{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_authorizerPayloadFormatVersion,
    updateAuthorizer_authorizerResultTtlInSeconds,
    updateAuthorizer_authorizerType,
    updateAuthorizer_authorizerUri,
    updateAuthorizer_enableSimpleResponses,
    updateAuthorizer_identitySource,
    updateAuthorizer_identityValidationExpression,
    updateAuthorizer_jwtConfiguration,
    updateAuthorizer_name,
    updateAuthorizer_authorizerId,
    updateAuthorizer_apiId,

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

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

import Amazonka.ApiGatewayV2.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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,
    -- | 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,
    -- | 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 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\'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 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 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],
    -- | This parameter is not used.
    UpdateAuthorizer -> Maybe Text
identityValidationExpression :: 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 authorizer identifier.
    UpdateAuthorizer -> Text
authorizerId :: Prelude.Text,
    -- | The API identifier.
    UpdateAuthorizer -> Text
apiId :: Prelude.Text
  }
  deriving (UpdateAuthorizer -> UpdateAuthorizer -> Bool
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]
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
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. 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.
--
-- '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>.
--
-- '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.
--
-- '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).
--
-- '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.
--
-- '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>
--
-- '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.
--
-- 'identityValidationExpression', 'updateAuthorizer_identityValidationExpression' - This parameter is not used.
--
-- '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.
--
-- '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'
    { $sel:authorizerCredentialsArn:UpdateAuthorizer' :: Maybe Text
authorizerCredentialsArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerPayloadFormatVersion:UpdateAuthorizer' :: Maybe Text
authorizerPayloadFormatVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerResultTtlInSeconds:UpdateAuthorizer' :: Maybe Natural
authorizerResultTtlInSeconds = forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerType:UpdateAuthorizer' :: Maybe AuthorizerType
authorizerType = forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerUri:UpdateAuthorizer' :: Maybe Text
authorizerUri = forall a. Maybe a
Prelude.Nothing,
      $sel:enableSimpleResponses:UpdateAuthorizer' :: Maybe Bool
enableSimpleResponses = forall a. Maybe a
Prelude.Nothing,
      $sel:identitySource:UpdateAuthorizer' :: Maybe [Text]
identitySource = forall a. Maybe a
Prelude.Nothing,
      $sel:identityValidationExpression:UpdateAuthorizer' :: Maybe Text
identityValidationExpression = forall a. Maybe a
Prelude.Nothing,
      $sel:jwtConfiguration:UpdateAuthorizer' :: Maybe JWTConfiguration
jwtConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateAuthorizer' :: Maybe Text
name = 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 :: Lens' UpdateAuthorizer (Maybe Text)
updateAuthorizer_authorizerCredentialsArn = 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)

-- | 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 :: Lens' UpdateAuthorizer (Maybe Text)
updateAuthorizer_authorizerPayloadFormatVersion = 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)

-- | 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 :: Lens' UpdateAuthorizer (Maybe Natural)
updateAuthorizer_authorizerResultTtlInSeconds = 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 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 :: Lens' UpdateAuthorizer (Maybe AuthorizerType)
updateAuthorizer_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\'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 :: Lens' UpdateAuthorizer (Maybe Text)
updateAuthorizer_authorizerUri = 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 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 :: Lens' UpdateAuthorizer (Maybe Bool)
updateAuthorizer_enableSimpleResponses = 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 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 :: Lens' UpdateAuthorizer (Maybe [Text])
updateAuthorizer_identitySource = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | This parameter is not used.
updateAuthorizer_identityValidationExpression :: Lens.Lens' UpdateAuthorizer (Prelude.Maybe Prelude.Text)
updateAuthorizer_identityValidationExpression :: Lens' UpdateAuthorizer (Maybe Text)
updateAuthorizer_identityValidationExpression = 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)

