{-# 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.CloudWatch.Types.DashboardEntry
-- 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.CloudWatch.Types.DashboardEntry 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

-- | Represents a specific dashboard.
--
-- /See:/ 'newDashboardEntry' smart constructor.
data DashboardEntry = DashboardEntry'
  { -- | The Amazon Resource Name (ARN) of the dashboard.
    DashboardEntry -> Maybe Text
dashboardArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the dashboard.
    DashboardEntry -> Maybe Text
dashboardName :: Prelude.Maybe Prelude.Text,
    -- | The time stamp of when the dashboard was last modified, either by an API
    -- call or through the console. This number is expressed as the number of
    -- milliseconds since Jan 1, 1970 00:00:00 UTC.
    DashboardEntry -> Maybe ISO8601
lastModified :: Prelude.Maybe Data.ISO8601,
    -- | The size of the dashboard, in bytes.
    DashboardEntry -> Maybe Integer
size :: Prelude.Maybe Prelude.Integer
  }
  deriving (DashboardEntry -> DashboardEntry -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DashboardEntry -> DashboardEntry -> Bool
$c/= :: DashboardEntry -> DashboardEntry -> Bool
== :: DashboardEntry -> DashboardEntry -> Bool
$c== :: DashboardEntry -> DashboardEntry -> Bool
Prelude.Eq, ReadPrec [DashboardEntry]
ReadPrec DashboardEntry
Int -> ReadS DashboardEntry
ReadS [DashboardEntry]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DashboardEntry]
$creadListPrec :: ReadPrec [DashboardEntry]
readPrec :: ReadPrec DashboardEntry
$creadPrec :: ReadPrec DashboardEntry
readList :: ReadS [DashboardEntry]
$creadList :: ReadS [DashboardEntry]
readsPrec :: Int -> ReadS DashboardEntry
$creadsPrec :: Int -> ReadS DashboardEntry
Prelude.Read, Int -> DashboardEntry -> ShowS
[DashboardEntry] -> ShowS
DashboardEntry -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DashboardEntry] -> ShowS
$cshowList :: [DashboardEntry] -> ShowS
show :: DashboardEntry -> String
$cshow :: DashboardEntry -> String
showsPrec :: Int -> DashboardEntry -> ShowS
$cshowsPrec :: Int -> DashboardEntry -> ShowS
Prelude.Show, forall x. Rep DashboardEntry x -> DashboardEntry
forall x. DashboardEntry -> Rep DashboardEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DashboardEntry x -> DashboardEntry
$cfrom :: forall x. DashboardEntry -> Rep DashboardEntry x
Prelude.Generic)

-- |
-- Create a value of 'DashboardEntry' 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:
--
-- 'dashboardArn', 'dashboardEntry_dashboardArn' - The Amazon Resource Name (ARN) of the dashboard.
--
-- 'dashboardName', 'dashboardEntry_dashboardName' - The name of the dashboard.
--
-- 'lastModified', 'dashboardEntry_lastModified' - The time stamp of when the dashboard was last modified, either by an API
-- call or through the console. This number is expressed as the number of
-- milliseconds since Jan 1, 1970 00:00:00 UTC.
--
-- 'size', 'dashboardEntry_size' - The size of the dashboard, in bytes.
newDashboardEntry ::
  DashboardEntry
newDashboardEntry :: DashboardEntry
newDashboardEntry =
  DashboardEntry'
    { $sel:dashboardArn:DashboardEntry' :: Maybe Text
dashboardArn = forall a. Maybe a
Prelude.Nothing,
      $sel:dashboardName:DashboardEntry' :: Maybe Text
dashboardName = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModified:DashboardEntry' :: Maybe ISO8601
lastModified = forall a. Maybe a
Prelude.Nothing,
      $sel:size:DashboardEntry' :: Maybe Integer
size = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the dashboard.
dashboardEntry_dashboardArn :: Lens.Lens' DashboardEntry (Prelude.Maybe Prelude.Text)
dashboardEntry_dashboardArn :: Lens' DashboardEntry (Maybe Text)
dashboardEntry_dashboardArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashboardEntry' {Maybe Text
dashboardArn :: Maybe Text
$sel:dashboardArn:DashboardEntry' :: DashboardEntry -> Maybe Text
dashboardArn} -> Maybe Text
dashboardArn) (\s :: DashboardEntry
s@DashboardEntry' {} Maybe Text
a -> DashboardEntry
s {$sel:dashboardArn:DashboardEntry' :: Maybe Text
dashboardArn = Maybe Text
a} :: DashboardEntry)

-- | The name of the dashboard.
dashboardEntry_dashboardName :: Lens.Lens' DashboardEntry (Prelude.Maybe Prelude.Text)
dashboardEntry_dashboardName :: Lens' DashboardEntry (Maybe Text)
dashboardEntry_dashboardName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashboardEntry' {Maybe Text
dashboardName :: Maybe Text
$sel:dashboardName:DashboardEntry' :: DashboardEntry -> Maybe Text
dashboardName} -> Maybe Text
dashboardName) (\s :: DashboardEntry
s@DashboardEntry' {} Maybe Text
a -> DashboardEntry
s {$sel:dashboardName:DashboardEntry' :: Maybe Text
dashboardName = Maybe Text
a} :: DashboardEntry)

-- | The time stamp of when the dashboard was last modified, either by an API
-- call or through the console. This number is expressed as the number of
-- milliseconds since Jan 1, 1970 00:00:00 UTC.
dashboardEntry_lastModified :: Lens.Lens' DashboardEntry (Prelude.Maybe Prelude.UTCTime)
dashboardEntry_lastModified :: Lens' DashboardEntry (Maybe UTCTime)
dashboardEntry_lastModified = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashboardEntry' {Maybe ISO8601
lastModified :: Maybe ISO8601
$sel:lastModified:DashboardEntry' :: DashboardEntry -> Maybe ISO8601
lastModified} -> Maybe ISO8601
lastModified) (\s :: DashboardEntry
s@DashboardEntry' {} Maybe ISO8601
a -> DashboardEntry
s {$sel:lastModified:DashboardEntry' :: Maybe ISO8601
lastModified = Maybe ISO8601
a} :: DashboardEntry) 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 size of the dashboard, in bytes.
dashboardEntry_size :: Lens.Lens' DashboardEntry (Prelude.Maybe Prelude.Integer)
dashboardEntry_size :: Lens' DashboardEntry (Maybe Integer)
dashboardEntry_size = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashboardEntry' {Maybe Integer
size :: Maybe Integer
$sel:size:DashboardEntry' :: DashboardEntry -> Maybe Integer
size} -> Maybe Integer
size) (\s :: DashboardEntry
s@DashboardEntry' {} Maybe Integer
a -> DashboardEntry
s {$sel:size:DashboardEntry' :: Maybe Integer
size = Maybe Integer
a} :: DashboardEntry)

instance Data.FromXML DashboardEntry where
  parseXML :: [Node] -> Either String DashboardEntry
parseXML [Node]
x =
    Maybe Text
-> Maybe Text -> Maybe ISO8601 -> Maybe Integer -> DashboardEntry
DashboardEntry'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"DashboardArn")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"DashboardName")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"LastModified")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Size")

instance Prelude.Hashable DashboardEntry where
  hashWithSalt :: Int -> DashboardEntry -> Int
hashWithSalt Int
_salt DashboardEntry' {Maybe Integer
Maybe Text
Maybe ISO8601
size :: Maybe Integer
lastModified :: Maybe ISO8601
dashboardName :: Maybe Text
dashboardArn :: Maybe Text
$sel:size:DashboardEntry' :: DashboardEntry -> Maybe Integer
$sel:lastModified:DashboardEntry' :: DashboardEntry -> Maybe ISO8601
$sel:dashboardName:DashboardEntry' :: DashboardEntry -> Maybe Text
$sel:dashboardArn:DashboardEntry' :: DashboardEntry -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
dashboardArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
dashboardName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
lastModified
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
size

instance Prelude.NFData DashboardEntry where
  rnf :: DashboardEntry -> ()
rnf DashboardEntry' {Maybe Integer
Maybe Text
Maybe ISO8601
size :: Maybe Integer
lastModified :: Maybe ISO8601
dashboardName :: Maybe Text
dashboardArn :: Maybe Text
$sel:size:DashboardEntry' :: DashboardEntry -> Maybe Integer
$sel:lastModified:DashboardEntry' :: DashboardEntry -> Maybe ISO8601
$sel:dashboardName:DashboardEntry' :: DashboardEntry -> Maybe Text
$sel:dashboardArn:DashboardEntry' :: DashboardEntry -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
dashboardArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
dashboardName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
lastModified
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
size