{-# 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.ExperimentConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ExperimentConfig = ExperimentConfig'
{
ExperimentConfig -> Maybe Text
trialComponentDisplayName :: Prelude.Maybe Prelude.Text,
ExperimentConfig -> Maybe Text
experimentName :: Prelude.Maybe Prelude.Text,
ExperimentConfig -> Maybe Text
trialName :: Prelude.Maybe Prelude.Text
}
deriving (ExperimentConfig -> ExperimentConfig -> Bool
(ExperimentConfig -> ExperimentConfig -> Bool)
-> (ExperimentConfig -> ExperimentConfig -> Bool)
-> Eq ExperimentConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExperimentConfig -> ExperimentConfig -> Bool
$c/= :: ExperimentConfig -> ExperimentConfig -> Bool
== :: ExperimentConfig -> ExperimentConfig -> Bool
$c== :: ExperimentConfig -> ExperimentConfig -> Bool
Prelude.Eq, ReadPrec [ExperimentConfig]
ReadPrec ExperimentConfig
Int -> ReadS ExperimentConfig
ReadS [ExperimentConfig]
(Int -> ReadS ExperimentConfig)
-> ReadS [ExperimentConfig]
-> ReadPrec ExperimentConfig
-> ReadPrec [ExperimentConfig]
-> Read ExperimentConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExperimentConfig]
$creadListPrec :: ReadPrec [ExperimentConfig]
readPrec :: ReadPrec ExperimentConfig
$creadPrec :: ReadPrec ExperimentConfig
readList :: ReadS [ExperimentConfig]
$creadList :: ReadS [ExperimentConfig]
readsPrec :: Int -> ReadS ExperimentConfig
$creadsPrec :: Int -> ReadS ExperimentConfig
Prelude.Read, Int -> ExperimentConfig -> ShowS
[ExperimentConfig] -> ShowS
ExperimentConfig -> String
(Int -> ExperimentConfig -> ShowS)
-> (ExperimentConfig -> String)
-> ([ExperimentConfig] -> ShowS)
-> Show ExperimentConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExperimentConfig] -> ShowS
$cshowList :: [ExperimentConfig] -> ShowS
show :: ExperimentConfig -> String
$cshow :: ExperimentConfig -> String
showsPrec :: Int -> ExperimentConfig -> ShowS
$cshowsPrec :: Int -> ExperimentConfig -> ShowS
Prelude.Show, (forall x. ExperimentConfig -> Rep ExperimentConfig x)
-> (forall x. Rep ExperimentConfig x -> ExperimentConfig)
-> Generic ExperimentConfig
forall x. Rep ExperimentConfig x -> ExperimentConfig
forall x. ExperimentConfig -> Rep ExperimentConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExperimentConfig x -> ExperimentConfig
$cfrom :: forall x. ExperimentConfig -> Rep ExperimentConfig x
Prelude.Generic)
newExperimentConfig ::
ExperimentConfig
newExperimentConfig :: ExperimentConfig
newExperimentConfig =
ExperimentConfig' :: Maybe Text -> Maybe Text -> Maybe Text -> ExperimentConfig
ExperimentConfig'
{ $sel:trialComponentDisplayName:ExperimentConfig' :: Maybe Text
trialComponentDisplayName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:experimentName:ExperimentConfig' :: Maybe Text
experimentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:trialName:ExperimentConfig' :: Maybe Text
trialName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
experimentConfig_trialComponentDisplayName :: Lens.Lens' ExperimentConfig (Prelude.Maybe Prelude.Text)
experimentConfig_trialComponentDisplayName :: (Maybe Text -> f (Maybe Text))
-> ExperimentConfig -> f ExperimentConfig
experimentConfig_trialComponentDisplayName = (ExperimentConfig -> Maybe Text)
-> (ExperimentConfig -> Maybe Text -> ExperimentConfig)
-> Lens ExperimentConfig ExperimentConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentConfig' {Maybe Text
trialComponentDisplayName :: Maybe Text
$sel:trialComponentDisplayName:ExperimentConfig' :: ExperimentConfig -> Maybe Text
trialComponentDisplayName} -> Maybe Text
trialComponentDisplayName) (\s :: ExperimentConfig
s@ExperimentConfig' {} Maybe Text
a -> ExperimentConfig
s {$sel:trialComponentDisplayName:ExperimentConfig' :: Maybe Text
trialComponentDisplayName = Maybe Text
a} :: ExperimentConfig)
experimentConfig_experimentName :: Lens.Lens' ExperimentConfig (Prelude.Maybe Prelude.Text)
experimentConfig_experimentName :: (Maybe Text -> f (Maybe Text))
-> ExperimentConfig -> f ExperimentConfig
experimentConfig_experimentName = (ExperimentConfig -> Maybe Text)
-> (ExperimentConfig -> Maybe Text -> ExperimentConfig)
-> Lens ExperimentConfig ExperimentConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentConfig' {Maybe Text
experimentName :: Maybe Text
$sel:experimentName:ExperimentConfig' :: ExperimentConfig -> Maybe Text
experimentName} -> Maybe Text
experimentName) (\s :: ExperimentConfig
s@ExperimentConfig' {} Maybe Text
a -> ExperimentConfig
s {$sel:experimentName:ExperimentConfig' :: Maybe Text
experimentName = Maybe Text
a} :: ExperimentConfig)
experimentConfig_trialName :: Lens.Lens' ExperimentConfig (Prelude.Maybe Prelude.Text)
experimentConfig_trialName :: (Maybe Text -> f (Maybe Text))
-> ExperimentConfig -> f ExperimentConfig
experimentConfig_trialName = (ExperimentConfig -> Maybe Text)
-> (ExperimentConfig -> Maybe Text -> ExperimentConfig)
-> Lens ExperimentConfig ExperimentConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentConfig' {Maybe Text
trialName :: Maybe Text
$sel:trialName:ExperimentConfig' :: ExperimentConfig -> Maybe Text
trialName} -> Maybe Text
trialName) (\s :: ExperimentConfig
s@ExperimentConfig' {} Maybe Text
a -> ExperimentConfig
s {$sel:trialName:ExperimentConfig' :: Maybe Text
trialName = Maybe Text
a} :: ExperimentConfig)
instance Core.FromJSON ExperimentConfig where
parseJSON :: Value -> Parser ExperimentConfig
parseJSON =
String
-> (Object -> Parser ExperimentConfig)
-> Value
-> Parser ExperimentConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ExperimentConfig"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> ExperimentConfig
ExperimentConfig'
(Maybe Text -> Maybe Text -> Maybe Text -> ExperimentConfig)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ExperimentConfig)
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
"TrialComponentDisplayName")
Parser (Maybe Text -> Maybe Text -> ExperimentConfig)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ExperimentConfig)
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
"ExperimentName")
Parser (Maybe Text -> ExperimentConfig)
-> Parser (Maybe Text) -> Parser ExperimentConfig
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
"TrialName")
)
instance Prelude.Hashable ExperimentConfig
instance Prelude.NFData ExperimentConfig
instance Core.ToJSON ExperimentConfig where
toJSON :: ExperimentConfig -> Value
toJSON ExperimentConfig' {Maybe Text
trialName :: Maybe Text
experimentName :: Maybe Text
trialComponentDisplayName :: Maybe Text
$sel:trialName:ExperimentConfig' :: ExperimentConfig -> Maybe Text
$sel:experimentName:ExperimentConfig' :: ExperimentConfig -> Maybe Text
$sel:trialComponentDisplayName:ExperimentConfig' :: ExperimentConfig -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"TrialComponentDisplayName" 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
trialComponentDisplayName,
(Text
"ExperimentName" 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
experimentName,
(Text
"TrialName" 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
trialName
]
)