module Stratosphere.AutoScaling.AutoScalingGroup.InstanceMaintenancePolicyProperty (
        InstanceMaintenancePolicyProperty(..),
        mkInstanceMaintenancePolicyProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data InstanceMaintenancePolicyProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-instancemaintenancepolicy.html>
    InstanceMaintenancePolicyProperty {InstanceMaintenancePolicyProperty -> ()
haddock_workaround_ :: (),
                                       -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-instancemaintenancepolicy.html#cfn-autoscaling-autoscalinggroup-instancemaintenancepolicy-maxhealthypercentage>
                                       InstanceMaintenancePolicyProperty -> Maybe (Value Integer)
maxHealthyPercentage :: (Prelude.Maybe (Value Prelude.Integer)),
                                       -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-instancemaintenancepolicy.html#cfn-autoscaling-autoscalinggroup-instancemaintenancepolicy-minhealthypercentage>
                                       InstanceMaintenancePolicyProperty -> Maybe (Value Integer)
minHealthyPercentage :: (Prelude.Maybe (Value Prelude.Integer))}
  deriving stock (InstanceMaintenancePolicyProperty
-> InstanceMaintenancePolicyProperty -> Bool
(InstanceMaintenancePolicyProperty
 -> InstanceMaintenancePolicyProperty -> Bool)
-> (InstanceMaintenancePolicyProperty
    -> InstanceMaintenancePolicyProperty -> Bool)
-> Eq InstanceMaintenancePolicyProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InstanceMaintenancePolicyProperty
-> InstanceMaintenancePolicyProperty -> Bool
== :: InstanceMaintenancePolicyProperty
-> InstanceMaintenancePolicyProperty -> Bool
$c/= :: InstanceMaintenancePolicyProperty
-> InstanceMaintenancePolicyProperty -> Bool
/= :: InstanceMaintenancePolicyProperty
-> InstanceMaintenancePolicyProperty -> Bool
Prelude.Eq, Int -> InstanceMaintenancePolicyProperty -> ShowS
[InstanceMaintenancePolicyProperty] -> ShowS
InstanceMaintenancePolicyProperty -> String
(Int -> InstanceMaintenancePolicyProperty -> ShowS)
-> (InstanceMaintenancePolicyProperty -> String)
-> ([InstanceMaintenancePolicyProperty] -> ShowS)
-> Show InstanceMaintenancePolicyProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InstanceMaintenancePolicyProperty -> ShowS
showsPrec :: Int -> InstanceMaintenancePolicyProperty -> ShowS
$cshow :: InstanceMaintenancePolicyProperty -> String
show :: InstanceMaintenancePolicyProperty -> String
$cshowList :: [InstanceMaintenancePolicyProperty] -> ShowS
showList :: [InstanceMaintenancePolicyProperty] -> ShowS
Prelude.Show)
mkInstanceMaintenancePolicyProperty ::
  InstanceMaintenancePolicyProperty
mkInstanceMaintenancePolicyProperty :: InstanceMaintenancePolicyProperty
mkInstanceMaintenancePolicyProperty
  = InstanceMaintenancePolicyProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), maxHealthyPercentage :: Maybe (Value Integer)
maxHealthyPercentage = Maybe (Value Integer)
forall a. Maybe a
Prelude.Nothing,
       minHealthyPercentage :: Maybe (Value Integer)
minHealthyPercentage = Maybe (Value Integer)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties InstanceMaintenancePolicyProperty where
  toResourceProperties :: InstanceMaintenancePolicyProperty -> ResourceProperties
toResourceProperties InstanceMaintenancePolicyProperty {Maybe (Value Integer)
()
haddock_workaround_ :: InstanceMaintenancePolicyProperty -> ()
maxHealthyPercentage :: InstanceMaintenancePolicyProperty -> Maybe (Value Integer)
minHealthyPercentage :: InstanceMaintenancePolicyProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
maxHealthyPercentage :: Maybe (Value Integer)
minHealthyPercentage :: Maybe (Value Integer)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::AutoScaling::AutoScalingGroup.InstanceMaintenancePolicy",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                           [Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"MaxHealthyPercentage" (Value Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
maxHealthyPercentage,
                            Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"MinHealthyPercentage"
                              (Value Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
minHealthyPercentage])}
instance JSON.ToJSON InstanceMaintenancePolicyProperty where
  toJSON :: InstanceMaintenancePolicyProperty -> Value
toJSON InstanceMaintenancePolicyProperty {Maybe (Value Integer)
()
haddock_workaround_ :: InstanceMaintenancePolicyProperty -> ()
maxHealthyPercentage :: InstanceMaintenancePolicyProperty -> Maybe (Value Integer)
minHealthyPercentage :: InstanceMaintenancePolicyProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
maxHealthyPercentage :: Maybe (Value Integer)
minHealthyPercentage :: Maybe (Value Integer)
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
              [Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"MaxHealthyPercentage" (Value Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
maxHealthyPercentage,
               Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"MinHealthyPercentage"
                 (Value Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
minHealthyPercentage]))
instance Property "MaxHealthyPercentage" InstanceMaintenancePolicyProperty where
  type PropertyType "MaxHealthyPercentage" InstanceMaintenancePolicyProperty = Value Prelude.Integer
  set :: PropertyType
  "MaxHealthyPercentage" InstanceMaintenancePolicyProperty
-> InstanceMaintenancePolicyProperty
-> InstanceMaintenancePolicyProperty
set PropertyType
  "MaxHealthyPercentage" InstanceMaintenancePolicyProperty
newValue InstanceMaintenancePolicyProperty {Maybe (Value Integer)
()
haddock_workaround_ :: InstanceMaintenancePolicyProperty -> ()
maxHealthyPercentage :: InstanceMaintenancePolicyProperty -> Maybe (Value Integer)
minHealthyPercentage :: InstanceMaintenancePolicyProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
maxHealthyPercentage :: Maybe (Value Integer)
minHealthyPercentage :: Maybe (Value Integer)
..}
    = InstanceMaintenancePolicyProperty
        {maxHealthyPercentage :: Maybe (Value Integer)
maxHealthyPercentage = Value Integer -> Maybe (Value Integer)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType
  "MaxHealthyPercentage" InstanceMaintenancePolicyProperty
Value Integer
newValue, Maybe (Value Integer)
()
haddock_workaround_ :: ()
minHealthyPercentage :: Maybe (Value Integer)
haddock_workaround_ :: ()
minHealthyPercentage :: Maybe (Value Integer)
..}
instance Property "MinHealthyPercentage" InstanceMaintenancePolicyProperty where
  type PropertyType "MinHealthyPercentage" InstanceMaintenancePolicyProperty = Value Prelude.Integer
  set :: PropertyType
  "MinHealthyPercentage" InstanceMaintenancePolicyProperty
-> InstanceMaintenancePolicyProperty
-> InstanceMaintenancePolicyProperty
set PropertyType
  "MinHealthyPercentage" InstanceMaintenancePolicyProperty
newValue InstanceMaintenancePolicyProperty {Maybe (Value Integer)
()
haddock_workaround_ :: InstanceMaintenancePolicyProperty -> ()
maxHealthyPercentage :: InstanceMaintenancePolicyProperty -> Maybe (Value Integer)
minHealthyPercentage :: InstanceMaintenancePolicyProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
maxHealthyPercentage :: Maybe (Value Integer)
minHealthyPercentage :: Maybe (Value Integer)
..}
    = InstanceMaintenancePolicyProperty
        {minHealthyPercentage :: Maybe (Value Integer)
minHealthyPercentage = Value Integer -> Maybe (Value Integer)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType
  "MinHealthyPercentage" InstanceMaintenancePolicyProperty
Value Integer
newValue, Maybe (Value Integer)
()
haddock_workaround_ :: ()
maxHealthyPercentage :: Maybe (Value Integer)
haddock_workaround_ :: ()
maxHealthyPercentage :: Maybe (Value Integer)
..}