{-# 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.TestInvokeMethod
-- 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 a Method in your RestApi with headers,
-- parameters, and an incoming request body.
module Amazonka.APIGateway.TestInvokeMethod
  ( -- * Creating a Request
    TestInvokeMethod (..),
    newTestInvokeMethod,

    -- * Request Lenses
    testInvokeMethod_pathWithQueryString,
    testInvokeMethod_body,
    testInvokeMethod_clientCertificateId,
    testInvokeMethod_stageVariables,
    testInvokeMethod_headers,
    testInvokeMethod_multiValueHeaders,
    testInvokeMethod_restApiId,
    testInvokeMethod_resourceId,
    testInvokeMethod_httpMethod,

    -- * Destructuring the Response
    TestInvokeMethodResponse (..),
    newTestInvokeMethodResponse,

    -- * Response Lenses
    testInvokeMethodResponse_log,
    testInvokeMethodResponse_status,
    testInvokeMethodResponse_body,
    testInvokeMethodResponse_latency,
    testInvokeMethodResponse_headers,
    testInvokeMethodResponse_multiValueHeaders,
    testInvokeMethodResponse_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 a Method.
--
-- /See:/ 'newTestInvokeMethod' smart constructor.
data TestInvokeMethod = TestInvokeMethod'
  { -- | The URI path, including query string, of the simulated invocation
    -- request. Use this to specify path parameters and query string
    -- parameters.
    TestInvokeMethod -> Maybe Text
pathWithQueryString :: Prelude.Maybe Prelude.Text,
    -- | The simulated request body of an incoming invocation request.
    TestInvokeMethod -> Maybe Text
body :: Prelude.Maybe Prelude.Text,
    -- | A ClientCertificate identifier to use in the test invocation. API
    -- Gateway will use the certificate when making the HTTPS request to the
    -- defined back-end endpoint.
    TestInvokeMethod -> Maybe Text
clientCertificateId :: Prelude.Maybe Prelude.Text,
    -- | A key-value map of stage variables to simulate an invocation on a
    -- deployed Stage.
    TestInvokeMethod -> Maybe (HashMap Text Text)
stageVariables :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A key-value map of headers to simulate an incoming invocation request.
    TestInvokeMethod -> Maybe (HashMap Text Text)
headers :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The headers as a map from string to list of values to simulate an
    -- incoming invocation request.
    TestInvokeMethod -> Maybe (HashMap Text [Text])
multiValueHeaders :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
    -- | [Required] The string identifier of the associated RestApi.
    TestInvokeMethod -> Text
restApiId :: Prelude.Text,
    -- | [Required] Specifies a test invoke method request\'s resource ID.
    TestInvokeMethod -> Text
resourceId :: Prelude.Text,
    -- | [Required] Specifies a test invoke method request\'s HTTP method.
    TestInvokeMethod -> Text
httpMethod :: Prelude.Text
  }
  deriving (TestInvokeMethod -> TestInvokeMethod -> Bool
(TestInvokeMethod -> TestInvokeMethod -> Bool)
-> (TestInvokeMethod -> TestInvokeMethod -> Bool)
-> Eq TestInvokeMethod
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestInvokeMethod -> TestInvokeMethod -> Bool
$c/= :: TestInvokeMethod -> TestInvokeMethod -> Bool
== :: TestInvokeMethod -> TestInvokeMethod -> Bool
$c== :: TestInvokeMethod -> TestInvokeMethod -> Bool
Prelude.Eq, ReadPrec [TestInvokeMethod]
ReadPrec TestInvokeMethod
Int -> ReadS TestInvokeMethod
ReadS [TestInvokeMethod]
(Int -> ReadS TestInvokeMethod)
-> ReadS [TestInvokeMethod]
-> ReadPrec TestInvokeMethod
-> ReadPrec [TestInvokeMethod]
-> Read TestInvokeMethod
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TestInvokeMethod]
$creadListPrec :: ReadPrec [TestInvokeMethod]
readPrec :: ReadPrec TestInvokeMethod
$creadPrec :: ReadPrec TestInvokeMethod
readList :: ReadS [TestInvokeMethod]
$creadList :: ReadS [TestInvokeMethod]
readsPrec :: Int -> ReadS TestInvokeMethod
$creadsPrec :: Int -> ReadS TestInvokeMethod
Prelude.Read, Int -> TestInvokeMethod -> ShowS
[TestInvokeMethod] -> ShowS
TestInvokeMethod -> String
(Int -> TestInvokeMethod -> ShowS)
-> (TestInvokeMethod -> String)
-> ([TestInvokeMethod] -> ShowS)
-> Show TestInvokeMethod
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TestInvokeMethod] -> ShowS
$cshowList :: [TestInvokeMethod] -> ShowS
show :: TestInvokeMethod -> String
$cshow :: TestInvokeMethod -> String
showsPrec :: Int -> TestInvokeMethod -> ShowS
$cshowsPrec :: Int -> TestInvokeMethod -> ShowS
Prelude.Show, (forall x. TestInvokeMethod -> Rep TestInvokeMethod x)
-> (forall x. Rep TestInvokeMethod x -> TestInvokeMethod)
-> Generic TestInvokeMethod
forall x. Rep TestInvokeMethod x -> TestInvokeMethod
forall x. TestInvokeMethod -> Rep TestInvokeMethod x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TestInvokeMethod x -> TestInvokeMethod
$cfrom :: forall x. TestInvokeMethod -> Rep TestInvokeMethod x
Prelude.Generic)

-- |
-- Create a value of 'TestInvokeMethod' 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', 'testInvokeMethod_pathWithQueryString' - The URI path, including query string, of the simulated invocation
-- request. Use this to specify path parameters and query string
-- parameters.
--
-- 'body', 'testInvokeMethod_body' - The simulated request body of an incoming invocation request.
--
-- 'clientCertificateId', 'testInvokeMethod_clientCertificateId' - A ClientCertificate identifier to use in the test invocation. API
-- Gateway will use the certificate when making the HTTPS request to the
-- defined back-end endpoint.
--
-- 'stageVariables', 'testInvokeMethod_stageVariables' - A key-value map of stage variables to simulate an invocation on a
-- deployed Stage.
--
-- 'headers', 'testInvokeMethod_headers' - A key-value map of headers to simulate an incoming invocation request.
--
-- 'multiValueHeaders', 'testInvokeMethod_multiValueHeaders' - The headers as a map from string to list of values to simulate an
-- incoming invocation request.
--
-- 'restApiId', 'testInvokeMethod_restApiId' - [Required] The string identifier of the associated RestApi.
--
-- 'resourceId', 'testInvokeMethod_resourceId' - [Required] Specifies a test invoke method request\'s resource ID.
--
-- 'httpMethod', 'testInvokeMethod_httpMethod' - [Required] Specifies a test invoke method request\'s HTTP method.
newTestInvokeMethod ::
  -- | 'restApiId'
  Prelude.Text ->
  -- | 'resourceId'
  Prelude.Text ->
  -- | 'httpMethod'
  Prelude.Text ->
  TestInvokeMethod
newTestInvokeMethod :: Text -> Text -> Text -> TestInvokeMethod
newTestInvokeMethod
  Text
pRestApiId_
  Text
pResourceId_
  Text
pHttpMethod_ =
    TestInvokeMethod' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text [Text])
-> Text
-> Text
-> Text
-> TestInvokeMethod
TestInvokeMethod'
      { $sel:pathWithQueryString:TestInvokeMethod' :: Maybe Text
pathWithQueryString =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:body:TestInvokeMethod' :: Maybe Text
body = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:clientCertificateId:TestInvokeMethod' :: Maybe Text
clientCertificateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:stageVariables:TestInvokeMethod' :: Maybe (HashMap Text Text)
stageVariables = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:headers:TestInvokeMethod' :: Maybe (HashMap Text Text)
headers = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:multiValueHeaders:TestInvokeMethod' :: Maybe (HashMap Text [Text])
multiValueHeaders = Maybe (HashMap Text [Text])
forall a. Maybe a
Prelude.Nothing,
        $sel:restApiId:TestInvokeMethod' :: Text
restApiId = Text
pRestApiId_,
        $sel:resourceId:TestInvokeMethod' :: Text
resourceId = Text
pResourceId_,
        $sel:httpMethod:TestInvokeMethod' :: Text
httpMethod = Text
pHttpMethod_
      }

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

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

-- | A ClientCertificate identifier to use in the test invocation. API
-- Gateway will use the certificate when making the HTTPS request to the
-- defined back-end endpoint.
testInvokeMethod_clientCertificateId :: Lens.Lens' TestInvokeMethod (Prelude.Maybe Prelude.Text)
testInvokeMethod_clientCertificateId :: (Maybe Text -> f (Maybe Text))
-> TestInvokeMethod -> f TestInvokeMethod
testInvokeMethod_clientCertificateId = (TestInvokeMethod -> Maybe Text)
-> (TestInvokeMethod -> Maybe Text -> TestInvokeMethod)
-> Lens TestInvokeMethod TestInvokeMethod (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeMethod' {Maybe Text
clientCertificateId :: Maybe Text
$sel:clientCertificateId:TestInvokeMethod' :: TestInvokeMethod -> Maybe Text
clientCertificateId} -> Maybe Text
clientCertificateId) (\s :: TestInvokeMethod
s@TestInvokeMethod' {} Maybe Text
a -> TestInvokeMethod
s {$sel:clientCertificateId:TestInvokeMethod' :: Maybe Text
clientCertificateId = Maybe Text
a} :: TestInvokeMethod)

-- | A key-value map of stage variables to simulate an invocation on a
-- deployed Stage.
testInvokeMethod_stageVariables :: Lens.Lens' TestInvokeMethod (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
testInvokeMethod_stageVariables :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> TestInvokeMethod -> f TestInvokeMethod
testInvokeMethod_stageVariables = (TestInvokeMethod -> Maybe (HashMap Text Text))
-> (TestInvokeMethod
    -> Maybe (HashMap Text Text) -> TestInvokeMethod)
-> Lens
     TestInvokeMethod
     TestInvokeMethod
     (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 (\TestInvokeMethod' {Maybe (HashMap Text Text)
stageVariables :: Maybe (HashMap Text Text)
$sel:stageVariables:TestInvokeMethod' :: TestInvokeMethod -> Maybe (HashMap Text Text)
stageVariables} -> Maybe (HashMap Text Text)
stageVariables) (\s :: TestInvokeMethod
s@TestInvokeMethod' {} Maybe (HashMap Text Text)
a -> TestInvokeMethod
s {$sel:stageVariables:TestInvokeMethod' :: Maybe (HashMap Text Text)
stageVariables = Maybe (HashMap Text Text)
a} :: TestInvokeMethod) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> TestInvokeMethod -> f TestInvokeMethod)
-> ((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)))
-> TestInvokeMethod
-> f TestInvokeMethod
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 headers to simulate an incoming invocation request.
testInvokeMethod_headers :: Lens.Lens' TestInvokeMethod (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
testInvokeMethod_headers :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> TestInvokeMethod -> f TestInvokeMethod
testInvokeMethod_headers = (TestInvokeMethod -> Maybe (HashMap Text Text))
-> (TestInvokeMethod
    -> Maybe (HashMap Text Text) -> TestInvokeMethod)
-> Lens
     TestInvokeMethod
     TestInvokeMethod
     (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 (\TestInvokeMethod' {Maybe (HashMap Text Text)
headers :: Maybe (HashMap Text Text)
$sel:headers:TestInvokeMethod' :: TestInvokeMethod -> Maybe (HashMap Text Text)
headers} -> Maybe (HashMap Text Text)
headers) (\s :: TestInvokeMethod
s@TestInvokeMethod' {} Maybe (HashMap Text Text)
a -> TestInvokeMethod
s {$sel:headers:TestInvokeMethod' :: Maybe (HashMap Text Text)
headers = Maybe (HashMap Text Text)
a} :: TestInvokeMethod) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> TestInvokeMethod -> f TestInvokeMethod)
-> ((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)))
-> TestInvokeMethod
-> f TestInvokeMethod
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 headers as a map from string to list of values to simulate an
-- incoming invocation request.
testInvokeMethod_multiValueHeaders :: Lens.Lens' TestInvokeMethod (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
testInvokeMethod_multiValueHeaders :: (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> TestInvokeMethod -> f TestInvokeMethod
testInvokeMethod_multiValueHeaders = (TestInvokeMethod -> Maybe (HashMap Text [Text]))
-> (TestInvokeMethod
    -> Maybe (HashMap Text [Text]) -> TestInvokeMethod)
-> Lens
     TestInvokeMethod
     TestInvokeMethod
     (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 (\TestInvokeMethod' {Maybe (HashMap Text [Text])
multiValueHeaders :: Maybe (HashMap Text [Text])
$sel:multiValueHeaders:TestInvokeMethod' :: TestInvokeMethod -> Maybe (HashMap Text [Text])
multiValueHeaders} -> Maybe (HashMap Text [Text])
multiValueHeaders) (\s :: TestInvokeMethod
s@TestInvokeMethod' {} Maybe (HashMap Text [Text])
a -> TestInvokeMethod
s {$sel:multiValueHeaders:TestInvokeMethod' :: Maybe (HashMap Text [Text])
multiValueHeaders = Maybe (HashMap Text [Text])
a} :: TestInvokeMethod) ((Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
 -> TestInvokeMethod -> f TestInvokeMethod)
-> ((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])))
-> TestInvokeMethod
-> f TestInvokeMethod
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.
testInvokeMethod_restApiId :: Lens.Lens' TestInvokeMethod Prelude.Text
testInvokeMethod_restApiId :: (Text -> f Text) -> TestInvokeMethod -> f TestInvokeMethod
testInvokeMethod_restApiId = (TestInvokeMethod -> Text)
-> (TestInvokeMethod -> Text -> TestInvokeMethod)
-> Lens TestInvokeMethod TestInvokeMethod Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeMethod' {Text
restApiId :: Text
$sel:restApiId:TestInvokeMethod' :: TestInvokeMethod -> Text
restApiId} -> Text
restApiId) (\s :: TestInvokeMethod
s@TestInvokeMethod' {} Text
a -> TestInvokeMethod
s {$sel:restApiId:TestInvokeMethod' :: Text
restApiId = Text
a} :: TestInvokeMethod)

-- | [Required] Specifies a test invoke method request\'s resource ID.
testInvokeMethod_resourceId :: Lens.Lens' TestInvokeMethod Prelude.Text
testInvokeMethod_resourceId :: (Text -> f Text) -> TestInvokeMethod -> f TestInvokeMethod
testInvokeMethod_resourceId = (TestInvokeMethod -> Text)
-> (TestInvokeMethod -> Text -> TestInvokeMethod)
-> Lens TestInvokeMethod TestInvokeMethod Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeMethod' {Text
resourceId :: Text
$sel:resourceId:TestInvokeMethod' :: TestInvokeMethod -> Text
resourceId} -> Text
resourceId) (\s :: TestInvokeMethod
s@TestInvokeMethod' {} Text
a -> TestInvokeMethod
s {$sel:resourceId:TestInvokeMethod' :: Text
resourceId = Text
a} :: TestInvokeMethod)

-- | [Required] Specifies a test invoke method request\'s HTTP method.
testInvokeMethod_httpMethod :: Lens.Lens' TestInvokeMethod Prelude.Text
testInvokeMethod_httpMethod :: (Text -> f Text) -> TestInvokeMethod -> f TestInvokeMethod
testInvokeMethod_httpMethod = (TestInvokeMethod -> Text)
-> (TestInvokeMethod -> Text -> TestInvokeMethod)
-> Lens TestInvokeMethod TestInvokeMethod Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeMethod' {Text
httpMethod :: Text
$sel:httpMethod:TestInvokeMethod' :: TestInvokeMethod -> Text
httpMethod} -> Text
httpMethod) (\s :: TestInvokeMethod
s@TestInvokeMethod' {} Text
a -> TestInvokeMethod
s {$sel:httpMethod:TestInvokeMethod' :: Text
httpMethod = Text
a} :: TestInvokeMethod)

instance Core.AWSRequest TestInvokeMethod where
  type
    AWSResponse TestInvokeMethod =
      TestInvokeMethodResponse
  request :: TestInvokeMethod -> Request TestInvokeMethod
