"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.BackupPlan = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A backup plan defines when and how to back up a resource, including the backup's schedule, retention, and location.
 *
 * To get more information about BackupPlan, see:
 *
 * * [API documentation](https://cloud.google.com/backup-disaster-recovery/docs/reference/rest)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/backup-disaster-recovery/docs)
 *
 * ## Example Usage
 *
 * ### Backup Dr Backup Plan Simple
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const myBackupVault = new gcp.backupdisasterrecovery.BackupVault("my_backup_vault", {
 *     location: "us-central1",
 *     backupVaultId: "backup-vault-simple-test",
 *     backupMinimumEnforcedRetentionDuration: "100000s",
 * });
 * const my_backup_plan_1 = new gcp.backupdisasterrecovery.BackupPlan("my-backup-plan-1", {
 *     location: "us-central1",
 *     backupPlanId: "backup-plan-simple-test",
 *     resourceType: "compute.googleapis.com/Instance",
 *     backupVault: myBackupVault.id,
 *     maxCustomOnDemandRetentionDays: 30,
 *     backupRules: [{
 *         ruleId: "rule-1",
 *         backupRetentionDays: 5,
 *         standardSchedule: {
 *             recurrenceType: "HOURLY",
 *             hourlyFrequency: 6,
 *             timeZone: "UTC",
 *             backupWindow: {
 *                 startHourOfDay: 0,
 *                 endHourOfDay: 24,
 *             },
 *         },
 *     }],
 * });
 * ```
 * ### Backup Dr Backup Plan For Disk Resource
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const myBackupVault = new gcp.backupdisasterrecovery.BackupVault("my_backup_vault", {
 *     location: "us-central1",
 *     backupVaultId: "backup-vault-disk-test",
 *     backupMinimumEnforcedRetentionDuration: "100000s",
 * });
 * const my_disk_backup_plan_1 = new gcp.backupdisasterrecovery.BackupPlan("my-disk-backup-plan-1", {
 *     location: "us-central1",
 *     backupPlanId: "backup-plan-disk-test",
 *     resourceType: "compute.googleapis.com/Disk",
 *     backupVault: myBackupVault.id,
 *     maxCustomOnDemandRetentionDays: 30,
 *     backupRules: [{
 *         ruleId: "rule-1",
 *         backupRetentionDays: 5,
 *         standardSchedule: {
 *             recurrenceType: "HOURLY",
 *             hourlyFrequency: 1,
 *             timeZone: "UTC",
 *             backupWindow: {
 *                 startHourOfDay: 0,
 *                 endHourOfDay: 6,
 *             },
 *         },
 *     }],
 * });
 * ```
 * ### Backup Dr Backup Plan For Csql Resource
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const myBackupVault = new gcp.backupdisasterrecovery.BackupVault("my_backup_vault", {
 *     location: "us-central1",
 *     backupVaultId: "backup-vault-csql-test",
 *     backupMinimumEnforcedRetentionDuration: "100000s",
 * });
 * const my_csql_backup_plan_1 = new gcp.backupdisasterrecovery.BackupPlan("my-csql-backup-plan-1", {
 *     location: "us-central1",
 *     backupPlanId: "backup-plan-csql-test",
 *     resourceType: "sqladmin.googleapis.com/Instance",
 *     backupVault: myBackupVault.id,
 *     backupRules: [{
 *         ruleId: "rule-1",
 *         backupRetentionDays: 5,
 *         standardSchedule: {
 *             recurrenceType: "HOURLY",
 *             hourlyFrequency: 6,
 *             timeZone: "UTC",
 *             backupWindow: {
 *                 startHourOfDay: 0,
 *                 endHourOfDay: 6,
 *             },
 *         },
 *     }],
 *     logRetentionDays: 4,
 * });
 * ```
 *
 * ## Import
 *
 * BackupPlan can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/backupPlans/{{backup_plan_id}}`
 *
 * * `{{project}}/{{location}}/{{backup_plan_id}}`
 *
 * * `{{location}}/{{backup_plan_id}}`
 *
 * When using the `pulumi import` command, BackupPlan can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:backupdisasterrecovery/backupPlan:BackupPlan default projects/{{project}}/locations/{{location}}/backupPlans/{{backup_plan_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:backupdisasterrecovery/backupPlan:BackupPlan default {{project}}/{{location}}/{{backup_plan_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:backupdisasterrecovery/backupPlan:BackupPlan default {{location}}/{{backup_plan_id}}
 * ```
 */
class BackupPlan extends pulumi.CustomResource {
    /**
     * Get an existing BackupPlan 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 BackupPlan(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of BackupPlan.  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'] === BackupPlan.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["backupPlanId"] = state?.backupPlanId;
            resourceInputs["backupRules"] = state?.backupRules;
            resourceInputs["backupVault"] = state?.backupVault;
            resourceInputs["backupVaultServiceAccount"] = state?.backupVaultServiceAccount;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["description"] = state?.description;
            resourceInputs["location"] = state?.location;
            resourceInputs["logRetentionDays"] = state?.logRetentionDays;
            resourceInputs["maxCustomOnDemandRetentionDays"] = state?.maxCustomOnDemandRetentionDays;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["resourceType"] = state?.resourceType;
            resourceInputs["supportedResourceTypes"] = state?.supportedResourceTypes;
            resourceInputs["updateTime"] = state?.updateTime;
        }
        else {
            const args = argsOrState;
            if (args?.backupPlanId === undefined && !opts.urn) {
                throw new Error("Missing required property 'backupPlanId'");
            }
            if (args?.backupRules === undefined && !opts.urn) {
                throw new Error("Missing required property 'backupRules'");
            }
            if (args?.backupVault === undefined && !opts.urn) {
                throw new Error("Missing required property 'backupVault'");
            }
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.resourceType === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceType'");
            }
            resourceInputs["backupPlanId"] = args?.backupPlanId;
            resourceInputs["backupRules"] = args?.backupRules;
            resourceInputs["backupVault"] = args?.backupVault;
            resourceInputs["description"] = args?.description;
            resourceInputs["location"] = args?.location;
            resourceInputs["logRetentionDays"] = args?.logRetentionDays;
            resourceInputs["maxCustomOnDemandRetentionDays"] = args?.maxCustomOnDemandRetentionDays;
            resourceInputs["project"] = args?.project;
            resourceInputs["resourceType"] = args?.resourceType;
            resourceInputs["backupVaultServiceAccount"] = undefined /*out*/;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["supportedResourceTypes"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(BackupPlan.__pulumiType, name, resourceInputs, opts);
    }
}
exports.BackupPlan = BackupPlan;
/** @internal */
BackupPlan.__pulumiType = 'gcp:backupdisasterrecovery/backupPlan:BackupPlan';
//# sourceMappingURL=backupPlan.js.map