export type PatchApiOfferingsOfferingIdAssessmentsAssessmentIdUserEmailArgs = {offeringId: string, assessmentId: string, userEmail: string, body: {dueDate?: string | undefined}}; export type PatchApiOfferingsOfferingIdAssessmentsAssessmentIdUserEmailOptions = {baseUrl?: string | undefined, Authorization?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update the due dates for a learner's quiz attempt * * PATCH /offerings/{offeringId}/assessments/{assessmentId}/{userEmail} */ export const patchApiOfferingsOfferingIdAssessmentsAssessmentIdUserEmail = async (args: PatchApiOfferingsOfferingIdAssessmentsAssessmentIdUserEmailArgs, options?: PatchApiOfferingsOfferingIdAssessmentsAssessmentIdUserEmailOptions) => { const {baseUrl = "https://api.iqualify.com/v1", fetch: fetchFn = fetch, Authorization} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Authorization !== undefined) headers.set("Authorization", Authorization) const url = `${baseUrl.replace(/\/+$/, '')}/offerings/${encodeURIComponent(String(args.offeringId))}/assessments/${encodeURIComponent(String(args.assessmentId))}/${encodeURIComponent(String(args.userEmail))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };