export type UpdateApihttpLocalhost8000ProjectIdSimilarityConfigsArgs = {project_id: string, body: {name: string, source?: string | undefined, distance_breaks?: string | undefined, dot_breaks?: string | undefined, tangent_neighbors?: string | undefined, matching_skeleton_ids?: string | undefined, matching_pointset_ids?: string | undefined, matching_pointcloud_ids?: string | undefined, random_skeleton_ids?: string | undefined, matching_sample_id?: string | undefined, random_sample_id?: string | undefined, scoring?: string | undefined}}; export type UpdateApihttpLocalhost8000ProjectIdSimilarityConfigsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create a new similarity/NBLAST configuration either by providing * * PUT http://localhost:8000/{project_id}/similarity/configs/ */ export const updateApihttpLocalhost8000ProjectIdSimilarityConfigs = async (args: UpdateApihttpLocalhost8000ProjectIdSimilarityConfigsArgs, options?: UpdateApihttpLocalhost8000ProjectIdSimilarityConfigsOptions) => { const {baseUrl = "http://localhost:8000", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/x-www-form-urlencoded") const url = `${baseUrl.replace(/\/+$/, '')}http://localhost:8000/${encodeURIComponent(String(args.project_id))}/similarity/configs/${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: new URLSearchParams(Object.entries(args.body).flatMap(([key, value]) => (value == null ? [] : [[key, String(value)]])))}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };