export type CreateApihttpLocalhost8000ProjectIdAnnotationsReplaceArgs = {project_id: string}; export type CreateApihttpLocalhost8000ProjectIdAnnotationsReplaceOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Replace a set of annotations for a list of target class instances by * * POST http://localhost:8000/{project_id}/annotations/replace */ export const createApihttpLocalhost8000ProjectIdAnnotationsReplace = async (args: CreateApihttpLocalhost8000ProjectIdAnnotationsReplaceArgs, options?: CreateApihttpLocalhost8000ProjectIdAnnotationsReplaceOptions) => { const {baseUrl = "http://localhost:8000", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}http://localhost:8000/${encodeURIComponent(String(args.project_id))}/annotations/replace${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };