{-# 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.MultiConditionalSplitActivity where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.MultiConditionalBranch
import Amazonka.Pinpoint.Types.WaitTime
import qualified Amazonka.Prelude as Prelude
data MultiConditionalSplitActivity = MultiConditionalSplitActivity'
{
MultiConditionalSplitActivity -> Maybe [MultiConditionalBranch]
branches :: Prelude.Maybe [MultiConditionalBranch],
MultiConditionalSplitActivity -> Maybe WaitTime
evaluationWaitTime :: Prelude.Maybe WaitTime,
MultiConditionalSplitActivity -> Maybe Text
defaultActivity :: Prelude.Maybe Prelude.Text
}
deriving (MultiConditionalSplitActivity
-> MultiConditionalSplitActivity -> Bool
(MultiConditionalSplitActivity
-> MultiConditionalSplitActivity -> Bool)
-> (MultiConditionalSplitActivity
-> MultiConditionalSplitActivity -> Bool)
-> Eq MultiConditionalSplitActivity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MultiConditionalSplitActivity
-> MultiConditionalSplitActivity -> Bool
$c/= :: MultiConditionalSplitActivity
-> MultiConditionalSplitActivity -> Bool
== :: MultiConditionalSplitActivity
-> MultiConditionalSplitActivity -> Bool
$c== :: MultiConditionalSplitActivity
-> MultiConditionalSplitActivity -> Bool
Prelude.Eq, ReadPrec [MultiConditionalSplitActivity]
ReadPrec MultiConditionalSplitActivity
Int -> ReadS MultiConditionalSplitActivity
ReadS [MultiConditionalSplitActivity]
(Int -> ReadS MultiConditionalSplitActivity)
-> ReadS [MultiConditionalSplitActivity]
-> ReadPrec MultiConditionalSplitActivity
-> ReadPrec [MultiConditionalSplitActivity]
-> Read MultiConditionalSplitActivity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MultiConditionalSplitActivity]
$creadListPrec :: ReadPrec [MultiConditionalSplitActivity]
readPrec :: ReadPrec MultiConditionalSplitActivity
$creadPrec :: ReadPrec MultiConditionalSplitActivity
readList :: ReadS [MultiConditionalSplitActivity]
$creadList :: ReadS [MultiConditionalSplitActivity]
readsPrec :: Int -> ReadS MultiConditionalSplitActivity
$creadsPrec :: Int -> ReadS MultiConditionalSplitActivity
Prelude.Read, Int -> MultiConditionalSplitActivity -> ShowS
[MultiConditionalSplitActivity] -> ShowS
MultiConditionalSplitActivity -> String
(Int -> MultiConditionalSplitActivity -> ShowS)
-> (MultiConditionalSplitActivity -> String)
-> ([MultiConditionalSplitActivity] -> ShowS)
-> Show MultiConditionalSplitActivity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MultiConditionalSplitActivity] -> ShowS
$cshowList :: [MultiConditionalSplitActivity] -> ShowS
show :: MultiConditionalSplitActivity -> String
$cshow :: MultiConditionalSplitActivity -> String
showsPrec :: Int -> MultiConditionalSplitActivity -> ShowS
$cshowsPrec :: Int -> MultiConditionalSplitActivity -> ShowS
Prelude.Show, (forall x.
MultiConditionalSplitActivity
-> Rep MultiConditionalSplitActivity x)
-> (forall x.
Rep MultiConditionalSplitActivity x
-> MultiConditionalSplitActivity)
-> Generic MultiConditionalSplitActivity
forall x.
Rep MultiConditionalSplitActivity x
-> MultiConditionalSplitActivity
forall x.
MultiConditionalSplitActivity
-> Rep MultiConditionalSplitActivity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MultiConditionalSplitActivity x
-> MultiConditionalSplitActivity
$cfrom :: forall x.
MultiConditionalSplitActivity
-> Rep MultiConditionalSplitActivity x
Prelude.Generic)
newMultiConditionalSplitActivity ::
MultiConditionalSplitActivity
newMultiConditionalSplitActivity :: MultiConditionalSplitActivity
newMultiConditionalSplitActivity =
MultiConditionalSplitActivity' :: Maybe [MultiConditionalBranch]
-> Maybe WaitTime -> Maybe Text -> MultiConditionalSplitActivity
MultiConditionalSplitActivity'
{ $sel:branches:MultiConditionalSplitActivity' :: Maybe [MultiConditionalBranch]
branches =
Maybe [MultiConditionalBranch]
forall a. Maybe a
Prelude.Nothing,
$sel:evaluationWaitTime:MultiConditionalSplitActivity' :: Maybe WaitTime
evaluationWaitTime = Maybe WaitTime
forall a. Maybe a
Prelude.Nothing,
$sel:defaultActivity:MultiConditionalSplitActivity' :: Maybe Text
defaultActivity = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
multiConditionalSplitActivity_branches :: Lens.Lens' MultiConditionalSplitActivity (Prelude.Maybe [MultiConditionalBranch])
multiConditionalSplitActivity_branches :: (Maybe [MultiConditionalBranch]
-> f (Maybe [MultiConditionalBranch]))
-> MultiConditionalSplitActivity -> f MultiConditionalSplitActivity
multiConditionalSplitActivity_branches = (MultiConditionalSplitActivity -> Maybe [MultiConditionalBranch])
-> (MultiConditionalSplitActivity
-> Maybe [MultiConditionalBranch] -> MultiConditionalSplitActivity)
-> Lens
MultiConditionalSplitActivity
MultiConditionalSplitActivity
(Maybe [MultiConditionalBranch])
(Maybe [MultiConditionalBranch])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiConditionalSplitActivity' {Maybe [MultiConditionalBranch]
branches :: Maybe [MultiConditionalBranch]
$sel:branches:MultiConditionalSplitActivity' :: MultiConditionalSplitActivity -> Maybe [MultiConditionalBranch]
branches} -> Maybe [MultiConditionalBranch]
branches) (\s :: MultiConditionalSplitActivity
s@MultiConditionalSplitActivity' {} Maybe [MultiConditionalBranch]
a -> MultiConditionalSplitActivity
s {$sel:branches:MultiConditionalSplitActivity' :: Maybe [MultiConditionalBranch]
branches = Maybe [MultiConditionalBranch]
a} :: MultiConditionalSplitActivity) ((Maybe [MultiConditionalBranch]
-> f (Maybe [MultiConditionalBranch]))
-> MultiConditionalSplitActivity
-> f MultiConditionalSplitActivity)
-> ((Maybe [MultiConditionalBranch]
-> f (Maybe [MultiConditionalBranch]))
-> Maybe [MultiConditionalBranch]
-> f (Maybe [MultiConditionalBranch]))
-> (Maybe [MultiConditionalBranch]
-> f (Maybe [MultiConditionalBranch]))
-> MultiConditionalSplitActivity
-> f MultiConditionalSplitActivity
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[MultiConditionalBranch]
[MultiConditionalBranch]
[MultiConditionalBranch]
[MultiConditionalBranch]
-> Iso
(Maybe [MultiConditionalBranch])
(Maybe [MultiConditionalBranch])
(Maybe [MultiConditionalBranch])
(Maybe [MultiConditionalBranch])
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
[MultiConditionalBranch]
[MultiConditionalBranch]
[MultiConditionalBranch]
[MultiConditionalBranch]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
multiConditionalSplitActivity_evaluationWaitTime :: Lens.Lens' MultiConditionalSplitActivity (Prelude.Maybe WaitTime)
multiConditionalSplitActivity_evaluationWaitTime :: (Maybe WaitTime -> f (Maybe WaitTime))
-> MultiConditionalSplitActivity -> f MultiConditionalSplitActivity
multiConditionalSplitActivity_evaluationWaitTime = (MultiConditionalSplitActivity -> Maybe WaitTime)
-> (MultiConditionalSplitActivity
-> Maybe WaitTime -> MultiConditionalSplitActivity)
-> Lens
MultiConditionalSplitActivity
MultiConditionalSplitActivity
(Maybe WaitTime)
(Maybe WaitTime)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiConditionalSplitActivity' {Maybe WaitTime
evaluationWaitTime :: Maybe WaitTime
$sel:evaluationWaitTime:MultiConditionalSplitActivity' :: MultiConditionalSplitActivity -> Maybe WaitTime
evaluationWaitTime} -> Maybe WaitTime
evaluationWaitTime) (\s :: MultiConditionalSplitActivity
s@MultiConditionalSplitActivity' {} Maybe WaitTime
a -> MultiConditionalSplitActivity
s {$sel:evaluationWaitTime:MultiConditionalSplitActivity' :: Maybe WaitTime
evaluationWaitTime = Maybe WaitTime
a} :: MultiConditionalSplitActivity)
multiConditionalSplitActivity_defaultActivity :: Lens.Lens' MultiConditionalSplitActivity (Prelude.Maybe Prelude.Text)
multiConditionalSplitActivity_defaultActivity :: (Maybe Text -> f (Maybe Text))
-> MultiConditionalSplitActivity -> f MultiConditionalSplitActivity
multiConditionalSplitActivity_defaultActivity = (MultiConditionalSplitActivity -> Maybe Text)
-> (MultiConditionalSplitActivity
-> Maybe Text -> MultiConditionalSplitActivity)
-> Lens
MultiConditionalSplitActivity
MultiConditionalSplitActivity
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiConditionalSplitActivity' {Maybe Text
defaultActivity :: Maybe Text
$sel:defaultActivity:MultiConditionalSplitActivity' :: MultiConditionalSplitActivity -> Maybe Text
defaultActivity} -> Maybe Text
defaultActivity) (\s :: MultiConditionalSplitActivity
s@MultiConditionalSplitActivity' {} Maybe Text
a -> MultiConditionalSplitActivity
s {$sel:defaultActivity:MultiConditionalSplitActivity' :: Maybe Text
defaultActivity = Maybe Text
a} :: MultiConditionalSplitActivity)
instance Core.FromJSON MultiConditionalSplitActivity where
parseJSON :: Value -> Parser MultiConditionalSplitActivity
parseJSON =
String
-> (Object -> Parser MultiConditionalSplitActivity)
-> Value
-> Parser MultiConditionalSplitActivity
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MultiConditionalSplitActivity"
( \Object
x ->
Maybe [MultiConditionalBranch]
-> Maybe WaitTime -> Maybe Text -> MultiConditionalSplitActivity
MultiConditionalSplitActivity'
(Maybe [MultiConditionalBranch]
-> Maybe WaitTime -> Maybe Text -> MultiConditionalSplitActivity)
-> Parser (Maybe [MultiConditionalBranch])
-> Parser
(Maybe WaitTime -> Maybe Text -> MultiConditionalSplitActivity)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [MultiConditionalBranch]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Branches" Parser (Maybe (Maybe [MultiConditionalBranch]))
-> Maybe [MultiConditionalBranch]
-> Parser (Maybe [MultiConditionalBranch])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [MultiConditionalBranch]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe WaitTime -> Maybe Text -> MultiConditionalSplitActivity)
-> Parser (Maybe WaitTime)
-> Parser (Maybe Text -> MultiConditionalSplitActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe WaitTime)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EvaluationWaitTime")
Parser (Maybe Text -> MultiConditionalSplitActivity)
-> Parser (Maybe Text) -> Parser MultiConditionalSplitActivity
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
"DefaultActivity")
)
instance
Prelude.Hashable
MultiConditionalSplitActivity
instance Prelude.NFData MultiConditionalSplitActivity
instance Core.ToJSON MultiConditionalSplitActivity where
toJSON :: MultiConditionalSplitActivity -> Value
toJSON MultiConditionalSplitActivity' {Maybe [MultiConditionalBranch]
Maybe Text
Maybe WaitTime
defaultActivity :: Maybe Text
evaluationWaitTime :: Maybe WaitTime
branches :: Maybe [MultiConditionalBranch]
$sel:defaultActivity:MultiConditionalSplitActivity' :: MultiConditionalSplitActivity -> Maybe Text
$sel:evaluationWaitTime:MultiConditionalSplitActivity' :: MultiConditionalSplitActivity -> Maybe WaitTime
$sel:branches:MultiConditionalSplitActivity' :: MultiConditionalSplitActivity -> Maybe [MultiConditionalBranch]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Branches" Text -> [MultiConditionalBranch] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([MultiConditionalBranch] -> Pair)
-> Maybe [MultiConditionalBranch] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MultiConditionalBranch]
branches,
(Text
"EvaluationWaitTime" Text -> WaitTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(WaitTime -> Pair) -> Maybe WaitTime -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe WaitTime
evaluationWaitTime,
(Text
"DefaultActivity" 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
defaultActivity
]
)