{-# 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.AlarmHistoryItem where
import Amazonka.CloudWatch.Types.AlarmType
import Amazonka.CloudWatch.Types.HistoryItemType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AlarmHistoryItem = AlarmHistoryItem'
{
AlarmHistoryItem -> Maybe Text
alarmName :: Prelude.Maybe Prelude.Text,
AlarmHistoryItem -> Maybe HistoryItemType
historyItemType :: Prelude.Maybe HistoryItemType,
AlarmHistoryItem -> Maybe Text
historyData :: Prelude.Maybe Prelude.Text,
AlarmHistoryItem -> Maybe AlarmType
alarmType :: Prelude.Maybe AlarmType,
AlarmHistoryItem -> Maybe Text
historySummary :: Prelude.Maybe Prelude.Text,
AlarmHistoryItem -> Maybe ISO8601
timestamp :: Prelude.Maybe Core.ISO8601
}
deriving (AlarmHistoryItem -> AlarmHistoryItem -> Bool
(AlarmHistoryItem -> AlarmHistoryItem -> Bool)
-> (AlarmHistoryItem -> AlarmHistoryItem -> Bool)
-> Eq AlarmHistoryItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AlarmHistoryItem -> AlarmHistoryItem -> Bool
$c/= :: AlarmHistoryItem -> AlarmHistoryItem -> Bool
== :: AlarmHistoryItem -> AlarmHistoryItem -> Bool
$c== :: AlarmHistoryItem -> AlarmHistoryItem -> Bool
Prelude.Eq, ReadPrec [AlarmHistoryItem]
ReadPrec AlarmHistoryItem
Int -> ReadS AlarmHistoryItem
ReadS [AlarmHistoryItem]
(Int -> ReadS AlarmHistoryItem)
-> ReadS [AlarmHistoryItem]
-> ReadPrec AlarmHistoryItem
-> ReadPrec [AlarmHistoryItem]
-> Read AlarmHistoryItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AlarmHistoryItem]
$creadListPrec :: ReadPrec [AlarmHistoryItem]
readPrec :: ReadPrec AlarmHistoryItem
$creadPrec :: ReadPrec AlarmHistoryItem
readList :: ReadS [AlarmHistoryItem]
$creadList :: ReadS [AlarmHistoryItem]
readsPrec :: Int -> ReadS AlarmHistoryItem
$creadsPrec :: Int -> ReadS AlarmHistoryItem
Prelude.Read, Int -> AlarmHistoryItem -> ShowS
[AlarmHistoryItem] -> ShowS
AlarmHistoryItem -> String
(Int -> AlarmHistoryItem -> ShowS)
-> (AlarmHistoryItem -> String)
-> ([AlarmHistoryItem] -> ShowS)
-> Show AlarmHistoryItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AlarmHistoryItem] -> ShowS
$cshowList :: [AlarmHistoryItem] -> ShowS
show :: AlarmHistoryItem -> String
$cshow :: AlarmHistoryItem -> String
showsPrec :: Int -> AlarmHistoryItem -> ShowS
$cshowsPrec :: Int -> AlarmHistoryItem -> ShowS
Prelude.Show, (forall x. AlarmHistoryItem -> Rep AlarmHistoryItem x)
-> (forall x. Rep AlarmHistoryItem x -> AlarmHistoryItem)
-> Generic AlarmHistoryItem
forall x. Rep AlarmHistoryItem x -> AlarmHistoryItem
forall x. AlarmHistoryItem -> Rep AlarmHistoryItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AlarmHistoryItem x -> AlarmHistoryItem
$cfrom :: forall x. AlarmHistoryItem -> Rep AlarmHistoryItem x
Prelude.Generic)
newAlarmHistoryItem ::
AlarmHistoryItem
newAlarmHistoryItem :: AlarmHistoryItem
newAlarmHistoryItem =
AlarmHistoryItem' :: Maybe Text
-> Maybe HistoryItemType
-> Maybe Text
-> Maybe AlarmType
-> Maybe Text
-> Maybe ISO8601
-> AlarmHistoryItem
AlarmHistoryItem'
{ $sel:alarmName:AlarmHistoryItem' :: Maybe Text
alarmName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:historyItemType:AlarmHistoryItem' :: Maybe HistoryItemType
historyItemType = Maybe HistoryItemType
forall a. Maybe a
Prelude.Nothing,
$sel:historyData:AlarmHistoryItem' :: Maybe Text
historyData = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:alarmType:AlarmHistoryItem' :: Maybe AlarmType
alarmType = Maybe AlarmType
forall a. Maybe a
Prelude.Nothing,
$sel:historySummary:AlarmHistoryItem' :: Maybe Text
historySummary = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:timestamp:AlarmHistoryItem' :: Maybe ISO8601
timestamp = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing
}
alarmHistoryItem_alarmName :: Lens.Lens' AlarmHistoryItem (Prelude.Maybe Prelude.Text)
alarmHistoryItem_alarmName :: (Maybe Text -> f (Maybe Text))
-> AlarmHistoryItem -> f AlarmHistoryItem
alarmHistoryItem_alarmName = (AlarmHistoryItem -> Maybe Text)
-> (AlarmHistoryItem -> Maybe Text -> AlarmHistoryItem)
-> Lens AlarmHistoryItem AlarmHistoryItem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlarmHistoryItem' {Maybe Text
alarmName :: Maybe Text
$sel:alarmName:AlarmHistoryItem' :: AlarmHistoryItem -> Maybe Text
alarmName} -> Maybe Text
alarmName) (\s :: AlarmHistoryItem
s@AlarmHistoryItem' {} Maybe Text
a -> AlarmHistoryItem
s {$sel:alarmName:AlarmHistoryItem' :: Maybe Text
alarmName = Maybe Text
a} :: AlarmHistoryItem)
alarmHistoryItem_historyItemType :: Lens.Lens' AlarmHistoryItem (Prelude.Maybe HistoryItemType)
alarmHistoryItem_historyItemType :: (Maybe HistoryItemType -> f (Maybe HistoryItemType))
-> AlarmHistoryItem -> f AlarmHistoryItem
alarmHistoryItem_historyItemType = (AlarmHistoryItem -> Maybe HistoryItemType)
-> (AlarmHistoryItem -> Maybe HistoryItemType -> AlarmHistoryItem)
-> Lens
AlarmHistoryItem
AlarmHistoryItem
(Maybe HistoryItemType)
(Maybe HistoryItemType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlarmHistoryItem' {Maybe HistoryItemType
historyItemType :: Maybe HistoryItemType
$sel:historyItemType:AlarmHistoryItem' :: AlarmHistoryItem -> Maybe HistoryItemType
historyItemType} -> Maybe HistoryItemType
historyItemType) (\s :: AlarmHistoryItem
s@AlarmHistoryItem' {} Maybe HistoryItemType
a -> AlarmHistoryItem
s {$sel:historyItemType:AlarmHistoryItem' :: Maybe HistoryItemType
historyItemType = Maybe HistoryItemType
a} :: AlarmHistoryItem)
alarmHistoryItem_historyData :: Lens.Lens' AlarmHistoryItem (Prelude.Maybe Prelude.Text)
alarmHistoryItem_historyData :: (Maybe Text -> f (Maybe Text))
-> AlarmHistoryItem -> f AlarmHistoryItem
alarmHistoryItem_historyData = (AlarmHistoryItem -> Maybe Text)
-> (AlarmHistoryItem -> Maybe Text -> AlarmHistoryItem)
-> Lens AlarmHistoryItem AlarmHistoryItem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlarmHistoryItem' {Maybe Text
historyData :: Maybe Text
$sel:historyData:AlarmHistoryItem' :: AlarmHistoryItem -> Maybe Text
historyData} -> Maybe Text
historyData) (\s :: AlarmHistoryItem
s@AlarmHistoryItem' {} Maybe Text
a -> AlarmHistoryItem
s {$sel:historyData:AlarmHistoryItem' :: Maybe Text
historyData = Maybe Text
a} :: AlarmHistoryItem)
alarmHistoryItem_alarmType :: Lens.Lens' AlarmHistoryItem (Prelude.Maybe AlarmType)
alarmHistoryItem_alarmType :: (Maybe AlarmType -> f (Maybe AlarmType))
-> AlarmHistoryItem -> f AlarmHistoryItem
alarmHistoryItem_alarmType = (AlarmHistoryItem -> Maybe AlarmType)
-> (AlarmHistoryItem -> Maybe AlarmType -> AlarmHistoryItem)
-> Lens
AlarmHistoryItem
AlarmHistoryItem
(Maybe AlarmType)
(Maybe AlarmType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlarmHistoryItem' {Maybe AlarmType
alarmType :: Maybe AlarmType
$sel:alarmType:AlarmHistoryItem' :: AlarmHistoryItem -> Maybe AlarmType
alarmType} -> Maybe AlarmType
alarmType) (\s :: AlarmHistoryItem
s@AlarmHistoryItem' {} Maybe AlarmType
a -> AlarmHistoryItem
s {$sel:alarmType:AlarmHistoryItem' :: Maybe AlarmType
alarmType = Maybe AlarmType
a} :: AlarmHistoryItem)
alarmHistoryItem_historySummary :: Lens.Lens' AlarmHistoryItem (Prelude.Maybe Prelude.Text)
alarmHistoryItem_historySummary :: (Maybe Text -> f (Maybe Text))
-> AlarmHistoryItem -> f AlarmHistoryItem
alarmHistoryItem_historySummary = (AlarmHistoryItem -> Maybe Text)
-> (AlarmHistoryItem -> Maybe Text -> AlarmHistoryItem)
-> Lens AlarmHistoryItem AlarmHistoryItem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlarmHistoryItem' {Maybe Text
historySummary :: Maybe Text
$sel:historySummary:AlarmHistoryItem' :: AlarmHistoryItem -> Maybe Text
historySummary} -> Maybe Text
historySummary) (\s :: AlarmHistoryItem
s@AlarmHistoryItem' {} Maybe Text
a -> AlarmHistoryItem
s {$sel:historySummary:AlarmHistoryItem' :: Maybe Text
historySummary = Maybe Text
a} :: AlarmHistoryItem)
alarmHistoryItem_timestamp :: Lens.Lens' AlarmHistoryItem (Prelude.Maybe Prelude.UTCTime)
alarmHistoryItem_timestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AlarmHistoryItem -> f AlarmHistoryItem
alarmHistoryItem_timestamp = (AlarmHistoryItem -> Maybe ISO8601)
-> (AlarmHistoryItem -> Maybe ISO8601 -> AlarmHistoryItem)
-> Lens
AlarmHistoryItem AlarmHistoryItem (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlarmHistoryItem' {Maybe ISO8601
timestamp :: Maybe ISO8601
$sel:timestamp:AlarmHistoryItem' :: AlarmHistoryItem -> Maybe ISO8601
timestamp} -> Maybe ISO8601
timestamp) (\s :: AlarmHistoryItem
s@AlarmHistoryItem' {} Maybe ISO8601
a -> AlarmHistoryItem
s {$sel:timestamp:AlarmHistoryItem' :: Maybe ISO8601
timestamp = Maybe ISO8601
a} :: AlarmHistoryItem) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> AlarmHistoryItem -> f AlarmHistoryItem)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AlarmHistoryItem
-> f AlarmHistoryItem
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
instance Core.FromXML AlarmHistoryItem where
parseXML :: [Node] -> Either String AlarmHistoryItem
parseXML [Node]
x =
Maybe Text
-> Maybe HistoryItemType
-> Maybe Text
-> Maybe AlarmType
-> Maybe Text
-> Maybe ISO8601
-> AlarmHistoryItem
AlarmHistoryItem'
(Maybe Text
-> Maybe HistoryItemType
-> Maybe Text
-> Maybe AlarmType
-> Maybe Text
-> Maybe ISO8601
-> AlarmHistoryItem)
-> Either String (Maybe Text)
-> Either
String
(Maybe HistoryItemType
-> Maybe Text
-> Maybe AlarmType
-> Maybe Text
-> Maybe ISO8601
-> AlarmHistoryItem)
forall (f :: * -> *) a b. Functor 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
"AlarmName")
Either
String
(Maybe HistoryItemType
-> Maybe Text
-> Maybe AlarmType
-> Maybe Text
-> Maybe ISO8601
-> AlarmHistoryItem)
-> Either String (Maybe HistoryItemType)
-> Either
String
(Maybe Text
-> Maybe AlarmType
-> Maybe Text
-> Maybe ISO8601
-> AlarmHistoryItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe HistoryItemType)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"HistoryItemType")
Either
String
(Maybe Text
-> Maybe AlarmType
-> Maybe Text
-> Maybe ISO8601
-> AlarmHistoryItem)
-> Either String (Maybe Text)
-> Either
String
(Maybe AlarmType
-> Maybe Text -> Maybe ISO8601 -> AlarmHistoryItem)
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
"HistoryData")
Either
String
(Maybe AlarmType
-> Maybe Text -> Maybe ISO8601 -> AlarmHistoryItem)
-> Either String (Maybe AlarmType)
-> Either String (Maybe Text -> Maybe ISO8601 -> AlarmHistoryItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe AlarmType)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AlarmType")
Either String (Maybe Text -> Maybe ISO8601 -> AlarmHistoryItem)
-> Either String (Maybe Text)
-> Either String (Maybe ISO8601 -> AlarmHistoryItem)
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
"HistorySummary")
Either String (Maybe ISO8601 -> AlarmHistoryItem)
-> Either String (Maybe ISO8601) -> Either String AlarmHistoryItem
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
"Timestamp")
instance Prelude.Hashable AlarmHistoryItem
instance Prelude.NFData AlarmHistoryItem