export type DeleteApiBackupBackupIdArgs = {backup_id: string}; export type DeleteApiBackupBackupIdOptions = {baseUrl: string, jwt?: string | undefined, fetch?: typeof fetch | undefined}; /** * cancel Backup * * DELETE /backup/{backup_id} */ export const deleteApiBackupBackupId = async (args: DeleteApiBackupBackupIdArgs, options: DeleteApiBackupBackupIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, jwt} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (jwt !== undefined) headers.set("Authorization", jwt) const url = `${baseUrl.replace(/\/+$/, '')}/backup/${encodeURIComponent(String(args.backup_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 };