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

    -- * Request Lenses
    updateIntegrationResponse_contentHandlingStrategy,
    updateIntegrationResponse_integrationResponseKey,
    updateIntegrationResponse_responseParameters,
    updateIntegrationResponse_responseTemplates,
    updateIntegrationResponse_templateSelectionExpression,
    updateIntegrationResponse_apiId,
    updateIntegrationResponse_integrationResponseId,
    updateIntegrationResponse_integrationId,

    -- * Destructuring the Response
    UpdateIntegrationResponseResponse (..),
    newUpdateIntegrationResponseResponse,

    -- * Response Lenses
    updateIntegrationResponseResponse_contentHandlingStrategy,
    updateIntegrationResponseResponse_integrationResponseId,
    updateIntegrationResponseResponse_integrationResponseKey,
    updateIntegrationResponseResponse_responseParameters,
    updateIntegrationResponseResponse_responseTemplates,
    updateIntegrationResponseResponse_templateSelectionExpression,
    updateIntegrationResponseResponse_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

-- | Updates an IntegrationResponses.
--
-- /See:/ 'newUpdateIntegrationResponse' smart constructor.
data UpdateIntegrationResponse = UpdateIntegrationResponse'
  { -- | 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.
    UpdateIntegrationResponse -> Maybe ContentHandlingStrategy
contentHandlingStrategy :: Prelude.Maybe ContentHandlingStrategy,
    -- | The integration response key.
    UpdateIntegrationResponse -> 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.
    UpdateIntegrationResponse -> 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.
    UpdateIntegrationResponse -> 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.
    UpdateIntegrationResponse -> Maybe Text
templateSelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | The API identifier.
    UpdateIntegrationResponse -> Text
apiId :: Prelude.Text,
    -- | The integration response ID.
    UpdateIntegrationResponse -> Text
integrationResponseId :: Prelude.Text,
    -- | The integration ID.
    UpdateIntegrationResponse -> Text
integrationId :: Prelude.Text
  }
  deriving (UpdateIntegrationResponse -> UpdateIntegrationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateIntegrationResponse -> UpdateIntegrationResponse -> Bool
$c/= :: UpdateIntegrationResponse -> UpdateIntegrationResponse -> Bool
== :: UpdateIntegrationResponse -> UpdateIntegrationResponse -> Bool
$c== :: UpdateIntegrationResponse -> UpdateIntegrationResponse -> Bool
Prelude.Eq, ReadPrec [UpdateIntegrationResponse]
ReadPrec UpdateIntegrationResponse
Int -> ReadS UpdateIntegrationResponse
ReadS [UpdateIntegrationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateIntegrationResponse]
$creadListPrec :: ReadPrec [UpdateIntegrationResponse]
readPrec :: ReadPrec UpdateIntegrationResponse
$creadPrec :: ReadPrec UpdateIntegrationResponse
readList :: ReadS [UpdateIntegrationResponse]
$creadList :: ReadS [UpdateIntegrationResponse]
readsPrec :: Int -> ReadS UpdateIntegrationResponse
$creadsPrec :: Int -> ReadS UpdateIntegrationResponse
Prelude.Read, Int -> UpdateIntegrationResponse -> ShowS
[UpdateIntegrationResponse] -> ShowS
UpdateIntegrationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateIntegrationResponse] -> ShowS
$cshowList :: [UpdateIntegrationResponse] -> ShowS
show :: UpdateIntegrationResponse -> String
$cshow :: UpdateIntegrationResponse -> String
showsPrec :: Int -> UpdateIntegrationResponse -> ShowS
$cshowsPrec :: Int -> UpdateIntegrationResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateIntegrationResponse x -> UpdateIntegrationResponse
forall x.
UpdateIntegrationResponse -> Rep UpdateIntegrationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateIntegrationResponse x -> UpdateIntegrationResponse
$cfrom :: forall x.
UpdateIntegrationResponse -> Rep UpdateIntegrationResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateIntegrationResponse' 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', 'updateIntegrationResponse_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.
--
-- 'integrationResponseKey', 'updateIntegrationResponse_integrationResponseKey' - The integration response key.
--
-- 'responseParameters', 'updateIntegrationResponse_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', 'updateIntegrationResponse_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', 'updateIntegrationResponse_templateSelectionExpression' - The template selection expression for the integration response.
-- Supported only for WebSocket APIs.
--
-- 'apiId', 'updateIntegrationResponse_apiId' - The API identifier.
--
-- 'integrationResponseId', 'updateIntegrationResponse_integrationResponseId' - The integration response ID.
--
-- 'integrationId', 'updateIntegrationResponse_integrationId' - The integration ID.
newUpdateIntegrationResponse ::
  -- | 'apiId'
  Prelude.Text ->
  -- | 'integrationResponseId'
  Prelude.Text ->
  -- | 'integrationId'
  Prelude.Text ->
  UpdateIntegrationResponse
newUpdateIntegrationResponse :: Text -> Text -> Text -> UpdateIntegrationResponse
newUpdateIntegrationResponse
  Text
pApiId_
  Text
pIntegrationResponseId_
  Text
pIntegrationId_ =
    UpdateIntegrationResponse'
      { $sel:contentHandlingStrategy:UpdateIntegrationResponse' :: Maybe ContentHandlingStrategy
contentHandlingStrategy =
          forall a. Maybe a
Prelude.Nothing,
        $sel:integrationResponseKey:UpdateIntegrationResponse' :: Maybe Text
integrationResponseKey = forall a. Maybe a
Prelude.Nothing,
        $sel:responseParameters:UpdateIntegrationResponse' :: Maybe (HashMap Text Text)
responseParameters = forall a. Maybe a
Prelude.Nothing,
        $sel:responseTemplates:UpdateIntegrationResponse' :: Maybe (HashMap Text Text)
responseTemplates = forall a. Maybe a
Prelude.Nothing,
        $sel:templateSelectionExpression:UpdateIntegrationResponse' :: Maybe Text
templateSelectionExpression = forall a. Maybe a
Prelude.Nothing,
        $sel:apiId:UpdateIntegrationResponse' :: Text
apiId = Text
pApiId_,
        $sel:integrationResponseId:UpdateIntegrationResponse' :: Text
integrationResponseId = Text
pIntegrationResponseId_,
        $sel:integrationId:UpdateIntegrationResponse' :: Text
integrationId = Text
pIntegrationId_
      }

-- | 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.
updateIntegrationResponse_contentHandlingStrategy :: Lens.Lens' UpdateIntegrationResponse (Prelude.Maybe ContentHandlingStrategy)
updateIntegrationResponse_contentHandlingStrategy :: Lens' UpdateIntegrationResponse (Maybe ContentHandlingStrategy)
updateIntegrationResponse_contentHandlingStrategy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIntegrationResponse' {Maybe ContentHandlingStrategy
contentHandlingStrategy :: Maybe ContentHandlingStrategy
$sel:contentHandlingStrategy:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe ContentHandlingStrategy
contentHandlingStrategy} -> Maybe ContentHandlingStrategy
contentHandlingStrategy) (\s :: UpdateIntegrationResponse
s@UpdateIntegrationResponse' {} Maybe ContentHandlingStrategy
a -> UpdateIntegrationResponse
s {$sel:contentHandlingStrategy:UpdateIntegrationResponse' :: Maybe ContentHandlingStrategy
contentHandlingStrategy = Maybe ContentHandlingStrategy
a} :: UpdateIntegrationResponse)

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

-- | 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.
updateIntegrationResponse_responseParameters :: Lens.Lens' UpdateIntegrationResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateIntegrationResponse_responseParameters :: Lens' UpdateIntegrationResponse (Maybe (HashMap Text Text))
updateIntegrationResponse_responseParameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIntegrationResponse' {Maybe (HashMap Text Text)
responseParameters :: Maybe (HashMap Text Text)
$sel:responseParameters:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe (HashMap Text Text)
responseParameters} -> Maybe (HashMap Text Text)
responseParameters) (\s :: UpdateIntegrationResponse
s@UpdateIntegrationResponse' {} Maybe (HashMap Text Text)
a -> UpdateIntegrationResponse
s {$sel:responseParameters:UpdateIntegrationResponse' :: Maybe (HashMap Text Text)
responseParameters = Maybe (HashMap Text Text)
a} :: UpdateIntegrationResponse) 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.
updateIntegrationResponse_responseTemplates :: Lens.Lens' UpdateIntegrationResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateIntegrationResponse_responseTemplates :: Lens' UpdateIntegrationResponse (Maybe (HashMap Text Text))
updateIntegrationResponse_responseTemplates = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIntegrationResponse' {Maybe (HashMap Text Text)
responseTemplates :: Maybe (HashMap Text Text)
$sel:responseTemplates:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe (HashMap Text Text)
responseTemplates} -> Maybe (HashMap Text Text)
responseTemplates) (\s :: UpdateIntegrationResponse
s@UpdateIntegrationResponse' {} Maybe (HashMap Text Text)
a -> UpdateIntegrationResponse
s {$sel:responseTemplates:UpdateIntegrationResponse' :: Maybe (HashMap Text Text)
responseTemplates = Maybe (HashMap Text Text)
a} :: UpdateIntegrationResponse) 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.
updateIntegrationResponse_templateSelectionExpression :: Lens.Lens' UpdateIntegrationResponse (Prelude.Maybe Prelude.Text)
updateIntegrationResponse_templateSelectionExpression :: Lens' UpdateIntegrationResponse (Maybe Text)
updateIntegrationResponse_templateSelectionExpression = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIntegrationResponse' {Maybe Text
templateSelectionExpression :: Maybe Text
$sel:templateSelectionExpression:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe Text
templateSelectionExpression} -> Maybe Text
templateSelectionExpression) (\s :: UpdateIntegrationResponse
s@UpdateIntegrationResponse' {} Maybe Text
a -> UpdateIntegrationResponse
s {$sel:templateSelectionExpression:UpdateIntegrationResponse' :: Maybe Text
templateSelectionExpression = Maybe Text
a} :: UpdateIntegrationResponse)

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

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

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

instance Core.AWSRequest UpdateIntegrationResponse where
  type
    AWSResponse UpdateIntegrationResponse =
      UpdateIntegrationResponseResponse
  request :: (Service -> Service)
-> UpdateIntegrationResponse -> Request UpdateIntegrationResponse
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateIntegrationResponse
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateIntegrationResponse)))
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
-> UpdateIntegrationResponseResponse
UpdateIntegrationResponseResponse'
            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 UpdateIntegrationResponse where
  hashWithSalt :: Int -> UpdateIntegrationResponse -> Int
hashWithSalt Int
_salt UpdateIntegrationResponse' {Maybe Text
Maybe (HashMap Text Text)
Maybe ContentHandlingStrategy
Text
integrationId :: Text
integrationResponseId :: Text
apiId :: Text
templateSelectionExpression :: Maybe Text
responseTemplates :: Maybe (HashMap Text Text)
responseParameters :: Maybe (HashMap Text Text)
integrationResponseKey :: Maybe Text
contentHandlingStrategy :: Maybe ContentHandlingStrategy
$sel:integrationId:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
$sel:integrationResponseId:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
$sel:apiId:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
$sel:templateSelectionExpression:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe Text
$sel:responseTemplates:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe (HashMap Text Text)
$sel:responseParameters:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe (HashMap Text Text)
$sel:integrationResponseKey:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe Text
$sel:contentHandlingStrategy:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> 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 Text
integrationResponseKey
      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
integrationResponseId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
integrationId

instance Prelude.NFData UpdateIntegrationResponse where
  rnf :: UpdateIntegrationResponse -> ()
rnf UpdateIntegrationResponse' {Maybe Text
Maybe (HashMap Text Text)
Maybe ContentHandlingStrategy
Text
integrationId :: Text
integrationResponseId :: Text
apiId :: Text
templateSelectionExpression :: Maybe Text
responseTemplates :: Maybe (HashMap Text Text)
responseParameters :: Maybe (HashMap Text Text)
integrationResponseKey :: Maybe Text
contentHandlingStrategy :: Maybe ContentHandlingStrategy
$sel:integrationId:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
$sel:integrationResponseId:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
$sel:apiId:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
$sel:templateSelectionExpression:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe Text
$sel:responseTemplates:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe (HashMap Text Text)
$sel:responseParameters:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe (HashMap Text Text)
$sel:integrationResponseKey:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe Text
$sel:contentHandlingStrategy:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> 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
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 Text
apiId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
integrationResponseId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
integrationId

instance Data.ToHeaders UpdateIntegrationResponse where
  toHeaders :: UpdateIntegrationResponse -> 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 UpdateIntegrationResponse where
  toJSON :: UpdateIntegrationResponse -> Value
toJSON UpdateIntegrationResponse' {Maybe Text
Maybe (HashMap Text Text)
Maybe ContentHandlingStrategy
Text
integrationId :: Text
integrationResponseId :: Text
apiId :: Text
templateSelectionExpression :: Maybe Text
responseTemplates :: Maybe (HashMap Text Text)
responseParameters :: Maybe (HashMap Text Text)
integrationResponseKey :: Maybe Text
contentHandlingStrategy :: Maybe ContentHandlingStrategy
$sel:integrationId:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
$sel:integrationResponseId:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
$sel:apiId:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
$sel:templateSelectionExpression:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe Text
$sel:responseTemplates:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe (HashMap Text Text)
$sel:responseParameters:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe (HashMap Text Text)
$sel:integrationResponseKey:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe Text
$sel:contentHandlingStrategy:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> 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
"integrationResponseKey" 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
integrationResponseKey,
            (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
          ]
      )

instance Data.ToPath UpdateIntegrationResponse where
  toPath :: UpdateIntegrationResponse -> ByteString
toPath UpdateIntegrationResponse' {Maybe Text
Maybe (HashMap Text Text)
Maybe ContentHandlingStrategy
Text
integrationId :: Text
integrationResponseId :: Text
apiId :: Text
templateSelectionExpression :: Maybe Text
responseTemplates :: Maybe (HashMap Text Text)
responseParameters :: Maybe (HashMap Text Text)
integrationResponseKey :: Maybe Text
contentHandlingStrategy :: Maybe ContentHandlingStrategy
$sel:integrationId:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
$sel:integrationResponseId:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
$sel:apiId:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Text
$sel:templateSelectionExpression:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe Text
$sel:responseTemplates:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe (HashMap Text Text)
$sel:responseParameters:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe (HashMap Text Text)
$sel:integrationResponseKey:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> Maybe Text
$sel:contentHandlingStrategy:UpdateIntegrationResponse' :: UpdateIntegrationResponse -> 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/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
integrationResponseId
      ]

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

-- | /See:/ 'newUpdateIntegrationResponseResponse' smart constructor.
data UpdateIntegrationResponseResponse = UpdateIntegrationResponseResponse'
  { -- | 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.
    UpdateIntegrationResponseResponse -> Maybe ContentHandlingStrategy
contentHandlingStrategy :: Prelude.Maybe ContentHandlingStrategy,
    -- | The integration response ID.
    UpdateIntegrationResponseResponse -> Maybe Text
integrationResponseId :: Prelude.Maybe Prelude.Text,
    -- | The integration response key.
    UpdateIntegrationResponseResponse -> 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.
    UpdateIntegrationResponseResponse -> 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.
    UpdateIntegrationResponseResponse -> Maybe (HashMap Text Text)
responseTemplates :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The template selection expressions for the integration response.
    UpdateIntegrationResponseResponse -> Maybe Text
templateSelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateIntegrationResponseResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateIntegrationResponseResponse
-> UpdateIntegrationResponseResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateIntegrationResponseResponse
-> UpdateIntegrationResponseResponse -> Bool
$c/= :: UpdateIntegrationResponseResponse
-> UpdateIntegrationResponseResponse -> Bool
== :: UpdateIntegrationResponseResponse
-> UpdateIntegrationResponseResponse -> Bool
$c== :: UpdateIntegrationResponseResponse
-> UpdateIntegrationResponseResponse -> Bool
Prelude.Eq, ReadPrec [UpdateIntegrationResponseResponse]
ReadPrec UpdateIntegrationResponseResponse
Int -> ReadS UpdateIntegrationResponseResponse
ReadS [UpdateIntegrationResponseResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateIntegrationResponseResponse]
$creadListPrec :: ReadPrec [UpdateIntegrationResponseResponse]
readPrec :: ReadPrec UpdateIntegrationResponseResponse
$creadPrec :: ReadPrec UpdateIntegrationResponseResponse
readList :: ReadS [UpdateIntegrationResponseResponse]
$creadList :: ReadS [UpdateIntegrationResponseResponse]
readsPrec :: Int -> ReadS UpdateIntegrationResponseResponse
$creadsPrec :: Int -> ReadS UpdateIntegrationResponseResponse
Prelude.Read, Int -> UpdateIntegrationResponseResponse -> ShowS
[UpdateIntegrationResponseResponse] -> ShowS
UpdateIntegrationResponseResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateIntegrationResponseResponse] -> ShowS
$cshowList :: [UpdateIntegrationResponseResponse] -> ShowS
show :: UpdateIntegrationResponseResponse -> String
$cshow :: UpdateIntegrationResponseResponse -> String
showsPrec :: Int -> UpdateIntegrationResponseResponse -> ShowS
$cshowsPrec :: Int -> UpdateIntegrationResponseResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateIntegrationResponseResponse x
-> UpdateIntegrationResponseResponse
forall x.
UpdateIntegrationResponseResponse
-> Rep UpdateIntegrationResponseResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateIntegrationResponseResponse x
-> UpdateIntegrationResponseResponse
$cfrom :: forall x.
UpdateIntegrationResponseResponse
-> Rep UpdateIntegrationResponseResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateIntegrationResponseResponse' 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', 'updateIntegrationResponseResponse_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', 'updateIntegrationResponseResponse_integrationResponseId' - The integration response ID.
--
-- 'integrationResponseKey', 'updateIntegrationResponseResponse_integrationResponseKey' - The integration response key.
--
-- 'responseParameters', 'updateIntegrationResponseResponse_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', 'updateIntegrationResponseResponse_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', 'updateIntegrationResponseResponse_templateSelectionExpression' - The template selection expressions for the integration response.
--
-- 'httpStatus', 'updateIntegrationResponseResponse_httpStatus' - The response's http status code.
newUpdateIntegrationResponseResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateIntegrationResponseResponse
newUpdateIntegrationResponseResponse :: Int -> UpdateIntegrationResponseResponse
newUpdateIntegrationResponseResponse Int
pHttpStatus_ =
  UpdateIntegrationResponseResponse'
    { $sel:contentHandlingStrategy:UpdateIntegrationResponseResponse' :: Maybe ContentHandlingStrategy
contentHandlingStrategy =
        forall a. Maybe a
Prelude.Nothing,
      $sel:integrationResponseId:UpdateIntegrationResponseResponse' :: Maybe Text
integrationResponseId = forall a. Maybe a
Prelude.Nothing,
      $sel:integrationResponseKey:UpdateIntegrationResponseResponse' :: Maybe Text
integrationResponseKey = forall a. Maybe a
Prelude.Nothing,
      $sel:responseParameters:UpdateIntegrationResponseResponse' :: Maybe (HashMap Text Text)
responseParameters = forall a. Maybe a
Prelude.Nothing,
      $sel:responseTemplates:UpdateIntegrationResponseResponse' :: Maybe (HashMap Text Text)
responseTemplates = forall a. Maybe a
Prelude.Nothing,
      $sel:templateSelectionExpression:UpdateIntegrationResponseResponse' :: Maybe Text
templateSelectionExpression =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateIntegrationResponseResponse' :: 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.
updateIntegrationResponseResponse_contentHandlingStrategy :: Lens.Lens' UpdateIntegrationResponseResponse (Prelude.Maybe ContentHandlingStrategy)
updateIntegrationResponseResponse_contentHandlingStrategy :: Lens'
  UpdateIntegrationResponseResponse (Maybe ContentHandlingStrategy)
updateIntegrationResponseResponse_contentHandlingStrategy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIntegrationResponseResponse' {Maybe ContentHandlingStrategy
contentHandlingStrategy :: Maybe ContentHandlingStrategy
$sel:contentHandlingStrategy:UpdateIntegrationResponseResponse' :: UpdateIntegrationResponseResponse -> Maybe ContentHandlingStrategy
contentHandlingStrategy} -> Maybe ContentHandlingStrategy
contentHandlingStrategy) (\s :: UpdateIntegrationResponseResponse
s@UpdateIntegrationResponseResponse' {} Maybe ContentHandlingStrategy
a -> UpdateIntegrationResponseResponse
s {$sel:contentHandlingStrategy:UpdateIntegrationResponseResponse' :: Maybe ContentHandlingStrategy
contentHandlingStrategy = Maybe ContentHandlingStrategy
a} :: UpdateIntegrationResponseResponse)

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

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

-- | 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.
updateIntegrationResponseResponse_responseParameters :: Lens.Lens' UpdateIntegrationResponseResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateIntegrationResponseResponse_responseParameters :: Lens' UpdateIntegrationResponseResponse (Maybe (HashMap Text Text))
updateIntegrationResponseResponse_responseParameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIntegrationResponseResponse' {Maybe (HashMap Text Text)
responseParameters :: Maybe (HashMap Text Text)
$sel:responseParameters:UpdateIntegrationResponseResponse' :: UpdateIntegrationResponseResponse -> Maybe (HashMap Text Text)
responseParameters} -> Maybe (HashMap Text Text)
responseParameters) (\s :: UpdateIntegrationResponseResponse
s@UpdateIntegrationResponseResponse' {} Maybe (HashMap Text Text)
a -> UpdateIntegrationResponseResponse
s {$sel:responseParameters:UpdateIntegrationResponseResponse' :: Maybe (HashMap Text Text)
responseParameters = Maybe (HashMap Text Text)
a} :: UpdateIntegrationResponseResponse) 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.
updateIntegrationResponseResponse_responseTemplates :: Lens.Lens' UpdateIntegrationResponseResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateIntegrationResponseResponse_responseTemplates :: Lens' UpdateIntegrationResponseResponse (Maybe (HashMap Text Text))
updateIntegrationResponseResponse_responseTemplates = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIntegrationResponseResponse' {Maybe (HashMap Text Text)
responseTemplates :: Maybe (HashMap Text Text)
$sel:responseTemplates:UpdateIntegrationResponseResponse' :: UpdateIntegrationResponseResponse -> Maybe (HashMap Text Text)
responseTemplates} -> Maybe (HashMap Text Text)
responseTemplates) (\s :: UpdateIntegrationResponseResponse
s@UpdateIntegrationResponseResponse' {} Maybe (HashMap Text Text)
a -> UpdateIntegrationResponseResponse
s {$sel:responseTemplates:UpdateIntegrationResponseResponse' :: Maybe (HashMap Text Text)
responseTemplates = Maybe (HashMap Text Text)
a} :: UpdateIntegrationResponseResponse) 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.
updateIntegrationResponseResponse_templateSelectionExpression :: Lens.Lens' UpdateIntegrationResponseResponse (Prelude.Maybe Prelude.Text)
updateIntegrationResponseResponse_templateSelectionExpression :: Lens' UpdateIntegrationResponseResponse (Maybe Text)
updateIntegrationResponseResponse_templateSelectionExpression = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIntegrationResponseResponse' {Maybe Text
templateSelectionExpression :: Maybe Text
$sel:templateSelectionExpression:UpdateIntegrationResponseResponse' :: UpdateIntegrationResponseResponse -> Maybe Text
templateSelectionExpression} -> Maybe Text
templateSelectionExpression) (\s :: UpdateIntegrationResponseResponse
s@UpdateIntegrationResponseResponse' {} Maybe Text
a -> UpdateIntegrationResponseResponse
s {$sel:templateSelectionExpression:UpdateIntegrationResponseResponse' :: Maybe Text
templateSelectionExpression = Maybe Text
a} :: UpdateIntegrationResponseResponse)

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

instance
  Prelude.NFData
    UpdateIntegrationResponseResponse
  where
  rnf :: UpdateIntegrationResponseResponse -> ()
rnf UpdateIntegrationResponseResponse' {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:UpdateIntegrationResponseResponse' :: UpdateIntegrationResponseResponse -> Int
$sel:templateSelectionExpression:UpdateIntegrationResponseResponse' :: UpdateIntegrationResponseResponse -> Maybe Text
$sel:responseTemplates:UpdateIntegrationResponseResponse' :: UpdateIntegrationResponseResponse -> Maybe (HashMap Text Text)
$sel:responseParameters:UpdateIntegrationResponseResponse' :: UpdateIntegrationResponseResponse -> Maybe (HashMap Text Text)
$sel:integrationResponseKey:UpdateIntegrationResponseResponse' :: UpdateIntegrationResponseResponse -> Maybe Text
$sel:integrationResponseId:UpdateIntegrationResponseResponse' :: UpdateIntegrationResponseResponse -> Maybe Text
$sel:contentHandlingStrategy:UpdateIntegrationResponseResponse' :: UpdateIntegrationResponseResponse -> 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