{-# 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.InsightRuleContributorDatapoint where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InsightRuleContributorDatapoint = InsightRuleContributorDatapoint'
{
InsightRuleContributorDatapoint -> ISO8601
timestamp :: Core.ISO8601,
InsightRuleContributorDatapoint -> Double
approximateValue :: Prelude.Double
}
deriving (InsightRuleContributorDatapoint
-> InsightRuleContributorDatapoint -> Bool
(InsightRuleContributorDatapoint
-> InsightRuleContributorDatapoint -> Bool)
-> (InsightRuleContributorDatapoint
-> InsightRuleContributorDatapoint -> Bool)
-> Eq InsightRuleContributorDatapoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InsightRuleContributorDatapoint
-> InsightRuleContributorDatapoint -> Bool
$c/= :: InsightRuleContributorDatapoint
-> InsightRuleContributorDatapoint -> Bool
== :: InsightRuleContributorDatapoint
-> InsightRuleContributorDatapoint -> Bool
$c== :: InsightRuleContributorDatapoint
-> InsightRuleContributorDatapoint -> Bool
Prelude.Eq, ReadPrec [InsightRuleContributorDatapoint]
ReadPrec InsightRuleContributorDatapoint
Int -> ReadS InsightRuleContributorDatapoint
ReadS [InsightRuleContributorDatapoint]
(Int -> ReadS InsightRuleContributorDatapoint)
-> ReadS [InsightRuleContributorDatapoint]
-> ReadPrec InsightRuleContributorDatapoint
-> ReadPrec [InsightRuleContributorDatapoint]
-> Read InsightRuleContributorDatapoint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InsightRuleContributorDatapoint]
$creadListPrec :: ReadPrec [InsightRuleContributorDatapoint]
readPrec :: ReadPrec InsightRuleContributorDatapoint
$creadPrec :: ReadPrec InsightRuleContributorDatapoint
readList :: ReadS [InsightRuleContributorDatapoint]
$creadList :: ReadS [InsightRuleContributorDatapoint]
readsPrec :: Int -> ReadS InsightRuleContributorDatapoint
$creadsPrec :: Int -> ReadS InsightRuleContributorDatapoint
Prelude.Read, Int -> InsightRuleContributorDatapoint -> ShowS
[InsightRuleContributorDatapoint] -> ShowS
InsightRuleContributorDatapoint -> String
(Int -> InsightRuleContributorDatapoint -> ShowS)
-> (InsightRuleContributorDatapoint -> String)
-> ([InsightRuleContributorDatapoint] -> ShowS)
-> Show InsightRuleContributorDatapoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InsightRuleContributorDatapoint] -> ShowS
$cshowList :: [InsightRuleContributorDatapoint] -> ShowS
show :: InsightRuleContributorDatapoint -> String
$cshow :: InsightRuleContributorDatapoint -> String
showsPrec :: Int -> InsightRuleContributorDatapoint -> ShowS
$cshowsPrec :: Int -> InsightRuleContributorDatapoint -> ShowS
Prelude.Show, (forall x.
InsightRuleContributorDatapoint
-> Rep InsightRuleContributorDatapoint x)
-> (forall x.
Rep InsightRuleContributorDatapoint x
-> InsightRuleContributorDatapoint)
-> Generic InsightRuleContributorDatapoint
forall x.
Rep InsightRuleContributorDatapoint x
-> InsightRuleContributorDatapoint
forall x.
InsightRuleContributorDatapoint
-> Rep InsightRuleContributorDatapoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InsightRuleContributorDatapoint x
-> InsightRuleContributorDatapoint
$cfrom :: forall x.
InsightRuleContributorDatapoint
-> Rep InsightRuleContributorDatapoint x
Prelude.Generic)
newInsightRuleContributorDatapoint ::
Prelude.UTCTime ->
Prelude.Double ->
InsightRuleContributorDatapoint
newInsightRuleContributorDatapoint :: UTCTime -> Double -> InsightRuleContributorDatapoint
newInsightRuleContributorDatapoint
UTCTime
pTimestamp_
Double
pApproximateValue_ =
InsightRuleContributorDatapoint' :: ISO8601 -> Double -> InsightRuleContributorDatapoint
InsightRuleContributorDatapoint'
{ $sel:timestamp:InsightRuleContributorDatapoint' :: 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_,
$sel:approximateValue:InsightRuleContributorDatapoint' :: Double
approximateValue = Double
pApproximateValue_
}
insightRuleContributorDatapoint_timestamp :: Lens.Lens' InsightRuleContributorDatapoint Prelude.UTCTime
insightRuleContributorDatapoint_timestamp :: (UTCTime -> f UTCTime)
-> InsightRuleContributorDatapoint
-> f InsightRuleContributorDatapoint
insightRuleContributorDatapoint_timestamp = (InsightRuleContributorDatapoint -> ISO8601)
-> (InsightRuleContributorDatapoint
-> ISO8601 -> InsightRuleContributorDatapoint)
-> Lens
InsightRuleContributorDatapoint
InsightRuleContributorDatapoint
ISO8601
ISO8601
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleContributorDatapoint' {ISO8601
timestamp :: ISO8601
$sel:timestamp:InsightRuleContributorDatapoint' :: InsightRuleContributorDatapoint -> ISO8601
timestamp} -> ISO8601
timestamp) (\s :: InsightRuleContributorDatapoint
s@InsightRuleContributorDatapoint' {} ISO8601
a -> InsightRuleContributorDatapoint
s {$sel:timestamp:InsightRuleContributorDatapoint' :: ISO8601
timestamp = ISO8601
a} :: InsightRuleContributorDatapoint) ((ISO8601 -> f ISO8601)
-> InsightRuleContributorDatapoint
-> f InsightRuleContributorDatapoint)
-> ((UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601)
-> (UTCTime -> f UTCTime)
-> InsightRuleContributorDatapoint
-> f InsightRuleContributorDatapoint
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
insightRuleContributorDatapoint_approximateValue :: Lens.Lens' InsightRuleContributorDatapoint Prelude.Double
insightRuleContributorDatapoint_approximateValue :: (Double -> f Double)
-> InsightRuleContributorDatapoint
-> f InsightRuleContributorDatapoint
insightRuleContributorDatapoint_approximateValue = (InsightRuleContributorDatapoint -> Double)
-> (InsightRuleContributorDatapoint
-> Double -> InsightRuleContributorDatapoint)
-> Lens
InsightRuleContributorDatapoint
InsightRuleContributorDatapoint
Double
Double
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleContributorDatapoint' {Double
approximateValue :: Double
$sel:approximateValue:InsightRuleContributorDatapoint' :: InsightRuleContributorDatapoint -> Double
approximateValue} -> Double
approximateValue) (\s :: InsightRuleContributorDatapoint
s@InsightRuleContributorDatapoint' {} Double
a -> InsightRuleContributorDatapoint
s {$sel:approximateValue:InsightRuleContributorDatapoint' :: Double
approximateValue = Double
a} :: InsightRuleContributorDatapoint)
instance Core.FromXML InsightRuleContributorDatapoint where
parseXML :: [Node] -> Either String InsightRuleContributorDatapoint
parseXML [Node]
x =
ISO8601 -> Double -> InsightRuleContributorDatapoint
InsightRuleContributorDatapoint'
(ISO8601 -> Double -> InsightRuleContributorDatapoint)
-> Either String ISO8601
-> Either String (Double -> InsightRuleContributorDatapoint)
forall (f :: * -> *) a b. Functor 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")
Either String (Double -> InsightRuleContributorDatapoint)
-> Either String Double
-> Either String InsightRuleContributorDatapoint
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Double
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"ApproximateValue")
instance
Prelude.Hashable
InsightRuleContributorDatapoint
instance
Prelude.NFData
InsightRuleContributorDatapoint