"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.WorkforcePool = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Represents a collection of external workforces. Provides namespaces for
 * federated users that can be referenced in IAM policies.
 *
 * To get more information about WorkforcePool, see:
 *
 * * [API documentation](https://cloud.google.com/iam/docs/reference/rest/v1/locations.workforcePools)
 * * How-to Guides
 *     * [Manage pools](https://cloud.google.com/iam/docs/manage-workforce-identity-pools-providers#manage_pools)
 *
 * > **Note:** Ask your Google Cloud account team to request access to workforce identity federation for
 * your billing/quota project. The account team notifies you when the project is granted access.
 *
 * ## Example Usage
 *
 * ### Iam Workforce Pool Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const example = new gcp.iam.WorkforcePool("example", {
 *     workforcePoolId: "example-pool",
 *     parent: "organizations/123456789",
 *     location: "global",
 * });
 * ```
 * ### Iam Workforce Pool Full
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const example = new gcp.iam.WorkforcePool("example", {
 *     workforcePoolId: "example-pool",
 *     parent: "organizations/123456789",
 *     location: "global",
 *     displayName: "Display name",
 *     description: "A sample workforce pool.",
 *     disabled: false,
 *     sessionDuration: "7200s",
 *     accessRestrictions: {
 *         allowedServices: [{
 *             domain: "backstory.chronicle.security",
 *         }],
 *         disableProgrammaticSignin: false,
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * WorkforcePool can be imported using any of these accepted formats:
 *
 * * `locations/{{location}}/workforcePools/{{workforce_pool_id}}`
 *
 * * `{{location}}/{{workforce_pool_id}}`
 *
 * When using the `pulumi import` command, WorkforcePool can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:iam/workforcePool:WorkforcePool default locations/{{location}}/workforcePools/{{workforce_pool_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:iam/workforcePool:WorkforcePool default {{location}}/{{workforce_pool_id}}
 * ```
 */
class WorkforcePool extends pulumi.CustomResource {
    /**
     * Get an existing WorkforcePool 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 WorkforcePool(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of WorkforcePool.  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'] === WorkforcePool.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["accessRestrictions"] = state?.accessRestrictions;
            resourceInputs["description"] = state?.description;
            resourceInputs["disabled"] = state?.disabled;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["parent"] = state?.parent;
            resourceInputs["sessionDuration"] = state?.sessionDuration;
            resourceInputs["state"] = state?.state;
            resourceInputs["workforcePoolId"] = state?.workforcePoolId;
        }
        else {
            const args = argsOrState;
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.parent === undefined && !opts.urn) {
                throw new Error("Missing required property 'parent'");
            }
            if (args?.workforcePoolId === undefined && !opts.urn) {
                throw new Error("Missing required property 'workforcePoolId'");
            }
            resourceInputs["accessRestrictions"] = args?.accessRestrictions;
            resourceInputs["description"] = args?.description;
            resourceInputs["disabled"] = args?.disabled;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["location"] = args?.location;
            resourceInputs["parent"] = args?.parent;
            resourceInputs["sessionDuration"] = args?.sessionDuration;
            resourceInputs["workforcePoolId"] = args?.workforcePoolId;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(WorkforcePool.__pulumiType, name, resourceInputs, opts);
    }
}
exports.WorkforcePool = WorkforcePool;
/** @internal */
WorkforcePool.__pulumiType = 'gcp:iam/workforcePool:WorkforcePool';
//# sourceMappingURL=workforcePool.js.map