"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.RegionalEndpoint = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Regional Private Service Connect (PSC) endpoint resource.
 *
 * To get more information about RegionalEndpoint, see:
 *
 * * [API documentation](https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.regionalEndpoints)
 * * How-to Guides
 *     * [Access regional Google APIs through endpoints](https://cloud.google.com/vpc/docs/access-regional-google-apis-endpoints)
 *
 * ## Example Usage
 *
 * ### Network Connectivity Regional Endpoint Regional Access
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const myNetwork = new gcp.compute.Network("my_network", {
 *     name: "my-network",
 *     autoCreateSubnetworks: false,
 * });
 * const mySubnetwork = new gcp.compute.Subnetwork("my_subnetwork", {
 *     name: "my-subnetwork",
 *     ipCidrRange: "192.168.0.0/24",
 *     region: "us-central1",
 *     network: myNetwork.id,
 * });
 * const _default = new gcp.networkconnectivity.RegionalEndpoint("default", {
 *     name: "my-rep",
 *     location: "us-central1",
 *     targetGoogleApi: "storage.us-central1.rep.googleapis.com",
 *     accessType: "REGIONAL",
 *     address: "192.168.0.5",
 *     network: myNetwork.id,
 *     subnetwork: mySubnetwork.id,
 *     description: "My RegionalEndpoint targeting Google API storage.us-central1.rep.googleapis.com",
 *     labels: {
 *         env: "default",
 *     },
 * });
 * ```
 * ### Network Connectivity Regional Endpoint Global Access
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const myNetwork = new gcp.compute.Network("my_network", {
 *     name: "my-network",
 *     autoCreateSubnetworks: false,
 * });
 * const mySubnetwork = new gcp.compute.Subnetwork("my_subnetwork", {
 *     name: "my-subnetwork",
 *     ipCidrRange: "192.168.0.0/24",
 *     region: "us-central1",
 *     network: myNetwork.id,
 * });
 * const _default = new gcp.networkconnectivity.RegionalEndpoint("default", {
 *     name: "my-rep",
 *     location: "us-central1",
 *     targetGoogleApi: "storage.us-central1.rep.googleapis.com",
 *     accessType: "GLOBAL",
 *     address: "192.168.0.4",
 *     network: myNetwork.id,
 *     subnetwork: mySubnetwork.id,
 * });
 * ```
 *
 * ## Import
 *
 * RegionalEndpoint can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/regionalEndpoints/{{name}}`
 *
 * * `{{project}}/{{location}}/{{name}}`
 *
 * * `{{location}}/{{name}}`
 *
 * When using the `pulumi import` command, RegionalEndpoint can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:networkconnectivity/regionalEndpoint:RegionalEndpoint default projects/{{project}}/locations/{{location}}/regionalEndpoints/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:networkconnectivity/regionalEndpoint:RegionalEndpoint default {{project}}/{{location}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:networkconnectivity/regionalEndpoint:RegionalEndpoint default {{location}}/{{name}}
 * ```
 */
class RegionalEndpoint extends pulumi.CustomResource {
    /**
     * Get an existing RegionalEndpoint 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 RegionalEndpoint(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of RegionalEndpoint.  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'] === RegionalEndpoint.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["accessType"] = state?.accessType;
            resourceInputs["address"] = state?.address;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["description"] = state?.description;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["network"] = state?.network;
            resourceInputs["project"] = state?.project;
            resourceInputs["pscForwardingRule"] = state?.pscForwardingRule;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["subnetwork"] = state?.subnetwork;
            resourceInputs["targetGoogleApi"] = state?.targetGoogleApi;
            resourceInputs["updateTime"] = state?.updateTime;
        }
        else {
            const args = argsOrState;
            if (args?.accessType === undefined && !opts.urn) {
                throw new Error("Missing required property 'accessType'");
            }
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.targetGoogleApi === undefined && !opts.urn) {
                throw new Error("Missing required property 'targetGoogleApi'");
            }
            resourceInputs["accessType"] = args?.accessType;
            resourceInputs["address"] = args?.address;
            resourceInputs["description"] = args?.description;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["location"] = args?.location;
            resourceInputs["name"] = args?.name;
            resourceInputs["network"] = args?.network;
            resourceInputs["project"] = args?.project;
            resourceInputs["subnetwork"] = args?.subnetwork;
            resourceInputs["targetGoogleApi"] = args?.targetGoogleApi;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["pscForwardingRule"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(RegionalEndpoint.__pulumiType, name, resourceInputs, opts);
    }
}
exports.RegionalEndpoint = RegionalEndpoint;
/** @internal */
RegionalEndpoint.__pulumiType = 'gcp:networkconnectivity/regionalEndpoint:RegionalEndpoint';
//# sourceMappingURL=regionalEndpoint.js.map