request = Service -> TestInvokeMethod -> Request TestInvokeMethod
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy TestInvokeMethod
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse TestInvokeMethod)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse TestInvokeMethod))
-> Logger
-> Service
-> Proxy TestInvokeMethod
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse TestInvokeMethod)))
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 Int
-> Maybe Text
-> Maybe Integer
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text [Text])
-> Int
-> TestInvokeMethodResponse
TestInvokeMethodResponse'
            (Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> Maybe Integer
 -> Maybe (HashMap Text Text)
 -> Maybe (HashMap Text [Text])
 -> Int
 -> TestInvokeMethodResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Int
      -> Maybe Text
      -> Maybe Integer
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text [Text])
      -> Int
      -> TestInvokeMethodResponse)
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 Int
   -> Maybe Text
   -> Maybe Integer
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text [Text])
   -> Int
   -> TestInvokeMethodResponse)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe Text
      -> Maybe Integer
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text [Text])
      -> Int
      -> TestInvokeMethodResponse)
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
"status")
            Either
  String
  (Maybe Text
   -> Maybe Integer
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text [Text])
   -> Int
   -> TestInvokeMethodResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Integer
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text [Text])
      -> Int
      -> TestInvokeMethodResponse)
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
"body")
            Either
  String
  (Maybe Integer
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text [Text])
   -> Int
   -> TestInvokeMethodResponse)
-> Either String (Maybe Integer)
-> Either
     String
     (Maybe (HashMap Text Text)
      -> Maybe (HashMap Text [Text]) -> Int -> TestInvokeMethodResponse)
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]) -> Int -> TestInvokeMethodResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either
     String
     (Maybe (HashMap Text [Text]) -> Int -> TestInvokeMethodResponse)
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
"headers" 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]) -> Int -> TestInvokeMethodResponse)
-> Either String (Maybe (HashMap Text [Text]))
-> Either String (Int -> TestInvokeMethodResponse)
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
"multiValueHeaders"
                            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 (Int -> TestInvokeMethodResponse)
-> Either String Int -> Either String TestInvokeMethodResponse
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 TestInvokeMethod

instance Prelude.NFData TestInvokeMethod

instance Core.ToHeaders TestInvokeMethod where
  toHeaders :: TestInvokeMethod -> ResponseHeaders
toHeaders =
    ResponseHeaders -> TestInvokeMethod -> 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 TestInvokeMethod where
  toJSON :: TestInvokeMethod -> Value
toJSON TestInvokeMethod' {Maybe Text
Maybe (HashMap Text [Text])
Maybe (HashMap Text Text)
Text
httpMethod :: Text
resourceId :: Text
restApiId :: Text
multiValueHeaders :: Maybe (HashMap Text [Text])
headers :: Maybe (HashMap Text Text)
stageVariables :: Maybe (HashMap Text Text)
clientCertificateId :: Maybe Text
body :: Maybe Text
pathWithQueryString :: Maybe Text
$sel:httpMethod:TestInvokeMethod' :: TestInvokeMethod -> Text
$sel:resourceId:TestInvokeMethod' :: TestInvokeMethod -> Text
$sel:restApiId:TestInvokeMethod' :: TestInvokeMethod -> Text
$sel:multiValueHeaders:TestInvokeMethod' :: TestInvokeMethod -> Maybe (HashMap Text [Text])
$sel:headers:TestInvokeMethod' :: TestInvokeMethod -> Maybe (HashMap Text Text)
$sel:stageVariables:TestInvokeMethod' :: TestInvokeMethod -> Maybe (HashMap Text Text)
$sel:clientCertificateId:TestInvokeMethod' :: TestInvokeMethod -> Maybe Text
$sel:body:TestInvokeMethod' :: TestInvokeMethod -> Maybe Text
$sel:pathWithQueryString:TestInvokeMethod' :: TestInvokeMethod -> 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
"clientCertificateId" 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
clientCertificateId,
            (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 TestInvokeMethod where
  toPath :: TestInvokeMethod -> ByteString
toPath TestInvokeMethod' {Maybe Text
Maybe (HashMap Text [Text])
Maybe (HashMap Text Text)
Text
httpMethod :: Text
resourceId :: Text
restApiId :: Text
multiValueHeaders :: Maybe (HashMap Text [Text])
headers :: Maybe (HashMap Text Text)
stageVariables :: Maybe (HashMap Text Text)
clientCertificateId :: Maybe Text
body :: Maybe Text
pathWithQueryString :: Maybe Text
$sel:httpMethod:TestInvokeMethod' :: TestInvokeMethod -> Text
$sel:resourceId:TestInvokeMethod' :: TestInvokeMethod -> Text
$sel:restApiId:TestInvokeMethod' :: TestInvokeMethod -> Text
$sel:multiValueHeaders:TestInvokeMethod' :: TestInvokeMethod -> Maybe (HashMap Text [Text])
$sel:headers:TestInvokeMethod' :: TestInvokeMethod -> Maybe (HashMap Text Text)
$sel:stageVariables:TestInvokeMethod' :: TestInvokeMethod -> Maybe (HashMap Text Text)
$sel:clientCertificateId:TestInvokeMethod' :: TestInvokeMethod -> Maybe Text
$sel:body:TestInvokeMethod' :: TestInvokeMethod -> Maybe Text
$sel:pathWithQueryString:TestInvokeMethod' :: TestInvokeMethod -> 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
"/resources/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
resourceId,
        ByteString
"/methods/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
httpMethod
      ]

instance Core.ToQuery TestInvokeMethod where
  toQuery :: TestInvokeMethod -> QueryString
toQuery = QueryString -> TestInvokeMethod -> 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 in the HTTP method.
--
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-test-method.html#how-to-test-method-console Test API using the API Gateway console>
--
-- /See:/ 'newTestInvokeMethodResponse' smart constructor.
data TestInvokeMethodResponse = TestInvokeMethodResponse'
  { -- | The API Gateway execution log for the test invoke request.
    TestInvokeMethodResponse -> Maybe Text
log :: Prelude.Maybe Prelude.Text,
    -- | The HTTP status code.
    TestInvokeMethodResponse -> Maybe Int
status :: Prelude.Maybe Prelude.Int,
    -- | The body of the HTTP response.
    TestInvokeMethodResponse -> Maybe Text
body :: Prelude.Maybe Prelude.Text,
    -- | The execution latency of the test invoke request.
    TestInvokeMethodResponse -> Maybe Integer
latency :: Prelude.Maybe Prelude.Integer,
    -- | The headers of the HTTP response.
    TestInvokeMethodResponse -> Maybe (HashMap Text Text)
headers :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The headers of the HTTP response as a map from string to list of values.
    TestInvokeMethodResponse -> Maybe (HashMap Text [Text])
multiValueHeaders :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
    -- | The response's http status code.
    TestInvokeMethodResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (TestInvokeMethodResponse -> TestInvokeMethodResponse -> Bool
(TestInvokeMethodResponse -> TestInvokeMethodResponse -> Bool)
-> (TestInvokeMethodResponse -> TestInvokeMethodResponse -> Bool)
-> Eq TestInvokeMethodResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestInvokeMethodResponse -> TestInvokeMethodResponse -> Bool
$c/= :: TestInvokeMethodResponse -> TestInvokeMethodResponse -> Bool
== :: TestInvokeMethodResponse -> TestInvokeMethodResponse -> Bool
$c== :: TestInvokeMethodResponse -> TestInvokeMethodResponse -> Bool
Prelude.Eq, ReadPrec [TestInvokeMethodResponse]
ReadPrec TestInvokeMethodResponse
Int -> ReadS TestInvokeMethodResponse
ReadS [TestInvokeMethodResponse]
(Int -> ReadS TestInvokeMethodResponse)
-> ReadS [TestInvokeMethodResponse]
-> ReadPrec TestInvokeMethodResponse
-> ReadPrec [TestInvokeMethodResponse]
-> Read TestInvokeMethodResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TestInvokeMethodResponse]
$creadListPrec :: ReadPrec [TestInvokeMethodResponse]
readPrec :: ReadPrec TestInvokeMethodResponse
$creadPrec :: ReadPrec TestInvokeMethodResponse
readList :: ReadS [TestInvokeMethodResponse]
$creadList :: ReadS [TestInvokeMethodResponse]
readsPrec :: Int -> ReadS TestInvokeMethodResponse
$creadsPrec :: Int -> ReadS TestInvokeMethodResponse
Prelude.Read, Int -> TestInvokeMethodResponse -> ShowS
[TestInvokeMethodResponse] -> ShowS
TestInvokeMethodResponse -> String
(Int -> TestInvokeMethodResponse -> ShowS)
-> (TestInvokeMethodResponse -> String)
-> ([TestInvokeMethodResponse] -> ShowS)
-> Show TestInvokeMethodResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TestInvokeMethodResponse] -> ShowS
$cshowList :: [TestInvokeMethodResponse] -> ShowS
show :: TestInvokeMethodResponse -> String
$cshow :: TestInvokeMethodResponse -> String
showsPrec :: Int -> TestInvokeMethodResponse -> ShowS
$cshowsPrec :: Int -> TestInvokeMethodResponse -> ShowS
Prelude.Show, (forall x.
 TestInvokeMethodResponse -> Rep TestInvokeMethodResponse x)
-> (forall x.
    Rep TestInvokeMethodResponse x -> TestInvokeMethodResponse)
-> Generic TestInvokeMethodResponse
forall x.
Rep TestInvokeMethodResponse x -> TestInvokeMethodResponse
forall x.
TestInvokeMethodResponse -> Rep TestInvokeMethodResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TestInvokeMethodResponse x -> TestInvokeMethodResponse
$cfrom :: forall x.
TestInvokeMethodResponse -> Rep TestInvokeMethodResponse x
Prelude.Generic)

-- |
-- Create a value of 'TestInvokeMethodResponse' 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', 'testInvokeMethodResponse_log' - The API Gateway execution log for the test invoke request.
--
-- 'status', 'testInvokeMethodResponse_status' - The HTTP status code.
--
-- 'body', 'testInvokeMethodResponse_body' - The body of the HTTP response.
--
-- 'latency', 'testInvokeMethodResponse_latency' - The execution latency of the test invoke request.
--
-- 'headers', 'testInvokeMethodResponse_headers' - The headers of the HTTP response.
--
-- 'multiValueHeaders', 'testInvokeMethodResponse_multiValueHeaders' - The headers of the HTTP response as a map from string to list of values.
--
-- 'httpStatus', 'testInvokeMethodResponse_httpStatus' - The response's http status code.
newTestInvokeMethodResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  TestInvokeMethodResponse
newTestInvokeMethodResponse :: Int -> TestInvokeMethodResponse
newTestInvokeMethodResponse Int
pHttpStatus_ =
  TestInvokeMethodResponse' :: Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Integer
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text [Text])
-> Int
-> TestInvokeMethodResponse
TestInvokeMethodResponse'
    { $sel:log:TestInvokeMethodResponse' :: Maybe Text
log = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:TestInvokeMethodResponse' :: Maybe Int
status = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:body:TestInvokeMethodResponse' :: Maybe Text
body = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:latency:TestInvokeMethodResponse' :: Maybe Integer
latency = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:headers:TestInvokeMethodResponse' :: Maybe (HashMap Text Text)
headers = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:multiValueHeaders:TestInvokeMethodResponse' :: Maybe (HashMap Text [Text])
multiValueHeaders = Maybe (HashMap Text [Text])
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:TestInvokeMethodResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | The HTTP status code.
testInvokeMethodResponse_status :: Lens.Lens' TestInvokeMethodResponse (Prelude.Maybe Prelude.Int)
testInvokeMethodResponse_status :: (Maybe Int -> f (Maybe Int))
-> TestInvokeMethodResponse -> f TestInvokeMethodResponse
testInvokeMethodResponse_status = (TestInvokeMethodResponse -> Maybe Int)
-> (TestInvokeMethodResponse
    -> Maybe Int -> TestInvokeMethodResponse)
-> Lens
     TestInvokeMethodResponse
     TestInvokeMethodResponse
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeMethodResponse' {Maybe Int
status :: Maybe Int
$sel:status:TestInvokeMethodResponse' :: TestInvokeMethodResponse -> Maybe Int
status} -> Maybe Int
status) (\s :: TestInvokeMethodResponse
s@TestInvokeMethodResponse' {} Maybe Int
a -> TestInvokeMethodResponse
s {$sel:status:TestInvokeMethodResponse' :: Maybe Int
status = Maybe Int
a} :: TestInvokeMethodResponse)

-- | The body of the HTTP response.
testInvokeMethodResponse_body :: Lens.Lens' TestInvokeMethodResponse (Prelude.Maybe Prelude.Text)
testInvokeMethodResponse_body :: (Maybe Text -> f (Maybe Text))
-> TestInvokeMethodResponse -> f TestInvokeMethodResponse
testInvokeMethodResponse_body = (TestInvokeMethodResponse -> Maybe Text)
-> (TestInvokeMethodResponse
    -> Maybe Text -> TestInvokeMethodResponse)
-> Lens
     TestInvokeMethodResponse
     TestInvokeMethodResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeMethodResponse' {Maybe Text
body :: Maybe Text
$sel:body:TestInvokeMethodResponse' :: TestInvokeMethodResponse -> Maybe Text
body} -> Maybe Text
body) (\s :: TestInvokeMethodResponse
s@TestInvokeMethodResponse' {} Maybe Text
a -> TestInvokeMethodResponse
s {$sel:body:TestInvokeMethodResponse' :: Maybe Text
body = Maybe Text
a} :: TestInvokeMethodResponse)

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

-- | The headers of the HTTP response.
testInvokeMethodResponse_headers :: Lens.Lens' TestInvokeMethodResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
testInvokeMethodResponse_headers :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> TestInvokeMethodResponse -> f TestInvokeMethodResponse
testInvokeMethodResponse_headers = (TestInvokeMethodResponse -> Maybe (HashMap Text Text))
-> (TestInvokeMethodResponse
    -> Maybe (HashMap Text Text) -> TestInvokeMethodResponse)
-> Lens
     TestInvokeMethodResponse
     TestInvokeMethodResponse
     (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 (\TestInvokeMethodResponse' {Maybe (HashMap Text Text)
headers :: Maybe (HashMap Text Text)
$sel:headers:TestInvokeMethodResponse' :: TestInvokeMethodResponse -> Maybe (HashMap Text Text)
headers} -> Maybe (HashMap Text Text)
headers) (\s :: TestInvokeMethodResponse
s@TestInvokeMethodResponse' {} Maybe (HashMap Text Text)
a -> TestInvokeMethodResponse
s {$sel:headers:TestInvokeMethodResponse' :: Maybe (HashMap Text Text)
headers = Maybe (HashMap Text Text)
a} :: TestInvokeMethodResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> TestInvokeMethodResponse -> f TestInvokeMethodResponse)
-> ((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)))
-> TestInvokeMethodResponse
-> f TestInvokeMethodResponse
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 headers of the HTTP response as a map from string to list of values.
testInvokeMethodResponse_multiValueHeaders :: Lens.Lens' TestInvokeMethodResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
testInvokeMethodResponse_multiValueHeaders :: (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> TestInvokeMethodResponse -> f TestInvokeMethodResponse
testInvokeMethodResponse_multiValueHeaders = (TestInvokeMethodResponse -> Maybe (HashMap Text [Text]))
-> (TestInvokeMethodResponse
    -> Maybe (HashMap Text [Text]) -> TestInvokeMethodResponse)
-> Lens
     TestInvokeMethodResponse
     TestInvokeMethodResponse
     (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 (\TestInvokeMethodResponse' {Maybe (HashMap Text [Text])
multiValueHeaders :: Maybe (HashMap Text [Text])
$sel:multiValueHeaders:TestInvokeMethodResponse' :: TestInvokeMethodResponse -> Maybe (HashMap Text [Text])
multiValueHeaders} -> Maybe (HashMap Text [Text])
multiValueHeaders) (\s :: TestInvokeMethodResponse
s@TestInvokeMethodResponse' {} Maybe (HashMap Text [Text])
a -> TestInvokeMethodResponse
s {$sel:multiValueHeaders:TestInvokeMethodResponse' :: Maybe (HashMap Text [Text])
multiValueHeaders = Maybe (HashMap Text [Text])
a} :: TestInvokeMethodResponse) ((Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
 -> TestInvokeMethodResponse -> f TestInvokeMethodResponse)
-> ((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])))
-> TestInvokeMethodResponse
-> f TestInvokeMethodResponse
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 response's http status code.
testInvokeMethodResponse_httpStatus :: Lens.Lens' TestInvokeMethodResponse Prelude.Int
testInvokeMethodResponse_httpStatus :: (Int -> f Int)
-> TestInvokeMethodResponse -> f TestInvokeMethodResponse
testInvokeMethodResponse_httpStatus = (TestInvokeMethodResponse -> Int)
-> (TestInvokeMethodResponse -> Int -> TestInvokeMethodResponse)
-> Lens TestInvokeMethodResponse TestInvokeMethodResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestInvokeMethodResponse' {Int
httpStatus :: Int
$sel:httpStatus:TestInvokeMethodResponse' :: TestInvokeMethodResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: TestInvokeMethodResponse
s@TestInvokeMethodResponse' {} Int
a -> TestInvokeMethodResponse
s {$sel:httpStatus:TestInvokeMethodResponse' :: Int
httpStatus = Int
a} :: TestInvokeMethodResponse)

instance Prelude.NFData TestInvokeMethodResponse