/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.6.4
 * Contact: hello@goauthentik.io
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import { mapValues } from '../runtime';
/**
 * Password Policy Serializer
 * @export
 * @interface PasswordPolicyRequest
 */
export interface PasswordPolicyRequest {
    /**
     * 
     * @type {string}
     * @memberof PasswordPolicyRequest
     */
    name: string;
    /**
     * When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged.
     * @type {boolean}
     * @memberof PasswordPolicyRequest
     */
    executionLogging?: boolean;
    /**
     * Field key to check, field keys defined in Prompt stages are available.
     * @type {string}
     * @memberof PasswordPolicyRequest
     */
    passwordField?: string;
    /**
     * 
     * @type {number}
     * @memberof PasswordPolicyRequest
     */
    amountDigits?: number;
    /**
     * 
     * @type {number}
     * @memberof PasswordPolicyRequest
     */
    amountUppercase?: number;
    /**
     * 
     * @type {number}
     * @memberof PasswordPolicyRequest
     */
    amountLowercase?: number;
    /**
     * 
     * @type {number}
     * @memberof PasswordPolicyRequest
     */
    amountSymbols?: number;
    /**
     * 
     * @type {number}
     * @memberof PasswordPolicyRequest
     */
    lengthMin?: number;
    /**
     * 
     * @type {string}
     * @memberof PasswordPolicyRequest
     */
    symbolCharset?: string;
    /**
     * 
     * @type {string}
     * @memberof PasswordPolicyRequest
     */
    errorMessage?: string;
    /**
     * 
     * @type {boolean}
     * @memberof PasswordPolicyRequest
     */
    checkStaticRules?: boolean;
    /**
     * 
     * @type {boolean}
     * @memberof PasswordPolicyRequest
     */
    checkHaveIBeenPwned?: boolean;
    /**
     * 
     * @type {boolean}
     * @memberof PasswordPolicyRequest
     */
    checkZxcvbn?: boolean;
    /**
     * How many times the password hash is allowed to be on haveibeenpwned
     * @type {number}
     * @memberof PasswordPolicyRequest
     */
    hibpAllowedCount?: number;
    /**
     * If the zxcvbn score is equal or less than this value, the policy will fail.
     * @type {number}
     * @memberof PasswordPolicyRequest
     */
    zxcvbnScoreThreshold?: number;
}

/**
 * Check if a given object implements the PasswordPolicyRequest interface.
 */
export function instanceOfPasswordPolicyRequest(value: object): value is PasswordPolicyRequest {
    if (!('name' in value) || value['name'] === undefined) return false;
    return true;
}

export function PasswordPolicyRequestFromJSON(json: any): PasswordPolicyRequest {
    return PasswordPolicyRequestFromJSONTyped(json, false);
}

export function PasswordPolicyRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PasswordPolicyRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'name': json['name'],
        'executionLogging': json['execution_logging'] == null ? undefined : json['execution_logging'],
        'passwordField': json['password_field'] == null ? undefined : json['password_field'],
        'amountDigits': json['amount_digits'] == null ? undefined : json['amount_digits'],
        'amountUppercase': json['amount_uppercase'] == null ? undefined : json['amount_uppercase'],
        'amountLowercase': json['amount_lowercase'] == null ? undefined : json['amount_lowercase'],
        'amountSymbols': json['amount_symbols'] == null ? undefined : json['amount_symbols'],
        'lengthMin': json['length_min'] == null ? undefined : json['length_min'],
        'symbolCharset': json['symbol_charset'] == null ? undefined : json['symbol_charset'],
        'errorMessage': json['error_message'] == null ? undefined : json['error_message'],
        'checkStaticRules': json['check_static_rules'] == null ? undefined : json['check_static_rules'],
        'checkHaveIBeenPwned': json['check_have_i_been_pwned'] == null ? undefined : json['check_have_i_been_pwned'],
        'checkZxcvbn': json['check_zxcvbn'] == null ? undefined : json['check_zxcvbn'],
        'hibpAllowedCount': json['hibp_allowed_count'] == null ? undefined : json['hibp_allowed_count'],
        'zxcvbnScoreThreshold': json['zxcvbn_score_threshold'] == null ? undefined : json['zxcvbn_score_threshold'],
    };
}

export function PasswordPolicyRequestToJSON(json: any): PasswordPolicyRequest {
    return PasswordPolicyRequestToJSONTyped(json, false);
}

export function PasswordPolicyRequestToJSONTyped(value?: PasswordPolicyRequest | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'name': value['name'],
        'execution_logging': value['executionLogging'],
        'password_field': value['passwordField'],
        'amount_digits': value['amountDigits'],
        'amount_uppercase': value['amountUppercase'],
        'amount_lowercase': value['amountLowercase'],
        'amount_symbols': value['amountSymbols'],
        'length_min': value['lengthMin'],
        'symbol_charset': value['symbolCharset'],
        'error_message': value['errorMessage'],
        'check_static_rules': value['checkStaticRules'],
        'check_have_i_been_pwned': value['checkHaveIBeenPwned'],
        'check_zxcvbn': value['checkZxcvbn'],
        'hibp_allowed_count': value['hibpAllowedCount'],
        'zxcvbn_score_threshold': value['zxcvbnScoreThreshold'],
    };
}

