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

com.pulumi.nomad.kotlin.JobArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.nomad.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import com.pulumi.nomad.JobArgs.builder
import com.pulumi.nomad.kotlin.inputs.JobHcl2Args
import com.pulumi.nomad.kotlin.inputs.JobHcl2ArgsBuilder
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 *
 * @property consulToken `(string: )` - Consul token used when registering this job.
 * Will fallback to the value declared in Nomad provider configuration, if any.
 * @property deregisterOnDestroy If true, the job will be deregistered on destroy.
 * @property deregisterOnIdChange `(boolean: true)` - Determines if the job will be
 * deregistered if the ID of the job in the jobspec changes.
 * @property detach `(boolean: true)` - If true, the provider will return immediately
 * after creating or updating, instead of monitoring.
 * @property hcl1 `(boolean: false)` - Set this to `true` to use the previous HCL1
 * parser. This option is provided for backwards compatibility only and should
 * not be used unless absolutely necessary.
 * @property hcl2 `(block: optional)` - Options for the HCL2 jobspec parser.
 * @property jobspec `(string: )` - The contents of the jobspec to register.
 * @property json `(boolean: false)` - Set this to `true` if your jobspec is structured with
 * JSON instead of the default HCL.
 * @property policyOverride `(boolean: false)` - Determines if the job will override any
 * soft-mandatory Sentinel policies and register even if they fail.
 * @property purgeOnDestroy `(boolean: false)` - Set this to true if you want the job to
 * be purged when the resource is destroyed.
 * @property readAllocationIds
 * @property rerunIfDead `(boolean: false)` - Set this to true to force the job to run
 * again if its status is `dead`.
 * @property vaultToken `(string: )` - Vault token used when registering this job.
 * Will fallback to the value declared in Nomad provider configuration, if any.
 */
public data class JobArgs(
    public val consulToken: Output? = null,
    public val deregisterOnDestroy: Output? = null,
    public val deregisterOnIdChange: Output? = null,
    public val detach: Output? = null,
    public val hcl1: Output? = null,
    public val hcl2: Output? = null,
    public val jobspec: Output? = null,
    public val json: Output? = null,
    public val policyOverride: Output? = null,
    public val purgeOnDestroy: Output? = null,
    @Deprecated(
        message = """
  Retrieving allocation IDs from the job resource is deprecated and will be removed in a future
      release. Use the nomad.getAllocations data source instead.
  """,
    )
    public val readAllocationIds: Output? = null,
    public val rerunIfDead: Output? = null,
    public val vaultToken: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.nomad.JobArgs = com.pulumi.nomad.JobArgs.builder()
        .consulToken(consulToken?.applyValue({ args0 -> args0 }))
        .deregisterOnDestroy(deregisterOnDestroy?.applyValue({ args0 -> args0 }))
        .deregisterOnIdChange(deregisterOnIdChange?.applyValue({ args0 -> args0 }))
        .detach(detach?.applyValue({ args0 -> args0 }))
        .hcl1(hcl1?.applyValue({ args0 -> args0 }))
        .hcl2(hcl2?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
        .jobspec(jobspec?.applyValue({ args0 -> args0 }))
        .json(json?.applyValue({ args0 -> args0 }))
        .policyOverride(policyOverride?.applyValue({ args0 -> args0 }))
        .purgeOnDestroy(purgeOnDestroy?.applyValue({ args0 -> args0 }))
        .readAllocationIds(readAllocationIds?.applyValue({ args0 -> args0 }))
        .rerunIfDead(rerunIfDead?.applyValue({ args0 -> args0 }))
        .vaultToken(vaultToken?.applyValue({ args0 -> args0 })).build()
}

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

    private var deregisterOnDestroy: Output? = null

    private var deregisterOnIdChange: Output? = null

    private var detach: Output? = null

    private var hcl1: Output? = null

    private var hcl2: Output? = null

    private var jobspec: Output? = null

    private var json: Output? = null

    private var policyOverride: Output? = null

    private var purgeOnDestroy: Output? = null

    private var readAllocationIds: Output? = null

    private var rerunIfDead: Output? = null

    private var vaultToken: Output? = null

    /**
     * @param value `(string: )` - Consul token used when registering this job.
     * Will fallback to the value declared in Nomad provider configuration, if any.
     */
    @JvmName("qfifnboryljpshgo")
    public suspend fun consulToken(`value`: Output) {
        this.consulToken = value
    }

    /**
     * @param value If true, the job will be deregistered on destroy.
     */
    @JvmName("wmbwogbsvltsciqc")
    public suspend fun deregisterOnDestroy(`value`: Output) {
        this.deregisterOnDestroy = value
    }

    /**
     * @param value `(boolean: true)` - Determines if the job will be
     * deregistered if the ID of the job in the jobspec changes.
     */
    @JvmName("vrkqmxmydrqlscla")
    public suspend fun deregisterOnIdChange(`value`: Output) {
        this.deregisterOnIdChange = value
    }

    /**
     * @param value `(boolean: true)` - If true, the provider will return immediately
     * after creating or updating, instead of monitoring.
     */
    @JvmName("lduidjoehvlxjkal")
    public suspend fun detach(`value`: Output) {
        this.detach = value
    }

    /**
     * @param value `(boolean: false)` - Set this to `true` to use the previous HCL1
     * parser. This option is provided for backwards compatibility only and should
     * not be used unless absolutely necessary.
     */
    @JvmName("xofuurpblugjhqdm")
    public suspend fun hcl1(`value`: Output) {
        this.hcl1 = value
    }

    /**
     * @param value `(block: optional)` - Options for the HCL2 jobspec parser.
     */
    @JvmName("jvjkpmqbjiomfwop")
    public suspend fun hcl2(`value`: Output) {
        this.hcl2 = value
    }

    /**
     * @param value `(string: )` - The contents of the jobspec to register.
     */
    @JvmName("ynjqothmosvchmad")
    public suspend fun jobspec(`value`: Output) {
        this.jobspec = value
    }

    /**
     * @param value `(boolean: false)` - Set this to `true` if your jobspec is structured with
     * JSON instead of the default HCL.
     */
    @JvmName("srsfxuixwcnaqigf")
    public suspend fun json(`value`: Output) {
        this.json = value
    }

    /**
     * @param value `(boolean: false)` - Determines if the job will override any
     * soft-mandatory Sentinel policies and register even if they fail.
     */
    @JvmName("vndhggqfdraevhbr")
    public suspend fun policyOverride(`value`: Output) {
        this.policyOverride = value
    }

    /**
     * @param value `(boolean: false)` - Set this to true if you want the job to
     * be purged when the resource is destroyed.
     */
    @JvmName("rrsfqjtvvdrppgys")
    public suspend fun purgeOnDestroy(`value`: Output) {
        this.purgeOnDestroy = value
    }

    /**
     * @param value
     */
    @Deprecated(
        message = """
  Retrieving allocation IDs from the job resource is deprecated and will be removed in a future
      release. Use the nomad.getAllocations data source instead.
  """,
    )
    @JvmName("hrhaugurxgtkmffy")
    public suspend fun readAllocationIds(`value`: Output) {
        this.readAllocationIds = value
    }

    /**
     * @param value `(boolean: false)` - Set this to true to force the job to run
     * again if its status is `dead`.
     */
    @JvmName("jjxgjalrnvtrqtwy")
    public suspend fun rerunIfDead(`value`: Output) {
        this.rerunIfDead = value
    }

    /**
     * @param value `(string: )` - Vault token used when registering this job.
     * Will fallback to the value declared in Nomad provider configuration, if any.
     */
    @JvmName("raxcfrdsmlnlaibe")
    public suspend fun vaultToken(`value`: Output) {
        this.vaultToken = value
    }

    /**
     * @param value `(string: )` - Consul token used when registering this job.
     * Will fallback to the value declared in Nomad provider configuration, if any.
     */
    @JvmName("siogaiiwmdjwhsag")
    public suspend fun consulToken(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.consulToken = mapped
    }

    /**
     * @param value If true, the job will be deregistered on destroy.
     */
    @JvmName("idmbbkflydqrcgjk")
    public suspend fun deregisterOnDestroy(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.deregisterOnDestroy = mapped
    }

    /**
     * @param value `(boolean: true)` - Determines if the job will be
     * deregistered if the ID of the job in the jobspec changes.
     */
    @JvmName("jdmhosjudeebknog")
    public suspend fun deregisterOnIdChange(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.deregisterOnIdChange = mapped
    }

    /**
     * @param value `(boolean: true)` - If true, the provider will return immediately
     * after creating or updating, instead of monitoring.
     */
    @JvmName("btjpamkxdvnsergq")
    public suspend fun detach(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.detach = mapped
    }

    /**
     * @param value `(boolean: false)` - Set this to `true` to use the previous HCL1
     * parser. This option is provided for backwards compatibility only and should
     * not be used unless absolutely necessary.
     */
    @JvmName("ecffwiqnqfhgvvxr")
    public suspend fun hcl1(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.hcl1 = mapped
    }

    /**
     * @param value `(block: optional)` - Options for the HCL2 jobspec parser.
     */
    @JvmName("runndcwseuwoagiv")
    public suspend fun hcl2(`value`: JobHcl2Args?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.hcl2 = mapped
    }

    /**
     * @param argument `(block: optional)` - Options for the HCL2 jobspec parser.
     */
    @JvmName("cxgfgxlnihpyfulm")
    public suspend fun hcl2(argument: suspend JobHcl2ArgsBuilder.() -> Unit) {
        val toBeMapped = JobHcl2ArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.hcl2 = mapped
    }

    /**
     * @param value `(string: )` - The contents of the jobspec to register.
     */
    @JvmName("qxcaxwmdpwcunsfr")
    public suspend fun jobspec(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.jobspec = mapped
    }

    /**
     * @param value `(boolean: false)` - Set this to `true` if your jobspec is structured with
     * JSON instead of the default HCL.
     */
    @JvmName("jrpbhewpsjkhjtlo")
    public suspend fun json(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.json = mapped
    }

    /**
     * @param value `(boolean: false)` - Determines if the job will override any
     * soft-mandatory Sentinel policies and register even if they fail.
     */
    @JvmName("dpooynovqrwaffdr")
    public suspend fun policyOverride(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.policyOverride = mapped
    }

    /**
     * @param value `(boolean: false)` - Set this to true if you want the job to
     * be purged when the resource is destroyed.
     */
    @JvmName("npnbknnfmxsakwly")
    public suspend fun purgeOnDestroy(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.purgeOnDestroy = mapped
    }

    /**
     * @param value
     */
    @Deprecated(
        message = """
  Retrieving allocation IDs from the job resource is deprecated and will be removed in a future
      release. Use the nomad.getAllocations data source instead.
  """,
    )
    @JvmName("mbkymiurdmlewwgn")
    public suspend fun readAllocationIds(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.readAllocationIds = mapped
    }

    /**
     * @param value `(boolean: false)` - Set this to true to force the job to run
     * again if its status is `dead`.
     */
    @JvmName("rbargiwmuywimxba")
    public suspend fun rerunIfDead(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rerunIfDead = mapped
    }

    /**
     * @param value `(string: )` - Vault token used when registering this job.
     * Will fallback to the value declared in Nomad provider configuration, if any.
     */
    @JvmName("ejofnatxirhlgojr")
    public suspend fun vaultToken(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.vaultToken = mapped
    }

    internal fun build(): JobArgs = JobArgs(
        consulToken = consulToken,
        deregisterOnDestroy = deregisterOnDestroy,
        deregisterOnIdChange = deregisterOnIdChange,
        detach = detach,
        hcl1 = hcl1,
        hcl2 = hcl2,
        jobspec = jobspec,
        json = json,
        policyOverride = policyOverride,
        purgeOnDestroy = purgeOnDestroy,
        readAllocationIds = readAllocationIds,
        rerunIfDead = rerunIfDead,
        vaultToken = vaultToken,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy