export type BatchDeleteExperimentsRequest = {ids?: Array | undefined}; export type DeleteApiDiV2ExperimentsArgs = {body: BatchDeleteExperimentsRequest}; export type DeleteApiDiV2ExperimentsOptions = {baseUrl?: string | undefined, basicAuthToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * BatchDeleteExperiments * * DELETE /di/v2/experiments * * Also accepts auth: watsonAuthToken, watsonAuthTokenQuery */ export const deleteApiDiV2Experiments = async (args: DeleteApiDiV2ExperimentsArgs, options?: DeleteApiDiV2ExperimentsOptions) => { 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/v2/experiments${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", 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 };