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

com.pulumi.azure.frontdoor.kotlin.inputs.RulesEngineRuleArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.frontdoor.kotlin.inputs

import com.pulumi.azure.frontdoor.inputs.RulesEngineRuleArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property action An `action` block as defined below.
 * @property matchConditions One or more `match_condition` block as defined below.
 * @property name The name of the rule.
 * @property priority Priority of the rule, must be unique per rules engine definition.
 */
public data class RulesEngineRuleArgs(
    public val action: Output? = null,
    public val matchConditions: Output>? = null,
    public val name: Output,
    public val priority: Output,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.frontdoor.inputs.RulesEngineRuleArgs =
        com.pulumi.azure.frontdoor.inputs.RulesEngineRuleArgs.builder()
            .action(action?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .matchConditions(
                matchConditions?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .name(name.applyValue({ args0 -> args0 }))
            .priority(priority.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [RulesEngineRuleArgs].
 */
@PulumiTagMarker
public class RulesEngineRuleArgsBuilder internal constructor() {
    private var action: Output? = null

    private var matchConditions: Output>? = null

    private var name: Output? = null

    private var priority: Output? = null

    /**
     * @param value An `action` block as defined below.
     */
    @JvmName("uluewynmmwumoygd")
    public suspend fun action(`value`: Output) {
        this.action = value
    }

    /**
     * @param value One or more `match_condition` block as defined below.
     */
    @JvmName("chvenblqptkgtgil")
    public suspend fun matchConditions(`value`: Output>) {
        this.matchConditions = value
    }

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

    /**
     * @param values One or more `match_condition` block as defined below.
     */
    @JvmName("qlllwhmmqxacdlkl")
    public suspend fun matchConditions(values: List>) {
        this.matchConditions = Output.all(values)
    }

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

    /**
     * @param value Priority of the rule, must be unique per rules engine definition.
     */
    @JvmName("simxnsvsjrbhcdoj")
    public suspend fun priority(`value`: Output) {
        this.priority = value
    }

    /**
     * @param value An `action` block as defined below.
     */
    @JvmName("mopwsyoxqikrwppv")
    public suspend fun action(`value`: RulesEngineRuleActionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.action = mapped
    }

    /**
     * @param argument An `action` block as defined below.
     */
    @JvmName("rdiawjnkpjccwome")
    public suspend fun action(argument: suspend RulesEngineRuleActionArgsBuilder.() -> Unit) {
        val toBeMapped = RulesEngineRuleActionArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.action = mapped
    }

    /**
     * @param value One or more `match_condition` block as defined below.
     */
    @JvmName("wwmessrighpftqnm")
    public suspend fun matchConditions(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.matchConditions = mapped
    }

    /**
     * @param argument One or more `match_condition` block as defined below.
     */
    @JvmName("qycqbbddyssqamus")
    public suspend fun matchConditions(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            RulesEngineRuleMatchConditionArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.matchConditions = mapped
    }

    /**
     * @param argument One or more `match_condition` block as defined below.
     */
    @JvmName("oscjctctyjognwyy")
    public suspend fun matchConditions(vararg argument: suspend RulesEngineRuleMatchConditionArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            RulesEngineRuleMatchConditionArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.matchConditions = mapped
    }

    /**
     * @param argument One or more `match_condition` block as defined below.
     */
    @JvmName("xdjtqfpomxqetant")
    public suspend fun matchConditions(argument: suspend RulesEngineRuleMatchConditionArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            RulesEngineRuleMatchConditionArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.matchConditions = mapped
    }

    /**
     * @param values One or more `match_condition` block as defined below.
     */
    @JvmName("mwpaiijqhenqpcxt")
    public suspend fun matchConditions(vararg values: RulesEngineRuleMatchConditionArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.matchConditions = mapped
    }

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

    /**
     * @param value Priority of the rule, must be unique per rules engine definition.
     */
    @JvmName("gibeeacsyrovlcsb")
    public suspend fun priority(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.priority = mapped
    }

    internal fun build(): RulesEngineRuleArgs = RulesEngineRuleArgs(
        action = action,
        matchConditions = matchConditions,
        name = name ?: throw PulumiNullFieldException("name"),
        priority = priority ?: throw PulumiNullFieldException("priority"),
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy