module Stratosphere.CloudWatch.AnomalyDetector.MetricMathAnomalyDetectorProperty (
        module Exports, MetricMathAnomalyDetectorProperty(..),
        mkMetricMathAnomalyDetectorProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.CloudWatch.AnomalyDetector.MetricDataQueryProperty as Exports
import Stratosphere.ResourceProperties
data MetricMathAnomalyDetectorProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricmathanomalydetector.html>
    MetricMathAnomalyDetectorProperty {MetricMathAnomalyDetectorProperty -> ()
haddock_workaround_ :: (),
                                       -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricmathanomalydetector.html#cfn-cloudwatch-anomalydetector-metricmathanomalydetector-metricdataqueries>
                                       MetricMathAnomalyDetectorProperty
-> Maybe [MetricDataQueryProperty]
metricDataQueries :: (Prelude.Maybe [MetricDataQueryProperty])}
  deriving stock (MetricMathAnomalyDetectorProperty
-> MetricMathAnomalyDetectorProperty -> Bool
(MetricMathAnomalyDetectorProperty
 -> MetricMathAnomalyDetectorProperty -> Bool)
-> (MetricMathAnomalyDetectorProperty
    -> MetricMathAnomalyDetectorProperty -> Bool)
-> Eq MetricMathAnomalyDetectorProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MetricMathAnomalyDetectorProperty
-> MetricMathAnomalyDetectorProperty -> Bool
== :: MetricMathAnomalyDetectorProperty
-> MetricMathAnomalyDetectorProperty -> Bool
$c/= :: MetricMathAnomalyDetectorProperty
-> MetricMathAnomalyDetectorProperty -> Bool
/= :: MetricMathAnomalyDetectorProperty
-> MetricMathAnomalyDetectorProperty -> Bool
Prelude.Eq, Int -> MetricMathAnomalyDetectorProperty -> ShowS
[MetricMathAnomalyDetectorProperty] -> ShowS
MetricMathAnomalyDetectorProperty -> String
(Int -> MetricMathAnomalyDetectorProperty -> ShowS)
-> (MetricMathAnomalyDetectorProperty -> String)
-> ([MetricMathAnomalyDetectorProperty] -> ShowS)
-> Show MetricMathAnomalyDetectorProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MetricMathAnomalyDetectorProperty -> ShowS
showsPrec :: Int -> MetricMathAnomalyDetectorProperty -> ShowS
$cshow :: MetricMathAnomalyDetectorProperty -> String
show :: MetricMathAnomalyDetectorProperty -> String
$cshowList :: [MetricMathAnomalyDetectorProperty] -> ShowS
showList :: [MetricMathAnomalyDetectorProperty] -> ShowS
Prelude.Show)
mkMetricMathAnomalyDetectorProperty ::
  MetricMathAnomalyDetectorProperty
mkMetricMathAnomalyDetectorProperty :: MetricMathAnomalyDetectorProperty
mkMetricMathAnomalyDetectorProperty
  = MetricMathAnomalyDetectorProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), metricDataQueries :: Maybe [MetricDataQueryProperty]
metricDataQueries = Maybe [MetricDataQueryProperty]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties MetricMathAnomalyDetectorProperty where
  toResourceProperties :: MetricMathAnomalyDetectorProperty -> ResourceProperties
toResourceProperties MetricMathAnomalyDetectorProperty {Maybe [MetricDataQueryProperty]
()
haddock_workaround_ :: MetricMathAnomalyDetectorProperty -> ()
metricDataQueries :: MetricMathAnomalyDetectorProperty
-> Maybe [MetricDataQueryProperty]
haddock_workaround_ :: ()
metricDataQueries :: Maybe [MetricDataQueryProperty]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::CloudWatch::AnomalyDetector.MetricMathAnomalyDetector",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                           [Key -> [MetricDataQueryProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"MetricDataQueries" ([MetricDataQueryProperty] -> (Key, Value))
-> Maybe [MetricDataQueryProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MetricDataQueryProperty]
metricDataQueries])}
instance JSON.ToJSON MetricMathAnomalyDetectorProperty where
  toJSON :: MetricMathAnomalyDetectorProperty -> Value
toJSON MetricMathAnomalyDetectorProperty {Maybe [MetricDataQueryProperty]
()
haddock_workaround_ :: MetricMathAnomalyDetectorProperty -> ()
metricDataQueries :: MetricMathAnomalyDetectorProperty
-> Maybe [MetricDataQueryProperty]
haddock_workaround_ :: ()
metricDataQueries :: Maybe [MetricDataQueryProperty]
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
              [Key -> [MetricDataQueryProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"MetricDataQueries" ([MetricDataQueryProperty] -> (Key, Value))
-> Maybe [MetricDataQueryProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MetricDataQueryProperty]
metricDataQueries]))
instance Property "MetricDataQueries" MetricMathAnomalyDetectorProperty where
  type PropertyType "MetricDataQueries" MetricMathAnomalyDetectorProperty = [MetricDataQueryProperty]
  set :: PropertyType "MetricDataQueries" MetricMathAnomalyDetectorProperty
-> MetricMathAnomalyDetectorProperty
-> MetricMathAnomalyDetectorProperty
set PropertyType "MetricDataQueries" MetricMathAnomalyDetectorProperty
newValue MetricMathAnomalyDetectorProperty {Maybe [MetricDataQueryProperty]
()
haddock_workaround_ :: MetricMathAnomalyDetectorProperty -> ()
metricDataQueries :: MetricMathAnomalyDetectorProperty
-> Maybe [MetricDataQueryProperty]
haddock_workaround_ :: ()
metricDataQueries :: Maybe [MetricDataQueryProperty]
..}
    = MetricMathAnomalyDetectorProperty
        {metricDataQueries :: Maybe [MetricDataQueryProperty]
metricDataQueries = [MetricDataQueryProperty] -> Maybe [MetricDataQueryProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [MetricDataQueryProperty]
PropertyType "MetricDataQueries" MetricMathAnomalyDetectorProperty
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}