{-# 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.Pinpoint.Types.TemplateResponse where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.TemplateType
import qualified Amazonka.Prelude as Prelude
data TemplateResponse = TemplateResponse'
{
TemplateResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
TemplateResponse -> Maybe Text
templateDescription :: Prelude.Maybe Prelude.Text,
TemplateResponse -> Maybe Text
defaultSubstitutions :: Prelude.Maybe Prelude.Text,
TemplateResponse -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
TemplateResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
TemplateResponse -> Text
lastModifiedDate :: Prelude.Text,
TemplateResponse -> Text
creationDate :: Prelude.Text,
TemplateResponse -> Text
templateName :: Prelude.Text,
TemplateResponse -> TemplateType
templateType :: TemplateType
}
deriving (TemplateResponse -> TemplateResponse -> Bool
(TemplateResponse -> TemplateResponse -> Bool)
-> (TemplateResponse -> TemplateResponse -> Bool)
-> Eq TemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TemplateResponse -> TemplateResponse -> Bool
$c/= :: TemplateResponse -> TemplateResponse -> Bool
== :: TemplateResponse -> TemplateResponse -> Bool
$c== :: TemplateResponse -> TemplateResponse -> Bool
Prelude.Eq, ReadPrec [TemplateResponse]
ReadPrec TemplateResponse
Int -> ReadS TemplateResponse
ReadS [TemplateResponse]
(Int -> ReadS TemplateResponse)
-> ReadS [TemplateResponse]
-> ReadPrec TemplateResponse
-> ReadPrec [TemplateResponse]
-> Read TemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TemplateResponse]
$creadListPrec :: ReadPrec [TemplateResponse]
readPrec :: ReadPrec TemplateResponse
$creadPrec :: ReadPrec TemplateResponse
readList :: ReadS [TemplateResponse]
$creadList :: ReadS [TemplateResponse]
readsPrec :: Int -> ReadS TemplateResponse
$creadsPrec :: Int -> ReadS TemplateResponse
Prelude.Read, Int -> TemplateResponse -> ShowS
[TemplateResponse] -> ShowS
TemplateResponse -> String
(Int -> TemplateResponse -> ShowS)
-> (TemplateResponse -> String)
-> ([TemplateResponse] -> ShowS)
-> Show TemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TemplateResponse] -> ShowS
$cshowList :: [TemplateResponse] -> ShowS
show :: TemplateResponse -> String
$cshow :: TemplateResponse -> String
showsPrec :: Int -> TemplateResponse -> ShowS
$cshowsPrec :: Int -> TemplateResponse -> ShowS
Prelude.Show, (forall x. TemplateResponse -> Rep TemplateResponse x)
-> (forall x. Rep TemplateResponse x -> TemplateResponse)
-> Generic TemplateResponse
forall x. Rep TemplateResponse x -> TemplateResponse
forall x. TemplateResponse -> Rep TemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TemplateResponse x -> TemplateResponse
$cfrom :: forall x. TemplateResponse -> Rep TemplateResponse x
Prelude.Generic)
newTemplateResponse ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
TemplateType ->
TemplateResponse
newTemplateResponse :: Text -> Text -> Text -> TemplateType -> TemplateResponse
newTemplateResponse
Text
pLastModifiedDate_
Text
pCreationDate_
Text
pTemplateName_
TemplateType
pTemplateType_ =
TemplateResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> TemplateType
-> TemplateResponse
TemplateResponse'
{ $sel:arn:TemplateResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:templateDescription:TemplateResponse' :: Maybe Text
templateDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:defaultSubstitutions:TemplateResponse' :: Maybe Text
defaultSubstitutions = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:version:TemplateResponse' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:TemplateResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:lastModifiedDate:TemplateResponse' :: Text
lastModifiedDate = Text
pLastModifiedDate_,
$sel:creationDate:TemplateResponse' :: Text
creationDate = Text
pCreationDate_,
$sel:templateName:TemplateResponse' :: Text
templateName = Text
pTemplateName_,
$sel:templateType:TemplateResponse' :: TemplateType
templateType = TemplateType
pTemplateType_
}
templateResponse_arn :: Lens.Lens' TemplateResponse (Prelude.Maybe Prelude.Text)
templateResponse_arn :: (Maybe Text -> f (Maybe Text))
-> TemplateResponse -> f TemplateResponse
templateResponse_arn = (TemplateResponse -> Maybe Text)
-> (TemplateResponse -> Maybe Text -> TemplateResponse)
-> Lens TemplateResponse TemplateResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:TemplateResponse' :: TemplateResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: TemplateResponse
s@TemplateResponse' {} Maybe Text
a -> TemplateResponse
s {$sel:arn:TemplateResponse' :: Maybe Text
arn = Maybe Text
a} :: TemplateResponse)
templateResponse_templateDescription :: Lens.Lens' TemplateResponse (Prelude.Maybe Prelude.Text)
templateResponse_templateDescription :: (Maybe Text -> f (Maybe Text))
-> TemplateResponse -> f TemplateResponse
templateResponse_templateDescription = (TemplateResponse -> Maybe Text)
-> (TemplateResponse -> Maybe Text -> TemplateResponse)
-> Lens TemplateResponse TemplateResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateResponse' {Maybe Text
templateDescription :: Maybe Text
$sel:templateDescription:TemplateResponse' :: TemplateResponse -> Maybe Text
templateDescription} -> Maybe Text
templateDescription) (\s :: TemplateResponse
s@TemplateResponse' {} Maybe Text
a -> TemplateResponse
s {$sel:templateDescription:TemplateResponse' :: Maybe Text
templateDescription = Maybe Text
a} :: TemplateResponse)
templateResponse_defaultSubstitutions :: Lens.Lens' TemplateResponse (Prelude.Maybe Prelude.Text)
templateResponse_defaultSubstitutions :: (Maybe Text -> f (Maybe Text))
-> TemplateResponse -> f TemplateResponse
templateResponse_defaultSubstitutions = (TemplateResponse -> Maybe Text)
-> (TemplateResponse -> Maybe Text -> TemplateResponse)
-> Lens TemplateResponse TemplateResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateResponse' {Maybe Text
defaultSubstitutions :: Maybe Text
$sel:defaultSubstitutions:TemplateResponse' :: TemplateResponse -> Maybe Text
defaultSubstitutions} -> Maybe Text
defaultSubstitutions) (\s :: TemplateResponse
s@TemplateResponse' {} Maybe Text
a -> TemplateResponse
s {$sel:defaultSubstitutions:TemplateResponse' :: Maybe Text
defaultSubstitutions = Maybe Text
a} :: TemplateResponse)
templateResponse_version :: Lens.Lens' TemplateResponse (Prelude.Maybe Prelude.Text)
templateResponse_version :: (Maybe Text -> f (Maybe Text))
-> TemplateResponse -> f TemplateResponse
templateResponse_version = (TemplateResponse -> Maybe Text)
-> (TemplateResponse -> Maybe Text -> TemplateResponse)
-> Lens TemplateResponse TemplateResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateResponse' {Maybe Text
version :: Maybe Text
$sel:version:TemplateResponse' :: TemplateResponse -> Maybe Text
version} -> Maybe Text
version) (\s :: TemplateResponse
s@TemplateResponse' {} Maybe Text
a -> TemplateResponse
s {$sel:version:TemplateResponse' :: Maybe Text
version = Maybe Text
a} :: TemplateResponse)
templateResponse_tags :: Lens.Lens' TemplateResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
templateResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> TemplateResponse -> f TemplateResponse
templateResponse_tags = (TemplateResponse -> Maybe (HashMap Text Text))
-> (TemplateResponse
-> Maybe (HashMap Text Text) -> TemplateResponse)
-> Lens
TemplateResponse
TemplateResponse
(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 (\TemplateResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:TemplateResponse' :: TemplateResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: TemplateResponse
s@TemplateResponse' {} Maybe (HashMap Text Text)
a -> TemplateResponse
s {$sel:tags:TemplateResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: TemplateResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> TemplateResponse -> f TemplateResponse)
-> ((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)))
-> TemplateResponse
-> f TemplateResponse
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
templateResponse_lastModifiedDate :: Lens.Lens' TemplateResponse Prelude.Text
templateResponse_lastModifiedDate :: (Text -> f Text) -> TemplateResponse -> f TemplateResponse
templateResponse_lastModifiedDate = (TemplateResponse -> Text)
-> (TemplateResponse -> Text -> TemplateResponse)
-> Lens TemplateResponse TemplateResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateResponse' {Text
lastModifiedDate :: Text
$sel:lastModifiedDate:TemplateResponse' :: TemplateResponse -> Text
lastModifiedDate} -> Text
lastModifiedDate) (\s :: TemplateResponse
s@TemplateResponse' {} Text
a -> TemplateResponse
s {$sel:lastModifiedDate:TemplateResponse' :: Text
lastModifiedDate = Text
a} :: TemplateResponse)
templateResponse_creationDate :: Lens.Lens' TemplateResponse Prelude.Text
templateResponse_creationDate :: (Text -> f Text) -> TemplateResponse -> f TemplateResponse
templateResponse_creationDate = (TemplateResponse -> Text)
-> (TemplateResponse -> Text -> TemplateResponse)
-> Lens TemplateResponse TemplateResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateResponse' {Text
creationDate :: Text
$sel:creationDate:TemplateResponse' :: TemplateResponse -> Text
creationDate} -> Text
creationDate) (\s :: TemplateResponse
s@TemplateResponse' {} Text
a -> TemplateResponse
s {$sel:creationDate:TemplateResponse' :: Text
creationDate = Text
a} :: TemplateResponse)
templateResponse_templateName :: Lens.Lens' TemplateResponse Prelude.Text
templateResponse_templateName :: (Text -> f Text) -> TemplateResponse -> f TemplateResponse
templateResponse_templateName = (TemplateResponse -> Text)
-> (TemplateResponse -> Text -> TemplateResponse)
-> Lens TemplateResponse TemplateResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateResponse' {Text
templateName :: Text
$sel:templateName:TemplateResponse' :: TemplateResponse -> Text
templateName} -> Text
templateName) (\s :: TemplateResponse
s@TemplateResponse' {} Text
a -> TemplateResponse
s {$sel:templateName:TemplateResponse' :: Text
templateName = Text
a} :: TemplateResponse)
templateResponse_templateType :: Lens.Lens' TemplateResponse TemplateType
templateResponse_templateType :: (TemplateType -> f TemplateType)
-> TemplateResponse -> f TemplateResponse
templateResponse_templateType = (TemplateResponse -> TemplateType)
-> (TemplateResponse -> TemplateType -> TemplateResponse)
-> Lens TemplateResponse TemplateResponse TemplateType TemplateType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateResponse' {TemplateType
templateType :: TemplateType
$sel:templateType:TemplateResponse' :: TemplateResponse -> TemplateType
templateType} -> TemplateType
templateType) (\s :: TemplateResponse
s@TemplateResponse' {} TemplateType
a -> TemplateResponse
s {$sel:templateType:TemplateResponse' :: TemplateType
templateType = TemplateType
a} :: TemplateResponse)
instance Core.FromJSON TemplateResponse where
parseJSON :: Value -> Parser TemplateResponse
parseJSON =
String
-> (Object -> Parser TemplateResponse)
-> Value
-> Parser TemplateResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TemplateResponse"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> TemplateType
-> TemplateResponse
TemplateResponse'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> TemplateType
-> TemplateResponse)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> TemplateType
-> TemplateResponse)
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
"Arn")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> TemplateType
-> TemplateResponse)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> TemplateType
-> TemplateResponse)
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
"TemplateDescription")
Parser
(Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> TemplateType
-> TemplateResponse)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> TemplateType
-> TemplateResponse)
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
"DefaultSubstitutions")
Parser
(Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> TemplateType
-> TemplateResponse)
-> Parser (Maybe Text)
-> Parser
(Maybe (HashMap Text Text)
-> Text -> Text -> Text -> TemplateType -> TemplateResponse)
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
"Version")
Parser
(Maybe (HashMap Text Text)
-> Text -> Text -> Text -> TemplateType -> TemplateResponse)
-> Parser (Maybe (HashMap Text Text))
-> Parser
(Text -> Text -> Text -> TemplateType -> TemplateResponse)
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
"tags" 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 -> Text -> Text -> TemplateType -> TemplateResponse)
-> Parser Text
-> Parser (Text -> Text -> TemplateType -> TemplateResponse)
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
"LastModifiedDate")
Parser (Text -> Text -> TemplateType -> TemplateResponse)
-> Parser Text -> Parser (Text -> TemplateType -> TemplateResponse)
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
"CreationDate")
Parser (Text -> TemplateType -> TemplateResponse)
-> Parser Text -> Parser (TemplateType -> TemplateResponse)
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
"TemplateName")
Parser (TemplateType -> TemplateResponse)
-> Parser TemplateType -> Parser TemplateResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser TemplateType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"TemplateType")
)
instance Prelude.Hashable TemplateResponse
instance Prelude.NFData TemplateResponse