export type DeleteApiV1StoragesStorageIdFilesArgs = {'App-ID': string, 'Auth-Token': string, storage_id: string, path?: string | undefined, path_separator?: string | undefined, directory_path?: string | undefined, checksum?: string | undefined, id?: string | undefined, name?: string | undefined, type?: string | undefined, status?: string | undefined, date_created?: string | undefined, date_modified?: string | undefined, original_name?: string | undefined, size?: string | undefined, asset_id?: string | undefined, format_id?: string | undefined}; export type DeleteApiV1StoragesStorageIdFilesOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * DELETE files (with copies in different storages) from a storage folder, or a storage * * DELETE /v1/storages/{storage_id}/files/ */ export const deleteApiV1StoragesStorageIdFiles = async (args: DeleteApiV1StoragesStorageIdFilesArgs, options: DeleteApiV1StoragesStorageIdFilesOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['App-ID'] != null) headers.set("App-ID", String(args['App-ID'])) if (args['Auth-Token'] != null) headers.set("Auth-Token", String(args['Auth-Token'])) if (args.path != null) query.append("path", String(args.path)) if (args.path_separator != null) query.append("path_separator", String(args.path_separator)) if (args.directory_path != null) query.append("directory_path", String(args.directory_path)) if (args.checksum != null) query.append("checksum", String(args.checksum)) if (args.id != null) query.append("id", String(args.id)) if (args.name != null) query.append("name", String(args.name)) if (args.type != null) query.append("type", String(args.type)) if (args.status != null) query.append("status", String(args.status)) if (args.date_created != null) query.append("date_created", String(args.date_created)) if (args.date_modified != null) query.append("date_modified", String(args.date_modified)) if (args.original_name != null) query.append("original_name", String(args.original_name)) if (args.size != null) query.append("size", String(args.size)) if (args.asset_id != null) query.append("asset_id", String(args.asset_id)) if (args.format_id != null) query.append("format_id", String(args.format_id)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/storages/${encodeURIComponent(String(args.storage_id))}/files/${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };