export type DeleteApiApiWorkflowWorkflowIdRemoveArgs = {workflowId: string, archiveWorkflow?: boolean | undefined}; export type DeleteApiApiWorkflowWorkflowIdRemoveOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Removes the workflow from the system * * DELETE /api/workflow/{workflowId}/remove */ export const deleteApiApiWorkflowWorkflowIdRemove = async (args: DeleteApiApiWorkflowWorkflowIdRemoveArgs, options?: DeleteApiApiWorkflowWorkflowIdRemoveOptions) => { const {baseUrl = "https://developer.orkescloud.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.archiveWorkflow != null) query.append("archiveWorkflow", String(args.archiveWorkflow)) if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/workflow/${encodeURIComponent(String(args.workflowId))}/remove${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 };