module Stratosphere.LookoutMetrics.AnomalyDetector.MetricProperty (
        MetricProperty(..), mkMetricProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data MetricProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lookoutmetrics-anomalydetector-metric.html>
    MetricProperty {MetricProperty -> ()
haddock_workaround_ :: (),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lookoutmetrics-anomalydetector-metric.html#cfn-lookoutmetrics-anomalydetector-metric-aggregationfunction>
                    MetricProperty -> Value Text
aggregationFunction :: (Value Prelude.Text),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lookoutmetrics-anomalydetector-metric.html#cfn-lookoutmetrics-anomalydetector-metric-metricname>
                    MetricProperty -> Value Text
metricName :: (Value Prelude.Text),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lookoutmetrics-anomalydetector-metric.html#cfn-lookoutmetrics-anomalydetector-metric-namespace>
                    MetricProperty -> Maybe (Value Text)
namespace :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (MetricProperty -> MetricProperty -> Bool
(MetricProperty -> MetricProperty -> Bool)
-> (MetricProperty -> MetricProperty -> Bool) -> Eq MetricProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MetricProperty -> MetricProperty -> Bool
== :: MetricProperty -> MetricProperty -> Bool
$c/= :: MetricProperty -> MetricProperty -> Bool
/= :: MetricProperty -> MetricProperty -> Bool
Prelude.Eq, Int -> MetricProperty -> ShowS
[MetricProperty] -> ShowS
MetricProperty -> String
(Int -> MetricProperty -> ShowS)
-> (MetricProperty -> String)
-> ([MetricProperty] -> ShowS)
-> Show MetricProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MetricProperty -> ShowS
showsPrec :: Int -> MetricProperty -> ShowS
$cshow :: MetricProperty -> String
show :: MetricProperty -> String
$cshowList :: [MetricProperty] -> ShowS
showList :: [MetricProperty] -> ShowS
Prelude.Show)
mkMetricProperty ::
  Value Prelude.Text -> Value Prelude.Text -> MetricProperty
mkMetricProperty :: Value Text -> Value Text -> MetricProperty
mkMetricProperty Value Text
aggregationFunction Value Text
metricName
  = MetricProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (),
       aggregationFunction :: Value Text
aggregationFunction = Value Text
aggregationFunction, metricName :: Value Text
metricName = Value Text
metricName,
       namespace :: Maybe (Value Text)
namespace = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties MetricProperty where
  toResourceProperties :: MetricProperty -> ResourceProperties
toResourceProperties MetricProperty {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: MetricProperty -> ()
aggregationFunction :: MetricProperty -> Value Text
metricName :: MetricProperty -> Value Text
namespace :: MetricProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
aggregationFunction :: Value Text
metricName :: Value Text
namespace :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::LookoutMetrics::AnomalyDetector.Metric",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
                           [Key
"AggregationFunction" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
aggregationFunction,
                            Key
"MetricName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
metricName]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Namespace" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
namespace]))}
instance JSON.ToJSON MetricProperty where
  toJSON :: MetricProperty -> Value
toJSON MetricProperty {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: MetricProperty -> ()
aggregationFunction :: MetricProperty -> Value Text
metricName :: MetricProperty -> Value Text
namespace :: MetricProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
aggregationFunction :: Value Text
metricName :: Value Text
namespace :: Maybe (Value Text)
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
              [Key
"AggregationFunction" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
aggregationFunction,
               Key
"MetricName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
metricName]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Namespace" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
namespace])))
instance Property "AggregationFunction" MetricProperty where
  type PropertyType "AggregationFunction" MetricProperty = Value Prelude.Text
  set :: PropertyType "AggregationFunction" MetricProperty
-> MetricProperty -> MetricProperty
set PropertyType "AggregationFunction" MetricProperty
newValue MetricProperty {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: MetricProperty -> ()
aggregationFunction :: MetricProperty -> Value Text
metricName :: MetricProperty -> Value Text
namespace :: MetricProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
aggregationFunction :: Value Text
metricName :: Value Text
namespace :: Maybe (Value Text)
..}
    = MetricProperty {aggregationFunction :: Value Text
aggregationFunction = PropertyType "AggregationFunction" MetricProperty
Value Text
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
metricName :: Value Text
namespace :: Maybe (Value Text)
haddock_workaround_ :: ()
metricName :: Value Text
namespace :: Maybe (Value Text)
..}
instance Property "MetricName" MetricProperty where
  type PropertyType "MetricName" MetricProperty = Value Prelude.Text
  set :: PropertyType "MetricName" MetricProperty
-> MetricProperty -> MetricProperty
set PropertyType "MetricName" MetricProperty
newValue MetricProperty {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: MetricProperty -> ()
aggregationFunction :: MetricProperty -> Value Text
metricName :: MetricProperty -> Value Text
namespace :: MetricProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
aggregationFunction :: Value Text
metricName :: Value Text
namespace :: Maybe (Value Text)
..}
    = MetricProperty {metricName :: Value Text
metricName = PropertyType "MetricName" MetricProperty
Value Text
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
aggregationFunction :: Value Text
namespace :: Maybe (Value Text)
haddock_workaround_ :: ()
aggregationFunction :: Value Text
namespace :: Maybe (Value Text)
..}
instance Property "Namespace" MetricProperty where
  type PropertyType "Namespace" MetricProperty = Value Prelude.Text
  set :: PropertyType "Namespace" MetricProperty
-> MetricProperty -> MetricProperty
set PropertyType "Namespace" MetricProperty
newValue MetricProperty {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: MetricProperty -> ()
aggregationFunction :: MetricProperty -> Value Text
metricName :: MetricProperty -> Value Text
namespace :: MetricProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
aggregationFunction :: Value Text
metricName :: Value Text
namespace :: Maybe (Value Text)
..}
    = MetricProperty {namespace :: Maybe (Value Text)
namespace = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Namespace" MetricProperty
Value Text
newValue, ()
Value Text
haddock_workaround_ :: ()
aggregationFunction :: Value Text
metricName :: Value Text
haddock_workaround_ :: ()
aggregationFunction :: Value Text
metricName :: Value Text
..}