{-# 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.IoT.Types.Statistics where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Statistics = Statistics'
{
Statistics -> Maybe Double
stdDeviation :: Prelude.Maybe Prelude.Double,
Statistics -> Maybe Double
maximum :: Prelude.Maybe Prelude.Double,
Statistics -> Maybe Double
average :: Prelude.Maybe Prelude.Double,
Statistics -> Maybe Int
count :: Prelude.Maybe Prelude.Int,
Statistics -> Maybe Double
minimum :: Prelude.Maybe Prelude.Double,
Statistics -> Maybe Double
variance :: Prelude.Maybe Prelude.Double,
Statistics -> Maybe Double
sumOfSquares :: Prelude.Maybe Prelude.Double,
Statistics -> Maybe Double
sum :: Prelude.Maybe Prelude.Double
}
deriving (Statistics -> Statistics -> Bool
(Statistics -> Statistics -> Bool)
-> (Statistics -> Statistics -> Bool) -> Eq Statistics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Statistics -> Statistics -> Bool
$c/= :: Statistics -> Statistics -> Bool
== :: Statistics -> Statistics -> Bool
$c== :: Statistics -> Statistics -> Bool
Prelude.Eq, ReadPrec [Statistics]
ReadPrec Statistics
Int -> ReadS Statistics
ReadS [Statistics]
(Int -> ReadS Statistics)
-> ReadS [Statistics]
-> ReadPrec Statistics
-> ReadPrec [Statistics]
-> Read Statistics
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Statistics]
$creadListPrec :: ReadPrec [Statistics]
readPrec :: ReadPrec Statistics
$creadPrec :: ReadPrec Statistics
readList :: ReadS [Statistics]
$creadList :: ReadS [Statistics]
readsPrec :: Int -> ReadS Statistics
$creadsPrec :: Int -> ReadS Statistics
Prelude.Read, Int -> Statistics -> ShowS
[Statistics] -> ShowS
Statistics -> String
(Int -> Statistics -> ShowS)
-> (Statistics -> String)
-> ([Statistics] -> ShowS)
-> Show Statistics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Statistics] -> ShowS
$cshowList :: [Statistics] -> ShowS
show :: Statistics -> String
$cshow :: Statistics -> String
showsPrec :: Int -> Statistics -> ShowS
$cshowsPrec :: Int -> Statistics -> ShowS
Prelude.Show, (forall x. Statistics -> Rep Statistics x)
-> (forall x. Rep Statistics x -> Statistics) -> Generic Statistics
forall x. Rep Statistics x -> Statistics
forall x. Statistics -> Rep Statistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Statistics x -> Statistics
$cfrom :: forall x. Statistics -> Rep Statistics x
Prelude.Generic)
newStatistics ::
Statistics
newStatistics :: Statistics
newStatistics =
Statistics' :: Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Int
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Statistics
Statistics'
{ $sel:stdDeviation:Statistics' :: Maybe Double
stdDeviation = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:maximum:Statistics' :: Maybe Double
maximum = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:average:Statistics' :: Maybe Double
average = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:count:Statistics' :: Maybe Int
count = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:minimum:Statistics' :: Maybe Double
minimum = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:variance:Statistics' :: Maybe Double
variance = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:sumOfSquares:Statistics' :: Maybe Double
sumOfSquares = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:sum:Statistics' :: Maybe Double
sum = Maybe Double
forall a. Maybe a
Prelude.Nothing
}
statistics_stdDeviation :: Lens.Lens' Statistics (Prelude.Maybe Prelude.Double)
statistics_stdDeviation :: (Maybe Double -> f (Maybe Double)) -> Statistics -> f Statistics
statistics_stdDeviation = (Statistics -> Maybe Double)
-> (Statistics -> Maybe Double -> Statistics)
-> Lens Statistics Statistics (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Statistics' {Maybe Double
stdDeviation :: Maybe Double
$sel:stdDeviation:Statistics' :: Statistics -> Maybe Double
stdDeviation} -> Maybe Double
stdDeviation) (\s :: Statistics
s@Statistics' {} Maybe Double
a -> Statistics
s {$sel:stdDeviation:Statistics' :: Maybe Double
stdDeviation = Maybe Double
a} :: Statistics)
statistics_maximum :: Lens.Lens' Statistics (Prelude.Maybe Prelude.Double)
statistics_maximum :: (Maybe Double -> f (Maybe Double)) -> Statistics -> f Statistics
statistics_maximum = (Statistics -> Maybe Double)
-> (Statistics -> Maybe Double -> Statistics)
-> Lens Statistics Statistics (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Statistics' {Maybe Double
maximum :: Maybe Double
$sel:maximum:Statistics' :: Statistics -> Maybe Double
maximum} -> Maybe Double
maximum) (\s :: Statistics
s@Statistics' {} Maybe Double
a -> Statistics
s {$sel:maximum:Statistics' :: Maybe Double
maximum = Maybe Double
a} :: Statistics)
statistics_average :: Lens.Lens' Statistics (Prelude.Maybe Prelude.Double)
statistics_average :: (Maybe Double -> f (Maybe Double)) -> Statistics -> f Statistics
statistics_average = (Statistics -> Maybe Double)
-> (Statistics -> Maybe Double -> Statistics)
-> Lens Statistics Statistics (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Statistics' {Maybe Double
average :: Maybe Double
$sel:average:Statistics' :: Statistics -> Maybe Double
average} -> Maybe Double
average) (\s :: Statistics
s@Statistics' {} Maybe Double
a -> Statistics
s {$sel:average:Statistics' :: Maybe Double
average = Maybe Double
a} :: Statistics)
statistics_count :: Lens.Lens' Statistics (Prelude.Maybe Prelude.Int)
statistics_count :: (Maybe Int -> f (Maybe Int)) -> Statistics -> f Statistics
statistics_count = (Statistics -> Maybe Int)
-> (Statistics -> Maybe Int -> Statistics)
-> Lens Statistics Statistics (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Statistics' {Maybe Int
count :: Maybe Int
$sel:count:Statistics' :: Statistics -> Maybe Int
count} -> Maybe Int
count) (\s :: Statistics
s@Statistics' {} Maybe Int
a -> Statistics
s {$sel:count:Statistics' :: Maybe Int
count = Maybe Int
a} :: Statistics)
statistics_minimum :: Lens.Lens' Statistics (Prelude.Maybe Prelude.Double)
statistics_minimum :: (Maybe Double -> f (Maybe Double)) -> Statistics -> f Statistics
statistics_minimum = (Statistics -> Maybe Double)
-> (Statistics -> Maybe Double -> Statistics)
-> Lens Statistics Statistics (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Statistics' {Maybe Double
minimum :: Maybe Double
$sel:minimum:Statistics' :: Statistics -> Maybe Double
minimum} -> Maybe Double
minimum) (\s :: Statistics
s@Statistics' {} Maybe Double
a -> Statistics
s {$sel:minimum:Statistics' :: Maybe Double
minimum = Maybe Double
a} :: Statistics)
statistics_variance :: Lens.Lens' Statistics (Prelude.Maybe Prelude.Double)
statistics_variance :: (Maybe Double -> f (Maybe Double)) -> Statistics -> f Statistics
statistics_variance = (Statistics -> Maybe Double)
-> (Statistics -> Maybe Double -> Statistics)
-> Lens Statistics Statistics (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Statistics' {Maybe Double
variance :: Maybe Double
$sel:variance:Statistics' :: Statistics -> Maybe Double
variance} -> Maybe Double
variance) (\s :: Statistics
s@Statistics' {} Maybe Double
a -> Statistics
s {$sel:variance:Statistics' :: Maybe Double
variance = Maybe Double
a} :: Statistics)
statistics_sumOfSquares :: Lens.Lens' Statistics (Prelude.Maybe Prelude.Double)
statistics_sumOfSquares :: (Maybe Double -> f (Maybe Double)) -> Statistics -> f Statistics
statistics_sumOfSquares = (Statistics -> Maybe Double)
-> (Statistics -> Maybe Double -> Statistics)
-> Lens Statistics Statistics (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Statistics' {Maybe Double
sumOfSquares :: Maybe Double
$sel:sumOfSquares:Statistics' :: Statistics -> Maybe Double
sumOfSquares} -> Maybe Double
sumOfSquares) (\s :: Statistics
s@Statistics' {} Maybe Double
a -> Statistics
s {$sel:sumOfSquares:Statistics' :: Maybe Double
sumOfSquares = Maybe Double
a} :: Statistics)
statistics_sum :: Lens.Lens' Statistics (Prelude.Maybe Prelude.Double)
statistics_sum :: (Maybe Double -> f (Maybe Double)) -> Statistics -> f Statistics
statistics_sum = (Statistics -> Maybe Double)
-> (Statistics -> Maybe Double -> Statistics)
-> Lens Statistics Statistics (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Statistics' {Maybe Double
sum :: Maybe Double
$sel:sum:Statistics' :: Statistics -> Maybe Double
sum} -> Maybe Double
sum) (\s :: Statistics
s@Statistics' {} Maybe Double
a -> Statistics
s {$sel:sum:Statistics' :: Maybe Double
sum = Maybe Double
a} :: Statistics)
instance Core.FromJSON Statistics where
parseJSON :: Value -> Parser Statistics
parseJSON =
String
-> (Object -> Parser Statistics) -> Value -> Parser Statistics
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Statistics"
( \Object
x ->
Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Int
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Statistics
Statistics'
(Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Int
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Statistics)
-> Parser (Maybe Double)
-> Parser
(Maybe Double
-> Maybe Double
-> Maybe Int
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Statistics)
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
"stdDeviation")
Parser
(Maybe Double
-> Maybe Double
-> Maybe Int
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Statistics)
-> Parser (Maybe Double)
-> Parser
(Maybe Double
-> Maybe Int
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Statistics)
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
"maximum")
Parser
(Maybe Double
-> Maybe Int
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Statistics)
-> Parser (Maybe Double)
-> Parser
(Maybe Int
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Statistics)
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 Int
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Statistics)
-> Parser (Maybe Int)
-> Parser
(Maybe Double
-> Maybe Double -> Maybe Double -> Maybe Double -> Statistics)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"count")
Parser
(Maybe Double
-> Maybe Double -> Maybe Double -> Maybe Double -> Statistics)
-> Parser (Maybe Double)
-> Parser
(Maybe Double -> Maybe Double -> Maybe Double -> Statistics)
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 -> Maybe Double -> Statistics)
-> Parser (Maybe Double)
-> Parser (Maybe Double -> Maybe Double -> Statistics)
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
"variance")
Parser (Maybe Double -> Maybe Double -> Statistics)
-> Parser (Maybe Double) -> Parser (Maybe Double -> Statistics)
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
"sumOfSquares")
Parser (Maybe Double -> Statistics)
-> Parser (Maybe Double) -> Parser Statistics
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 Statistics
instance Prelude.NFData Statistics