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

com.pulumi.gcp.cloudfunctions.kotlin.inputs.FunctionEventTriggerArgs.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.12.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.cloudfunctions.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.cloudfunctions.inputs.FunctionEventTriggerArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 *
 * @property eventType The type of event to observe. For example: `"google.storage.object.finalize"`.
 * See the documentation on [calling Cloud Functions](https://cloud.google.com/functions/docs/calling/) for a
 * full reference of accepted triggers.
 * @property failurePolicy Specifies policy for failed executions. Structure is documented below.
 * @property resource Required. The name or partial URI of the resource from
 * which to observe events. For example, `"myBucket"` or `"projects/my-project/topics/my-topic"`
 */
public data class FunctionEventTriggerArgs(
    public val eventType: Output,
    public val failurePolicy: Output? = null,
    public val resource: Output,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.cloudfunctions.inputs.FunctionEventTriggerArgs =
        com.pulumi.gcp.cloudfunctions.inputs.FunctionEventTriggerArgs.builder()
            .eventType(eventType.applyValue({ args0 -> args0 }))
            .failurePolicy(failurePolicy?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .resource(resource.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [FunctionEventTriggerArgs].
 */
@PulumiTagMarker
public class FunctionEventTriggerArgsBuilder internal constructor() {
    private var eventType: Output? = null

    private var failurePolicy: Output? = null

    private var resource: Output? = null

    /**
     * @param value The type of event to observe. For example: `"google.storage.object.finalize"`.
     * See the documentation on [calling Cloud Functions](https://cloud.google.com/functions/docs/calling/) for a
     * full reference of accepted triggers.
     */
    @JvmName("walacpeifaxeyynf")
    public suspend fun eventType(`value`: Output) {
        this.eventType = value
    }

    /**
     * @param value Specifies policy for failed executions. Structure is documented below.
     */
    @JvmName("haojvihpsqquhxxd")
    public suspend fun failurePolicy(`value`: Output) {
        this.failurePolicy = value
    }

    /**
     * @param value Required. The name or partial URI of the resource from
     * which to observe events. For example, `"myBucket"` or `"projects/my-project/topics/my-topic"`
     */
    @JvmName("jmnsgabraodqmhvg")
    public suspend fun resource(`value`: Output) {
        this.resource = value
    }

    /**
     * @param value The type of event to observe. For example: `"google.storage.object.finalize"`.
     * See the documentation on [calling Cloud Functions](https://cloud.google.com/functions/docs/calling/) for a
     * full reference of accepted triggers.
     */
    @JvmName("ojkxvtaknayyxlam")
    public suspend fun eventType(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.eventType = mapped
    }

    /**
     * @param value Specifies policy for failed executions. Structure is documented below.
     */
    @JvmName("oijfkyakitomahub")
    public suspend fun failurePolicy(`value`: FunctionEventTriggerFailurePolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.failurePolicy = mapped
    }

    /**
     * @param argument Specifies policy for failed executions. Structure is documented below.
     */
    @JvmName("wtyjsynfoefcmtkq")
    public suspend fun failurePolicy(argument: suspend FunctionEventTriggerFailurePolicyArgsBuilder.() -> Unit) {
        val toBeMapped = FunctionEventTriggerFailurePolicyArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.failurePolicy = mapped
    }

    /**
     * @param value Required. The name or partial URI of the resource from
     * which to observe events. For example, `"myBucket"` or `"projects/my-project/topics/my-topic"`
     */
    @JvmName("ofewlucaoqqxbyib")
    public suspend fun resource(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.resource = mapped
    }

    internal fun build(): FunctionEventTriggerArgs = FunctionEventTriggerArgs(
        eventType = eventType ?: throw PulumiNullFieldException("eventType"),
        failurePolicy = failurePolicy,
        resource = resource ?: throw PulumiNullFieldException("resource"),
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy