{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.QuickSight.Types.GutterStyle where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(GutterStyle -> GutterStyle -> Bool)
-> (GutterStyle -> GutterStyle -> Bool) -> Eq GutterStyle
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]
(Int -> ReadS GutterStyle)
-> ReadS [GutterStyle]
-> ReadPrec GutterStyle
-> ReadPrec [GutterStyle]
-> Read 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
(Int -> GutterStyle -> ShowS)
-> (GutterStyle -> String)
-> ([GutterStyle] -> ShowS)
-> Show GutterStyle
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. GutterStyle -> Rep GutterStyle x)
-> (forall x. Rep GutterStyle x -> GutterStyle)
-> Generic GutterStyle
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' :: Maybe Bool -> GutterStyle
GutterStyle' {$sel:show:GutterStyle' :: Maybe Bool
show = Maybe Bool
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 :: (Maybe Bool -> f (Maybe Bool)) -> GutterStyle -> f GutterStyle
gutterStyle_show = (GutterStyle -> Maybe Bool)
-> (GutterStyle -> Maybe Bool -> GutterStyle)
-> Lens GutterStyle GutterStyle (Maybe Bool) (Maybe Bool)
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 Core.FromJSON GutterStyle where
  parseJSON :: Value -> Parser GutterStyle
parseJSON =
    String
-> (Object -> Parser GutterStyle) -> Value -> Parser GutterStyle
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"GutterStyle"
      (\Object
x -> Maybe Bool -> GutterStyle
GutterStyle' (Maybe Bool -> GutterStyle)
-> Parser (Maybe Bool) -> Parser GutterStyle
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Show"))

instance Prelude.Hashable GutterStyle

instance Prelude.NFData GutterStyle

instance Core.ToJSON GutterStyle where
  toJSON :: GutterStyle -> Value
toJSON GutterStyle' {Maybe Bool
show :: Maybe Bool
$sel:show:GutterStyle' :: GutterStyle -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"Show" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
show]
      )