"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.SingleServerVirtualNetworkRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A virtual network rule.
 *
 * Uses Azure REST API version 2017-12-01.
 */
class SingleServerVirtualNetworkRule extends pulumi.CustomResource {
    /**
     * Get an existing SingleServerVirtualNetworkRule 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 opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, opts) {
        return new SingleServerVirtualNetworkRule(name, undefined, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of SingleServerVirtualNetworkRule.  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'] === SingleServerVirtualNetworkRule.__pulumiType;
    }
    /**
     * Create a SingleServerVirtualNetworkRule resource with the given unique name, arguments, and options.
     *
     * @param name The _unique_ name of the resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param opts A bag of options that control this resource's behavior.
     */
    constructor(name, args, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (!opts.id) {
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            if (args?.serverName === undefined && !opts.urn) {
                throw new Error("Missing required property 'serverName'");
            }
            if (args?.virtualNetworkSubnetId === undefined && !opts.urn) {
                throw new Error("Missing required property 'virtualNetworkSubnetId'");
            }
            resourceInputs["ignoreMissingVnetServiceEndpoint"] = args?.ignoreMissingVnetServiceEndpoint;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["serverName"] = args?.serverName;
            resourceInputs["virtualNetworkRuleName"] = args?.virtualNetworkRuleName;
            resourceInputs["virtualNetworkSubnetId"] = args?.virtualNetworkSubnetId;
            resourceInputs["azureApiVersion"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["type"] = undefined /*out*/;
        }
        else {
            resourceInputs["azureApiVersion"] = undefined /*out*/;
            resourceInputs["ignoreMissingVnetServiceEndpoint"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["type"] = undefined /*out*/;
            resourceInputs["virtualNetworkSubnetId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const aliasOpts = { aliases: [{ type: "azure-native:dbforpostgresql/v20171201:SingleServerVirtualNetworkRule" }, { type: "azure-native:dbforpostgresql/v20171201:VirtualNetworkRule" }, { type: "azure-native:dbforpostgresql/v20171201preview:SingleServerVirtualNetworkRule" }, { type: "azure-native:dbforpostgresql/v20171201preview:VirtualNetworkRule" }] };
        opts = pulumi.mergeOptions(opts, aliasOpts);
        super(SingleServerVirtualNetworkRule.__pulumiType, name, resourceInputs, opts);
    }
}
exports.SingleServerVirtualNetworkRule = SingleServerVirtualNetworkRule;
/** @internal */
SingleServerVirtualNetworkRule.__pulumiType = 'azure-native:dbforpostgresql:SingleServerVirtualNetworkRule';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2luZ2xlU2VydmVyVmlydHVhbE5ldHdvcmtSdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vZGJmb3Jwb3N0Z3Jlc3FsL3NpbmdsZVNlcnZlclZpcnR1YWxOZXR3b3JrUnVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsc0VBQXNFO0FBQ3RFLGlGQUFpRjs7O0FBRWpGLHlDQUF5QztBQUN6QywwQ0FBMEM7QUFFMUM7Ozs7R0FJRztBQUNILE1BQWE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