{-# 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.GetAuthorizer
-- 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)
--
-- Gets an Authorizer.
module Amazonka.ApiGatewayV2.GetAuthorizer
  ( -- * Creating a Request
    GetAuthorizer (..),
    newGetAuthorizer,

    -- * Request Lenses
    getAuthorizer_authorizerId,
    getAuthorizer_apiId,

    -- * Destructuring the Response
    GetAuthorizerResponse (..),
    newGetAuthorizerResponse,

    -- * Response Lenses
    getAuthorizerResponse_authorizerCredentialsArn,
    getAuthorizerResponse_identityValidationExpression,
    getAuthorizerResponse_enableSimpleResponses,
    getAuthorizerResponse_authorizerUri,
    getAuthorizerResponse_authorizerPayloadFormatVersion,
    getAuthorizerResponse_jwtConfiguration,
    getAuthorizerResponse_authorizerId,
    getAuthorizerResponse_name,
    getAuthorizerResponse_authorizerResultTtlInSeconds,
    getAuthorizerResponse_identitySource,
    getAuthorizerResponse_authorizerType,
    getAuthorizerResponse_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

-- | /See:/ 'newGetAuthorizer' smart constructor.
data GetAuthorizer = GetAuthorizer'
  { -- | The authorizer identifier.
    GetAuthorizer -> Text
authorizerId :: Prelude.Text,
    -- | The API identifier.
    GetAuthorizer -> Text
apiId :: Prelude.Text
  }
  deriving (GetAuthorizer -> GetAuthorizer -> Bool
(GetAuthorizer -> GetAuthorizer -> Bool)
-> (GetAuthorizer -> GetAuthorizer -> Bool) -> Eq GetAuthorizer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAuthorizer -> GetAuthorizer -> Bool
$c/= :: GetAuthorizer -> GetAuthorizer -> Bool
== :: GetAuthorizer -> GetAuthorizer -> Bool
$c== :: GetAuthorizer -> GetAuthorizer -> Bool
Prelude.Eq, ReadPrec [GetAuthorizer]
ReadPrec GetAuthorizer
Int -> ReadS GetAuthorizer
ReadS [GetAuthorizer]
(Int -> ReadS GetAuthorizer)
-> ReadS [GetAuthorizer]
-> ReadPrec GetAuthorizer
-> ReadPrec [GetAuthorizer]
-> Read GetAuthorizer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAuthorizer]
$creadListPrec :: ReadPrec [GetAuthorizer]
readPrec :: ReadPrec GetAuthorizer
$creadPrec :: ReadPrec GetAuthorizer
readList :: ReadS [GetAuthorizer]
$creadList :: ReadS [GetAuthorizer]
readsPrec :: Int -> ReadS GetAuthorizer
$creadsPrec :: Int -> ReadS GetAuthorizer
Prelude.Read, Int -> GetAuthorizer -> ShowS
[GetAuthorizer] -> ShowS
GetAuthorizer -> String
(Int -> GetAuthorizer -> ShowS)
-> (GetAuthorizer -> String)
-> ([GetAuthorizer] -> ShowS)
-> Show GetAuthorizer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAuthorizer] -> ShowS
$cshowList :: [GetAuthorizer] -> ShowS
show :: GetAuthorizer -> String
$cshow :: GetAuthorizer -> String
showsPrec :: Int -> GetAuthorizer -> ShowS
$cshowsPrec :: Int -> GetAuthorizer -> ShowS
Prelude.Show, (forall x. GetAuthorizer -> Rep GetAuthorizer x)
-> (forall x. Rep GetAuthorizer x -> GetAuthorizer)
-> Generic GetAuthorizer
forall x. Rep GetAuthorizer x -> GetAuthorizer
forall x. GetAuthorizer -> Rep GetAuthorizer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAuthorizer x -> GetAuthorizer
$cfrom :: forall x. GetAuthorizer -> Rep GetAuthorizer x
Prelude.Generic)

-- |
-- Create a value of 'GetAuthorizer' 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:
--
-- 'authorizerId', 'getAuthorizer_authorizerId' - The authorizer identifier.
--
-- 'apiId', 'getAuthorizer_apiId' - The API identifier.
newGetAuthorizer ::
  -- | 'authorizerId'
  Prelude.Text ->
  -- | 'apiId'
  Prelude.Text ->
  GetAuthorizer
newGetAuthorizer :: Text -> Text -> GetAuthorizer
newGetAuthorizer Text
pAuthorizerId_ Text
pApiId_ =
  GetAuthorizer' :: Text -> Text -> GetAuthorizer
GetAuthorizer'
    { $sel:authorizerId:GetAuthorizer' :: Text
authorizerId = Text
pAuthorizerId_,
      $sel:apiId:GetAuthorizer' :: Text
apiId = Text
pApiId_
    }

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

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

instance Core.AWSRequest GetAuthorizer where
  type
    AWSResponse GetAuthorizer =
      GetAuthorizerResponse
  request :: GetAuthorizer -> Request GetAuthorizer
request = Service -> GetAuthorizer -> Request GetAuthorizer
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetAuthorizer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetAuthorizer)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetAuthorizer))
-> Logger
-> Service
-> Proxy GetAuthorizer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetAuthorizer)))
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
-> GetAuthorizerResponse
GetAuthorizerResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe JWTConfiguration
 -> Maybe Text
 -> Maybe Text
 -> Maybe Natural
 -> Maybe [Text]
 -> Maybe AuthorizerType
 -> Int
 -> GetAuthorizerResponse)
-> 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
      -> GetAuthorizerResponse)
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
   -> GetAuthorizerResponse)
-> 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
      -> GetAuthorizerResponse)
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
   -> GetAuthorizerResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe JWTConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe [Text]
      -> Maybe AuthorizerType
      -> Int
      -> GetAuthorizerResponse)
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
   -> GetAuthorizerResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe JWTConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe [Text]
      -> Maybe AuthorizerType
      -> Int
      -> GetAuthorizerResponse)
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
   -> GetAuthorizerResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe JWTConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe [Text]
      -> Maybe AuthorizerType
      -> Int
      -> GetAuthorizerResponse)
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
   -> GetAuthorizerResponse)
-> Either String (Maybe JWTConfiguration)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe [Text]
      -> Maybe AuthorizerType
      -> Int
      -> GetAuthorizerResponse)
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
   -> GetAuthorizerResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Natural
      -> Maybe [Text]
      -> Maybe AuthorizerType
      -> Int
      -> GetAuthorizerResponse)
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
   -> GetAuthorizerResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Natural
      -> Maybe [Text]
      -> Maybe AuthorizerType
      -> Int
      -> GetAuthorizerResponse)
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
   -> GetAuthorizerResponse)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe [Text]
      -> Maybe AuthorizerType -> Int -> GetAuthorizerResponse)
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 -> GetAuthorizerResponse)
-> Either String (Maybe [Text])
-> Either
     String (Maybe AuthorizerType -> Int -> GetAuthorizerResponse)
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 -> GetAuthorizerResponse)
-> Either String (Maybe AuthorizerType)
-> Either String (Int -> GetAuthorizerResponse)
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 -> GetAuthorizerResponse)
-> Either String Int -> Either String GetAuthorizerResponse
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 GetAuthorizer

instance Prelude.NFData GetAuthorizer

instance Core.ToHeaders GetAuthorizer where
  toHeaders :: GetAuthorizer -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetAuthorizer -> 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.ToPath GetAuthorizer where
  toPath :: GetAuthorizer -> ByteString
toPath GetAuthorizer' {Text
apiId :: Text
authorizerId :: Text
$sel:apiId:GetAuthorizer' :: GetAuthorizer -> Text
$sel:authorizerId:GetAuthorizer' :: GetAuthorizer -> 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 GetAuthorizer where
  toQuery :: GetAuthorizer -> QueryString
toQuery = QueryString -> GetAuthorizer -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetAuthorizerResponse' smart constructor.
data GetAuthorizerResponse = GetAuthorizerResponse'
  { -- | 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.
    GetAuthorizerResponse -> Maybe Text
authorizerCredentialsArn :: Prelude.Maybe Prelude.Text,
    -- | The validation expression does not apply to the REQUEST authorizer.
    GetAuthorizerResponse -> 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>
    GetAuthorizerResponse -> 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.
    GetAuthorizerResponse -> 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>.
    GetAuthorizerResponse -> 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.
    GetAuthorizerResponse -> Maybe JWTConfiguration
jwtConfiguration :: Prelude.Maybe JWTConfiguration,
    -- | The authorizer identifier.
    GetAuthorizerResponse -> Maybe Text
authorizerId :: Prelude.Maybe Prelude.Text,
    -- | The name of the authorizer.
    GetAuthorizerResponse -> 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.
    GetAuthorizerResponse -> 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.
    GetAuthorizerResponse -> 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).
    GetAuthorizerResponse -> Maybe AuthorizerType
authorizerType :: Prelude.Maybe AuthorizerType,
    -- | The response's http status code.
    GetAuthorizerResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetAuthorizerResponse -> GetAuthorizerResponse -> Bool
(GetAuthorizerResponse -> GetAuthorizerResponse -> Bool)
-> (GetAuthorizerResponse -> GetAuthorizerResponse -> Bool)
-> Eq GetAuthorizerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAuthorizerResponse -> GetAuthorizerResponse -> Bool
$c/= :: GetAuthorizerResponse -> GetAuthorizerResponse -> Bool
== :: GetAuthorizerResponse -> GetAuthorizerResponse -> Bool
$c== :: GetAuthorizerResponse -> GetAuthorizerResponse -> Bool
Prelude.Eq, ReadPrec [GetAuthorizerResponse]
ReadPrec GetAuthorizerResponse
Int -> ReadS GetAuthorizerResponse
ReadS [GetAuthorizerResponse]
(Int -> ReadS GetAuthorizerResponse)
-> ReadS [GetAuthorizerResponse]
-> ReadPrec GetAuthorizerResponse
-> ReadPrec [GetAuthorizerResponse]
-> Read GetAuthorizerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAuthorizerResponse]
$creadListPrec :: ReadPrec [GetAuthorizerResponse]
readPrec :: ReadPrec GetAuthorizerResponse
$creadPrec :: ReadPrec GetAuthorizerResponse
readList :: ReadS [GetAuthorizerResponse]
$creadList :: ReadS [GetAuthorizerResponse]
readsPrec :: Int -> ReadS GetAuthorizerResponse
$creadsPrec :: Int -> ReadS GetAuthorizerResponse
Prelude.Read, Int -> GetAuthorizerResponse -> ShowS
[GetAuthorizerResponse] -> ShowS
GetAuthorizerResponse -> String
(Int -> GetAuthorizerResponse -> ShowS)
-> (GetAuthorizerResponse -> String)
-> ([GetAuthorizerResponse] -> ShowS)
-> Show GetAuthorizerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAuthorizerResponse] -> ShowS
$cshowList :: [GetAuthorizerResponse] -> ShowS
show :: GetAuthorizerResponse -> String
$cshow :: GetAuthorizerResponse -> String
showsPrec :: Int -> GetAuthorizerResponse -> ShowS
$cshowsPrec :: Int -> GetAuthorizerResponse -> ShowS
Prelude.Show, (forall x. GetAuthorizerResponse -> Rep GetAuthorizerResponse x)
-> (forall x. Rep GetAuthorizerResponse x -> GetAuthorizerResponse)
-> Generic GetAuthorizerResponse
forall x. Rep GetAuthorizerResponse x -> GetAuthorizerResponse
forall x. GetAuthorizerResponse -> Rep GetAuthorizerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAuthorizerResponse x -> GetAuthorizerResponse
$cfrom :: forall x. GetAuthorizerResponse -> Rep GetAuthorizerResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetAuthorizerResponse' 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', 'getAuthorizerResponse_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', 'getAuthorizerResponse_identityValidationExpression' - The validation expression does not apply to the REQUEST authorizer.
--
-- 'enableSimpleResponses', 'getAuthorizerResponse_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', 'getAuthorizerResponse_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', 'getAuthorizerResponse_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', 'getAuthorizerResponse_jwtConfiguration' - Represents the configuration of a JWT authorizer. Required for the JWT
-- authorizer type. Supported only for HTTP APIs.
--
-- 'authorizerId', 'getAuthorizerResponse_authorizerId' - The authorizer identifier.
--
-- 'name', 'getAuthorizerResponse_name' - The name of the authorizer.
--
-- 'authorizerResultTtlInSeconds', 'getAuthorizerResponse_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', 'getAuthorizerResponse_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', 'getAuthorizerResponse_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', 'getAuthorizerResponse_httpStatus' - The response's http status code.
newGetAuthorizerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetAuthorizerResponse
newGetAuthorizerResponse :: Int -> GetAuthorizerResponse
newGetAuthorizerResponse Int
pHttpStatus_ =
  GetAuthorizerResponse' :: Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe JWTConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe [Text]
-> Maybe AuthorizerType
-> Int
-> GetAuthorizerResponse
GetAuthorizerResponse'
    { $sel:authorizerCredentialsArn:GetAuthorizerResponse' :: Maybe Text
authorizerCredentialsArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:identityValidationExpression:GetAuthorizerResponse' :: Maybe Text
identityValidationExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enableSimpleResponses:GetAuthorizerResponse' :: Maybe Bool
enableSimpleResponses = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerUri:GetAuthorizerResponse' :: Maybe Text
authorizerUri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerPayloadFormatVersion:GetAuthorizerResponse' :: Maybe Text
authorizerPayloadFormatVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jwtConfiguration:GetAuthorizerResponse' :: Maybe JWTConfiguration
jwtConfiguration = Maybe JWTConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerId:GetAuthorizerResponse' :: Maybe Text
authorizerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetAuthorizerResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerResultTtlInSeconds:GetAuthorizerResponse' :: Maybe Natural
authorizerResultTtlInSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:identitySource:GetAuthorizerResponse' :: Maybe [Text]
identitySource = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerType:GetAuthorizerResponse' :: Maybe AuthorizerType
authorizerType = Maybe AuthorizerType
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetAuthorizerResponse' :: 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.
getAuthorizerResponse_authorizerCredentialsArn :: Lens.Lens' GetAuthorizerResponse (Prelude.Maybe Prelude.Text)
getAuthorizerResponse_authorizerCredentialsArn :: (Maybe Text -> f (Maybe Text))
-> GetAuthorizerResponse -> f GetAuthorizerResponse
getAuthorizerResponse_authorizerCredentialsArn = (GetAuthorizerResponse -> Maybe Text)
-> (GetAuthorizerResponse -> Maybe Text -> GetAuthorizerResponse)
-> Lens
     GetAuthorizerResponse
     GetAuthorizerResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAuthorizerResponse' {Maybe Text
authorizerCredentialsArn :: Maybe Text
$sel:authorizerCredentialsArn:GetAuthorizerResponse' :: GetAuthorizerResponse -> Maybe Text
authorizerCredentialsArn} -> Maybe Text
authorizerCredentialsArn) (\s :: GetAuthorizerResponse
s@GetAuthorizerResponse' {} Maybe Text
a -> GetAuthorizerResponse
s {$sel:authorizerCredentialsArn:GetAuthorizerResponse' :: Maybe Text
authorizerCredentialsArn = Maybe Text
a} :: GetAuthorizerResponse)

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

-- | 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>
getAuthorizerResponse_enableSimpleResponses :: Lens.Lens' GetAuthorizerResponse (Prelude.Maybe Prelude.Bool)
getAuthorizerResponse_enableSimpleResponses :: (Maybe Bool -> f (Maybe Bool))
-> GetAuthorizerResponse -> f GetAuthorizerResponse
getAuthorizerResponse_enableSimpleResponses = (GetAuthorizerResponse -> Maybe Bool)
-> (GetAuthorizerResponse -> Maybe Bool -> GetAuthorizerResponse)
-> Lens
     GetAuthorizerResponse
     GetAuthorizerResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAuthorizerResponse' {Maybe Bool
enableSimpleResponses :: Maybe Bool
$sel:enableSimpleResponses:GetAuthorizerResponse' :: GetAuthorizerResponse -> Maybe Bool
enableSimpleResponses} -> Maybe Bool
enableSimpleResponses) (\s :: GetAuthorizerResponse
s@GetAuthorizerResponse' {} Maybe Bool
a -> GetAuthorizerResponse
s {$sel:enableSimpleResponses:GetAuthorizerResponse' :: Maybe Bool
enableSimpleResponses = Maybe Bool
a} :: GetAuthorizerResponse)

-- | 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.
getAuthorizerResponse_authorizerUri :: Lens.Lens' GetAuthorizerResponse (Prelude.Maybe Prelude.Text)
getAuthorizerResponse_authorizerUri :: (Maybe Text -> f (Maybe Text))
-> GetAuthorizerResponse -> f GetAuthorizerResponse
getAuthorizerResponse_authorizerUri = (GetAuthorizerResponse -> Maybe Text)
-> (GetAuthorizerResponse -> Maybe Text -> GetAuthorizerResponse)
-> Lens
     GetAuthorizerResponse
     GetAuthorizerResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAuthorizerResponse' {Maybe Text
authorizerUri :: Maybe Text
$sel:authorizerUri:GetAuthorizerResponse' :: GetAuthorizerResponse -> Maybe Text
authorizerUri} -> Maybe Text
authorizerUri) (\s :: GetAuthorizerResponse
s@GetAuthorizerResponse' {} Maybe Text
a -> GetAuthorizerResponse
s {$sel:authorizerUri:GetAuthorizerResponse' :: Maybe Text
authorizerUri = Maybe Text
a} :: GetAuthorizerResponse)

-- | 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>.
getAuthorizerResponse_authorizerPayloadFormatVersion :: Lens.Lens' GetAuthorizerResponse (Prelude.Maybe Prelude.Text)
getAuthorizerResponse_authorizerPayloadFormatVersion :: (Maybe Text -> f (Maybe Text))
-> GetAuthorizerResponse -> f GetAuthorizerResponse
getAuthorizerResponse_authorizerPayloadFormatVersion = (GetAuthorizerResponse -> Maybe Text)
-> (GetAuthorizerResponse -> Maybe Text -> GetAuthorizerResponse)
-> Lens
     GetAuthorizerResponse
     GetAuthorizerResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAuthorizerResponse' {Maybe Text
authorizerPayloadFormatVersion :: Maybe Text
$sel:authorizerPayloadFormatVersion:GetAuthorizerResponse' :: GetAuthorizerResponse -> Maybe Text
authorizerPayloadFormatVersion} -> Maybe Text
authorizerPayloadFormatVersion) (\s :: GetAuthorizerResponse
s@GetAuthorizerResponse' {} Maybe Text
a -> GetAuthorizerResponse
s {$sel:authorizerPayloadFormatVersion:GetAuthorizerResponse' :: Maybe Text
authorizerPayloadFormatVersion = Maybe Text
a} :: GetAuthorizerResponse)

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

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

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

