export type GetApiDiV1ExperimentRunIdKillArgs = {id: number}; export type GetApiDiV1ExperimentRunIdKillOptions = {baseUrl?: string | undefined, basicAuthToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Kill Experiment Run By Exec Id. * * GET /di/v1/experimentRun/{id}/kill * * Also accepts auth: watsonAuthToken, watsonAuthTokenQuery */ export const getApiDiV1ExperimentRunIdKill = async (args: GetApiDiV1ExperimentRunIdKillArgs, options?: GetApiDiV1ExperimentRunIdKillOptions) => { 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/v1/experimentRun/${encodeURIComponent(String(args.id))}/kill${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };