/* tslint:disable */
/* eslint-disable */
/**
 * Nech.PL Audio Intelligence API
 * Stem-aware audio analysis — emotion, features, sample role, loop grading, onsets/tempo, waveform & spectrogram, loudness, naming. The `audio` API of the Nech.PL APIs platform, served at /audio/v1/...; the gateway does central auth + metering (Bearer token).
 *
 * The version of the OpenAPI document: 0.1.0
 * 
 *
 * 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';
import type { LocationInner } from './LocationInner';
import {
    LocationInnerFromJSON,
    LocationInnerFromJSONTyped,
    LocationInnerToJSON,
    LocationInnerToJSONTyped,
} from './LocationInner';

/**
 * 
 * @export
 * @interface ValidationError
 */
export interface ValidationError {
    /**
     * 
     * @type {Array<LocationInner>}
     * @memberof ValidationError
     */
    loc: Array<LocationInner>;
    /**
     * 
     * @type {string}
     * @memberof ValidationError
     */
    msg: string;
    /**
     * 
     * @type {string}
     * @memberof ValidationError
     */
    type: string;
    /**
     * 
     * @type {any}
     * @memberof ValidationError
     */
    input?: any | null;
    /**
     * 
     * @type {object}
     * @memberof ValidationError
     */
    ctx?: object;
}

/**
 * Check if a given object implements the ValidationError interface.
 */
export function instanceOfValidationError(value: object): value is ValidationError {
    if (!('loc' in value) || value['loc'] === undefined) return false;
    if (!('msg' in value) || value['msg'] === undefined) return false;
    if (!('type' in value) || value['type'] === undefined) return false;
    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 {
        
        'loc': ((json['loc'] as Array<any>).map(LocationInnerFromJSON)),
        'msg': json['msg'],
        'type': json['type'],
        'input': json['input'] == null ? undefined : json['input'],
        'ctx': json['ctx'] == null ? undefined : json['ctx'],
    };
}

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 {
        
        'loc': ((value['loc'] as Array<any>).map(LocationInnerToJSON)),
        'msg': value['msg'],
        'type': value['type'],
        'input': value['input'],
        'ctx': value['ctx'],
    };
}

