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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types.ResourceStatus

-- | The template version.
--
-- /See:/ 'newTemplateVersionSummary' smart constructor.
data TemplateVersionSummary = TemplateVersionSummary'
  { -- | The status of the template version.
    TemplateVersionSummary -> Maybe ResourceStatus
status :: Prelude.Maybe ResourceStatus,
    -- | The Amazon Resource Name (ARN) of the template version.
    TemplateVersionSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The time that this template version was created.
    TemplateVersionSummary -> Maybe POSIX
createdTime :: Prelude.Maybe Core.POSIX,
    -- | The version number of the template version.
    TemplateVersionSummary -> Maybe Natural
versionNumber :: Prelude.Maybe Prelude.Natural,
    -- | The description of the template version.
    TemplateVersionSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (TemplateVersionSummary -> TemplateVersionSummary -> Bool
(TemplateVersionSummary -> TemplateVersionSummary -> Bool)
-> (TemplateVersionSummary -> TemplateVersionSummary -> Bool)
-> Eq TemplateVersionSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TemplateVersionSummary -> TemplateVersionSummary -> Bool
$c/= :: TemplateVersionSummary -> TemplateVersionSummary -> Bool
== :: TemplateVersionSummary -> TemplateVersionSummary -> Bool
$c== :: TemplateVersionSummary -> TemplateVersionSummary -> Bool
Prelude.Eq, ReadPrec [TemplateVersionSummary]
ReadPrec TemplateVersionSummary
Int -> ReadS TemplateVersionSummary
ReadS [TemplateVersionSummary]
(Int -> ReadS TemplateVersionSummary)
-> ReadS [TemplateVersionSummary]
-> ReadPrec TemplateVersionSummary
-> ReadPrec [TemplateVersionSummary]
-> Read TemplateVersionSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TemplateVersionSummary]
$creadListPrec :: ReadPrec [TemplateVersionSummary]
readPrec :: ReadPrec TemplateVersionSummary
$creadPrec :: ReadPrec TemplateVersionSummary
readList :: ReadS [TemplateVersionSummary]
$creadList :: ReadS [TemplateVersionSummary]
readsPrec :: Int -> ReadS TemplateVersionSummary
$creadsPrec :: Int -> ReadS TemplateVersionSummary
Prelude.Read, Int -> TemplateVersionSummary -> ShowS
[TemplateVersionSummary] -> ShowS
TemplateVersionSummary -> String
(Int -> TemplateVersionSummary -> ShowS)
-> (TemplateVersionSummary -> String)
-> ([TemplateVersionSummary] -> ShowS)
-> Show TemplateVersionSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TemplateVersionSummary] -> ShowS
$cshowList :: [TemplateVersionSummary] -> ShowS
show :: TemplateVersionSummary -> String
$cshow :: TemplateVersionSummary -> String
showsPrec :: Int -> TemplateVersionSummary -> ShowS
$cshowsPrec :: Int -> TemplateVersionSummary -> ShowS
Prelude.Show, (forall x. TemplateVersionSummary -> Rep TemplateVersionSummary x)
-> (forall x.
    Rep TemplateVersionSummary x -> TemplateVersionSummary)
-> Generic TemplateVersionSummary
forall x. Rep TemplateVersionSummary x -> TemplateVersionSummary
forall x. TemplateVersionSummary -> Rep TemplateVersionSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TemplateVersionSummary x -> TemplateVersionSummary
$cfrom :: forall x. TemplateVersionSummary -> Rep TemplateVersionSummary x
Prelude.Generic)

-- |
-- Create a value of 'TemplateVersionSummary' 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:
--
-- 'status', 'templateVersionSummary_status' - The status of the template version.
--
-- 'arn', 'templateVersionSummary_arn' - The Amazon Resource Name (ARN) of the template version.
--
-- 'createdTime', 'templateVersionSummary_createdTime' - The time that this template version was created.
--
-- 'versionNumber', 'templateVersionSummary_versionNumber' - The version number of the template version.
--
-- 'description', 'templateVersionSummary_description' - The description of the template version.
newTemplateVersionSummary ::
  TemplateVersionSummary
newTemplateVersionSummary :: TemplateVersionSummary
newTemplateVersionSummary =
  TemplateVersionSummary' :: Maybe ResourceStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Natural
-> Maybe Text
-> TemplateVersionSummary
TemplateVersionSummary'
    { $sel:status:TemplateVersionSummary' :: Maybe ResourceStatus
status = Maybe ResourceStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:TemplateVersionSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:TemplateVersionSummary' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:versionNumber:TemplateVersionSummary' :: Maybe Natural
versionNumber = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:description:TemplateVersionSummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the template version.
templateVersionSummary_status :: Lens.Lens' TemplateVersionSummary (Prelude.Maybe ResourceStatus)
templateVersionSummary_status :: (Maybe ResourceStatus -> f (Maybe ResourceStatus))
-> TemplateVersionSummary -> f TemplateVersionSummary
templateVersionSummary_status = (TemplateVersionSummary -> Maybe ResourceStatus)
-> (TemplateVersionSummary
    -> Maybe ResourceStatus -> TemplateVersionSummary)
-> Lens
     TemplateVersionSummary
     TemplateVersionSummary
     (Maybe ResourceStatus)
     (Maybe ResourceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateVersionSummary' {Maybe ResourceStatus
status :: Maybe ResourceStatus
$sel:status:TemplateVersionSummary' :: TemplateVersionSummary -> Maybe ResourceStatus
status} -> Maybe ResourceStatus
status) (\s :: TemplateVersionSummary
s@TemplateVersionSummary' {} Maybe ResourceStatus
a -> TemplateVersionSummary
s {$sel:status:TemplateVersionSummary' :: Maybe ResourceStatus
status = Maybe ResourceStatus
a} :: TemplateVersionSummary)

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

-- | The time that this template version was created.
templateVersionSummary_createdTime :: Lens.Lens' TemplateVersionSummary (Prelude.Maybe Prelude.UTCTime)
templateVersionSummary_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> TemplateVersionSummary -> f TemplateVersionSummary
templateVersionSummary_createdTime = (TemplateVersionSummary -> Maybe POSIX)
-> (TemplateVersionSummary
    -> Maybe POSIX -> TemplateVersionSummary)
-> Lens
     TemplateVersionSummary
     TemplateVersionSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateVersionSummary' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:TemplateVersionSummary' :: TemplateVersionSummary -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: TemplateVersionSummary
s@TemplateVersionSummary' {} Maybe POSIX
a -> TemplateVersionSummary
s {$sel:createdTime:TemplateVersionSummary' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: TemplateVersionSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> TemplateVersionSummary -> f TemplateVersionSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> TemplateVersionSummary
-> f TemplateVersionSummary
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 version number of the template version.
templateVersionSummary_versionNumber :: Lens.Lens' TemplateVersionSummary (Prelude.Maybe Prelude.Natural)
templateVersionSummary_versionNumber :: (Maybe Natural -> f (Maybe Natural))
-> TemplateVersionSummary -> f TemplateVersionSummary
templateVersionSummary_versionNumber = (TemplateVersionSummary -> Maybe Natural)
-> (TemplateVersionSummary
    -> Maybe Natural -> TemplateVersionSummary)
-> Lens
     TemplateVersionSummary
     TemplateVersionSummary
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateVersionSummary' {Maybe Natural
versionNumber :: Maybe Natural
$sel:versionNumber:TemplateVersionSummary' :: TemplateVersionSummary -> Maybe Natural
versionNumber} -> Maybe Natural
versionNumber) (\s :: TemplateVersionSummary
s@TemplateVersionSummary' {} Maybe Natural
a -> TemplateVersionSummary
s {$sel:versionNumber:TemplateVersionSummary' :: Maybe Natural
versionNumber = Maybe Natural
a} :: TemplateVersionSummary)

-- | The description of the template version.
templateVersionSummary_description :: Lens.Lens' TemplateVersionSummary (Prelude.Maybe Prelude.Text)
templateVersionSummary_description :: (Maybe Text -> f (Maybe Text))
-> TemplateVersionSummary -> f TemplateVersionSummary
templateVersionSummary_description = (TemplateVersionSummary -> Maybe Text)
-> (TemplateVersionSummary -> Maybe Text -> TemplateVersionSummary)
-> Lens
     TemplateVersionSummary
     TemplateVersionSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateVersionSummary' {Maybe Text
description :: Maybe Text
$sel:description:TemplateVersionSummary' :: TemplateVersionSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: TemplateVersionSummary
s@TemplateVersionSummary' {} Maybe Text
a -> TemplateVersionSummary
s {$sel:description:TemplateVersionSummary' :: Maybe Text
description = Maybe Text
a} :: TemplateVersionSummary)

instance Core.FromJSON TemplateVersionSummary where
  parseJSON :: Value -> Parser TemplateVersionSummary
parseJSON =
    String
-> (Object -> Parser TemplateVersionSummary)
-> Value
-> Parser TemplateVersionSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"TemplateVersionSummary"
      ( \Object
x ->
          Maybe ResourceStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Natural
-> Maybe Text
-> TemplateVersionSummary
TemplateVersionSummary'
            (Maybe ResourceStatus
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Natural
 -> Maybe Text
 -> TemplateVersionSummary)
-> Parser (Maybe ResourceStatus)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Natural
      -> Maybe Text
      -> TemplateVersionSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ResourceStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Natural
   -> Maybe Text
   -> TemplateVersionSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Natural -> Maybe Text -> TemplateVersionSummary)
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 Natural -> Maybe Text -> TemplateVersionSummary)
-> Parser (Maybe POSIX)
-> Parser (Maybe Natural -> Maybe Text -> TemplateVersionSummary)
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 Natural -> Maybe Text -> TemplateVersionSummary)
-> Parser (Maybe Natural)
-> Parser (Maybe Text -> TemplateVersionSummary)
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
"VersionNumber")
            Parser (Maybe Text -> TemplateVersionSummary)
-> Parser (Maybe Text) -> Parser TemplateVersionSummary
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
"Description")
      )

instance Prelude.Hashable TemplateVersionSummary

instance Prelude.NFData TemplateVersionSummary