{-# 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.APIGateway.TestInvokeAuthorizer
-- 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)
--
-- Simulate the execution of an Authorizer in your RestApi with headers,
-- parameters, and an incoming request body.
--
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-use-lambda-authorizer.html Use Lambda Function as Authorizer>
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-integrate-with-cognito.html Use Cognito User Pool as Authorizer>
module Amazonka.APIGateway.TestInvokeAuthorizer
  ( -- * Creating a Request
    TestInvokeAuthorizer (..),
    newTestInvokeAuthorizer,

    -- * Request Lenses
    testInvokeAuthorizer_pathWithQueryString,
    testInvokeAuthorizer_body,
    testInvokeAuthorizer_additionalContext,
    testInvokeAuthorizer_stageVariables,
    testInvokeAuthorizer_headers,
    testInvokeAuthorizer_multiValueHeaders,
    testInvokeAuthorizer_restApiId,
    testInvokeAuthorizer_authorizerId,

    -- * Destructuring the Response
    TestInvokeAuthorizerResponse (..),
    newTestInvokeAuthorizerResponse,

    -- * Response Lenses
    testInvokeAuthorizerResponse_log,
    testInvokeAuthorizerResponse_principalId,
    testInvokeAuthorizerResponse_latency,
    testInvokeAuthorizerResponse_authorization,
    testInvokeAuthorizerResponse_claims,
    testInvokeAuthorizerResponse_clientStatus,
    testInvokeAuthorizerResponse_policy,
    testInvokeAuthorizerResponse_httpStatus,
  )
where

import Amazonka.APIGateway.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

-- | Make a request to simulate the execution of an Authorizer.
--
-- /See:/ 'newTestInvokeAuthorizer' smart constructor.
data TestInvokeAuthorizer = TestInvokeAuthorizer'
  { -- | [Optional] The URI path, including query string, of the simulated
    -- invocation request. Use this to specify path parameters and query string
    -- parameters.
    TestInvokeAuthorizer -> Maybe Text
pathWithQueryString :: Prelude.Maybe Prelude.Text,
    -- | [Optional] The simulated request body of an incoming invocation request.
    TestInvokeAuthorizer -> Maybe Text
body :: Prelude.Maybe Prelude.Text,
    -- | [Optional] A key-value map of additional context variables.
    TestInvokeAuthorizer -> Maybe (HashMap Text Text)
additionalContext :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A key-value map of stage variables to simulate an invocation on a
    -- deployed Stage.
    TestInvokeAuthorizer -> Maybe (HashMap Text Text)
stageVariables :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | [Required] A key-value map of headers to simulate an incoming invocation
    -- request. This is where the incoming authorization token, or identity
    -- source, should be specified.
    TestInvokeAuthorizer -> Maybe (HashMap Text Text)
headers :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | [Optional] The headers as a map from string to list of values to
    -- simulate an incoming invocation request. This is where the incoming
    -- authorization token, or identity source, may be specified.
    TestInvokeAuthorizer -> Maybe (HashMap Text [Text])
multiValueHeaders :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
    -- | [Required] The string identifier of the associated RestApi.
    TestInvokeAuthorizer -> Text
restApiId :: Prelude.Text,
    -- | [Required] Specifies a test invoke authorizer request\'s Authorizer ID.
    TestInvokeAuthorizer -> Text
authorizerId :: Prelude.Text
  }
  deriving (TestInvokeAuthorizer -> TestInvokeAuthorizer -> Bool
(TestInvokeAuthorizer -> TestInvokeAuthorizer -> Bool)
-> (TestInvokeAuthorizer -> TestInvokeAuthorizer -> Bool)
-> Eq TestInvokeAuthorizer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestInvokeAuthorizer -> TestInvokeAuthorizer -> Bool
$c/= :: TestInvokeAuthorizer -> TestInvokeAuthorizer -> Bool
== :: TestInvokeAuthorizer -> TestInvokeAuthorizer -> Bool
$c== :: TestInvokeAuthorizer -> TestInvokeAuthorizer -> Bool
Prelude.Eq, ReadPrec [TestInvokeAuthorizer]
ReadPrec TestInvokeAuthorizer
Int -> ReadS TestInvokeAuthorizer
ReadS [TestInvokeAuthorizer]
(Int -> ReadS TestInvokeAuthorizer)
-> ReadS [TestInvokeAuthorizer]
-> ReadPrec TestInvokeAuthorizer
-> ReadPrec [TestInvokeAuthorizer]
-> Read TestInvokeAuthorizer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TestInvokeAuthorizer]
$creadListPrec :: ReadPrec [TestInvokeAuthorizer]
readPrec :: ReadPrec TestInvokeAuthorizer
$creadPrec :: ReadPrec TestInvokeAuthorizer
readList :: ReadS [TestInvokeAuthorizer]
$creadList :: ReadS [TestInvokeAuthorizer]
readsPrec :: Int -> ReadS TestInvokeAuthorizer
$creadsPrec :: Int -> ReadS TestInvokeAuthorizer
Prelude.Read, Int -> TestInvokeAuthorizer -> ShowS
[TestInvokeAuthorizer] -> ShowS
TestInvokeAuthorizer -> String
(Int -> TestInvokeAuthorizer -> ShowS)
-> (TestInvokeAuthorizer -> String)
-> ([TestInvokeAuthorizer] -> ShowS)
-> Show TestInvokeAuthorizer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TestInvokeAuthorizer] -> ShowS
$cshowList :: [TestInvokeAuthorizer] -> ShowS
show :: TestInvokeAuthorizer -> String
$cshow :: TestInvokeAuthorizer -> String
showsPrec :: Int -> TestInvokeAuthorizer -> ShowS
$cshowsPrec :: Int -> TestInvokeAuthorizer -> ShowS
Prelude.Show, (forall x. TestInvokeAuthorizer -> Rep TestInvokeAuthorizer x)
-> (forall x. Rep TestInvokeAuthorizer x -> TestInvokeAuthorizer)
-> Generic TestInvokeAuthorizer
forall x. Rep TestInvokeAuthorizer x -> TestInvokeAuthorizer
forall x. TestInvokeAuthorizer -> Rep TestInvokeAuthorizer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TestInvokeAuthorizer x -> TestInvokeAuthorizer
$cfrom :: forall x. TestInvokeAuthorizer -> Rep TestInvokeAuthorizer x
Prelude.Generic)

-- |
-- Create a value of 'TestInvokeAuthorizer' 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:
--
-- 'pathWithQueryString', 'testInvokeAuthorizer_pathWithQueryString' - [Optional] The URI path, including query string, of the simulated
-- invocation request. Use this to specify path parameters and query string
-- parameters.
--
-- 'body', 'testInvokeAuthorizer_body' - [Optional] The simulated request body of an incoming invocation request.
--
-- 'additionalContext', 'testInvokeAuthorizer_additionalContext' - [Optional] A key-value map of additional context variables.
--
-- 'stageVariables', 'testInvokeAuthorizer_stageVariables' - A key-value map of stage variables to simulate an invocation on a
-- deployed Stage.
--
-- 'headers', 'testInvokeAuthorizer_headers' - [Required] A key-value map of headers to simulate an incoming invocation
-- request. This is where the incoming authorization token, or identity
-- source, should be specified.
--
-- 'multiValueHeaders', 'testInvokeAuthorizer_multiValueHeaders' - [Optional] The headers as a map from string to list of values to
-- simulate an incoming invocation request. This is where the incoming
-- authorization token, or identity source, may be specified.
--
-- 'restApiId', 'testInvokeAuthorizer_restApiId' - [Required] The string identifier of the associated RestApi.
--
-- 'authorizerId', 'testInvokeAuthorizer_authorizerId' - [Required] Specifies a test invoke authorizer request\'s Authorizer ID.
newTestInvokeAuthorizer ::
  -- | 'restApiId'
  Prelude.Text ->
  -- | 'authorizerId'
  Prelude.Text ->
  TestInvokeAuthorizer
newTestInvokeAuthorizer :: Text -> Text -> TestInvokeAuthorizer
newTestInvokeAuthorizer Text
pRestApiId_ Text
pAuthorizerId_ =
  TestInvokeAuthorizer' :: Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text [Text])
-> Text
-> Text
-> TestInvokeAuthorizer
TestInvokeAuthorizer'
    { $sel:pathWithQueryString:TestInvokeAuthorizer' :: Maybe Text
pathWithQueryString =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:body:TestInvokeAuthorizer' :: Maybe Text
body = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:additionalContext:TestInvokeAuthorizer' :: Maybe (HashMap Text Text)
additionalContext = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:stageVariables:TestInvokeAuthorizer' :: Maybe (HashMap Text Text)
stageVariables = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:headers:TestInvokeAuthorizer' :: Maybe (HashMap Text Text)
headers = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:multiValueHeaders:TestInvokeAuthorizer' :: Maybe (HashMap Text [Text])
multiValueHeaders = Maybe (HashMap Text [Text])
forall a. Maybe a
Prelude.Nothing,
      $sel:restApiId:TestInvokeAuthorizer' :: Text
restApiId = Text
pRestApiId_,
      $sel:authorizerId:TestInvokeAuthorizer' :: Text
authorizerId = Text
pAuthorizerId_
    }

-- | [Optional] The URI path, including query string, of the simulated
-- invocation request. Use this to specify path parameters and query string
-- parameters.
testInvokeAuthorizer_pathWithQueryString :: Lens.Lens' TestInvokeAuthorizer (Prelude.Maybe Prelude.Text)
testInvokeAuthorizer_pathWithQueryString :: (Maybe Text -> f (Maybe Text))
-> TestInvokeAuthorizer -> f TestInvokeAuthorizer
testInvokeAuthorizer_pathWithQueryString = (TestInvokeAuthorizer -> Maybe Text)
-> (TestInvokeAuthorizer -> Maybe Text -> TestInvokeAuthorizer)
-> Lens
     TestInvokeAuthorizer TestInvokeAuthorizer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeAuthorizer' {Maybe Text
pathWithQueryString :: Maybe Text
$sel:pathWithQueryString:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Maybe Text
pathWithQueryString} -> Maybe Text
pathWithQueryString) (\s :: TestInvokeAuthorizer
s@TestInvokeAuthorizer' {} Maybe Text
a -> TestInvokeAuthorizer
s {$sel:pathWithQueryString:TestInvokeAuthorizer' :: Maybe Text
pathWithQueryString = Maybe Text
a} :: TestInvokeAuthorizer)

-- | [Optional] The simulated request body of an incoming invocation request.
testInvokeAuthorizer_body :: Lens.Lens' TestInvokeAuthorizer (Prelude.Maybe Prelude.Text)
testInvokeAuthorizer_body :: (Maybe Text -> f (Maybe Text))
-> TestInvokeAuthorizer -> f TestInvokeAuthorizer
testInvokeAuthorizer_body = (TestInvokeAuthorizer -> Maybe Text)
-> (TestInvokeAuthorizer -> Maybe Text -> TestInvokeAuthorizer)
-> Lens
     TestInvokeAuthorizer TestInvokeAuthorizer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeAuthorizer' {Maybe Text
body :: Maybe Text
$sel:body:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Maybe Text
body} -> Maybe Text
body) (\s :: TestInvokeAuthorizer
s@TestInvokeAuthorizer' {} Maybe Text
a -> TestInvokeAuthorizer
s {$sel:body:TestInvokeAuthorizer' :: Maybe Text
body = Maybe Text
a} :: TestInvokeAuthorizer)

-- | [Optional] A key-value map of additional context variables.
testInvokeAuthorizer_additionalContext :: Lens.Lens' TestInvokeAuthorizer (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
testInvokeAuthorizer_additionalContext :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> TestInvokeAuthorizer -> f TestInvokeAuthorizer
testInvokeAuthorizer_additionalContext = (TestInvokeAuthorizer -> Maybe (HashMap Text Text))
-> (TestInvokeAuthorizer
    -> Maybe (HashMap Text Text) -> TestInvokeAuthorizer)
-> Lens
     TestInvokeAuthorizer
     TestInvokeAuthorizer
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeAuthorizer' {Maybe (HashMap Text Text)
additionalContext :: Maybe (HashMap Text Text)
$sel:additionalContext:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Maybe (HashMap Text Text)
additionalContext} -> Maybe (HashMap Text Text)
additionalContext) (\s :: TestInvokeAuthorizer
s@TestInvokeAuthorizer' {} Maybe (HashMap Text Text)
a -> TestInvokeAuthorizer
s {$sel:additionalContext:TestInvokeAuthorizer' :: Maybe (HashMap Text Text)
additionalContext = Maybe (HashMap Text Text)
a} :: TestInvokeAuthorizer) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> TestInvokeAuthorizer -> f TestInvokeAuthorizer)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> TestInvokeAuthorizer
-> f TestInvokeAuthorizer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A key-value map of stage variables to simulate an invocation on a
-- deployed Stage.
testInvokeAuthorizer_stageVariables :: Lens.Lens' TestInvokeAuthorizer (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
testInvokeAuthorizer_stageVariables :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> TestInvokeAuthorizer -> f TestInvokeAuthorizer
testInvokeAuthorizer_stageVariables = (TestInvokeAuthorizer -> Maybe (HashMap Text Text))
-> (TestInvokeAuthorizer
    -> Maybe (HashMap Text Text) -> TestInvokeAuthorizer)
-> Lens
     TestInvokeAuthorizer
     TestInvokeAuthorizer
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeAuthorizer' {Maybe (HashMap Text Text)
stageVariables :: Maybe (HashMap Text Text)
$sel:stageVariables:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Maybe (HashMap Text Text)
stageVariables} -> Maybe (HashMap Text Text)
stageVariables) (\s :: TestInvokeAuthorizer
s@TestInvokeAuthorizer' {} Maybe (HashMap Text Text)
a -> TestInvokeAuthorizer
s {$sel:stageVariables:TestInvokeAuthorizer' :: Maybe (HashMap Text Text)
stageVariables = Maybe (HashMap Text Text)
a} :: TestInvokeAuthorizer) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> TestInvokeAuthorizer -> f TestInvokeAuthorizer)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> TestInvokeAuthorizer
-> f TestInvokeAuthorizer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | [Required] A key-value map of headers to simulate an incoming invocation
-- request. This is where the incoming authorization token, or identity
-- source, should be specified.
testInvokeAuthorizer_headers :: Lens.Lens' TestInvokeAuthorizer (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
testInvokeAuthorizer_headers :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> TestInvokeAuthorizer -> f TestInvokeAuthorizer
testInvokeAuthorizer_headers = (TestInvokeAuthorizer -> Maybe (HashMap Text Text))
-> (TestInvokeAuthorizer
    -> Maybe (HashMap Text Text) -> TestInvokeAuthorizer)
-> Lens
     TestInvokeAuthorizer
     TestInvokeAuthorizer
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeAuthorizer' {Maybe (HashMap Text Text)
headers :: Maybe (HashMap Text Text)
$sel:headers:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Maybe (HashMap Text Text)
headers} -> Maybe (HashMap Text Text)
headers) (\s :: TestInvokeAuthorizer
s@TestInvokeAuthorizer' {} Maybe (HashMap Text Text)
a -> TestInvokeAuthorizer
s {$sel:headers:TestInvokeAuthorizer' :: Maybe (HashMap Text Text)
headers = Maybe (HashMap Text Text)
a} :: TestInvokeAuthorizer) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> TestInvokeAuthorizer -> f TestInvokeAuthorizer)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> TestInvokeAuthorizer
-> f TestInvokeAuthorizer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | [Optional] The headers as a map from string to list of values to
-- simulate an incoming invocation request. This is where the incoming
-- authorization token, or identity source, may be specified.
testInvokeAuthorizer_multiValueHeaders :: Lens.Lens' TestInvokeAuthorizer (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
testInvokeAuthorizer_multiValueHeaders :: (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> TestInvokeAuthorizer -> f TestInvokeAuthorizer
testInvokeAuthorizer_multiValueHeaders = (TestInvokeAuthorizer -> Maybe (HashMap Text [Text]))
-> (TestInvokeAuthorizer
    -> Maybe (HashMap Text [Text]) -> TestInvokeAuthorizer)
-> Lens
     TestInvokeAuthorizer
     TestInvokeAuthorizer
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeAuthorizer' {Maybe (HashMap Text [Text])
multiValueHeaders :: Maybe (HashMap Text [Text])
$sel:multiValueHeaders:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Maybe (HashMap Text [Text])
multiValueHeaders} -> Maybe (HashMap Text [Text])
multiValueHeaders) (\s :: TestInvokeAuthorizer
s@TestInvokeAuthorizer' {} Maybe (HashMap Text [Text])
a -> TestInvokeAuthorizer
s {$sel:multiValueHeaders:TestInvokeAuthorizer' :: Maybe (HashMap Text [Text])
multiValueHeaders = Maybe (HashMap Text [Text])
a} :: TestInvokeAuthorizer) ((Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
 -> TestInvokeAuthorizer -> f TestInvokeAuthorizer)
-> ((Maybe (HashMap Text [Text])
     -> f (Maybe (HashMap Text [Text])))
    -> Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> TestInvokeAuthorizer
-> f TestInvokeAuthorizer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
-> Iso
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [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
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | [Required] The string identifier of the associated RestApi.
testInvokeAuthorizer_restApiId :: Lens.Lens' TestInvokeAuthorizer Prelude.Text
testInvokeAuthorizer_restApiId :: (Text -> f Text) -> TestInvokeAuthorizer -> f TestInvokeAuthorizer
testInvokeAuthorizer_restApiId = (TestInvokeAuthorizer -> Text)
-> (TestInvokeAuthorizer -> Text -> TestInvokeAuthorizer)
-> Lens TestInvokeAuthorizer TestInvokeAuthorizer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeAuthorizer' {Text
restApiId :: Text
$sel:restApiId:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Text
restApiId} -> Text
restApiId) (\s :: TestInvokeAuthorizer
s@TestInvokeAuthorizer' {} Text
a -> TestInvokeAuthorizer
s {$sel:restApiId:TestInvokeAuthorizer' :: Text
restApiId = Text
a} :: TestInvokeAuthorizer)

-- | [Required] Specifies a test invoke authorizer request\'s Authorizer ID.
testInvokeAuthorizer_authorizerId :: Lens.Lens' TestInvokeAuthorizer Prelude.Text
testInvokeAuthorizer_authorizerId :: (Text -> f Text) -> TestInvokeAuthorizer -> f TestInvokeAuthorizer
testInvokeAuthorizer_authorizerId = (TestInvokeAuthorizer -> Text)
-> (TestInvokeAuthorizer -> Text -> TestInvokeAuthorizer)
-> Lens TestInvokeAuthorizer TestInvokeAuthorizer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeAuthorizer' {Text
authorizerId :: Text
$sel:authorizerId:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Text
authorizerId} -> Text
authorizerId) (\s :: TestInvokeAuthorizer
s@TestInvokeAuthorizer' {} Text
a -> TestInvokeAuthorizer
s {$sel:authorizerId:TestInvokeAuthorizer' :: Text
authorizerId = Text
a} :: TestInvokeAuthorizer)

instance Core.AWSRequest TestInvokeAuthorizer where
  type
    AWSResponse TestInvokeAuthorizer =
      TestInvokeAuthorizerResponse
  request :: TestInvokeAuthorizer -> Request TestInvokeAuthorizer
request = Service -> TestInvokeAuthorizer -> Request TestInvokeAuthorizer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy TestInvokeAuthorizer
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse TestInvokeAuthorizer)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse TestInvokeAuthorizer))
-> Logger
-> Service
-> Proxy TestInvokeAuthorizer
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse TestInvokeAuthorizer)))
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 Integer
-> Maybe (HashMap Text [Text])
-> Maybe (HashMap Text Text)
-> Maybe Int
-> Maybe Text
-> Int
-> TestInvokeAuthorizerResponse
TestInvokeAuthorizerResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Integer
 -> Maybe (HashMap Text [Text])
 -> Maybe (HashMap Text Text)
 -> Maybe Int
 -> Maybe Text
 -> Int
 -> TestInvokeAuthorizerResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Integer
      -> Maybe (HashMap Text [Text])
      -> Maybe (HashMap Text Text)
      -> Maybe Int
      -> Maybe Text
      -> Int
      -> TestInvokeAuthorizerResponse)
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
"log")
            Either
  String
  (Maybe Text
   -> Maybe Integer
   -> Maybe (HashMap Text [Text])
   -> Maybe (HashMap Text Text)
   -> Maybe Int
   -> Maybe Text
   -> Int
   -> TestInvokeAuthorizerResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Integer
      -> Maybe (HashMap Text [Text])
      -> Maybe (HashMap Text Text)
      -> Maybe Int
      -> Maybe Text
      -> Int
      -> TestInvokeAuthorizerResponse)
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
"principalId")
            Either
  String
  (Maybe Integer
   -> Maybe (HashMap Text [Text])
   -> Maybe (HashMap Text Text)
   -> Maybe Int
   -> Maybe Text
   -> Int
   -> TestInvokeAuthorizerResponse)
-> Either String (Maybe Integer)
-> Either
     String
     (Maybe (HashMap Text [Text])
      -> Maybe (HashMap Text Text)
      -> Maybe Int
      -> Maybe Text
      -> Int
      -> TestInvokeAuthorizerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"latency")
            Either
  String
  (Maybe (HashMap Text [Text])
   -> Maybe (HashMap Text Text)
   -> Maybe Int
   -> Maybe Text
   -> Int
   -> TestInvokeAuthorizerResponse)
-> Either String (Maybe (HashMap Text [Text]))
-> Either
     String
     (Maybe (HashMap Text Text)
      -> Maybe Int -> Maybe Text -> Int -> TestInvokeAuthorizerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe (Maybe (HashMap Text [Text])))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"authorization" Either String (Maybe (Maybe (HashMap Text [Text])))
-> Maybe (HashMap Text [Text])
-> Either String (Maybe (HashMap Text [Text]))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text [Text])
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe (HashMap Text Text)
   -> Maybe Int -> Maybe Text -> Int -> TestInvokeAuthorizerResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either
     String
     (Maybe Int -> Maybe Text -> Int -> TestInvokeAuthorizerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"claims" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Int -> Maybe Text -> Int -> TestInvokeAuthorizerResponse)
-> Either String (Maybe Int)
-> Either
     String (Maybe Text -> Int -> TestInvokeAuthorizerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Int)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"clientStatus")
            Either String (Maybe Text -> Int -> TestInvokeAuthorizerResponse)
-> Either String (Maybe Text)
-> Either String (Int -> TestInvokeAuthorizerResponse)
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
"policy")
            Either String (Int -> TestInvokeAuthorizerResponse)
-> Either String Int -> Either String TestInvokeAuthorizerResponse
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 TestInvokeAuthorizer

instance Prelude.NFData TestInvokeAuthorizer

instance Core.ToHeaders TestInvokeAuthorizer where
  toHeaders :: TestInvokeAuthorizer -> ResponseHeaders
toHeaders =
    ResponseHeaders -> TestInvokeAuthorizer -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Accept"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"application/json" :: Prelude.ByteString)
          ]
      )

instance Core.ToJSON TestInvokeAuthorizer where
  toJSON :: TestInvokeAuthorizer -> Value
