module Network.AWS.APIGateway.CreateDocumentationPart
(
createDocumentationPart
, CreateDocumentationPart
, cdpRestAPIId
, cdpLocation
, cdpProperties
, documentationPart
, DocumentationPart
, dpLocation
, dpId
, dpProperties
) where
import Network.AWS.APIGateway.Types
import Network.AWS.APIGateway.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data CreateDocumentationPart = CreateDocumentationPart'
{ _cdpRestAPIId :: !Text
, _cdpLocation :: !DocumentationPartLocation
, _cdpProperties :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createDocumentationPart
:: Text
-> DocumentationPartLocation
-> Text
-> CreateDocumentationPart
createDocumentationPart pRestAPIId_ pLocation_ pProperties_ =
CreateDocumentationPart'
{ _cdpRestAPIId = pRestAPIId_
, _cdpLocation = pLocation_
, _cdpProperties = pProperties_
}
cdpRestAPIId :: Lens' CreateDocumentationPart Text
cdpRestAPIId = lens _cdpRestAPIId (\ s a -> s{_cdpRestAPIId = a});
cdpLocation :: Lens' CreateDocumentationPart DocumentationPartLocation
cdpLocation = lens _cdpLocation (\ s a -> s{_cdpLocation = a});
cdpProperties :: Lens' CreateDocumentationPart Text
cdpProperties = lens _cdpProperties (\ s a -> s{_cdpProperties = a});
instance AWSRequest CreateDocumentationPart where
type Rs CreateDocumentationPart = DocumentationPart
request = postJSON apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable CreateDocumentationPart where
instance NFData CreateDocumentationPart where
instance ToHeaders CreateDocumentationPart where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToJSON CreateDocumentationPart where
toJSON CreateDocumentationPart'{..}
= object
(catMaybes
[Just ("location" .= _cdpLocation),
Just ("properties" .= _cdpProperties)])
instance ToPath CreateDocumentationPart where
toPath CreateDocumentationPart'{..}
= mconcat
["/restapis/", toBS _cdpRestAPIId,
"/documentation/parts"]
instance ToQuery CreateDocumentationPart where
toQuery = const mempty