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