/* 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 DatabaseInfoResponse
 */
export interface DatabaseInfoResponse {
    /**
     * Path to the SQLite database file
     * @type {string}
     * @memberof DatabaseInfoResponse
     */
    path: string;
    /**
     * Size of the database file in bytes
     * @type {number}
     * @memberof DatabaseInfoResponse
     */
    size: number;
    /**
     * Number of tables in the database
     * @type {number}
     * @memberof DatabaseInfoResponse
     */
    tableCount: number;
    /**
     * Database statistics
     * @type {{ [key: string]: number; }}
     * @memberof DatabaseInfoResponse
     */
    stats: { [key: string]: number; };
    /**
     * Last modification time of the database file
     * @type {Date}
     * @memberof DatabaseInfoResponse
     */
    lastModified?: Date;
}

/**
 * Check if a given object implements the DatabaseInfoResponse interface.
 */
export function instanceOfDatabaseInfoResponse(value: object): value is DatabaseInfoResponse {
    if (!('path' in value) || value['path'] === undefined) return false;
    if (!('size' in value) || value['size'] === undefined) return false;
    if (!('tableCount' in value) || value['tableCount'] === undefined) return false;
    if (!('stats' in value) || value['stats'] === undefined) return false;
    return true;
}

export function DatabaseInfoResponseFromJSON(json: any): DatabaseInfoResponse {
    return DatabaseInfoResponseFromJSONTyped(json, false);
}

export function DatabaseInfoResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DatabaseInfoResponse {
    if (json == null) {
        return json;
    }
    return {

        'path': json['path'],
        'size': json['size'],
        'tableCount': json['table_count'],
        'stats': json['stats'],
        'lastModified': json['last_modified'] == null ? undefined : (new Date(json['last_modified'])),
    };
}

export function DatabaseInfoResponseToJSON(json: any): DatabaseInfoResponse {
    return DatabaseInfoResponseToJSONTyped(json, false);
}

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

    return {

        'path': value['path'],
        'size': value['size'],
        'table_count': value['tableCount'],
        'stats': value['stats'],
        'last_modified': value['lastModified'] == null ? undefined : ((value['lastModified']).toISOString()),
    };
}