-- | 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 :: Lens' UpdateAuthorizer (Maybe JWTConfiguration)
updateAuthorizer_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 :: Lens' UpdateAuthorizer (Maybe Text)
updateAuthorizer_name = 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 authorizer identifier.
updateAuthorizer_authorizerId :: Lens.Lens' UpdateAuthorizer Prelude.Text
updateAuthorizer_authorizerId :: Lens' UpdateAuthorizer Text
updateAuthorizer_authorizerId = 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 :: Lens' UpdateAuthorizer Text
updateAuthorizer_apiId = 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 :: (Service -> Service)
-> UpdateAuthorizer -> Request UpdateAuthorizer
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateAuthorizer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateAuthorizer)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe AuthorizerType
-> Maybe Text
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe JWTConfiguration
-> Maybe Text
-> Int
-> UpdateAuthorizerResponse
UpdateAuthorizerResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"authorizerCredentialsArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"authorizerId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"authorizerPayloadFormatVersion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"authorizerResultTtlInSeconds")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"authorizerType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"authorizerUri")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"enableSimpleResponses")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"identitySource" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"identityValidationExpression")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"jwtConfiguration")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateAuthorizer where
  hashWithSalt :: Int -> UpdateAuthorizer -> Int
hashWithSalt Int
_salt UpdateAuthorizer' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe Text
Maybe AuthorizerType
Maybe JWTConfiguration
Text
apiId :: Text
authorizerId :: Text
name :: Maybe Text
jwtConfiguration :: Maybe JWTConfiguration
identityValidationExpression :: Maybe Text
identitySource :: Maybe [Text]
enableSimpleResponses :: Maybe Bool
authorizerUri :: Maybe Text
authorizerType :: Maybe AuthorizerType
authorizerResultTtlInSeconds :: Maybe Natural
authorizerPayloadFormatVersion :: Maybe Text
authorizerCredentialsArn :: Maybe Text
$sel:apiId:UpdateAuthorizer' :: UpdateAuthorizer -> Text
$sel:authorizerId:UpdateAuthorizer' :: UpdateAuthorizer -> Text
$sel:name:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
$sel:jwtConfiguration:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe JWTConfiguration
$sel:identityValidationExpression:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
$sel:identitySource:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe [Text]
$sel:enableSimpleResponses:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Bool
$sel:authorizerUri:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
$sel:authorizerType:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe AuthorizerType
$sel:authorizerResultTtlInSeconds:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Natural
$sel:authorizerPayloadFormatVersion:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
$sel:authorizerCredentialsArn:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
authorizerCredentialsArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
authorizerPayloadFormatVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
authorizerResultTtlInSeconds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AuthorizerType
authorizerType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
authorizerUri
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enableSimpleResponses
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
identitySource
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
identityValidationExpression
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe JWTConfiguration
jwtConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
authorizerId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
apiId

instance Prelude.NFData UpdateAuthorizer where
  rnf :: UpdateAuthorizer -> ()
rnf UpdateAuthorizer' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe Text
Maybe AuthorizerType
Maybe JWTConfiguration
Text
apiId :: Text
authorizerId :: Text
name :: Maybe Text
jwtConfiguration :: Maybe JWTConfiguration
identityValidationExpression :: Maybe Text
identitySource :: Maybe [Text]
enableSimpleResponses :: Maybe Bool
authorizerUri :: Maybe Text
authorizerType :: Maybe AuthorizerType
authorizerResultTtlInSeconds :: Maybe Natural
authorizerPayloadFormatVersion :: Maybe Text
authorizerCredentialsArn :: Maybe Text
$sel:apiId:UpdateAuthorizer' :: UpdateAuthorizer -> Text
$sel:authorizerId:UpdateAuthorizer' :: UpdateAuthorizer -> Text
$sel:name:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
$sel:jwtConfiguration:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe JWTConfiguration
$sel:identityValidationExpression:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
$sel:identitySource:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe [Text]
$sel:enableSimpleResponses:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Bool
$sel:authorizerUri:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
$sel:authorizerType:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe AuthorizerType
$sel:authorizerResultTtlInSeconds:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Natural
$sel:authorizerPayloadFormatVersion:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
$sel:authorizerCredentialsArn:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
authorizerCredentialsArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
authorizerPayloadFormatVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
authorizerResultTtlInSeconds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AuthorizerType
authorizerType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
authorizerUri
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enableSimpleResponses
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
identitySource
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
identityValidationExpression
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe JWTConfiguration
jwtConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
authorizerId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
apiId

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

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

instance Data.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
name :: Maybe Text
jwtConfiguration :: Maybe JWTConfiguration
identityValidationExpression :: Maybe Text
identitySource :: Maybe [Text]
enableSimpleResponses :: Maybe Bool
authorizerUri :: Maybe Text
authorizerType :: Maybe AuthorizerType
authorizerResultTtlInSeconds :: Maybe Natural
authorizerPayloadFormatVersion :: Maybe Text
authorizerCredentialsArn :: Maybe Text
$sel:apiId:UpdateAuthorizer' :: UpdateAuthorizer -> Text
$sel:authorizerId:UpdateAuthorizer' :: UpdateAuthorizer -> Text
$sel:name:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
$sel:jwtConfiguration:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe JWTConfiguration
$sel:identityValidationExpression:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
$sel:identitySource:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe [Text]
$sel:enableSimpleResponses:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Bool
$sel:authorizerUri:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
$sel:authorizerType:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe AuthorizerType
$sel:authorizerResultTtlInSeconds:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Natural
$sel:authorizerPayloadFormatVersion:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
$sel:authorizerCredentialsArn:UpdateAuthorizer' :: UpdateAuthorizer -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v2/apis/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
apiId,
        ByteString
"/authorizers/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
authorizerId
      ]

instance Data.ToQuery UpdateAuthorizer where
  toQuery :: UpdateAuthorizer -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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 authorizer identifier.
    UpdateAuthorizerResponse -> Maybe Text
authorizerId :: 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,
    -- | 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 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 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 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 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 validation expression does not apply to the REQUEST authorizer.
    UpdateAuthorizerResponse -> Maybe Text
identityValidationExpression :: 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 name of the authorizer.
    UpdateAuthorizerResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateAuthorizerResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateAuthorizerResponse -> UpdateAuthorizerResponse -> Bool
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]
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
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.
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.
--
-- 'authorizerId', 'updateAuthorizerResponse_authorizerId' - The authorizer identifier.
--
-- '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>.
--
-- '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.
--
-- '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).
--
-- '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.
--
-- '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>
--
-- '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.
--
-- 'identityValidationExpression', 'updateAuthorizerResponse_identityValidationExpression' - The validation expression does not apply to the REQUEST authorizer.
--
-- 'jwtConfiguration', 'updateAuthorizerResponse_jwtConfiguration' - Represents the configuration of a JWT authorizer. Required for the JWT
-- authorizer type. Supported only for HTTP APIs.
--
-- 'name', 'updateAuthorizerResponse_name' - The name of the authorizer.
--
-- 'httpStatus', 'updateAuthorizerResponse_httpStatus' - The response's http status code.
newUpdateAuthorizerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateAuthorizerResponse
newUpdateAuthorizerResponse :: Int -> UpdateAuthorizerResponse
newUpdateAuthorizerResponse Int
pHttpStatus_ =
  UpdateAuthorizerResponse'
    { $sel:authorizerCredentialsArn:UpdateAuthorizerResponse' :: Maybe Text
authorizerCredentialsArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerId:UpdateAuthorizerResponse' :: Maybe Text
authorizerId = forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerPayloadFormatVersion:UpdateAuthorizerResponse' :: Maybe Text
authorizerPayloadFormatVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerResultTtlInSeconds:UpdateAuthorizerResponse' :: Maybe Natural
authorizerResultTtlInSeconds = forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerType:UpdateAuthorizerResponse' :: Maybe AuthorizerType
authorizerType = forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerUri:UpdateAuthorizerResponse' :: Maybe Text
authorizerUri = forall a. Maybe a
Prelude.Nothing,
      $sel:enableSimpleResponses:UpdateAuthorizerResponse' :: Maybe Bool
enableSimpleResponses = forall a. Maybe a
Prelude.Nothing,
      $sel:identitySource:UpdateAuthorizerResponse' :: Maybe [Text]
identitySource = forall a. Maybe a
Prelude.Nothing,
      $sel:identityValidationExpression:UpdateAuthorizerResponse' :: Maybe Text
identityValidationExpression = forall a. Maybe a
Prelude.Nothing,
      $sel:jwtConfiguration:UpdateAuthorizerResponse' :: Maybe JWTConfiguration
jwtConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateAuthorizerResponse' :: Maybe Text
name = 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 :: Lens' UpdateAuthorizerResponse (Maybe Text)
updateAuthorizerResponse_authorizerCredentialsArn = 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 authorizer identifier.
updateAuthorizerResponse_authorizerId :: Lens.Lens' UpdateAuthorizerResponse (Prelude.Maybe Prelude.Text)
updateAuthorizerResponse_authorizerId :: Lens' UpdateAuthorizerResponse (Maybe Text)
updateAuthorizerResponse_authorizerId = 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)

