{-# 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.AppFlow.Types.ScheduledTriggerProperties
-- 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.AppFlow.Types.ScheduledTriggerProperties where

import Amazonka.AppFlow.Types.DataPullMode
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Specifies the configuration details of a schedule-triggered flow as
-- defined by the user. Currently, these settings only apply to the
-- @Scheduled@ trigger type.
--
-- /See:/ 'newScheduledTriggerProperties' smart constructor.
data ScheduledTriggerProperties = ScheduledTriggerProperties'
  { -- | Specifies the scheduled end time for a schedule-triggered flow.
    ScheduledTriggerProperties -> Maybe POSIX
scheduleEndTime :: Prelude.Maybe Core.POSIX,
    -- | Specifies the optional offset that is added to the time interval for a
    -- schedule-triggered flow.
    ScheduledTriggerProperties -> Maybe Natural
scheduleOffset :: Prelude.Maybe Prelude.Natural,
    -- | Specifies whether a scheduled flow has an incremental data transfer or a
    -- complete data transfer for each flow run.
    ScheduledTriggerProperties -> Maybe DataPullMode
dataPullMode :: Prelude.Maybe DataPullMode,
    -- | Specifies the scheduled start time for a schedule-triggered flow.
    ScheduledTriggerProperties -> Maybe POSIX
scheduleStartTime :: Prelude.Maybe Core.POSIX,
    -- | Specifies the time zone used when referring to the date and time of a
    -- scheduled-triggered flow, such as @America\/New_York@.
    ScheduledTriggerProperties -> Maybe Text
timezone :: Prelude.Maybe Prelude.Text,
    -- | Specifies the date range for the records to import from the connector in
    -- the first flow run.
    ScheduledTriggerProperties -> Maybe POSIX
firstExecutionFrom :: Prelude.Maybe Core.POSIX,
    -- | The scheduling expression that determines the rate at which the schedule
    -- will run, for example @rate(5minutes)@.
    ScheduledTriggerProperties -> Text
scheduleExpression :: Prelude.Text
  }
  deriving (ScheduledTriggerProperties -> ScheduledTriggerProperties -> Bool
(ScheduledTriggerProperties -> ScheduledTriggerProperties -> Bool)
-> (ScheduledTriggerProperties
    -> ScheduledTriggerProperties -> Bool)
-> Eq ScheduledTriggerProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ScheduledTriggerProperties -> ScheduledTriggerProperties -> Bool
$c/= :: ScheduledTriggerProperties -> ScheduledTriggerProperties -> Bool
== :: ScheduledTriggerProperties -> ScheduledTriggerProperties -> Bool
$c== :: ScheduledTriggerProperties -> ScheduledTriggerProperties -> Bool
Prelude.Eq, ReadPrec [ScheduledTriggerProperties]
ReadPrec ScheduledTriggerProperties
Int -> ReadS ScheduledTriggerProperties
ReadS [ScheduledTriggerProperties]
(Int -> ReadS ScheduledTriggerProperties)
-> ReadS [ScheduledTriggerProperties]
-> ReadPrec ScheduledTriggerProperties
-> ReadPrec [ScheduledTriggerProperties]
-> Read ScheduledTriggerProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ScheduledTriggerProperties]
$creadListPrec :: ReadPrec [ScheduledTriggerProperties]
readPrec :: ReadPrec ScheduledTriggerProperties
$creadPrec :: ReadPrec ScheduledTriggerProperties
readList :: ReadS [ScheduledTriggerProperties]
$creadList :: ReadS [ScheduledTriggerProperties]
readsPrec :: Int -> ReadS ScheduledTriggerProperties
$creadsPrec :: Int -> ReadS ScheduledTriggerProperties
Prelude.Read, Int -> ScheduledTriggerProperties -> ShowS
[ScheduledTriggerProperties] -> ShowS
ScheduledTriggerProperties -> String
(Int -> ScheduledTriggerProperties -> ShowS)
-> (ScheduledTriggerProperties -> String)
-> ([ScheduledTriggerProperties] -> ShowS)
-> Show ScheduledTriggerProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ScheduledTriggerProperties] -> ShowS
$cshowList :: [ScheduledTriggerProperties] -> ShowS
show :: ScheduledTriggerProperties -> String
$cshow :: ScheduledTriggerProperties -> String
showsPrec :: Int -> ScheduledTriggerProperties -> ShowS
$cshowsPrec :: Int -> ScheduledTriggerProperties -> ShowS
Prelude.Show, (forall x.
 ScheduledTriggerProperties -> Rep ScheduledTriggerProperties x)
-> (forall x.
    Rep ScheduledTriggerProperties x -> ScheduledTriggerProperties)
-> Generic ScheduledTriggerProperties
forall x.
Rep ScheduledTriggerProperties x -> ScheduledTriggerProperties
forall x.
ScheduledTriggerProperties -> Rep ScheduledTriggerProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ScheduledTriggerProperties x -> ScheduledTriggerProperties
$cfrom :: forall x.
ScheduledTriggerProperties -> Rep ScheduledTriggerProperties x
Prelude.Generic)

-- |
-- Create a value of 'ScheduledTriggerProperties' 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:
--
-- 'scheduleEndTime', 'scheduledTriggerProperties_scheduleEndTime' - Specifies the scheduled end time for a schedule-triggered flow.
--
-- 'scheduleOffset', 'scheduledTriggerProperties_scheduleOffset' - Specifies the optional offset that is added to the time interval for a
-- schedule-triggered flow.
--
-- 'dataPullMode', 'scheduledTriggerProperties_dataPullMode' - Specifies whether a scheduled flow has an incremental data transfer or a
-- complete data transfer for each flow run.
--
-- 'scheduleStartTime', 'scheduledTriggerProperties_scheduleStartTime' - Specifies the scheduled start time for a schedule-triggered flow.
--
-- 'timezone', 'scheduledTriggerProperties_timezone' - Specifies the time zone used when referring to the date and time of a
-- scheduled-triggered flow, such as @America\/New_York@.
--
-- 'firstExecutionFrom', 'scheduledTriggerProperties_firstExecutionFrom' - Specifies the date range for the records to import from the connector in
-- the first flow run.
--
-- 'scheduleExpression', 'scheduledTriggerProperties_scheduleExpression' - The scheduling expression that determines the rate at which the schedule
-- will run, for example @rate(5minutes)@.
newScheduledTriggerProperties ::
  -- | 'scheduleExpression'
  Prelude.Text ->
  ScheduledTriggerProperties
newScheduledTriggerProperties :: Text -> ScheduledTriggerProperties
newScheduledTriggerProperties Text
pScheduleExpression_ =
  ScheduledTriggerProperties' :: Maybe POSIX
-> Maybe Natural
-> Maybe DataPullMode
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Text
-> ScheduledTriggerProperties
ScheduledTriggerProperties'
    { $sel:scheduleEndTime:ScheduledTriggerProperties' :: Maybe POSIX
scheduleEndTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:scheduleOffset:ScheduledTriggerProperties' :: Maybe Natural
scheduleOffset = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:dataPullMode:ScheduledTriggerProperties' :: Maybe DataPullMode
dataPullMode = Maybe DataPullMode
forall a. Maybe a
Prelude.Nothing,
      $sel:scheduleStartTime:ScheduledTriggerProperties' :: Maybe POSIX
scheduleStartTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:timezone:ScheduledTriggerProperties' :: Maybe Text
timezone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:firstExecutionFrom:ScheduledTriggerProperties' :: Maybe POSIX
firstExecutionFrom = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:scheduleExpression:ScheduledTriggerProperties' :: Text
scheduleExpression = Text
pScheduleExpression_
    }

-- | Specifies the scheduled end time for a schedule-triggered flow.
scheduledTriggerProperties_scheduleEndTime :: Lens.Lens' ScheduledTriggerProperties (Prelude.Maybe Prelude.UTCTime)
scheduledTriggerProperties_scheduleEndTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ScheduledTriggerProperties -> f ScheduledTriggerProperties
scheduledTriggerProperties_scheduleEndTime = (ScheduledTriggerProperties -> Maybe POSIX)
-> (ScheduledTriggerProperties
    -> Maybe POSIX -> ScheduledTriggerProperties)
-> Lens
     ScheduledTriggerProperties
     ScheduledTriggerProperties
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduledTriggerProperties' {Maybe POSIX
scheduleEndTime :: Maybe POSIX
$sel:scheduleEndTime:ScheduledTriggerProperties' :: ScheduledTriggerProperties -> Maybe POSIX
scheduleEndTime} -> Maybe POSIX
scheduleEndTime) (\s :: ScheduledTriggerProperties
s@ScheduledTriggerProperties' {} Maybe POSIX
a -> ScheduledTriggerProperties
s {$sel:scheduleEndTime:ScheduledTriggerProperties' :: Maybe POSIX
scheduleEndTime = Maybe POSIX
a} :: ScheduledTriggerProperties) ((Maybe POSIX -> f (Maybe POSIX))
 -> ScheduledTriggerProperties -> f ScheduledTriggerProperties)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ScheduledTriggerProperties
-> f ScheduledTriggerProperties
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Specifies the optional offset that is added to the time interval for a
-- schedule-triggered flow.
scheduledTriggerProperties_scheduleOffset :: Lens.Lens' ScheduledTriggerProperties (Prelude.Maybe Prelude.Natural)
scheduledTriggerProperties_scheduleOffset :: (Maybe Natural -> f (Maybe Natural))
-> ScheduledTriggerProperties -> f ScheduledTriggerProperties
scheduledTriggerProperties_scheduleOffset = (ScheduledTriggerProperties -> Maybe Natural)
-> (ScheduledTriggerProperties
    -> Maybe Natural -> ScheduledTriggerProperties)
-> Lens
     ScheduledTriggerProperties
     ScheduledTriggerProperties
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduledTriggerProperties' {Maybe Natural
scheduleOffset :: Maybe Natural
$sel:scheduleOffset:ScheduledTriggerProperties' :: ScheduledTriggerProperties -> Maybe Natural
scheduleOffset} -> Maybe Natural
scheduleOffset) (\s :: ScheduledTriggerProperties
s@ScheduledTriggerProperties' {} Maybe Natural
a -> ScheduledTriggerProperties
s {$sel:scheduleOffset:ScheduledTriggerProperties' :: Maybe Natural
scheduleOffset = Maybe Natural
a} :: ScheduledTriggerProperties)

-- | Specifies whether a scheduled flow has an incremental data transfer or a
-- complete data transfer for each flow run.
scheduledTriggerProperties_dataPullMode :: Lens.Lens' ScheduledTriggerProperties (Prelude.Maybe DataPullMode)
scheduledTriggerProperties_dataPullMode :: (Maybe DataPullMode -> f (Maybe DataPullMode))
-> ScheduledTriggerProperties -> f ScheduledTriggerProperties
scheduledTriggerProperties_dataPullMode = (ScheduledTriggerProperties -> Maybe DataPullMode)
-> (ScheduledTriggerProperties
    -> Maybe DataPullMode -> ScheduledTriggerProperties)
-> Lens
     ScheduledTriggerProperties
     ScheduledTriggerProperties
     (Maybe DataPullMode)
     (Maybe DataPullMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduledTriggerProperties' {Maybe DataPullMode
dataPullMode :: Maybe DataPullMode
$sel:dataPullMode:ScheduledTriggerProperties' :: ScheduledTriggerProperties -> Maybe DataPullMode
dataPullMode} -> Maybe DataPullMode
dataPullMode) (\s :: ScheduledTriggerProperties
s@ScheduledTriggerProperties' {} Maybe DataPullMode
a -> ScheduledTriggerProperties
s {$sel:dataPullMode:ScheduledTriggerProperties' :: Maybe DataPullMode
dataPullMode = Maybe DataPullMode
a} :: ScheduledTriggerProperties)

-- | Specifies the scheduled start time for a schedule-triggered flow.
scheduledTriggerProperties_scheduleStartTime :: Lens.Lens' ScheduledTriggerProperties (Prelude.Maybe Prelude.UTCTime)
scheduledTriggerProperties_scheduleStartTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ScheduledTriggerProperties -> f ScheduledTriggerProperties
scheduledTriggerProperties_scheduleStartTime = (ScheduledTriggerProperties -> Maybe POSIX)
-> (ScheduledTriggerProperties
    -> Maybe POSIX -> ScheduledTriggerProperties)
-> Lens
     ScheduledTriggerProperties
     ScheduledTriggerProperties
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduledTriggerProperties' {Maybe POSIX
scheduleStartTime :: Maybe POSIX
$sel:scheduleStartTime:ScheduledTriggerProperties' :: ScheduledTriggerProperties -> Maybe POSIX
scheduleStartTime} -> Maybe POSIX
scheduleStartTime) (\s :: ScheduledTriggerProperties
s@ScheduledTriggerProperties' {} Maybe POSIX
a -> ScheduledTriggerProperties
s {$sel:scheduleStartTime:ScheduledTriggerProperties' :: Maybe POSIX
scheduleStartTime = Maybe POSIX
a} :: ScheduledTriggerProperties) ((Maybe POSIX -> f (Maybe POSIX))
 -> ScheduledTriggerProperties -> f ScheduledTriggerProperties)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ScheduledTriggerProperties
-> f ScheduledTriggerProperties
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Specifies the time zone used when referring to the date and time of a
-- scheduled-triggered flow, such as @America\/New_York@.
scheduledTriggerProperties_timezone :: Lens.Lens' ScheduledTriggerProperties (Prelude.Maybe Prelude.Text)
scheduledTriggerProperties_timezone :: (Maybe Text -> f (Maybe Text))
-> ScheduledTriggerProperties -> f ScheduledTriggerProperties
scheduledTriggerProperties_timezone = (ScheduledTriggerProperties -> Maybe Text)
-> (ScheduledTriggerProperties
    -> Maybe Text -> ScheduledTriggerProperties)
-> Lens
     ScheduledTriggerProperties
     ScheduledTriggerProperties
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduledTriggerProperties' {Maybe Text
timezone :: Maybe Text
$sel:timezone:ScheduledTriggerProperties' :: ScheduledTriggerProperties -> Maybe Text
timezone} -> Maybe Text
timezone) (\s :: ScheduledTriggerProperties
s@ScheduledTriggerProperties' {} Maybe Text
a -> ScheduledTriggerProperties
s {$sel:timezone:ScheduledTriggerProperties' :: Maybe Text
timezone = Maybe Text
a} :: ScheduledTriggerProperties)

-- | Specifies the date range for the records to import from the connector in
-- the first flow run.
scheduledTriggerProperties_firstExecutionFrom :: Lens.Lens' ScheduledTriggerProperties (Prelude.Maybe Prelude.UTCTime)
scheduledTriggerProperties_firstExecutionFrom :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ScheduledTriggerProperties -> f ScheduledTriggerProperties
scheduledTriggerProperties_firstExecutionFrom = (ScheduledTriggerProperties -> Maybe POSIX)
-> (ScheduledTriggerProperties
    -> Maybe POSIX -> ScheduledTriggerProperties)
-> Lens
     ScheduledTriggerProperties
     ScheduledTriggerProperties
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduledTriggerProperties' {Maybe POSIX
firstExecutionFrom :: Maybe POSIX
$sel:firstExecutionFrom:ScheduledTriggerProperties' :: ScheduledTriggerProperties -> Maybe POSIX
firstExecutionFrom} -> Maybe POSIX
firstExecutionFrom) (\s :: ScheduledTriggerProperties
s@ScheduledTriggerProperties' {} Maybe POSIX
a -> ScheduledTriggerProperties
s {$sel:firstExecutionFrom:ScheduledTriggerProperties' :: Maybe POSIX
firstExecutionFrom = Maybe POSIX
a} :: ScheduledTriggerProperties) ((Maybe POSIX -> f (Maybe POSIX))
 -> ScheduledTriggerProperties -> f ScheduledTriggerProperties)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ScheduledTriggerProperties
-> f ScheduledTriggerProperties
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The scheduling expression that determines the rate at which the schedule
-- will run, for example @rate(5minutes)@.
scheduledTriggerProperties_scheduleExpression :: Lens.Lens' ScheduledTriggerProperties Prelude.Text
scheduledTriggerProperties_scheduleExpression :: (Text -> f Text)
-> ScheduledTriggerProperties -> f ScheduledTriggerProperties
scheduledTriggerProperties_scheduleExpression = (ScheduledTriggerProperties -> Text)
-> (ScheduledTriggerProperties
    -> Text -> ScheduledTriggerProperties)
-> Lens
     ScheduledTriggerProperties ScheduledTriggerProperties Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduledTriggerProperties' {Text
scheduleExpression :: Text
$sel:scheduleExpression:ScheduledTriggerProperties' :: ScheduledTriggerProperties -> Text
scheduleExpression} -> Text
scheduleExpression) (\s :: ScheduledTriggerProperties
s@ScheduledTriggerProperties' {} Text
a -> ScheduledTriggerProperties
s {$sel:scheduleExpression:ScheduledTriggerProperties' :: Text
scheduleExpression = Text
a} :: ScheduledTriggerProperties)

instance Core.FromJSON ScheduledTriggerProperties where
  parseJSON :: Value -> Parser ScheduledTriggerProperties
parseJSON =
    String
-> (Object -> Parser ScheduledTriggerProperties)
-> Value
-> Parser ScheduledTriggerProperties
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ScheduledTriggerProperties"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Natural
-> Maybe DataPullMode
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Text
-> ScheduledTriggerProperties
ScheduledTriggerProperties'
            (Maybe POSIX
 -> Maybe Natural
 -> Maybe DataPullMode
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Text
 -> ScheduledTriggerProperties)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Natural
      -> Maybe DataPullMode
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Text
      -> ScheduledTriggerProperties)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"scheduleEndTime")
            Parser
  (Maybe Natural
   -> Maybe DataPullMode
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Text
   -> ScheduledTriggerProperties)
-> Parser (Maybe Natural)
-> Parser
     (Maybe DataPullMode
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Text
      -> ScheduledTriggerProperties)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"scheduleOffset")
            Parser
  (Maybe DataPullMode
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Text
   -> ScheduledTriggerProperties)
-> Parser (Maybe DataPullMode)
-> Parser
     (Maybe POSIX
      -> Maybe Text -> Maybe POSIX -> Text -> ScheduledTriggerProperties)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DataPullMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"dataPullMode")
            Parser
  (Maybe POSIX
   -> Maybe Text -> Maybe POSIX -> Text -> ScheduledTriggerProperties)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text -> Maybe POSIX -> Text -> ScheduledTriggerProperties)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"scheduleStartTime")
            Parser
  (Maybe Text -> Maybe POSIX -> Text -> ScheduledTriggerProperties)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Text -> ScheduledTriggerProperties)
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 (Maybe POSIX -> Text -> ScheduledTriggerProperties)
-> Parser (Maybe POSIX)
-> Parser (Text -> ScheduledTriggerProperties)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"firstExecutionFrom")
            Parser (Text -> ScheduledTriggerProperties)
-> Parser Text -> Parser ScheduledTriggerProperties
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
"scheduleExpression")
      )

instance Prelude.Hashable ScheduledTriggerProperties

instance Prelude.NFData ScheduledTriggerProperties

instance Core.ToJSON ScheduledTriggerProperties where
  toJSON :: ScheduledTriggerProperties -> Value
toJSON ScheduledTriggerProperties' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe DataPullMode
Text
scheduleExpression :: Text
firstExecutionFrom :: Maybe POSIX
timezone :: Maybe Text
scheduleStartTime :: Maybe POSIX
dataPullMode :: Maybe DataPullMode
scheduleOffset :: Maybe Natural
scheduleEndTime :: Maybe POSIX
$sel:scheduleExpression:ScheduledTriggerProperties' :: ScheduledTriggerProperties -> Text
$sel:firstExecutionFrom:ScheduledTriggerProperties' :: ScheduledTriggerProperties -> Maybe POSIX
$sel:timezone:ScheduledTriggerProperties' :: ScheduledTriggerProperties -> Maybe Text
$sel:scheduleStartTime:ScheduledTriggerProperties' :: ScheduledTriggerProperties -> Maybe POSIX
$sel:dataPullMode:ScheduledTriggerProperties' :: ScheduledTriggerProperties -> Maybe DataPullMode
$sel:scheduleOffset:ScheduledTriggerProperties' :: ScheduledTriggerProperties -> Maybe Natural
$sel:scheduleEndTime:ScheduledTriggerProperties' :: ScheduledTriggerProperties -> Maybe POSIX
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"scheduleEndTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
scheduleEndTime,
            (Text
"scheduleOffset" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
scheduleOffset,
            (Text
"dataPullMode" Text -> DataPullMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DataPullMode -> Pair) -> Maybe DataPullMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DataPullMode
dataPullMode,
            (Text
"scheduleStartTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
scheduleStartTime,
            (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,
            (Text
"firstExecutionFrom" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
firstExecutionFrom,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"scheduleExpression" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
scheduleExpression)
          ]
      )