{-# 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.ListControlSelectAllOptions
-- 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.ListControlSelectAllOptions 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.Visibility

-- | The configuration of the @Select all@ options in a list control.
--
-- /See:/ 'newListControlSelectAllOptions' smart constructor.
data ListControlSelectAllOptions = ListControlSelectAllOptions'
  { -- | The visibility configuration of the @Select all@ options in a list
    -- control.
    ListControlSelectAllOptions -> Maybe Visibility
visibility :: Prelude.Maybe Visibility
  }
  deriving (ListControlSelectAllOptions -> ListControlSelectAllOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListControlSelectAllOptions -> ListControlSelectAllOptions -> Bool
$c/= :: ListControlSelectAllOptions -> ListControlSelectAllOptions -> Bool
== :: ListControlSelectAllOptions -> ListControlSelectAllOptions -> Bool
$c== :: ListControlSelectAllOptions -> ListControlSelectAllOptions -> Bool
Prelude.Eq, ReadPrec [ListControlSelectAllOptions]
ReadPrec ListControlSelectAllOptions
Int -> ReadS ListControlSelectAllOptions
ReadS [ListControlSelectAllOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListControlSelectAllOptions]
$creadListPrec :: ReadPrec [ListControlSelectAllOptions]
readPrec :: ReadPrec ListControlSelectAllOptions
$creadPrec :: ReadPrec ListControlSelectAllOptions
readList :: ReadS [ListControlSelectAllOptions]
$creadList :: ReadS [ListControlSelectAllOptions]
readsPrec :: Int -> ReadS ListControlSelectAllOptions
$creadsPrec :: Int -> ReadS ListControlSelectAllOptions
Prelude.Read, Int -> ListControlSelectAllOptions -> ShowS
[ListControlSelectAllOptions] -> ShowS
ListControlSelectAllOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListControlSelectAllOptions] -> ShowS
$cshowList :: [ListControlSelectAllOptions] -> ShowS
show :: ListControlSelectAllOptions -> String
$cshow :: ListControlSelectAllOptions -> String
showsPrec :: Int -> ListControlSelectAllOptions -> ShowS
$cshowsPrec :: Int -> ListControlSelectAllOptions -> ShowS
Prelude.Show, forall x.
Rep ListControlSelectAllOptions x -> ListControlSelectAllOptions
forall x.
ListControlSelectAllOptions -> Rep ListControlSelectAllOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListControlSelectAllOptions x -> ListControlSelectAllOptions
$cfrom :: forall x.
ListControlSelectAllOptions -> Rep ListControlSelectAllOptions x
Prelude.Generic)

-- |
-- Create a value of 'ListControlSelectAllOptions' 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:
--
-- 'visibility', 'listControlSelectAllOptions_visibility' - The visibility configuration of the @Select all@ options in a list
-- control.
newListControlSelectAllOptions ::
  ListControlSelectAllOptions
newListControlSelectAllOptions :: ListControlSelectAllOptions
newListControlSelectAllOptions =
  ListControlSelectAllOptions'
    { $sel:visibility:ListControlSelectAllOptions' :: Maybe Visibility
visibility =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The visibility configuration of the @Select all@ options in a list
-- control.
listControlSelectAllOptions_visibility :: Lens.Lens' ListControlSelectAllOptions (Prelude.Maybe Visibility)
listControlSelectAllOptions_visibility :: Lens' ListControlSelectAllOptions (Maybe Visibility)
listControlSelectAllOptions_visibility = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListControlSelectAllOptions' {Maybe Visibility
visibility :: Maybe Visibility
$sel:visibility:ListControlSelectAllOptions' :: ListControlSelectAllOptions -> Maybe Visibility
visibility} -> Maybe Visibility
visibility) (\s :: ListControlSelectAllOptions
s@ListControlSelectAllOptions' {} Maybe Visibility
a -> ListControlSelectAllOptions
s {$sel:visibility:ListControlSelectAllOptions' :: Maybe Visibility
visibility = Maybe Visibility
a} :: ListControlSelectAllOptions)

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

instance Prelude.Hashable ListControlSelectAllOptions where
  hashWithSalt :: Int -> ListControlSelectAllOptions -> Int
hashWithSalt Int
_salt ListControlSelectAllOptions' {Maybe Visibility
visibility :: Maybe Visibility
$sel:visibility:ListControlSelectAllOptions' :: ListControlSelectAllOptions -> Maybe Visibility
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Visibility
visibility

instance Prelude.NFData ListControlSelectAllOptions where
  rnf :: ListControlSelectAllOptions -> ()
rnf ListControlSelectAllOptions' {Maybe Visibility
visibility :: Maybe Visibility
$sel:visibility:ListControlSelectAllOptions' :: ListControlSelectAllOptions -> Maybe Visibility
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Visibility
visibility

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