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

com.pulumi.azurenative.insights.kotlin.inputs.ConditionArgs.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: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.insights.kotlin.inputs

import com.pulumi.azurenative.insights.inputs.ConditionArgs.builder
import com.pulumi.azurenative.insights.kotlin.enums.ConditionOperator
import com.pulumi.azurenative.insights.kotlin.enums.TimeAggregation
import com.pulumi.core.Either
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.Double
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * A condition of the scheduled query rule.
 * @property dimensions List of Dimensions conditions
 * @property failingPeriods The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant only for rules of the kind LogAlert.
 * @property metricMeasureColumn The column containing the metric measure number. Relevant only for rules of the kind LogAlert.
 * @property metricName The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric.
 * @property operator The criteria operator. Relevant and required only for rules of the kind LogAlert.
 * @property query Log query alert
 * @property resourceIdColumn The column containing the resource id. The content of the column must be a uri formatted as resource id. Relevant only for rules of the kind LogAlert.
 * @property threshold the criteria threshold value that activates the alert. Relevant and required only for rules of the kind LogAlert.
 * @property timeAggregation Aggregation type. Relevant and required only for rules of the kind LogAlert.
 */
public data class ConditionArgs(
    public val dimensions: Output>? = null,
    public val failingPeriods: Output? = null,
    public val metricMeasureColumn: Output? = null,
    public val metricName: Output? = null,
    public val `operator`: Output>? = null,
    public val query: Output? = null,
    public val resourceIdColumn: Output? = null,
    public val threshold: Output? = null,
    public val timeAggregation: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.insights.inputs.ConditionArgs =
        com.pulumi.azurenative.insights.inputs.ConditionArgs.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 }))
            .metricName(metricName?.applyValue({ args0 -> args0 }))
            .`operator`(
                `operator`?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .query(query?.applyValue({ args0 -> args0 }))
            .resourceIdColumn(resourceIdColumn?.applyValue({ args0 -> args0 }))
            .threshold(threshold?.applyValue({ args0 -> args0 }))
            .timeAggregation(
                timeAggregation?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            ).build()
}

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

    private var failingPeriods: Output? = null

    private var metricMeasureColumn: Output? = null

    private var metricName: Output? = null

    private var `operator`: Output>? = null

    private var query: Output? = null

    private var resourceIdColumn: Output? = null

    private var threshold: Output? = null

    private var timeAggregation: Output>? = null

    /**
     * @param value List of Dimensions conditions
     */
    @JvmName("ihngamkshkrvyodv")
    public suspend fun dimensions(`value`: Output>) {
        this.dimensions = value
    }

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

    /**
     * @param values List of Dimensions conditions
     */
    @JvmName("msyqauvhfemcmyiy")
    public suspend fun dimensions(values: List>) {
        this.dimensions = Output.all(values)
    }

    /**
     * @param value The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant only for rules of the kind LogAlert.
     */
    @JvmName("nasddxxcdytdfhij")
    public suspend fun failingPeriods(`value`: Output) {
        this.failingPeriods = value
    }

    /**
     * @param value The column containing the metric measure number. Relevant only for rules of the kind LogAlert.
     */
    @JvmName("fhwywfablpeqylwc")
    public suspend fun metricMeasureColumn(`value`: Output) {
        this.metricMeasureColumn = value
    }

    /**
     * @param value The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric.
     */
    @JvmName("syeahmnefsybslgm")
    public suspend fun metricName(`value`: Output) {
        this.metricName = value
    }

    /**
     * @param value The criteria operator. Relevant and required only for rules of the kind LogAlert.
     */
    @JvmName("pxvwmjyiyusmxhmy")
    public suspend fun `operator`(`value`: Output>) {
        this.`operator` = value
    }

    /**
     * @param value Log query alert
     */
    @JvmName("xycnwcgswovtsxne")
    public suspend fun query(`value`: Output) {
        this.query = value
    }

    /**
     * @param value The column containing the resource id. The content of the column must be a uri formatted as resource id. Relevant only for rules of the kind LogAlert.
     */
    @JvmName("hxoneypylqssisay")
    public suspend fun resourceIdColumn(`value`: Output) {
        this.resourceIdColumn = value
    }

    /**
     * @param value the criteria threshold value that activates the alert. Relevant and required only for rules of the kind LogAlert.
     */
    @JvmName("ldlasduimvapqfuk")
    public suspend fun threshold(`value`: Output) {
        this.threshold = value
    }

    /**
     * @param value Aggregation type. Relevant and required only for rules of the kind LogAlert.
     */
    @JvmName("thojupmfyujyslrm")
    public suspend fun timeAggregation(`value`: Output>) {
        this.timeAggregation = value
    }

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

    /**
     * @param argument List of Dimensions conditions
     */
    @JvmName("emytnigakeyrtuun")
    public suspend fun dimensions(argument: List Unit>) {
        val toBeMapped = argument.toList().map { DimensionArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.dimensions = mapped
    }

    /**
     * @param argument List of Dimensions conditions
     */
    @JvmName("mtdibdujxhaivxku")
    public suspend fun dimensions(vararg argument: suspend DimensionArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { DimensionArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.dimensions = mapped
    }

    /**
     * @param argument List of Dimensions conditions
     */
    @JvmName("rcngjffjlbfmnjmv")
    public suspend fun dimensions(argument: suspend DimensionArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(DimensionArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.dimensions = mapped
    }

    /**
     * @param values List of Dimensions conditions
     */
    @JvmName("tgeuheqhkttojqhm")
    public suspend fun dimensions(vararg values: DimensionArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.dimensions = mapped
    }

    /**
     * @param value The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant only for rules of the kind LogAlert.
     */
    @JvmName("gyskuuqydovmpbug")
    public suspend fun failingPeriods(`value`: ConditionFailingPeriodsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.failingPeriods = mapped
    }

    /**
     * @param argument The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant only for rules of the kind LogAlert.
     */
    @JvmName("dbdnbncpxjfsasut")
    public suspend fun failingPeriods(argument: suspend ConditionFailingPeriodsArgsBuilder.() -> Unit) {
        val toBeMapped = ConditionFailingPeriodsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.failingPeriods = mapped
    }

    /**
     * @param value The column containing the metric measure number. Relevant only for rules of the kind LogAlert.
     */
    @JvmName("xqkdwhmgwcdwowaj")
    public suspend fun metricMeasureColumn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.metricMeasureColumn = mapped
    }

    /**
     * @param value The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric.
     */
    @JvmName("iwuhyoekjpkdvvar")
    public suspend fun metricName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.metricName = mapped
    }

    /**
     * @param value The criteria operator. Relevant and required only for rules of the kind LogAlert.
     */
    @JvmName("mjxktjgmytakdbsg")
    public suspend fun `operator`(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.`operator` = mapped
    }

    /**
     * @param value The criteria operator. Relevant and required only for rules of the kind LogAlert.
     */
    @JvmName("gwcqgwleimwkchps")
    public fun `operator`(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.`operator` = mapped
    }

    /**
     * @param value The criteria operator. Relevant and required only for rules of the kind LogAlert.
     */
    @JvmName("yvjadsytnxbqhdma")
    public fun `operator`(`value`: ConditionOperator) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.`operator` = mapped
    }

    /**
     * @param value Log query alert
     */
    @JvmName("xqyveyenjgjoygef")
    public suspend fun query(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.query = mapped
    }

    /**
     * @param value The column containing the resource id. The content of the column must be a uri formatted as resource id. Relevant only for rules of the kind LogAlert.
     */
    @JvmName("qjesqtojvhgdwgrd")
    public suspend fun resourceIdColumn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceIdColumn = mapped
    }

    /**
     * @param value the criteria threshold value that activates the alert. Relevant and required only for rules of the kind LogAlert.
     */
    @JvmName("buasewjwhckmbfop")
    public suspend fun threshold(`value`: Double?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.threshold = mapped
    }

    /**
     * @param value Aggregation type. Relevant and required only for rules of the kind LogAlert.
     */
    @JvmName("qqvfmgqijilcmksq")
    public suspend fun timeAggregation(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timeAggregation = mapped
    }

    /**
     * @param value Aggregation type. Relevant and required only for rules of the kind LogAlert.
     */
    @JvmName("facrxabhkdawnjvv")
    public fun timeAggregation(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.timeAggregation = mapped
    }

    /**
     * @param value Aggregation type. Relevant and required only for rules of the kind LogAlert.
     */
    @JvmName("kyagvhrsxochaeiq")
    public fun timeAggregation(`value`: TimeAggregation) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.timeAggregation = mapped
    }

    internal fun build(): ConditionArgs = ConditionArgs(
        dimensions = dimensions,
        failingPeriods = failingPeriods,
        metricMeasureColumn = metricMeasureColumn,
        metricName = metricName,
        `operator` = `operator`,
        query = query,
        resourceIdColumn = resourceIdColumn,
        threshold = threshold,
        timeAggregation = timeAggregation,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy