module Stratosphere.AutoScaling.ScalingPolicy.MetricProperty (
        module Exports, MetricProperty(..), mkMetricProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.AutoScaling.ScalingPolicy.MetricDimensionProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data MetricProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-scalingpolicy-metric.html>
    MetricProperty {MetricProperty -> ()
haddock_workaround_ :: (),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-scalingpolicy-metric.html#cfn-autoscaling-scalingpolicy-metric-dimensions>
                    MetricProperty -> Maybe [MetricDimensionProperty]
dimensions :: (Prelude.Maybe [MetricDimensionProperty]),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-scalingpolicy-metric.html#cfn-autoscaling-scalingpolicy-metric-metricname>
                    MetricProperty -> Value Text
metricName :: (Value Prelude.Text),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-scalingpolicy-metric.html#cfn-autoscaling-scalingpolicy-metric-namespace>
                    MetricProperty -> Value Text
namespace :: (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
metricName Value Text
namespace
  = MetricProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), metricName :: Value Text
metricName = Value Text
metricName,
       namespace :: Value Text
namespace = Value Text
namespace, dimensions :: Maybe [MetricDimensionProperty]
dimensions = Maybe [MetricDimensionProperty]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties MetricProperty where
  toResourceProperties :: MetricProperty -> ResourceProperties
toResourceProperties MetricProperty {Maybe [MetricDimensionProperty]
()
Value Text
haddock_workaround_ :: MetricProperty -> ()
dimensions :: MetricProperty -> Maybe [MetricDimensionProperty]
metricName :: MetricProperty -> Value Text
namespace :: MetricProperty -> Value Text
haddock_workaround_ :: ()
dimensions :: Maybe [MetricDimensionProperty]
metricName :: Value Text
namespace :: Value Text
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::AutoScaling::ScalingPolicy.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
"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, Key
"Namespace" 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
namespace]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> [MetricDimensionProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Dimensions" ([MetricDimensionProperty] -> (Key, Value))
-> Maybe [MetricDimensionProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MetricDimensionProperty]
dimensions]))}
instance JSON.ToJSON MetricProperty where
  toJSON :: MetricProperty -> Value
toJSON MetricProperty {Maybe [MetricDimensionProperty]
()
Value Text
haddock_workaround_ :: MetricProperty -> ()
dimensions :: MetricProperty -> Maybe [MetricDimensionProperty]
metricName :: MetricProperty -> Value Text
namespace :: MetricProperty -> Value Text
haddock_workaround_ :: ()
dimensions :: Maybe [MetricDimensionProperty]
metricName :: Value Text
namespace :: 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
"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, Key
"Namespace" 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
namespace]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> [MetricDimensionProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Dimensions" ([MetricDimensionProperty] -> (Key, Value))
-> Maybe [MetricDimensionProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MetricDimensionProperty]
dimensions])))
instance Property "Dimensions" MetricProperty where
  type PropertyType "Dimensions" MetricProperty = [MetricDimensionProperty]
  set :: PropertyType "Dimensions" MetricProperty
-> MetricProperty -> MetricProperty
set PropertyType "Dimensions" MetricProperty
newValue MetricProperty {Maybe [MetricDimensionProperty]
()
Value Text
haddock_workaround_ :: MetricProperty -> ()
dimensions :: MetricProperty -> Maybe [MetricDimensionProperty]
metricName :: MetricProperty -> Value Text
namespace :: MetricProperty -> Value Text
haddock_workaround_ :: ()
dimensions :: Maybe [MetricDimensionProperty]
metricName :: Value Text
namespace :: Value Text
..}
    = MetricProperty {dimensions :: Maybe [MetricDimensionProperty]
dimensions = [MetricDimensionProperty] -> Maybe [MetricDimensionProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [MetricDimensionProperty]
PropertyType "Dimensions" MetricProperty
newValue, ()
Value Text
haddock_workaround_ :: ()
metricName :: Value Text
namespace :: Value Text
haddock_workaround_ :: ()
metricName :: Value Text
namespace :: 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 [MetricDimensionProperty]
()
Value Text
haddock_workaround_ :: MetricProperty -> ()
dimensions :: MetricProperty -> Maybe [MetricDimensionProperty]
metricName :: MetricProperty -> Value Text
namespace :: MetricProperty -> Value Text
haddock_workaround_ :: ()
dimensions :: Maybe [MetricDimensionProperty]
metricName :: Value Text
namespace :: Value Text
..}
    = MetricProperty {metricName :: Value Text
metricName = PropertyType "MetricName" MetricProperty
Value Text
newValue, Maybe [MetricDimensionProperty]
()
Value Text
haddock_workaround_ :: ()
dimensions :: Maybe [MetricDimensionProperty]
namespace :: Value Text
haddock_workaround_ :: ()
dimensions :: Maybe [MetricDimensionProperty]
namespace :: 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 [MetricDimensionProperty]
()
Value Text
haddock_workaround_ :: MetricProperty -> ()
dimensions :: MetricProperty -> Maybe [MetricDimensionProperty]
metricName :: MetricProperty -> Value Text
namespace :: MetricProperty -> Value Text
haddock_workaround_ :: ()
dimensions :: Maybe [MetricDimensionProperty]
metricName :: Value Text
namespace :: Value Text
..}
    = MetricProperty {namespace :: Value Text
namespace = PropertyType "Namespace" MetricProperty
Value Text
newValue, Maybe [MetricDimensionProperty]
()
Value Text
haddock_workaround_ :: ()
dimensions :: Maybe [MetricDimensionProperty]
metricName :: Value Text
haddock_workaround_ :: ()
dimensions :: Maybe [MetricDimensionProperty]
metricName :: Value Text
..}