{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates an IntegrationResponses.
module Amazonka.ApiGatewayV2.UpdateIntegrationResponse
  ( -- * Creating a Request
    UpdateIntegrationResponse (..),
    newUpdateIntegrationResponse,

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

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

    -- * Response Lenses
    updateIntegrationResponseResponse_integrationResponseId,
    updateIntegrationResponseResponse_integrationResponseKey,
    updateIntegrationResponseResponse_templateSelectionExpression,
    updateIntegrationResponseResponse_contentHandlingStrategy,
    updateIntegrationResponseResponse_responseTemplates,
    updateIntegrationResponseResponse_responseParameters,
    updateIntegrationResponseResponse_httpStatus,
  )
where

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

-- | Updates an IntegrationResponses.
--
-- /See:/ 'newUpdateIntegrationResponse' smart constructor.
data UpdateIntegrationResponse = UpdateIntegrationResponse'
  { -- | The integration response key.
    UpdateIntegrationResponse -> Maybe Text
integrationResponseKey :: Prelude.Maybe Prelude.Text,
    -- | The template selection expression for the integration response.
    -- Supported only for WebSocket APIs.
    UpdateIntegrationResponse -> Maybe Text
templateSelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | Supported only for WebSocket APIs. Specifies how to handle response
    -- payload content type conversions. Supported values are CONVERT_TO_BINARY
    -- and CONVERT_TO_TEXT, with the following behaviors:
    --
    -- CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded
    -- string to the corresponding binary blob.
    --
    -- CONVERT_TO_TEXT: Converts a response payload from a binary blob to a
    -- Base64-encoded string.
    --
    -- If this property is not defined, the response payload will be passed
    -- through from the integration response to the route response or method
    -- response without modification.
    UpdateIntegrationResponse -> Maybe ContentHandlingStrategy
contentHandlingStrategy :: Prelude.Maybe ContentHandlingStrategy,
    -- | The collection of response templates for the integration response as a
    -- string-to-string map of key-value pairs. Response templates are
    -- represented as a key\/value map, with a content-type as the key and a
    -- template as the value.
    UpdateIntegrationResponse -> Maybe (HashMap Text Text)
responseTemplates :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A key-value map specifying response parameters that are passed to the
    -- method response from the backend. The key is a method response header
    -- parameter name and the mapped value is an integration response header
    -- value, a static value enclosed within a pair of single quotes, or a JSON
    -- expression from the integration response body. The mapping key must
    -- match the pattern of method.response.header.{name} , where name is a
    -- valid and unique header name. The mapped non-static value must match the
    -- pattern of integration.response.header.{name} or
    -- integration.response.body.{JSON-expression} , where {name} is a valid
    -- and unique response header name and {JSON-expression} is a valid JSON
    -- expression without the $ prefix.
    UpdateIntegrationResponse -> Maybe (HashMap Text Text)
responseParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text 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
(UpdateIntegrationResponse -> UpdateIntegrationResponse -> Bool)
-> (UpdateIntegrationResponse -> UpdateIntegrationResponse -> Bool)
-> Eq UpdateIntegrationResponse
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]
(Int -> ReadS UpdateIntegrationResponse)
-> ReadS [UpdateIntegrationResponse]
-> ReadPrec UpdateIntegrationResponse
-> ReadPrec [UpdateIntegrationResponse]
-> Read 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
(Int -> UpdateIntegrationResponse -> ShowS)
-> (UpdateIntegrationResponse -> String)
-> ([UpdateIntegrationResponse] -> ShowS)
-> Show UpdateIntegrationResponse
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.
 UpdateIntegrationResponse -> Rep UpdateIntegrationResponse x)
-> (forall x.
    Rep UpdateIntegrationResponse x -> UpdateIntegrationResponse)
-> Generic UpdateIntegrationResponse
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:
--
-- 'integrationResponseKey', 'updateIntegrationResponse_integrationResponseKey' - The integration response key.
--
-- 'templateSelectionExpression', 'updateIntegrationResponse_templateSelectionExpression' - The template selection expression for the integration response.
-- Supported only for WebSocket APIs.
--
-- '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.
--
-- '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.
--
-- '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.
--
-- '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' :: Maybe Text
-> Maybe Text
-> Maybe ContentHandlingStrategy
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> UpdateIntegrationResponse
UpdateIntegrationResponse'
      { $sel:integrationResponseKey:UpdateIntegrationResponse' :: Maybe Text
integrationResponseKey =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:templateSelectionExpression:UpdateIntegrationResponse' :: Maybe Text
templateSelectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:contentHandlingStrategy:UpdateIntegrationResponse' :: Maybe ContentHandlingStrategy
contentHandlingStrategy = Maybe ContentHandlingStrategy
forall a. Maybe a
Prelude.Nothing,
        $sel:responseTemplates:UpdateIntegrationResponse' :: Maybe (HashMap Text Text)
responseTemplates = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:responseParameters:UpdateIntegrationResponse' :: Maybe (HashMap Text Text)
responseParameters = Maybe (HashMap Text Text)
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_
      }

-- | The integration response key.
updateIntegrationResponse_integrationResponseKey :: Lens.Lens' UpdateIntegrationResponse (Prelude.Maybe Prelude.Text)
updateIntegrationResponse_integrationResponseKey :: (Maybe Text -> f (Maybe Text))
-> UpdateIntegrationResponse -> f UpdateIntegrationResponse
updateIntegrationResponse_integrationResponseKey = (UpdateIntegrationResponse -> Maybe Text)
-> (UpdateIntegrationResponse
    -> Maybe Text -> UpdateIntegrationResponse)
-> Lens
     UpdateIntegrationResponse
     UpdateIntegrationResponse
     (Maybe Text)
     (Maybe Text)
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)

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

-- | 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 :: (Maybe ContentHandlingStrategy
 -> f (Maybe ContentHandlingStrategy))
-> UpdateIntegrationResponse -> f UpdateIntegrationResponse
updateIntegrationResponse_contentHandlingStrategy = (UpdateIntegrationResponse -> Maybe ContentHandlingStrategy)
-> (UpdateIntegrationResponse
    -> Maybe ContentHandlingStrategy -> UpdateIntegrationResponse)
-> Lens
     UpdateIntegrationResponse
     UpdateIntegrationResponse
     (Maybe ContentHandlingStrategy)
     (Maybe 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 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 :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateIntegrationResponse -> f UpdateIntegrationResponse
updateIntegrationResponse_responseTemplates = (UpdateIntegrationResponse -> Maybe (HashMap Text Text))
-> (UpdateIntegrationResponse
    -> Maybe (HashMap Text Text) -> UpdateIntegrationResponse)
-> Lens
     UpdateIntegrationResponse
     UpdateIntegrationResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\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) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> UpdateIntegrationResponse -> f UpdateIntegrationResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateIntegrationResponse
-> f UpdateIntegrationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A key-value map specifying response parameters that are passed to the
-- method response from the backend. The key is a method response header
-- parameter name and the mapped value is an integration response header
-- value, a static value enclosed within a pair of single quotes, or a JSON
-- expression from the integration response body. The mapping key must
-- match the pattern of method.response.header.{name} , where name is a
-- valid and unique header name. The mapped non-static value must match the
-- pattern of integration.response.header.{name} or
-- integration.response.body.{JSON-expression} , where {name} is a valid
-- and unique response header name and {JSON-expression} is a valid JSON
-- expression without the $ prefix.
updateIntegrationResponse_responseParameters :: Lens.Lens' UpdateIntegrationResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateIntegrationResponse_responseParameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateIntegrationResponse -> f UpdateIntegrationResponse
updateIntegrationResponse_responseParameters = (UpdateIntegrationResponse -> Maybe (HashMap Text Text))
-> (UpdateIntegrationResponse
    -> Maybe (HashMap Text Text) -> UpdateIntegrationResponse)
-> Lens
     UpdateIntegrationResponse
     UpdateIntegrationResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\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) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> UpdateIntegrationResponse -> f UpdateIntegrationResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateIntegrationResponse
-> f UpdateIntegrationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.Hashable UpdateIntegrationResponse

instance Prelude.NFData UpdateIntegrationResponse

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

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

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

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

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

-- | The integration response ID.
updateIntegrationResponseResponse_integrationResponseId :: Lens.Lens' UpdateIntegrationResponseResponse (Prelude.Maybe Prelude.Text)
updateIntegrationResponseResponse_integrationResponseId :: (Maybe Text -> f (Maybe Text))
-> UpdateIntegrationResponseResponse
-> f UpdateIntegrationResponseResponse
updateIntegrationResponseResponse_integrationResponseId = (UpdateIntegrationResponseResponse -> Maybe Text)
-> (UpdateIntegrationResponseResponse
    -> Maybe Text -> UpdateIntegrationResponseResponse)
-> Lens
     UpdateIntegrationResponseResponse
     UpdateIntegrationResponseResponse
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> UpdateIntegrationResponseResponse
-> f UpdateIntegrationResponseResponse
updateIntegrationResponseResponse_integrationResponseKey = (UpdateIntegrationResponseResponse -> Maybe Text)
-> (UpdateIntegrationResponseResponse
    -> Maybe Text -> UpdateIntegrationResponseResponse)
-> Lens
     UpdateIntegrationResponseResponse
     UpdateIntegrationResponseResponse
     (Maybe Text)
     (Maybe Text)
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)

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

-- | 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 :: (Maybe ContentHandlingStrategy
 -> f (Maybe ContentHandlingStrategy))
-> UpdateIntegrationResponseResponse
-> f UpdateIntegrationResponseResponse
updateIntegrationResponseResponse_contentHandlingStrategy = (UpdateIntegrationResponseResponse
 -> Maybe ContentHandlingStrategy)
-> (UpdateIntegrationResponseResponse
    -> Maybe ContentHandlingStrategy
    -> UpdateIntegrationResponseResponse)
-> Lens
     UpdateIntegrationResponseResponse
     UpdateIntegrationResponseResponse
     (Maybe ContentHandlingStrategy)
     (Maybe 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 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 :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateIntegrationResponseResponse
-> f UpdateIntegrationResponseResponse
updateIntegrationResponseResponse_responseTemplates = (UpdateIntegrationResponseResponse -> Maybe (HashMap Text Text))
-> (UpdateIntegrationResponseResponse
    -> Maybe (HashMap Text Text) -> UpdateIntegrationResponseResponse)
-> Lens
     UpdateIntegrationResponseResponse
     UpdateIntegrationResponseResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\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) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> UpdateIntegrationResponseResponse
 -> f UpdateIntegrationResponseResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateIntegrationResponseResponse
-> f UpdateIntegrationResponseResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A key-value map specifying response parameters that are passed to the
-- method response from the backend. The key is a method response header
-- parameter name and the mapped value is an integration response header
-- value, a static value enclosed within a pair of single quotes, or a JSON
-- expression from the integration response body. The mapping key must
-- match the pattern of method.response.header.{name}, where name is a
-- valid and unique header name. The mapped non-static value must match the
-- pattern of integration.response.header.{name} or
-- integration.response.body.{JSON-expression}, where name is a valid and
-- unique response header name and JSON-expression is a valid JSON
-- expression without the $ prefix.
updateIntegrationResponseResponse_responseParameters :: Lens.Lens' UpdateIntegrationResponseResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateIntegrationResponseResponse_responseParameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateIntegrationResponseResponse
-> f UpdateIntegrationResponseResponse
updateIntegrationResponseResponse_responseParameters = (UpdateIntegrationResponseResponse -> Maybe (HashMap Text Text))
-> (UpdateIntegrationResponseResponse
    -> Maybe (HashMap Text Text) -> UpdateIntegrationResponseResponse)
-> Lens
     UpdateIntegrationResponseResponse
     UpdateIntegrationResponseResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\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) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> UpdateIntegrationResponseResponse
 -> f UpdateIntegrationResponseResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateIntegrationResponseResponse
-> f UpdateIntegrationResponseResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
updateIntegrationResponseResponse_httpStatus :: Lens.Lens' UpdateIntegrationResponseResponse Prelude.Int
updateIntegrationResponseResponse_httpStatus :: (Int -> f Int)
-> UpdateIntegrationResponseResponse
-> f UpdateIntegrationResponseResponse
updateIntegrationResponseResponse_httpStatus = (UpdateIntegrationResponseResponse -> Int)
-> (UpdateIntegrationResponseResponse
    -> Int -> UpdateIntegrationResponseResponse)
-> Lens
     UpdateIntegrationResponseResponse
     UpdateIntegrationResponseResponse
     Int
     Int
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