{-# 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.UpdateIntegration
(
updateIntegration
, UpdateIntegration
, updPatchOperations
, updRestAPIId
, updResourceId
, updHttpMethod
, integration
, Integration
, iHttpMethod
, iRequestTemplates
, iCredentials
, iRequestParameters
, iContentHandling
, iPassthroughBehavior
, iUri
, iIntegrationResponses
, iCacheNamespace
, iType
, iCacheKeyParameters
) 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 UpdateIntegration = UpdateIntegration'
{ _updPatchOperations :: !(Maybe [PatchOperation])
, _updRestAPIId :: !Text
, _updResourceId :: !Text
, _updHttpMethod :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateIntegration
:: Text
-> Text
-> Text
-> UpdateIntegration
updateIntegration pRestAPIId_ pResourceId_ pHttpMethod_ =
UpdateIntegration'
{ _updPatchOperations = Nothing
, _updRestAPIId = pRestAPIId_
, _updResourceId = pResourceId_
, _updHttpMethod = pHttpMethod_
}
updPatchOperations :: Lens' UpdateIntegration [PatchOperation]
updPatchOperations = lens _updPatchOperations (\ s a -> s{_updPatchOperations = a}) . _Default . _Coerce;
updRestAPIId :: Lens' UpdateIntegration Text
updRestAPIId = lens _updRestAPIId (\ s a -> s{_updRestAPIId = a});
updResourceId :: Lens' UpdateIntegration Text
updResourceId = lens _updResourceId (\ s a -> s{_updResourceId = a});
updHttpMethod :: Lens' UpdateIntegration Text
updHttpMethod = lens _updHttpMethod (\ s a -> s{_updHttpMethod = a});
instance AWSRequest UpdateIntegration where
type Rs UpdateIntegration = Integration
request = patchJSON apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable UpdateIntegration
instance NFData UpdateIntegration
instance ToHeaders UpdateIntegration where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToJSON UpdateIntegration where
toJSON UpdateIntegration'{..}
= object
(catMaybes
[("patchOperations" .=) <$> _updPatchOperations])
instance ToPath UpdateIntegration where
toPath UpdateIntegration'{..}
= mconcat
["/restapis/", toBS _updRestAPIId, "/resources/",
toBS _updResourceId, "/methods/",
toBS _updHttpMethod, "/integration"]
instance ToQuery UpdateIntegration where
toQuery = const mempty