/* tslint:disable */
/* eslint-disable */
/**
 * RMI Backend
 * Rug Munch Intelligence — institutional-grade crypto intelligence API. 13+ chains, 96 data providers, 8 MCP tools, x402 paid tier, sovereign-first FOSS.
 *
 * The version of the OpenAPI document: 2026.06.21
 * 
 *
 * 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';
/**
 * RAG document ingestion result.
 * @export
 * @interface IngestResult
 */
export interface IngestResult {
    /**
     * 
     * @type {string}
     * @memberof IngestResult
     */
    docId: string;
    /**
     * 
     * @type {string}
     * @memberof IngestResult
     */
    collection: string;
    /**
     * 
     * @type {string}
     * @memberof IngestResult
     */
    status?: string;
    /**
     * 
     * @type {number}
     * @memberof IngestResult
     */
    chunks?: number;
    /**
     * 
     * @type {string}
     * @memberof IngestResult
     */
    error?: string | null;
    /**
     * 
     * @type {Date}
     * @memberof IngestResult
     */
    ingestedAt?: Date;
}

/**
 * Check if a given object implements the IngestResult interface.
 */
export function instanceOfIngestResult(value: object): value is IngestResult {
    if ((!('docId' in value) && !('doc_id' in value)) || (value['docId'] === undefined && value['doc_id'] === undefined)) return false;
    if (!('collection' in value) || value['collection'] === undefined) return false;
    return true;
}

export function IngestResultFromJSON(json: any): IngestResult {
    return IngestResultFromJSONTyped(json, false);
}

export function IngestResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): IngestResult {
    if (json == null) {
        return json;
    }
    return {
        
        'docId': json['doc_id'],
        'collection': json['collection'],
        'status': json['status'] == null ? undefined : json['status'],
        'chunks': json['chunks'] == null ? undefined : json['chunks'],
        'error': json['error'] == null ? undefined : json['error'],
        'ingestedAt': json['ingested_at'] == null ? undefined : (new Date(json['ingested_at'])),
    };
}

export function IngestResultToJSON(json: any): IngestResult {
    return IngestResultToJSONTyped(json, false);
}

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

    return {
        
        'doc_id': value['docId'],
        'collection': value['collection'],
        'status': value['status'],
        'chunks': value['chunks'],
        'error': value['error'],
        'ingested_at': value['ingestedAt'] == null ? value['ingestedAt'] : value['ingestedAt'].toISOString(),
    };
}

