{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.IntegrationResponse
-- 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)
module Amazonka.ApiGatewayV2.Types.IntegrationResponse where

import Amazonka.ApiGatewayV2.Types.ContentHandlingStrategy
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'IntegrationResponse' 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', 'integrationResponse_integrationResponseId' - The integration response ID.
--
-- 'templateSelectionExpression', 'integrationResponse_templateSelectionExpression' - The template selection expressions for the integration response.
--
-- 'contentHandlingStrategy', 'integrationResponse_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', 'integrationResponse_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', 'integrationResponse_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.
--
-- 'integrationResponseKey', 'integrationResponse_integrationResponseKey' - The integration response key.
newIntegrationResponse ::
  -- | 'integrationResponseKey'
  Prelude.Text ->
  IntegrationResponse
newIntegrationResponse :: Text -> IntegrationResponse
newIntegrationResponse Text
pIntegrationResponseKey_ =
  IntegrationResponse' :: Maybe Text
-> Maybe Text
-> Maybe ContentHandlingStrategy
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Text
-> IntegrationResponse
IntegrationResponse'
    { $sel:integrationResponseId:IntegrationResponse' :: Maybe Text
integrationResponseId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateSelectionExpression:IntegrationResponse' :: Maybe Text
templateSelectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contentHandlingStrategy:IntegrationResponse' :: Maybe ContentHandlingStrategy
contentHandlingStrategy = Maybe ContentHandlingStrategy
forall a. Maybe a
Prelude.Nothing,
      $sel:responseTemplates:IntegrationResponse' :: Maybe (HashMap Text Text)
responseTemplates = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:responseParameters:IntegrationResponse' :: Maybe (HashMap Text Text)
responseParameters = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:integrationResponseKey:IntegrationResponse' :: Text
integrationResponseKey = Text
pIntegrationResponseKey_
    }

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

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

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

-- | 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.
integrationResponse_responseTemplates :: Lens.Lens' IntegrationResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
integrationResponse_responseTemplates :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> IntegrationResponse -> f IntegrationResponse
integrationResponse_responseTemplates = (IntegrationResponse -> Maybe (HashMap Text Text))
-> (IntegrationResponse
    -> Maybe (HashMap Text Text) -> IntegrationResponse)
-> Lens
     IntegrationResponse
     IntegrationResponse
     (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 (\IntegrationResponse' {Maybe (HashMap Text Text)
responseTemplates :: Maybe (HashMap Text Text)
$sel:responseTemplates:IntegrationResponse' :: IntegrationResponse -> Maybe (HashMap Text Text)
responseTemplates} -> Maybe (HashMap Text Text)
responseTemplates) (\s :: IntegrationResponse
s@IntegrationResponse' {} Maybe (HashMap Text Text)
a -> IntegrationResponse
s {$sel:responseTemplates:IntegrationResponse' :: Maybe (HashMap Text Text)
responseTemplates = Maybe (HashMap Text Text)
a} :: IntegrationResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> IntegrationResponse -> f IntegrationResponse)
-> ((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)))
-> IntegrationResponse
-> f IntegrationResponse
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.
integrationResponse_responseParameters :: Lens.Lens' IntegrationResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
integrationResponse_responseParameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> IntegrationResponse -> f IntegrationResponse
integrationResponse_responseParameters = (IntegrationResponse -> Maybe (HashMap Text Text))
-> (IntegrationResponse
    -> Maybe (HashMap Text Text) -> IntegrationResponse)
-> Lens
     IntegrationResponse
     IntegrationResponse
     (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 (\IntegrationResponse' {Maybe (HashMap Text Text)
responseParameters :: Maybe (HashMap Text Text)
$sel:responseParameters:IntegrationResponse' :: IntegrationResponse -> Maybe (HashMap Text Text)
responseParameters} -> Maybe (HashMap Text Text)
responseParameters) (\s :: IntegrationResponse
s@IntegrationResponse' {} Maybe (HashMap Text Text)
a -> IntegrationResponse
s {$sel:responseParameters:IntegrationResponse' :: Maybe (HashMap Text Text)
responseParameters = Maybe (HashMap Text Text)
a} :: IntegrationResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> IntegrationResponse -> f IntegrationResponse)
-> ((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)))
-> IntegrationResponse
-> f IntegrationResponse
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 integration response key.
integrationResponse_integrationResponseKey :: Lens.Lens' IntegrationResponse Prelude.Text
integrationResponse_integrationResponseKey :: (Text -> f Text) -> IntegrationResponse -> f IntegrationResponse
integrationResponse_integrationResponseKey = (IntegrationResponse -> Text)
-> (IntegrationResponse -> Text -> IntegrationResponse)
-> Lens IntegrationResponse IntegrationResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntegrationResponse' {Text
integrationResponseKey :: Text
$sel:integrationResponseKey:IntegrationResponse' :: IntegrationResponse -> Text
integrationResponseKey} -> Text
integrationResponseKey) (\s :: IntegrationResponse
s@IntegrationResponse' {} Text
a -> IntegrationResponse
s {$sel:integrationResponseKey:IntegrationResponse' :: Text
integrationResponseKey = Text
a} :: IntegrationResponse)

instance Core.FromJSON IntegrationResponse where
  parseJSON :: Value -> Parser IntegrationResponse
parseJSON =
    String
-> (Object -> Parser IntegrationResponse)
-> Value
-> Parser IntegrationResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"IntegrationResponse"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe ContentHandlingStrategy
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Text
-> IntegrationResponse
IntegrationResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe ContentHandlingStrategy
 -> Maybe (HashMap Text Text)
 -> Maybe (HashMap Text Text)
 -> Text
 -> IntegrationResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ContentHandlingStrategy
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> Text
      -> IntegrationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"integrationResponseId")
            Parser
  (Maybe Text
   -> Maybe ContentHandlingStrategy
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> Text
   -> IntegrationResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe ContentHandlingStrategy
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> Text
      -> IntegrationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"templateSelectionExpression")
            Parser
  (Maybe ContentHandlingStrategy
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> Text
   -> IntegrationResponse)
-> Parser (Maybe ContentHandlingStrategy)
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text) -> Text -> IntegrationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ContentHandlingStrategy)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"contentHandlingStrategy")
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text) -> Text -> IntegrationResponse)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe (HashMap Text Text) -> Text -> IntegrationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"responseTemplates"
                            Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe (HashMap Text Text) -> Text -> IntegrationResponse)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Text -> IntegrationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"responseParameters"
                            Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Text -> IntegrationResponse)
-> Parser Text -> Parser IntegrationResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"integrationResponseKey")
      )

instance Prelude.Hashable IntegrationResponse

instance Prelude.NFData IntegrationResponse