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

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

-- |
-- Create a value of 'TemplateAlias' 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', 'templateAlias_aliasName' - The display name of the template alias.
--
-- 'arn', 'templateAlias_arn' - The Amazon Resource Name (ARN) of the template alias.
--
-- 'templateVersionNumber', 'templateAlias_templateVersionNumber' - The version number of the template alias.
newTemplateAlias ::
  TemplateAlias
newTemplateAlias :: TemplateAlias
newTemplateAlias =
  TemplateAlias'
    { $sel:aliasName:TemplateAlias' :: Maybe Text
aliasName = forall a. Maybe a
Prelude.Nothing,
      $sel:arn:TemplateAlias' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:templateVersionNumber:TemplateAlias' :: Maybe Natural
templateVersionNumber = forall a. Maybe a
Prelude.Nothing
    }

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

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

-- | The version number of the template alias.
templateAlias_templateVersionNumber :: Lens.Lens' TemplateAlias (Prelude.Maybe Prelude.Natural)
templateAlias_templateVersionNumber :: Lens' TemplateAlias (Maybe Natural)
templateAlias_templateVersionNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateAlias' {Maybe Natural
templateVersionNumber :: Maybe Natural
$sel:templateVersionNumber:TemplateAlias' :: TemplateAlias -> Maybe Natural
templateVersionNumber} -> Maybe Natural
templateVersionNumber) (\s :: TemplateAlias
s@TemplateAlias' {} Maybe Natural
a -> TemplateAlias
s {$sel:templateVersionNumber:TemplateAlias' :: Maybe Natural
templateVersionNumber = Maybe Natural
a} :: TemplateAlias)

instance Data.FromJSON TemplateAlias where
  parseJSON :: Value -> Parser TemplateAlias
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"TemplateAlias"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Natural -> TemplateAlias
TemplateAlias'
            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
"TemplateVersionNumber")
      )

instance Prelude.Hashable TemplateAlias where
  hashWithSalt :: Int -> TemplateAlias -> Int
hashWithSalt Int
_salt TemplateAlias' {Maybe Natural
Maybe Text
templateVersionNumber :: Maybe Natural
arn :: Maybe Text
aliasName :: Maybe Text
$sel:templateVersionNumber:TemplateAlias' :: TemplateAlias -> Maybe Natural
$sel:arn:TemplateAlias' :: TemplateAlias -> Maybe Text
$sel:aliasName:TemplateAlias' :: TemplateAlias -> 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
templateVersionNumber

instance Prelude.NFData TemplateAlias where
  rnf :: TemplateAlias -> ()
rnf TemplateAlias' {Maybe Natural
Maybe Text
templateVersionNumber :: Maybe Natural
arn :: Maybe Text
aliasName :: Maybe Text
$sel:templateVersionNumber:TemplateAlias' :: TemplateAlias -> Maybe Natural
$sel:arn:TemplateAlias' :: TemplateAlias -> Maybe Text
$sel:aliasName:TemplateAlias' :: TemplateAlias -> 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
templateVersionNumber