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

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

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

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

import com.pulumi.azurenative.network.inputs.RoutingRuleArgs.builder
import com.pulumi.azurenative.network.kotlin.enums.FrontDoorProtocol
import com.pulumi.azurenative.network.kotlin.enums.RoutingRuleEnabledState
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.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * A routing rule represents a specification for traffic to treat and where to send it, along with health probe information.
 * @property acceptedProtocols Protocol schemes to match for this rule
 * @property enabledState Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'
 * @property frontendEndpoints Frontend endpoints associated with this rule
 * @property id Resource ID.
 * @property name Resource name.
 * @property patternsToMatch The route patterns of the rule.
 * @property routeConfiguration A reference to the routing configuration.
 * @property rulesEngine A reference to a specific Rules Engine Configuration to apply to this route.
 * @property webApplicationFirewallPolicyLink Defines the Web Application Firewall policy for each routing rule (if applicable)
 */
public data class RoutingRuleArgs(
    public val acceptedProtocols: Output>>? = null,
    public val enabledState: Output>? = null,
    public val frontendEndpoints: Output>? = null,
    public val id: Output? = null,
    public val name: Output? = null,
    public val patternsToMatch: Output>? = null,
    public val routeConfiguration: Output>? = null,
    public val rulesEngine: Output? = null,
    public val webApplicationFirewallPolicyLink: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.network.inputs.RoutingRuleArgs =
        com.pulumi.azurenative.network.inputs.RoutingRuleArgs.builder()
            .acceptedProtocols(
                acceptedProtocols?.applyValue({ args0 ->
                    args0.map({ 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() })
                    })
                }),
            )
            .frontendEndpoints(
                frontendEndpoints?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .id(id?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .patternsToMatch(patternsToMatch?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .routeConfiguration(
                routeConfiguration?.applyValue({ args0 ->
                    args0.transform({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    }, { args0 -> args0.let({ args0 -> args0.toJava() }) })
                }),
            )
            .rulesEngine(rulesEngine?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .webApplicationFirewallPolicyLink(
                webApplicationFirewallPolicyLink?.applyValue({ args0 ->
                    args0.let({ args0 -> args0.toJava() })
                }),
            ).build()
}

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

    private var enabledState: Output>? = null

    private var frontendEndpoints: Output>? = null

    private var id: Output? = null

    private var name: Output? = null

    private var patternsToMatch: Output>? = null

    private var routeConfiguration:
        Output>? = null

    private var rulesEngine: Output? = null

    private var webApplicationFirewallPolicyLink:
        Output? = null

    /**
     * @param value Protocol schemes to match for this rule
     */
    @JvmName("otfmhlslmgjctynl")
    public suspend fun acceptedProtocols(`value`: Output>>) {
        this.acceptedProtocols = value
    }

    @JvmName("jjxcvccqnayejprs")
    public suspend fun acceptedProtocols(vararg values: Output>) {
        this.acceptedProtocols = Output.all(values.asList())
    }

    /**
     * @param values Protocol schemes to match for this rule
     */
    @JvmName("escqoqutindrngta")
    public suspend fun acceptedProtocols(values: List>>) {
        this.acceptedProtocols = Output.all(values)
    }

    /**
     * @param value Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'
     */
    @JvmName("opwvpytlypeklymh")
    public suspend fun enabledState(`value`: Output>) {
        this.enabledState = value
    }

    /**
     * @param value Frontend endpoints associated with this rule
     */
    @JvmName("irakydaemcddtjwm")
    public suspend fun frontendEndpoints(`value`: Output>) {
        this.frontendEndpoints = value
    }

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

    /**
     * @param values Frontend endpoints associated with this rule
     */
    @JvmName("iiqqjefuvwoyyolx")
    public suspend fun frontendEndpoints(values: List>) {
        this.frontendEndpoints = Output.all(values)
    }

    /**
     * @param value Resource ID.
     */
    @JvmName("axeagbvmkrvmrjgk")
    public suspend fun id(`value`: Output) {
        this.id = value
    }

    /**
     * @param value Resource name.
     */
    @JvmName("wwmncvtqykbgrecl")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The route patterns of the rule.
     */
    @JvmName("jqclrptmakldthha")
    public suspend fun patternsToMatch(`value`: Output>) {
        this.patternsToMatch = value
    }

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

    /**
     * @param values The route patterns of the rule.
     */
    @JvmName("vcimbxnptdrvsoat")
    public suspend fun patternsToMatch(values: List>) {
        this.patternsToMatch = Output.all(values)
    }

    /**
     * @param value A reference to the routing configuration.
     */
    @JvmName("bealnjxutadhwoli")
    public suspend fun routeConfiguration(`value`: Output>) {
        this.routeConfiguration = value
    }

    /**
     * @param value A reference to a specific Rules Engine Configuration to apply to this route.
     */
    @JvmName("qjuguwykfyxtsvhi")
    public suspend fun rulesEngine(`value`: Output) {
        this.rulesEngine = value
    }

    /**
     * @param value Defines the Web Application Firewall policy for each routing rule (if applicable)
     */
    @JvmName("uwwwnfmnlytlqdko")
    public suspend fun webApplicationFirewallPolicyLink(`value`: Output) {
        this.webApplicationFirewallPolicyLink = value
    }

    /**
     * @param value Protocol schemes to match for this rule
     */
    @JvmName("deblssdxugwfiivi")
    public suspend fun acceptedProtocols(`value`: List>?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.acceptedProtocols = mapped
    }

    /**
     * @param values Protocol schemes to match for this rule
     */
    @JvmName("cmmmhvikoosatxwj")
    public suspend fun acceptedProtocols(vararg values: Either) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.acceptedProtocols = mapped
    }

    /**
     * @param value Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'
     */
    @JvmName("tajxgwmuamiyiqhc")
    public suspend fun enabledState(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enabledState = mapped
    }

    /**
     * @param value Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'
     */
    @JvmName("hxgotmflfkyofugc")
    public fun enabledState(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.enabledState = mapped
    }

    /**
     * @param value Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'
     */
    @JvmName("uostqvrooifyxswp")
    public fun enabledState(`value`: RoutingRuleEnabledState) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.enabledState = mapped
    }

    /**
     * @param value Frontend endpoints associated with this rule
     */
    @JvmName("xvbdyrixyobyqwph")
    public suspend fun frontendEndpoints(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.frontendEndpoints = mapped
    }

    /**
     * @param argument Frontend endpoints associated with this rule
     */
    @JvmName("mioiabnujfrcyjuy")
    public suspend fun frontendEndpoints(argument: List Unit>) {
        val toBeMapped = argument.toList().map { SubResourceArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.frontendEndpoints = mapped
    }

    /**
     * @param argument Frontend endpoints associated with this rule
     */
    @JvmName("tkmtjgojlochchxd")
    public suspend fun frontendEndpoints(vararg argument: suspend SubResourceArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { SubResourceArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.frontendEndpoints = mapped
    }

    /**
     * @param argument Frontend endpoints associated with this rule
     */
    @JvmName("wmttjtaldorpxcwk")
    public suspend fun frontendEndpoints(argument: suspend SubResourceArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(SubResourceArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.frontendEndpoints = mapped
    }

    /**
     * @param values Frontend endpoints associated with this rule
     */
    @JvmName("mntnomlficurmvym")
    public suspend fun frontendEndpoints(vararg values: SubResourceArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.frontendEndpoints = mapped
    }

    /**
     * @param value Resource ID.
     */
    @JvmName("lqvcnkgtnmceuqdx")
    public suspend fun id(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.id = mapped
    }

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

    /**
     * @param value The route patterns of the rule.
     */
    @JvmName("pjnisydurootmuui")
    public suspend fun patternsToMatch(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.patternsToMatch = mapped
    }

    /**
     * @param values The route patterns of the rule.
     */
    @JvmName("lnauwgcxehisjxsv")
    public suspend fun patternsToMatch(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.patternsToMatch = mapped
    }

    /**
     * @param value A reference to the routing configuration.
     */
    @JvmName("wgrdincwhwqwibmk")
    public suspend fun routeConfiguration(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.routeConfiguration = mapped
    }

    /**
     * @param value A reference to the routing configuration.
     */
    @JvmName("kxhlgwxbaqchikrx")
    public fun routeConfiguration(`value`: ForwardingConfigurationArgs) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.routeConfiguration = mapped
    }

    /**
     * @param value A reference to the routing configuration.
     */
    @JvmName("rpvjwpnnbqgvptaf")
    public fun routeConfiguration(`value`: RedirectConfigurationArgs) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.routeConfiguration = mapped
    }

    /**
     * @param value A reference to a specific Rules Engine Configuration to apply to this route.
     */
    @JvmName("qegnsfcaumcesxnh")
    public suspend fun rulesEngine(`value`: SubResourceArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rulesEngine = mapped
    }

    /**
     * @param argument A reference to a specific Rules Engine Configuration to apply to this route.
     */
    @JvmName("pdopcxpyyhavagjp")
    public suspend fun rulesEngine(argument: suspend SubResourceArgsBuilder.() -> Unit) {
        val toBeMapped = SubResourceArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.rulesEngine = mapped
    }

    /**
     * @param value Defines the Web Application Firewall policy for each routing rule (if applicable)
     */
    @JvmName("yhlcbgehthnyxski")
    public suspend fun webApplicationFirewallPolicyLink(`value`: RoutingRuleUpdateParametersWebApplicationFirewallPolicyLinkArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.webApplicationFirewallPolicyLink = mapped
    }

    /**
     * @param argument Defines the Web Application Firewall policy for each routing rule (if applicable)
     */
    @JvmName("jmssjlitnoqkrrdc")
    public suspend fun webApplicationFirewallPolicyLink(argument: suspend RoutingRuleUpdateParametersWebApplicationFirewallPolicyLinkArgsBuilder.() -> Unit) {
        val toBeMapped =
            RoutingRuleUpdateParametersWebApplicationFirewallPolicyLinkArgsBuilder().applySuspend {
                argument()
            }.build()
        val mapped = of(toBeMapped)
        this.webApplicationFirewallPolicyLink = mapped
    }

    internal fun build(): RoutingRuleArgs = RoutingRuleArgs(
        acceptedProtocols = acceptedProtocols,
        enabledState = enabledState,
        frontendEndpoints = frontendEndpoints,
        id = id,
        name = name,
        patternsToMatch = patternsToMatch,
        routeConfiguration = routeConfiguration,
        rulesEngine = rulesEngine,
        webApplicationFirewallPolicyLink = webApplicationFirewallPolicyLink,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy