{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
defaultSubstitutions :: Prelude.Maybe Prelude.Text,
TemplateResponse -> Maybe Text
templateDescription :: 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
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]
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
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. 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'
{ $sel:arn:TemplateResponse' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:defaultSubstitutions:TemplateResponse' :: Maybe Text
defaultSubstitutions = forall a. Maybe a
Prelude.Nothing,
$sel:templateDescription:TemplateResponse' :: Maybe Text
templateDescription = forall a. Maybe a
Prelude.Nothing,
$sel:version:TemplateResponse' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing,
$sel:tags:TemplateResponse' :: Maybe (HashMap Text Text)
tags = 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 :: Lens' TemplateResponse (Maybe Text)
templateResponse_arn = 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_defaultSubstitutions :: Lens.Lens' TemplateResponse (Prelude.Maybe Prelude.Text)
templateResponse_defaultSubstitutions :: Lens' TemplateResponse (Maybe Text)
templateResponse_defaultSubstitutions = 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_templateDescription :: Lens.Lens' TemplateResponse (Prelude.Maybe Prelude.Text)
templateResponse_templateDescription :: Lens' TemplateResponse (Maybe Text)
templateResponse_templateDescription = 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_version :: Lens.Lens' TemplateResponse (Prelude.Maybe Prelude.Text)
templateResponse_version :: Lens' TemplateResponse (Maybe Text)
templateResponse_version = 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 :: Lens' TemplateResponse (Maybe (HashMap Text Text))
templateResponse_tags = 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) 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
templateResponse_lastModifiedDate :: Lens.Lens' TemplateResponse Prelude.Text
templateResponse_lastModifiedDate :: Lens' TemplateResponse Text
templateResponse_lastModifiedDate = 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 :: Lens' TemplateResponse Text
templateResponse_creationDate = 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 :: Lens' TemplateResponse Text
templateResponse_templateName = 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 :: Lens' TemplateResponse TemplateType
templateResponse_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 Data.FromJSON TemplateResponse where
parseJSON :: Value -> Parser TemplateResponse
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"TemplateResponse"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> TemplateType
-> TemplateResponse
TemplateResponse'
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
"Arn")
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
"DefaultSubstitutions")
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
"TemplateDescription")
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
"Version")
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
"tags" 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 a
Data..: Key
"LastModifiedDate")
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
"CreationDate")
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
"TemplateName")
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
"TemplateType")
)
instance Prelude.Hashable TemplateResponse where
hashWithSalt :: Int -> TemplateResponse -> Int
hashWithSalt Int
_salt TemplateResponse' {Maybe Text
Maybe (HashMap Text Text)
Text
TemplateType
templateType :: TemplateType
templateName :: Text
creationDate :: Text
lastModifiedDate :: Text
tags :: Maybe (HashMap Text Text)
version :: Maybe Text
templateDescription :: Maybe Text
defaultSubstitutions :: Maybe Text
arn :: Maybe Text
$sel:templateType:TemplateResponse' :: TemplateResponse -> TemplateType
$sel:templateName:TemplateResponse' :: TemplateResponse -> Text
$sel:creationDate:TemplateResponse' :: TemplateResponse -> Text
$sel:lastModifiedDate:TemplateResponse' :: TemplateResponse -> Text
$sel:tags:TemplateResponse' :: TemplateResponse -> Maybe (HashMap Text Text)
$sel:version:TemplateResponse' :: TemplateResponse -> Maybe Text
$sel:templateDescription:TemplateResponse' :: TemplateResponse -> Maybe Text
$sel:defaultSubstitutions:TemplateResponse' :: TemplateResponse -> Maybe Text
$sel:arn:TemplateResponse' :: TemplateResponse -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultSubstitutions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
templateDescription
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
version
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
lastModifiedDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
creationDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
templateName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` TemplateType
templateType
instance Prelude.NFData TemplateResponse where
rnf :: TemplateResponse -> ()
rnf TemplateResponse' {Maybe Text
Maybe (HashMap Text Text)
Text
TemplateType
templateType :: TemplateType
templateName :: Text
creationDate :: Text
lastModifiedDate :: Text
tags :: Maybe (HashMap Text Text)
version :: Maybe Text
templateDescription :: Maybe Text
defaultSubstitutions :: Maybe Text
arn :: Maybe Text
$sel:templateType:TemplateResponse' :: TemplateResponse -> TemplateType
$sel:templateName:TemplateResponse' :: TemplateResponse -> Text
$sel:creationDate:TemplateResponse' :: TemplateResponse -> Text
$sel:lastModifiedDate:TemplateResponse' :: TemplateResponse -> Text
$sel:tags:TemplateResponse' :: TemplateResponse -> Maybe (HashMap Text Text)
$sel:version:TemplateResponse' :: TemplateResponse -> Maybe Text
$sel:templateDescription:TemplateResponse' :: TemplateResponse -> Maybe Text
$sel:defaultSubstitutions:TemplateResponse' :: TemplateResponse -> Maybe Text
$sel:arn:TemplateResponse' :: TemplateResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultSubstitutions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
templateDescription
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
version
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
lastModifiedDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
creationDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
templateName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf TemplateType
templateType