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