{-# 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.TileLayoutStyle 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.GutterStyle
import Amazonka.QuickSight.Types.MarginStyle
data TileLayoutStyle = TileLayoutStyle'
{
TileLayoutStyle -> Maybe GutterStyle
gutter :: Prelude.Maybe GutterStyle,
TileLayoutStyle -> Maybe MarginStyle
margin :: Prelude.Maybe MarginStyle
}
deriving (TileLayoutStyle -> TileLayoutStyle -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TileLayoutStyle -> TileLayoutStyle -> Bool
$c/= :: TileLayoutStyle -> TileLayoutStyle -> Bool
== :: TileLayoutStyle -> TileLayoutStyle -> Bool
$c== :: TileLayoutStyle -> TileLayoutStyle -> Bool
Prelude.Eq, ReadPrec [TileLayoutStyle]
ReadPrec TileLayoutStyle
Int -> ReadS TileLayoutStyle
ReadS [TileLayoutStyle]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TileLayoutStyle]
$creadListPrec :: ReadPrec [TileLayoutStyle]
readPrec :: ReadPrec TileLayoutStyle
$creadPrec :: ReadPrec TileLayoutStyle
readList :: ReadS [TileLayoutStyle]
$creadList :: ReadS [TileLayoutStyle]
readsPrec :: Int -> ReadS TileLayoutStyle
$creadsPrec :: Int -> ReadS TileLayoutStyle
Prelude.Read, Int -> TileLayoutStyle -> ShowS
[TileLayoutStyle] -> ShowS
TileLayoutStyle -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TileLayoutStyle] -> ShowS
$cshowList :: [TileLayoutStyle] -> ShowS
show :: TileLayoutStyle -> String
$cshow :: TileLayoutStyle -> String
showsPrec :: Int -> TileLayoutStyle -> ShowS
$cshowsPrec :: Int -> TileLayoutStyle -> ShowS
Prelude.Show, forall x. Rep TileLayoutStyle x -> TileLayoutStyle
forall x. TileLayoutStyle -> Rep TileLayoutStyle x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TileLayoutStyle x -> TileLayoutStyle
$cfrom :: forall x. TileLayoutStyle -> Rep TileLayoutStyle x
Prelude.Generic)
newTileLayoutStyle ::
TileLayoutStyle
newTileLayoutStyle :: TileLayoutStyle
newTileLayoutStyle =
TileLayoutStyle'
{ $sel:gutter:TileLayoutStyle' :: Maybe GutterStyle
gutter = forall a. Maybe a
Prelude.Nothing,
$sel:margin:TileLayoutStyle' :: Maybe MarginStyle
margin = forall a. Maybe a
Prelude.Nothing
}
tileLayoutStyle_gutter :: Lens.Lens' TileLayoutStyle (Prelude.Maybe GutterStyle)
tileLayoutStyle_gutter :: Lens' TileLayoutStyle (Maybe GutterStyle)
tileLayoutStyle_gutter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TileLayoutStyle' {Maybe GutterStyle
gutter :: Maybe GutterStyle
$sel:gutter:TileLayoutStyle' :: TileLayoutStyle -> Maybe GutterStyle
gutter} -> Maybe GutterStyle
gutter) (\s :: TileLayoutStyle
s@TileLayoutStyle' {} Maybe GutterStyle
a -> TileLayoutStyle
s {$sel:gutter:TileLayoutStyle' :: Maybe GutterStyle
gutter = Maybe GutterStyle
a} :: TileLayoutStyle)
tileLayoutStyle_margin :: Lens.Lens' TileLayoutStyle (Prelude.Maybe MarginStyle)
tileLayoutStyle_margin :: Lens' TileLayoutStyle (Maybe MarginStyle)
tileLayoutStyle_margin = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TileLayoutStyle' {Maybe MarginStyle
margin :: Maybe MarginStyle
$sel:margin:TileLayoutStyle' :: TileLayoutStyle -> Maybe MarginStyle
margin} -> Maybe MarginStyle
margin) (\s :: TileLayoutStyle
s@TileLayoutStyle' {} Maybe MarginStyle
a -> TileLayoutStyle
s {$sel:margin:TileLayoutStyle' :: Maybe MarginStyle
margin = Maybe MarginStyle
a} :: TileLayoutStyle)
instance Data.FromJSON TileLayoutStyle where
parseJSON :: Value -> Parser TileLayoutStyle
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"TileLayoutStyle"
( \Object
x ->
Maybe GutterStyle -> Maybe MarginStyle -> TileLayoutStyle
TileLayoutStyle'
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
"Gutter")
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
"Margin")
)
instance Prelude.Hashable TileLayoutStyle where
hashWithSalt :: Int -> TileLayoutStyle -> Int
hashWithSalt Int
_salt TileLayoutStyle' {Maybe GutterStyle
Maybe MarginStyle
margin :: Maybe MarginStyle
gutter :: Maybe GutterStyle
$sel:margin:TileLayoutStyle' :: TileLayoutStyle -> Maybe MarginStyle
$sel:gutter:TileLayoutStyle' :: TileLayoutStyle -> Maybe GutterStyle
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GutterStyle
gutter
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MarginStyle
margin
instance Prelude.NFData TileLayoutStyle where
rnf :: TileLayoutStyle -> ()
rnf TileLayoutStyle' {Maybe GutterStyle
Maybe MarginStyle
margin :: Maybe MarginStyle
gutter :: Maybe GutterStyle
$sel:margin:TileLayoutStyle' :: TileLayoutStyle -> Maybe MarginStyle
$sel:gutter:TileLayoutStyle' :: TileLayoutStyle -> Maybe GutterStyle
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe GutterStyle
gutter seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MarginStyle
margin
instance Data.ToJSON TileLayoutStyle where
toJSON :: TileLayoutStyle -> Value
toJSON TileLayoutStyle' {Maybe GutterStyle
Maybe MarginStyle
margin :: Maybe MarginStyle
gutter :: Maybe GutterStyle
$sel:margin:TileLayoutStyle' :: TileLayoutStyle -> Maybe MarginStyle
$sel:gutter:TileLayoutStyle' :: TileLayoutStyle -> Maybe GutterStyle
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Gutter" 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 GutterStyle
gutter,
(Key
"Margin" 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 MarginStyle
margin
]
)