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

com.pulumi.gcp.cloudrunv2.kotlin.inputs.JobTemplateArgs.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.

There is a newer version: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.cloudrunv2.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.cloudrunv2.inputs.JobTemplateArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 *
 * @property annotations Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.
 * Cloud Run API v2 does not support annotations with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
 * All system annotations in v1 now have a corresponding field in v2 ExecutionTemplate.
 * This field follows Kubernetes annotations' namespacing, limits, and rules.
 * @property labels Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google's billing system, so they can be used to filter,
 * or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or
 * https://cloud.google.com/run/docs/configuring/labels.
 * Cloud Run API v2 does not support labels with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
 * All system labels in v1 now have a corresponding field in v2 ExecutionTemplate.
 * @property parallelism Specifies the maximum desired number of tasks the execution should run at given time. Must be <= taskCount. When the job is run, if this field is 0 or unset, the maximum possible value will be used for that execution. The actual number of tasks running in steady state will be less than this number when there are fewer tasks waiting to be completed remaining, i.e. when the work left to do is less than max parallelism.
 * @property taskCount Specifies the desired number of tasks the execution should run. Setting to 1 means that parallelism is limited to 1 and the success of that task signals the success of the execution. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
 * @property template Describes the task(s) that will be created when executing an execution
 * Structure is documented below.
 */
public data class JobTemplateArgs(
    public val annotations: Output>? = null,
    public val labels: Output>? = null,
    public val parallelism: Output? = null,
    public val taskCount: Output? = null,
    public val template: Output,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.cloudrunv2.inputs.JobTemplateArgs =
        com.pulumi.gcp.cloudrunv2.inputs.JobTemplateArgs.builder()
            .annotations(
                annotations?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .parallelism(parallelism?.applyValue({ args0 -> args0 }))
            .taskCount(taskCount?.applyValue({ args0 -> args0 }))
            .template(template.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [JobTemplateArgs].
 */
@PulumiTagMarker
public class JobTemplateArgsBuilder internal constructor() {
    private var annotations: Output>? = null

    private var labels: Output>? = null

    private var parallelism: Output? = null

    private var taskCount: Output? = null

    private var template: Output? = null

    /**
     * @param value Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.
     * Cloud Run API v2 does not support annotations with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
     * All system annotations in v1 now have a corresponding field in v2 ExecutionTemplate.
     * This field follows Kubernetes annotations' namespacing, limits, and rules.
     */
    @JvmName("etscvmlixqusowue")
    public suspend fun annotations(`value`: Output>) {
        this.annotations = value
    }

    /**
     * @param value Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google's billing system, so they can be used to filter,
     * or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or
     * https://cloud.google.com/run/docs/configuring/labels.
     * Cloud Run API v2 does not support labels with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
     * All system labels in v1 now have a corresponding field in v2 ExecutionTemplate.
     */
    @JvmName("rhvmncevrjcglwts")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value Specifies the maximum desired number of tasks the execution should run at given time. Must be <= taskCount. When the job is run, if this field is 0 or unset, the maximum possible value will be used for that execution. The actual number of tasks running in steady state will be less than this number when there are fewer tasks waiting to be completed remaining, i.e. when the work left to do is less than max parallelism.
     */
    @JvmName("lmgqodojogqfuojb")
    public suspend fun parallelism(`value`: Output) {
        this.parallelism = value
    }

    /**
     * @param value Specifies the desired number of tasks the execution should run. Setting to 1 means that parallelism is limited to 1 and the success of that task signals the success of the execution. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
     */
    @JvmName("uikwpolfhpjjemit")
    public suspend fun taskCount(`value`: Output) {
        this.taskCount = value
    }

    /**
     * @param value Describes the task(s) that will be created when executing an execution
     * Structure is documented below.
     */
    @JvmName("ubrvaionchabtcrh")
    public suspend fun template(`value`: Output) {
        this.template = value
    }

    /**
     * @param value Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.
     * Cloud Run API v2 does not support annotations with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
     * All system annotations in v1 now have a corresponding field in v2 ExecutionTemplate.
     * This field follows Kubernetes annotations' namespacing, limits, and rules.
     */
    @JvmName("tgtkahtloqunbxrx")
    public suspend fun annotations(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.annotations = mapped
    }

    /**
     * @param values Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.
     * Cloud Run API v2 does not support annotations with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
     * All system annotations in v1 now have a corresponding field in v2 ExecutionTemplate.
     * This field follows Kubernetes annotations' namespacing, limits, and rules.
     */
    @JvmName("jarsgtlnllvgwuhm")
    public fun annotations(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.annotations = mapped
    }

    /**
     * @param value Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google's billing system, so they can be used to filter,
     * or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or
     * https://cloud.google.com/run/docs/configuring/labels.
     * Cloud Run API v2 does not support labels with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
     * All system labels in v1 now have a corresponding field in v2 ExecutionTemplate.
     */
    @JvmName("iqfwsjvvydmhjkmi")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google's billing system, so they can be used to filter,
     * or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or
     * https://cloud.google.com/run/docs/configuring/labels.
     * Cloud Run API v2 does not support labels with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
     * All system labels in v1 now have a corresponding field in v2 ExecutionTemplate.
     */
    @JvmName("vocmnkynlvxwkhxo")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value Specifies the maximum desired number of tasks the execution should run at given time. Must be <= taskCount. When the job is run, if this field is 0 or unset, the maximum possible value will be used for that execution. The actual number of tasks running in steady state will be less than this number when there are fewer tasks waiting to be completed remaining, i.e. when the work left to do is less than max parallelism.
     */
    @JvmName("fleemlpemabdkocu")
    public suspend fun parallelism(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.parallelism = mapped
    }

    /**
     * @param value Specifies the desired number of tasks the execution should run. Setting to 1 means that parallelism is limited to 1 and the success of that task signals the success of the execution. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
     */
    @JvmName("cpvbdwakhpqmoodl")
    public suspend fun taskCount(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.taskCount = mapped
    }

    /**
     * @param value Describes the task(s) that will be created when executing an execution
     * Structure is documented below.
     */
    @JvmName("wemltnokquefeoqo")
    public suspend fun template(`value`: JobTemplateTemplateArgs) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.template = mapped
    }

    /**
     * @param argument Describes the task(s) that will be created when executing an execution
     * Structure is documented below.
     */
    @JvmName("poablviimupvkdcl")
    public suspend fun template(argument: suspend JobTemplateTemplateArgsBuilder.() -> Unit) {
        val toBeMapped = JobTemplateTemplateArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.template = mapped
    }

    internal fun build(): JobTemplateArgs = JobTemplateArgs(
        annotations = annotations,
        labels = labels,
        parallelism = parallelism,
        taskCount = taskCount,
        template = template ?: throw PulumiNullFieldException("template"),
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy