{-# 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.DecimalDefaultValues 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.DynamicDefaultValue
data DecimalDefaultValues = DecimalDefaultValues'
{
DecimalDefaultValues -> Maybe DynamicDefaultValue
dynamicValue :: Prelude.Maybe DynamicDefaultValue,
DecimalDefaultValues -> Maybe [Sensitive Double]
staticValues :: Prelude.Maybe [Data.Sensitive Prelude.Double]
}
deriving (DecimalDefaultValues -> DecimalDefaultValues -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DecimalDefaultValues -> DecimalDefaultValues -> Bool
$c/= :: DecimalDefaultValues -> DecimalDefaultValues -> Bool
== :: DecimalDefaultValues -> DecimalDefaultValues -> Bool
$c== :: DecimalDefaultValues -> DecimalDefaultValues -> Bool
Prelude.Eq, Int -> DecimalDefaultValues -> ShowS
[DecimalDefaultValues] -> ShowS
DecimalDefaultValues -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DecimalDefaultValues] -> ShowS
$cshowList :: [DecimalDefaultValues] -> ShowS
show :: DecimalDefaultValues -> String
$cshow :: DecimalDefaultValues -> String
showsPrec :: Int -> DecimalDefaultValues -> ShowS
$cshowsPrec :: Int -> DecimalDefaultValues -> ShowS
Prelude.Show, forall x. Rep DecimalDefaultValues x -> DecimalDefaultValues
forall x. DecimalDefaultValues -> Rep DecimalDefaultValues x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DecimalDefaultValues x -> DecimalDefaultValues
$cfrom :: forall x. DecimalDefaultValues -> Rep DecimalDefaultValues x
Prelude.Generic)
newDecimalDefaultValues ::
DecimalDefaultValues
newDecimalDefaultValues :: DecimalDefaultValues
newDecimalDefaultValues =
DecimalDefaultValues'
{ $sel:dynamicValue:DecimalDefaultValues' :: Maybe DynamicDefaultValue
dynamicValue =
forall a. Maybe a
Prelude.Nothing,
$sel:staticValues:DecimalDefaultValues' :: Maybe [Sensitive Double]
staticValues = forall a. Maybe a
Prelude.Nothing
}
decimalDefaultValues_dynamicValue :: Lens.Lens' DecimalDefaultValues (Prelude.Maybe DynamicDefaultValue)
decimalDefaultValues_dynamicValue :: Lens' DecimalDefaultValues (Maybe DynamicDefaultValue)
decimalDefaultValues_dynamicValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecimalDefaultValues' {Maybe DynamicDefaultValue
dynamicValue :: Maybe DynamicDefaultValue
$sel:dynamicValue:DecimalDefaultValues' :: DecimalDefaultValues -> Maybe DynamicDefaultValue
dynamicValue} -> Maybe DynamicDefaultValue
dynamicValue) (\s :: DecimalDefaultValues
s@DecimalDefaultValues' {} Maybe DynamicDefaultValue
a -> DecimalDefaultValues
s {$sel:dynamicValue:DecimalDefaultValues' :: Maybe DynamicDefaultValue
dynamicValue = Maybe DynamicDefaultValue
a} :: DecimalDefaultValues)
decimalDefaultValues_staticValues :: Lens.Lens' DecimalDefaultValues (Prelude.Maybe [Prelude.Double])
decimalDefaultValues_staticValues :: Lens' DecimalDefaultValues (Maybe [Double])
decimalDefaultValues_staticValues = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecimalDefaultValues' {Maybe [Sensitive Double]
staticValues :: Maybe [Sensitive Double]
$sel:staticValues:DecimalDefaultValues' :: DecimalDefaultValues -> Maybe [Sensitive Double]
staticValues} -> Maybe [Sensitive Double]
staticValues) (\s :: DecimalDefaultValues
s@DecimalDefaultValues' {} Maybe [Sensitive Double]
a -> DecimalDefaultValues
s {$sel:staticValues:DecimalDefaultValues' :: Maybe [Sensitive Double]
staticValues = Maybe [Sensitive Double]
a} :: DecimalDefaultValues) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON DecimalDefaultValues where
parseJSON :: Value -> Parser DecimalDefaultValues
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DecimalDefaultValues"
( \Object
x ->
Maybe DynamicDefaultValue
-> Maybe [Sensitive Double] -> DecimalDefaultValues
DecimalDefaultValues'
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
"DynamicValue")
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
"StaticValues" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable DecimalDefaultValues where
hashWithSalt :: Int -> DecimalDefaultValues -> Int
hashWithSalt Int
_salt DecimalDefaultValues' {Maybe [Sensitive Double]
Maybe DynamicDefaultValue
staticValues :: Maybe [Sensitive Double]
dynamicValue :: Maybe DynamicDefaultValue
$sel:staticValues:DecimalDefaultValues' :: DecimalDefaultValues -> Maybe [Sensitive Double]
$sel:dynamicValue:DecimalDefaultValues' :: DecimalDefaultValues -> Maybe DynamicDefaultValue
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DynamicDefaultValue
dynamicValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Sensitive Double]
staticValues
instance Prelude.NFData DecimalDefaultValues where
rnf :: DecimalDefaultValues -> ()
rnf DecimalDefaultValues' {Maybe [Sensitive Double]
Maybe DynamicDefaultValue
staticValues :: Maybe [Sensitive Double]
dynamicValue :: Maybe DynamicDefaultValue
$sel:staticValues:DecimalDefaultValues' :: DecimalDefaultValues -> Maybe [Sensitive Double]
$sel:dynamicValue:DecimalDefaultValues' :: DecimalDefaultValues -> Maybe DynamicDefaultValue
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe DynamicDefaultValue
dynamicValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Sensitive Double]
staticValues
instance Data.ToJSON DecimalDefaultValues where
toJSON :: DecimalDefaultValues -> Value
toJSON DecimalDefaultValues' {Maybe [Sensitive Double]
Maybe DynamicDefaultValue
staticValues :: Maybe [Sensitive Double]
dynamicValue :: Maybe DynamicDefaultValue
$sel:staticValues:DecimalDefaultValues' :: DecimalDefaultValues -> Maybe [Sensitive Double]
$sel:dynamicValue:DecimalDefaultValues' :: DecimalDefaultValues -> Maybe DynamicDefaultValue
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DynamicValue" 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 DynamicDefaultValue
dynamicValue,
(Key
"StaticValues" 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 [Sensitive Double]
staticValues
]
)