module Network.AWS.APIGateway.UpdateMethodResponse
(
updateMethodResponse
, UpdateMethodResponse
, umPatchOperations
, umRestAPIId
, umResourceId
, umHttpMethod
, umStatusCode
, methodResponse
, MethodResponse
, mResponseModels
, mStatusCode
, mResponseParameters
) 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 UpdateMethodResponse = UpdateMethodResponse'
{ _umPatchOperations :: !(Maybe [PatchOperation])
, _umRestAPIId :: !Text
, _umResourceId :: !Text
, _umHttpMethod :: !Text
, _umStatusCode :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateMethodResponse
:: Text
-> Text
-> Text
-> Text
-> UpdateMethodResponse
updateMethodResponse pRestAPIId_ pResourceId_ pHttpMethod_ pStatusCode_ =
UpdateMethodResponse'
{ _umPatchOperations = Nothing
, _umRestAPIId = pRestAPIId_
, _umResourceId = pResourceId_
, _umHttpMethod = pHttpMethod_
, _umStatusCode = pStatusCode_
}
umPatchOperations :: Lens' UpdateMethodResponse [PatchOperation]
umPatchOperations = lens _umPatchOperations (\ s a -> s{_umPatchOperations = a}) . _Default . _Coerce;
umRestAPIId :: Lens' UpdateMethodResponse Text
umRestAPIId = lens _umRestAPIId (\ s a -> s{_umRestAPIId = a});
umResourceId :: Lens' UpdateMethodResponse Text
umResourceId = lens _umResourceId (\ s a -> s{_umResourceId = a});
umHttpMethod :: Lens' UpdateMethodResponse Text
umHttpMethod = lens _umHttpMethod (\ s a -> s{_umHttpMethod = a});
umStatusCode :: Lens' UpdateMethodResponse Text
umStatusCode = lens _umStatusCode (\ s a -> s{_umStatusCode = a});
instance AWSRequest UpdateMethodResponse where
type Rs UpdateMethodResponse = MethodResponse
request = patchJSON apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable UpdateMethodResponse where
instance NFData UpdateMethodResponse where
instance ToHeaders UpdateMethodResponse where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToJSON UpdateMethodResponse where
toJSON UpdateMethodResponse'{..}
= object
(catMaybes
[("patchOperations" .=) <$> _umPatchOperations])
instance ToPath UpdateMethodResponse where
toPath UpdateMethodResponse'{..}
= mconcat
["/restapis/", toBS _umRestAPIId, "/resources/",
toBS _umResourceId, "/methods/", toBS _umHttpMethod,
"/responses/", toBS _umStatusCode]
instance ToQuery UpdateMethodResponse where
toQuery = const mempty