{-# 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.CustomMessageActivity where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.EndpointTypesElement
import Amazonka.Pinpoint.Types.JourneyCustomMessage
import qualified Amazonka.Prelude as Prelude
data CustomMessageActivity = CustomMessageActivity'
{
CustomMessageActivity -> Maybe Text
templateName :: Prelude.Maybe Prelude.Text,
CustomMessageActivity -> Maybe Text
templateVersion :: Prelude.Maybe Prelude.Text,
CustomMessageActivity -> Maybe [EndpointTypesElement]
endpointTypes :: Prelude.Maybe [EndpointTypesElement],
CustomMessageActivity -> Maybe Text
nextActivity :: Prelude.Maybe Prelude.Text,
CustomMessageActivity -> Maybe Text
deliveryUri :: Prelude.Maybe Prelude.Text,
CustomMessageActivity -> Maybe JourneyCustomMessage
messageConfig :: Prelude.Maybe JourneyCustomMessage
}
deriving (CustomMessageActivity -> CustomMessageActivity -> Bool
(CustomMessageActivity -> CustomMessageActivity -> Bool)
-> (CustomMessageActivity -> CustomMessageActivity -> Bool)
-> Eq CustomMessageActivity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomMessageActivity -> CustomMessageActivity -> Bool
$c/= :: CustomMessageActivity -> CustomMessageActivity -> Bool
== :: CustomMessageActivity -> CustomMessageActivity -> Bool
$c== :: CustomMessageActivity -> CustomMessageActivity -> Bool
Prelude.Eq, ReadPrec [CustomMessageActivity]
ReadPrec CustomMessageActivity
Int -> ReadS CustomMessageActivity
ReadS [CustomMessageActivity]
(Int -> ReadS CustomMessageActivity)
-> ReadS [CustomMessageActivity]
-> ReadPrec CustomMessageActivity
-> ReadPrec [CustomMessageActivity]
-> Read CustomMessageActivity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomMessageActivity]
$creadListPrec :: ReadPrec [CustomMessageActivity]
readPrec :: ReadPrec CustomMessageActivity
$creadPrec :: ReadPrec CustomMessageActivity
readList :: ReadS [CustomMessageActivity]
$creadList :: ReadS [CustomMessageActivity]
readsPrec :: Int -> ReadS CustomMessageActivity
$creadsPrec :: Int -> ReadS CustomMessageActivity
Prelude.Read, Int -> CustomMessageActivity -> ShowS
[CustomMessageActivity] -> ShowS
CustomMessageActivity -> String
(Int -> CustomMessageActivity -> ShowS)
-> (CustomMessageActivity -> String)
-> ([CustomMessageActivity] -> ShowS)
-> Show CustomMessageActivity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomMessageActivity] -> ShowS
$cshowList :: [CustomMessageActivity] -> ShowS
show :: CustomMessageActivity -> String
$cshow :: CustomMessageActivity -> String
showsPrec :: Int -> CustomMessageActivity -> ShowS
$cshowsPrec :: Int -> CustomMessageActivity -> ShowS
Prelude.Show, (forall x. CustomMessageActivity -> Rep CustomMessageActivity x)
-> (forall x. Rep CustomMessageActivity x -> CustomMessageActivity)
-> Generic CustomMessageActivity
forall x. Rep CustomMessageActivity x -> CustomMessageActivity
forall x. CustomMessageActivity -> Rep CustomMessageActivity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CustomMessageActivity x -> CustomMessageActivity
$cfrom :: forall x. CustomMessageActivity -> Rep CustomMessageActivity x
Prelude.Generic)
newCustomMessageActivity ::
CustomMessageActivity
newCustomMessageActivity :: CustomMessageActivity
newCustomMessageActivity =
CustomMessageActivity' :: Maybe Text
-> Maybe Text
-> Maybe [EndpointTypesElement]
-> Maybe Text
-> Maybe Text
-> Maybe JourneyCustomMessage
-> CustomMessageActivity
CustomMessageActivity'
{ $sel:templateName:CustomMessageActivity' :: Maybe Text
templateName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:templateVersion:CustomMessageActivity' :: Maybe Text
templateVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:endpointTypes:CustomMessageActivity' :: Maybe [EndpointTypesElement]
endpointTypes = Maybe [EndpointTypesElement]
forall a. Maybe a
Prelude.Nothing,
$sel:nextActivity:CustomMessageActivity' :: Maybe Text
nextActivity = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:deliveryUri:CustomMessageActivity' :: Maybe Text
deliveryUri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:messageConfig:CustomMessageActivity' :: Maybe JourneyCustomMessage
messageConfig = Maybe JourneyCustomMessage
forall a. Maybe a
Prelude.Nothing
}
customMessageActivity_templateName :: Lens.Lens' CustomMessageActivity (Prelude.Maybe Prelude.Text)
customMessageActivity_templateName :: (Maybe Text -> f (Maybe Text))
-> CustomMessageActivity -> f CustomMessageActivity
customMessageActivity_templateName = (CustomMessageActivity -> Maybe Text)
-> (CustomMessageActivity -> Maybe Text -> CustomMessageActivity)
-> Lens
CustomMessageActivity
CustomMessageActivity
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomMessageActivity' {Maybe Text
templateName :: Maybe Text
$sel:templateName:CustomMessageActivity' :: CustomMessageActivity -> Maybe Text
templateName} -> Maybe Text
templateName) (\s :: CustomMessageActivity
s@CustomMessageActivity' {} Maybe Text
a -> CustomMessageActivity
s {$sel:templateName:CustomMessageActivity' :: Maybe Text
templateName = Maybe Text
a} :: CustomMessageActivity)
customMessageActivity_templateVersion :: Lens.Lens' CustomMessageActivity (Prelude.Maybe Prelude.Text)
customMessageActivity_templateVersion :: (Maybe Text -> f (Maybe Text))
-> CustomMessageActivity -> f CustomMessageActivity
customMessageActivity_templateVersion = (CustomMessageActivity -> Maybe Text)
-> (CustomMessageActivity -> Maybe Text -> CustomMessageActivity)
-> Lens
CustomMessageActivity
CustomMessageActivity
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomMessageActivity' {Maybe Text
templateVersion :: Maybe Text
$sel:templateVersion:CustomMessageActivity' :: CustomMessageActivity -> Maybe Text
templateVersion} -> Maybe Text
templateVersion) (\s :: CustomMessageActivity
s@CustomMessageActivity' {} Maybe Text
a -> CustomMessageActivity
s {$sel:templateVersion:CustomMessageActivity' :: Maybe Text
templateVersion = Maybe Text
a} :: CustomMessageActivity)
customMessageActivity_endpointTypes :: Lens.Lens' CustomMessageActivity (Prelude.Maybe [EndpointTypesElement])
customMessageActivity_endpointTypes :: (Maybe [EndpointTypesElement] -> f (Maybe [EndpointTypesElement]))
-> CustomMessageActivity -> f CustomMessageActivity
customMessageActivity_endpointTypes = (CustomMessageActivity -> Maybe [EndpointTypesElement])
-> (CustomMessageActivity
-> Maybe [EndpointTypesElement] -> CustomMessageActivity)
-> Lens
CustomMessageActivity
CustomMessageActivity
(Maybe [EndpointTypesElement])
(Maybe [EndpointTypesElement])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomMessageActivity' {Maybe [EndpointTypesElement]
endpointTypes :: Maybe [EndpointTypesElement]
$sel:endpointTypes:CustomMessageActivity' :: CustomMessageActivity -> Maybe [EndpointTypesElement]
endpointTypes} -> Maybe [EndpointTypesElement]
endpointTypes) (\s :: CustomMessageActivity
s@CustomMessageActivity' {} Maybe [EndpointTypesElement]
a -> CustomMessageActivity
s {$sel:endpointTypes:CustomMessageActivity' :: Maybe [EndpointTypesElement]
endpointTypes = Maybe [EndpointTypesElement]
a} :: CustomMessageActivity) ((Maybe [EndpointTypesElement] -> f (Maybe [EndpointTypesElement]))
-> CustomMessageActivity -> f CustomMessageActivity)
-> ((Maybe [EndpointTypesElement]
-> f (Maybe [EndpointTypesElement]))
-> Maybe [EndpointTypesElement]
-> f (Maybe [EndpointTypesElement]))
-> (Maybe [EndpointTypesElement]
-> f (Maybe [EndpointTypesElement]))
-> CustomMessageActivity
-> f CustomMessageActivity
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[EndpointTypesElement]
[EndpointTypesElement]
[EndpointTypesElement]
[EndpointTypesElement]
-> Iso
(Maybe [EndpointTypesElement])
(Maybe [EndpointTypesElement])
(Maybe [EndpointTypesElement])
(Maybe [EndpointTypesElement])
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
[EndpointTypesElement]
[EndpointTypesElement]
[EndpointTypesElement]
[EndpointTypesElement]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
customMessageActivity_nextActivity :: Lens.Lens' CustomMessageActivity (Prelude.Maybe Prelude.Text)
customMessageActivity_nextActivity :: (Maybe Text -> f (Maybe Text))
-> CustomMessageActivity -> f CustomMessageActivity
customMessageActivity_nextActivity = (CustomMessageActivity -> Maybe Text)
-> (CustomMessageActivity -> Maybe Text -> CustomMessageActivity)
-> Lens
CustomMessageActivity
CustomMessageActivity
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomMessageActivity' {Maybe Text
nextActivity :: Maybe Text
$sel:nextActivity:CustomMessageActivity' :: CustomMessageActivity -> Maybe Text
nextActivity} -> Maybe Text
nextActivity) (\s :: CustomMessageActivity
s@CustomMessageActivity' {} Maybe Text
a -> CustomMessageActivity
s {$sel:nextActivity:CustomMessageActivity' :: Maybe Text
nextActivity = Maybe Text
a} :: CustomMessageActivity)
customMessageActivity_deliveryUri :: Lens.Lens' CustomMessageActivity (Prelude.Maybe Prelude.Text)
customMessageActivity_deliveryUri :: (Maybe Text -> f (Maybe Text))
-> CustomMessageActivity -> f CustomMessageActivity
customMessageActivity_deliveryUri = (CustomMessageActivity -> Maybe Text)
-> (CustomMessageActivity -> Maybe Text -> CustomMessageActivity)
-> Lens
CustomMessageActivity
CustomMessageActivity
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomMessageActivity' {Maybe Text
deliveryUri :: Maybe Text
$sel:deliveryUri:CustomMessageActivity' :: CustomMessageActivity -> Maybe Text
deliveryUri} -> Maybe Text
deliveryUri) (\s :: CustomMessageActivity
s@CustomMessageActivity' {} Maybe Text
a -> CustomMessageActivity
s {$sel:deliveryUri:CustomMessageActivity' :: Maybe Text
deliveryUri = Maybe Text
a} :: CustomMessageActivity)
customMessageActivity_messageConfig :: Lens.Lens' CustomMessageActivity (Prelude.Maybe JourneyCustomMessage)
customMessageActivity_messageConfig :: (Maybe JourneyCustomMessage -> f (Maybe JourneyCustomMessage))
-> CustomMessageActivity -> f CustomMessageActivity
customMessageActivity_messageConfig = (CustomMessageActivity -> Maybe JourneyCustomMessage)
-> (CustomMessageActivity
-> Maybe JourneyCustomMessage -> CustomMessageActivity)
-> Lens
CustomMessageActivity
CustomMessageActivity
(Maybe JourneyCustomMessage)
(Maybe JourneyCustomMessage)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomMessageActivity' {Maybe JourneyCustomMessage
messageConfig :: Maybe JourneyCustomMessage
$sel:messageConfig:CustomMessageActivity' :: CustomMessageActivity -> Maybe JourneyCustomMessage
messageConfig} -> Maybe JourneyCustomMessage
messageConfig) (\s :: CustomMessageActivity
s@CustomMessageActivity' {} Maybe JourneyCustomMessage
a -> CustomMessageActivity
s {$sel:messageConfig:CustomMessageActivity' :: Maybe JourneyCustomMessage
messageConfig = Maybe JourneyCustomMessage
a} :: CustomMessageActivity)
instance Core.FromJSON CustomMessageActivity where
parseJSON :: Value -> Parser CustomMessageActivity
parseJSON =
String
-> (Object -> Parser CustomMessageActivity)
-> Value
-> Parser CustomMessageActivity
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CustomMessageActivity"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe [EndpointTypesElement]
-> Maybe Text
-> Maybe Text
-> Maybe JourneyCustomMessage
-> CustomMessageActivity
CustomMessageActivity'
(Maybe Text
-> Maybe Text
-> Maybe [EndpointTypesElement]
-> Maybe Text
-> Maybe Text
-> Maybe JourneyCustomMessage
-> CustomMessageActivity)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe [EndpointTypesElement]
-> Maybe Text
-> Maybe Text
-> Maybe JourneyCustomMessage
-> CustomMessageActivity)
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 [EndpointTypesElement]
-> Maybe Text
-> Maybe Text
-> Maybe JourneyCustomMessage
-> CustomMessageActivity)
-> Parser (Maybe Text)
-> Parser
(Maybe [EndpointTypesElement]
-> Maybe Text
-> Maybe Text
-> Maybe JourneyCustomMessage
-> CustomMessageActivity)
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 [EndpointTypesElement]
-> Maybe Text
-> Maybe Text
-> Maybe JourneyCustomMessage
-> CustomMessageActivity)
-> Parser (Maybe [EndpointTypesElement])
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe JourneyCustomMessage
-> CustomMessageActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [EndpointTypesElement]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EndpointTypes" Parser (Maybe (Maybe [EndpointTypesElement]))
-> Maybe [EndpointTypesElement]
-> Parser (Maybe [EndpointTypesElement])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [EndpointTypesElement]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text
-> Maybe Text
-> Maybe JourneyCustomMessage
-> CustomMessageActivity)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe JourneyCustomMessage -> CustomMessageActivity)
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 Text -> Maybe JourneyCustomMessage -> CustomMessageActivity)
-> Parser (Maybe Text)
-> Parser (Maybe JourneyCustomMessage -> CustomMessageActivity)
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
"DeliveryUri")
Parser (Maybe JourneyCustomMessage -> CustomMessageActivity)
-> Parser (Maybe JourneyCustomMessage)
-> Parser CustomMessageActivity
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JourneyCustomMessage)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MessageConfig")
)
instance Prelude.Hashable CustomMessageActivity
instance Prelude.NFData CustomMessageActivity
instance Core.ToJSON CustomMessageActivity where
toJSON :: CustomMessageActivity -> Value
toJSON CustomMessageActivity' {Maybe [EndpointTypesElement]
Maybe Text
Maybe JourneyCustomMessage
messageConfig :: Maybe JourneyCustomMessage
deliveryUri :: Maybe Text
nextActivity :: Maybe Text
endpointTypes :: Maybe [EndpointTypesElement]
templateVersion :: Maybe Text
templateName :: Maybe Text
$sel:messageConfig:CustomMessageActivity' :: CustomMessageActivity -> Maybe JourneyCustomMessage
$sel:deliveryUri:CustomMessageActivity' :: CustomMessageActivity -> Maybe Text
$sel:nextActivity:CustomMessageActivity' :: CustomMessageActivity -> Maybe Text
$sel:endpointTypes:CustomMessageActivity' :: CustomMessageActivity -> Maybe [EndpointTypesElement]
$sel:templateVersion:CustomMessageActivity' :: CustomMessageActivity -> Maybe Text
$sel:templateName:CustomMessageActivity' :: CustomMessageActivity -> 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
"EndpointTypes" Text -> [EndpointTypesElement] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([EndpointTypesElement] -> Pair)
-> Maybe [EndpointTypesElement] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [EndpointTypesElement]
endpointTypes,
(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
"DeliveryUri" 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
deliveryUri,
(Text
"MessageConfig" Text -> JourneyCustomMessage -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (JourneyCustomMessage -> Pair)
-> Maybe JourneyCustomMessage -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe JourneyCustomMessage
messageConfig
]
)