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