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