{-# 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.EmailMessageActivity where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.JourneyEmailMessage
import qualified Amazonka.Prelude as Prelude
data EmailMessageActivity = EmailMessageActivity'
{
EmailMessageActivity -> Maybe Text
templateName :: Prelude.Maybe Prelude.Text,
EmailMessageActivity -> Maybe Text
templateVersion :: Prelude.Maybe Prelude.Text,
EmailMessageActivity -> Maybe Text
nextActivity :: Prelude.Maybe Prelude.Text,
EmailMessageActivity -> Maybe JourneyEmailMessage
messageConfig :: Prelude.Maybe JourneyEmailMessage
}
deriving (EmailMessageActivity -> EmailMessageActivity -> Bool
(EmailMessageActivity -> EmailMessageActivity -> Bool)
-> (EmailMessageActivity -> EmailMessageActivity -> Bool)
-> Eq EmailMessageActivity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EmailMessageActivity -> EmailMessageActivity -> Bool
$c/= :: EmailMessageActivity -> EmailMessageActivity -> Bool
== :: EmailMessageActivity -> EmailMessageActivity -> Bool
$c== :: EmailMessageActivity -> EmailMessageActivity -> Bool
Prelude.Eq, ReadPrec [EmailMessageActivity]
ReadPrec EmailMessageActivity
Int -> ReadS EmailMessageActivity
ReadS [EmailMessageActivity]
(Int -> ReadS EmailMessageActivity)
-> ReadS [EmailMessageActivity]
-> ReadPrec EmailMessageActivity
-> ReadPrec [EmailMessageActivity]
-> Read EmailMessageActivity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EmailMessageActivity]
$creadListPrec :: ReadPrec [EmailMessageActivity]
readPrec :: ReadPrec EmailMessageActivity
$creadPrec :: ReadPrec EmailMessageActivity
readList :: ReadS [EmailMessageActivity]
$creadList :: ReadS [EmailMessageActivity]
readsPrec :: Int -> ReadS EmailMessageActivity
$creadsPrec :: Int -> ReadS EmailMessageActivity
Prelude.Read, Int -> EmailMessageActivity -> ShowS
[EmailMessageActivity] -> ShowS
EmailMessageActivity -> String
(Int -> EmailMessageActivity -> ShowS)
-> (EmailMessageActivity -> String)
-> ([EmailMessageActivity] -> ShowS)
-> Show EmailMessageActivity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EmailMessageActivity] -> ShowS
$cshowList :: [EmailMessageActivity] -> ShowS
show :: EmailMessageActivity -> String
$cshow :: EmailMessageActivity -> String
showsPrec :: Int -> EmailMessageActivity -> ShowS
$cshowsPrec :: Int -> EmailMessageActivity -> ShowS
Prelude.Show, (forall x. EmailMessageActivity -> Rep EmailMessageActivity x)
-> (forall x. Rep EmailMessageActivity x -> EmailMessageActivity)
-> Generic EmailMessageActivity
forall x. Rep EmailMessageActivity x -> EmailMessageActivity
forall x. EmailMessageActivity -> Rep EmailMessageActivity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EmailMessageActivity x -> EmailMessageActivity
$cfrom :: forall x. EmailMessageActivity -> Rep EmailMessageActivity x
Prelude.Generic)
newEmailMessageActivity ::
EmailMessageActivity
newEmailMessageActivity :: EmailMessageActivity
newEmailMessageActivity =
EmailMessageActivity' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe JourneyEmailMessage
-> EmailMessageActivity
EmailMessageActivity'
{ $sel:templateName:EmailMessageActivity' :: Maybe Text
templateName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:templateVersion:EmailMessageActivity' :: Maybe Text
templateVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:nextActivity:EmailMessageActivity' :: Maybe Text
nextActivity = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:messageConfig:EmailMessageActivity' :: Maybe JourneyEmailMessage
messageConfig = Maybe JourneyEmailMessage
forall a. Maybe a
Prelude.Nothing
}
emailMessageActivity_templateName :: Lens.Lens' EmailMessageActivity (Prelude.Maybe Prelude.Text)
emailMessageActivity_templateName :: (Maybe Text -> f (Maybe Text))
-> EmailMessageActivity -> f EmailMessageActivity
emailMessageActivity_templateName = (EmailMessageActivity -> Maybe Text)
-> (EmailMessageActivity -> Maybe Text -> EmailMessageActivity)
-> Lens
EmailMessageActivity EmailMessageActivity (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailMessageActivity' {Maybe Text
templateName :: Maybe Text
$sel:templateName:EmailMessageActivity' :: EmailMessageActivity -> Maybe Text
templateName} -> Maybe Text
templateName) (\s :: EmailMessageActivity
s@EmailMessageActivity' {} Maybe Text
a -> EmailMessageActivity
s {$sel:templateName:EmailMessageActivity' :: Maybe Text
templateName = Maybe Text
a} :: EmailMessageActivity)
emailMessageActivity_templateVersion :: Lens.Lens' EmailMessageActivity (Prelude.Maybe Prelude.Text)
emailMessageActivity_templateVersion :: (Maybe Text -> f (Maybe Text))
-> EmailMessageActivity -> f EmailMessageActivity
emailMessageActivity_templateVersion = (EmailMessageActivity -> Maybe Text)
-> (EmailMessageActivity -> Maybe Text -> EmailMessageActivity)
-> Lens
EmailMessageActivity EmailMessageActivity (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailMessageActivity' {Maybe Text
templateVersion :: Maybe Text
$sel:templateVersion:EmailMessageActivity' :: EmailMessageActivity -> Maybe Text
templateVersion} -> Maybe Text
templateVersion) (\s :: EmailMessageActivity
s@EmailMessageActivity' {} Maybe Text
a -> EmailMessageActivity
s {$sel:templateVersion:EmailMessageActivity' :: Maybe Text
templateVersion = Maybe Text
a} :: EmailMessageActivity)
emailMessageActivity_nextActivity :: Lens.Lens' EmailMessageActivity (Prelude.Maybe Prelude.Text)
emailMessageActivity_nextActivity :: (Maybe Text -> f (Maybe Text))
-> EmailMessageActivity -> f EmailMessageActivity
emailMessageActivity_nextActivity = (EmailMessageActivity -> Maybe Text)
-> (EmailMessageActivity -> Maybe Text -> EmailMessageActivity)
-> Lens
EmailMessageActivity EmailMessageActivity (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailMessageActivity' {Maybe Text
nextActivity :: Maybe Text
$sel:nextActivity:EmailMessageActivity' :: EmailMessageActivity -> Maybe Text
nextActivity} -> Maybe Text
nextActivity) (\s :: EmailMessageActivity
s@EmailMessageActivity' {} Maybe Text
a -> EmailMessageActivity
s {$sel:nextActivity:EmailMessageActivity' :: Maybe Text
nextActivity = Maybe Text
a} :: EmailMessageActivity)
emailMessageActivity_messageConfig :: Lens.Lens' EmailMessageActivity (Prelude.Maybe JourneyEmailMessage)
emailMessageActivity_messageConfig :: (Maybe JourneyEmailMessage -> f (Maybe JourneyEmailMessage))
-> EmailMessageActivity -> f EmailMessageActivity
emailMessageActivity_messageConfig = (EmailMessageActivity -> Maybe JourneyEmailMessage)
-> (EmailMessageActivity
-> Maybe JourneyEmailMessage -> EmailMessageActivity)
-> Lens
EmailMessageActivity
EmailMessageActivity
(Maybe JourneyEmailMessage)
(Maybe JourneyEmailMessage)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailMessageActivity' {Maybe JourneyEmailMessage
messageConfig :: Maybe JourneyEmailMessage
$sel:messageConfig:EmailMessageActivity' :: EmailMessageActivity -> Maybe JourneyEmailMessage
messageConfig} -> Maybe JourneyEmailMessage
messageConfig) (\s :: EmailMessageActivity
s@EmailMessageActivity' {} Maybe JourneyEmailMessage
a -> EmailMessageActivity
s {$sel:messageConfig:EmailMessageActivity' :: Maybe JourneyEmailMessage
messageConfig = Maybe JourneyEmailMessage
a} :: EmailMessageActivity)
instance Core.FromJSON EmailMessageActivity where
parseJSON :: Value -> Parser EmailMessageActivity
parseJSON =
String
-> (Object -> Parser EmailMessageActivity)
-> Value
-> Parser EmailMessageActivity
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EmailMessageActivity"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe JourneyEmailMessage
-> EmailMessageActivity
EmailMessageActivity'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe JourneyEmailMessage
-> EmailMessageActivity)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe JourneyEmailMessage -> EmailMessageActivity)
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
"TemplateName")
Parser
(Maybe Text
-> Maybe Text -> Maybe JourneyEmailMessage -> EmailMessageActivity)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe JourneyEmailMessage -> EmailMessageActivity)
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
"TemplateVersion")
Parser
(Maybe Text -> Maybe JourneyEmailMessage -> EmailMessageActivity)
-> Parser (Maybe Text)
-> Parser (Maybe JourneyEmailMessage -> EmailMessageActivity)
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
"NextActivity")
Parser (Maybe JourneyEmailMessage -> EmailMessageActivity)
-> Parser (Maybe JourneyEmailMessage)
-> Parser EmailMessageActivity
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JourneyEmailMessage)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MessageConfig")
)
instance Prelude.Hashable EmailMessageActivity
instance Prelude.NFData EmailMessageActivity
instance Core.ToJSON EmailMessageActivity where
toJSON :: EmailMessageActivity -> Value
toJSON EmailMessageActivity' {Maybe Text
Maybe JourneyEmailMessage
messageConfig :: Maybe JourneyEmailMessage
nextActivity :: Maybe Text
templateVersion :: Maybe Text
templateName :: Maybe Text
$sel:messageConfig:EmailMessageActivity' :: EmailMessageActivity -> Maybe JourneyEmailMessage
$sel:nextActivity:EmailMessageActivity' :: EmailMessageActivity -> Maybe Text
$sel:templateVersion:EmailMessageActivity' :: EmailMessageActivity -> Maybe Text
$sel:templateName:EmailMessageActivity' :: EmailMessageActivity -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"TemplateName" 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
templateName,
(Text
"TemplateVersion" 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
templateVersion,
(Text
"NextActivity" 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
nextActivity,
(Text
"MessageConfig" Text -> JourneyEmailMessage -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (JourneyEmailMessage -> Pair)
-> Maybe JourneyEmailMessage -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe JourneyEmailMessage
messageConfig
]
)