module Stratosphere.GameLift.GameServerGroup.AutoScalingPolicyProperty (
        module Exports, AutoScalingPolicyProperty(..),
        mkAutoScalingPolicyProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.GameLift.GameServerGroup.TargetTrackingConfigurationProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data AutoScalingPolicyProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-gamelift-gameservergroup-autoscalingpolicy.html>
    AutoScalingPolicyProperty {AutoScalingPolicyProperty -> ()
haddock_workaround_ :: (),
                               -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-gamelift-gameservergroup-autoscalingpolicy.html#cfn-gamelift-gameservergroup-autoscalingpolicy-estimatedinstancewarmup>
                               AutoScalingPolicyProperty -> Maybe (Value Double)
estimatedInstanceWarmup :: (Prelude.Maybe (Value Prelude.Double)),
                               -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-gamelift-gameservergroup-autoscalingpolicy.html#cfn-gamelift-gameservergroup-autoscalingpolicy-targettrackingconfiguration>
                               AutoScalingPolicyProperty -> TargetTrackingConfigurationProperty
targetTrackingConfiguration :: TargetTrackingConfigurationProperty}
  deriving stock (AutoScalingPolicyProperty -> AutoScalingPolicyProperty -> Bool
(AutoScalingPolicyProperty -> AutoScalingPolicyProperty -> Bool)
-> (AutoScalingPolicyProperty -> AutoScalingPolicyProperty -> Bool)
-> Eq AutoScalingPolicyProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AutoScalingPolicyProperty -> AutoScalingPolicyProperty -> Bool
== :: AutoScalingPolicyProperty -> AutoScalingPolicyProperty -> Bool
$c/= :: AutoScalingPolicyProperty -> AutoScalingPolicyProperty -> Bool
/= :: AutoScalingPolicyProperty -> AutoScalingPolicyProperty -> Bool
Prelude.Eq, Int -> AutoScalingPolicyProperty -> ShowS
[AutoScalingPolicyProperty] -> ShowS
AutoScalingPolicyProperty -> String
(Int -> AutoScalingPolicyProperty -> ShowS)
-> (AutoScalingPolicyProperty -> String)
-> ([AutoScalingPolicyProperty] -> ShowS)
-> Show AutoScalingPolicyProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AutoScalingPolicyProperty -> ShowS
showsPrec :: Int -> AutoScalingPolicyProperty -> ShowS
$cshow :: AutoScalingPolicyProperty -> String
show :: AutoScalingPolicyProperty -> String
$cshowList :: [AutoScalingPolicyProperty] -> ShowS
showList :: [AutoScalingPolicyProperty] -> ShowS
Prelude.Show)
mkAutoScalingPolicyProperty ::
  TargetTrackingConfigurationProperty -> AutoScalingPolicyProperty
mkAutoScalingPolicyProperty :: TargetTrackingConfigurationProperty -> AutoScalingPolicyProperty
mkAutoScalingPolicyProperty TargetTrackingConfigurationProperty
targetTrackingConfiguration
  = AutoScalingPolicyProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (),
       targetTrackingConfiguration :: TargetTrackingConfigurationProperty
targetTrackingConfiguration = TargetTrackingConfigurationProperty
targetTrackingConfiguration,
       estimatedInstanceWarmup :: Maybe (Value Double)
estimatedInstanceWarmup = Maybe (Value Double)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties AutoScalingPolicyProperty where
  toResourceProperties :: AutoScalingPolicyProperty -> ResourceProperties
toResourceProperties AutoScalingPolicyProperty {Maybe (Value Double)
()
TargetTrackingConfigurationProperty
haddock_workaround_ :: AutoScalingPolicyProperty -> ()
estimatedInstanceWarmup :: AutoScalingPolicyProperty -> Maybe (Value Double)
targetTrackingConfiguration :: AutoScalingPolicyProperty -> TargetTrackingConfigurationProperty
haddock_workaround_ :: ()
estimatedInstanceWarmup :: Maybe (Value Double)
targetTrackingConfiguration :: TargetTrackingConfigurationProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::GameLift::GameServerGroup.AutoScalingPolicy",
         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
"TargetTrackingConfiguration" Key -> TargetTrackingConfigurationProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= TargetTrackingConfigurationProperty
targetTrackingConfiguration]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> Value Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"EstimatedInstanceWarmup"
                                 (Value Double -> (Key, Value))
-> Maybe (Value Double) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Double)
estimatedInstanceWarmup]))}
instance JSON.ToJSON AutoScalingPolicyProperty where
  toJSON :: AutoScalingPolicyProperty -> Value
toJSON AutoScalingPolicyProperty {Maybe (Value Double)
()
TargetTrackingConfigurationProperty
haddock_workaround_ :: AutoScalingPolicyProperty -> ()
estimatedInstanceWarmup :: AutoScalingPolicyProperty -> Maybe (Value Double)
targetTrackingConfiguration :: AutoScalingPolicyProperty -> TargetTrackingConfigurationProperty
haddock_workaround_ :: ()
estimatedInstanceWarmup :: Maybe (Value Double)
targetTrackingConfiguration :: TargetTrackingConfigurationProperty
..}
    = [(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
"TargetTrackingConfiguration" Key -> TargetTrackingConfigurationProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= TargetTrackingConfigurationProperty
targetTrackingConfiguration]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> Value Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"EstimatedInstanceWarmup"
                    (Value Double -> (Key, Value))
-> Maybe (Value Double) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Double)
estimatedInstanceWarmup])))
instance Property "EstimatedInstanceWarmup" AutoScalingPolicyProperty where
  type PropertyType "EstimatedInstanceWarmup" AutoScalingPolicyProperty = Value Prelude.Double
  set :: PropertyType "EstimatedInstanceWarmup" AutoScalingPolicyProperty
-> AutoScalingPolicyProperty -> AutoScalingPolicyProperty
set PropertyType "EstimatedInstanceWarmup" AutoScalingPolicyProperty
newValue AutoScalingPolicyProperty {Maybe (Value Double)
()
TargetTrackingConfigurationProperty
haddock_workaround_ :: AutoScalingPolicyProperty -> ()
estimatedInstanceWarmup :: AutoScalingPolicyProperty -> Maybe (Value Double)
targetTrackingConfiguration :: AutoScalingPolicyProperty -> TargetTrackingConfigurationProperty
haddock_workaround_ :: ()
estimatedInstanceWarmup :: Maybe (Value Double)
targetTrackingConfiguration :: TargetTrackingConfigurationProperty
..}
    = AutoScalingPolicyProperty
        {estimatedInstanceWarmup :: Maybe (Value Double)
estimatedInstanceWarmup = Value Double -> Maybe (Value Double)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "EstimatedInstanceWarmup" AutoScalingPolicyProperty
Value Double
newValue, ()
TargetTrackingConfigurationProperty
haddock_workaround_ :: ()
targetTrackingConfiguration :: TargetTrackingConfigurationProperty
haddock_workaround_ :: ()
targetTrackingConfiguration :: TargetTrackingConfigurationProperty
..}
instance Property "TargetTrackingConfiguration" AutoScalingPolicyProperty where
  type PropertyType "TargetTrackingConfiguration" AutoScalingPolicyProperty = TargetTrackingConfigurationProperty
  set :: PropertyType
  "TargetTrackingConfiguration" AutoScalingPolicyProperty
-> AutoScalingPolicyProperty -> AutoScalingPolicyProperty
set PropertyType
  "TargetTrackingConfiguration" AutoScalingPolicyProperty
newValue AutoScalingPolicyProperty {Maybe (Value Double)
()
TargetTrackingConfigurationProperty
haddock_workaround_ :: AutoScalingPolicyProperty -> ()
estimatedInstanceWarmup :: AutoScalingPolicyProperty -> Maybe (Value Double)
targetTrackingConfiguration :: AutoScalingPolicyProperty -> TargetTrackingConfigurationProperty
haddock_workaround_ :: ()
estimatedInstanceWarmup :: Maybe (Value Double)
targetTrackingConfiguration :: TargetTrackingConfigurationProperty
..}
    = AutoScalingPolicyProperty
        {targetTrackingConfiguration :: TargetTrackingConfigurationProperty
targetTrackingConfiguration = PropertyType
  "TargetTrackingConfiguration" AutoScalingPolicyProperty
TargetTrackingConfigurationProperty
newValue, Maybe (Value Double)
()
haddock_workaround_ :: ()
estimatedInstanceWarmup :: Maybe (Value Double)
haddock_workaround_ :: ()
estimatedInstanceWarmup :: Maybe (Value Double)
..}