{-# 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.HeaderFooterSectionConfiguration 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.SectionLayoutConfiguration
import Amazonka.QuickSight.Types.SectionStyle
data =
{
:: Prelude.Maybe SectionStyle,
:: Prelude.Text,
:: SectionLayoutConfiguration
}
deriving (HeaderFooterSectionConfiguration
-> HeaderFooterSectionConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HeaderFooterSectionConfiguration
-> HeaderFooterSectionConfiguration -> Bool
$c/= :: HeaderFooterSectionConfiguration
-> HeaderFooterSectionConfiguration -> Bool
== :: HeaderFooterSectionConfiguration
-> HeaderFooterSectionConfiguration -> Bool
$c== :: HeaderFooterSectionConfiguration
-> HeaderFooterSectionConfiguration -> Bool
Prelude.Eq, Int -> HeaderFooterSectionConfiguration -> ShowS
[HeaderFooterSectionConfiguration] -> ShowS
HeaderFooterSectionConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HeaderFooterSectionConfiguration] -> ShowS
$cshowList :: [HeaderFooterSectionConfiguration] -> ShowS
show :: HeaderFooterSectionConfiguration -> String
$cshow :: HeaderFooterSectionConfiguration -> String
showsPrec :: Int -> HeaderFooterSectionConfiguration -> ShowS
$cshowsPrec :: Int -> HeaderFooterSectionConfiguration -> ShowS
Prelude.Show, forall x.
Rep HeaderFooterSectionConfiguration x
-> HeaderFooterSectionConfiguration
forall x.
HeaderFooterSectionConfiguration
-> Rep HeaderFooterSectionConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep HeaderFooterSectionConfiguration x
-> HeaderFooterSectionConfiguration
$cfrom :: forall x.
HeaderFooterSectionConfiguration
-> Rep HeaderFooterSectionConfiguration x
Prelude.Generic)
newHeaderFooterSectionConfiguration ::
Prelude.Text ->
SectionLayoutConfiguration ->
HeaderFooterSectionConfiguration
Text
pSectionId_
SectionLayoutConfiguration
pLayout_ =
HeaderFooterSectionConfiguration'
{ $sel:style:HeaderFooterSectionConfiguration' :: Maybe SectionStyle
style =
forall a. Maybe a
Prelude.Nothing,
$sel:sectionId:HeaderFooterSectionConfiguration' :: Text
sectionId = Text
pSectionId_,
$sel:layout:HeaderFooterSectionConfiguration' :: SectionLayoutConfiguration
layout = SectionLayoutConfiguration
pLayout_
}
headerFooterSectionConfiguration_style :: Lens.Lens' HeaderFooterSectionConfiguration (Prelude.Maybe SectionStyle)
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HeaderFooterSectionConfiguration' {Maybe SectionStyle
style :: Maybe SectionStyle
$sel:style:HeaderFooterSectionConfiguration' :: HeaderFooterSectionConfiguration -> Maybe SectionStyle
style} -> Maybe SectionStyle
style) (\s :: HeaderFooterSectionConfiguration
s@HeaderFooterSectionConfiguration' {} Maybe SectionStyle
a -> HeaderFooterSectionConfiguration
s {$sel:style:HeaderFooterSectionConfiguration' :: Maybe SectionStyle
style = Maybe SectionStyle
a} :: HeaderFooterSectionConfiguration)
headerFooterSectionConfiguration_sectionId :: Lens.Lens' HeaderFooterSectionConfiguration Prelude.Text
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HeaderFooterSectionConfiguration' {Text
sectionId :: Text
$sel:sectionId:HeaderFooterSectionConfiguration' :: HeaderFooterSectionConfiguration -> Text
sectionId} -> Text
sectionId) (\s :: HeaderFooterSectionConfiguration
s@HeaderFooterSectionConfiguration' {} Text
a -> HeaderFooterSectionConfiguration
s {$sel:sectionId:HeaderFooterSectionConfiguration' :: Text
sectionId = Text
a} :: HeaderFooterSectionConfiguration)
headerFooterSectionConfiguration_layout :: Lens.Lens' HeaderFooterSectionConfiguration SectionLayoutConfiguration
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HeaderFooterSectionConfiguration' {SectionLayoutConfiguration
layout :: SectionLayoutConfiguration
$sel:layout:HeaderFooterSectionConfiguration' :: HeaderFooterSectionConfiguration -> SectionLayoutConfiguration
layout} -> SectionLayoutConfiguration
layout) (\s :: HeaderFooterSectionConfiguration
s@HeaderFooterSectionConfiguration' {} SectionLayoutConfiguration
a -> HeaderFooterSectionConfiguration
s {$sel:layout:HeaderFooterSectionConfiguration' :: SectionLayoutConfiguration
layout = SectionLayoutConfiguration
a} :: HeaderFooterSectionConfiguration)
instance
Data.FromJSON
HeaderFooterSectionConfiguration
where
parseJSON :: Value -> Parser HeaderFooterSectionConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"HeaderFooterSectionConfiguration"
( \Object
x ->
Maybe SectionStyle
-> Text
-> SectionLayoutConfiguration
-> HeaderFooterSectionConfiguration
HeaderFooterSectionConfiguration'
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
"Style")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"SectionId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Layout")
)
instance
Prelude.Hashable
HeaderFooterSectionConfiguration
where
hashWithSalt :: Int -> HeaderFooterSectionConfiguration -> Int
hashWithSalt
Int
_salt
HeaderFooterSectionConfiguration' {Maybe SectionStyle
Text
SectionLayoutConfiguration
layout :: SectionLayoutConfiguration
sectionId :: Text
style :: Maybe SectionStyle
$sel:layout:HeaderFooterSectionConfiguration' :: HeaderFooterSectionConfiguration -> SectionLayoutConfiguration
$sel:sectionId:HeaderFooterSectionConfiguration' :: HeaderFooterSectionConfiguration -> Text
$sel:style:HeaderFooterSectionConfiguration' :: HeaderFooterSectionConfiguration -> Maybe SectionStyle
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SectionStyle
style
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sectionId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SectionLayoutConfiguration
layout
instance
Prelude.NFData
HeaderFooterSectionConfiguration
where
rnf :: HeaderFooterSectionConfiguration -> ()
rnf HeaderFooterSectionConfiguration' {Maybe SectionStyle
Text
SectionLayoutConfiguration
layout :: SectionLayoutConfiguration
sectionId :: Text
style :: Maybe SectionStyle
$sel:layout:HeaderFooterSectionConfiguration' :: HeaderFooterSectionConfiguration -> SectionLayoutConfiguration
$sel:sectionId:HeaderFooterSectionConfiguration' :: HeaderFooterSectionConfiguration -> Text
$sel:style:HeaderFooterSectionConfiguration' :: HeaderFooterSectionConfiguration -> Maybe SectionStyle
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe SectionStyle
style
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sectionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SectionLayoutConfiguration
layout
instance Data.ToJSON HeaderFooterSectionConfiguration where
toJSON :: HeaderFooterSectionConfiguration -> Value
toJSON HeaderFooterSectionConfiguration' {Maybe SectionStyle
Text
SectionLayoutConfiguration
layout :: SectionLayoutConfiguration
sectionId :: Text
style :: Maybe SectionStyle
$sel:layout:HeaderFooterSectionConfiguration' :: HeaderFooterSectionConfiguration -> SectionLayoutConfiguration
$sel:sectionId:HeaderFooterSectionConfiguration' :: HeaderFooterSectionConfiguration -> Text
$sel:style:HeaderFooterSectionConfiguration' :: HeaderFooterSectionConfiguration -> Maybe SectionStyle
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Style" 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 SectionStyle
style,
forall a. a -> Maybe a
Prelude.Just (Key
"SectionId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
sectionId),
forall a. a -> Maybe a
Prelude.Just (Key
"Layout" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= SectionLayoutConfiguration
layout)
]
)