module Stratosphere.CloudWatch.AnomalyDetector.MetricStatProperty (
        module Exports, MetricStatProperty(..), mkMetricStatProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.CloudWatch.AnomalyDetector.MetricProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data MetricStatProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricstat.html>
    MetricStatProperty {MetricStatProperty -> ()
haddock_workaround_ :: (),
                        -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricstat.html#cfn-cloudwatch-anomalydetector-metricstat-metric>
                        MetricStatProperty -> MetricProperty
metric :: MetricProperty,
                        -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricstat.html#cfn-cloudwatch-anomalydetector-metricstat-period>
                        MetricStatProperty -> Value Integer
period :: (Value Prelude.Integer),
                        -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricstat.html#cfn-cloudwatch-anomalydetector-metricstat-stat>
                        MetricStatProperty -> Value Text
stat :: (Value Prelude.Text),
                        -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricstat.html#cfn-cloudwatch-anomalydetector-metricstat-unit>
                        MetricStatProperty -> Maybe (Value Text)
unit :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (MetricStatProperty -> MetricStatProperty -> Bool
(MetricStatProperty -> MetricStatProperty -> Bool)
-> (MetricStatProperty -> MetricStatProperty -> Bool)
-> Eq MetricStatProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MetricStatProperty -> MetricStatProperty -> Bool
== :: MetricStatProperty -> MetricStatProperty -> Bool
$c/= :: MetricStatProperty -> MetricStatProperty -> Bool
/= :: MetricStatProperty -> MetricStatProperty -> Bool
Prelude.Eq, Int -> MetricStatProperty -> ShowS
[MetricStatProperty] -> ShowS
MetricStatProperty -> String
(Int -> MetricStatProperty -> ShowS)
-> (MetricStatProperty -> String)
-> ([MetricStatProperty] -> ShowS)
-> Show MetricStatProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MetricStatProperty -> ShowS
showsPrec :: Int -> MetricStatProperty -> ShowS
$cshow :: MetricStatProperty -> String
show :: MetricStatProperty -> String
$cshowList :: [MetricStatProperty] -> ShowS
showList :: [MetricStatProperty] -> ShowS
Prelude.Show)
mkMetricStatProperty ::
  MetricProperty
  -> Value Prelude.Integer
     -> Value Prelude.Text -> MetricStatProperty
mkMetricStatProperty :: MetricProperty -> Value Integer -> Value Text -> MetricStatProperty
mkMetricStatProperty MetricProperty
metric Value Integer
period Value Text
stat
  = MetricStatProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), metric :: MetricProperty
metric = MetricProperty
metric, period :: Value Integer
period = Value Integer
period,
       stat :: Value Text
stat = Value Text
stat, unit :: Maybe (Value Text)
unit = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties MetricStatProperty where
  toResourceProperties :: MetricStatProperty -> ResourceProperties
toResourceProperties MetricStatProperty {Maybe (Value Text)
()
Value Integer
Value Text
MetricProperty
haddock_workaround_ :: MetricStatProperty -> ()
metric :: MetricStatProperty -> MetricProperty
period :: MetricStatProperty -> Value Integer
stat :: MetricStatProperty -> Value Text
unit :: MetricStatProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
metric :: MetricProperty
period :: Value Integer
stat :: Value Text
unit :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::CloudWatch::AnomalyDetector.MetricStat",
         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
"Metric" Key -> MetricProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= MetricProperty
metric, Key
"Period" Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Integer
period,
                            Key
"Stat" 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
stat]
                           ([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
"Unit" (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)
unit]))}
instance JSON.ToJSON MetricStatProperty where
  toJSON :: MetricStatProperty -> Value
toJSON MetricStatProperty {Maybe (Value Text)
()
Value Integer
Value Text
MetricProperty
haddock_workaround_ :: MetricStatProperty -> ()
metric :: MetricStatProperty -> MetricProperty
period :: MetricStatProperty -> Value Integer
stat :: MetricStatProperty -> Value Text
unit :: MetricStatProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
metric :: MetricProperty
period :: Value Integer
stat :: Value Text
unit :: 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
"Metric" Key -> MetricProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= MetricProperty
metric, Key
"Period" Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Integer
period,
               Key
"Stat" 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
stat]
              ([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
"Unit" (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)
unit])))
instance Property "Metric" MetricStatProperty where
  type PropertyType "Metric" MetricStatProperty = MetricProperty
  set :: PropertyType "Metric" MetricStatProperty
-> MetricStatProperty -> MetricStatProperty
set PropertyType "Metric" MetricStatProperty
newValue MetricStatProperty {Maybe (Value Text)
()
Value Integer
Value Text
MetricProperty
haddock_workaround_ :: MetricStatProperty -> ()
metric :: MetricStatProperty -> MetricProperty
period :: MetricStatProperty -> Value Integer
stat :: MetricStatProperty -> Value Text
unit :: MetricStatProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
metric :: MetricProperty
period :: Value Integer
stat :: Value Text
unit :: Maybe (Value Text)
..}
    = MetricStatProperty {metric :: MetricProperty
metric = PropertyType "Metric" MetricStatProperty
MetricProperty
newValue, Maybe (Value Text)
()
Value Integer
Value Text
haddock_workaround_ :: ()
period :: Value Integer
stat :: Value Text
unit :: Maybe (Value Text)
haddock_workaround_ :: ()
period :: Value Integer
stat :: Value Text
unit :: Maybe (Value Text)
..}
instance Property "Period" MetricStatProperty where
  type PropertyType "Period" MetricStatProperty = Value Prelude.Integer
  set :: PropertyType "Period" MetricStatProperty
-> MetricStatProperty -> MetricStatProperty
set PropertyType "Period" MetricStatProperty
newValue MetricStatProperty {Maybe (Value Text)
()
Value Integer
Value Text
MetricProperty
haddock_workaround_ :: MetricStatProperty -> ()
metric :: MetricStatProperty -> MetricProperty
period :: MetricStatProperty -> Value Integer
stat :: MetricStatProperty -> Value Text
unit :: MetricStatProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
metric :: MetricProperty
period :: Value Integer
stat :: Value Text
unit :: Maybe (Value Text)
..}
    = MetricStatProperty {period :: Value Integer
period = PropertyType "Period" MetricStatProperty
Value Integer
newValue, Maybe (Value Text)
()
Value Text
MetricProperty
haddock_workaround_ :: ()
metric :: MetricProperty
stat :: Value Text
unit :: Maybe (Value Text)
haddock_workaround_ :: ()
metric :: MetricProperty
stat :: Value Text
unit :: Maybe (Value Text)
..}
instance Property "Stat" MetricStatProperty where
  type PropertyType "Stat" MetricStatProperty = Value Prelude.Text
  set :: PropertyType "Stat" MetricStatProperty
-> MetricStatProperty -> MetricStatProperty
set PropertyType "Stat" MetricStatProperty
newValue MetricStatProperty {Maybe (Value Text)
()
Value Integer
Value Text
MetricProperty
haddock_workaround_ :: MetricStatProperty -> ()
metric :: MetricStatProperty -> MetricProperty
period :: MetricStatProperty -> Value Integer
stat :: MetricStatProperty -> Value Text
unit :: MetricStatProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
metric :: MetricProperty
period :: Value Integer
stat :: Value Text
unit :: Maybe (Value Text)
..}
    = MetricStatProperty {stat :: Value Text
stat = PropertyType "Stat" MetricStatProperty
Value Text
newValue, Maybe (Value Text)
()
Value Integer
MetricProperty
haddock_workaround_ :: ()
metric :: MetricProperty
period :: Value Integer
unit :: Maybe (Value Text)
haddock_workaround_ :: ()
metric :: MetricProperty
period :: Value Integer
unit :: Maybe (Value Text)
..}
instance Property "Unit" MetricStatProperty where
  type PropertyType "Unit" MetricStatProperty = Value Prelude.Text
  set :: PropertyType "Unit" MetricStatProperty
-> MetricStatProperty -> MetricStatProperty
set PropertyType "Unit" MetricStatProperty
newValue MetricStatProperty {Maybe (Value Text)
()
Value Integer
Value Text
MetricProperty
haddock_workaround_ :: MetricStatProperty -> ()
metric :: MetricStatProperty -> MetricProperty
period :: MetricStatProperty -> Value Integer
stat :: MetricStatProperty -> Value Text
unit :: MetricStatProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
metric :: MetricProperty
period :: Value Integer
stat :: Value Text
unit :: Maybe (Value Text)
..}
    = MetricStatProperty {unit :: Maybe (Value Text)
unit = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Unit" MetricStatProperty
Value Text
newValue, ()
Value Integer
Value Text
MetricProperty
haddock_workaround_ :: ()
metric :: MetricProperty
period :: Value Integer
stat :: Value Text
haddock_workaround_ :: ()
metric :: MetricProperty
period :: Value Integer
stat :: Value Text
..}