/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.10.0-rc1
 * 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 Uniqueness Policy Serializer
 * @export
 * @interface UniquePasswordPolicyRequest
 */
export interface UniquePasswordPolicyRequest {
    /**
     * 
     * @type {string}
     * @memberof UniquePasswordPolicyRequest
     */
    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 UniquePasswordPolicyRequest
     */
    executionLogging?: boolean;
    /**
     * Field key to check, field keys defined in Prompt stages are available.
     * @type {string}
     * @memberof UniquePasswordPolicyRequest
     */
    passwordField?: string;
    /**
     * Number of passwords to check against.
     * @type {number}
     * @memberof UniquePasswordPolicyRequest
     */
    numHistoricalPasswords?: number;
}

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

export function UniquePasswordPolicyRequestFromJSON(json: any): UniquePasswordPolicyRequest {
    return UniquePasswordPolicyRequestFromJSONTyped(json, false);
}

export function UniquePasswordPolicyRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UniquePasswordPolicyRequest {
    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'],
        'numHistoricalPasswords': json['num_historical_passwords'] == null ? undefined : json['num_historical_passwords'],
    };
}

export function UniquePasswordPolicyRequestToJSON(json: any): UniquePasswordPolicyRequest {
    return UniquePasswordPolicyRequestToJSONTyped(json, false);
}

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

    return {
        
        'name': value['name'],
        'execution_logging': value['executionLogging'],
        'password_field': value['passwordField'],
        'num_historical_passwords': value['numHistoricalPasswords'],
    };
}

