{-# 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.InsightRuleContributor where
import Amazonka.CloudWatch.Types.InsightRuleContributorDatapoint
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 InsightRuleContributor = InsightRuleContributor'
{
InsightRuleContributor -> [Text]
keys :: [Prelude.Text],
InsightRuleContributor -> Double
approximateAggregateValue :: Prelude.Double,
InsightRuleContributor -> [InsightRuleContributorDatapoint]
datapoints :: [InsightRuleContributorDatapoint]
}
deriving (InsightRuleContributor -> InsightRuleContributor -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InsightRuleContributor -> InsightRuleContributor -> Bool
$c/= :: InsightRuleContributor -> InsightRuleContributor -> Bool
== :: InsightRuleContributor -> InsightRuleContributor -> Bool
$c== :: InsightRuleContributor -> InsightRuleContributor -> Bool
Prelude.Eq, ReadPrec [InsightRuleContributor]
ReadPrec InsightRuleContributor
Int -> ReadS InsightRuleContributor
ReadS [InsightRuleContributor]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InsightRuleContributor]
$creadListPrec :: ReadPrec [InsightRuleContributor]
readPrec :: ReadPrec InsightRuleContributor
$creadPrec :: ReadPrec InsightRuleContributor
readList :: ReadS [InsightRuleContributor]
$creadList :: ReadS [InsightRuleContributor]
readsPrec :: Int -> ReadS InsightRuleContributor
$creadsPrec :: Int -> ReadS InsightRuleContributor
Prelude.Read, Int -> InsightRuleContributor -> ShowS
[InsightRuleContributor] -> ShowS
InsightRuleContributor -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InsightRuleContributor] -> ShowS
$cshowList :: [InsightRuleContributor] -> ShowS
show :: InsightRuleContributor -> String
$cshow :: InsightRuleContributor -> String
showsPrec :: Int -> InsightRuleContributor -> ShowS
$cshowsPrec :: Int -> InsightRuleContributor -> ShowS
Prelude.Show, forall x. Rep InsightRuleContributor x -> InsightRuleContributor
forall x. InsightRuleContributor -> Rep InsightRuleContributor x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InsightRuleContributor x -> InsightRuleContributor
$cfrom :: forall x. InsightRuleContributor -> Rep InsightRuleContributor x
Prelude.Generic)
newInsightRuleContributor ::
Prelude.Double ->
InsightRuleContributor
newInsightRuleContributor :: Double -> InsightRuleContributor
newInsightRuleContributor Double
pApproximateAggregateValue_ =
InsightRuleContributor'
{ $sel:keys:InsightRuleContributor' :: [Text]
keys = forall a. Monoid a => a
Prelude.mempty,
$sel:approximateAggregateValue:InsightRuleContributor' :: Double
approximateAggregateValue =
Double
pApproximateAggregateValue_,
$sel:datapoints:InsightRuleContributor' :: [InsightRuleContributorDatapoint]
datapoints = forall a. Monoid a => a
Prelude.mempty
}
insightRuleContributor_keys :: Lens.Lens' InsightRuleContributor [Prelude.Text]
insightRuleContributor_keys :: Lens' InsightRuleContributor [Text]
insightRuleContributor_keys = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleContributor' {[Text]
keys :: [Text]
$sel:keys:InsightRuleContributor' :: InsightRuleContributor -> [Text]
keys} -> [Text]
keys) (\s :: InsightRuleContributor
s@InsightRuleContributor' {} [Text]
a -> InsightRuleContributor
s {$sel:keys:InsightRuleContributor' :: [Text]
keys = [Text]
a} :: InsightRuleContributor) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
insightRuleContributor_approximateAggregateValue :: Lens.Lens' InsightRuleContributor Prelude.Double
insightRuleContributor_approximateAggregateValue :: Lens' InsightRuleContributor Double
insightRuleContributor_approximateAggregateValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleContributor' {Double
approximateAggregateValue :: Double
$sel:approximateAggregateValue:InsightRuleContributor' :: InsightRuleContributor -> Double
approximateAggregateValue} -> Double
approximateAggregateValue) (\s :: InsightRuleContributor
s@InsightRuleContributor' {} Double
a -> InsightRuleContributor
s {$sel:approximateAggregateValue:InsightRuleContributor' :: Double
approximateAggregateValue = Double
a} :: InsightRuleContributor)
insightRuleContributor_datapoints :: Lens.Lens' InsightRuleContributor [InsightRuleContributorDatapoint]
insightRuleContributor_datapoints :: Lens' InsightRuleContributor [InsightRuleContributorDatapoint]
insightRuleContributor_datapoints = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleContributor' {[InsightRuleContributorDatapoint]
datapoints :: [InsightRuleContributorDatapoint]
$sel:datapoints:InsightRuleContributor' :: InsightRuleContributor -> [InsightRuleContributorDatapoint]
datapoints} -> [InsightRuleContributorDatapoint]
datapoints) (\s :: InsightRuleContributor
s@InsightRuleContributor' {} [InsightRuleContributorDatapoint]
a -> InsightRuleContributor
s {$sel:datapoints:InsightRuleContributor' :: [InsightRuleContributorDatapoint]
datapoints = [InsightRuleContributorDatapoint]
a} :: InsightRuleContributor) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromXML InsightRuleContributor where
parseXML :: [Node] -> Either String InsightRuleContributor
parseXML [Node]
x =
[Text]
-> Double
-> [InsightRuleContributorDatapoint]
-> InsightRuleContributor
InsightRuleContributor'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Keys"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member"
)
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
"ApproximateAggregateValue")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Datapoints"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member"
)
instance Prelude.Hashable InsightRuleContributor where
hashWithSalt :: Int -> InsightRuleContributor -> Int
hashWithSalt Int
_salt InsightRuleContributor' {Double
[Text]
[InsightRuleContributorDatapoint]
datapoints :: [InsightRuleContributorDatapoint]
approximateAggregateValue :: Double
keys :: [Text]
$sel:datapoints:InsightRuleContributor' :: InsightRuleContributor -> [InsightRuleContributorDatapoint]
$sel:approximateAggregateValue:InsightRuleContributor' :: InsightRuleContributor -> Double
$sel:keys:InsightRuleContributor' :: InsightRuleContributor -> [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
keys
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
approximateAggregateValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [InsightRuleContributorDatapoint]
datapoints
instance Prelude.NFData InsightRuleContributor where
rnf :: InsightRuleContributor -> ()
rnf InsightRuleContributor' {Double
[Text]
[InsightRuleContributorDatapoint]
datapoints :: [InsightRuleContributorDatapoint]
approximateAggregateValue :: Double
keys :: [Text]
$sel:datapoints:InsightRuleContributor' :: InsightRuleContributor -> [InsightRuleContributorDatapoint]
$sel:approximateAggregateValue:InsightRuleContributor' :: InsightRuleContributor -> Double
$sel:keys:InsightRuleContributor' :: InsightRuleContributor -> [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf [Text]
keys
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Double
approximateAggregateValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [InsightRuleContributorDatapoint]
datapoints