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

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

-- | The template summary.
--
-- /See:/ 'newTemplateSummary' smart constructor.
data TemplateSummary = TemplateSummary'
  { -- | The last time that this template was updated.
    TemplateSummary -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Core.POSIX,
    -- | A structure containing a list of version numbers for the template
    -- summary.
    TemplateSummary -> Maybe Natural
latestVersionNumber :: Prelude.Maybe Prelude.Natural,
    -- | A summary of a template.
    TemplateSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The last time that this template was created.
    TemplateSummary -> Maybe POSIX
createdTime :: Prelude.Maybe Core.POSIX,
    -- | The ID of the template. This ID is unique per Amazon Web Services Region
    -- for each Amazon Web Services account.
    TemplateSummary -> Maybe Text
templateId :: Prelude.Maybe Prelude.Text,
    -- | A display name for the template.
    TemplateSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (TemplateSummary -> TemplateSummary -> Bool
(TemplateSummary -> TemplateSummary -> Bool)
-> (TemplateSummary -> TemplateSummary -> Bool)
-> Eq TemplateSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TemplateSummary -> TemplateSummary -> Bool
$c/= :: TemplateSummary -> TemplateSummary -> Bool
== :: TemplateSummary -> TemplateSummary -> Bool
$c== :: TemplateSummary -> TemplateSummary -> Bool
Prelude.Eq, ReadPrec [TemplateSummary]
ReadPrec TemplateSummary
Int -> ReadS TemplateSummary
ReadS [TemplateSummary]
(Int -> ReadS TemplateSummary)
-> ReadS [TemplateSummary]
-> ReadPrec TemplateSummary
-> ReadPrec [TemplateSummary]
-> Read TemplateSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TemplateSummary]
$creadListPrec :: ReadPrec [TemplateSummary]
readPrec :: ReadPrec TemplateSummary
$creadPrec :: ReadPrec TemplateSummary
readList :: ReadS [TemplateSummary]
$creadList :: ReadS [TemplateSummary]
readsPrec :: Int -> ReadS TemplateSummary
$creadsPrec :: Int -> ReadS TemplateSummary
Prelude.Read, Int -> TemplateSummary -> ShowS
[TemplateSummary] -> ShowS
TemplateSummary -> String
(Int -> TemplateSummary -> ShowS)
-> (TemplateSummary -> String)
-> ([TemplateSummary] -> ShowS)
-> Show TemplateSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TemplateSummary] -> ShowS
$cshowList :: [TemplateSummary] -> ShowS
show :: TemplateSummary -> String
$cshow :: TemplateSummary -> String
showsPrec :: Int -> TemplateSummary -> ShowS
$cshowsPrec :: Int -> TemplateSummary -> ShowS
Prelude.Show, (forall x. TemplateSummary -> Rep TemplateSummary x)
-> (forall x. Rep TemplateSummary x -> TemplateSummary)
-> Generic TemplateSummary
forall x. Rep TemplateSummary x -> TemplateSummary
forall x. TemplateSummary -> Rep TemplateSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TemplateSummary x -> TemplateSummary
$cfrom :: forall x. TemplateSummary -> Rep TemplateSummary x
Prelude.Generic)

-- |
-- Create a value of 'TemplateSummary' 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:
--
-- 'lastUpdatedTime', 'templateSummary_lastUpdatedTime' - The last time that this template was updated.
--
-- 'latestVersionNumber', 'templateSummary_latestVersionNumber' - A structure containing a list of version numbers for the template
-- summary.
--
-- 'arn', 'templateSummary_arn' - A summary of a template.
--
-- 'createdTime', 'templateSummary_createdTime' - The last time that this template was created.
--
-- 'templateId', 'templateSummary_templateId' - The ID of the template. This ID is unique per Amazon Web Services Region
-- for each Amazon Web Services account.
--
-- 'name', 'templateSummary_name' - A display name for the template.
newTemplateSummary ::
  TemplateSummary
newTemplateSummary :: TemplateSummary
newTemplateSummary =
  TemplateSummary' :: Maybe POSIX
