module Network.AWS.APIGateway.GetDocumentationVersions
(
getDocumentationVersions
, GetDocumentationVersions
, gdvLimit
, gdvPosition
, gdvRestAPIId
, getDocumentationVersionsResponse
, GetDocumentationVersionsResponse
, gdvrsItems
, gdvrsPosition
, gdvrsResponseStatus
) 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 GetDocumentationVersions = GetDocumentationVersions'
{ _gdvLimit :: !(Maybe Int)
, _gdvPosition :: !(Maybe Text)
, _gdvRestAPIId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getDocumentationVersions
:: Text
-> GetDocumentationVersions
getDocumentationVersions pRestAPIId_ =
GetDocumentationVersions'
{_gdvLimit = Nothing, _gdvPosition = Nothing, _gdvRestAPIId = pRestAPIId_}
gdvLimit :: Lens' GetDocumentationVersions (Maybe Int)
gdvLimit = lens _gdvLimit (\ s a -> s{_gdvLimit = a});
gdvPosition :: Lens' GetDocumentationVersions (Maybe Text)
gdvPosition = lens _gdvPosition (\ s a -> s{_gdvPosition = a});
gdvRestAPIId :: Lens' GetDocumentationVersions Text
gdvRestAPIId = lens _gdvRestAPIId (\ s a -> s{_gdvRestAPIId = a});
instance AWSRequest GetDocumentationVersions where
type Rs GetDocumentationVersions =
GetDocumentationVersionsResponse
request = get apiGateway
response
= receiveJSON
(\ s h x ->
GetDocumentationVersionsResponse' <$>
(x .?> "item" .!@ mempty) <*> (x .?> "position") <*>
(pure (fromEnum s)))
instance Hashable GetDocumentationVersions where
instance NFData GetDocumentationVersions where
instance ToHeaders GetDocumentationVersions where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToPath GetDocumentationVersions where
toPath GetDocumentationVersions'{..}
= mconcat
["/restapis/", toBS _gdvRestAPIId,
"/documentation/versions"]
instance ToQuery GetDocumentationVersions where
toQuery GetDocumentationVersions'{..}
= mconcat
["limit" =: _gdvLimit, "position" =: _gdvPosition]
data GetDocumentationVersionsResponse = GetDocumentationVersionsResponse'
{ _gdvrsItems :: !(Maybe [DocumentationVersion])
, _gdvrsPosition :: !(Maybe Text)
, _gdvrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getDocumentationVersionsResponse
:: Int
-> GetDocumentationVersionsResponse
getDocumentationVersionsResponse pResponseStatus_ =
GetDocumentationVersionsResponse'
{ _gdvrsItems = Nothing
, _gdvrsPosition = Nothing
, _gdvrsResponseStatus = pResponseStatus_
}
gdvrsItems :: Lens' GetDocumentationVersionsResponse [DocumentationVersion]
gdvrsItems = lens _gdvrsItems (\ s a -> s{_gdvrsItems = a}) . _Default . _Coerce;
gdvrsPosition :: Lens' GetDocumentationVersionsResponse (Maybe Text)
gdvrsPosition = lens _gdvrsPosition (\ s a -> s{_gdvrsPosition = a});
gdvrsResponseStatus :: Lens' GetDocumentationVersionsResponse Int
gdvrsResponseStatus = lens _gdvrsResponseStatus (\ s a -> s{_gdvrsResponseStatus = a});
instance NFData GetDocumentationVersionsResponse
where