export type DeleteApiPrimsLabelsArgs = {prim_path?: (string | null) | undefined}; export type DeleteApiPrimsLabelsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Clear Semantic Labels * * DELETE /prims/labels */ export const deleteApiPrimsLabels = async (args: DeleteApiPrimsLabelsArgs, options: DeleteApiPrimsLabelsOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.prim_path != null) query.append("prim_path", String(args.prim_path)) const url = `${baseUrl.replace(/\/+$/, '')}/prims/labels${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 };