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

com.pulumi.googlenative.clouddeploy.v1.kotlin.DeliveryPipeline.kt Maven / Gradle / Ivy

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

package com.pulumi.googlenative.clouddeploy.v1.kotlin

import com.pulumi.core.Output
import com.pulumi.googlenative.clouddeploy.v1.kotlin.outputs.PipelineConditionResponse
import com.pulumi.googlenative.clouddeploy.v1.kotlin.outputs.SerialPipelineResponse
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import com.pulumi.googlenative.clouddeploy.v1.kotlin.outputs.PipelineConditionResponse.Companion.toKotlin as pipelineConditionResponseToKotlin
import com.pulumi.googlenative.clouddeploy.v1.kotlin.outputs.SerialPipelineResponse.Companion.toKotlin as serialPipelineResponseToKotlin

/**
 * Builder for [DeliveryPipeline].
 */
@PulumiTagMarker
public class DeliveryPipelineResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: DeliveryPipelineArgs = DeliveryPipelineArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend DeliveryPipelineArgsBuilder.() -> Unit) {
        val builder = DeliveryPipelineArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): DeliveryPipeline {
        val builtJavaResource =
            com.pulumi.googlenative.clouddeploy.v1.DeliveryPipeline(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return DeliveryPipeline(builtJavaResource)
    }
}

/**
 * Creates a new DeliveryPipeline in a given project and location.
 * Auto-naming is currently not supported for this resource.
 */
public class DeliveryPipeline internal constructor(
    override val javaResource: com.pulumi.googlenative.clouddeploy.v1.DeliveryPipeline,
) : KotlinCustomResource(javaResource, DeliveryPipelineMapper) {
    /**
     * User annotations. These attributes can only be set and used by the user, and not by Google Cloud Deploy.
     */
    public val annotations: Output>
        get() = javaResource.annotations().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * Information around the state of the Delivery Pipeline.
     */
    public val condition: Output
        get() = javaResource.condition().applyValue({ args0 ->
            args0.let({ args0 ->
                pipelineConditionResponseToKotlin(args0)
            })
        })

    /**
     * Time at which the pipeline was created.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * Required. ID of the `DeliveryPipeline`.
     */
    public val deliveryPipelineId: Output
        get() = javaResource.deliveryPipelineId().applyValue({ args0 -> args0 })

    /**
     * Description of the `DeliveryPipeline`. Max length is 255 characters.
     */
    public val description: Output
        get() = javaResource.description().applyValue({ args0 -> args0 })

    /**
     * This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
     */
    public val etag: Output
        get() = javaResource.etag().applyValue({ args0 -> args0 })

    /**
     * Labels are attributes that can be set and used by both the user and by Google Cloud Deploy. Labels must meet the following constraints: * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. * All characters must use UTF-8 encoding, and international characters are allowed. * Keys must start with a lowercase letter or international character. * Each resource is limited to a maximum of 64 labels. Both keys and values are additionally constrained to be <= 128 bytes.
     */
    public val labels: Output>
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Optional. Name of the `DeliveryPipeline`. Format is projects/{project}/ locations/{location}/deliveryPipelines/a-z{0,62}.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * Optional. A 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).
     */
    public val requestId: Output?
        get() = javaResource.requestId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * SerialPipeline defines a sequential set of stages for a `DeliveryPipeline`.
     */
    public val serialPipeline: Output
        get() = javaResource.serialPipeline().applyValue({ args0 ->
            args0.let({ args0 ->
                serialPipelineResponseToKotlin(args0)
            })
        })

    /**
     * When suspended, no new releases or rollouts can be created, but in-progress ones will complete.
     */
    public val suspended: Output
        get() = javaResource.suspended().applyValue({ args0 -> args0 })

    /**
     * Unique identifier of the `DeliveryPipeline`.
     */
    public val uid: Output
        get() = javaResource.uid().applyValue({ args0 -> args0 })

    /**
     * Most recent time at which the pipeline was updated.
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}

public object DeliveryPipelineMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.googlenative.clouddeploy.v1.DeliveryPipeline::class == javaResource::class

    override fun map(javaResource: Resource): DeliveryPipeline = DeliveryPipeline(
        javaResource as
            com.pulumi.googlenative.clouddeploy.v1.DeliveryPipeline,
    )
}

/**
 * @see [DeliveryPipeline].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [DeliveryPipeline].
 */
public suspend fun deliveryPipeline(
    name: String,
    block: suspend DeliveryPipelineResourceBuilder.() -> Unit,
): DeliveryPipeline {
    val builder = DeliveryPipelineResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [DeliveryPipeline].
 * @param name The _unique_ name of the resulting resource.
 */
public fun deliveryPipeline(name: String): DeliveryPipeline {
    val builder = DeliveryPipelineResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy