export type PatchApiV1WorkflowsWorkflowIdArgs = {workflowId: number}; export type PatchApiV1WorkflowsWorkflowIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * PATCH /v1/workflows/{workflowId} */ export const patchApiV1WorkflowsWorkflowId = async (args: PatchApiV1WorkflowsWorkflowIdArgs, options: PatchApiV1WorkflowsWorkflowIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v1/workflows/${encodeURIComponent(String(args.workflowId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };