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

com.pulumi.azurenative.insights.kotlin.inputs.MetricCriteriaArgs.kt Maven / Gradle / Ivy

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

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

import com.pulumi.azurenative.insights.inputs.MetricCriteriaArgs.builder
import com.pulumi.azurenative.insights.kotlin.enums.AggregationTypeEnum
import com.pulumi.azurenative.insights.kotlin.enums.Operator
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.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

/**
 * Criterion to filter metrics.
 * @property criterionType Specifies the type of threshold criteria
 * Expected value is 'StaticThresholdCriterion'.
 * @property dimensions List of dimension conditions.
 * @property metricName Name of the metric.
 * @property metricNamespace Namespace of the metric.
 * @property name Name of the criteria.
 * @property operator the criteria operator.
 * @property skipMetricValidation Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
 * @property threshold the criteria threshold value that activates the alert.
 * @property timeAggregation the criteria time aggregation types.
 */
public data class MetricCriteriaArgs(
    public val criterionType: Output,
    public val dimensions: Output>? = null,
    public val metricName: Output,
    public val metricNamespace: Output? = null,
    public val name: Output,
    public val `operator`: Output>,
    public val skipMetricValidation: Output? = null,
    public val threshold: Output,
    public val timeAggregation: Output>,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.insights.inputs.MetricCriteriaArgs =
        com.pulumi.azurenative.insights.inputs.MetricCriteriaArgs.builder()
            .criterionType(criterionType.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 }))
            .name(name.applyValue({ args0 -> args0 }))
            .`operator`(
                `operator`.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .skipMetricValidation(skipMetricValidation?.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 [MetricCriteriaArgs].
 */
@PulumiTagMarker
public class MetricCriteriaArgsBuilder internal constructor() {
    private var criterionType: Output? = null

    private var dimensions: Output>? = null

    private var metricName: Output? = null

    private var metricNamespace: Output? = null

    private var name: Output? = null

    private var `operator`: Output>? = null

    private var skipMetricValidation: Output? = null

    private var threshold: Output? = null

    private var timeAggregation: Output>? = null

    /**
     * @param value Specifies the type of threshold criteria
     * Expected value is 'StaticThresholdCriterion'.
     */
    @JvmName("qeohphcdcyfftyyn")
    public suspend fun criterionType(`value`: Output) {
        this.criterionType = value
    }

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

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

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

    /**
     * @param value Name of the metric.
     */
    @JvmName("dkmhcmnpiguuqgls")
    public suspend fun metricName(`value`: Output) {
        this.metricName = value
    }

    /**
     * @param value Namespace of the metric.
     */
    @JvmName("kfmjuhoaxatsmeat")
    public suspend fun metricNamespace(`value`: Output) {
        this.metricNamespace = value
    }

    /**
     * @param value Name of the criteria.
     */
    @JvmName("brykoohokyhtpbqw")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value the criteria operator.
     */
    @JvmName("docybngqleckiblk")
    public suspend fun `operator`(`value`: Output>) {
        this.`operator` = value
    }

    /**
     * @param value Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
     */
    @JvmName("cidiynrbqmmdscra")
    public suspend fun skipMetricValidation(`value`: Output) {
        this.skipMetricValidation = value
    }

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

    /**
     * @param value the criteria time aggregation types.
     */
    @JvmName("krbqntfyughomdnh")
    public suspend fun timeAggregation(`value`: Output>) {
        this.timeAggregation = value
    }

    /**
     * @param value Specifies the type of threshold criteria
     * Expected value is 'StaticThresholdCriterion'.
     */
    @JvmName("rihmysokomyuwxuw")
    public suspend fun criterionType(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.criterionType = mapped
    }

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

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

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

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

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

    /**
     * @param value Name of the metric.
     */
    @JvmName("kijcrdnqcciuewwr")
    public suspend fun metricName(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.metricName = mapped
    }

    /**
     * @param value Namespace of the metric.
     */
    @JvmName("qxohhmfuqjcgkjuc")
    public suspend fun metricNamespace(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.metricNamespace = mapped
    }

    /**
     * @param value Name of the criteria.
     */
    @JvmName("plsesiesiyjdxtke")
    public suspend fun name(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value the criteria operator.
     */
    @JvmName("oupcmadonehxjwcd")
    public suspend fun `operator`(`value`: Either) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.`operator` = mapped
    }

    /**
     * @param value the criteria operator.
     */
    @JvmName("hmduckjbiwwmhbia")
    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.
     */
    @JvmName("pxxybggphyqvvrwl")
    public fun `operator`(`value`: Operator) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.`operator` = mapped
    }

    /**
     * @param value Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.
     */
    @JvmName("rsjeblskorirapdd")
    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("dhcifyvggofqnmth")
    public suspend fun threshold(`value`: Double) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.threshold = mapped
    }

    /**
     * @param value the criteria time aggregation types.
     */
    @JvmName("qnuuwaijodtmxdgx")
    public suspend fun timeAggregation(`value`: Either) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.timeAggregation = mapped
    }

    /**
     * @param value the criteria time aggregation types.
     */
    @JvmName("cahcwrweaudqyrxc")
    public fun timeAggregation(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.timeAggregation = mapped
    }

    /**
     * @param value the criteria time aggregation types.
     */
    @JvmName("ntxbdxmnxxcqldrf")
    public fun timeAggregation(`value`: AggregationTypeEnum) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.timeAggregation = mapped
    }

    internal fun build(): MetricCriteriaArgs = MetricCriteriaArgs(
        criterionType = criterionType ?: throw PulumiNullFieldException("criterionType"),
        dimensions = dimensions,
        metricName = metricName ?: throw PulumiNullFieldException("metricName"),
        metricNamespace = metricNamespace,
        name = name ?: throw PulumiNullFieldException("name"),
        `operator` = `operator` ?: throw PulumiNullFieldException("operator"),
        skipMetricValidation = skipMetricValidation,
        threshold = threshold ?: throw PulumiNullFieldException("threshold"),
        timeAggregation = timeAggregation ?: throw PulumiNullFieldException("timeAggregation"),
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy