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

com.pulumi.gcp.cloudbuild.kotlin.inputs.TriggerBuildArgs.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.cloudbuild.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.cloudbuild.inputs.TriggerBuildArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
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

/**
 *
 * @property artifacts Artifacts produced by the build that should be uploaded upon successful completion of all build steps.
 * Structure is documented below.
 * @property availableSecrets Secrets and secret environment variables.
 * Structure is documented below.
 * @property images A list of images to be pushed upon the successful completion of all build steps.
 * The images are pushed using the builder service account's credentials.
 * The digests of the pushed images will be stored in the Build resource's results field.
 * If any of the images fail to be pushed, the build status is marked FAILURE.
 * @property logsBucket Google Cloud Storage bucket where logs should be written.
 * Logs file names will be of the format ${logsBucket}/log-${build_id}.txt.
 * @property options Special options for this build.
 * Structure is documented below.
 * @property queueTtl TTL in queue for this build. If provided and the build is enqueued longer than this value,
 * the build will expire and the build status will be EXPIRED.
 * The TTL starts ticking from createTime.
 * A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
 * @property secrets Secrets to decrypt using Cloud Key Management Service.
 * Structure is documented below.
 * @property source The location of the source files to build.
 * One of `storageSource` or `repoSource` must be provided.
 * Structure is documented below.
 * @property steps The operations to be performed on the workspace.
 * Structure is documented below.
 * @property substitutions Substitutions data for Build resource.
 * @property tags Tags for annotation of a Build. These are not docker tags.
 * @property timeout Amount of time that this build should be allowed to run, to second granularity.
 * If this amount of time elapses, work on the build will cease and the build status will be TIMEOUT.
 * This timeout must be equal to or greater than the sum of the timeouts for build steps within the build.
 * The expected format is the number of seconds followed by s.
 * Default time is ten minutes (600s).
 */
public data class TriggerBuildArgs(
    public val artifacts: Output? = null,
    public val availableSecrets: Output? = null,
    public val images: Output>? = null,
    public val logsBucket: Output? = null,
    public val options: Output? = null,
    public val queueTtl: Output? = null,
    public val secrets: Output>? = null,
    public val source: Output? = null,
    public val steps: Output>,
    public val substitutions: Output>? = null,
    public val tags: Output>? = null,
    public val timeout: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.cloudbuild.inputs.TriggerBuildArgs =
        com.pulumi.gcp.cloudbuild.inputs.TriggerBuildArgs.builder()
            .artifacts(artifacts?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .availableSecrets(availableSecrets?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .images(images?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .logsBucket(logsBucket?.applyValue({ args0 -> args0 }))
            .options(options?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .queueTtl(queueTtl?.applyValue({ args0 -> args0 }))
            .secrets(
                secrets?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .source(source?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .steps(steps.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .substitutions(
                substitutions?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .timeout(timeout?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [TriggerBuildArgs].
 */
@PulumiTagMarker
public class TriggerBuildArgsBuilder internal constructor() {
    private var artifacts: Output? = null

    private var availableSecrets: Output? = null

    private var images: Output>? = null

    private var logsBucket: Output? = null

    private var options: Output? = null

    private var queueTtl: Output? = null

    private var secrets: Output>? = null

    private var source: Output? = null

    private var steps: Output>? = null

    private var substitutions: Output>? = null

    private var tags: Output>? = null

    private var timeout: Output? = null

    /**
     * @param value Artifacts produced by the build that should be uploaded upon successful completion of all build steps.
     * Structure is documented below.
     */
    @JvmName("krtdbuuytlniiqub")
    public suspend fun artifacts(`value`: Output) {
        this.artifacts = value
    }

    /**
     * @param value Secrets and secret environment variables.
     * Structure is documented below.
     */
    @JvmName("uxnxyfgettdhfath")
    public suspend fun availableSecrets(`value`: Output) {
        this.availableSecrets = value
    }

    /**
     * @param value A list of images to be pushed upon the successful completion of all build steps.
     * The images are pushed using the builder service account's credentials.
     * The digests of the pushed images will be stored in the Build resource's results field.
     * If any of the images fail to be pushed, the build status is marked FAILURE.
     */
    @JvmName("fvlpcbbpiykwuayq")
    public suspend fun images(`value`: Output>) {
        this.images = value
    }

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

    /**
     * @param values A list of images to be pushed upon the successful completion of all build steps.
     * The images are pushed using the builder service account's credentials.
     * The digests of the pushed images will be stored in the Build resource's results field.
     * If any of the images fail to be pushed, the build status is marked FAILURE.
     */
    @JvmName("vfssdbuserwampsa")
    public suspend fun images(values: List>) {
        this.images = Output.all(values)
    }

    /**
     * @param value Google Cloud Storage bucket where logs should be written.
     * Logs file names will be of the format ${logsBucket}/log-${build_id}.txt.
     */
    @JvmName("sscytrwsigpcrqyd")
    public suspend fun logsBucket(`value`: Output) {
        this.logsBucket = value
    }

    /**
     * @param value Special options for this build.
     * Structure is documented below.
     */
    @JvmName("vguwkasgsejqxuhh")
    public suspend fun options(`value`: Output) {
        this.options = value
    }

    /**
     * @param value TTL in queue for this build. If provided and the build is enqueued longer than this value,
     * the build will expire and the build status will be EXPIRED.
     * The TTL starts ticking from createTime.
     * A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
     */
    @JvmName("cvnfypgxjmwyrmje")
    public suspend fun queueTtl(`value`: Output) {
        this.queueTtl = value
    }

    /**
     * @param value Secrets to decrypt using Cloud Key Management Service.
     * Structure is documented below.
     */
    @JvmName("kjbdglanlovwosxv")
    public suspend fun secrets(`value`: Output>) {
        this.secrets = value
    }

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

    /**
     * @param values Secrets to decrypt using Cloud Key Management Service.
     * Structure is documented below.
     */
    @JvmName("vwjnfngurabpqcoa")
    public suspend fun secrets(values: List>) {
        this.secrets = Output.all(values)
    }

    /**
     * @param value The location of the source files to build.
     * One of `storageSource` or `repoSource` must be provided.
     * Structure is documented below.
     */
    @JvmName("onbjrtclyubyagej")
    public suspend fun source(`value`: Output) {
        this.source = value
    }

    /**
     * @param value The operations to be performed on the workspace.
     * Structure is documented below.
     */
    @JvmName("nycxsffkxnbrfggw")
    public suspend fun steps(`value`: Output>) {
        this.steps = value
    }

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

    /**
     * @param values The operations to be performed on the workspace.
     * Structure is documented below.
     */
    @JvmName("rofqibqrhfufojow")
    public suspend fun steps(values: List>) {
        this.steps = Output.all(values)
    }

    /**
     * @param value Substitutions data for Build resource.
     */
    @JvmName("vesedwhsasowsift")
    public suspend fun substitutions(`value`: Output>) {
        this.substitutions = value
    }

    /**
     * @param value Tags for annotation of a Build. These are not docker tags.
     */
    @JvmName("cpflpxbpudrrnruh")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

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

    /**
     * @param values Tags for annotation of a Build. These are not docker tags.
     */
    @JvmName("oliguwmpdmrrxgck")
    public suspend fun tags(values: List>) {
        this.tags = Output.all(values)
    }

    /**
     * @param value Amount of time that this build should be allowed to run, to second granularity.
     * If this amount of time elapses, work on the build will cease and the build status will be TIMEOUT.
     * This timeout must be equal to or greater than the sum of the timeouts for build steps within the build.
     * The expected format is the number of seconds followed by s.
     * Default time is ten minutes (600s).
     */
    @JvmName("khprebmyqgsxdsfu")
    public suspend fun timeout(`value`: Output) {
        this.timeout = value
    }

    /**
     * @param value Artifacts produced by the build that should be uploaded upon successful completion of all build steps.
     * Structure is documented below.
     */
    @JvmName("mjrcyahllhmvpgrv")
    public suspend fun artifacts(`value`: TriggerBuildArtifactsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.artifacts = mapped
    }

    /**
     * @param argument Artifacts produced by the build that should be uploaded upon successful completion of all build steps.
     * Structure is documented below.
     */
    @JvmName("unxwtmomtsycnqrh")
    public suspend fun artifacts(argument: suspend TriggerBuildArtifactsArgsBuilder.() -> Unit) {
        val toBeMapped = TriggerBuildArtifactsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.artifacts = mapped
    }

    /**
     * @param value Secrets and secret environment variables.
     * Structure is documented below.
     */
    @JvmName("ikxwfonvcfkvcmbr")
    public suspend fun availableSecrets(`value`: TriggerBuildAvailableSecretsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.availableSecrets = mapped
    }

    /**
     * @param argument Secrets and secret environment variables.
     * Structure is documented below.
     */
    @JvmName("phkinhvcuqouijpd")
    public suspend fun availableSecrets(argument: suspend TriggerBuildAvailableSecretsArgsBuilder.() -> Unit) {
        val toBeMapped = TriggerBuildAvailableSecretsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.availableSecrets = mapped
    }

    /**
     * @param value A list of images to be pushed upon the successful completion of all build steps.
     * The images are pushed using the builder service account's credentials.
     * The digests of the pushed images will be stored in the Build resource's results field.
     * If any of the images fail to be pushed, the build status is marked FAILURE.
     */
    @JvmName("hugadokrxjvxrunj")
    public suspend fun images(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.images = mapped
    }

    /**
     * @param values A list of images to be pushed upon the successful completion of all build steps.
     * The images are pushed using the builder service account's credentials.
     * The digests of the pushed images will be stored in the Build resource's results field.
     * If any of the images fail to be pushed, the build status is marked FAILURE.
     */
    @JvmName("cqhwungjsyheirtq")
    public suspend fun images(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.images = mapped
    }

    /**
     * @param value Google Cloud Storage bucket where logs should be written.
     * Logs file names will be of the format ${logsBucket}/log-${build_id}.txt.
     */
    @JvmName("qpihawtxweiqlapo")
    public suspend fun logsBucket(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.logsBucket = mapped
    }

    /**
     * @param value Special options for this build.
     * Structure is documented below.
     */
    @JvmName("xlnbgyjttigpiioy")
    public suspend fun options(`value`: TriggerBuildOptionsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.options = mapped
    }

    /**
     * @param argument Special options for this build.
     * Structure is documented below.
     */
    @JvmName("wkxqhsqfntyqfhay")
    public suspend fun options(argument: suspend TriggerBuildOptionsArgsBuilder.() -> Unit) {
        val toBeMapped = TriggerBuildOptionsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.options = mapped
    }

    /**
     * @param value TTL in queue for this build. If provided and the build is enqueued longer than this value,
     * the build will expire and the build status will be EXPIRED.
     * The TTL starts ticking from createTime.
     * A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
     */
    @JvmName("raaasnykxurnqekd")
    public suspend fun queueTtl(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.queueTtl = mapped
    }

    /**
     * @param value Secrets to decrypt using Cloud Key Management Service.
     * Structure is documented below.
     */
    @JvmName("vhoaopyltkwdmsbg")
    public suspend fun secrets(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.secrets = mapped
    }

    /**
     * @param argument Secrets to decrypt using Cloud Key Management Service.
     * Structure is documented below.
     */
    @JvmName("nvvkhbmyigqbifwg")
    public suspend fun secrets(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            TriggerBuildSecretArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.secrets = mapped
    }

    /**
     * @param argument Secrets to decrypt using Cloud Key Management Service.
     * Structure is documented below.
     */
    @JvmName("awqavypechisbuxa")
    public suspend fun secrets(vararg argument: suspend TriggerBuildSecretArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            TriggerBuildSecretArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.secrets = mapped
    }

    /**
     * @param argument Secrets to decrypt using Cloud Key Management Service.
     * Structure is documented below.
     */
    @JvmName("oxvxuuwgifecsmms")
    public suspend fun secrets(argument: suspend TriggerBuildSecretArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TriggerBuildSecretArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.secrets = mapped
    }

    /**
     * @param values Secrets to decrypt using Cloud Key Management Service.
     * Structure is documented below.
     */
    @JvmName("botaawvoqxjypanp")
    public suspend fun secrets(vararg values: TriggerBuildSecretArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.secrets = mapped
    }

    /**
     * @param value The location of the source files to build.
     * One of `storageSource` or `repoSource` must be provided.
     * Structure is documented below.
     */
    @JvmName("tkpodattjynnwucm")
    public suspend fun source(`value`: TriggerBuildSourceArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.source = mapped
    }

    /**
     * @param argument The location of the source files to build.
     * One of `storageSource` or `repoSource` must be provided.
     * Structure is documented below.
     */
    @JvmName("wkupfjsiovndlitk")
    public suspend fun source(argument: suspend TriggerBuildSourceArgsBuilder.() -> Unit) {
        val toBeMapped = TriggerBuildSourceArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.source = mapped
    }

    /**
     * @param value The operations to be performed on the workspace.
     * Structure is documented below.
     */
    @JvmName("cqpymiydjpleadsi")
    public suspend fun steps(`value`: List) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.steps = mapped
    }

    /**
     * @param argument The operations to be performed on the workspace.
     * Structure is documented below.
     */
    @JvmName("ibqdykxagsuvovyy")
    public suspend fun steps(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            TriggerBuildStepArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.steps = mapped
    }

    /**
     * @param argument The operations to be performed on the workspace.
     * Structure is documented below.
     */
    @JvmName("gkqqyyojxytsxtnt")
    public suspend fun steps(vararg argument: suspend TriggerBuildStepArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            TriggerBuildStepArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.steps = mapped
    }

    /**
     * @param argument The operations to be performed on the workspace.
     * Structure is documented below.
     */
    @JvmName("jdoaswlvkntcnoaq")
    public suspend fun steps(argument: suspend TriggerBuildStepArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TriggerBuildStepArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.steps = mapped
    }

    /**
     * @param values The operations to be performed on the workspace.
     * Structure is documented below.
     */
    @JvmName("eakawmkvrritoxcp")
    public suspend fun steps(vararg values: TriggerBuildStepArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.steps = mapped
    }

    /**
     * @param value Substitutions data for Build resource.
     */
    @JvmName("rghrkwvclotbwxlx")
    public suspend fun substitutions(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.substitutions = mapped
    }

    /**
     * @param values Substitutions data for Build resource.
     */
    @JvmName("tkhpvkenedtukoop")
    public fun substitutions(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.substitutions = mapped
    }

    /**
     * @param value Tags for annotation of a Build. These are not docker tags.
     */
    @JvmName("njviyxwyrvxcxbca")
    public suspend fun tags(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values Tags for annotation of a Build. These are not docker tags.
     */
    @JvmName("peihmttghlmyqmvi")
    public suspend fun tags(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value Amount of time that this build should be allowed to run, to second granularity.
     * If this amount of time elapses, work on the build will cease and the build status will be TIMEOUT.
     * This timeout must be equal to or greater than the sum of the timeouts for build steps within the build.
     * The expected format is the number of seconds followed by s.
     * Default time is ten minutes (600s).
     */
    @JvmName("gdilavjxtymcinod")
    public suspend fun timeout(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timeout = mapped
    }

    internal fun build(): TriggerBuildArgs = TriggerBuildArgs(
        artifacts = artifacts,
        availableSecrets = availableSecrets,
        images = images,
        logsBucket = logsBucket,
        options = options,
        queueTtl = queueTtl,
        secrets = secrets,
        source = source,
        steps = steps ?: throw PulumiNullFieldException("steps"),
        substitutions = substitutions,
        tags = tags,
        timeout = timeout,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy