// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.gcp.iam;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import com.pulumi.gcp.Utilities;
import com.pulumi.gcp.iam.WorkforcePoolArgs;
import com.pulumi.gcp.iam.inputs.WorkforcePoolState;
import java.lang.Boolean;
import java.lang.String;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * 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)
 * 
 * &gt; **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
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.iam.WorkforcePool;
 * import com.pulumi.gcp.iam.WorkforcePoolArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * 
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 * 
 *     public static void stack(Context ctx) {
 *         var example = new WorkforcePool(&#34;example&#34;, WorkforcePoolArgs.builder()        
 *             .location(&#34;global&#34;)
 *             .parent(&#34;organizations/123456789&#34;)
 *             .workforcePoolId(&#34;example-pool&#34;)
 *             .build());
 * 
 *     }
 * }
 * ```
 * ### Iam Workforce Pool Full
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.iam.WorkforcePool;
 * import com.pulumi.gcp.iam.WorkforcePoolArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * 
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 * 
 *     public static void stack(Context ctx) {
 *         var example = new WorkforcePool(&#34;example&#34;, WorkforcePoolArgs.builder()        
 *             .description(&#34;A sample workforce pool.&#34;)
 *             .disabled(false)
 *             .displayName(&#34;Display name&#34;)
 *             .location(&#34;global&#34;)
 *             .parent(&#34;organizations/123456789&#34;)
 *             .sessionDuration(&#34;7200s&#34;)
 *             .workforcePoolId(&#34;example-pool&#34;)
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * WorkforcePool can be imported using any of these accepted formats
 * 
 * ```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}}
 * ```
 * 
 */
@ResourceType(type="gcp:iam/workforcePool:WorkforcePool")
public class WorkforcePool extends com.pulumi.resources.CustomResource {
    /**
     * A user-specified description of the pool. Cannot exceed 256 characters.
     * 
     */
    @Export(name="description", type=String.class, parameters={})
    private Output</* @Nullable */ String> description;

    /**
     * @return A user-specified description of the pool. Cannot exceed 256 characters.
     * 
     */
    public Output<Optional<String>> description() {
        return Codegen.optional(this.description);
    }
    /**
     * Whether the pool is disabled. You cannot use a disabled pool to exchange tokens,
     * or use existing tokens to access resources. If the pool is re-enabled, existing tokens grant access again.
     * 
     */
    @Export(name="disabled", type=Boolean.class, parameters={})
    private Output</* @Nullable */ Boolean> disabled;

    /**
     * @return Whether the pool is disabled. You cannot use a disabled pool to exchange tokens,
     * or use existing tokens to access resources. If the pool is re-enabled, existing tokens grant access again.
     * 
     */
    public Output<Optional<Boolean>> disabled() {
        return Codegen.optional(this.disabled);
    }
    /**
     * A user-specified display name of the pool in Google Cloud Console. Cannot exceed 32 characters.
     * 
     */
    @Export(name="displayName", type=String.class, parameters={})
    private Output</* @Nullable */ String> displayName;

    /**
     * @return A user-specified display name of the pool in Google Cloud Console. Cannot exceed 32 characters.
     * 
     */
    public Output<Optional<String>> displayName() {
        return Codegen.optional(this.displayName);
    }
    /**
     * The location for the resource.
     * 
     */
    @Export(name="location", type=String.class, parameters={})
    private Output<String> location;

    /**
     * @return The location for the resource.
     * 
     */
    public Output<String> location() {
        return this.location;
    }
    /**
     * Output only. The resource name of the pool.
     * Format: `locations/{location}/workforcePools/{workforcePoolId}`
     * 
     */
    @Export(name="name", type=String.class, parameters={})
    private Output<String> name;

    /**
     * @return Output only. The resource name of the pool.
     * Format: `locations/{location}/workforcePools/{workforcePoolId}`
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * Immutable. The resource name of the parent. Format: `organizations/{org-id}`.
     * 
     * ***
     * 
     */
    @Export(name="parent", type=String.class, parameters={})
    private Output<String> parent;

    /**
     * @return Immutable. The resource name of the parent. Format: `organizations/{org-id}`.
     * 
     * ***
     * 
     */
    public Output<String> parent() {
        return this.parent;
    }
    /**
     * Duration that the Google Cloud access tokens, console sign-in sessions,
     * and `gcloud` sign-in sessions from this pool are valid.
     * Must be greater than 15 minutes (900s) and less than 12 hours (43200s).
     * If `sessionDuration` is not configured, minted credentials have a default duration of one hour (3600s).
     * A duration in seconds with up to nine fractional digits, ending with &#39;`s`&#39;. Example: &#34;`3.5s`&#34;.
     * 
     */
    @Export(name="sessionDuration", type=String.class, parameters={})
    private Output</* @Nullable */ String> sessionDuration;

    /**
     * @return Duration that the Google Cloud access tokens, console sign-in sessions,
     * and `gcloud` sign-in sessions from this pool are valid.
     * Must be greater than 15 minutes (900s) and less than 12 hours (43200s).
     * If `sessionDuration` is not configured, minted credentials have a default duration of one hour (3600s).
     * A duration in seconds with up to nine fractional digits, ending with &#39;`s`&#39;. Example: &#34;`3.5s`&#34;.
     * 
     */
    public Output<Optional<String>> sessionDuration() {
        return Codegen.optional(this.sessionDuration);
    }
    /**
     * Output only. The state of the pool.
     * * STATE_UNSPECIFIED: State unspecified.
     * * ACTIVE: The pool is active, and may be used in Google Cloud policies.
     * * DELETED: The pool is soft-deleted. Soft-deleted pools are permanently deleted
     *   after approximately 30 days. You can restore a soft-deleted pool using
     *   [workforcePools.undelete](https://cloud.google.com/iam/docs/reference/rest/v1/locations.workforcePools/undelete#google.iam.admin.v1.WorkforcePools.UndeleteWorkforcePool).
     *   You cannot reuse the ID of a soft-deleted pool until it is permanently deleted.
     *   While a pool is deleted, you cannot use it to exchange tokens, or use
     *   existing tokens to access resources. If the pool is undeleted, existing
     *   tokens grant access again.
     * 
     */
    @Export(name="state", type=String.class, parameters={})
    private Output<String> state;

    /**
     * @return Output only. The state of the pool.
     * * STATE_UNSPECIFIED: State unspecified.
     * * ACTIVE: The pool is active, and may be used in Google Cloud policies.
     * * DELETED: The pool is soft-deleted. Soft-deleted pools are permanently deleted
     *   after approximately 30 days. You can restore a soft-deleted pool using
     *   [workforcePools.undelete](https://cloud.google.com/iam/docs/reference/rest/v1/locations.workforcePools/undelete#google.iam.admin.v1.WorkforcePools.UndeleteWorkforcePool).
     *   You cannot reuse the ID of a soft-deleted pool until it is permanently deleted.
     *   While a pool is deleted, you cannot use it to exchange tokens, or use
     *   existing tokens to access resources. If the pool is undeleted, existing
     *   tokens grant access again.
     * 
     */
    public Output<String> state() {
        return this.state;
    }
    /**
     * The name of the pool. The ID must be a globally unique string of 6 to 63 lowercase letters,
     * digits, or hyphens. It must start with a letter, and cannot have a trailing hyphen.
     * The prefix `gcp-` is reserved for use by Google, and may not be specified.
     * 
     */
    @Export(name="workforcePoolId", type=String.class, parameters={})
    private Output<String> workforcePoolId;

    /**
     * @return The name of the pool. The ID must be a globally unique string of 6 to 63 lowercase letters,
     * digits, or hyphens. It must start with a letter, and cannot have a trailing hyphen.
     * The prefix `gcp-` is reserved for use by Google, and may not be specified.
     * 
     */
    public Output<String> workforcePoolId() {
        return this.workforcePoolId;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public WorkforcePool(String name) {
        this(name, WorkforcePoolArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public WorkforcePool(String name, WorkforcePoolArgs args) {
        this(name, args, null);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param options A bag of options that control this resource's behavior.
     */
    public WorkforcePool(String name, WorkforcePoolArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("gcp:iam/workforcePool:WorkforcePool", name, args == null ? WorkforcePoolArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private WorkforcePool(String name, Output<String> id, @Nullable WorkforcePoolState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("gcp:iam/workforcePool:WorkforcePool", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> id) {
        var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
            .version(Utilities.getVersion())
            .build();
        return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
    }

    /**
     * Get an existing Host 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
     * @param options Optional settings to control the behavior of the CustomResource.
     */
    public static WorkforcePool get(String name, Output<String> id, @Nullable WorkforcePoolState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new WorkforcePool(name, id, state, options);
    }
}
