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

com.pulumi.azure.monitoring.kotlin.inputs.MetricAlertCriteriaArgs.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.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.monitoring.kotlin.inputs

import com.pulumi.azure.monitoring.inputs.MetricAlertCriteriaArgs.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.Boolean
import kotlin.Double
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property aggregation The statistic that runs over the metric values. Possible values are `Average`, `Count`, `Minimum`, `Maximum` and `Total`.
 * @property dimensions One or more `dimension` blocks as defined below.
 * @property metricName One of the metric names to be monitored.
 * @property metricNamespace One of the metric namespaces to be monitored.
 * @property operator The criteria operator. Possible values are `Equals`, `GreaterThan`, `GreaterThanOrEqual`, `LessThan` and `LessThanOrEqual`.
 * @property skipMetricValidation Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted? Defaults to `false`.
 * @property threshold The criteria threshold value that activates the alert.
 */
public data class MetricAlertCriteriaArgs(
    public val aggregation: Output,
    public val dimensions: Output>? = null,
    public val metricName: Output,
    public val metricNamespace: Output,
    public val `operator`: Output,
    public val skipMetricValidation: Output? = null,
    public val threshold: Output,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.monitoring.inputs.MetricAlertCriteriaArgs =
        com.pulumi.azure.monitoring.inputs.MetricAlertCriteriaArgs.builder()
            .aggregation(aggregation.applyValue({ args0 -> args0 }))
            .dimensions(
                dimensions?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .metricName(metricName.applyValue({ args0 -> args0 }))
            .metricNamespace(metricNamespace.applyValue({ args0 -> args0 }))
            .`operator`(`operator`.applyValue({ args0 -> args0 }))
            .skipMetricValidation(skipMetricValidation?.applyValue({ args0 -> args0 }))
            .threshold(threshold.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [MetricAlertCriteriaArgs].
 */
@PulumiTagMarker
public class MetricAlertCriteriaArgsBuilder internal constructor() {
    private var aggregation: Output? = null

    private var dimensions: Output>? = null

    private var metricName: Output? = null

    private var metricNamespace: Output? = null

    private var `operator`: Output? = null

    private var skipMetricValidation: Output? = null

    private var threshold: Output? = null

    /**
     * @param value The statistic that runs over the metric values. Possible values are `Average`, `Count`, `Minimum`, `Maximum` and `Total`.
     */
    @JvmName("thwtgndnnqdnybpy")
    public suspend fun aggregation(`value`: Output) {
        this.aggregation = value
    }

    /**
     * @param value One or more `dimension` blocks as defined below.
     */
    @JvmName("wppafymrdstqapuf")
    public suspend fun dimensions(`value`: Output>) {
        this.dimensions = value
    }

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

    /**
     * @param values One or more `dimension` blocks as defined below.
     */
    @JvmName("gvhvlrncdpojtjqo")
    public suspend fun dimensions(values: List>) {
        this.dimensions = Output.all(values)
    }

    /**
     * @param value One of the metric names to be monitored.
     */
    @JvmName("fecjflxwqtxwrgie")
    public suspend fun metricName(`value`: Output) {
        this.metricName = value
    }

    /**
     * @param value One of the metric namespaces to be monitored.
     */
    @JvmName("vhyeohsufxkekecl")
    public suspend fun metricNamespace(`value`: Output) {
        this.metricNamespace = value
    }

    /**
     * @param value The criteria operator. Possible values are `Equals`, `GreaterThan`, `GreaterThanOrEqual`, `LessThan` and `LessThanOrEqual`.
     */
    @JvmName("kgvptiwarfsitxhk")
    public suspend fun `operator`(`value`: Output) {
        this.`operator` = value
    }

    /**
     * @param value Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted? Defaults to `false`.
     */
    @JvmName("gpdxywfinxlwwdxf")
    public suspend fun skipMetricValidation(`value`: Output) {
        this.skipMetricValidation = value
    }

    /**
     * @param value The criteria threshold value that activates the alert.
     */
    @JvmName("ikkmnqcnpmpobqoc")
    public suspend fun threshold(`value`: Output) {
        this.threshold = value
    }

    /**
     * @param value The statistic that runs over the metric values. Possible values are `Average`, `Count`, `Minimum`, `Maximum` and `Total`.
     */
    @JvmName("heudmklghjalgsas")
    public suspend fun aggregation(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.aggregation = mapped
    }

    /**
     * @param value One or more `dimension` blocks as defined below.
     */
    @JvmName("mnyrcghiskqdgglt")
    public suspend fun dimensions(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dimensions = mapped
    }

    /**
     * @param argument One or more `dimension` blocks as defined below.
     */
    @JvmName("qhqrugbdxemqsjru")
    public suspend
    fun dimensions(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            MetricAlertCriteriaDimensionArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.dimensions = mapped
    }

    /**
     * @param argument One or more `dimension` blocks as defined below.
     */
    @JvmName("qsqetfakiewwgmls")
    public suspend fun dimensions(
        vararg
        argument: suspend MetricAlertCriteriaDimensionArgsBuilder.() -> Unit,
    ) {
        val toBeMapped = argument.toList().map {
            MetricAlertCriteriaDimensionArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.dimensions = mapped
    }

    /**
     * @param argument One or more `dimension` blocks as defined below.
     */
    @JvmName("cypbledjlnyhjnrs")
    public suspend
    fun dimensions(argument: suspend MetricAlertCriteriaDimensionArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            MetricAlertCriteriaDimensionArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.dimensions = mapped
    }

    /**
     * @param values One or more `dimension` blocks as defined below.
     */
    @JvmName("aijeokedcyibgpcw")
    public suspend fun dimensions(vararg values: MetricAlertCriteriaDimensionArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.dimensions = mapped
    }

    /**
     * @param value One of the metric names to be monitored.
     */
    @JvmName("bfxvsqoetyuljwtu")
    public suspend fun metricName(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.metricName = mapped
    }

    /**
     * @param value One of the metric namespaces to be monitored.
     */
    @JvmName("htcfuuooicdbbkyi")
    public suspend fun metricNamespace(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.metricNamespace = mapped
    }

    /**
     * @param value The criteria operator. Possible values are `Equals`, `GreaterThan`, `GreaterThanOrEqual`, `LessThan` and `LessThanOrEqual`.
     */
    @JvmName("kievevwxfpgecykw")
    public suspend fun `operator`(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.`operator` = mapped
    }

    /**
     * @param value Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted? Defaults to `false`.
     */
    @JvmName("ysqctkwhvnpiayju")
    public suspend fun skipMetricValidation(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.skipMetricValidation = mapped
    }

    /**
     * @param value The criteria threshold value that activates the alert.
     */
    @JvmName("ppirvbcuooqkbmvi")
    public suspend fun threshold(`value`: Double) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.threshold = mapped
    }

    internal fun build(): MetricAlertCriteriaArgs = MetricAlertCriteriaArgs(
        aggregation = aggregation ?: throw PulumiNullFieldException("aggregation"),
        dimensions = dimensions,
        metricName = metricName ?: throw PulumiNullFieldException("metricName"),
        metricNamespace = metricNamespace ?: throw PulumiNullFieldException("metricNamespace"),
        `operator` = `operator` ?: throw PulumiNullFieldException("operator"),
        skipMetricValidation = skipMetricValidation,
        threshold = threshold ?: throw PulumiNullFieldException("threshold"),
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy