"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.FlexibleServer = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a MySQL Flexible Server.
 *
 * ## 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 exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
 *     name: "example-vn",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     addressSpaces: ["10.0.0.0/16"],
 * });
 * const exampleSubnet = new azure.network.Subnet("example", {
 *     name: "example-sn",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: exampleVirtualNetwork.name,
 *     addressPrefixes: ["10.0.2.0/24"],
 *     serviceEndpoints: ["Microsoft.Storage"],
 *     delegations: [{
 *         name: "fs",
 *         serviceDelegation: {
 *             name: "Microsoft.DBforMySQL/flexibleServers",
 *             actions: ["Microsoft.Network/virtualNetworks/subnets/join/action"],
 *         },
 *     }],
 * });
 * const exampleZone = new azure.privatedns.Zone("example", {
 *     name: "example.mysql.database.azure.com",
 *     resourceGroupName: example.name,
 * });
 * const exampleZoneVirtualNetworkLink = new azure.privatedns.ZoneVirtualNetworkLink("example", {
 *     name: "exampleVnetZone.com",
 *     privateDnsZoneName: exampleZone.name,
 *     virtualNetworkId: exampleVirtualNetwork.id,
 *     resourceGroupName: example.name,
 * });
 * const exampleFlexibleServer = new azure.mysql.FlexibleServer("example", {
 *     name: "example-fs",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     administratorLogin: "psqladmin",
 *     administratorPassword: "H@Sh1CoR3!",
 *     backupRetentionDays: 7,
 *     delegatedSubnetId: exampleSubnet.id,
 *     privateDnsZoneId: exampleZone.id,
 *     skuName: "GP_Standard_D2ds_v4",
 * }, {
 *     dependsOn: [exampleZoneVirtualNetworkLink],
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.DBforMySQL` - 2023-12-30
 *
 * ## Import
 *
 * MySQL Flexible Servers can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:mysql/flexibleServer:FlexibleServer example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServer1
 * ```
 */
class FlexibleServer extends pulumi.CustomResource {
    /**
     * Get an existing FlexibleServer 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 FlexibleServer(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:mysql/flexibleServer:FlexibleServer';
    /**
     * Returns true if the given object is an instance of FlexibleServer.  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'] === FlexibleServer.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["administratorLogin"] = state?.administratorLogin;
            resourceInputs["administratorPassword"] = state?.administratorPassword;
            resourceInputs["administratorPasswordWoVersion"] = state?.administratorPasswordWoVersion;
            resourceInputs["backupRetentionDays"] = state?.backupRetentionDays;
            resourceInputs["createMode"] = state?.createMode;
            resourceInputs["customerManagedKey"] = state?.customerManagedKey;
            resourceInputs["delegatedSubnetId"] = state?.delegatedSubnetId;
            resourceInputs["fqdn"] = state?.fqdn;
            resourceInputs["geoRedundantBackupEnabled"] = state?.geoRedundantBackupEnabled;
            resourceInputs["highAvailability"] = state?.highAvailability;
            resourceInputs["identity"] = state?.identity;
            resourceInputs["location"] = state?.location;
            resourceInputs["maintenanceWindow"] = state?.maintenanceWindow;
            resourceInputs["name"] = state?.name;
            resourceInputs["pointInTimeRestoreTimeInUtc"] = state?.pointInTimeRestoreTimeInUtc;
            resourceInputs["privateDnsZoneId"] = state?.privateDnsZoneId;
            resourceInputs["publicNetworkAccess"] = state?.publicNetworkAccess;
            resourceInputs["publicNetworkAccessEnabled"] = state?.publicNetworkAccessEnabled;
            resourceInputs["replicaCapacity"] = state?.replicaCapacity;
            resourceInputs["replicationRole"] = state?.replicationRole;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["skuName"] = state?.skuName;
            resourceInputs["sourceServerId"] = state?.sourceServerId;
            resourceInputs["storage"] = state?.storage;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["version"] = state?.version;
            resourceInputs["zone"] = state?.zone;
        }
        else {
            const args = argsOrState;
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            resourceInputs["administratorLogin"] = args?.administratorLogin;
            resourceInputs["administratorPassword"] = args?.administratorPassword ? pulumi.secret(args.administratorPassword) : undefined;
            resourceInputs["administratorPasswordWoVersion"] = args?.administratorPasswordWoVersion;
            resourceInputs["backupRetentionDays"] = args?.backupRetentionDays;
            resourceInputs["createMode"] = args?.createMode;
            resourceInputs["customerManagedKey"] = args?.customerManagedKey;
            resourceInputs["delegatedSubnetId"] = args?.delegatedSubnetId;
            resourceInputs["geoRedundantBackupEnabled"] = args?.geoRedundantBackupEnabled;
            resourceInputs["highAvailability"] = args?.highAvailability;
            resourceInputs["identity"] = args?.identity;
            resourceInputs["location"] = args?.location;
            resourceInputs["maintenanceWindow"] = args?.maintenanceWindow;
            resourceInputs["name"] = args?.name;
            resourceInputs["pointInTimeRestoreTimeInUtc"] = args?.pointInTimeRestoreTimeInUtc;
            resourceInputs["privateDnsZoneId"] = args?.privateDnsZoneId;
            resourceInputs["publicNetworkAccess"] = args?.publicNetworkAccess;
            resourceInputs["replicationRole"] = args?.replicationRole;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["skuName"] = args?.skuName;
            resourceInputs["sourceServerId"] = args?.sourceServerId;
            resourceInputs["storage"] = args?.storage;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["version"] = args?.version;
            resourceInputs["zone"] = args?.zone;
            resourceInputs["fqdn"] = undefined /*out*/;
            resourceInputs["publicNetworkAccessEnabled"] = undefined /*out*/;
            resourceInputs["replicaCapacity"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["administratorPassword"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(FlexibleServer.__pulumiType, name, resourceInputs, opts);
    }
}
exports.FlexibleServer = FlexibleServer;
//# sourceMappingURL=flexibleServer.js.map