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