{-# 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.EmailTemplateRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EmailTemplateRequest = EmailTemplateRequest'
{
EmailTemplateRequest -> Maybe Text
subject :: Prelude.Maybe Prelude.Text,
EmailTemplateRequest -> Maybe Text
textPart :: Prelude.Maybe Prelude.Text,
EmailTemplateRequest -> Maybe Text
templateDescription :: Prelude.Maybe Prelude.Text,
EmailTemplateRequest -> Maybe Text
defaultSubstitutions :: Prelude.Maybe Prelude.Text,
EmailTemplateRequest -> Maybe Text
htmlPart :: Prelude.Maybe Prelude.Text,
EmailTemplateRequest -> Maybe Text
recommenderId :: Prelude.Maybe Prelude.Text,
EmailTemplateRequest -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
}
deriving (EmailTemplateRequest -> EmailTemplateRequest -> Bool
(EmailTemplateRequest -> EmailTemplateRequest -> Bool)
-> (EmailTemplateRequest -> EmailTemplateRequest -> Bool)
-> Eq EmailTemplateRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EmailTemplateRequest -> EmailTemplateRequest -> Bool
$c/= :: EmailTemplateRequest -> EmailTemplateRequest -> Bool
== :: EmailTemplateRequest -> EmailTemplateRequest -> Bool
$c== :: EmailTemplateRequest -> EmailTemplateRequest -> Bool
Prelude.Eq, ReadPrec [EmailTemplateRequest]
ReadPrec EmailTemplateRequest
Int -> ReadS EmailTemplateRequest
ReadS [EmailTemplateRequest]
(Int -> ReadS EmailTemplateRequest)
-> ReadS [EmailTemplateRequest]
-> ReadPrec EmailTemplateRequest
-> ReadPrec [EmailTemplateRequest]
-> Read EmailTemplateRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EmailTemplateRequest]
$creadListPrec :: ReadPrec [EmailTemplateRequest]
readPrec :: ReadPrec EmailTemplateRequest
$creadPrec :: ReadPrec EmailTemplateRequest
readList :: ReadS [EmailTemplateRequest]
$creadList :: ReadS [EmailTemplateRequest]
readsPrec :: Int -> ReadS EmailTemplateRequest
$creadsPrec :: Int -> ReadS EmailTemplateRequest
Prelude.Read, Int -> EmailTemplateRequest -> ShowS
[EmailTemplateRequest] -> ShowS
EmailTemplateRequest -> String
(Int -> EmailTemplateRequest -> ShowS)
-> (EmailTemplateRequest -> String)
-> ([EmailTemplateRequest] -> ShowS)
-> Show EmailTemplateRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EmailTemplateRequest] -> ShowS
$cshowList :: [EmailTemplateRequest] -> ShowS
show :: EmailTemplateRequest -> String
$cshow :: EmailTemplateRequest -> String
showsPrec :: Int -> EmailTemplateRequest -> ShowS
$cshowsPrec :: Int -> EmailTemplateRequest -> ShowS
Prelude.Show, (forall x. EmailTemplateRequest -> Rep EmailTemplateRequest x)
-> (forall x. Rep EmailTemplateRequest x -> EmailTemplateRequest)
-> Generic EmailTemplateRequest
forall x. Rep EmailTemplateRequest x -> EmailTemplateRequest
forall x. EmailTemplateRequest -> Rep EmailTemplateRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EmailTemplateRequest x -> EmailTemplateRequest
$cfrom :: forall x. EmailTemplateRequest -> Rep EmailTemplateRequest x
Prelude.Generic)
newEmailTemplateRequest ::
EmailTemplateRequest
newEmailTemplateRequest :: EmailTemplateRequest
newEmailTemplateRequest =
EmailTemplateRequest' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> EmailTemplateRequest
EmailTemplateRequest'
{ $sel:subject:EmailTemplateRequest' :: Maybe Text
subject = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:textPart:EmailTemplateRequest' :: Maybe Text
textPart = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:templateDescription:EmailTemplateRequest' :: Maybe Text
templateDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:defaultSubstitutions:EmailTemplateRequest' :: Maybe Text
defaultSubstitutions = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:htmlPart:EmailTemplateRequest' :: Maybe Text
htmlPart = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:recommenderId:EmailTemplateRequest' :: Maybe Text
recommenderId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:EmailTemplateRequest' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
}
emailTemplateRequest_subject :: Lens.Lens' EmailTemplateRequest (Prelude.Maybe Prelude.Text)
emailTemplateRequest_subject :: (Maybe Text -> f (Maybe Text))
-> EmailTemplateRequest -> f EmailTemplateRequest
emailTemplateRequest_subject = (EmailTemplateRequest -> Maybe Text)
-> (EmailTemplateRequest -> Maybe Text -> EmailTemplateRequest)
-> Lens
EmailTemplateRequest EmailTemplateRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailTemplateRequest' {Maybe Text
subject :: Maybe Text
$sel:subject:EmailTemplateRequest' :: EmailTemplateRequest -> Maybe Text
subject} -> Maybe Text
subject) (\s :: EmailTemplateRequest
s@EmailTemplateRequest' {} Maybe Text
a -> EmailTemplateRequest
s {$sel:subject:EmailTemplateRequest' :: Maybe Text
subject = Maybe Text
a} :: EmailTemplateRequest)
emailTemplateRequest_textPart :: Lens.Lens' EmailTemplateRequest (Prelude.Maybe Prelude.Text)
emailTemplateRequest_textPart :: (Maybe Text -> f (Maybe Text))
-> EmailTemplateRequest -> f EmailTemplateRequest
emailTemplateRequest_textPart = (EmailTemplateRequest -> Maybe Text)
-> (EmailTemplateRequest -> Maybe Text -> EmailTemplateRequest)
-> Lens
EmailTemplateRequest EmailTemplateRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailTemplateRequest' {Maybe Text
textPart :: Maybe Text
$sel:textPart:EmailTemplateRequest' :: EmailTemplateRequest -> Maybe Text
textPart} -> Maybe Text
textPart) (\s :: EmailTemplateRequest
s@EmailTemplateRequest' {} Maybe Text
a -> EmailTemplateRequest
s {$sel:textPart:EmailTemplateRequest' :: Maybe Text
textPart = Maybe Text
a} :: EmailTemplateRequest)
emailTemplateRequest_templateDescription :: Lens.Lens' EmailTemplateRequest (Prelude.Maybe Prelude.Text)
emailTemplateRequest_templateDescription :: (Maybe Text -> f (Maybe Text))
-> EmailTemplateRequest -> f EmailTemplateRequest
emailTemplateRequest_templateDescription = (EmailTemplateRequest -> Maybe Text)
-> (EmailTemplateRequest -> Maybe Text -> EmailTemplateRequest)
-> Lens
EmailTemplateRequest EmailTemplateRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailTemplateRequest' {Maybe Text
templateDescription :: Maybe Text
$sel:templateDescription:EmailTemplateRequest' :: EmailTemplateRequest -> Maybe Text
templateDescription} -> Maybe Text
templateDescription) (\s :: EmailTemplateRequest
s@EmailTemplateRequest' {} Maybe Text
a -> EmailTemplateRequest
s {$sel:templateDescription:EmailTemplateRequest' :: Maybe Text
templateDescription = Maybe Text
a} :: EmailTemplateRequest)
emailTemplateRequest_defaultSubstitutions :: Lens.Lens' EmailTemplateRequest (Prelude.Maybe Prelude.Text)
emailTemplateRequest_defaultSubstitutions :: (Maybe Text -> f (Maybe Text))
-> EmailTemplateRequest -> f EmailTemplateRequest
emailTemplateRequest_defaultSubstitutions = (EmailTemplateRequest -> Maybe Text)
-> (EmailTemplateRequest -> Maybe Text -> EmailTemplateRequest)
-> Lens
EmailTemplateRequest EmailTemplateRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailTemplateRequest' {Maybe Text
defaultSubstitutions :: Maybe Text
$sel:defaultSubstitutions:EmailTemplateRequest' :: EmailTemplateRequest -> Maybe Text
defaultSubstitutions} -> Maybe Text
defaultSubstitutions) (\s :: EmailTemplateRequest
s@EmailTemplateRequest' {} Maybe Text
a -> EmailTemplateRequest
s {$sel:defaultSubstitutions:EmailTemplateRequest' :: Maybe Text
defaultSubstitutions = Maybe Text
a} :: EmailTemplateRequest)
emailTemplateRequest_htmlPart :: Lens.Lens' EmailTemplateRequest (Prelude.Maybe Prelude.Text)
emailTemplateRequest_htmlPart :: (Maybe Text -> f (Maybe Text))
-> EmailTemplateRequest -> f EmailTemplateRequest
emailTemplateRequest_htmlPart = (EmailTemplateRequest -> Maybe Text)
-> (EmailTemplateRequest -> Maybe Text -> EmailTemplateRequest)
-> Lens
EmailTemplateRequest EmailTemplateRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailTemplateRequest' {Maybe Text
htmlPart :: Maybe Text
$sel:htmlPart:EmailTemplateRequest' :: EmailTemplateRequest -> Maybe Text
htmlPart} -> Maybe Text
htmlPart) (\s :: EmailTemplateRequest
s@EmailTemplateRequest' {} Maybe Text
a -> EmailTemplateRequest
s {$sel:htmlPart:EmailTemplateRequest' :: Maybe Text
htmlPart = Maybe Text
a} :: EmailTemplateRequest)
emailTemplateRequest_recommenderId :: Lens.Lens' EmailTemplateRequest (Prelude.Maybe Prelude.Text)
emailTemplateRequest_recommenderId :: (Maybe Text -> f (Maybe Text))
-> EmailTemplateRequest -> f EmailTemplateRequest
emailTemplateRequest_recommenderId = (EmailTemplateRequest -> Maybe Text)
-> (EmailTemplateRequest -> Maybe Text -> EmailTemplateRequest)
-> Lens
EmailTemplateRequest EmailTemplateRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailTemplateRequest' {Maybe Text
recommenderId :: Maybe Text
$sel:recommenderId:EmailTemplateRequest' :: EmailTemplateRequest -> Maybe Text
recommenderId} -> Maybe Text
recommenderId) (\s :: EmailTemplateRequest
s@EmailTemplateRequest' {} Maybe Text
a -> EmailTemplateRequest
s {$sel:recommenderId:EmailTemplateRequest' :: Maybe Text
recommenderId = Maybe Text
a} :: EmailTemplateRequest)
emailTemplateRequest_tags :: Lens.Lens' EmailTemplateRequest (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
emailTemplateRequest_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> EmailTemplateRequest -> f EmailTemplateRequest
emailTemplateRequest_tags = (EmailTemplateRequest -> Maybe (HashMap Text Text))
-> (EmailTemplateRequest
-> Maybe (HashMap Text Text) -> EmailTemplateRequest)
-> Lens
EmailTemplateRequest
EmailTemplateRequest
(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 (\EmailTemplateRequest' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:EmailTemplateRequest' :: EmailTemplateRequest -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: EmailTemplateRequest
s@EmailTemplateRequest' {} Maybe (HashMap Text Text)
a -> EmailTemplateRequest
s {$sel:tags:EmailTemplateRequest' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: EmailTemplateRequest) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> EmailTemplateRequest -> f EmailTemplateRequest)
-> ((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)))
-> EmailTemplateRequest
-> f EmailTemplateRequest
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 Prelude.Hashable EmailTemplateRequest
instance Prelude.NFData EmailTemplateRequest
instance Core.ToJSON EmailTemplateRequest where
toJSON :: EmailTemplateRequest -> Value
toJSON EmailTemplateRequest' {Maybe Text
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
recommenderId :: Maybe Text
htmlPart :: Maybe Text
defaultSubstitutions :: Maybe Text
templateDescription :: Maybe Text
textPart :: Maybe Text
subject :: Maybe Text
$sel:tags:EmailTemplateRequest' :: EmailTemplateRequest -> Maybe (HashMap Text Text)
$sel:recommenderId:EmailTemplateRequest' :: EmailTemplateRequest -> Maybe Text
$sel:htmlPart:EmailTemplateRequest' :: EmailTemplateRequest -> Maybe Text
$sel:defaultSubstitutions:EmailTemplateRequest' :: EmailTemplateRequest -> Maybe Text
$sel:templateDescription:EmailTemplateRequest' :: EmailTemplateRequest -> Maybe Text
$sel:textPart:EmailTemplateRequest' :: EmailTemplateRequest -> Maybe Text
$sel:subject:EmailTemplateRequest' :: EmailTemplateRequest -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Subject" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
subject,
(Text
"TextPart" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
textPart,
(Text
"TemplateDescription" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
templateDescription,
(Text
"DefaultSubstitutions" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
defaultSubstitutions,
(Text
"HtmlPart" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
htmlPart,
(Text
"RecommenderId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
recommenderId,
(Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags
]
)