-- | 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 :: Lens' UpdateAuthorizerResponse (Maybe Text)
updateAuthorizerResponse_authorizerPayloadFormatVersion = 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)

-- | 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 :: Lens' UpdateAuthorizerResponse (Maybe Natural)
updateAuthorizerResponse_authorizerResultTtlInSeconds = 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 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 :: Lens' UpdateAuthorizerResponse (Maybe AuthorizerType)
updateAuthorizerResponse_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 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 :: Lens' UpdateAuthorizerResponse (Maybe Text)
updateAuthorizerResponse_authorizerUri = 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 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 :: Lens' UpdateAuthorizerResponse (Maybe Bool)
updateAuthorizerResponse_enableSimpleResponses = 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 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 :: Lens' UpdateAuthorizerResponse (Maybe [Text])
updateAuthorizerResponse_identitySource = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The validation expression does not apply to the REQUEST authorizer.
updateAuthorizerResponse_identityValidationExpression :: Lens.Lens' UpdateAuthorizerResponse (Prelude.Maybe Prelude.Text)
updateAuthorizerResponse_identityValidationExpression :: Lens' UpdateAuthorizerResponse (Maybe Text)
updateAuthorizerResponse_identityValidationExpression = 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)

-- | 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 :: Lens' UpdateAuthorizerResponse (Maybe JWTConfiguration)
updateAuthorizerResponse_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 name of the authorizer.
updateAuthorizerResponse_name :: Lens.Lens' UpdateAuthorizerResponse (Prelude.Maybe Prelude.Text)
updateAuthorizerResponse_name :: Lens' UpdateAuthorizerResponse (Maybe Text)
updateAuthorizerResponse_name = 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 response's http status code.
updateAuthorizerResponse_httpStatus :: Lens.Lens' UpdateAuthorizerResponse Prelude.Int
updateAuthorizerResponse_httpStatus :: Lens' UpdateAuthorizerResponse Int
updateAuthorizerResponse_httpStatus = 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 where
  rnf :: UpdateAuthorizerResponse -> ()
rnf UpdateAuthorizerResponse' {Int
Maybe Bool
Maybe Natural
Maybe [Text]
Maybe Text
Maybe AuthorizerType
Maybe JWTConfiguration
httpStatus :: Int
name :: Maybe Text
jwtConfiguration :: Maybe JWTConfiguration
identityValidationExpression :: Maybe Text
identitySource :: Maybe [Text]
enableSimpleResponses :: Maybe Bool
authorizerUri :: Maybe Text
authorizerType :: Maybe AuthorizerType
authorizerResultTtlInSeconds :: Maybe Natural
authorizerPayloadFormatVersion :: Maybe Text
authorizerId :: Maybe Text
authorizerCredentialsArn :: Maybe Text
$sel:httpStatus:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Int
$sel:name:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe Text
$sel:jwtConfiguration:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe JWTConfiguration
$sel:identityValidationExpression:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe Text
$sel:identitySource:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe [Text]
$sel:enableSimpleResponses:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe Bool
$sel:authorizerUri:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe Text
$sel:authorizerType:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe AuthorizerType
$sel:authorizerResultTtlInSeconds:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe Natural
$sel:authorizerPayloadFormatVersion:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe Text
$sel:authorizerId:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe Text
$sel:authorizerCredentialsArn:UpdateAuthorizerResponse' :: UpdateAuthorizerResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
authorizerCredentialsArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
authorizerId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
authorizerPayloadFormatVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
authorizerResultTtlInSeconds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AuthorizerType
authorizerType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
authorizerUri
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enableSimpleResponses
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
identitySource
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
identityValidationExpression
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe JWTConfiguration
jwtConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus