module Stratosphere.AutoScaling.ScalingPolicy.MetricStatProperty (
module Exports, MetricStatProperty(..), mkMetricStatProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.AutoScaling.ScalingPolicy.MetricProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data MetricStatProperty
=
MetricStatProperty {MetricStatProperty -> ()
haddock_workaround_ :: (),
MetricStatProperty -> MetricProperty
metric :: MetricProperty,
MetricStatProperty -> Value Text
stat :: (Value Prelude.Text),
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.Text -> MetricStatProperty
mkMetricStatProperty :: MetricProperty -> Value Text -> MetricStatProperty
mkMetricStatProperty MetricProperty
metric Value Text
stat
= MetricStatProperty
{haddock_workaround_ :: ()
haddock_workaround_ = (), metric :: MetricProperty
metric = MetricProperty
metric, 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 Text
MetricProperty
haddock_workaround_ :: MetricStatProperty -> ()
metric :: MetricStatProperty -> MetricProperty
stat :: MetricStatProperty -> Value Text
unit :: MetricStatProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
metric :: MetricProperty
stat :: Value Text
unit :: Maybe (Value Text)
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::AutoScaling::ScalingPolicy.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
"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 Text
MetricProperty
haddock_workaround_ :: MetricStatProperty -> ()
metric :: MetricStatProperty -> MetricProperty
stat :: MetricStatProperty -> Value Text
unit :: MetricStatProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
metric :: MetricProperty
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
"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 Text
MetricProperty
haddock_workaround_ :: MetricStatProperty -> ()
metric :: MetricStatProperty -> MetricProperty
stat :: MetricStatProperty -> Value Text
unit :: MetricStatProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
metric :: MetricProperty
stat :: Value Text
unit :: Maybe (Value Text)
..}
= MetricStatProperty {metric :: MetricProperty
metric = PropertyType "Metric" MetricStatProperty
MetricProperty
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
stat :: Value Text
unit :: Maybe (Value Text)
haddock_workaround_ :: ()
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 Text
MetricProperty
haddock_workaround_ :: MetricStatProperty -> ()
metric :: MetricStatProperty -> MetricProperty
stat :: MetricStatProperty -> Value Text
unit :: MetricStatProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
metric :: MetricProperty
stat :: Value Text
unit :: Maybe (Value Text)
..}
= MetricStatProperty {stat :: Value Text
stat = PropertyType "Stat" MetricStatProperty
Value Text
newValue, Maybe (Value Text)
()
MetricProperty
haddock_workaround_ :: ()
metric :: MetricProperty
unit :: Maybe (Value Text)
haddock_workaround_ :: ()
metric :: MetricProperty
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 Text
MetricProperty
haddock_workaround_ :: MetricStatProperty -> ()
metric :: MetricStatProperty -> MetricProperty
stat :: MetricStatProperty -> Value Text
unit :: MetricStatProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
metric :: MetricProperty
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 Text
MetricProperty
haddock_workaround_ :: ()
metric :: MetricProperty
stat :: Value Text
haddock_workaround_ :: ()
metric :: MetricProperty
stat :: Value Text
..}