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

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

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

-- |
-- Create a value of 'DashboardVersionSummary' 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', 'dashboardVersionSummary_status' - The HTTP status of the request.
--
-- 'arn', 'dashboardVersionSummary_arn' - The Amazon Resource Name (ARN) of the resource.
--
-- 'createdTime', 'dashboardVersionSummary_createdTime' - The time that this dashboard version was created.
--
-- 'sourceEntityArn', 'dashboardVersionSummary_sourceEntityArn' - Source entity ARN.
--
-- 'versionNumber', 'dashboardVersionSummary_versionNumber' - Version number.
--
-- 'description', 'dashboardVersionSummary_description' - Description.
newDashboardVersionSummary ::
  DashboardVersionSummary
newDashboardVersionSummary :: DashboardVersionSummary
newDashboardVersionSummary =
  DashboardVersionSummary' :: Maybe ResourceStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> DashboardVersionSummary
DashboardVersionSummary'
    { $sel:status:DashboardVersionSummary' :: Maybe ResourceStatus
status = Maybe ResourceStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:DashboardVersionSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:DashboardVersionSummary' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceEntityArn:DashboardVersionSummary' :: Maybe Text
sourceEntityArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:versionNumber:DashboardVersionSummary' :: Maybe Natural
versionNumber = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:description:DashboardVersionSummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The HTTP status of the request.
dashboardVersionSummary_status :: Lens.Lens' DashboardVersionSummary (Prelude.Maybe ResourceStatus)
dashboardVersionSummary_status :: (Maybe ResourceStatus -> f (Maybe ResourceStatus))
-> DashboardVersionSummary -> f DashboardVersionSummary
dashboardVersionSummary_status = (DashboardVersionSummary -> Maybe ResourceStatus)
-> (DashboardVersionSummary
    -> Maybe ResourceStatus -> DashboardVersionSummary)
-> Lens
     DashboardVersionSummary
     DashboardVersionSummary
     (Maybe ResourceStatus)
     (Maybe ResourceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashboardVersionSummary' {Maybe ResourceStatus
status :: Maybe ResourceStatus
$sel:status:DashboardVersionSummary' :: DashboardVersionSummary -> Maybe ResourceStatus
status} -> Maybe ResourceStatus
status) (\s :: DashboardVersionSummary
s@DashboardVersionSummary' {} Maybe ResourceStatus
a -> DashboardVersionSummary
s {$sel:status:DashboardVersionSummary' :: Maybe ResourceStatus
status = Maybe ResourceStatus
a} :: DashboardVersionSummary)

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

-- | The time that this dashboard version was created.
dashboardVersionSummary_createdTime :: Lens.Lens' DashboardVersionSummary (Prelude.Maybe Prelude.UTCTime)
dashboardVersionSummary_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DashboardVersionSummary -> f DashboardVersionSummary
dashboardVersionSummary_createdTime = (DashboardVersionSummary -> Maybe POSIX)
-> (DashboardVersionSummary
    -> Maybe POSIX -> DashboardVersionSummary)
-> Lens
     DashboardVersionSummary
     DashboardVersionSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashboardVersionSummary' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:DashboardVersionSummary' :: DashboardVersionSummary -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: DashboardVersionSummary
s@DashboardVersionSummary' {} Maybe POSIX
a -> DashboardVersionSummary
s {$sel:createdTime:DashboardVersionSummary' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: DashboardVersionSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> DashboardVersionSummary -> f DashboardVersionSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DashboardVersionSummary
-> f DashboardVersionSummary
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

-- | Source entity ARN.
dashboardVersionSummary_sourceEntityArn :: Lens.Lens' DashboardVersionSummary (Prelude.Maybe Prelude.Text)
dashboardVersionSummary_sourceEntityArn :: (Maybe Text -> f (Maybe Text))
-> DashboardVersionSummary -> f DashboardVersionSummary
dashboardVersionSummary_sourceEntityArn = (DashboardVersionSummary -> Maybe Text)
-> (DashboardVersionSummary
    -> Maybe Text -> DashboardVersionSummary)
-> Lens
     DashboardVersionSummary
     DashboardVersionSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashboardVersionSummary' {Maybe Text
sourceEntityArn :: Maybe Text
$sel:sourceEntityArn:DashboardVersionSummary' :: DashboardVersionSummary -> Maybe Text
sourceEntityArn} -> Maybe Text
sourceEntityArn) (\s :: DashboardVersionSummary
s@DashboardVersionSummary' {} Maybe Text
a -> DashboardVersionSummary
s {$sel:sourceEntityArn:DashboardVersionSummary' :: Maybe Text
sourceEntityArn = Maybe Text
a} :: DashboardVersionSummary)

-- | Version number.
dashboardVersionSummary_versionNumber :: Lens.Lens' DashboardVersionSummary (Prelude.Maybe Prelude.Natural)
dashboardVersionSummary_versionNumber :: (Maybe Natural -> f (Maybe Natural))
-> DashboardVersionSummary -> f DashboardVersionSummary
dashboardVersionSummary_versionNumber = (DashboardVersionSummary -> Maybe Natural)
-> (DashboardVersionSummary
    -> Maybe Natural -> DashboardVersionSummary)
-> Lens
     DashboardVersionSummary
     DashboardVersionSummary
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashboardVersionSummary' {Maybe Natural
versionNumber :: Maybe Natural
$sel:versionNumber:DashboardVersionSummary' :: DashboardVersionSummary -> Maybe Natural
versionNumber} -> Maybe Natural
versionNumber) (\s :: DashboardVersionSummary
s@DashboardVersionSummary' {} Maybe Natural
a -> DashboardVersionSummary
s {$sel:versionNumber:DashboardVersionSummary' :: Maybe Natural
versionNumber = Maybe Natural
a} :: DashboardVersionSummary)

-- | Description.
dashboardVersionSummary_description :: Lens.Lens' DashboardVersionSummary (Prelude.Maybe Prelude.Text)
dashboardVersionSummary_description :: (Maybe Text -> f (Maybe Text))
-> DashboardVersionSummary -> f DashboardVersionSummary
dashboardVersionSummary_description = (DashboardVersionSummary -> Maybe Text)
-> (DashboardVersionSummary
    -> Maybe Text -> DashboardVersionSummary)
-> Lens
     DashboardVersionSummary
     DashboardVersionSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashboardVersionSummary' {Maybe Text
description :: Maybe Text
$sel:description:DashboardVersionSummary' :: DashboardVersionSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: DashboardVersionSummary
s@DashboardVersionSummary' {} Maybe Text
a -> DashboardVersionSummary
s {$sel:description:DashboardVersionSummary' :: Maybe Text
description = Maybe Text
a} :: DashboardVersionSummary)

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

instance Prelude.NFData DashboardVersionSummary