/* 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';
import type { MCPConfig } from './MCPConfig';
import {
    MCPConfigFromJSON,
    MCPConfigFromJSONTyped,
    MCPConfigToJSON,
    MCPConfigToJSONTyped,
} from './MCPConfig';

/**
 *
 * @export
 * @interface CreateSessionRequest
 */
export interface CreateSessionRequest {
    /**
     * Initial query for Claude
     * @type {string}
     * @memberof CreateSessionRequest
     */
    query: string;
    /**
     * Model to use for the session
     * @type {string}
     * @memberof CreateSessionRequest
     */
    model?: CreateSessionRequestModelEnum;
    /**
     *
     * @type {MCPConfig}
     * @memberof CreateSessionRequest
     */
    mcpConfig?: MCPConfig;
    /**
     * MCP tool for permission prompts
     * @type {string}
     * @memberof CreateSessionRequest
     */
    permissionPromptTool?: string;
    /**
     * Working directory for the session
     * @type {string}
     * @memberof CreateSessionRequest
     */
    workingDir?: string;
    /**
     * Maximum conversation turns
     * @type {number}
     * @memberof CreateSessionRequest
     */
    maxTurns?: number;
    /**
     * Override system prompt
     * @type {string}
     * @memberof CreateSessionRequest
     */
    systemPrompt?: string;
    /**
     * Text to append to system prompt
     * @type {string}
     * @memberof CreateSessionRequest
     */
    appendSystemPrompt?: string;
    /**
     * Whitelist of allowed tools
     * @type {Array<string>}
     * @memberof CreateSessionRequest
     */
    allowedTools?: Array<string>;
    /**
     * Blacklist of disallowed tools
     * @type {Array<string>}
     * @memberof CreateSessionRequest
     */
    disallowedTools?: Array<string>;
    /**
     * Custom instructions for Claude
     * @type {string}
     * @memberof CreateSessionRequest
     */
    customInstructions?: string;
    /**
     * Launch session with dangerously skip permissions enabled
     * @type {boolean}
     * @memberof CreateSessionRequest
     */
    dangerouslySkipPermissions?: boolean;
    /**
     * Optional default timeout in milliseconds for dangerously skip permissions
     * @type {number}
     * @memberof CreateSessionRequest
     */
    dangerouslySkipPermissionsTimeout?: number;
    /**
     * Enable verbose output
     * @type {boolean}
     * @memberof CreateSessionRequest
     */
    verbose?: boolean;
}


/**
 * @export
 */
export const CreateSessionRequestModelEnum = {
    Opus: 'opus',
    Sonnet: 'sonnet'
} as const;
export type CreateSessionRequestModelEnum = typeof CreateSessionRequestModelEnum[keyof typeof CreateSessionRequestModelEnum];


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

export function CreateSessionRequestFromJSON(json: any): CreateSessionRequest {
    return CreateSessionRequestFromJSONTyped(json, false);
}

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

        'query': json['query'],
        'model': json['model'] == null ? undefined : json['model'],
        'mcpConfig': json['mcp_config'] == null ? undefined : MCPConfigFromJSON(json['mcp_config']),
        'permissionPromptTool': json['permission_prompt_tool'] == null ? undefined : json['permission_prompt_tool'],
        'workingDir': json['working_dir'] == null ? undefined : json['working_dir'],
        'maxTurns': json['max_turns'] == null ? undefined : json['max_turns'],
        'systemPrompt': json['system_prompt'] == null ? undefined : json['system_prompt'],
        'appendSystemPrompt': json['append_system_prompt'] == null ? undefined : json['append_system_prompt'],
        'allowedTools': json['allowed_tools'] == null ? undefined : json['allowed_tools'],
        'disallowedTools': json['disallowed_tools'] == null ? undefined : json['disallowed_tools'],
        'customInstructions': json['custom_instructions'] == null ? undefined : json['custom_instructions'],
        'dangerouslySkipPermissions': json['dangerously_skip_permissions'] == null ? undefined : json['dangerously_skip_permissions'],
        'dangerouslySkipPermissionsTimeout': json['dangerously_skip_permissions_timeout'] == null ? undefined : json['dangerously_skip_permissions_timeout'],
        'verbose': json['verbose'] == null ? undefined : json['verbose'],
    };
}

export function CreateSessionRequestToJSON(json: any): CreateSessionRequest {
    return CreateSessionRequestToJSONTyped(json, false);
}

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

    return {

        'query': value['query'],
        'model': value['model'],
        'mcp_config': MCPConfigToJSON(value['mcpConfig']),
        'permission_prompt_tool': value['permissionPromptTool'],
        'working_dir': value['workingDir'],
        'max_turns': value['maxTurns'],
        'system_prompt': value['systemPrompt'],
        'append_system_prompt': value['appendSystemPrompt'],
        'allowed_tools': value['allowedTools'],
        'disallowed_tools': value['disallowedTools'],
        'custom_instructions': value['customInstructions'],
        'dangerously_skip_permissions': value['dangerouslySkipPermissions'],
        'dangerously_skip_permissions_timeout': value['dangerouslySkipPermissionsTimeout'],
        'verbose': value['verbose'],
    };
}
