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

com.pulumi.azurenative.network.kotlin.inputs.CustomRuleArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azurenative.network.kotlin.inputs

import com.pulumi.azurenative.network.inputs.CustomRuleArgs.builder
import com.pulumi.azurenative.network.kotlin.enums.ActionType
import com.pulumi.azurenative.network.kotlin.enums.CustomRuleEnabledState
import com.pulumi.azurenative.network.kotlin.enums.RuleType
import com.pulumi.core.Either
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

/**
 * Defines contents of a web application rule
 * @property action Describes what action to be applied when rule matches.
 * @property enabledState Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified.
 * @property matchConditions List of match conditions.
 * @property name Describes the name of the rule.
 * @property priority Describes priority of the rule. Rules with a lower value will be evaluated before rules with a higher value.
 * @property rateLimitDurationInMinutes Time window for resetting the rate limit count. Default is 1 minute.
 * @property rateLimitThreshold Number of allowed requests per client within the time window.
 * @property ruleType Describes type of rule.
 */
public data class CustomRuleArgs(
    public val action: Output>,
    public val enabledState: Output>? = null,
    public val matchConditions: Output>,
    public val name: Output? = null,
    public val priority: Output,
    public val rateLimitDurationInMinutes: Output? = null,
    public val rateLimitThreshold: Output? = null,
    public val ruleType: Output>,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.network.inputs.CustomRuleArgs =
        com.pulumi.azurenative.network.inputs.CustomRuleArgs.builder()
            .action(
                action.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .enabledState(
                enabledState?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { 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 }))
            .rateLimitDurationInMinutes(rateLimitDurationInMinutes?.applyValue({ args0 -> args0 }))
            .rateLimitThreshold(rateLimitThreshold?.applyValue({ args0 -> args0 }))
            .ruleType(
                ruleType.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            ).build()
}

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

    private var enabledState: Output>? = null

    private var matchConditions: Output>? = null

    private var name: Output? = null

    private var priority: Output? = null

    private var rateLimitDurationInMinutes: Output? = null

    private var rateLimitThreshold: Output? = null

    private var ruleType: Output>? = null

    /**
     * @param value Describes what action to be applied when rule matches.
     */
    @JvmName("urwtvpxgeqmejqoh")
    public suspend fun action(`value`: Output>) {
        this.action = value
    }

    /**
     * @param value Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified.
     */
    @JvmName("slnjwacrpoqvlxus")
    public suspend fun enabledState(`value`: Output>) {
        this.enabledState = value
    }

    /**
     * @param value List of match conditions.
     */
    @JvmName("wvjqawldkybtcoct")
    public suspend fun matchConditions(`value`: Output>) {
        this.matchConditions = value
    }

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

    /**
     * @param values List of match conditions.
     */
    @JvmName("sigrhvatncnrytqs")
    public suspend fun matchConditions(values: List>) {
        this.matchConditions = Output.all(values)
    }

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

    /**
     * @param value Describes priority of the rule. Rules with a lower value will be evaluated before rules with a higher value.
     */
    @JvmName("ijivqxstmbeyhjug")
    public suspend fun priority(`value`: Output) {
        this.priority = value
    }

    /**
     * @param value Time window for resetting the rate limit count. Default is 1 minute.
     */
    @JvmName("kgknnjiubrktqirk")
    public suspend fun rateLimitDurationInMinutes(`value`: Output) {
        this.rateLimitDurationInMinutes = value
    }

    /**
     * @param value Number of allowed requests per client within the time window.
     */
    @JvmName("mdmqhmxbnfngcbau")
    public suspend fun rateLimitThreshold(`value`: Output) {
        this.rateLimitThreshold = value
    }

    /**
     * @param value Describes type of rule.
     */
    @JvmName("dodvrhwjxcwkptes")
    public suspend fun ruleType(`value`: Output>) {
        this.ruleType = value
    }

    /**
     * @param value Describes what action to be applied when rule matches.
     */
    @JvmName("qmrgatyvihkguoqb")
    public suspend fun action(`value`: Either) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.action = mapped
    }

    /**
     * @param value Describes what action to be applied when rule matches.
     */
    @JvmName("mmlxmeisudflnlnu")
    public fun action(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.action = mapped
    }

    /**
     * @param value Describes what action to be applied when rule matches.
     */
    @JvmName("mlrmyivxwmufslge")
    public fun action(`value`: ActionType) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.action = mapped
    }

    /**
     * @param value Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified.
     */
    @JvmName("oltuedibupkbsqmc")
    public suspend fun enabledState(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enabledState = mapped
    }

    /**
     * @param value Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified.
     */
    @JvmName("axsixjiywairvkql")
    public fun enabledState(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.enabledState = mapped
    }

    /**
     * @param value Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified.
     */
    @JvmName("tivkxajlhyrbunar")
    public fun enabledState(`value`: CustomRuleEnabledState) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.enabledState = mapped
    }

    /**
     * @param value List of match conditions.
     */
    @JvmName("ahrjdfdbxayluajm")
    public suspend fun matchConditions(`value`: List) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.matchConditions = mapped
    }

    /**
     * @param argument List of match conditions.
     */
    @JvmName("icxgkaulnevpswgk")
    public suspend fun matchConditions(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            FrontDoorMatchConditionArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.matchConditions = mapped
    }

    /**
     * @param argument List of match conditions.
     */
    @JvmName("tngkkpxvbqrgqpgr")
    public suspend fun matchConditions(vararg argument: suspend FrontDoorMatchConditionArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            FrontDoorMatchConditionArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.matchConditions = mapped
    }

    /**
     * @param argument List of match conditions.
     */
    @JvmName("ppftwfkjbeuitjwb")
    public suspend fun matchConditions(argument: suspend FrontDoorMatchConditionArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            FrontDoorMatchConditionArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.matchConditions = mapped
    }

    /**
     * @param values List of match conditions.
     */
    @JvmName("geagnvoxqysfrktl")
    public suspend fun matchConditions(vararg values: FrontDoorMatchConditionArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.matchConditions = mapped
    }

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

    /**
     * @param value Describes priority of the rule. Rules with a lower value will be evaluated before rules with a higher value.
     */
    @JvmName("oefprrhjutgfrlrt")
    public suspend fun priority(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.priority = mapped
    }

    /**
     * @param value Time window for resetting the rate limit count. Default is 1 minute.
     */
    @JvmName("gkecpnwthgsilhpr")
    public suspend fun rateLimitDurationInMinutes(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rateLimitDurationInMinutes = mapped
    }

    /**
     * @param value Number of allowed requests per client within the time window.
     */
    @JvmName("ubvmaulmflfgcnyf")
    public suspend fun rateLimitThreshold(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rateLimitThreshold = mapped
    }

    /**
     * @param value Describes type of rule.
     */
    @JvmName("nhcawcfhsswdejly")
    public suspend fun ruleType(`value`: Either) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.ruleType = mapped
    }

    /**
     * @param value Describes type of rule.
     */
    @JvmName("cwwgjqvhyswylgmd")
    public fun ruleType(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.ruleType = mapped
    }

    /**
     * @param value Describes type of rule.
     */
    @JvmName("xivxucafxablhagr")
    public fun ruleType(`value`: RuleType) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.ruleType = mapped
    }

    internal fun build(): CustomRuleArgs = CustomRuleArgs(
        action = action ?: throw PulumiNullFieldException("action"),
        enabledState = enabledState,
        matchConditions = matchConditions ?: throw PulumiNullFieldException("matchConditions"),
        name = name,
        priority = priority ?: throw PulumiNullFieldException("priority"),
        rateLimitDurationInMinutes = rateLimitDurationInMinutes,
        rateLimitThreshold = rateLimitThreshold,
        ruleType = ruleType ?: throw PulumiNullFieldException("ruleType"),
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy