{-# 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.Activity where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.ConditionalSplitActivity
import Amazonka.Pinpoint.Types.ContactCenterActivity
import Amazonka.Pinpoint.Types.CustomMessageActivity
import Amazonka.Pinpoint.Types.EmailMessageActivity
import Amazonka.Pinpoint.Types.HoldoutActivity
import Amazonka.Pinpoint.Types.MultiConditionalSplitActivity
import Amazonka.Pinpoint.Types.PushMessageActivity
import Amazonka.Pinpoint.Types.RandomSplitActivity
import Amazonka.Pinpoint.Types.SMSMessageActivity
import Amazonka.Pinpoint.Types.WaitActivity
import qualified Amazonka.Prelude as Prelude
data Activity = Activity'
{
Activity -> Maybe ConditionalSplitActivity
conditionalSplit :: Prelude.Maybe ConditionalSplitActivity,
Activity -> Maybe EmailMessageActivity
email :: Prelude.Maybe EmailMessageActivity,
Activity -> Maybe MultiConditionalSplitActivity
multiCondition :: Prelude.Maybe MultiConditionalSplitActivity,
Activity -> Maybe ContactCenterActivity
contactCenter :: Prelude.Maybe ContactCenterActivity,
Activity -> Maybe CustomMessageActivity
custom :: Prelude.Maybe CustomMessageActivity,
Activity -> Maybe WaitActivity
wait :: Prelude.Maybe WaitActivity,
Activity -> Maybe RandomSplitActivity
randomSplit :: Prelude.Maybe RandomSplitActivity,
Activity -> Maybe HoldoutActivity
holdout :: Prelude.Maybe HoldoutActivity,
Activity -> Maybe SMSMessageActivity
sms :: Prelude.Maybe SMSMessageActivity,
Activity -> Maybe PushMessageActivity
push :: Prelude.Maybe PushMessageActivity,
Activity -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (Activity -> Activity -> Bool
(Activity -> Activity -> Bool)
-> (Activity -> Activity -> Bool) -> Eq Activity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Activity -> Activity -> Bool
$c/= :: Activity -> Activity -> Bool
== :: Activity -> Activity -> Bool
$c== :: Activity -> Activity -> Bool
Prelude.Eq, ReadPrec [Activity]
ReadPrec Activity
Int -> ReadS Activity
ReadS [Activity]
(Int -> ReadS Activity)
-> ReadS [Activity]
-> ReadPrec Activity
-> ReadPrec [Activity]
-> Read Activity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Activity]
$creadListPrec :: ReadPrec [Activity]
readPrec :: ReadPrec Activity
$creadPrec :: ReadPrec Activity
readList :: ReadS [Activity]
$creadList :: ReadS [Activity]
readsPrec :: Int -> ReadS Activity
$creadsPrec :: Int -> ReadS Activity
Prelude.Read, Int -> Activity -> ShowS
[Activity] -> ShowS
Activity -> String
(Int -> Activity -> ShowS)
-> (Activity -> String) -> ([Activity] -> ShowS) -> Show Activity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Activity] -> ShowS
$cshowList :: [Activity] -> ShowS
show :: Activity -> String
$cshow :: Activity -> String
showsPrec :: Int -> Activity -> ShowS
$cshowsPrec :: Int -> Activity -> ShowS
Prelude.Show, (forall x. Activity -> Rep Activity x)
-> (forall x. Rep Activity x -> Activity) -> Generic Activity
forall x. Rep Activity x -> Activity
forall x. Activity -> Rep Activity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Activity x -> Activity
$cfrom :: forall x. Activity -> Rep Activity x
Prelude.Generic)
newActivity ::
Activity
newActivity :: Activity
newActivity =
Activity' :: Maybe ConditionalSplitActivity
-> Maybe EmailMessageActivity
-> Maybe MultiConditionalSplitActivity
-> Maybe ContactCenterActivity
-> Maybe CustomMessageActivity
-> Maybe WaitActivity
-> Maybe RandomSplitActivity
-> Maybe HoldoutActivity
-> Maybe SMSMessageActivity
-> Maybe PushMessageActivity
-> Maybe Text
-> Activity
Activity'
{ $sel:conditionalSplit:Activity' :: Maybe ConditionalSplitActivity
conditionalSplit = Maybe ConditionalSplitActivity
forall a. Maybe a
Prelude.Nothing,
$sel:email:Activity' :: Maybe EmailMessageActivity
email = Maybe EmailMessageActivity
forall a. Maybe a
Prelude.Nothing,
$sel:multiCondition:Activity' :: Maybe MultiConditionalSplitActivity
multiCondition = Maybe MultiConditionalSplitActivity
forall a. Maybe a
Prelude.Nothing,
$sel:contactCenter:Activity' :: Maybe ContactCenterActivity
contactCenter = Maybe ContactCenterActivity
forall a. Maybe a
Prelude.Nothing,
$sel:custom:Activity' :: Maybe CustomMessageActivity
custom = Maybe CustomMessageActivity
forall a. Maybe a
Prelude.Nothing,
$sel:wait:Activity' :: Maybe WaitActivity
wait = Maybe WaitActivity
forall a. Maybe a
Prelude.Nothing,
$sel:randomSplit:Activity' :: Maybe RandomSplitActivity
randomSplit = Maybe RandomSplitActivity
forall a. Maybe a
Prelude.Nothing,
$sel:holdout:Activity' :: Maybe HoldoutActivity
holdout = Maybe HoldoutActivity
forall a. Maybe a
Prelude.Nothing,
$sel:sms:Activity' :: Maybe SMSMessageActivity
sms = Maybe SMSMessageActivity
forall a. Maybe a
Prelude.Nothing,
$sel:push:Activity' :: Maybe PushMessageActivity
push = Maybe PushMessageActivity
forall a. Maybe a
Prelude.Nothing,
$sel:description:Activity' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
activity_conditionalSplit :: Lens.Lens' Activity (Prelude.Maybe ConditionalSplitActivity)
activity_conditionalSplit :: (Maybe ConditionalSplitActivity
-> f (Maybe ConditionalSplitActivity))
-> Activity -> f Activity
activity_conditionalSplit = (Activity -> Maybe ConditionalSplitActivity)
-> (Activity -> Maybe ConditionalSplitActivity -> Activity)
-> Lens
Activity
Activity
(Maybe ConditionalSplitActivity)
(Maybe ConditionalSplitActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Activity' {Maybe ConditionalSplitActivity
conditionalSplit :: Maybe ConditionalSplitActivity
$sel:conditionalSplit:Activity' :: Activity -> Maybe ConditionalSplitActivity
conditionalSplit} -> Maybe ConditionalSplitActivity
conditionalSplit) (\s :: Activity
s@Activity' {} Maybe ConditionalSplitActivity
a -> Activity
s {$sel:conditionalSplit:Activity' :: Maybe ConditionalSplitActivity
conditionalSplit = Maybe ConditionalSplitActivity
a} :: Activity)
activity_email :: Lens.Lens' Activity (Prelude.Maybe EmailMessageActivity)
activity_email :: (Maybe EmailMessageActivity -> f (Maybe EmailMessageActivity))
-> Activity -> f Activity
activity_email = (Activity -> Maybe EmailMessageActivity)
-> (Activity -> Maybe EmailMessageActivity -> Activity)
-> Lens
Activity
Activity
(Maybe EmailMessageActivity)
(Maybe EmailMessageActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Activity' {Maybe EmailMessageActivity
email :: Maybe EmailMessageActivity
$sel:email:Activity' :: Activity -> Maybe EmailMessageActivity
email} -> Maybe EmailMessageActivity
email) (\s :: Activity
s@Activity' {} Maybe EmailMessageActivity
a -> Activity
s {$sel:email:Activity' :: Maybe EmailMessageActivity
email = Maybe EmailMessageActivity
a} :: Activity)
activity_multiCondition :: Lens.Lens' Activity (Prelude.Maybe MultiConditionalSplitActivity)
activity_multiCondition :: (Maybe MultiConditionalSplitActivity
-> f (Maybe MultiConditionalSplitActivity))
-> Activity -> f Activity
activity_multiCondition = (Activity -> Maybe MultiConditionalSplitActivity)
-> (Activity -> Maybe MultiConditionalSplitActivity -> Activity)
-> Lens
Activity
Activity
(Maybe MultiConditionalSplitActivity)
(Maybe MultiConditionalSplitActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Activity' {Maybe MultiConditionalSplitActivity
multiCondition :: Maybe MultiConditionalSplitActivity
$sel:multiCondition:Activity' :: Activity -> Maybe MultiConditionalSplitActivity
multiCondition} -> Maybe MultiConditionalSplitActivity
multiCondition) (\s :: Activity
s@Activity' {} Maybe MultiConditionalSplitActivity
a -> Activity
s {$sel:multiCondition:Activity' :: Maybe MultiConditionalSplitActivity
multiCondition = Maybe MultiConditionalSplitActivity
a} :: Activity)
activity_contactCenter :: Lens.Lens' Activity (Prelude.Maybe ContactCenterActivity)
activity_contactCenter :: (Maybe ContactCenterActivity -> f (Maybe ContactCenterActivity))
-> Activity -> f Activity
activity_contactCenter = (Activity -> Maybe ContactCenterActivity)
-> (Activity -> Maybe ContactCenterActivity -> Activity)
-> Lens
Activity
Activity
(Maybe ContactCenterActivity)
(Maybe ContactCenterActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Activity' {Maybe ContactCenterActivity
contactCenter :: Maybe ContactCenterActivity
$sel:contactCenter:Activity' :: Activity -> Maybe ContactCenterActivity
contactCenter} -> Maybe ContactCenterActivity
contactCenter) (\s :: Activity
s@Activity' {} Maybe ContactCenterActivity
a -> Activity
s {$sel:contactCenter:Activity' :: Maybe ContactCenterActivity
contactCenter = Maybe ContactCenterActivity
a} :: Activity)
activity_custom :: Lens.Lens' Activity (Prelude.Maybe CustomMessageActivity)
activity_custom :: (Maybe CustomMessageActivity -> f (Maybe CustomMessageActivity))
-> Activity -> f Activity
activity_custom = (Activity -> Maybe CustomMessageActivity)
-> (Activity -> Maybe CustomMessageActivity -> Activity)
-> Lens
Activity
Activity
(Maybe CustomMessageActivity)
(Maybe CustomMessageActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Activity' {Maybe CustomMessageActivity
custom :: Maybe CustomMessageActivity
$sel:custom:Activity' :: Activity -> Maybe CustomMessageActivity
custom} -> Maybe CustomMessageActivity
custom) (\s :: Activity
s@Activity' {} Maybe CustomMessageActivity
a -> Activity
s {$sel:custom:Activity' :: Maybe CustomMessageActivity
custom = Maybe CustomMessageActivity
a} :: Activity)
activity_wait :: Lens.Lens' Activity (Prelude.Maybe WaitActivity)
activity_wait :: (Maybe WaitActivity -> f (Maybe WaitActivity))
-> Activity -> f Activity
activity_wait = (Activity -> Maybe WaitActivity)
-> (Activity -> Maybe WaitActivity -> Activity)
-> Lens Activity Activity (Maybe WaitActivity) (Maybe WaitActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Activity' {Maybe WaitActivity
wait :: Maybe WaitActivity
$sel:wait:Activity' :: Activity -> Maybe WaitActivity
wait} -> Maybe WaitActivity
wait) (\s :: Activity
s@Activity' {} Maybe WaitActivity
a -> Activity
s {$sel:wait:Activity' :: Maybe WaitActivity
wait = Maybe WaitActivity
a} :: Activity)
activity_randomSplit :: Lens.Lens' Activity (Prelude.Maybe RandomSplitActivity)
activity_randomSplit :: (Maybe RandomSplitActivity -> f (Maybe RandomSplitActivity))
-> Activity -> f Activity
activity_randomSplit = (Activity -> Maybe RandomSplitActivity)
-> (Activity -> Maybe RandomSplitActivity -> Activity)
-> Lens
Activity
Activity
(Maybe RandomSplitActivity)
(Maybe RandomSplitActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Activity' {Maybe RandomSplitActivity
randomSplit :: Maybe RandomSplitActivity
$sel:randomSplit:Activity' :: Activity -> Maybe RandomSplitActivity
randomSplit} -> Maybe RandomSplitActivity
randomSplit) (\s :: Activity
s@Activity' {} Maybe RandomSplitActivity
a -> Activity
s {$sel:randomSplit:Activity' :: Maybe RandomSplitActivity
randomSplit = Maybe RandomSplitActivity
a} :: Activity)
activity_holdout :: Lens.Lens' Activity (Prelude.Maybe HoldoutActivity)
activity_holdout :: (Maybe HoldoutActivity -> f (Maybe HoldoutActivity))
-> Activity -> f Activity
activity_holdout = (Activity -> Maybe HoldoutActivity)
-> (Activity -> Maybe HoldoutActivity -> Activity)
-> Lens
Activity Activity (Maybe HoldoutActivity) (Maybe HoldoutActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Activity' {Maybe HoldoutActivity
holdout :: Maybe HoldoutActivity
$sel:holdout:Activity' :: Activity -> Maybe HoldoutActivity
holdout} -> Maybe HoldoutActivity
holdout) (\s :: Activity
s@Activity' {} Maybe HoldoutActivity
a -> Activity
s {$sel:holdout:Activity' :: Maybe HoldoutActivity
holdout = Maybe HoldoutActivity
a} :: Activity)
activity_sms :: Lens.Lens' Activity (Prelude.Maybe SMSMessageActivity)
activity_sms :: (Maybe SMSMessageActivity -> f (Maybe SMSMessageActivity))
-> Activity -> f Activity
activity_sms = (Activity -> Maybe SMSMessageActivity)
-> (Activity -> Maybe SMSMessageActivity -> Activity)
-> Lens
Activity
Activity
(Maybe SMSMessageActivity)
(Maybe SMSMessageActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Activity' {Maybe SMSMessageActivity
sms :: Maybe SMSMessageActivity
$sel:sms:Activity' :: Activity -> Maybe SMSMessageActivity
sms} -> Maybe SMSMessageActivity
sms) (\s :: Activity
s@Activity' {} Maybe SMSMessageActivity
a -> Activity
s {$sel:sms:Activity' :: Maybe SMSMessageActivity
sms = Maybe SMSMessageActivity
a} :: Activity)
activity_push :: Lens.Lens' Activity (Prelude.Maybe PushMessageActivity)
activity_push :: (Maybe PushMessageActivity -> f (Maybe PushMessageActivity))
-> Activity -> f Activity
activity_push = (Activity -> Maybe PushMessageActivity)
-> (Activity -> Maybe PushMessageActivity -> Activity)
-> Lens
Activity
Activity
(Maybe PushMessageActivity)
(Maybe PushMessageActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Activity' {Maybe PushMessageActivity
push :: Maybe PushMessageActivity
$sel:push:Activity' :: Activity -> Maybe PushMessageActivity
push} -> Maybe PushMessageActivity
push) (\s :: Activity
s@Activity' {} Maybe PushMessageActivity
a -> Activity
s {$sel:push:Activity' :: Maybe PushMessageActivity
push = Maybe PushMessageActivity
a} :: Activity)
activity_description :: Lens.Lens' Activity (Prelude.Maybe Prelude.Text)
activity_description :: (Maybe Text -> f (Maybe Text)) -> Activity -> f Activity
activity_description = (Activity -> Maybe Text)
-> (Activity -> Maybe Text -> Activity)
-> Lens Activity Activity (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Activity' {Maybe Text
description :: Maybe Text
$sel:description:Activity' :: Activity -> Maybe Text
description} -> Maybe Text
description) (\s :: Activity
s@Activity' {} Maybe Text
a -> Activity
s {$sel:description:Activity' :: Maybe Text
description = Maybe Text
a} :: Activity)
instance Core.FromJSON Activity where
parseJSON :: Value -> Parser Activity
parseJSON =
String -> (Object -> Parser Activity) -> Value -> Parser Activity
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Activity"
( \Object
x ->
Maybe ConditionalSplitActivity
-> Maybe EmailMessageActivity
-> Maybe MultiConditionalSplitActivity
-> Maybe ContactCenterActivity
-> Maybe CustomMessageActivity
-> Maybe WaitActivity
-> Maybe RandomSplitActivity
-> Maybe HoldoutActivity
-> Maybe SMSMessageActivity
-> Maybe PushMessageActivity
-> Maybe Text
-> Activity
Activity'
(Maybe ConditionalSplitActivity
-> Maybe EmailMessageActivity
-> Maybe MultiConditionalSplitActivity
-> Maybe ContactCenterActivity
-> Maybe CustomMessageActivity
-> Maybe WaitActivity
-> Maybe RandomSplitActivity
-> Maybe HoldoutActivity
-> Maybe SMSMessageActivity
-> Maybe PushMessageActivity
-> Maybe Text
-> Activity)
-> Parser (Maybe ConditionalSplitActivity)
-> Parser
(Maybe EmailMessageActivity
-> Maybe MultiConditionalSplitActivity
-> Maybe ContactCenterActivity
-> Maybe CustomMessageActivity
-> Maybe WaitActivity
-> Maybe RandomSplitActivity
-> Maybe HoldoutActivity
-> Maybe SMSMessageActivity
-> Maybe PushMessageActivity
-> Maybe Text
-> Activity)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ConditionalSplitActivity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ConditionalSplit")
Parser
(Maybe EmailMessageActivity
-> Maybe MultiConditionalSplitActivity
-> Maybe ContactCenterActivity
-> Maybe CustomMessageActivity
-> Maybe WaitActivity
-> Maybe RandomSplitActivity
-> Maybe HoldoutActivity
-> Maybe SMSMessageActivity
-> Maybe PushMessageActivity
-> Maybe Text
-> Activity)
-> Parser (Maybe EmailMessageActivity)
-> Parser
(Maybe MultiConditionalSplitActivity
-> Maybe ContactCenterActivity
-> Maybe CustomMessageActivity
-> Maybe WaitActivity
-> Maybe RandomSplitActivity
-> Maybe HoldoutActivity
-> Maybe SMSMessageActivity
-> Maybe PushMessageActivity
-> Maybe Text
-> Activity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EmailMessageActivity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EMAIL")
Parser
(Maybe MultiConditionalSplitActivity
-> Maybe ContactCenterActivity
-> Maybe CustomMessageActivity
-> Maybe WaitActivity
-> Maybe RandomSplitActivity
-> Maybe HoldoutActivity
-> Maybe SMSMessageActivity
-> Maybe PushMessageActivity
-> Maybe Text
-> Activity)
-> Parser (Maybe MultiConditionalSplitActivity)
-> Parser
(Maybe ContactCenterActivity
-> Maybe CustomMessageActivity
-> Maybe WaitActivity
-> Maybe RandomSplitActivity
-> Maybe HoldoutActivity
-> Maybe SMSMessageActivity
-> Maybe PushMessageActivity
-> Maybe Text
-> Activity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MultiConditionalSplitActivity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MultiCondition")
Parser
(Maybe ContactCenterActivity
-> Maybe CustomMessageActivity
-> Maybe WaitActivity
-> Maybe RandomSplitActivity
-> Maybe HoldoutActivity
-> Maybe SMSMessageActivity
-> Maybe PushMessageActivity
-> Maybe Text
-> Activity)
-> Parser (Maybe ContactCenterActivity)
-> Parser
(Maybe CustomMessageActivity
-> Maybe WaitActivity
-> Maybe RandomSplitActivity
-> Maybe HoldoutActivity
-> Maybe SMSMessageActivity
-> Maybe PushMessageActivity
-> Maybe Text
-> Activity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ContactCenterActivity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ContactCenter")
Parser
(Maybe CustomMessageActivity
-> Maybe WaitActivity
-> Maybe RandomSplitActivity
-> Maybe HoldoutActivity
-> Maybe SMSMessageActivity
-> Maybe PushMessageActivity
-> Maybe Text
-> Activity)
-> Parser (Maybe CustomMessageActivity)
-> Parser
(Maybe WaitActivity
-> Maybe RandomSplitActivity
-> Maybe HoldoutActivity
-> Maybe SMSMessageActivity
-> Maybe PushMessageActivity
-> Maybe Text
-> Activity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CustomMessageActivity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CUSTOM")
Parser
(Maybe WaitActivity
-> Maybe RandomSplitActivity
-> Maybe HoldoutActivity
-> Maybe SMSMessageActivity
-> Maybe PushMessageActivity
-> Maybe Text
-> Activity)
-> Parser (Maybe WaitActivity)
-> Parser
(Maybe RandomSplitActivity
-> Maybe HoldoutActivity
-> Maybe SMSMessageActivity
-> Maybe PushMessageActivity
-> Maybe Text
-> Activity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe WaitActivity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Wait")
Parser
(Maybe RandomSplitActivity
-> Maybe HoldoutActivity
-> Maybe SMSMessageActivity
-> Maybe PushMessageActivity
-> Maybe Text
-> Activity)
-> Parser (Maybe RandomSplitActivity)
-> Parser
(Maybe HoldoutActivity
-> Maybe SMSMessageActivity
-> Maybe PushMessageActivity
-> Maybe Text
-> Activity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RandomSplitActivity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RandomSplit")
Parser
(Maybe HoldoutActivity
-> Maybe SMSMessageActivity
-> Maybe PushMessageActivity
-> Maybe Text
-> Activity)
-> Parser (Maybe HoldoutActivity)
-> Parser
(Maybe SMSMessageActivity
-> Maybe PushMessageActivity -> Maybe Text -> Activity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HoldoutActivity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Holdout")
Parser
(Maybe SMSMessageActivity
-> Maybe PushMessageActivity -> Maybe Text -> Activity)
-> Parser (Maybe SMSMessageActivity)
-> Parser (Maybe PushMessageActivity -> Maybe Text -> Activity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SMSMessageActivity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SMS")
Parser (Maybe PushMessageActivity -> Maybe Text -> Activity)
-> Parser (Maybe PushMessageActivity)
-> Parser (Maybe Text -> Activity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PushMessageActivity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PUSH")
Parser (Maybe Text -> Activity)
-> Parser (Maybe Text) -> Parser Activity
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
"Description")
)
instance Prelude.Hashable Activity
instance Prelude.NFData Activity
instance Core.ToJSON Activity where
toJSON :: Activity -> Value
toJSON Activity' {Maybe Text
Maybe ContactCenterActivity
Maybe HoldoutActivity
Maybe CustomMessageActivity
Maybe EmailMessageActivity
Maybe PushMessageActivity
Maybe RandomSplitActivity
Maybe SMSMessageActivity
Maybe WaitActivity
Maybe MultiConditionalSplitActivity
Maybe ConditionalSplitActivity
description :: Maybe Text
push :: Maybe PushMessageActivity
sms :: Maybe SMSMessageActivity
holdout :: Maybe HoldoutActivity
randomSplit :: Maybe RandomSplitActivity
wait :: Maybe WaitActivity
custom :: Maybe CustomMessageActivity
contactCenter :: Maybe ContactCenterActivity
multiCondition :: Maybe MultiConditionalSplitActivity
email :: Maybe EmailMessageActivity
conditionalSplit :: Maybe ConditionalSplitActivity
$sel:description:Activity' :: Activity -> Maybe Text
$sel:push:Activity' :: Activity -> Maybe PushMessageActivity
$sel:sms:Activity' :: Activity -> Maybe SMSMessageActivity
$sel:holdout:Activity' :: Activity -> Maybe HoldoutActivity
$sel:randomSplit:Activity' :: Activity -> Maybe RandomSplitActivity
$sel:wait:Activity' :: Activity -> Maybe WaitActivity
$sel:custom:Activity' :: Activity -> Maybe CustomMessageActivity
$sel:contactCenter:Activity' :: Activity -> Maybe ContactCenterActivity
$sel:multiCondition:Activity' :: Activity -> Maybe MultiConditionalSplitActivity
$sel:email:Activity' :: Activity -> Maybe EmailMessageActivity
$sel:conditionalSplit:Activity' :: Activity -> Maybe ConditionalSplitActivity
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ConditionalSplit" Text -> ConditionalSplitActivity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ConditionalSplitActivity -> Pair)
-> Maybe ConditionalSplitActivity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConditionalSplitActivity
conditionalSplit,
(Text
"EMAIL" Text -> EmailMessageActivity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (EmailMessageActivity -> Pair)
-> Maybe EmailMessageActivity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EmailMessageActivity
email,
(Text
"MultiCondition" Text -> MultiConditionalSplitActivity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(MultiConditionalSplitActivity -> Pair)
-> Maybe MultiConditionalSplitActivity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MultiConditionalSplitActivity
multiCondition,
(Text
"ContactCenter" Text -> ContactCenterActivity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ContactCenterActivity -> Pair)
-> Maybe ContactCenterActivity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ContactCenterActivity
contactCenter,
(Text
"CUSTOM" Text -> CustomMessageActivity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CustomMessageActivity -> Pair)
-> Maybe CustomMessageActivity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CustomMessageActivity
custom,
(Text
"Wait" Text -> WaitActivity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (WaitActivity -> Pair) -> Maybe WaitActivity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe WaitActivity
wait,
(Text
"RandomSplit" Text -> RandomSplitActivity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RandomSplitActivity -> Pair)
-> Maybe RandomSplitActivity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RandomSplitActivity
randomSplit,
(Text
"Holdout" Text -> HoldoutActivity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HoldoutActivity -> Pair) -> Maybe HoldoutActivity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HoldoutActivity
holdout,
(Text
"SMS" Text -> SMSMessageActivity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SMSMessageActivity -> Pair)
-> Maybe SMSMessageActivity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SMSMessageActivity
sms,
(Text
"PUSH" Text -> PushMessageActivity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PushMessageActivity -> Pair)
-> Maybe PushMessageActivity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PushMessageActivity
push,
(Text
"Description" 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
description
]
)