-- | 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.
getAuthorizerResponse_authorizerResultTtlInSeconds :: Lens.Lens' GetAuthorizerResponse (Prelude.Maybe Prelude.Natural)
getAuthorizerResponse_authorizerResultTtlInSeconds :: (Maybe Natural -> f (Maybe Natural))
-> GetAuthorizerResponse -> f GetAuthorizerResponse
getAuthorizerResponse_authorizerResultTtlInSeconds = (GetAuthorizerResponse -> Maybe Natural)
-> (GetAuthorizerResponse
    -> Maybe Natural -> GetAuthorizerResponse)
-> Lens
     GetAuthorizerResponse
     GetAuthorizerResponse
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAuthorizerResponse' {Maybe Natural
authorizerResultTtlInSeconds :: Maybe Natural
$sel:authorizerResultTtlInSeconds:GetAuthorizerResponse' :: GetAuthorizerResponse -> Maybe Natural
authorizerResultTtlInSeconds} -> Maybe Natural
authorizerResultTtlInSeconds) (\s :: GetAuthorizerResponse
s@GetAuthorizerResponse' {} Maybe Natural
a -> GetAuthorizerResponse
s {$sel:authorizerResultTtlInSeconds:GetAuthorizerResponse' :: Maybe Natural
authorizerResultTtlInSeconds = Maybe Natural
a} :: GetAuthorizerResponse)

-- | 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.
getAuthorizerResponse_identitySource :: Lens.Lens' GetAuthorizerResponse (Prelude.Maybe [Prelude.Text])
getAuthorizerResponse_identitySource :: (Maybe [Text] -> f (Maybe [Text]))
-> GetAuthorizerResponse -> f GetAuthorizerResponse
getAuthorizerResponse_identitySource = (GetAuthorizerResponse -> Maybe [Text])
-> (GetAuthorizerResponse -> Maybe [Text] -> GetAuthorizerResponse)
-> Lens
     GetAuthorizerResponse
     GetAuthorizerResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAuthorizerResponse' {Maybe [Text]
identitySource :: Maybe [Text]
$sel:identitySource:GetAuthorizerResponse' :: GetAuthorizerResponse -> Maybe [Text]
identitySource} -> Maybe [Text]
identitySource) (\s :: GetAuthorizerResponse
s@GetAuthorizerResponse' {} Maybe [Text]
a -> GetAuthorizerResponse
s {$sel:identitySource:GetAuthorizerResponse' :: Maybe [Text]
identitySource = Maybe [Text]
a} :: GetAuthorizerResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetAuthorizerResponse -> f GetAuthorizerResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetAuthorizerResponse
-> f GetAuthorizerResponse
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).
getAuthorizerResponse_authorizerType :: Lens.Lens' GetAuthorizerResponse (Prelude.Maybe AuthorizerType)
getAuthorizerResponse_authorizerType :: (Maybe AuthorizerType -> f (Maybe AuthorizerType))
-> GetAuthorizerResponse -> f GetAuthorizerResponse
getAuthorizerResponse_authorizerType = (GetAuthorizerResponse -> Maybe AuthorizerType)
-> (GetAuthorizerResponse
    -> Maybe AuthorizerType -> GetAuthorizerResponse)
-> Lens
     GetAuthorizerResponse
     GetAuthorizerResponse
     (Maybe AuthorizerType)
     (Maybe AuthorizerType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAuthorizerResponse' {Maybe AuthorizerType
authorizerType :: Maybe AuthorizerType
$sel:authorizerType:GetAuthorizerResponse' :: GetAuthorizerResponse -> Maybe AuthorizerType
authorizerType} -> Maybe AuthorizerType
authorizerType) (\s :: GetAuthorizerResponse
s@GetAuthorizerResponse' {} Maybe AuthorizerType
a -> GetAuthorizerResponse
s {$sel:authorizerType:GetAuthorizerResponse' :: Maybe AuthorizerType
authorizerType = Maybe AuthorizerType
a} :: GetAuthorizerResponse)

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

instance Prelude.NFData GetAuthorizerResponse