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

-- |
-- Create a value of 'MaximumLabelType' 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', 'maximumLabelType_visibility' - The visibility of the maximum label.
newMaximumLabelType ::
  MaximumLabelType
newMaximumLabelType :: MaximumLabelType
newMaximumLabelType =
  MaximumLabelType' {$sel:visibility:MaximumLabelType' :: Maybe Visibility
visibility = forall a. Maybe a
Prelude.Nothing}

-- | The visibility of the maximum label.
maximumLabelType_visibility :: Lens.Lens' MaximumLabelType (Prelude.Maybe Visibility)
maximumLabelType_visibility :: Lens' MaximumLabelType (Maybe Visibility)
maximumLabelType_visibility = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaximumLabelType' {Maybe Visibility
visibility :: Maybe Visibility
$sel:visibility:MaximumLabelType' :: MaximumLabelType -> Maybe Visibility
visibility} -> Maybe Visibility
visibility) (\s :: MaximumLabelType
s@MaximumLabelType' {} Maybe Visibility
a -> MaximumLabelType
s {$sel:visibility:MaximumLabelType' :: Maybe Visibility
visibility = Maybe Visibility
a} :: MaximumLabelType)

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

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

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