export type DeleteApiDiV2ExperimentExpIdVersionVersionNameArgs = {exp_id: string, version_name: string}; export type DeleteApiDiV2ExperimentExpIdVersionVersionNameOptions = {baseUrl?: string | undefined, basicAuthToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * DeleteExperimentVersion * * DELETE /di/v2/experiment/{exp_id}/version/{version_name} * * Also accepts auth: watsonAuthToken, watsonAuthTokenQuery */ export const deleteApiDiV2ExperimentExpIdVersionVersionName = async (args: DeleteApiDiV2ExperimentExpIdVersionVersionNameArgs, options?: DeleteApiDiV2ExperimentExpIdVersionVersionNameOptions) => { const {baseUrl = "https://di.prophecis.com", fetch: fetchFn = fetch, basicAuthToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (basicAuthToken !== undefined) headers.set("Authorization", basicAuthToken) const url = `${baseUrl.replace(/\/+$/, '')}/di/v2/experiment/${encodeURIComponent(String(args.exp_id))}/version/${encodeURIComponent(String(args.version_name))}${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 };