export type DeleteApiV2DatasetsDatasetIdClearArgs = {dataset_id: string}; export type DeleteApiV2DatasetsDatasetIdClearOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete all datapoints * * DELETE /v2/datasets/{dataset_id}/clear */ export const deleteApiV2DatasetsDatasetIdClear = async (args: DeleteApiV2DatasetsDatasetIdClearArgs, options?: DeleteApiV2DatasetsDatasetIdClearOptions) => { const {baseUrl = "https://my.orq.ai", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKey !== undefined) headers.set('authorization', `Bearer ${ApiKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/v2/datasets/${encodeURIComponent(String(args.dataset_id))}/clear${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 };