{-# 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.NumericSeparatorConfiguration 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.NumericSeparatorSymbol
import Amazonka.QuickSight.Types.ThousandSeparatorOptions
data NumericSeparatorConfiguration = NumericSeparatorConfiguration'
{
NumericSeparatorConfiguration -> Maybe NumericSeparatorSymbol
decimalSeparator :: Prelude.Maybe NumericSeparatorSymbol,
NumericSeparatorConfiguration -> Maybe ThousandSeparatorOptions
thousandsSeparator :: Prelude.Maybe ThousandSeparatorOptions
}
deriving (NumericSeparatorConfiguration
-> NumericSeparatorConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NumericSeparatorConfiguration
-> NumericSeparatorConfiguration -> Bool
$c/= :: NumericSeparatorConfiguration
-> NumericSeparatorConfiguration -> Bool
== :: NumericSeparatorConfiguration
-> NumericSeparatorConfiguration -> Bool
$c== :: NumericSeparatorConfiguration
-> NumericSeparatorConfiguration -> Bool
Prelude.Eq, ReadPrec [NumericSeparatorConfiguration]
ReadPrec NumericSeparatorConfiguration
Int -> ReadS NumericSeparatorConfiguration
ReadS [NumericSeparatorConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NumericSeparatorConfiguration]
$creadListPrec :: ReadPrec [NumericSeparatorConfiguration]
readPrec :: ReadPrec NumericSeparatorConfiguration
$creadPrec :: ReadPrec NumericSeparatorConfiguration
readList :: ReadS [NumericSeparatorConfiguration]
$creadList :: ReadS [NumericSeparatorConfiguration]
readsPrec :: Int -> ReadS NumericSeparatorConfiguration
$creadsPrec :: Int -> ReadS NumericSeparatorConfiguration
Prelude.Read, Int -> NumericSeparatorConfiguration -> ShowS
[NumericSeparatorConfiguration] -> ShowS
NumericSeparatorConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NumericSeparatorConfiguration] -> ShowS
$cshowList :: [NumericSeparatorConfiguration] -> ShowS
show :: NumericSeparatorConfiguration -> String
$cshow :: NumericSeparatorConfiguration -> String
showsPrec :: Int -> NumericSeparatorConfiguration -> ShowS
$cshowsPrec :: Int -> NumericSeparatorConfiguration -> ShowS
Prelude.Show, forall x.
Rep NumericSeparatorConfiguration x
-> NumericSeparatorConfiguration
forall x.
NumericSeparatorConfiguration
-> Rep NumericSeparatorConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NumericSeparatorConfiguration x
-> NumericSeparatorConfiguration
$cfrom :: forall x.
NumericSeparatorConfiguration
-> Rep NumericSeparatorConfiguration x
Prelude.Generic)
newNumericSeparatorConfiguration ::
NumericSeparatorConfiguration
newNumericSeparatorConfiguration :: NumericSeparatorConfiguration
newNumericSeparatorConfiguration =
NumericSeparatorConfiguration'
{ $sel:decimalSeparator:NumericSeparatorConfiguration' :: Maybe NumericSeparatorSymbol
decimalSeparator =
forall a. Maybe a
Prelude.Nothing,
$sel:thousandsSeparator:NumericSeparatorConfiguration' :: Maybe ThousandSeparatorOptions
thousandsSeparator = forall a. Maybe a
Prelude.Nothing
}
numericSeparatorConfiguration_decimalSeparator :: Lens.Lens' NumericSeparatorConfiguration (Prelude.Maybe NumericSeparatorSymbol)
numericSeparatorConfiguration_decimalSeparator :: Lens' NumericSeparatorConfiguration (Maybe NumericSeparatorSymbol)
numericSeparatorConfiguration_decimalSeparator = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NumericSeparatorConfiguration' {Maybe NumericSeparatorSymbol
decimalSeparator :: Maybe NumericSeparatorSymbol
$sel:decimalSeparator:NumericSeparatorConfiguration' :: NumericSeparatorConfiguration -> Maybe NumericSeparatorSymbol
decimalSeparator} -> Maybe NumericSeparatorSymbol
decimalSeparator) (\s :: NumericSeparatorConfiguration
s@NumericSeparatorConfiguration' {} Maybe NumericSeparatorSymbol
a -> NumericSeparatorConfiguration
s {$sel:decimalSeparator:NumericSeparatorConfiguration' :: Maybe NumericSeparatorSymbol
decimalSeparator = Maybe NumericSeparatorSymbol
a} :: NumericSeparatorConfiguration)
numericSeparatorConfiguration_thousandsSeparator :: Lens.Lens' NumericSeparatorConfiguration (Prelude.Maybe ThousandSeparatorOptions)
numericSeparatorConfiguration_thousandsSeparator :: Lens'
NumericSeparatorConfiguration (Maybe ThousandSeparatorOptions)
numericSeparatorConfiguration_thousandsSeparator = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NumericSeparatorConfiguration' {Maybe ThousandSeparatorOptions
thousandsSeparator :: Maybe ThousandSeparatorOptions
$sel:thousandsSeparator:NumericSeparatorConfiguration' :: NumericSeparatorConfiguration -> Maybe ThousandSeparatorOptions
thousandsSeparator} -> Maybe ThousandSeparatorOptions
thousandsSeparator) (\s :: NumericSeparatorConfiguration
s@NumericSeparatorConfiguration' {} Maybe ThousandSeparatorOptions
a -> NumericSeparatorConfiguration
s {$sel:thousandsSeparator:NumericSeparatorConfiguration' :: Maybe ThousandSeparatorOptions
thousandsSeparator = Maybe ThousandSeparatorOptions
a} :: NumericSeparatorConfiguration)
instance Data.FromJSON NumericSeparatorConfiguration where
parseJSON :: Value -> Parser NumericSeparatorConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"NumericSeparatorConfiguration"
( \Object
x ->
Maybe NumericSeparatorSymbol
-> Maybe ThousandSeparatorOptions -> NumericSeparatorConfiguration
NumericSeparatorConfiguration'
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
"DecimalSeparator")
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
"ThousandsSeparator")
)
instance
Prelude.Hashable
NumericSeparatorConfiguration
where
hashWithSalt :: Int -> NumericSeparatorConfiguration -> Int
hashWithSalt Int
_salt NumericSeparatorConfiguration' {Maybe NumericSeparatorSymbol
Maybe ThousandSeparatorOptions
thousandsSeparator :: Maybe ThousandSeparatorOptions
decimalSeparator :: Maybe NumericSeparatorSymbol
$sel:thousandsSeparator:NumericSeparatorConfiguration' :: NumericSeparatorConfiguration -> Maybe ThousandSeparatorOptions
$sel:decimalSeparator:NumericSeparatorConfiguration' :: NumericSeparatorConfiguration -> Maybe NumericSeparatorSymbol
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NumericSeparatorSymbol
decimalSeparator
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ThousandSeparatorOptions
thousandsSeparator
instance Prelude.NFData NumericSeparatorConfiguration where
rnf :: NumericSeparatorConfiguration -> ()
rnf NumericSeparatorConfiguration' {Maybe NumericSeparatorSymbol
Maybe ThousandSeparatorOptions
thousandsSeparator :: Maybe ThousandSeparatorOptions
decimalSeparator :: Maybe NumericSeparatorSymbol
$sel:thousandsSeparator:NumericSeparatorConfiguration' :: NumericSeparatorConfiguration -> Maybe ThousandSeparatorOptions
$sel:decimalSeparator:NumericSeparatorConfiguration' :: NumericSeparatorConfiguration -> Maybe NumericSeparatorSymbol
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe NumericSeparatorSymbol
decimalSeparator
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ThousandSeparatorOptions
thousandsSeparator
instance Data.ToJSON NumericSeparatorConfiguration where
toJSON :: NumericSeparatorConfiguration -> Value
toJSON NumericSeparatorConfiguration' {Maybe NumericSeparatorSymbol
Maybe ThousandSeparatorOptions
thousandsSeparator :: Maybe ThousandSeparatorOptions
decimalSeparator :: Maybe NumericSeparatorSymbol
$sel:thousandsSeparator:NumericSeparatorConfiguration' :: NumericSeparatorConfiguration -> Maybe ThousandSeparatorOptions
$sel:decimalSeparator:NumericSeparatorConfiguration' :: NumericSeparatorConfiguration -> Maybe NumericSeparatorSymbol
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DecimalSeparator" 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 NumericSeparatorSymbol
decimalSeparator,
(Key
"ThousandsSeparator" 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 ThousandSeparatorOptions
thousandsSeparator
]
)