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

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

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

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

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.googlenative.batch.v1.JobArgs.builder
import com.pulumi.googlenative.batch.v1.kotlin.inputs.AllocationPolicyArgs
import com.pulumi.googlenative.batch.v1.kotlin.inputs.AllocationPolicyArgsBuilder
import com.pulumi.googlenative.batch.v1.kotlin.inputs.JobNotificationArgs
import com.pulumi.googlenative.batch.v1.kotlin.inputs.JobNotificationArgsBuilder
import com.pulumi.googlenative.batch.v1.kotlin.inputs.LogsPolicyArgs
import com.pulumi.googlenative.batch.v1.kotlin.inputs.LogsPolicyArgsBuilder
import com.pulumi.googlenative.batch.v1.kotlin.inputs.TaskGroupArgs
import com.pulumi.googlenative.batch.v1.kotlin.inputs.TaskGroupArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Create a Job.
 * Auto-naming is currently not supported for this resource.
 * @property allocationPolicy Compute resource allocation for all TaskGroups in the Job.
 * @property jobId ID used to uniquely identify the Job within its parent scope. This field should contain at most 63 characters and must start with lowercase characters. Only lowercase characters, numbers and '-' are accepted. The '-' character cannot be the first or the last one. A system generated ID will be used if the field is not set. The job.name field in the request will be ignored and the created resource name of the Job will be "{parent}/jobs/{job_id}".
 * @property labels Labels for the Job. Labels could be user provided or system generated. For example, "labels": { "department": "finance", "environment": "test" } You can assign up to 64 labels. [Google Compute Engine label restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) apply. Label names that start with "goog-" or "google-" are reserved.
 * @property location
 * @property logsPolicy Log preservation policy for the Job.
 * @property notifications Notification configurations.
 * @property priority Priority of the Job. The valid value range is [0, 100). Default value is 0. Higher value indicates higher priority. A job with higher priority value is more likely to run earlier if all other requirements are satisfied.
 * @property project
 * @property requestId Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
 * @property taskGroups TaskGroups in the Job. Only one TaskGroup is supported now.
 */
public data class JobArgs(
    public val allocationPolicy: Output? = null,
    public val jobId: Output? = null,
    public val labels: Output>? = null,
    public val location: Output? = null,
    public val logsPolicy: Output? = null,
    public val notifications: Output>? = null,
    public val priority: Output? = null,
    public val project: Output? = null,
    public val requestId: Output? = null,
    public val taskGroups: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.googlenative.batch.v1.JobArgs =
        com.pulumi.googlenative.batch.v1.JobArgs.builder()
            .allocationPolicy(allocationPolicy?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .jobId(jobId?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .location(location?.applyValue({ args0 -> args0 }))
            .logsPolicy(logsPolicy?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .notifications(
                notifications?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .priority(priority?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .requestId(requestId?.applyValue({ args0 -> args0 }))
            .taskGroups(
                taskGroups?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [JobArgs].
 */
@PulumiTagMarker
public class JobArgsBuilder internal constructor() {
    private var allocationPolicy: Output? = null

    private var jobId: Output? = null

    private var labels: Output>? = null

    private var location: Output? = null

    private var logsPolicy: Output? = null

    private var notifications: Output>? = null

    private var priority: Output? = null

    private var project: Output? = null

    private var requestId: Output? = null

    private var taskGroups: Output>? = null

    /**
     * @param value Compute resource allocation for all TaskGroups in the Job.
     */
    @JvmName("fsevlhhrhwffmvpm")
    public suspend fun allocationPolicy(`value`: Output) {
        this.allocationPolicy = value
    }

    /**
     * @param value ID used to uniquely identify the Job within its parent scope. This field should contain at most 63 characters and must start with lowercase characters. Only lowercase characters, numbers and '-' are accepted. The '-' character cannot be the first or the last one. A system generated ID will be used if the field is not set. The job.name field in the request will be ignored and the created resource name of the Job will be "{parent}/jobs/{job_id}".
     */
    @JvmName("mpfbwgxruoghkwnj")
    public suspend fun jobId(`value`: Output) {
        this.jobId = value
    }

    /**
     * @param value Labels for the Job. Labels could be user provided or system generated. For example, "labels": { "department": "finance", "environment": "test" } You can assign up to 64 labels. [Google Compute Engine label restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) apply. Label names that start with "goog-" or "google-" are reserved.
     */
    @JvmName("jtvxrigtdgomcmwi")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value
     */
    @JvmName("vgvwopcfaoewhxdq")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Log preservation policy for the Job.
     */
    @JvmName("pntcyqgttgkyiokt")
    public suspend fun logsPolicy(`value`: Output) {
        this.logsPolicy = value
    }

    /**
     * @param value Notification configurations.
     */
    @JvmName("rdbbtjcuckjrdvvx")
    public suspend fun notifications(`value`: Output>) {
        this.notifications = value
    }

    @JvmName("ovxlcdguytsqgbit")
    public suspend fun notifications(vararg values: Output) {
        this.notifications = Output.all(values.asList())
    }

    /**
     * @param values Notification configurations.
     */
    @JvmName("acjkspurngbnysng")
    public suspend fun notifications(values: List>) {
        this.notifications = Output.all(values)
    }

    /**
     * @param value Priority of the Job. The valid value range is [0, 100). Default value is 0. Higher value indicates higher priority. A job with higher priority value is more likely to run earlier if all other requirements are satisfied.
     */
    @JvmName("cxxddxiplfmjkxkq")
    public suspend fun priority(`value`: Output) {
        this.priority = value
    }

    /**
     * @param value
     */
    @JvmName("gngttgmjuhxhqsvk")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
     */
    @JvmName("okeyhnuedmgbcppv")
    public suspend fun requestId(`value`: Output) {
        this.requestId = value
    }

    /**
     * @param value TaskGroups in the Job. Only one TaskGroup is supported now.
     */
    @JvmName("jwdfarckhpntygrg")
    public suspend fun taskGroups(`value`: Output>) {
        this.taskGroups = value
    }

    @JvmName("qfuucxigoavagvhi")
    public suspend fun taskGroups(vararg values: Output) {
        this.taskGroups = Output.all(values.asList())
    }

    /**
     * @param values TaskGroups in the Job. Only one TaskGroup is supported now.
     */
    @JvmName("yuuxjlxdkajsrjgs")
    public suspend fun taskGroups(values: List>) {
        this.taskGroups = Output.all(values)
    }

    /**
     * @param value Compute resource allocation for all TaskGroups in the Job.
     */
    @JvmName("qaysxfwmpgyihrrs")
    public suspend fun allocationPolicy(`value`: AllocationPolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allocationPolicy = mapped
    }

    /**
     * @param argument Compute resource allocation for all TaskGroups in the Job.
     */
    @JvmName("ywyligmjbmnurdpf")
    public suspend fun allocationPolicy(argument: suspend AllocationPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = AllocationPolicyArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.allocationPolicy = mapped
    }

    /**
     * @param value ID used to uniquely identify the Job within its parent scope. This field should contain at most 63 characters and must start with lowercase characters. Only lowercase characters, numbers and '-' are accepted. The '-' character cannot be the first or the last one. A system generated ID will be used if the field is not set. The job.name field in the request will be ignored and the created resource name of the Job will be "{parent}/jobs/{job_id}".
     */
    @JvmName("jifsygpvpmanlyfq")
    public suspend fun jobId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.jobId = mapped
    }

    /**
     * @param value Labels for the Job. Labels could be user provided or system generated. For example, "labels": { "department": "finance", "environment": "test" } You can assign up to 64 labels. [Google Compute Engine label restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) apply. Label names that start with "goog-" or "google-" are reserved.
     */
    @JvmName("doqwrrafvwvlmfko")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Labels for the Job. Labels could be user provided or system generated. For example, "labels": { "department": "finance", "environment": "test" } You can assign up to 64 labels. [Google Compute Engine label restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) apply. Label names that start with "goog-" or "google-" are reserved.
     */
    @JvmName("afbktjbabnaanbch")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value
     */
    @JvmName("mrkaxpkmjlvmalvc")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value Log preservation policy for the Job.
     */
    @JvmName("nfibwdadoipiblwj")
    public suspend fun logsPolicy(`value`: LogsPolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.logsPolicy = mapped
    }

    /**
     * @param argument Log preservation policy for the Job.
     */
    @JvmName("owexodeeghkmnbfw")
    public suspend fun logsPolicy(argument: suspend LogsPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = LogsPolicyArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.logsPolicy = mapped
    }

    /**
     * @param value Notification configurations.
     */
    @JvmName("tagbgbwvouccrkai")
    public suspend fun notifications(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.notifications = mapped
    }

    /**
     * @param argument Notification configurations.
     */
    @JvmName("tidkhluadekjlehh")
    public suspend fun notifications(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            JobNotificationArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.notifications = mapped
    }

    /**
     * @param argument Notification configurations.
     */
    @JvmName("lxysofgunffpqllf")
    public suspend fun notifications(vararg argument: suspend JobNotificationArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            JobNotificationArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.notifications = mapped
    }

    /**
     * @param argument Notification configurations.
     */
    @JvmName("kidfgvdwncfrnylx")
    public suspend fun notifications(argument: suspend JobNotificationArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(JobNotificationArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.notifications = mapped
    }

    /**
     * @param values Notification configurations.
     */
    @JvmName("uagwbiwiukwforlt")
    public suspend fun notifications(vararg values: JobNotificationArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.notifications = mapped
    }

    /**
     * @param value Priority of the Job. The valid value range is [0, 100). Default value is 0. Higher value indicates higher priority. A job with higher priority value is more likely to run earlier if all other requirements are satisfied.
     */
    @JvmName("tfgmcbrjoloodmqt")
    public suspend fun priority(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.priority = mapped
    }

    /**
     * @param value
     */
    @JvmName("myfeqcgchyrtklkv")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
     */
    @JvmName("qjmqmkgvpbvrkfwq")
    public suspend fun requestId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.requestId = mapped
    }

    /**
     * @param value TaskGroups in the Job. Only one TaskGroup is supported now.
     */
    @JvmName("rspaokogeartcufk")
    public suspend fun taskGroups(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.taskGroups = mapped
    }

    /**
     * @param argument TaskGroups in the Job. Only one TaskGroup is supported now.
     */
    @JvmName("kgjmbmvevtqkskmv")
    public suspend fun taskGroups(argument: List Unit>) {
        val toBeMapped = argument.toList().map { TaskGroupArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.taskGroups = mapped
    }

    /**
     * @param argument TaskGroups in the Job. Only one TaskGroup is supported now.
     */
    @JvmName("tnhinqhsmxsponhe")
    public suspend fun taskGroups(vararg argument: suspend TaskGroupArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { TaskGroupArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.taskGroups = mapped
    }

    /**
     * @param argument TaskGroups in the Job. Only one TaskGroup is supported now.
     */
    @JvmName("gntyjbqbhotqrcic")
    public suspend fun taskGroups(argument: suspend TaskGroupArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TaskGroupArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.taskGroups = mapped
    }

    /**
     * @param values TaskGroups in the Job. Only one TaskGroup is supported now.
     */
    @JvmName("aakturqhyrbabcjn")
    public suspend fun taskGroups(vararg values: TaskGroupArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.taskGroups = mapped
    }

    internal fun build(): JobArgs = JobArgs(
        allocationPolicy = allocationPolicy,
        jobId = jobId,
        labels = labels,
        location = location,
        logsPolicy = logsPolicy,
        notifications = notifications,
        priority = priority,
        project = project,
        requestId = requestId,
        taskGroups = taskGroups,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy