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