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