export type DeleteApiV1StoragesStorageIdDeletionsDeletionIdArgs = {'Auth-Token': string, 'App-ID': string, storage_id: string, deletion_id: string}; export type DeleteApiV1StoragesStorageIdDeletionsDeletionIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete file deletion job after handling it * * DELETE /v1/storages/{storage_id}/deletions/{deletion_id}/ */ export const deleteApiV1StoragesStorageIdDeletionsDeletionId = async (args: DeleteApiV1StoragesStorageIdDeletionsDeletionIdArgs, options: DeleteApiV1StoragesStorageIdDeletionsDeletionIdOptions) => { 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/storages/${encodeURIComponent(String(args.storage_id))}/deletions/${encodeURIComponent(String(args.deletion_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 };