"use strict";
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.LoginProfile = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage iam login profile
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const foo = new volcengine.iam.LoginProfile("foo", {
 *     loginAllowed: true,
 *     password: "",
 *     passwordResetRequired: true,
 *     safeAuthExemptDuration: 1,
 *     safeAuthExemptRequired: 1,
 *     safeAuthExemptUnit: 1,
 *     safeAuthFlag: true,
 *     safeAuthType: "phone",
 *     userName: "jonny-tt",
 * });
 * ```
 *
 * ## Import
 *
 * Login profile can be imported using the UserName, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:iam/loginProfile:LoginProfile default user_name
 * ```
 */
class LoginProfile extends pulumi.CustomResource {
    /**
     * Get an existing LoginProfile 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 LoginProfile(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of LoginProfile.  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'] === LoginProfile.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["createDate"] = state ? state.createDate : undefined;
            resourceInputs["lastLoginDate"] = state ? state.lastLoginDate : undefined;
            resourceInputs["lastLoginIp"] = state ? state.lastLoginIp : undefined;
            resourceInputs["lastResetPasswordTime"] = state ? state.lastResetPasswordTime : undefined;
            resourceInputs["loginAllowed"] = state ? state.loginAllowed : undefined;
            resourceInputs["loginLocked"] = state ? state.loginLocked : undefined;
            resourceInputs["password"] = state ? state.password : undefined;
            resourceInputs["passwordExpireAt"] = state ? state.passwordExpireAt : undefined;
            resourceInputs["passwordResetRequired"] = state ? state.passwordResetRequired : undefined;
            resourceInputs["safeAuthExemptDuration"] = state ? state.safeAuthExemptDuration : undefined;
            resourceInputs["safeAuthExemptRequired"] = state ? state.safeAuthExemptRequired : undefined;
            resourceInputs["safeAuthExemptUnit"] = state ? state.safeAuthExemptUnit : undefined;
            resourceInputs["safeAuthFlag"] = state ? state.safeAuthFlag : undefined;
            resourceInputs["safeAuthType"] = state ? state.safeAuthType : undefined;
            resourceInputs["updateDate"] = state ? state.updateDate : undefined;
            resourceInputs["userId"] = state ? state.userId : undefined;
            resourceInputs["userName"] = state ? state.userName : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.password === undefined) && !opts.urn) {
                throw new Error("Missing required property 'password'");
            }
            if ((!args || args.userName === undefined) && !opts.urn) {
                throw new Error("Missing required property 'userName'");
            }
            resourceInputs["loginAllowed"] = args ? args.loginAllowed : undefined;
            resourceInputs["password"] = (args === null || args === void 0 ? void 0 : args.password) ? pulumi.secret(args.password) : undefined;
            resourceInputs["passwordResetRequired"] = args ? args.passwordResetRequired : undefined;
            resourceInputs["safeAuthExemptDuration"] = args ? args.safeAuthExemptDuration : undefined;
            resourceInputs["safeAuthExemptRequired"] = args ? args.safeAuthExemptRequired : undefined;
            resourceInputs["safeAuthExemptUnit"] = args ? args.safeAuthExemptUnit : undefined;
            resourceInputs["safeAuthFlag"] = args ? args.safeAuthFlag : undefined;
            resourceInputs["safeAuthType"] = args ? args.safeAuthType : undefined;
            resourceInputs["userName"] = args ? args.userName : undefined;
            resourceInputs["createDate"] = undefined /*out*/;
            resourceInputs["lastLoginDate"] = undefined /*out*/;
            resourceInputs["lastLoginIp"] = undefined /*out*/;
            resourceInputs["lastResetPasswordTime"] = undefined /*out*/;
            resourceInputs["loginLocked"] = undefined /*out*/;
            resourceInputs["passwordExpireAt"] = undefined /*out*/;
            resourceInputs["updateDate"] = undefined /*out*/;
            resourceInputs["userId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["password"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(LoginProfile.__pulumiType, name, resourceInputs, opts);
    }
}
exports.LoginProfile = LoginProfile;
/** @internal */
LoginProfile.__pulumiType = 'volcengine:iam/loginProfile:LoginProfile';
//# sourceMappingURL=loginProfile.js.map