"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.AutonomousDatabase = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages an Autonomous Database.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.oracle.AutonomousDatabase("example", {
 *     name: "example",
 *     resourceGroupName: "example",
 *     location: "West Europe",
 *     subnetId: "example",
 *     displayName: "example",
 *     dbWorkload: "example",
 *     mtlsConnectionRequired: false,
 *     backupRetentionPeriodInDays: 42,
 *     computeModel: "example",
 *     dataStorageSizeInGbs: 42,
 *     autoScalingForStorageEnabled: false,
 *     virtualNetworkId: "example",
 *     adminPassword: "example",
 *     autoScalingEnabled: "example" === "true",
 *     characterSet: "example",
 *     computeCount: 1.23456,
 *     nationalCharacterSet: "example",
 *     licenseModel: "false",
 *     dbVersion: "example",
 * });
 * ```
 *
 * ## > **Note:** `allowedIps`  cannot be updated after provisioning the resource with an empty list (i.e., a publicly accessible Autonomous Database)
 *
 *               size: the maximum number of Ips provided shouldn't exceed 1024. At this time we only support IpV4.
 * ***
 *
 * * `customerContacts` - (Optional) Specifies a list of customer contacts as email addresses. Changing this forces a new Autonomous Database to be created.
 *
 * * `tags` - (Optional) A mapping of tags which should be assigned to the Autonomous Database.
 *
 * * `longTermBackupSchedule` - (Optional) A `longTermBackupSchedule` block as defined below.
 *
 * > **Note:** for more information see [Create Long-Term Backups on Autonomous Database](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/backup-long-term.html#GUID-BD76E02E-AEB0-4450-A6AB-5C9EB1F4EAD0)
 *
 * ***
 *
 * A `longTermBackupSchedule` blocks supports the following:
 *
 * * `repeatCadence` - (Required) Specifies the schedule for automated long-term backups. Possible values are `Weekly`, `Monthly`, `Yearly`, or `OneTime` (does not repeat) . For example, if the Backup date and Time is `Jan 24, 2025 00:09:00 UTC` and this is a Tuesday, and Weekly is selected, the long-term backup will happen every Tuesday.
 *
 * * `timeOfBackup` - (Required) The date and time in which the backup should be taken in ISO8601 Date Time format.
 *
 * * `retentionPeriodInDays` - (Required) The retention period in days for the Autonomous Database Backup. Possible values range from `90` to `2558` days (7 years).
 *
 * * `enabled` - (Required) A boolean value that indicates whether the long term backup schedule is enabled.
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Oracle.Database` - 2025-09-01
 *
 * ## Import
 *
 * Autonomous Databases can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:oracle/autonomousDatabase:AutonomousDatabase example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup/providers/Oracle.Database/autonomousDatabases/autonomousDatabases1
 * ```
 */
class AutonomousDatabase extends pulumi.CustomResource {
    /**
     * Get an existing AutonomousDatabase 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 AutonomousDatabase(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:oracle/autonomousDatabase:AutonomousDatabase';
    /**
     * Returns true if the given object is an instance of AutonomousDatabase.  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'] === AutonomousDatabase.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["adminPassword"] = state?.adminPassword;
            resourceInputs["allowedIps"] = state?.allowedIps;
            resourceInputs["autoScalingEnabled"] = state?.autoScalingEnabled;
            resourceInputs["autoScalingForStorageEnabled"] = state?.autoScalingForStorageEnabled;
            resourceInputs["backupRetentionPeriodInDays"] = state?.backupRetentionPeriodInDays;
            resourceInputs["characterSet"] = state?.characterSet;
            resourceInputs["computeCount"] = state?.computeCount;
            resourceInputs["computeModel"] = state?.computeModel;
            resourceInputs["customerContacts"] = state?.customerContacts;
            resourceInputs["dataStorageSizeInTbs"] = state?.dataStorageSizeInTbs;
            resourceInputs["dbVersion"] = state?.dbVersion;
            resourceInputs["dbWorkload"] = state?.dbWorkload;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["licenseModel"] = state?.licenseModel;
            resourceInputs["location"] = state?.location;
            resourceInputs["longTermBackupSchedule"] = state?.longTermBackupSchedule;
            resourceInputs["mtlsConnectionRequired"] = state?.mtlsConnectionRequired;
            resourceInputs["name"] = state?.name;
            resourceInputs["nationalCharacterSet"] = state?.nationalCharacterSet;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["subnetId"] = state?.subnetId;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["virtualNetworkId"] = state?.virtualNetworkId;
        }
        else {
            const args = argsOrState;
            if (args?.adminPassword === undefined && !opts.urn) {
                throw new Error("Missing required property 'adminPassword'");
            }
            if (args?.autoScalingEnabled === undefined && !opts.urn) {
                throw new Error("Missing required property 'autoScalingEnabled'");
            }
            if (args?.autoScalingForStorageEnabled === undefined && !opts.urn) {
                throw new Error("Missing required property 'autoScalingForStorageEnabled'");
            }
            if (args?.backupRetentionPeriodInDays === undefined && !opts.urn) {
                throw new Error("Missing required property 'backupRetentionPeriodInDays'");
            }
            if (args?.characterSet === undefined && !opts.urn) {
                throw new Error("Missing required property 'characterSet'");
            }
            if (args?.computeCount === undefined && !opts.urn) {
                throw new Error("Missing required property 'computeCount'");
            }
            if (args?.computeModel === undefined && !opts.urn) {
                throw new Error("Missing required property 'computeModel'");
            }
            if (args?.dataStorageSizeInTbs === undefined && !opts.urn) {
                throw new Error("Missing required property 'dataStorageSizeInTbs'");
            }
            if (args?.dbVersion === undefined && !opts.urn) {
                throw new Error("Missing required property 'dbVersion'");
            }
            if (args?.dbWorkload === undefined && !opts.urn) {
                throw new Error("Missing required property 'dbWorkload'");
            }
            if (args?.displayName === undefined && !opts.urn) {
                throw new Error("Missing required property 'displayName'");
            }
            if (args?.licenseModel === undefined && !opts.urn) {
                throw new Error("Missing required property 'licenseModel'");
            }
            if (args?.mtlsConnectionRequired === undefined && !opts.urn) {
                throw new Error("Missing required property 'mtlsConnectionRequired'");
            }
            if (args?.nationalCharacterSet === undefined && !opts.urn) {
                throw new Error("Missing required property 'nationalCharacterSet'");
            }
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            resourceInputs["adminPassword"] = args?.adminPassword ? pulumi.secret(args.adminPassword) : undefined;
            resourceInputs["allowedIps"] = args?.allowedIps;
            resourceInputs["autoScalingEnabled"] = args?.autoScalingEnabled;
            resourceInputs["autoScalingForStorageEnabled"] = args?.autoScalingForStorageEnabled;
            resourceInputs["backupRetentionPeriodInDays"] = args?.backupRetentionPeriodInDays;
            resourceInputs["characterSet"] = args?.characterSet;
            resourceInputs["computeCount"] = args?.computeCount;
            resourceInputs["computeModel"] = args?.computeModel;
            resourceInputs["customerContacts"] = args?.customerContacts;
            resourceInputs["dataStorageSizeInTbs"] = args?.dataStorageSizeInTbs;
            resourceInputs["dbVersion"] = args?.dbVersion;
            resourceInputs["dbWorkload"] = args?.dbWorkload;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["licenseModel"] = args?.licenseModel;
            resourceInputs["location"] = args?.location;
            resourceInputs["longTermBackupSchedule"] = args?.longTermBackupSchedule;
            resourceInputs["mtlsConnectionRequired"] = args?.mtlsConnectionRequired;
            resourceInputs["name"] = args?.name;
            resourceInputs["nationalCharacterSet"] = args?.nationalCharacterSet;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["subnetId"] = args?.subnetId;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["virtualNetworkId"] = args?.virtualNetworkId;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["adminPassword"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(AutonomousDatabase.__pulumiType, name, resourceInputs, opts);
    }
}
exports.AutonomousDatabase = AutonomousDatabase;
//# sourceMappingURL=autonomousDatabase.js.map