{-# 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.MetricDatum where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.AutoMLMetricEnum
import Amazonka.SageMaker.Types.MetricSetSource
data MetricDatum = MetricDatum'
{
MetricDatum -> Maybe MetricSetSource
set :: Prelude.Maybe MetricSetSource,
MetricDatum -> Maybe AutoMLMetricEnum
metricName :: Prelude.Maybe AutoMLMetricEnum,
MetricDatum -> Maybe Double
value :: Prelude.Maybe Prelude.Double
}
deriving (MetricDatum -> MetricDatum -> Bool
(MetricDatum -> MetricDatum -> Bool)
-> (MetricDatum -> MetricDatum -> Bool) -> Eq MetricDatum
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MetricDatum -> MetricDatum -> Bool
$c/= :: MetricDatum -> MetricDatum -> Bool
== :: MetricDatum -> MetricDatum -> Bool
$c== :: MetricDatum -> MetricDatum -> Bool
Prelude.Eq, ReadPrec [MetricDatum]
ReadPrec MetricDatum
Int -> ReadS MetricDatum
ReadS [MetricDatum]
(Int -> ReadS MetricDatum)
-> ReadS [MetricDatum]
-> ReadPrec MetricDatum
-> ReadPrec [MetricDatum]
-> Read MetricDatum
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MetricDatum]
$creadListPrec :: ReadPrec [MetricDatum]
readPrec :: ReadPrec MetricDatum
$creadPrec :: ReadPrec MetricDatum
readList :: ReadS [MetricDatum]
$creadList :: ReadS [MetricDatum]
readsPrec :: Int -> ReadS MetricDatum
$creadsPrec :: Int -> ReadS MetricDatum
Prelude.Read, Int -> MetricDatum -> ShowS
[MetricDatum] -> ShowS
MetricDatum -> String
(Int -> MetricDatum -> ShowS)
-> (MetricDatum -> String)
-> ([MetricDatum] -> ShowS)
-> Show MetricDatum
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MetricDatum] -> ShowS
$cshowList :: [MetricDatum] -> ShowS
show :: MetricDatum -> String
$cshow :: MetricDatum -> String
showsPrec :: Int -> MetricDatum -> ShowS
$cshowsPrec :: Int -> MetricDatum -> ShowS
Prelude.Show, (forall x. MetricDatum -> Rep MetricDatum x)
-> (forall x. Rep MetricDatum x -> MetricDatum)
-> Generic MetricDatum
forall x. Rep MetricDatum x -> MetricDatum
forall x. MetricDatum -> Rep MetricDatum x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MetricDatum x -> MetricDatum
$cfrom :: forall x. MetricDatum -> Rep MetricDatum x
Prelude.Generic)
newMetricDatum ::
MetricDatum
newMetricDatum :: MetricDatum
newMetricDatum =
MetricDatum' :: Maybe MetricSetSource
-> Maybe AutoMLMetricEnum -> Maybe Double -> MetricDatum
MetricDatum'
{ $sel:set:MetricDatum' :: Maybe MetricSetSource
set = Maybe MetricSetSource
forall a. Maybe a
Prelude.Nothing,
$sel:metricName:MetricDatum' :: Maybe AutoMLMetricEnum
metricName = Maybe AutoMLMetricEnum
forall a. Maybe a
Prelude.Nothing,
$sel:value:MetricDatum' :: Maybe Double
value = Maybe Double
forall a. Maybe a
Prelude.Nothing
}
metricDatum_set :: Lens.Lens' MetricDatum (Prelude.Maybe MetricSetSource)
metricDatum_set :: (Maybe MetricSetSource -> f (Maybe MetricSetSource))
-> MetricDatum -> f MetricDatum
metricDatum_set = (MetricDatum -> Maybe MetricSetSource)
-> (MetricDatum -> Maybe MetricSetSource -> MetricDatum)
-> Lens
MetricDatum
MetricDatum
(Maybe MetricSetSource)
(Maybe MetricSetSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricDatum' {Maybe MetricSetSource
set :: Maybe MetricSetSource
$sel:set:MetricDatum' :: MetricDatum -> Maybe MetricSetSource
set} -> Maybe MetricSetSource
set) (\s :: MetricDatum
s@MetricDatum' {} Maybe MetricSetSource
a -> MetricDatum
s {$sel:set:MetricDatum' :: Maybe MetricSetSource
set = Maybe MetricSetSource
a} :: MetricDatum)
metricDatum_metricName :: Lens.Lens' MetricDatum (Prelude.Maybe AutoMLMetricEnum)
metricDatum_metricName :: (Maybe AutoMLMetricEnum -> f (Maybe AutoMLMetricEnum))
-> MetricDatum -> f MetricDatum
metricDatum_metricName = (MetricDatum -> Maybe AutoMLMetricEnum)
-> (MetricDatum -> Maybe AutoMLMetricEnum -> MetricDatum)
-> Lens
MetricDatum
MetricDatum
(Maybe AutoMLMetricEnum)
(Maybe AutoMLMetricEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricDatum' {Maybe AutoMLMetricEnum
metricName :: Maybe AutoMLMetricEnum
$sel:metricName:MetricDatum' :: MetricDatum -> Maybe AutoMLMetricEnum
metricName} -> Maybe AutoMLMetricEnum
metricName) (\s :: MetricDatum
s@MetricDatum' {} Maybe AutoMLMetricEnum
a -> MetricDatum
s {$sel:metricName:MetricDatum' :: Maybe AutoMLMetricEnum
metricName = Maybe AutoMLMetricEnum
a} :: MetricDatum)
metricDatum_value :: Lens.Lens' MetricDatum (Prelude.Maybe Prelude.Double)
metricDatum_value :: (Maybe Double -> f (Maybe Double)) -> MetricDatum -> f MetricDatum
metricDatum_value = (MetricDatum -> Maybe Double)
-> (MetricDatum -> Maybe Double -> MetricDatum)
-> Lens MetricDatum MetricDatum (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricDatum' {Maybe Double
value :: Maybe Double
$sel:value:MetricDatum' :: MetricDatum -> Maybe Double
value} -> Maybe Double
value) (\s :: MetricDatum
s@MetricDatum' {} Maybe Double
a -> MetricDatum
s {$sel:value:MetricDatum' :: Maybe Double
value = Maybe Double
a} :: MetricDatum)
instance Core.FromJSON MetricDatum where
parseJSON :: Value -> Parser MetricDatum
parseJSON =
String
-> (Object -> Parser MetricDatum) -> Value -> Parser MetricDatum
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MetricDatum"
( \Object
x ->
Maybe MetricSetSource
-> Maybe AutoMLMetricEnum -> Maybe Double -> MetricDatum
MetricDatum'
(Maybe MetricSetSource
-> Maybe AutoMLMetricEnum -> Maybe Double -> MetricDatum)
-> Parser (Maybe MetricSetSource)
-> Parser (Maybe AutoMLMetricEnum -> Maybe Double -> MetricDatum)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe MetricSetSource)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Set")
Parser (Maybe AutoMLMetricEnum -> Maybe Double -> MetricDatum)
-> Parser (Maybe AutoMLMetricEnum)
-> Parser (Maybe Double -> MetricDatum)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AutoMLMetricEnum)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MetricName")
Parser (Maybe Double -> MetricDatum)
-> Parser (Maybe Double) -> Parser MetricDatum
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Value")
)
instance Prelude.Hashable MetricDatum
instance Prelude.NFData MetricDatum