"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.UnitKind = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A UnitKind serves as a template or type definition for a group of Units. Units that belong to the same UnitKind are managed together, follow the same release model, and are typically updated together through rollouts.
 *
 * ## Example Usage
 *
 * ### Saas Runtime Unit Kind 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: "us-east1",
 *     locations: [{
 *         name: "us-east1",
 *     }],
 * });
 * const clusterUnitKind = new gcp.saasruntime.UnitKind("cluster_unit_kind", {
 *     location: "us-east1",
 *     unitKindId: "cluster-unitkind",
 *     saas: exampleSaas.id,
 *     defaultRelease: "projects/my-project-name/locations/us-east1/releases/example-release",
 * });
 * const example = new gcp.saasruntime.UnitKind("example", {
 *     location: "us-east1",
 *     unitKindId: "app-unitkind",
 *     saas: exampleSaas.id,
 *     dependencies: [{
 *         unitKind: clusterUnitKind.id,
 *         alias: "cluster",
 *     }],
 * });
 * const exampleRelease = new gcp.saasruntime.Release("example_release", {
 *     location: "us-east1",
 *     releaseId: "example-release",
 *     unitKind: clusterUnitKind.id,
 *     blueprint: {
 *         "package": "us-central1-docker.pkg.dev/ci-test-project-188019/test-repo/tf-test-easysaas-alpha-image@sha256:7992fdbaeaf998ecd31a7f937bb26e38a781ecf49b24857a6176c1e9bfc299ee",
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * UnitKind can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/unitKinds/{{unit_kind_id}}`
 *
 * * `{{project}}/{{location}}/{{unit_kind_id}}`
 *
 * * `{{location}}/{{unit_kind_id}}`
 *
 * When using the `pulumi import` command, UnitKind can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:saasruntime/unitKind:UnitKind default projects/{{project}}/locations/{{location}}/unitKinds/{{unit_kind_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:saasruntime/unitKind:UnitKind default {{project}}/{{location}}/{{unit_kind_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:saasruntime/unitKind:UnitKind default {{location}}/{{unit_kind_id}}
 * ```
 */
class UnitKind extends pulumi.CustomResource {
    /**
     * Get an existing UnitKind 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 UnitKind(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of UnitKind.  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'] === UnitKind.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["annotations"] = state?.annotations;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["defaultRelease"] = state?.defaultRelease;
            resourceInputs["dependencies"] = state?.dependencies;
            resourceInputs["effectiveAnnotations"] = state?.effectiveAnnotations;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["etag"] = state?.etag;
            resourceInputs["inputVariableMappings"] = state?.inputVariableMappings;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["outputVariableMappings"] = state?.outputVariableMappings;
            resourceInputs["project"] = state?.project;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["saas"] = state?.saas;
            resourceInputs["uid"] = state?.uid;
            resourceInputs["unitKindId"] = state?.unitKindId;
            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?.unitKindId === undefined && !opts.urn) {
                throw new Error("Missing required property 'unitKindId'");
            }
            resourceInputs["annotations"] = args?.annotations;
            resourceInputs["defaultRelease"] = args?.defaultRelease;
            resourceInputs["dependencies"] = args?.dependencies;
            resourceInputs["inputVariableMappings"] = args?.inputVariableMappings;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["location"] = args?.location;
            resourceInputs["outputVariableMappings"] = args?.outputVariableMappings;
            resourceInputs["project"] = args?.project;
            resourceInputs["saas"] = args?.saas;
            resourceInputs["unitKindId"] = args?.unitKindId;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["effectiveAnnotations"] = undefined /*out*/;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["etag"] = 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(UnitKind.__pulumiType, name, resourceInputs, opts);
    }
}
exports.UnitKind = UnitKind;
/** @internal */
UnitKind.__pulumiType = 'gcp:saasruntime/unitKind:UnitKind';
//# sourceMappingURL=unitKind.js.map