{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ApiGatewayV2.UpdateAuthorizer
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates an Authorizer.
module Amazonka.ApiGatewayV2.UpdateAuthorizer
  ( -- * Creating a Request
    UpdateAuthorizer (..),
    newUpdateAuthorizer,

    -- * Request Lenses
    updateAuthorizer_authorizerCredentialsArn,
    updateAuthorizer_identityValidationExpression,
    updateAuthorizer_enableSimpleResponses,
    updateAuthorizer_authorizerUri,
    updateAuthorizer_authorizerPayloadFormatVersion,
    updateAuthorizer_jwtConfiguration,
    updateAuthorizer_name,
    updateAuthorizer_authorizerResultTtlInSeconds,
    updateAuthorizer_identitySource,
    updateAuthorizer_authorizerType,
    updateAuthorizer_authorizerId,
    updateAuthorizer_apiId,

    -- * Destructuring the Response
    UpdateAuthorizerResponse (..),
    newUpdateAuthorizerResponse,

    -- * Response Lenses
    updateAuthorizerResponse_authorizerCredentialsArn,
    updateAuthorizerResponse_identityValidationExpression,
    updateAuthorizerResponse_enableSimpleResponses,
    updateAuthorizerResponse_authorizerUri,
    updateAuthorizerResponse_authorizerPayloadFormatVersion,
    updateAuthorizerResponse_jwtConfiguration,
    updateAuthorizerResponse_authorizerId,
    updateAuthorizerResponse_name,
    updateAuthorizerResponse_authorizerResultTtlInSeconds,
    updateAuthorizerResponse_identitySource,
    updateAuthorizerResponse_authorizerType,
    updateAuthorizerResponse_httpStatus,
  )
where

import Amazonka.ApiGatewayV2.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Updates an Authorizer.
--
-- /See:/ 'newUpdateAuthorizer' smart constructor.
data UpdateAuthorizer = UpdateAuthorizer'
  { -- | Specifies the required credentials as an IAM role for API Gateway to
    -- invoke the authorizer. To specify an IAM role for API Gateway to assume,
    -- use the role\'s Amazon Resource Name (ARN). To use resource-based
    -- permissions on the Lambda function, don\'t specify this parameter.
    UpdateAuthorizer -> Maybe Text
authorizerCredentialsArn :: Prelude.Maybe Prelude.Text,
    -- | This parameter is not used.
    UpdateAuthorizer -> Maybe Text
identityValidationExpression :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether a Lambda authorizer returns a response in a simple
    -- format. By default, a Lambda authorizer must return an IAM policy. If
    -- enabled, the Lambda authorizer can return a boolean value instead of an
    -- IAM policy. Supported only for HTTP APIs. To learn more, see
    -- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html Working with AWS Lambda authorizers for HTTP APIs>
    UpdateAuthorizer -> Maybe Bool
enableSimpleResponses :: Prelude.Maybe Prelude.Bool,
    -- | The authorizer\'s Uniform Resource Identifier (URI). For REQUEST
    -- authorizers, this must be a well-formed Lambda function URI, for
    -- example,
    -- arn:aws:apigateway:us-west-2:lambda:path\/2015-03-31\/functions\/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}\/invocations.
    -- In general, the URI has this form:
    -- arn:aws:apigateway:{region}:lambda:path\/{service_api} , where {region}
    -- is the same as the region hosting the Lambda function, path indicates
    -- that the remaining substring in the URI should be treated as the path to
    -- the resource, including the initial \/. For Lambda functions, this is
    -- usually of the form \/2015-03-31\/functions\/[FunctionARN]\/invocations.
    -- Supported only for REQUEST authorizers.
    UpdateAuthorizer -> Maybe Text
authorizerUri :: Prelude.Maybe Prelude.Text,
    -- | Specifies the format of the payload sent to an HTTP API Lambda
    -- authorizer. Required for HTTP API Lambda authorizers. Supported values
    -- are 1.0 and 2.0. To learn more, see
    -- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html Working with AWS Lambda authorizers for HTTP APIs>.
    UpdateAuthorizer -> Maybe Text
authorizerPayloadFormatVersion :: Prelude.Maybe Prelude.Text,
    -- | Represents the configuration of a JWT authorizer. Required for the JWT
    -- authorizer type. Supported only for HTTP APIs.
    UpdateAuthorizer -> Maybe JWTConfiguration
jwtConfiguration :: Prelude.Maybe JWTConfiguration,
    -- | The name of the authorizer.
    UpdateAuthorizer -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The time to live (TTL) for cached authorizer results, in seconds. If it
    -- equals 0, authorization caching is disabled. If it is greater than 0,
    -- API Gateway caches authorizer responses. The maximum value is 3600, or 1
    -- hour. Supported only for HTTP API Lambda authorizers.
    UpdateAuthorizer -> Maybe Natural
authorizerResultTtlInSeconds :: Prelude.Maybe Prelude.Natural,
    -- | The identity source for which authorization is requested.
    --
    -- For a REQUEST authorizer, this is optional. The value is a set of one or
    -- more mapping expressions of the specified request parameters. The
    -- identity source can be headers, query string parameters, stage
    -- variables, and context parameters. For example, if an Auth header and a
    -- Name query string parameter are defined as identity sources, this value
    -- is route.request.header.Auth, route.request.querystring.Name for
    -- WebSocket APIs. For HTTP APIs, use selection expressions prefixed with
    -- \$, for example, $request.header.Auth, $request.querystring.Name. These
    -- parameters are used to perform runtime validation for Lambda-based
    -- authorizers by verifying all of the identity-related request parameters
    -- are present in the request, not null, and non-empty. Only when this is
    -- true does the authorizer invoke the authorizer Lambda function.
    -- Otherwise, it returns a 401 Unauthorized response without calling the
    -- Lambda function. For HTTP APIs, identity sources are also used as the
    -- cache key when caching is enabled. To learn more, see
    -- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html Working with AWS Lambda authorizers for HTTP APIs>.
    --
    -- For JWT, a single entry that specifies where to extract the JSON Web
    -- Token (JWT) from inbound requests. Currently only header-based and query
    -- parameter-based selections are supported, for example
    -- \$request.header.Authorization.
    UpdateAuthorizer -> Maybe [Text]
identitySource :: Prelude.Maybe [Prelude.Text],
    -- | The authorizer type. Specify REQUEST for a Lambda function using
    -- incoming request parameters. Specify JWT to use JSON Web Tokens
    -- (supported only for HTTP APIs).
    UpdateAuthorizer -> Maybe AuthorizerType
authorizerType :: Prelude.Maybe AuthorizerType,
    -- | The authorizer identifier.
    UpdateAuthorizer -> Text
authorizerId :: Prelude.Text,
    -- | The API identifier.
    UpdateAuthorizer -> Text
apiId :: Prelude.Text
  }
  deriving (UpdateAuthorizer -> UpdateAuthorizer -> Bool
(UpdateAuthorizer -> UpdateAuthorizer -> Bool)
-> (UpdateAuthorizer -> UpdateAuthorizer -> Bool)
-> Eq UpdateAuthorizer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAuthorizer -> UpdateAuthorizer -> Bool
$c/= :: UpdateAuthorizer -> UpdateAuthorizer -> Bool
== :: UpdateAuthorizer -> UpdateAuthorizer -> Bool
$c== :: UpdateAuthorizer -> UpdateAuthorizer -> Bool
Prelude.Eq, ReadPrec [UpdateAuthorizer]
ReadPrec UpdateAuthorizer
Int -> ReadS UpdateAuthorizer
ReadS [UpdateAuthorizer]
(Int -> ReadS UpdateAuthorizer)
-> ReadS [UpdateAuthorizer]
-> ReadPrec UpdateAuthorizer
-> ReadPrec [UpdateAuthorizer]
-> Read UpdateAuthorizer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAuthorizer]
$creadListPrec :: ReadPrec [UpdateAuthorizer]
readPrec :: ReadPrec UpdateAuthorizer
$creadPrec :: ReadPrec UpdateAuthorizer
readList :: ReadS [UpdateAuthorizer]
$creadList :: ReadS [UpdateAuthorizer]
readsPrec :: Int -> ReadS UpdateAuthorizer
$creadsPrec :: Int -> ReadS UpdateAuthorizer
Prelude.Read, Int -> UpdateAuthorizer -> ShowS
[UpdateAuthorizer] -> ShowS
UpdateAuthorizer -> String
(Int -> UpdateAuthorizer -> ShowS)
-> (UpdateAuthorizer -> String)
-> ([UpdateAuthorizer] -> ShowS)
-> Show UpdateAuthorizer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAuthorizer] -> ShowS
$cshowList :: [UpdateAuthorizer] -> ShowS
show :: UpdateAuthorizer -> String
$cshow :: UpdateAuthorizer -> String
showsPrec :: Int -> UpdateAuthorizer -> ShowS
$cshowsPrec :: Int -> UpdateAuthorizer -> ShowS
Prelude.Show, (forall x. UpdateAuthorizer -> Rep UpdateAuthorizer x)
-> (forall x. Rep UpdateAuthorizer x -> UpdateAuthorizer)
-> Generic UpdateAuthorizer
forall x. Rep UpdateAuthorizer x -> UpdateAuthorizer
forall x. UpdateAuthorizer -> Rep UpdateAuthorizer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAuthorizer x -> UpdateAuthorizer
$cfrom :: forall x. UpdateAuthorizer -> Rep UpdateAuthorizer x
Prelude.Generic)

-- |
-- Create a value of 'UpdateAuthorizer' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'authorizerCredentialsArn', 'updateAuthorizer_authorizerCredentialsArn' - Specifies the required credentials as an IAM role for API Gateway to
-- invoke the authorizer. To specify an IAM role for API Gateway to assume,
-- use the role\'s Amazon Resource Name (ARN). To use resource-based
-- permissions on the Lambda function, don\'t specify this parameter.
--
-- 'identityValidationExpression', 'updateAuthorizer_identityValidationExpression' - This parameter is not used.
--
-- 'enableSimpleResponses', 'updateAuthorizer_enableSimpleResponses' - Specifies whether a Lambda authorizer returns a response in a simple
-- format. By default, a Lambda authorizer must return an IAM policy. If
-- enabled, the Lambda authorizer can return a boolean value instead of an
-- IAM policy. Supported only for HTTP APIs. To learn more, see
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html Working with AWS Lambda authorizers for HTTP APIs>
--
-- 'authorizerUri', 'updateAuthorizer_authorizerUri' - The authorizer\'s Uniform Resource Identifier (URI). For REQUEST
-- authorizers, this must be a well-formed Lambda function URI, for
-- example,
-- arn:aws:apigateway:us-west-2:lambda:path\/2015-03-31\/functions\/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}\/invocations.
-- In general, the URI has this form:
-- arn:aws:apigateway:{region}:lambda:path\/{service_api} , where {region}
-- is the same as the region hosting the Lambda function, path indicates
-- that the remaining substring in the URI should be treated as the path to
-- the resource, including the initial \/. For Lambda functions, this is
-- usually of the form \/2015-03-31\/functions\/[FunctionARN]\/invocations.
-- Supported only for REQUEST authorizers.
--
-- 'authorizerPayloadFormatVersion', 'updateAuthorizer_authorizerPayloadFormatVersion' - Specifies the format of the payload sent to an HTTP API Lambda
-- authorizer. Required for HTTP API Lambda authorizers. Supported values
-- are 1.0 and 2.0. To learn more, see
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html Working with AWS Lambda authorizers for HTTP APIs>.
--
-- 'jwtConfiguration', 'updateAuthorizer_jwtConfiguration' - Represents the configuration of a JWT authorizer. Required for the JWT
-- authorizer type. Supported only for HTTP APIs.
--
-- 'name', 'updateAuthorizer_name' - The name of the authorizer.
--
-- 'authorizerResultTtlInSeconds', 'updateAuthorizer_authorizerResultTtlInSeconds' - The time to live (TTL) for cached authorizer results, in seconds. If it
-- equals 0, authorization caching is disabled. If it is greater than 0,
-- API Gateway caches authorizer responses. The maximum value is 3600, or 1
-- hour. Supported only for HTTP API Lambda authorizers.
--
-- 'identitySource', 'updateAuthorizer_identitySource' - The identity source for which authorization is requested.
--
-- For a REQUEST authorizer, this is optional. The value is a set of one or
-- more mapping expressions of the specified request parameters. The
-- identity source can be headers, query string parameters, stage
-- variables, and context parameters. For example, if an Auth header and a
-- Name query string parameter are defined as identity sources, this value
-- is route.request.header.Auth, route.request.querystring.Name for
-- WebSocket APIs. For HTTP APIs, use selection expressions prefixed with
-- \$, for example, $request.header.Auth, $request.querystring.Name. These
-- parameters are used to perform runtime validation for Lambda-based
-- authorizers by verifying all of the identity-related request parameters
-- are present in the request, not null, and non-empty. Only when this is
-- true does the authorizer invoke the authorizer Lambda function.
-- Otherwise, it returns a 401 Unauthorized response without calling the
-- Lambda function. For HTTP APIs, identity sources are also used as the
-- cache key when caching is enabled. To learn more, see
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html Working with AWS Lambda authorizers for HTTP APIs>.
--
-- For JWT, a single entry that specifies where to extract the JSON Web
-- Token (JWT) from inbound requests. Currently only header-based and query
-- parameter-based selections are supported, for example
-- \$request.header.Authorization.
--
-- 'authorizerType', 'updateAuthorizer_authorizerType' - The authorizer type. Specify REQUEST for a Lambda function using
-- incoming request parameters. Specify JWT to use JSON Web Tokens
-- (supported only for HTTP APIs).
--
-- 'authorizerId', 'updateAuthorizer_authorizerId' - The authorizer identifier.
--
-- 'apiId', 'updateAuthorizer_apiId' - The API identifier.
newUpdateAuthorizer ::
  -- | 'authorizerId'
  Prelude.Text ->
  -- | 'apiId'
  Prelude.Text ->
  UpdateAuthorizer
newUpdateAuthorizer :: Text -> Text -> UpdateAuthorizer
newUpdateAuthorizer Text
pAuthorizerId_ Text
pApiId_ =
  UpdateAuthorizer' :: Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe JWTConfiguration
-> Maybe Text
-> Maybe Natural
-> Maybe [Text]
-> Maybe AuthorizerType
-> Text
-> Text
-> UpdateAuthorizer
UpdateAuthorizer'
    { $sel:authorizerCredentialsArn:UpdateAuthorizer' :: Maybe Text
authorizerCredentialsArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:identityValidationExpression:UpdateAuthorizer' :: Maybe Text
identityValidationExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enableSimpleResponses:UpdateAuthorizer' :: Maybe Bool
enableSimpleResponses = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerUri:UpdateAuthorizer' :: Maybe Text
authorizerUri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerPayloadFormatVersion:UpdateAuthorizer' :: Maybe Text
authorizerPayloadFormatVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jwtConfiguration:UpdateAuthorizer' :: Maybe JWTConfiguration
jwtConfiguration = Maybe JWTConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateAuthorizer' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerResultTtlInSeconds:UpdateAuthorizer' :: Maybe Natural
authorizerResultTtlInSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:identitySource:UpdateAuthorizer' :: Maybe [Text]
identitySource = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerType:UpdateAuthorizer' :: Maybe AuthorizerType
authorizerType = Maybe AuthorizerType
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerId:UpdateAuthorizer' :: Text
authorizerId = Text
pAuthorizerId_,
      $sel:apiId:UpdateAuthorizer' :: Text
apiId = Text
pApiId_
    }

-- | Specifies the required credentials as an IAM role for API Gateway to
-- invoke the authorizer. To specify an IAM role for API Gateway to assume,
-- use the role\'s Amazon Resource Name (ARN). To use resource-based
-- permissions on the Lambda function, don\'t specify this parameter.
updateAuthorizer_authorizerCredentialsArn :: Lens.Lens' UpdateAuthorizer (Prelude.Maybe Prelude.Text)
updateAuthorizer_authorizerCredentialsArn :: (Maybe Text -> f (Maybe Text))
-> UpdateAuthorizer -> f UpdateAuthorizer
updateAuthorizer_authorizerCredentialsArn = (UpdateAuthorizer -> Maybe Text)
-> (UpdateAuthorizer -> Maybe Text -> UpdateAuthorizer)
-> Lens UpdateAuthorizer UpdateAuthorizer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizer' {Maybe Text
authorizerCredentialsArn :: Maybe Text
$sel:authorizerCredentialsArn:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
authorizerCredentialsArn} -> Maybe Text
authorizerCredentialsArn) (\s :: UpdateAuthorizer
s@UpdateAuthorizer' {} Maybe Text
a -> UpdateAuthorizer
s {$sel:authorizerCredentialsArn:UpdateAuthorizer' :: Maybe Text
authorizerCredentialsArn = Maybe Text
a} :: UpdateAuthorizer)

-- | This parameter is not used.
updateAuthorizer_identityValidationExpression :: Lens.Lens' UpdateAuthorizer (Prelude.Maybe Prelude.Text)
updateAuthorizer_identityValidationExpression :: (Maybe Text -> f (Maybe Text))
-> UpdateAuthorizer -> f UpdateAuthorizer
updateAuthorizer_identityValidationExpression = (UpdateAuthorizer -> Maybe Text)
-> (UpdateAuthorizer -> Maybe Text -> UpdateAuthorizer)
-> Lens UpdateAuthorizer UpdateAuthorizer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizer' {Maybe Text
identityValidationExpression :: Maybe Text
$sel:identityValidationExpression:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
identityValidationExpression} -> Maybe Text
identityValidationExpression) (\s :: UpdateAuthorizer
s@UpdateAuthorizer' {} Maybe Text
a -> UpdateAuthorizer
s {$sel:identityValidationExpression:UpdateAuthorizer' :: Maybe Text
identityValidationExpression = Maybe Text
a} :: UpdateAuthorizer)

-- | Specifies whether a Lambda authorizer returns a response in a simple
-- format. By default, a Lambda authorizer must return an IAM policy. If
-- enabled, the Lambda authorizer can return a boolean value instead of an
-- IAM policy. Supported only for HTTP APIs. To learn more, see
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html Working with AWS Lambda authorizers for HTTP APIs>
updateAuthorizer_enableSimpleResponses :: Lens.Lens' UpdateAuthorizer (Prelude.Maybe Prelude.Bool)
updateAuthorizer_enableSimpleResponses :: (Maybe Bool -> f (Maybe Bool))
-> UpdateAuthorizer -> f UpdateAuthorizer
updateAuthorizer_enableSimpleResponses = (UpdateAuthorizer -> Maybe Bool)
-> (UpdateAuthorizer -> Maybe Bool -> UpdateAuthorizer)
-> Lens UpdateAuthorizer UpdateAuthorizer (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizer' {Maybe Bool
enableSimpleResponses :: Maybe Bool
$sel:enableSimpleResponses:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Bool
enableSimpleResponses} -> Maybe Bool
enableSimpleResponses) (\s :: UpdateAuthorizer
s@UpdateAuthorizer' {} Maybe Bool
a -> UpdateAuthorizer
s {$sel:enableSimpleResponses:UpdateAuthorizer' :: Maybe Bool
enableSimpleResponses = Maybe Bool
a} :: UpdateAuthorizer)

-- | The authorizer\'s Uniform Resource Identifier (URI). For REQUEST
-- authorizers, this must be a well-formed Lambda function URI, for
-- example,
-- arn:aws:apigateway:us-west-2:lambda:path\/2015-03-31\/functions\/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}\/invocations.
-- In general, the URI has this form:
-- arn:aws:apigateway:{region}:lambda:path\/{service_api} , where {region}
-- is the same as the region hosting the Lambda function, path indicates
-- that the remaining substring in the URI should be treated as the path to
-- the resource, including the initial \/. For Lambda functions, this is
-- usually of the form \/2015-03-31\/functions\/[FunctionARN]\/invocations.
-- Supported only for REQUEST authorizers.
updateAuthorizer_authorizerUri :: Lens.Lens' UpdateAuthorizer (Prelude.Maybe Prelude.Text)
updateAuthorizer_authorizerUri :: (Maybe Text -> f (Maybe Text))
-> UpdateAuthorizer -> f UpdateAuthorizer
updateAuthorizer_authorizerUri = (UpdateAuthorizer -> Maybe Text)
-> (UpdateAuthorizer -> Maybe Text -> UpdateAuthorizer)
-> Lens UpdateAuthorizer UpdateAuthorizer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizer' {Maybe Text
authorizerUri :: Maybe Text
$sel:authorizerUri:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
authorizerUri} -> Maybe Text
authorizerUri) (\s :: UpdateAuthorizer
s@UpdateAuthorizer' {} Maybe Text
a -> UpdateAuthorizer
s {$sel:authorizerUri:UpdateAuthorizer' :: Maybe Text
authorizerUri = Maybe Text
a} :: UpdateAuthorizer)

-- | Specifies the format of the payload sent to an HTTP API Lambda
-- authorizer. Required for HTTP API Lambda authorizers. Supported values
-- are 1.0 and 2.0. To learn more, see
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html Working with AWS Lambda authorizers for HTTP APIs>.
updateAuthorizer_authorizerPayloadFormatVersion :: Lens.Lens' UpdateAuthorizer (Prelude.Maybe Prelude.Text)
updateAuthorizer_authorizerPayloadFormatVersion :: (Maybe Text -> f (Maybe Text))
-> UpdateAuthorizer -> f UpdateAuthorizer
updateAuthorizer_authorizerPayloadFormatVersion = (UpdateAuthorizer -> Maybe Text)
-> (UpdateAuthorizer -> Maybe Text -> UpdateAuthorizer)
-> Lens UpdateAuthorizer UpdateAuthorizer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizer' {Maybe Text
authorizerPayloadFormatVersion :: Maybe Text
$sel:authorizerPayloadFormatVersion:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
authorizerPayloadFormatVersion} -> Maybe Text
authorizerPayloadFormatVersion) (\s :: UpdateAuthorizer
s@UpdateAuthorizer' {} Maybe Text
a -> UpdateAuthorizer
s {$sel:authorizerPayloadFormatVersion:UpdateAuthorizer' :: Maybe Text
authorizerPayloadFormatVersion = Maybe Text
a} :: UpdateAuthorizer)

-- | Represents the configuration of a JWT authorizer. Required for the JWT
-- authorizer type. Supported only for HTTP APIs.
updateAuthorizer_jwtConfiguration :: Lens.Lens' UpdateAuthorizer (Prelude.Maybe JWTConfiguration)
updateAuthorizer_jwtConfiguration :: (Maybe JWTConfiguration -> f (Maybe JWTConfiguration))
-> UpdateAuthorizer -> f UpdateAuthorizer
updateAuthorizer_jwtConfiguration = (UpdateAuthorizer -> Maybe JWTConfiguration)
-> (UpdateAuthorizer -> Maybe JWTConfiguration -> UpdateAuthorizer)
-> Lens
     UpdateAuthorizer
     UpdateAuthorizer
     (Maybe JWTConfiguration)
     (Maybe JWTConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizer' {Maybe JWTConfiguration
jwtConfiguration :: Maybe JWTConfiguration
$sel:jwtConfiguration:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe JWTConfiguration
jwtConfiguration} -> Maybe JWTConfiguration
jwtConfiguration) (\s :: UpdateAuthorizer
s@UpdateAuthorizer' {} Maybe JWTConfiguration
a -> UpdateAuthorizer
s {$sel:jwtConfiguration:UpdateAuthorizer' :: Maybe JWTConfiguration
jwtConfiguration = Maybe JWTConfiguration
a} :: UpdateAuthorizer)

-- | The name of the authorizer.
updateAuthorizer_name :: Lens.Lens' UpdateAuthorizer (Prelude.Maybe Prelude.Text)
updateAuthorizer_name :: (Maybe Text -> f (Maybe Text))
-> UpdateAuthorizer -> f UpdateAuthorizer
updateAuthorizer_name = (UpdateAuthorizer -> Maybe Text)
-> (UpdateAuthorizer -> Maybe Text -> UpdateAuthorizer)
-> Lens UpdateAuthorizer UpdateAuthorizer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizer' {Maybe Text
name :: Maybe Text
$sel:name:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateAuthorizer
s@UpdateAuthorizer' {} Maybe Text
a -> UpdateAuthorizer
s {$sel:name:UpdateAuthorizer' :: Maybe Text
name = Maybe Text
a} :: UpdateAuthorizer)

-- | The time to live (TTL) for cached authorizer results, in seconds. If it
-- equals 0, authorization caching is disabled. If it is greater than 0,
-- API Gateway caches authorizer responses. The maximum value is 3600, or 1
-- hour. Supported only for HTTP API Lambda authorizers.
updateAuthorizer_authorizerResultTtlInSeconds :: Lens.Lens' UpdateAuthorizer (Prelude.Maybe Prelude.Natural)
updateAuthorizer_authorizerResultTtlInSeconds :: (Maybe Natural -> f (Maybe Natural))
-> UpdateAuthorizer -> f UpdateAuthorizer
updateAuthorizer_authorizerResultTtlInSeconds = (UpdateAuthorizer -> Maybe Natural)
-> (UpdateAuthorizer -> Maybe Natural -> UpdateAuthorizer)
-> Lens
     UpdateAuthorizer UpdateAuthorizer (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizer' {Maybe Natural
authorizerResultTtlInSeconds :: Maybe Natural
$sel:authorizerResultTtlInSeconds:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Natural
authorizerResultTtlInSeconds} -> Maybe Natural
authorizerResultTtlInSeconds) (\s :: UpdateAuthorizer
s@UpdateAuthorizer' {} Maybe Natural
a -> UpdateAuthorizer
s {$sel:authorizerResultTtlInSeconds:UpdateAuthorizer' :: Maybe Natural
authorizerResultTtlInSeconds = Maybe Natural
a} :: UpdateAuthorizer)

-- | The identity source for which authorization is requested.
--
-- For a REQUEST authorizer, this is optional. The value is a set of one or
-- more mapping expressions of the specified request parameters. The
-- identity source can be headers, query string parameters, stage
-- variables, and context parameters. For example, if an Auth header and a
-- Name query string parameter are defined as identity sources, this value
-- is route.request.header.Auth, route.request.querystring.Name for
-- WebSocket APIs. For HTTP APIs, use selection expressions prefixed with
-- \$, for example, $request.header.Auth, $request.querystring.Name. These
-- parameters are used to perform runtime validation for Lambda-based
-- authorizers by verifying all of the identity-related request parameters
-- are present in the request, not null, and non-empty. Only when this is
-- true does the authorizer invoke the authorizer Lambda function.
-- Otherwise, it returns a 401 Unauthorized response without calling the
-- Lambda function. For HTTP APIs, identity sources are also used as the
-- cache key when caching is enabled. To learn more, see
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html Working with AWS Lambda authorizers for HTTP APIs>.
--
-- For JWT, a single entry that specifies where to extract the JSON Web
-- Token (JWT) from inbound requests. Currently only header-based and query
-- parameter-based selections are supported, for example
-- \$request.header.Authorization.
updateAuthorizer_identitySource :: Lens.Lens' UpdateAuthorizer (Prelude.Maybe [Prelude.Text])
updateAuthorizer_identitySource :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateAuthorizer -> f UpdateAuthorizer
updateAuthorizer_identitySource = (UpdateAuthorizer -> Maybe [Text])
-> (UpdateAuthorizer -> Maybe [Text] -> UpdateAuthorizer)
-> Lens
     UpdateAuthorizer UpdateAuthorizer (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizer' {Maybe [Text]
identitySource :: Maybe [Text]
$sel:identitySource:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe [Text]
identitySource} -> Maybe [Text]
identitySource) (\s :: UpdateAuthorizer
s@UpdateAuthorizer' {} Maybe [Text]
a -> UpdateAuthorizer
s {$sel:identitySource:UpdateAuthorizer' :: Maybe [Text]
identitySource = Maybe [Text]
a} :: UpdateAuthorizer) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateAuthorizer -> f UpdateAuthorizer)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateAuthorizer
-> f UpdateAuthorizer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The authorizer type. Specify REQUEST for a Lambda function using
-- incoming request parameters. Specify JWT to use JSON Web Tokens
-- (supported only for HTTP APIs).
updateAuthorizer_authorizerType :: Lens.Lens' UpdateAuthorizer (Prelude.Maybe AuthorizerType)
updateAuthorizer_authorizerType :: (Maybe AuthorizerType -> f (Maybe AuthorizerType))
-> UpdateAuthorizer -> f UpdateAuthorizer
updateAuthorizer_authorizerType = (UpdateAuthorizer -> Maybe AuthorizerType)
-> (UpdateAuthorizer -> Maybe AuthorizerType -> UpdateAuthorizer)
-> Lens
     UpdateAuthorizer
     UpdateAuthorizer
     (Maybe AuthorizerType)
     (Maybe AuthorizerType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizer' {Maybe AuthorizerType
authorizerType :: Maybe AuthorizerType
$sel:authorizerType:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe AuthorizerType
authorizerType} -> Maybe AuthorizerType
authorizerType) (\s :: UpdateAuthorizer
s@UpdateAuthorizer' {} Maybe AuthorizerType
a -> UpdateAuthorizer
s {$sel:authorizerType:UpdateAuthorizer' :: Maybe AuthorizerType
authorizerType = Maybe AuthorizerType
a} :: UpdateAuthorizer)

-- | The authorizer identifier.
updateAuthorizer_authorizerId :: Lens.Lens' UpdateAuthorizer Prelude.Text
updateAuthorizer_authorizerId :: (Text -> f Text) -> UpdateAuthorizer -> f UpdateAuthorizer
updateAuthorizer_authorizerId = (UpdateAuthorizer -> Text)
-> (UpdateAuthorizer -> Text -> UpdateAuthorizer)
-> Lens UpdateAuthorizer UpdateAuthorizer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizer' {Text
authorizerId :: Text
$sel:authorizerId:UpdateAuthorizer' :: UpdateAuthorizer -> Text
authorizerId} -> Text
authorizerId) (\s :: UpdateAuthorizer
s@UpdateAuthorizer' {} Text
a -> UpdateAuthorizer
s {$sel:authorizerId:UpdateAuthorizer' :: Text
authorizerId = Text
a} :: UpdateAuthorizer)

-- | The API identifier.
updateAuthorizer_apiId :: Lens.Lens' UpdateAuthorizer Prelude.Text
updateAuthorizer_apiId :: (Text -> f Text) -> UpdateAuthorizer -> f UpdateAuthorizer
updateAuthorizer_apiId = (UpdateAuthorizer -> Text)
-> (UpdateAuthorizer -> Text -> UpdateAuthorizer)
-> Lens UpdateAuthorizer UpdateAuthorizer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizer' {Text
apiId :: Text
$sel:apiId:UpdateAuthorizer' :: UpdateAuthorizer -> Text
apiId} -> Text
apiId) (\s :: UpdateAuthorizer
s@UpdateAuthorizer' {} Text
a -> UpdateAuthorizer
s {$sel:apiId:UpdateAuthorizer' :: Text
apiId = Text
a} :: UpdateAuthorizer)

instance Core.AWSRequest UpdateAuthorizer where
  type
    AWSResponse UpdateAuthorizer =
      UpdateAuthorizerResponse
  request :: UpdateAuthorizer -> Request UpdateAuthorizer
request = Service -> UpdateAuthorizer -> Request UpdateAuthorizer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateAuthorizer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateAuthorizer)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateAuthorizer))
-> Logger
-> Service
-> Proxy UpdateAuthorizer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateAuthorizer)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe JWTConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe [Text]
-> Maybe AuthorizerType
-> Int
-> UpdateAuthorizerResponse
UpdateAuthorizerResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe JWTConfiguration
 -> Maybe Text
 -> Maybe Text
 -> Maybe Natural
 -> Maybe [Text]
 -> Maybe AuthorizerType
 -> Int
 -> UpdateAuthorizerResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe JWTConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe [Text]
      -> Maybe AuthorizerType
      -> Int
      -> UpdateAuthorizerResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"authorizerCredentialsArn")
            Either
  String
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe JWTConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe [Text]
   -> Maybe AuthorizerType
   -> Int
   -> UpdateAuthorizerResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe JWTConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe [Text]
      -> Maybe AuthorizerType
      -> Int
      -> UpdateAuthorizerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"identityValidationExpression")
            Either
  String
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe JWTConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe [Text]
   -> Maybe AuthorizerType
   -> Int
   -> UpdateAuthorizerResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe JWTConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe [Text]
      -> Maybe AuthorizerType
      -> Int
      -> UpdateAuthorizerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"enableSimpleResponses")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe JWTConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe [Text]
   -> Maybe AuthorizerType
   -> Int
   -> UpdateAuthorizerResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe JWTConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe [Text]
      -> Maybe AuthorizerType
      -> Int
      -> UpdateAuthorizerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"authorizerUri")
            Either
  String
  (Maybe Text
   -> Maybe JWTConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe [Text]
   -> Maybe AuthorizerType
   -> Int
   -> UpdateAuthorizerResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe JWTConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe [Text]
      -> Maybe AuthorizerType
      -> Int
      -> UpdateAuthorizerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"authorizerPayloadFormatVersion")
            Either
  String
  (Maybe JWTConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe [Text]
   -> Maybe AuthorizerType
   -> Int
   -> UpdateAuthorizerResponse)
-> Either String (Maybe JWTConfiguration)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe [Text]
      -> Maybe AuthorizerType
      -> Int
      -> UpdateAuthorizerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe JWTConfiguration)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"jwtConfiguration")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe [Text]
   -> Maybe AuthorizerType
   -> Int
   -> UpdateAuthorizerResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Natural
      -> Maybe [Text]
      -> Maybe AuthorizerType
      -> Int
      -> UpdateAuthorizerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"authorizerId")
            Either
  String
  (Maybe Text
   -> Maybe Natural
   -> Maybe [Text]
   -> Maybe AuthorizerType
   -> Int
   -> UpdateAuthorizerResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Natural
      -> Maybe [Text]
      -> Maybe AuthorizerType
      -> Int
      -> UpdateAuthorizerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"name")
            Either
  String
  (Maybe Natural
   -> Maybe [Text]
   -> Maybe AuthorizerType
   -> Int
   -> UpdateAuthorizerResponse)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe [Text]
      -> Maybe AuthorizerType -> Int -> UpdateAuthorizerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"authorizerResultTtlInSeconds")
            Either
  String
  (Maybe [Text]
   -> Maybe AuthorizerType -> Int -> UpdateAuthorizerResponse)
-> Either String (Maybe [Text])
-> Either
     String (Maybe AuthorizerType -> Int -> UpdateAuthorizerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"identitySource" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String (Maybe AuthorizerType -> Int -> UpdateAuthorizerResponse)
-> Either String (Maybe AuthorizerType)
-> Either String (Int -> UpdateAuthorizerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe AuthorizerType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"authorizerType")
            Either String (Int -> UpdateAuthorizerResponse)
-> Either String Int -> Either String UpdateAuthorizerResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateAuthorizer

instance Prelude.NFData UpdateAuthorizer

instance Core.ToHeaders UpdateAuthorizer where
  toHeaders :: UpdateAuthorizer -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateAuthorizer -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON UpdateAuthorizer where
  toJSON :: UpdateAuthorizer -> Value
toJSON UpdateAuthorizer' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe Text
Maybe AuthorizerType
Maybe JWTConfiguration
Text
apiId :: Text
authorizerId :: Text
authorizerType :: Maybe AuthorizerType
identitySource :: Maybe [Text]
authorizerResultTtlInSeconds :: Maybe Natural
name :: Maybe Text
jwtConfiguration :: Maybe JWTConfiguration
authorizerPayloadFormatVersion :: Maybe Text
authorizerUri :: Maybe Text
enableSimpleResponses :: Maybe Bool
identityValidationExpression :: Maybe Text
authorizerCredentialsArn :: Maybe Text
$sel:apiId:UpdateAuthorizer' :: UpdateAuthorizer -> Text
$sel:authorizerId:UpdateAuthorizer' :: UpdateAuthorizer -> Text
$sel:authorizerType:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe AuthorizerType
$sel:identitySource:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe [Text]
$sel:authorizerResultTtlInSeconds:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Natural
$sel:name:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
$sel:jwtConfiguration:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe JWTConfiguration
$sel:authorizerPayloadFormatVersion:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
$sel:authorizerUri:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
$sel:enableSimpleResponses:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Bool
$sel:identityValidationExpression:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
$sel:authorizerCredentialsArn:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"authorizerCredentialsArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
authorizerCredentialsArn,
            (Text
"identityValidationExpression" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
identityValidationExpression,
            (Text
"enableSimpleResponses" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableSimpleResponses,
            (Text
"authorizerUri" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
authorizerUri,
            (Text
"authorizerPayloadFormatVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
authorizerPayloadFormatVersion,
            (Text
"jwtConfiguration" Text -> JWTConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (JWTConfiguration -> Pair) -> Maybe JWTConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe JWTConfiguration
jwtConfiguration,
            (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Text
"authorizerResultTtlInSeconds" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
authorizerResultTtlInSeconds,
            (Text
"identitySource" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
identitySource,
            (Text
"authorizerType" Text -> AuthorizerType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AuthorizerType -> Pair) -> Maybe AuthorizerType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AuthorizerType
authorizerType
          ]
      )

instance Core.ToPath UpdateAuthorizer where
  toPath :: UpdateAuthorizer -> ByteString
toPath UpdateAuthorizer' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe Text
Maybe AuthorizerType
Maybe JWTConfiguration
Text
apiId :: Text
authorizerId :: Text
authorizerType :: Maybe AuthorizerType
identitySource :: Maybe [Text]
authorizerResultTtlInSeconds :: Maybe Natural
name :: Maybe Text
jwtConfiguration :: Maybe JWTConfiguration
authorizerPayloadFormatVersion :: Maybe Text
authorizerUri :: Maybe Text
enableSimpleResponses :: Maybe Bool
identityValidationExpression :: Maybe Text
authorizerCredentialsArn :: Maybe Text
$sel:apiId:UpdateAuthorizer' :: UpdateAuthorizer -> Text
$sel:authorizerId:UpdateAuthorizer' :: UpdateAuthorizer -> Text
$sel:authorizerType:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe AuthorizerType
$sel:identitySource:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe [Text]
$sel:authorizerResultTtlInSeconds:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Natural
$sel:name:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
$sel:jwtConfiguration:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe JWTConfiguration
$sel:authorizerPayloadFormatVersion:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
$sel:authorizerUri:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
$sel:enableSimpleResponses:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Bool
$sel:identityValidationExpression:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
$sel:authorizerCredentialsArn:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v2/apis/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
apiId,
        ByteString
"/authorizers/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
authorizerId
      ]

instance Core.ToQuery UpdateAuthorizer where
  toQuery :: UpdateAuthorizer -> QueryString
toQuery = QueryString -> UpdateAuthorizer -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateAuthorizerResponse' smart constructor.
data UpdateAuthorizerResponse = UpdateAuthorizerResponse'
  { -- | Specifies the required credentials as an IAM role for API Gateway to
    -- invoke the authorizer. To specify an IAM role for API Gateway to assume,
    -- use the role\'s Amazon Resource Name (ARN). To use resource-based
    -- permissions on the Lambda function, don\'t specify this parameter.
    -- Supported only for REQUEST authorizers.
    UpdateAuthorizerResponse -> Maybe Text
authorizerCredentialsArn :: Prelude.Maybe Prelude.Text,
    -- | The validation expression does not apply to the REQUEST authorizer.
    UpdateAuthorizerResponse -> Maybe Text
identityValidationExpression :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether a Lambda authorizer returns a response in a simple
    -- format. If enabled, the Lambda authorizer can return a boolean value
    -- instead of an IAM policy. Supported only for HTTP APIs. To learn more,
    -- see
    -- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html Working with AWS Lambda authorizers for HTTP APIs>
    UpdateAuthorizerResponse -> Maybe Bool
enableSimpleResponses :: Prelude.Maybe Prelude.Bool,
    -- | The authorizer\'s Uniform Resource Identifier (URI). For REQUEST
    -- authorizers, this must be a well-formed Lambda function URI, for
    -- example,
    -- arn:aws:apigateway:us-west-2:lambda:path\/2015-03-31\/functions\/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}\/invocations.
    -- In general, the URI has this form:
    -- arn:aws:apigateway:{region}:lambda:path\/{service_api} , where {region}
    -- is the same as the region hosting the Lambda function, path indicates
    -- that the remaining substring in the URI should be treated as the path to
    -- the resource, including the initial \/. For Lambda functions, this is
    -- usually of the form \/2015-03-31\/functions\/[FunctionARN]\/invocations.
    -- Supported only for REQUEST authorizers.
    UpdateAuthorizerResponse -> Maybe Text
authorizerUri :: Prelude.Maybe Prelude.Text,
    -- | Specifies the format of the payload sent to an HTTP API Lambda
    -- authorizer. Required for HTTP API Lambda authorizers. Supported values
    -- are 1.0 and 2.0. To learn more, see
    -- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html Working with AWS Lambda authorizers for HTTP APIs>.
    UpdateAuthorizerResponse -> Maybe Text
authorizerPayloadFormatVersion :: Prelude.Maybe Prelude.Text,
    -- | Represents the configuration of a JWT authorizer. Required for the JWT
    -- authorizer type. Supported only for HTTP APIs.
    UpdateAuthorizerResponse -> Maybe JWTConfiguration
jwtConfiguration :: Prelude.Maybe JWTConfiguration,
    -- | The authorizer identifier.
    UpdateAuthorizerResponse -> Maybe Text
authorizerId :: Prelude.Maybe Prelude.Text,
    -- | The name of the authorizer.
    UpdateAuthorizerResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The time to live (TTL) for cached authorizer results, in seconds. If it
    -- equals 0, authorization caching is disabled. If it is greater than 0,
    -- API Gateway caches authorizer responses. The maximum value is 3600, or 1
    -- hour. Supported only for HTTP API Lambda authorizers.
    UpdateAuthorizerResponse -> Maybe Natural
authorizerResultTtlInSeconds :: Prelude.Maybe Prelude.Natural,
    -- | The identity source for which authorization is requested.
    --
    -- For a REQUEST authorizer, this is optional. The value is a set of one or
    -- more mapping expressions of the specified request parameters. The
    -- identity source can be headers, query string parameters, stage
    -- variables, and context parameters. For example, if an Auth header and a
    -- Name query string parameter are defined as identity sources, this value
    -- is route.request.header.Auth, route.request.querystring.Name for
    -- WebSocket APIs. For HTTP APIs, use selection expressions prefixed with
    -- \$, for example, $request.header.Auth, $request.querystring.Name. These
    -- parameters are used to perform runtime validation for Lambda-based
    -- authorizers by verifying all of the identity-related request parameters
    -- are present in the request, not null, and non-empty. Only when this is
    -- true does the authorizer invoke the authorizer Lambda function.
    -- Otherwise, it returns a 401 Unauthorized response without calling the
    -- Lambda function. For HTTP APIs, identity sources are also used as the
    -- cache key when caching is enabled. To learn more, see
    -- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html Working with AWS Lambda authorizers for HTTP APIs>.
    --
    -- For JWT, a single entry that specifies where to extract the JSON Web
    -- Token (JWT) from inbound requests. Currently only header-based and query
    -- parameter-based selections are supported, for example
    -- \$request.header.Authorization.
    UpdateAuthorizerResponse -> Maybe [Text]
identitySource :: Prelude.Maybe [Prelude.Text],
    -- | The authorizer type. Specify REQUEST for a Lambda function using
    -- incoming request parameters. Specify JWT to use JSON Web Tokens
    -- (supported only for HTTP APIs).
    UpdateAuthorizerResponse -> Maybe AuthorizerType
authorizerType :: Prelude.Maybe AuthorizerType,
    -- | The response's http status code.
    UpdateAuthorizerResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateAuthorizerResponse -> UpdateAuthorizerResponse -> Bool
(UpdateAuthorizerResponse -> UpdateAuthorizerResponse -> Bool)
-> (UpdateAuthorizerResponse -> UpdateAuthorizerResponse -> Bool)
-> Eq UpdateAuthorizerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAuthorizerResponse -> UpdateAuthorizerResponse -> Bool
$c/= :: UpdateAuthorizerResponse -> UpdateAuthorizerResponse -> Bool
== :: UpdateAuthorizerResponse -> UpdateAuthorizerResponse -> Bool
$c== :: UpdateAuthorizerResponse -> UpdateAuthorizerResponse -> Bool
Prelude.Eq, ReadPrec [UpdateAuthorizerResponse]
ReadPrec UpdateAuthorizerResponse
Int -> ReadS UpdateAuthorizerResponse
ReadS [UpdateAuthorizerResponse]
(Int -> ReadS UpdateAuthorizerResponse)
-> ReadS [UpdateAuthorizerResponse]
-> ReadPrec UpdateAuthorizerResponse
-> ReadPrec [UpdateAuthorizerResponse]
-> Read UpdateAuthorizerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAuthorizerResponse]
$creadListPrec :: ReadPrec [UpdateAuthorizerResponse]
readPrec :: ReadPrec UpdateAuthorizerResponse
$creadPrec :: ReadPrec UpdateAuthorizerResponse
readList :: ReadS [UpdateAuthorizerResponse]
$creadList :: ReadS [UpdateAuthorizerResponse]
readsPrec :: Int -> ReadS UpdateAuthorizerResponse
$creadsPrec :: Int -> ReadS UpdateAuthorizerResponse
Prelude.Read, Int -> UpdateAuthorizerResponse -> ShowS
[UpdateAuthorizerResponse] -> ShowS
UpdateAuthorizerResponse -> String
(Int -> UpdateAuthorizerResponse -> ShowS)
-> (UpdateAuthorizerResponse -> String)
-> ([UpdateAuthorizerResponse] -> ShowS)
-> Show UpdateAuthorizerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAuthorizerResponse] -> ShowS
$cshowList :: [UpdateAuthorizerResponse] -> ShowS
show :: UpdateAuthorizerResponse -> String
$cshow :: UpdateAuthorizerResponse -> String
showsPrec :: Int -> UpdateAuthorizerResponse -> ShowS
$cshowsPrec :: Int -> UpdateAuthorizerResponse -> ShowS
Prelude.Show, (forall x.
 UpdateAuthorizerResponse -> Rep UpdateAuthorizerResponse x)
-> (forall x.
    Rep UpdateAuthorizerResponse x -> UpdateAuthorizerResponse)
-> Generic UpdateAuthorizerResponse
forall x.
Rep UpdateAuthorizerResponse x -> UpdateAuthorizerResponse
forall x.
UpdateAuthorizerResponse -> Rep UpdateAuthorizerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateAuthorizerResponse x -> UpdateAuthorizerResponse
$cfrom :: forall x.
UpdateAuthorizerResponse -> Rep UpdateAuthorizerResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateAuthorizerResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'authorizerCredentialsArn', 'updateAuthorizerResponse_authorizerCredentialsArn' - Specifies the required credentials as an IAM role for API Gateway to
-- invoke the authorizer. To specify an IAM role for API Gateway to assume,
-- use the role\'s Amazon Resource Name (ARN). To use resource-based
-- permissions on the Lambda function, don\'t specify this parameter.
-- Supported only for REQUEST authorizers.
--
-- 'identityValidationExpression', 'updateAuthorizerResponse_identityValidationExpression' - The validation expression does not apply to the REQUEST authorizer.
--
-- 'enableSimpleResponses', 'updateAuthorizerResponse_enableSimpleResponses' - Specifies whether a Lambda authorizer returns a response in a simple
-- format. If enabled, the Lambda authorizer can return a boolean value
-- instead of an IAM policy. Supported only for HTTP APIs. To learn more,
-- see
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html Working with AWS Lambda authorizers for HTTP APIs>
--
-- 'authorizerUri', 'updateAuthorizerResponse_authorizerUri' - The authorizer\'s Uniform Resource Identifier (URI). For REQUEST
-- authorizers, this must be a well-formed Lambda function URI, for
-- example,
-- arn:aws:apigateway:us-west-2:lambda:path\/2015-03-31\/functions\/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}\/invocations.
-- In general, the URI has this form:
-- arn:aws:apigateway:{region}:lambda:path\/{service_api} , where {region}
-- is the same as the region hosting the Lambda function, path indicates
-- that the remaining substring in the URI should be treated as the path to
-- the resource, including the initial \/. For Lambda functions, this is
-- usually of the form \/2015-03-31\/functions\/[FunctionARN]\/invocations.
-- Supported only for REQUEST authorizers.
--
-- 'authorizerPayloadFormatVersion', 'updateAuthorizerResponse_authorizerPayloadFormatVersion' - Specifies the format of the payload sent to an HTTP API Lambda
-- authorizer. Required for HTTP API Lambda authorizers. Supported values
-- are 1.0 and 2.0. To learn more, see
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html Working with AWS Lambda authorizers for HTTP APIs>.
--
-- 'jwtConfiguration', 'updateAuthorizerResponse_jwtConfiguration' - Represents the configuration of a JWT authorizer. Required for the JWT
-- authorizer type. Supported only for HTTP APIs.
--
-- 'authorizerId', 'updateAuthorizerResponse_authorizerId' - The authorizer identifier.
--
-- 'name', 'updateAuthorizerResponse_name' - The name of the authorizer.
--
-- 'authorizerResultTtlInSeconds', 'updateAuthorizerResponse_authorizerResultTtlInSeconds' - The time to live (TTL) for cached authorizer results, in seconds. If it
-- equals 0, authorization caching is disabled. If it is greater than 0,
-- API Gateway caches authorizer responses. The maximum value is 3600, or 1
-- hour. Supported only for HTTP API Lambda authorizers.
--
-- 'identitySource', 'updateAuthorizerResponse_identitySource' - The identity source for which authorization is requested.
--
-- For a REQUEST authorizer, this is optional. The value is a set of one or
-- more mapping expressions of the specified request parameters. The
-- identity source can be headers, query string parameters, stage
-- variables, and context parameters. For example, if an Auth header and a
-- Name query string parameter are defined as identity sources, this value
-- is route.request.header.Auth, route.request.querystring.Name for
-- WebSocket APIs. For HTTP APIs, use selection expressions prefixed with
-- \$, for example, $request.header.Auth, $request.querystring.Name. These
-- parameters are used to perform runtime validation for Lambda-based
-- authorizers by verifying all of the identity-related request parameters
-- are present in the request, not null, and non-empty. Only when this is
-- true does the authorizer invoke the authorizer Lambda function.
-- Otherwise, it returns a 401 Unauthorized response without calling the
-- Lambda function. For HTTP APIs, identity sources are also used as the
-- cache key when caching is enabled. To learn more, see
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html Working with AWS Lambda authorizers for HTTP APIs>.
--
-- For JWT, a single entry that specifies where to extract the JSON Web
-- Token (JWT) from inbound requests. Currently only header-based and query
-- parameter-based selections are supported, for example
-- \$request.header.Authorization.
--
-- 'authorizerType', 'updateAuthorizerResponse_authorizerType' - The authorizer type. Specify REQUEST for a Lambda function using
-- incoming request parameters. Specify JWT to use JSON Web Tokens
-- (supported only for HTTP APIs).
--
-- 'httpStatus', 'updateAuthorizerResponse_httpStatus' - The response's http status code.
newUpdateAuthorizerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateAuthorizerResponse
newUpdateAuthorizerResponse :: Int -> UpdateAuthorizerResponse
newUpdateAuthorizerResponse Int
pHttpStatus_ =
  UpdateAuthorizerResponse' :: Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe JWTConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe [Text]
-> Maybe AuthorizerType
-> Int
-> UpdateAuthorizerResponse
UpdateAuthorizerResponse'
    { $sel:authorizerCredentialsArn:UpdateAuthorizerResponse' :: Maybe Text
authorizerCredentialsArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:identityValidationExpression:UpdateAuthorizerResponse' :: Maybe Text
identityValidationExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enableSimpleResponses:UpdateAuthorizerResponse' :: Maybe Bool
enableSimpleResponses = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerUri:UpdateAuthorizerResponse' :: Maybe Text
authorizerUri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerPayloadFormatVersion:UpdateAuthorizerResponse' :: Maybe Text
authorizerPayloadFormatVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jwtConfiguration:UpdateAuthorizerResponse' :: Maybe JWTConfiguration
jwtConfiguration = Maybe JWTConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerId:UpdateAuthorizerResponse' :: Maybe Text
authorizerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateAuthorizerResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerResultTtlInSeconds:UpdateAuthorizerResponse' :: Maybe Natural
authorizerResultTtlInSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:identitySource:UpdateAuthorizerResponse' :: Maybe [Text]
identitySource = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerType:UpdateAuthorizerResponse' :: Maybe AuthorizerType
authorizerType = Maybe AuthorizerType
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateAuthorizerResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Specifies the required credentials as an IAM role for API Gateway to
-- invoke the authorizer. To specify an IAM role for API Gateway to assume,
-- use the role\'s Amazon Resource Name (ARN). To use resource-based
-- permissions on the Lambda function, don\'t specify this parameter.
-- Supported only for REQUEST authorizers.
updateAuthorizerResponse_authorizerCredentialsArn :: Lens.Lens' UpdateAuthorizerResponse (Prelude.Maybe Prelude.Text)
updateAuthorizerResponse_authorizerCredentialsArn :: (Maybe Text -> f (Maybe Text))
-> UpdateAuthorizerResponse -> f UpdateAuthorizerResponse
updateAuthorizerResponse_authorizerCredentialsArn = (UpdateAuthorizerResponse -> Maybe Text)
-> (UpdateAuthorizerResponse
    -> Maybe Text -> UpdateAuthorizerResponse)
-> Lens
     UpdateAuthorizerResponse
     UpdateAuthorizerResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizerResponse' {Maybe Text
authorizerCredentialsArn :: Maybe Text
$sel:authorizerCredentialsArn:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe Text
authorizerCredentialsArn} -> Maybe Text
authorizerCredentialsArn) (\s :: UpdateAuthorizerResponse
s@UpdateAuthorizerResponse' {} Maybe Text
a -> UpdateAuthorizerResponse
s {$sel:authorizerCredentialsArn:UpdateAuthorizerResponse' :: Maybe Text
authorizerCredentialsArn = Maybe Text
a} :: UpdateAuthorizerResponse)

-- | The validation expression does not apply to the REQUEST authorizer.
updateAuthorizerResponse_identityValidationExpression :: Lens.Lens' UpdateAuthorizerResponse (Prelude.Maybe Prelude.Text)
updateAuthorizerResponse_identityValidationExpression :: (Maybe Text -> f (Maybe Text))
-> UpdateAuthorizerResponse -> f UpdateAuthorizerResponse
updateAuthorizerResponse_identityValidationExpression = (UpdateAuthorizerResponse -> Maybe Text)
-> (UpdateAuthorizerResponse
    -> Maybe Text -> UpdateAuthorizerResponse)
-> Lens
     UpdateAuthorizerResponse
     UpdateAuthorizerResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizerResponse' {Maybe Text
identityValidationExpression :: Maybe Text
$sel:identityValidationExpression:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe Text
identityValidationExpression} -> Maybe Text
identityValidationExpression) (\s :: UpdateAuthorizerResponse
s@UpdateAuthorizerResponse' {} Maybe Text
a -> UpdateAuthorizerResponse
s {$sel:identityValidationExpression:UpdateAuthorizerResponse' :: Maybe Text
identityValidationExpression = Maybe Text
a} :: UpdateAuthorizerResponse)

