export type DeleteApiDiV2ExperimentExpIdArgs = {exp_id: string}; export type DeleteApiDiV2ExperimentExpIdOptions = {baseUrl?: string | undefined, basicAuthToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * DeleteExperiment * * DELETE /di/v2/experiment/{exp_id} * * Also accepts auth: watsonAuthToken, watsonAuthTokenQuery */ export const deleteApiDiV2ExperimentExpId = async (args: DeleteApiDiV2ExperimentExpIdArgs, options?: DeleteApiDiV2ExperimentExpIdOptions) => { 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))}${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 };