-> Maybe Natural
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> TemplateSummary
TemplateSummary'
    { $sel:lastUpdatedTime:TemplateSummary' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:latestVersionNumber:TemplateSummary' :: Maybe Natural
latestVersionNumber = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:TemplateSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:TemplateSummary' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:templateId:TemplateSummary' :: Maybe Text
templateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:TemplateSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The last time that this template was updated.
templateSummary_lastUpdatedTime :: Lens.Lens' TemplateSummary (Prelude.Maybe Prelude.UTCTime)
templateSummary_lastUpdatedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> TemplateSummary -> f TemplateSummary
templateSummary_lastUpdatedTime = (TemplateSummary -> Maybe POSIX)
-> (TemplateSummary -> Maybe POSIX -> TemplateSummary)
-> Lens TemplateSummary TemplateSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateSummary' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:TemplateSummary' :: TemplateSummary -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: TemplateSummary
s@TemplateSummary' {} Maybe POSIX
a -> TemplateSummary
s {$sel:lastUpdatedTime:TemplateSummary' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: TemplateSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> TemplateSummary -> f TemplateSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> TemplateSummary
-> f TemplateSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A structure containing a list of version numbers for the template
-- summary.
templateSummary_latestVersionNumber :: Lens.Lens' TemplateSummary (Prelude.Maybe Prelude.Natural)
templateSummary_latestVersionNumber :: (Maybe Natural -> f (Maybe Natural))
-> TemplateSummary -> f TemplateSummary
templateSummary_latestVersionNumber = (TemplateSummary -> Maybe Natural)
-> (TemplateSummary -> Maybe Natural -> TemplateSummary)
-> Lens
     TemplateSummary TemplateSummary (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateSummary' {Maybe Natural
latestVersionNumber :: Maybe Natural
$sel:latestVersionNumber:TemplateSummary' :: TemplateSummary -> Maybe Natural
latestVersionNumber} -> Maybe Natural
latestVersionNumber) (\s :: TemplateSummary
s@TemplateSummary' {} Maybe Natural
a -> TemplateSummary
s {$sel:latestVersionNumber:TemplateSummary' :: Maybe Natural
latestVersionNumber = Maybe Natural
a} :: TemplateSummary)

-- | A summary of a template.
templateSummary_arn :: Lens.Lens' TemplateSummary (Prelude.Maybe Prelude.Text)
templateSummary_arn :: (Maybe Text -> f (Maybe Text))
-> TemplateSummary -> f TemplateSummary
templateSummary_arn = (TemplateSummary -> Maybe Text)
-> (TemplateSummary -> Maybe Text -> TemplateSummary)
-> Lens TemplateSummary TemplateSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:TemplateSummary' :: TemplateSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: TemplateSummary
s@TemplateSummary' {} Maybe Text
a -> TemplateSummary
s {$sel:arn:TemplateSummary' :: Maybe Text
arn = Maybe Text
a} :: TemplateSummary)

-- | The last time that this template was created.
templateSummary_createdTime :: Lens.Lens' TemplateSummary (Prelude.Maybe Prelude.UTCTime)
templateSummary_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> TemplateSummary -> f TemplateSummary
templateSummary_createdTime = (TemplateSummary -> Maybe POSIX)
-> (TemplateSummary -> Maybe POSIX -> TemplateSummary)
-> Lens TemplateSummary TemplateSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateSummary' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:TemplateSummary' :: TemplateSummary -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: TemplateSummary
s@TemplateSummary' {} Maybe POSIX
a -> TemplateSummary
s {$sel:createdTime:TemplateSummary' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: TemplateSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> TemplateSummary -> f TemplateSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> TemplateSummary
-> f TemplateSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The ID of the template. This ID is unique per Amazon Web Services Region
-- for each Amazon Web Services account.
templateSummary_templateId :: Lens.Lens' TemplateSummary (Prelude.Maybe Prelude.Text)
templateSummary_templateId :: (Maybe Text -> f (Maybe Text))
-> TemplateSummary -> f TemplateSummary
templateSummary_templateId = (TemplateSummary -> Maybe Text)
-> (TemplateSummary -> Maybe Text -> TemplateSummary)
-> Lens TemplateSummary TemplateSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateSummary' {Maybe Text
templateId :: Maybe Text
$sel:templateId:TemplateSummary' :: TemplateSummary -> Maybe Text
templateId} -> Maybe Text
templateId) (\s :: TemplateSummary
s@TemplateSummary' {} Maybe Text
a -> TemplateSummary
s {$sel:templateId:TemplateSummary' :: Maybe Text
templateId = Maybe Text
a} :: TemplateSummary)

-- | A display name for the template.
templateSummary_name :: Lens.Lens' TemplateSummary (Prelude.Maybe Prelude.Text)
templateSummary_name :: (Maybe Text -> f (Maybe Text))
-> TemplateSummary -> f TemplateSummary
templateSummary_name = (TemplateSummary -> Maybe Text)
-> (TemplateSummary -> Maybe Text -> TemplateSummary)
-> Lens TemplateSummary TemplateSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateSummary' {Maybe Text
name :: Maybe Text
$sel:name:TemplateSummary' :: TemplateSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: TemplateSummary
s@TemplateSummary' {} Maybe Text
a -> TemplateSummary
s {$sel:name:TemplateSummary' :: Maybe Text
name = Maybe Text
a} :: TemplateSummary)

instance Core.FromJSON TemplateSummary where
  parseJSON :: Value -> Parser TemplateSummary
parseJSON =
    String
-> (Object -> Parser TemplateSummary)
-> Value
-> Parser TemplateSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"TemplateSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Natural
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> TemplateSummary
TemplateSummary'
            (Maybe POSIX
 -> Maybe Natural
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> TemplateSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Natural
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> TemplateSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastUpdatedTime")
            Parser
  (Maybe Natural
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> TemplateSummary)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Text
      -> Maybe POSIX -> Maybe Text -> Maybe Text -> TemplateSummary)
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
"LatestVersionNumber")
            Parser
  (Maybe Text
   -> Maybe POSIX -> Maybe Text -> Maybe Text -> TemplateSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX -> Maybe Text -> Maybe Text -> TemplateSummary)
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
"Arn")
            Parser (Maybe POSIX -> Maybe Text -> Maybe Text -> TemplateSummary)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> TemplateSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedTime")
            Parser (Maybe Text -> Maybe Text -> TemplateSummary)
-> Parser (Maybe Text) -> Parser (Maybe Text -> TemplateSummary)
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
"TemplateId")
            Parser (Maybe Text -> TemplateSummary)
-> Parser (Maybe Text) -> Parser TemplateSummary
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
"Name")
      )

instance Prelude.Hashable TemplateSummary

instance Prelude.NFData TemplateSummary