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

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

package com.pulumi.azure.cdn.kotlin.inputs

import com.pulumi.azure.cdn.inputs.FrontdoorFirewallPolicyCustomRuleArgs.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 FrontdoorFirewallPolicyCustomRuleArgs(
    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.cdn.inputs.FrontdoorFirewallPolicyCustomRuleArgs =
        com.pulumi.azure.cdn.inputs.FrontdoorFirewallPolicyCustomRuleArgs.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 [FrontdoorFirewallPolicyCustomRuleArgs].
 */
@PulumiTagMarker
public class FrontdoorFirewallPolicyCustomRuleArgsBuilder 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("yshcyskboynwxahl")
    public suspend fun action(`value`: Output) {
        this.action = value
    }

    /**
     * @param value Is the rule is enabled or disabled? Defaults to `true`.
     */
    @JvmName("eomsyewwwgelxsgy")
    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("lruqlmmalfnmlryl")
    public suspend
    fun matchConditions(`value`: Output>) {
        this.matchConditions = value
    }

    @JvmName("udosbhvsquurnocn")
    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("oqkposmqogfvkflb")
    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("scbwrrysuljviqnq")
    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("jtauowhisabdmrtf")
    public suspend fun priority(`value`: Output) {
        this.priority = value
    }

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

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

    /**
     * @param value The type of rule. Possible values are `MatchRule` or `RateLimitRule`.
     */
    @JvmName("xghwlwdnuhncspss")
    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("imqtwfcvwkqdxbgk")
    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("labpvudkqqgyaonn")
    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("siwocwspnowtejqj")
    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("kpiatuhjrxhvjkyi")
    public suspend
    fun matchConditions(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            FrontdoorFirewallPolicyCustomRuleMatchConditionArgsBuilder().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("bmvwfgvplrqjhvsf")
    public suspend fun matchConditions(
        vararg
        argument: suspend FrontdoorFirewallPolicyCustomRuleMatchConditionArgsBuilder.() -> Unit,
    ) {
        val toBeMapped = argument.toList().map {
            FrontdoorFirewallPolicyCustomRuleMatchConditionArgsBuilder().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("cuidqhvjtycrqjrx")
    public suspend
    fun matchConditions(argument: suspend FrontdoorFirewallPolicyCustomRuleMatchConditionArgsBuilder.() -> Unit) {
        val toBeMapped =
            listOf(
                FrontdoorFirewallPolicyCustomRuleMatchConditionArgsBuilder().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("wprsipdrqgfjqeki")
    public suspend fun matchConditions(
        vararg
        values: FrontdoorFirewallPolicyCustomRuleMatchConditionArgs,
    ) {
        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("cvraikoehmbfabag")
    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("biqxabfboqkbyitx")
    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("puyausldgehdrrqa")
    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("apaprhhmpnrltdkw")
    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("pyhsusbkgbhirvib")
    public suspend fun type(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.type = mapped
    }

    internal fun build(): FrontdoorFirewallPolicyCustomRuleArgs =
        FrontdoorFirewallPolicyCustomRuleArgs(
            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