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

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

import com.pulumi.azurenative.costmanagement.BudgetArgs.builder
import com.pulumi.azurenative.costmanagement.kotlin.enums.CategoryType
import com.pulumi.azurenative.costmanagement.kotlin.enums.TimeGrainType
import com.pulumi.azurenative.costmanagement.kotlin.inputs.BudgetFilterArgs
import com.pulumi.azurenative.costmanagement.kotlin.inputs.BudgetFilterArgsBuilder
import com.pulumi.azurenative.costmanagement.kotlin.inputs.BudgetTimePeriodArgs
import com.pulumi.azurenative.costmanagement.kotlin.inputs.BudgetTimePeriodArgsBuilder
import com.pulumi.azurenative.costmanagement.kotlin.inputs.NotificationArgs
import com.pulumi.azurenative.costmanagement.kotlin.inputs.NotificationArgsBuilder
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.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * A budget resource.
 * Azure REST API version: 2023-04-01-preview.
 * Other available API versions: 2019-04-01-preview, 2023-08-01, 2023-09-01, 2023-11-01.
 * @property amount The total amount of cost to track with the budget.
 *  Supported for CategoryType(s): Cost.
 *  Required for CategoryType(s): Cost.
 * @property budgetName Budget Name.
 * @property category The category of the budget.
 * - 'Cost' defines a Budget.
 * - 'ReservationUtilization' defines a Reservation Utilization Alert Rule.
 * @property eTag eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.
 * @property filter May be used to filter budgets by user-specified dimensions and/or tags.
 *  Supported for CategoryType(s): Cost, ReservationUtilization.
 * @property notifications Dictionary of notifications associated with the budget.
 *  Supported for CategoryType(s): Cost, ReservationUtilization.
 * - Constraints for **CategoryType: Cost** - Budget can have up to 5 notifications with thresholdType: Actual and 5 notifications with thresholdType: Forecasted.
 * - Constraints for **CategoryType: ReservationUtilization** - Only one notification allowed. thresholdType is not applicable.
 * @property scope The scope associated with budget operations.
 *  Supported scopes for **CategoryType: Cost**
 *  Azure RBAC Scopes:
 * - '/subscriptions/{subscriptionId}/' for subscription scope
 * - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope
 * - '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope
 *  EA (Enterprise Agreement) Scopes:
 * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
 * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope
 * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope
 *  MCA (Modern Customer Agreement) Scopes:
 * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
 * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope
 * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope
 * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for customer scope (CSP only)
 *  Supported scopes for **CategoryType: ReservationUtilization**
 *  EA (Enterprise Agreement) Scopes:
 * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope
 * MCA (Modern Customer Agreement) Scopes:
 * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope (non-CSP only)
 * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for customer scope (CSP only)
 * @property timeGrain The time covered by a budget. Tracking of the amount will be reset based on the time grain.
 * Supported for CategoryType(s): Cost, ReservationUtilization.
 *  Supported timeGrainTypes for **CategoryType: Cost**
 * - Monthly
 * - Quarterly
 * - Annually
 * - BillingMonth*
 * - BillingQuarter*
 * - BillingAnnual*
 *   *only supported for Web Direct customers.
 *  Supported timeGrainTypes for **CategoryType: ReservationUtilization**
 * - Last7Days
 * - Last30Days
 *  Required for CategoryType(s): Cost, ReservationUtilization.
 * @property timePeriod The time period that defines the active period of the budget. The budget will evaluate data on or after the startDate and will expire on the endDate.
 *  Supported for CategoryType(s): Cost, ReservationUtilization.
 *  Required for CategoryType(s): Cost, ReservationUtilization.
 */
public data class BudgetArgs(
    public val amount: Output? = null,
    public val budgetName: Output? = null,
    public val category: Output>? = null,
    public val eTag: Output? = null,
    public val filter: Output? = null,
    public val notifications: Output>? = null,
    public val scope: Output? = null,
    public val timeGrain: Output>? = null,
    public val timePeriod: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.costmanagement.BudgetArgs =
        com.pulumi.azurenative.costmanagement.BudgetArgs.builder()
            .amount(amount?.applyValue({ args0 -> args0 }))
            .budgetName(budgetName?.applyValue({ args0 -> args0 }))
            .category(
                category?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .eTag(eTag?.applyValue({ args0 -> args0 }))
            .filter(filter?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .notifications(
                notifications?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value.let({ args0 -> args0.toJava() }))
                    }).toMap()
                }),
            )
            .scope(scope?.applyValue({ args0 -> args0 }))
            .timeGrain(
                timeGrain?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .timePeriod(timePeriod?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [BudgetArgs].
 */
@PulumiTagMarker
public class BudgetArgsBuilder internal constructor() {
    private var amount: Output? = null

    private var budgetName: Output? = null

    private var category: Output>? = null

    private var eTag: Output? = null

    private var filter: Output? = null

    private var notifications: Output>? = null

    private var scope: Output? = null

    private var timeGrain: Output>? = null

    private var timePeriod: Output? = null

    /**
     * @param value The total amount of cost to track with the budget.
     *  Supported for CategoryType(s): Cost.
     *  Required for CategoryType(s): Cost.
     */
    @JvmName("ntwtlxrotoqintqe")
    public suspend fun amount(`value`: Output) {
        this.amount = value
    }

    /**
     * @param value Budget Name.
     */
    @JvmName("lnfexvlidcpyrbhx")
    public suspend fun budgetName(`value`: Output) {
        this.budgetName = value
    }

    /**
     * @param value The category of the budget.
     * - 'Cost' defines a Budget.
     * - 'ReservationUtilization' defines a Reservation Utilization Alert Rule.
     */
    @JvmName("lrjfvgpwqneaeqyb")
    public suspend fun category(`value`: Output>) {
        this.category = value
    }

    /**
     * @param value eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.
     */
    @JvmName("qtgentgmrrwjowlt")
    public suspend fun eTag(`value`: Output) {
        this.eTag = value
    }

    /**
     * @param value May be used to filter budgets by user-specified dimensions and/or tags.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     */
    @JvmName("rwcffiuxhjuxhknq")
    public suspend fun filter(`value`: Output) {
        this.filter = value
    }

    /**
     * @param value Dictionary of notifications associated with the budget.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     * - Constraints for **CategoryType: Cost** - Budget can have up to 5 notifications with thresholdType: Actual and 5 notifications with thresholdType: Forecasted.
     * - Constraints for **CategoryType: ReservationUtilization** - Only one notification allowed. thresholdType is not applicable.
     */
    @JvmName("yaoacplsdrncscgj")
    public suspend fun notifications(`value`: Output>) {
        this.notifications = value
    }

    /**
     * @param value The scope associated with budget operations.
     *  Supported scopes for **CategoryType: Cost**
     *  Azure RBAC Scopes:
     * - '/subscriptions/{subscriptionId}/' for subscription scope
     * - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope
     * - '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope
     *  EA (Enterprise Agreement) Scopes:
     * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
     * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope
     * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope
     *  MCA (Modern Customer Agreement) Scopes:
     * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
     * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope
     * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope
     * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for customer scope (CSP only)
     *  Supported scopes for **CategoryType: ReservationUtilization**
     *  EA (Enterprise Agreement) Scopes:
     * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope
     * MCA (Modern Customer Agreement) Scopes:
     * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope (non-CSP only)
     * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for customer scope (CSP only)
     */
    @JvmName("wmqscsledhncjyon")
    public suspend fun scope(`value`: Output) {
        this.scope = value
    }

    /**
     * @param value The time covered by a budget. Tracking of the amount will be reset based on the time grain.
     * Supported for CategoryType(s): Cost, ReservationUtilization.
     *  Supported timeGrainTypes for **CategoryType: Cost**
     * - Monthly
     * - Quarterly
     * - Annually
     * - BillingMonth*
     * - BillingQuarter*
     * - BillingAnnual*
     *   *only supported for Web Direct customers.
     *  Supported timeGrainTypes for **CategoryType: ReservationUtilization**
     * - Last7Days
     * - Last30Days
     *  Required for CategoryType(s): Cost, ReservationUtilization.
     */
    @JvmName("staufoicacnxkjui")
    public suspend fun timeGrain(`value`: Output>) {
        this.timeGrain = value
    }

    /**
     * @param value The time period that defines the active period of the budget. The budget will evaluate data on or after the startDate and will expire on the endDate.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     *  Required for CategoryType(s): Cost, ReservationUtilization.
     */
    @JvmName("rmaldlhvcrmycwuf")
    public suspend fun timePeriod(`value`: Output) {
        this.timePeriod = value
    }

    /**
     * @param value The total amount of cost to track with the budget.
     *  Supported for CategoryType(s): Cost.
     *  Required for CategoryType(s): Cost.
     */
    @JvmName("metyhtnyktisfhed")
    public suspend fun amount(`value`: Double?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.amount = mapped
    }

    /**
     * @param value Budget Name.
     */
    @JvmName("vkrkydegejtdwkxv")
    public suspend fun budgetName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.budgetName = mapped
    }

    /**
     * @param value The category of the budget.
     * - 'Cost' defines a Budget.
     * - 'ReservationUtilization' defines a Reservation Utilization Alert Rule.
     */
    @JvmName("qgdyhydnagkhmekb")
    public suspend fun category(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.category = mapped
    }

    /**
     * @param value The category of the budget.
     * - 'Cost' defines a Budget.
     * - 'ReservationUtilization' defines a Reservation Utilization Alert Rule.
     */
    @JvmName("fdfykggsnwndsmxx")
    public fun category(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.category = mapped
    }

    /**
     * @param value The category of the budget.
     * - 'Cost' defines a Budget.
     * - 'ReservationUtilization' defines a Reservation Utilization Alert Rule.
     */
    @JvmName("khoruktgfqllphbo")
    public fun category(`value`: CategoryType) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.category = mapped
    }

    /**
     * @param value eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.
     */
    @JvmName("yvkwarvetskktdcn")
    public suspend fun eTag(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.eTag = mapped
    }

    /**
     * @param value May be used to filter budgets by user-specified dimensions and/or tags.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     */
    @JvmName("ldnutifbcvqmpacu")
    public suspend fun filter(`value`: BudgetFilterArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.filter = mapped
    }

    /**
     * @param argument May be used to filter budgets by user-specified dimensions and/or tags.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     */
    @JvmName("pkrtxoibobggfhqr")
    public suspend fun filter(argument: suspend BudgetFilterArgsBuilder.() -> Unit) {
        val toBeMapped = BudgetFilterArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.filter = mapped
    }

    /**
     * @param value Dictionary of notifications associated with the budget.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     * - Constraints for **CategoryType: Cost** - Budget can have up to 5 notifications with thresholdType: Actual and 5 notifications with thresholdType: Forecasted.
     * - Constraints for **CategoryType: ReservationUtilization** - Only one notification allowed. thresholdType is not applicable.
     */
    @JvmName("yfmltijablovbgiw")
    public suspend fun notifications(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.notifications = mapped
    }

    /**
     * @param argument Dictionary of notifications associated with the budget.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     * - Constraints for **CategoryType: Cost** - Budget can have up to 5 notifications with thresholdType: Actual and 5 notifications with thresholdType: Forecasted.
     * - Constraints for **CategoryType: ReservationUtilization** - Only one notification allowed. thresholdType is not applicable.
     */
    @JvmName("ycfhuapjdohrfhak")
    public suspend fun notifications(vararg argument: Pair Unit>) {
        val toBeMapped = argument.toList().map { (left, right) ->
            left to
                NotificationArgsBuilder().applySuspend { right() }.build()
        }.toMap()
        val mapped = of(toBeMapped)
        this.notifications = mapped
    }

    /**
     * @param values Dictionary of notifications associated with the budget.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     * - Constraints for **CategoryType: Cost** - Budget can have up to 5 notifications with thresholdType: Actual and 5 notifications with thresholdType: Forecasted.
     * - Constraints for **CategoryType: ReservationUtilization** - Only one notification allowed. thresholdType is not applicable.
     */
    @JvmName("rxalnbyiuymjwnjq")
    public fun notifications(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.notifications = mapped
    }

    /**
     * @param value The scope associated with budget operations.
     *  Supported scopes for **CategoryType: Cost**
     *  Azure RBAC Scopes:
     * - '/subscriptions/{subscriptionId}/' for subscription scope
     * - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope
     * - '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope
     *  EA (Enterprise Agreement) Scopes:
     * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
     * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope
     * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope
     *  MCA (Modern Customer Agreement) Scopes:
     * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope
     * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope
     * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope
     * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for customer scope (CSP only)
     *  Supported scopes for **CategoryType: ReservationUtilization**
     *  EA (Enterprise Agreement) Scopes:
     * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope
     * MCA (Modern Customer Agreement) Scopes:
     * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope (non-CSP only)
     * - '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for customer scope (CSP only)
     */
    @JvmName("qikxefmdbrgqpytj")
    public suspend fun scope(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scope = mapped
    }

    /**
     * @param value The time covered by a budget. Tracking of the amount will be reset based on the time grain.
     * Supported for CategoryType(s): Cost, ReservationUtilization.
     *  Supported timeGrainTypes for **CategoryType: Cost**
     * - Monthly
     * - Quarterly
     * - Annually
     * - BillingMonth*
     * - BillingQuarter*
     * - BillingAnnual*
     *   *only supported for Web Direct customers.
     *  Supported timeGrainTypes for **CategoryType: ReservationUtilization**
     * - Last7Days
     * - Last30Days
     *  Required for CategoryType(s): Cost, ReservationUtilization.
     */
    @JvmName("ytmrvbrmlfuhmdbx")
    public suspend fun timeGrain(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timeGrain = mapped
    }

    /**
     * @param value The time covered by a budget. Tracking of the amount will be reset based on the time grain.
     * Supported for CategoryType(s): Cost, ReservationUtilization.
     *  Supported timeGrainTypes for **CategoryType: Cost**
     * - Monthly
     * - Quarterly
     * - Annually
     * - BillingMonth*
     * - BillingQuarter*
     * - BillingAnnual*
     *   *only supported for Web Direct customers.
     *  Supported timeGrainTypes for **CategoryType: ReservationUtilization**
     * - Last7Days
     * - Last30Days
     *  Required for CategoryType(s): Cost, ReservationUtilization.
     */
    @JvmName("nbtnnannyiteftnc")
    public fun timeGrain(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.timeGrain = mapped
    }

    /**
     * @param value The time covered by a budget. Tracking of the amount will be reset based on the time grain.
     * Supported for CategoryType(s): Cost, ReservationUtilization.
     *  Supported timeGrainTypes for **CategoryType: Cost**
     * - Monthly
     * - Quarterly
     * - Annually
     * - BillingMonth*
     * - BillingQuarter*
     * - BillingAnnual*
     *   *only supported for Web Direct customers.
     *  Supported timeGrainTypes for **CategoryType: ReservationUtilization**
     * - Last7Days
     * - Last30Days
     *  Required for CategoryType(s): Cost, ReservationUtilization.
     */
    @JvmName("lueaxawtkxbyefct")
    public fun timeGrain(`value`: TimeGrainType) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.timeGrain = mapped
    }

    /**
     * @param value The time period that defines the active period of the budget. The budget will evaluate data on or after the startDate and will expire on the endDate.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     *  Required for CategoryType(s): Cost, ReservationUtilization.
     */
    @JvmName("xtjfgbhsxsnlmrpy")
    public suspend fun timePeriod(`value`: BudgetTimePeriodArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timePeriod = mapped
    }

    /**
     * @param argument The time period that defines the active period of the budget. The budget will evaluate data on or after the startDate and will expire on the endDate.
     *  Supported for CategoryType(s): Cost, ReservationUtilization.
     *  Required for CategoryType(s): Cost, ReservationUtilization.
     */
    @JvmName("swvoytbywxrilpcm")
    public suspend fun timePeriod(argument: suspend BudgetTimePeriodArgsBuilder.() -> Unit) {
        val toBeMapped = BudgetTimePeriodArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.timePeriod = mapped
    }

    internal fun build(): BudgetArgs = BudgetArgs(
        amount = amount,
        budgetName = budgetName,
        category = category,
        eTag = eTag,
        filter = filter,
        notifications = notifications,
        scope = scope,
        timeGrain = timeGrain,
        timePeriod = timePeriod,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy