"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! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.User = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * This resource provides the User resource in Oracle Cloud Infrastructure Identity service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/identity/latest/User
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/identity
 *
 * Creates a new user in your tenancy. For conceptual information about users, your tenancy, and other
 * IAM Service components, see [Overview of the IAM Service](https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/overview.htm).
 *
 * You must specify your tenancy's OCID as the compartment ID in the request object (remember that the
 * tenancy is simply the root compartment). Notice that IAM resources (users, groups, compartments, and
 * some policies) reside within the tenancy itself, unlike cloud resources such as compute instances,
 * which typically reside within compartments inside the tenancy. For information about OCIDs, see
 * [Resource Identifiers](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm).
 *
 * You must also specify a *name* for the user, which must be unique across all users in your tenancy
 * and cannot be changed. Allowed characters: No spaces. Only letters, numerals, hyphens, periods,
 * underscores, +, and @. If you specify a name that's already in use, you'll get a 409 error.
 * This name will be the user's login to the Console. You might want to pick a
 * name that your company's own identity system (e.g., Active Directory, LDAP, etc.) already uses.
 * If you delete a user and then create a new user with the same name, they'll be considered different
 * users because they have different OCIDs.
 *
 * You must also specify a *description* for the user (although it can be an empty string).
 * It does not have to be unique, and you can change it anytime with
 * [UpdateUser](https://docs.cloud.oracle.com/iaas/api/#/en/identity/20160918/User/UpdateUser). You can use the field to provide the user's
 * full name, a description, a nickname, or other information to generally identify the user.
 * A new user has no permissions until you place the user in one or more groups (see
 * [AddUserToGroup](https://docs.cloud.oracle.com/iaas/api/#/en/identity/20160918/UserGroupMembership/AddUserToGroup)). If the user needs to
 * access the Console, you need to provide the user a password (see
 * [CreateOrResetUIPassword](https://docs.cloud.oracle.com/iaas/api/#/en/identity/20160918/UIPassword/CreateOrResetUIPassword)).
 * If the user needs to access the Oracle Cloud Infrastructure REST API, you need to upload a
 * public API signing key for that user (see
 * [Required Keys and OCIDs](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/apisigningkey.htm) and also
 * [UploadApiKey](https://docs.cloud.oracle.com/iaas/api/#/en/identity/20160918/ApiKey/UploadApiKey)).
 *
 * **Important:** Make sure to inform the new user which compartment(s) they have access to.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as oci from "@pulumi/oci";
 *
 * const testUser = new oci.identity.User("test_user", {
 *     compartmentId: tenancyOcid,
 *     description: userDescription,
 *     name: userName,
 *     definedTags: {
 *         "Operations.CostCenter": "42",
 *     },
 *     email: userEmail,
 *     freeformTags: {
 *         Department: "Finance",
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * Users can be imported using the `id`, e.g.
 *
 * ```sh
 * $ pulumi import oci:Identity/user:User test_user "id"
 * ```
 */
class User extends pulumi.CustomResource {
    /**
     * Get an existing User 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 User(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'oci:Identity/user:User';
    /**
     * Returns true if the given object is an instance of User.  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'] === User.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["capabilities"] = state?.capabilities;
            resourceInputs["compartmentId"] = state?.compartmentId;
            resourceInputs["dbUserName"] = state?.dbUserName;
            resourceInputs["definedTags"] = state?.definedTags;
            resourceInputs["description"] = state?.description;
            resourceInputs["email"] = state?.email;
            resourceInputs["emailVerified"] = state?.emailVerified;
            resourceInputs["externalIdentifier"] = state?.externalIdentifier;
            resourceInputs["freeformTags"] = state?.freeformTags;
            resourceInputs["identityProviderId"] = state?.identityProviderId;
            resourceInputs["inactiveState"] = state?.inactiveState;
            resourceInputs["lastSuccessfulLoginTime"] = state?.lastSuccessfulLoginTime;
            resourceInputs["name"] = state?.name;
            resourceInputs["previousSuccessfulLoginTime"] = state?.previousSuccessfulLoginTime;
            resourceInputs["state"] = state?.state;
            resourceInputs["timeCreated"] = state?.timeCreated;
        }
        else {
            const args = argsOrState;
            if (args?.description === undefined && !opts.urn) {
                throw new Error("Missing required property 'description'");
            }
            resourceInputs["compartmentId"] = args?.compartmentId;
            resourceInputs["definedTags"] = args?.definedTags;
            resourceInputs["description"] = args?.description;
            resourceInputs["email"] = args?.email;
            resourceInputs["freeformTags"] = args?.freeformTags;
            resourceInputs["name"] = args?.name;
            resourceInputs["capabilities"] = undefined /*out*/;
            resourceInputs["dbUserName"] = undefined /*out*/;
            resourceInputs["emailVerified"] = undefined /*out*/;
            resourceInputs["externalIdentifier"] = undefined /*out*/;
            resourceInputs["identityProviderId"] = undefined /*out*/;
            resourceInputs["inactiveState"] = undefined /*out*/;
            resourceInputs["lastSuccessfulLoginTime"] = undefined /*out*/;
            resourceInputs["previousSuccessfulLoginTime"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["timeCreated"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(User.__pulumiType, name, resourceInputs, opts);
    }
}
exports.User = User;
//# sourceMappingURL=user.js.map