module Network.AWS.APIGateway.UpdateRequestValidator
(
updateRequestValidator
, UpdateRequestValidator
, urvPatchOperations
, urvRestAPIId
, urvRequestValidatorId
, requestValidator
, RequestValidator
, rvValidateRequestParameters
, rvName
, rvValidateRequestBody
, rvId
) 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 UpdateRequestValidator = UpdateRequestValidator'
{ _urvPatchOperations :: !(Maybe [PatchOperation])
, _urvRestAPIId :: !Text
, _urvRequestValidatorId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateRequestValidator
:: Text
-> Text
-> UpdateRequestValidator
updateRequestValidator pRestAPIId_ pRequestValidatorId_ =
UpdateRequestValidator'
{ _urvPatchOperations = Nothing
, _urvRestAPIId = pRestAPIId_
, _urvRequestValidatorId = pRequestValidatorId_
}
urvPatchOperations :: Lens' UpdateRequestValidator [PatchOperation]
urvPatchOperations = lens _urvPatchOperations (\ s a -> s{_urvPatchOperations = a}) . _Default . _Coerce;
urvRestAPIId :: Lens' UpdateRequestValidator Text
urvRestAPIId = lens _urvRestAPIId (\ s a -> s{_urvRestAPIId = a});
urvRequestValidatorId :: Lens' UpdateRequestValidator Text
urvRequestValidatorId = lens _urvRequestValidatorId (\ s a -> s{_urvRequestValidatorId = a});
instance AWSRequest UpdateRequestValidator where
type Rs UpdateRequestValidator = RequestValidator
request = patchJSON apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable UpdateRequestValidator where
instance NFData UpdateRequestValidator where
instance ToHeaders UpdateRequestValidator where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToJSON UpdateRequestValidator where
toJSON UpdateRequestValidator'{..}
= object
(catMaybes
[("patchOperations" .=) <$> _urvPatchOperations])
instance ToPath UpdateRequestValidator where
toPath UpdateRequestValidator'{..}
= mconcat
["/restapis/", toBS _urvRestAPIId,
"/requestvalidators/", toBS _urvRequestValidatorId]
instance ToQuery UpdateRequestValidator where
toQuery = const mempty