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

com.pulumi.azure.monitoring.kotlin.inputs.ScheduledQueryRulesAlertV2CriteriaArgs.kt Maven / Gradle / Ivy

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

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

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

/**
 *
 * @property dimensions A `dimension` block as defined below.
 * @property failingPeriods A `failing_periods` block as defined below.
 * @property metricMeasureColumn Specifies the column containing the metric measure number.
 * > **Note** `metric_measure_column` is required if `time_aggregation_method` is `Average`, `Maximum`, `Minimum`, or `Total`. And `metric_measure_column` can not be specified if `time_aggregation_method` is `Count`.
 * @property operator Specifies the criteria operator. Possible values are `Equal`, `GreaterThan`, `GreaterThanOrEqual`, `LessThan`,and `LessThanOrEqual`.
 * @property query The query to run on logs. The results returned by this query are used to populate the alert.
 * @property resourceIdColumn Specifies the column containing the resource ID. The content of the column must be an uri formatted as resource ID.
 * @property threshold Specifies the criteria threshold value that activates the alert.
 * @property timeAggregationMethod The type of aggregation to apply to the data points in aggregation granularity. Possible values are `Average`, `Count`, `Maximum`, `Minimum`,and `Total`.
 */
public data class ScheduledQueryRulesAlertV2CriteriaArgs(
    public val dimensions: Output>? = null,
    public val failingPeriods: Output? = null,
    public val metricMeasureColumn: Output? = null,
    public val `operator`: Output,
    public val query: Output,
    public val resourceIdColumn: Output? = null,
    public val threshold: Output,
    public val timeAggregationMethod: Output,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.monitoring.inputs.ScheduledQueryRulesAlertV2CriteriaArgs =
        com.pulumi.azure.monitoring.inputs.ScheduledQueryRulesAlertV2CriteriaArgs.builder()
            .dimensions(
                dimensions?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .failingPeriods(failingPeriods?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .metricMeasureColumn(metricMeasureColumn?.applyValue({ args0 -> args0 }))
            .`operator`(`operator`.applyValue({ args0 -> args0 }))
            .query(query.applyValue({ args0 -> args0 }))
            .resourceIdColumn(resourceIdColumn?.applyValue({ args0 -> args0 }))
            .threshold(threshold.applyValue({ args0 -> args0 }))
            .timeAggregationMethod(timeAggregationMethod.applyValue({ args0 -> args0 })).build()
}

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

    private var failingPeriods: Output? = null

    private var metricMeasureColumn: Output? = null

    private var `operator`: Output? = null

    private var query: Output? = null

    private var resourceIdColumn: Output? = null

    private var threshold: Output? = null

    private var timeAggregationMethod: Output? = null

    /**
     * @param value A `dimension` block as defined below.
     */
    @JvmName("ymaheecovvxhoftu")
    public suspend fun dimensions(`value`: Output>) {
        this.dimensions = value
    }

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

    /**
     * @param values A `dimension` block as defined below.
     */
    @JvmName("uwyxcbacqroljxjh")
    public suspend fun dimensions(values: List>) {
        this.dimensions = Output.all(values)
    }

    /**
     * @param value A `failing_periods` block as defined below.
     */
    @JvmName("bcrjaisdhpbpnubm")
    public suspend fun failingPeriods(`value`: Output) {
        this.failingPeriods = value
    }

    /**
     * @param value Specifies the column containing the metric measure number.
     * > **Note** `metric_measure_column` is required if `time_aggregation_method` is `Average`, `Maximum`, `Minimum`, or `Total`. And `metric_measure_column` can not be specified if `time_aggregation_method` is `Count`.
     */
    @JvmName("lonfpotsfskgudse")
    public suspend fun metricMeasureColumn(`value`: Output) {
        this.metricMeasureColumn = value
    }

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

    /**
     * @param value The query to run on logs. The results returned by this query are used to populate the alert.
     */
    @JvmName("vdtwecuwbmkgvumc")
    public suspend fun query(`value`: Output) {
        this.query = value
    }

    /**
     * @param value Specifies the column containing the resource ID. The content of the column must be an uri formatted as resource ID.
     */
    @JvmName("sgbswqnetbvbmpqj")
    public suspend fun resourceIdColumn(`value`: Output) {
        this.resourceIdColumn = value
    }

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

    /**
     * @param value The type of aggregation to apply to the data points in aggregation granularity. Possible values are `Average`, `Count`, `Maximum`, `Minimum`,and `Total`.
     */
    @JvmName("mwlfwwyaxgbtkglh")
    public suspend fun timeAggregationMethod(`value`: Output) {
        this.timeAggregationMethod = value
    }

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

    /**
     * @param argument A `dimension` block as defined below.
     */
    @JvmName("veilxrtcajotmlra")
    public suspend fun dimensions(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ScheduledQueryRulesAlertV2CriteriaDimensionArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.dimensions = mapped
    }

    /**
     * @param argument A `dimension` block as defined below.
     */
    @JvmName("ycncslgcxmjdouoh")
    public suspend fun dimensions(vararg argument: suspend ScheduledQueryRulesAlertV2CriteriaDimensionArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ScheduledQueryRulesAlertV2CriteriaDimensionArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.dimensions = mapped
    }

    /**
     * @param argument A `dimension` block as defined below.
     */
    @JvmName("apuomqspnhfydviv")
    public suspend fun dimensions(argument: suspend ScheduledQueryRulesAlertV2CriteriaDimensionArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ScheduledQueryRulesAlertV2CriteriaDimensionArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.dimensions = mapped
    }

    /**
     * @param values A `dimension` block as defined below.
     */
    @JvmName("cnbhmxofgsqeklip")
    public suspend fun dimensions(vararg values: ScheduledQueryRulesAlertV2CriteriaDimensionArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.dimensions = mapped
    }

    /**
     * @param value A `failing_periods` block as defined below.
     */
    @JvmName("vydenvbxoiemxfgh")
    public suspend fun failingPeriods(`value`: ScheduledQueryRulesAlertV2CriteriaFailingPeriodsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.failingPeriods = mapped
    }

    /**
     * @param argument A `failing_periods` block as defined below.
     */
    @JvmName("qwcnibetubevyhbc")
    public suspend fun failingPeriods(argument: suspend ScheduledQueryRulesAlertV2CriteriaFailingPeriodsArgsBuilder.() -> Unit) {
        val toBeMapped = ScheduledQueryRulesAlertV2CriteriaFailingPeriodsArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.failingPeriods = mapped
    }

    /**
     * @param value Specifies the column containing the metric measure number.
     * > **Note** `metric_measure_column` is required if `time_aggregation_method` is `Average`, `Maximum`, `Minimum`, or `Total`. And `metric_measure_column` can not be specified if `time_aggregation_method` is `Count`.
     */
    @JvmName("gjinbhhnsisgtcnw")
    public suspend fun metricMeasureColumn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.metricMeasureColumn = mapped
    }

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

    /**
     * @param value The query to run on logs. The results returned by this query are used to populate the alert.
     */
    @JvmName("jfpausmqwrselhgv")
    public suspend fun query(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.query = mapped
    }

    /**
     * @param value Specifies the column containing the resource ID. The content of the column must be an uri formatted as resource ID.
     */
    @JvmName("nhntngmkhxidwaoe")
    public suspend fun resourceIdColumn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceIdColumn = mapped
    }

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

    /**
     * @param value The type of aggregation to apply to the data points in aggregation granularity. Possible values are `Average`, `Count`, `Maximum`, `Minimum`,and `Total`.
     */
    @JvmName("edoqqxgrsielaswr")
    public suspend fun timeAggregationMethod(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.timeAggregationMethod = mapped
    }

    internal fun build(): ScheduledQueryRulesAlertV2CriteriaArgs =
        ScheduledQueryRulesAlertV2CriteriaArgs(
            dimensions = dimensions,
            failingPeriods = failingPeriods,
            metricMeasureColumn = metricMeasureColumn,
            `operator` = `operator` ?: throw PulumiNullFieldException("operator"),
            query = query ?: throw PulumiNullFieldException("query"),
            resourceIdColumn = resourceIdColumn,
            threshold = threshold ?: throw PulumiNullFieldException("threshold"),
            timeAggregationMethod = timeAggregationMethod ?: throw
                PulumiNullFieldException("timeAggregationMethod"),
        )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy