/* 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 ValidateDirectoryResponse
 */
export interface ValidateDirectoryResponse {
    /**
     * Whether the directory exists
     * @type {boolean}
     * @memberof ValidateDirectoryResponse
     */
    _exists: boolean;
    /**
     * Whether the path is a directory (only set if exists is true)
     * @type {boolean}
     * @memberof ValidateDirectoryResponse
     */
    isDirectory?: boolean;
    /**
     * Whether the directory can be created (only set if exists is false)
     * @type {boolean}
     * @memberof ValidateDirectoryResponse
     */
    canCreate?: boolean;
    /**
     * The expanded path with ~ resolved
     * @type {string}
     * @memberof ValidateDirectoryResponse
     */
    expandedPath: string;
    /**
     * Error message if path validation failed
     * @type {string}
     * @memberof ValidateDirectoryResponse
     */
    error?: string;
}

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

export function ValidateDirectoryResponseFromJSON(json: any): ValidateDirectoryResponse {
    return ValidateDirectoryResponseFromJSONTyped(json, false);
}

export function ValidateDirectoryResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidateDirectoryResponse {
    if (json == null) {
        return json;
    }
    return {
        
        '_exists': json['exists'],
        'isDirectory': json['isDirectory'] == null ? undefined : json['isDirectory'],
        'canCreate': json['canCreate'] == null ? undefined : json['canCreate'],
        'expandedPath': json['expandedPath'],
        'error': json['error'] == null ? undefined : json['error'],
    };
}

export function ValidateDirectoryResponseToJSON(json: any): ValidateDirectoryResponse {
    return ValidateDirectoryResponseToJSONTyped(json, false);
}

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

    return {
        
        'exists': value['_exists'],
        'isDirectory': value['isDirectory'],
        'canCreate': value['canCreate'],
        'expandedPath': value['expandedPath'],
        'error': value['error'],
    };
}

