/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { BaseResponse } from '../models/BaseResponse';
import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';
export class StorageService {
    /**
     * Delete File
     * 删除 a file from storage.
     *
     * Raises:
     * InvalidParameterException: Path is invalid
     * StorageException: Failed to delete file
     * @param path File path or URL to delete
     * @returns BaseResponse Successful Response
     * @throws ApiError
     */
    public static deleteFile(
        path: string,
    ): CancelablePromise<BaseResponse> {
        return __request(OpenAPI, {
            method: 'DELETE',
            url: '/api/v1/storage/files',
            query: {
                'path': path,
            },
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Download File
     * 专用下载接口：
     * - 后端代理拉取远端资源
     * - 设置 Content-Disposition=attachment，避免浏览器直接在当前页打开视频/音频
     * @param url Original or signed media URL
     * @param filename Optional download filename
     * @returns any Successful Response
     * @throws ApiError
     */
    public static downloadFile(
        url: string,
        filename?: (string | null),
    ): CancelablePromise<any> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/api/v1/storage/download',
            query: {
                'url': url,
                'filename': filename,
            },
            errors: {
                422: `Validation Error`,
            },
        });
    }
}
