export type DeleteApiApiOrgIdExperimentsExperimentIdArgs = {org_id: string, experiment_id: string}; export type DeleteApiApiOrgIdExperimentsExperimentIdOptions = {baseUrl: string, Authorization?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an Experiment early and start its asynchronous cleanup. * * DELETE /api/{org_id}/experiments/{experiment_id} */ export const deleteApiApiOrgIdExperimentsExperimentId = async (args: DeleteApiApiOrgIdExperimentsExperimentIdArgs, options: DeleteApiApiOrgIdExperimentsExperimentIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, Authorization} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Authorization !== undefined) headers.set("Authorization", Authorization) const url = `${baseUrl.replace(/\/+$/, '')}/api/${encodeURIComponent(String(args.org_id))}/experiments/${encodeURIComponent(String(args.experiment_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 };