{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.QuickSight.Types.Dashboard where

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

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

-- | The Amazon Resource Name (ARN) of the resource.
dashboard_arn :: Lens.Lens' Dashboard (Prelude.Maybe Prelude.Text)
dashboard_arn :: Lens' Dashboard (Maybe Text)
dashboard_arn = 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 dashboard was created.
dashboard_createdTime :: Lens.Lens' Dashboard (Prelude.Maybe Prelude.UTCTime)
dashboard_createdTime :: Lens' Dashboard (Maybe UTCTime)
dashboard_createdTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Dashboard ID.
dashboard_dashboardId :: Lens.Lens' Dashboard (Prelude.Maybe Prelude.Text)
dashboard_dashboardId :: Lens' Dashboard (Maybe Text)
dashboard_dashboardId = 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 dashboard was published.
dashboard_lastPublishedTime :: Lens.Lens' Dashboard (Prelude.Maybe Prelude.UTCTime)
dashboard_lastPublishedTime :: Lens' Dashboard (Maybe UTCTime)
dashboard_lastPublishedTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The last time that this dashboard was updated.
dashboard_lastUpdatedTime :: Lens.Lens' Dashboard (Prelude.Maybe Prelude.UTCTime)
dashboard_lastUpdatedTime :: Lens' Dashboard (Maybe UTCTime)
dashboard_lastUpdatedTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | A display name for the dashboard.
dashboard_name :: Lens.Lens' Dashboard (Prelude.Maybe Prelude.Text)
dashboard_name :: Lens' Dashboard (Maybe Text)
dashboard_name = 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 :: Lens' Dashboard (Maybe DashboardVersion)
dashboard_version = 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 Data.FromJSON Dashboard where
  parseJSON :: Value -> Parser Dashboard
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Dashboard"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe DashboardVersion
-> Dashboard
Dashboard'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CreatedTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DashboardId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LastPublishedTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LastUpdatedTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Version")
      )

instance Prelude.Hashable Dashboard where
  hashWithSalt :: Int -> Dashboard -> Int
hashWithSalt Int
_salt Dashboard' {Maybe Text
Maybe POSIX
Maybe DashboardVersion
version :: Maybe DashboardVersion
name :: Maybe Text
lastUpdatedTime :: Maybe POSIX
lastPublishedTime :: Maybe POSIX
dashboardId :: Maybe Text
createdTime :: Maybe POSIX
arn :: Maybe Text
$sel:version:Dashboard' :: Dashboard -> Maybe DashboardVersion
$sel:name:Dashboard' :: Dashboard -> Maybe Text
$sel:lastUpdatedTime:Dashboard' :: Dashboard -> Maybe POSIX
$sel:lastPublishedTime:Dashboard' :: Dashboard -> Maybe POSIX
$sel:dashboardId:Dashboard' :: Dashboard -> Maybe Text
$sel:createdTime:Dashboard' :: Dashboard -> Maybe POSIX
$sel:arn:Dashboard' :: Dashboard -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
dashboardId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastPublishedTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdatedTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DashboardVersion
version

instance Prelude.NFData Dashboard where
  rnf :: Dashboard -> ()
rnf Dashboard' {Maybe Text
Maybe POSIX
Maybe DashboardVersion
version :: Maybe DashboardVersion
name :: Maybe Text
lastUpdatedTime :: Maybe POSIX
lastPublishedTime :: Maybe POSIX
dashboardId :: Maybe Text
createdTime :: Maybe POSIX
arn :: Maybe Text
$sel:version:Dashboard' :: Dashboard -> Maybe DashboardVersion
$sel:name:Dashboard' :: Dashboard -> Maybe Text
$sel:lastUpdatedTime:Dashboard' :: Dashboard -> Maybe POSIX
$sel:lastPublishedTime:Dashboard' :: Dashboard -> Maybe POSIX
$sel:dashboardId:Dashboard' :: Dashboard -> Maybe Text
$sel:createdTime:Dashboard' :: Dashboard -> Maybe POSIX
$sel:arn:Dashboard' :: Dashboard -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
dashboardId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastPublishedTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdatedTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DashboardVersion
version