toJSON TestInvokeAuthorizer' {Maybe Text
Maybe (HashMap Text [Text])
Maybe (HashMap Text Text)
Text
authorizerId :: Text
restApiId :: Text
multiValueHeaders :: Maybe (HashMap Text [Text])
headers :: Maybe (HashMap Text Text)
stageVariables :: Maybe (HashMap Text Text)
additionalContext :: Maybe (HashMap Text Text)
body :: Maybe Text
pathWithQueryString :: Maybe Text
$sel:authorizerId:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Text
$sel:restApiId:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Text
$sel:multiValueHeaders:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Maybe (HashMap Text [Text])
$sel:headers:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Maybe (HashMap Text Text)
$sel:stageVariables:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Maybe (HashMap Text Text)
$sel:additionalContext:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Maybe (HashMap Text Text)
$sel:body:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Maybe Text
$sel:pathWithQueryString:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"pathWithQueryString" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
pathWithQueryString,
            (Text
"body" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
body,
            (Text
"additionalContext" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
additionalContext,
            (Text
"stageVariables" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
stageVariables,
            (Text
"headers" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
headers,
            (Text
"multiValueHeaders" Text -> HashMap Text [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text [Text] -> Pair)
-> Maybe (HashMap Text [Text]) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text [Text])
multiValueHeaders
          ]
      )

instance Core.ToPath TestInvokeAuthorizer where
  toPath :: TestInvokeAuthorizer -> ByteString
toPath TestInvokeAuthorizer' {Maybe Text
Maybe (HashMap Text [Text])
Maybe (HashMap Text Text)
Text
authorizerId :: Text
restApiId :: Text
multiValueHeaders :: Maybe (HashMap Text [Text])
headers :: Maybe (HashMap Text Text)
stageVariables :: Maybe (HashMap Text Text)
additionalContext :: Maybe (HashMap Text Text)
body :: Maybe Text
pathWithQueryString :: Maybe Text
$sel:authorizerId:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Text
$sel:restApiId:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Text
$sel:multiValueHeaders:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Maybe (HashMap Text [Text])
$sel:headers:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Maybe (HashMap Text Text)
$sel:stageVariables:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Maybe (HashMap Text Text)
$sel:additionalContext:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Maybe (HashMap Text Text)
$sel:body:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Maybe Text
$sel:pathWithQueryString:TestInvokeAuthorizer' :: TestInvokeAuthorizer -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/restapis/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
restApiId,
        ByteString
"/authorizers/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
authorizerId
      ]

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

-- | Represents the response of the test invoke request for a custom
-- Authorizer
--
-- /See:/ 'newTestInvokeAuthorizerResponse' smart constructor.
data TestInvokeAuthorizerResponse = TestInvokeAuthorizerResponse'
  { -- | The API Gateway execution log for the test authorizer request.
    TestInvokeAuthorizerResponse -> Maybe Text
log :: Prelude.Maybe Prelude.Text,
    -- | The principal identity returned by the Authorizer
    TestInvokeAuthorizerResponse -> Maybe Text
principalId :: Prelude.Maybe Prelude.Text,
    -- | The execution latency of the test authorizer request.
    TestInvokeAuthorizerResponse -> Maybe Integer
latency :: Prelude.Maybe Prelude.Integer,
    TestInvokeAuthorizerResponse -> Maybe (HashMap Text [Text])
authorization :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
    -- | The
    -- <https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims open identity claims>,
    -- with any supported custom attributes, returned from the Cognito Your
    -- User Pool configured for the API.
    TestInvokeAuthorizerResponse -> Maybe (HashMap Text Text)
claims :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The HTTP status code that the client would have received. Value is 0 if
    -- the authorizer succeeded.
    TestInvokeAuthorizerResponse -> Maybe Int
clientStatus :: Prelude.Maybe Prelude.Int,
    -- | The JSON policy document returned by the Authorizer
    TestInvokeAuthorizerResponse -> Maybe Text
policy :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    TestInvokeAuthorizerResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (TestInvokeAuthorizerResponse
-> TestInvokeAuthorizerResponse -> Bool
(TestInvokeAuthorizerResponse
 -> TestInvokeAuthorizerResponse -> Bool)
-> (TestInvokeAuthorizerResponse
    -> TestInvokeAuthorizerResponse -> Bool)
-> Eq TestInvokeAuthorizerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestInvokeAuthorizerResponse
-> TestInvokeAuthorizerResponse -> Bool
$c/= :: TestInvokeAuthorizerResponse
-> TestInvokeAuthorizerResponse -> Bool
== :: TestInvokeAuthorizerResponse
-> TestInvokeAuthorizerResponse -> Bool
$c== :: TestInvokeAuthorizerResponse
-> TestInvokeAuthorizerResponse -> Bool
Prelude.Eq, ReadPrec [TestInvokeAuthorizerResponse]
ReadPrec TestInvokeAuthorizerResponse
Int -> ReadS TestInvokeAuthorizerResponse
ReadS [TestInvokeAuthorizerResponse]
(Int -> ReadS TestInvokeAuthorizerResponse)
-> ReadS [TestInvokeAuthorizerResponse]
-> ReadPrec TestInvokeAuthorizerResponse
-> ReadPrec [TestInvokeAuthorizerResponse]
-> Read TestInvokeAuthorizerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TestInvokeAuthorizerResponse]
$creadListPrec :: ReadPrec [TestInvokeAuthorizerResponse]
readPrec :: ReadPrec TestInvokeAuthorizerResponse
$creadPrec :: ReadPrec TestInvokeAuthorizerResponse
readList :: ReadS [TestInvokeAuthorizerResponse]
$creadList :: ReadS [TestInvokeAuthorizerResponse]
readsPrec :: Int -> ReadS TestInvokeAuthorizerResponse
$creadsPrec :: Int -> ReadS TestInvokeAuthorizerResponse
Prelude.Read, Int -> TestInvokeAuthorizerResponse -> ShowS
[TestInvokeAuthorizerResponse] -> ShowS
TestInvokeAuthorizerResponse -> String
(Int -> TestInvokeAuthorizerResponse -> ShowS)
-> (TestInvokeAuthorizerResponse -> String)
-> ([TestInvokeAuthorizerResponse] -> ShowS)
-> Show TestInvokeAuthorizerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TestInvokeAuthorizerResponse] -> ShowS
$cshowList :: [TestInvokeAuthorizerResponse] -> ShowS
show :: TestInvokeAuthorizerResponse -> String
$cshow :: TestInvokeAuthorizerResponse -> String
showsPrec :: Int -> TestInvokeAuthorizerResponse -> ShowS
$cshowsPrec :: Int -> TestInvokeAuthorizerResponse -> ShowS
Prelude.Show, (forall x.
 TestInvokeAuthorizerResponse -> Rep TestInvokeAuthorizerResponse x)
-> (forall x.
    Rep TestInvokeAuthorizerResponse x -> TestInvokeAuthorizerResponse)
-> Generic TestInvokeAuthorizerResponse
forall x.
Rep TestInvokeAuthorizerResponse x -> TestInvokeAuthorizerResponse
forall x.
TestInvokeAuthorizerResponse -> Rep TestInvokeAuthorizerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TestInvokeAuthorizerResponse x -> TestInvokeAuthorizerResponse
$cfrom :: forall x.
TestInvokeAuthorizerResponse -> Rep TestInvokeAuthorizerResponse x
Prelude.Generic)

-- |
-- Create a value of 'TestInvokeAuthorizerResponse' 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:
--
-- 'log', 'testInvokeAuthorizerResponse_log' - The API Gateway execution log for the test authorizer request.
--
-- 'principalId', 'testInvokeAuthorizerResponse_principalId' - The principal identity returned by the Authorizer
--
-- 'latency', 'testInvokeAuthorizerResponse_latency' - The execution latency of the test authorizer request.
--
-- 'authorization', 'testInvokeAuthorizerResponse_authorization' - Undocumented member.
--
-- 'claims', 'testInvokeAuthorizerResponse_claims' - The
-- <https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims open identity claims>,
-- with any supported custom attributes, returned from the Cognito Your
-- User Pool configured for the API.
--
-- 'clientStatus', 'testInvokeAuthorizerResponse_clientStatus' - The HTTP status code that the client would have received. Value is 0 if
-- the authorizer succeeded.
--
-- 'policy', 'testInvokeAuthorizerResponse_policy' - The JSON policy document returned by the Authorizer
--
-- 'httpStatus', 'testInvokeAuthorizerResponse_httpStatus' - The response's http status code.
newTestInvokeAuthorizerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  TestInvokeAuthorizerResponse
newTestInvokeAuthorizerResponse :: Int -> TestInvokeAuthorizerResponse
newTestInvokeAuthorizerResponse Int
pHttpStatus_ =
  TestInvokeAuthorizerResponse' :: Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe (HashMap Text [Text])
-> Maybe (HashMap Text Text)
-> Maybe Int
-> Maybe Text
-> Int
-> TestInvokeAuthorizerResponse
TestInvokeAuthorizerResponse'
    { $sel:log:TestInvokeAuthorizerResponse' :: Maybe Text
log =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:principalId:TestInvokeAuthorizerResponse' :: Maybe Text
principalId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:latency:TestInvokeAuthorizerResponse' :: Maybe Integer
latency = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:authorization:TestInvokeAuthorizerResponse' :: Maybe (HashMap Text [Text])
authorization = Maybe (HashMap Text [Text])
forall a. Maybe a
Prelude.Nothing,
      $sel:claims:TestInvokeAuthorizerResponse' :: Maybe (HashMap Text Text)
claims = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:clientStatus:TestInvokeAuthorizerResponse' :: Maybe Int
clientStatus = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:policy:TestInvokeAuthorizerResponse' :: Maybe Text
policy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:TestInvokeAuthorizerResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The API Gateway execution log for the test authorizer request.
testInvokeAuthorizerResponse_log :: Lens.Lens' TestInvokeAuthorizerResponse (Prelude.Maybe Prelude.Text)
testInvokeAuthorizerResponse_log :: (Maybe Text -> f (Maybe Text))
-> TestInvokeAuthorizerResponse -> f TestInvokeAuthorizerResponse
testInvokeAuthorizerResponse_log = (TestInvokeAuthorizerResponse -> Maybe Text)
-> (TestInvokeAuthorizerResponse
    -> Maybe Text -> TestInvokeAuthorizerResponse)
-> Lens
     TestInvokeAuthorizerResponse
     TestInvokeAuthorizerResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeAuthorizerResponse' {Maybe Text
log :: Maybe Text
$sel:log:TestInvokeAuthorizerResponse' :: TestInvokeAuthorizerResponse -> Maybe Text
log} -> Maybe Text
log) (\s :: TestInvokeAuthorizerResponse
s@TestInvokeAuthorizerResponse' {} Maybe Text
a -> TestInvokeAuthorizerResponse
s {$sel:log:TestInvokeAuthorizerResponse' :: Maybe Text
log = Maybe Text
a} :: TestInvokeAuthorizerResponse)

-- | The principal identity returned by the Authorizer
testInvokeAuthorizerResponse_principalId :: Lens.Lens' TestInvokeAuthorizerResponse (Prelude.Maybe Prelude.Text)
testInvokeAuthorizerResponse_principalId :: (Maybe Text -> f (Maybe Text))
-> TestInvokeAuthorizerResponse -> f TestInvokeAuthorizerResponse
testInvokeAuthorizerResponse_principalId = (TestInvokeAuthorizerResponse -> Maybe Text)
-> (TestInvokeAuthorizerResponse
    -> Maybe Text -> TestInvokeAuthorizerResponse)
-> Lens
     TestInvokeAuthorizerResponse
     TestInvokeAuthorizerResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeAuthorizerResponse' {Maybe Text
principalId :: Maybe Text
$sel:principalId:TestInvokeAuthorizerResponse' :: TestInvokeAuthorizerResponse -> Maybe Text
principalId} -> Maybe Text
principalId) (\s :: TestInvokeAuthorizerResponse
s@TestInvokeAuthorizerResponse' {} Maybe Text
a -> TestInvokeAuthorizerResponse
s {$sel:principalId:TestInvokeAuthorizerResponse' :: Maybe Text
principalId = Maybe Text
a} :: TestInvokeAuthorizerResponse)

-- | The execution latency of the test authorizer request.
testInvokeAuthorizerResponse_latency :: Lens.Lens' TestInvokeAuthorizerResponse (Prelude.Maybe Prelude.Integer)
testInvokeAuthorizerResponse_latency :: (Maybe Integer -> f (Maybe Integer))
-> TestInvokeAuthorizerResponse -> f TestInvokeAuthorizerResponse
testInvokeAuthorizerResponse_latency = (TestInvokeAuthorizerResponse -> Maybe Integer)
-> (TestInvokeAuthorizerResponse
    -> Maybe Integer -> TestInvokeAuthorizerResponse)
-> Lens
     TestInvokeAuthorizerResponse
     TestInvokeAuthorizerResponse
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeAuthorizerResponse' {Maybe Integer
latency :: Maybe Integer
$sel:latency:TestInvokeAuthorizerResponse' :: TestInvokeAuthorizerResponse -> Maybe Integer
latency} -> Maybe Integer
latency) (\s :: TestInvokeAuthorizerResponse
s@TestInvokeAuthorizerResponse' {} Maybe Integer
a -> TestInvokeAuthorizerResponse
s {$sel:latency:TestInvokeAuthorizerResponse' :: Maybe Integer
latency = Maybe Integer
a} :: TestInvokeAuthorizerResponse)

-- | Undocumented member.
testInvokeAuthorizerResponse_authorization :: Lens.Lens' TestInvokeAuthorizerResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
testInvokeAuthorizerResponse_authorization :: (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> TestInvokeAuthorizerResponse -> f TestInvokeAuthorizerResponse
testInvokeAuthorizerResponse_authorization = (TestInvokeAuthorizerResponse -> Maybe (HashMap Text [Text]))
-> (TestInvokeAuthorizerResponse
    -> Maybe (HashMap Text [Text]) -> TestInvokeAuthorizerResponse)
-> Lens
     TestInvokeAuthorizerResponse
     TestInvokeAuthorizerResponse
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeAuthorizerResponse' {Maybe (HashMap Text [Text])
authorization :: Maybe (HashMap Text [Text])
$sel:authorization:TestInvokeAuthorizerResponse' :: TestInvokeAuthorizerResponse -> Maybe (HashMap Text [Text])
authorization} -> Maybe (HashMap Text [Text])
authorization) (\s :: TestInvokeAuthorizerResponse
s@TestInvokeAuthorizerResponse' {} Maybe (HashMap Text [Text])
a -> TestInvokeAuthorizerResponse
s {$sel:authorization:TestInvokeAuthorizerResponse' :: Maybe (HashMap Text [Text])
authorization = Maybe (HashMap Text [Text])
a} :: TestInvokeAuthorizerResponse) ((Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
 -> TestInvokeAuthorizerResponse -> f TestInvokeAuthorizerResponse)
-> ((Maybe (HashMap Text [Text])
     -> f (Maybe (HashMap Text [Text])))
    -> Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> TestInvokeAuthorizerResponse
-> f TestInvokeAuthorizerResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
-> Iso
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [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
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The
-- <https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims open identity claims>,
-- with any supported custom attributes, returned from the Cognito Your
-- User Pool configured for the API.
testInvokeAuthorizerResponse_claims :: Lens.Lens' TestInvokeAuthorizerResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
testInvokeAuthorizerResponse_claims :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> TestInvokeAuthorizerResponse -> f TestInvokeAuthorizerResponse
testInvokeAuthorizerResponse_claims = (TestInvokeAuthorizerResponse -> Maybe (HashMap Text Text))
-> (TestInvokeAuthorizerResponse
    -> Maybe (HashMap Text Text) -> TestInvokeAuthorizerResponse)
-> Lens
     TestInvokeAuthorizerResponse
     TestInvokeAuthorizerResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeAuthorizerResponse' {Maybe (HashMap Text Text)
claims :: Maybe (HashMap Text Text)
$sel:claims:TestInvokeAuthorizerResponse' :: TestInvokeAuthorizerResponse -> Maybe (HashMap Text Text)
claims} -> Maybe (HashMap Text Text)
claims) (\s :: TestInvokeAuthorizerResponse
s@TestInvokeAuthorizerResponse' {} Maybe (HashMap Text Text)
a -> TestInvokeAuthorizerResponse
s {$sel:claims:TestInvokeAuthorizerResponse' :: Maybe (HashMap Text Text)
claims = Maybe (HashMap Text Text)
a} :: TestInvokeAuthorizerResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> TestInvokeAuthorizerResponse -> f TestInvokeAuthorizerResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> TestInvokeAuthorizerResponse
-> f TestInvokeAuthorizerResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The HTTP status code that the client would have received. Value is 0 if
-- the authorizer succeeded.
testInvokeAuthorizerResponse_clientStatus :: Lens.Lens' TestInvokeAuthorizerResponse (Prelude.Maybe Prelude.Int)
testInvokeAuthorizerResponse_clientStatus :: (Maybe Int -> f (Maybe Int))
-> TestInvokeAuthorizerResponse -> f TestInvokeAuthorizerResponse
testInvokeAuthorizerResponse_clientStatus = (TestInvokeAuthorizerResponse -> Maybe Int)
-> (TestInvokeAuthorizerResponse
    -> Maybe Int -> TestInvokeAuthorizerResponse)
-> Lens
     TestInvokeAuthorizerResponse
     TestInvokeAuthorizerResponse
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeAuthorizerResponse' {Maybe Int
clientStatus :: Maybe Int
$sel:clientStatus:TestInvokeAuthorizerResponse' :: TestInvokeAuthorizerResponse -> Maybe Int
clientStatus} -> Maybe Int
clientStatus) (\s :: TestInvokeAuthorizerResponse
s@TestInvokeAuthorizerResponse' {} Maybe Int
a -> TestInvokeAuthorizerResponse
s {$sel:clientStatus:TestInvokeAuthorizerResponse' :: Maybe Int
clientStatus = Maybe Int
a} :: TestInvokeAuthorizerResponse)

-- | The JSON policy document returned by the Authorizer
testInvokeAuthorizerResponse_policy :: Lens.Lens' TestInvokeAuthorizerResponse (Prelude.Maybe Prelude.Text)
testInvokeAuthorizerResponse_policy :: (Maybe Text -> f (Maybe Text))
-> TestInvokeAuthorizerResponse -> f TestInvokeAuthorizerResponse
testInvokeAuthorizerResponse_policy = (TestInvokeAuthorizerResponse -> Maybe Text)
-> (TestInvokeAuthorizerResponse
    -> Maybe Text -> TestInvokeAuthorizerResponse)
-> Lens
     TestInvokeAuthorizerResponse
     TestInvokeAuthorizerResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeAuthorizerResponse' {Maybe Text
policy :: Maybe Text
$sel:policy:TestInvokeAuthorizerResponse' :: TestInvokeAuthorizerResponse -> Maybe Text
policy} -> Maybe Text
policy) (\s :: TestInvokeAuthorizerResponse
s@TestInvokeAuthorizerResponse' {} Maybe Text
a -> TestInvokeAuthorizerResponse
s {$sel:policy:TestInvokeAuthorizerResponse' :: Maybe Text
policy = Maybe Text
a} :: TestInvokeAuthorizerResponse)

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

instance Prelude.NFData TestInvokeAuthorizerResponse