module Stratosphere.AutoScaling.AutoScalingGroup.MetricsCollectionProperty (
        MetricsCollectionProperty(..), mkMetricsCollectionProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data MetricsCollectionProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-metricscollection.html>
    MetricsCollectionProperty {MetricsCollectionProperty -> ()
haddock_workaround_ :: (),
                               -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-metricscollection.html#cfn-autoscaling-autoscalinggroup-metricscollection-granularity>
                               MetricsCollectionProperty -> Value Text
granularity :: (Value Prelude.Text),
                               -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-metricscollection.html#cfn-autoscaling-autoscalinggroup-metricscollection-metrics>
                               MetricsCollectionProperty -> Maybe (ValueList Text)
metrics :: (Prelude.Maybe (ValueList Prelude.Text))}
  deriving stock (MetricsCollectionProperty -> MetricsCollectionProperty -> Bool
(MetricsCollectionProperty -> MetricsCollectionProperty -> Bool)
-> (MetricsCollectionProperty -> MetricsCollectionProperty -> Bool)
-> Eq MetricsCollectionProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MetricsCollectionProperty -> MetricsCollectionProperty -> Bool
== :: MetricsCollectionProperty -> MetricsCollectionProperty -> Bool
$c/= :: MetricsCollectionProperty -> MetricsCollectionProperty -> Bool
/= :: MetricsCollectionProperty -> MetricsCollectionProperty -> Bool
Prelude.Eq, Int -> MetricsCollectionProperty -> ShowS
[MetricsCollectionProperty] -> ShowS
MetricsCollectionProperty -> String
(Int -> MetricsCollectionProperty -> ShowS)
-> (MetricsCollectionProperty -> String)
-> ([MetricsCollectionProperty] -> ShowS)
-> Show MetricsCollectionProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MetricsCollectionProperty -> ShowS
showsPrec :: Int -> MetricsCollectionProperty -> ShowS
$cshow :: MetricsCollectionProperty -> String
show :: MetricsCollectionProperty -> String
$cshowList :: [MetricsCollectionProperty] -> ShowS
showList :: [MetricsCollectionProperty] -> ShowS
Prelude.Show)
mkMetricsCollectionProperty ::
  Value Prelude.Text -> MetricsCollectionProperty
mkMetricsCollectionProperty :: Value Text -> MetricsCollectionProperty
mkMetricsCollectionProperty Value Text
granularity
  = MetricsCollectionProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), granularity :: Value Text
granularity = Value Text
granularity,
       metrics :: Maybe (ValueList Text)
metrics = Maybe (ValueList Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties MetricsCollectionProperty where
  toResourceProperties :: MetricsCollectionProperty -> ResourceProperties
toResourceProperties MetricsCollectionProperty {Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: MetricsCollectionProperty -> ()
granularity :: MetricsCollectionProperty -> Value Text
metrics :: MetricsCollectionProperty -> Maybe (ValueList Text)
haddock_workaround_ :: ()
granularity :: Value Text
metrics :: Maybe (ValueList Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::AutoScaling::AutoScalingGroup.MetricsCollection",
         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
"Granularity" 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
granularity]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> ValueList 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
"Metrics" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
metrics]))}
instance JSON.ToJSON MetricsCollectionProperty where
  toJSON :: MetricsCollectionProperty -> Value
toJSON MetricsCollectionProperty {Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: MetricsCollectionProperty -> ()
granularity :: MetricsCollectionProperty -> Value Text
metrics :: MetricsCollectionProperty -> Maybe (ValueList Text)
haddock_workaround_ :: ()
granularity :: Value Text
metrics :: Maybe (ValueList 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
"Granularity" 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
granularity]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> ValueList 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
"Metrics" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
metrics])))
instance Property "Granularity" MetricsCollectionProperty where
  type PropertyType "Granularity" MetricsCollectionProperty = Value Prelude.Text
  set :: PropertyType "Granularity" MetricsCollectionProperty
-> MetricsCollectionProperty -> MetricsCollectionProperty
set PropertyType "Granularity" MetricsCollectionProperty
newValue MetricsCollectionProperty {Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: MetricsCollectionProperty -> ()
granularity :: MetricsCollectionProperty -> Value Text
metrics :: MetricsCollectionProperty -> Maybe (ValueList Text)
haddock_workaround_ :: ()
granularity :: Value Text
metrics :: Maybe (ValueList Text)
..}
    = MetricsCollectionProperty {granularity :: Value Text
granularity = PropertyType "Granularity" MetricsCollectionProperty
Value Text
newValue, Maybe (ValueList Text)
()
haddock_workaround_ :: ()
metrics :: Maybe (ValueList Text)
haddock_workaround_ :: ()
metrics :: Maybe (ValueList Text)
..}
instance Property "Metrics" MetricsCollectionProperty where
  type PropertyType "Metrics" MetricsCollectionProperty = ValueList Prelude.Text
  set :: PropertyType "Metrics" MetricsCollectionProperty
-> MetricsCollectionProperty -> MetricsCollectionProperty
set PropertyType "Metrics" MetricsCollectionProperty
newValue MetricsCollectionProperty {Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: MetricsCollectionProperty -> ()
granularity :: MetricsCollectionProperty -> Value Text
metrics :: MetricsCollectionProperty -> Maybe (ValueList Text)
haddock_workaround_ :: ()
granularity :: Value Text
metrics :: Maybe (ValueList Text)
..}
    = MetricsCollectionProperty {metrics :: Maybe (ValueList Text)
metrics = ValueList Text -> Maybe (ValueList Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Metrics" MetricsCollectionProperty
ValueList Text
newValue, ()
Value Text
haddock_workaround_ :: ()
granularity :: Value Text
haddock_workaround_ :: ()
granularity :: Value Text
..}