export type DeleteApiApiV1DocumentAnnotationsIdArgs = {id: string}; export type DeleteApiApiV1DocumentAnnotationsIdOptions = {baseUrl: string, AuthToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Annotation (Document Field Value) * * DELETE /api/v1/document/annotations/{id}/ */ export const deleteApiApiV1DocumentAnnotationsId = async (args: DeleteApiApiV1DocumentAnnotationsIdArgs, options: DeleteApiApiV1DocumentAnnotationsIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, AuthToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (AuthToken !== undefined) headers.set("Authorization", AuthToken) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/document/annotations/${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 };