{-# 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.TopBottomRankedComputation 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.DimensionField
import Amazonka.QuickSight.Types.MeasureField
import Amazonka.QuickSight.Types.TopBottomComputationType
data TopBottomRankedComputation = TopBottomRankedComputation'
{
TopBottomRankedComputation -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
TopBottomRankedComputation -> Maybe Natural
resultSize :: Prelude.Maybe Prelude.Natural,
TopBottomRankedComputation -> Maybe MeasureField
value :: Prelude.Maybe MeasureField,
TopBottomRankedComputation -> Text
computationId :: Prelude.Text,
TopBottomRankedComputation -> DimensionField
category :: DimensionField,
TopBottomRankedComputation -> TopBottomComputationType
type' :: TopBottomComputationType
}
deriving (TopBottomRankedComputation -> TopBottomRankedComputation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TopBottomRankedComputation -> TopBottomRankedComputation -> Bool
$c/= :: TopBottomRankedComputation -> TopBottomRankedComputation -> Bool
== :: TopBottomRankedComputation -> TopBottomRankedComputation -> Bool
$c== :: TopBottomRankedComputation -> TopBottomRankedComputation -> Bool
Prelude.Eq, Int -> TopBottomRankedComputation -> ShowS
[TopBottomRankedComputation] -> ShowS
TopBottomRankedComputation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TopBottomRankedComputation] -> ShowS
$cshowList :: [TopBottomRankedComputation] -> ShowS
show :: TopBottomRankedComputation -> String
$cshow :: TopBottomRankedComputation -> String
showsPrec :: Int -> TopBottomRankedComputation -> ShowS
$cshowsPrec :: Int -> TopBottomRankedComputation -> ShowS
Prelude.Show, forall x.
Rep TopBottomRankedComputation x -> TopBottomRankedComputation
forall x.
TopBottomRankedComputation -> Rep TopBottomRankedComputation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TopBottomRankedComputation x -> TopBottomRankedComputation
$cfrom :: forall x.
TopBottomRankedComputation -> Rep TopBottomRankedComputation x
Prelude.Generic)
newTopBottomRankedComputation ::
Prelude.Text ->
DimensionField ->
TopBottomComputationType ->
TopBottomRankedComputation
newTopBottomRankedComputation :: Text
-> DimensionField
-> TopBottomComputationType
-> TopBottomRankedComputation
newTopBottomRankedComputation
Text
pComputationId_
DimensionField
pCategory_
TopBottomComputationType
pType_ =
TopBottomRankedComputation'
{ $sel:name:TopBottomRankedComputation' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:resultSize:TopBottomRankedComputation' :: Maybe Natural
resultSize = forall a. Maybe a
Prelude.Nothing,
$sel:value:TopBottomRankedComputation' :: Maybe MeasureField
value = forall a. Maybe a
Prelude.Nothing,
$sel:computationId:TopBottomRankedComputation' :: Text
computationId = Text
pComputationId_,
$sel:category:TopBottomRankedComputation' :: DimensionField
category = DimensionField
pCategory_,
$sel:type':TopBottomRankedComputation' :: TopBottomComputationType
type' = TopBottomComputationType
pType_
}
topBottomRankedComputation_name :: Lens.Lens' TopBottomRankedComputation (Prelude.Maybe Prelude.Text)
topBottomRankedComputation_name :: Lens' TopBottomRankedComputation (Maybe Text)
topBottomRankedComputation_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopBottomRankedComputation' {Maybe Text
name :: Maybe Text
$sel:name:TopBottomRankedComputation' :: TopBottomRankedComputation -> Maybe Text
name} -> Maybe Text
name) (\s :: TopBottomRankedComputation
s@TopBottomRankedComputation' {} Maybe Text
a -> TopBottomRankedComputation
s {$sel:name:TopBottomRankedComputation' :: Maybe Text
name = Maybe Text
a} :: TopBottomRankedComputation)
topBottomRankedComputation_resultSize :: Lens.Lens' TopBottomRankedComputation (Prelude.Maybe Prelude.Natural)
topBottomRankedComputation_resultSize :: Lens' TopBottomRankedComputation (Maybe Natural)
topBottomRankedComputation_resultSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopBottomRankedComputation' {Maybe Natural
resultSize :: Maybe Natural
$sel:resultSize:TopBottomRankedComputation' :: TopBottomRankedComputation -> Maybe Natural
resultSize} -> Maybe Natural
resultSize) (\s :: TopBottomRankedComputation
s@TopBottomRankedComputation' {} Maybe Natural
a -> TopBottomRankedComputation
s {$sel:resultSize:TopBottomRankedComputation' :: Maybe Natural
resultSize = Maybe Natural
a} :: TopBottomRankedComputation)
topBottomRankedComputation_value :: Lens.Lens' TopBottomRankedComputation (Prelude.Maybe MeasureField)
topBottomRankedComputation_value :: Lens' TopBottomRankedComputation (Maybe MeasureField)
topBottomRankedComputation_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopBottomRankedComputation' {Maybe MeasureField
value :: Maybe MeasureField
$sel:value:TopBottomRankedComputation' :: TopBottomRankedComputation -> Maybe MeasureField
value} -> Maybe MeasureField
value) (\s :: TopBottomRankedComputation
s@TopBottomRankedComputation' {} Maybe MeasureField
a -> TopBottomRankedComputation
s {$sel:value:TopBottomRankedComputation' :: Maybe MeasureField
value = Maybe MeasureField
a} :: TopBottomRankedComputation)
topBottomRankedComputation_computationId :: Lens.Lens' TopBottomRankedComputation Prelude.Text
topBottomRankedComputation_computationId :: Lens' TopBottomRankedComputation Text
topBottomRankedComputation_computationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopBottomRankedComputation' {Text
computationId :: Text
$sel:computationId:TopBottomRankedComputation' :: TopBottomRankedComputation -> Text
computationId} -> Text
computationId) (\s :: TopBottomRankedComputation
s@TopBottomRankedComputation' {} Text
a -> TopBottomRankedComputation
s {$sel:computationId:TopBottomRankedComputation' :: Text
computationId = Text
a} :: TopBottomRankedComputation)
topBottomRankedComputation_category :: Lens.Lens' TopBottomRankedComputation DimensionField
topBottomRankedComputation_category :: Lens' TopBottomRankedComputation DimensionField
topBottomRankedComputation_category = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopBottomRankedComputation' {DimensionField
category :: DimensionField
$sel:category:TopBottomRankedComputation' :: TopBottomRankedComputation -> DimensionField
category} -> DimensionField
category) (\s :: TopBottomRankedComputation
s@TopBottomRankedComputation' {} DimensionField
a -> TopBottomRankedComputation
s {$sel:category:TopBottomRankedComputation' :: DimensionField
category = DimensionField
a} :: TopBottomRankedComputation)
topBottomRankedComputation_type :: Lens.Lens' TopBottomRankedComputation TopBottomComputationType
topBottomRankedComputation_type :: Lens' TopBottomRankedComputation TopBottomComputationType
topBottomRankedComputation_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TopBottomRankedComputation' {TopBottomComputationType
type' :: TopBottomComputationType
$sel:type':TopBottomRankedComputation' :: TopBottomRankedComputation -> TopBottomComputationType
type'} -> TopBottomComputationType
type') (\s :: TopBottomRankedComputation
s@TopBottomRankedComputation' {} TopBottomComputationType
a -> TopBottomRankedComputation
s {$sel:type':TopBottomRankedComputation' :: TopBottomComputationType
type' = TopBottomComputationType
a} :: TopBottomRankedComputation)
instance Data.FromJSON TopBottomRankedComputation where
parseJSON :: Value -> Parser TopBottomRankedComputation
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"TopBottomRankedComputation"
( \Object
x ->
Maybe Text
-> Maybe Natural
-> Maybe MeasureField
-> Text
-> DimensionField
-> TopBottomComputationType
-> TopBottomRankedComputation
TopBottomRankedComputation'
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
"Name")
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
"ResultSize")
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
"Value")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ComputationId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Category")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Type")
)
instance Prelude.Hashable TopBottomRankedComputation where
hashWithSalt :: Int -> TopBottomRankedComputation -> Int
hashWithSalt Int
_salt TopBottomRankedComputation' {Maybe Natural
Maybe Text
Maybe MeasureField
Text
TopBottomComputationType
DimensionField
type' :: TopBottomComputationType
category :: DimensionField
computationId :: Text
value :: Maybe MeasureField
resultSize :: Maybe Natural
name :: Maybe Text
$sel:type':TopBottomRankedComputation' :: TopBottomRankedComputation -> TopBottomComputationType
$sel:category:TopBottomRankedComputation' :: TopBottomRankedComputation -> DimensionField
$sel:computationId:TopBottomRankedComputation' :: TopBottomRankedComputation -> Text
$sel:value:TopBottomRankedComputation' :: TopBottomRankedComputation -> Maybe MeasureField
$sel:resultSize:TopBottomRankedComputation' :: TopBottomRankedComputation -> Maybe Natural
$sel:name:TopBottomRankedComputation' :: TopBottomRankedComputation -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
resultSize
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MeasureField
value
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
computationId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DimensionField
category
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` TopBottomComputationType
type'
instance Prelude.NFData TopBottomRankedComputation where
rnf :: TopBottomRankedComputation -> ()
rnf TopBottomRankedComputation' {Maybe Natural
Maybe Text
Maybe MeasureField
Text
TopBottomComputationType
DimensionField
type' :: TopBottomComputationType
category :: DimensionField
computationId :: Text
value :: Maybe MeasureField
resultSize :: Maybe Natural
name :: Maybe Text
$sel:type':TopBottomRankedComputation' :: TopBottomRankedComputation -> TopBottomComputationType
$sel:category:TopBottomRankedComputation' :: TopBottomRankedComputation -> DimensionField
$sel:computationId:TopBottomRankedComputation' :: TopBottomRankedComputation -> Text
$sel:value:TopBottomRankedComputation' :: TopBottomRankedComputation -> Maybe MeasureField
$sel:resultSize:TopBottomRankedComputation' :: TopBottomRankedComputation -> Maybe Natural
$sel:name:TopBottomRankedComputation' :: TopBottomRankedComputation -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
resultSize
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MeasureField
value
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
computationId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DimensionField
category
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf TopBottomComputationType
type'
instance Data.ToJSON TopBottomRankedComputation where
toJSON :: TopBottomRankedComputation -> Value
toJSON TopBottomRankedComputation' {Maybe Natural
Maybe Text
Maybe MeasureField
Text
TopBottomComputationType
DimensionField
type' :: TopBottomComputationType
category :: DimensionField
computationId :: Text
value :: Maybe MeasureField
resultSize :: Maybe Natural
name :: Maybe Text
$sel:type':TopBottomRankedComputation' :: TopBottomRankedComputation -> TopBottomComputationType
$sel:category:TopBottomRankedComputation' :: TopBottomRankedComputation -> DimensionField
$sel:computationId:TopBottomRankedComputation' :: TopBottomRankedComputation -> Text
$sel:value:TopBottomRankedComputation' :: TopBottomRankedComputation -> Maybe MeasureField
$sel:resultSize:TopBottomRankedComputation' :: TopBottomRankedComputation -> Maybe Natural
$sel:name:TopBottomRankedComputation' :: TopBottomRankedComputation -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Name" 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 Text
name,
(Key
"ResultSize" 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 Natural
resultSize,
(Key
"Value" 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 MeasureField
value,
forall a. a -> Maybe a
Prelude.Just (Key
"ComputationId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
computationId),
forall a. a -> Maybe a
Prelude.Just (Key
"Category" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DimensionField
category),
forall a. a -> Maybe a
Prelude.Just (Key
"Type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= TopBottomComputationType
type')
]
)