{-# 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.UpdateGatewayResponse
(
updateGatewayResponse
, UpdateGatewayResponse
, ugPatchOperations
, ugRestAPIId
, ugResponseType
, gatewayResponse
, GatewayResponse
, gDefaultResponse
, gResponseTemplates
, gResponseType
, gStatusCode
, gResponseParameters
) 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 UpdateGatewayResponse = UpdateGatewayResponse'
{ _ugPatchOperations :: !(Maybe [PatchOperation])
, _ugRestAPIId :: !Text
, _ugResponseType :: !GatewayResponseType
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateGatewayResponse
:: Text
-> GatewayResponseType
-> UpdateGatewayResponse
updateGatewayResponse pRestAPIId_ pResponseType_ =
UpdateGatewayResponse'
{ _ugPatchOperations = Nothing
, _ugRestAPIId = pRestAPIId_
, _ugResponseType = pResponseType_
}
ugPatchOperations :: Lens' UpdateGatewayResponse [PatchOperation]
ugPatchOperations = lens _ugPatchOperations (\ s a -> s{_ugPatchOperations = a}) . _Default . _Coerce
ugRestAPIId :: Lens' UpdateGatewayResponse Text
ugRestAPIId = lens _ugRestAPIId (\ s a -> s{_ugRestAPIId = a})
ugResponseType :: Lens' UpdateGatewayResponse GatewayResponseType
ugResponseType = lens _ugResponseType (\ s a -> s{_ugResponseType = a})
instance AWSRequest UpdateGatewayResponse where
type Rs UpdateGatewayResponse = GatewayResponse
request = patchJSON apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable UpdateGatewayResponse where
instance NFData UpdateGatewayResponse where
instance ToHeaders UpdateGatewayResponse where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToJSON UpdateGatewayResponse where
toJSON UpdateGatewayResponse'{..}
= object
(catMaybes
[("patchOperations" .=) <$> _ugPatchOperations])
instance ToPath UpdateGatewayResponse where
toPath UpdateGatewayResponse'{..}
= mconcat
["/restapis/", toBS _ugRestAPIId,
"/gatewayresponses/", toBS _ugResponseType]
instance ToQuery UpdateGatewayResponse where
toQuery = const mempty