"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.ServiceProjectAttachment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Represents a Service project attachment to the Host Project.
 *
 * ## Example Usage
 *
 * ### Service Project Attachment Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * import * as time from "@pulumiverse/time";
 *
 * const serviceProject = new gcp.organizations.Project("service_project", {
 *     projectId: "project-1",
 *     name: "Service Project",
 *     orgId: "123456789",
 *     deletionPolicy: "DELETE",
 * });
 * const wait120s = new time.Sleep("wait_120s", {createDuration: "120s"}, {
 *     dependsOn: [serviceProject],
 * });
 * const example = new gcp.apphub.ServiceProjectAttachment("example", {serviceProjectAttachmentId: serviceProject.projectId}, {
 *     dependsOn: [wait120s],
 * });
 * ```
 * ### Service Project Attachment Full
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * import * as time from "@pulumiverse/time";
 *
 * const serviceProjectFull = new gcp.organizations.Project("service_project_full", {
 *     projectId: "project-1",
 *     name: "Service Project Full",
 *     orgId: "123456789",
 *     deletionPolicy: "DELETE",
 * });
 * const wait120s = new time.Sleep("wait_120s", {createDuration: "120s"}, {
 *     dependsOn: [serviceProjectFull],
 * });
 * const example2 = new gcp.apphub.ServiceProjectAttachment("example2", {
 *     serviceProjectAttachmentId: serviceProjectFull.projectId,
 *     serviceProject: serviceProjectFull.projectId,
 * }, {
 *     dependsOn: [wait120s],
 * });
 * ```
 *
 * ## Import
 *
 * ServiceProjectAttachment can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/global/serviceProjectAttachments/{{service_project_attachment_id}}`
 *
 * * `{{project}}/{{service_project_attachment_id}}`
 *
 * * `{{service_project_attachment_id}}`
 *
 * When using the `pulumi import` command, ServiceProjectAttachment can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:apphub/serviceProjectAttachment:ServiceProjectAttachment default projects/{{project}}/locations/global/serviceProjectAttachments/{{service_project_attachment_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:apphub/serviceProjectAttachment:ServiceProjectAttachment default {{project}}/{{service_project_attachment_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:apphub/serviceProjectAttachment:ServiceProjectAttachment default {{service_project_attachment_id}}
 * ```
 */
class ServiceProjectAttachment extends pulumi.CustomResource {
    /**
     * Get an existing ServiceProjectAttachment 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 ServiceProjectAttachment(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of ServiceProjectAttachment.  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'] === ServiceProjectAttachment.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["serviceProject"] = state?.serviceProject;
            resourceInputs["serviceProjectAttachmentId"] = state?.serviceProjectAttachmentId;
            resourceInputs["state"] = state?.state;
            resourceInputs["uid"] = state?.uid;
        }
        else {
            const args = argsOrState;
            if (args?.serviceProjectAttachmentId === undefined && !opts.urn) {
                throw new Error("Missing required property 'serviceProjectAttachmentId'");
            }
            resourceInputs["project"] = args?.project;
            resourceInputs["serviceProject"] = args?.serviceProject;
            resourceInputs["serviceProjectAttachmentId"] = args?.serviceProjectAttachmentId;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["uid"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ServiceProjectAttachment.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ServiceProjectAttachment = ServiceProjectAttachment;
/** @internal */
ServiceProjectAttachment.__pulumiType = 'gcp:apphub/serviceProjectAttachment:ServiceProjectAttachment';
//# sourceMappingURL=serviceProjectAttachment.js.map