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

com.pulumi.digitalocean.kotlin.inputs.AppSpecServiceAutoscalingArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.digitalocean.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.digitalocean.inputs.AppSpecServiceAutoscalingArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 *
 * @property maxInstanceCount The maximum amount of instances for this component. Must be more than min_instance_count.
 * @property metrics The metrics that the component is scaled on.
 * @property minInstanceCount The minimum amount of instances for this component. Must be less than max_instance_count.
 */
public data class AppSpecServiceAutoscalingArgs(
    public val maxInstanceCount: Output,
    public val metrics: Output,
    public val minInstanceCount: Output,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.digitalocean.inputs.AppSpecServiceAutoscalingArgs =
        com.pulumi.digitalocean.inputs.AppSpecServiceAutoscalingArgs.builder()
            .maxInstanceCount(maxInstanceCount.applyValue({ args0 -> args0 }))
            .metrics(metrics.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .minInstanceCount(minInstanceCount.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AppSpecServiceAutoscalingArgs].
 */
@PulumiTagMarker
public class AppSpecServiceAutoscalingArgsBuilder internal constructor() {
    private var maxInstanceCount: Output? = null

    private var metrics: Output? = null

    private var minInstanceCount: Output? = null

    /**
     * @param value The maximum amount of instances for this component. Must be more than min_instance_count.
     */
    @JvmName("rufikecvmughnscg")
    public suspend fun maxInstanceCount(`value`: Output) {
        this.maxInstanceCount = value
    }

    /**
     * @param value The metrics that the component is scaled on.
     */
    @JvmName("kixritjcrpsnfpou")
    public suspend fun metrics(`value`: Output) {
        this.metrics = value
    }

    /**
     * @param value The minimum amount of instances for this component. Must be less than max_instance_count.
     */
    @JvmName("wncwbygamgigsiwj")
    public suspend fun minInstanceCount(`value`: Output) {
        this.minInstanceCount = value
    }

    /**
     * @param value The maximum amount of instances for this component. Must be more than min_instance_count.
     */
    @JvmName("pokryvdeqntujqyo")
    public suspend fun maxInstanceCount(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.maxInstanceCount = mapped
    }

    /**
     * @param value The metrics that the component is scaled on.
     */
    @JvmName("ddifdjtxntoxehad")
    public suspend fun metrics(`value`: AppSpecServiceAutoscalingMetricsArgs) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.metrics = mapped
    }

    /**
     * @param argument The metrics that the component is scaled on.
     */
    @JvmName("sibipknvmawfrelq")
    public suspend fun metrics(argument: suspend AppSpecServiceAutoscalingMetricsArgsBuilder.() -> Unit) {
        val toBeMapped = AppSpecServiceAutoscalingMetricsArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.metrics = mapped
    }

    /**
     * @param value The minimum amount of instances for this component. Must be less than max_instance_count.
     */
    @JvmName("ocgmmkkptxpejsht")
    public suspend fun minInstanceCount(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.minInstanceCount = mapped
    }

    internal fun build(): AppSpecServiceAutoscalingArgs = AppSpecServiceAutoscalingArgs(
        maxInstanceCount = maxInstanceCount ?: throw PulumiNullFieldException("maxInstanceCount"),
        metrics = metrics ?: throw PulumiNullFieldException("metrics"),
        minInstanceCount = minInstanceCount ?: throw PulumiNullFieldException("minInstanceCount"),
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy