module Network.AWS.APIGateway.UpdateMethod
(
updateMethod
, UpdateMethod
, ummPatchOperations
, ummRestAPIId
, ummResourceId
, ummHttpMethod
, method
, Method
, mMethodResponses
, mHttpMethod
, mRequestModels
, mRequestParameters
, mAuthorizerId
, mAuthorizationType
, mApiKeyRequired
, mMethodIntegration
) 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 UpdateMethod = UpdateMethod'
{ _ummPatchOperations :: !(Maybe [PatchOperation])
, _ummRestAPIId :: !Text
, _ummResourceId :: !Text
, _ummHttpMethod :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateMethod
:: Text
-> Text
-> Text
-> UpdateMethod
updateMethod pRestAPIId_ pResourceId_ pHttpMethod_ =
UpdateMethod'
{ _ummPatchOperations = Nothing
, _ummRestAPIId = pRestAPIId_
, _ummResourceId = pResourceId_
, _ummHttpMethod = pHttpMethod_
}
ummPatchOperations :: Lens' UpdateMethod [PatchOperation]
ummPatchOperations = lens _ummPatchOperations (\ s a -> s{_ummPatchOperations = a}) . _Default . _Coerce;
ummRestAPIId :: Lens' UpdateMethod Text
ummRestAPIId = lens _ummRestAPIId (\ s a -> s{_ummRestAPIId = a});
ummResourceId :: Lens' UpdateMethod Text
ummResourceId = lens _ummResourceId (\ s a -> s{_ummResourceId = a});
ummHttpMethod :: Lens' UpdateMethod Text
ummHttpMethod = lens _ummHttpMethod (\ s a -> s{_ummHttpMethod = a});
instance AWSRequest UpdateMethod where
type Rs UpdateMethod = Method
request = patchJSON apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable UpdateMethod
instance ToHeaders UpdateMethod where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToJSON UpdateMethod where
toJSON UpdateMethod'{..}
= object
(catMaybes
[("patchOperations" .=) <$> _ummPatchOperations])
instance ToPath UpdateMethod where
toPath UpdateMethod'{..}
= mconcat
["/restapis/", toBS _ummRestAPIId, "/resources/",
toBS _ummResourceId, "/methods/",
toBS _ummHttpMethod]
instance ToQuery UpdateMethod where
toQuery = const mempty