{-# 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.HyperParameterTuningJobObjective where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.HyperParameterTuningJobObjectiveType
data HyperParameterTuningJobObjective = HyperParameterTuningJobObjective'
{
HyperParameterTuningJobObjective
-> HyperParameterTuningJobObjectiveType
type' :: HyperParameterTuningJobObjectiveType,
HyperParameterTuningJobObjective -> Text
metricName :: Prelude.Text
}
deriving (HyperParameterTuningJobObjective
-> HyperParameterTuningJobObjective -> Bool
(HyperParameterTuningJobObjective
-> HyperParameterTuningJobObjective -> Bool)
-> (HyperParameterTuningJobObjective
-> HyperParameterTuningJobObjective -> Bool)
-> Eq HyperParameterTuningJobObjective
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HyperParameterTuningJobObjective
-> HyperParameterTuningJobObjective -> Bool
$c/= :: HyperParameterTuningJobObjective
-> HyperParameterTuningJobObjective -> Bool
== :: HyperParameterTuningJobObjective
-> HyperParameterTuningJobObjective -> Bool
$c== :: HyperParameterTuningJobObjective
-> HyperParameterTuningJobObjective -> Bool
Prelude.Eq, ReadPrec [HyperParameterTuningJobObjective]
ReadPrec HyperParameterTuningJobObjective
Int -> ReadS HyperParameterTuningJobObjective
ReadS [HyperParameterTuningJobObjective]
(Int -> ReadS HyperParameterTuningJobObjective)
-> ReadS [HyperParameterTuningJobObjective]
-> ReadPrec HyperParameterTuningJobObjective
-> ReadPrec [HyperParameterTuningJobObjective]
-> Read HyperParameterTuningJobObjective
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HyperParameterTuningJobObjective]
$creadListPrec :: ReadPrec [HyperParameterTuningJobObjective]
readPrec :: ReadPrec HyperParameterTuningJobObjective
$creadPrec :: ReadPrec HyperParameterTuningJobObjective
readList :: ReadS [HyperParameterTuningJobObjective]
$creadList :: ReadS [HyperParameterTuningJobObjective]
readsPrec :: Int -> ReadS HyperParameterTuningJobObjective
$creadsPrec :: Int -> ReadS HyperParameterTuningJobObjective
Prelude.Read, Int -> HyperParameterTuningJobObjective -> ShowS
[HyperParameterTuningJobObjective] -> ShowS
HyperParameterTuningJobObjective -> String
(Int -> HyperParameterTuningJobObjective -> ShowS)
-> (HyperParameterTuningJobObjective -> String)
-> ([HyperParameterTuningJobObjective] -> ShowS)
-> Show HyperParameterTuningJobObjective
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HyperParameterTuningJobObjective] -> ShowS
$cshowList :: [HyperParameterTuningJobObjective] -> ShowS
show :: HyperParameterTuningJobObjective -> String
$cshow :: HyperParameterTuningJobObjective -> String
showsPrec :: Int -> HyperParameterTuningJobObjective -> ShowS
$cshowsPrec :: Int -> HyperParameterTuningJobObjective -> ShowS
Prelude.Show, (forall x.
HyperParameterTuningJobObjective
-> Rep HyperParameterTuningJobObjective x)
-> (forall x.
Rep HyperParameterTuningJobObjective x
-> HyperParameterTuningJobObjective)
-> Generic HyperParameterTuningJobObjective
forall x.
Rep HyperParameterTuningJobObjective x
-> HyperParameterTuningJobObjective
forall x.
HyperParameterTuningJobObjective
-> Rep HyperParameterTuningJobObjective x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep HyperParameterTuningJobObjective x
-> HyperParameterTuningJobObjective
$cfrom :: forall x.
HyperParameterTuningJobObjective
-> Rep HyperParameterTuningJobObjective x
Prelude.Generic)
newHyperParameterTuningJobObjective ::
HyperParameterTuningJobObjectiveType ->
Prelude.Text ->
HyperParameterTuningJobObjective
newHyperParameterTuningJobObjective :: HyperParameterTuningJobObjectiveType
-> Text -> HyperParameterTuningJobObjective
newHyperParameterTuningJobObjective
HyperParameterTuningJobObjectiveType
pType_
Text
pMetricName_ =
HyperParameterTuningJobObjective' :: HyperParameterTuningJobObjectiveType
-> Text -> HyperParameterTuningJobObjective
HyperParameterTuningJobObjective'
{ $sel:type':HyperParameterTuningJobObjective' :: HyperParameterTuningJobObjectiveType
type' = HyperParameterTuningJobObjectiveType
pType_,
$sel:metricName:HyperParameterTuningJobObjective' :: Text
metricName = Text
pMetricName_
}
hyperParameterTuningJobObjective_type :: Lens.Lens' HyperParameterTuningJobObjective HyperParameterTuningJobObjectiveType
hyperParameterTuningJobObjective_type :: (HyperParameterTuningJobObjectiveType
-> f HyperParameterTuningJobObjectiveType)
-> HyperParameterTuningJobObjective
-> f HyperParameterTuningJobObjective
hyperParameterTuningJobObjective_type = (HyperParameterTuningJobObjective
-> HyperParameterTuningJobObjectiveType)
-> (HyperParameterTuningJobObjective
-> HyperParameterTuningJobObjectiveType
-> HyperParameterTuningJobObjective)
-> Lens
HyperParameterTuningJobObjective
HyperParameterTuningJobObjective
HyperParameterTuningJobObjectiveType
HyperParameterTuningJobObjectiveType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HyperParameterTuningJobObjective' {HyperParameterTuningJobObjectiveType
type' :: HyperParameterTuningJobObjectiveType
$sel:type':HyperParameterTuningJobObjective' :: HyperParameterTuningJobObjective
-> HyperParameterTuningJobObjectiveType
type'} -> HyperParameterTuningJobObjectiveType
type') (\s :: HyperParameterTuningJobObjective
s@HyperParameterTuningJobObjective' {} HyperParameterTuningJobObjectiveType
a -> HyperParameterTuningJobObjective
s {$sel:type':HyperParameterTuningJobObjective' :: HyperParameterTuningJobObjectiveType
type' = HyperParameterTuningJobObjectiveType
a} :: HyperParameterTuningJobObjective)
hyperParameterTuningJobObjective_metricName :: Lens.Lens' HyperParameterTuningJobObjective Prelude.Text
hyperParameterTuningJobObjective_metricName :: (Text -> f Text)
-> HyperParameterTuningJobObjective
-> f HyperParameterTuningJobObjective
hyperParameterTuningJobObjective_metricName = (HyperParameterTuningJobObjective -> Text)
-> (HyperParameterTuningJobObjective
-> Text -> HyperParameterTuningJobObjective)
-> Lens
HyperParameterTuningJobObjective
HyperParameterTuningJobObjective
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HyperParameterTuningJobObjective' {Text
metricName :: Text
$sel:metricName:HyperParameterTuningJobObjective' :: HyperParameterTuningJobObjective -> Text
metricName} -> Text
metricName) (\s :: HyperParameterTuningJobObjective
s@HyperParameterTuningJobObjective' {} Text
a -> HyperParameterTuningJobObjective
s {$sel:metricName:HyperParameterTuningJobObjective' :: Text
metricName = Text
a} :: HyperParameterTuningJobObjective)
instance
Core.FromJSON
HyperParameterTuningJobObjective
where
parseJSON :: Value -> Parser HyperParameterTuningJobObjective
parseJSON =
String
-> (Object -> Parser HyperParameterTuningJobObjective)
-> Value
-> Parser HyperParameterTuningJobObjective
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HyperParameterTuningJobObjective"
( \Object
x ->
HyperParameterTuningJobObjectiveType
-> Text -> HyperParameterTuningJobObjective
HyperParameterTuningJobObjective'
(HyperParameterTuningJobObjectiveType
-> Text -> HyperParameterTuningJobObjective)
-> Parser HyperParameterTuningJobObjectiveType
-> Parser (Text -> HyperParameterTuningJobObjective)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser HyperParameterTuningJobObjectiveType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Type")
Parser (Text -> HyperParameterTuningJobObjective)
-> Parser Text -> Parser HyperParameterTuningJobObjective
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"MetricName")
)
instance
Prelude.Hashable
HyperParameterTuningJobObjective
instance
Prelude.NFData
HyperParameterTuningJobObjective
instance Core.ToJSON HyperParameterTuningJobObjective where
toJSON :: HyperParameterTuningJobObjective -> Value
toJSON HyperParameterTuningJobObjective' {Text
HyperParameterTuningJobObjectiveType
metricName :: Text
type' :: HyperParameterTuningJobObjectiveType
$sel:metricName:HyperParameterTuningJobObjective' :: HyperParameterTuningJobObjective -> Text
$sel:type':HyperParameterTuningJobObjective' :: HyperParameterTuningJobObjective
-> HyperParameterTuningJobObjectiveType
..} =
[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
"Type" Text -> HyperParameterTuningJobObjectiveType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= HyperParameterTuningJobObjectiveType
type'),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"MetricName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
metricName)
]
)