"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BudgetSubscription = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a Subscription Consumption Budget.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const current = azure.core.getSubscription({});
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example",
 *     location: "eastus",
 * });
 * const exampleActionGroup = new azure.monitoring.ActionGroup("example", {
 *     name: "example",
 *     resourceGroupName: example.name,
 *     shortName: "example",
 * });
 * const exampleBudgetSubscription = new azure.consumption.BudgetSubscription("example", {
 *     name: "example",
 *     subscriptionId: current.then(current => current.id),
 *     amount: 1000,
 *     timeGrain: "Monthly",
 *     timePeriod: {
 *         startDate: "2022-06-01T00:00:00Z",
 *         endDate: "2022-07-01T00:00:00Z",
 *     },
 *     filter: {
 *         dimensions: [{
 *             name: "ResourceGroupName",
 *             values: [example.name],
 *         }],
 *         tags: [{
 *             name: "foo",
 *             values: [
 *                 "bar",
 *                 "baz",
 *             ],
 *         }],
 *     },
 *     notifications: [
 *         {
 *             enabled: true,
 *             threshold: 90,
 *             operator: "EqualTo",
 *             contactEmails: [
 *                 "foo@example.com",
 *                 "bar@example.com",
 *             ],
 *             contactGroups: [exampleActionGroup.id],
 *             contactRoles: ["Owner"],
 *         },
 *         {
 *             enabled: false,
 *             threshold: 100,
 *             operator: "GreaterThan",
 *             thresholdType: "Forecasted",
 *             contactEmails: [
 *                 "foo@example.com",
 *                 "bar@example.com",
 *             ],
 *         },
 *     ],
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Consumption` - 2019-10-01
 *
 * ## Import
 *
 * Subscription Consumption Budgets can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:consumption/budgetSubscription:BudgetSubscription example /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/budgets/subscription1
 * ```
 */
class BudgetSubscription extends pulumi.CustomResource {
    /**
     * Get an existing BudgetSubscription resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new BudgetSubscription(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:consumption/budgetSubscription:BudgetSubscription';
    /**
     * Returns true if the given object is an instance of BudgetSubscription.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === BudgetSubscription.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["amount"] = state?.amount;
            resourceInputs["etag"] = state?.etag;
            resourceInputs["filter"] = state?.filter;
            resourceInputs["name"] = state?.name;
            resourceInputs["notifications"] = state?.notifications;
            resourceInputs["subscriptionId"] = state?.subscriptionId;
            resourceInputs["timeGrain"] = state?.timeGrain;
            resourceInputs["timePeriod"] = state?.timePeriod;
        }
        else {
            const args = argsOrState;
            if (args?.amount === undefined && !opts.urn) {
                throw new Error("Missing required property 'amount'");
            }
            if (args?.notifications === undefined && !opts.urn) {
                throw new Error("Missing required property 'notifications'");
            }
            if (args?.subscriptionId === undefined && !opts.urn) {
                throw new Error("Missing required property 'subscriptionId'");
            }
            if (args?.timePeriod === undefined && !opts.urn) {
                throw new Error("Missing required property 'timePeriod'");
            }
            resourceInputs["amount"] = args?.amount;
            resourceInputs["etag"] = args?.etag;
            resourceInputs["filter"] = args?.filter;
            resourceInputs["name"] = args?.name;
            resourceInputs["notifications"] = args?.notifications;
            resourceInputs["subscriptionId"] = args?.subscriptionId;
            resourceInputs["timeGrain"] = args?.timeGrain;
            resourceInputs["timePeriod"] = args?.timePeriod;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(BudgetSubscription.__pulumiType, name, resourceInputs, opts);
    }
}
exports.BudgetSubscription = BudgetSubscription;
//# sourceMappingURL=budgetSubscription.js.map