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

com.pulumi.azure.frontdoor.kotlin.inputs.FirewallPolicyCustomRuleArgs.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: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

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

import com.pulumi.azure.frontdoor.inputs.FirewallPolicyCustomRuleArgs.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.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property action The action to perform when the rule is matched. Possible values are `Allow`, `Block`, `Log`, or `Redirect`.
 * @property enabled Is the rule is enabled or disabled? Defaults to `true`.
 * @property matchConditions One or more `match_condition` block defined below. Can support up to `10` `match_condition` blocks.
 * @property name Gets name of the resource that is unique within a policy. This name can be used to access the resource.
 * @property priority The priority of the rule. Rules with a lower value will be evaluated before rules with a higher value. Defaults to `1`.
 * @property rateLimitDurationInMinutes The rate limit duration in minutes. Defaults to `1`.
 * @property rateLimitThreshold The rate limit threshold. Defaults to `10`.
 * @property type The type of rule. Possible values are `MatchRule` or `RateLimitRule`.
 */
public data class FirewallPolicyCustomRuleArgs(
    public val action: Output,
    public val enabled: Output? = null,
    public val matchConditions: Output>? = null,
    public val name: Output,
    public val priority: Output? = null,
    public val rateLimitDurationInMinutes: Output? = null,
    public val rateLimitThreshold: Output? = null,
    public val type: Output,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.frontdoor.inputs.FirewallPolicyCustomRuleArgs =
        com.pulumi.azure.frontdoor.inputs.FirewallPolicyCustomRuleArgs.builder()
            .action(action.applyValue({ args0 -> args0 }))
            .enabled(enabled?.applyValue({ args0 -> args0 }))
            .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 }))
            .type(type.applyValue({ args0 -> args0 })).build()
}

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

    private var enabled: 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 type: Output? = null

    /**
     * @param value The action to perform when the rule is matched. Possible values are `Allow`, `Block`, `Log`, or `Redirect`.
     */
    @JvmName("qpmpdanuhrqprgys")
    public suspend fun action(`value`: Output) {
        this.action = value
    }

    /**
     * @param value Is the rule is enabled or disabled? Defaults to `true`.
     */
    @JvmName("pmorbnpospndxjfb")
    public suspend fun enabled(`value`: Output) {
        this.enabled = value
    }

    /**
     * @param value One or more `match_condition` block defined below. Can support up to `10` `match_condition` blocks.
     */
    @JvmName("ajjscoueevjopasl")
    public suspend fun matchConditions(`value`: Output>) {
        this.matchConditions = value
    }

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

    /**
     * @param values One or more `match_condition` block defined below. Can support up to `10` `match_condition` blocks.
     */
    @JvmName("ereendpguyjcpeka")
    public suspend fun matchConditions(values: List>) {
        this.matchConditions = Output.all(values)
    }

    /**
     * @param value Gets name of the resource that is unique within a policy. This name can be used to access the resource.
     */
    @JvmName("cerfwwvpuaolymjr")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

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

    /**
     * @param value The rate limit duration in minutes. Defaults to `1`.
     */
    @JvmName("ngubkaikaysfjnou")
    public suspend fun rateLimitDurationInMinutes(`value`: Output) {
        this.rateLimitDurationInMinutes = value
    }

    /**
     * @param value The rate limit threshold. Defaults to `10`.
     */
    @JvmName("ykdnyloorcjtsgwf")
    public suspend fun rateLimitThreshold(`value`: Output) {
        this.rateLimitThreshold = value
    }

    /**
     * @param value The type of rule. Possible values are `MatchRule` or `RateLimitRule`.
     */
    @JvmName("lbkkdedyeicjqmno")
    public suspend fun type(`value`: Output) {
        this.type = value
    }

    /**
     * @param value The action to perform when the rule is matched. Possible values are `Allow`, `Block`, `Log`, or `Redirect`.
     */
    @JvmName("njmuyrxwlygyqcaa")
    public suspend fun action(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.action = mapped
    }

    /**
     * @param value Is the rule is enabled or disabled? Defaults to `true`.
     */
    @JvmName("ndkyncexwscbhbcr")
    public suspend fun enabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enabled = mapped
    }

    /**
     * @param value One or more `match_condition` block defined below. Can support up to `10` `match_condition` blocks.
     */
    @JvmName("icfqxyyanfqoajwi")
    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 defined below. Can support up to `10` `match_condition` blocks.
     */
    @JvmName("phpghfabyrtiwmue")
    public suspend fun matchConditions(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            FirewallPolicyCustomRuleMatchConditionArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.matchConditions = mapped
    }

    /**
     * @param argument One or more `match_condition` block defined below. Can support up to `10` `match_condition` blocks.
     */
    @JvmName("okdkxxyraamlticb")
    public suspend fun matchConditions(vararg argument: suspend FirewallPolicyCustomRuleMatchConditionArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            FirewallPolicyCustomRuleMatchConditionArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.matchConditions = mapped
    }

    /**
     * @param argument One or more `match_condition` block defined below. Can support up to `10` `match_condition` blocks.
     */
    @JvmName("bbehymgyyvrvgajl")
    public suspend fun matchConditions(argument: suspend FirewallPolicyCustomRuleMatchConditionArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            FirewallPolicyCustomRuleMatchConditionArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.matchConditions = mapped
    }

    /**
     * @param values One or more `match_condition` block defined below. Can support up to `10` `match_condition` blocks.
     */
    @JvmName("dgwodbpcrkxhblgs")
    public suspend fun matchConditions(vararg values: FirewallPolicyCustomRuleMatchConditionArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.matchConditions = mapped
    }

    /**
     * @param value Gets name of the resource that is unique within a policy. This name can be used to access the resource.
     */
    @JvmName("bipvvfkraujvtkox")
    public suspend fun name(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.name = mapped
    }

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

    /**
     * @param value The rate limit duration in minutes. Defaults to `1`.
     */
    @JvmName("txekvwcsbehiifjn")
    public suspend fun rateLimitDurationInMinutes(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rateLimitDurationInMinutes = mapped
    }

    /**
     * @param value The rate limit threshold. Defaults to `10`.
     */
    @JvmName("ghwyijwaiqhhyeyl")
    public suspend fun rateLimitThreshold(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rateLimitThreshold = mapped
    }

    /**
     * @param value The type of rule. Possible values are `MatchRule` or `RateLimitRule`.
     */
    @JvmName("nskktswjktoigfjo")
    public suspend fun type(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.type = mapped
    }

    internal fun build(): FirewallPolicyCustomRuleArgs = FirewallPolicyCustomRuleArgs(
        action = action ?: throw PulumiNullFieldException("action"),
        enabled = enabled,
        matchConditions = matchConditions,
        name = name ?: throw PulumiNullFieldException("name"),
        priority = priority,
        rateLimitDurationInMinutes = rateLimitDurationInMinutes,
        rateLimitThreshold = rateLimitThreshold,
        type = type ?: throw PulumiNullFieldException("type"),
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy