export type ResultRequest = {model_id?: number | undefined, model_version_id?: number | undefined, training_id: string, result_msg: string, enable_flag?: number | undefined}; export type UpdateApiMfV1ResultIdResultIdArgs = {resultId: number, body: ResultRequest}; export type UpdateApiMfV1ResultIdResultIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * update result * * PUT /mf/v1/result/id/{resultId} */ export const updateApiMfV1ResultIdResultId = async (args: UpdateApiMfV1ResultIdResultIdArgs, options?: UpdateApiMfV1ResultIdResultIdOptions) => { const {baseUrl = "http://gateway.mlss.mf", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/mf/v1/result/id/${encodeURIComponent(String(args.resultId))}${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 };