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

com.pulumi.gcp.networkservices.kotlin.inputs.GrpcRouteRuleArgs.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.10.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.GrpcRouteRuleArgs.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 Required. A detailed rule defining how to route traffic.
 * Structure is documented below.
 * @property matches Matches define conditions used for matching the rule against incoming gRPC requests.
 * Structure is documented below.
 */
public data class GrpcRouteRuleArgs(
    public val action: Output? = null,
    public val matches: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.networkservices.inputs.GrpcRouteRuleArgs =
        com.pulumi.gcp.networkservices.inputs.GrpcRouteRuleArgs.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 [GrpcRouteRuleArgs].
 */
@PulumiTagMarker
public class GrpcRouteRuleArgsBuilder internal constructor() {
    private var action: Output? = null

    private var matches: Output>? = null

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

    /**
     * @param value Matches define conditions used for matching the rule against incoming gRPC requests.
     * Structure is documented below.
     */
    @JvmName("udvdsogvlkwqeidm")
    public suspend fun matches(`value`: Output>) {
        this.matches = value
    }

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

    /**
     * @param values Matches define conditions used for matching the rule against incoming gRPC requests.
     * Structure is documented below.
     */
    @JvmName("gbfelhixfauwerxa")
    public suspend fun matches(values: List>) {
        this.matches = Output.all(values)
    }

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

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

    /**
     * @param value Matches define conditions used for matching the rule against incoming gRPC requests.
     * Structure is documented below.
     */
    @JvmName("ggpkjkeqeldmvvqc")
    public suspend fun matches(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.matches = mapped
    }

    /**
     * @param argument Matches define conditions used for matching the rule against incoming gRPC requests.
     * Structure is documented below.
     */
    @JvmName("fxpsbiwwostakefs")
    public suspend fun matches(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            GrpcRouteRuleMatchArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.matches = mapped
    }

    /**
     * @param argument Matches define conditions used for matching the rule against incoming gRPC requests.
     * Structure is documented below.
     */
    @JvmName("edjoyqtjkaanpknb")
    public suspend fun matches(vararg argument: suspend GrpcRouteRuleMatchArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            GrpcRouteRuleMatchArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.matches = mapped
    }

    /**
     * @param argument Matches define conditions used for matching the rule against incoming gRPC requests.
     * Structure is documented below.
     */
    @JvmName("ujsrdsfumtflemjt")
    public suspend fun matches(argument: suspend GrpcRouteRuleMatchArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(GrpcRouteRuleMatchArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.matches = mapped
    }

    /**
     * @param values Matches define conditions used for matching the rule against incoming gRPC requests.
     * Structure is documented below.
     */
    @JvmName("fxtbtapatlxyxueh")
    public suspend fun matches(vararg values: GrpcRouteRuleMatchArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.matches = mapped
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy