{-# 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.QuickSight.Types.NumericalAggregationFunction 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
import Amazonka.QuickSight.Types.PercentileAggregation
import Amazonka.QuickSight.Types.SimpleNumericalAggregationFunction
data NumericalAggregationFunction = NumericalAggregationFunction'
{
NumericalAggregationFunction -> Maybe PercentileAggregation
percentileAggregation :: Prelude.Maybe PercentileAggregation,
NumericalAggregationFunction
-> Maybe SimpleNumericalAggregationFunction
simpleNumericalAggregation :: Prelude.Maybe SimpleNumericalAggregationFunction
}
deriving (NumericalAggregationFunction
-> NumericalAggregationFunction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NumericalAggregationFunction
-> NumericalAggregationFunction -> Bool
$c/= :: NumericalAggregationFunction
-> NumericalAggregationFunction -> Bool
== :: NumericalAggregationFunction
-> NumericalAggregationFunction -> Bool
$c== :: NumericalAggregationFunction
-> NumericalAggregationFunction -> Bool
Prelude.Eq, ReadPrec [NumericalAggregationFunction]
ReadPrec NumericalAggregationFunction
Int -> ReadS NumericalAggregationFunction
ReadS [NumericalAggregationFunction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NumericalAggregationFunction]
$creadListPrec :: ReadPrec [NumericalAggregationFunction]
readPrec :: ReadPrec NumericalAggregationFunction
$creadPrec :: ReadPrec NumericalAggregationFunction
readList :: ReadS [NumericalAggregationFunction]
$creadList :: ReadS [NumericalAggregationFunction]
readsPrec :: Int -> ReadS NumericalAggregationFunction
$creadsPrec :: Int -> ReadS NumericalAggregationFunction
Prelude.Read, Int -> NumericalAggregationFunction -> ShowS
[NumericalAggregationFunction] -> ShowS
NumericalAggregationFunction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NumericalAggregationFunction] -> ShowS
$cshowList :: [NumericalAggregationFunction] -> ShowS
show :: NumericalAggregationFunction -> String
$cshow :: NumericalAggregationFunction -> String
showsPrec :: Int -> NumericalAggregationFunction -> ShowS
$cshowsPrec :: Int -> NumericalAggregationFunction -> ShowS
Prelude.Show, forall x.
Rep NumericalAggregationFunction x -> NumericalAggregationFunction
forall x.
NumericalAggregationFunction -> Rep NumericalAggregationFunction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NumericalAggregationFunction x -> NumericalAggregationFunction
$cfrom :: forall x.
NumericalAggregationFunction -> Rep NumericalAggregationFunction x
Prelude.Generic)
newNumericalAggregationFunction ::
NumericalAggregationFunction
newNumericalAggregationFunction :: NumericalAggregationFunction
newNumericalAggregationFunction =
NumericalAggregationFunction'
{ $sel:percentileAggregation:NumericalAggregationFunction' :: Maybe PercentileAggregation
percentileAggregation =
forall a. Maybe a
Prelude.Nothing,
$sel:simpleNumericalAggregation:NumericalAggregationFunction' :: Maybe SimpleNumericalAggregationFunction
simpleNumericalAggregation = forall a. Maybe a
Prelude.Nothing
}
numericalAggregationFunction_percentileAggregation :: Lens.Lens' NumericalAggregationFunction (Prelude.Maybe PercentileAggregation)
numericalAggregationFunction_percentileAggregation :: Lens' NumericalAggregationFunction (Maybe PercentileAggregation)
numericalAggregationFunction_percentileAggregation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NumericalAggregationFunction' {Maybe PercentileAggregation
percentileAggregation :: Maybe PercentileAggregation
$sel:percentileAggregation:NumericalAggregationFunction' :: NumericalAggregationFunction -> Maybe PercentileAggregation
percentileAggregation} -> Maybe PercentileAggregation
percentileAggregation) (\s :: NumericalAggregationFunction
s@NumericalAggregationFunction' {} Maybe PercentileAggregation
a -> NumericalAggregationFunction
s {$sel:percentileAggregation:NumericalAggregationFunction' :: Maybe PercentileAggregation
percentileAggregation = Maybe PercentileAggregation
a} :: NumericalAggregationFunction)
numericalAggregationFunction_simpleNumericalAggregation :: Lens.Lens' NumericalAggregationFunction (Prelude.Maybe SimpleNumericalAggregationFunction)
numericalAggregationFunction_simpleNumericalAggregation :: Lens'
NumericalAggregationFunction
(Maybe SimpleNumericalAggregationFunction)
numericalAggregationFunction_simpleNumericalAggregation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NumericalAggregationFunction' {Maybe SimpleNumericalAggregationFunction
simpleNumericalAggregation :: Maybe SimpleNumericalAggregationFunction
$sel:simpleNumericalAggregation:NumericalAggregationFunction' :: NumericalAggregationFunction
-> Maybe SimpleNumericalAggregationFunction
simpleNumericalAggregation} -> Maybe SimpleNumericalAggregationFunction
simpleNumericalAggregation) (\s :: NumericalAggregationFunction
s@NumericalAggregationFunction' {} Maybe SimpleNumericalAggregationFunction
a -> NumericalAggregationFunction
s {$sel:simpleNumericalAggregation:NumericalAggregationFunction' :: Maybe SimpleNumericalAggregationFunction
simpleNumericalAggregation = Maybe SimpleNumericalAggregationFunction
a} :: NumericalAggregationFunction)
instance Data.FromJSON NumericalAggregationFunction where
parseJSON :: Value -> Parser NumericalAggregationFunction
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"NumericalAggregationFunction"
( \Object
x ->
Maybe PercentileAggregation
-> Maybe SimpleNumericalAggregationFunction
-> NumericalAggregationFunction
NumericalAggregationFunction'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PercentileAggregation")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SimpleNumericalAggregation")
)
instance
Prelude.Hashable
NumericalAggregationFunction
where
hashWithSalt :: Int -> NumericalAggregationFunction -> Int
hashWithSalt Int
_salt NumericalAggregationFunction' {Maybe PercentileAggregation
Maybe SimpleNumericalAggregationFunction
simpleNumericalAggregation :: Maybe SimpleNumericalAggregationFunction
percentileAggregation :: Maybe PercentileAggregation
$sel:simpleNumericalAggregation:NumericalAggregationFunction' :: NumericalAggregationFunction
-> Maybe SimpleNumericalAggregationFunction
$sel:percentileAggregation:NumericalAggregationFunction' :: NumericalAggregationFunction -> Maybe PercentileAggregation
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PercentileAggregation
percentileAggregation
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SimpleNumericalAggregationFunction
simpleNumericalAggregation
instance Prelude.NFData NumericalAggregationFunction where
rnf :: NumericalAggregationFunction -> ()
rnf NumericalAggregationFunction' {Maybe PercentileAggregation
Maybe SimpleNumericalAggregationFunction
simpleNumericalAggregation :: Maybe SimpleNumericalAggregationFunction
percentileAggregation :: Maybe PercentileAggregation
$sel:simpleNumericalAggregation:NumericalAggregationFunction' :: NumericalAggregationFunction
-> Maybe SimpleNumericalAggregationFunction
$sel:percentileAggregation:NumericalAggregationFunction' :: NumericalAggregationFunction -> Maybe PercentileAggregation
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe PercentileAggregation
percentileAggregation
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SimpleNumericalAggregationFunction
simpleNumericalAggregation
instance Data.ToJSON NumericalAggregationFunction where
toJSON :: NumericalAggregationFunction -> Value
toJSON NumericalAggregationFunction' {Maybe PercentileAggregation
Maybe SimpleNumericalAggregationFunction
simpleNumericalAggregation :: Maybe SimpleNumericalAggregationFunction
percentileAggregation :: Maybe PercentileAggregation
$sel:simpleNumericalAggregation:NumericalAggregationFunction' :: NumericalAggregationFunction
-> Maybe SimpleNumericalAggregationFunction
$sel:percentileAggregation:NumericalAggregationFunction' :: NumericalAggregationFunction -> Maybe PercentileAggregation
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"PercentileAggregation" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PercentileAggregation
percentileAggregation,
(Key
"SimpleNumericalAggregation" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SimpleNumericalAggregationFunction
simpleNumericalAggregation
]
)