export type UpdateApiPeersIdArgs = {id: string, body: {CertificateFile?: string | undefined, CertificateKeyFile?: string | undefined, CertificateKeyPassword?: string | undefined, HttpHeaders?: Record | undefined, Password?: string | undefined, URL?: string | undefined, Username?: string | undefined}}; export type UpdateApiPeersIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update Orthanc peer * * PUT /peers/{id} */ export const updateApiPeersId = async (args: UpdateApiPeersIdArgs, options?: UpdateApiPeersIdOptions) => { 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(/\/+$/, '')}/peers/${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 };