export type DeleteApiV1FilesFileIdDeletionsFromStorageIdArgs = {'Auth-Token': string, 'App-ID': string, file_id: string, storage_id: string}; export type DeleteApiV1FilesFileIdDeletionsFromStorageIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete file deletion job after handling it * * DELETE /v1/files/{file_id}/deletions_from/{storage_id}/ */ export const deleteApiV1FilesFileIdDeletionsFromStorageId = async (args: DeleteApiV1FilesFileIdDeletionsFromStorageIdArgs, options: DeleteApiV1FilesFileIdDeletionsFromStorageIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Auth-Token'] != null) headers.set("Auth-Token", String(args['Auth-Token'])) if (args['App-ID'] != null) headers.set("App-ID", String(args['App-ID'])) const url = `${baseUrl.replace(/\/+$/, '')}/v1/files/${encodeURIComponent(String(args.file_id))}/deletions_from/${encodeURIComponent(String(args.storage_id))}/${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 };