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

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

-- |
-- Module      : Amazonka.ApiGatewayV2.CreateIntegrationResponse
-- 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)
--
-- Creates an IntegrationResponses.
module Amazonka.ApiGatewayV2.CreateIntegrationResponse
  ( -- * Creating a Request
    CreateIntegrationResponse (..),
    newCreateIntegrationResponse,

    -- * Request Lenses
    createIntegrationResponse_templateSelectionExpression,
    createIntegrationResponse_contentHandlingStrategy,
    createIntegrationResponse_responseTemplates,
    createIntegrationResponse_responseParameters,
    createIntegrationResponse_apiId,
    createIntegrationResponse_integrationId,
    createIntegrationResponse_integrationResponseKey,

    -- * Destructuring the Response
    CreateIntegrationResponseResponse (..),
    newCreateIntegrationResponseResponse,

    -- * Response Lenses
    createIntegrationResponseResponse_integrationResponseId,
    createIntegrationResponseResponse_integrationResponseKey,
    createIntegrationResponseResponse_templateSelectionExpression,
    createIntegrationResponseResponse_contentHandlingStrategy,
    createIntegrationResponseResponse_responseTemplates,
    createIntegrationResponseResponse_responseParameters,
    createIntegrationResponseResponse_httpStatus,
  )
where

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

-- | Creates a new IntegrationResponse resource to represent an integration
-- response.
--
-- /See:/ 'newCreateIntegrationResponse' smart constructor.
data CreateIntegrationResponse = CreateIntegrationResponse'
  { -- | The template selection expression for the integration response.
    -- Supported only for WebSocket APIs.
    CreateIntegrationResponse -> Maybe Text
templateSelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | Specifies how to handle response payload content type conversions.
    -- Supported values are CONVERT_TO_BINARY and CONVERT_TO_TEXT, with the
    -- following behaviors:
    --
    -- CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded
    -- string to the corresponding binary blob.
    --
    -- CONVERT_TO_TEXT: Converts a response payload from a binary blob to a
    -- Base64-encoded string.
    --
    -- If this property is not defined, the response payload will be passed
    -- through from the integration response to the route response or method
    -- response without modification.
    CreateIntegrationResponse -> Maybe ContentHandlingStrategy
contentHandlingStrategy :: Prelude.Maybe ContentHandlingStrategy,
    -- | The collection of response templates for the integration response as a
    -- string-to-string map of key-value pairs. Response templates are
    -- represented as a key\/value map, with a content-type as the key and a
    -- template as the value.
    CreateIntegrationResponse -> Maybe (HashMap Text Text)
responseTemplates :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A key-value map specifying response parameters that are passed to the
    -- method response from the backend. The key is a method response header
    -- parameter name and the mapped value is an integration response header
    -- value, a static value enclosed within a pair of single quotes, or a JSON
    -- expression from the integration response body. The mapping key must
    -- match the pattern of method.response.header.{name}, where {name} is a
    -- valid and unique header name. The mapped non-static value must match the
    -- pattern of integration.response.header.{name} or
    -- integration.response.body.{JSON-expression}, where {name} is a valid and
    -- unique response header name and {JSON-expression} is a valid JSON
    -- expression without the $ prefix.
    CreateIntegrationResponse -> Maybe (HashMap Text Text)
responseParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The API identifier.
    CreateIntegrationResponse -> Text
apiId :: Prelude.Text,
    -- | The integration ID.
    CreateIntegrationResponse -> Text
integrationId :: Prelude.Text,
    -- | The integration response key.
    CreateIntegrationResponse -> Text
integrationResponseKey :: Prelude.Text
  }
  deriving (CreateIntegrationResponse -> CreateIntegrationResponse -> Bool
(CreateIntegrationResponse -> CreateIntegrationResponse -> Bool)
-> (CreateIntegrationResponse -> CreateIntegrationResponse -> Bool)
-> Eq CreateIntegrationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateIntegrationResponse -> CreateIntegrationResponse -> Bool
$c/= :: CreateIntegrationResponse -> CreateIntegrationResponse -> Bool
== :: CreateIntegrationResponse -> CreateIntegrationResponse -> Bool
$c== :: CreateIntegrationResponse -> CreateIntegrationResponse -> Bool
Prelude.Eq, ReadPrec [CreateIntegrationResponse]
ReadPrec CreateIntegrationResponse
Int -> ReadS CreateIntegrationResponse
ReadS [CreateIntegrationResponse]
(Int -> ReadS CreateIntegrationResponse)
-> ReadS [CreateIntegrationResponse]
-> ReadPrec CreateIntegrationResponse
-> ReadPrec [CreateIntegrationResponse]
-> Read CreateIntegrationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateIntegrationResponse]
$creadListPrec :: ReadPrec [CreateIntegrationResponse]
readPrec :: ReadPrec CreateIntegrationResponse
$creadPrec :: ReadPrec CreateIntegrationResponse
readList :: ReadS [CreateIntegrationResponse]
$creadList :: ReadS [CreateIntegrationResponse]
readsPrec :: Int -> ReadS CreateIntegrationResponse
$creadsPrec :: Int -> ReadS CreateIntegrationResponse
Prelude.Read, Int -> CreateIntegrationResponse -> ShowS
[CreateIntegrationResponse] -> ShowS
CreateIntegrationResponse -> String
(Int -> CreateIntegrationResponse -> ShowS)
-> (CreateIntegrationResponse -> String)
-> ([CreateIntegrationResponse] -> ShowS)
-> Show CreateIntegrationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateIntegrationResponse] -> ShowS
$cshowList :: [CreateIntegrationResponse] -> ShowS
show :: CreateIntegrationResponse -> String
$cshow :: CreateIntegrationResponse -> String
showsPrec :: Int -> CreateIntegrationResponse -> ShowS
$cshowsPrec :: Int -> CreateIntegrationResponse -> ShowS
Prelude.Show, (forall x.
 CreateIntegrationResponse -> Rep CreateIntegrationResponse x)
-> (forall x.
    Rep CreateIntegrationResponse x -> CreateIntegrationResponse)
-> Generic CreateIntegrationResponse
forall x.
Rep CreateIntegrationResponse x -> CreateIntegrationResponse
forall x.
CreateIntegrationResponse -> Rep CreateIntegrationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateIntegrationResponse x -> CreateIntegrationResponse
$cfrom :: forall x.
CreateIntegrationResponse -> Rep CreateIntegrationResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateIntegrationResponse' 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:
--
-- 'templateSelectionExpression', 'createIntegrationResponse_templateSelectionExpression' - The template selection expression for the integration response.
-- Supported only for WebSocket APIs.
--
-- 'contentHandlingStrategy', 'createIntegrationResponse_contentHandlingStrategy' - Specifies how to handle response payload content type conversions.
-- Supported values are CONVERT_TO_BINARY and CONVERT_TO_TEXT, with the
-- following behaviors:
--
-- CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded
-- string to the corresponding binary blob.
--
-- CONVERT_TO_TEXT: Converts a response payload from a binary blob to a
-- Base64-encoded string.
--
-- If this property is not defined, the response payload will be passed
-- through from the integration response to the route response or method
-- response without modification.
--
-- 'responseTemplates', 'createIntegrationResponse_responseTemplates' - The collection of response templates for the integration response as a
-- string-to-string map of key-value pairs. Response templates are
-- represented as a key\/value map, with a content-type as the key and a
-- template as the value.
--
-- 'responseParameters', 'createIntegrationResponse_responseParameters' - A key-value map specifying response parameters that are passed to the
-- method response from the backend. The key is a method response header
-- parameter name and the mapped value is an integration response header
-- value, a static value enclosed within a pair of single quotes, or a JSON
-- expression from the integration response body. The mapping key must
-- match the pattern of method.response.header.{name}, where {name} is a
-- valid and unique header name. The mapped non-static value must match the
-- pattern of integration.response.header.{name} or
-- integration.response.body.{JSON-expression}, where {name} is a valid and
-- unique response header name and {JSON-expression} is a valid JSON
-- expression without the $ prefix.
--
-- 'apiId', 'createIntegrationResponse_apiId' - The API identifier.
--
-- 'integrationId', 'createIntegrationResponse_integrationId' - The integration ID.
--
-- 'integrationResponseKey', 'createIntegrationResponse_integrationResponseKey' - The integration response key.
newCreateIntegrationResponse ::
  -- | 'apiId'
  Prelude.Text ->
  -- | 'integrationId'
  Prelude.Text ->
  -- | 'integrationResponseKey'
  Prelude.Text ->
  CreateIntegrationResponse
newCreateIntegrationResponse :: Text -> Text -> Text -> CreateIntegrationResponse
newCreateIntegrationResponse
  Text
pApiId_
  Text
pIntegrationId_
  Text
pIntegrationResponseKey_ =
    CreateIntegrationResponse' :: Maybe Text
-> Maybe ContentHandlingStrategy
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> CreateIntegrationResponse
CreateIntegrationResponse'
      { $sel:templateSelectionExpression:CreateIntegrationResponse' :: Maybe Text
templateSelectionExpression =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:contentHandlingStrategy:CreateIntegrationResponse' :: Maybe ContentHandlingStrategy
contentHandlingStrategy = Maybe ContentHandlingStrategy
forall a. Maybe a
Prelude.Nothing,
        $sel:responseTemplates:CreateIntegrationResponse' :: Maybe (HashMap Text Text)
responseTemplates = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:responseParameters:CreateIntegrationResponse' :: Maybe (HashMap Text Text)
responseParameters = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:apiId:CreateIntegrationResponse' :: Text
apiId = Text
pApiId_,
        $sel:integrationId:CreateIntegrationResponse' :: Text
integrationId = Text
pIntegrationId_,
        $sel:integrationResponseKey:CreateIntegrationResponse' :: Text
integrationResponseKey =
          Text
pIntegrationResponseKey_
      }

-- | The template selection expression for the integration response.
-- Supported only for WebSocket APIs.
createIntegrationResponse_templateSelectionExpression :: Lens.Lens' CreateIntegrationResponse (Prelude.Maybe Prelude.Text)
createIntegrationResponse_templateSelectionExpression :: (Maybe Text -> f (Maybe Text))
-> CreateIntegrationResponse -> f CreateIntegrationResponse
createIntegrationResponse_templateSelectionExpression = (CreateIntegrationResponse -> Maybe Text)
-> (CreateIntegrationResponse
    -> Maybe Text -> CreateIntegrationResponse)
-> Lens
     CreateIntegrationResponse
     CreateIntegrationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIntegrationResponse' {Maybe Text
templateSelectionExpression :: Maybe Text
$sel:templateSelectionExpression:CreateIntegrationResponse' :: CreateIntegrationResponse -> Maybe Text
templateSelectionExpression} -> Maybe Text
templateSelectionExpression) (\s :: CreateIntegrationResponse
s@CreateIntegrationResponse' {} Maybe Text
a -> CreateIntegrationResponse
s {$sel:templateSelectionExpression:CreateIntegrationResponse' :: Maybe Text
templateSelectionExpression = Maybe Text
a} :: CreateIntegrationResponse)

-- | Specifies how to handle response payload content type conversions.
-- Supported values are CONVERT_TO_BINARY and CONVERT_TO_TEXT, with the
-- following behaviors:
--
-- CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded
-- string to the corresponding binary blob.
--
-- CONVERT_TO_TEXT: Converts a response payload from a binary blob to a
-- Base64-encoded string.
--
-- If this property is not defined, the response payload will be passed
-- through from the integration response to the route response or method
-- response without modification.
createIntegrationResponse_contentHandlingStrategy :: Lens.Lens' CreateIntegrationResponse (Prelude.Maybe ContentHandlingStrategy)
createIntegrationResponse_contentHandlingStrategy :: (Maybe ContentHandlingStrategy
 -> f (Maybe ContentHandlingStrategy))
-> CreateIntegrationResponse -> f CreateIntegrationResponse
createIntegrationResponse_contentHandlingStrategy = (CreateIntegrationResponse -> Maybe ContentHandlingStrategy)
-> (CreateIntegrationResponse
    -> Maybe ContentHandlingStrategy -> CreateIntegrationResponse)
-> Lens
     CreateIntegrationResponse
     CreateIntegrationResponse
     (Maybe ContentHandlingStrategy)
     (Maybe ContentHandlingStrategy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIntegrationResponse' {Maybe ContentHandlingStrategy
contentHandlingStrategy :: Maybe ContentHandlingStrategy
$sel:contentHandlingStrategy:CreateIntegrationResponse' :: CreateIntegrationResponse -> Maybe ContentHandlingStrategy
contentHandlingStrategy} -> Maybe ContentHandlingStrategy
contentHandlingStrategy) (\s :: CreateIntegrationResponse
s@CreateIntegrationResponse' {} Maybe ContentHandlingStrategy
a -> CreateIntegrationResponse
s {$sel:contentHandlingStrategy:CreateIntegrationResponse' :: Maybe ContentHandlingStrategy
contentHandlingStrategy = Maybe ContentHandlingStrategy
a} :: CreateIntegrationResponse)

-- | The collection of response templates for the integration response as a
-- string-to-string map of key-value pairs. Response templates are
-- represented as a key\/value map, with a content-type as the key and a
-- template as the value.
createIntegrationResponse_responseTemplates :: Lens.Lens' CreateIntegrationResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createIntegrationResponse_responseTemplates :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateIntegrationResponse -> f CreateIntegrationResponse
createIntegrationResponse_responseTemplates = (CreateIntegrationResponse -> Maybe (HashMap Text Text))
-> (CreateIntegrationResponse
    -> Maybe (HashMap Text Text) -> CreateIntegrationResponse)
-> Lens
     CreateIntegrationResponse
     CreateIntegrationResponse
     (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 (\CreateIntegrationResponse' {Maybe (HashMap Text Text)
responseTemplates :: Maybe (HashMap Text Text)
$sel:responseTemplates:CreateIntegrationResponse' :: CreateIntegrationResponse -> Maybe (HashMap Text Text)
responseTemplates} -> Maybe (HashMap Text Text)
responseTemplates) (\s :: CreateIntegrationResponse
s@CreateIntegrationResponse' {} Maybe (HashMap Text Text)
a -> CreateIntegrationResponse
s {$sel:responseTemplates:CreateIntegrationResponse' :: Maybe (HashMap Text Text)
responseTemplates = Maybe (HashMap Text Text)
a} :: CreateIntegrationResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateIntegrationResponse -> f CreateIntegrationResponse)
-> ((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)))
-> CreateIntegrationResponse
-> f CreateIntegrationResponse
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 specifying response parameters that are passed to the
-- method response from the backend. The key is a method response header
-- parameter name and the mapped value is an integration response header
-- value, a static value enclosed within a pair of single quotes, or a JSON
-- expression from the integration response body. The mapping key must
-- match the pattern of method.response.header.{name}, where {name} is a
-- valid and unique header name. The mapped non-static value must match the
-- pattern of integration.response.header.{name} or
-- integration.response.body.{JSON-expression}, where {name} is a valid and
-- unique response header name and {JSON-expression} is a valid JSON
-- expression without the $ prefix.
createIntegrationResponse_responseParameters :: Lens.Lens' CreateIntegrationResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createIntegrationResponse_responseParameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateIntegrationResponse -> f CreateIntegrationResponse
createIntegrationResponse_responseParameters = (CreateIntegrationResponse -> Maybe (HashMap Text Text))
-> (CreateIntegrationResponse
    -> Maybe (HashMap Text Text) -> CreateIntegrationResponse)
-> Lens
     CreateIntegrationResponse
     CreateIntegrationResponse
     (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 (\CreateIntegrationResponse' {Maybe (HashMap Text Text)
responseParameters :: Maybe (HashMap Text Text)
$sel:responseParameters:CreateIntegrationResponse' :: CreateIntegrationResponse -> Maybe (HashMap Text Text)
responseParameters} -> Maybe (HashMap Text Text)
responseParameters) (\s :: CreateIntegrationResponse
s@CreateIntegrationResponse' {} Maybe (HashMap Text Text)
a -> CreateIntegrationResponse
s {$sel:responseParameters:CreateIntegrationResponse' :: Maybe (HashMap Text Text)
responseParameters = Maybe (HashMap Text Text)
a} :: CreateIntegrationResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateIntegrationResponse -> f CreateIntegrationResponse)
-> ((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)))
-> CreateIntegrationResponse
-> f CreateIntegrationResponse
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 API identifier.
createIntegrationResponse_apiId :: Lens.Lens' CreateIntegrationResponse Prelude.Text
createIntegrationResponse_apiId :: (Text -> f Text)
-> CreateIntegrationResponse -> f CreateIntegrationResponse
createIntegrationResponse_apiId = (CreateIntegrationResponse -> Text)
-> (CreateIntegrationResponse -> Text -> CreateIntegrationResponse)
-> Lens
     CreateIntegrationResponse CreateIntegrationResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIntegrationResponse' {Text
