{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.QuickSight.Types.ThemeAlias where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An alias for a theme.
--
-- /See:/ 'newThemeAlias' smart constructor.
data ThemeAlias = ThemeAlias'
  { -- | 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,
    -- | The display name of the theme alias.
    ThemeAlias -> Maybe Text
aliasName :: Prelude.Maybe Prelude.Text
  }
  deriving (ThemeAlias -> ThemeAlias -> Bool
(ThemeAlias -> ThemeAlias -> Bool)
-> (ThemeAlias -> ThemeAlias -> Bool) -> Eq ThemeAlias
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]
(Int -> ReadS ThemeAlias)
-> ReadS [ThemeAlias]
-> ReadPrec ThemeAlias
-> ReadPrec [ThemeAlias]
-> Read 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
(Int -> ThemeAlias -> ShowS)
-> (ThemeAlias -> String)
-> ([ThemeAlias] -> ShowS)
-> Show ThemeAlias
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. ThemeAlias -> Rep ThemeAlias x)
-> (forall x. Rep ThemeAlias x -> ThemeAlias) -> Generic ThemeAlias
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:
--
-- 'arn', 'themeAlias_arn' - The Amazon Resource Name (ARN) of the theme alias.
--
-- 'themeVersionNumber', 'themeAlias_themeVersionNumber' - The version number of the theme alias.
--
-- 'aliasName', 'themeAlias_aliasName' - The display name of the theme alias.
newThemeAlias ::
  ThemeAlias
newThemeAlias :: ThemeAlias
newThemeAlias =
  ThemeAlias' :: Maybe Text -> Maybe Natural -> Maybe Text -> ThemeAlias
ThemeAlias'
    { $sel:arn:ThemeAlias' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:themeVersionNumber:ThemeAlias' :: Maybe Natural
themeVersionNumber = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:aliasName:ThemeAlias' :: Maybe Text
aliasName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the theme alias.
themeAlias_arn :: Lens.Lens' ThemeAlias (Prelude.Maybe Prelude.Text)
themeAlias_arn :: (Maybe Text -> f (Maybe Text)) -> ThemeAlias -> f ThemeAlias
themeAlias_arn = (ThemeAlias -> Maybe Text)
-> (ThemeAlias -> Maybe Text -> ThemeAlias)
-> Lens ThemeAlias ThemeAlias (Maybe Text) (Maybe Text)
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 :: (Maybe Natural -> f (Maybe Natural)) -> ThemeAlias -> f ThemeAlias
themeAlias_themeVersionNumber = (ThemeAlias -> Maybe Natural)
-> (ThemeAlias -> Maybe Natural -> ThemeAlias)
-> Lens ThemeAlias ThemeAlias (Maybe Natural) (Maybe Natural)
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)

-- | The display name of the theme alias.
themeAlias_aliasName :: Lens.Lens' ThemeAlias (Prelude.Maybe Prelude.Text)
themeAlias_aliasName :: (Maybe Text -> f (Maybe Text)) -> ThemeAlias -> f ThemeAlias
themeAlias_aliasName = (ThemeAlias -> Maybe Text)
-> (ThemeAlias -> Maybe Text -> ThemeAlias)
-> Lens ThemeAlias ThemeAlias (Maybe Text) (Maybe Text)
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)

instance Core.FromJSON ThemeAlias where
  parseJSON :: Value -> Parser ThemeAlias
parseJSON =
    String
-> (Object -> Parser ThemeAlias) -> Value -> Parser ThemeAlias
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ThemeAlias"
      ( \Object
x ->
          Maybe Text -> Maybe Natural -> Maybe Text -> ThemeAlias
ThemeAlias'
            (Maybe Text -> Maybe Natural -> Maybe Text -> ThemeAlias)
-> Parser (Maybe Text)
-> Parser (Maybe Natural -> Maybe Text -> ThemeAlias)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Arn")
            Parser (Maybe Natural -> Maybe Text -> ThemeAlias)
-> Parser (Maybe Natural) -> Parser (Maybe Text -> ThemeAlias)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ThemeVersionNumber")
            Parser (Maybe Text -> ThemeAlias)
-> Parser (Maybe Text) -> Parser ThemeAlias
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AliasName")
      )

instance Prelude.Hashable ThemeAlias

instance Prelude.NFData ThemeAlias