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