import { APIResource } from "../core/resource.js"; import { APIPromise } from "../core/api-promise.js"; import { type Uploadable } from "../core/uploads.js"; import { RequestOptions } from "../internal/request-options.js"; export declare class Files extends APIResource { /** * Delete files by temporary_file_ids (bulk deletion) */ delete(params: FileDeleteParams, options?: RequestOptions): APIPromise; /** * Delete a file from object storage associated with a conversation. */ deleteAll(params: FileDeleteAllParams, options?: RequestOptions): APIPromise; /** * Upload file independently and get temporary_file_id. Also accepts an optional * 'model_name' form field (its parsed value below is unused; the actual value is * read from the raw form body to preserve the distinction between an omitted value * and an explicit empty string, see FileUploadRequest.as_form). Tri-state: omitted * falls back to the chatbot's first configured model (the one the client defaults * to); a non-empty value scopes to that one model; an explicit empty string means * no model is selected, so no model-based extensions apply. Also accepts an * optional 'agent_id' form field. Uploads destined for an agent -- either via * Agent Mode on the chatbot or a non-empty 'agent_id' -- skip file-type validation * entirely (no extension whitelist, no content-type check); size, empty-file, and * virus-scan checks still apply. A supplied 'agent_id' must belong to the chatbot, * otherwise the request is rejected with 400. An optional 'digital_employee_id' * form field gets the same treatment for uploads destined for a Digital Employee * (DocProc is skipped too); it must exist in the caller's organization (404 * otherwise), and is rejected with 422 when the feature is disabled or when * combined with 'agent_id'. */ upload(params: FileUploadParams, options?: RequestOptions): APIPromise; } /** * Response model for uploading a file independently. * * Attributes: temporary_file_id (str): Backend-generated identifier for the * uploaded file. filename (str): The original filename of the uploaded file. size * (int): The size of the uploaded file in bytes. status (str): The status of the * upload. expires_at (str): ISO 8601 timestamp when the uploaded file expires. url * (str | None): Presigned S3 URL to access the uploaded file, or None if the URL * could not be generated. object_storage_type (str | None): The object storage * backend the file was stored in (e.g. "minio"), or None if unknown. */ export interface FileUploadResponse { /** * ISO 8601 timestamp when the uploaded file expires */ expires_at: string; /** * The original filename of the uploaded file */ filename: string; /** * The size of the uploaded file in bytes */ size: number; /** * The status of the upload */ status: string; /** * Backend-generated identifier for the uploaded file */ temporary_file_id: string; /** * The object storage backend the file was stored in */ object_storage_type?: string | null; /** * Presigned S3 URL to access the uploaded file */ url?: string | null; } /** * Response model for bulk-deleting uploaded files. * * Attributes: status (str): The status of the deletion. deleted_files * (list[DeletedFileItem]): List of files that were deleted. total_deleted (int): * The total number of files deleted. */ export interface FileDeleteResponse { /** * List of files that were deleted */ deleted_files: Array; /** * The status of the deletion */ status: string; /** * The total number of files deleted */ total_deleted: number; } export declare namespace FileDeleteResponse { /** * Model for a single deleted file entry. * * Attributes: temporary_file_id (str): The identifier of the deleted file. * filename (str): The filename of the deleted file. */ interface DeletedFile { /** * The filename of the deleted file */ filename: string; /** * The identifier of the deleted file */ temporary_file_id: string; } } export type FileDeleteAllResponse = { [key: string]: unknown; }; export interface FileDeleteParams { /** * Body param: List of backend-generated temporary file IDs to delete */ temporary_file_ids: Array; /** * Body param: The user ID. Only honored for service clients (e.g. SDK); otherwise * it is overwritten with the authenticated user. */ user_id?: string | null; /** * Header param */ 'Accept-Language'?: string; /** * Header param: Set to `structured` to receive errors in the structured envelope. * Omit it to keep the legacy error body. */ 'X-Error-Format'?: string; } export interface FileDeleteAllParams { /** * Body param */ conversation_id: string; /** * Body param */ file_id: string; /** * Body param */ file_name: string; /** * Body param */ object_key_version: number; /** * Body param */ object_storage_type: string; /** * Body param */ user_id: string; /** * Header param */ 'Accept-Language'?: string; /** * Header param: Set to `structured` to receive errors in the structured envelope. * Omit it to keep the legacy error body. */ 'X-Error-Format'?: string; } export interface FileUploadParams { /** * Body param */ chatbot_id: string; /** * Body param */ file: Uploadable; /** * Body param */ agent_id?: string | null; /** * Body param */ digital_employee_id?: string | null; /** * Body param */ model_name?: string | null; /** * Body param */ user_id?: string | null; /** * Header param */ 'Accept-Language'?: string; /** * Header param: Set to `structured` to receive errors in the structured envelope. * Omit it to keep the legacy error body. */ 'X-Error-Format'?: string; } export declare namespace Files { export { type FileUploadResponse as FileUploadResponse, type FileDeleteResponse as FileDeleteResponse, type FileDeleteAllResponse as FileDeleteAllResponse, type FileDeleteParams as FileDeleteParams, type FileDeleteAllParams as FileDeleteAllParams, type FileUploadParams as FileUploadParams, }; } //# sourceMappingURL=files.d.ts.map