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