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

com.pulumi.kubernetes.autoscaling.v2.kotlin.inputs.ExternalMetricSourceArgs.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: 4.18.2.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.kubernetes.autoscaling.v2.kotlin.inputs

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 com.pulumi.kubernetes.autoscaling.v2.inputs.ExternalMetricSourceArgs.builder
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * ExternalMetricSource indicates how to scale on a metric not associated with any Kubernetes object (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).
 * @property metric metric identifies the target metric by name and selector
 * @property target target specifies the target value for the given metric
 */
public data class ExternalMetricSourceArgs(
    public val metric: Output,
    public val target: Output,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.kubernetes.autoscaling.v2.inputs.ExternalMetricSourceArgs =
        com.pulumi.kubernetes.autoscaling.v2.inputs.ExternalMetricSourceArgs.builder()
            .metric(metric.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .target(target.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [ExternalMetricSourceArgs].
 */
@PulumiTagMarker
public class ExternalMetricSourceArgsBuilder internal constructor() {
    private var metric: Output? = null

    private var target: Output? = null

    /**
     * @param value metric identifies the target metric by name and selector
     */
    @JvmName("bouejcbxlfvucgbc")
    public suspend fun metric(`value`: Output) {
        this.metric = value
    }

    /**
     * @param value target specifies the target value for the given metric
     */
    @JvmName("wrneeamkuvomfwhi")
    public suspend fun target(`value`: Output) {
        this.target = value
    }

    /**
     * @param value metric identifies the target metric by name and selector
     */
    @JvmName("fbtomgsgrnydkpii")
    public suspend fun metric(`value`: MetricIdentifierArgs) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.metric = mapped
    }

    /**
     * @param argument metric identifies the target metric by name and selector
     */
    @JvmName("lajvjfjbeohotdld")
    public suspend fun metric(argument: suspend MetricIdentifierArgsBuilder.() -> Unit) {
        val toBeMapped = MetricIdentifierArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.metric = mapped
    }

    /**
     * @param value target specifies the target value for the given metric
     */
    @JvmName("clhwmfvnbxbbcxga")
    public suspend fun target(`value`: MetricTargetArgs) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.target = mapped
    }

    /**
     * @param argument target specifies the target value for the given metric
     */
    @JvmName("qibwfneyxjcwibiw")
    public suspend fun target(argument: suspend MetricTargetArgsBuilder.() -> Unit) {
        val toBeMapped = MetricTargetArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.target = mapped
    }

    internal fun build(): ExternalMetricSourceArgs = ExternalMetricSourceArgs(
        metric = metric ?: throw PulumiNullFieldException("metric"),
        target = target ?: throw PulumiNullFieldException("target"),
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy