{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Pinpoint.Types.Schedule
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Pinpoint.Types.Schedule where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.CampaignEventFilter
import Amazonka.Pinpoint.Types.Frequency
import Amazonka.Pinpoint.Types.QuietTime
import qualified Amazonka.Prelude as Prelude

-- | Specifies the schedule settings for a campaign.
--
-- /See:/ 'newSchedule' smart constructor.
data Schedule = Schedule'
  { -- | Specifies how often the campaign is sent or whether the campaign is sent
    -- in response to a specific event.
    Schedule -> Maybe Frequency
frequency :: Prelude.Maybe Frequency,
    -- | The default quiet time for the campaign. Quiet time is a specific time
    -- range when a campaign doesn\'t send messages to endpoints, if all the
    -- following conditions are met:
    --
    -- -   The EndpointDemographic.Timezone property of the endpoint is set to
    --     a valid value.
    --
    -- -   The current time in the endpoint\'s time zone is later than or equal
    --     to the time specified by the QuietTime.Start property for the
    --     campaign.
    --
    -- -   The current time in the endpoint\'s time zone is earlier than or
    --     equal to the time specified by the QuietTime.End property for the
    --     campaign.
    --
    -- If any of the preceding conditions isn\'t met, the endpoint will receive
    -- messages from the campaign, even if quiet time is enabled.
    Schedule -> Maybe QuietTime
quietTime :: Prelude.Maybe QuietTime,
    -- | The type of event that causes the campaign to be sent, if the value of
    -- the Frequency property is EVENT.
    Schedule -> Maybe CampaignEventFilter
eventFilter :: Prelude.Maybe CampaignEventFilter,
    -- | Specifies whether the start and end times for the campaign schedule use
    -- each recipient\'s local time. To base the schedule on each recipient\'s
    -- local time, set this value to true.
    Schedule -> Maybe Bool
isLocalTime :: Prelude.Maybe Prelude.Bool,
    -- | The scheduled time, in ISO 8601 format, when the campaign ended or will
    -- end.
    Schedule -> Maybe Text
endTime :: Prelude.Maybe Prelude.Text,
    -- | The starting UTC offset for the campaign schedule, if the value of the
    -- IsLocalTime property is true. Valid values are: UTC, UTC+01, UTC+02,
    -- UTC+03, UTC+03:30, UTC+04, UTC+04:30, UTC+05, UTC+05:30, UTC+05:45,
    -- UTC+06, UTC+06:30, UTC+07, UTC+08, UTC+09, UTC+09:30, UTC+10, UTC+10:30,
    -- UTC+11, UTC+12, UTC+13, UTC-02, UTC-03, UTC-04, UTC-05, UTC-06, UTC-07,
    -- UTC-08, UTC-09, UTC-10, and UTC-11.
    Schedule -> Maybe Text
timezone :: Prelude.Maybe Prelude.Text,
    -- | The scheduled time when the campaign began or will begin. Valid values
    -- are: IMMEDIATE, to start the campaign immediately; or, a specific time
    -- in ISO 8601 format.
    Schedule -> Text
startTime :: Prelude.Text
  }
  deriving (Schedule -> Schedule -> Bool
(Schedule -> Schedule -> Bool)
-> (Schedule -> Schedule -> Bool) -> Eq Schedule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Schedule -> Schedule -> Bool
$c/= :: Schedule -> Schedule -> Bool
== :: Schedule -> Schedule -> Bool
$c== :: Schedule -> Schedule -> Bool
Prelude.Eq, ReadPrec [Schedule]
ReadPrec Schedule
Int -> ReadS Schedule
ReadS [Schedule]
(Int -> ReadS Schedule)
-> ReadS [Schedule]
-> ReadPrec Schedule
-> ReadPrec [Schedule]
-> Read Schedule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Schedule]
$creadListPrec :: ReadPrec [Schedule]
readPrec :: ReadPrec Schedule
$creadPrec :: ReadPrec Schedule
readList :: ReadS [Schedule]
$creadList :: ReadS [Schedule]
readsPrec :: Int -> ReadS Schedule
$creadsPrec :: Int -> ReadS Schedule
Prelude.Read, Int -> Schedule -> ShowS
[Schedule] -> ShowS
Schedule -> String
(Int -> Schedule -> ShowS)
-> (Schedule -> String) -> ([Schedule] -> ShowS) -> Show Schedule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Schedule] -> ShowS
$cshowList :: [Schedule] -> ShowS
show :: Schedule -> String
$cshow :: Schedule -> String
showsPrec :: Int -> Schedule -> ShowS
$cshowsPrec :: Int -> Schedule -> ShowS
Prelude.Show, (forall x. Schedule -> Rep Schedule x)
-> (forall x. Rep Schedule x -> Schedule) -> Generic Schedule
forall x. Rep Schedule x -> Schedule
forall x. Schedule -> Rep Schedule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Schedule x -> Schedule
$cfrom :: forall x. Schedule -> Rep Schedule x
Prelude.Generic)

-- |
-- Create a value of 'Schedule' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'frequency', 'schedule_frequency' - Specifies how often the campaign is sent or whether the campaign is sent
-- in response to a specific event.
--
-- 'quietTime', 'schedule_quietTime' - The default quiet time for the campaign. Quiet time is a specific time
-- range when a campaign doesn\'t send messages to endpoints, if all the
-- following conditions are met:
--
-- -   The EndpointDemographic.Timezone property of the endpoint is set to
--     a valid value.
--
-- -   The current time in the endpoint\'s time zone is later than or equal
--     to the time specified by the QuietTime.Start property for the
--     campaign.
--
-- -   The current time in the endpoint\'s time zone is earlier than or
--     equal to the time specified by the QuietTime.End property for the
--     campaign.
--
-- If any of the preceding conditions isn\'t met, the endpoint will receive
-- messages from the campaign, even if quiet time is enabled.
--
-- 'eventFilter', 'schedule_eventFilter' - The type of event that causes the campaign to be sent, if the value of
-- the Frequency property is EVENT.
--
-- 'isLocalTime', 'schedule_isLocalTime' - Specifies whether the start and end times for the campaign schedule use
-- each recipient\'s local time. To base the schedule on each recipient\'s
-- local time, set this value to true.
--
-- 'endTime', 'schedule_endTime' - The scheduled time, in ISO 8601 format, when the campaign ended or will
-- end.
--
-- 'timezone', 'schedule_timezone' - The starting UTC offset for the campaign schedule, if the value of the
-- IsLocalTime property is true. Valid values are: UTC, UTC+01, UTC+02,
-- UTC+03, UTC+03:30, UTC+04, UTC+04:30, UTC+05, UTC+05:30, UTC+05:45,
-- UTC+06, UTC+06:30, UTC+07, UTC+08, UTC+09, UTC+09:30, UTC+10, UTC+10:30,
-- UTC+11, UTC+12, UTC+13, UTC-02, UTC-03, UTC-04, UTC-05, UTC-06, UTC-07,
-- UTC-08, UTC-09, UTC-10, and UTC-11.
--
-- 'startTime', 'schedule_startTime' - The scheduled time when the campaign began or will begin. Valid values
-- are: IMMEDIATE, to start the campaign immediately; or, a specific time
-- in ISO 8601 format.
newSchedule ::
  -- | 'startTime'
  Prelude.Text ->
  Schedule
newSchedule :: Text -> Schedule
newSchedule Text
pStartTime_ =
  Schedule' :: Maybe Frequency
-> Maybe QuietTime
-> Maybe CampaignEventFilter
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Text
-> Schedule
Schedule'
    { $sel:frequency:Schedule' :: Maybe Frequency
frequency = Maybe Frequency
forall a. Maybe a
Prelude.Nothing,
      $sel:quietTime:Schedule' :: Maybe QuietTime
quietTime = Maybe QuietTime
forall a. Maybe a
Prelude.Nothing,
      $sel:eventFilter:Schedule' :: Maybe CampaignEventFilter
eventFilter = Maybe CampaignEventFilter
forall a. Maybe a
Prelude.Nothing,
      $sel:isLocalTime:Schedule' :: Maybe Bool
isLocalTime = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:endTime:Schedule' :: Maybe Text
endTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:timezone:Schedule' :: Maybe Text
timezone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:Schedule' :: Text
startTime = Text
pStartTime_
    }

-- | Specifies how often the campaign is sent or whether the campaign is sent
-- in response to a specific event.
schedule_frequency :: Lens.Lens' Schedule (Prelude.Maybe Frequency)
schedule_frequency :: (Maybe Frequency -> f (Maybe Frequency)) -> Schedule -> f Schedule
schedule_frequency = (Schedule -> Maybe Frequency)
-> (Schedule -> Maybe Frequency -> Schedule)
-> Lens Schedule Schedule (Maybe Frequency) (Maybe Frequency)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Schedule' {Maybe Frequency
frequency :: Maybe Frequency
$sel:frequency:Schedule' :: Schedule -> Maybe Frequency
frequency} -> Maybe Frequency
frequency) (\s :: Schedule
s@Schedule' {} Maybe Frequency
a -> Schedule
s {$sel:frequency:Schedule' :: Maybe Frequency
frequency = Maybe Frequency
a} :: Schedule)

-- | The default quiet time for the campaign. Quiet time is a specific time
-- range when a campaign doesn\'t send messages to endpoints, if all the
-- following conditions are met:
--
-- -   The EndpointDemographic.Timezone property of the endpoint is set to
--     a valid value.
--
-- -   The current time in the endpoint\'s time zone is later than or equal
--     to the time specified by the QuietTime.Start property for the
--     campaign.
--
-- -   The current time in the endpoint\'s time zone is earlier than or
--     equal to the time specified by the QuietTime.End property for the
--     campaign.
--
-- If any of the preceding conditions isn\'t met, the endpoint will receive
-- messages from the campaign, even if quiet time is enabled.
schedule_quietTime :: Lens.Lens' Schedule (Prelude.Maybe QuietTime)
schedule_quietTime :: (Maybe QuietTime -> f (Maybe QuietTime)) -> Schedule -> f Schedule
schedule_quietTime = (Schedule -> Maybe QuietTime)
-> (Schedule -> Maybe QuietTime -> Schedule)
-> Lens Schedule Schedule (Maybe QuietTime) (Maybe QuietTime)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Schedule' {Maybe QuietTime
quietTime :: Maybe QuietTime
$sel:quietTime:Schedule' :: Schedule -> Maybe QuietTime
quietTime} -> Maybe QuietTime
quietTime) (\s :: Schedule
s@Schedule' {} Maybe QuietTime
a -> Schedule
s {$sel:quietTime:Schedule' :: Maybe QuietTime
quietTime = Maybe QuietTime
a} :: Schedule)

-- | The type of event that causes the campaign to be sent, if the value of
-- the Frequency property is EVENT.
schedule_eventFilter :: Lens.Lens' Schedule (Prelude.Maybe CampaignEventFilter)
schedule_eventFilter :: (Maybe CampaignEventFilter -> f (Maybe CampaignEventFilter))
-> Schedule -> f Schedule
schedule_eventFilter = (Schedule -> Maybe CampaignEventFilter)
-> (Schedule -> Maybe CampaignEventFilter -> Schedule)
-> Lens
     Schedule
     Schedule
     (Maybe CampaignEventFilter)
     (Maybe CampaignEventFilter)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Schedule' {Maybe CampaignEventFilter
eventFilter :: Maybe CampaignEventFilter
$sel:eventFilter:Schedule' :: Schedule -> Maybe CampaignEventFilter
eventFilter} -> Maybe CampaignEventFilter
eventFilter) (\s :: Schedule
s@Schedule' {} Maybe CampaignEventFilter
a -> Schedule
s {$sel:eventFilter:Schedule' :: Maybe CampaignEventFilter
eventFilter = Maybe CampaignEventFilter
a} :: Schedule)

-- | Specifies whether the start and end times for the campaign schedule use
-- each recipient\'s local time. To base the schedule on each recipient\'s
-- local time, set this value to true.
schedule_isLocalTime :: Lens.Lens' Schedule (Prelude.Maybe Prelude.Bool)
schedule_isLocalTime :: (Maybe Bool -> f (Maybe Bool)) -> Schedule -> f Schedule
schedule_isLocalTime = (Schedule -> Maybe Bool)
-> (Schedule -> Maybe Bool -> Schedule)
-> Lens Schedule Schedule (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Schedule' {Maybe Bool
isLocalTime :: Maybe Bool
$sel:isLocalTime:Schedule' :: Schedule -> Maybe Bool
isLocalTime} -> Maybe Bool
isLocalTime) (\s :: Schedule
s@Schedule' {} Maybe Bool
a -> Schedule
s {$sel:isLocalTime:Schedule' :: Maybe Bool
isLocalTime = Maybe Bool
a} :: Schedule)

-- | The scheduled time, in ISO 8601 format, when the campaign ended or will
-- end.
schedule_endTime :: Lens.Lens' Schedule (Prelude.Maybe Prelude.Text)
schedule_endTime :: (Maybe Text -> f (Maybe Text)) -> Schedule -> f Schedule
schedule_endTime = (Schedule -> Maybe Text)
-> (Schedule -> Maybe Text -> Schedule)
-> Lens Schedule Schedule (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Schedule' {Maybe Text
endTime :: Maybe Text
$sel:endTime:Schedule' :: Schedule -> Maybe Text
endTime} -> Maybe Text
endTime) (\s :: Schedule
s@Schedule' {} Maybe Text
a -> Schedule
s {$sel:endTime:Schedule' :: Maybe Text
endTime = Maybe Text
a} :: Schedule)

-- | The starting UTC offset for the campaign schedule, if the value of the
-- IsLocalTime property is true. Valid values are: UTC, UTC+01, UTC+02,
-- UTC+03, UTC+03:30, UTC+04, UTC+04:30, UTC+05, UTC+05:30, UTC+05:45,
-- UTC+06, UTC+06:30, UTC+07, UTC+08, UTC+09, UTC+09:30, UTC+10, UTC+10:30,
-- UTC+11, UTC+12, UTC+13, UTC-02, UTC-03, UTC-04, UTC-05, UTC-06, UTC-07,
-- UTC-08, UTC-09, UTC-10, and UTC-11.
schedule_timezone :: Lens.Lens' Schedule (Prelude.Maybe Prelude.Text)
schedule_timezone :: (Maybe Text -> f (Maybe Text)) -> Schedule -> f Schedule
schedule_timezone = (Schedule -> Maybe Text)
-> (Schedule -> Maybe Text -> Schedule)
-> Lens Schedule Schedule (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Schedule' {Maybe Text
timezone :: Maybe Text
$sel:timezone:Schedule' :: Schedule -> Maybe Text
timezone} -> Maybe Text
timezone) (\s :: Schedule
s@Schedule' {} Maybe Text
a -> Schedule
s {$sel:timezone:Schedule' :: Maybe Text
timezone = Maybe Text
a} :: Schedule)

-- | The scheduled time when the campaign began or will begin. Valid values
-- are: IMMEDIATE, to start the campaign immediately; or, a specific time
-- in ISO 8601 format.
schedule_startTime :: Lens.Lens' Schedule Prelude.Text
schedule_startTime :: (Text -> f Text) -> Schedule -> f Schedule
schedule_startTime = (Schedule -> Text)
-> (Schedule -> Text -> Schedule)
-> Lens Schedule Schedule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Schedule' {Text
startTime :: Text
$sel:startTime:Schedule' :: Schedule -> Text
startTime} -> Text
startTime) (\s :: Schedule
s@Schedule' {} Text
a -> Schedule
s {$sel:startTime:Schedule' :: Text
startTime = Text
a} :: Schedule)

instance Core.FromJSON Schedule where
  parseJSON :: Value -> Parser Schedule
parseJSON =
    String -> (Object -> Parser Schedule) -> Value -> Parser Schedule
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Schedule"
      ( \Object
x ->
          Maybe Frequency
-> Maybe QuietTime
-> Maybe CampaignEventFilter
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Text
-> Schedule
Schedule'
            (Maybe Frequency
 -> Maybe QuietTime
 -> Maybe CampaignEventFilter
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Text
 -> Schedule)
-> Parser (Maybe Frequency)
-> Parser
     (Maybe QuietTime
      -> Maybe CampaignEventFilter
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Schedule)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Frequency)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Frequency")
            Parser
  (Maybe QuietTime
   -> Maybe CampaignEventFilter
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Schedule)
-> Parser (Maybe QuietTime)
-> Parser
     (Maybe CampaignEventFilter
      -> Maybe Bool -> Maybe Text -> Maybe Text -> Text -> Schedule)
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
   -> Maybe Bool -> Maybe Text -> Maybe Text -> Text -> Schedule)
-> Parser (Maybe CampaignEventFilter)
-> Parser
     (Maybe Bool -> Maybe Text -> Maybe Text -> Text -> Schedule)
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")
            Parser (Maybe Bool -> Maybe Text -> Maybe Text -> Text -> Schedule)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> Maybe Text -> Text -> Schedule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IsLocalTime")
            Parser (Maybe Text -> Maybe Text -> Text -> Schedule)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Text -> Schedule)
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
"EndTime")
            Parser (Maybe Text -> Text -> Schedule)
-> Parser (Maybe Text) -> Parser (Text -> Schedule)
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
"Timezone")
            Parser (Text -> Schedule) -> Parser Text -> Parser Schedule
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"StartTime")
      )

instance Prelude.Hashable Schedule

instance Prelude.NFData Schedule

instance Core.ToJSON Schedule where
  toJSON :: Schedule -> Value
toJSON Schedule' {Maybe Bool
Maybe Text
Maybe Frequency
Maybe QuietTime
Maybe CampaignEventFilter
Text
startTime :: Text
timezone :: Maybe Text
endTime :: Maybe Text
isLocalTime :: Maybe Bool
eventFilter :: Maybe CampaignEventFilter
quietTime :: Maybe QuietTime
frequency :: Maybe Frequency
$sel:startTime:Schedule' :: Schedule -> Text
$sel:timezone:Schedule' :: Schedule -> Maybe Text
$sel:endTime:Schedule' :: Schedule -> Maybe Text
$sel:isLocalTime:Schedule' :: Schedule -> Maybe Bool
$sel:eventFilter:Schedule' :: Schedule -> Maybe CampaignEventFilter
$sel:quietTime:Schedule' :: Schedule -> Maybe QuietTime
$sel:frequency:Schedule' :: Schedule -> Maybe Frequency
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Frequency" Text -> Frequency -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Frequency -> Pair) -> Maybe Frequency -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Frequency
frequency,
            (Text
"QuietTime" Text -> QuietTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (QuietTime -> Pair) -> Maybe QuietTime -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe QuietTime
quietTime,
            (Text
"EventFilter" Text -> CampaignEventFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CampaignEventFilter -> Pair)
-> Maybe CampaignEventFilter -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CampaignEventFilter
eventFilter,
            (Text
"IsLocalTime" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
isLocalTime,
            (Text
"EndTime" 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
endTime,
            (Text
"Timezone" 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
timezone,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"StartTime" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
startTime)
          ]
      )