module Network.AWS.APIGateway.UpdateRestAPI
(
updateRestAPI
, UpdateRestAPI
, uraPatchOperations
, uraRestAPIId
, restAPI
, RestAPI
, raCreatedDate
, raName
, raId
, raDescription
) 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 UpdateRestAPI = UpdateRestAPI'
{ _uraPatchOperations :: !(Maybe [PatchOperation])
, _uraRestAPIId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateRestAPI
:: Text
-> UpdateRestAPI
updateRestAPI pRestAPIId_ =
UpdateRestAPI'
{ _uraPatchOperations = Nothing
, _uraRestAPIId = pRestAPIId_
}
uraPatchOperations :: Lens' UpdateRestAPI [PatchOperation]
uraPatchOperations = lens _uraPatchOperations (\ s a -> s{_uraPatchOperations = a}) . _Default . _Coerce;
uraRestAPIId :: Lens' UpdateRestAPI Text
uraRestAPIId = lens _uraRestAPIId (\ s a -> s{_uraRestAPIId = a});
instance AWSRequest UpdateRestAPI where
type Rs UpdateRestAPI = RestAPI
request = patchJSON apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable UpdateRestAPI
instance ToHeaders UpdateRestAPI where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToJSON UpdateRestAPI where
toJSON UpdateRestAPI'{..}
= object
(catMaybes
[("patchOperations" .=) <$> _uraPatchOperations])
instance ToPath UpdateRestAPI where
toPath UpdateRestAPI'{..}
= mconcat ["/restapis/", toBS _uraRestAPIId]
instance ToQuery UpdateRestAPI where
toQuery = const mempty