{-# 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.TableOptions 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.RowAlternateColorOptions
import Amazonka.QuickSight.Types.TableCellStyle
import Amazonka.QuickSight.Types.TableOrientation
data TableOptions = TableOptions'
{
TableOptions -> Maybe TableCellStyle
cellStyle :: Prelude.Maybe TableCellStyle,
:: Prelude.Maybe TableCellStyle,
TableOptions -> Maybe TableOrientation
orientation :: Prelude.Maybe TableOrientation,
TableOptions -> Maybe RowAlternateColorOptions
rowAlternateColorOptions :: Prelude.Maybe RowAlternateColorOptions
}
deriving (TableOptions -> TableOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TableOptions -> TableOptions -> Bool
$c/= :: TableOptions -> TableOptions -> Bool
== :: TableOptions -> TableOptions -> Bool
$c== :: TableOptions -> TableOptions -> Bool
Prelude.Eq, ReadPrec [TableOptions]
ReadPrec TableOptions
Int -> ReadS TableOptions
ReadS [TableOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TableOptions]
$creadListPrec :: ReadPrec [TableOptions]
readPrec :: ReadPrec TableOptions
$creadPrec :: ReadPrec TableOptions
readList :: ReadS [TableOptions]
$creadList :: ReadS [TableOptions]
readsPrec :: Int -> ReadS TableOptions
$creadsPrec :: Int -> ReadS TableOptions
Prelude.Read, Int -> TableOptions -> ShowS
[TableOptions] -> ShowS
TableOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TableOptions] -> ShowS
$cshowList :: [TableOptions] -> ShowS
show :: TableOptions -> String
$cshow :: TableOptions -> String
showsPrec :: Int -> TableOptions -> ShowS
$cshowsPrec :: Int -> TableOptions -> ShowS
Prelude.Show, forall x. Rep TableOptions x -> TableOptions
forall x. TableOptions -> Rep TableOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TableOptions x -> TableOptions
$cfrom :: forall x. TableOptions -> Rep TableOptions x
Prelude.Generic)
newTableOptions ::
TableOptions
newTableOptions :: TableOptions
newTableOptions =
TableOptions'
{ $sel:cellStyle:TableOptions' :: Maybe TableCellStyle
cellStyle = forall a. Maybe a
Prelude.Nothing,
$sel:headerStyle:TableOptions' :: Maybe TableCellStyle
headerStyle = forall a. Maybe a
Prelude.Nothing,
$sel:orientation:TableOptions' :: Maybe TableOrientation
orientation = forall a. Maybe a
Prelude.Nothing,
$sel:rowAlternateColorOptions:TableOptions' :: Maybe RowAlternateColorOptions
rowAlternateColorOptions = forall a. Maybe a
Prelude.Nothing
}
tableOptions_cellStyle :: Lens.Lens' TableOptions (Prelude.Maybe TableCellStyle)
tableOptions_cellStyle :: Lens' TableOptions (Maybe TableCellStyle)
tableOptions_cellStyle = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableOptions' {Maybe TableCellStyle
cellStyle :: Maybe TableCellStyle
$sel:cellStyle:TableOptions' :: TableOptions -> Maybe TableCellStyle
cellStyle} -> Maybe TableCellStyle
cellStyle) (\s :: TableOptions
s@TableOptions' {} Maybe TableCellStyle
a -> TableOptions
s {$sel:cellStyle:TableOptions' :: Maybe TableCellStyle
cellStyle = Maybe TableCellStyle
a} :: TableOptions)
tableOptions_headerStyle :: Lens.Lens' TableOptions (Prelude.Maybe TableCellStyle)
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableOptions' {Maybe TableCellStyle
headerStyle :: Maybe TableCellStyle
$sel:headerStyle:TableOptions' :: TableOptions -> Maybe TableCellStyle
headerStyle} -> Maybe TableCellStyle
headerStyle) (\s :: TableOptions
s@TableOptions' {} Maybe TableCellStyle
a -> TableOptions
s {$sel:headerStyle:TableOptions' :: Maybe TableCellStyle
headerStyle = Maybe TableCellStyle
a} :: TableOptions)
tableOptions_orientation :: Lens.Lens' TableOptions (Prelude.Maybe TableOrientation)
tableOptions_orientation :: Lens' TableOptions (Maybe TableOrientation)
tableOptions_orientation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableOptions' {Maybe TableOrientation
orientation :: Maybe TableOrientation
$sel:orientation:TableOptions' :: TableOptions -> Maybe TableOrientation
orientation} -> Maybe TableOrientation
orientation) (\s :: TableOptions
s@TableOptions' {} Maybe TableOrientation
a -> TableOptions
s {$sel:orientation:TableOptions' :: Maybe TableOrientation
orientation = Maybe TableOrientation
a} :: TableOptions)
tableOptions_rowAlternateColorOptions :: Lens.Lens' TableOptions (Prelude.Maybe RowAlternateColorOptions)
tableOptions_rowAlternateColorOptions :: Lens' TableOptions (Maybe RowAlternateColorOptions)
tableOptions_rowAlternateColorOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableOptions' {Maybe RowAlternateColorOptions
rowAlternateColorOptions :: Maybe RowAlternateColorOptions
$sel:rowAlternateColorOptions:TableOptions' :: TableOptions -> Maybe RowAlternateColorOptions
rowAlternateColorOptions} -> Maybe RowAlternateColorOptions
rowAlternateColorOptions) (\s :: TableOptions
s@TableOptions' {} Maybe RowAlternateColorOptions
a -> TableOptions
s {$sel:rowAlternateColorOptions:TableOptions' :: Maybe RowAlternateColorOptions
rowAlternateColorOptions = Maybe RowAlternateColorOptions
a} :: TableOptions)
instance Data.FromJSON TableOptions where
parseJSON :: Value -> Parser TableOptions
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"TableOptions"
( \Object
x ->
Maybe TableCellStyle
-> Maybe TableCellStyle
-> Maybe TableOrientation
-> Maybe RowAlternateColorOptions
-> TableOptions
TableOptions'
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
"CellStyle")
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
"HeaderStyle")
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
"Orientation")
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
"RowAlternateColorOptions")
)
instance Prelude.Hashable TableOptions where
hashWithSalt :: Int -> TableOptions -> Int
hashWithSalt Int
_salt TableOptions' {Maybe TableOrientation
Maybe TableCellStyle
Maybe RowAlternateColorOptions
rowAlternateColorOptions :: Maybe RowAlternateColorOptions
orientation :: Maybe TableOrientation
headerStyle :: Maybe TableCellStyle
cellStyle :: Maybe TableCellStyle
$sel:rowAlternateColorOptions:TableOptions' :: TableOptions -> Maybe RowAlternateColorOptions
$sel:orientation:TableOptions' :: TableOptions -> Maybe TableOrientation
$sel:headerStyle:TableOptions' :: TableOptions -> Maybe TableCellStyle
$sel:cellStyle:TableOptions' :: TableOptions -> Maybe TableCellStyle
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TableCellStyle
cellStyle
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TableCellStyle
headerStyle
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TableOrientation
orientation
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RowAlternateColorOptions
rowAlternateColorOptions
instance Prelude.NFData TableOptions where
rnf :: TableOptions -> ()
rnf TableOptions' {Maybe TableOrientation
Maybe TableCellStyle
Maybe RowAlternateColorOptions
rowAlternateColorOptions :: Maybe RowAlternateColorOptions
orientation :: Maybe TableOrientation
headerStyle :: Maybe TableCellStyle
cellStyle :: Maybe TableCellStyle
$sel:rowAlternateColorOptions:TableOptions' :: TableOptions -> Maybe RowAlternateColorOptions
$sel:orientation:TableOptions' :: TableOptions -> Maybe TableOrientation
$sel:headerStyle:TableOptions' :: TableOptions -> Maybe TableCellStyle
$sel:cellStyle:TableOptions' :: TableOptions -> Maybe TableCellStyle
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe TableCellStyle
cellStyle
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TableCellStyle
headerStyle
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TableOrientation
orientation
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RowAlternateColorOptions
rowAlternateColorOptions
instance Data.ToJSON TableOptions where
toJSON :: TableOptions -> Value
toJSON TableOptions' {Maybe TableOrientation
Maybe TableCellStyle
Maybe RowAlternateColorOptions
rowAlternateColorOptions :: Maybe RowAlternateColorOptions
orientation :: Maybe TableOrientation
headerStyle :: Maybe TableCellStyle
cellStyle :: Maybe TableCellStyle
$sel:rowAlternateColorOptions:TableOptions' :: TableOptions -> Maybe RowAlternateColorOptions
$sel:orientation:TableOptions' :: TableOptions -> Maybe TableOrientation
$sel:headerStyle:TableOptions' :: TableOptions -> Maybe TableCellStyle
$sel:cellStyle:TableOptions' :: TableOptions -> Maybe TableCellStyle
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"CellStyle" 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 TableCellStyle
cellStyle,
(Key
"HeaderStyle" 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 TableCellStyle
headerStyle,
(Key
"Orientation" 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 TableOrientation
orientation,
(Key
"RowAlternateColorOptions" 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 RowAlternateColorOptions
rowAlternateColorOptions
]
)