{-# 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.StringFormatConfiguration 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.NullValueFormatConfiguration
import Amazonka.QuickSight.Types.NumericFormatConfiguration
data StringFormatConfiguration = StringFormatConfiguration'
{
StringFormatConfiguration -> Maybe NullValueFormatConfiguration
nullValueFormatConfiguration :: Prelude.Maybe NullValueFormatConfiguration,
StringFormatConfiguration -> Maybe NumericFormatConfiguration
numericFormatConfiguration :: Prelude.Maybe NumericFormatConfiguration
}
deriving (StringFormatConfiguration -> StringFormatConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StringFormatConfiguration -> StringFormatConfiguration -> Bool
$c/= :: StringFormatConfiguration -> StringFormatConfiguration -> Bool
== :: StringFormatConfiguration -> StringFormatConfiguration -> Bool
$c== :: StringFormatConfiguration -> StringFormatConfiguration -> Bool
Prelude.Eq, Int -> StringFormatConfiguration -> ShowS
[StringFormatConfiguration] -> ShowS
StringFormatConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StringFormatConfiguration] -> ShowS
$cshowList :: [StringFormatConfiguration] -> ShowS
show :: StringFormatConfiguration -> String
$cshow :: StringFormatConfiguration -> String
showsPrec :: Int -> StringFormatConfiguration -> ShowS
$cshowsPrec :: Int -> StringFormatConfiguration -> ShowS
Prelude.Show, forall x.
Rep StringFormatConfiguration x -> StringFormatConfiguration
forall x.
StringFormatConfiguration -> Rep StringFormatConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StringFormatConfiguration x -> StringFormatConfiguration
$cfrom :: forall x.
StringFormatConfiguration -> Rep StringFormatConfiguration x
Prelude.Generic)
newStringFormatConfiguration ::
StringFormatConfiguration
newStringFormatConfiguration :: StringFormatConfiguration
newStringFormatConfiguration =
StringFormatConfiguration'
{ $sel:nullValueFormatConfiguration:StringFormatConfiguration' :: Maybe NullValueFormatConfiguration
nullValueFormatConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:numericFormatConfiguration:StringFormatConfiguration' :: Maybe NumericFormatConfiguration
numericFormatConfiguration = forall a. Maybe a
Prelude.Nothing
}
stringFormatConfiguration_nullValueFormatConfiguration :: Lens.Lens' StringFormatConfiguration (Prelude.Maybe NullValueFormatConfiguration)
stringFormatConfiguration_nullValueFormatConfiguration :: Lens'
StringFormatConfiguration (Maybe NullValueFormatConfiguration)
stringFormatConfiguration_nullValueFormatConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StringFormatConfiguration' {Maybe NullValueFormatConfiguration
nullValueFormatConfiguration :: Maybe NullValueFormatConfiguration
$sel:nullValueFormatConfiguration:StringFormatConfiguration' :: StringFormatConfiguration -> Maybe NullValueFormatConfiguration
nullValueFormatConfiguration} -> Maybe NullValueFormatConfiguration
nullValueFormatConfiguration) (\s :: StringFormatConfiguration
s@StringFormatConfiguration' {} Maybe NullValueFormatConfiguration
a -> StringFormatConfiguration
s {$sel:nullValueFormatConfiguration:StringFormatConfiguration' :: Maybe NullValueFormatConfiguration
nullValueFormatConfiguration = Maybe NullValueFormatConfiguration
a} :: StringFormatConfiguration)
stringFormatConfiguration_numericFormatConfiguration :: Lens.Lens' StringFormatConfiguration (Prelude.Maybe NumericFormatConfiguration)
stringFormatConfiguration_numericFormatConfiguration :: Lens' StringFormatConfiguration (Maybe NumericFormatConfiguration)
stringFormatConfiguration_numericFormatConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StringFormatConfiguration' {Maybe NumericFormatConfiguration
numericFormatConfiguration :: Maybe NumericFormatConfiguration
$sel:numericFormatConfiguration:StringFormatConfiguration' :: StringFormatConfiguration -> Maybe NumericFormatConfiguration
numericFormatConfiguration} -> Maybe NumericFormatConfiguration
numericFormatConfiguration) (\s :: StringFormatConfiguration
s@StringFormatConfiguration' {} Maybe NumericFormatConfiguration
a -> StringFormatConfiguration
s {$sel:numericFormatConfiguration:StringFormatConfiguration' :: Maybe NumericFormatConfiguration
numericFormatConfiguration = Maybe NumericFormatConfiguration
a} :: StringFormatConfiguration)
instance Data.FromJSON StringFormatConfiguration where
parseJSON :: Value -> Parser StringFormatConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"StringFormatConfiguration"
( \Object
x ->
Maybe NullValueFormatConfiguration
-> Maybe NumericFormatConfiguration -> StringFormatConfiguration
StringFormatConfiguration'
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
"NullValueFormatConfiguration")
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
"NumericFormatConfiguration")
)
instance Prelude.Hashable StringFormatConfiguration where
hashWithSalt :: Int -> StringFormatConfiguration -> Int
hashWithSalt Int
_salt StringFormatConfiguration' {Maybe NullValueFormatConfiguration
Maybe NumericFormatConfiguration
numericFormatConfiguration :: Maybe NumericFormatConfiguration
nullValueFormatConfiguration :: Maybe NullValueFormatConfiguration
$sel:numericFormatConfiguration:StringFormatConfiguration' :: StringFormatConfiguration -> Maybe NumericFormatConfiguration
$sel:nullValueFormatConfiguration:StringFormatConfiguration' :: StringFormatConfiguration -> Maybe NullValueFormatConfiguration
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NullValueFormatConfiguration
nullValueFormatConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NumericFormatConfiguration
numericFormatConfiguration
instance Prelude.NFData StringFormatConfiguration where
rnf :: StringFormatConfiguration -> ()
rnf StringFormatConfiguration' {Maybe NullValueFormatConfiguration
Maybe NumericFormatConfiguration
numericFormatConfiguration :: Maybe NumericFormatConfiguration
nullValueFormatConfiguration :: Maybe NullValueFormatConfiguration
$sel:numericFormatConfiguration:StringFormatConfiguration' :: StringFormatConfiguration -> Maybe NumericFormatConfiguration
$sel:nullValueFormatConfiguration:StringFormatConfiguration' :: StringFormatConfiguration -> Maybe NullValueFormatConfiguration
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe NullValueFormatConfiguration
nullValueFormatConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NumericFormatConfiguration
numericFormatConfiguration
instance Data.ToJSON StringFormatConfiguration where
toJSON :: StringFormatConfiguration -> Value
toJSON StringFormatConfiguration' {Maybe NullValueFormatConfiguration
Maybe NumericFormatConfiguration
numericFormatConfiguration :: Maybe NumericFormatConfiguration
nullValueFormatConfiguration :: Maybe NullValueFormatConfiguration
$sel:numericFormatConfiguration:StringFormatConfiguration' :: StringFormatConfiguration -> Maybe NumericFormatConfiguration
$sel:nullValueFormatConfiguration:StringFormatConfiguration' :: StringFormatConfiguration -> Maybe NullValueFormatConfiguration
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"NullValueFormatConfiguration" 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 NullValueFormatConfiguration
nullValueFormatConfiguration,
(Key
"NumericFormatConfiguration" 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 NumericFormatConfiguration
numericFormatConfiguration
]
)