/* tslint:disable */
/* eslint-disable */
/**
 * HumanLayer Daemon REST API
 * REST API for HumanLayer daemon operations, providing session management, approval workflows, and real-time event streaming capabilities. 
 *
 * The version of the OpenAPI document: 1.0.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 { SearchMetadata } from './SearchMetadata';
import {
    SearchMetadataFromJSON,
    SearchMetadataFromJSONTyped,
    SearchMetadataToJSON,
    SearchMetadataToJSONTyped,
} from './SearchMetadata';
import type { FileMatch } from './FileMatch';
import {
    FileMatchFromJSON,
    FileMatchFromJSONTyped,
    FileMatchToJSON,
    FileMatchToJSONTyped,
} from './FileMatch';

/**
 * 
 * @export
 * @interface FuzzySearchFilesResponse
 */
export interface FuzzySearchFilesResponse {
    /**
     * Matched files/folders sorted by relevance
     * @type {Array<FileMatch>}
     * @memberof FuzzySearchFilesResponse
     */
    results: Array<FileMatch>;
    /**
     * 
     * @type {SearchMetadata}
     * @memberof FuzzySearchFilesResponse
     */
    metadata: SearchMetadata;
}

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

export function FuzzySearchFilesResponseFromJSON(json: any): FuzzySearchFilesResponse {
    return FuzzySearchFilesResponseFromJSONTyped(json, false);
}

export function FuzzySearchFilesResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): FuzzySearchFilesResponse {
    if (json == null) {
        return json;
    }
    return {
        
        'results': ((json['results'] as Array<any>).map(FileMatchFromJSON)),
        'metadata': SearchMetadataFromJSON(json['metadata']),
    };
}

export function FuzzySearchFilesResponseToJSON(json: any): FuzzySearchFilesResponse {
    return FuzzySearchFilesResponseToJSONTyped(json, false);
}

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

    return {
        
        'results': ((value['results'] as Array<any>).map(FileMatchToJSON)),
        'metadata': SearchMetadataToJSON(value['metadata']),
    };
}

