export type UpdateApiToolsUnknownSopClassAcceptedArgs = {body: BodyInit}; export type UpdateApiToolsUnknownSopClassAcceptedOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Set unknown SOP class accepted * * PUT /tools/unknown-sop-class-accepted */ export const updateApiToolsUnknownSopClassAccepted = async (args: UpdateApiToolsUnknownSopClassAcceptedArgs, options?: UpdateApiToolsUnknownSopClassAcceptedOptions) => { const {baseUrl = "https://orthanc.uclouvain.be/demo", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "text/plain") const url = `${baseUrl.replace(/\/+$/, '')}/tools/unknown-sop-class-accepted${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: args.body}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };