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

com.pulumi.awsnative.events.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: 0.122.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.events.kotlin

import com.pulumi.awsnative.events.RuleArgs.builder
import com.pulumi.awsnative.events.kotlin.enums.RuleState
import com.pulumi.awsnative.events.kotlin.inputs.RuleTargetArgs
import com.pulumi.awsnative.events.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.Any
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Resource Type definition for AWS::Events::Rule
 * ## Example Usage
 * ### Example
 * No Java example available.
 * @property description The description of the rule.
 * @property eventBusName The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.
 * @property eventPattern The event pattern of the rule. For more information, see Events and Event Patterns in the Amazon EventBridge User Guide.
 * Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::Events::Rule` for more information about the expected schema for this property.
 * @property name The name of the rule.
 * @property roleArn The Amazon Resource Name (ARN) of the role that is used for target invocation.
 * @property scheduleExpression The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)". For more information, see Creating an Amazon EventBridge rule that runs on a schedule.
 * @property state The state of the rule.
 * @property targets Adds the specified targets to the specified rule, or updates the targets if they are already associated with the rule.
 * Targets are the resources that are invoked when a rule is triggered.
 */
public data class RuleArgs(
    public val description: Output? = null,
    public val eventBusName: Output? = null,
    public val eventPattern: Output? = null,
    public val name: Output? = null,
    public val roleArn: Output? = null,
    public val scheduleExpression: Output? = null,
    public val state: Output? = null,
    public val targets: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.events.RuleArgs =
        com.pulumi.awsnative.events.RuleArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .eventBusName(eventBusName?.applyValue({ args0 -> args0 }))
            .eventPattern(eventPattern?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .roleArn(roleArn?.applyValue({ args0 -> args0 }))
            .scheduleExpression(scheduleExpression?.applyValue({ args0 -> args0 }))
            .state(state?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .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 eventPattern: Output? = null

    private var name: Output? = null

    private var roleArn: Output? = null

    private var scheduleExpression: Output? = null

    private var state: Output? = null

    private var targets: Output>? = null

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

    /**
     * @param value The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.
     */
    @JvmName("qtfwisvfjcxasoyx")
    public suspend fun eventBusName(`value`: Output) {
        this.eventBusName = value
    }

    /**
     * @param value The event pattern of the rule. For more information, see Events and Event Patterns in the Amazon EventBridge User Guide.
     * Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::Events::Rule` for more information about the expected schema for this property.
     */
    @JvmName("sfhmsecuumhgfcip")
    public suspend fun eventPattern(`value`: Output) {
        this.eventPattern = value
    }

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

    /**
     * @param value The Amazon Resource Name (ARN) of the role that is used for target invocation.
     */
    @JvmName("oceerqqlhnbtinal")
    public suspend fun roleArn(`value`: Output) {
        this.roleArn = value
    }

    /**
     * @param value The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)". For more information, see Creating an Amazon EventBridge rule that runs on a schedule.
     */
    @JvmName("ruikhxakcqiqxmlw")
    public suspend fun scheduleExpression(`value`: Output) {
        this.scheduleExpression = value
    }

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

    /**
     * @param value Adds the specified targets to the specified rule, or updates the targets if they are already associated with the rule.
     * Targets are the resources that are invoked when a rule is triggered.
     */
    @JvmName("fsrxbscgkwyuwwhu")
    public suspend fun targets(`value`: Output>) {
        this.targets = value
    }

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

    /**
     * @param values Adds the specified targets to the specified rule, or updates the targets if they are already associated with the rule.
     * Targets are the resources that are invoked when a rule is triggered.
     */
    @JvmName("iffwjyxfphujxxnq")
    public suspend fun targets(values: List>) {
        this.targets = Output.all(values)
    }

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

    /**
     * @param value The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.
     */
    @JvmName("urvmbvdurxhtsygo")
    public suspend fun eventBusName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.eventBusName = mapped
    }

    /**
     * @param value The event pattern of the rule. For more information, see Events and Event Patterns in the Amazon EventBridge User Guide.
     * Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::Events::Rule` for more information about the expected schema for this property.
     */
    @JvmName("tgxvsodvmtuqahat")
    public suspend fun eventPattern(`value`: Any?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.eventPattern = mapped
    }

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

    /**
     * @param value The Amazon Resource Name (ARN) of the role that is used for target invocation.
     */
    @JvmName("rptfjgqdwdxdqvdy")
    public suspend fun roleArn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.roleArn = mapped
    }

    /**
     * @param value The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)". For more information, see Creating an Amazon EventBridge rule that runs on a schedule.
     */
    @JvmName("fsqfjbnlokkscrvq")
    public suspend fun scheduleExpression(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scheduleExpression = mapped
    }

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

    /**
     * @param value Adds the specified targets to the specified rule, or updates the targets if they are already associated with the rule.
     * Targets are the resources that are invoked when a rule is triggered.
     */
    @JvmName("scidvepslilbtrjb")
    public suspend fun targets(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.targets = mapped
    }

    /**
     * @param argument Adds the specified targets to the specified rule, or updates the targets if they are already associated with the rule.
     * Targets are the resources that are invoked when a rule is triggered.
     */
    @JvmName("inaquaqykicqhgnn")
    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 Adds the specified targets to the specified rule, or updates the targets if they are already associated with the rule.
     * Targets are the resources that are invoked when a rule is triggered.
     */
    @JvmName("ytsehdomgjceochs")
    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 Adds the specified targets to the specified rule, or updates the targets if they are already associated with the rule.
     * Targets are the resources that are invoked when a rule is triggered.
     */
    @JvmName("fuawleyhnfjmxfaa")
    public suspend fun targets(argument: suspend RuleTargetArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(RuleTargetArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.targets = mapped
    }

    /**
     * @param values Adds the specified targets to the specified rule, or updates the targets if they are already associated with the rule.
     * Targets are the resources that are invoked when a rule is triggered.
     */
    @JvmName("utkiqegywkipygdf")
    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,
        eventPattern = eventPattern,
        name = name,
        roleArn = roleArn,
        scheduleExpression = scheduleExpression,
        state = state,
        targets = targets,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy