{-# 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.SheetControlsOption
-- 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.SheetControlsOption where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types.DashboardUIState

-- | Sheet controls option.
--
-- /See:/ 'newSheetControlsOption' smart constructor.
data SheetControlsOption = SheetControlsOption'
  { -- | Visibility state.
    SheetControlsOption -> Maybe DashboardUIState
visibilityState :: Prelude.Maybe DashboardUIState
  }
  deriving (SheetControlsOption -> SheetControlsOption -> Bool
(SheetControlsOption -> SheetControlsOption -> Bool)
-> (SheetControlsOption -> SheetControlsOption -> Bool)
-> Eq SheetControlsOption
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SheetControlsOption -> SheetControlsOption -> Bool
$c/= :: SheetControlsOption -> SheetControlsOption -> Bool
== :: SheetControlsOption -> SheetControlsOption -> Bool
$c== :: SheetControlsOption -> SheetControlsOption -> Bool
Prelude.Eq, ReadPrec [SheetControlsOption]
ReadPrec SheetControlsOption
Int -> ReadS SheetControlsOption
ReadS [SheetControlsOption]
(Int -> ReadS SheetControlsOption)
-> ReadS [SheetControlsOption]
-> ReadPrec SheetControlsOption
-> ReadPrec [SheetControlsOption]
-> Read SheetControlsOption
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SheetControlsOption]
$creadListPrec :: ReadPrec [SheetControlsOption]
readPrec :: ReadPrec SheetControlsOption
$creadPrec :: ReadPrec SheetControlsOption
readList :: ReadS [SheetControlsOption]
$creadList :: ReadS [SheetControlsOption]
readsPrec :: Int -> ReadS SheetControlsOption
$creadsPrec :: Int -> ReadS SheetControlsOption
Prelude.Read, Int -> SheetControlsOption -> ShowS
[SheetControlsOption] -> ShowS
SheetControlsOption -> String
(Int -> SheetControlsOption -> ShowS)
-> (SheetControlsOption -> String)
-> ([SheetControlsOption] -> ShowS)
-> Show SheetControlsOption
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SheetControlsOption] -> ShowS
$cshowList :: [SheetControlsOption] -> ShowS
show :: SheetControlsOption -> String
$cshow :: SheetControlsOption -> String
showsPrec :: Int -> SheetControlsOption -> ShowS
$cshowsPrec :: Int -> SheetControlsOption -> ShowS
Prelude.Show, (forall x. SheetControlsOption -> Rep SheetControlsOption x)
-> (forall x. Rep SheetControlsOption x -> SheetControlsOption)
-> Generic SheetControlsOption
forall x. Rep SheetControlsOption x -> SheetControlsOption
forall x. SheetControlsOption -> Rep SheetControlsOption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SheetControlsOption x -> SheetControlsOption
$cfrom :: forall x. SheetControlsOption -> Rep SheetControlsOption x
Prelude.Generic)

-- |
-- Create a value of 'SheetControlsOption' 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:
--
-- 'visibilityState', 'sheetControlsOption_visibilityState' - Visibility state.
newSheetControlsOption ::
  SheetControlsOption
newSheetControlsOption :: SheetControlsOption
newSheetControlsOption =
  SheetControlsOption' :: Maybe DashboardUIState -> SheetControlsOption
SheetControlsOption'
    { $sel:visibilityState:SheetControlsOption' :: Maybe DashboardUIState
visibilityState =
        Maybe DashboardUIState
forall a. Maybe a
Prelude.Nothing
    }

-- | Visibility state.
sheetControlsOption_visibilityState :: Lens.Lens' SheetControlsOption (Prelude.Maybe DashboardUIState)
sheetControlsOption_visibilityState :: (Maybe DashboardUIState -> f (Maybe DashboardUIState))
-> SheetControlsOption -> f SheetControlsOption
sheetControlsOption_visibilityState = (SheetControlsOption -> Maybe DashboardUIState)
-> (SheetControlsOption
    -> Maybe DashboardUIState -> SheetControlsOption)
-> Lens
     SheetControlsOption
     SheetControlsOption
     (Maybe DashboardUIState)
     (Maybe DashboardUIState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SheetControlsOption' {Maybe DashboardUIState
visibilityState :: Maybe DashboardUIState
$sel:visibilityState:SheetControlsOption' :: SheetControlsOption -> Maybe DashboardUIState
visibilityState} -> Maybe DashboardUIState
visibilityState) (\s :: SheetControlsOption
s@SheetControlsOption' {} Maybe DashboardUIState
a -> SheetControlsOption
s {$sel:visibilityState:SheetControlsOption' :: Maybe DashboardUIState
visibilityState = Maybe DashboardUIState
a} :: SheetControlsOption)

instance Prelude.Hashable SheetControlsOption

instance Prelude.NFData SheetControlsOption

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