{-# 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.Lightsail.Types.Alarm where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.AlarmState
import Amazonka.Lightsail.Types.ComparisonOperator
import Amazonka.Lightsail.Types.ContactProtocol
import Amazonka.Lightsail.Types.MetricName
import Amazonka.Lightsail.Types.MetricStatistic
import Amazonka.Lightsail.Types.MetricUnit
import Amazonka.Lightsail.Types.MonitoredResourceInfo
import Amazonka.Lightsail.Types.ResourceLocation
import Amazonka.Lightsail.Types.ResourceType
import Amazonka.Lightsail.Types.TreatMissingData
import qualified Amazonka.Prelude as Prelude
data Alarm = Alarm'
{
Alarm -> Maybe AlarmState
state :: Prelude.Maybe AlarmState,
Alarm -> Maybe TreatMissingData
treatMissingData :: Prelude.Maybe TreatMissingData,
Alarm -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType,
Alarm -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Alarm -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
Alarm -> Maybe ResourceLocation
location :: Prelude.Maybe ResourceLocation,
Alarm -> Maybe [ContactProtocol]
contactProtocols :: Prelude.Maybe [ContactProtocol],
Alarm -> Maybe Natural
period :: Prelude.Maybe Prelude.Natural,
Alarm -> Maybe Int
evaluationPeriods :: Prelude.Maybe Prelude.Int,
Alarm -> Maybe MetricName
metricName :: Prelude.Maybe MetricName,
Alarm -> Maybe ComparisonOperator
comparisonOperator :: Prelude.Maybe ComparisonOperator,
Alarm -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Alarm -> Maybe Double
threshold :: Prelude.Maybe Prelude.Double,
Alarm -> Maybe Int
datapointsToAlarm :: Prelude.Maybe Prelude.Int,
Alarm -> Maybe Text
supportCode :: Prelude.Maybe Prelude.Text,
Alarm -> Maybe Bool
notificationEnabled :: Prelude.Maybe Prelude.Bool,
Alarm -> Maybe [AlarmState]
notificationTriggers :: Prelude.Maybe [AlarmState],
Alarm -> Maybe MetricStatistic
statistic :: Prelude.Maybe MetricStatistic,
Alarm -> Maybe MetricUnit
unit :: Prelude.Maybe MetricUnit,
Alarm -> Maybe MonitoredResourceInfo
monitoredResourceInfo :: Prelude.Maybe MonitoredResourceInfo
}
deriving (Alarm -> Alarm -> Bool
(Alarm -> Alarm -> Bool) -> (Alarm -> Alarm -> Bool) -> Eq Alarm
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Alarm -> Alarm -> Bool
$c/= :: Alarm -> Alarm -> Bool
== :: Alarm -> Alarm -> Bool
$c== :: Alarm -> Alarm -> Bool
Prelude.Eq, ReadPrec [Alarm]
ReadPrec Alarm
Int -> ReadS Alarm
ReadS [Alarm]
(Int -> ReadS Alarm)
-> ReadS [Alarm]
-> ReadPrec Alarm
-> ReadPrec [Alarm]
-> Read Alarm
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Alarm]
$creadListPrec :: ReadPrec [Alarm]
readPrec :: ReadPrec Alarm
$creadPrec :: ReadPrec Alarm
readList :: ReadS [Alarm]
$creadList :: ReadS [Alarm]
readsPrec :: Int -> ReadS Alarm
$creadsPrec :: Int -> ReadS Alarm
Prelude.Read, Int -> Alarm -> ShowS
[Alarm] -> ShowS
Alarm -> String
(Int -> Alarm -> ShowS)
-> (Alarm -> String) -> ([Alarm] -> ShowS) -> Show Alarm
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Alarm] -> ShowS
$cshowList :: [Alarm] -> ShowS
show :: Alarm -> String
$cshow :: Alarm -> String
showsPrec :: Int -> Alarm -> ShowS
$cshowsPrec :: Int -> Alarm -> ShowS
Prelude.Show, (forall x. Alarm -> Rep Alarm x)
-> (forall x. Rep Alarm x -> Alarm) -> Generic Alarm
forall x. Rep Alarm x -> Alarm
forall x. Alarm -> Rep Alarm x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Alarm x -> Alarm
$cfrom :: forall x. Alarm -> Rep Alarm x
Prelude.Generic)
newAlarm ::
Alarm
newAlarm :: Alarm
newAlarm =
Alarm' :: Maybe AlarmState
-> Maybe TreatMissingData
-> Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe [ContactProtocol]
-> Maybe Natural
-> Maybe Int
-> Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm
Alarm'
{ $sel:state:Alarm' :: Maybe AlarmState
state = Maybe AlarmState
forall a. Maybe a
Prelude.Nothing,
$sel:treatMissingData:Alarm' :: Maybe TreatMissingData
treatMissingData = Maybe TreatMissingData
forall a. Maybe a
Prelude.Nothing,
$sel:resourceType:Alarm' :: Maybe ResourceType
resourceType = Maybe ResourceType
forall a. Maybe a
Prelude.Nothing,
$sel:arn:Alarm' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:Alarm' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:location:Alarm' :: Maybe ResourceLocation
location = Maybe ResourceLocation
forall a. Maybe a
Prelude.Nothing,
$sel:contactProtocols:Alarm' :: Maybe [ContactProtocol]
contactProtocols = Maybe [ContactProtocol]
forall a. Maybe a
Prelude.Nothing,
$sel:period:Alarm' :: Maybe Natural
period = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:evaluationPeriods:Alarm' :: Maybe Int
evaluationPeriods = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:metricName:Alarm' :: Maybe MetricName
metricName = Maybe MetricName
forall a. Maybe a
Prelude.Nothing,
$sel:comparisonOperator:Alarm' :: Maybe ComparisonOperator
comparisonOperator = Maybe ComparisonOperator
forall a. Maybe a
Prelude.Nothing,
$sel:name:Alarm' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:threshold:Alarm' :: Maybe Double
threshold = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:datapointsToAlarm:Alarm' :: Maybe Int
datapointsToAlarm = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:supportCode:Alarm' :: Maybe Text
supportCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:notificationEnabled:Alarm' :: Maybe Bool
notificationEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:notificationTriggers:Alarm' :: Maybe [AlarmState]
notificationTriggers = Maybe [AlarmState]
forall a. Maybe a
Prelude.Nothing,
$sel:statistic:Alarm' :: Maybe MetricStatistic
statistic = Maybe MetricStatistic
forall a. Maybe a
Prelude.Nothing,
$sel:unit:Alarm' :: Maybe MetricUnit
unit = Maybe MetricUnit
forall a. Maybe a
Prelude.Nothing,
$sel:monitoredResourceInfo:Alarm' :: Maybe MonitoredResourceInfo
monitoredResourceInfo = Maybe MonitoredResourceInfo
forall a. Maybe a
Prelude.Nothing
}
alarm_state :: Lens.Lens' Alarm (Prelude.Maybe AlarmState)
alarm_state :: (Maybe AlarmState -> f (Maybe AlarmState)) -> Alarm -> f Alarm
alarm_state = (Alarm -> Maybe AlarmState)
-> (Alarm -> Maybe AlarmState -> Alarm)
-> Lens Alarm Alarm (Maybe AlarmState) (Maybe AlarmState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alarm' {Maybe AlarmState
state :: Maybe AlarmState
$sel:state:Alarm' :: Alarm -> Maybe AlarmState
state} -> Maybe AlarmState
state) (\s :: Alarm
s@Alarm' {} Maybe AlarmState
a -> Alarm
s {$sel:state:Alarm' :: Maybe AlarmState
state = Maybe AlarmState
a} :: Alarm)
alarm_treatMissingData :: Lens.Lens' Alarm (Prelude.Maybe TreatMissingData)
alarm_treatMissingData :: (Maybe TreatMissingData -> f (Maybe TreatMissingData))
-> Alarm -> f Alarm
alarm_treatMissingData = (Alarm -> Maybe TreatMissingData)
-> (Alarm -> Maybe TreatMissingData -> Alarm)
-> Lens
Alarm Alarm (Maybe TreatMissingData) (Maybe TreatMissingData)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alarm' {Maybe TreatMissingData
treatMissingData :: Maybe TreatMissingData
$sel:treatMissingData:Alarm' :: Alarm -> Maybe TreatMissingData
treatMissingData} -> Maybe TreatMissingData
treatMissingData) (\s :: Alarm
s@Alarm' {} Maybe TreatMissingData
a -> Alarm
s {$sel:treatMissingData:Alarm' :: Maybe TreatMissingData
treatMissingData = Maybe TreatMissingData
a} :: Alarm)
alarm_resourceType :: Lens.Lens' Alarm (Prelude.Maybe ResourceType)
alarm_resourceType :: (Maybe ResourceType -> f (Maybe ResourceType)) -> Alarm -> f Alarm
alarm_resourceType = (Alarm -> Maybe ResourceType)
-> (Alarm -> Maybe ResourceType -> Alarm)
-> Lens Alarm Alarm (Maybe ResourceType) (Maybe ResourceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alarm' {Maybe ResourceType
resourceType :: Maybe ResourceType
$sel:resourceType:Alarm' :: Alarm -> Maybe ResourceType
resourceType} -> Maybe ResourceType
resourceType) (\s :: Alarm
s@Alarm' {} Maybe ResourceType
a -> Alarm
s {$sel:resourceType:Alarm' :: Maybe ResourceType
resourceType = Maybe ResourceType
a} :: Alarm)
alarm_arn :: Lens.Lens' Alarm (Prelude.Maybe Prelude.Text)
alarm_arn :: (Maybe Text -> f (Maybe Text)) -> Alarm -> f Alarm
alarm_arn = (Alarm -> Maybe Text)
-> (Alarm -> Maybe Text -> Alarm)
-> Lens Alarm Alarm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alarm' {Maybe Text
arn :: Maybe Text
$sel:arn:Alarm' :: Alarm -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Alarm
s@Alarm' {} Maybe Text
a -> Alarm
s {$sel:arn:Alarm' :: Maybe Text
arn = Maybe Text
a} :: Alarm)
alarm_createdAt :: Lens.Lens' Alarm (Prelude.Maybe Prelude.UTCTime)
alarm_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Alarm -> f Alarm
alarm_createdAt = (Alarm -> Maybe POSIX)
-> (Alarm -> Maybe POSIX -> Alarm)
-> Lens Alarm Alarm (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alarm' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:Alarm' :: Alarm -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: Alarm
s@Alarm' {} Maybe POSIX
a -> Alarm
s {$sel:createdAt:Alarm' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: Alarm) ((Maybe POSIX -> f (Maybe POSIX)) -> Alarm -> f Alarm)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Alarm
-> f Alarm
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
alarm_location :: Lens.Lens' Alarm (Prelude.Maybe ResourceLocation)
alarm_location :: (Maybe ResourceLocation -> f (Maybe ResourceLocation))
-> Alarm -> f Alarm
alarm_location = (Alarm -> Maybe ResourceLocation)
-> (Alarm -> Maybe ResourceLocation -> Alarm)
-> Lens
Alarm Alarm (Maybe ResourceLocation) (Maybe ResourceLocation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alarm' {Maybe ResourceLocation
location :: Maybe ResourceLocation
$sel:location:Alarm' :: Alarm -> Maybe ResourceLocation
location} -> Maybe ResourceLocation
location) (\s :: Alarm
s@Alarm' {} Maybe ResourceLocation
a -> Alarm
s {$sel:location:Alarm' :: Maybe ResourceLocation
location = Maybe ResourceLocation
a} :: Alarm)
alarm_contactProtocols :: Lens.Lens' Alarm (Prelude.Maybe [ContactProtocol])
alarm_contactProtocols :: (Maybe [ContactProtocol] -> f (Maybe [ContactProtocol]))
-> Alarm -> f Alarm
alarm_contactProtocols = (Alarm -> Maybe [ContactProtocol])
-> (Alarm -> Maybe [ContactProtocol] -> Alarm)
-> Lens
Alarm Alarm (Maybe [ContactProtocol]) (Maybe [ContactProtocol])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alarm' {Maybe [ContactProtocol]
contactProtocols :: Maybe [ContactProtocol]
$sel:contactProtocols:Alarm' :: Alarm -> Maybe [ContactProtocol]
contactProtocols} -> Maybe [ContactProtocol]
contactProtocols) (\s :: Alarm
s@Alarm' {} Maybe [ContactProtocol]
a -> Alarm
s {$sel:contactProtocols:Alarm' :: Maybe [ContactProtocol]
contactProtocols = Maybe [ContactProtocol]
a} :: Alarm) ((Maybe [ContactProtocol] -> f (Maybe [ContactProtocol]))
-> Alarm -> f Alarm)
-> ((Maybe [ContactProtocol] -> f (Maybe [ContactProtocol]))
-> Maybe [ContactProtocol] -> f (Maybe [ContactProtocol]))
-> (Maybe [ContactProtocol] -> f (Maybe [ContactProtocol]))
-> Alarm
-> f Alarm
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ContactProtocol]
[ContactProtocol]
[ContactProtocol]
[ContactProtocol]
-> Iso
(Maybe [ContactProtocol])
(Maybe [ContactProtocol])
(Maybe [ContactProtocol])
(Maybe [ContactProtocol])
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
[ContactProtocol]
[ContactProtocol]
[ContactProtocol]
[ContactProtocol]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
alarm_period :: Lens.Lens' Alarm (Prelude.Maybe Prelude.Natural)
alarm_period :: (Maybe Natural -> f (Maybe Natural)) -> Alarm -> f Alarm
alarm_period = (Alarm -> Maybe Natural)
-> (Alarm -> Maybe Natural -> Alarm)
-> Lens Alarm Alarm (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alarm' {Maybe Natural
period :: Maybe Natural
$sel:period:Alarm' :: Alarm -> Maybe Natural
period} -> Maybe Natural
period) (\s :: Alarm
s@Alarm' {} Maybe Natural
a -> Alarm
s {$sel:period:Alarm' :: Maybe Natural
period = Maybe Natural
a} :: Alarm)
alarm_evaluationPeriods :: Lens.Lens' Alarm (Prelude.Maybe Prelude.Int)
alarm_evaluationPeriods :: (Maybe Int -> f (Maybe Int)) -> Alarm -> f Alarm
alarm_evaluationPeriods = (Alarm -> Maybe Int)
-> (Alarm -> Maybe Int -> Alarm)
-> Lens Alarm Alarm (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alarm' {Maybe Int
evaluationPeriods :: Maybe Int
$sel:evaluationPeriods:Alarm' :: Alarm -> Maybe Int
evaluationPeriods} -> Maybe Int
evaluationPeriods) (\s :: Alarm
s@Alarm' {} Maybe Int
a -> Alarm
s {$sel:evaluationPeriods:Alarm' :: Maybe Int
evaluationPeriods = Maybe Int
a} :: Alarm)
alarm_metricName :: Lens.Lens' Alarm (Prelude.Maybe MetricName)
alarm_metricName :: (Maybe MetricName -> f (Maybe MetricName)) -> Alarm -> f Alarm
alarm_metricName = (Alarm -> Maybe MetricName)
-> (Alarm -> Maybe MetricName -> Alarm)
-> Lens Alarm Alarm (Maybe MetricName) (Maybe MetricName)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alarm' {Maybe MetricName
metricName :: Maybe MetricName
$sel:metricName:Alarm' :: Alarm -> Maybe MetricName
metricName} -> Maybe MetricName
metricName) (\s :: Alarm
s@Alarm' {} Maybe MetricName
a -> Alarm
s {$sel:metricName:Alarm' :: Maybe MetricName
metricName = Maybe MetricName
a} :: Alarm)
alarm_comparisonOperator :: Lens.Lens' Alarm (Prelude.Maybe ComparisonOperator)
alarm_comparisonOperator :: (Maybe ComparisonOperator -> f (Maybe ComparisonOperator))
-> Alarm -> f Alarm
alarm_comparisonOperator = (Alarm -> Maybe ComparisonOperator)
-> (Alarm -> Maybe ComparisonOperator -> Alarm)
-> Lens
Alarm Alarm (Maybe ComparisonOperator) (Maybe ComparisonOperator)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alarm' {Maybe ComparisonOperator
comparisonOperator :: Maybe ComparisonOperator
$sel:comparisonOperator:Alarm' :: Alarm -> Maybe ComparisonOperator
comparisonOperator} -> Maybe ComparisonOperator
comparisonOperator) (\s :: Alarm
s@Alarm' {} Maybe ComparisonOperator
a -> Alarm
s {$sel:comparisonOperator:Alarm' :: Maybe ComparisonOperator
comparisonOperator = Maybe ComparisonOperator
a} :: Alarm)
alarm_name :: Lens.Lens' Alarm (Prelude.Maybe Prelude.Text)
alarm_name :: (Maybe Text -> f (Maybe Text)) -> Alarm -> f Alarm
alarm_name = (Alarm -> Maybe Text)
-> (Alarm -> Maybe Text -> Alarm)
-> Lens Alarm Alarm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alarm' {Maybe Text
name :: Maybe Text
$sel:name:Alarm' :: Alarm -> Maybe Text
name} -> Maybe Text
name) (\s :: Alarm
s@Alarm' {} Maybe Text
a -> Alarm
s {$sel:name:Alarm' :: Maybe Text
name = Maybe Text
a} :: Alarm)
alarm_threshold :: Lens.Lens' Alarm (Prelude.Maybe Prelude.Double)
alarm_threshold :: (Maybe Double -> f (Maybe Double)) -> Alarm -> f Alarm
alarm_threshold = (Alarm -> Maybe Double)
-> (Alarm -> Maybe Double -> Alarm)
-> Lens Alarm Alarm (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alarm' {Maybe Double
threshold :: Maybe Double
$sel:threshold:Alarm' :: Alarm -> Maybe Double
threshold} -> Maybe Double
threshold) (\s :: Alarm
s@Alarm' {} Maybe Double
a -> Alarm
s {$sel:threshold:Alarm' :: Maybe Double
threshold = Maybe Double
a} :: Alarm)
alarm_datapointsToAlarm :: Lens.Lens' Alarm (Prelude.Maybe Prelude.Int)
alarm_datapointsToAlarm :: (Maybe Int -> f (Maybe Int)) -> Alarm -> f Alarm
alarm_datapointsToAlarm = (Alarm -> Maybe Int)
-> (Alarm -> Maybe Int -> Alarm)
-> Lens Alarm Alarm (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alarm' {Maybe Int
datapointsToAlarm :: Maybe Int
$sel:datapointsToAlarm:Alarm' :: Alarm -> Maybe Int
datapointsToAlarm} -> Maybe Int
datapointsToAlarm) (\s :: Alarm
s@Alarm' {} Maybe Int
a -> Alarm
s {$sel:datapointsToAlarm:Alarm' :: Maybe Int
datapointsToAlarm = Maybe Int
a} :: Alarm)
alarm_supportCode :: Lens.Lens' Alarm (Prelude.Maybe Prelude.Text)
alarm_supportCode :: (Maybe Text -> f (Maybe Text)) -> Alarm -> f Alarm
alarm_supportCode = (Alarm -> Maybe Text)
-> (Alarm -> Maybe Text -> Alarm)
-> Lens Alarm Alarm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alarm' {Maybe Text
supportCode :: Maybe Text
$sel:supportCode:Alarm' :: Alarm -> Maybe Text
supportCode} -> Maybe Text
supportCode) (\s :: Alarm
s@Alarm' {} Maybe Text
a -> Alarm
s {$sel:supportCode:Alarm' :: Maybe Text
supportCode = Maybe Text
a} :: Alarm)
alarm_notificationEnabled :: Lens.Lens' Alarm (Prelude.Maybe Prelude.Bool)
alarm_notificationEnabled :: (Maybe Bool -> f (Maybe Bool)) -> Alarm -> f Alarm
alarm_notificationEnabled = (Alarm -> Maybe Bool)
-> (Alarm -> Maybe Bool -> Alarm)
-> Lens Alarm Alarm (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alarm' {Maybe Bool
notificationEnabled :: Maybe Bool
$sel:notificationEnabled:Alarm' :: Alarm -> Maybe Bool
notificationEnabled} -> Maybe Bool
notificationEnabled) (\s :: Alarm
s@Alarm' {} Maybe Bool
a -> Alarm
s {$sel:notificationEnabled:Alarm' :: Maybe Bool
notificationEnabled = Maybe Bool
a} :: Alarm)
alarm_notificationTriggers :: Lens.Lens' Alarm (Prelude.Maybe [AlarmState])
alarm_notificationTriggers :: (Maybe [AlarmState] -> f (Maybe [AlarmState])) -> Alarm -> f Alarm
alarm_notificationTriggers = (Alarm -> Maybe [AlarmState])
-> (Alarm -> Maybe [AlarmState] -> Alarm)
-> Lens Alarm Alarm (Maybe [AlarmState]) (Maybe [AlarmState])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alarm' {Maybe [AlarmState]
notificationTriggers :: Maybe [AlarmState]
$sel:notificationTriggers:Alarm' :: Alarm -> Maybe [AlarmState]
notificationTriggers} -> Maybe [AlarmState]
notificationTriggers) (\s :: Alarm
s@Alarm' {} Maybe [AlarmState]
a -> Alarm
s {$sel:notificationTriggers:Alarm' :: Maybe [AlarmState]
notificationTriggers = Maybe [AlarmState]
a} :: Alarm) ((Maybe [AlarmState] -> f (Maybe [AlarmState]))
-> Alarm -> f Alarm)
-> ((Maybe [AlarmState] -> f (Maybe [AlarmState]))
-> Maybe [AlarmState] -> f (Maybe [AlarmState]))
-> (Maybe [AlarmState] -> f (Maybe [AlarmState]))
-> Alarm
-> f Alarm
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [AlarmState] [AlarmState] [AlarmState] [AlarmState]
-> Iso
(Maybe [AlarmState])
(Maybe [AlarmState])
(Maybe [AlarmState])
(Maybe [AlarmState])
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 [AlarmState] [AlarmState] [AlarmState] [AlarmState]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
alarm_statistic :: Lens.Lens' Alarm (Prelude.Maybe MetricStatistic)
alarm_statistic :: (Maybe MetricStatistic -> f (Maybe MetricStatistic))
-> Alarm -> f Alarm
alarm_statistic = (Alarm -> Maybe MetricStatistic)
-> (Alarm -> Maybe MetricStatistic -> Alarm)
-> Lens Alarm Alarm (Maybe MetricStatistic) (Maybe MetricStatistic)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alarm' {Maybe MetricStatistic
statistic :: Maybe MetricStatistic
$sel:statistic:Alarm' :: Alarm -> Maybe MetricStatistic
statistic} -> Maybe MetricStatistic
statistic) (\s :: Alarm
s@Alarm' {} Maybe MetricStatistic
a -> Alarm
s {$sel:statistic:Alarm' :: Maybe MetricStatistic
statistic = Maybe MetricStatistic
a} :: Alarm)
alarm_unit :: Lens.Lens' Alarm (Prelude.Maybe MetricUnit)
alarm_unit :: (Maybe MetricUnit -> f (Maybe MetricUnit)) -> Alarm -> f Alarm
alarm_unit = (Alarm -> Maybe MetricUnit)
-> (Alarm -> Maybe MetricUnit -> Alarm)
-> Lens Alarm Alarm (Maybe MetricUnit) (Maybe MetricUnit)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alarm' {Maybe MetricUnit
unit :: Maybe MetricUnit
$sel:unit:Alarm' :: Alarm -> Maybe MetricUnit
unit} -> Maybe MetricUnit
unit) (\s :: Alarm
s@Alarm' {} Maybe MetricUnit
a -> Alarm
s {$sel:unit:Alarm' :: Maybe MetricUnit
unit = Maybe MetricUnit
a} :: Alarm)
alarm_monitoredResourceInfo :: Lens.Lens' Alarm (Prelude.Maybe MonitoredResourceInfo)
alarm_monitoredResourceInfo :: (Maybe MonitoredResourceInfo -> f (Maybe MonitoredResourceInfo))
-> Alarm -> f Alarm
alarm_monitoredResourceInfo = (Alarm -> Maybe MonitoredResourceInfo)
-> (Alarm -> Maybe MonitoredResourceInfo -> Alarm)
-> Lens
Alarm
Alarm
(Maybe MonitoredResourceInfo)
(Maybe MonitoredResourceInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alarm' {Maybe MonitoredResourceInfo
monitoredResourceInfo :: Maybe MonitoredResourceInfo
$sel:monitoredResourceInfo:Alarm' :: Alarm -> Maybe MonitoredResourceInfo
monitoredResourceInfo} -> Maybe MonitoredResourceInfo
monitoredResourceInfo) (\s :: Alarm
s@Alarm' {} Maybe MonitoredResourceInfo
a -> Alarm
s {$sel:monitoredResourceInfo:Alarm' :: Maybe MonitoredResourceInfo
monitoredResourceInfo = Maybe MonitoredResourceInfo
a} :: Alarm)
instance Core.FromJSON Alarm where
parseJSON :: Value -> Parser Alarm
parseJSON =
String -> (Object -> Parser Alarm) -> Value -> Parser Alarm
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Alarm"
( \Object
x ->
Maybe AlarmState
-> Maybe TreatMissingData
-> Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe [ContactProtocol]
-> Maybe Natural
-> Maybe Int
-> Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm
Alarm'
(Maybe AlarmState
-> Maybe TreatMissingData
-> Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe [ContactProtocol]
-> Maybe Natural
-> Maybe Int
-> Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
-> Parser (Maybe AlarmState)
-> Parser
(Maybe TreatMissingData
-> Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe [ContactProtocol]
-> Maybe Natural
-> Maybe Int
-> Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AlarmState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"state")
Parser
(Maybe TreatMissingData
-> Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe [ContactProtocol]
-> Maybe Natural
-> Maybe Int
-> Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
-> Parser (Maybe TreatMissingData)
-> Parser
(Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe [ContactProtocol]
-> Maybe Natural
-> Maybe Int
-> Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TreatMissingData)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"treatMissingData")
Parser
(Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe [ContactProtocol]
-> Maybe Natural
-> Maybe Int
-> Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
-> Parser (Maybe ResourceType)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe [ContactProtocol]
-> Maybe Natural
-> Maybe Int
-> Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourceType")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe [ContactProtocol]
-> Maybe Natural
-> Maybe Int
-> Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe ResourceLocation
-> Maybe [ContactProtocol]
-> Maybe Natural
-> Maybe Int
-> Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
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
"arn")
Parser
(Maybe POSIX
-> Maybe ResourceLocation
-> Maybe [ContactProtocol]
-> Maybe Natural
-> Maybe Int
-> Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
-> Parser (Maybe POSIX)
-> Parser
(Maybe ResourceLocation
-> Maybe [ContactProtocol]
-> Maybe Natural
-> Maybe Int
-> Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
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
"createdAt")
Parser
(Maybe ResourceLocation
-> Maybe [ContactProtocol]
-> Maybe Natural
-> Maybe Int
-> Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
-> Parser (Maybe ResourceLocation)
-> Parser
(Maybe [ContactProtocol]
-> Maybe Natural
-> Maybe Int
-> Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceLocation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"location")
Parser
(Maybe [ContactProtocol]
-> Maybe Natural
-> Maybe Int
-> Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
-> Parser (Maybe [ContactProtocol])
-> Parser
(Maybe Natural
-> Maybe Int
-> Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [ContactProtocol]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"contactProtocols"
Parser (Maybe (Maybe [ContactProtocol]))
-> Maybe [ContactProtocol] -> Parser (Maybe [ContactProtocol])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ContactProtocol]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe Natural
-> Maybe Int
-> Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
-> Parser (Maybe Natural)
-> Parser
(Maybe Int
-> Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"period")
Parser
(Maybe Int
-> Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
-> Parser (Maybe Int)
-> Parser
(Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"evaluationPeriods")
Parser
(Maybe MetricName
-> Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
-> Parser (Maybe MetricName)
-> Parser
(Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MetricName)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"metricName")
Parser
(Maybe ComparisonOperator
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
-> Parser (Maybe ComparisonOperator)
-> Parser
(Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ComparisonOperator)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"comparisonOperator")
Parser
(Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
-> Parser (Maybe Text)
-> Parser
(Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
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
"name")
Parser
(Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
-> Parser (Maybe Double)
-> Parser
(Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"threshold")
Parser
(Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
-> Parser (Maybe Int)
-> Parser
(Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"datapointsToAlarm")
Parser
(Maybe Text
-> Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
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
"supportCode")
Parser
(Maybe Bool
-> Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
-> Parser (Maybe Bool)
-> Parser
(Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"notificationEnabled")
Parser
(Maybe [AlarmState]
-> Maybe MetricStatistic
-> Maybe MetricUnit
-> Maybe MonitoredResourceInfo
-> Alarm)
-> Parser (Maybe [AlarmState])
-> Parser
(Maybe MetricStatistic
-> Maybe MetricUnit -> Maybe MonitoredResourceInfo -> Alarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [AlarmState]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"notificationTriggers"
Parser (Maybe (Maybe [AlarmState]))
-> Maybe [AlarmState] -> Parser (Maybe [AlarmState])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AlarmState]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe MetricStatistic
-> Maybe MetricUnit -> Maybe MonitoredResourceInfo -> Alarm)
-> Parser (Maybe MetricStatistic)
-> Parser
(Maybe MetricUnit -> Maybe MonitoredResourceInfo -> Alarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MetricStatistic)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"statistic")
Parser (Maybe MetricUnit -> Maybe MonitoredResourceInfo -> Alarm)
-> Parser (Maybe MetricUnit)
-> Parser (Maybe MonitoredResourceInfo -> Alarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MetricUnit)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"unit")
Parser (Maybe MonitoredResourceInfo -> Alarm)
-> Parser (Maybe MonitoredResourceInfo) -> Parser Alarm
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MonitoredResourceInfo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"monitoredResourceInfo")
)
instance Prelude.Hashable Alarm
instance Prelude.NFData Alarm