/* 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 FileSnapshot
 */
export interface FileSnapshot {
    /**
     * Tool invocation that created snapshot
     * @type {string}
     * @memberof FileSnapshot
     */
    toolId: string;
    /**
     * Path to the file
     * @type {string}
     * @memberof FileSnapshot
     */
    filePath: string;
    /**
     * File content at snapshot time
     * @type {string}
     * @memberof FileSnapshot
     */
    content: string;
    /**
     * 
     * @type {Date}
     * @memberof FileSnapshot
     */
    createdAt: Date;
}

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

export function FileSnapshotFromJSON(json: any): FileSnapshot {
    return FileSnapshotFromJSONTyped(json, false);
}

export function FileSnapshotFromJSONTyped(json: any, ignoreDiscriminator: boolean): FileSnapshot {
    if (json == null) {
        return json;
    }
    return {
        
        'toolId': json['tool_id'],
        'filePath': json['file_path'],
        'content': json['content'],
        'createdAt': (new Date(json['created_at'])),
    };
}

export function FileSnapshotToJSON(json: any): FileSnapshot {
    return FileSnapshotToJSONTyped(json, false);
}

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

    return {
        
        'tool_id': value['toolId'],
        'file_path': value['filePath'],
        'content': value['content'],
        'created_at': ((value['createdAt']).toISOString()),
    };
}

