{-# 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.TemplateSourceTemplate
-- 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.TemplateSourceTemplate where

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

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

-- |
-- Create a value of 'TemplateSourceTemplate' 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', 'templateSourceTemplate_arn' - The Amazon Resource Name (ARN) of the resource.
newTemplateSourceTemplate ::
  -- | 'arn'
  Prelude.Text ->
  TemplateSourceTemplate
newTemplateSourceTemplate :: Text -> TemplateSourceTemplate
newTemplateSourceTemplate Text
pArn_ =
  TemplateSourceTemplate' :: Text -> TemplateSourceTemplate
TemplateSourceTemplate' {$sel:arn:TemplateSourceTemplate' :: Text
arn = Text
pArn_}

-- | The Amazon Resource Name (ARN) of the resource.
templateSourceTemplate_arn :: Lens.Lens' TemplateSourceTemplate Prelude.Text
templateSourceTemplate_arn :: (Text -> f Text)
-> TemplateSourceTemplate -> f TemplateSourceTemplate
templateSourceTemplate_arn = (TemplateSourceTemplate -> Text)
-> (TemplateSourceTemplate -> Text -> TemplateSourceTemplate)
-> Lens TemplateSourceTemplate TemplateSourceTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateSourceTemplate' {Text
arn :: Text
$sel:arn:TemplateSourceTemplate' :: TemplateSourceTemplate -> Text
arn} -> Text
arn) (\s :: TemplateSourceTemplate
s@TemplateSourceTemplate' {} Text
a -> TemplateSourceTemplate
s {$sel:arn:TemplateSourceTemplate' :: Text
arn = Text
a} :: TemplateSourceTemplate)

instance Prelude.Hashable TemplateSourceTemplate

instance Prelude.NFData TemplateSourceTemplate

instance Core.ToJSON TemplateSourceTemplate where
  toJSON :: TemplateSourceTemplate -> Value
toJSON TemplateSourceTemplate' {Text
arn :: Text
$sel:arn:TemplateSourceTemplate' :: TemplateSourceTemplate -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Arn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
arn)]
      )