{-# 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.InAppCampaignSchedule where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.CampaignEventFilter
import Amazonka.Pinpoint.Types.QuietTime
import qualified Amazonka.Prelude as Prelude
data InAppCampaignSchedule = InAppCampaignSchedule'
{
InAppCampaignSchedule -> Maybe Text
endDate :: Prelude.Maybe Prelude.Text,
InAppCampaignSchedule -> Maybe QuietTime
quietTime :: Prelude.Maybe QuietTime,
InAppCampaignSchedule -> Maybe CampaignEventFilter
eventFilter :: Prelude.Maybe CampaignEventFilter
}
deriving (InAppCampaignSchedule -> InAppCampaignSchedule -> Bool
(InAppCampaignSchedule -> InAppCampaignSchedule -> Bool)
-> (InAppCampaignSchedule -> InAppCampaignSchedule -> Bool)
-> Eq InAppCampaignSchedule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InAppCampaignSchedule -> InAppCampaignSchedule -> Bool
$c/= :: InAppCampaignSchedule -> InAppCampaignSchedule -> Bool
== :: InAppCampaignSchedule -> InAppCampaignSchedule -> Bool
$c== :: InAppCampaignSchedule -> InAppCampaignSchedule -> Bool
Prelude.Eq, ReadPrec [InAppCampaignSchedule]
ReadPrec InAppCampaignSchedule
Int -> ReadS InAppCampaignSchedule
ReadS [InAppCampaignSchedule]
(Int -> ReadS InAppCampaignSchedule)
-> ReadS [InAppCampaignSchedule]
-> ReadPrec InAppCampaignSchedule
-> ReadPrec [InAppCampaignSchedule]
-> Read InAppCampaignSchedule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InAppCampaignSchedule]
$creadListPrec :: ReadPrec [InAppCampaignSchedule]
readPrec :: ReadPrec InAppCampaignSchedule
$creadPrec :: ReadPrec InAppCampaignSchedule
readList :: ReadS [InAppCampaignSchedule]
$creadList :: ReadS [InAppCampaignSchedule]
readsPrec :: Int -> ReadS InAppCampaignSchedule
$creadsPrec :: Int -> ReadS InAppCampaignSchedule
Prelude.Read, Int -> InAppCampaignSchedule -> ShowS
[InAppCampaignSchedule] -> ShowS
InAppCampaignSchedule -> String
(Int -> InAppCampaignSchedule -> ShowS)
-> (InAppCampaignSchedule -> String)
-> ([InAppCampaignSchedule] -> ShowS)
-> Show InAppCampaignSchedule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InAppCampaignSchedule] -> ShowS
$cshowList :: [InAppCampaignSchedule] -> ShowS
show :: InAppCampaignSchedule -> String
$cshow :: InAppCampaignSchedule -> String
showsPrec :: Int -> InAppCampaignSchedule -> ShowS
$cshowsPrec :: Int -> InAppCampaignSchedule -> ShowS
Prelude.Show, (forall x. InAppCampaignSchedule -> Rep InAppCampaignSchedule x)
-> (forall x. Rep InAppCampaignSchedule x -> InAppCampaignSchedule)
-> Generic InAppCampaignSchedule
forall x. Rep InAppCampaignSchedule x -> InAppCampaignSchedule
forall x. InAppCampaignSchedule -> Rep InAppCampaignSchedule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InAppCampaignSchedule x -> InAppCampaignSchedule
$cfrom :: forall x. InAppCampaignSchedule -> Rep InAppCampaignSchedule x
Prelude.Generic)
newInAppCampaignSchedule ::
InAppCampaignSchedule
newInAppCampaignSchedule :: InAppCampaignSchedule
newInAppCampaignSchedule =
InAppCampaignSchedule' :: Maybe Text
-> Maybe QuietTime
-> Maybe CampaignEventFilter
-> InAppCampaignSchedule
InAppCampaignSchedule'
{ $sel:endDate:InAppCampaignSchedule' :: Maybe Text
endDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:quietTime:InAppCampaignSchedule' :: Maybe QuietTime
quietTime = Maybe QuietTime
forall a. Maybe a
Prelude.Nothing,
$sel:eventFilter:InAppCampaignSchedule' :: Maybe CampaignEventFilter
eventFilter = Maybe CampaignEventFilter
forall a. Maybe a
Prelude.Nothing
}
inAppCampaignSchedule_endDate :: Lens.Lens' InAppCampaignSchedule (Prelude.Maybe Prelude.Text)
inAppCampaignSchedule_endDate :: (Maybe Text -> f (Maybe Text))
-> InAppCampaignSchedule -> f InAppCampaignSchedule
inAppCampaignSchedule_endDate = (InAppCampaignSchedule -> Maybe Text)
-> (InAppCampaignSchedule -> Maybe Text -> InAppCampaignSchedule)
-> Lens
InAppCampaignSchedule
InAppCampaignSchedule
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InAppCampaignSchedule' {Maybe Text
endDate :: Maybe Text
$sel:endDate:InAppCampaignSchedule' :: InAppCampaignSchedule -> Maybe Text
endDate} -> Maybe Text
endDate) (\s :: InAppCampaignSchedule
s@InAppCampaignSchedule' {} Maybe Text
a -> InAppCampaignSchedule
s {$sel:endDate:InAppCampaignSchedule' :: Maybe Text
endDate = Maybe Text
a} :: InAppCampaignSchedule)
inAppCampaignSchedule_quietTime :: Lens.Lens' InAppCampaignSchedule (Prelude.Maybe QuietTime)
inAppCampaignSchedule_quietTime :: (Maybe QuietTime -> f (Maybe QuietTime))
-> InAppCampaignSchedule -> f InAppCampaignSchedule
inAppCampaignSchedule_quietTime = (InAppCampaignSchedule -> Maybe QuietTime)
-> (InAppCampaignSchedule
-> Maybe QuietTime -> InAppCampaignSchedule)
-> Lens
InAppCampaignSchedule
InAppCampaignSchedule
(Maybe QuietTime)
(Maybe QuietTime)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InAppCampaignSchedule' {Maybe QuietTime
quietTime :: Maybe QuietTime
$sel:quietTime:InAppCampaignSchedule' :: InAppCampaignSchedule -> Maybe QuietTime
quietTime} -> Maybe QuietTime
quietTime) (\s :: InAppCampaignSchedule
s@InAppCampaignSchedule' {} Maybe QuietTime
a -> InAppCampaignSchedule
s {$sel:quietTime:InAppCampaignSchedule' :: Maybe QuietTime
quietTime = Maybe QuietTime
a} :: InAppCampaignSchedule)
inAppCampaignSchedule_eventFilter :: Lens.Lens' InAppCampaignSchedule (Prelude.Maybe CampaignEventFilter)
inAppCampaignSchedule_eventFilter :: (Maybe CampaignEventFilter -> f (Maybe CampaignEventFilter))
-> InAppCampaignSchedule -> f InAppCampaignSchedule
inAppCampaignSchedule_eventFilter = (InAppCampaignSchedule -> Maybe CampaignEventFilter)
-> (InAppCampaignSchedule
-> Maybe CampaignEventFilter -> InAppCampaignSchedule)
-> Lens
InAppCampaignSchedule
InAppCampaignSchedule
(Maybe CampaignEventFilter)
(Maybe CampaignEventFilter)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InAppCampaignSchedule' {Maybe CampaignEventFilter
eventFilter :: Maybe CampaignEventFilter
$sel:eventFilter:InAppCampaignSchedule' :: InAppCampaignSchedule -> Maybe CampaignEventFilter
eventFilter} -> Maybe CampaignEventFilter
eventFilter) (\s :: InAppCampaignSchedule
s@InAppCampaignSchedule' {} Maybe CampaignEventFilter
a -> InAppCampaignSchedule
s {$sel:eventFilter:InAppCampaignSchedule' :: Maybe CampaignEventFilter
eventFilter = Maybe CampaignEventFilter
a} :: InAppCampaignSchedule)
instance Core.FromJSON InAppCampaignSchedule where
parseJSON :: Value -> Parser InAppCampaignSchedule
parseJSON =
String
-> (Object -> Parser InAppCampaignSchedule)
-> Value
-> Parser InAppCampaignSchedule
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InAppCampaignSchedule"
( \Object
x ->
Maybe Text
-> Maybe QuietTime
-> Maybe CampaignEventFilter
-> InAppCampaignSchedule
InAppCampaignSchedule'
(Maybe Text
-> Maybe QuietTime
-> Maybe CampaignEventFilter
-> InAppCampaignSchedule)
-> Parser (Maybe Text)
-> Parser
(Maybe QuietTime
-> Maybe CampaignEventFilter -> InAppCampaignSchedule)
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
"EndDate")
Parser
(Maybe QuietTime
-> Maybe CampaignEventFilter -> InAppCampaignSchedule)
-> Parser (Maybe QuietTime)
-> Parser (Maybe CampaignEventFilter -> InAppCampaignSchedule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe QuietTime)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"QuietTime")
Parser (Maybe CampaignEventFilter -> InAppCampaignSchedule)
-> Parser (Maybe CampaignEventFilter)
-> Parser InAppCampaignSchedule
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CampaignEventFilter)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EventFilter")
)
instance Prelude.Hashable InAppCampaignSchedule
instance Prelude.NFData InAppCampaignSchedule