-- | Specifies whether a Lambda authorizer returns a response in a simple
-- format. If enabled, the Lambda authorizer can return a boolean value
-- instead of an IAM policy. Supported only for HTTP APIs. To learn more,
-- see
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html Working with AWS Lambda authorizers for HTTP APIs>
updateAuthorizerResponse_enableSimpleResponses :: Lens.Lens' UpdateAuthorizerResponse (Prelude.Maybe Prelude.Bool)
updateAuthorizerResponse_enableSimpleResponses :: (Maybe Bool -> f (Maybe Bool))
-> UpdateAuthorizerResponse -> f UpdateAuthorizerResponse
updateAuthorizerResponse_enableSimpleResponses = (UpdateAuthorizerResponse -> Maybe Bool)
-> (UpdateAuthorizerResponse
    -> Maybe Bool -> UpdateAuthorizerResponse)
-> Lens
     UpdateAuthorizerResponse
     UpdateAuthorizerResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizerResponse' {Maybe Bool
enableSimpleResponses :: Maybe Bool
$sel:enableSimpleResponses:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe Bool
enableSimpleResponses} -> Maybe Bool
enableSimpleResponses) (\s :: UpdateAuthorizerResponse
s@UpdateAuthorizerResponse' {} Maybe Bool
a -> UpdateAuthorizerResponse
s {$sel:enableSimpleResponses:UpdateAuthorizerResponse' :: Maybe Bool
enableSimpleResponses = Maybe Bool
a} :: UpdateAuthorizerResponse)

-- | The authorizer\'s Uniform Resource Identifier (URI). For REQUEST
-- authorizers, this must be a well-formed Lambda function URI, for
-- example,
-- arn:aws:apigateway:us-west-2:lambda:path\/2015-03-31\/functions\/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}\/invocations.
-- In general, the URI has this form:
-- arn:aws:apigateway:{region}:lambda:path\/{service_api} , where {region}
-- is the same as the region hosting the Lambda function, path indicates
-- that the remaining substring in the URI should be treated as the path to
-- the resource, including the initial \/. For Lambda functions, this is
-- usually of the form \/2015-03-31\/functions\/[FunctionARN]\/invocations.
-- Supported only for REQUEST authorizers.
updateAuthorizerResponse_authorizerUri :: Lens.Lens' UpdateAuthorizerResponse (Prelude.Maybe Prelude.Text)
updateAuthorizerResponse_authorizerUri :: (Maybe Text -> f (Maybe Text))
-> UpdateAuthorizerResponse -> f UpdateAuthorizerResponse
updateAuthorizerResponse_authorizerUri = (UpdateAuthorizerResponse -> Maybe Text)
-> (UpdateAuthorizerResponse
    -> Maybe Text -> UpdateAuthorizerResponse)
-> Lens
     UpdateAuthorizerResponse
     UpdateAuthorizerResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizerResponse' {Maybe Text
authorizerUri :: Maybe Text
$sel:authorizerUri:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe Text
authorizerUri} -> Maybe Text
authorizerUri) (\s :: UpdateAuthorizerResponse
s@UpdateAuthorizerResponse' {} Maybe Text
a -> UpdateAuthorizerResponse
s {$sel:authorizerUri:UpdateAuthorizerResponse' :: Maybe Text
authorizerUri = Maybe Text
a} :: UpdateAuthorizerResponse)

-- | Specifies the format of the payload sent to an HTTP API Lambda
-- authorizer. Required for HTTP API Lambda authorizers. Supported values
-- are 1.0 and 2.0. To learn more, see
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html Working with AWS Lambda authorizers for HTTP APIs>.
updateAuthorizerResponse_authorizerPayloadFormatVersion :: Lens.Lens' UpdateAuthorizerResponse (Prelude.Maybe Prelude.Text)
updateAuthorizerResponse_authorizerPayloadFormatVersion :: (Maybe Text -> f (Maybe Text))
-> UpdateAuthorizerResponse -> f UpdateAuthorizerResponse
updateAuthorizerResponse_authorizerPayloadFormatVersion = (UpdateAuthorizerResponse -> Maybe Text)
-> (UpdateAuthorizerResponse
    -> Maybe Text -> UpdateAuthorizerResponse)
-> Lens
     UpdateAuthorizerResponse
     UpdateAuthorizerResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizerResponse' {Maybe Text
authorizerPayloadFormatVersion :: Maybe Text
$sel:authorizerPayloadFormatVersion:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe Text
authorizerPayloadFormatVersion} -> Maybe Text
authorizerPayloadFormatVersion) (\s :: UpdateAuthorizerResponse
s@UpdateAuthorizerResponse' {} Maybe Text
a -> UpdateAuthorizerResponse
s {$sel:authorizerPayloadFormatVersion:UpdateAuthorizerResponse' :: Maybe Text
authorizerPayloadFormatVersion = Maybe Text
a} :: UpdateAuthorizerResponse)

-- | Represents the configuration of a JWT authorizer. Required for the JWT
-- authorizer type. Supported only for HTTP APIs.
updateAuthorizerResponse_jwtConfiguration :: Lens.Lens' UpdateAuthorizerResponse (Prelude.Maybe JWTConfiguration)
updateAuthorizerResponse_jwtConfiguration :: (Maybe JWTConfiguration -> f (Maybe JWTConfiguration))
-> UpdateAuthorizerResponse -> f UpdateAuthorizerResponse
updateAuthorizerResponse_jwtConfiguration = (UpdateAuthorizerResponse -> Maybe JWTConfiguration)
-> (UpdateAuthorizerResponse
    -> Maybe JWTConfiguration -> UpdateAuthorizerResponse)
