export type UpdateApiModalitiesIdArgs = {id: string, body: {AET?: string | undefined, AllowEcho?: boolean | undefined, AllowFind?: boolean | undefined, AllowFindWorklist?: boolean | undefined, AllowGet?: boolean | undefined, AllowMove?: boolean | undefined, AllowStorageCommitment?: boolean | undefined, AllowStore?: boolean | undefined, AllowTranscoding?: boolean | undefined, Host?: string | undefined, LocalAet?: string | undefined, Manufacturer?: string | undefined, Port?: number | undefined, Timeout?: number | undefined, UseDicomTls?: boolean | undefined}}; export type UpdateApiModalitiesIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update DICOM modality * * PUT /modalities/{id} */ export const updateApiModalitiesId = async (args: UpdateApiModalitiesIdArgs, options?: UpdateApiModalitiesIdOptions) => { const {baseUrl = "https://orthanc.uclouvain.be/demo", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/modalities/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };