/* 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';
/**
 * A single search result.
 * @export
 * @interface SearchHit
 */
export interface SearchHit {
    /**
     * 
     * @type {string}
     * @memberof SearchHit
     */
    content: string;
    /**
     * 
     * @type {number}
     * @memberof SearchHit
     */
    score?: number;
    /**
     * 
     * @type {{ [key: string]: any; }}
     * @memberof SearchHit
     */
    metadata?: { [key: string]: any; };
    /**
     * 
     * @type {string}
     * @memberof SearchHit
     */
    collection?: string;
    /**
     * 
     * @type {string}
     * @memberof SearchHit
     */
    docId?: string;
}

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

export function SearchHitFromJSON(json: any): SearchHit {
    return SearchHitFromJSONTyped(json, false);
}

export function SearchHitFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchHit {
    if (json == null) {
        return json;
    }
    return {
        
        'content': json['content'],
        'score': json['score'] == null ? undefined : json['score'],
        'metadata': json['metadata'] == null ? undefined : json['metadata'],
        'collection': json['collection'] == null ? undefined : json['collection'],
        'docId': json['doc_id'] == null ? undefined : json['doc_id'],
    };
}

export function SearchHitToJSON(json: any): SearchHit {
    return SearchHitToJSONTyped(json, false);
}

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

    return {
        
        'content': value['content'],
        'score': value['score'],
        'metadata': value['metadata'],
        'collection': value['collection'],
        'doc_id': value['docId'],
    };
}

