module Network.AWS.APIGateway.GetExport
(
getExport
, GetExport
, geParameters
, geAccepts
, geRestAPIId
, geStageName
, geExportType
, getExportResponse
, GetExportResponse
, gersBody
, gersContentDisposition
, gersContentType
, gersResponseStatus
) 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 GetExport = GetExport'
{ _geParameters :: !(Maybe (Map Text Text))
, _geAccepts :: !(Maybe Text)
, _geRestAPIId :: !Text
, _geStageName :: !Text
, _geExportType :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getExport
:: Text
-> Text
-> Text
-> GetExport
getExport pRestAPIId_ pStageName_ pExportType_ =
GetExport'
{ _geParameters = Nothing
, _geAccepts = Nothing
, _geRestAPIId = pRestAPIId_
, _geStageName = pStageName_
, _geExportType = pExportType_
}
geParameters :: Lens' GetExport (HashMap Text Text)
geParameters = lens _geParameters (\ s a -> s{_geParameters = a}) . _Default . _Map;
geAccepts :: Lens' GetExport (Maybe Text)
geAccepts = lens _geAccepts (\ s a -> s{_geAccepts = a});
geRestAPIId :: Lens' GetExport Text
geRestAPIId = lens _geRestAPIId (\ s a -> s{_geRestAPIId = a});
geStageName :: Lens' GetExport Text
geStageName = lens _geStageName (\ s a -> s{_geStageName = a});
geExportType :: Lens' GetExport Text
geExportType = lens _geExportType (\ s a -> s{_geExportType = a});
instance AWSRequest GetExport where
type Rs GetExport = GetExportResponse
request = get apiGateway
response
= receiveJSON
(\ s h x ->
GetExportResponse' <$>
(pure (Just x)) <*> (h .#? "Content-Disposition") <*>
(h .#? "Content-Type")
<*> (pure (fromEnum s)))
instance Hashable GetExport
instance ToHeaders GetExport where
toHeaders GetExport'{..}
= mconcat
["Accept" =# _geAccepts,
"Accept" =# ("application/json" :: ByteString)]
instance ToPath GetExport where
toPath GetExport'{..}
= mconcat
["/restapis/", toBS _geRestAPIId, "/stages/",
toBS _geStageName, "/exports/", toBS _geExportType]
instance ToQuery GetExport where
toQuery GetExport'{..}
= mconcat
["parameters" =:
toQuery
(toQueryMap "entry" "key" "value" <$> _geParameters)]
data GetExportResponse = GetExportResponse'
{ _gersBody :: !(Maybe (HashMap Text Value))
, _gersContentDisposition :: !(Maybe Text)
, _gersContentType :: !(Maybe Text)
, _gersResponseStatus :: !Int
} deriving (Eq,Show,Data,Typeable,Generic)
getExportResponse
:: Int
-> GetExportResponse
getExportResponse pResponseStatus_ =
GetExportResponse'
{ _gersBody = Nothing
, _gersContentDisposition = Nothing
, _gersContentType = Nothing
, _gersResponseStatus = pResponseStatus_
}
gersBody :: Lens' GetExportResponse (Maybe (HashMap Text Value))
gersBody = lens _gersBody (\ s a -> s{_gersBody = a});
gersContentDisposition :: Lens' GetExportResponse (Maybe Text)
gersContentDisposition = lens _gersContentDisposition (\ s a -> s{_gersContentDisposition = a});
gersContentType :: Lens' GetExportResponse (Maybe Text)
gersContentType = lens _gersContentType (\ s a -> s{_gersContentType = a});
gersResponseStatus :: Lens' GetExportResponse Int
gersResponseStatus = lens _gersResponseStatus (\ s a -> s{_gersResponseStatus = a});