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

com.pulumi.azurenative.costmanagement.kotlin.inputs.NotificationArgs.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.costmanagement.kotlin.inputs

import com.pulumi.azurenative.costmanagement.inputs.NotificationArgs.builder
import com.pulumi.azurenative.costmanagement.kotlin.enums.BudgetNotificationOperatorType
import com.pulumi.azurenative.costmanagement.kotlin.enums.CultureCode
import com.pulumi.azurenative.costmanagement.kotlin.enums.Frequency
import com.pulumi.azurenative.costmanagement.kotlin.enums.ThresholdType
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 kotlin.Boolean
import kotlin.Double
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * The notification associated with a budget.
 *  Supported for CategoryType(s): Cost, ReservationUtilization.
 * @property contactEmails Email addresses to send the notification to when the threshold is breached. Must have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact email specified.
 *  Supported for CategoryType(s): Cost, ReservationUtilization.
 * @property contactGroups Subscription or Resource Group scopes only. Action groups to send the notification to when the threshold is exceeded. Must be provided as a fully qualified Azure resource id.
 *  Supported for CategoryType(s): Cost.
 * @property contactRoles Subscription or Resource Group scopes only. Contact roles to send the notification to when the threshold is breached.
 *  Supported for CategoryType(s): Cost.
 * @property enabled The notification is enabled or not.
 *  Supported for CategoryType(s): Cost, ReservationUtilization.
 * @property frequency Frequency of a notification. Represents how long the notification will be silent after triggering an alert for a threshold breach. If not specified, the frequency will be set by default based on the timeGrain (Weekly when timeGrain: Last7Days, Monthly when timeGrain: Last30Days).
 *  Supported for CategoryType(s): ReservationUtilization.
 * @property locale Language in which the recipient will receive the notification,
 *  Supported for CategoryType(s): Cost, ReservationUtilization.
 * @property operator The comparison operator.
 *  Supported for CategoryType(s): Cost, ReservationUtilization.
 *  Supported operators for **CategoryType: Cost**
 * - GreaterThan
 * - GreaterThanOrEqualTo
 *  Supported operators for **CategoryType: ReservationUtilization**
 * - LessThan
 * @property threshold Threshold value associated with a notification. It is always percent with a maximum of 2 decimal places.
 *  Supported for CategoryType(s): Cost, ReservationUtilization.
 *  **CategoryType: Cost** - Must be between 0 and 1000. Notification is sent when the cost exceeded the threshold.
 *  **CategoryType: ReservationUtilization** - Must be between 0 and 100. Notification is sent when a reservation has a utilization percentage below the threshold.
 * @property thresholdType The type of threshold.
 *  Supported for CategoryType(s): Cost.
 */
public data class NotificationArgs(
    public val contactEmails: Output>,
    public val contactGroups: Output>? = null,
    public val contactRoles: Output>? = null,
    public val enabled: Output,
    public val frequency: Output>? = null,
    public val locale: Output>? = null,
    public val `operator`: Output>,
    public val threshold: Output,
    public val thresholdType: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.costmanagement.inputs.NotificationArgs =
        com.pulumi.azurenative.costmanagement.inputs.NotificationArgs.builder()
            .contactEmails(contactEmails.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .contactGroups(contactGroups?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .contactRoles(contactRoles?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .enabled(enabled.applyValue({ args0 -> args0 }))
            .frequency(
                frequency?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .locale(
                locale?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .`operator`(
                `operator`.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .threshold(threshold.applyValue({ args0 -> args0 }))
            .thresholdType(
                thresholdType?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            ).build()
}

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

    private var contactGroups: Output>? = null

    private var contactRoles: Output>? = null

    private var enabled: Output? = null

    private var frequency: Output>? = null

    private var locale: Output>? = null

    private var `operator`: Output>? = null

    private var threshold: Output? = null

    private var thresholdType: Output>? = null

    /**
     * @param value Email addresses to send the notification to when the threshold is breached. Must have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact email specified.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     */
    @JvmName("ebkbgaeenmuyeuou")
    public suspend fun contactEmails(`value`: Output>) {
        this.contactEmails = value
    }

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

    /**
     * @param values Email addresses to send the notification to when the threshold is breached. Must have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact email specified.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     */
    @JvmName("nkapnlivtocktgqe")
    public suspend fun contactEmails(values: List>) {
        this.contactEmails = Output.all(values)
    }

    /**
     * @param value Subscription or Resource Group scopes only. Action groups to send the notification to when the threshold is exceeded. Must be provided as a fully qualified Azure resource id.
     *  Supported for CategoryType(s): Cost.
     */
    @JvmName("eknhtojisgqgyxeh")
    public suspend fun contactGroups(`value`: Output>) {
        this.contactGroups = value
    }

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

    /**
     * @param values Subscription or Resource Group scopes only. Action groups to send the notification to when the threshold is exceeded. Must be provided as a fully qualified Azure resource id.
     *  Supported for CategoryType(s): Cost.
     */
    @JvmName("qiwhuijtvqtstuum")
    public suspend fun contactGroups(values: List>) {
        this.contactGroups = Output.all(values)
    }

    /**
     * @param value Subscription or Resource Group scopes only. Contact roles to send the notification to when the threshold is breached.
     *  Supported for CategoryType(s): Cost.
     */
    @JvmName("ntwdhcliflvlrpux")
    public suspend fun contactRoles(`value`: Output>) {
        this.contactRoles = value
    }

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

    /**
     * @param values Subscription or Resource Group scopes only. Contact roles to send the notification to when the threshold is breached.
     *  Supported for CategoryType(s): Cost.
     */
    @JvmName("ojhfjldxddilrgxt")
    public suspend fun contactRoles(values: List>) {
        this.contactRoles = Output.all(values)
    }

    /**
     * @param value The notification is enabled or not.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     */
    @JvmName("lqqxrmmeshupcwda")
    public suspend fun enabled(`value`: Output) {
        this.enabled = value
    }

    /**
     * @param value Frequency of a notification. Represents how long the notification will be silent after triggering an alert for a threshold breach. If not specified, the frequency will be set by default based on the timeGrain (Weekly when timeGrain: Last7Days, Monthly when timeGrain: Last30Days).
     *  Supported for CategoryType(s): ReservationUtilization.
     */
    @JvmName("qkxkommcddpsoxpg")
    public suspend fun frequency(`value`: Output>) {
        this.frequency = value
    }

    /**
     * @param value Language in which the recipient will receive the notification,
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     */
    @JvmName("kdiqevemhakygwij")
    public suspend fun locale(`value`: Output>) {
        this.locale = value
    }

    /**
     * @param value The comparison operator.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     *  Supported operators for **CategoryType: Cost**
     * - GreaterThan
     * - GreaterThanOrEqualTo
     *  Supported operators for **CategoryType: ReservationUtilization**
     * - LessThan
     */
    @JvmName("blirkmwrbnkglsjc")
    public suspend fun `operator`(`value`: Output>) {
        this.`operator` = value
    }

    /**
     * @param value Threshold value associated with a notification. It is always percent with a maximum of 2 decimal places.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     *  **CategoryType: Cost** - Must be between 0 and 1000. Notification is sent when the cost exceeded the threshold.
     *  **CategoryType: ReservationUtilization** - Must be between 0 and 100. Notification is sent when a reservation has a utilization percentage below the threshold.
     */
    @JvmName("fckdktbkukuioexq")
    public suspend fun threshold(`value`: Output) {
        this.threshold = value
    }

    /**
     * @param value The type of threshold.
     *  Supported for CategoryType(s): Cost.
     */
    @JvmName("vepehlfawqiesiow")
    public suspend fun thresholdType(`value`: Output>) {
        this.thresholdType = value
    }

    /**
     * @param value Email addresses to send the notification to when the threshold is breached. Must have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact email specified.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     */
    @JvmName("uqueqhutewtcaejn")
    public suspend fun contactEmails(`value`: List) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.contactEmails = mapped
    }

    /**
     * @param values Email addresses to send the notification to when the threshold is breached. Must have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact email specified.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     */
    @JvmName("hiqmprvwrjjfbxfx")
    public suspend fun contactEmails(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.contactEmails = mapped
    }

    /**
     * @param value Subscription or Resource Group scopes only. Action groups to send the notification to when the threshold is exceeded. Must be provided as a fully qualified Azure resource id.
     *  Supported for CategoryType(s): Cost.
     */
    @JvmName("qdkuqctmjfcsvljp")
    public suspend fun contactGroups(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.contactGroups = mapped
    }

    /**
     * @param values Subscription or Resource Group scopes only. Action groups to send the notification to when the threshold is exceeded. Must be provided as a fully qualified Azure resource id.
     *  Supported for CategoryType(s): Cost.
     */
    @JvmName("swjthnrdtpedmsgu")
    public suspend fun contactGroups(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.contactGroups = mapped
    }

    /**
     * @param value Subscription or Resource Group scopes only. Contact roles to send the notification to when the threshold is breached.
     *  Supported for CategoryType(s): Cost.
     */
    @JvmName("uudsacxkodeljrao")
    public suspend fun contactRoles(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.contactRoles = mapped
    }

    /**
     * @param values Subscription or Resource Group scopes only. Contact roles to send the notification to when the threshold is breached.
     *  Supported for CategoryType(s): Cost.
     */
    @JvmName("pqadrxqxklqdsbmi")
    public suspend fun contactRoles(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.contactRoles = mapped
    }

    /**
     * @param value The notification is enabled or not.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     */
    @JvmName("kjeyjpigddicevkj")
    public suspend fun enabled(`value`: Boolean) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.enabled = mapped
    }

    /**
     * @param value Frequency of a notification. Represents how long the notification will be silent after triggering an alert for a threshold breach. If not specified, the frequency will be set by default based on the timeGrain (Weekly when timeGrain: Last7Days, Monthly when timeGrain: Last30Days).
     *  Supported for CategoryType(s): ReservationUtilization.
     */
    @JvmName("balutuisowxvobwh")
    public suspend fun frequency(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.frequency = mapped
    }

    /**
     * @param value Frequency of a notification. Represents how long the notification will be silent after triggering an alert for a threshold breach. If not specified, the frequency will be set by default based on the timeGrain (Weekly when timeGrain: Last7Days, Monthly when timeGrain: Last30Days).
     *  Supported for CategoryType(s): ReservationUtilization.
     */
    @JvmName("lwymbvwdrcmparyt")
    public fun frequency(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.frequency = mapped
    }

    /**
     * @param value Frequency of a notification. Represents how long the notification will be silent after triggering an alert for a threshold breach. If not specified, the frequency will be set by default based on the timeGrain (Weekly when timeGrain: Last7Days, Monthly when timeGrain: Last30Days).
     *  Supported for CategoryType(s): ReservationUtilization.
     */
    @JvmName("rsdrnsffdxjtikvg")
    public fun frequency(`value`: Frequency) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.frequency = mapped
    }

    /**
     * @param value Language in which the recipient will receive the notification,
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     */
    @JvmName("aaqohmjcdvmwxfni")
    public suspend fun locale(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.locale = mapped
    }

    /**
     * @param value Language in which the recipient will receive the notification,
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     */
    @JvmName("kjueoemrjewuyovd")
    public fun locale(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.locale = mapped
    }

    /**
     * @param value Language in which the recipient will receive the notification,
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     */
    @JvmName("tyijmwbrqbdkvgvy")
    public fun locale(`value`: CultureCode) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.locale = mapped
    }

    /**
     * @param value The comparison operator.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     *  Supported operators for **CategoryType: Cost**
     * - GreaterThan
     * - GreaterThanOrEqualTo
     *  Supported operators for **CategoryType: ReservationUtilization**
     * - LessThan
     */
    @JvmName("hcuhlfxbfuejrbup")
    public suspend fun `operator`(`value`: Either) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.`operator` = mapped
    }

    /**
     * @param value The comparison operator.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     *  Supported operators for **CategoryType: Cost**
     * - GreaterThan
     * - GreaterThanOrEqualTo
     *  Supported operators for **CategoryType: ReservationUtilization**
     * - LessThan
     */
    @JvmName("koectduusjhfbfjj")
    public fun `operator`(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.`operator` = mapped
    }

    /**
     * @param value The comparison operator.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     *  Supported operators for **CategoryType: Cost**
     * - GreaterThan
     * - GreaterThanOrEqualTo
     *  Supported operators for **CategoryType: ReservationUtilization**
     * - LessThan
     */
    @JvmName("auywfpnjpsbbpqws")
    public fun `operator`(`value`: BudgetNotificationOperatorType) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.`operator` = mapped
    }

    /**
     * @param value Threshold value associated with a notification. It is always percent with a maximum of 2 decimal places.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     *  **CategoryType: Cost** - Must be between 0 and 1000. Notification is sent when the cost exceeded the threshold.
     *  **CategoryType: ReservationUtilization** - Must be between 0 and 100. Notification is sent when a reservation has a utilization percentage below the threshold.
     */
    @JvmName("schprvdjgpmrxtbv")
    public suspend fun threshold(`value`: Double) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.threshold = mapped
    }

    /**
     * @param value The type of threshold.
     *  Supported for CategoryType(s): Cost.
     */
    @JvmName("mnfdfnbbgvnonltg")
    public suspend fun thresholdType(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.thresholdType = mapped
    }

    /**
     * @param value The type of threshold.
     *  Supported for CategoryType(s): Cost.
     */
    @JvmName("nrwfpkvaqvsmlycu")
    public fun thresholdType(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.thresholdType = mapped
    }

    /**
     * @param value The type of threshold.
     *  Supported for CategoryType(s): Cost.
     */
    @JvmName("agjmyguiiwvrnhpx")
    public fun thresholdType(`value`: ThresholdType) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.thresholdType = mapped
    }

    internal fun build(): NotificationArgs = NotificationArgs(
        contactEmails = contactEmails ?: throw PulumiNullFieldException("contactEmails"),
        contactGroups = contactGroups,
        contactRoles = contactRoles,
        enabled = enabled ?: throw PulumiNullFieldException("enabled"),
        frequency = frequency,
        locale = locale,
        `operator` = `operator` ?: throw PulumiNullFieldException("operator"),
        threshold = threshold ?: throw PulumiNullFieldException("threshold"),
        thresholdType = thresholdType,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy