"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.NetworkPolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Represents a network policy resource. Network policies are regional resources.
 *
 * To get more information about NetworkPolicy, see:
 *
 * * [API documentation](https://cloud.google.com/vmware-engine/docs/reference/rest/v1/projects.locations.networkPolicies)
 *
 * ## Example Usage
 *
 * ### Vmware Engine Network Policy Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const network_policy_nw = new gcp.vmwareengine.Network("network-policy-nw", {
 *     name: "sample-network",
 *     location: "global",
 *     type: "STANDARD",
 *     description: "VMwareEngine standard network sample",
 * });
 * const vmw_engine_network_policy = new gcp.vmwareengine.NetworkPolicy("vmw-engine-network-policy", {
 *     location: "us-west1",
 *     name: "sample-network-policy",
 *     edgeServicesCidr: "192.168.30.0/26",
 *     vmwareEngineNetwork: network_policy_nw.id,
 * });
 * ```
 * ### Vmware Engine Network Policy Full
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const network_policy_nw = new gcp.vmwareengine.Network("network-policy-nw", {
 *     name: "sample-network",
 *     location: "global",
 *     type: "STANDARD",
 *     description: "VMwareEngine standard network sample",
 * });
 * const vmw_engine_network_policy = new gcp.vmwareengine.NetworkPolicy("vmw-engine-network-policy", {
 *     location: "us-west1",
 *     name: "sample-network-policy",
 *     edgeServicesCidr: "192.168.30.0/26",
 *     vmwareEngineNetwork: network_policy_nw.id,
 *     description: "Sample Network Policy",
 *     internetAccess: {
 *         enabled: true,
 *     },
 *     externalIp: {
 *         enabled: true,
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * NetworkPolicy can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/networkPolicies/{{name}}`
 *
 * * `{{project}}/{{location}}/{{name}}`
 *
 * * `{{location}}/{{name}}`
 *
 * When using the `pulumi import` command, NetworkPolicy can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:vmwareengine/networkPolicy:NetworkPolicy default projects/{{project}}/locations/{{location}}/networkPolicies/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:vmwareengine/networkPolicy:NetworkPolicy default {{project}}/{{location}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:vmwareengine/networkPolicy:NetworkPolicy default {{location}}/{{name}}
 * ```
 */
class NetworkPolicy extends pulumi.CustomResource {
    /**
     * Get an existing NetworkPolicy 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 NetworkPolicy(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of NetworkPolicy.  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'] === NetworkPolicy.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["description"] = state?.description;
            resourceInputs["edgeServicesCidr"] = state?.edgeServicesCidr;
            resourceInputs["externalIp"] = state?.externalIp;
            resourceInputs["internetAccess"] = state?.internetAccess;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["uid"] = state?.uid;
            resourceInputs["updateTime"] = state?.updateTime;
            resourceInputs["vmwareEngineNetwork"] = state?.vmwareEngineNetwork;
            resourceInputs["vmwareEngineNetworkCanonical"] = state?.vmwareEngineNetworkCanonical;
        }
        else {
            const args = argsOrState;
            if (args?.edgeServicesCidr === undefined && !opts.urn) {
                throw new Error("Missing required property 'edgeServicesCidr'");
            }
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.vmwareEngineNetwork === undefined && !opts.urn) {
                throw new Error("Missing required property 'vmwareEngineNetwork'");
            }
            resourceInputs["description"] = args?.description;
            resourceInputs["edgeServicesCidr"] = args?.edgeServicesCidr;
            resourceInputs["externalIp"] = args?.externalIp;
            resourceInputs["internetAccess"] = args?.internetAccess;
            resourceInputs["location"] = args?.location;
            resourceInputs["name"] = args?.name;
            resourceInputs["project"] = args?.project;
            resourceInputs["vmwareEngineNetwork"] = args?.vmwareEngineNetwork;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["uid"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
            resourceInputs["vmwareEngineNetworkCanonical"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(NetworkPolicy.__pulumiType, name, resourceInputs, opts);
    }
}
exports.NetworkPolicy = NetworkPolicy;
/** @internal */
NetworkPolicy.__pulumiType = 'gcp:vmwareengine/networkPolicy:NetworkPolicy';
//# sourceMappingURL=networkPolicy.js.map