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

com.pulumi.gcp.networkservices.kotlin.inputs.TcpRouteRuleArgs.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.TcpRouteRuleArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
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 A detailed rule defining how to route traffic.
 * Structure is documented below.
 * @property matches RouteMatch defines the predicate used to match requests to a given action. Multiple match types are "OR"ed for evaluation.
 * If no routeMatch field is specified, this rule will unconditionally match traffic.
 * Structure is documented below.
 */
public data class TcpRouteRuleArgs(
    public val action: Output,
    public val matches: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.networkservices.inputs.TcpRouteRuleArgs =
        com.pulumi.gcp.networkservices.inputs.TcpRouteRuleArgs.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 [TcpRouteRuleArgs].
 */
@PulumiTagMarker
public class TcpRouteRuleArgsBuilder internal constructor() {
    private var action: Output? = null

    private var matches: Output>? = null

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

    /**
     * @param value RouteMatch defines the predicate used to match requests to a given action. Multiple match types are "OR"ed for evaluation.
     * If no routeMatch field is specified, this rule will unconditionally match traffic.
     * Structure is documented below.
     */
    @JvmName("aucyhjxwcxyljjwu")
    public suspend fun matches(`value`: Output>) {
        this.matches = value
    }

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

    /**
     * @param values RouteMatch defines the predicate used to match requests to a given action. Multiple match types are "OR"ed for evaluation.
     * If no routeMatch field is specified, this rule will unconditionally match traffic.
     * Structure is documented below.
     */
    @JvmName("ixegpkewhsftyxmn")
    public suspend fun matches(values: List>) {
        this.matches = Output.all(values)
    }

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

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

    /**
     * @param value RouteMatch defines the predicate used to match requests to a given action. Multiple match types are "OR"ed for evaluation.
     * If no routeMatch field is specified, this rule will unconditionally match traffic.
     * Structure is documented below.
     */
    @JvmName("gmmuunyuxbycueue")
    public suspend fun matches(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.matches = mapped
    }

    /**
     * @param argument RouteMatch defines the predicate used to match requests to a given action. Multiple match types are "OR"ed for evaluation.
     * If no routeMatch field is specified, this rule will unconditionally match traffic.
     * Structure is documented below.
     */
    @JvmName("ncyjyvarkbpduwry")
    public suspend fun matches(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            TcpRouteRuleMatchArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.matches = mapped
    }

    /**
     * @param argument RouteMatch defines the predicate used to match requests to a given action. Multiple match types are "OR"ed for evaluation.
     * If no routeMatch field is specified, this rule will unconditionally match traffic.
     * Structure is documented below.
     */
    @JvmName("bdownfbboamqfyqh")
    public suspend fun matches(vararg argument: suspend TcpRouteRuleMatchArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            TcpRouteRuleMatchArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.matches = mapped
    }

    /**
     * @param argument RouteMatch defines the predicate used to match requests to a given action. Multiple match types are "OR"ed for evaluation.
     * If no routeMatch field is specified, this rule will unconditionally match traffic.
     * Structure is documented below.
     */
    @JvmName("ybtyrludvnkctwvb")
    public suspend fun matches(argument: suspend TcpRouteRuleMatchArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TcpRouteRuleMatchArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.matches = mapped
    }

    /**
     * @param values RouteMatch defines the predicate used to match requests to a given action. Multiple match types are "OR"ed for evaluation.
     * If no routeMatch field is specified, this rule will unconditionally match traffic.
     * Structure is documented below.
     */
    @JvmName("iuppimsunipeufme")
    public suspend fun matches(vararg values: TcpRouteRuleMatchArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.matches = mapped
    }

    internal fun build(): TcpRouteRuleArgs = TcpRouteRuleArgs(
        action = action ?: throw PulumiNullFieldException("action"),
        matches = matches,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy