{-# 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.ImageBuilder.Types.Schedule where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ImageBuilder.Types.PipelineExecutionStartCondition
import qualified Amazonka.Prelude as Prelude
data Schedule = Schedule'
{
Schedule -> Maybe PipelineExecutionStartCondition
pipelineExecutionStartCondition :: Prelude.Maybe PipelineExecutionStartCondition,
Schedule -> Maybe Text
scheduleExpression :: Prelude.Maybe Prelude.Text,
Schedule -> Maybe Text
timezone :: Prelude.Maybe Prelude.Text
}
deriving (Schedule -> Schedule -> Bool
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]
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
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. 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)
newSchedule ::
Schedule
newSchedule :: Schedule
newSchedule =
Schedule'
{ $sel:pipelineExecutionStartCondition:Schedule' :: Maybe PipelineExecutionStartCondition
pipelineExecutionStartCondition =
forall a. Maybe a
Prelude.Nothing,
$sel:scheduleExpression:Schedule' :: Maybe Text
scheduleExpression = forall a. Maybe a
Prelude.Nothing,
$sel:timezone:Schedule' :: Maybe Text
timezone = forall a. Maybe a
Prelude.Nothing
}
schedule_pipelineExecutionStartCondition :: Lens.Lens' Schedule (Prelude.Maybe PipelineExecutionStartCondition)
schedule_pipelineExecutionStartCondition :: Lens' Schedule (Maybe PipelineExecutionStartCondition)
schedule_pipelineExecutionStartCondition = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Schedule' {Maybe PipelineExecutionStartCondition
pipelineExecutionStartCondition :: Maybe PipelineExecutionStartCondition
$sel:pipelineExecutionStartCondition:Schedule' :: Schedule -> Maybe PipelineExecutionStartCondition
pipelineExecutionStartCondition} -> Maybe PipelineExecutionStartCondition
pipelineExecutionStartCondition) (\s :: Schedule
s@Schedule' {} Maybe PipelineExecutionStartCondition
a -> Schedule
s {$sel:pipelineExecutionStartCondition:Schedule' :: Maybe PipelineExecutionStartCondition
pipelineExecutionStartCondition = Maybe PipelineExecutionStartCondition
a} :: Schedule)
schedule_scheduleExpression :: Lens.Lens' Schedule (Prelude.Maybe Prelude.Text)
schedule_scheduleExpression :: Lens' Schedule (Maybe Text)
schedule_scheduleExpression = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Schedule' {Maybe Text
scheduleExpression :: Maybe Text
$sel:scheduleExpression:Schedule' :: Schedule -> Maybe Text
scheduleExpression} -> Maybe Text
scheduleExpression) (\s :: Schedule
s@Schedule' {} Maybe Text
a -> Schedule
s {$sel:scheduleExpression:Schedule' :: Maybe Text
scheduleExpression = Maybe Text
a} :: Schedule)
schedule_timezone :: Lens.Lens' Schedule (Prelude.Maybe Prelude.Text)
schedule_timezone :: Lens' Schedule (Maybe Text)
schedule_timezone = 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)
instance Data.FromJSON Schedule where
parseJSON :: Value -> Parser Schedule
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Schedule"
( \Object
x ->
Maybe PipelineExecutionStartCondition
-> Maybe Text -> Maybe Text -> Schedule
Schedule'
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
"pipelineExecutionStartCondition")
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
"scheduleExpression")
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
"timezone")
)
instance Prelude.Hashable Schedule where
hashWithSalt :: Int -> Schedule -> Int
hashWithSalt Int
_salt Schedule' {Maybe Text
Maybe PipelineExecutionStartCondition
timezone :: Maybe Text
scheduleExpression :: Maybe Text
pipelineExecutionStartCondition :: Maybe PipelineExecutionStartCondition
$sel:timezone:Schedule' :: Schedule -> Maybe Text
$sel:scheduleExpression:Schedule' :: Schedule -> Maybe Text
$sel:pipelineExecutionStartCondition:Schedule' :: Schedule -> Maybe PipelineExecutionStartCondition
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PipelineExecutionStartCondition
pipelineExecutionStartCondition
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
scheduleExpression
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
timezone
instance Prelude.NFData Schedule where
rnf :: Schedule -> ()
rnf Schedule' {Maybe Text
Maybe PipelineExecutionStartCondition
timezone :: Maybe Text
scheduleExpression :: Maybe Text
pipelineExecutionStartCondition :: Maybe PipelineExecutionStartCondition
$sel:timezone:Schedule' :: Schedule -> Maybe Text
$sel:scheduleExpression:Schedule' :: Schedule -> Maybe Text
$sel:pipelineExecutionStartCondition:Schedule' :: Schedule -> Maybe PipelineExecutionStartCondition
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe PipelineExecutionStartCondition
pipelineExecutionStartCondition
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
scheduleExpression
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
timezone
instance Data.ToJSON Schedule where
toJSON :: Schedule -> Value
toJSON Schedule' {Maybe Text
Maybe PipelineExecutionStartCondition
timezone :: Maybe Text
scheduleExpression :: Maybe Text
pipelineExecutionStartCondition :: Maybe PipelineExecutionStartCondition
$sel:timezone:Schedule' :: Schedule -> Maybe Text
$sel:scheduleExpression:Schedule' :: Schedule -> Maybe Text
$sel:pipelineExecutionStartCondition:Schedule' :: Schedule -> Maybe PipelineExecutionStartCondition
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"pipelineExecutionStartCondition" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PipelineExecutionStartCondition
pipelineExecutionStartCondition,
(Key
"scheduleExpression" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
scheduleExpression,
(Key
"timezone" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
timezone
]
)