{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data MetricData = MetricData'
{
MetricData -> Maybe Text
metricName :: Prelude.Maybe Prelude.Text,
MetricData -> Maybe POSIX
timestamp :: Prelude.Maybe Data.POSIX,
MetricData -> Maybe Double
value :: Prelude.Maybe Prelude.Double
}
deriving (MetricData -> MetricData -> Bool
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]
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
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. 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'
{ $sel:metricName:MetricData' :: Maybe Text
metricName = forall a. Maybe a
Prelude.Nothing,
$sel:timestamp:MetricData' :: Maybe POSIX
timestamp = forall a. Maybe a
Prelude.Nothing,
$sel:value:MetricData' :: Maybe Double
value = forall a. Maybe a
Prelude.Nothing
}
metricData_metricName :: Lens.Lens' MetricData (Prelude.Maybe Prelude.Text)
metricData_metricName :: Lens' MetricData (Maybe Text)
metricData_metricName = 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_timestamp :: Lens.Lens' MetricData (Prelude.Maybe Prelude.UTCTime)
metricData_timestamp :: Lens' MetricData (Maybe UTCTime)
metricData_timestamp = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
metricData_value :: Lens.Lens' MetricData (Prelude.Maybe Prelude.Double)
metricData_value :: Lens' MetricData (Maybe Double)
metricData_value = 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)
instance Data.FromJSON MetricData where
parseJSON :: Value -> Parser MetricData
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"MetricData"
( \Object
x ->
Maybe Text -> Maybe POSIX -> Maybe Double -> MetricData
MetricData'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MetricName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Timestamp")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Value")
)
instance Prelude.Hashable MetricData where
hashWithSalt :: Int -> MetricData -> Int
hashWithSalt Int
_salt MetricData' {Maybe Double
Maybe Text
Maybe POSIX
value :: Maybe Double
timestamp :: Maybe POSIX
metricName :: Maybe Text
$sel:value:MetricData' :: MetricData -> Maybe Double
$sel:timestamp:MetricData' :: MetricData -> Maybe POSIX
$sel:metricName:MetricData' :: MetricData -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
metricName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
timestamp
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
value
instance Prelude.NFData MetricData where
rnf :: MetricData -> ()
rnf MetricData' {Maybe Double
Maybe Text
Maybe POSIX
value :: Maybe Double
timestamp :: Maybe POSIX
metricName :: Maybe Text
$sel:value:MetricData' :: MetricData -> Maybe Double
$sel:timestamp:MetricData' :: MetricData -> Maybe POSIX
$sel:metricName:MetricData' :: MetricData -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
metricName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
timestamp
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
value