{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.APIGateway.GetSDK
(
getSDK
, GetSDK
, gsdkParameters
, gsdkRestAPIId
, gsdkStageName
, gsdkSdkType
, getSDKResponse
, GetSDKResponse
, gsdkrsBody
, gsdkrsContentDisposition
, gsdkrsContentType
, gsdkrsResponseStatus
) 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 GetSDK = GetSDK'
{ _gsdkParameters :: !(Maybe (Map Text Text))
, _gsdkRestAPIId :: !Text
, _gsdkStageName :: !Text
, _gsdkSdkType :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getSDK
:: Text
-> Text
-> Text
-> GetSDK
getSDK pRestAPIId_ pStageName_ pSdkType_ =
GetSDK'
{ _gsdkParameters = Nothing
, _gsdkRestAPIId = pRestAPIId_
, _gsdkStageName = pStageName_
, _gsdkSdkType = pSdkType_
}
gsdkParameters :: Lens' GetSDK (HashMap Text Text)
gsdkParameters = lens _gsdkParameters (\ s a -> s{_gsdkParameters = a}) . _Default . _Map;
gsdkRestAPIId :: Lens' GetSDK Text
gsdkRestAPIId = lens _gsdkRestAPIId (\ s a -> s{_gsdkRestAPIId = a});
gsdkStageName :: Lens' GetSDK Text
gsdkStageName = lens _gsdkStageName (\ s a -> s{_gsdkStageName = a});
gsdkSdkType :: Lens' GetSDK Text
gsdkSdkType = lens _gsdkSdkType (\ s a -> s{_gsdkSdkType = a});
instance AWSRequest GetSDK where
type Rs GetSDK = GetSDKResponse
request = get apiGateway
response
= receiveJSON
(\ s h x ->
GetSDKResponse' <$>
(pure (Just x)) <*> (h .#? "Content-Disposition") <*>
(h .#? "Content-Type")
<*> (pure (fromEnum s)))
instance Hashable GetSDK
instance NFData GetSDK
instance ToHeaders GetSDK where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToPath GetSDK where
toPath GetSDK'{..}
= mconcat
["/restapis/", toBS _gsdkRestAPIId, "/stages/",
toBS _gsdkStageName, "/sdks/", toBS _gsdkSdkType]
instance ToQuery GetSDK where
toQuery GetSDK'{..}
= mconcat
["parameters" =:
toQuery
(toQueryMap "entry" "key" "value" <$>
_gsdkParameters)]
data GetSDKResponse = GetSDKResponse'
{ _gsdkrsBody :: !(Maybe (HashMap Text Value))
, _gsdkrsContentDisposition :: !(Maybe Text)
, _gsdkrsContentType :: !(Maybe Text)
, _gsdkrsResponseStatus :: !Int
} deriving (Eq,Show,Data,Typeable,Generic)
getSDKResponse
:: Int
-> GetSDKResponse
getSDKResponse pResponseStatus_ =
GetSDKResponse'
{ _gsdkrsBody = Nothing
, _gsdkrsContentDisposition = Nothing
, _gsdkrsContentType = Nothing
, _gsdkrsResponseStatus = pResponseStatus_
}
gsdkrsBody :: Lens' GetSDKResponse (Maybe (HashMap Text Value))
gsdkrsBody = lens _gsdkrsBody (\ s a -> s{_gsdkrsBody = a});
gsdkrsContentDisposition :: Lens' GetSDKResponse (Maybe Text)
gsdkrsContentDisposition = lens _gsdkrsContentDisposition (\ s a -> s{_gsdkrsContentDisposition = a});
gsdkrsContentType :: Lens' GetSDKResponse (Maybe Text)
gsdkrsContentType = lens _gsdkrsContentType (\ s a -> s{_gsdkrsContentType = a});
gsdkrsResponseStatus :: Lens' GetSDKResponse Int
gsdkrsResponseStatus = lens _gsdkrsResponseStatus (\ s a -> s{_gsdkrsResponseStatus = a});
instance NFData GetSDKResponse