export type Archivo = {height?: number | undefined, timestamp?: string | undefined, uri?: (string | null) | undefined, fileName?: (string | null) | undefined, data?: (string | null) | undefined}; export type CourseCreateUpdate = {courseID?: number | undefined, topicID?: number | undefined, title?: (string | null) | undefined, subtitle?: (string | null) | undefined, shortDescription?: (string | null) | undefined, description?: (string | null) | undefined, instructions?: (string | null) | undefined, image?: Archivo | undefined, video?: Archivo | undefined, points?: number | undefined, totalEmployees?: number | undefined, employeesCompleted?: number | undefined, startDate?: string | undefined, endDate?: string | undefined, isHardSkill?: boolean | undefined, isRecommended?: boolean | undefined, isActive?: boolean | undefined, paisID?: (number | null) | undefined, listaAccounts?: (Array | null) | undefined, listaStores?: (Array | null) | undefined}; export type UpdateApiV1ApiCourseCourseIdArgs = {courseId: number, body: CourseCreateUpdate}; export type UpdateApiV1ApiCourseCourseIdOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * PUT /v1/api/Course/{courseId} */ export const updateApiV1ApiCourseCourseId = async (args: UpdateApiV1ApiCourseCourseIdArgs, options: UpdateApiV1ApiCourseCourseIdOptions) => { 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/Course/${encodeURIComponent(String(args.courseId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };