{-# 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.UpdateDeployment
(
updateDeployment
, UpdateDeployment
, udPatchOperations
, udRestAPIId
, udDeploymentId
, deployment
, Deployment
, dApiSummary
, dCreatedDate
, dId
, dDescription
) 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 UpdateDeployment = UpdateDeployment'
{ _udPatchOperations :: !(Maybe [PatchOperation])
, _udRestAPIId :: !Text
, _udDeploymentId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateDeployment
:: Text
-> Text
-> UpdateDeployment
updateDeployment pRestAPIId_ pDeploymentId_ =
UpdateDeployment'
{ _udPatchOperations = Nothing
, _udRestAPIId = pRestAPIId_
, _udDeploymentId = pDeploymentId_
}
udPatchOperations :: Lens' UpdateDeployment [PatchOperation]
udPatchOperations = lens _udPatchOperations (\ s a -> s{_udPatchOperations = a}) . _Default . _Coerce;
udRestAPIId :: Lens' UpdateDeployment Text
udRestAPIId = lens _udRestAPIId (\ s a -> s{_udRestAPIId = a});
udDeploymentId :: Lens' UpdateDeployment Text
udDeploymentId = lens _udDeploymentId (\ s a -> s{_udDeploymentId = a});
instance AWSRequest UpdateDeployment where
type Rs UpdateDeployment = Deployment
request = patchJSON apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable UpdateDeployment
instance NFData UpdateDeployment
instance ToHeaders UpdateDeployment where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToJSON UpdateDeployment where
toJSON UpdateDeployment'{..}
= object
(catMaybes
[("patchOperations" .=) <$> _udPatchOperations])
instance ToPath UpdateDeployment where
toPath UpdateDeployment'{..}
= mconcat
["/restapis/", toBS _udRestAPIId, "/deployments/",
toBS _udDeploymentId]
instance ToQuery UpdateDeployment where
toQuery = const mempty