/* 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';
/**
 * 
 * @export
 * @interface FileMatch
 */
export interface FileMatch {
    /**
     * Absolute path to matched file or folder
     * @type {string}
     * @memberof FileMatch
     */
    path: string;
    /**
     * Relative path for display (relative to first search path if applicable)
     * @type {string}
     * @memberof FileMatch
     */
    displayPath: string;
    /**
     * Match quality score (higher is better)
     * @type {number}
     * @memberof FileMatch
     */
    score: number;
    /**
     * Character positions of matched query characters
     * @type {Array<number>}
     * @memberof FileMatch
     */
    matchedIndexes: Array<number>;
    /**
     * True if this is a directory, false for files
     * @type {boolean}
     * @memberof FileMatch
     */
    isDirectory: boolean;
}

/**
 * Check if a given object implements the FileMatch interface.
 */
export function instanceOfFileMatch(value: object): value is FileMatch {
    if (!('path' in value) || value['path'] === undefined) return false;
    if (!('displayPath' in value) || value['displayPath'] === undefined) return false;
    if (!('score' in value) || value['score'] === undefined) return false;
    if (!('matchedIndexes' in value) || value['matchedIndexes'] === undefined) return false;
    if (!('isDirectory' in value) || value['isDirectory'] === undefined) return false;
    return true;
}

export function FileMatchFromJSON(json: any): FileMatch {
    return FileMatchFromJSONTyped(json, false);
}

export function FileMatchFromJSONTyped(json: any, ignoreDiscriminator: boolean): FileMatch {
    if (json == null) {
        return json;
    }
    return {
        
        'path': json['path'],
        'displayPath': json['displayPath'],
        'score': json['score'],
        'matchedIndexes': json['matchedIndexes'],
        'isDirectory': json['isDirectory'],
    };
}

export function FileMatchToJSON(json: any): FileMatch {
    return FileMatchToJSONTyped(json, false);
}

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

    return {
        
        'path': value['path'],
        'displayPath': value['displayPath'],
        'score': value['score'],
        'matchedIndexes': value['matchedIndexes'],
        'isDirectory': value['isDirectory'],
    };
}

