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

com.pulumi.alicloud.eventbridge.kotlin.RuleArgs.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: 3.62.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.alicloud.eventbridge.kotlin

import com.pulumi.alicloud.eventbridge.RuleArgs.builder
import com.pulumi.alicloud.eventbridge.kotlin.inputs.RuleTargetArgs
import com.pulumi.alicloud.eventbridge.kotlin.inputs.RuleTargetArgsBuilder
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 kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Provides a Event Bridge Rule resource.
 * For information about Event Bridge Rule and how to use it, see [What is Rule](https://www.alibabacloud.com/help/en/eventbridge/latest/createrule-6).
 * > **NOTE:** Available since v1.129.0.
 * ## Import
 * Event Bridge Rule can be imported using the id, e.g.
 * ```sh
 * $ pulumi import alicloud:eventbridge/rule:Rule example :
 * ```
 * @property description The description of the event rule.
 * @property eventBusName The name of the event bus.
 * @property filterPattern The pattern to match interested events. Event mode, JSON format. The value description is as follows: `stringEqual` mode. `stringExpression` mode. Each field has up to 5 expressions (map structure).
 * @property ruleName The name of the event rule.
 * @property status The status of the event rule. Valid values: `ENABLE`, `DISABLE`.
 * @property targets The targets of rule. See `targets` below.
 */
public data class RuleArgs(
    public val description: Output? = null,
    public val eventBusName: Output? = null,
    public val filterPattern: Output? = null,
    public val ruleName: Output? = null,
    public val status: Output? = null,
    public val targets: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.alicloud.eventbridge.RuleArgs =
        com.pulumi.alicloud.eventbridge.RuleArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .eventBusName(eventBusName?.applyValue({ args0 -> args0 }))
            .filterPattern(filterPattern?.applyValue({ args0 -> args0 }))
            .ruleName(ruleName?.applyValue({ args0 -> args0 }))
            .status(status?.applyValue({ args0 -> args0 }))
            .targets(
                targets?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [RuleArgs].
 */
@PulumiTagMarker
public class RuleArgsBuilder internal constructor() {
    private var description: Output? = null

    private var eventBusName: Output? = null

    private var filterPattern: Output? = null

    private var ruleName: Output? = null

    private var status: Output? = null

    private var targets: Output>? = null

    /**
     * @param value The description of the event rule.
     */
    @JvmName("awegoneoxixmgewn")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The name of the event bus.
     */
    @JvmName("hiefssogovalokbw")
    public suspend fun eventBusName(`value`: Output) {
        this.eventBusName = value
    }

    /**
     * @param value The pattern to match interested events. Event mode, JSON format. The value description is as follows: `stringEqual` mode. `stringExpression` mode. Each field has up to 5 expressions (map structure).
     */
    @JvmName("gqdowxfrmonqdord")
    public suspend fun filterPattern(`value`: Output) {
        this.filterPattern = value
    }

    /**
     * @param value The name of the event rule.
     */
    @JvmName("edmmjotblndkubdl")
    public suspend fun ruleName(`value`: Output) {
        this.ruleName = value
    }

    /**
     * @param value The status of the event rule. Valid values: `ENABLE`, `DISABLE`.
     */
    @JvmName("ogejieuaipyudjgv")
    public suspend fun status(`value`: Output) {
        this.status = value
    }

    /**
     * @param value The targets of rule. See `targets` below.
     */
    @JvmName("hduovjobfpyilare")
    public suspend fun targets(`value`: Output>) {
        this.targets = value
    }

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

    /**
     * @param values The targets of rule. See `targets` below.
     */
    @JvmName("pdyqahfubchwjvrk")
    public suspend fun targets(values: List>) {
        this.targets = Output.all(values)
    }

    /**
     * @param value The description of the event rule.
     */
    @JvmName("obomexvlfyauvihv")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The name of the event bus.
     */
    @JvmName("sdugarhkcljnbfov")
    public suspend fun eventBusName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.eventBusName = mapped
    }

    /**
     * @param value The pattern to match interested events. Event mode, JSON format. The value description is as follows: `stringEqual` mode. `stringExpression` mode. Each field has up to 5 expressions (map structure).
     */
    @JvmName("whtbvrkbrycscbbm")
    public suspend fun filterPattern(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.filterPattern = mapped
    }

    /**
     * @param value The name of the event rule.
     */
    @JvmName("tkxlruofobpogxdb")
    public suspend fun ruleName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ruleName = mapped
    }

    /**
     * @param value The status of the event rule. Valid values: `ENABLE`, `DISABLE`.
     */
    @JvmName("lmwiixtikxdafywh")
    public suspend fun status(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.status = mapped
    }

    /**
     * @param value The targets of rule. See `targets` below.
     */
    @JvmName("gdxaudjlkyovouoa")
    public suspend fun targets(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.targets = mapped
    }

    /**
     * @param argument The targets of rule. See `targets` below.
     */
    @JvmName("akunegcorxqklkle")
    public suspend fun targets(argument: List Unit>) {
        val toBeMapped = argument.toList().map { RuleTargetArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.targets = mapped
    }

    /**
     * @param argument The targets of rule. See `targets` below.
     */
    @JvmName("jwpffrlywurrcnig")
    public suspend fun targets(vararg argument: suspend RuleTargetArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { RuleTargetArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.targets = mapped
    }

    /**
     * @param argument The targets of rule. See `targets` below.
     */
    @JvmName("glpgerpxhgsvdpwu")
    public suspend fun targets(argument: suspend RuleTargetArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(RuleTargetArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.targets = mapped
    }

    /**
     * @param values The targets of rule. See `targets` below.
     */
    @JvmName("wltpkoxpwvlhxdsq")
    public suspend fun targets(vararg values: RuleTargetArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.targets = mapped
    }

    internal fun build(): RuleArgs = RuleArgs(
        description = description,
        eventBusName = eventBusName,
        filterPattern = filterPattern,
        ruleName = ruleName,
        status = status,
        targets = targets,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy