/* 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 SearchMetadata
 */
export interface SearchMetadata {
    /**
     * Total number of files/folders scanned
     * @type {number}
     * @memberof SearchMetadata
     */
    totalScanned: number;
    /**
     * Total matches found before applying limit
     * @type {number}
     * @memberof SearchMetadata
     */
    totalMatches: number;
    /**
     * Search duration in milliseconds
     * @type {number}
     * @memberof SearchMetadata
     */
    durationMs: number;
    /**
     * True if search was terminated due to timeout
     * @type {boolean}
     * @memberof SearchMetadata
     */
    timedOut: boolean;
}

/**
 * Check if a given object implements the SearchMetadata interface.
 */
export function instanceOfSearchMetadata(value: object): value is SearchMetadata {
    if (!('totalScanned' in value) || value['totalScanned'] === undefined) return false;
    if (!('totalMatches' in value) || value['totalMatches'] === undefined) return false;
    if (!('durationMs' in value) || value['durationMs'] === undefined) return false;
    if (!('timedOut' in value) || value['timedOut'] === undefined) return false;
    return true;
}

export function SearchMetadataFromJSON(json: any): SearchMetadata {
    return SearchMetadataFromJSONTyped(json, false);
}

export function SearchMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchMetadata {
    if (json == null) {
        return json;
    }
    return {
        
        'totalScanned': json['totalScanned'],
        'totalMatches': json['totalMatches'],
        'durationMs': json['durationMs'],
        'timedOut': json['timedOut'],
    };
}

export function SearchMetadataToJSON(json: any): SearchMetadata {
    return SearchMetadataToJSONTyped(json, false);
}

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

    return {
        
        'totalScanned': value['totalScanned'],
        'totalMatches': value['totalMatches'],
        'durationMs': value['durationMs'],
        'timedOut': value['timedOut'],
    };
}

