{-# 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.UpdateIntegrationResponse
(
updateIntegrationResponse
, UpdateIntegrationResponse
, uiPatchOperations
, uiRestAPIId
, uiResourceId
, uiHttpMethod
, uiStatusCode
, integrationResponse
, IntegrationResponse
, intContentHandling
, intResponseTemplates
, intSelectionPattern
, intStatusCode
, intResponseParameters
) 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 UpdateIntegrationResponse = UpdateIntegrationResponse'
{ _uiPatchOperations :: !(Maybe [PatchOperation])
, _uiRestAPIId :: !Text
, _uiResourceId :: !Text
, _uiHttpMethod :: !Text
, _uiStatusCode :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateIntegrationResponse
:: Text
-> Text
-> Text
-> Text
-> UpdateIntegrationResponse
updateIntegrationResponse pRestAPIId_ pResourceId_ pHttpMethod_ pStatusCode_ =
UpdateIntegrationResponse'
{ _uiPatchOperations = Nothing
, _uiRestAPIId = pRestAPIId_
, _uiResourceId = pResourceId_
, _uiHttpMethod = pHttpMethod_
, _uiStatusCode = pStatusCode_
}
uiPatchOperations :: Lens' UpdateIntegrationResponse [PatchOperation]
uiPatchOperations = lens _uiPatchOperations (\ s a -> s{_uiPatchOperations = a}) . _Default . _Coerce;
uiRestAPIId :: Lens' UpdateIntegrationResponse Text
uiRestAPIId = lens _uiRestAPIId (\ s a -> s{_uiRestAPIId = a});
uiResourceId :: Lens' UpdateIntegrationResponse Text
uiResourceId = lens _uiResourceId (\ s a -> s{_uiResourceId = a});
uiHttpMethod :: Lens' UpdateIntegrationResponse Text
uiHttpMethod = lens _uiHttpMethod (\ s a -> s{_uiHttpMethod = a});
uiStatusCode :: Lens' UpdateIntegrationResponse Text
uiStatusCode = lens _uiStatusCode (\ s a -> s{_uiStatusCode = a});
instance AWSRequest UpdateIntegrationResponse where
type Rs UpdateIntegrationResponse =
IntegrationResponse
request = patchJSON apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable UpdateIntegrationResponse
instance NFData UpdateIntegrationResponse
instance ToHeaders UpdateIntegrationResponse where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToJSON UpdateIntegrationResponse where
toJSON UpdateIntegrationResponse'{..}
= object
(catMaybes
[("patchOperations" .=) <$> _uiPatchOperations])
instance ToPath UpdateIntegrationResponse where
toPath UpdateIntegrationResponse'{..}
= mconcat
["/restapis/", toBS _uiRestAPIId, "/resources/",
toBS _uiResourceId, "/methods/", toBS _uiHttpMethod,
"/integration/responses/", toBS _uiStatusCode]
instance ToQuery UpdateIntegrationResponse where
toQuery = const mempty