export type ProphecisExperimentTagPutBasicInfo = {exp_id?: number | undefined, exp_tag?: string | undefined}; export type ProphecisExperimentPutBasicInfo = {exp_name?: string | undefined, exp_desc?: string | undefined, group_name?: string | undefined, tag_list?: Array | undefined}; export type UpdateApiDiV1ExperimentIdArgs = {id: number, body: ProphecisExperimentPutBasicInfo}; export type UpdateApiDiV1ExperimentIdOptions = {baseUrl?: string | undefined, basicAuthToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Put Experiment Basic Info * * PUT /di/v1/experiment/{id} * * Also accepts auth: watsonAuthToken, watsonAuthTokenQuery */ export const updateApiDiV1ExperimentId = async (args: UpdateApiDiV1ExperimentIdArgs, options?: UpdateApiDiV1ExperimentIdOptions) => { const {baseUrl = "https://di.prophecis.com", fetch: fetchFn = fetch, basicAuthToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (basicAuthToken !== undefined) headers.set("Authorization", basicAuthToken) const url = `${baseUrl.replace(/\/+$/, '')}/di/v1/experiment/${encodeURIComponent(String(args.id))}${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 };