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