"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.TraceScope = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A trace scope is a collection of resources whose traces are queried together
 *
 * ## Example Usage
 *
 * ### Observability Trace Scope Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const project = gcp.organizations.getProject({});
 * const project_2 = new gcp.organizations.Project("project-2", {
 *     projectId: "tf-test_12125",
 *     name: "tf-test_82749",
 *     orgId: "123456789",
 *     deletionPolicy: "DELETE",
 * });
 * const observabilityTraceScope = new gcp.observability.TraceScope("observability_trace_scope", {
 *     traceScopeId: "test-scope",
 *     location: "global",
 *     resourceNames: [
 *         project.then(project => `projects/${project.projectId}`),
 *         pulumi.interpolate`projects/${project_2.projectId}`,
 *     ],
 *     description: "A trace scope configured with Terraform",
 * }, {
 *     dependsOn: [project_2],
 * });
 * ```
 *
 * ## Import
 *
 * TraceScope can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/traceScopes/{{trace_scope_id}}`
 *
 * * `{{project}}/{{location}}/{{trace_scope_id}}`
 *
 * * `{{location}}/{{trace_scope_id}}`
 *
 * When using the `pulumi import` command, TraceScope can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:observability/traceScope:TraceScope default projects/{{project}}/locations/{{location}}/traceScopes/{{trace_scope_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:observability/traceScope:TraceScope default {{project}}/{{location}}/{{trace_scope_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:observability/traceScope:TraceScope default {{location}}/{{trace_scope_id}}
 * ```
 */
class TraceScope extends pulumi.CustomResource {
    /**
     * Get an existing TraceScope 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 TraceScope(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of TraceScope.  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'] === TraceScope.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["description"] = state?.description;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["resourceNames"] = state?.resourceNames;
            resourceInputs["traceScopeId"] = state?.traceScopeId;
            resourceInputs["updateTime"] = state?.updateTime;
        }
        else {
            const args = argsOrState;
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.resourceNames === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceNames'");
            }
            if (args?.traceScopeId === undefined && !opts.urn) {
                throw new Error("Missing required property 'traceScopeId'");
            }
            resourceInputs["description"] = args?.description;
            resourceInputs["location"] = args?.location;
            resourceInputs["project"] = args?.project;
            resourceInputs["resourceNames"] = args?.resourceNames;
            resourceInputs["traceScopeId"] = args?.traceScopeId;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(TraceScope.__pulumiType, name, resourceInputs, opts);
    }
}
exports.TraceScope = TraceScope;
/** @internal */
TraceScope.__pulumiType = 'gcp:observability/traceScope:TraceScope';
//# sourceMappingURL=traceScope.js.map