"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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.BackupPolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A backup policy is used to schedule backups at regular daily, weekly, or monthly intervals.
 * Backup policies allow you to attach a backup schedule to a volume.
 * The policy defines how many backups to retain at daily, weekly, or monthly intervals.
 *
 * To get more information about BackupPolicy, see:
 *
 * * [API documentation](https://cloud.google.com/netapp/volumes/docs/reference/rest/v1/projects.locations.backupPolicies)
 * * How-to Guides
 *     * [Documentation](https://cloud.google.com/netapp/volumes/docs/protect-data/about-volume-backups#about_backup_policies)
 *
 * ## Example Usage
 *
 * ### Netapp Backup Policy Full
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const testBackupPolicyFull = new gcp.netapp.BackupPolicy("test_backup_policy_full", {
 *     name: "test-backup-policy-full",
 *     location: "us-central1",
 *     dailyBackupLimit: 2,
 *     weeklyBackupLimit: 1,
 *     monthlyBackupLimit: 1,
 *     description: "TF test backup schedule",
 *     enabled: true,
 *     labels: {
 *         foo: "bar",
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * BackupPolicy can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/backupPolicies/{{name}}`
 *
 * * `{{project}}/{{location}}/{{name}}`
 *
 * * `{{location}}/{{name}}`
 *
 * When using the `pulumi import` command, BackupPolicy can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:netapp/backupPolicy:BackupPolicy default projects/{{project}}/locations/{{location}}/backupPolicies/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:netapp/backupPolicy:BackupPolicy default {{project}}/{{location}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:netapp/backupPolicy:BackupPolicy default {{location}}/{{name}}
 * ```
 */
class BackupPolicy extends pulumi.CustomResource {
    /**
     * Get an existing BackupPolicy 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 BackupPolicy(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of BackupPolicy.  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'] === BackupPolicy.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["assignedVolumeCount"] = state?.assignedVolumeCount;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["dailyBackupLimit"] = state?.dailyBackupLimit;
            resourceInputs["description"] = state?.description;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["enabled"] = state?.enabled;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["location"] = state?.location;
            resourceInputs["monthlyBackupLimit"] = state?.monthlyBackupLimit;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["state"] = state?.state;
            resourceInputs["weeklyBackupLimit"] = state?.weeklyBackupLimit;
        }
        else {
            const args = argsOrState;
            if (args?.dailyBackupLimit === undefined && !opts.urn) {
                throw new Error("Missing required property 'dailyBackupLimit'");
            }
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.monthlyBackupLimit === undefined && !opts.urn) {
                throw new Error("Missing required property 'monthlyBackupLimit'");
            }
            if (args?.weeklyBackupLimit === undefined && !opts.urn) {
                throw new Error("Missing required property 'weeklyBackupLimit'");
            }
            resourceInputs["dailyBackupLimit"] = args?.dailyBackupLimit;
            resourceInputs["description"] = args?.description;
            resourceInputs["enabled"] = args?.enabled;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["location"] = args?.location;
            resourceInputs["monthlyBackupLimit"] = args?.monthlyBackupLimit;
            resourceInputs["name"] = args?.name;
            resourceInputs["project"] = args?.project;
            resourceInputs["weeklyBackupLimit"] = args?.weeklyBackupLimit;
            resourceInputs["assignedVolumeCount"] = undefined /*out*/;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(BackupPolicy.__pulumiType, name, resourceInputs, opts);
    }
}
exports.BackupPolicy = BackupPolicy;
/** @internal */
BackupPolicy.__pulumiType = 'gcp:netapp/backupPolicy:BackupPolicy';
//# sourceMappingURL=backupPolicy.js.map