{-# 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.IoTSiteWise.Types.Aggregates where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Aggregates = Aggregates'
{
Aggregates -> Maybe Double
maximum :: Prelude.Maybe Prelude.Double,
Aggregates -> Maybe Double
average :: Prelude.Maybe Prelude.Double,
Aggregates -> Maybe Double
count :: Prelude.Maybe Prelude.Double,
Aggregates -> Maybe Double
minimum :: Prelude.Maybe Prelude.Double,
Aggregates -> Maybe Double
standardDeviation :: Prelude.Maybe Prelude.Double,
Aggregates -> Maybe Double
sum :: Prelude.Maybe Prelude.Double
}
deriving (Aggregates -> Aggregates -> Bool
(Aggregates -> Aggregates -> Bool)
-> (Aggregates -> Aggregates -> Bool) -> Eq Aggregates
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Aggregates -> Aggregates -> Bool
$c/= :: Aggregates -> Aggregates -> Bool
== :: Aggregates -> Aggregates -> Bool
$c== :: Aggregates -> Aggregates -> Bool
Prelude.Eq, ReadPrec [Aggregates]
ReadPrec Aggregates
Int -> ReadS Aggregates
ReadS [Aggregates]
(Int -> ReadS Aggregates)
-> ReadS [Aggregates]
-> ReadPrec Aggregates
-> ReadPrec [Aggregates]
-> Read Aggregates
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Aggregates]
$creadListPrec :: ReadPrec [Aggregates]
readPrec :: ReadPrec Aggregates
$creadPrec :: ReadPrec Aggregates
readList :: ReadS [Aggregates]
$creadList :: ReadS [Aggregates]
readsPrec :: Int -> ReadS Aggregates
$creadsPrec :: Int -> ReadS Aggregates
Prelude.Read, Int -> Aggregates -> ShowS
[Aggregates] -> ShowS
Aggregates -> String
(Int -> Aggregates -> ShowS)
-> (Aggregates -> String)
-> ([Aggregates] -> ShowS)
-> Show Aggregates
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Aggregates] -> ShowS
$cshowList :: [Aggregates] -> ShowS
show :: Aggregates -> String
$cshow :: Aggregates -> String
showsPrec :: Int -> Aggregates -> ShowS
$cshowsPrec :: Int -> Aggregates -> ShowS
Prelude.Show, (forall x. Aggregates -> Rep Aggregates x)
-> (forall x. Rep Aggregates x -> Aggregates) -> Generic Aggregates
forall x. Rep Aggregates x -> Aggregates
forall x. Aggregates -> Rep Aggregates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Aggregates x -> Aggregates
$cfrom :: forall x. Aggregates -> Rep Aggregates x
Prelude.Generic)
newAggregates ::
Aggregates
newAggregates :: Aggregates
newAggregates =
Aggregates' :: Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Aggregates
Aggregates'
{ $sel:maximum:Aggregates' :: Maybe Double
maximum = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:average:Aggregates' :: Maybe Double
average = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:count:Aggregates' :: Maybe Double
count = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:minimum:Aggregates' :: Maybe Double
minimum = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:standardDeviation:Aggregates' :: Maybe Double
standardDeviation = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:sum:Aggregates' :: Maybe Double
sum = Maybe Double
forall a. Maybe a
Prelude.Nothing
}
aggregates_maximum :: Lens.Lens' Aggregates (Prelude.Maybe Prelude.Double)
aggregates_maximum :: (Maybe Double -> f (Maybe Double)) -> Aggregates -> f Aggregates
aggregates_maximum = (Aggregates -> Maybe Double)
-> (Aggregates -> Maybe Double -> Aggregates)
-> Lens Aggregates Aggregates (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Aggregates' {Maybe Double
maximum :: Maybe Double
$sel:maximum:Aggregates' :: Aggregates -> Maybe Double
maximum} -> Maybe Double
maximum) (\s :: Aggregates
s@Aggregates' {} Maybe Double
a -> Aggregates
s {$sel:maximum:Aggregates' :: Maybe Double
maximum = Maybe Double
a} :: Aggregates)
aggregates_average :: Lens.Lens' Aggregates (Prelude.Maybe Prelude.Double)
aggregates_average :: (Maybe Double -> f (Maybe Double)) -> Aggregates -> f Aggregates
aggregates_average = (Aggregates -> Maybe Double)
-> (Aggregates -> Maybe Double -> Aggregates)
-> Lens Aggregates Aggregates (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Aggregates' {Maybe Double
average :: Maybe Double
$sel:average:Aggregates' :: Aggregates -> Maybe Double
average} -> Maybe Double
average) (\s :: Aggregates
s@Aggregates' {} Maybe Double
a -> Aggregates
s {$sel:average:Aggregates' :: Maybe Double
average = Maybe Double
a} :: Aggregates)
aggregates_count :: Lens.Lens' Aggregates (Prelude.Maybe Prelude.Double)
aggregates_count :: (Maybe Double -> f (Maybe Double)) -> Aggregates -> f Aggregates
aggregates_count = (Aggregates -> Maybe Double)
-> (Aggregates -> Maybe Double -> Aggregates)
-> Lens Aggregates Aggregates (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Aggregates' {Maybe Double
count :: Maybe Double
$sel:count:Aggregates' :: Aggregates -> Maybe Double
count} -> Maybe Double
count) (\s :: Aggregates
s@Aggregates' {} Maybe Double
a -> Aggregates
s {$sel:count:Aggregates' :: Maybe Double
count = Maybe Double
a} :: Aggregates)
aggregates_minimum :: Lens.Lens' Aggregates (Prelude.Maybe Prelude.Double)
aggregates_minimum :: (Maybe Double -> f (Maybe Double)) -> Aggregates -> f Aggregates
aggregates_minimum = (Aggregates -> Maybe Double)
-> (Aggregates -> Maybe Double -> Aggregates)
-> Lens Aggregates Aggregates (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Aggregates' {Maybe Double
minimum :: Maybe Double
$sel:minimum:Aggregates' :: Aggregates -> Maybe Double
minimum} -> Maybe Double
minimum) (\s :: Aggregates
s@Aggregates' {} Maybe Double
a -> Aggregates
s {$sel:minimum:Aggregates' :: Maybe Double
minimum = Maybe Double
a} :: Aggregates)
aggregates_standardDeviation :: Lens.Lens' Aggregates (Prelude.Maybe Prelude.Double)
aggregates_standardDeviation :: (Maybe Double -> f (Maybe Double)) -> Aggregates -> f Aggregates
aggregates_standardDeviation = (Aggregates -> Maybe Double)
-> (Aggregates -> Maybe Double -> Aggregates)
-> Lens Aggregates Aggregates (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Aggregates' {Maybe Double
standardDeviation :: Maybe Double
$sel:standardDeviation:Aggregates' :: Aggregates -> Maybe Double
standardDeviation} -> Maybe Double
standardDeviation) (\s :: Aggregates
s@Aggregates' {} Maybe Double
a -> Aggregates
s {$sel:standardDeviation:Aggregates' :: Maybe Double
standardDeviation = Maybe Double
a} :: Aggregates)
aggregates_sum :: Lens.Lens' Aggregates (Prelude.Maybe Prelude.Double)
aggregates_sum :: (Maybe Double -> f (Maybe Double)) -> Aggregates -> f Aggregates
aggregates_sum = (Aggregates -> Maybe Double)
-> (Aggregates -> Maybe Double -> Aggregates)
-> Lens Aggregates Aggregates (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Aggregates' {Maybe Double
sum :: Maybe Double
$sel:sum:Aggregates' :: Aggregates -> Maybe Double
sum} -> Maybe Double
sum) (\s :: Aggregates
s@Aggregates' {} Maybe Double
a -> Aggregates
s {$sel:sum:Aggregates' :: Maybe Double
sum = Maybe Double
a} :: Aggregates)
instance Core.FromJSON Aggregates where
parseJSON :: Value -> Parser Aggregates
parseJSON =
String
-> (Object -> Parser Aggregates) -> Value -> Parser Aggregates
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Aggregates"
( \Object
x ->
Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Aggregates
Aggregates'
(Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Aggregates)
-> Parser (Maybe Double)
-> Parser
(Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Aggregates)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"maximum")
Parser
(Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Aggregates)
-> Parser (Maybe Double)
-> Parser
(Maybe Double
-> Maybe Double -> Maybe Double -> Maybe Double -> Aggregates)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"average")
Parser
(Maybe Double
-> Maybe Double -> Maybe Double -> Maybe Double -> Aggregates)
-> Parser (Maybe Double)
-> Parser
(Maybe Double -> Maybe Double -> Maybe Double -> Aggregates)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"count")
Parser (Maybe Double -> Maybe Double -> Maybe Double -> Aggregates)
-> Parser (Maybe Double)
-> Parser (Maybe Double -> Maybe Double -> Aggregates)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"minimum")
Parser (Maybe Double -> Maybe Double -> Aggregates)
-> Parser (Maybe Double) -> Parser (Maybe Double -> Aggregates)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"standardDeviation")
Parser (Maybe Double -> Aggregates)
-> Parser (Maybe Double) -> Parser Aggregates
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sum")
)
instance Prelude.Hashable Aggregates
instance Prelude.NFData Aggregates