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

com.pulumi.aws.appmesh.kotlin.inputs.RouteSpecHttp2RouteActionArgs.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: 6.57.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.appmesh.kotlin.inputs

import com.pulumi.aws.appmesh.inputs.RouteSpecHttp2RouteActionArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
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 weightedTargets Targets that traffic is routed to when a request matches the route.
 * You can specify one or more targets and their relative weights with which to distribute traffic.
 */
public data class RouteSpecHttp2RouteActionArgs(
    public val weightedTargets: Output>,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.appmesh.inputs.RouteSpecHttp2RouteActionArgs =
        com.pulumi.aws.appmesh.inputs.RouteSpecHttp2RouteActionArgs.builder()
            .weightedTargets(
                weightedTargets.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

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

    /**
     * @param value Targets that traffic is routed to when a request matches the route.
     * You can specify one or more targets and their relative weights with which to distribute traffic.
     */
    @JvmName("sainbcebxnskcpdx")
    public suspend fun weightedTargets(`value`: Output>) {
        this.weightedTargets = value
    }

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

    /**
     * @param values Targets that traffic is routed to when a request matches the route.
     * You can specify one or more targets and their relative weights with which to distribute traffic.
     */
    @JvmName("htsgncdnxppyilyf")
    public suspend fun weightedTargets(values: List>) {
        this.weightedTargets = Output.all(values)
    }

    /**
     * @param value Targets that traffic is routed to when a request matches the route.
     * You can specify one or more targets and their relative weights with which to distribute traffic.
     */
    @JvmName("aphdiqausaaflcfj")
    public suspend fun weightedTargets(`value`: List) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.weightedTargets = mapped
    }

    /**
     * @param argument Targets that traffic is routed to when a request matches the route.
     * You can specify one or more targets and their relative weights with which to distribute traffic.
     */
    @JvmName("bttwkqiaxlwvggnk")
    public suspend fun weightedTargets(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            RouteSpecHttp2RouteActionWeightedTargetArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.weightedTargets = mapped
    }

    /**
     * @param argument Targets that traffic is routed to when a request matches the route.
     * You can specify one or more targets and their relative weights with which to distribute traffic.
     */
    @JvmName("llopntlbgtvympmj")
    public suspend fun weightedTargets(vararg argument: suspend RouteSpecHttp2RouteActionWeightedTargetArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            RouteSpecHttp2RouteActionWeightedTargetArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.weightedTargets = mapped
    }

    /**
     * @param argument Targets that traffic is routed to when a request matches the route.
     * You can specify one or more targets and their relative weights with which to distribute traffic.
     */
    @JvmName("eggqjrtwdpbsvnmp")
    public suspend fun weightedTargets(argument: suspend RouteSpecHttp2RouteActionWeightedTargetArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            RouteSpecHttp2RouteActionWeightedTargetArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.weightedTargets = mapped
    }

    /**
     * @param values Targets that traffic is routed to when a request matches the route.
     * You can specify one or more targets and their relative weights with which to distribute traffic.
     */
    @JvmName("btixoanisvwsnujp")
    public suspend fun weightedTargets(vararg values: RouteSpecHttp2RouteActionWeightedTargetArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.weightedTargets = mapped
    }

    internal fun build(): RouteSpecHttp2RouteActionArgs = RouteSpecHttp2RouteActionArgs(
        weightedTargets = weightedTargets ?: throw PulumiNullFieldException("weightedTargets"),
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy