{-# 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.MetricAlarm
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CloudWatch.Types.MetricAlarm where

import Amazonka.CloudWatch.Types.ComparisonOperator
import Amazonka.CloudWatch.Types.Dimension
import Amazonka.CloudWatch.Types.MetricDataQuery
import Amazonka.CloudWatch.Types.StandardUnit
import Amazonka.CloudWatch.Types.StateValue
import Amazonka.CloudWatch.Types.Statistic
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The details about a metric alarm.
--
-- /See:/ 'newMetricAlarm' smart constructor.
data MetricAlarm = MetricAlarm'
  { -- | The name of the alarm.
    MetricAlarm -> Maybe Text
alarmName :: Prelude.Maybe Prelude.Text,
    -- | The time stamp of the last update to the alarm state.
    MetricAlarm -> Maybe ISO8601
stateUpdatedTimestamp :: Prelude.Maybe Core.ISO8601,
    -- | An array of MetricDataQuery structures, used in an alarm based on a
    -- metric math expression. Each structure either retrieves a metric or
    -- performs a math expression. One item in the Metrics array is the math
    -- expression that the alarm watches. This expression by designated by
    -- having @ReturnData@ set to true.
    MetricAlarm -> Maybe [MetricDataQuery]
metrics :: Prelude.Maybe [MetricDataQuery],
    -- | Sets how this alarm is to handle missing data points. If this parameter
    -- is omitted, the default behavior of @missing@ is used.
    MetricAlarm -> Maybe Text
treatMissingData :: Prelude.Maybe Prelude.Text,
    -- | The period, in seconds, over which the statistic is applied.
    MetricAlarm -> Maybe Natural
period :: Prelude.Maybe Prelude.Natural,
    -- | The description of the alarm.
    MetricAlarm -> Maybe Text
alarmDescription :: Prelude.Maybe Prelude.Text,
    -- | The number of periods over which data is compared to the specified
    -- threshold.
    MetricAlarm -> Maybe Natural
evaluationPeriods :: Prelude.Maybe Prelude.Natural,
    -- | The name of the metric associated with the alarm, if this is an alarm
    -- based on a single metric.
    MetricAlarm -> Maybe Text
metricName :: Prelude.Maybe Prelude.Text,
    -- | The namespace of the metric associated with the alarm.
    MetricAlarm -> Maybe Text
namespace :: Prelude.Maybe Prelude.Text,
    -- | In an alarm based on an anomaly detection model, this is the ID of the
    -- @ANOMALY_DETECTION_BAND@ function used as the threshold for the alarm.
    MetricAlarm -> Maybe Text
thresholdMetricId :: Prelude.Maybe Prelude.Text,
    -- | The arithmetic operation to use when comparing the specified statistic
    -- and threshold. The specified statistic value is used as the first
    -- operand.
    MetricAlarm -> Maybe ComparisonOperator
comparisonOperator :: Prelude.Maybe ComparisonOperator,
    -- | The actions to execute when this alarm transitions to the @OK@ state
    -- from any other state. Each action is specified as an Amazon Resource
    -- Name (ARN).
    MetricAlarm -> Maybe [Text]
oKActions :: Prelude.Maybe [Prelude.Text],
    -- | Used only for alarms based on percentiles. If @ignore@, the alarm state
    -- does not change during periods with too few data points to be
    -- statistically significant. If @evaluate@ or this parameter is not used,
    -- the alarm is always evaluated and possibly changes state no matter how
    -- many data points are available.
    MetricAlarm -> Maybe Text
evaluateLowSampleCountPercentile :: Prelude.Maybe Prelude.Text,
    -- | The state value for the alarm.
    MetricAlarm -> Maybe StateValue
stateValue :: Prelude.Maybe StateValue,
    -- | The number of data points that must be breaching to trigger the alarm.
    MetricAlarm -> Maybe Natural
datapointsToAlarm :: Prelude.Maybe Prelude.Natural,
    -- | The value to compare with the specified statistic.
    MetricAlarm -> Maybe Double
threshold :: Prelude.Maybe Prelude.Double,
    -- | The time stamp of the last update to the alarm configuration.
    MetricAlarm -> Maybe ISO8601
alarmConfigurationUpdatedTimestamp :: Prelude.Maybe Core.ISO8601,
    -- | Indicates whether actions should be executed during any changes to the
    -- alarm state.
    MetricAlarm -> Maybe Bool
actionsEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The actions to execute when this alarm transitions to the
    -- @INSUFFICIENT_DATA@ state from any other state. Each action is specified
    -- as an Amazon Resource Name (ARN).
    MetricAlarm -> Maybe [Text]
insufficientDataActions :: Prelude.Maybe [Prelude.Text],
    -- | An explanation for the alarm state, in text format.
    MetricAlarm -> Maybe Text
stateReason :: Prelude.Maybe Prelude.Text,
    -- | An explanation for the alarm state, in JSON format.
    MetricAlarm -> Maybe Text
stateReasonData :: Prelude.Maybe Prelude.Text,
    -- | The dimensions for the metric associated with the alarm.
    MetricAlarm -> Maybe [Dimension]
dimensions :: Prelude.Maybe [Dimension],
    -- | The Amazon Resource Name (ARN) of the alarm.
    MetricAlarm -> Maybe Text
alarmArn :: Prelude.Maybe Prelude.Text,
    -- | The actions to execute when this alarm transitions to the @ALARM@ state
    -- from any other state. Each action is specified as an Amazon Resource
    -- Name (ARN).
    MetricAlarm -> Maybe [Text]
alarmActions :: Prelude.Maybe [Prelude.Text],
    -- | The unit of the metric associated with the alarm.
    MetricAlarm -> Maybe StandardUnit
unit :: Prelude.Maybe StandardUnit,
    -- | The statistic for the metric associated with the alarm, other than
    -- percentile. For percentile statistics, use @ExtendedStatistic@.
    MetricAlarm -> Maybe Statistic
statistic :: Prelude.Maybe Statistic,
    -- | The percentile statistic for the metric associated with the alarm.
    -- Specify a value between p0.0 and p100.
    MetricAlarm -> Maybe Text
extendedStatistic :: Prelude.Maybe Prelude.Text
  }
  deriving (MetricAlarm -> MetricAlarm -> Bool
(MetricAlarm -> MetricAlarm -> Bool)
-> (MetricAlarm -> MetricAlarm -> Bool) -> Eq MetricAlarm
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MetricAlarm -> MetricAlarm -> Bool
$c/= :: MetricAlarm -> MetricAlarm -> Bool
== :: MetricAlarm -> MetricAlarm -> Bool
$c== :: MetricAlarm -> MetricAlarm -> Bool
Prelude.Eq, ReadPrec [MetricAlarm]
ReadPrec MetricAlarm
Int -> ReadS MetricAlarm
ReadS [MetricAlarm]
(Int -> ReadS MetricAlarm)
-> ReadS [MetricAlarm]
-> ReadPrec MetricAlarm
-> ReadPrec [MetricAlarm]
-> Read MetricAlarm
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MetricAlarm]
$creadListPrec :: ReadPrec [MetricAlarm]
readPrec :: ReadPrec MetricAlarm
$creadPrec :: ReadPrec MetricAlarm
readList :: ReadS [MetricAlarm]
$creadList :: ReadS [MetricAlarm]
readsPrec :: Int -> ReadS MetricAlarm
$creadsPrec :: Int -> ReadS MetricAlarm
Prelude.Read, Int -> MetricAlarm -> ShowS
[MetricAlarm] -> ShowS
MetricAlarm -> String
(Int -> MetricAlarm -> ShowS)
-> (MetricAlarm -> String)
-> ([MetricAlarm] -> ShowS)
-> Show MetricAlarm
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MetricAlarm] -> ShowS
$cshowList :: [MetricAlarm] -> ShowS
show :: MetricAlarm -> String
$cshow :: MetricAlarm -> String
showsPrec :: Int -> MetricAlarm -> ShowS
$cshowsPrec :: Int -> MetricAlarm -> ShowS
Prelude.Show, (forall x. MetricAlarm -> Rep MetricAlarm x)
-> (forall x. Rep MetricAlarm x -> MetricAlarm)
-> Generic MetricAlarm
forall x. Rep MetricAlarm x -> MetricAlarm
forall x. MetricAlarm -> Rep MetricAlarm x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MetricAlarm x -> MetricAlarm
$cfrom :: forall x. MetricAlarm -> Rep MetricAlarm x
Prelude.Generic)

-- |
-- Create a value of 'MetricAlarm' 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:
--
-- 'alarmName', 'metricAlarm_alarmName' - The name of the alarm.
--
-- 'stateUpdatedTimestamp', 'metricAlarm_stateUpdatedTimestamp' - The time stamp of the last update to the alarm state.
--
-- 'metrics', 'metricAlarm_metrics' - An array of MetricDataQuery structures, used in an alarm based on a
-- metric math expression. Each structure either retrieves a metric or
-- performs a math expression. One item in the Metrics array is the math
-- expression that the alarm watches. This expression by designated by
-- having @ReturnData@ set to true.
--
-- 'treatMissingData', 'metricAlarm_treatMissingData' - Sets how this alarm is to handle missing data points. If this parameter
-- is omitted, the default behavior of @missing@ is used.
--
-- 'period', 'metricAlarm_period' - The period, in seconds, over which the statistic is applied.
--
-- 'alarmDescription', 'metricAlarm_alarmDescription' - The description of the alarm.
--
-- 'evaluationPeriods', 'metricAlarm_evaluationPeriods' - The number of periods over which data is compared to the specified
-- threshold.
--
-- 'metricName', 'metricAlarm_metricName' - The name of the metric associated with the alarm, if this is an alarm
-- based on a single metric.
--
-- 'namespace', 'metricAlarm_namespace' - The namespace of the metric associated with the alarm.
--
-- 'thresholdMetricId', 'metricAlarm_thresholdMetricId' - In an alarm based on an anomaly detection model, this is the ID of the
-- @ANOMALY_DETECTION_BAND@ function used as the threshold for the alarm.
--
-- 'comparisonOperator', 'metricAlarm_comparisonOperator' - The arithmetic operation to use when comparing the specified statistic
-- and threshold. The specified statistic value is used as the first
-- operand.
--
-- 'oKActions', 'metricAlarm_oKActions' - The actions to execute when this alarm transitions to the @OK@ state
-- from any other state. Each action is specified as an Amazon Resource
-- Name (ARN).
--
-- 'evaluateLowSampleCountPercentile', 'metricAlarm_evaluateLowSampleCountPercentile' - Used only for alarms based on percentiles. If @ignore@, the alarm state
-- does not change during periods with too few data points to be
-- statistically significant. If @evaluate@ or this parameter is not used,
-- the alarm is always evaluated and possibly changes state no matter how
-- many data points are available.
--
-- 'stateValue', 'metricAlarm_stateValue' - The state value for the alarm.
--
-- 'datapointsToAlarm', 'metricAlarm_datapointsToAlarm' - The number of data points that must be breaching to trigger the alarm.
--
-- 'threshold', 'metricAlarm_threshold' - The value to compare with the specified statistic.
--
-- 'alarmConfigurationUpdatedTimestamp', 'metricAlarm_alarmConfigurationUpdatedTimestamp' - The time stamp of the last update to the alarm configuration.
--
-- 'actionsEnabled', 'metricAlarm_actionsEnabled' - Indicates whether actions should be executed during any changes to the
-- alarm state.
--
-- 'insufficientDataActions', 'metricAlarm_insufficientDataActions' - The actions to execute when this alarm transitions to the
-- @INSUFFICIENT_DATA@ state from any other state. Each action is specified
-- as an Amazon Resource Name (ARN).
--
-- 'stateReason', 'metricAlarm_stateReason' - An explanation for the alarm state, in text format.
--
-- 'stateReasonData', 'metricAlarm_stateReasonData' - An explanation for the alarm state, in JSON format.
--
-- 'dimensions', 'metricAlarm_dimensions' - The dimensions for the metric associated with the alarm.
--
-- 'alarmArn', 'metricAlarm_alarmArn' - The Amazon Resource Name (ARN) of the alarm.
--
-- 'alarmActions', 'metricAlarm_alarmActions' - The actions to execute when this alarm transitions to the @ALARM@ state
-- from any other state. Each action is specified as an Amazon Resource
-- Name (ARN).
--
-- 'unit', 'metricAlarm_unit' - The unit of the metric associated with the alarm.
--
-- 'statistic', 'metricAlarm_statistic' - The statistic for the metric associated with the alarm, other than
-- percentile. For percentile statistics, use @ExtendedStatistic@.
--
-- 'extendedStatistic', 'metricAlarm_extendedStatistic' - The percentile statistic for the metric associated with the alarm.
-- Specify a value between p0.0 and p100.
newMetricAlarm ::
  MetricAlarm
newMetricAlarm :: MetricAlarm
newMetricAlarm =
  MetricAlarm' :: Maybe Text
-> Maybe ISO8601
-> Maybe [MetricDataQuery]
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ComparisonOperator
-> Maybe [Text]
-> Maybe Text
-> Maybe StateValue
-> Maybe Natural
-> Maybe Double
-> Maybe ISO8601
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Dimension]
-> Maybe Text
-> Maybe [Text]
-> Maybe StandardUnit
-> Maybe Statistic
-> Maybe Text
-> MetricAlarm
MetricAlarm'
    { $sel:alarmName:MetricAlarm' :: Maybe Text
alarmName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stateUpdatedTimestamp:MetricAlarm' :: Maybe ISO8601
stateUpdatedTimestamp = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:metrics:MetricAlarm' :: Maybe [MetricDataQuery]
metrics = Maybe [MetricDataQuery]
forall a. Maybe a
Prelude.Nothing,
      $sel:treatMissingData:MetricAlarm' :: Maybe Text
treatMissingData = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:period:MetricAlarm' :: Maybe Natural
period = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:alarmDescription:MetricAlarm' :: Maybe Text
alarmDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:evaluationPeriods:MetricAlarm' :: Maybe Natural
evaluationPeriods = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:metricName:MetricAlarm' :: Maybe Text
metricName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:namespace:MetricAlarm' :: Maybe Text
namespace = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:thresholdMetricId:MetricAlarm' :: Maybe Text
thresholdMetricId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:comparisonOperator:MetricAlarm' :: Maybe ComparisonOperator
comparisonOperator = Maybe ComparisonOperator
forall a. Maybe a
Prelude.Nothing,
      $sel:oKActions:MetricAlarm' :: Maybe [Text]
oKActions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:evaluateLowSampleCountPercentile:MetricAlarm' :: Maybe Text
evaluateLowSampleCountPercentile = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stateValue:MetricAlarm' :: Maybe StateValue
stateValue = Maybe StateValue
forall a. Maybe a
Prelude.Nothing,
      $sel:datapointsToAlarm:MetricAlarm' :: Maybe Natural
datapointsToAlarm = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:threshold:MetricAlarm' :: Maybe Double
threshold = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:alarmConfigurationUpdatedTimestamp:MetricAlarm' :: Maybe ISO8601
alarmConfigurationUpdatedTimestamp = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:actionsEnabled:MetricAlarm' :: Maybe Bool
actionsEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:insufficientDataActions:MetricAlarm' :: Maybe [Text]
insufficientDataActions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:stateReason:MetricAlarm' :: Maybe Text
stateReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stateReasonData:MetricAlarm' :: Maybe Text
stateReasonData = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dimensions:MetricAlarm' :: Maybe [Dimension]
dimensions = Maybe [Dimension]
forall a. Maybe a
Prelude.Nothing,
      $sel:alarmArn:MetricAlarm' :: Maybe Text
alarmArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:alarmActions:MetricAlarm' :: Maybe [Text]
alarmActions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:unit:MetricAlarm' :: Maybe StandardUnit
unit = Maybe StandardUnit
forall a. Maybe a
Prelude.Nothing,
      $sel:statistic:MetricAlarm' :: Maybe Statistic
statistic = Maybe Statistic
forall a. Maybe a
Prelude.Nothing,
      $sel:extendedStatistic:MetricAlarm' :: Maybe Text
extendedStatistic = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the alarm.
metricAlarm_alarmName :: Lens.Lens' MetricAlarm (Prelude.Maybe Prelude.Text)
metricAlarm_alarmName :: (Maybe Text -> f (Maybe Text)) -> MetricAlarm -> f MetricAlarm
metricAlarm_alarmName = (MetricAlarm -> Maybe Text)
-> (MetricAlarm -> Maybe Text -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe Text
alarmName :: Maybe Text
$sel:alarmName:MetricAlarm' :: MetricAlarm -> Maybe Text
alarmName} -> Maybe Text
alarmName) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe Text
a -> MetricAlarm
s {$sel:alarmName:MetricAlarm' :: Maybe Text
alarmName = Maybe Text
a} :: MetricAlarm)

-- | The time stamp of the last update to the alarm state.
metricAlarm_stateUpdatedTimestamp :: Lens.Lens' MetricAlarm (Prelude.Maybe Prelude.UTCTime)
metricAlarm_stateUpdatedTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> MetricAlarm -> f MetricAlarm
metricAlarm_stateUpdatedTimestamp = (MetricAlarm -> Maybe ISO8601)
-> (MetricAlarm -> Maybe ISO8601 -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe ISO8601
stateUpdatedTimestamp :: Maybe ISO8601
$sel:stateUpdatedTimestamp:MetricAlarm' :: MetricAlarm -> Maybe ISO8601
stateUpdatedTimestamp} -> Maybe ISO8601
stateUpdatedTimestamp) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe ISO8601
a -> MetricAlarm
s {$sel:stateUpdatedTimestamp:MetricAlarm' :: Maybe ISO8601
stateUpdatedTimestamp = Maybe ISO8601
a} :: MetricAlarm) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> MetricAlarm -> f MetricAlarm)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> MetricAlarm
-> f MetricAlarm
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

-- | An array of MetricDataQuery structures, used in an alarm based on a
-- metric math expression. Each structure either retrieves a metric or
-- performs a math expression. One item in the Metrics array is the math
-- expression that the alarm watches. This expression by designated by
-- having @ReturnData@ set to true.
metricAlarm_metrics :: Lens.Lens' MetricAlarm (Prelude.Maybe [MetricDataQuery])
metricAlarm_metrics :: (Maybe [MetricDataQuery] -> f (Maybe [MetricDataQuery]))
-> MetricAlarm -> f MetricAlarm
metricAlarm_metrics = (MetricAlarm -> Maybe [MetricDataQuery])
-> (MetricAlarm -> Maybe [MetricDataQuery] -> MetricAlarm)
-> Lens
     MetricAlarm
     MetricAlarm
     (Maybe [MetricDataQuery])
     (Maybe [MetricDataQuery])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe [MetricDataQuery]
metrics :: Maybe [MetricDataQuery]
$sel:metrics:MetricAlarm' :: MetricAlarm -> Maybe [MetricDataQuery]
metrics} -> Maybe [MetricDataQuery]
metrics) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe [MetricDataQuery]
a -> MetricAlarm
s {$sel:metrics:MetricAlarm' :: Maybe [MetricDataQuery]
metrics = Maybe [MetricDataQuery]
a} :: MetricAlarm) ((Maybe [MetricDataQuery] -> f (Maybe [MetricDataQuery]))
 -> MetricAlarm -> f MetricAlarm)
-> ((Maybe [MetricDataQuery] -> f (Maybe [MetricDataQuery]))
    -> Maybe [MetricDataQuery] -> f (Maybe [MetricDataQuery]))
-> (Maybe [MetricDataQuery] -> f (Maybe [MetricDataQuery]))
-> MetricAlarm
-> f MetricAlarm
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MetricDataQuery]
  [MetricDataQuery]
  [MetricDataQuery]
  [MetricDataQuery]
-> Iso
     (Maybe [MetricDataQuery])
     (Maybe [MetricDataQuery])
     (Maybe [MetricDataQuery])
     (Maybe [MetricDataQuery])
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
  [MetricDataQuery]
  [MetricDataQuery]
  [MetricDataQuery]
  [MetricDataQuery]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Sets how this alarm is to handle missing data points. If this parameter
-- is omitted, the default behavior of @missing@ is used.
metricAlarm_treatMissingData :: Lens.Lens' MetricAlarm (Prelude.Maybe Prelude.Text)
metricAlarm_treatMissingData :: (Maybe Text -> f (Maybe Text)) -> MetricAlarm -> f MetricAlarm
metricAlarm_treatMissingData = (MetricAlarm -> Maybe Text)
-> (MetricAlarm -> Maybe Text -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe Text
treatMissingData :: Maybe Text
$sel:treatMissingData:MetricAlarm' :: MetricAlarm -> Maybe Text
treatMissingData} -> Maybe Text
treatMissingData) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe Text
a -> MetricAlarm
s {$sel:treatMissingData:MetricAlarm' :: Maybe Text
treatMissingData = Maybe Text
a} :: MetricAlarm)

-- | The period, in seconds, over which the statistic is applied.
metricAlarm_period :: Lens.Lens' MetricAlarm (Prelude.Maybe Prelude.Natural)
metricAlarm_period :: (Maybe Natural -> f (Maybe Natural))
-> MetricAlarm -> f MetricAlarm
metricAlarm_period = (MetricAlarm -> Maybe Natural)
-> (MetricAlarm -> Maybe Natural -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe Natural
period :: Maybe Natural
$sel:period:MetricAlarm' :: MetricAlarm -> Maybe Natural
period} -> Maybe Natural
period) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe Natural
a -> MetricAlarm
s {$sel:period:MetricAlarm' :: Maybe Natural
period = Maybe Natural
a} :: MetricAlarm)

-- | The description of the alarm.
metricAlarm_alarmDescription :: Lens.Lens' MetricAlarm (Prelude.Maybe Prelude.Text)
metricAlarm_alarmDescription :: (Maybe Text -> f (Maybe Text)) -> MetricAlarm -> f MetricAlarm
metricAlarm_alarmDescription = (MetricAlarm -> Maybe Text)
-> (MetricAlarm -> Maybe Text -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe Text
alarmDescription :: Maybe Text
$sel:alarmDescription:MetricAlarm' :: MetricAlarm -> Maybe Text
alarmDescription} -> Maybe Text
alarmDescription) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe Text
a -> MetricAlarm
s {$sel:alarmDescription:MetricAlarm' :: Maybe Text
alarmDescription = Maybe Text
a} :: MetricAlarm)

-- | The number of periods over which data is compared to the specified
-- threshold.
metricAlarm_evaluationPeriods :: Lens.Lens' MetricAlarm (Prelude.Maybe Prelude.Natural)
metricAlarm_evaluationPeriods :: (Maybe Natural -> f (Maybe Natural))
-> MetricAlarm -> f MetricAlarm
metricAlarm_evaluationPeriods = (MetricAlarm -> Maybe Natural)
-> (MetricAlarm -> Maybe Natural -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe Natural
evaluationPeriods :: Maybe Natural
$sel:evaluationPeriods:MetricAlarm' :: MetricAlarm -> Maybe Natural
evaluationPeriods} -> Maybe Natural
evaluationPeriods) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe Natural
a -> MetricAlarm
s {$sel:evaluationPeriods:MetricAlarm' :: Maybe Natural
evaluationPeriods = Maybe Natural
a} :: MetricAlarm)

-- | The name of the metric associated with the alarm, if this is an alarm
-- based on a single metric.
metricAlarm_metricName :: Lens.Lens' MetricAlarm (Prelude.Maybe Prelude.Text)
metricAlarm_metricName :: (Maybe Text -> f (Maybe Text)) -> MetricAlarm -> f MetricAlarm
metricAlarm_metricName = (MetricAlarm -> Maybe Text)
-> (MetricAlarm -> Maybe Text -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe Text
metricName :: Maybe Text
$sel:metricName:MetricAlarm' :: MetricAlarm -> Maybe Text
metricName} -> Maybe Text
metricName) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe Text
a -> MetricAlarm
s {$sel:metricName:MetricAlarm' :: Maybe Text
metricName = Maybe Text
a} :: MetricAlarm)

-- | The namespace of the metric associated with the alarm.
metricAlarm_namespace :: Lens.Lens' MetricAlarm (Prelude.Maybe Prelude.Text)
metricAlarm_namespace :: (Maybe Text -> f (Maybe Text)) -> MetricAlarm -> f MetricAlarm
metricAlarm_namespace = (MetricAlarm -> Maybe Text)
-> (MetricAlarm -> Maybe Text -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe Text
namespace :: Maybe Text
$sel:namespace:MetricAlarm' :: MetricAlarm -> Maybe Text
namespace} -> Maybe Text
namespace) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe Text
a -> MetricAlarm
s {$sel:namespace:MetricAlarm' :: Maybe Text
namespace = Maybe Text
a} :: MetricAlarm)

-- | In an alarm based on an anomaly detection model, this is the ID of the
-- @ANOMALY_DETECTION_BAND@ function used as the threshold for the alarm.
metricAlarm_thresholdMetricId :: Lens.Lens' MetricAlarm (Prelude.Maybe Prelude.Text)
metricAlarm_thresholdMetricId :: (Maybe Text -> f (Maybe Text)) -> MetricAlarm -> f MetricAlarm
metricAlarm_thresholdMetricId = (MetricAlarm -> Maybe Text)
-> (MetricAlarm -> Maybe Text -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe Text
thresholdMetricId :: Maybe Text
$sel:thresholdMetricId:MetricAlarm' :: MetricAlarm -> Maybe Text
thresholdMetricId} -> Maybe Text
thresholdMetricId) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe Text
a -> MetricAlarm
s {$sel:thresholdMetricId:MetricAlarm' :: Maybe Text
thresholdMetricId = Maybe Text
a} :: MetricAlarm)

-- | The arithmetic operation to use when comparing the specified statistic
-- and threshold. The specified statistic value is used as the first
-- operand.
metricAlarm_comparisonOperator :: Lens.Lens' MetricAlarm (Prelude.Maybe ComparisonOperator)
metricAlarm_comparisonOperator :: (Maybe ComparisonOperator -> f (Maybe ComparisonOperator))
-> MetricAlarm -> f MetricAlarm
metricAlarm_comparisonOperator = (MetricAlarm -> Maybe ComparisonOperator)
-> (MetricAlarm -> Maybe ComparisonOperator -> MetricAlarm)
-> Lens
     MetricAlarm
     MetricAlarm
     (Maybe ComparisonOperator)
     (Maybe ComparisonOperator)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe ComparisonOperator
comparisonOperator :: Maybe ComparisonOperator
$sel:comparisonOperator:MetricAlarm' :: MetricAlarm -> Maybe ComparisonOperator
comparisonOperator} -> Maybe ComparisonOperator
comparisonOperator) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe ComparisonOperator
a -> MetricAlarm
s {$sel:comparisonOperator:MetricAlarm' :: Maybe ComparisonOperator
comparisonOperator = Maybe ComparisonOperator
a} :: MetricAlarm)

-- | The actions to execute when this alarm transitions to the @OK@ state
-- from any other state. Each action is specified as an Amazon Resource
-- Name (ARN).
metricAlarm_oKActions :: Lens.Lens' MetricAlarm (Prelude.Maybe [Prelude.Text])
metricAlarm_oKActions :: (Maybe [Text] -> f (Maybe [Text])) -> MetricAlarm -> f MetricAlarm
metricAlarm_oKActions = (MetricAlarm -> Maybe [Text])
-> (MetricAlarm -> Maybe [Text] -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe [Text]
oKActions :: Maybe [Text]
$sel:oKActions:MetricAlarm' :: MetricAlarm -> Maybe [Text]
oKActions} -> Maybe [Text]
oKActions) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe [Text]
a -> MetricAlarm
s {$sel:oKActions:MetricAlarm' :: Maybe [Text]
oKActions = Maybe [Text]
a} :: MetricAlarm) ((Maybe [Text] -> f (Maybe [Text]))
 -> MetricAlarm -> f MetricAlarm)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> MetricAlarm
-> f MetricAlarm
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Used only for alarms based on percentiles. If @ignore@, the alarm state
-- does not change during periods with too few data points to be
-- statistically significant. If @evaluate@ or this parameter is not used,
-- the alarm is always evaluated and possibly changes state no matter how
-- many data points are available.
metricAlarm_evaluateLowSampleCountPercentile :: Lens.Lens' MetricAlarm (Prelude.Maybe Prelude.Text)
metricAlarm_evaluateLowSampleCountPercentile :: (Maybe Text -> f (Maybe Text)) -> MetricAlarm -> f MetricAlarm
metricAlarm_evaluateLowSampleCountPercentile = (MetricAlarm -> Maybe Text)
-> (MetricAlarm -> Maybe Text -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe Text
evaluateLowSampleCountPercentile :: Maybe Text
$sel:evaluateLowSampleCountPercentile:MetricAlarm' :: MetricAlarm -> Maybe Text
evaluateLowSampleCountPercentile} -> Maybe Text
evaluateLowSampleCountPercentile) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe Text
a -> MetricAlarm
s {$sel:evaluateLowSampleCountPercentile:MetricAlarm' :: Maybe Text
evaluateLowSampleCountPercentile = Maybe Text
a} :: MetricAlarm)

-- | The state value for the alarm.
metricAlarm_stateValue :: Lens.Lens' MetricAlarm (Prelude.Maybe StateValue)
metricAlarm_stateValue :: (Maybe StateValue -> f (Maybe StateValue))
-> MetricAlarm -> f MetricAlarm
metricAlarm_stateValue = (MetricAlarm -> Maybe StateValue)
-> (MetricAlarm -> Maybe StateValue -> MetricAlarm)
-> Lens
     MetricAlarm MetricAlarm (Maybe StateValue) (Maybe StateValue)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe StateValue
stateValue :: Maybe StateValue
$sel:stateValue:MetricAlarm' :: MetricAlarm -> Maybe StateValue
stateValue} -> Maybe StateValue
stateValue) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe StateValue
a -> MetricAlarm
s {$sel:stateValue:MetricAlarm' :: Maybe StateValue
stateValue = Maybe StateValue
a} :: MetricAlarm)

-- | The number of data points that must be breaching to trigger the alarm.
metricAlarm_datapointsToAlarm :: Lens.Lens' MetricAlarm (Prelude.Maybe Prelude.Natural)
metricAlarm_datapointsToAlarm :: (Maybe Natural -> f (Maybe Natural))
-> MetricAlarm -> f MetricAlarm
metricAlarm_datapointsToAlarm = (MetricAlarm -> Maybe Natural)
-> (MetricAlarm -> Maybe Natural -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe Natural
datapointsToAlarm :: Maybe Natural
$sel:datapointsToAlarm:MetricAlarm' :: MetricAlarm -> Maybe Natural
datapointsToAlarm} -> Maybe Natural
datapointsToAlarm) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe Natural
a -> MetricAlarm
s {$sel:datapointsToAlarm:MetricAlarm' :: Maybe Natural
datapointsToAlarm = Maybe Natural
a} :: MetricAlarm)

-- | The value to compare with the specified statistic.
metricAlarm_threshold :: Lens.Lens' MetricAlarm (Prelude.Maybe Prelude.Double)
metricAlarm_threshold :: (Maybe Double -> f (Maybe Double)) -> MetricAlarm -> f MetricAlarm
metricAlarm_threshold = (MetricAlarm -> Maybe Double)
-> (MetricAlarm -> Maybe Double -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe Double
threshold :: Maybe Double
$sel:threshold:MetricAlarm' :: MetricAlarm -> Maybe Double
threshold} -> Maybe Double
threshold) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe Double
a -> MetricAlarm
s {$sel:threshold:MetricAlarm' :: Maybe Double
threshold = Maybe Double
a} :: MetricAlarm)

-- | The time stamp of the last update to the alarm configuration.
metricAlarm_alarmConfigurationUpdatedTimestamp :: Lens.Lens' MetricAlarm (Prelude.Maybe Prelude.UTCTime)
metricAlarm_alarmConfigurationUpdatedTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> MetricAlarm -> f MetricAlarm
metricAlarm_alarmConfigurationUpdatedTimestamp = (MetricAlarm -> Maybe ISO8601)
-> (MetricAlarm -> Maybe ISO8601 -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe ISO8601
alarmConfigurationUpdatedTimestamp :: Maybe ISO8601
$sel:alarmConfigurationUpdatedTimestamp:MetricAlarm' :: MetricAlarm -> Maybe ISO8601
alarmConfigurationUpdatedTimestamp} -> Maybe ISO8601
alarmConfigurationUpdatedTimestamp) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe ISO8601
a -> MetricAlarm
s {$sel:alarmConfigurationUpdatedTimestamp:MetricAlarm' :: Maybe ISO8601
alarmConfigurationUpdatedTimestamp = Maybe ISO8601
a} :: MetricAlarm) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> MetricAlarm -> f MetricAlarm)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> MetricAlarm
-> f MetricAlarm
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

-- | Indicates whether actions should be executed during any changes to the
-- alarm state.
metricAlarm_actionsEnabled :: Lens.Lens' MetricAlarm (Prelude.Maybe Prelude.Bool)
metricAlarm_actionsEnabled :: (Maybe Bool -> f (Maybe Bool)) -> MetricAlarm -> f MetricAlarm
metricAlarm_actionsEnabled = (MetricAlarm -> Maybe Bool)
-> (MetricAlarm -> Maybe Bool -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe Bool
actionsEnabled :: Maybe Bool
$sel:actionsEnabled:MetricAlarm' :: MetricAlarm -> Maybe Bool
actionsEnabled} -> Maybe Bool
actionsEnabled) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe Bool
a -> MetricAlarm
s {$sel:actionsEnabled:MetricAlarm' :: Maybe Bool
actionsEnabled = Maybe Bool
a} :: MetricAlarm)

-- | The actions to execute when this alarm transitions to the
-- @INSUFFICIENT_DATA@ state from any other state. Each action is specified
-- as an Amazon Resource Name (ARN).
metricAlarm_insufficientDataActions :: Lens.Lens' MetricAlarm (Prelude.Maybe [Prelude.Text])
metricAlarm_insufficientDataActions :: (Maybe [Text] -> f (Maybe [Text])) -> MetricAlarm -> f MetricAlarm
metricAlarm_insufficientDataActions = (MetricAlarm -> Maybe [Text])
-> (MetricAlarm -> Maybe [Text] -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe [Text]
insufficientDataActions :: Maybe [Text]
$sel:insufficientDataActions:MetricAlarm' :: MetricAlarm -> Maybe [Text]
insufficientDataActions} -> Maybe [Text]
insufficientDataActions) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe [Text]
a -> MetricAlarm
s {$sel:insufficientDataActions:MetricAlarm' :: Maybe [Text]
insufficientDataActions = Maybe [Text]
a} :: MetricAlarm) ((Maybe [Text] -> f (Maybe [Text]))
 -> MetricAlarm -> f MetricAlarm)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> MetricAlarm
-> f MetricAlarm
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An explanation for the alarm state, in text format.
metricAlarm_stateReason :: Lens.Lens' MetricAlarm (Prelude.Maybe Prelude.Text)
metricAlarm_stateReason :: (Maybe Text -> f (Maybe Text)) -> MetricAlarm -> f MetricAlarm
metricAlarm_stateReason = (MetricAlarm -> Maybe Text)
-> (MetricAlarm -> Maybe Text -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe Text
stateReason :: Maybe Text
$sel:stateReason:MetricAlarm' :: MetricAlarm -> Maybe Text
stateReason} -> Maybe Text
stateReason) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe Text
a -> MetricAlarm
s {$sel:stateReason:MetricAlarm' :: Maybe Text
stateReason = Maybe Text
a} :: MetricAlarm)

-- | An explanation for the alarm state, in JSON format.
metricAlarm_stateReasonData :: Lens.Lens' MetricAlarm (Prelude.Maybe Prelude.Text)
metricAlarm_stateReasonData :: (Maybe Text -> f (Maybe Text)) -> MetricAlarm -> f MetricAlarm
metricAlarm_stateReasonData = (MetricAlarm -> Maybe Text)
-> (MetricAlarm -> Maybe Text -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe Text
stateReasonData :: Maybe Text
$sel:stateReasonData:MetricAlarm' :: MetricAlarm -> Maybe Text
stateReasonData} -> Maybe Text
stateReasonData) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe Text
a -> MetricAlarm
s {$sel:stateReasonData:MetricAlarm' :: Maybe Text
stateReasonData = Maybe Text
a} :: MetricAlarm)

-- | The dimensions for the metric associated with the alarm.
metricAlarm_dimensions :: Lens.Lens' MetricAlarm (Prelude.Maybe [Dimension])
metricAlarm_dimensions :: (Maybe [Dimension] -> f (Maybe [Dimension]))
-> MetricAlarm -> f MetricAlarm
metricAlarm_dimensions = (MetricAlarm -> Maybe [Dimension])
-> (MetricAlarm -> Maybe [Dimension] -> MetricAlarm)
-> Lens
     MetricAlarm MetricAlarm (Maybe [Dimension]) (Maybe [Dimension])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe [Dimension]
dimensions :: Maybe [Dimension]
$sel:dimensions:MetricAlarm' :: MetricAlarm -> Maybe [Dimension]
dimensions} -> Maybe [Dimension]
dimensions) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe [Dimension]
a -> MetricAlarm
s {$sel:dimensions:MetricAlarm' :: Maybe [Dimension]
dimensions = Maybe [Dimension]
a} :: MetricAlarm) ((Maybe [Dimension] -> f (Maybe [Dimension]))
 -> MetricAlarm -> f MetricAlarm)
-> ((Maybe [Dimension] -> f (Maybe [Dimension]))
    -> Maybe [Dimension] -> f (Maybe [Dimension]))
-> (Maybe [Dimension] -> f (Maybe [Dimension]))
-> MetricAlarm
-> f MetricAlarm
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Dimension] [Dimension] [Dimension] [Dimension]
-> Iso
     (Maybe [Dimension])
     (Maybe [Dimension])
     (Maybe [Dimension])
     (Maybe [Dimension])
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 [Dimension] [Dimension] [Dimension] [Dimension]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the alarm.
metricAlarm_alarmArn :: Lens.Lens' MetricAlarm (Prelude.Maybe Prelude.Text)
metricAlarm_alarmArn :: (Maybe Text -> f (Maybe Text)) -> MetricAlarm -> f MetricAlarm
metricAlarm_alarmArn = (MetricAlarm -> Maybe Text)
-> (MetricAlarm -> Maybe Text -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe Text
alarmArn :: Maybe Text
$sel:alarmArn:MetricAlarm' :: MetricAlarm -> Maybe Text
alarmArn} -> Maybe Text
alarmArn) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe Text
a -> MetricAlarm
s {$sel:alarmArn:MetricAlarm' :: Maybe Text
alarmArn = Maybe Text
a} :: MetricAlarm)

-- | The actions to execute when this alarm transitions to the @ALARM@ state
-- from any other state. Each action is specified as an Amazon Resource
-- Name (ARN).
metricAlarm_alarmActions :: Lens.Lens' MetricAlarm (Prelude.Maybe [Prelude.Text])
metricAlarm_alarmActions :: (Maybe [Text] -> f (Maybe [Text])) -> MetricAlarm -> f MetricAlarm
metricAlarm_alarmActions = (MetricAlarm -> Maybe [Text])
-> (MetricAlarm -> Maybe [Text] -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe [Text]
alarmActions :: Maybe [Text]
$sel:alarmActions:MetricAlarm' :: MetricAlarm -> Maybe [Text]
alarmActions} -> Maybe [Text]
alarmActions) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe [Text]
a -> MetricAlarm
s {$sel:alarmActions:MetricAlarm' :: Maybe [Text]
alarmActions = Maybe [Text]
a} :: MetricAlarm) ((Maybe [Text] -> f (Maybe [Text]))
 -> MetricAlarm -> f MetricAlarm)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> MetricAlarm
-> f MetricAlarm
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The unit of the metric associated with the alarm.
metricAlarm_unit :: Lens.Lens' MetricAlarm (Prelude.Maybe StandardUnit)
metricAlarm_unit :: (Maybe StandardUnit -> f (Maybe StandardUnit))
-> MetricAlarm -> f MetricAlarm
metricAlarm_unit = (MetricAlarm -> Maybe StandardUnit)
-> (MetricAlarm -> Maybe StandardUnit -> MetricAlarm)
-> Lens
     MetricAlarm MetricAlarm (Maybe StandardUnit) (Maybe StandardUnit)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe StandardUnit
unit :: Maybe StandardUnit
$sel:unit:MetricAlarm' :: MetricAlarm -> Maybe StandardUnit
unit} -> Maybe StandardUnit
unit) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe StandardUnit
a -> MetricAlarm
s {$sel:unit:MetricAlarm' :: Maybe StandardUnit
unit = Maybe StandardUnit
a} :: MetricAlarm)

-- | The statistic for the metric associated with the alarm, other than
-- percentile. For percentile statistics, use @ExtendedStatistic@.
metricAlarm_statistic :: Lens.Lens' MetricAlarm (Prelude.Maybe Statistic)
metricAlarm_statistic :: (Maybe Statistic -> f (Maybe Statistic))
-> MetricAlarm -> f MetricAlarm
metricAlarm_statistic = (MetricAlarm -> Maybe Statistic)
-> (MetricAlarm -> Maybe Statistic -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe Statistic) (Maybe Statistic)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe Statistic
statistic :: Maybe Statistic
$sel:statistic:MetricAlarm' :: MetricAlarm -> Maybe Statistic
statistic} -> Maybe Statistic
statistic) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe Statistic
a -> MetricAlarm
s {$sel:statistic:MetricAlarm' :: Maybe Statistic
statistic = Maybe Statistic
a} :: MetricAlarm)

-- | The percentile statistic for the metric associated with the alarm.
-- Specify a value between p0.0 and p100.
metricAlarm_extendedStatistic :: Lens.Lens' MetricAlarm (Prelude.Maybe Prelude.Text)
metricAlarm_extendedStatistic :: (Maybe Text -> f (Maybe Text)) -> MetricAlarm -> f MetricAlarm
metricAlarm_extendedStatistic = (MetricAlarm -> Maybe Text)
-> (MetricAlarm -> Maybe Text -> MetricAlarm)
-> Lens MetricAlarm MetricAlarm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricAlarm' {Maybe Text
extendedStatistic :: Maybe Text
$sel:extendedStatistic:MetricAlarm' :: MetricAlarm -> Maybe Text
extendedStatistic} -> Maybe Text
extendedStatistic) (\s :: MetricAlarm
s@MetricAlarm' {} Maybe Text
a -> MetricAlarm
s {$sel:extendedStatistic:MetricAlarm' :: Maybe Text
extendedStatistic = Maybe Text
a} :: MetricAlarm)

instance Core.FromXML MetricAlarm where
  parseXML :: [Node] -> Either String MetricAlarm
parseXML [Node]
x =
    Maybe Text
