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

-- |
-- Create a value of 'ProgressBarOptions' 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', 'progressBarOptions_visibility' - The visibility of the progress bar.
newProgressBarOptions ::
  ProgressBarOptions
newProgressBarOptions :: ProgressBarOptions
newProgressBarOptions =
  ProgressBarOptions' {$sel:visibility:ProgressBarOptions' :: Maybe Visibility
visibility = forall a. Maybe a
Prelude.Nothing}

-- | The visibility of the progress bar.
progressBarOptions_visibility :: Lens.Lens' ProgressBarOptions (Prelude.Maybe Visibility)
progressBarOptions_visibility :: Lens' ProgressBarOptions (Maybe Visibility)
progressBarOptions_visibility = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProgressBarOptions' {Maybe Visibility
visibility :: Maybe Visibility
$sel:visibility:ProgressBarOptions' :: ProgressBarOptions -> Maybe Visibility
visibility} -> Maybe Visibility
visibility) (\s :: ProgressBarOptions
s@ProgressBarOptions' {} Maybe Visibility
a -> ProgressBarOptions
s {$sel:visibility:ProgressBarOptions' :: Maybe Visibility
visibility = Maybe Visibility
a} :: ProgressBarOptions)

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

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

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