/* 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.
 */

/**
 * Validation Error
 * @export
 * @interface ValidationError
 */
export interface ValidationError {
    [key: string]: any | any;
    /**
     *
     * @type {Array<string>}
     * @memberof ValidationError
     */
    nonFieldErrors?: Array<string>;
    /**
     *
     * @type {string}
     * @memberof ValidationError
     */
    code?: string;
}

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

export function ValidationErrorFromJSON(json: any): ValidationError {
    return ValidationErrorFromJSONTyped(json, false);
}

export function ValidationErrorFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): ValidationError {
    if (json == null) {
        return json;
    }
    return {
        ...json,
        nonFieldErrors: json["non_field_errors"] == null ? undefined : json["non_field_errors"],
        code: json["code"] == null ? undefined : json["code"],
    };
}

export function ValidationErrorToJSON(json: any): ValidationError {
    return ValidationErrorToJSONTyped(json, false);
}

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

    return {
        ...value,
        non_field_errors: value["nonFieldErrors"],
        code: value["code"],
    };
}
