"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.EnvReferences = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * An `Environment Reference` in Apigee.
 *
 * To get more information about EnvReferences, see:
 *
 * * [API documentation](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments.references/create)
 * * How-to Guides
 *     * [Creating an environment](https://cloud.google.com/apigee/docs/api-platform/get-started/create-environment)
 *
 * ## Import
 *
 * EnvReferences can be imported using any of these accepted formats:
 *
 * * `{{env_id}}/references/{{name}}`
 *
 * * `{{env_id}}/{{name}}`
 *
 * When using the `pulumi import` command, EnvReferences can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:apigee/envReferences:EnvReferences default {{env_id}}/references/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:apigee/envReferences:EnvReferences default {{env_id}}/{{name}}
 * ```
 */
class EnvReferences extends pulumi.CustomResource {
    /**
     * Get an existing EnvReferences 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 EnvReferences(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of EnvReferences.  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'] === EnvReferences.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["description"] = state?.description;
            resourceInputs["envId"] = state?.envId;
            resourceInputs["name"] = state?.name;
            resourceInputs["refers"] = state?.refers;
            resourceInputs["resourceType"] = state?.resourceType;
        }
        else {
            const args = argsOrState;
            if (args?.envId === undefined && !opts.urn) {
                throw new Error("Missing required property 'envId'");
            }
            if (args?.refers === undefined && !opts.urn) {
                throw new Error("Missing required property 'refers'");
            }
            if (args?.resourceType === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceType'");
            }
            resourceInputs["description"] = args?.description;
            resourceInputs["envId"] = args?.envId;
            resourceInputs["name"] = args?.name;
            resourceInputs["refers"] = args?.refers;
            resourceInputs["resourceType"] = args?.resourceType;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(EnvReferences.__pulumiType, name, resourceInputs, opts);
    }
}
exports.EnvReferences = EnvReferences;
/** @internal */
EnvReferences.__pulumiType = 'gcp:apigee/envReferences:EnvReferences';
//# sourceMappingURL=envReferences.js.map