/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.5.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.
 */

/**
 * Password Uniqueness Policy Serializer
 * @export
 * @interface PatchedUniquePasswordPolicyRequest
 */
export interface PatchedUniquePasswordPolicyRequest {
    /**
     *
     * @type {string}
     * @memberof PatchedUniquePasswordPolicyRequest
     */
    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 PatchedUniquePasswordPolicyRequest
     */
    executionLogging?: boolean;
    /**
     * Field key to check, field keys defined in Prompt stages are available.
     * @type {string}
     * @memberof PatchedUniquePasswordPolicyRequest
     */
    passwordField?: string;
    /**
     * Number of passwords to check against.
     * @type {number}
     * @memberof PatchedUniquePasswordPolicyRequest
     */
    numHistoricalPasswords?: number;
}

/**
 * Check if a given object implements the PatchedUniquePasswordPolicyRequest interface.
 */
export function instanceOfPatchedUniquePasswordPolicyRequest(
    value: object,
): value is PatchedUniquePasswordPolicyRequest {
    return true;
}

export function PatchedUniquePasswordPolicyRequestFromJSON(
    json: any,
): PatchedUniquePasswordPolicyRequest {
    return PatchedUniquePasswordPolicyRequestFromJSONTyped(json, false);
}

export function PatchedUniquePasswordPolicyRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): PatchedUniquePasswordPolicyRequest {
    if (json == null) {
        return json;
    }
    return {
        name: json["name"] == null ? undefined : 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 PatchedUniquePasswordPolicyRequestToJSON(
    json: any,
): PatchedUniquePasswordPolicyRequest {
    return PatchedUniquePasswordPolicyRequestToJSONTyped(json, false);
}

export function PatchedUniquePasswordPolicyRequestToJSONTyped(
    value?: PatchedUniquePasswordPolicyRequest | 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"],
    };
}
