{-# 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.TextControlPlaceholderOptions
-- 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.TextControlPlaceholderOptions 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 placeholder options in a text control.
--
-- /See:/ 'newTextControlPlaceholderOptions' smart constructor.
data TextControlPlaceholderOptions = TextControlPlaceholderOptions'
  { -- | The visibility configuration of the placeholder options in a text
    -- control.
    TextControlPlaceholderOptions -> Maybe Visibility
visibility :: Prelude.Maybe Visibility
  }
  deriving (TextControlPlaceholderOptions
-> TextControlPlaceholderOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TextControlPlaceholderOptions
-> TextControlPlaceholderOptions -> Bool
$c/= :: TextControlPlaceholderOptions
-> TextControlPlaceholderOptions -> Bool
== :: TextControlPlaceholderOptions
-> TextControlPlaceholderOptions -> Bool
$c== :: TextControlPlaceholderOptions
-> TextControlPlaceholderOptions -> Bool
Prelude.Eq, ReadPrec [TextControlPlaceholderOptions]
ReadPrec TextControlPlaceholderOptions
Int -> ReadS TextControlPlaceholderOptions
ReadS [TextControlPlaceholderOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TextControlPlaceholderOptions]
$creadListPrec :: ReadPrec [TextControlPlaceholderOptions]
readPrec :: ReadPrec TextControlPlaceholderOptions
$creadPrec :: ReadPrec TextControlPlaceholderOptions
readList :: ReadS [TextControlPlaceholderOptions]
$creadList :: ReadS [TextControlPlaceholderOptions]
readsPrec :: Int -> ReadS TextControlPlaceholderOptions
$creadsPrec :: Int -> ReadS TextControlPlaceholderOptions
Prelude.Read, Int -> TextControlPlaceholderOptions -> ShowS
[TextControlPlaceholderOptions] -> ShowS
TextControlPlaceholderOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TextControlPlaceholderOptions] -> ShowS
$cshowList :: [TextControlPlaceholderOptions] -> ShowS
show :: TextControlPlaceholderOptions -> String
$cshow :: TextControlPlaceholderOptions -> String
showsPrec :: Int -> TextControlPlaceholderOptions -> ShowS
$cshowsPrec :: Int -> TextControlPlaceholderOptions -> ShowS
Prelude.Show, forall x.
Rep TextControlPlaceholderOptions x
-> TextControlPlaceholderOptions
forall x.
TextControlPlaceholderOptions
-> Rep TextControlPlaceholderOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TextControlPlaceholderOptions x
-> TextControlPlaceholderOptions
$cfrom :: forall x.
TextControlPlaceholderOptions
-> Rep TextControlPlaceholderOptions x
Prelude.Generic)

-- |
-- Create a value of 'TextControlPlaceholderOptions' 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', 'textControlPlaceholderOptions_visibility' - The visibility configuration of the placeholder options in a text
-- control.
newTextControlPlaceholderOptions ::
  TextControlPlaceholderOptions
newTextControlPlaceholderOptions :: TextControlPlaceholderOptions
newTextControlPlaceholderOptions =
  TextControlPlaceholderOptions'
    { $sel:visibility:TextControlPlaceholderOptions' :: Maybe Visibility
visibility =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The visibility configuration of the placeholder options in a text
-- control.
textControlPlaceholderOptions_visibility :: Lens.Lens' TextControlPlaceholderOptions (Prelude.Maybe Visibility)
textControlPlaceholderOptions_visibility :: Lens' TextControlPlaceholderOptions (Maybe Visibility)
textControlPlaceholderOptions_visibility = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TextControlPlaceholderOptions' {Maybe Visibility
visibility :: Maybe Visibility
$sel:visibility:TextControlPlaceholderOptions' :: TextControlPlaceholderOptions -> Maybe Visibility
visibility} -> Maybe Visibility
visibility) (\s :: TextControlPlaceholderOptions
s@TextControlPlaceholderOptions' {} Maybe Visibility
a -> TextControlPlaceholderOptions
s {$sel:visibility:TextControlPlaceholderOptions' :: Maybe Visibility
visibility = Maybe Visibility
a} :: TextControlPlaceholderOptions)

instance Data.FromJSON TextControlPlaceholderOptions where
  parseJSON :: Value -> Parser TextControlPlaceholderOptions
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"TextControlPlaceholderOptions"
      ( \Object
x ->
          Maybe Visibility -> TextControlPlaceholderOptions
TextControlPlaceholderOptions'
            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
    TextControlPlaceholderOptions
  where
  hashWithSalt :: Int -> TextControlPlaceholderOptions -> Int
hashWithSalt Int
_salt TextControlPlaceholderOptions' {Maybe Visibility
visibility :: Maybe Visibility
$sel:visibility:TextControlPlaceholderOptions' :: TextControlPlaceholderOptions -> Maybe Visibility
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Visibility
visibility

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

instance Data.ToJSON TextControlPlaceholderOptions where
  toJSON :: TextControlPlaceholderOptions -> Value
toJSON TextControlPlaceholderOptions' {Maybe Visibility
visibility :: Maybe Visibility
$sel:visibility:TextControlPlaceholderOptions' :: TextControlPlaceholderOptions -> 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]
      )