"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.AccountCostManagementExport = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a Cost Management Export for a Billing Account.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "example",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     accountTier: "Standard",
 *     accountReplicationType: "LRS",
 * });
 * const exampleContainer = new azure.storage.Container("example", {
 *     name: "examplecontainer",
 *     storageAccountName: exampleAccount.name,
 * });
 * const exampleAccountCostManagementExport = new azure.billing.AccountCostManagementExport("example", {
 *     name: "example",
 *     billingAccountId: "example",
 *     recurrenceType: "Monthly",
 *     recurrencePeriodStartDate: "2020-08-18T00:00:00Z",
 *     recurrencePeriodEndDate: "2020-09-18T00:00:00Z",
 *     fileFormat: "Csv",
 *     exportDataStorageLocation: {
 *         containerId: exampleContainer.id,
 *         rootFolderPath: "/root/updated",
 *     },
 *     exportDataOptions: {
 *         type: "Usage",
 *         timeFrame: "WeekToDate",
 *     },
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.CostManagement` - 2023-08-01
 *
 * ## Import
 *
 * Billing Account Cost Management Exports can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:billing/accountCostManagementExport:AccountCostManagementExport example /providers/Microsoft.Billing/billingAccounts/12345678/providers/Microsoft.CostManagement/exports/export1
 * ```
 */
class AccountCostManagementExport extends pulumi.CustomResource {
    /**
     * Get an existing AccountCostManagementExport 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 AccountCostManagementExport(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:billing/accountCostManagementExport:AccountCostManagementExport';
    /**
     * Returns true if the given object is an instance of AccountCostManagementExport.  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'] === AccountCostManagementExport.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["active"] = state?.active;
            resourceInputs["billingAccountId"] = state?.billingAccountId;
            resourceInputs["exportDataOptions"] = state?.exportDataOptions;
            resourceInputs["exportDataStorageLocation"] = state?.exportDataStorageLocation;
            resourceInputs["fileFormat"] = state?.fileFormat;
            resourceInputs["name"] = state?.name;
            resourceInputs["recurrencePeriodEndDate"] = state?.recurrencePeriodEndDate;
            resourceInputs["recurrencePeriodStartDate"] = state?.recurrencePeriodStartDate;
            resourceInputs["recurrenceType"] = state?.recurrenceType;
        }
        else {
            const args = argsOrState;
            if (args?.billingAccountId === undefined && !opts.urn) {
                throw new Error("Missing required property 'billingAccountId'");
            }
            if (args?.exportDataOptions === undefined && !opts.urn) {
                throw new Error("Missing required property 'exportDataOptions'");
            }
            if (args?.exportDataStorageLocation === undefined && !opts.urn) {
                throw new Error("Missing required property 'exportDataStorageLocation'");
            }
            if (args?.recurrencePeriodEndDate === undefined && !opts.urn) {
                throw new Error("Missing required property 'recurrencePeriodEndDate'");
            }
            if (args?.recurrencePeriodStartDate === undefined && !opts.urn) {
                throw new Error("Missing required property 'recurrencePeriodStartDate'");
            }
            if (args?.recurrenceType === undefined && !opts.urn) {
                throw new Error("Missing required property 'recurrenceType'");
            }
            resourceInputs["active"] = args?.active;
            resourceInputs["billingAccountId"] = args?.billingAccountId;
            resourceInputs["exportDataOptions"] = args?.exportDataOptions;
            resourceInputs["exportDataStorageLocation"] = args?.exportDataStorageLocation;
            resourceInputs["fileFormat"] = args?.fileFormat;
            resourceInputs["name"] = args?.name;
            resourceInputs["recurrencePeriodEndDate"] = args?.recurrencePeriodEndDate;
            resourceInputs["recurrencePeriodStartDate"] = args?.recurrencePeriodStartDate;
            resourceInputs["recurrenceType"] = args?.recurrenceType;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(AccountCostManagementExport.__pulumiType, name, resourceInputs, opts);
    }
}
exports.AccountCostManagementExport = AccountCostManagementExport;
//# sourceMappingURL=accountCostManagementExport.js.map