export type Archivo = {height?: number | undefined, timestamp?: string | undefined, uri?: (string | null) | undefined, fileName?: (string | null) | undefined, data?: (string | null) | undefined}; export type CourseLessonCreateUpdateRqst = {courseLessonID?: number | undefined, courseID?: number | undefined, order?: number | undefined, title?: (string | null) | undefined, subtitle?: (string | null) | undefined, pdfFile?: Archivo | undefined, photo?: Archivo | undefined, video?: Archivo | undefined, description?: (string | null) | undefined, isActive?: boolean | undefined}; export type CreateApiV1ApiCourseLessonCreateUpdateLessonIdArgs = {lessonId: number, body: CourseLessonCreateUpdateRqst}; export type CreateApiV1ApiCourseLessonCreateUpdateLessonIdOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /v1/api/CourseLesson/CreateUpdate/{lessonId} */ export const createApiV1ApiCourseLessonCreateUpdateLessonId = async (args: CreateApiV1ApiCourseLessonCreateUpdateLessonIdArgs, options: CreateApiV1ApiCourseLessonCreateUpdateLessonIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/v1/api/CourseLesson/CreateUpdate/${encodeURIComponent(String(args.lessonId))}${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 };