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

com.pulumi.gcp.networkservices.kotlin.inputs.HttpRouteRuleArgs.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: 8.12.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.networkservices.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.networkservices.inputs.HttpRouteRuleArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property action The detailed rule defining how to route matched traffic.
 * Structure is documented below.
 * @property matches A list of matches define conditions used for matching the rule against incoming HTTP requests. Each match is independent, i.e. this rule will be matched if ANY one of the matches is satisfied.
 * If no matches field is specified, this rule will unconditionally match traffic.
 * If a default rule is desired to be configured, add a rule with no matches specified to the end of the rules list.
 * Structure is documented below.
 */
public data class HttpRouteRuleArgs(
    public val action: Output? = null,
    public val matches: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.networkservices.inputs.HttpRouteRuleArgs =
        com.pulumi.gcp.networkservices.inputs.HttpRouteRuleArgs.builder()
            .action(action?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .matches(
                matches?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

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

    private var matches: Output>? = null

    /**
     * @param value The detailed rule defining how to route matched traffic.
     * Structure is documented below.
     */
    @JvmName("xphvgexygcsramsn")
    public suspend fun action(`value`: Output) {
        this.action = value
    }

    /**
     * @param value A list of matches define conditions used for matching the rule against incoming HTTP requests. Each match is independent, i.e. this rule will be matched if ANY one of the matches is satisfied.
     * If no matches field is specified, this rule will unconditionally match traffic.
     * If a default rule is desired to be configured, add a rule with no matches specified to the end of the rules list.
     * Structure is documented below.
     */
    @JvmName("liytergmwwmueavn")
    public suspend fun matches(`value`: Output>) {
        this.matches = value
    }

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

    /**
     * @param values A list of matches define conditions used for matching the rule against incoming HTTP requests. Each match is independent, i.e. this rule will be matched if ANY one of the matches is satisfied.
     * If no matches field is specified, this rule will unconditionally match traffic.
     * If a default rule is desired to be configured, add a rule with no matches specified to the end of the rules list.
     * Structure is documented below.
     */
    @JvmName("oqvxjixnhfspiygi")
    public suspend fun matches(values: List>) {
        this.matches = Output.all(values)
    }

    /**
     * @param value The detailed rule defining how to route matched traffic.
     * Structure is documented below.
     */
    @JvmName("ccbpbvycwqhgsfna")
    public suspend fun action(`value`: HttpRouteRuleActionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.action = mapped
    }

    /**
     * @param argument The detailed rule defining how to route matched traffic.
     * Structure is documented below.
     */
    @JvmName("mkowfeyplkgpflnu")
    public suspend fun action(argument: suspend HttpRouteRuleActionArgsBuilder.() -> Unit) {
        val toBeMapped = HttpRouteRuleActionArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.action = mapped
    }

    /**
     * @param value A list of matches define conditions used for matching the rule against incoming HTTP requests. Each match is independent, i.e. this rule will be matched if ANY one of the matches is satisfied.
     * If no matches field is specified, this rule will unconditionally match traffic.
     * If a default rule is desired to be configured, add a rule with no matches specified to the end of the rules list.
     * Structure is documented below.
     */
    @JvmName("hwwdobhfwbstrsyy")
    public suspend fun matches(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.matches = mapped
    }

    /**
     * @param argument A list of matches define conditions used for matching the rule against incoming HTTP requests. Each match is independent, i.e. this rule will be matched if ANY one of the matches is satisfied.
     * If no matches field is specified, this rule will unconditionally match traffic.
     * If a default rule is desired to be configured, add a rule with no matches specified to the end of the rules list.
     * Structure is documented below.
     */
    @JvmName("cdqrfdklvkciadhs")
    public suspend fun matches(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            HttpRouteRuleMatchArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.matches = mapped
    }

    /**
     * @param argument A list of matches define conditions used for matching the rule against incoming HTTP requests. Each match is independent, i.e. this rule will be matched if ANY one of the matches is satisfied.
     * If no matches field is specified, this rule will unconditionally match traffic.
     * If a default rule is desired to be configured, add a rule with no matches specified to the end of the rules list.
     * Structure is documented below.
     */
    @JvmName("ejjfoubhfsccokbl")
    public suspend fun matches(vararg argument: suspend HttpRouteRuleMatchArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            HttpRouteRuleMatchArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.matches = mapped
    }

    /**
     * @param argument A list of matches define conditions used for matching the rule against incoming HTTP requests. Each match is independent, i.e. this rule will be matched if ANY one of the matches is satisfied.
     * If no matches field is specified, this rule will unconditionally match traffic.
     * If a default rule is desired to be configured, add a rule with no matches specified to the end of the rules list.
     * Structure is documented below.
     */
    @JvmName("acmkslhvylialswp")
    public suspend fun matches(argument: suspend HttpRouteRuleMatchArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(HttpRouteRuleMatchArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.matches = mapped
    }

    /**
     * @param values A list of matches define conditions used for matching the rule against incoming HTTP requests. Each match is independent, i.e. this rule will be matched if ANY one of the matches is satisfied.
     * If no matches field is specified, this rule will unconditionally match traffic.
     * If a default rule is desired to be configured, add a rule with no matches specified to the end of the rules list.
     * Structure is documented below.
     */
    @JvmName("qeonrvavcxmxtkjb")
    public suspend fun matches(vararg values: HttpRouteRuleMatchArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.matches = mapped
    }

    internal fun build(): HttpRouteRuleArgs = HttpRouteRuleArgs(
        action = action,
        matches = matches,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy