module Network.AWS.APIGateway.CreateDocumentationVersion
(
createDocumentationVersion
, CreateDocumentationVersion
, cdvStageName
, cdvDescription
, cdvRestAPIId
, cdvDocumentationVersion
, documentationVersion
, DocumentationVersion
, dvCreatedDate
, dvVersion
, dvDescription
) 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 CreateDocumentationVersion = CreateDocumentationVersion'
{ _cdvStageName :: !(Maybe Text)
, _cdvDescription :: !(Maybe Text)
, _cdvRestAPIId :: !Text
, _cdvDocumentationVersion :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createDocumentationVersion
:: Text
-> Text
-> CreateDocumentationVersion
createDocumentationVersion pRestAPIId_ pDocumentationVersion_ =
CreateDocumentationVersion'
{ _cdvStageName = Nothing
, _cdvDescription = Nothing
, _cdvRestAPIId = pRestAPIId_
, _cdvDocumentationVersion = pDocumentationVersion_
}
cdvStageName :: Lens' CreateDocumentationVersion (Maybe Text)
cdvStageName = lens _cdvStageName (\ s a -> s{_cdvStageName = a});
cdvDescription :: Lens' CreateDocumentationVersion (Maybe Text)
cdvDescription = lens _cdvDescription (\ s a -> s{_cdvDescription = a});
cdvRestAPIId :: Lens' CreateDocumentationVersion Text
cdvRestAPIId = lens _cdvRestAPIId (\ s a -> s{_cdvRestAPIId = a});
cdvDocumentationVersion :: Lens' CreateDocumentationVersion Text
cdvDocumentationVersion = lens _cdvDocumentationVersion (\ s a -> s{_cdvDocumentationVersion = a});
instance AWSRequest CreateDocumentationVersion where
type Rs CreateDocumentationVersion =
DocumentationVersion
request = postJSON apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable CreateDocumentationVersion where
instance NFData CreateDocumentationVersion where
instance ToHeaders CreateDocumentationVersion where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToJSON CreateDocumentationVersion where
toJSON CreateDocumentationVersion'{..}
= object
(catMaybes
[("stageName" .=) <$> _cdvStageName,
("description" .=) <$> _cdvDescription,
Just
("documentationVersion" .=
_cdvDocumentationVersion)])
instance ToPath CreateDocumentationVersion where
toPath CreateDocumentationVersion'{..}
= mconcat
["/restapis/", toBS _cdvRestAPIId,
"/documentation/versions"]
instance ToQuery CreateDocumentationVersion where
toQuery = const mempty