export type DeleteApiApiV3SubmissionsIdArgs = {id: string, 'If-Match': string}; export type DeleteApiApiV3SubmissionsIdOptions = {baseUrl: string, submissionBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Cancels only draft or validated state. After owner checks, already-cancelled state returns 204 regardless of the supplied If-Match (even if stale). The If-Match header is always required, but its value is not compared on repeated cancellation. All queued/importing/imported/failed/needs_reconciliation/expired states return 409. This never deletes biological records. * * DELETE /api/v3/submissions/{id} */ export const deleteApiApiV3SubmissionsId = async (args: DeleteApiApiV3SubmissionsIdArgs, options: DeleteApiApiV3SubmissionsIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, submissionBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['If-Match'] != null) headers.set("If-Match", String(args['If-Match'])) if (submissionBearer !== undefined) headers.set('authorization', `Bearer ${submissionBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v3/submissions/${encodeURIComponent(String(args.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 };