{-# 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.CloudWatch.Types.MetricDatum where
import Amazonka.CloudWatch.Types.Dimension
import Amazonka.CloudWatch.Types.StandardUnit
import Amazonka.CloudWatch.Types.StatisticSet
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data MetricDatum = MetricDatum'
{
MetricDatum -> Maybe [Double]
values :: Prelude.Maybe [Prelude.Double],
MetricDatum -> Maybe [Double]
counts :: Prelude.Maybe [Prelude.Double],
MetricDatum -> Maybe Double
value :: Prelude.Maybe Prelude.Double,
MetricDatum -> Maybe Natural
storageResolution :: Prelude.Maybe Prelude.Natural,
MetricDatum -> Maybe [Dimension]
dimensions :: Prelude.Maybe [Dimension],
MetricDatum -> Maybe StandardUnit
unit :: Prelude.Maybe StandardUnit,
MetricDatum -> Maybe ISO8601
timestamp :: Prelude.Maybe Core.ISO8601,
MetricDatum -> Maybe StatisticSet
statisticValues :: Prelude.Maybe StatisticSet,
MetricDatum -> Text
metricName :: Prelude.Text
}
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 ::
Prelude.Text ->
MetricDatum
newMetricDatum :: Text -> MetricDatum
newMetricDatum Text
pMetricName_ =
MetricDatum' :: Maybe [Double]
-> Maybe [Double]
-> Maybe Double
-> Maybe Natural
-> Maybe [Dimension]
-> Maybe StandardUnit
-> Maybe ISO8601
-> Maybe StatisticSet
-> Text
-> MetricDatum
MetricDatum'
{ $sel:values:MetricDatum' :: Maybe [Double]
values = Maybe [Double]
forall a. Maybe a
Prelude.Nothing,
$sel:counts:MetricDatum' :: Maybe [Double]
counts = Maybe [Double]
forall a. Maybe a
Prelude.Nothing,
$sel:value:MetricDatum' :: Maybe Double
value = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:storageResolution:MetricDatum' :: Maybe Natural
storageResolution = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:dimensions:MetricDatum' :: Maybe [Dimension]
dimensions = Maybe [Dimension]
forall a. Maybe a
Prelude.Nothing,
$sel:unit:MetricDatum' :: Maybe StandardUnit
unit = Maybe StandardUnit
forall a. Maybe a
Prelude.Nothing,
$sel:timestamp:MetricDatum' :: Maybe ISO8601
timestamp = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
$sel:statisticValues:MetricDatum' :: Maybe StatisticSet
statisticValues = Maybe StatisticSet
forall a. Maybe a
Prelude.Nothing,
$sel:metricName:MetricDatum' :: Text
metricName = Text
pMetricName_
}
metricDatum_values :: Lens.Lens' MetricDatum (Prelude.Maybe [Prelude.Double])
metricDatum_values :: (Maybe [Double] -> f (Maybe [Double]))
-> MetricDatum -> f MetricDatum
metricDatum_values = (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]
values :: Maybe [Double]
$sel:values:MetricDatum' :: MetricDatum -> Maybe [Double]
values} -> Maybe [Double]
values) (\s :: MetricDatum
s@MetricDatum' {} Maybe [Double]
a -> MetricDatum
s {$sel:values:MetricDatum' :: Maybe [Double]
values = Maybe [Double]
a} :: MetricDatum) ((Maybe [Double] -> f (Maybe [Double]))
-> MetricDatum -> f MetricDatum)
-> ((Maybe [Double] -> f (Maybe [Double]))
-> Maybe [Double] -> f (Maybe [Double]))
-> (Maybe [Double] -> f (Maybe [Double]))
-> MetricDatum
-> f MetricDatum
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Double] [Double] [Double] [Double]
-> Iso
(Maybe [Double]) (Maybe [Double]) (Maybe [Double]) (Maybe [Double])
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 [Double] [Double] [Double] [Double]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
metricDatum_counts :: Lens.Lens' MetricDatum (Prelude.Maybe [Prelude.Double])
metricDatum_counts :: (Maybe [Double] -> f (Maybe [Double]))
-> MetricDatum -> f MetricDatum
metricDatum_counts = (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]
counts :: Maybe [Double]
$sel:counts:MetricDatum' :: MetricDatum -> Maybe [Double]
counts} -> Maybe [Double]
counts) (\s :: MetricDatum
s@MetricDatum' {} Maybe [Double]
a -> MetricDatum
s {$sel:counts:MetricDatum' :: Maybe [Double]
counts = Maybe [Double]
a} :: MetricDatum) ((Maybe [Double] -> f (Maybe [Double]))
-> MetricDatum -> f MetricDatum)
-> ((Maybe [Double] -> f (Maybe [Double]))
-> Maybe [Double] -> f (Maybe [Double]))
-> (Maybe [Double] -> f (Maybe [Double]))
-> MetricDatum
-> f MetricDatum
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Double] [Double] [Double] [Double]
-> Iso
(Maybe [Double]) (Maybe [Double]) (Maybe [Double]) (Maybe [Double])
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 [Double] [Double] [Double] [Double]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
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)
metricDatum_storageResolution :: Lens.Lens' MetricDatum (Prelude.Maybe Prelude.Natural)
metricDatum_storageResolution :: (Maybe Natural -> f (Maybe Natural))
-> MetricDatum -> f MetricDatum
metricDatum_storageResolution = (MetricDatum -> Maybe Natural)
-> (MetricDatum -> Maybe Natural -> MetricDatum)
-> Lens MetricDatum MetricDatum (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricDatum' {Maybe Natural
storageResolution :: Maybe Natural
$sel:storageResolution:MetricDatum' :: MetricDatum -> Maybe Natural
storageResolution} -> Maybe Natural
storageResolution) (\s :: MetricDatum
s@MetricDatum' {} Maybe Natural
a -> MetricDatum
s {$sel:storageResolution:MetricDatum' :: Maybe Natural
storageResolution = Maybe Natural
a} :: MetricDatum)
metricDatum_dimensions :: Lens.Lens' MetricDatum (Prelude.Maybe [Dimension])
metricDatum_dimensions :: (Maybe [Dimension] -> f (Maybe [Dimension]))
-> MetricDatum -> f MetricDatum
metricDatum_dimensions = (MetricDatum -> Maybe [Dimension])
-> (MetricDatum -> Maybe [Dimension] -> MetricDatum)
-> Lens
MetricDatum MetricDatum (Maybe [Dimension]) (Maybe [Dimension])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricDatum' {Maybe [Dimension]
dimensions :: Maybe [Dimension]
$sel:dimensions:MetricDatum' :: MetricDatum -> Maybe [Dimension]
dimensions} -> Maybe [Dimension]
dimensions) (\s :: MetricDatum
s@MetricDatum' {} Maybe [Dimension]
a -> MetricDatum
s {$sel:dimensions:MetricDatum' :: Maybe [Dimension]
dimensions = Maybe [Dimension]
a} :: MetricDatum) ((Maybe [Dimension] -> f (Maybe [Dimension]))
-> MetricDatum -> f MetricDatum)
-> ((Maybe [Dimension] -> f (Maybe [Dimension]))
-> Maybe [Dimension] -> f (Maybe [Dimension]))
-> (Maybe [Dimension] -> f (Maybe [Dimension]))
-> MetricDatum
-> f MetricDatum
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Dimension] [Dimension] [Dimension] [Dimension]
-> Iso
(Maybe [Dimension])
(Maybe [Dimension])
(Maybe [Dimension])
(Maybe [Dimension])
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 [Dimension] [Dimension] [Dimension] [Dimension]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
metricDatum_unit :: Lens.Lens' MetricDatum (Prelude.Maybe StandardUnit)
metricDatum_unit :: (Maybe StandardUnit -> f (Maybe StandardUnit))
-> MetricDatum -> f MetricDatum
metricDatum_unit = (MetricDatum -> Maybe StandardUnit)
-> (MetricDatum -> Maybe StandardUnit -> MetricDatum)
-> Lens
MetricDatum MetricDatum (Maybe StandardUnit) (Maybe StandardUnit)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricDatum' {Maybe StandardUnit
unit :: Maybe StandardUnit
$sel:unit:MetricDatum' :: MetricDatum -> Maybe StandardUnit
unit} -> Maybe StandardUnit
unit) (\s :: MetricDatum
s@MetricDatum' {} Maybe StandardUnit
a -> MetricDatum
s {$sel:unit:MetricDatum' :: Maybe StandardUnit
unit = Maybe StandardUnit
a} :: MetricDatum)
metricDatum_timestamp :: Lens.Lens' MetricDatum (Prelude.Maybe Prelude.UTCTime)
metricDatum_timestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> MetricDatum -> f MetricDatum
metricDatum_timestamp = (MetricDatum -> Maybe ISO8601)
-> (MetricDatum -> Maybe ISO8601 -> MetricDatum)
-> Lens MetricDatum MetricDatum (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricDatum' {Maybe ISO8601
timestamp :: Maybe ISO8601
$sel:timestamp:MetricDatum' :: MetricDatum -> Maybe ISO8601
timestamp} -> Maybe ISO8601
timestamp) (\s :: MetricDatum
s@MetricDatum' {} Maybe ISO8601
a -> MetricDatum
s {$sel:timestamp:MetricDatum' :: Maybe ISO8601
timestamp = Maybe ISO8601
a} :: MetricDatum) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> MetricDatum -> f MetricDatum)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> MetricDatum
-> f MetricDatum
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
(Maybe ISO8601) (Maybe ISO8601) (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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
metricDatum_statisticValues :: Lens.Lens' MetricDatum (Prelude.Maybe StatisticSet)
metricDatum_statisticValues :: (Maybe StatisticSet -> f (Maybe StatisticSet))
-> MetricDatum -> f MetricDatum
metricDatum_statisticValues = (MetricDatum -> Maybe StatisticSet)
-> (MetricDatum -> Maybe StatisticSet -> MetricDatum)
-> Lens
MetricDatum MetricDatum (Maybe StatisticSet) (Maybe StatisticSet)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricDatum' {Maybe StatisticSet
statisticValues :: Maybe StatisticSet
$sel:statisticValues:MetricDatum' :: MetricDatum -> Maybe StatisticSet
statisticValues} -> Maybe StatisticSet
statisticValues) (\s :: MetricDatum
s@MetricDatum' {} Maybe StatisticSet
a -> MetricDatum
s {$sel:statisticValues:MetricDatum' :: Maybe StatisticSet
statisticValues = Maybe StatisticSet
a} :: MetricDatum)
metricDatum_metricName :: Lens.Lens' MetricDatum Prelude.Text
metricDatum_metricName :: (Text -> f Text) -> MetricDatum -> f MetricDatum
metricDatum_metricName = (MetricDatum -> Text)
-> (MetricDatum -> Text -> MetricDatum)
-> Lens MetricDatum MetricDatum Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricDatum' {Text
metricName :: Text
$sel:metricName:MetricDatum' :: MetricDatum -> Text
metricName} -> Text
metricName) (\s :: MetricDatum
s@MetricDatum' {} Text
a -> MetricDatum
s {$sel:metricName:MetricDatum' :: Text
metricName = Text
a} :: MetricDatum)
instance Prelude.Hashable MetricDatum
instance Prelude.NFData MetricDatum
instance Core.ToQuery MetricDatum where
toQuery :: MetricDatum -> QueryString
toQuery MetricDatum' {Maybe Double
Maybe Natural
Maybe [Double]
Maybe [Dimension]
Maybe ISO8601
Maybe StandardUnit
Maybe StatisticSet
Text
metricName :: Text
statisticValues :: Maybe StatisticSet
timestamp :: Maybe ISO8601
unit :: Maybe StandardUnit
dimensions :: Maybe [Dimension]
storageResolution :: Maybe Natural
value :: Maybe Double
counts :: Maybe [Double]
values :: Maybe [Double]
$sel:metricName:MetricDatum' :: MetricDatum -> Text
$sel:statisticValues:MetricDatum' :: MetricDatum -> Maybe StatisticSet
$sel:timestamp:MetricDatum' :: MetricDatum -> Maybe ISO8601
$sel:unit:MetricDatum' :: MetricDatum -> Maybe StandardUnit
$sel:dimensions:MetricDatum' :: MetricDatum -> Maybe [Dimension]
$sel:storageResolution:MetricDatum' :: MetricDatum -> Maybe Natural
$sel:value:MetricDatum' :: MetricDatum -> Maybe Double
$sel:counts:MetricDatum' :: MetricDatum -> Maybe [Double]
$sel:values:MetricDatum' :: MetricDatum -> Maybe [Double]
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Values"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
(ByteString -> [Double] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Double] -> QueryString) -> Maybe [Double] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Double]
values),
ByteString
"Counts"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
(ByteString -> [Double] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Double] -> QueryString) -> Maybe [Double] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Double]
counts),
ByteString
"Value" ByteString -> Maybe Double -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Double
value,
ByteString
"StorageResolution" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
storageResolution,
ByteString
"Dimensions"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
(ByteString -> [Dimension] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Dimension] -> QueryString)
-> Maybe [Dimension] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Dimension]
dimensions),
ByteString
"Unit" ByteString -> Maybe StandardUnit -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe StandardUnit
unit,
ByteString
"Timestamp" ByteString -> Maybe ISO8601 -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ISO8601
timestamp,
ByteString
"StatisticValues" ByteString -> Maybe StatisticSet -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe StatisticSet
statisticValues,
ByteString
"MetricName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
metricName
]