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