"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.DomainsPasswordPolicy = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * This resource provides the Password Policy resource in Oracle Cloud Infrastructure Identity Domains service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/identity-domains/latest/PasswordPolicy
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/identity_domains
 *
 * Create a password policy.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as oci from "@pulumi/oci";
 *
 * const testPasswordPolicy = new oci.identity.DomainsPasswordPolicy("test_password_policy", {
 *     idcsEndpoint: testDomain.url,
 *     name: passwordPolicyName,
 *     schemas: ["urn:ietf:params:scim:schemas:oracle:idcs:PasswordPolicy"],
 *     allowedChars: passwordPolicyAllowedChars,
 *     attributeSets: [],
 *     attributes: "",
 *     authorization: passwordPolicyAuthorization,
 *     description: passwordPolicyDescription,
 *     dictionaryDelimiter: passwordPolicyDictionaryDelimiter,
 *     dictionaryLocation: passwordPolicyDictionaryLocation,
 *     dictionaryWordDisallowed: passwordPolicyDictionaryWordDisallowed === "true",
 *     disallowedChars: passwordPolicyDisallowedChars,
 *     disallowedSubstrings: passwordPolicyDisallowedSubstrings,
 *     disallowedUserAttributeValues: passwordPolicyDisallowedUserAttributeValues,
 *     distinctCharacters: Number(passwordPolicyDistinctCharacters),
 *     externalId: "externalId",
 *     firstNameDisallowed: passwordPolicyFirstNameDisallowed === "true",
 *     forcePasswordReset: passwordPolicyForcePasswordReset === "true",
 *     groups: [{
 *         value: testGroup.id,
 *     }],
 *     id: passwordPolicyId,
 *     lastNameDisallowed: passwordPolicyLastNameDisallowed === "true",
 *     lockoutDuration: Number(passwordPolicyLockoutDuration),
 *     maxIncorrectAttempts: Number(passwordPolicyMaxIncorrectAttempts),
 *     maxLength: Number(passwordPolicyMaxLength),
 *     maxRepeatedChars: Number(passwordPolicyMaxRepeatedChars),
 *     maxSpecialChars: Number(passwordPolicyMaxSpecialChars),
 *     minAlphaNumerals: Number(passwordPolicyMinAlphaNumerals),
 *     minAlphas: Number(passwordPolicyMinAlphas),
 *     minLength: Number(passwordPolicyMinLength),
 *     minLowerCase: Number(passwordPolicyMinLowerCase),
 *     minNumerals: Number(passwordPolicyMinNumerals),
 *     minPasswordAge: Number(passwordPolicyMinPasswordAge),
 *     minSpecialChars: Number(passwordPolicyMinSpecialChars),
 *     minUniqueChars: Number(passwordPolicyMinUniqueChars),
 *     minUpperCase: Number(passwordPolicyMinUpperCase),
 *     numPasswordsInHistory: Number(passwordPolicyNumPasswordsInHistory),
 *     ocid: passwordPolicyOcid,
 *     passwordExpireWarning: Number(passwordPolicyPasswordExpireWarning),
 *     passwordExpiresAfter: Number(passwordPolicyPasswordExpiresAfter),
 *     passwordStrength: passwordPolicyPasswordStrength,
 *     priority: Number(passwordPolicyPriority),
 *     requiredChars: passwordPolicyRequiredChars,
 *     resourceTypeSchemaVersion: passwordPolicyResourceTypeSchemaVersion,
 *     startsWithAlphabet: passwordPolicyStartsWithAlphabet === "true",
 *     tags: [{
 *         key: passwordPolicyTagsKey,
 *         value: passwordPolicyTagsValue,
 *     }],
 *     userNameDisallowed: passwordPolicyUserNameDisallowed === "true",
 * });
 * ```
 *
 * ## Import
 *
 * PasswordPolicies can be imported using the `id`, e.g.
 *
 * ```sh
 * $ pulumi import oci:Identity/domainsPasswordPolicy:DomainsPasswordPolicy test_password_policy "idcsEndpoint/{idcsEndpoint}/passwordPolicies/{passwordPolicyId}"
 * ```
 */
class DomainsPasswordPolicy extends pulumi.CustomResource {
    /**
     * Get an existing DomainsPasswordPolicy 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 DomainsPasswordPolicy(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'oci:Identity/domainsPasswordPolicy:DomainsPasswordPolicy';
    /**
     * Returns true if the given object is an instance of DomainsPasswordPolicy.  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'] === DomainsPasswordPolicy.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["allowedChars"] = state?.allowedChars;
            resourceInputs["attributeSets"] = state?.attributeSets;
            resourceInputs["attributes"] = state?.attributes;
            resourceInputs["authorization"] = state?.authorization;
            resourceInputs["compartmentOcid"] = state?.compartmentOcid;
            resourceInputs["configuredPasswordPolicyRules"] = state?.configuredPasswordPolicyRules;
            resourceInputs["deleteInProgress"] = state?.deleteInProgress;
            resourceInputs["description"] = state?.description;
            resourceInputs["dictionaryDelimiter"] = state?.dictionaryDelimiter;
            resourceInputs["dictionaryLocation"] = state?.dictionaryLocation;
            resourceInputs["dictionaryWordDisallowed"] = state?.dictionaryWordDisallowed;
            resourceInputs["disallowedChars"] = state?.disallowedChars;
            resourceInputs["disallowedSubstrings"] = state?.disallowedSubstrings;
            resourceInputs["disallowedUserAttributeValues"] = state?.disallowedUserAttributeValues;
            resourceInputs["distinctCharacters"] = state?.distinctCharacters;
            resourceInputs["domainOcid"] = state?.domainOcid;
            resourceInputs["externalId"] = state?.externalId;
            resourceInputs["firstNameDisallowed"] = state?.firstNameDisallowed;
            resourceInputs["forcePasswordReset"] = state?.forcePasswordReset;
            resourceInputs["groups"] = state?.groups;
            resourceInputs["idcsCreatedBies"] = state?.idcsCreatedBies;
            resourceInputs["idcsEndpoint"] = state?.idcsEndpoint;
            resourceInputs["idcsLastModifiedBies"] = state?.idcsLastModifiedBies;
            resourceInputs["idcsLastUpgradedInRelease"] = state?.idcsLastUpgradedInRelease;
            resourceInputs["idcsPreventedOperations"] = state?.idcsPreventedOperations;
            resourceInputs["lastNameDisallowed"] = state?.lastNameDisallowed;
            resourceInputs["lockoutDuration"] = state?.lockoutDuration;
            resourceInputs["maxIncorrectAttempts"] = state?.maxIncorrectAttempts;
            resourceInputs["maxLength"] = state?.maxLength;
            resourceInputs["maxRepeatedChars"] = state?.maxRepeatedChars;
            resourceInputs["maxSpecialChars"] = state?.maxSpecialChars;
            resourceInputs["metas"] = state?.metas;
            resourceInputs["minAlphaNumerals"] = state?.minAlphaNumerals;
            resourceInputs["minAlphas"] = state?.minAlphas;
            resourceInputs["minLength"] = state?.minLength;
            resourceInputs["minLowerCase"] = state?.minLowerCase;
            resourceInputs["minNumerals"] = state?.minNumerals;
            resourceInputs["minPasswordAge"] = state?.minPasswordAge;
            resourceInputs["minSpecialChars"] = state?.minSpecialChars;
            resourceInputs["minUniqueChars"] = state?.minUniqueChars;
            resourceInputs["minUpperCase"] = state?.minUpperCase;
            resourceInputs["name"] = state?.name;
            resourceInputs["numPasswordsInHistory"] = state?.numPasswordsInHistory;
            resourceInputs["ocid"] = state?.ocid;
            resourceInputs["passwordExpireWarning"] = state?.passwordExpireWarning;
            resourceInputs["passwordExpiresAfter"] = state?.passwordExpiresAfter;
            resourceInputs["passwordStrength"] = state?.passwordStrength;
            resourceInputs["priority"] = state?.priority;
            resourceInputs["requiredChars"] = state?.requiredChars;
            resourceInputs["resourceTypeSchemaVersion"] = state?.resourceTypeSchemaVersion;
            resourceInputs["schemas"] = state?.schemas;
            resourceInputs["startsWithAlphabet"] = state?.startsWithAlphabet;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["tenancyOcid"] = state?.tenancyOcid;
            resourceInputs["userNameDisallowed"] = state?.userNameDisallowed;
        }
        else {
            const args = argsOrState;
            if (args?.idcsEndpoint === undefined && !opts.urn) {
                throw new Error("Missing required property 'idcsEndpoint'");
            }
            if (args?.schemas === undefined && !opts.urn) {
                throw new Error("Missing required property 'schemas'");
            }
            resourceInputs["allowedChars"] = args?.allowedChars;
            resourceInputs["attributeSets"] = args?.attributeSets;
            resourceInputs["attributes"] = args?.attributes;
            resourceInputs["authorization"] = args?.authorization;
            resourceInputs["description"] = args?.description;
            resourceInputs["dictionaryDelimiter"] = args?.dictionaryDelimiter;
            resourceInputs["dictionaryLocation"] = args?.dictionaryLocation;
            resourceInputs["dictionaryWordDisallowed"] = args?.dictionaryWordDisallowed;
            resourceInputs["disallowedChars"] = args?.disallowedChars;
            resourceInputs["disallowedSubstrings"] = args?.disallowedSubstrings;
            resourceInputs["disallowedUserAttributeValues"] = args?.disallowedUserAttributeValues;
            resourceInputs["distinctCharacters"] = args?.distinctCharacters;
            resourceInputs["externalId"] = args?.externalId;
            resourceInputs["firstNameDisallowed"] = args?.firstNameDisallowed;
            resourceInputs["forcePasswordReset"] = args?.forcePasswordReset;
            resourceInputs["groups"] = args?.groups;
            resourceInputs["idcsEndpoint"] = args?.idcsEndpoint;
            resourceInputs["lastNameDisallowed"] = args?.lastNameDisallowed;
            resourceInputs["lockoutDuration"] = args?.lockoutDuration;
            resourceInputs["maxIncorrectAttempts"] = args?.maxIncorrectAttempts;
            resourceInputs["maxLength"] = args?.maxLength;
            resourceInputs["maxRepeatedChars"] = args?.maxRepeatedChars;
            resourceInputs["maxSpecialChars"] = args?.maxSpecialChars;
            resourceInputs["minAlphaNumerals"] = args?.minAlphaNumerals;
            resourceInputs["minAlphas"] = args?.minAlphas;
            resourceInputs["minLength"] = args?.minLength;
            resourceInputs["minLowerCase"] = args?.minLowerCase;
            resourceInputs["minNumerals"] = args?.minNumerals;
            resourceInputs["minPasswordAge"] = args?.minPasswordAge;
            resourceInputs["minSpecialChars"] = args?.minSpecialChars;
            resourceInputs["minUniqueChars"] = args?.minUniqueChars;
            resourceInputs["minUpperCase"] = args?.minUpperCase;
            resourceInputs["name"] = args?.name;
            resourceInputs["numPasswordsInHistory"] = args?.numPasswordsInHistory;
            resourceInputs["ocid"] = args?.ocid;
            resourceInputs["passwordExpireWarning"] = args?.passwordExpireWarning;
            resourceInputs["passwordExpiresAfter"] = args?.passwordExpiresAfter;
            resourceInputs["passwordStrength"] = args?.passwordStrength ? pulumi.secret(args.passwordStrength) : undefined;
            resourceInputs["priority"] = args?.priority;
            resourceInputs["requiredChars"] = args?.requiredChars;
            resourceInputs["resourceTypeSchemaVersion"] = args?.resourceTypeSchemaVersion;
            resourceInputs["schemas"] = args?.schemas;
            resourceInputs["startsWithAlphabet"] = args?.startsWithAlphabet;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["userNameDisallowed"] = args?.userNameDisallowed;
            resourceInputs["compartmentOcid"] = undefined /*out*/;
            resourceInputs["configuredPasswordPolicyRules"] = undefined /*out*/;
            resourceInputs["deleteInProgress"] = undefined /*out*/;
            resourceInputs["domainOcid"] = undefined /*out*/;
            resourceInputs["idcsCreatedBies"] = undefined /*out*/;
            resourceInputs["idcsLastModifiedBies"] = undefined /*out*/;
            resourceInputs["idcsLastUpgradedInRelease"] = undefined /*out*/;
            resourceInputs["idcsPreventedOperations"] = undefined /*out*/;
            resourceInputs["metas"] = undefined /*out*/;
            resourceInputs["tenancyOcid"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["passwordStrength"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(DomainsPasswordPolicy.__pulumiType, name, resourceInputs, opts);
    }
}
exports.DomainsPasswordPolicy = DomainsPasswordPolicy;
//# sourceMappingURL=domainsPasswordPolicy.js.map