export type InternalUpdateStoragePathsRequest = {log_storage_path: string, results_storage_path: string}; export type PatchApiInternalReclassificationRunsRunIdStoragePathsArgs = {run_id: string, 'X-Internal-Service-Token'?: (string | null) | undefined, body: InternalUpdateStoragePathsRequest}; export type PatchApiInternalReclassificationRunsRunIdStoragePathsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Update storage paths post-migration (internal) * * PATCH /internal/reclassification/runs/{run_id}/storage-paths */ export const patchApiInternalReclassificationRunsRunIdStoragePaths = async (args: PatchApiInternalReclassificationRunsRunIdStoragePathsArgs, options: PatchApiInternalReclassificationRunsRunIdStoragePathsOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['X-Internal-Service-Token'] != null) headers.set("X-Internal-Service-Token", String(args['X-Internal-Service-Token'])) const url = `${baseUrl.replace(/\/+$/, '')}/internal/reclassification/runs/${encodeURIComponent(String(args.run_id))}/storage-paths${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };