export type AIReportRegenerationRequestModel = {lessonID?: number | undefined, sectionsToRegenerate?: (Array | null) | undefined}; export type CreateApiLessonRegenerateLessonAIReportArgs = {'X-Version'?: string | undefined, body: AIReportRegenerationRequestModel}; export type CreateApiLessonRegenerateLessonAIReportOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Regenerates the AI Report for the specified lessonID. * SectionsToRegenerate: List of sectionIDs, you can specify individual sections to be regenerated, or leave as null/blank to regenerate all sections * SectionIDs: 0 = All, 1 = Essay, 2 = Resources (deprecated), 3 = Lesson Plan, 4 = Syllabus, 5 = Learning Objectives, 6 = Quizzes * * POST /Lesson/RegenerateLessonAIReport */ export const createApiLessonRegenerateLessonAIReport = async (args: CreateApiLessonRegenerateLessonAIReportArgs, options: CreateApiLessonRegenerateLessonAIReportOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['X-Version'] != null) headers.set("X-Version", String(args['X-Version'])) if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/Lesson/RegenerateLessonAIReport${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };