All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.googlenative.batch.v1.kotlin.outputs.TaskSpecResponse.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.googlenative.batch.v1.kotlin.outputs

import kotlin.Deprecated
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.collections.Map

/**
 * Spec of a task
 * @property computeResource ComputeResource requirements.
 * @property environment Environment variables to set before running the Task.
 * @property environments Deprecated: please use environment(non-plural) instead.
 * @property lifecyclePolicies Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.
 * @property maxRetryCount Maximum number of retries on failures. The default, 0, which means never retry. The valid value range is [0, 10].
 * @property maxRunDuration Maximum duration the task should run. The task will be killed and marked as FAILED if over this limit.
 * @property runnables The sequence of scripts or containers to run for this Task. Each Task using this TaskSpec executes its list of runnables in order. The Task succeeds if all of its runnables either exit with a zero status or any that exit with a non-zero status have the ignore_exit_status flag. Background runnables are killed automatically (if they have not already exited) a short time after all foreground runnables have completed. Even though this is likely to result in a non-zero exit status for the background runnable, these automatic kills are not treated as Task failures.
 * @property volumes Volumes to mount before running Tasks using this TaskSpec.
 */
public data class TaskSpecResponse(
    public val computeResource: ComputeResourceResponse,
    public val environment: EnvironmentResponse,
    @Deprecated(
        message = """
  Deprecated: please use environment(non-plural) instead.
  """,
    )
    public val environments: Map,
    public val lifecyclePolicies: List,
    public val maxRetryCount: Int,
    public val maxRunDuration: String,
    public val runnables: List,
    public val volumes: List,
) {
    public companion object {
        public fun toKotlin(javaType: com.pulumi.googlenative.batch.v1.outputs.TaskSpecResponse): TaskSpecResponse = TaskSpecResponse(
            computeResource = javaType.computeResource().let({ args0 ->
                com.pulumi.googlenative.batch.v1.kotlin.outputs.ComputeResourceResponse.Companion.toKotlin(args0)
            }),
            environment = javaType.environment().let({ args0 ->
                com.pulumi.googlenative.batch.v1.kotlin.outputs.EnvironmentResponse.Companion.toKotlin(args0)
            }),
            environments = javaType.environments().map({ args0 -> args0.key.to(args0.value) }).toMap(),
            lifecyclePolicies = javaType.lifecyclePolicies().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.googlenative.batch.v1.kotlin.outputs.LifecyclePolicyResponse.Companion.toKotlin(args0)
                })
            }),
            maxRetryCount = javaType.maxRetryCount(),
            maxRunDuration = javaType.maxRunDuration(),
            runnables = javaType.runnables().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.googlenative.batch.v1.kotlin.outputs.RunnableResponse.Companion.toKotlin(args0)
                })
            }),
            volumes = javaType.volumes().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.googlenative.batch.v1.kotlin.outputs.VolumeResponse.Companion.toKotlin(args0)
                })
            }),
        )
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy