module Network.AWS.APIGateway.UpdateAuthorizer
(
updateAuthorizer
, UpdateAuthorizer
, uaaPatchOperations
, uaaRestAPIId
, uaaAuthorizerId
, authorizer
, Authorizer
, aAuthorizerURI
, aIdentityValidationExpression
, aName
, aId
, aAuthorizerResultTtlInSeconds
, aType
, aIdentitySource
, aAuthorizerCredentials
) 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 UpdateAuthorizer = UpdateAuthorizer'
{ _uaaPatchOperations :: !(Maybe [PatchOperation])
, _uaaRestAPIId :: !Text
, _uaaAuthorizerId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateAuthorizer
:: Text
-> Text
-> UpdateAuthorizer
updateAuthorizer pRestAPIId_ pAuthorizerId_ =
UpdateAuthorizer'
{ _uaaPatchOperations = Nothing
, _uaaRestAPIId = pRestAPIId_
, _uaaAuthorizerId = pAuthorizerId_
}
uaaPatchOperations :: Lens' UpdateAuthorizer [PatchOperation]
uaaPatchOperations = lens _uaaPatchOperations (\ s a -> s{_uaaPatchOperations = a}) . _Default . _Coerce;
uaaRestAPIId :: Lens' UpdateAuthorizer Text
uaaRestAPIId = lens _uaaRestAPIId (\ s a -> s{_uaaRestAPIId = a});
uaaAuthorizerId :: Lens' UpdateAuthorizer Text
uaaAuthorizerId = lens _uaaAuthorizerId (\ s a -> s{_uaaAuthorizerId = a});
instance AWSRequest UpdateAuthorizer where
type Rs UpdateAuthorizer = Authorizer
request = patchJSON apiGateway
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable UpdateAuthorizer
instance ToHeaders UpdateAuthorizer where
toHeaders
= const
(mconcat
["Accept" =# ("application/json" :: ByteString)])
instance ToJSON UpdateAuthorizer where
toJSON UpdateAuthorizer'{..}
= object
(catMaybes
[("patchOperations" .=) <$> _uaaPatchOperations])
instance ToPath UpdateAuthorizer where
toPath UpdateAuthorizer'{..}
= mconcat
["/restapis/", toBS _uaaRestAPIId, "/authorizers/",
toBS _uaaAuthorizerId]
instance ToQuery UpdateAuthorizer where
toQuery = const mempty