{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.QuickSight.Types.GutterStyle
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.QuickSight.Types.GutterStyle 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

-- | The display options for gutter spacing between tiles on a sheet.
--
-- /See:/ 'newGutterStyle' smart constructor.
data GutterStyle = GutterStyle'
  { -- | This Boolean value controls whether to display a gutter space between
    -- sheet tiles.
    GutterStyle -> Maybe Bool
show :: Prelude.Maybe Prelude.Bool
  }
  deriving (GutterStyle -> GutterStyle -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GutterStyle -> GutterStyle -> Bool
$c/= :: GutterStyle -> GutterStyle -> Bool
== :: GutterStyle -> GutterStyle -> Bool
$c== :: GutterStyle -> GutterStyle -> Bool
Prelude.Eq, ReadPrec [GutterStyle]
ReadPrec GutterStyle
Int -> ReadS GutterStyle
ReadS [GutterStyle]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GutterStyle]
$creadListPrec :: ReadPrec [GutterStyle]
readPrec :: ReadPrec GutterStyle
$creadPrec :: ReadPrec GutterStyle
readList :: ReadS [GutterStyle]
$creadList :: ReadS [GutterStyle]
readsPrec :: Int -> ReadS GutterStyle
$creadsPrec :: Int -> ReadS GutterStyle
Prelude.Read, Int -> GutterStyle -> ShowS
[GutterStyle] -> ShowS
GutterStyle -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GutterStyle] -> ShowS
$cshowList :: [GutterStyle] -> ShowS
show :: GutterStyle -> String
$cshow :: GutterStyle -> String
showsPrec :: Int -> GutterStyle -> ShowS
$cshowsPrec :: Int -> GutterStyle -> ShowS
Prelude.Show, forall x. Rep GutterStyle x -> GutterStyle
forall x. GutterStyle -> Rep GutterStyle x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GutterStyle x -> GutterStyle
$cfrom :: forall x. GutterStyle -> Rep GutterStyle x
Prelude.Generic)

-- |
-- Create a value of 'GutterStyle' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'show', 'gutterStyle_show' - This Boolean value controls whether to display a gutter space between
-- sheet tiles.
newGutterStyle ::
  GutterStyle
newGutterStyle :: GutterStyle
newGutterStyle = GutterStyle' {$sel:show:GutterStyle' :: Maybe Bool
show = forall a. Maybe a
Prelude.Nothing}

-- | This Boolean value controls whether to display a gutter space between
-- sheet tiles.
gutterStyle_show :: Lens.Lens' GutterStyle (Prelude.Maybe Prelude.Bool)
gutterStyle_show :: Lens' GutterStyle (Maybe Bool)
gutterStyle_show = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GutterStyle' {Maybe Bool
show :: Maybe Bool
$sel:show:GutterStyle' :: GutterStyle -> Maybe Bool
show} -> Maybe Bool
show) (\s :: GutterStyle
s@GutterStyle' {} Maybe Bool
a -> GutterStyle
s {$sel:show:GutterStyle' :: Maybe Bool
show = Maybe Bool
a} :: GutterStyle)

instance Data.FromJSON GutterStyle where
  parseJSON :: Value -> Parser GutterStyle
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"GutterStyle"
      (\Object
x -> Maybe Bool -> GutterStyle
GutterStyle' 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
"Show"))

instance Prelude.Hashable GutterStyle where
  hashWithSalt :: Int -> GutterStyle -> Int
hashWithSalt Int
_salt GutterStyle' {Maybe Bool
show :: Maybe Bool
$sel:show:GutterStyle' :: GutterStyle -> Maybe Bool
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
show

instance Prelude.NFData GutterStyle where
  rnf :: GutterStyle -> ()
rnf GutterStyle' {Maybe Bool
show :: Maybe Bool
$sel:show:GutterStyle' :: GutterStyle -> Maybe Bool
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
show

instance Data.ToJSON GutterStyle where
  toJSON :: GutterStyle -> Value
toJSON GutterStyle' {Maybe Bool
show :: Maybe Bool
$sel:show:GutterStyle' :: GutterStyle -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"Show" 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 Bool
show]
      )