export type DeleteApiWorkflowsWorkflowIdSubmissionsSubmissionIdArgs = {workflowId: string, submissionId: string, destroy?: boolean | undefined}; export type DeleteApiWorkflowsWorkflowIdSubmissionsSubmissionIdOptions = {baseUrl?: string | undefined, OAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Workflow Submission * * DELETE /workflows/{workflowId}/submissions/{submissionId} */ export const deleteApiWorkflowsWorkflowIdSubmissionsSubmissionId = async (args: DeleteApiWorkflowsWorkflowIdSubmissionsSubmissionIdArgs, options?: DeleteApiWorkflowsWorkflowIdSubmissionsSubmissionIdOptions) => { const {baseUrl = "https://env.unqork.io/api/1.0", fetch: fetchFn = fetch, OAuth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.destroy != null) query.append("destroy", String(args.destroy)) if (OAuth2 !== undefined) headers.set('authorization', `Bearer ${OAuth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/workflows/${encodeURIComponent(String(args.workflowId))}/submissions/${encodeURIComponent(String(args.submissionId))}${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 };