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

com.pulumi.azurenative.web.kotlin.inputs.ScaleArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.web.kotlin.inputs

import com.pulumi.azurenative.web.inputs.ScaleArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Container App scaling configurations.
 * @property maxReplicas Optional. Maximum number of container replicas. Defaults to 10 if not set.
 * @property minReplicas Optional. Minimum number of container replicas.
 * @property rules Scaling rules.
 */
public data class ScaleArgs(
    public val maxReplicas: Output? = null,
    public val minReplicas: Output? = null,
    public val rules: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.web.inputs.ScaleArgs =
        com.pulumi.azurenative.web.inputs.ScaleArgs.builder()
            .maxReplicas(maxReplicas?.applyValue({ args0 -> args0 }))
            .minReplicas(minReplicas?.applyValue({ args0 -> args0 }))
            .rules(
                rules?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [ScaleArgs].
 */
@PulumiTagMarker
public class ScaleArgsBuilder internal constructor() {
    private var maxReplicas: Output? = null

    private var minReplicas: Output? = null

    private var rules: Output>? = null

    /**
     * @param value Optional. Maximum number of container replicas. Defaults to 10 if not set.
     */
    @JvmName("ggqwdajxmjyaaubd")
    public suspend fun maxReplicas(`value`: Output) {
        this.maxReplicas = value
    }

    /**
     * @param value Optional. Minimum number of container replicas.
     */
    @JvmName("ehkhogqskrquckbr")
    public suspend fun minReplicas(`value`: Output) {
        this.minReplicas = value
    }

    /**
     * @param value Scaling rules.
     */
    @JvmName("diverwejqlmwidxq")
    public suspend fun rules(`value`: Output>) {
        this.rules = value
    }

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

    /**
     * @param values Scaling rules.
     */
    @JvmName("lhjlaftwjojhjryn")
    public suspend fun rules(values: List>) {
        this.rules = Output.all(values)
    }

    /**
     * @param value Optional. Maximum number of container replicas. Defaults to 10 if not set.
     */
    @JvmName("fbikmstsfvdbetkf")
    public suspend fun maxReplicas(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxReplicas = mapped
    }

    /**
     * @param value Optional. Minimum number of container replicas.
     */
    @JvmName("ajytsrvbdweaehcw")
    public suspend fun minReplicas(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.minReplicas = mapped
    }

    /**
     * @param value Scaling rules.
     */
    @JvmName("mbhwojpckmwoxuew")
    public suspend fun rules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rules = mapped
    }

    /**
     * @param argument Scaling rules.
     */
    @JvmName("qwskbjbhwriluheh")
    public suspend fun rules(argument: List Unit>) {
        val toBeMapped = argument.toList().map { ScaleRuleArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param argument Scaling rules.
     */
    @JvmName("ctonurjlxqrgssrh")
    public suspend fun rules(vararg argument: suspend ScaleRuleArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { ScaleRuleArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param argument Scaling rules.
     */
    @JvmName("fcsjmbktrwbgbxvs")
    public suspend fun rules(argument: suspend ScaleRuleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(ScaleRuleArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param values Scaling rules.
     */
    @JvmName("gimlwqonbbtfrhqi")
    public suspend fun rules(vararg values: ScaleRuleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.rules = mapped
    }

    internal fun build(): ScaleArgs = ScaleArgs(
        maxReplicas = maxReplicas,
        minReplicas = minReplicas,
        rules = rules,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy