{-# 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.AutoMLJobCompletionCriteria where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AutoMLJobCompletionCriteria = AutoMLJobCompletionCriteria'
{
AutoMLJobCompletionCriteria -> Maybe Natural
maxCandidates :: Prelude.Maybe Prelude.Natural,
AutoMLJobCompletionCriteria -> Maybe Natural
maxRuntimePerTrainingJobInSeconds :: Prelude.Maybe Prelude.Natural,
AutoMLJobCompletionCriteria -> Maybe Natural
maxAutoMLJobRuntimeInSeconds :: Prelude.Maybe Prelude.Natural
}
deriving (AutoMLJobCompletionCriteria -> AutoMLJobCompletionCriteria -> Bool
(AutoMLJobCompletionCriteria
-> AutoMLJobCompletionCriteria -> Bool)
-> (AutoMLJobCompletionCriteria
-> AutoMLJobCompletionCriteria -> Bool)
-> Eq AutoMLJobCompletionCriteria
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoMLJobCompletionCriteria -> AutoMLJobCompletionCriteria -> Bool
$c/= :: AutoMLJobCompletionCriteria -> AutoMLJobCompletionCriteria -> Bool
== :: AutoMLJobCompletionCriteria -> AutoMLJobCompletionCriteria -> Bool
$c== :: AutoMLJobCompletionCriteria -> AutoMLJobCompletionCriteria -> Bool
Prelude.Eq, ReadPrec [AutoMLJobCompletionCriteria]
ReadPrec AutoMLJobCompletionCriteria
Int -> ReadS AutoMLJobCompletionCriteria
ReadS [AutoMLJobCompletionCriteria]
(Int -> ReadS AutoMLJobCompletionCriteria)
-> ReadS [AutoMLJobCompletionCriteria]
-> ReadPrec AutoMLJobCompletionCriteria
-> ReadPrec [AutoMLJobCompletionCriteria]
-> Read AutoMLJobCompletionCriteria
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoMLJobCompletionCriteria]
$creadListPrec :: ReadPrec [AutoMLJobCompletionCriteria]
readPrec :: ReadPrec AutoMLJobCompletionCriteria
$creadPrec :: ReadPrec AutoMLJobCompletionCriteria
readList :: ReadS [AutoMLJobCompletionCriteria]
$creadList :: ReadS [AutoMLJobCompletionCriteria]
readsPrec :: Int -> ReadS AutoMLJobCompletionCriteria
$creadsPrec :: Int -> ReadS AutoMLJobCompletionCriteria
Prelude.Read, Int -> AutoMLJobCompletionCriteria -> ShowS
[AutoMLJobCompletionCriteria] -> ShowS
AutoMLJobCompletionCriteria -> String
(Int -> AutoMLJobCompletionCriteria -> ShowS)
-> (AutoMLJobCompletionCriteria -> String)
-> ([AutoMLJobCompletionCriteria] -> ShowS)
-> Show AutoMLJobCompletionCriteria
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoMLJobCompletionCriteria] -> ShowS
$cshowList :: [AutoMLJobCompletionCriteria] -> ShowS
show :: AutoMLJobCompletionCriteria -> String
$cshow :: AutoMLJobCompletionCriteria -> String
showsPrec :: Int -> AutoMLJobCompletionCriteria -> ShowS
$cshowsPrec :: Int -> AutoMLJobCompletionCriteria -> ShowS
Prelude.Show, (forall x.
AutoMLJobCompletionCriteria -> Rep AutoMLJobCompletionCriteria x)
-> (forall x.
Rep AutoMLJobCompletionCriteria x -> AutoMLJobCompletionCriteria)
-> Generic AutoMLJobCompletionCriteria
forall x.
Rep AutoMLJobCompletionCriteria x -> AutoMLJobCompletionCriteria
forall x.
AutoMLJobCompletionCriteria -> Rep AutoMLJobCompletionCriteria x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AutoMLJobCompletionCriteria x -> AutoMLJobCompletionCriteria
$cfrom :: forall x.
AutoMLJobCompletionCriteria -> Rep AutoMLJobCompletionCriteria x
Prelude.Generic)
newAutoMLJobCompletionCriteria ::
AutoMLJobCompletionCriteria
newAutoMLJobCompletionCriteria :: AutoMLJobCompletionCriteria
newAutoMLJobCompletionCriteria =
AutoMLJobCompletionCriteria' :: Maybe Natural
-> Maybe Natural -> Maybe Natural -> AutoMLJobCompletionCriteria
AutoMLJobCompletionCriteria'
{ $sel:maxCandidates:AutoMLJobCompletionCriteria' :: Maybe Natural
maxCandidates =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:maxRuntimePerTrainingJobInSeconds:AutoMLJobCompletionCriteria' :: Maybe Natural
maxRuntimePerTrainingJobInSeconds =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:maxAutoMLJobRuntimeInSeconds:AutoMLJobCompletionCriteria' :: Maybe Natural
maxAutoMLJobRuntimeInSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
autoMLJobCompletionCriteria_maxCandidates :: Lens.Lens' AutoMLJobCompletionCriteria (Prelude.Maybe Prelude.Natural)
autoMLJobCompletionCriteria_maxCandidates :: (Maybe Natural -> f (Maybe Natural))
-> AutoMLJobCompletionCriteria -> f AutoMLJobCompletionCriteria
autoMLJobCompletionCriteria_maxCandidates = (AutoMLJobCompletionCriteria -> Maybe Natural)
-> (AutoMLJobCompletionCriteria
-> Maybe Natural -> AutoMLJobCompletionCriteria)
-> Lens
AutoMLJobCompletionCriteria
AutoMLJobCompletionCriteria
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoMLJobCompletionCriteria' {Maybe Natural
maxCandidates :: Maybe Natural
$sel:maxCandidates:AutoMLJobCompletionCriteria' :: AutoMLJobCompletionCriteria -> Maybe Natural
maxCandidates} -> Maybe Natural
maxCandidates) (\s :: AutoMLJobCompletionCriteria
s@AutoMLJobCompletionCriteria' {} Maybe Natural
a -> AutoMLJobCompletionCriteria
s {$sel:maxCandidates:AutoMLJobCompletionCriteria' :: Maybe Natural
maxCandidates = Maybe Natural
a} :: AutoMLJobCompletionCriteria)
autoMLJobCompletionCriteria_maxRuntimePerTrainingJobInSeconds :: Lens.Lens' AutoMLJobCompletionCriteria (Prelude.Maybe Prelude.Natural)
autoMLJobCompletionCriteria_maxRuntimePerTrainingJobInSeconds :: (Maybe Natural -> f (Maybe Natural))
-> AutoMLJobCompletionCriteria -> f AutoMLJobCompletionCriteria
autoMLJobCompletionCriteria_maxRuntimePerTrainingJobInSeconds = (AutoMLJobCompletionCriteria -> Maybe Natural)
-> (AutoMLJobCompletionCriteria
-> Maybe Natural -> AutoMLJobCompletionCriteria)
-> Lens
AutoMLJobCompletionCriteria
AutoMLJobCompletionCriteria
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoMLJobCompletionCriteria' {Maybe Natural
maxRuntimePerTrainingJobInSeconds :: Maybe Natural
$sel:maxRuntimePerTrainingJobInSeconds:AutoMLJobCompletionCriteria' :: AutoMLJobCompletionCriteria -> Maybe Natural
maxRuntimePerTrainingJobInSeconds} -> Maybe Natural
maxRuntimePerTrainingJobInSeconds) (\s :: AutoMLJobCompletionCriteria
s@AutoMLJobCompletionCriteria' {} Maybe Natural
a -> AutoMLJobCompletionCriteria
s {$sel:maxRuntimePerTrainingJobInSeconds:AutoMLJobCompletionCriteria' :: Maybe Natural
maxRuntimePerTrainingJobInSeconds = Maybe Natural
a} :: AutoMLJobCompletionCriteria)
autoMLJobCompletionCriteria_maxAutoMLJobRuntimeInSeconds :: Lens.Lens' AutoMLJobCompletionCriteria (Prelude.Maybe Prelude.Natural)
autoMLJobCompletionCriteria_maxAutoMLJobRuntimeInSeconds :: (Maybe Natural -> f (Maybe Natural))
-> AutoMLJobCompletionCriteria -> f AutoMLJobCompletionCriteria
autoMLJobCompletionCriteria_maxAutoMLJobRuntimeInSeconds = (AutoMLJobCompletionCriteria -> Maybe Natural)
-> (AutoMLJobCompletionCriteria
-> Maybe Natural -> AutoMLJobCompletionCriteria)
-> Lens
AutoMLJobCompletionCriteria
AutoMLJobCompletionCriteria
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoMLJobCompletionCriteria' {Maybe Natural
maxAutoMLJobRuntimeInSeconds :: Maybe Natural
$sel:maxAutoMLJobRuntimeInSeconds:AutoMLJobCompletionCriteria' :: AutoMLJobCompletionCriteria -> Maybe Natural
maxAutoMLJobRuntimeInSeconds} -> Maybe Natural
maxAutoMLJobRuntimeInSeconds) (\s :: AutoMLJobCompletionCriteria
s@AutoMLJobCompletionCriteria' {} Maybe Natural
a -> AutoMLJobCompletionCriteria
s {$sel:maxAutoMLJobRuntimeInSeconds:AutoMLJobCompletionCriteria' :: Maybe Natural
maxAutoMLJobRuntimeInSeconds = Maybe Natural
a} :: AutoMLJobCompletionCriteria)
instance Core.FromJSON AutoMLJobCompletionCriteria where
parseJSON :: Value -> Parser AutoMLJobCompletionCriteria
parseJSON =
String
-> (Object -> Parser AutoMLJobCompletionCriteria)
-> Value
-> Parser AutoMLJobCompletionCriteria
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AutoMLJobCompletionCriteria"
( \Object
x ->
Maybe Natural
-> Maybe Natural -> Maybe Natural -> AutoMLJobCompletionCriteria
AutoMLJobCompletionCriteria'
(Maybe Natural
-> Maybe Natural -> Maybe Natural -> AutoMLJobCompletionCriteria)
-> Parser (Maybe Natural)
-> Parser
(Maybe Natural -> Maybe Natural -> AutoMLJobCompletionCriteria)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MaxCandidates")
Parser
(Maybe Natural -> Maybe Natural -> AutoMLJobCompletionCriteria)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> AutoMLJobCompletionCriteria)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MaxRuntimePerTrainingJobInSeconds")
Parser (Maybe Natural -> AutoMLJobCompletionCriteria)
-> Parser (Maybe Natural) -> Parser AutoMLJobCompletionCriteria
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MaxAutoMLJobRuntimeInSeconds")
)
instance Prelude.Hashable AutoMLJobCompletionCriteria
instance Prelude.NFData AutoMLJobCompletionCriteria
instance Core.ToJSON AutoMLJobCompletionCriteria where
toJSON :: AutoMLJobCompletionCriteria -> Value
toJSON AutoMLJobCompletionCriteria' {Maybe Natural
maxAutoMLJobRuntimeInSeconds :: Maybe Natural
maxRuntimePerTrainingJobInSeconds :: Maybe Natural
maxCandidates :: Maybe Natural
$sel:maxAutoMLJobRuntimeInSeconds:AutoMLJobCompletionCriteria' :: AutoMLJobCompletionCriteria -> Maybe Natural
$sel:maxRuntimePerTrainingJobInSeconds:AutoMLJobCompletionCriteria' :: AutoMLJobCompletionCriteria -> Maybe Natural
$sel:maxCandidates:AutoMLJobCompletionCriteria' :: AutoMLJobCompletionCriteria -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"MaxCandidates" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxCandidates,
(Text
"MaxRuntimePerTrainingJobInSeconds" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxRuntimePerTrainingJobInSeconds,
(Text
"MaxAutoMLJobRuntimeInSeconds" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxAutoMLJobRuntimeInSeconds
]
)