{-# 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 #-}
module Amazonka.CloudWatch.Types.DashboardEntry where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DashboardEntry = DashboardEntry'
{
DashboardEntry -> Maybe Integer
size :: Prelude.Maybe Prelude.Integer,
DashboardEntry -> Maybe Text
dashboardName :: Prelude.Maybe Prelude.Text,
DashboardEntry -> Maybe ISO8601
lastModified :: Prelude.Maybe Core.ISO8601,
DashboardEntry -> Maybe Text
dashboardArn :: Prelude.Maybe Prelude.Text
}
deriving (DashboardEntry -> DashboardEntry -> Bool
(DashboardEntry -> DashboardEntry -> Bool)
-> (DashboardEntry -> DashboardEntry -> Bool) -> Eq DashboardEntry
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]
(Int -> ReadS DashboardEntry)
-> ReadS [DashboardEntry]
-> ReadPrec DashboardEntry
-> ReadPrec [DashboardEntry]
-> Read 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
(Int -> DashboardEntry -> ShowS)
-> (DashboardEntry -> String)
-> ([DashboardEntry] -> ShowS)
-> Show DashboardEntry
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. DashboardEntry -> Rep DashboardEntry x)
-> (forall x. Rep DashboardEntry x -> DashboardEntry)
-> Generic DashboardEntry
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)
newDashboardEntry ::
DashboardEntry
newDashboardEntry :: DashboardEntry
newDashboardEntry =
DashboardEntry' :: Maybe Integer
-> Maybe Text -> Maybe ISO8601 -> Maybe Text -> DashboardEntry
DashboardEntry'
{ $sel:size:DashboardEntry' :: Maybe Integer
size = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:dashboardName:DashboardEntry' :: Maybe Text
dashboardName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastModified:DashboardEntry' :: Maybe ISO8601
lastModified = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
$sel:dashboardArn:DashboardEntry' :: Maybe Text
dashboardArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
dashboardEntry_size :: Lens.Lens' DashboardEntry (Prelude.Maybe Prelude.Integer)
dashboardEntry_size :: (Maybe Integer -> f (Maybe Integer))
-> DashboardEntry -> f DashboardEntry
dashboardEntry_size = (DashboardEntry -> Maybe Integer)
-> (DashboardEntry -> Maybe Integer -> DashboardEntry)
-> Lens
DashboardEntry DashboardEntry (Maybe Integer) (Maybe Integer)
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)
dashboardEntry_dashboardName :: Lens.Lens' DashboardEntry (Prelude.Maybe Prelude.Text)
dashboardEntry_dashboardName :: (Maybe Text -> f (Maybe Text))
-> DashboardEntry -> f DashboardEntry
dashboardEntry_dashboardName = (DashboardEntry -> Maybe Text)
-> (DashboardEntry -> Maybe Text -> DashboardEntry)
-> Lens DashboardEntry DashboardEntry (Maybe Text) (Maybe Text)
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)
dashboardEntry_lastModified :: Lens.Lens' DashboardEntry (Prelude.Maybe Prelude.UTCTime)
dashboardEntry_lastModified :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DashboardEntry -> f DashboardEntry
dashboardEntry_lastModified = (DashboardEntry -> Maybe ISO8601)
-> (DashboardEntry -> Maybe ISO8601 -> DashboardEntry)
-> Lens
DashboardEntry DashboardEntry (Maybe ISO8601) (Maybe ISO8601)
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) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> DashboardEntry -> f DashboardEntry)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DashboardEntry
-> f DashboardEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
(Maybe ISO8601) (Maybe ISO8601) (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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
dashboardEntry_dashboardArn :: Lens.Lens' DashboardEntry (Prelude.Maybe Prelude.Text)
dashboardEntry_dashboardArn :: (Maybe Text -> f (Maybe Text))
-> DashboardEntry -> f DashboardEntry
dashboardEntry_dashboardArn = (DashboardEntry -> Maybe Text)
-> (DashboardEntry -> Maybe Text -> DashboardEntry)
-> Lens DashboardEntry DashboardEntry (Maybe Text) (Maybe Text)
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)
instance Core.FromXML DashboardEntry where
parseXML :: [Node] -> Either String DashboardEntry
parseXML [Node]
x =
Maybe Integer
-> Maybe Text -> Maybe ISO8601 -> Maybe Text -> DashboardEntry
DashboardEntry'
(Maybe Integer
-> Maybe Text -> Maybe ISO8601 -> Maybe Text -> DashboardEntry)
-> Either String (Maybe Integer)
-> Either
String
(Maybe Text -> Maybe ISO8601 -> Maybe Text -> DashboardEntry)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Integer)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Size")
Either
String
(Maybe Text -> Maybe ISO8601 -> Maybe Text -> DashboardEntry)
-> Either String (Maybe Text)
-> Either String (Maybe ISO8601 -> Maybe Text -> DashboardEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DashboardName")
Either String (Maybe ISO8601 -> Maybe Text -> DashboardEntry)
-> Either String (Maybe ISO8601)
-> Either String (Maybe Text -> DashboardEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LastModified")
Either String (Maybe Text -> DashboardEntry)
-> Either String (Maybe Text) -> Either String DashboardEntry
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DashboardArn")
instance Prelude.Hashable DashboardEntry
instance Prelude.NFData DashboardEntry