{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an IntegrationResponses.
module Amazonka.ApiGatewayV2.CreateIntegrationResponse
  ( -- * Creating a Request
    CreateIntegrationResponse (..),
    newCreateIntegrationResponse,

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

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

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

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

-- | Creates a new IntegrationResponse resource to represent an integration
-- response.
--
-- /See:/ 'newCreateIntegrationResponse' smart constructor.
data CreateIntegrationResponse = 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 -> Maybe ContentHandlingStrategy
contentHandlingStrategy :: Prelude.Maybe ContentHandlingStrategy,
    -- | 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 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),
    -- | The template selection expression for the integration response.
    -- Supported only for WebSocket APIs.
    CreateIntegrationResponse -> Maybe Text
templateSelectionExpression :: Prelude.Maybe 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
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]
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
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.
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:
--
-- '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.
--
-- '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.
--
-- '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.
--
-- 'templateSelectionExpression', 'createIntegrationResponse_templateSelectionExpression' - The template selection expression for the integration response.
-- Supported only for WebSocket APIs.
--
-- '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'
      { $sel:contentHandlingStrategy:CreateIntegrationResponse' :: Maybe ContentHandlingStrategy
contentHandlingStrategy =
          forall a. Maybe a
Prelude.Nothing,
        $sel:responseParameters:CreateIntegrationResponse' :: Maybe (HashMap Text Text)
responseParameters = forall a. Maybe a
Prelude.Nothing,
        $sel:responseTemplates:CreateIntegrationResponse' :: Maybe (HashMap Text Text)
responseTemplates = forall a. Maybe a
Prelude.Nothing,
        $sel:templateSelectionExpression:CreateIntegrationResponse' :: Maybe Text
templateSelectionExpression = 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_
      }

-- | 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 :: Lens' CreateIntegrationResponse (Maybe ContentHandlingStrategy)
createIntegrationResponse_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)

-- | 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 :: Lens' CreateIntegrationResponse (Maybe (HashMap Text Text))
createIntegrationResponse_responseParameters = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The 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 :: Lens' CreateIntegrationResponse (Maybe (HashMap Text Text))
createIntegrationResponse_responseTemplates = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The template selection expression for the integration response.
-- Supported only for WebSocket APIs.
createIntegrationResponse_templateSelectionExpression :: Lens.Lens' CreateIntegrationResponse (Prelude.Maybe Prelude.Text)
createIntegrationResponse_templateSelectionExpression :: Lens' CreateIntegrationResponse (Maybe Text)
createIntegrationResponse_templateSelectionExpression = 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)

-- | The API identifier.
createIntegrationResponse_apiId :: Lens.Lens' CreateIntegrationResponse Prelude.Text
createIntegrationResponse_apiId :: Lens' CreateIntegrationResponse Text
createIntegrationResponse_apiId = 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 :: Lens' CreateIntegrationResponse Text
createIntegrationResponse_integrationId = 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 :: Lens' CreateIntegrationResponse Text
createIntegrationResponse_integrationResponseKey = 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 :: (Service -> Service)
-> CreateIntegrationResponse -> Request CreateIntegrationResponse
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateIntegrationResponse
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateIntegrationResponse)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe ContentHandlingStrategy
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Int
-> CreateIntegrationResponseResponse
CreateIntegrationResponseResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"contentHandlingStrategy")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"integrationResponseId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"integrationResponseKey")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"responseParameters"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"responseTemplates"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"templateSelectionExpression")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateIntegrationResponse where
  hashWithSalt :: Int -> CreateIntegrationResponse -> Int
hashWithSalt Int
_salt CreateIntegrationResponse' {Maybe Text
Maybe (HashMap Text Text)
Maybe ContentHandlingStrategy
Text
integrationResponseKey :: Text
integrationId :: Text
apiId :: Text
templateSelectionExpression :: Maybe Text
responseTemplates :: Maybe (HashMap Text Text)
responseParameters :: Maybe (HashMap Text Text)
contentHandlingStrategy :: Maybe ContentHandlingStrategy
$sel:integrationResponseKey:CreateIntegrationResponse' :: CreateIntegrationResponse -> Text
$sel:integrationId:CreateIntegrationResponse' :: CreateIntegrationResponse -> Text
$sel:apiId:CreateIntegrationResponse' :: CreateIntegrationResponse -> Text
$sel:templateSelectionExpression:CreateIntegrationResponse' :: CreateIntegrationResponse -> Maybe Text
$sel:responseTemplates:CreateIntegrationResponse' :: CreateIntegrationResponse -> Maybe (HashMap Text Text)
$sel:responseParameters:CreateIntegrationResponse' :: CreateIntegrationResponse -> Maybe (HashMap Text Text)
$sel:contentHandlingStrategy:CreateIntegrationResponse' :: CreateIntegrationResponse -> Maybe ContentHandlingStrategy
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ContentHandlingStrategy
contentHandlingStrategy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
responseParameters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
responseTemplates
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
templateSelectionExpression
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
apiId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
integrationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
integrationResponseKey

instance Prelude.NFData CreateIntegrationResponse where
  rnf :: CreateIntegrationResponse -> ()
rnf CreateIntegrationResponse' {Maybe Text
Maybe (HashMap Text Text)
Maybe ContentHandlingStrategy
Text
integrationResponseKey :: Text
integrationId :: Text
apiId :: Text
templateSelectionExpression :: Maybe Text
responseTemplates :: Maybe (HashMap Text Text)
responseParameters :: Maybe (HashMap Text Text)
contentHandlingStrategy :: Maybe ContentHandlingStrategy
$sel:integrationResponseKey:CreateIntegrationResponse' :: CreateIntegrationResponse -> Text
$sel:integrationId:CreateIntegrationResponse' :: CreateIntegrationResponse -> Text
$sel:apiId:CreateIntegrationResponse' :: CreateIntegrationResponse -> Text
$sel:templateSelectionExpression:CreateIntegrationResponse' :: CreateIntegrationResponse -> Maybe Text
$sel:responseTemplates:CreateIntegrationResponse' :: CreateIntegrationResponse -> Maybe (HashMap Text Text)
$sel:responseParameters:CreateIntegrationResponse' :: CreateIntegrationResponse -> Maybe (HashMap Text Text)
$sel:contentHandlingStrategy:CreateIntegrationResponse' :: CreateIntegrationResponse -> Maybe ContentHandlingStrategy
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ContentHandlingStrategy
contentHandlingStrategy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
responseParameters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
responseTemplates
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
templateSelectionExpression
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
apiId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
integrationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
integrationResponseKey

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

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

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

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

-- | /See:/ 'newCreateIntegrationResponseResponse' smart constructor.
data CreateIntegrationResponseResponse = 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 -> Maybe ContentHandlingStrategy
contentHandlingStrategy :: Prelude.Maybe ContentHandlingStrategy,
    -- | The integration response ID.
    CreateIntegrationResponseResponse -> Maybe Text
integrationResponseId :: Prelude.Maybe Prelude.Text,
    -- | The integration response key.
    CreateIntegrationResponseResponse -> Maybe Text
integrationResponseKey :: Prelude.Maybe 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 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),
    -- | The template selection expressions for the integration response.
    CreateIntegrationResponseResponse -> Maybe Text
templateSelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateIntegrationResponseResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateIntegrationResponseResponse
-> CreateIntegrationResponseResponse -> Bool
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]
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
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.
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:
--
-- '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.
--
-- 'integrationResponseId', 'createIntegrationResponseResponse_integrationResponseId' - The integration response ID.
--
-- 'integrationResponseKey', 'createIntegrationResponseResponse_integrationResponseKey' - The integration response key.
--
-- '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.
--
-- '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.
--
-- 'templateSelectionExpression', 'createIntegrationResponseResponse_templateSelectionExpression' - The template selection expressions for the integration response.
--
-- 'httpStatus', 'createIntegrationResponseResponse_httpStatus' - The response's http status code.
newCreateIntegrationResponseResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateIntegrationResponseResponse
newCreateIntegrationResponseResponse :: Int -> CreateIntegrationResponseResponse
newCreateIntegrationResponseResponse Int
pHttpStatus_ =
  CreateIntegrationResponseResponse'
    { $sel:contentHandlingStrategy:CreateIntegrationResponseResponse' :: Maybe ContentHandlingStrategy
contentHandlingStrategy =
        forall a. Maybe a
Prelude.Nothing,
      $sel:integrationResponseId:CreateIntegrationResponseResponse' :: Maybe Text
integrationResponseId = forall a. Maybe a
Prelude.Nothing,
      $sel:integrationResponseKey:CreateIntegrationResponseResponse' :: Maybe Text
integrationResponseKey = forall a. Maybe a
Prelude.Nothing,
      $sel:responseParameters:CreateIntegrationResponseResponse' :: Maybe (HashMap Text Text)
responseParameters = forall a. Maybe a
Prelude.Nothing,
      $sel:responseTemplates:CreateIntegrationResponseResponse' :: Maybe (HashMap Text Text)
responseTemplates = forall a. Maybe a
Prelude.Nothing,
      $sel:templateSelectionExpression:CreateIntegrationResponseResponse' :: Maybe Text
templateSelectionExpression =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateIntegrationResponseResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | 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 :: Lens'
  CreateIntegrationResponseResponse (Maybe ContentHandlingStrategy)
createIntegrationResponseResponse_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 integration response ID.
createIntegrationResponseResponse_integrationResponseId :: Lens.Lens' CreateIntegrationResponseResponse (Prelude.Maybe Prelude.Text)
createIntegrationResponseResponse_integrationResponseId :: Lens' CreateIntegrationResponseResponse (Maybe Text)
createIntegrationResponseResponse_integrationResponseId = 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 :: Lens' CreateIntegrationResponseResponse (Maybe Text)
createIntegrationResponseResponse_integrationResponseKey = 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)

-- | 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 :: Lens' CreateIntegrationResponseResponse (Maybe (HashMap Text Text))
createIntegrationResponseResponse_responseParameters = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The 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 :: Lens' CreateIntegrationResponseResponse (Maybe (HashMap Text Text))
createIntegrationResponseResponse_responseTemplates = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The template selection expressions for the integration response.
createIntegrationResponseResponse_templateSelectionExpression :: Lens.Lens' CreateIntegrationResponseResponse (Prelude.Maybe Prelude.Text)
createIntegrationResponseResponse_templateSelectionExpression :: Lens' CreateIntegrationResponseResponse (Maybe Text)
createIntegrationResponseResponse_templateSelectionExpression = 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)

-- | The response's http status code.
createIntegrationResponseResponse_httpStatus :: Lens.Lens' CreateIntegrationResponseResponse Prelude.Int
createIntegrationResponseResponse_httpStatus :: Lens' CreateIntegrationResponseResponse Int
createIntegrationResponseResponse_httpStatus = 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
  where
  rnf :: CreateIntegrationResponseResponse -> ()
rnf CreateIntegrationResponseResponse' {Int
Maybe Text
Maybe (HashMap Text Text)
Maybe ContentHandlingStrategy
httpStatus :: Int
templateSelectionExpression :: Maybe Text
responseTemplates :: Maybe (HashMap Text Text)
responseParameters :: Maybe (HashMap Text Text)
integrationResponseKey :: Maybe Text
integrationResponseId :: Maybe Text
contentHandlingStrategy :: Maybe ContentHandlingStrategy
$sel:httpStatus:CreateIntegrationResponseResponse' :: CreateIntegrationResponseResponse -> Int
$sel:templateSelectionExpression:CreateIntegrationResponseResponse' :: CreateIntegrationResponseResponse -> Maybe Text
$sel:responseTemplates:CreateIntegrationResponseResponse' :: CreateIntegrationResponseResponse -> Maybe (HashMap Text Text)
$sel:responseParameters:CreateIntegrationResponseResponse' :: CreateIntegrationResponseResponse -> Maybe (HashMap Text Text)
$sel:integrationResponseKey:CreateIntegrationResponseResponse' :: CreateIntegrationResponseResponse -> Maybe Text
$sel:integrationResponseId:CreateIntegrationResponseResponse' :: CreateIntegrationResponseResponse -> Maybe Text
$sel:contentHandlingStrategy:CreateIntegrationResponseResponse' :: CreateIntegrationResponseResponse -> Maybe ContentHandlingStrategy
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ContentHandlingStrategy
contentHandlingStrategy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
integrationResponseId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
integrationResponseKey
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
responseParameters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
responseTemplates
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
templateSelectionExpression
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus