{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CloudWatch.Types.AnomalyDetector where
import Amazonka.CloudWatch.Types.AnomalyDetectorConfiguration
import Amazonka.CloudWatch.Types.AnomalyDetectorStateValue
import Amazonka.CloudWatch.Types.Dimension
import Amazonka.CloudWatch.Types.MetricMathAnomalyDetector
import Amazonka.CloudWatch.Types.SingleMetricAnomalyDetector
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data AnomalyDetector = AnomalyDetector'
{
AnomalyDetector -> Maybe AnomalyDetectorConfiguration
configuration :: Prelude.Maybe AnomalyDetectorConfiguration,
AnomalyDetector -> Maybe [Dimension]
dimensions :: Prelude.Maybe [Dimension],
AnomalyDetector -> Maybe MetricMathAnomalyDetector
metricMathAnomalyDetector :: Prelude.Maybe MetricMathAnomalyDetector,
AnomalyDetector -> Maybe Text
metricName :: Prelude.Maybe Prelude.Text,
AnomalyDetector -> Maybe Text
namespace :: Prelude.Maybe Prelude.Text,
AnomalyDetector -> Maybe SingleMetricAnomalyDetector
singleMetricAnomalyDetector :: Prelude.Maybe SingleMetricAnomalyDetector,
AnomalyDetector -> Maybe Text
stat :: Prelude.Maybe Prelude.Text,
AnomalyDetector -> Maybe AnomalyDetectorStateValue
stateValue :: Prelude.Maybe AnomalyDetectorStateValue
}
deriving (AnomalyDetector -> AnomalyDetector -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnomalyDetector -> AnomalyDetector -> Bool
$c/= :: AnomalyDetector -> AnomalyDetector -> Bool
== :: AnomalyDetector -> AnomalyDetector -> Bool
$c== :: AnomalyDetector -> AnomalyDetector -> Bool
Prelude.Eq, ReadPrec [AnomalyDetector]
ReadPrec AnomalyDetector
Int -> ReadS AnomalyDetector
ReadS [AnomalyDetector]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AnomalyDetector]
$creadListPrec :: ReadPrec [AnomalyDetector]
readPrec :: ReadPrec AnomalyDetector
$creadPrec :: ReadPrec AnomalyDetector
readList :: ReadS [AnomalyDetector]
$creadList :: ReadS [AnomalyDetector]
readsPrec :: Int -> ReadS AnomalyDetector
$creadsPrec :: Int -> ReadS AnomalyDetector
Prelude.Read, Int -> AnomalyDetector -> ShowS
[AnomalyDetector] -> ShowS
AnomalyDetector -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnomalyDetector] -> ShowS
$cshowList :: [AnomalyDetector] -> ShowS
show :: AnomalyDetector -> String
$cshow :: AnomalyDetector -> String
showsPrec :: Int -> AnomalyDetector -> ShowS
$cshowsPrec :: Int -> AnomalyDetector -> ShowS
Prelude.Show, forall x. Rep AnomalyDetector x -> AnomalyDetector
forall x. AnomalyDetector -> Rep AnomalyDetector x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AnomalyDetector x -> AnomalyDetector
$cfrom :: forall x. AnomalyDetector -> Rep AnomalyDetector x
Prelude.Generic)
newAnomalyDetector ::
AnomalyDetector
newAnomalyDetector :: AnomalyDetector
newAnomalyDetector =
AnomalyDetector'
{ $sel:configuration:AnomalyDetector' :: Maybe AnomalyDetectorConfiguration
configuration = forall a. Maybe a
Prelude.Nothing,
$sel:dimensions:AnomalyDetector' :: Maybe [Dimension]
dimensions = forall a. Maybe a
Prelude.Nothing,
$sel:metricMathAnomalyDetector:AnomalyDetector' :: Maybe MetricMathAnomalyDetector
metricMathAnomalyDetector = forall a. Maybe a
Prelude.Nothing,
$sel:metricName:AnomalyDetector' :: Maybe Text
metricName = forall a. Maybe a
Prelude.Nothing,
$sel:namespace:AnomalyDetector' :: Maybe Text
namespace = forall a. Maybe a
Prelude.Nothing,
$sel:singleMetricAnomalyDetector:AnomalyDetector' :: Maybe SingleMetricAnomalyDetector
singleMetricAnomalyDetector = forall a. Maybe a
Prelude.Nothing,
$sel:stat:AnomalyDetector' :: Maybe Text
stat = forall a. Maybe a
Prelude.Nothing,
$sel:stateValue:AnomalyDetector' :: Maybe AnomalyDetectorStateValue
stateValue = forall a. Maybe a
Prelude.Nothing
}
anomalyDetector_configuration :: Lens.Lens' AnomalyDetector (Prelude.Maybe AnomalyDetectorConfiguration)
anomalyDetector_configuration :: Lens' AnomalyDetector (Maybe AnomalyDetectorConfiguration)
anomalyDetector_configuration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyDetector' {Maybe AnomalyDetectorConfiguration
configuration :: Maybe AnomalyDetectorConfiguration
$sel:configuration:AnomalyDetector' :: AnomalyDetector -> Maybe AnomalyDetectorConfiguration
configuration} -> Maybe AnomalyDetectorConfiguration
configuration) (\s :: AnomalyDetector
s@AnomalyDetector' {} Maybe AnomalyDetectorConfiguration
a -> AnomalyDetector
s {$sel:configuration:AnomalyDetector' :: Maybe AnomalyDetectorConfiguration
configuration = Maybe AnomalyDetectorConfiguration
a} :: AnomalyDetector)
anomalyDetector_dimensions :: Lens.Lens' AnomalyDetector (Prelude.Maybe [Dimension])
anomalyDetector_dimensions :: Lens' AnomalyDetector (Maybe [Dimension])
anomalyDetector_dimensions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyDetector' {Maybe [Dimension]
dimensions :: Maybe [Dimension]
$sel:dimensions:AnomalyDetector' :: AnomalyDetector -> Maybe [Dimension]
dimensions} -> Maybe [Dimension]
dimensions) (\s :: AnomalyDetector
s@AnomalyDetector' {} Maybe [Dimension]
a -> AnomalyDetector
s {$sel:dimensions:AnomalyDetector' :: Maybe [Dimension]
dimensions = Maybe [Dimension]
a} :: AnomalyDetector) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
anomalyDetector_metricMathAnomalyDetector :: Lens.Lens' AnomalyDetector (Prelude.Maybe MetricMathAnomalyDetector)
anomalyDetector_metricMathAnomalyDetector :: Lens' AnomalyDetector (Maybe MetricMathAnomalyDetector)
anomalyDetector_metricMathAnomalyDetector = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyDetector' {Maybe MetricMathAnomalyDetector
metricMathAnomalyDetector :: Maybe MetricMathAnomalyDetector
$sel:metricMathAnomalyDetector:AnomalyDetector' :: AnomalyDetector -> Maybe MetricMathAnomalyDetector
metricMathAnomalyDetector} -> Maybe MetricMathAnomalyDetector
metricMathAnomalyDetector) (\s :: AnomalyDetector
s@AnomalyDetector' {} Maybe MetricMathAnomalyDetector
a -> AnomalyDetector
s {$sel:metricMathAnomalyDetector:AnomalyDetector' :: Maybe MetricMathAnomalyDetector
metricMathAnomalyDetector = Maybe MetricMathAnomalyDetector
a} :: AnomalyDetector)
anomalyDetector_metricName :: Lens.Lens' AnomalyDetector (Prelude.Maybe Prelude.Text)
anomalyDetector_metricName :: Lens' AnomalyDetector (Maybe Text)
anomalyDetector_metricName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyDetector' {Maybe Text
metricName :: Maybe Text
$sel:metricName:AnomalyDetector' :: AnomalyDetector -> Maybe Text
metricName} -> Maybe Text
metricName) (\s :: AnomalyDetector
s@AnomalyDetector' {} Maybe Text
a -> AnomalyDetector
s {$sel:metricName:AnomalyDetector' :: Maybe Text
metricName = Maybe Text
a} :: AnomalyDetector)
anomalyDetector_namespace :: Lens.Lens' AnomalyDetector (Prelude.Maybe Prelude.Text)
anomalyDetector_namespace :: Lens' AnomalyDetector (Maybe Text)
anomalyDetector_namespace = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyDetector' {Maybe Text
namespace :: Maybe Text
$sel:namespace:AnomalyDetector' :: AnomalyDetector -> Maybe Text
namespace} -> Maybe Text
namespace) (\s :: AnomalyDetector
s@AnomalyDetector' {} Maybe Text
a -> AnomalyDetector
s {$sel:namespace:AnomalyDetector' :: Maybe Text
namespace = Maybe Text
a} :: AnomalyDetector)
anomalyDetector_singleMetricAnomalyDetector :: Lens.Lens' AnomalyDetector (Prelude.Maybe SingleMetricAnomalyDetector)
anomalyDetector_singleMetricAnomalyDetector :: Lens' AnomalyDetector (Maybe SingleMetricAnomalyDetector)
anomalyDetector_singleMetricAnomalyDetector = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyDetector' {Maybe SingleMetricAnomalyDetector
singleMetricAnomalyDetector :: Maybe SingleMetricAnomalyDetector
$sel:singleMetricAnomalyDetector:AnomalyDetector' :: AnomalyDetector -> Maybe SingleMetricAnomalyDetector
singleMetricAnomalyDetector} -> Maybe SingleMetricAnomalyDetector
singleMetricAnomalyDetector) (\s :: AnomalyDetector
s@AnomalyDetector' {} Maybe SingleMetricAnomalyDetector
a -> AnomalyDetector
s {$sel:singleMetricAnomalyDetector:AnomalyDetector' :: Maybe SingleMetricAnomalyDetector
singleMetricAnomalyDetector = Maybe SingleMetricAnomalyDetector
a} :: AnomalyDetector)
anomalyDetector_stat :: Lens.Lens' AnomalyDetector (Prelude.Maybe Prelude.Text)
anomalyDetector_stat :: Lens' AnomalyDetector (Maybe Text)
anomalyDetector_stat = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyDetector' {Maybe Text
stat :: Maybe Text
$sel:stat:AnomalyDetector' :: AnomalyDetector -> Maybe Text
stat} -> Maybe Text
stat) (\s :: AnomalyDetector
s@AnomalyDetector' {} Maybe Text
a -> AnomalyDetector
s {$sel:stat:AnomalyDetector' :: Maybe Text
stat = Maybe Text
a} :: AnomalyDetector)
anomalyDetector_stateValue :: Lens.Lens' AnomalyDetector (Prelude.Maybe AnomalyDetectorStateValue)
anomalyDetector_stateValue :: Lens' AnomalyDetector (Maybe AnomalyDetectorStateValue)
anomalyDetector_stateValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyDetector' {Maybe AnomalyDetectorStateValue
stateValue :: Maybe AnomalyDetectorStateValue
$sel:stateValue:AnomalyDetector' :: AnomalyDetector -> Maybe AnomalyDetectorStateValue
stateValue} -> Maybe AnomalyDetectorStateValue
stateValue) (\s :: AnomalyDetector
s@AnomalyDetector' {} Maybe AnomalyDetectorStateValue
a -> AnomalyDetector
s {$sel:stateValue:AnomalyDetector' :: Maybe AnomalyDetectorStateValue
stateValue = Maybe AnomalyDetectorStateValue
a} :: AnomalyDetector)
instance Data.FromXML AnomalyDetector where
parseXML :: [Node] -> Either String AnomalyDetector
parseXML [Node]
x =
Maybe AnomalyDetectorConfiguration
-> Maybe [Dimension]
-> Maybe MetricMathAnomalyDetector
-> Maybe Text
-> Maybe Text
-> Maybe SingleMetricAnomalyDetector
-> Maybe Text
-> Maybe AnomalyDetectorStateValue
-> AnomalyDetector
AnomalyDetector'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Configuration")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Dimensions"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"MetricMathAnomalyDetector")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"MetricName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Namespace")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"SingleMetricAnomalyDetector")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Stat")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"StateValue")
instance Prelude.Hashable AnomalyDetector where
hashWithSalt :: Int -> AnomalyDetector -> Int
hashWithSalt Int
_salt AnomalyDetector' {Maybe [Dimension]
Maybe Text
Maybe AnomalyDetectorStateValue
Maybe AnomalyDetectorConfiguration
Maybe SingleMetricAnomalyDetector
Maybe MetricMathAnomalyDetector
stateValue :: Maybe AnomalyDetectorStateValue
stat :: Maybe Text
singleMetricAnomalyDetector :: Maybe SingleMetricAnomalyDetector
namespace :: Maybe Text
metricName :: Maybe Text
metricMathAnomalyDetector :: Maybe MetricMathAnomalyDetector
dimensions :: Maybe [Dimension]
configuration :: Maybe AnomalyDetectorConfiguration
$sel:stateValue:AnomalyDetector' :: AnomalyDetector -> Maybe AnomalyDetectorStateValue
$sel:stat:AnomalyDetector' :: AnomalyDetector -> Maybe Text
$sel:singleMetricAnomalyDetector:AnomalyDetector' :: AnomalyDetector -> Maybe SingleMetricAnomalyDetector
$sel:namespace:AnomalyDetector' :: AnomalyDetector -> Maybe Text
$sel:metricName:AnomalyDetector' :: AnomalyDetector -> Maybe Text
$sel:metricMathAnomalyDetector:AnomalyDetector' :: AnomalyDetector -> Maybe MetricMathAnomalyDetector
$sel:dimensions:AnomalyDetector' :: AnomalyDetector -> Maybe [Dimension]
$sel:configuration:AnomalyDetector' :: AnomalyDetector -> Maybe AnomalyDetectorConfiguration
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AnomalyDetectorConfiguration
configuration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Dimension]
dimensions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MetricMathAnomalyDetector
metricMathAnomalyDetector
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
metricName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
namespace
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SingleMetricAnomalyDetector
singleMetricAnomalyDetector
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stat
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AnomalyDetectorStateValue
stateValue
instance Prelude.NFData AnomalyDetector where
rnf :: AnomalyDetector -> ()
rnf AnomalyDetector' {Maybe [Dimension]
Maybe Text
Maybe AnomalyDetectorStateValue
Maybe AnomalyDetectorConfiguration
Maybe SingleMetricAnomalyDetector
Maybe MetricMathAnomalyDetector
stateValue :: Maybe AnomalyDetectorStateValue
stat :: Maybe Text
singleMetricAnomalyDetector :: Maybe SingleMetricAnomalyDetector
namespace :: Maybe Text
metricName :: Maybe Text
metricMathAnomalyDetector :: Maybe MetricMathAnomalyDetector
dimensions :: Maybe [Dimension]
configuration :: Maybe AnomalyDetectorConfiguration
$sel:stateValue:AnomalyDetector' :: AnomalyDetector -> Maybe AnomalyDetectorStateValue
$sel:stat:AnomalyDetector' :: AnomalyDetector -> Maybe Text
$sel:singleMetricAnomalyDetector:AnomalyDetector' :: AnomalyDetector -> Maybe SingleMetricAnomalyDetector
$sel:namespace:AnomalyDetector' :: AnomalyDetector -> Maybe Text
$sel:metricName:AnomalyDetector' :: AnomalyDetector -> Maybe Text
$sel:metricMathAnomalyDetector:AnomalyDetector' :: AnomalyDetector -> Maybe MetricMathAnomalyDetector
$sel:dimensions:AnomalyDetector' :: AnomalyDetector -> Maybe [Dimension]
$sel:configuration:AnomalyDetector' :: AnomalyDetector -> Maybe AnomalyDetectorConfiguration
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AnomalyDetectorConfiguration
configuration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Dimension]
dimensions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MetricMathAnomalyDetector
metricMathAnomalyDetector
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
metricName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
namespace
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SingleMetricAnomalyDetector
singleMetricAnomalyDetector
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stat
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AnomalyDetectorStateValue
stateValue