{-# 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.InAppMessageCampaign where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.InAppCampaignSchedule
import Amazonka.Pinpoint.Types.InAppMessage
import qualified Amazonka.Prelude as Prelude
data InAppMessageCampaign = InAppMessageCampaign'
{
InAppMessageCampaign -> Maybe Int
sessionCap :: Prelude.Maybe Prelude.Int,
InAppMessageCampaign -> Maybe Int
priority :: Prelude.Maybe Prelude.Int,
InAppMessageCampaign -> Maybe InAppCampaignSchedule
schedule :: Prelude.Maybe InAppCampaignSchedule,
InAppMessageCampaign -> Maybe Text
campaignId :: Prelude.Maybe Prelude.Text,
InAppMessageCampaign -> Maybe Text
treatmentId :: Prelude.Maybe Prelude.Text,
InAppMessageCampaign -> Maybe InAppMessage
inAppMessage :: Prelude.Maybe InAppMessage,
InAppMessageCampaign -> Maybe Int
totalCap :: Prelude.Maybe Prelude.Int,
InAppMessageCampaign -> Maybe Int
dailyCap :: Prelude.Maybe Prelude.Int
}
deriving (InAppMessageCampaign -> InAppMessageCampaign -> Bool
(InAppMessageCampaign -> InAppMessageCampaign -> Bool)
-> (InAppMessageCampaign -> InAppMessageCampaign -> Bool)
-> Eq InAppMessageCampaign
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InAppMessageCampaign -> InAppMessageCampaign -> Bool
$c/= :: InAppMessageCampaign -> InAppMessageCampaign -> Bool
== :: InAppMessageCampaign -> InAppMessageCampaign -> Bool
$c== :: InAppMessageCampaign -> InAppMessageCampaign -> Bool
Prelude.Eq, ReadPrec [InAppMessageCampaign]
ReadPrec InAppMessageCampaign
Int -> ReadS InAppMessageCampaign
ReadS [InAppMessageCampaign]
(Int -> ReadS InAppMessageCampaign)
-> ReadS [InAppMessageCampaign]
-> ReadPrec InAppMessageCampaign
-> ReadPrec [InAppMessageCampaign]
-> Read InAppMessageCampaign
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InAppMessageCampaign]
$creadListPrec :: ReadPrec [InAppMessageCampaign]
readPrec :: ReadPrec InAppMessageCampaign
$creadPrec :: ReadPrec InAppMessageCampaign
readList :: ReadS [InAppMessageCampaign]
$creadList :: ReadS [InAppMessageCampaign]
readsPrec :: Int -> ReadS InAppMessageCampaign
$creadsPrec :: Int -> ReadS InAppMessageCampaign
Prelude.Read, Int -> InAppMessageCampaign -> ShowS
[InAppMessageCampaign] -> ShowS
InAppMessageCampaign -> String
(Int -> InAppMessageCampaign -> ShowS)
-> (InAppMessageCampaign -> String)
-> ([InAppMessageCampaign] -> ShowS)
-> Show InAppMessageCampaign
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InAppMessageCampaign] -> ShowS
$cshowList :: [InAppMessageCampaign] -> ShowS
show :: InAppMessageCampaign -> String
$cshow :: InAppMessageCampaign -> String
showsPrec :: Int -> InAppMessageCampaign -> ShowS
$cshowsPrec :: Int -> InAppMessageCampaign -> ShowS
Prelude.Show, (forall x. InAppMessageCampaign -> Rep InAppMessageCampaign x)
-> (forall x. Rep InAppMessageCampaign x -> InAppMessageCampaign)
-> Generic InAppMessageCampaign
forall x. Rep InAppMessageCampaign x -> InAppMessageCampaign
forall x. InAppMessageCampaign -> Rep InAppMessageCampaign x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InAppMessageCampaign x -> InAppMessageCampaign
$cfrom :: forall x. InAppMessageCampaign -> Rep InAppMessageCampaign x
Prelude.Generic)
newInAppMessageCampaign ::
InAppMessageCampaign
newInAppMessageCampaign :: InAppMessageCampaign
newInAppMessageCampaign =
InAppMessageCampaign' :: Maybe Int
-> Maybe Int
-> Maybe InAppCampaignSchedule
-> Maybe Text
-> Maybe Text
-> Maybe InAppMessage
-> Maybe Int
-> Maybe Int
-> InAppMessageCampaign
InAppMessageCampaign'
{ $sel:sessionCap:InAppMessageCampaign' :: Maybe Int
sessionCap = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:priority:InAppMessageCampaign' :: Maybe Int
priority = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:schedule:InAppMessageCampaign' :: Maybe InAppCampaignSchedule
schedule = Maybe InAppCampaignSchedule
forall a. Maybe a
Prelude.Nothing,
$sel:campaignId:InAppMessageCampaign' :: Maybe Text
campaignId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:treatmentId:InAppMessageCampaign' :: Maybe Text
treatmentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:inAppMessage:InAppMessageCampaign' :: Maybe InAppMessage
inAppMessage = Maybe InAppMessage
forall a. Maybe a
Prelude.Nothing,
$sel:totalCap:InAppMessageCampaign' :: Maybe Int
totalCap = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:dailyCap:InAppMessageCampaign' :: Maybe Int
dailyCap = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
inAppMessageCampaign_sessionCap :: Lens.Lens' InAppMessageCampaign (Prelude.Maybe Prelude.Int)
inAppMessageCampaign_sessionCap :: (Maybe Int -> f (Maybe Int))
-> InAppMessageCampaign -> f InAppMessageCampaign
inAppMessageCampaign_sessionCap = (InAppMessageCampaign -> Maybe Int)
-> (InAppMessageCampaign -> Maybe Int -> InAppMessageCampaign)
-> Lens
InAppMessageCampaign InAppMessageCampaign (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InAppMessageCampaign' {Maybe Int
sessionCap :: Maybe Int
$sel:sessionCap:InAppMessageCampaign' :: InAppMessageCampaign -> Maybe Int
sessionCap} -> Maybe Int
sessionCap) (\s :: InAppMessageCampaign
s@InAppMessageCampaign' {} Maybe Int
a -> InAppMessageCampaign
s {$sel:sessionCap:InAppMessageCampaign' :: Maybe Int
sessionCap = Maybe Int
a} :: InAppMessageCampaign)
inAppMessageCampaign_priority :: Lens.Lens' InAppMessageCampaign (Prelude.Maybe Prelude.Int)
inAppMessageCampaign_priority :: (Maybe Int -> f (Maybe Int))
-> InAppMessageCampaign -> f InAppMessageCampaign
inAppMessageCampaign_priority = (InAppMessageCampaign -> Maybe Int)
-> (InAppMessageCampaign -> Maybe Int -> InAppMessageCampaign)
-> Lens
InAppMessageCampaign InAppMessageCampaign (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InAppMessageCampaign' {Maybe Int
priority :: Maybe Int
$sel:priority:InAppMessageCampaign' :: InAppMessageCampaign -> Maybe Int
priority} -> Maybe Int
priority) (\s :: InAppMessageCampaign
s@InAppMessageCampaign' {} Maybe Int
a -> InAppMessageCampaign
s {$sel:priority:InAppMessageCampaign' :: Maybe Int
priority = Maybe Int
a} :: InAppMessageCampaign)
inAppMessageCampaign_schedule :: Lens.Lens' InAppMessageCampaign (Prelude.Maybe InAppCampaignSchedule)
inAppMessageCampaign_schedule :: (Maybe InAppCampaignSchedule -> f (Maybe InAppCampaignSchedule))
-> InAppMessageCampaign -> f InAppMessageCampaign
inAppMessageCampaign_schedule = (InAppMessageCampaign -> Maybe InAppCampaignSchedule)
-> (InAppMessageCampaign
-> Maybe InAppCampaignSchedule -> InAppMessageCampaign)
-> Lens
InAppMessageCampaign
InAppMessageCampaign
(Maybe InAppCampaignSchedule)
(Maybe InAppCampaignSchedule)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InAppMessageCampaign' {Maybe InAppCampaignSchedule
schedule :: Maybe InAppCampaignSchedule
$sel:schedule:InAppMessageCampaign' :: InAppMessageCampaign -> Maybe InAppCampaignSchedule
schedule} -> Maybe InAppCampaignSchedule
schedule) (\s :: InAppMessageCampaign
s@InAppMessageCampaign' {} Maybe InAppCampaignSchedule
a -> InAppMessageCampaign
s {$sel:schedule:InAppMessageCampaign' :: Maybe InAppCampaignSchedule
schedule = Maybe InAppCampaignSchedule
a} :: InAppMessageCampaign)
inAppMessageCampaign_campaignId :: Lens.Lens' InAppMessageCampaign (Prelude.Maybe Prelude.Text)
inAppMessageCampaign_campaignId :: (Maybe Text -> f (Maybe Text))
-> InAppMessageCampaign -> f InAppMessageCampaign
inAppMessageCampaign_campaignId = (InAppMessageCampaign -> Maybe Text)
-> (InAppMessageCampaign -> Maybe Text -> InAppMessageCampaign)
-> Lens
InAppMessageCampaign InAppMessageCampaign (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InAppMessageCampaign' {Maybe Text
campaignId :: Maybe Text
$sel:campaignId:InAppMessageCampaign' :: InAppMessageCampaign -> Maybe Text
campaignId} -> Maybe Text
campaignId) (\s :: InAppMessageCampaign
s@InAppMessageCampaign' {} Maybe Text
a -> InAppMessageCampaign
s {$sel:campaignId:InAppMessageCampaign' :: Maybe Text
campaignId = Maybe Text
a} :: InAppMessageCampaign)
inAppMessageCampaign_treatmentId :: Lens.Lens' InAppMessageCampaign (Prelude.Maybe Prelude.Text)
inAppMessageCampaign_treatmentId :: (Maybe Text -> f (Maybe Text))
-> InAppMessageCampaign -> f InAppMessageCampaign
inAppMessageCampaign_treatmentId = (InAppMessageCampaign -> Maybe Text)
-> (InAppMessageCampaign -> Maybe Text -> InAppMessageCampaign)
-> Lens
InAppMessageCampaign InAppMessageCampaign (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InAppMessageCampaign' {Maybe Text
treatmentId :: Maybe Text
$sel:treatmentId:InAppMessageCampaign' :: InAppMessageCampaign -> Maybe Text
treatmentId} -> Maybe Text
treatmentId) (\s :: InAppMessageCampaign
s@InAppMessageCampaign' {} Maybe Text
a -> InAppMessageCampaign
s {$sel:treatmentId:InAppMessageCampaign' :: Maybe Text
treatmentId = Maybe Text
a} :: InAppMessageCampaign)
inAppMessageCampaign_inAppMessage :: Lens.Lens' InAppMessageCampaign (Prelude.Maybe InAppMessage)
inAppMessageCampaign_inAppMessage :: (Maybe InAppMessage -> f (Maybe InAppMessage))
-> InAppMessageCampaign -> f InAppMessageCampaign
inAppMessageCampaign_inAppMessage = (InAppMessageCampaign -> Maybe InAppMessage)
-> (InAppMessageCampaign
-> Maybe InAppMessage -> InAppMessageCampaign)
-> Lens
InAppMessageCampaign
InAppMessageCampaign
(Maybe InAppMessage)
(Maybe InAppMessage)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InAppMessageCampaign' {Maybe InAppMessage
inAppMessage :: Maybe InAppMessage
$sel:inAppMessage:InAppMessageCampaign' :: InAppMessageCampaign -> Maybe InAppMessage
inAppMessage} -> Maybe InAppMessage
inAppMessage) (\s :: InAppMessageCampaign
s@InAppMessageCampaign' {} Maybe InAppMessage
a -> InAppMessageCampaign
s {$sel:inAppMessage:InAppMessageCampaign' :: Maybe InAppMessage
inAppMessage = Maybe InAppMessage
a} :: InAppMessageCampaign)
inAppMessageCampaign_totalCap :: Lens.Lens' InAppMessageCampaign (Prelude.Maybe Prelude.Int)
inAppMessageCampaign_totalCap :: (Maybe Int -> f (Maybe Int))
-> InAppMessageCampaign -> f InAppMessageCampaign
inAppMessageCampaign_totalCap = (InAppMessageCampaign -> Maybe Int)
-> (InAppMessageCampaign -> Maybe Int -> InAppMessageCampaign)
-> Lens
InAppMessageCampaign InAppMessageCampaign (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InAppMessageCampaign' {Maybe Int
totalCap :: Maybe Int
$sel:totalCap:InAppMessageCampaign' :: InAppMessageCampaign -> Maybe Int
totalCap} -> Maybe Int
totalCap) (\s :: InAppMessageCampaign
s@InAppMessageCampaign' {} Maybe Int
a -> InAppMessageCampaign
s {$sel:totalCap:InAppMessageCampaign' :: Maybe Int
totalCap = Maybe Int
a} :: InAppMessageCampaign)
inAppMessageCampaign_dailyCap :: Lens.Lens' InAppMessageCampaign (Prelude.Maybe Prelude.Int)
inAppMessageCampaign_dailyCap :: (Maybe Int -> f (Maybe Int))
-> InAppMessageCampaign -> f InAppMessageCampaign
inAppMessageCampaign_dailyCap = (InAppMessageCampaign -> Maybe Int)
-> (InAppMessageCampaign -> Maybe Int -> InAppMessageCampaign)
-> Lens
InAppMessageCampaign InAppMessageCampaign (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InAppMessageCampaign' {Maybe Int
dailyCap :: Maybe Int
$sel:dailyCap:InAppMessageCampaign' :: InAppMessageCampaign -> Maybe Int
dailyCap} -> Maybe Int
dailyCap) (\s :: InAppMessageCampaign
s@InAppMessageCampaign' {} Maybe Int
a -> InAppMessageCampaign
s {$sel:dailyCap:InAppMessageCampaign' :: Maybe Int
dailyCap = Maybe Int
a} :: InAppMessageCampaign)
instance Core.FromJSON InAppMessageCampaign where
parseJSON :: Value -> Parser InAppMessageCampaign
parseJSON =
String
-> (Object -> Parser InAppMessageCampaign)
-> Value
-> Parser InAppMessageCampaign
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InAppMessageCampaign"
( \Object
x ->
Maybe Int
-> Maybe Int
-> Maybe InAppCampaignSchedule
-> Maybe Text
-> Maybe Text
-> Maybe InAppMessage
-> Maybe Int
-> Maybe Int
-> InAppMessageCampaign
InAppMessageCampaign'
(Maybe Int
-> Maybe Int
-> Maybe InAppCampaignSchedule
-> Maybe Text
-> Maybe Text
-> Maybe InAppMessage
-> Maybe Int
-> Maybe Int
-> InAppMessageCampaign)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Maybe InAppCampaignSchedule
-> Maybe Text
-> Maybe Text
-> Maybe InAppMessage
-> Maybe Int
-> Maybe Int
-> InAppMessageCampaign)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SessionCap")
Parser
(Maybe Int
-> Maybe InAppCampaignSchedule
-> Maybe Text
-> Maybe Text
-> Maybe InAppMessage
-> Maybe Int
-> Maybe Int
-> InAppMessageCampaign)
-> Parser (Maybe Int)
-> Parser
(Maybe InAppCampaignSchedule
-> Maybe Text
-> Maybe Text
-> Maybe InAppMessage
-> Maybe Int
-> Maybe Int
-> InAppMessageCampaign)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Priority")
Parser
(Maybe InAppCampaignSchedule
-> Maybe Text
-> Maybe Text
-> Maybe InAppMessage
-> Maybe Int
-> Maybe Int
-> InAppMessageCampaign)
-> Parser (Maybe InAppCampaignSchedule)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe InAppMessage
-> Maybe Int
-> Maybe Int
-> InAppMessageCampaign)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InAppCampaignSchedule)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Schedule")
Parser
(Maybe Text
-> Maybe Text
-> Maybe InAppMessage
-> Maybe Int
-> Maybe Int
-> InAppMessageCampaign)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe InAppMessage
-> Maybe Int
-> Maybe Int
-> InAppMessageCampaign)
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
"CampaignId")
Parser
(Maybe Text
-> Maybe InAppMessage
-> Maybe Int
-> Maybe Int
-> InAppMessageCampaign)
-> Parser (Maybe Text)
-> Parser
(Maybe InAppMessage
-> Maybe Int -> Maybe Int -> InAppMessageCampaign)
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
"TreatmentId")
Parser
(Maybe InAppMessage
-> Maybe Int -> Maybe Int -> InAppMessageCampaign)
-> Parser (Maybe InAppMessage)
-> Parser (Maybe Int -> Maybe Int -> InAppMessageCampaign)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InAppMessage)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InAppMessage")
Parser (Maybe Int -> Maybe Int -> InAppMessageCampaign)
-> Parser (Maybe Int) -> Parser (Maybe Int -> InAppMessageCampaign)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TotalCap")
Parser (Maybe Int -> InAppMessageCampaign)
-> Parser (Maybe Int) -> Parser InAppMessageCampaign
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DailyCap")
)
instance Prelude.Hashable InAppMessageCampaign
instance Prelude.NFData InAppMessageCampaign