-> Lens
     UpdateAuthorizerResponse
     UpdateAuthorizerResponse
     (Maybe JWTConfiguration)
     (Maybe JWTConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizerResponse' {Maybe JWTConfiguration
jwtConfiguration :: Maybe JWTConfiguration
$sel:jwtConfiguration:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe JWTConfiguration
jwtConfiguration} -> Maybe JWTConfiguration
jwtConfiguration) (\s :: UpdateAuthorizerResponse
s@UpdateAuthorizerResponse' {} Maybe JWTConfiguration
a -> UpdateAuthorizerResponse
s {$sel:jwtConfiguration:UpdateAuthorizerResponse' :: Maybe JWTConfiguration
jwtConfiguration = Maybe JWTConfiguration
a} :: UpdateAuthorizerResponse)

-- | The authorizer identifier.
updateAuthorizerResponse_authorizerId :: Lens.Lens' UpdateAuthorizerResponse (Prelude.Maybe Prelude.Text)
updateAuthorizerResponse_authorizerId :: (Maybe Text -> f (Maybe Text))
-> UpdateAuthorizerResponse -> f UpdateAuthorizerResponse
updateAuthorizerResponse_authorizerId = (UpdateAuthorizerResponse -> Maybe Text)
-> (UpdateAuthorizerResponse
    -> Maybe Text -> UpdateAuthorizerResponse)
-> Lens
     UpdateAuthorizerResponse
     UpdateAuthorizerResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizerResponse' {Maybe Text
authorizerId :: Maybe Text
$sel:authorizerId:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe Text
authorizerId} -> Maybe Text
authorizerId) (\s :: UpdateAuthorizerResponse
s@UpdateAuthorizerResponse' {} Maybe Text
a -> UpdateAuthorizerResponse
s {$sel:authorizerId:UpdateAuthorizerResponse' :: Maybe Text
authorizerId = Maybe Text
a} :: UpdateAuthorizerResponse)

-- | The name of the authorizer.
updateAuthorizerResponse_name :: Lens.Lens' UpdateAuthorizerResponse (Prelude.Maybe Prelude.Text)
updateAuthorizerResponse_name :: (Maybe Text -> f (Maybe Text))
-> UpdateAuthorizerResponse -> f UpdateAuthorizerResponse
updateAuthorizerResponse_name = (UpdateAuthorizerResponse -> Maybe Text)
-> (UpdateAuthorizerResponse
    -> Maybe Text -> UpdateAuthorizerResponse)
-> Lens
     UpdateAuthorizerResponse
     UpdateAuthorizerResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizerResponse' {Maybe Text
name :: Maybe Text
$sel:name:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateAuthorizerResponse
s@UpdateAuthorizerResponse' {} Maybe Text
a -> UpdateAuthorizerResponse
s {$sel:name:UpdateAuthorizerResponse' :: Maybe Text
name = Maybe Text
a} :: UpdateAuthorizerResponse)

-- | The time to live (TTL) for cached authorizer results, in seconds. If it
-- equals 0, authorization caching is disabled. If it is greater than 0,
-- API Gateway caches authorizer responses. The maximum value is 3600, or 1
-- hour. Supported only for HTTP API Lambda authorizers.
updateAuthorizerResponse_authorizerResultTtlInSeconds :: Lens.Lens' UpdateAuthorizerResponse (Prelude.Maybe Prelude.Natural)
updateAuthorizerResponse_authorizerResultTtlInSeconds :: (Maybe Natural -> f (Maybe Natural))
-> UpdateAuthorizerResponse -> f UpdateAuthorizerResponse
updateAuthorizerResponse_authorizerResultTtlInSeconds = (UpdateAuthorizerResponse -> Maybe Natural)
-> (UpdateAuthorizerResponse
    -> Maybe Natural -> UpdateAuthorizerResponse)
-> Lens
     UpdateAuthorizerResponse
     UpdateAuthorizerResponse
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizerResponse' {Maybe Natural
authorizerResultTtlInSeconds :: Maybe Natural
$sel:authorizerResultTtlInSeconds:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe Natural
authorizerResultTtlInSeconds} -> Maybe Natural
authorizerResultTtlInSeconds) (\s :: UpdateAuthorizerResponse
s@UpdateAuthorizerResponse' {} Maybe Natural
a -> UpdateAuthorizerResponse
s {$sel:authorizerResultTtlInSeconds:UpdateAuthorizerResponse' :: Maybe Natural
authorizerResultTtlInSeconds = Maybe Natural
a} :: UpdateAuthorizerResponse)

-- | The identity source for which authorization is requested.
--
-- For a REQUEST authorizer, this is optional. The value is a set of one or
-- more mapping expressions of the specified request parameters. The
-- identity source can be headers, query string parameters, stage
-- variables, and context parameters. For example, if an Auth header and a
-- Name query string parameter are defined as identity sources, this value
-- is route.request.header.Auth, route.request.querystring.Name for
-- WebSocket APIs. For HTTP APIs, use selection expressions prefixed with
-- \$, for example, $request.header.Auth, $request.querystring.Name. These
-- parameters are used to perform runtime validation for Lambda-based
-- authorizers by verifying all of the identity-related request parameters
-- are present in the request, not null, and non-empty. Only when this is
-- true does the authorizer invoke the authorizer Lambda function.
-- Otherwise, it returns a 401 Unauthorized response without calling the
-- Lambda function. For HTTP APIs, identity sources are also used as the
-- cache key when caching is enabled. To learn more, see
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html Working with AWS Lambda authorizers for HTTP APIs>.
--
-- For JWT, a single entry that specifies where to extract the JSON Web
-- Token (JWT) from inbound requests. Currently only header-based and query
-- parameter-based selections are supported, for example
-- \$request.header.Authorization.
updateAuthorizerResponse_identitySource :: Lens.Lens' UpdateAuthorizerResponse (Prelude.Maybe [Prelude.Text])
updateAuthorizerResponse_identitySource :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateAuthorizerResponse -> f UpdateAuthorizerResponse
updateAuthorizerResponse_identitySource = (UpdateAuthorizerResponse -> Maybe [Text])
-> (UpdateAuthorizerResponse
    -> Maybe [Text] -> UpdateAuthorizerResponse)
-> Lens
     UpdateAuthorizerResponse
     UpdateAuthorizerResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizerResponse' {Maybe [Text]
identitySource :: Maybe [Text]
$sel:identitySource:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe [Text]
identitySource} -> Maybe [Text]
identitySource) (\s :: UpdateAuthorizerResponse
s@UpdateAuthorizerResponse' {} Maybe [Text]
a -> UpdateAuthorizerResponse
s {$sel:identitySource:UpdateAuthorizerResponse' :: Maybe [Text]
identitySource = Maybe [Text]
a} :: UpdateAuthorizerResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateAuthorizerResponse -> f UpdateAuthorizerResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateAuthorizerResponse
-> f UpdateAuthorizerResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The authorizer type. Specify REQUEST for a Lambda function using
-- incoming request parameters. Specify JWT to use JSON Web Tokens
-- (supported only for HTTP APIs).
updateAuthorizerResponse_authorizerType :: Lens.Lens' UpdateAuthorizerResponse (Prelude.Maybe AuthorizerType)
updateAuthorizerResponse_authorizerType :: (Maybe AuthorizerType -> f (Maybe AuthorizerType))
-> UpdateAuthorizerResponse -> f UpdateAuthorizerResponse
updateAuthorizerResponse_authorizerType = (UpdateAuthorizerResponse -> Maybe AuthorizerType)
-> (UpdateAuthorizerResponse
    -> Maybe AuthorizerType -> UpdateAuthorizerResponse)
-> Lens
     UpdateAuthorizerResponse
     UpdateAuthorizerResponse
     (Maybe AuthorizerType)
     (Maybe AuthorizerType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizerResponse' {Maybe AuthorizerType
authorizerType :: Maybe AuthorizerType
$sel:authorizerType:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe AuthorizerType
authorizerType} -> Maybe AuthorizerType
authorizerType) (\s :: UpdateAuthorizerResponse
s@UpdateAuthorizerResponse' {} Maybe AuthorizerType
a -> UpdateAuthorizerResponse
s {$sel:authorizerType:UpdateAuthorizerResponse' :: Maybe AuthorizerType
authorizerType = Maybe AuthorizerType
a} :: UpdateAuthorizerResponse)

-- | The response's http status code.
updateAuthorizerResponse_httpStatus :: Lens.Lens' UpdateAuthorizerResponse Prelude.Int
updateAuthorizerResponse_httpStatus :: (Int -> f Int)
-> UpdateAuthorizerResponse -> f UpdateAuthorizerResponse
updateAuthorizerResponse_httpStatus = (UpdateAuthorizerResponse -> Int)
-> (UpdateAuthorizerResponse -> Int -> UpdateAuthorizerResponse)
-> Lens UpdateAuthorizerResponse UpdateAuthorizerResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAuthorizerResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateAuthorizerResponse
s@UpdateAuthorizerResponse' {} Int
a -> UpdateAuthorizerResponse
s {$sel:httpStatus:UpdateAuthorizerResponse' :: Int
httpStatus = Int
a} :: UpdateAuthorizerResponse)

instance Prelude.NFData UpdateAuthorizerResponse