{-# 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.InsightRuleMetricDatapoint where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InsightRuleMetricDatapoint = InsightRuleMetricDatapoint'
{
InsightRuleMetricDatapoint -> Maybe Double
maxContributorValue :: Prelude.Maybe Prelude.Double,
InsightRuleMetricDatapoint -> Maybe Double
sampleCount :: Prelude.Maybe Prelude.Double,
InsightRuleMetricDatapoint -> Maybe Double
maximum :: Prelude.Maybe Prelude.Double,
InsightRuleMetricDatapoint -> Maybe Double
average :: Prelude.Maybe Prelude.Double,
InsightRuleMetricDatapoint -> Maybe Double
minimum :: Prelude.Maybe Prelude.Double,
InsightRuleMetricDatapoint -> Maybe Double
uniqueContributors :: Prelude.Maybe Prelude.Double,
InsightRuleMetricDatapoint -> Maybe Double
sum :: Prelude.Maybe Prelude.Double,
InsightRuleMetricDatapoint -> ISO8601
timestamp :: Core.ISO8601
}
deriving (InsightRuleMetricDatapoint -> InsightRuleMetricDatapoint -> Bool
(InsightRuleMetricDatapoint -> InsightRuleMetricDatapoint -> Bool)
-> (InsightRuleMetricDatapoint
-> InsightRuleMetricDatapoint -> Bool)
-> Eq InsightRuleMetricDatapoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InsightRuleMetricDatapoint -> InsightRuleMetricDatapoint -> Bool
$c/= :: InsightRuleMetricDatapoint -> InsightRuleMetricDatapoint -> Bool
== :: InsightRuleMetricDatapoint -> InsightRuleMetricDatapoint -> Bool
$c== :: InsightRuleMetricDatapoint -> InsightRuleMetricDatapoint -> Bool
Prelude.Eq, ReadPrec [InsightRuleMetricDatapoint]
ReadPrec InsightRuleMetricDatapoint
Int -> ReadS InsightRuleMetricDatapoint
ReadS [InsightRuleMetricDatapoint]
(Int -> ReadS InsightRuleMetricDatapoint)
-> ReadS [InsightRuleMetricDatapoint]
-> ReadPrec InsightRuleMetricDatapoint
-> ReadPrec [InsightRuleMetricDatapoint]
-> Read InsightRuleMetricDatapoint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InsightRuleMetricDatapoint]
$creadListPrec :: ReadPrec [InsightRuleMetricDatapoint]
readPrec :: ReadPrec InsightRuleMetricDatapoint
$creadPrec :: ReadPrec InsightRuleMetricDatapoint
readList :: ReadS [InsightRuleMetricDatapoint]
$creadList :: ReadS [InsightRuleMetricDatapoint]
readsPrec :: Int -> ReadS InsightRuleMetricDatapoint
$creadsPrec :: Int -> ReadS InsightRuleMetricDatapoint
Prelude.Read, Int -> InsightRuleMetricDatapoint -> ShowS
[InsightRuleMetricDatapoint] -> ShowS
InsightRuleMetricDatapoint -> String
(Int -> InsightRuleMetricDatapoint -> ShowS)
-> (InsightRuleMetricDatapoint -> String)
-> ([InsightRuleMetricDatapoint] -> ShowS)
-> Show InsightRuleMetricDatapoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InsightRuleMetricDatapoint] -> ShowS
$cshowList :: [InsightRuleMetricDatapoint] -> ShowS
show :: InsightRuleMetricDatapoint -> String
$cshow :: InsightRuleMetricDatapoint -> String
showsPrec :: Int -> InsightRuleMetricDatapoint -> ShowS
$cshowsPrec :: Int -> InsightRuleMetricDatapoint -> ShowS
Prelude.Show, (forall x.
InsightRuleMetricDatapoint -> Rep InsightRuleMetricDatapoint x)
-> (forall x.
Rep InsightRuleMetricDatapoint x -> InsightRuleMetricDatapoint)
-> Generic InsightRuleMetricDatapoint
forall x.
Rep InsightRuleMetricDatapoint x -> InsightRuleMetricDatapoint
forall x.
InsightRuleMetricDatapoint -> Rep InsightRuleMetricDatapoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InsightRuleMetricDatapoint x -> InsightRuleMetricDatapoint
$cfrom :: forall x.
InsightRuleMetricDatapoint -> Rep InsightRuleMetricDatapoint x
Prelude.Generic)
newInsightRuleMetricDatapoint ::
Prelude.UTCTime ->
InsightRuleMetricDatapoint
newInsightRuleMetricDatapoint :: UTCTime -> InsightRuleMetricDatapoint
newInsightRuleMetricDatapoint UTCTime
pTimestamp_ =
InsightRuleMetricDatapoint' :: Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> ISO8601
-> InsightRuleMetricDatapoint
InsightRuleMetricDatapoint'
{ $sel:maxContributorValue:InsightRuleMetricDatapoint' :: Maybe Double
maxContributorValue =
Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:sampleCount:InsightRuleMetricDatapoint' :: Maybe Double
sampleCount = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:maximum:InsightRuleMetricDatapoint' :: Maybe Double
maximum = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:average:InsightRuleMetricDatapoint' :: Maybe Double
average = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:minimum:InsightRuleMetricDatapoint' :: Maybe Double
minimum = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:uniqueContributors:InsightRuleMetricDatapoint' :: Maybe Double
uniqueContributors = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:sum:InsightRuleMetricDatapoint' :: Maybe Double
sum = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:timestamp:InsightRuleMetricDatapoint' :: ISO8601
timestamp = Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601))
-> UTCTime -> ISO8601
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pTimestamp_
}
insightRuleMetricDatapoint_maxContributorValue :: Lens.Lens' InsightRuleMetricDatapoint (Prelude.Maybe Prelude.Double)
insightRuleMetricDatapoint_maxContributorValue :: (Maybe Double -> f (Maybe Double))
-> InsightRuleMetricDatapoint -> f InsightRuleMetricDatapoint
insightRuleMetricDatapoint_maxContributorValue = (InsightRuleMetricDatapoint -> Maybe Double)
-> (InsightRuleMetricDatapoint
-> Maybe Double -> InsightRuleMetricDatapoint)
-> Lens
InsightRuleMetricDatapoint
InsightRuleMetricDatapoint
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleMetricDatapoint' {Maybe Double
maxContributorValue :: Maybe Double
$sel:maxContributorValue:InsightRuleMetricDatapoint' :: InsightRuleMetricDatapoint -> Maybe Double
maxContributorValue} -> Maybe Double
maxContributorValue) (\s :: InsightRuleMetricDatapoint
s@InsightRuleMetricDatapoint' {} Maybe Double
a -> InsightRuleMetricDatapoint
s {$sel:maxContributorValue:InsightRuleMetricDatapoint' :: Maybe Double
maxContributorValue = Maybe Double
a} :: InsightRuleMetricDatapoint)
insightRuleMetricDatapoint_sampleCount :: Lens.Lens' InsightRuleMetricDatapoint (Prelude.Maybe Prelude.Double)
insightRuleMetricDatapoint_sampleCount :: (Maybe Double -> f (Maybe Double))
-> InsightRuleMetricDatapoint -> f InsightRuleMetricDatapoint
insightRuleMetricDatapoint_sampleCount = (InsightRuleMetricDatapoint -> Maybe Double)
-> (InsightRuleMetricDatapoint
-> Maybe Double -> InsightRuleMetricDatapoint)
-> Lens
InsightRuleMetricDatapoint
InsightRuleMetricDatapoint
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleMetricDatapoint' {Maybe Double
sampleCount :: Maybe Double
$sel:sampleCount:InsightRuleMetricDatapoint' :: InsightRuleMetricDatapoint -> Maybe Double
sampleCount} -> Maybe Double
sampleCount) (\s :: InsightRuleMetricDatapoint
s@InsightRuleMetricDatapoint' {} Maybe Double
a -> InsightRuleMetricDatapoint
s {$sel:sampleCount:InsightRuleMetricDatapoint' :: Maybe Double
sampleCount = Maybe Double
a} :: InsightRuleMetricDatapoint)
insightRuleMetricDatapoint_maximum :: Lens.Lens' InsightRuleMetricDatapoint (Prelude.Maybe Prelude.Double)
insightRuleMetricDatapoint_maximum :: (Maybe Double -> f (Maybe Double))
-> InsightRuleMetricDatapoint -> f InsightRuleMetricDatapoint
insightRuleMetricDatapoint_maximum = (InsightRuleMetricDatapoint -> Maybe Double)
-> (InsightRuleMetricDatapoint
-> Maybe Double -> InsightRuleMetricDatapoint)
-> Lens
InsightRuleMetricDatapoint
InsightRuleMetricDatapoint
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleMetricDatapoint' {Maybe Double
maximum :: Maybe Double
$sel:maximum:InsightRuleMetricDatapoint' :: InsightRuleMetricDatapoint -> Maybe Double
maximum} -> Maybe Double
maximum) (\s :: InsightRuleMetricDatapoint
s@InsightRuleMetricDatapoint' {} Maybe Double
a -> InsightRuleMetricDatapoint
s {$sel:maximum:InsightRuleMetricDatapoint' :: Maybe Double
maximum = Maybe Double
a} :: InsightRuleMetricDatapoint)
insightRuleMetricDatapoint_average :: Lens.Lens' InsightRuleMetricDatapoint (Prelude.Maybe Prelude.Double)
insightRuleMetricDatapoint_average :: (Maybe Double -> f (Maybe Double))
-> InsightRuleMetricDatapoint -> f InsightRuleMetricDatapoint
insightRuleMetricDatapoint_average = (InsightRuleMetricDatapoint -> Maybe Double)
-> (InsightRuleMetricDatapoint
-> Maybe Double -> InsightRuleMetricDatapoint)
-> Lens
InsightRuleMetricDatapoint
InsightRuleMetricDatapoint
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleMetricDatapoint' {Maybe Double
average :: Maybe Double
$sel:average:InsightRuleMetricDatapoint' :: InsightRuleMetricDatapoint -> Maybe Double
average} -> Maybe Double
average) (\s :: InsightRuleMetricDatapoint
s@InsightRuleMetricDatapoint' {} Maybe Double
a -> InsightRuleMetricDatapoint
s {$sel:average:InsightRuleMetricDatapoint' :: Maybe Double
average = Maybe Double
a} :: InsightRuleMetricDatapoint)
insightRuleMetricDatapoint_minimum :: Lens.Lens' InsightRuleMetricDatapoint (Prelude.Maybe Prelude.Double)
insightRuleMetricDatapoint_minimum :: (Maybe Double -> f (Maybe Double))
-> InsightRuleMetricDatapoint -> f InsightRuleMetricDatapoint
insightRuleMetricDatapoint_minimum = (InsightRuleMetricDatapoint -> Maybe Double)
-> (InsightRuleMetricDatapoint
-> Maybe Double -> InsightRuleMetricDatapoint)
-> Lens
InsightRuleMetricDatapoint
InsightRuleMetricDatapoint
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleMetricDatapoint' {Maybe Double
minimum :: Maybe Double
$sel:minimum:InsightRuleMetricDatapoint' :: InsightRuleMetricDatapoint -> Maybe Double
minimum} -> Maybe Double
minimum) (\s :: InsightRuleMetricDatapoint
s@InsightRuleMetricDatapoint' {} Maybe Double
a -> InsightRuleMetricDatapoint
s {$sel:minimum:InsightRuleMetricDatapoint' :: Maybe Double
minimum = Maybe Double
a} :: InsightRuleMetricDatapoint)
insightRuleMetricDatapoint_uniqueContributors :: Lens.Lens' InsightRuleMetricDatapoint (Prelude.Maybe Prelude.Double)
insightRuleMetricDatapoint_uniqueContributors :: (Maybe Double -> f (Maybe Double))
-> InsightRuleMetricDatapoint -> f InsightRuleMetricDatapoint
insightRuleMetricDatapoint_uniqueContributors = (InsightRuleMetricDatapoint -> Maybe Double)
-> (InsightRuleMetricDatapoint
-> Maybe Double -> InsightRuleMetricDatapoint)
-> Lens
InsightRuleMetricDatapoint
InsightRuleMetricDatapoint
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleMetricDatapoint' {Maybe Double
uniqueContributors :: Maybe Double
$sel:uniqueContributors:InsightRuleMetricDatapoint' :: InsightRuleMetricDatapoint -> Maybe Double
uniqueContributors} -> Maybe Double
uniqueContributors) (\s :: InsightRuleMetricDatapoint
s@InsightRuleMetricDatapoint' {} Maybe Double
a -> InsightRuleMetricDatapoint
s {$sel:uniqueContributors:InsightRuleMetricDatapoint' :: Maybe Double
uniqueContributors = Maybe Double
a} :: InsightRuleMetricDatapoint)
insightRuleMetricDatapoint_sum :: Lens.Lens' InsightRuleMetricDatapoint (Prelude.Maybe Prelude.Double)
insightRuleMetricDatapoint_sum :: (Maybe Double -> f (Maybe Double))
-> InsightRuleMetricDatapoint -> f InsightRuleMetricDatapoint
insightRuleMetricDatapoint_sum = (InsightRuleMetricDatapoint -> Maybe Double)
-> (InsightRuleMetricDatapoint
-> Maybe Double -> InsightRuleMetricDatapoint)
-> Lens
InsightRuleMetricDatapoint
InsightRuleMetricDatapoint
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleMetricDatapoint' {Maybe Double
sum :: Maybe Double
$sel:sum:InsightRuleMetricDatapoint' :: InsightRuleMetricDatapoint -> Maybe Double
sum} -> Maybe Double
sum) (\s :: InsightRuleMetricDatapoint
s@InsightRuleMetricDatapoint' {} Maybe Double
a -> InsightRuleMetricDatapoint
s {$sel:sum:InsightRuleMetricDatapoint' :: Maybe Double
sum = Maybe Double
a} :: InsightRuleMetricDatapoint)
insightRuleMetricDatapoint_timestamp :: Lens.Lens' InsightRuleMetricDatapoint Prelude.UTCTime
insightRuleMetricDatapoint_timestamp :: (UTCTime -> f UTCTime)
-> InsightRuleMetricDatapoint -> f InsightRuleMetricDatapoint
insightRuleMetricDatapoint_timestamp = (InsightRuleMetricDatapoint -> ISO8601)
-> (InsightRuleMetricDatapoint
-> ISO8601 -> InsightRuleMetricDatapoint)
-> Lens
InsightRuleMetricDatapoint
InsightRuleMetricDatapoint
ISO8601
ISO8601
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleMetricDatapoint' {ISO8601
timestamp :: ISO8601
$sel:timestamp:InsightRuleMetricDatapoint' :: InsightRuleMetricDatapoint -> ISO8601
timestamp} -> ISO8601
timestamp) (\s :: InsightRuleMetricDatapoint
s@InsightRuleMetricDatapoint' {} ISO8601
a -> InsightRuleMetricDatapoint
s {$sel:timestamp:InsightRuleMetricDatapoint' :: ISO8601
timestamp = ISO8601
a} :: InsightRuleMetricDatapoint) ((ISO8601 -> f ISO8601)
-> InsightRuleMetricDatapoint -> f InsightRuleMetricDatapoint)
-> ((UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601)
-> (UTCTime -> f UTCTime)
-> InsightRuleMetricDatapoint
-> f InsightRuleMetricDatapoint
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromXML InsightRuleMetricDatapoint where
parseXML :: [Node] -> Either String InsightRuleMetricDatapoint
parseXML [Node]
x =
Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> ISO8601
-> InsightRuleMetricDatapoint
InsightRuleMetricDatapoint'
(Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> ISO8601
-> InsightRuleMetricDatapoint)
-> Either String (Maybe Double)
-> Either
String
(Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> ISO8601
-> InsightRuleMetricDatapoint)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"MaxContributorValue")
Either
String
(Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> ISO8601
-> InsightRuleMetricDatapoint)
-> Either String (Maybe Double)
-> Either
String
(Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> ISO8601
-> InsightRuleMetricDatapoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SampleCount")
Either
String
(Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> ISO8601
-> InsightRuleMetricDatapoint)
-> Either String (Maybe Double)
-> Either
String
(Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> ISO8601
-> InsightRuleMetricDatapoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Maximum")
Either
String
(Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> ISO8601
-> InsightRuleMetricDatapoint)
-> Either String (Maybe Double)
-> Either
String
(Maybe Double
-> Maybe Double
-> Maybe Double
-> ISO8601
-> InsightRuleMetricDatapoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Average")
Either
String
(Maybe Double
-> Maybe Double
-> Maybe Double
-> ISO8601
-> InsightRuleMetricDatapoint)
-> Either String (Maybe Double)
-> Either
String
(Maybe Double
-> Maybe Double -> ISO8601 -> InsightRuleMetricDatapoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Minimum")
Either
String
(Maybe Double
-> Maybe Double -> ISO8601 -> InsightRuleMetricDatapoint)
-> Either String (Maybe Double)
-> Either
String (Maybe Double -> ISO8601 -> InsightRuleMetricDatapoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"UniqueContributors")
Either
String (Maybe Double -> ISO8601 -> InsightRuleMetricDatapoint)
-> Either String (Maybe Double)
-> Either String (ISO8601 -> InsightRuleMetricDatapoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Sum")
Either String (ISO8601 -> InsightRuleMetricDatapoint)
-> Either String ISO8601
-> Either String InsightRuleMetricDatapoint
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ISO8601
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Timestamp")
instance Prelude.Hashable InsightRuleMetricDatapoint
instance Prelude.NFData InsightRuleMetricDatapoint