{-# 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.IoTEventsData.Types.AlarmSummary where
import qualified Amazonka.Core as Core
import Amazonka.IoTEventsData.Types.AlarmStateName
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AlarmSummary = AlarmSummary'
{
AlarmSummary -> Maybe Text
keyValue :: Prelude.Maybe Prelude.Text,
AlarmSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
AlarmSummary -> Maybe Text
alarmModelName :: Prelude.Maybe Prelude.Text,
AlarmSummary -> Maybe AlarmStateName
stateName :: Prelude.Maybe AlarmStateName,
AlarmSummary -> Maybe POSIX
lastUpdateTime :: Prelude.Maybe Core.POSIX,
AlarmSummary -> Maybe Text
alarmModelVersion :: Prelude.Maybe Prelude.Text
}
deriving (AlarmSummary -> AlarmSummary -> Bool
(AlarmSummary -> AlarmSummary -> Bool)
-> (AlarmSummary -> AlarmSummary -> Bool) -> Eq AlarmSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AlarmSummary -> AlarmSummary -> Bool
$c/= :: AlarmSummary -> AlarmSummary -> Bool
== :: AlarmSummary -> AlarmSummary -> Bool
$c== :: AlarmSummary -> AlarmSummary -> Bool
Prelude.Eq, ReadPrec [AlarmSummary]
ReadPrec AlarmSummary
Int -> ReadS AlarmSummary
ReadS [AlarmSummary]
(Int -> ReadS AlarmSummary)
-> ReadS [AlarmSummary]
-> ReadPrec AlarmSummary
-> ReadPrec [AlarmSummary]
-> Read AlarmSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AlarmSummary]
$creadListPrec :: ReadPrec [AlarmSummary]
readPrec :: ReadPrec AlarmSummary
$creadPrec :: ReadPrec AlarmSummary
readList :: ReadS [AlarmSummary]
$creadList :: ReadS [AlarmSummary]
readsPrec :: Int -> ReadS AlarmSummary
$creadsPrec :: Int -> ReadS AlarmSummary
Prelude.Read, Int -> AlarmSummary -> ShowS
[AlarmSummary] -> ShowS
AlarmSummary -> String
(Int -> AlarmSummary -> ShowS)
-> (AlarmSummary -> String)
-> ([AlarmSummary] -> ShowS)
-> Show AlarmSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AlarmSummary] -> ShowS
$cshowList :: [AlarmSummary] -> ShowS
show :: AlarmSummary -> String
$cshow :: AlarmSummary -> String
showsPrec :: Int -> AlarmSummary -> ShowS
$cshowsPrec :: Int -> AlarmSummary -> ShowS
Prelude.Show, (forall x. AlarmSummary -> Rep AlarmSummary x)
-> (forall x. Rep AlarmSummary x -> AlarmSummary)
-> Generic AlarmSummary
forall x. Rep AlarmSummary x -> AlarmSummary
forall x. AlarmSummary -> Rep AlarmSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AlarmSummary x -> AlarmSummary
$cfrom :: forall x. AlarmSummary -> Rep AlarmSummary x
Prelude.Generic)
newAlarmSummary ::
AlarmSummary
newAlarmSummary :: AlarmSummary
newAlarmSummary =
AlarmSummary' :: Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe AlarmStateName
-> Maybe POSIX
-> Maybe Text
-> AlarmSummary
AlarmSummary'
{ $sel:keyValue:AlarmSummary' :: Maybe Text
keyValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:creationTime:AlarmSummary' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:alarmModelName:AlarmSummary' :: Maybe Text
alarmModelName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:stateName:AlarmSummary' :: Maybe AlarmStateName
stateName = Maybe AlarmStateName
forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdateTime:AlarmSummary' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:alarmModelVersion:AlarmSummary' :: Maybe Text
alarmModelVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
alarmSummary_keyValue :: Lens.Lens' AlarmSummary (Prelude.Maybe Prelude.Text)
alarmSummary_keyValue :: (Maybe Text -> f (Maybe Text)) -> AlarmSummary -> f AlarmSummary
alarmSummary_keyValue = (AlarmSummary -> Maybe Text)
-> (AlarmSummary -> Maybe Text -> AlarmSummary)
-> Lens AlarmSummary AlarmSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlarmSummary' {Maybe Text
keyValue :: Maybe Text
$sel:keyValue:AlarmSummary' :: AlarmSummary -> Maybe Text
keyValue} -> Maybe Text
keyValue) (\s :: AlarmSummary
s@AlarmSummary' {} Maybe Text
a -> AlarmSummary
s {$sel:keyValue:AlarmSummary' :: Maybe Text
keyValue = Maybe Text
a} :: AlarmSummary)
alarmSummary_creationTime :: Lens.Lens' AlarmSummary (Prelude.Maybe Prelude.UTCTime)
alarmSummary_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AlarmSummary -> f AlarmSummary
alarmSummary_creationTime = (AlarmSummary -> Maybe POSIX)
-> (AlarmSummary -> Maybe POSIX -> AlarmSummary)
-> Lens AlarmSummary AlarmSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlarmSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:AlarmSummary' :: AlarmSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: AlarmSummary
s@AlarmSummary' {} Maybe POSIX
a -> AlarmSummary
s {$sel:creationTime:AlarmSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: AlarmSummary) ((Maybe POSIX -> f (Maybe POSIX))
-> AlarmSummary -> f AlarmSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AlarmSummary
-> f AlarmSummary
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
alarmSummary_alarmModelName :: Lens.Lens' AlarmSummary (Prelude.Maybe Prelude.Text)
alarmSummary_alarmModelName :: (Maybe Text -> f (Maybe Text)) -> AlarmSummary -> f AlarmSummary
alarmSummary_alarmModelName = (AlarmSummary -> Maybe Text)
-> (AlarmSummary -> Maybe Text -> AlarmSummary)
-> Lens AlarmSummary AlarmSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlarmSummary' {Maybe Text
alarmModelName :: Maybe Text
$sel:alarmModelName:AlarmSummary' :: AlarmSummary -> Maybe Text
alarmModelName} -> Maybe Text
alarmModelName) (\s :: AlarmSummary
s@AlarmSummary' {} Maybe Text
a -> AlarmSummary
s {$sel:alarmModelName:AlarmSummary' :: Maybe Text
alarmModelName = Maybe Text
a} :: AlarmSummary)
alarmSummary_stateName :: Lens.Lens' AlarmSummary (Prelude.Maybe AlarmStateName)
alarmSummary_stateName :: (Maybe AlarmStateName -> f (Maybe AlarmStateName))
-> AlarmSummary -> f AlarmSummary
alarmSummary_stateName = (AlarmSummary -> Maybe AlarmStateName)
-> (AlarmSummary -> Maybe AlarmStateName -> AlarmSummary)
-> Lens
AlarmSummary
AlarmSummary
(Maybe AlarmStateName)
(Maybe AlarmStateName)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlarmSummary' {Maybe AlarmStateName
stateName :: Maybe AlarmStateName
$sel:stateName:AlarmSummary' :: AlarmSummary -> Maybe AlarmStateName
stateName} -> Maybe AlarmStateName
stateName) (\s :: AlarmSummary
s@AlarmSummary' {} Maybe AlarmStateName
a -> AlarmSummary
s {$sel:stateName:AlarmSummary' :: Maybe AlarmStateName
stateName = Maybe AlarmStateName
a} :: AlarmSummary)
alarmSummary_lastUpdateTime :: Lens.Lens' AlarmSummary (Prelude.Maybe Prelude.UTCTime)
alarmSummary_lastUpdateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AlarmSummary -> f AlarmSummary
alarmSummary_lastUpdateTime = (AlarmSummary -> Maybe POSIX)
-> (AlarmSummary -> Maybe POSIX -> AlarmSummary)
-> Lens AlarmSummary AlarmSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlarmSummary' {Maybe POSIX
lastUpdateTime :: Maybe POSIX
$sel:lastUpdateTime:AlarmSummary' :: AlarmSummary -> Maybe POSIX
lastUpdateTime} -> Maybe POSIX
lastUpdateTime) (\s :: AlarmSummary
s@AlarmSummary' {} Maybe POSIX
a -> AlarmSummary
s {$sel:lastUpdateTime:AlarmSummary' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
a} :: AlarmSummary) ((Maybe POSIX -> f (Maybe POSIX))
-> AlarmSummary -> f AlarmSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AlarmSummary
-> f AlarmSummary
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
alarmSummary_alarmModelVersion :: Lens.Lens' AlarmSummary (Prelude.Maybe Prelude.Text)
alarmSummary_alarmModelVersion :: (Maybe Text -> f (Maybe Text)) -> AlarmSummary -> f AlarmSummary
alarmSummary_alarmModelVersion = (AlarmSummary -> Maybe Text)
-> (AlarmSummary -> Maybe Text -> AlarmSummary)
-> Lens AlarmSummary AlarmSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlarmSummary' {Maybe Text
alarmModelVersion :: Maybe Text
$sel:alarmModelVersion:AlarmSummary' :: AlarmSummary -> Maybe Text
alarmModelVersion} -> Maybe Text
alarmModelVersion) (\s :: AlarmSummary
s@AlarmSummary' {} Maybe Text
a -> AlarmSummary
s {$sel:alarmModelVersion:AlarmSummary' :: Maybe Text
alarmModelVersion = Maybe Text
a} :: AlarmSummary)
instance Core.FromJSON AlarmSummary where
parseJSON :: Value -> Parser AlarmSummary
parseJSON =
String
-> (Object -> Parser AlarmSummary) -> Value -> Parser AlarmSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AlarmSummary"
( \Object
x ->
Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe AlarmStateName
-> Maybe POSIX
-> Maybe Text
-> AlarmSummary
AlarmSummary'
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe AlarmStateName
-> Maybe POSIX
-> Maybe Text
-> AlarmSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe Text
-> Maybe AlarmStateName
-> Maybe POSIX
-> Maybe Text
-> AlarmSummary)
forall (f :: * -> *) a b. Functor 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
"keyValue")
Parser
(Maybe POSIX
-> Maybe Text
-> Maybe AlarmStateName
-> Maybe POSIX
-> Maybe Text
-> AlarmSummary)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe AlarmStateName
-> Maybe POSIX
-> Maybe Text
-> AlarmSummary)
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
"creationTime")
Parser
(Maybe Text
-> Maybe AlarmStateName
-> Maybe POSIX
-> Maybe Text
-> AlarmSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe AlarmStateName -> Maybe POSIX -> Maybe Text -> AlarmSummary)
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
"alarmModelName")
Parser
(Maybe AlarmStateName -> Maybe POSIX -> Maybe Text -> AlarmSummary)
-> Parser (Maybe AlarmStateName)
-> Parser (Maybe POSIX -> Maybe Text -> AlarmSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AlarmStateName)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"stateName")
Parser (Maybe POSIX -> Maybe Text -> AlarmSummary)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> AlarmSummary)
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
"lastUpdateTime")
Parser (Maybe Text -> AlarmSummary)
-> Parser (Maybe Text) -> Parser AlarmSummary
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
"alarmModelVersion")
)
instance Prelude.Hashable AlarmSummary
instance Prelude.NFData AlarmSummary