{-# 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.Route53.Types.CloudWatchAlarmConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53.Internal
import Amazonka.Route53.Types.ComparisonOperator
import Amazonka.Route53.Types.Dimension
import Amazonka.Route53.Types.Statistic
data CloudWatchAlarmConfiguration = CloudWatchAlarmConfiguration'
{
CloudWatchAlarmConfiguration -> Maybe [Dimension]
dimensions :: Prelude.Maybe [Dimension],
CloudWatchAlarmConfiguration -> Natural
evaluationPeriods :: Prelude.Natural,
CloudWatchAlarmConfiguration -> Double
threshold :: Prelude.Double,
CloudWatchAlarmConfiguration -> ComparisonOperator
comparisonOperator :: ComparisonOperator,
CloudWatchAlarmConfiguration -> Natural
period :: Prelude.Natural,
CloudWatchAlarmConfiguration -> Text
metricName :: Prelude.Text,
CloudWatchAlarmConfiguration -> Text
namespace :: Prelude.Text,
CloudWatchAlarmConfiguration -> Statistic
statistic :: Statistic
}
deriving (CloudWatchAlarmConfiguration
-> CloudWatchAlarmConfiguration -> Bool
(CloudWatchAlarmConfiguration
-> CloudWatchAlarmConfiguration -> Bool)
-> (CloudWatchAlarmConfiguration
-> CloudWatchAlarmConfiguration -> Bool)
-> Eq CloudWatchAlarmConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CloudWatchAlarmConfiguration
-> CloudWatchAlarmConfiguration -> Bool
$c/= :: CloudWatchAlarmConfiguration
-> CloudWatchAlarmConfiguration -> Bool
== :: CloudWatchAlarmConfiguration
-> CloudWatchAlarmConfiguration -> Bool
$c== :: CloudWatchAlarmConfiguration
-> CloudWatchAlarmConfiguration -> Bool
Prelude.Eq, ReadPrec [CloudWatchAlarmConfiguration]
ReadPrec CloudWatchAlarmConfiguration
Int -> ReadS CloudWatchAlarmConfiguration
ReadS [CloudWatchAlarmConfiguration]
(Int -> ReadS CloudWatchAlarmConfiguration)
-> ReadS [CloudWatchAlarmConfiguration]
-> ReadPrec CloudWatchAlarmConfiguration
-> ReadPrec [CloudWatchAlarmConfiguration]
-> Read CloudWatchAlarmConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CloudWatchAlarmConfiguration]
$creadListPrec :: ReadPrec [CloudWatchAlarmConfiguration]
readPrec :: ReadPrec CloudWatchAlarmConfiguration
$creadPrec :: ReadPrec CloudWatchAlarmConfiguration
readList :: ReadS [CloudWatchAlarmConfiguration]
$creadList :: ReadS [CloudWatchAlarmConfiguration]
readsPrec :: Int -> ReadS CloudWatchAlarmConfiguration
$creadsPrec :: Int -> ReadS CloudWatchAlarmConfiguration
Prelude.Read, Int -> CloudWatchAlarmConfiguration -> ShowS
[CloudWatchAlarmConfiguration] -> ShowS
CloudWatchAlarmConfiguration -> String
(Int -> CloudWatchAlarmConfiguration -> ShowS)
-> (CloudWatchAlarmConfiguration -> String)
-> ([CloudWatchAlarmConfiguration] -> ShowS)
-> Show CloudWatchAlarmConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CloudWatchAlarmConfiguration] -> ShowS
$cshowList :: [CloudWatchAlarmConfiguration] -> ShowS
show :: CloudWatchAlarmConfiguration -> String
$cshow :: CloudWatchAlarmConfiguration -> String
showsPrec :: Int -> CloudWatchAlarmConfiguration -> ShowS
$cshowsPrec :: Int -> CloudWatchAlarmConfiguration -> ShowS
Prelude.Show, (forall x.
CloudWatchAlarmConfiguration -> Rep CloudWatchAlarmConfiguration x)
-> (forall x.
Rep CloudWatchAlarmConfiguration x -> CloudWatchAlarmConfiguration)
-> Generic CloudWatchAlarmConfiguration
forall x.
Rep CloudWatchAlarmConfiguration x -> CloudWatchAlarmConfiguration
forall x.
CloudWatchAlarmConfiguration -> Rep CloudWatchAlarmConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CloudWatchAlarmConfiguration x -> CloudWatchAlarmConfiguration
$cfrom :: forall x.
CloudWatchAlarmConfiguration -> Rep CloudWatchAlarmConfiguration x
Prelude.Generic)
newCloudWatchAlarmConfiguration ::
Prelude.Natural ->
Prelude.Double ->
ComparisonOperator ->
Prelude.Natural ->
Prelude.Text ->
Prelude.Text ->
Statistic ->
CloudWatchAlarmConfiguration
newCloudWatchAlarmConfiguration :: Natural
-> Double
-> ComparisonOperator
-> Natural
-> Text
-> Text
-> Statistic
-> CloudWatchAlarmConfiguration
newCloudWatchAlarmConfiguration
Natural
pEvaluationPeriods_
Double
pThreshold_
ComparisonOperator
pComparisonOperator_
Natural
pPeriod_
Text
pMetricName_
Text
pNamespace_
Statistic
pStatistic_ =
CloudWatchAlarmConfiguration' :: Maybe [Dimension]
-> Natural
-> Double
-> ComparisonOperator
-> Natural
-> Text
-> Text
-> Statistic
-> CloudWatchAlarmConfiguration
CloudWatchAlarmConfiguration'
{ $sel:dimensions:CloudWatchAlarmConfiguration' :: Maybe [Dimension]
dimensions =
Maybe [Dimension]
forall a. Maybe a
Prelude.Nothing,
$sel:evaluationPeriods:CloudWatchAlarmConfiguration' :: Natural
evaluationPeriods = Natural
pEvaluationPeriods_,
$sel:threshold:CloudWatchAlarmConfiguration' :: Double
threshold = Double
pThreshold_,
$sel:comparisonOperator:CloudWatchAlarmConfiguration' :: ComparisonOperator
comparisonOperator = ComparisonOperator
pComparisonOperator_,
$sel:period:CloudWatchAlarmConfiguration' :: Natural
period = Natural
pPeriod_,
$sel:metricName:CloudWatchAlarmConfiguration' :: Text
metricName = Text
pMetricName_,
$sel:namespace:CloudWatchAlarmConfiguration' :: Text
namespace = Text
pNamespace_,
$sel:statistic:CloudWatchAlarmConfiguration' :: Statistic
statistic = Statistic
pStatistic_
}
cloudWatchAlarmConfiguration_dimensions :: Lens.Lens' CloudWatchAlarmConfiguration (Prelude.Maybe [Dimension])
cloudWatchAlarmConfiguration_dimensions :: (Maybe [Dimension] -> f (Maybe [Dimension]))
-> CloudWatchAlarmConfiguration -> f CloudWatchAlarmConfiguration
cloudWatchAlarmConfiguration_dimensions = (CloudWatchAlarmConfiguration -> Maybe [Dimension])
-> (CloudWatchAlarmConfiguration
-> Maybe [Dimension] -> CloudWatchAlarmConfiguration)
-> Lens
CloudWatchAlarmConfiguration
CloudWatchAlarmConfiguration
(Maybe [Dimension])
(Maybe [Dimension])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchAlarmConfiguration' {Maybe [Dimension]
dimensions :: Maybe [Dimension]
$sel:dimensions:CloudWatchAlarmConfiguration' :: CloudWatchAlarmConfiguration -> Maybe [Dimension]
dimensions} -> Maybe [Dimension]
dimensions) (\s :: CloudWatchAlarmConfiguration
s@CloudWatchAlarmConfiguration' {} Maybe [Dimension]
a -> CloudWatchAlarmConfiguration
s {$sel:dimensions:CloudWatchAlarmConfiguration' :: Maybe [Dimension]
dimensions = Maybe [Dimension]
a} :: CloudWatchAlarmConfiguration) ((Maybe [Dimension] -> f (Maybe [Dimension]))
-> CloudWatchAlarmConfiguration -> f CloudWatchAlarmConfiguration)
-> ((Maybe [Dimension] -> f (Maybe [Dimension]))
-> Maybe [Dimension] -> f (Maybe [Dimension]))
-> (Maybe [Dimension] -> f (Maybe [Dimension]))
-> CloudWatchAlarmConfiguration
-> f CloudWatchAlarmConfiguration
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
cloudWatchAlarmConfiguration_evaluationPeriods :: Lens.Lens' CloudWatchAlarmConfiguration Prelude.Natural
cloudWatchAlarmConfiguration_evaluationPeriods :: (Natural -> f Natural)
-> CloudWatchAlarmConfiguration -> f CloudWatchAlarmConfiguration
cloudWatchAlarmConfiguration_evaluationPeriods = (CloudWatchAlarmConfiguration -> Natural)
-> (CloudWatchAlarmConfiguration
-> Natural -> CloudWatchAlarmConfiguration)
-> Lens
CloudWatchAlarmConfiguration
CloudWatchAlarmConfiguration
Natural
Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchAlarmConfiguration' {Natural
evaluationPeriods :: Natural
$sel:evaluationPeriods:CloudWatchAlarmConfiguration' :: CloudWatchAlarmConfiguration -> Natural
evaluationPeriods} -> Natural
evaluationPeriods) (\s :: CloudWatchAlarmConfiguration
s@CloudWatchAlarmConfiguration' {} Natural
a -> CloudWatchAlarmConfiguration
s {$sel:evaluationPeriods:CloudWatchAlarmConfiguration' :: Natural
evaluationPeriods = Natural
a} :: CloudWatchAlarmConfiguration)
cloudWatchAlarmConfiguration_threshold :: Lens.Lens' CloudWatchAlarmConfiguration Prelude.Double
cloudWatchAlarmConfiguration_threshold :: (Double -> f Double)
-> CloudWatchAlarmConfiguration -> f CloudWatchAlarmConfiguration
cloudWatchAlarmConfiguration_threshold = (CloudWatchAlarmConfiguration -> Double)
-> (CloudWatchAlarmConfiguration
-> Double -> CloudWatchAlarmConfiguration)
-> Lens
CloudWatchAlarmConfiguration
CloudWatchAlarmConfiguration
Double
Double
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchAlarmConfiguration' {Double
threshold :: Double
$sel:threshold:CloudWatchAlarmConfiguration' :: CloudWatchAlarmConfiguration -> Double
threshold} -> Double
threshold) (\s :: CloudWatchAlarmConfiguration
s@CloudWatchAlarmConfiguration' {} Double
a -> CloudWatchAlarmConfiguration
s {$sel:threshold:CloudWatchAlarmConfiguration' :: Double
threshold = Double
a} :: CloudWatchAlarmConfiguration)
cloudWatchAlarmConfiguration_comparisonOperator :: Lens.Lens' CloudWatchAlarmConfiguration ComparisonOperator
cloudWatchAlarmConfiguration_comparisonOperator :: (ComparisonOperator -> f ComparisonOperator)
-> CloudWatchAlarmConfiguration -> f CloudWatchAlarmConfiguration
cloudWatchAlarmConfiguration_comparisonOperator = (CloudWatchAlarmConfiguration -> ComparisonOperator)
-> (CloudWatchAlarmConfiguration
-> ComparisonOperator -> CloudWatchAlarmConfiguration)
-> Lens
CloudWatchAlarmConfiguration
CloudWatchAlarmConfiguration
ComparisonOperator
ComparisonOperator
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchAlarmConfiguration' {ComparisonOperator
comparisonOperator :: ComparisonOperator
$sel:comparisonOperator:CloudWatchAlarmConfiguration' :: CloudWatchAlarmConfiguration -> ComparisonOperator
comparisonOperator} -> ComparisonOperator
comparisonOperator) (\s :: CloudWatchAlarmConfiguration
s@CloudWatchAlarmConfiguration' {} ComparisonOperator
a -> CloudWatchAlarmConfiguration
s {$sel:comparisonOperator:CloudWatchAlarmConfiguration' :: ComparisonOperator
comparisonOperator = ComparisonOperator
a} :: CloudWatchAlarmConfiguration)
cloudWatchAlarmConfiguration_period :: Lens.Lens' CloudWatchAlarmConfiguration Prelude.Natural
cloudWatchAlarmConfiguration_period :: (Natural -> f Natural)
-> CloudWatchAlarmConfiguration -> f CloudWatchAlarmConfiguration
cloudWatchAlarmConfiguration_period = (CloudWatchAlarmConfiguration -> Natural)
-> (CloudWatchAlarmConfiguration
-> Natural -> CloudWatchAlarmConfiguration)
-> Lens
CloudWatchAlarmConfiguration
CloudWatchAlarmConfiguration
Natural
Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchAlarmConfiguration' {Natural
period :: Natural
$sel:period:CloudWatchAlarmConfiguration' :: CloudWatchAlarmConfiguration -> Natural
period} -> Natural
period) (\s :: CloudWatchAlarmConfiguration
s@CloudWatchAlarmConfiguration' {} Natural
a -> CloudWatchAlarmConfiguration
s {$sel:period:CloudWatchAlarmConfiguration' :: Natural
period = Natural
a} :: CloudWatchAlarmConfiguration)
cloudWatchAlarmConfiguration_metricName :: Lens.Lens' CloudWatchAlarmConfiguration Prelude.Text
cloudWatchAlarmConfiguration_metricName :: (Text -> f Text)
-> CloudWatchAlarmConfiguration -> f CloudWatchAlarmConfiguration
cloudWatchAlarmConfiguration_metricName = (CloudWatchAlarmConfiguration -> Text)
-> (CloudWatchAlarmConfiguration
-> Text -> CloudWatchAlarmConfiguration)
-> Lens
CloudWatchAlarmConfiguration CloudWatchAlarmConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchAlarmConfiguration' {Text
metricName :: Text
$sel:metricName:CloudWatchAlarmConfiguration' :: CloudWatchAlarmConfiguration -> Text
metricName} -> Text
metricName) (\s :: CloudWatchAlarmConfiguration
s@CloudWatchAlarmConfiguration' {} Text
a -> CloudWatchAlarmConfiguration
s {$sel:metricName:CloudWatchAlarmConfiguration' :: Text
metricName = Text
a} :: CloudWatchAlarmConfiguration)
cloudWatchAlarmConfiguration_namespace :: Lens.Lens' CloudWatchAlarmConfiguration Prelude.Text
cloudWatchAlarmConfiguration_namespace :: (Text -> f Text)
-> CloudWatchAlarmConfiguration -> f CloudWatchAlarmConfiguration
cloudWatchAlarmConfiguration_namespace = (CloudWatchAlarmConfiguration -> Text)
-> (CloudWatchAlarmConfiguration
-> Text -> CloudWatchAlarmConfiguration)
-> Lens
CloudWatchAlarmConfiguration CloudWatchAlarmConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchAlarmConfiguration' {Text
namespace :: Text
$sel:namespace:CloudWatchAlarmConfiguration' :: CloudWatchAlarmConfiguration -> Text
namespace} -> Text
namespace) (\s :: CloudWatchAlarmConfiguration
s@CloudWatchAlarmConfiguration' {} Text
a -> CloudWatchAlarmConfiguration
s {$sel:namespace:CloudWatchAlarmConfiguration' :: Text
namespace = Text
a} :: CloudWatchAlarmConfiguration)
cloudWatchAlarmConfiguration_statistic :: Lens.Lens' CloudWatchAlarmConfiguration Statistic
cloudWatchAlarmConfiguration_statistic :: (Statistic -> f Statistic)
-> CloudWatchAlarmConfiguration -> f CloudWatchAlarmConfiguration
cloudWatchAlarmConfiguration_statistic = (CloudWatchAlarmConfiguration -> Statistic)
-> (CloudWatchAlarmConfiguration
-> Statistic -> CloudWatchAlarmConfiguration)
-> Lens
CloudWatchAlarmConfiguration
CloudWatchAlarmConfiguration
Statistic
Statistic
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchAlarmConfiguration' {Statistic
statistic :: Statistic
$sel:statistic:CloudWatchAlarmConfiguration' :: CloudWatchAlarmConfiguration -> Statistic
statistic} -> Statistic
statistic) (\s :: CloudWatchAlarmConfiguration
s@CloudWatchAlarmConfiguration' {} Statistic
a -> CloudWatchAlarmConfiguration
s {$sel:statistic:CloudWatchAlarmConfiguration' :: Statistic
statistic = Statistic
a} :: CloudWatchAlarmConfiguration)
instance Core.FromXML CloudWatchAlarmConfiguration where
parseXML :: [Node] -> Either String CloudWatchAlarmConfiguration
parseXML [Node]
x =
Maybe [Dimension]
-> Natural
-> Double
-> ComparisonOperator
-> Natural
-> Text
-> Text
-> Statistic
-> CloudWatchAlarmConfiguration
CloudWatchAlarmConfiguration'
(Maybe [Dimension]
-> Natural
-> Double
-> ComparisonOperator
-> Natural
-> Text
-> Text
-> Statistic
-> CloudWatchAlarmConfiguration)
-> Either String (Maybe [Dimension])
-> Either
String
(Natural
-> Double
-> ComparisonOperator
-> Natural
-> Text
-> Text
-> Statistic
-> CloudWatchAlarmConfiguration)
forall (f :: * -> *) a b. Functor 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
"Dimension")
)
Either
String
(Natural
-> Double
-> ComparisonOperator
-> Natural
-> Text
-> Text
-> Statistic
-> CloudWatchAlarmConfiguration)
-> Either String Natural
-> Either
String
(Double
-> ComparisonOperator
-> Natural
-> Text
-> Text
-> Statistic
-> CloudWatchAlarmConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Natural
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"EvaluationPeriods")
Either
String
(Double
-> ComparisonOperator
-> Natural
-> Text
-> Text
-> Statistic
-> CloudWatchAlarmConfiguration)
-> Either String Double
-> Either
String
(ComparisonOperator
-> Natural
-> Text
-> Text
-> Statistic
-> CloudWatchAlarmConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Double
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Threshold")
Either
String
(ComparisonOperator
-> Natural
-> Text
-> Text
-> Statistic
-> CloudWatchAlarmConfiguration)
-> Either String ComparisonOperator
-> Either
String
(Natural
-> Text -> Text -> Statistic -> CloudWatchAlarmConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ComparisonOperator
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"ComparisonOperator")
Either
String
(Natural
-> Text -> Text -> Statistic -> CloudWatchAlarmConfiguration)
-> Either String Natural
-> Either
String (Text -> Text -> Statistic -> CloudWatchAlarmConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Natural
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Period")
Either
String (Text -> Text -> Statistic -> CloudWatchAlarmConfiguration)
-> Either String Text
-> Either
String (Text -> Statistic -> CloudWatchAlarmConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"MetricName")
Either String (Text -> Statistic -> CloudWatchAlarmConfiguration)
-> Either String Text
-> Either String (Statistic -> CloudWatchAlarmConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Namespace")
Either String (Statistic -> CloudWatchAlarmConfiguration)
-> Either String Statistic
-> Either String CloudWatchAlarmConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Statistic
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Statistic")
instance
Prelude.Hashable
CloudWatchAlarmConfiguration
instance Prelude.NFData CloudWatchAlarmConfiguration