-> Maybe ISO8601
-> Maybe [MetricDataQuery]
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ComparisonOperator
-> Maybe [Text]
-> Maybe Text
-> Maybe StateValue
-> Maybe Natural
-> Maybe Double
-> Maybe ISO8601
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Dimension]
-> Maybe Text
-> Maybe [Text]
-> Maybe StandardUnit
-> Maybe Statistic
-> Maybe Text
-> MetricAlarm
MetricAlarm'
      (Maybe Text
 -> Maybe ISO8601
 -> Maybe [MetricDataQuery]
 -> Maybe Text
 -> Maybe Natural
 -> Maybe Text
 -> Maybe Natural
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe ComparisonOperator
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe StateValue
 -> Maybe Natural
 -> Maybe Double
 -> Maybe ISO8601
 -> Maybe Bool
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Dimension]
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe StandardUnit
 -> Maybe Statistic
 -> Maybe Text
 -> MetricAlarm)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ISO8601
      -> Maybe [MetricDataQuery]
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ComparisonOperator
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe StateValue
      -> Maybe Natural
      -> Maybe Double
      -> Maybe ISO8601
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
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 ISO8601
   -> Maybe [MetricDataQuery]
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ComparisonOperator
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe StateValue
   -> Maybe Natural
   -> Maybe Double
   -> Maybe ISO8601
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe [MetricDataQuery]
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ComparisonOperator
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe StateValue
      -> Maybe Natural
      -> Maybe Double
      -> Maybe ISO8601
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
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
"StateUpdatedTimestamp")
      Either
  String
  (Maybe [MetricDataQuery]
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ComparisonOperator
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe StateValue
   -> Maybe Natural
   -> Maybe Double
   -> Maybe ISO8601
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe [MetricDataQuery])
-> Either
     String
     (Maybe Text
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ComparisonOperator
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe StateValue
      -> Maybe Natural
      -> Maybe Double
      -> Maybe ISO8601
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Metrics" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [MetricDataQuery]))
-> Either String (Maybe [MetricDataQuery])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [MetricDataQuery])
-> [Node] -> Either String (Maybe [MetricDataQuery])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [MetricDataQuery]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )
      Either
  String
  (Maybe Text
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ComparisonOperator
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe StateValue
   -> Maybe Natural
   -> Maybe Double
   -> Maybe ISO8601
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Natural
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ComparisonOperator
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe StateValue
      -> Maybe Natural
      -> Maybe Double
      -> Maybe ISO8601
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
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
"TreatMissingData")
      Either
  String
  (Maybe Natural
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ComparisonOperator
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe StateValue
   -> Maybe Natural
   -> Maybe Double
   -> Maybe ISO8601
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Text
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ComparisonOperator
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe StateValue
      -> Maybe Natural
      -> Maybe Double
      -> Maybe ISO8601
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Period")
      Either
  String
  (Maybe Text
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ComparisonOperator
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe StateValue
   -> Maybe Natural
   -> Maybe Double
   -> Maybe ISO8601
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ComparisonOperator
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe StateValue
      -> Maybe Natural
      -> Maybe Double
      -> Maybe ISO8601
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
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
"AlarmDescription")
      Either
  String
  (Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ComparisonOperator
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe StateValue
   -> Maybe Natural
   -> Maybe Double
   -> Maybe ISO8601
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ComparisonOperator
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe StateValue
      -> Maybe Natural
      -> Maybe Double
      -> Maybe ISO8601
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"EvaluationPeriods")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ComparisonOperator
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe StateValue
   -> Maybe Natural
   -> Maybe Double
   -> Maybe ISO8601
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe ComparisonOperator
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe StateValue
      -> Maybe Natural
      -> Maybe Double
      -> Maybe ISO8601
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
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
"MetricName")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe ComparisonOperator
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe StateValue
   -> Maybe Natural
   -> Maybe Double
   -> Maybe ISO8601
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe ComparisonOperator
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe StateValue
      -> Maybe Natural
      -> Maybe Double
      -> Maybe ISO8601
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
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
"Namespace")
      Either
  String
  (Maybe Text
   -> Maybe ComparisonOperator
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe StateValue
   -> Maybe Natural
   -> Maybe Double
   -> Maybe ISO8601
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ComparisonOperator
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe StateValue
      -> Maybe Natural
      -> Maybe Double
      -> Maybe ISO8601
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
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
"ThresholdMetricId")
      Either
  String
  (Maybe ComparisonOperator
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe StateValue
   -> Maybe Natural
   -> Maybe Double
   -> Maybe ISO8601
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe ComparisonOperator)
-> Either
     String
     (Maybe [Text]
      -> Maybe Text
      -> Maybe StateValue
      -> Maybe Natural
      -> Maybe Double
      -> Maybe ISO8601
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ComparisonOperator)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ComparisonOperator")
      Either
  String
  (Maybe [Text]
   -> Maybe Text
   -> Maybe StateValue
   -> Maybe Natural
   -> Maybe Double
   -> Maybe ISO8601
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Text
      -> Maybe StateValue
      -> Maybe Natural
      -> Maybe Double
      -> Maybe ISO8601
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"OKActions" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )
      Either
  String
  (Maybe Text
   -> Maybe StateValue
   -> Maybe Natural
   -> Maybe Double
   -> Maybe ISO8601
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe StateValue
      -> Maybe Natural
      -> Maybe Double
      -> Maybe ISO8601
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
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
"EvaluateLowSampleCountPercentile")
      Either
  String
  (Maybe StateValue
   -> Maybe Natural
   -> Maybe Double
   -> Maybe ISO8601
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe StateValue)
-> Either
     String
     (Maybe Natural
      -> Maybe Double
      -> Maybe ISO8601
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe StateValue)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"StateValue")
      Either
  String
  (Maybe Natural
   -> Maybe Double
   -> Maybe ISO8601
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Double
      -> Maybe ISO8601
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DatapointsToAlarm")
      Either
  String
  (Maybe Double
   -> Maybe ISO8601
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe Double)
-> Either
     String
     (Maybe ISO8601
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Threshold")
      Either
  String
  (Maybe ISO8601
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe Bool
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
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
"AlarmConfigurationUpdatedTimestamp")
      Either
  String
  (Maybe Bool
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ActionsEnabled")
      Either
  String
  (Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"InsufficientDataActions"
                      Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
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
"StateReason")
      Either
  String
  (Maybe Text
   -> Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Dimension]
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
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
"StateReasonData")
      Either
  String
  (Maybe [Dimension]
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe [Dimension])
-> Either
     String
     (Maybe Text
      -> Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Dimensions" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [Dimension]))
-> Either String (Maybe [Dimension])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Dimension])
-> [Node] -> Either String (Maybe [Dimension])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Dimension]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )
      Either
  String
  (Maybe Text
   -> Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Text]
      -> Maybe StandardUnit
      -> Maybe Statistic
      -> Maybe Text
      -> MetricAlarm)
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
"AlarmArn")
      Either
  String
  (Maybe [Text]
   -> Maybe StandardUnit
   -> Maybe Statistic
   -> Maybe Text
   -> MetricAlarm)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe StandardUnit
      -> Maybe Statistic -> Maybe Text -> MetricAlarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AlarmActions" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )
      Either
  String
  (Maybe StandardUnit
   -> Maybe Statistic -> Maybe Text -> MetricAlarm)
-> Either String (Maybe StandardUnit)
-> Either String (Maybe Statistic -> Maybe Text -> MetricAlarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe StandardUnit)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Unit")
      Either String (Maybe Statistic -> Maybe Text -> MetricAlarm)
-> Either String (Maybe Statistic)
-> Either String (Maybe Text -> MetricAlarm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Statistic)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Statistic")
      Either String (Maybe Text -> MetricAlarm)
-> Either String (Maybe Text) -> Either String MetricAlarm
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
"ExtendedStatistic")

instance Prelude.Hashable MetricAlarm

instance Prelude.NFData MetricAlarm