{-# 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.APIGateway.Types.IntegrationResponse where
import Amazonka.APIGateway.Types.ContentHandlingStrategy
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data IntegrationResponse = IntegrationResponse'
{
IntegrationResponse -> Maybe ContentHandlingStrategy
contentHandling :: Prelude.Maybe ContentHandlingStrategy,
IntegrationResponse -> Maybe (HashMap Text Text)
responseTemplates :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
IntegrationResponse -> Maybe Text
selectionPattern :: Prelude.Maybe Prelude.Text,
IntegrationResponse -> Maybe Text
statusCode :: Prelude.Maybe Prelude.Text,
IntegrationResponse -> Maybe (HashMap Text Text)
responseParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text 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)
newIntegrationResponse ::
IntegrationResponse
newIntegrationResponse :: IntegrationResponse
newIntegrationResponse =
IntegrationResponse' :: Maybe ContentHandlingStrategy
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> IntegrationResponse
IntegrationResponse'
{ $sel:contentHandling:IntegrationResponse' :: Maybe ContentHandlingStrategy
contentHandling =
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:selectionPattern:IntegrationResponse' :: Maybe Text
selectionPattern = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:statusCode:IntegrationResponse' :: Maybe Text
statusCode = Maybe 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
}
integrationResponse_contentHandling :: Lens.Lens' IntegrationResponse (Prelude.Maybe ContentHandlingStrategy)
integrationResponse_contentHandling :: (Maybe ContentHandlingStrategy
-> f (Maybe ContentHandlingStrategy))
-> IntegrationResponse -> f IntegrationResponse
integrationResponse_contentHandling = (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
contentHandling :: Maybe ContentHandlingStrategy
$sel:contentHandling:IntegrationResponse' :: IntegrationResponse -> Maybe ContentHandlingStrategy
contentHandling} -> Maybe ContentHandlingStrategy
contentHandling) (\s :: IntegrationResponse
s@IntegrationResponse' {} Maybe ContentHandlingStrategy
a -> IntegrationResponse
s {$sel:contentHandling:IntegrationResponse' :: Maybe ContentHandlingStrategy
contentHandling = Maybe ContentHandlingStrategy
a} :: IntegrationResponse)
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
integrationResponse_selectionPattern :: Lens.Lens' IntegrationResponse (Prelude.Maybe Prelude.Text)
integrationResponse_selectionPattern :: (Maybe Text -> f (Maybe Text))
-> IntegrationResponse -> f IntegrationResponse
integrationResponse_selectionPattern = (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
selectionPattern :: Maybe Text
$sel:selectionPattern:IntegrationResponse' :: IntegrationResponse -> Maybe Text
selectionPattern} -> Maybe Text
selectionPattern) (\s :: IntegrationResponse
s@IntegrationResponse' {} Maybe Text
a -> IntegrationResponse
s {$sel:selectionPattern:IntegrationResponse' :: Maybe Text
selectionPattern = Maybe Text
a} :: IntegrationResponse)
integrationResponse_statusCode :: Lens.Lens' IntegrationResponse (Prelude.Maybe Prelude.Text)
integrationResponse_statusCode :: (Maybe Text -> f (Maybe Text))
-> IntegrationResponse -> f IntegrationResponse
integrationResponse_statusCode = (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
statusCode :: Maybe Text
$sel:statusCode:IntegrationResponse' :: IntegrationResponse -> Maybe Text
statusCode} -> Maybe Text
statusCode) (\s :: IntegrationResponse
s@IntegrationResponse' {} Maybe Text
a -> IntegrationResponse
s {$sel:statusCode:IntegrationResponse' :: Maybe Text
statusCode = Maybe Text
a} :: IntegrationResponse)
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
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 ContentHandlingStrategy
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> IntegrationResponse
IntegrationResponse'
(Maybe ContentHandlingStrategy
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> IntegrationResponse)
-> Parser (Maybe ContentHandlingStrategy)
-> Parser
(Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> IntegrationResponse)
forall (f :: * -> *) a b. Functor 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
"contentHandling")
Parser
(Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> IntegrationResponse)
-> Parser (Maybe (HashMap Text Text))
-> Parser
(Maybe Text
-> Maybe Text -> Maybe (HashMap 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 Text
-> Maybe Text -> Maybe (HashMap Text Text) -> IntegrationResponse)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe (HashMap 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
"selectionPattern")
Parser
(Maybe Text -> Maybe (HashMap Text Text) -> IntegrationResponse)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap 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
"statusCode")
Parser (Maybe (HashMap Text Text) -> IntegrationResponse)
-> Parser (Maybe (HashMap Text Text)) -> Parser 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
)
)
instance Prelude.Hashable IntegrationResponse
instance Prelude.NFData IntegrationResponse