export type DeleteApiV1CustomHarnessesHarnessIdArgs = {harness_id: string, team_id?: (string | null) | undefined}; export type DeleteApiV1CustomHarnessesHarnessIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete Custom Harness * * DELETE /v1/custom-harnesses/{harness_id} */ export const deleteApiV1CustomHarnessesHarnessId = async (args: DeleteApiV1CustomHarnessesHarnessIdArgs, options: DeleteApiV1CustomHarnessesHarnessIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.team_id != null) query.append("team_id", String(args.team_id)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/custom-harnesses/${encodeURIComponent(String(args.harness_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 };