module Stratosphere.AutoScaling.AutoScalingGroup.MixedInstancesPolicyProperty (
        module Exports, MixedInstancesPolicyProperty(..),
        mkMixedInstancesPolicyProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.AutoScaling.AutoScalingGroup.InstancesDistributionProperty as Exports
import {-# SOURCE #-} Stratosphere.AutoScaling.AutoScalingGroup.LaunchTemplateProperty as Exports
import Stratosphere.ResourceProperties
data MixedInstancesPolicyProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy.html>
    MixedInstancesPolicyProperty {MixedInstancesPolicyProperty -> ()
haddock_workaround_ :: (),
                                  -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy.html#cfn-autoscaling-autoscalinggroup-mixedinstancespolicy-instancesdistribution>
                                  MixedInstancesPolicyProperty -> Maybe InstancesDistributionProperty
instancesDistribution :: (Prelude.Maybe InstancesDistributionProperty),
                                  -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy.html#cfn-autoscaling-autoscalinggroup-mixedinstancespolicy-launchtemplate>
                                  MixedInstancesPolicyProperty -> LaunchTemplateProperty
launchTemplate :: LaunchTemplateProperty}
  deriving stock (MixedInstancesPolicyProperty
-> MixedInstancesPolicyProperty -> Bool
(MixedInstancesPolicyProperty
 -> MixedInstancesPolicyProperty -> Bool)
-> (MixedInstancesPolicyProperty
    -> MixedInstancesPolicyProperty -> Bool)
-> Eq MixedInstancesPolicyProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MixedInstancesPolicyProperty
-> MixedInstancesPolicyProperty -> Bool
== :: MixedInstancesPolicyProperty
-> MixedInstancesPolicyProperty -> Bool
$c/= :: MixedInstancesPolicyProperty
-> MixedInstancesPolicyProperty -> Bool
/= :: MixedInstancesPolicyProperty
-> MixedInstancesPolicyProperty -> Bool
Prelude.Eq, Int -> MixedInstancesPolicyProperty -> ShowS
[MixedInstancesPolicyProperty] -> ShowS
MixedInstancesPolicyProperty -> String
(Int -> MixedInstancesPolicyProperty -> ShowS)
-> (MixedInstancesPolicyProperty -> String)
-> ([MixedInstancesPolicyProperty] -> ShowS)
-> Show MixedInstancesPolicyProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MixedInstancesPolicyProperty -> ShowS
showsPrec :: Int -> MixedInstancesPolicyProperty -> ShowS
$cshow :: MixedInstancesPolicyProperty -> String
show :: MixedInstancesPolicyProperty -> String
$cshowList :: [MixedInstancesPolicyProperty] -> ShowS
showList :: [MixedInstancesPolicyProperty] -> ShowS
Prelude.Show)
mkMixedInstancesPolicyProperty ::
  LaunchTemplateProperty -> MixedInstancesPolicyProperty
mkMixedInstancesPolicyProperty :: LaunchTemplateProperty -> MixedInstancesPolicyProperty
mkMixedInstancesPolicyProperty LaunchTemplateProperty
launchTemplate
  = MixedInstancesPolicyProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), launchTemplate :: LaunchTemplateProperty
launchTemplate = LaunchTemplateProperty
launchTemplate,
       instancesDistribution :: Maybe InstancesDistributionProperty
instancesDistribution = Maybe InstancesDistributionProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties MixedInstancesPolicyProperty where
  toResourceProperties :: MixedInstancesPolicyProperty -> ResourceProperties
toResourceProperties MixedInstancesPolicyProperty {Maybe InstancesDistributionProperty
()
LaunchTemplateProperty
haddock_workaround_ :: MixedInstancesPolicyProperty -> ()
instancesDistribution :: MixedInstancesPolicyProperty -> Maybe InstancesDistributionProperty
launchTemplate :: MixedInstancesPolicyProperty -> LaunchTemplateProperty
haddock_workaround_ :: ()
instancesDistribution :: Maybe InstancesDistributionProperty
launchTemplate :: LaunchTemplateProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::AutoScaling::AutoScalingGroup.MixedInstancesPolicy",
         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
"LaunchTemplate" Key -> LaunchTemplateProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= LaunchTemplateProperty
launchTemplate]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> InstancesDistributionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"InstancesDistribution"
                                 (InstancesDistributionProperty -> (Key, Value))
-> Maybe InstancesDistributionProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InstancesDistributionProperty
instancesDistribution]))}
instance JSON.ToJSON MixedInstancesPolicyProperty where
  toJSON :: MixedInstancesPolicyProperty -> Value
toJSON MixedInstancesPolicyProperty {Maybe InstancesDistributionProperty
()
LaunchTemplateProperty
haddock_workaround_ :: MixedInstancesPolicyProperty -> ()
instancesDistribution :: MixedInstancesPolicyProperty -> Maybe InstancesDistributionProperty
launchTemplate :: MixedInstancesPolicyProperty -> LaunchTemplateProperty
haddock_workaround_ :: ()
instancesDistribution :: Maybe InstancesDistributionProperty
launchTemplate :: LaunchTemplateProperty
..}
    = [(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
"LaunchTemplate" Key -> LaunchTemplateProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= LaunchTemplateProperty
launchTemplate]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> InstancesDistributionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"InstancesDistribution"
                    (InstancesDistributionProperty -> (Key, Value))
-> Maybe InstancesDistributionProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InstancesDistributionProperty
instancesDistribution])))
instance Property "InstancesDistribution" MixedInstancesPolicyProperty where
  type PropertyType "InstancesDistribution" MixedInstancesPolicyProperty = InstancesDistributionProperty
  set :: PropertyType "InstancesDistribution" MixedInstancesPolicyProperty
-> MixedInstancesPolicyProperty -> MixedInstancesPolicyProperty
set PropertyType "InstancesDistribution" MixedInstancesPolicyProperty
newValue MixedInstancesPolicyProperty {Maybe InstancesDistributionProperty
()
LaunchTemplateProperty
haddock_workaround_ :: MixedInstancesPolicyProperty -> ()
instancesDistribution :: MixedInstancesPolicyProperty -> Maybe InstancesDistributionProperty
launchTemplate :: MixedInstancesPolicyProperty -> LaunchTemplateProperty
haddock_workaround_ :: ()
instancesDistribution :: Maybe InstancesDistributionProperty
launchTemplate :: LaunchTemplateProperty
..}
    = MixedInstancesPolicyProperty
        {instancesDistribution :: Maybe InstancesDistributionProperty
instancesDistribution = InstancesDistributionProperty
-> Maybe InstancesDistributionProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "InstancesDistribution" MixedInstancesPolicyProperty
InstancesDistributionProperty
newValue, ()
LaunchTemplateProperty
haddock_workaround_ :: ()
launchTemplate :: LaunchTemplateProperty
haddock_workaround_ :: ()
launchTemplate :: LaunchTemplateProperty
..}
instance Property "LaunchTemplate" MixedInstancesPolicyProperty where
  type PropertyType "LaunchTemplate" MixedInstancesPolicyProperty = LaunchTemplateProperty
  set :: PropertyType "LaunchTemplate" MixedInstancesPolicyProperty
-> MixedInstancesPolicyProperty -> MixedInstancesPolicyProperty
set PropertyType "LaunchTemplate" MixedInstancesPolicyProperty
newValue MixedInstancesPolicyProperty {Maybe InstancesDistributionProperty
()
LaunchTemplateProperty
haddock_workaround_ :: MixedInstancesPolicyProperty -> ()
instancesDistribution :: MixedInstancesPolicyProperty -> Maybe InstancesDistributionProperty
launchTemplate :: MixedInstancesPolicyProperty -> LaunchTemplateProperty
haddock_workaround_ :: ()
instancesDistribution :: Maybe InstancesDistributionProperty
launchTemplate :: LaunchTemplateProperty
..}
    = MixedInstancesPolicyProperty {launchTemplate :: LaunchTemplateProperty
launchTemplate = PropertyType "LaunchTemplate" MixedInstancesPolicyProperty
LaunchTemplateProperty
newValue, Maybe InstancesDistributionProperty
()
haddock_workaround_ :: ()
instancesDistribution :: Maybe InstancesDistributionProperty
haddock_workaround_ :: ()
instancesDistribution :: Maybe InstancesDistributionProperty
..}