"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.WorkloadIdentityPoolNamespace = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Represents a namespace for a workload identity pool. Namespaces are used to segment identities
 * within the pool.
 *
 * To get more information about WorkloadIdentityPoolNamespace, see:
 *
 * * [API documentation](https://cloud.google.com/iam/docs/reference/rest/v1/projects.locations.workloadIdentityPools.namespaces)
 * * How-to Guides
 *     * [Configure managed workload identity authentication for Compute Engine](https://cloud.google.com/iam/docs/create-managed-workload-identities)
 *     * [Configure managed workload identity authentication for GKE](https://cloud.google.com/iam/docs/create-managed-workload-identities-gke)
 *
 * ## Example Usage
 *
 * ### Iam Workload Identity Pool Namespace Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const pool = new gcp.iam.WorkloadIdentityPool("pool", {
 *     workloadIdentityPoolId: "example-pool",
 *     mode: "TRUST_DOMAIN",
 * });
 * const example = new gcp.iam.WorkloadIdentityPoolNamespace("example", {
 *     workloadIdentityPoolId: pool.workloadIdentityPoolId,
 *     workloadIdentityPoolNamespaceId: "example-namespace",
 * });
 * ```
 * ### Iam Workload Identity Pool Namespace Full
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const pool = new gcp.iam.WorkloadIdentityPool("pool", {
 *     workloadIdentityPoolId: "example-pool",
 *     mode: "TRUST_DOMAIN",
 * });
 * const example = new gcp.iam.WorkloadIdentityPoolNamespace("example", {
 *     workloadIdentityPoolId: pool.workloadIdentityPoolId,
 *     workloadIdentityPoolNamespaceId: "example-namespace",
 *     description: "Example Namespace in a Workload Identity Pool",
 *     disabled: true,
 * });
 * ```
 *
 * ## Import
 *
 * WorkloadIdentityPoolNamespace can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/global/workloadIdentityPools/{{workload_identity_pool_id}}/namespaces/{{workload_identity_pool_namespace_id}}`
 *
 * * `{{project}}/{{workload_identity_pool_id}}/{{workload_identity_pool_namespace_id}}`
 *
 * * `{{workload_identity_pool_id}}/{{workload_identity_pool_namespace_id}}`
 *
 * When using the `pulumi import` command, WorkloadIdentityPoolNamespace can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:iam/workloadIdentityPoolNamespace:WorkloadIdentityPoolNamespace default projects/{{project}}/locations/global/workloadIdentityPools/{{workload_identity_pool_id}}/namespaces/{{workload_identity_pool_namespace_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:iam/workloadIdentityPoolNamespace:WorkloadIdentityPoolNamespace default {{project}}/{{workload_identity_pool_id}}/{{workload_identity_pool_namespace_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:iam/workloadIdentityPoolNamespace:WorkloadIdentityPoolNamespace default {{workload_identity_pool_id}}/{{workload_identity_pool_namespace_id}}
 * ```
 */
class WorkloadIdentityPoolNamespace extends pulumi.CustomResource {
    /**
     * Get an existing WorkloadIdentityPoolNamespace 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 WorkloadIdentityPoolNamespace(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of WorkloadIdentityPoolNamespace.  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'] === WorkloadIdentityPoolNamespace.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["description"] = state?.description;
            resourceInputs["disabled"] = state?.disabled;
            resourceInputs["name"] = state?.name;
            resourceInputs["ownerServices"] = state?.ownerServices;
            resourceInputs["project"] = state?.project;
            resourceInputs["state"] = state?.state;
            resourceInputs["workloadIdentityPoolId"] = state?.workloadIdentityPoolId;
            resourceInputs["workloadIdentityPoolNamespaceId"] = state?.workloadIdentityPoolNamespaceId;
        }
        else {
            const args = argsOrState;
            if (args?.workloadIdentityPoolId === undefined && !opts.urn) {
                throw new Error("Missing required property 'workloadIdentityPoolId'");
            }
            if (args?.workloadIdentityPoolNamespaceId === undefined && !opts.urn) {
                throw new Error("Missing required property 'workloadIdentityPoolNamespaceId'");
            }
            resourceInputs["description"] = args?.description;
            resourceInputs["disabled"] = args?.disabled;
            resourceInputs["project"] = args?.project;
            resourceInputs["workloadIdentityPoolId"] = args?.workloadIdentityPoolId;
            resourceInputs["workloadIdentityPoolNamespaceId"] = args?.workloadIdentityPoolNamespaceId;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["ownerServices"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(WorkloadIdentityPoolNamespace.__pulumiType, name, resourceInputs, opts);
    }
}
exports.WorkloadIdentityPoolNamespace = WorkloadIdentityPoolNamespace;
/** @internal */
WorkloadIdentityPoolNamespace.__pulumiType = 'gcp:iam/workloadIdentityPoolNamespace:WorkloadIdentityPoolNamespace';
//# sourceMappingURL=workloadIdentityPoolNamespace.js.map