"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.Tenant = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * The Tenant resource represents the service producer's view of a service instance created for a consumer. It enables the association between the service producer's managed resources and the end consumer.
 *
 * ## Example Usage
 *
 * ### Saas Runtime Tenant Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const exampleSaas = new gcp.saasruntime.SaaS("example_saas", {
 *     saasId: "example-saas",
 *     location: "global",
 *     locations: [{
 *         name: "us-central1",
 *     }],
 * });
 * const example = new gcp.saasruntime.Tenant("example", {
 *     location: "global",
 *     tenantId: "example-tenant",
 *     saas: exampleSaas.id,
 *     consumerResource: "//compute.googleapis.com/projects/example-project/zones/us-central1-a/instances/example-instance",
 * });
 * ```
 *
 * ## Import
 *
 * Tenant can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/tenants/{{tenant_id}}`
 *
 * * `{{project}}/{{location}}/{{tenant_id}}`
 *
 * * `{{location}}/{{tenant_id}}`
 *
 * When using the `pulumi import` command, Tenant can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:saasruntime/tenant:Tenant default projects/{{project}}/locations/{{location}}/tenants/{{tenant_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:saasruntime/tenant:Tenant default {{project}}/{{location}}/{{tenant_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:saasruntime/tenant:Tenant default {{location}}/{{tenant_id}}
 * ```
 */
class Tenant extends pulumi.CustomResource {
    /**
     * Get an existing Tenant 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 Tenant(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Tenant.  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'] === Tenant.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["annotations"] = state?.annotations;
            resourceInputs["consumerResource"] = state?.consumerResource;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["effectiveAnnotations"] = state?.effectiveAnnotations;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["saas"] = state?.saas;
            resourceInputs["tenantId"] = state?.tenantId;
            resourceInputs["uid"] = state?.uid;
            resourceInputs["updateTime"] = state?.updateTime;
        }
        else {
            const args = argsOrState;
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.saas === undefined && !opts.urn) {
                throw new Error("Missing required property 'saas'");
            }
            if (args?.tenantId === undefined && !opts.urn) {
                throw new Error("Missing required property 'tenantId'");
            }
            resourceInputs["annotations"] = args?.annotations;
            resourceInputs["consumerResource"] = args?.consumerResource;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["location"] = args?.location;
            resourceInputs["project"] = args?.project;
            resourceInputs["saas"] = args?.saas;
            resourceInputs["tenantId"] = args?.tenantId;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["effectiveAnnotations"] = undefined /*out*/;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
            resourceInputs["uid"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(Tenant.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Tenant = Tenant;
/** @internal */
Tenant.__pulumiType = 'gcp:saasruntime/tenant:Tenant';
//# sourceMappingURL=tenant.js.map