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

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

-- | Dashboard.
--
-- /See:/ 'newDashboard' smart constructor.
data Dashboard = Dashboard'
  { -- | The last time that this dataset was updated.
    Dashboard -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the resource.
    Dashboard -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The time that this dataset was created.
    Dashboard -> Maybe POSIX
createdTime :: Prelude.Maybe Core.POSIX,
    -- | Dashboard ID.
    Dashboard -> Maybe Text
dashboardId :: Prelude.Maybe Prelude.Text,
    -- | The last time that this dataset was published.
    Dashboard -> Maybe POSIX
lastPublishedTime :: Prelude.Maybe Core.POSIX,
    -- | A display name for the dashboard.
    Dashboard -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Version.
    Dashboard -> Maybe DashboardVersion
version :: Prelude.Maybe DashboardVersion
  }
  deriving (Dashboard -> Dashboard -> Bool
(Dashboard -> Dashboard -> Bool)
-> (Dashboard -> Dashboard -> Bool) -> Eq Dashboard
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Dashboard -> Dashboard -> Bool
$c/= :: Dashboard -> Dashboard -> Bool
== :: Dashboard -> Dashboard -> Bool
$c== :: Dashboard -> Dashboard -> Bool
Prelude.Eq, ReadPrec [Dashboard]
ReadPrec Dashboard
Int -> ReadS Dashboard
ReadS [Dashboard]
(Int -> ReadS Dashboard)
-> ReadS [Dashboard]
-> ReadPrec Dashboard
-> ReadPrec [Dashboard]
-> Read Dashboard
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Dashboard]
$creadListPrec :: ReadPrec [Dashboard]
readPrec :: ReadPrec Dashboard
$creadPrec :: ReadPrec Dashboard
readList :: ReadS [Dashboard]
$creadList :: ReadS [Dashboard]
readsPrec :: Int -> ReadS Dashboard
$creadsPrec :: Int -> ReadS Dashboard
Prelude.Read, Int -> Dashboard -> ShowS
[Dashboard] -> ShowS
Dashboard -> String
(Int -> Dashboard -> ShowS)
-> (Dashboard -> String)
-> ([Dashboard] -> ShowS)
-> Show Dashboard
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Dashboard] -> ShowS
$cshowList :: [Dashboard] -> ShowS
show :: Dashboard -> String
$cshow :: Dashboard -> String
showsPrec :: Int -> Dashboard -> ShowS
$cshowsPrec :: Int -> Dashboard -> ShowS
Prelude.Show, (forall x. Dashboard -> Rep Dashboard x)
-> (forall x. Rep Dashboard x -> Dashboard) -> Generic Dashboard
forall x. Rep Dashboard x -> Dashboard
forall x. Dashboard -> Rep Dashboard x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Dashboard x -> Dashboard
$cfrom :: forall x. Dashboard -> Rep Dashboard x
Prelude.Generic)

-- |
-- Create a value of 'Dashboard' 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', 'dashboard_lastUpdatedTime' - The last time that this dataset was updated.
--
-- 'arn', 'dashboard_arn' - The Amazon Resource Name (ARN) of the resource.
--
-- 'createdTime', 'dashboard_createdTime' - The time that this dataset was created.
--
-- 'dashboardId', 'dashboard_dashboardId' - Dashboard ID.
--
-- 'lastPublishedTime', 'dashboard_lastPublishedTime' - The last time that this dataset was published.
--
-- 'name', 'dashboard_name' - A display name for the dashboard.
--
-- 'version', 'dashboard_version' - Version.
newDashboard ::
  Dashboard
newDashboard :: Dashboard
newDashboard =
  Dashboard' :: Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe DashboardVersion
-> Dashboard
Dashboard'
    { $sel:lastUpdatedTime:Dashboard' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:Dashboard' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:Dashboard' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:dashboardId:Dashboard' :: Maybe Text
dashboardId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastPublishedTime:Dashboard' :: Maybe POSIX
lastPublishedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Dashboard' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:Dashboard' :: Maybe DashboardVersion
version = Maybe DashboardVersion
forall a. Maybe a
Prelude.Nothing
    }

-- | The last time that this dataset was updated.
dashboard_lastUpdatedTime :: Lens.Lens' Dashboard (Prelude.Maybe Prelude.UTCTime)
dashboard_lastUpdatedTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Dashboard -> f Dashboard
dashboard_lastUpdatedTime = (Dashboard -> Maybe POSIX)
-> (Dashboard -> Maybe POSIX -> Dashboard)
-> Lens Dashboard Dashboard (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Dashboard' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:Dashboard' :: Dashboard -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: Dashboard
s@Dashboard' {} Maybe POSIX
a -> Dashboard
s {$sel:lastUpdatedTime:Dashboard' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: Dashboard) ((Maybe POSIX -> f (Maybe POSIX)) -> Dashboard -> f Dashboard)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Dashboard
-> f Dashboard
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 Amazon Resource Name (ARN) of the resource.
dashboard_arn :: Lens.Lens' Dashboard (Prelude.Maybe Prelude.Text)
dashboard_arn :: (Maybe Text -> f (Maybe Text)) -> Dashboard -> f Dashboard
dashboard_arn = (Dashboard -> Maybe Text)
-> (Dashboard -> Maybe Text -> Dashboard)
-> Lens Dashboard Dashboard (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Dashboard' {Maybe Text
arn :: Maybe Text
$sel:arn:Dashboard' :: Dashboard -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Dashboard
s@Dashboard' {} Maybe Text
a -> Dashboard
s {$sel:arn:Dashboard' :: Maybe Text
arn = Maybe Text
a} :: Dashboard)

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

-- | Dashboard ID.
dashboard_dashboardId :: Lens.Lens' Dashboard (Prelude.Maybe Prelude.Text)
dashboard_dashboardId :: (Maybe Text -> f (Maybe Text)) -> Dashboard -> f Dashboard
dashboard_dashboardId = (Dashboard -> Maybe Text)
-> (Dashboard -> Maybe Text -> Dashboard)
-> Lens Dashboard Dashboard (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Dashboard' {Maybe Text
dashboardId :: Maybe Text
$sel:dashboardId:Dashboard' :: Dashboard -> Maybe Text
dashboardId} -> Maybe Text
dashboardId) (\s :: Dashboard
s@Dashboard' {} Maybe Text
a -> Dashboard
s {$sel:dashboardId:Dashboard' :: Maybe Text
dashboardId = Maybe Text
a} :: Dashboard)

-- | The last time that this dataset was published.
dashboard_lastPublishedTime :: Lens.Lens' Dashboard (Prelude.Maybe Prelude.UTCTime)
dashboard_lastPublishedTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Dashboard -> f Dashboard
dashboard_lastPublishedTime = (Dashboard -> Maybe POSIX)
-> (Dashboard -> Maybe POSIX -> Dashboard)
-> Lens Dashboard Dashboard (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Dashboard' {Maybe POSIX
lastPublishedTime :: Maybe POSIX
$sel:lastPublishedTime:Dashboard' :: Dashboard -> Maybe POSIX
lastPublishedTime} -> Maybe POSIX
lastPublishedTime) (\s :: Dashboard
s@Dashboard' {} Maybe POSIX
a -> Dashboard
s {$sel:lastPublishedTime:Dashboard' :: Maybe POSIX
lastPublishedTime = Maybe POSIX
a} :: Dashboard) ((Maybe POSIX -> f (Maybe POSIX)) -> Dashboard -> f Dashboard)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Dashboard
-> f Dashboard
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 display name for the dashboard.
dashboard_name :: Lens.Lens' Dashboard (Prelude.Maybe Prelude.Text)
dashboard_name :: (Maybe Text -> f (Maybe Text)) -> Dashboard -> f Dashboard
dashboard_name = (Dashboard -> Maybe Text)
-> (Dashboard -> Maybe Text -> Dashboard)
-> Lens Dashboard Dashboard (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Dashboard' {Maybe Text
name :: Maybe Text
$sel:name:Dashboard' :: Dashboard -> Maybe Text
name} -> Maybe Text
name) (\s :: Dashboard
s@Dashboard' {} Maybe Text
a -> Dashboard
s {$sel:name:Dashboard' :: Maybe Text
name = Maybe Text
a} :: Dashboard)

-- | Version.
dashboard_version :: Lens.Lens' Dashboard (Prelude.Maybe DashboardVersion)
dashboard_version :: (Maybe DashboardVersion -> f (Maybe DashboardVersion))
-> Dashboard -> f Dashboard
dashboard_version = (Dashboard -> Maybe DashboardVersion)
-> (Dashboard -> Maybe DashboardVersion -> Dashboard)
-> Lens
     Dashboard
     Dashboard
     (Maybe DashboardVersion)
     (Maybe DashboardVersion)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Dashboard' {Maybe DashboardVersion
version :: Maybe DashboardVersion
$sel:version:Dashboard' :: Dashboard -> Maybe DashboardVersion
version} -> Maybe DashboardVersion
version) (\s :: Dashboard
s@Dashboard' {} Maybe DashboardVersion
a -> Dashboard
s {$sel:version:Dashboard' :: Maybe DashboardVersion
version = Maybe DashboardVersion
a} :: Dashboard)

instance Core.FromJSON Dashboard where
  parseJSON :: Value -> Parser Dashboard
parseJSON =
    String -> (Object -> Parser Dashboard) -> Value -> Parser Dashboard
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Dashboard"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe DashboardVersion
-> Dashboard
Dashboard'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe DashboardVersion
 -> Dashboard)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe DashboardVersion
      -> Dashboard)
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 Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe DashboardVersion
   -> Dashboard)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe DashboardVersion
      -> Dashboard)
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 POSIX
   -> Maybe Text
   -> Maybe DashboardVersion
   -> Dashboard)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe DashboardVersion
      -> Dashboard)
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 POSIX
   -> Maybe Text
   -> Maybe DashboardVersion
   -> Dashboard)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX -> Maybe Text -> Maybe DashboardVersion -> Dashboard)
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
"DashboardId")
            Parser
  (Maybe POSIX -> Maybe Text -> Maybe DashboardVersion -> Dashboard)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe DashboardVersion -> Dashboard)
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
"LastPublishedTime")
            Parser (Maybe Text -> Maybe DashboardVersion -> Dashboard)
-> Parser (Maybe Text)
-> Parser (Maybe DashboardVersion -> Dashboard)
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")
            Parser (Maybe DashboardVersion -> Dashboard)
-> Parser (Maybe DashboardVersion) -> Parser Dashboard
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DashboardVersion)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Version")
      )

instance Prelude.Hashable Dashboard

instance Prelude.NFData Dashboard