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

com.pulumi.gcp.networkservices.kotlin.inputs.TcpRouteRuleActionArgs.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.13.1.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.TcpRouteRuleActionArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property destinations The destination services to which traffic should be forwarded. At least one destination service is required.
 * Structure is documented below.
 * @property idleTimeout Specifies the idle timeout for the selected route. The idle timeout is defined as the period in which there are no bytes sent or received on either the upstream or downstream connection. If not set, the default idle timeout is 30 seconds. If set to 0s, the timeout will be disabled.
 * A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
 * @property originalDestination If true, Router will use the destination IP and port of the original connection as the destination of the request.
 */
public data class TcpRouteRuleActionArgs(
    public val destinations: Output>? = null,
    public val idleTimeout: Output? = null,
    public val originalDestination: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.networkservices.inputs.TcpRouteRuleActionArgs =
        com.pulumi.gcp.networkservices.inputs.TcpRouteRuleActionArgs.builder()
            .destinations(
                destinations?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .idleTimeout(idleTimeout?.applyValue({ args0 -> args0 }))
            .originalDestination(originalDestination?.applyValue({ args0 -> args0 })).build()
}

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

    private var idleTimeout: Output? = null

    private var originalDestination: Output? = null

    /**
     * @param value The destination services to which traffic should be forwarded. At least one destination service is required.
     * Structure is documented below.
     */
    @JvmName("wtqskpegclhsfqmu")
    public suspend fun destinations(`value`: Output>) {
        this.destinations = value
    }

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

    /**
     * @param values The destination services to which traffic should be forwarded. At least one destination service is required.
     * Structure is documented below.
     */
    @JvmName("afanpylgwpwydqxh")
    public suspend fun destinations(values: List>) {
        this.destinations = Output.all(values)
    }

    /**
     * @param value Specifies the idle timeout for the selected route. The idle timeout is defined as the period in which there are no bytes sent or received on either the upstream or downstream connection. If not set, the default idle timeout is 30 seconds. If set to 0s, the timeout will be disabled.
     * A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
     */
    @JvmName("mpurmvfxirabouin")
    public suspend fun idleTimeout(`value`: Output) {
        this.idleTimeout = value
    }

    /**
     * @param value If true, Router will use the destination IP and port of the original connection as the destination of the request.
     */
    @JvmName("ynydsnmhogkjeubn")
    public suspend fun originalDestination(`value`: Output) {
        this.originalDestination = value
    }

    /**
     * @param value The destination services to which traffic should be forwarded. At least one destination service is required.
     * Structure is documented below.
     */
    @JvmName("plrjngqyowiagjpq")
    public suspend fun destinations(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destinations = mapped
    }

    /**
     * @param argument The destination services to which traffic should be forwarded. At least one destination service is required.
     * Structure is documented below.
     */
    @JvmName("wetmlkyhofkkffso")
    public suspend fun destinations(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            TcpRouteRuleActionDestinationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.destinations = mapped
    }

    /**
     * @param argument The destination services to which traffic should be forwarded. At least one destination service is required.
     * Structure is documented below.
     */
    @JvmName("dhhqcptpfsjfjljq")
    public suspend fun destinations(vararg argument: suspend TcpRouteRuleActionDestinationArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            TcpRouteRuleActionDestinationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.destinations = mapped
    }

    /**
     * @param argument The destination services to which traffic should be forwarded. At least one destination service is required.
     * Structure is documented below.
     */
    @JvmName("mdbmlqqeyyhvqdpl")
    public suspend fun destinations(argument: suspend TcpRouteRuleActionDestinationArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            TcpRouteRuleActionDestinationArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.destinations = mapped
    }

    /**
     * @param values The destination services to which traffic should be forwarded. At least one destination service is required.
     * Structure is documented below.
     */
    @JvmName("iweqtisdfdbsfhmp")
    public suspend fun destinations(vararg values: TcpRouteRuleActionDestinationArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.destinations = mapped
    }

    /**
     * @param value Specifies the idle timeout for the selected route. The idle timeout is defined as the period in which there are no bytes sent or received on either the upstream or downstream connection. If not set, the default idle timeout is 30 seconds. If set to 0s, the timeout will be disabled.
     * A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
     */
    @JvmName("yuchlfdrcmqmnrqw")
    public suspend fun idleTimeout(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.idleTimeout = mapped
    }

    /**
     * @param value If true, Router will use the destination IP and port of the original connection as the destination of the request.
     */
    @JvmName("iylkrvhdafjdtwve")
    public suspend fun originalDestination(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.originalDestination = mapped
    }

    internal fun build(): TcpRouteRuleActionArgs = TcpRouteRuleActionArgs(
        destinations = destinations,
        idleTimeout = idleTimeout,
        originalDestination = originalDestination,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy