{-# 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.DataSync.Types.TaskSchedule where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TaskSchedule = TaskSchedule'
{
TaskSchedule -> Text
scheduleExpression :: Prelude.Text
}
deriving (TaskSchedule -> TaskSchedule -> Bool
(TaskSchedule -> TaskSchedule -> Bool)
-> (TaskSchedule -> TaskSchedule -> Bool) -> Eq TaskSchedule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TaskSchedule -> TaskSchedule -> Bool
$c/= :: TaskSchedule -> TaskSchedule -> Bool
== :: TaskSchedule -> TaskSchedule -> Bool
$c== :: TaskSchedule -> TaskSchedule -> Bool
Prelude.Eq, ReadPrec [TaskSchedule]
ReadPrec TaskSchedule
Int -> ReadS TaskSchedule
ReadS [TaskSchedule]
(Int -> ReadS TaskSchedule)
-> ReadS [TaskSchedule]
-> ReadPrec TaskSchedule
-> ReadPrec [TaskSchedule]
-> Read TaskSchedule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TaskSchedule]
$creadListPrec :: ReadPrec [TaskSchedule]
readPrec :: ReadPrec TaskSchedule
$creadPrec :: ReadPrec TaskSchedule
readList :: ReadS [TaskSchedule]
$creadList :: ReadS [TaskSchedule]
readsPrec :: Int -> ReadS TaskSchedule
$creadsPrec :: Int -> ReadS TaskSchedule
Prelude.Read, Int -> TaskSchedule -> ShowS
[TaskSchedule] -> ShowS
TaskSchedule -> String
(Int -> TaskSchedule -> ShowS)
-> (TaskSchedule -> String)
-> ([TaskSchedule] -> ShowS)
-> Show TaskSchedule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TaskSchedule] -> ShowS
$cshowList :: [TaskSchedule] -> ShowS
show :: TaskSchedule -> String
$cshow :: TaskSchedule -> String
showsPrec :: Int -> TaskSchedule -> ShowS
$cshowsPrec :: Int -> TaskSchedule -> ShowS
Prelude.Show, (forall x. TaskSchedule -> Rep TaskSchedule x)
-> (forall x. Rep TaskSchedule x -> TaskSchedule)
-> Generic TaskSchedule
forall x. Rep TaskSchedule x -> TaskSchedule
forall x. TaskSchedule -> Rep TaskSchedule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TaskSchedule x -> TaskSchedule
$cfrom :: forall x. TaskSchedule -> Rep TaskSchedule x
Prelude.Generic)
newTaskSchedule ::
Prelude.Text ->
TaskSchedule
newTaskSchedule :: Text -> TaskSchedule
newTaskSchedule Text
pScheduleExpression_ =
TaskSchedule' :: Text -> TaskSchedule
TaskSchedule'
{ $sel:scheduleExpression:TaskSchedule' :: Text
scheduleExpression =
Text
pScheduleExpression_
}
taskSchedule_scheduleExpression :: Lens.Lens' TaskSchedule Prelude.Text
taskSchedule_scheduleExpression :: (Text -> f Text) -> TaskSchedule -> f TaskSchedule
taskSchedule_scheduleExpression = (TaskSchedule -> Text)
-> (TaskSchedule -> Text -> TaskSchedule)
-> Lens TaskSchedule TaskSchedule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskSchedule' {Text
scheduleExpression :: Text
$sel:scheduleExpression:TaskSchedule' :: TaskSchedule -> Text
scheduleExpression} -> Text
scheduleExpression) (\s :: TaskSchedule
s@TaskSchedule' {} Text
a -> TaskSchedule
s {$sel:scheduleExpression:TaskSchedule' :: Text
scheduleExpression = Text
a} :: TaskSchedule)
instance Core.FromJSON TaskSchedule where
parseJSON :: Value -> Parser TaskSchedule
parseJSON =
String
-> (Object -> Parser TaskSchedule) -> Value -> Parser TaskSchedule
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TaskSchedule"
( \Object
x ->
Text -> TaskSchedule
TaskSchedule'
(Text -> TaskSchedule) -> Parser Text -> Parser TaskSchedule
forall (f :: * -> *) a b. Functor 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 TaskSchedule
instance Prelude.NFData TaskSchedule
instance Core.ToJSON TaskSchedule where
toJSON :: TaskSchedule -> Value
toJSON TaskSchedule' {Text
scheduleExpression :: Text
$sel:scheduleExpression:TaskSchedule' :: TaskSchedule -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ 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)
]
)