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