{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data InsightRuleContributorDatapoint = InsightRuleContributorDatapoint'
{
InsightRuleContributorDatapoint -> ISO8601
timestamp :: Data.ISO8601,
InsightRuleContributorDatapoint -> Double
approximateValue :: Prelude.Double
}
deriving (InsightRuleContributorDatapoint
-> InsightRuleContributorDatapoint -> Bool
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]
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
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.
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'
{ $sel:timestamp:InsightRuleContributorDatapoint' :: ISO8601
timestamp =
forall (a :: Format). Iso' (Time a) UTCTime
Data._Time 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 :: Lens' InsightRuleContributorDatapoint UTCTime
insightRuleContributorDatapoint_timestamp = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
insightRuleContributorDatapoint_approximateValue :: Lens.Lens' InsightRuleContributorDatapoint Prelude.Double
insightRuleContributorDatapoint_approximateValue :: Lens' InsightRuleContributorDatapoint Double
insightRuleContributorDatapoint_approximateValue = 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 Data.FromXML InsightRuleContributorDatapoint where
parseXML :: [Node] -> Either String InsightRuleContributorDatapoint
parseXML [Node]
x =
ISO8601 -> Double -> InsightRuleContributorDatapoint
InsightRuleContributorDatapoint'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Timestamp")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"ApproximateValue")
instance
Prelude.Hashable
InsightRuleContributorDatapoint
where
hashWithSalt :: Int -> InsightRuleContributorDatapoint -> Int
hashWithSalt
Int
_salt
InsightRuleContributorDatapoint' {Double
ISO8601
approximateValue :: Double
timestamp :: ISO8601
$sel:approximateValue:InsightRuleContributorDatapoint' :: InsightRuleContributorDatapoint -> Double
$sel:timestamp:InsightRuleContributorDatapoint' :: InsightRuleContributorDatapoint -> ISO8601
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
timestamp
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
approximateValue
instance
Prelude.NFData
InsightRuleContributorDatapoint
where
rnf :: InsightRuleContributorDatapoint -> ()
rnf InsightRuleContributorDatapoint' {Double
ISO8601
approximateValue :: Double
timestamp :: ISO8601
$sel:approximateValue:InsightRuleContributorDatapoint' :: InsightRuleContributorDatapoint -> Double
$sel:timestamp:InsightRuleContributorDatapoint' :: InsightRuleContributorDatapoint -> ISO8601
..} =
forall a. NFData a => a -> ()
Prelude.rnf ISO8601
timestamp
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Double
approximateValue