{-# 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 #-}
module Amazonka.ApiGatewayV2.Types.IntegrationResponse where
import Amazonka.ApiGatewayV2.Types.ContentHandlingStrategy
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
data IntegrationResponse = IntegrationResponse'
{
IntegrationResponse -> Maybe ContentHandlingStrategy
contentHandlingStrategy :: Prelude.Maybe ContentHandlingStrategy,
IntegrationResponse -> Maybe Text
integrationResponseId :: Prelude.Maybe Prelude.Text,
IntegrationResponse -> Maybe (HashMap Text Text)
responseParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
IntegrationResponse -> Maybe (HashMap Text Text)
responseTemplates :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
IntegrationResponse -> Maybe Text
templateSelectionExpression :: Prelude.Maybe Prelude.Text,
IntegrationResponse -> Text
integrationResponseKey :: Prelude.Text
}
deriving (IntegrationResponse -> IntegrationResponse -> Bool
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]
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
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. 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)
newIntegrationResponse ::
Prelude.Text ->
IntegrationResponse
newIntegrationResponse :: Text -> IntegrationResponse
newIntegrationResponse Text
pIntegrationResponseKey_ =
IntegrationResponse'
{ $sel:contentHandlingStrategy:IntegrationResponse' :: Maybe ContentHandlingStrategy
contentHandlingStrategy =
forall a. Maybe a
Prelude.Nothing,
$sel:integrationResponseId:IntegrationResponse' :: Maybe Text
integrationResponseId = forall a. Maybe a
Prelude.Nothing,
$sel:responseParameters:IntegrationResponse' :: Maybe (HashMap Text Text)
responseParameters = forall a. Maybe a
Prelude.Nothing,
$sel:responseTemplates:IntegrationResponse' :: Maybe (HashMap Text Text)
responseTemplates = forall a. Maybe a
Prelude.Nothing,
$sel:templateSelectionExpression:IntegrationResponse' :: Maybe Text
templateSelectionExpression = forall a. Maybe a
Prelude.Nothing,
$sel:integrationResponseKey:IntegrationResponse' :: Text
integrationResponseKey = Text
pIntegrationResponseKey_
}
integrationResponse_contentHandlingStrategy :: Lens.Lens' IntegrationResponse (Prelude.Maybe ContentHandlingStrategy)
integrationResponse_contentHandlingStrategy :: Lens' IntegrationResponse (Maybe ContentHandlingStrategy)
integrationResponse_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)
integrationResponse_integrationResponseId :: Lens.Lens' IntegrationResponse (Prelude.Maybe Prelude.Text)
integrationResponse_integrationResponseId :: Lens' IntegrationResponse (Maybe Text)
integrationResponse_integrationResponseId = 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)
integrationResponse_responseParameters :: Lens.Lens' IntegrationResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
integrationResponse_responseParameters :: Lens' IntegrationResponse (Maybe (HashMap Text Text))
integrationResponse_responseParameters = 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) 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
integrationResponse_responseTemplates :: Lens.Lens' IntegrationResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
integrationResponse_responseTemplates :: Lens' IntegrationResponse (Maybe (HashMap Text Text))
integrationResponse_responseTemplates = 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) 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
integrationResponse_templateSelectionExpression :: Lens.Lens' IntegrationResponse (Prelude.Maybe Prelude.Text)
integrationResponse_templateSelectionExpression :: Lens' IntegrationResponse (Maybe Text)
integrationResponse_templateSelectionExpression = 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)
integrationResponse_integrationResponseKey :: Lens.Lens' IntegrationResponse Prelude.Text
integrationResponse_integrationResponseKey :: Lens' IntegrationResponse Text
integrationResponse_integrationResponseKey = 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 Data.FromJSON IntegrationResponse where
parseJSON :: Value -> Parser IntegrationResponse
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"IntegrationResponse"
( \Object
x ->
Maybe ContentHandlingStrategy
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Text
-> IntegrationResponse
IntegrationResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (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 -> Parser (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 -> Parser (Maybe a)
Data..:? Key
"responseParameters"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= 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 -> Parser (Maybe a)
Data..:? Key
"responseTemplates"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= 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 -> Parser (Maybe a)
Data..:? Key
"templateSelectionExpression")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"integrationResponseKey")
)
instance Prelude.Hashable IntegrationResponse where
hashWithSalt :: Int -> IntegrationResponse -> Int
hashWithSalt Int
_salt IntegrationResponse' {Maybe Text
Maybe (HashMap Text Text)
Maybe ContentHandlingStrategy
Text
integrationResponseKey :: Text
templateSelectionExpression :: Maybe Text
responseTemplates :: Maybe (HashMap Text Text)
responseParameters :: Maybe (HashMap Text Text)
integrationResponseId :: Maybe Text
contentHandlingStrategy :: Maybe ContentHandlingStrategy
$sel:integrationResponseKey:IntegrationResponse' :: IntegrationResponse -> Text
$sel:templateSelectionExpression:IntegrationResponse' :: IntegrationResponse -> Maybe Text
$sel:responseTemplates:IntegrationResponse' :: IntegrationResponse -> Maybe (HashMap Text Text)
$sel:responseParameters:IntegrationResponse' :: IntegrationResponse -> Maybe (HashMap Text Text)
$sel:integrationResponseId:IntegrationResponse' :: IntegrationResponse -> Maybe Text
$sel:contentHandlingStrategy:IntegrationResponse' :: IntegrationResponse -> 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
integrationResponseId
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
integrationResponseKey
instance Prelude.NFData IntegrationResponse where
rnf :: IntegrationResponse -> ()
rnf IntegrationResponse' {Maybe Text
Maybe (HashMap Text Text)
Maybe ContentHandlingStrategy
Text
integrationResponseKey :: Text
templateSelectionExpression :: Maybe Text
responseTemplates :: Maybe (HashMap Text Text)
responseParameters :: Maybe (HashMap Text Text)
integrationResponseId :: Maybe Text
contentHandlingStrategy :: Maybe ContentHandlingStrategy
$sel:integrationResponseKey:IntegrationResponse' :: IntegrationResponse -> Text
$sel:templateSelectionExpression:IntegrationResponse' :: IntegrationResponse -> Maybe Text
$sel:responseTemplates:IntegrationResponse' :: IntegrationResponse -> Maybe (HashMap Text Text)
$sel:responseParameters:IntegrationResponse' :: IntegrationResponse -> Maybe (HashMap Text Text)
$sel:integrationResponseId:IntegrationResponse' :: IntegrationResponse -> Maybe Text
$sel:contentHandlingStrategy:IntegrationResponse' :: IntegrationResponse -> 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 (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
integrationResponseKey