{-# 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.ThemeAlias
-- 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.ThemeAlias 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

-- | An alias for a theme.
--
-- /See:/ 'newThemeAlias' smart constructor.
data ThemeAlias = ThemeAlias'
  { -- | The display name of the theme alias.
    ThemeAlias -> Maybe Text
aliasName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the theme alias.
    ThemeAlias -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The version number of the theme alias.
    ThemeAlias -> Maybe Natural
themeVersionNumber :: Prelude.Maybe Prelude.Natural
  }
  deriving (ThemeAlias -> ThemeAlias -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ThemeAlias -> ThemeAlias -> Bool
$c/= :: ThemeAlias -> ThemeAlias -> Bool
== :: ThemeAlias -> ThemeAlias -> Bool
$c== :: ThemeAlias -> ThemeAlias -> Bool
Prelude.Eq, ReadPrec [ThemeAlias]
ReadPrec ThemeAlias
Int -> ReadS ThemeAlias
ReadS [ThemeAlias]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ThemeAlias]
$creadListPrec :: ReadPrec [ThemeAlias]
readPrec :: ReadPrec ThemeAlias
$creadPrec :: ReadPrec ThemeAlias
readList :: ReadS [ThemeAlias]
$creadList :: ReadS [ThemeAlias]
readsPrec :: Int -> ReadS ThemeAlias
$creadsPrec :: Int -> ReadS ThemeAlias
Prelude.Read, Int -> ThemeAlias -> ShowS
[ThemeAlias] -> ShowS
ThemeAlias -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ThemeAlias] -> ShowS
$cshowList :: [ThemeAlias] -> ShowS
show :: ThemeAlias -> String
$cshow :: ThemeAlias -> String
showsPrec :: Int -> ThemeAlias -> ShowS
$cshowsPrec :: Int -> ThemeAlias -> ShowS
Prelude.Show, forall x. Rep ThemeAlias x -> ThemeAlias
forall x. ThemeAlias -> Rep ThemeAlias x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ThemeAlias x -> ThemeAlias
$cfrom :: forall x. ThemeAlias -> Rep ThemeAlias x
Prelude.Generic)

-- |
-- Create a value of 'ThemeAlias' 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:
--
-- 'aliasName', 'themeAlias_aliasName' - The display name of the theme alias.
--
-- 'arn', 'themeAlias_arn' - The Amazon Resource Name (ARN) of the theme alias.
--
-- 'themeVersionNumber', 'themeAlias_themeVersionNumber' - The version number of the theme alias.
newThemeAlias ::
  ThemeAlias
newThemeAlias :: ThemeAlias
newThemeAlias =
  ThemeAlias'
    { $sel:aliasName:ThemeAlias' :: Maybe Text
aliasName = forall a. Maybe a
Prelude.Nothing,
      $sel:arn:ThemeAlias' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:themeVersionNumber:ThemeAlias' :: Maybe Natural
themeVersionNumber = forall a. Maybe a
Prelude.Nothing
    }

-- | The display name of the theme alias.
themeAlias_aliasName :: Lens.Lens' ThemeAlias (Prelude.Maybe Prelude.Text)
themeAlias_aliasName :: Lens' ThemeAlias (Maybe Text)
themeAlias_aliasName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThemeAlias' {Maybe Text
aliasName :: Maybe Text
$sel:aliasName:ThemeAlias' :: ThemeAlias -> Maybe Text
aliasName} -> Maybe Text
aliasName) (\s :: ThemeAlias
s@ThemeAlias' {} Maybe Text
a -> ThemeAlias
s {$sel:aliasName:ThemeAlias' :: Maybe Text
aliasName = Maybe Text
a} :: ThemeAlias)

-- | The Amazon Resource Name (ARN) of the theme alias.
themeAlias_arn :: Lens.Lens' ThemeAlias (Prelude.Maybe Prelude.Text)
themeAlias_arn :: Lens' ThemeAlias (Maybe Text)
themeAlias_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThemeAlias' {Maybe Text
arn :: Maybe Text
$sel:arn:ThemeAlias' :: ThemeAlias -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ThemeAlias
s@ThemeAlias' {} Maybe Text
a -> ThemeAlias
s {$sel:arn:ThemeAlias' :: Maybe Text
arn = Maybe Text
a} :: ThemeAlias)

-- | The version number of the theme alias.
themeAlias_themeVersionNumber :: Lens.Lens' ThemeAlias (Prelude.Maybe Prelude.Natural)
themeAlias_themeVersionNumber :: Lens' ThemeAlias (Maybe Natural)
themeAlias_themeVersionNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThemeAlias' {Maybe Natural
themeVersionNumber :: Maybe Natural
$sel:themeVersionNumber:ThemeAlias' :: ThemeAlias -> Maybe Natural
themeVersionNumber} -> Maybe Natural
themeVersionNumber) (\s :: ThemeAlias
s@ThemeAlias' {} Maybe Natural
a -> ThemeAlias
s {$sel:themeVersionNumber:ThemeAlias' :: Maybe Natural
themeVersionNumber = Maybe Natural
a} :: ThemeAlias)

instance Data.FromJSON ThemeAlias where
  parseJSON :: Value -> Parser ThemeAlias
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ThemeAlias"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Natural -> ThemeAlias
ThemeAlias'
            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
"AliasName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ThemeVersionNumber")
      )

instance Prelude.Hashable ThemeAlias where
  hashWithSalt :: Int -> ThemeAlias -> Int
hashWithSalt Int
_salt ThemeAlias' {Maybe Natural
Maybe Text
themeVersionNumber :: Maybe Natural
arn :: Maybe Text
aliasName :: Maybe Text
$sel:themeVersionNumber:ThemeAlias' :: ThemeAlias -> Maybe Natural
$sel:arn:ThemeAlias' :: ThemeAlias -> Maybe Text
$sel:aliasName:ThemeAlias' :: ThemeAlias -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
aliasName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
themeVersionNumber

instance Prelude.NFData ThemeAlias where
  rnf :: ThemeAlias -> ()
rnf ThemeAlias' {Maybe Natural
Maybe Text
themeVersionNumber :: Maybe Natural
arn :: Maybe Text
aliasName :: Maybe Text
$sel:themeVersionNumber:ThemeAlias' :: ThemeAlias -> Maybe Natural
$sel:arn:ThemeAlias' :: ThemeAlias -> Maybe Text
$sel:aliasName:ThemeAlias' :: ThemeAlias -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
aliasName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
themeVersionNumber