{-# 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.MetricData where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data MetricData = MetricData'
{
MetricData -> Maybe Text
metricName :: Prelude.Maybe Prelude.Text,
MetricData -> Maybe Double
value :: Prelude.Maybe Prelude.Double,
MetricData -> Maybe POSIX
timestamp :: Prelude.Maybe Core.POSIX
}
deriving (MetricData -> MetricData -> Bool
(MetricData -> MetricData -> Bool)
-> (MetricData -> MetricData -> Bool) -> Eq MetricData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MetricData -> MetricData -> Bool
$c/= :: MetricData -> MetricData -> Bool
== :: MetricData -> MetricData -> Bool
$c== :: MetricData -> MetricData -> Bool
Prelude.Eq, ReadPrec [MetricData]
ReadPrec MetricData
Int -> ReadS MetricData
ReadS [MetricData]
(Int -> ReadS MetricData)
-> ReadS [MetricData]
-> ReadPrec MetricData
-> ReadPrec [MetricData]
-> Read MetricData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MetricData]
$creadListPrec :: ReadPrec [MetricData]
readPrec :: ReadPrec MetricData
$creadPrec :: ReadPrec MetricData
readList :: ReadS [MetricData]
$creadList :: ReadS [MetricData]
readsPrec :: Int -> ReadS MetricData
$creadsPrec :: Int -> ReadS MetricData
Prelude.Read, Int -> MetricData -> ShowS
[MetricData] -> ShowS
MetricData -> String
(Int -> MetricData -> ShowS)
-> (MetricData -> String)
-> ([MetricData] -> ShowS)
-> Show MetricData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MetricData] -> ShowS
$cshowList :: [MetricData] -> ShowS
show :: MetricData -> String
$cshow :: MetricData -> String
showsPrec :: Int -> MetricData -> ShowS
$cshowsPrec :: Int -> MetricData -> ShowS
Prelude.Show, (forall x. MetricData -> Rep MetricData x)
-> (forall x. Rep MetricData x -> MetricData) -> Generic MetricData
forall x. Rep MetricData x -> MetricData
forall x. MetricData -> Rep MetricData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MetricData x -> MetricData
$cfrom :: forall x. MetricData -> Rep MetricData x
Prelude.Generic)
newMetricData ::
MetricData
newMetricData :: MetricData
newMetricData =
MetricData' :: Maybe Text -> Maybe Double -> Maybe POSIX -> MetricData
MetricData'
{ $sel:metricName:MetricData' :: Maybe Text
metricName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:value:MetricData' :: Maybe Double
value = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:timestamp:MetricData' :: Maybe POSIX
timestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
metricData_metricName :: Lens.Lens' MetricData (Prelude.Maybe Prelude.Text)
metricData_metricName :: (Maybe Text -> f (Maybe Text)) -> MetricData -> f MetricData
metricData_metricName = (MetricData -> Maybe Text)
-> (MetricData -> Maybe Text -> MetricData)
-> Lens MetricData MetricData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricData' {Maybe Text
metricName :: Maybe Text
$sel:metricName:MetricData' :: MetricData -> Maybe Text
metricName} -> Maybe Text
metricName) (\s :: MetricData
s@MetricData' {} Maybe Text
a -> MetricData
s {$sel:metricName:MetricData' :: Maybe Text
metricName = Maybe Text
a} :: MetricData)
metricData_value :: Lens.Lens' MetricData (Prelude.Maybe Prelude.Double)
metricData_value :: (Maybe Double -> f (Maybe Double)) -> MetricData -> f MetricData
metricData_value = (MetricData -> Maybe Double)
-> (MetricData -> Maybe Double -> MetricData)
-> Lens MetricData MetricData (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricData' {Maybe Double
value :: Maybe Double
$sel:value:MetricData' :: MetricData -> Maybe Double
value} -> Maybe Double
value) (\s :: MetricData
s@MetricData' {} Maybe Double
a -> MetricData
s {$sel:value:MetricData' :: Maybe Double
value = Maybe Double
a} :: MetricData)
metricData_timestamp :: Lens.Lens' MetricData (Prelude.Maybe Prelude.UTCTime)
metricData_timestamp :: (Maybe UTCTime -> f (Maybe UTCTime)) -> MetricData -> f MetricData
metricData_timestamp = (MetricData -> Maybe POSIX)
-> (MetricData -> Maybe POSIX -> MetricData)
-> Lens MetricData MetricData (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricData' {Maybe POSIX
timestamp :: Maybe POSIX
$sel:timestamp:MetricData' :: MetricData -> Maybe POSIX
timestamp} -> Maybe POSIX
timestamp) (\s :: MetricData
s@MetricData' {} Maybe POSIX
a -> MetricData
s {$sel:timestamp:MetricData' :: Maybe POSIX
timestamp = Maybe POSIX
a} :: MetricData) ((Maybe POSIX -> f (Maybe POSIX)) -> MetricData -> f MetricData)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> MetricData
-> f MetricData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON MetricData where
parseJSON :: Value -> Parser MetricData
parseJSON =
String
-> (Object -> Parser MetricData) -> Value -> Parser MetricData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MetricData"
( \Object
x ->
Maybe Text -> Maybe Double -> Maybe POSIX -> MetricData
MetricData'
(Maybe Text -> Maybe Double -> Maybe POSIX -> MetricData)
-> Parser (Maybe Text)
-> Parser (Maybe Double -> Maybe POSIX -> MetricData)
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
"MetricName")
Parser (Maybe Double -> Maybe POSIX -> MetricData)
-> Parser (Maybe Double) -> Parser (Maybe POSIX -> MetricData)
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")
Parser (Maybe POSIX -> MetricData)
-> Parser (Maybe POSIX) -> Parser MetricData
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Timestamp")
)
instance Prelude.Hashable MetricData
instance Prelude.NFData MetricData