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

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

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

-- |
-- Create a value of 'ThemeSummary' 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:
--
-- 'themeId', 'themeSummary_themeId' - The ID of the theme. This ID is unique per Amazon Web Services Region
-- for each Amazon Web Services account.
--
-- 'lastUpdatedTime', 'themeSummary_lastUpdatedTime' - The last date and time that this theme was updated.
--
-- 'latestVersionNumber', 'themeSummary_latestVersionNumber' - The latest version number for the theme.
--
-- 'arn', 'themeSummary_arn' - The Amazon Resource Name (ARN) of the resource.
--
-- 'createdTime', 'themeSummary_createdTime' - The date and time that this theme was created.
--
-- 'name', 'themeSummary_name' - the display name for the theme.
newThemeSummary ::
  ThemeSummary
newThemeSummary :: ThemeSummary
newThemeSummary =
  ThemeSummary' :: Maybe Text
-> Maybe POSIX
-> Maybe Natural
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> ThemeSummary
ThemeSummary'
    { $sel:themeId:ThemeSummary' :: Maybe Text
themeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTime:ThemeSummary' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:latestVersionNumber:ThemeSummary' :: Maybe Natural
latestVersionNumber = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:ThemeSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:ThemeSummary' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ThemeSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The last date and time that this theme was updated.
themeSummary_lastUpdatedTime :: Lens.Lens' ThemeSummary (Prelude.Maybe Prelude.UTCTime)
themeSummary_lastUpdatedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ThemeSummary -> f ThemeSummary
themeSummary_lastUpdatedTime = (ThemeSummary -> Maybe POSIX)
-> (ThemeSummary -> Maybe POSIX -> ThemeSummary)
-> Lens ThemeSummary ThemeSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThemeSummary' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:ThemeSummary' :: ThemeSummary -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: ThemeSummary
s@ThemeSummary' {} Maybe POSIX
a -> ThemeSummary
s {$sel:lastUpdatedTime:ThemeSummary' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: ThemeSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> ThemeSummary -> f ThemeSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ThemeSummary
-> f ThemeSummary
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 latest version number for the theme.
themeSummary_latestVersionNumber :: Lens.Lens' ThemeSummary (Prelude.Maybe Prelude.Natural)
themeSummary_latestVersionNumber :: (Maybe Natural -> f (Maybe Natural))
-> ThemeSummary -> f ThemeSummary
themeSummary_latestVersionNumber = (ThemeSummary -> Maybe Natural)
-> (ThemeSummary -> Maybe Natural -> ThemeSummary)
-> Lens ThemeSummary ThemeSummary (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThemeSummary' {Maybe Natural
latestVersionNumber :: Maybe Natural
$sel:latestVersionNumber:ThemeSummary' :: ThemeSummary -> Maybe Natural
latestVersionNumber} -> Maybe Natural
latestVersionNumber) (\s :: ThemeSummary
s@ThemeSummary' {} Maybe Natural
a -> ThemeSummary
s {$sel:latestVersionNumber:ThemeSummary' :: Maybe Natural
latestVersionNumber = Maybe Natural
a} :: ThemeSummary)

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

-- | The date and time that this theme was created.
themeSummary_createdTime :: Lens.Lens' ThemeSummary (Prelude.Maybe Prelude.UTCTime)
themeSummary_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ThemeSummary -> f ThemeSummary
themeSummary_createdTime = (ThemeSummary -> Maybe POSIX)
-> (ThemeSummary -> Maybe POSIX -> ThemeSummary)
-> Lens ThemeSummary ThemeSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThemeSummary' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:ThemeSummary' :: ThemeSummary -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: ThemeSummary
s@ThemeSummary' {} Maybe POSIX
a -> ThemeSummary
s {$sel:createdTime:ThemeSummary' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: ThemeSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> ThemeSummary -> f ThemeSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ThemeSummary
-> f ThemeSummary
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 display name for the theme.
themeSummary_name :: Lens.Lens' ThemeSummary (Prelude.Maybe Prelude.Text)
themeSummary_name :: (Maybe Text -> f (Maybe Text)) -> ThemeSummary -> f ThemeSummary
themeSummary_name = (ThemeSummary -> Maybe Text)
-> (ThemeSummary -> Maybe Text -> ThemeSummary)
-> Lens ThemeSummary ThemeSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThemeSummary' {Maybe Text
name :: Maybe Text
$sel:name:ThemeSummary' :: ThemeSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: ThemeSummary
s@ThemeSummary' {} Maybe Text
a -> ThemeSummary
s {$sel:name:ThemeSummary' :: Maybe Text
name = Maybe Text
a} :: ThemeSummary)

instance Core.FromJSON ThemeSummary where
  parseJSON :: Value -> Parser ThemeSummary
parseJSON =
    String
-> (Object -> Parser ThemeSummary) -> Value -> Parser ThemeSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ThemeSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe Natural
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> ThemeSummary
ThemeSummary'
            (Maybe Text
 -> Maybe POSIX
 -> Maybe Natural
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> ThemeSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Natural
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> ThemeSummary)
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
"ThemeId")
            Parser
  (Maybe POSIX
   -> Maybe Natural
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> ThemeSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Natural
      -> Maybe Text -> Maybe POSIX -> Maybe Text -> ThemeSummary)
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
"LastUpdatedTime")
            Parser
  (Maybe Natural
   -> Maybe Text -> Maybe POSIX -> Maybe Text -> ThemeSummary)
-> Parser (Maybe Natural)
-> Parser (Maybe Text -> Maybe POSIX -> Maybe Text -> ThemeSummary)
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 -> ThemeSummary)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> ThemeSummary)
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 -> ThemeSummary)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> ThemeSummary)
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 -> ThemeSummary)
-> Parser (Maybe Text) -> Parser ThemeSummary
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 ThemeSummary

instance Prelude.NFData ThemeSummary