apiId :: Text
$sel:apiId:CreateIntegrationResponse' :: CreateIntegrationResponse -> Text
apiId} -> Text
apiId) (\s :: CreateIntegrationResponse
s@CreateIntegrationResponse' {} Text
a -> CreateIntegrationResponse
s {$sel:apiId:CreateIntegrationResponse' :: Text
apiId = Text
a} :: CreateIntegrationResponse)

-- | The integration ID.
createIntegrationResponse_integrationId :: Lens.Lens' CreateIntegrationResponse Prelude.Text
createIntegrationResponse_integrationId :: (Text -> f Text)
-> CreateIntegrationResponse -> f CreateIntegrationResponse
createIntegrationResponse_integrationId = (CreateIntegrationResponse -> Text)
-> (CreateIntegrationResponse -> Text -> CreateIntegrationResponse)
-> Lens
     CreateIntegrationResponse CreateIntegrationResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIntegrationResponse' {Text
integrationId :: Text
$sel:integrationId:CreateIntegrationResponse' :: CreateIntegrationResponse -> Text
integrationId} -> Text
integrationId) (\s :: CreateIntegrationResponse
s@CreateIntegrationResponse' {} Text
a -> CreateIntegrationResponse
s {$sel:integrationId:CreateIntegrationResponse' :: Text
integrationId = Text
a} :: CreateIntegrationResponse)

-- | The integration response key.
createIntegrationResponse_integrationResponseKey :: Lens.Lens' CreateIntegrationResponse Prelude.Text
createIntegrationResponse_integrationResponseKey :: (Text -> f Text)
-> CreateIntegrationResponse -> f CreateIntegrationResponse
createIntegrationResponse_integrationResponseKey = (CreateIntegrationResponse -> Text)
-> (CreateIntegrationResponse -> Text -> CreateIntegrationResponse)
-> Lens
     CreateIntegrationResponse CreateIntegrationResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIntegrationResponse' {Text
integrationResponseKey :: Text
$sel:integrationResponseKey:CreateIntegrationResponse' :: CreateIntegrationResponse -> Text
integrationResponseKey} -> Text
integrationResponseKey) (\s :: CreateIntegrationResponse
s@CreateIntegrationResponse' {} Text
a -> CreateIntegrationResponse
s {$sel:integrationResponseKey:CreateIntegrationResponse' :: Text
integrationResponseKey = Text
a} :: CreateIntegrationResponse)

instance Core.AWSRequest CreateIntegrationResponse where
  type
    AWSResponse CreateIntegrationResponse =
      CreateIntegrationResponseResponse
  request :: CreateIntegrationResponse -> Request CreateIntegrationResponse
request = Service
-> CreateIntegrationResponse -> Request CreateIntegrationResponse
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateIntegrationResponse
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateIntegrationResponse)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateIntegrationResponse))
-> Logger
-> Service
-> Proxy CreateIntegrationResponse
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateIntegrationResponse)))
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 Text
-> Maybe ContentHandlingStrategy
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Int
-> CreateIntegrationResponseResponse
CreateIntegrationResponseResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe ContentHandlingStrategy
 -> Maybe (HashMap Text Text)
 -> Maybe (HashMap Text Text)
 -> Int
 -> CreateIntegrationResponseResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe ContentHandlingStrategy
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateIntegrationResponseResponse)
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
"integrationResponseId")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe ContentHandlingStrategy
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateIntegrationResponseResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe ContentHandlingStrategy
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateIntegrationResponseResponse)
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
"integrationResponseKey")
            Either
  String
  (Maybe Text
   -> Maybe ContentHandlingStrategy
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateIntegrationResponseResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ContentHandlingStrategy
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateIntegrationResponseResponse)
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
"templateSelectionExpression")
            Either
  String
  (Maybe ContentHandlingStrategy
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateIntegrationResponseResponse)
-> Either String (Maybe ContentHandlingStrategy)
-> Either
     String
     (Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateIntegrationResponseResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ContentHandlingStrategy)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"contentHandlingStrategy")
            Either
  String
  (Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateIntegrationResponseResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either
     String
     (Maybe (HashMap Text Text)
      -> Int -> CreateIntegrationResponseResponse)
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
"responseTemplates"
                            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 -> CreateIntegrationResponseResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> CreateIntegrationResponseResponse)
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
"responseParameters"
                            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 -> CreateIntegrationResponseResponse)
-> Either String Int
-> Either String CreateIntegrationResponseResponse
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 CreateIntegrationResponse

instance Prelude.NFData CreateIntegrationResponse

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

instance Core.ToJSON CreateIntegrationResponse where
  toJSON :: CreateIntegrationResponse -> Value
toJSON CreateIntegrationResponse' {Maybe Text
Maybe (HashMap Text Text)
Maybe ContentHandlingStrategy
Text
integrationResponseKey :: Text
integrationId :: Text
apiId :: Text
responseParameters :: Maybe (HashMap Text Text)
responseTemplates :: Maybe (HashMap Text Text)
contentHandlingStrategy :: Maybe ContentHandlingStrategy
templateSelectionExpression :: Maybe Text
$sel:integrationResponseKey:CreateIntegrationResponse' :: CreateIntegrationResponse -> Text
$sel:integrationId:CreateIntegrationResponse' :: CreateIntegrationResponse -> Text
$sel:apiId:CreateIntegrationResponse' :: CreateIntegrationResponse -> Text
$sel:responseParameters:CreateIntegrationResponse' :: CreateIntegrationResponse -> Maybe (HashMap Text Text)
$sel:responseTemplates:CreateIntegrationResponse' :: CreateIntegrationResponse -> Maybe (HashMap Text Text)
$sel:contentHandlingStrategy:CreateIntegrationResponse' :: CreateIntegrationResponse -> Maybe ContentHandlingStrategy
$sel:templateSelectionExpression:CreateIntegrationResponse' :: CreateIntegrationResponse -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"templateSelectionExpression" 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
templateSelectionExpression,
            (Text
"contentHandlingStrategy" Text -> ContentHandlingStrategy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ContentHandlingStrategy -> Pair)
-> Maybe ContentHandlingStrategy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ContentHandlingStrategy
contentHandlingStrategy,
            (Text
"responseTemplates" 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)
responseTemplates,
            (Text
"responseParameters" 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)
responseParameters,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"integrationResponseKey"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
integrationResponseKey
              )
          ]
      )

instance Core.ToPath CreateIntegrationResponse where
  toPath :: CreateIntegrationResponse -> ByteString
toPath CreateIntegrationResponse' {Maybe Text
Maybe (HashMap Text Text)
Maybe ContentHandlingStrategy
Text
integrationResponseKey :: Text
integrationId :: Text
apiId :: Text
responseParameters :: Maybe (HashMap Text Text)
responseTemplates :: Maybe (HashMap Text Text)
contentHandlingStrategy :: Maybe ContentHandlingStrategy
templateSelectionExpression :: Maybe Text
$sel:integrationResponseKey:CreateIntegrationResponse' :: CreateIntegrationResponse -> Text
$sel:integrationId:CreateIntegrationResponse' :: CreateIntegrationResponse -> Text
$sel:apiId:CreateIntegrationResponse' :: CreateIntegrationResponse -> Text
$sel:responseParameters:CreateIntegrationResponse' :: CreateIntegrationResponse -> Maybe (HashMap Text Text)
$sel:responseTemplates:CreateIntegrationResponse' :: CreateIntegrationResponse -> Maybe (HashMap Text Text)
$sel:contentHandlingStrategy:CreateIntegrationResponse' :: CreateIntegrationResponse -> Maybe ContentHandlingStrategy
$sel:templateSelectionExpression:CreateIntegrationResponse' :: CreateIntegrationResponse -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v2/apis/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
apiId,
        ByteString
"/integrations/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
integrationId,
        ByteString
"/integrationresponses"
      ]

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

-- | /See:/ 'newCreateIntegrationResponseResponse' smart constructor.
data CreateIntegrationResponseResponse = CreateIntegrationResponseResponse'
  { -- | The integration response ID.
    CreateIntegrationResponseResponse -> Maybe Text
integrationResponseId :: Prelude.Maybe Prelude.Text,
    -- | The integration response key.
    CreateIntegrationResponseResponse -> Maybe Text
integrationResponseKey :: Prelude.Maybe Prelude.Text,
    -- | The template selection expressions for the integration response.
    CreateIntegrationResponseResponse -> Maybe Text
templateSelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | Supported only for WebSocket APIs. Specifies how to handle response
    -- payload content type conversions. Supported values are CONVERT_TO_BINARY
    -- and CONVERT_TO_TEXT, with the following behaviors:
    --
    -- CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded
    -- string to the corresponding binary blob.
    --
    -- CONVERT_TO_TEXT: Converts a response payload from a binary blob to a
    -- Base64-encoded string.
    --
    -- If this property is not defined, the response payload will be passed
    -- through from the integration response to the route response or method
    -- response without modification.
    CreateIntegrationResponseResponse -> Maybe ContentHandlingStrategy
contentHandlingStrategy :: Prelude.Maybe ContentHandlingStrategy,
    -- | The collection of response templates for the integration response as a
    -- string-to-string map of key-value pairs. Response templates are
    -- represented as a key\/value map, with a content-type as the key and a
    -- template as the value.
    CreateIntegrationResponseResponse -> Maybe (HashMap Text Text)
responseTemplates :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A key-value map specifying response parameters that are passed to the
    -- method response from the backend. The key is a method response header
    -- parameter name and the mapped value is an integration response header
    -- value, a static value enclosed within a pair of single quotes, or a JSON
    -- expression from the integration response body. The mapping key must
    -- match the pattern of method.response.header.{name}, where name is a
    -- valid and unique header name. The mapped non-static value must match the
    -- pattern of integration.response.header.{name} or
    -- integration.response.body.{JSON-expression}, where name is a valid and
    -- unique response header name and JSON-expression is a valid JSON
    -- expression without the $ prefix.
    CreateIntegrationResponseResponse -> Maybe (HashMap Text Text)
responseParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    CreateIntegrationResponseResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateIntegrationResponseResponse
-> CreateIntegrationResponseResponse -> Bool
(CreateIntegrationResponseResponse
 -> CreateIntegrationResponseResponse -> Bool)
-> (CreateIntegrationResponseResponse
    -> CreateIntegrationResponseResponse -> Bool)
-> Eq CreateIntegrationResponseResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateIntegrationResponseResponse
-> CreateIntegrationResponseResponse -> Bool
$c/= :: CreateIntegrationResponseResponse
-> CreateIntegrationResponseResponse -> Bool
== :: CreateIntegrationResponseResponse
-> CreateIntegrationResponseResponse -> Bool
$c== :: CreateIntegrationResponseResponse
-> CreateIntegrationResponseResponse -> Bool
Prelude.Eq, ReadPrec [CreateIntegrationResponseResponse]
ReadPrec CreateIntegrationResponseResponse
Int -> ReadS CreateIntegrationResponseResponse
ReadS [CreateIntegrationResponseResponse]
(Int -> ReadS CreateIntegrationResponseResponse)
-> ReadS [CreateIntegrationResponseResponse]
-> ReadPrec CreateIntegrationResponseResponse
-> ReadPrec [CreateIntegrationResponseResponse]
-> Read CreateIntegrationResponseResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateIntegrationResponseResponse]
$creadListPrec :: ReadPrec [CreateIntegrationResponseResponse]
readPrec :: ReadPrec CreateIntegrationResponseResponse
$creadPrec :: ReadPrec CreateIntegrationResponseResponse
readList :: ReadS [CreateIntegrationResponseResponse]
$creadList :: ReadS [CreateIntegrationResponseResponse]
readsPrec :: Int -> ReadS CreateIntegrationResponseResponse
$creadsPrec :: Int -> ReadS CreateIntegrationResponseResponse
Prelude.Read, Int -> CreateIntegrationResponseResponse -> ShowS
[CreateIntegrationResponseResponse] -> ShowS
CreateIntegrationResponseResponse -> String
(Int -> CreateIntegrationResponseResponse -> ShowS)
-> (CreateIntegrationResponseResponse -> String)
-> ([CreateIntegrationResponseResponse] -> ShowS)
-> Show CreateIntegrationResponseResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateIntegrationResponseResponse] -> ShowS
$cshowList :: [CreateIntegrationResponseResponse] -> ShowS
show :: CreateIntegrationResponseResponse -> String
$cshow :: CreateIntegrationResponseResponse -> String
showsPrec :: Int -> CreateIntegrationResponseResponse -> ShowS
$cshowsPrec :: Int -> CreateIntegrationResponseResponse -> ShowS
Prelude.Show, (forall x.
 CreateIntegrationResponseResponse
 -> Rep CreateIntegrationResponseResponse x)
-> (forall x.
    Rep CreateIntegrationResponseResponse x
    -> CreateIntegrationResponseResponse)
-> Generic CreateIntegrationResponseResponse
forall x.
Rep CreateIntegrationResponseResponse x
-> CreateIntegrationResponseResponse
forall x.
CreateIntegrationResponseResponse
-> Rep CreateIntegrationResponseResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateIntegrationResponseResponse x
-> CreateIntegrationResponseResponse
$cfrom :: forall x.
CreateIntegrationResponseResponse
-> Rep CreateIntegrationResponseResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateIntegrationResponseResponse' 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:
--
-- 'integrationResponseId', 'createIntegrationResponseResponse_integrationResponseId' - The integration response ID.
--
-- 'integrationResponseKey', 'createIntegrationResponseResponse_integrationResponseKey' - The integration response key.
--
-- 'templateSelectionExpression', 'createIntegrationResponseResponse_templateSelectionExpression' - The template selection expressions for the integration response.
--
-- 'contentHandlingStrategy', 'createIntegrationResponseResponse_contentHandlingStrategy' - Supported only for WebSocket APIs. Specifies how to handle response
-- payload content type conversions. Supported values are CONVERT_TO_BINARY
-- and CONVERT_TO_TEXT, with the following behaviors:
--
-- CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded
-- string to the corresponding binary blob.
--
-- CONVERT_TO_TEXT: Converts a response payload from a binary blob to a
-- Base64-encoded string.
--
-- If this property is not defined, the response payload will be passed
-- through from the integration response to the route response or method
-- response without modification.
--
-- 'responseTemplates', 'createIntegrationResponseResponse_responseTemplates' - The collection of response templates for the integration response as a
-- string-to-string map of key-value pairs. Response templates are
-- represented as a key\/value map, with a content-type as the key and a
-- template as the value.
--
-- 'responseParameters', 'createIntegrationResponseResponse_responseParameters' - A key-value map specifying response parameters that are passed to the
-- method response from the backend. The key is a method response header
-- parameter name and the mapped value is an integration response header
-- value, a static value enclosed within a pair of single quotes, or a JSON
-- expression from the integration response body. The mapping key must
-- match the pattern of method.response.header.{name}, where name is a
-- valid and unique header name. The mapped non-static value must match the
-- pattern of integration.response.header.{name} or
-- integration.response.body.{JSON-expression}, where name is a valid and
-- unique response header name and JSON-expression is a valid JSON
-- expression without the $ prefix.
--
-- 'httpStatus', 'createIntegrationResponseResponse_httpStatus' - The response's http status code.
newCreateIntegrationResponseResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateIntegrationResponseResponse
newCreateIntegrationResponseResponse :: Int -> CreateIntegrationResponseResponse
newCreateIntegrationResponseResponse Int
pHttpStatus_ =
  CreateIntegrationResponseResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ContentHandlingStrategy
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Int
-> CreateIntegrationResponseResponse
CreateIntegrationResponseResponse'
    { $sel:integrationResponseId:CreateIntegrationResponseResponse' :: Maybe Text
integrationResponseId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:integrationResponseKey:CreateIntegrationResponseResponse' :: Maybe Text
integrationResponseKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateSelectionExpression:CreateIntegrationResponseResponse' :: Maybe Text
templateSelectionExpression =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contentHandlingStrategy:CreateIntegrationResponseResponse' :: Maybe ContentHandlingStrategy
contentHandlingStrategy =
        Maybe ContentHandlingStrategy
forall a. Maybe a
Prelude.Nothing,
      $sel:responseTemplates:CreateIntegrationResponseResponse' :: Maybe (HashMap Text Text)
responseTemplates = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:responseParameters:CreateIntegrationResponseResponse' :: Maybe (HashMap Text Text)
responseParameters = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateIntegrationResponseResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The integration response ID.
createIntegrationResponseResponse_integrationResponseId :: Lens.Lens' CreateIntegrationResponseResponse (Prelude.Maybe Prelude.Text)
createIntegrationResponseResponse_integrationResponseId :: (Maybe Text -> f (Maybe Text))
-> CreateIntegrationResponseResponse
-> f CreateIntegrationResponseResponse
createIntegrationResponseResponse_integrationResponseId = (CreateIntegrationResponseResponse -> Maybe Text)
-> (CreateIntegrationResponseResponse
    -> Maybe Text -> CreateIntegrationResponseResponse)
-> Lens
     CreateIntegrationResponseResponse
     CreateIntegrationResponseResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIntegrationResponseResponse' {Maybe Text
integrationResponseId :: Maybe Text
$sel:integrationResponseId:CreateIntegrationResponseResponse' :: CreateIntegrationResponseResponse -> Maybe Text
integrationResponseId} -> Maybe Text
integrationResponseId) (\s :: CreateIntegrationResponseResponse
s@CreateIntegrationResponseResponse' {} Maybe Text
a -> CreateIntegrationResponseResponse
s {$sel:integrationResponseId:CreateIntegrationResponseResponse' :: Maybe Text
integrationResponseId = Maybe Text
a} :: CreateIntegrationResponseResponse)

-- | The integration response key.
createIntegrationResponseResponse_integrationResponseKey :: Lens.Lens' CreateIntegrationResponseResponse (Prelude.Maybe Prelude.Text)
createIntegrationResponseResponse_integrationResponseKey :: (Maybe Text -> f (Maybe Text))
-> CreateIntegrationResponseResponse
-> f CreateIntegrationResponseResponse
createIntegrationResponseResponse_integrationResponseKey = (CreateIntegrationResponseResponse -> Maybe Text)
-> (CreateIntegrationResponseResponse
    -> Maybe Text -> CreateIntegrationResponseResponse)
-> Lens
     CreateIntegrationResponseResponse
     CreateIntegrationResponseResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIntegrationResponseResponse' {Maybe Text
integrationResponseKey :: Maybe Text
$sel:integrationResponseKey:CreateIntegrationResponseResponse' :: CreateIntegrationResponseResponse -> Maybe Text
integrationResponseKey} -> Maybe Text
integrationResponseKey) (\s :: CreateIntegrationResponseResponse
s@CreateIntegrationResponseResponse' {} Maybe Text
a -> CreateIntegrationResponseResponse
s {$sel:integrationResponseKey:CreateIntegrationResponseResponse' :: Maybe Text
integrationResponseKey = Maybe Text
a} :: CreateIntegrationResponseResponse)

-- | The template selection expressions for the integration response.
createIntegrationResponseResponse_templateSelectionExpression :: Lens.Lens' CreateIntegrationResponseResponse (Prelude.Maybe Prelude.Text)
createIntegrationResponseResponse_templateSelectionExpression :: (Maybe Text -> f (Maybe Text))
-> CreateIntegrationResponseResponse
-> f CreateIntegrationResponseResponse
createIntegrationResponseResponse_templateSelectionExpression = (CreateIntegrationResponseResponse -> Maybe Text)
-> (CreateIntegrationResponseResponse
    -> Maybe Text -> CreateIntegrationResponseResponse)
-> Lens
     CreateIntegrationResponseResponse
     CreateIntegrationResponseResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIntegrationResponseResponse' {Maybe Text
templateSelectionExpression :: Maybe Text
$sel:templateSelectionExpression:CreateIntegrationResponseResponse' :: CreateIntegrationResponseResponse -> Maybe Text
templateSelectionExpression} -> Maybe Text
templateSelectionExpression) (\s :: CreateIntegrationResponseResponse
s@CreateIntegrationResponseResponse' {} Maybe Text
a -> CreateIntegrationResponseResponse
s {$sel:templateSelectionExpression:CreateIntegrationResponseResponse' :: Maybe Text
templateSelectionExpression = Maybe Text
a} :: CreateIntegrationResponseResponse)

-- | Supported only for WebSocket APIs. Specifies how to handle response
-- payload content type conversions. Supported values are CONVERT_TO_BINARY
-- and CONVERT_TO_TEXT, with the following behaviors:
--
-- CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded
-- string to the corresponding binary blob.
--
-- CONVERT_TO_TEXT: Converts a response payload from a binary blob to a
-- Base64-encoded string.
--
-- If this property is not defined, the response payload will be passed
-- through from the integration response to the route response or method
-- response without modification.
createIntegrationResponseResponse_contentHandlingStrategy :: Lens.Lens' CreateIntegrationResponseResponse (Prelude.Maybe ContentHandlingStrategy)
createIntegrationResponseResponse_contentHandlingStrategy :: (Maybe ContentHandlingStrategy
 -> f (Maybe ContentHandlingStrategy))
-> CreateIntegrationResponseResponse
-> f CreateIntegrationResponseResponse
createIntegrationResponseResponse_contentHandlingStrategy = (CreateIntegrationResponseResponse
 -> Maybe ContentHandlingStrategy)
-> (CreateIntegrationResponseResponse
    -> Maybe ContentHandlingStrategy
    -> CreateIntegrationResponseResponse)
-> Lens
     CreateIntegrationResponseResponse
     CreateIntegrationResponseResponse
     (Maybe ContentHandlingStrategy)
     (Maybe ContentHandlingStrategy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIntegrationResponseResponse' {Maybe ContentHandlingStrategy
contentHandlingStrategy :: Maybe ContentHandlingStrategy
$sel:contentHandlingStrategy:CreateIntegrationResponseResponse' :: CreateIntegrationResponseResponse -> Maybe ContentHandlingStrategy
contentHandlingStrategy} -> Maybe ContentHandlingStrategy
contentHandlingStrategy) (\s :: CreateIntegrationResponseResponse
s@CreateIntegrationResponseResponse' {} Maybe ContentHandlingStrategy
a -> CreateIntegrationResponseResponse
s {$sel:contentHandlingStrategy:CreateIntegrationResponseResponse' :: Maybe ContentHandlingStrategy
contentHandlingStrategy = Maybe ContentHandlingStrategy
a} :: CreateIntegrationResponseResponse)

-- | The collection of response templates for the integration response as a
-- string-to-string map of key-value pairs. Response templates are
-- represented as a key\/value map, with a content-type as the key and a
-- template as the value.
createIntegrationResponseResponse_responseTemplates :: Lens.Lens' CreateIntegrationResponseResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createIntegrationResponseResponse_responseTemplates :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateIntegrationResponseResponse
-> f CreateIntegrationResponseResponse
createIntegrationResponseResponse_responseTemplates = (CreateIntegrationResponseResponse -> Maybe (HashMap Text Text))
-> (CreateIntegrationResponseResponse
    -> Maybe (HashMap Text Text) -> CreateIntegrationResponseResponse)
-> Lens
     CreateIntegrationResponseResponse
     CreateIntegrationResponseResponse
     (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 (\CreateIntegrationResponseResponse' {Maybe (HashMap Text Text)
responseTemplates :: Maybe (HashMap Text Text)
$sel:responseTemplates:CreateIntegrationResponseResponse' :: CreateIntegrationResponseResponse -> Maybe (HashMap Text Text)
responseTemplates} -> Maybe (HashMap Text Text)
responseTemplates) (\s :: CreateIntegrationResponseResponse
s@CreateIntegrationResponseResponse' {} Maybe (HashMap Text Text)
a -> CreateIntegrationResponseResponse
s {$sel:responseTemplates:CreateIntegrationResponseResponse' :: Maybe (HashMap Text Text)
responseTemplates = Maybe (HashMap Text Text)
a} :: CreateIntegrationResponseResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateIntegrationResponseResponse
 -> f CreateIntegrationResponseResponse)
-> ((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)))
-> CreateIntegrationResponseResponse
-> f CreateIntegrationResponseResponse
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 specifying response parameters that are passed to the
-- method response from the backend. The key is a method response header
-- parameter name and the mapped value is an integration response header
-- value, a static value enclosed within a pair of single quotes, or a JSON
-- expression from the integration response body. The mapping key must
-- match the pattern of method.response.header.{name}, where name is a
-- valid and unique header name. The mapped non-static value must match the
-- pattern of integration.response.header.{name} or
-- integration.response.body.{JSON-expression}, where name is a valid and
-- unique response header name and JSON-expression is a valid JSON
-- expression without the $ prefix.
createIntegrationResponseResponse_responseParameters :: Lens.Lens' CreateIntegrationResponseResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createIntegrationResponseResponse_responseParameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateIntegrationResponseResponse
-> f CreateIntegrationResponseResponse
createIntegrationResponseResponse_responseParameters = (CreateIntegrationResponseResponse -> Maybe (HashMap Text Text))
-> (CreateIntegrationResponseResponse
    -> Maybe (HashMap Text Text) -> CreateIntegrationResponseResponse)
-> Lens
     CreateIntegrationResponseResponse
     CreateIntegrationResponseResponse
     (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 (\CreateIntegrationResponseResponse' {Maybe (HashMap Text Text)
responseParameters :: Maybe (HashMap Text Text)
$sel:responseParameters:CreateIntegrationResponseResponse' :: CreateIntegrationResponseResponse -> Maybe (HashMap Text Text)
responseParameters} -> Maybe (HashMap Text Text)
responseParameters) (\s :: CreateIntegrationResponseResponse
s@CreateIntegrationResponseResponse' {} Maybe (HashMap Text Text)
a -> CreateIntegrationResponseResponse
s {$sel:responseParameters:CreateIntegrationResponseResponse' :: Maybe (HashMap Text Text)
responseParameters = Maybe (HashMap Text Text)
a} :: CreateIntegrationResponseResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateIntegrationResponseResponse
 -> f CreateIntegrationResponseResponse)
-> ((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)))
-> CreateIntegrationResponseResponse
-> f CreateIntegrationResponseResponse
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.
createIntegrationResponseResponse_httpStatus :: Lens.Lens' CreateIntegrationResponseResponse Prelude.Int
createIntegrationResponseResponse_httpStatus :: (Int -> f Int)
-> CreateIntegrationResponseResponse
-> f CreateIntegrationResponseResponse
createIntegrationResponseResponse_httpStatus = (CreateIntegrationResponseResponse -> Int)
-> (CreateIntegrationResponseResponse
    -> Int -> CreateIntegrationResponseResponse)
-> Lens
     CreateIntegrationResponseResponse
     CreateIntegrationResponseResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIntegrationResponseResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateIntegrationResponseResponse' :: CreateIntegrationResponseResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateIntegrationResponseResponse
s@CreateIntegrationResponseResponse' {} Int
a -> CreateIntegrationResponseResponse
s {$sel:httpStatus:CreateIntegrationResponseResponse' :: Int
httpStatus = Int
a} :: CreateIntegrationResponseResponse)

instance
  Prelude.NFData
    CreateIntegrationResponseResponse