export type DeleteApiApiExpertsExpertIdWorkflowsWorkflowIdArgs = {expert_id: string, workflow_id: string}; export type DeleteApiApiExpertsExpertIdWorkflowsWorkflowIdOptions = {baseUrl: string, HTTPBearerJWT?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove Expert Workflow * * DELETE /api/experts/{expert_id}/workflows/{workflow_id} */ export const deleteApiApiExpertsExpertIdWorkflowsWorkflowId = async (args: DeleteApiApiExpertsExpertIdWorkflowsWorkflowIdArgs, options: DeleteApiApiExpertsExpertIdWorkflowsWorkflowIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, HTTPBearerJWT} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (HTTPBearerJWT !== undefined) headers.set('authorization', `Bearer ${HTTPBearerJWT}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/experts/${encodeURIComponent(String(args.expert_id))}/workflows/${encodeURIComponent(String(args.workflow_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 };