{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 CampaignEventFilter
eventFilter :: Prelude.Maybe CampaignEventFilter,
InAppCampaignSchedule -> Maybe QuietTime
quietTime :: Prelude.Maybe QuietTime
}
deriving (InAppCampaignSchedule -> InAppCampaignSchedule -> Bool
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]
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
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. 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'
{ $sel:endDate:InAppCampaignSchedule' :: Maybe Text
endDate = forall a. Maybe a
Prelude.Nothing,
$sel:eventFilter:InAppCampaignSchedule' :: Maybe CampaignEventFilter
eventFilter = forall a. Maybe a
Prelude.Nothing,
$sel:quietTime:InAppCampaignSchedule' :: Maybe QuietTime
quietTime = forall a. Maybe a
Prelude.Nothing
}
inAppCampaignSchedule_endDate :: Lens.Lens' InAppCampaignSchedule (Prelude.Maybe Prelude.Text)
inAppCampaignSchedule_endDate :: Lens' InAppCampaignSchedule (Maybe Text)
inAppCampaignSchedule_endDate = 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_eventFilter :: Lens.Lens' InAppCampaignSchedule (Prelude.Maybe CampaignEventFilter)
inAppCampaignSchedule_eventFilter :: Lens' InAppCampaignSchedule (Maybe CampaignEventFilter)
inAppCampaignSchedule_eventFilter = 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)
inAppCampaignSchedule_quietTime :: Lens.Lens' InAppCampaignSchedule (Prelude.Maybe QuietTime)
inAppCampaignSchedule_quietTime :: Lens' InAppCampaignSchedule (Maybe QuietTime)
inAppCampaignSchedule_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)
instance Data.FromJSON InAppCampaignSchedule where
parseJSON :: Value -> Parser InAppCampaignSchedule
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"InAppCampaignSchedule"
( \Object
x ->
Maybe Text
-> Maybe CampaignEventFilter
-> Maybe QuietTime
-> InAppCampaignSchedule
InAppCampaignSchedule'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"EndDate")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"EventFilter")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"QuietTime")
)
instance Prelude.Hashable InAppCampaignSchedule where
hashWithSalt :: Int -> InAppCampaignSchedule -> Int
hashWithSalt Int
_salt InAppCampaignSchedule' {Maybe Text
Maybe QuietTime
Maybe CampaignEventFilter
quietTime :: Maybe QuietTime
eventFilter :: Maybe CampaignEventFilter
endDate :: Maybe Text
$sel:quietTime:InAppCampaignSchedule' :: InAppCampaignSchedule -> Maybe QuietTime
$sel:eventFilter:InAppCampaignSchedule' :: InAppCampaignSchedule -> Maybe CampaignEventFilter
$sel:endDate:InAppCampaignSchedule' :: InAppCampaignSchedule -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
endDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CampaignEventFilter
eventFilter
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe QuietTime
quietTime
instance Prelude.NFData InAppCampaignSchedule where
rnf :: InAppCampaignSchedule -> ()
rnf InAppCampaignSchedule' {Maybe Text
Maybe QuietTime
Maybe CampaignEventFilter
quietTime :: Maybe QuietTime
eventFilter :: Maybe CampaignEventFilter
endDate :: Maybe Text
$sel:quietTime:InAppCampaignSchedule' :: InAppCampaignSchedule -> Maybe QuietTime
$sel:eventFilter:InAppCampaignSchedule' :: InAppCampaignSchedule -> Maybe CampaignEventFilter
$sel:endDate:InAppCampaignSchedule' :: InAppCampaignSchedule -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
endDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CampaignEventFilter
eventFilter
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe QuietTime
quietTime