module Stratosphere.ECS.TaskDefinition.RestartPolicyProperty (
        RestartPolicyProperty(..), mkRestartPolicyProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data RestartPolicyProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-restartpolicy.html>
    RestartPolicyProperty {RestartPolicyProperty -> ()
haddock_workaround_ :: (),
                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-restartpolicy.html#cfn-ecs-taskdefinition-restartpolicy-enabled>
                           RestartPolicyProperty -> Maybe (Value Bool)
enabled :: (Prelude.Maybe (Value Prelude.Bool)),
                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-restartpolicy.html#cfn-ecs-taskdefinition-restartpolicy-ignoredexitcodes>
                           RestartPolicyProperty -> Maybe (ValueList Integer)
ignoredExitCodes :: (Prelude.Maybe (ValueList Prelude.Integer)),
                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-restartpolicy.html#cfn-ecs-taskdefinition-restartpolicy-restartattemptperiod>
                           RestartPolicyProperty -> Maybe (Value Integer)
restartAttemptPeriod :: (Prelude.Maybe (Value Prelude.Integer))}
  deriving stock (RestartPolicyProperty -> RestartPolicyProperty -> Bool
(RestartPolicyProperty -> RestartPolicyProperty -> Bool)
-> (RestartPolicyProperty -> RestartPolicyProperty -> Bool)
-> Eq RestartPolicyProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RestartPolicyProperty -> RestartPolicyProperty -> Bool
== :: RestartPolicyProperty -> RestartPolicyProperty -> Bool
$c/= :: RestartPolicyProperty -> RestartPolicyProperty -> Bool
/= :: RestartPolicyProperty -> RestartPolicyProperty -> Bool
Prelude.Eq, Int -> RestartPolicyProperty -> ShowS
[RestartPolicyProperty] -> ShowS
RestartPolicyProperty -> String
(Int -> RestartPolicyProperty -> ShowS)
-> (RestartPolicyProperty -> String)
-> ([RestartPolicyProperty] -> ShowS)
-> Show RestartPolicyProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RestartPolicyProperty -> ShowS
showsPrec :: Int -> RestartPolicyProperty -> ShowS
$cshow :: RestartPolicyProperty -> String
show :: RestartPolicyProperty -> String
$cshowList :: [RestartPolicyProperty] -> ShowS
showList :: [RestartPolicyProperty] -> ShowS
Prelude.Show)
mkRestartPolicyProperty :: RestartPolicyProperty
mkRestartPolicyProperty :: RestartPolicyProperty
mkRestartPolicyProperty
  = RestartPolicyProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), enabled :: Maybe (Value Bool)
enabled = Maybe (Value Bool)
forall a. Maybe a
Prelude.Nothing,
       ignoredExitCodes :: Maybe (ValueList Integer)
ignoredExitCodes = Maybe (ValueList Integer)
forall a. Maybe a
Prelude.Nothing,
       restartAttemptPeriod :: Maybe (Value Integer)
restartAttemptPeriod = Maybe (Value Integer)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties RestartPolicyProperty where
  toResourceProperties :: RestartPolicyProperty -> ResourceProperties
toResourceProperties RestartPolicyProperty {Maybe (ValueList Integer)
Maybe (Value Bool)
Maybe (Value Integer)
()
haddock_workaround_ :: RestartPolicyProperty -> ()
enabled :: RestartPolicyProperty -> Maybe (Value Bool)
ignoredExitCodes :: RestartPolicyProperty -> Maybe (ValueList Integer)
restartAttemptPeriod :: RestartPolicyProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
ignoredExitCodes :: Maybe (ValueList Integer)
restartAttemptPeriod :: Maybe (Value Integer)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::ECS::TaskDefinition.RestartPolicy",
         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 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
"Enabled" (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)
enabled,
                            Key -> ValueList 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
"IgnoredExitCodes" (ValueList Integer -> (Key, Value))
-> Maybe (ValueList Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Integer)
ignoredExitCodes,
                            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
"RestartAttemptPeriod"
                              (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)
restartAttemptPeriod])}
instance JSON.ToJSON RestartPolicyProperty where
  toJSON :: RestartPolicyProperty -> Value
toJSON RestartPolicyProperty {Maybe (ValueList Integer)
Maybe (Value Bool)
Maybe (Value Integer)
()
haddock_workaround_ :: RestartPolicyProperty -> ()
enabled :: RestartPolicyProperty -> Maybe (Value Bool)
ignoredExitCodes :: RestartPolicyProperty -> Maybe (ValueList Integer)
restartAttemptPeriod :: RestartPolicyProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
ignoredExitCodes :: Maybe (ValueList Integer)
restartAttemptPeriod :: 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 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
"Enabled" (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)
enabled,
               Key -> ValueList 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
"IgnoredExitCodes" (ValueList Integer -> (Key, Value))
-> Maybe (ValueList Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Integer)
ignoredExitCodes,
               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
"RestartAttemptPeriod"
                 (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)
restartAttemptPeriod]))
instance Property "Enabled" RestartPolicyProperty where
  type PropertyType "Enabled" RestartPolicyProperty = Value Prelude.Bool
  set :: PropertyType "Enabled" RestartPolicyProperty
-> RestartPolicyProperty -> RestartPolicyProperty
set PropertyType "Enabled" RestartPolicyProperty
newValue RestartPolicyProperty {Maybe (ValueList Integer)
Maybe (Value Bool)
Maybe (Value Integer)
()
haddock_workaround_ :: RestartPolicyProperty -> ()
enabled :: RestartPolicyProperty -> Maybe (Value Bool)
ignoredExitCodes :: RestartPolicyProperty -> Maybe (ValueList Integer)
restartAttemptPeriod :: RestartPolicyProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
ignoredExitCodes :: Maybe (ValueList Integer)
restartAttemptPeriod :: Maybe (Value Integer)
..}
    = RestartPolicyProperty {enabled :: Maybe (Value Bool)
enabled = Value Bool -> Maybe (Value Bool)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Enabled" RestartPolicyProperty
Value Bool
newValue, Maybe (ValueList Integer)
Maybe (Value Integer)
()
haddock_workaround_ :: ()
ignoredExitCodes :: Maybe (ValueList Integer)
restartAttemptPeriod :: Maybe (Value Integer)
haddock_workaround_ :: ()
ignoredExitCodes :: Maybe (ValueList Integer)
restartAttemptPeriod :: Maybe (Value Integer)
..}
instance Property "IgnoredExitCodes" RestartPolicyProperty where
  type PropertyType "IgnoredExitCodes" RestartPolicyProperty = ValueList Prelude.Integer
  set :: PropertyType "IgnoredExitCodes" RestartPolicyProperty
-> RestartPolicyProperty -> RestartPolicyProperty
set PropertyType "IgnoredExitCodes" RestartPolicyProperty
newValue RestartPolicyProperty {Maybe (ValueList Integer)
Maybe (Value Bool)
Maybe (Value Integer)
()
haddock_workaround_ :: RestartPolicyProperty -> ()
enabled :: RestartPolicyProperty -> Maybe (Value Bool)
ignoredExitCodes :: RestartPolicyProperty -> Maybe (ValueList Integer)
restartAttemptPeriod :: RestartPolicyProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
ignoredExitCodes :: Maybe (ValueList Integer)
restartAttemptPeriod :: Maybe (Value Integer)
..}
    = RestartPolicyProperty
        {ignoredExitCodes :: Maybe (ValueList Integer)
ignoredExitCodes = ValueList Integer -> Maybe (ValueList Integer)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "IgnoredExitCodes" RestartPolicyProperty
ValueList Integer
newValue, Maybe (Value Bool)
Maybe (Value Integer)
()
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
restartAttemptPeriod :: Maybe (Value Integer)
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
restartAttemptPeriod :: Maybe (Value Integer)
..}
instance Property "RestartAttemptPeriod" RestartPolicyProperty where
  type PropertyType "RestartAttemptPeriod" RestartPolicyProperty = Value Prelude.Integer
  set :: PropertyType "RestartAttemptPeriod" RestartPolicyProperty
-> RestartPolicyProperty -> RestartPolicyProperty
set PropertyType "RestartAttemptPeriod" RestartPolicyProperty
newValue RestartPolicyProperty {Maybe (ValueList Integer)
Maybe (Value Bool)
Maybe (Value Integer)
()
haddock_workaround_ :: RestartPolicyProperty -> ()
enabled :: RestartPolicyProperty -> Maybe (Value Bool)
ignoredExitCodes :: RestartPolicyProperty -> Maybe (ValueList Integer)
restartAttemptPeriod :: RestartPolicyProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
ignoredExitCodes :: Maybe (ValueList Integer)
restartAttemptPeriod :: Maybe (Value Integer)
..}
    = RestartPolicyProperty
        {restartAttemptPeriod :: Maybe (Value Integer)
restartAttemptPeriod = Value Integer -> Maybe (Value Integer)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "RestartAttemptPeriod" RestartPolicyProperty
Value Integer
newValue, Maybe (ValueList Integer)
Maybe (Value Bool)
()
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
ignoredExitCodes :: Maybe (ValueList Integer)
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
ignoredExitCodes :: Maybe (ValueList Integer)
..}