export type DeleteApiModulesModuleIdSubmissionsSubmissionIdArgs = {moduleId: string, submissionId: string, destroy?: boolean | undefined}; export type DeleteApiModulesModuleIdSubmissionsSubmissionIdOptions = {baseUrl?: string | undefined, OAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Module Submission * * DELETE /modules/{moduleId}/submissions/{submissionId} */ export const deleteApiModulesModuleIdSubmissionsSubmissionId = async (args: DeleteApiModulesModuleIdSubmissionsSubmissionIdArgs, options?: DeleteApiModulesModuleIdSubmissionsSubmissionIdOptions) => { 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(/\/+$/, '')}/modules/${encodeURIComponent(String(args.moduleId))}/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 };