{-# 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.CloudSearchDomains.Types.FieldStats where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data FieldStats = FieldStats'
{
FieldStats -> Maybe Text
max :: Prelude.Maybe Prelude.Text,
FieldStats -> Maybe Text
mean :: Prelude.Maybe Prelude.Text,
FieldStats -> Maybe Integer
count :: Prelude.Maybe Prelude.Integer,
FieldStats -> Maybe Integer
missing :: Prelude.Maybe Prelude.Integer,
FieldStats -> Maybe Double
stddev :: Prelude.Maybe Prelude.Double,
FieldStats -> Maybe Text
min :: Prelude.Maybe Prelude.Text,
FieldStats -> Maybe Double
sumOfSquares :: Prelude.Maybe Prelude.Double,
FieldStats -> Maybe Double
sum :: Prelude.Maybe Prelude.Double
}
deriving (FieldStats -> FieldStats -> Bool
(FieldStats -> FieldStats -> Bool)
-> (FieldStats -> FieldStats -> Bool) -> Eq FieldStats
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FieldStats -> FieldStats -> Bool
$c/= :: FieldStats -> FieldStats -> Bool
== :: FieldStats -> FieldStats -> Bool
$c== :: FieldStats -> FieldStats -> Bool
Prelude.Eq, ReadPrec [FieldStats]
ReadPrec FieldStats
Int -> ReadS FieldStats
ReadS [FieldStats]
(Int -> ReadS FieldStats)
-> ReadS [FieldStats]
-> ReadPrec FieldStats
-> ReadPrec [FieldStats]
-> Read FieldStats
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FieldStats]
$creadListPrec :: ReadPrec [FieldStats]
readPrec :: ReadPrec FieldStats
$creadPrec :: ReadPrec FieldStats
readList :: ReadS [FieldStats]
$creadList :: ReadS [FieldStats]
readsPrec :: Int -> ReadS FieldStats
$creadsPrec :: Int -> ReadS FieldStats
Prelude.Read, Int -> FieldStats -> ShowS
[FieldStats] -> ShowS
FieldStats -> String
(Int -> FieldStats -> ShowS)
-> (FieldStats -> String)
-> ([FieldStats] -> ShowS)
-> Show FieldStats
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FieldStats] -> ShowS
$cshowList :: [FieldStats] -> ShowS
show :: FieldStats -> String
$cshow :: FieldStats -> String
showsPrec :: Int -> FieldStats -> ShowS
$cshowsPrec :: Int -> FieldStats -> ShowS
Prelude.Show, (forall x. FieldStats -> Rep FieldStats x)
-> (forall x. Rep FieldStats x -> FieldStats) -> Generic FieldStats
forall x. Rep FieldStats x -> FieldStats
forall x. FieldStats -> Rep FieldStats x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FieldStats x -> FieldStats
$cfrom :: forall x. FieldStats -> Rep FieldStats x
Prelude.Generic)
newFieldStats ::
FieldStats
newFieldStats :: FieldStats
newFieldStats =
FieldStats' :: Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Integer
-> Maybe Double
-> Maybe Text
-> Maybe Double
-> Maybe Double
-> FieldStats
FieldStats'
{ $sel:max:FieldStats' :: Maybe Text
max = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:mean:FieldStats' :: Maybe Text
mean = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:count:FieldStats' :: Maybe Integer
count = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:missing:FieldStats' :: Maybe Integer
missing = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:stddev:FieldStats' :: Maybe Double
stddev = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:min:FieldStats' :: Maybe Text
min = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sumOfSquares:FieldStats' :: Maybe Double
sumOfSquares = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:sum:FieldStats' :: Maybe Double
sum = Maybe Double
forall a. Maybe a
Prelude.Nothing
}
fieldStats_max :: Lens.Lens' FieldStats (Prelude.Maybe Prelude.Text)
fieldStats_max :: (Maybe Text -> f (Maybe Text)) -> FieldStats -> f FieldStats
fieldStats_max = (FieldStats -> Maybe Text)
-> (FieldStats -> Maybe Text -> FieldStats)
-> Lens FieldStats FieldStats (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldStats' {Maybe Text
max :: Maybe Text
$sel:max:FieldStats' :: FieldStats -> Maybe Text
max} -> Maybe Text
max) (\s :: FieldStats
s@FieldStats' {} Maybe Text
a -> FieldStats
s {$sel:max:FieldStats' :: Maybe Text
max = Maybe Text
a} :: FieldStats)
fieldStats_mean :: Lens.Lens' FieldStats (Prelude.Maybe Prelude.Text)
fieldStats_mean :: (Maybe Text -> f (Maybe Text)) -> FieldStats -> f FieldStats
fieldStats_mean = (FieldStats -> Maybe Text)
-> (FieldStats -> Maybe Text -> FieldStats)
-> Lens FieldStats FieldStats (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldStats' {Maybe Text
mean :: Maybe Text
$sel:mean:FieldStats' :: FieldStats -> Maybe Text
mean} -> Maybe Text
mean) (\s :: FieldStats
s@FieldStats' {} Maybe Text
a -> FieldStats
s {$sel:mean:FieldStats' :: Maybe Text
mean = Maybe Text
a} :: FieldStats)
fieldStats_count :: Lens.Lens' FieldStats (Prelude.Maybe Prelude.Integer)
fieldStats_count :: (Maybe Integer -> f (Maybe Integer)) -> FieldStats -> f FieldStats
fieldStats_count = (FieldStats -> Maybe Integer)
-> (FieldStats -> Maybe Integer -> FieldStats)
-> Lens FieldStats FieldStats (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldStats' {Maybe Integer
count :: Maybe Integer
$sel:count:FieldStats' :: FieldStats -> Maybe Integer
count} -> Maybe Integer
count) (\s :: FieldStats
s@FieldStats' {} Maybe Integer
a -> FieldStats
s {$sel:count:FieldStats' :: Maybe Integer
count = Maybe Integer
a} :: FieldStats)
fieldStats_missing :: Lens.Lens' FieldStats (Prelude.Maybe Prelude.Integer)
fieldStats_missing :: (Maybe Integer -> f (Maybe Integer)) -> FieldStats -> f FieldStats
fieldStats_missing = (FieldStats -> Maybe Integer)
-> (FieldStats -> Maybe Integer -> FieldStats)
-> Lens FieldStats FieldStats (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldStats' {Maybe Integer
missing :: Maybe Integer
$sel:missing:FieldStats' :: FieldStats -> Maybe Integer
missing} -> Maybe Integer
missing) (\s :: FieldStats
s@FieldStats' {} Maybe Integer
a -> FieldStats
s {$sel:missing:FieldStats' :: Maybe Integer
missing = Maybe Integer
a} :: FieldStats)
fieldStats_stddev :: Lens.Lens' FieldStats (Prelude.Maybe Prelude.Double)
fieldStats_stddev :: (Maybe Double -> f (Maybe Double)) -> FieldStats -> f FieldStats
fieldStats_stddev = (FieldStats -> Maybe Double)
-> (FieldStats -> Maybe Double -> FieldStats)
-> Lens FieldStats FieldStats (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldStats' {Maybe Double
stddev :: Maybe Double
$sel:stddev:FieldStats' :: FieldStats -> Maybe Double
stddev} -> Maybe Double
stddev) (\s :: FieldStats
s@FieldStats' {} Maybe Double
a -> FieldStats
s {$sel:stddev:FieldStats' :: Maybe Double
stddev = Maybe Double
a} :: FieldStats)
fieldStats_min :: Lens.Lens' FieldStats (Prelude.Maybe Prelude.Text)
fieldStats_min :: (Maybe Text -> f (Maybe Text)) -> FieldStats -> f FieldStats
fieldStats_min = (FieldStats -> Maybe Text)
-> (FieldStats -> Maybe Text -> FieldStats)
-> Lens FieldStats FieldStats (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldStats' {Maybe Text
min :: Maybe Text
$sel:min:FieldStats' :: FieldStats -> Maybe Text
min} -> Maybe Text
min) (\s :: FieldStats
s@FieldStats' {} Maybe Text
a -> FieldStats
s {$sel:min:FieldStats' :: Maybe Text
min = Maybe Text
a} :: FieldStats)
fieldStats_sumOfSquares :: Lens.Lens' FieldStats (Prelude.Maybe Prelude.Double)
fieldStats_sumOfSquares :: (Maybe Double -> f (Maybe Double)) -> FieldStats -> f FieldStats
fieldStats_sumOfSquares = (FieldStats -> Maybe Double)
-> (FieldStats -> Maybe Double -> FieldStats)
-> Lens FieldStats FieldStats (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldStats' {Maybe Double
sumOfSquares :: Maybe Double
$sel:sumOfSquares:FieldStats' :: FieldStats -> Maybe Double
sumOfSquares} -> Maybe Double
sumOfSquares) (\s :: FieldStats
s@FieldStats' {} Maybe Double
a -> FieldStats
s {$sel:sumOfSquares:FieldStats' :: Maybe Double
sumOfSquares = Maybe Double
a} :: FieldStats)
fieldStats_sum :: Lens.Lens' FieldStats (Prelude.Maybe Prelude.Double)
fieldStats_sum :: (Maybe Double -> f (Maybe Double)) -> FieldStats -> f FieldStats
fieldStats_sum = (FieldStats -> Maybe Double)
-> (FieldStats -> Maybe Double -> FieldStats)
-> Lens FieldStats FieldStats (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldStats' {Maybe Double
sum :: Maybe Double
$sel:sum:FieldStats' :: FieldStats -> Maybe Double
sum} -> Maybe Double
sum) (\s :: FieldStats
s@FieldStats' {} Maybe Double
a -> FieldStats
s {$sel:sum:FieldStats' :: Maybe Double
sum = Maybe Double
a} :: FieldStats)
instance Core.FromJSON FieldStats where
parseJSON :: Value -> Parser FieldStats
parseJSON =
String
-> (Object -> Parser FieldStats) -> Value -> Parser FieldStats
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FieldStats"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Integer
-> Maybe Double
-> Maybe Text
-> Maybe Double
-> Maybe Double
-> FieldStats
FieldStats'
(Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Integer
-> Maybe Double
-> Maybe Text
-> Maybe Double
-> Maybe Double
-> FieldStats)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Integer
-> Maybe Integer
-> Maybe Double
-> Maybe Text
-> Maybe Double
-> Maybe Double
-> FieldStats)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"max")
Parser
(Maybe Text
-> Maybe Integer
-> Maybe Integer
-> Maybe Double
-> Maybe Text
-> Maybe Double
-> Maybe Double
-> FieldStats)
-> Parser (Maybe Text)
-> Parser
(Maybe Integer
-> Maybe Integer
-> Maybe Double
-> Maybe Text
-> Maybe Double
-> Maybe Double
-> FieldStats)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"mean")
Parser
(Maybe Integer
-> Maybe Integer
-> Maybe Double
-> Maybe Text
-> Maybe Double
-> Maybe Double
-> FieldStats)
-> Parser (Maybe Integer)
-> Parser
(Maybe Integer
-> Maybe Double
-> Maybe Text
-> Maybe Double
-> Maybe Double
-> FieldStats)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"count")
Parser
(Maybe Integer
-> Maybe Double
-> Maybe Text
-> Maybe Double
-> Maybe Double
-> FieldStats)
-> Parser (Maybe Integer)
-> Parser
(Maybe Double
-> Maybe Text -> Maybe Double -> Maybe Double -> FieldStats)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"missing")
Parser
(Maybe Double
-> Maybe Text -> Maybe Double -> Maybe Double -> FieldStats)
-> Parser (Maybe Double)
-> Parser
(Maybe Text -> Maybe Double -> Maybe Double -> FieldStats)
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
"stddev")
Parser (Maybe Text -> Maybe Double -> Maybe Double -> FieldStats)
-> Parser (Maybe Text)
-> Parser (Maybe Double -> Maybe Double -> FieldStats)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"min")
Parser (Maybe Double -> Maybe Double -> FieldStats)
-> Parser (Maybe Double) -> Parser (Maybe Double -> FieldStats)
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 -> FieldStats)
-> Parser (Maybe Double) -> Parser FieldStats
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 FieldStats
instance Prelude.NFData FieldStats