module Stratosphere.Batch.ComputeEnvironment.UpdatePolicyProperty (
        UpdatePolicyProperty(..), mkUpdatePolicyProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data UpdatePolicyProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-computeenvironment-updatepolicy.html>
    UpdatePolicyProperty {UpdatePolicyProperty -> ()
haddock_workaround_ :: (),
                          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-computeenvironment-updatepolicy.html#cfn-batch-computeenvironment-updatepolicy-jobexecutiontimeoutminutes>
                          UpdatePolicyProperty -> Maybe (Value Integer)
jobExecutionTimeoutMinutes :: (Prelude.Maybe (Value Prelude.Integer)),
                          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-computeenvironment-updatepolicy.html#cfn-batch-computeenvironment-updatepolicy-terminatejobsonupdate>
                          UpdatePolicyProperty -> Maybe (Value Bool)
terminateJobsOnUpdate :: (Prelude.Maybe (Value Prelude.Bool))}
  deriving stock (UpdatePolicyProperty -> UpdatePolicyProperty -> Bool
(UpdatePolicyProperty -> UpdatePolicyProperty -> Bool)
-> (UpdatePolicyProperty -> UpdatePolicyProperty -> Bool)
-> Eq UpdatePolicyProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UpdatePolicyProperty -> UpdatePolicyProperty -> Bool
== :: UpdatePolicyProperty -> UpdatePolicyProperty -> Bool
$c/= :: UpdatePolicyProperty -> UpdatePolicyProperty -> Bool
/= :: UpdatePolicyProperty -> UpdatePolicyProperty -> Bool
Prelude.Eq, Int -> UpdatePolicyProperty -> ShowS
[UpdatePolicyProperty] -> ShowS
UpdatePolicyProperty -> String
(Int -> UpdatePolicyProperty -> ShowS)
-> (UpdatePolicyProperty -> String)
-> ([UpdatePolicyProperty] -> ShowS)
-> Show UpdatePolicyProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UpdatePolicyProperty -> ShowS
showsPrec :: Int -> UpdatePolicyProperty -> ShowS
$cshow :: UpdatePolicyProperty -> String
show :: UpdatePolicyProperty -> String
$cshowList :: [UpdatePolicyProperty] -> ShowS
showList :: [UpdatePolicyProperty] -> ShowS
Prelude.Show)
mkUpdatePolicyProperty :: UpdatePolicyProperty
mkUpdatePolicyProperty :: UpdatePolicyProperty
mkUpdatePolicyProperty
  = UpdatePolicyProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (),
       jobExecutionTimeoutMinutes :: Maybe (Value Integer)
jobExecutionTimeoutMinutes = Maybe (Value Integer)
forall a. Maybe a
Prelude.Nothing,
       terminateJobsOnUpdate :: Maybe (Value Bool)
terminateJobsOnUpdate = Maybe (Value Bool)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties UpdatePolicyProperty where
  toResourceProperties :: UpdatePolicyProperty -> ResourceProperties
toResourceProperties UpdatePolicyProperty {Maybe (Value Bool)
Maybe (Value Integer)
()
haddock_workaround_ :: UpdatePolicyProperty -> ()
jobExecutionTimeoutMinutes :: UpdatePolicyProperty -> Maybe (Value Integer)
terminateJobsOnUpdate :: UpdatePolicyProperty -> Maybe (Value Bool)
haddock_workaround_ :: ()
jobExecutionTimeoutMinutes :: Maybe (Value Integer)
terminateJobsOnUpdate :: Maybe (Value Bool)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Batch::ComputeEnvironment.UpdatePolicy",
         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
"JobExecutionTimeoutMinutes"
                              (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)
jobExecutionTimeoutMinutes,
                            Key -> Value Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"TerminateJobsOnUpdate"
                              (Value Bool -> (Key, Value))
-> Maybe (Value Bool) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Bool)
terminateJobsOnUpdate])}
instance JSON.ToJSON UpdatePolicyProperty where
  toJSON :: UpdatePolicyProperty -> Value
toJSON UpdatePolicyProperty {Maybe (Value Bool)
Maybe (Value Integer)
()
haddock_workaround_ :: UpdatePolicyProperty -> ()
jobExecutionTimeoutMinutes :: UpdatePolicyProperty -> Maybe (Value Integer)
terminateJobsOnUpdate :: UpdatePolicyProperty -> Maybe (Value Bool)
haddock_workaround_ :: ()
jobExecutionTimeoutMinutes :: Maybe (Value Integer)
terminateJobsOnUpdate :: Maybe (Value Bool)
..}
    = [(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
"JobExecutionTimeoutMinutes"
                 (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)
jobExecutionTimeoutMinutes,
               Key -> Value Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"TerminateJobsOnUpdate"
                 (Value Bool -> (Key, Value))
-> Maybe (Value Bool) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Bool)
terminateJobsOnUpdate]))
instance Property "JobExecutionTimeoutMinutes" UpdatePolicyProperty where
  type PropertyType "JobExecutionTimeoutMinutes" UpdatePolicyProperty = Value Prelude.Integer
  set :: PropertyType "JobExecutionTimeoutMinutes" UpdatePolicyProperty
-> UpdatePolicyProperty -> UpdatePolicyProperty
set PropertyType "JobExecutionTimeoutMinutes" UpdatePolicyProperty
newValue UpdatePolicyProperty {Maybe (Value Bool)
Maybe (Value Integer)
()
haddock_workaround_ :: UpdatePolicyProperty -> ()
jobExecutionTimeoutMinutes :: UpdatePolicyProperty -> Maybe (Value Integer)
terminateJobsOnUpdate :: UpdatePolicyProperty -> Maybe (Value Bool)
haddock_workaround_ :: ()
jobExecutionTimeoutMinutes :: Maybe (Value Integer)
terminateJobsOnUpdate :: Maybe (Value Bool)
..}
    = UpdatePolicyProperty
        {jobExecutionTimeoutMinutes :: Maybe (Value Integer)
jobExecutionTimeoutMinutes = Value Integer -> Maybe (Value Integer)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "JobExecutionTimeoutMinutes" UpdatePolicyProperty
Value Integer
newValue, Maybe (Value Bool)
()
haddock_workaround_ :: ()
terminateJobsOnUpdate :: Maybe (Value Bool)
haddock_workaround_ :: ()
terminateJobsOnUpdate :: Maybe (Value Bool)
..}
instance Property "TerminateJobsOnUpdate" UpdatePolicyProperty where
  type PropertyType "TerminateJobsOnUpdate" UpdatePolicyProperty = Value Prelude.Bool
  set :: PropertyType "TerminateJobsOnUpdate" UpdatePolicyProperty
-> UpdatePolicyProperty -> UpdatePolicyProperty
set PropertyType "TerminateJobsOnUpdate" UpdatePolicyProperty
newValue UpdatePolicyProperty {Maybe (Value Bool)
Maybe (Value Integer)
()
haddock_workaround_ :: UpdatePolicyProperty -> ()
jobExecutionTimeoutMinutes :: UpdatePolicyProperty -> Maybe (Value Integer)
terminateJobsOnUpdate :: UpdatePolicyProperty -> Maybe (Value Bool)
haddock_workaround_ :: ()
jobExecutionTimeoutMinutes :: Maybe (Value Integer)
terminateJobsOnUpdate :: Maybe (Value Bool)
..}
    = UpdatePolicyProperty
        {terminateJobsOnUpdate :: Maybe (Value Bool)
terminateJobsOnUpdate = Value Bool -> Maybe (Value Bool)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "TerminateJobsOnUpdate" UpdatePolicyProperty
Value Bool
newValue, Maybe (Value Integer)
()
haddock_workaround_ :: ()
jobExecutionTimeoutMinutes :: Maybe (Value Integer)
haddock_workaround_ :: ()
jobExecutionTimeoutMinutes :: Maybe (Value Integer)
..}