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

com.pulumi.googlenative.cloudfunctions.v2.kotlin.FunctionArgs.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.cloudfunctions.v2.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.googlenative.cloudfunctions.v2.FunctionArgs.builder
import com.pulumi.googlenative.cloudfunctions.v2.kotlin.enums.FunctionEnvironment
import com.pulumi.googlenative.cloudfunctions.v2.kotlin.inputs.BuildConfigArgs
import com.pulumi.googlenative.cloudfunctions.v2.kotlin.inputs.BuildConfigArgsBuilder
import com.pulumi.googlenative.cloudfunctions.v2.kotlin.inputs.EventTriggerArgs
import com.pulumi.googlenative.cloudfunctions.v2.kotlin.inputs.EventTriggerArgsBuilder
import com.pulumi.googlenative.cloudfunctions.v2.kotlin.inputs.ServiceConfigArgs
import com.pulumi.googlenative.cloudfunctions.v2.kotlin.inputs.ServiceConfigArgsBuilder
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.Map
import kotlin.jvm.JvmName

/**
 * Creates a new function. If a function with the given name already exists in the specified project, the long running operation will return `ALREADY_EXISTS` error.
 * @property buildConfig Describes the Build step of the function that builds a container from the given source.
 * @property description User-provided description of a function.
 * @property environment Describe whether the function is 1st Gen or 2nd Gen.
 * @property eventTrigger An Eventarc trigger managed by Google Cloud Functions that fires events in response to a condition in another service.
 * @property functionId The ID to use for the function, which will become the final component of the function's resource name. This value should be 4-63 characters, and valid characters are /a-z-/.
 * @property kmsKeyName [Preview] Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt function resources. It must match the pattern `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
 * @property labels Labels associated with this Cloud Function.
 * @property location
 * @property name A user-defined name of the function. Function names must be unique globally and match pattern `projects/*/locations/*/functions/*`
 * @property project
 * @property serviceConfig Describes the Service being deployed. Currently deploys services to Cloud Run (fully managed).
 * */*/*/
 */
public data class FunctionArgs(
    public val buildConfig: Output? = null,
    public val description: Output? = null,
    public val environment: Output? = null,
    public val eventTrigger: Output? = null,
    public val functionId: Output? = null,
    public val kmsKeyName: Output? = null,
    public val labels: Output>? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val serviceConfig: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.googlenative.cloudfunctions.v2.FunctionArgs =
        com.pulumi.googlenative.cloudfunctions.v2.FunctionArgs.builder()
            .buildConfig(buildConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .description(description?.applyValue({ args0 -> args0 }))
            .environment(environment?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .eventTrigger(eventTrigger?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .functionId(functionId?.applyValue({ args0 -> args0 }))
            .kmsKeyName(kmsKeyName?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .serviceConfig(serviceConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [FunctionArgs].
 */
@PulumiTagMarker
public class FunctionArgsBuilder internal constructor() {
    private var buildConfig: Output? = null

    private var description: Output? = null

    private var environment: Output? = null

    private var eventTrigger: Output? = null

    private var functionId: Output? = null

    private var kmsKeyName: Output? = null

    private var labels: Output>? = null

    private var location: Output? = null

    private var name: Output? = null

    private var project: Output? = null

    private var serviceConfig: Output? = null

    /**
     * @param value Describes the Build step of the function that builds a container from the given source.
     */
    @JvmName("vqnofhlclebcvtlv")
    public suspend fun buildConfig(`value`: Output) {
        this.buildConfig = value
    }

    /**
     * @param value User-provided description of a function.
     */
    @JvmName("guouypwgsdkjcohx")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Describe whether the function is 1st Gen or 2nd Gen.
     */
    @JvmName("cbumdxvifaqlpayj")
    public suspend fun environment(`value`: Output) {
        this.environment = value
    }

    /**
     * @param value An Eventarc trigger managed by Google Cloud Functions that fires events in response to a condition in another service.
     */
    @JvmName("sbvjfhcmdlmksdja")
    public suspend fun eventTrigger(`value`: Output) {
        this.eventTrigger = value
    }

    /**
     * @param value The ID to use for the function, which will become the final component of the function's resource name. This value should be 4-63 characters, and valid characters are /a-z-/.
     */
    @JvmName("tsqbvepnyqauahwl")
    public suspend fun functionId(`value`: Output) {
        this.functionId = value
    }

    /**
     * @param value [Preview] Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt function resources. It must match the pattern `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
     */
    @JvmName("hqmhoqykoakecind")
    public suspend fun kmsKeyName(`value`: Output) {
        this.kmsKeyName = value
    }

    /**
     * @param value Labels associated with this Cloud Function.
     */
    @JvmName("dmwlismingbuwffe")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

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

    /**
     * @param value A user-defined name of the function. Function names must be unique globally and match pattern `projects/*/locations/*/functions/*`
     * */*/*/
     */
    @JvmName("wnarvphgkxvnucfs")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

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

    /**
     * @param value Describes the Service being deployed. Currently deploys services to Cloud Run (fully managed).
     */
    @JvmName("lyuvnqepnlkxojrh")
    public suspend fun serviceConfig(`value`: Output) {
        this.serviceConfig = value
    }

    /**
     * @param value Describes the Build step of the function that builds a container from the given source.
     */
    @JvmName("bdkbyytxpxagssmm")
    public suspend fun buildConfig(`value`: BuildConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.buildConfig = mapped
    }

    /**
     * @param argument Describes the Build step of the function that builds a container from the given source.
     */
    @JvmName("lkqmwxksekumospi")
    public suspend fun buildConfig(argument: suspend BuildConfigArgsBuilder.() -> Unit) {
        val toBeMapped = BuildConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.buildConfig = mapped
    }

    /**
     * @param value User-provided description of a function.
     */
    @JvmName("oppxtgifoeujxqjl")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Describe whether the function is 1st Gen or 2nd Gen.
     */
    @JvmName("mkmnayyqfcengtag")
    public suspend fun environment(`value`: FunctionEnvironment?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.environment = mapped
    }

    /**
     * @param value An Eventarc trigger managed by Google Cloud Functions that fires events in response to a condition in another service.
     */
    @JvmName("fnasuvyphdoqdpuy")
    public suspend fun eventTrigger(`value`: EventTriggerArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.eventTrigger = mapped
    }

    /**
     * @param argument An Eventarc trigger managed by Google Cloud Functions that fires events in response to a condition in another service.
     */
    @JvmName("kwxwnsajbtmlioqq")
    public suspend fun eventTrigger(argument: suspend EventTriggerArgsBuilder.() -> Unit) {
        val toBeMapped = EventTriggerArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.eventTrigger = mapped
    }

    /**
     * @param value The ID to use for the function, which will become the final component of the function's resource name. This value should be 4-63 characters, and valid characters are /a-z-/.
     */
    @JvmName("pihtcsmgloawsvbr")
    public suspend fun functionId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.functionId = mapped
    }

    /**
     * @param value [Preview] Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt function resources. It must match the pattern `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
     */
    @JvmName("srummgiefkphnsdw")
    public suspend fun kmsKeyName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.kmsKeyName = mapped
    }

    /**
     * @param value Labels associated with this Cloud Function.
     */
    @JvmName("plsxjcoacomdjnci")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Labels associated with this Cloud Function.
     */
    @JvmName("jfqyhkdigsrvpmbf")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

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

    /**
     * @param value A user-defined name of the function. Function names must be unique globally and match pattern `projects/*/locations/*/functions/*`
     * */*/*/
     */
    @JvmName("encqdykmvueiinda")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

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

    /**
     * @param value Describes the Service being deployed. Currently deploys services to Cloud Run (fully managed).
     */
    @JvmName("rxfermxlaiarlvxb")
    public suspend fun serviceConfig(`value`: ServiceConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serviceConfig = mapped
    }

    /**
     * @param argument Describes the Service being deployed. Currently deploys services to Cloud Run (fully managed).
     */
    @JvmName("gcdorjvglvavnvcu")
    public suspend fun serviceConfig(argument: suspend ServiceConfigArgsBuilder.() -> Unit) {
        val toBeMapped = ServiceConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.serviceConfig = mapped
    }

    internal fun build(): FunctionArgs = FunctionArgs(
        buildConfig = buildConfig,
        description = description,
        environment = environment,
        eventTrigger = eventTrigger,
        functionId = functionId,
        kmsKeyName = kmsKeyName,
        labels = labels,
        location = location,
        name = name,
        project = project,
        serviceConfig = serviceConfig,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy