diff --git a/src/gen/haClient/api.ts b/src/gen/haClient/api.ts index 036676734..0305fb879 100644 --- a/src/gen/haClient/api.ts +++ b/src/gen/haClient/api.ts @@ -4,7 +4,7 @@ * HEI Admin API * _Programmatically connect to a computer programming [school](https://hei.school)._ After [joining us](mailto:contact@hei.school), you can get an identification token from our [dev](https://dev-hei-admin.auth.eu-west-3.amazoncognito.com/oauth2/authorize?client_id=5s8cg50doahmu855rlc8fr6qmp&response_type=token&scope=email+openid&redirect_uri=https%3A%2F%2Fapi-dev.hei.school%2Fwhoami) or [prod](https://prod-hei-admin.auth.eu-west-3.amazoncognito.com/oauth2/authorize?client_id=i8bg538jpfu6mqmqb61m26trd&response_type=token&scope=email+openid&redirect_uri=https%3A%2F%2Fapi-prod.hei.school%2Fwhoami) authentication service. Then, start playing with our system! The implementation of our API is [publicly disclosed](https://github.com/hei-school/hei-admin-api). You are welcome to try and compromise it. Happy hacking! * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,8 +12,9 @@ * Do not edit the class manually. */ -import { Configuration } from './configuration' -import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios' +import type { Configuration } from './configuration' +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios' +import globalAxios from 'axios' // Some imports not used depending on template conditions // @ts-ignore import { @@ -28,9 +29,105 @@ import { toPathString, createRequestFunction } from './common' +import type { RequestArgs } from './base' // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base' +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base' +/** + * + * @export + * @enum {string} + */ + +export const AttendanceMovementType = { + In: 'IN', + Out: 'OUT' +} as const + +export type AttendanceMovementType = (typeof AttendanceMovementType)[keyof typeof AttendanceMovementType] + +/** + * + * @export + * @enum {string} + */ + +export const AttendanceStatus = { + Missing: 'MISSING', + Late: 'LATE', + Present: 'PRESENT' +} as const + +export type AttendanceStatus = (typeof AttendanceStatus)[keyof typeof AttendanceStatus] + +/** + * + * @export + * @interface AwardedCourse + */ +export interface AwardedCourse { + /** + * + * @type {string} + * @memberof AwardedCourse + */ + id?: string + /** + * + * @type {Teacher} + * @memberof AwardedCourse + */ + main_teacher?: Teacher + /** + * + * @type {Course} + * @memberof AwardedCourse + */ + course?: Course + /** + * + * @type {Group} + * @memberof AwardedCourse + */ + group?: Group +} +/** + * + * @export + * @interface AwardedCourseExam + */ +export interface AwardedCourseExam { + /** + * + * @type {Array} + * @memberof AwardedCourseExam + */ + exams?: Array + /** + * + * @type {string} + * @memberof AwardedCourseExam + */ + id?: string + /** + * + * @type {Teacher} + * @memberof AwardedCourseExam + */ + main_teacher?: Teacher + /** + * + * @type {Course} + * @memberof AwardedCourseExam + */ + course?: Course + /** + * + * @type {Group} + * @memberof AwardedCourseExam + */ + group?: Group +} /** * * @export @@ -56,12 +153,6 @@ export interface BadRequestException { * @interface Course */ export interface Course { - /** - * - * @type {Teacher} - * @memberof Course - */ - main_teacher?: Teacher /** * * @type {string} @@ -109,16 +200,34 @@ export type CourseDirection = (typeof CourseDirection)[keyof typeof CourseDirect /** * * @export - * @enum {string} + * @interface CourseSession */ - -export const CourseStatus = { - Linked: 'LINKED', - Unlinked: 'UNLINKED' -} as const - -export type CourseStatus = (typeof CourseStatus)[keyof typeof CourseStatus] - +export interface CourseSession { + /** + * + * @type {string} + * @memberof CourseSession + */ + id?: string + /** + * + * @type {AwardedCourse} + * @memberof CourseSession + */ + awareded_course?: AwardedCourse + /** + * + * @type {string} + * @memberof CourseSession + */ + begin?: string + /** + * + * @type {string} + * @memberof CourseSession + */ + end?: string +} /** * * @export @@ -156,6 +265,69 @@ export interface CourseTemplate { */ total_hours?: number } +/** + * + * @export + * @interface CreateAttendanceMovement + */ +export interface CreateAttendanceMovement { + /** + * + * @type {string} + * @memberof CreateAttendanceMovement + */ + student_id?: string + /** + * + * @type {string} + * @memberof CreateAttendanceMovement + */ + created_at?: string + /** + * + * @type {AttendanceMovementType} + * @memberof CreateAttendanceMovement + */ + attendance_movement_type?: AttendanceMovementType + /** + * + * @type {PlaceEnum} + * @memberof CreateAttendanceMovement + */ + place?: PlaceEnum +} + +/** + * + * @export + * @interface CreateAwardedCourse + */ +export interface CreateAwardedCourse { + /** + * + * @type {string} + * @memberof CreateAwardedCourse + */ + id?: string + /** + * + * @type {string} + * @memberof CreateAwardedCourse + */ + main_teacher_id?: string + /** + * + * @type {string} + * @memberof CreateAwardedCourse + */ + course_id?: string + /** + * + * @type {string} + * @memberof CreateAwardedCourse + */ + group_id?: string +} /** * * @export @@ -243,84 +415,66 @@ export type CreateFeeTypeEnum = (typeof CreateFeeTypeEnum)[keyof typeof CreateFe /** * * @export - * @interface CreateOrUpdateStudents200ResponseInner + * @interface CreateGrade */ -export interface CreateOrUpdateStudents200ResponseInner { - /** - * - * @type {string} - * @memberof CreateOrUpdateStudents200ResponseInner - */ - id?: string +export interface CreateGrade { /** * - * @type {string} - * @memberof CreateOrUpdateStudents200ResponseInner - */ - ref?: string - /** - * - * @type {string} - * @memberof CreateOrUpdateStudents200ResponseInner - */ - first_name?: string - /** - * - * @type {string} - * @memberof CreateOrUpdateStudents200ResponseInner + * @type {number} + * @memberof CreateGrade */ - last_name?: string + score?: number /** * * @type {string} - * @memberof CreateOrUpdateStudents200ResponseInner + * @memberof CreateGrade */ - email?: string + student_id?: string /** * * @type {string} - * @memberof CreateOrUpdateStudents200ResponseInner + * @memberof CreateGrade */ - sex?: CreateOrUpdateStudents200ResponseInnerSexEnum + exam_id?: string /** * * @type {string} - * @memberof CreateOrUpdateStudents200ResponseInner + * @memberof CreateGrade */ - birth_date?: string + awarded_course_id?: string +} +/** + * + * @export + * @interface CreateGroupFlow + */ +export interface CreateGroupFlow { /** * * @type {string} - * @memberof CreateOrUpdateStudents200ResponseInner + * @memberof CreateGroupFlow */ - address?: string + MoveType?: CreateGroupFlowMoveTypeEnum /** * * @type {string} - * @memberof CreateOrUpdateStudents200ResponseInner + * @memberof CreateGroupFlow */ - phone?: string + groupId?: string /** * * @type {string} - * @memberof CreateOrUpdateStudents200ResponseInner + * @memberof CreateGroupFlow */ - entrance_datetime?: string - /** - * - * @type {EnableStatus} - * @memberof CreateOrUpdateStudents200ResponseInner - */ - status?: EnableStatus + studentId?: string } -export const CreateOrUpdateStudents200ResponseInnerSexEnum = { - M: 'M', - F: 'F' +export const CreateGroupFlowMoveTypeEnum = { + Join: 'JOIN', + Leave: 'LEAVE' } as const -export type CreateOrUpdateStudents200ResponseInnerSexEnum = - (typeof CreateOrUpdateStudents200ResponseInnerSexEnum)[keyof typeof CreateOrUpdateStudents200ResponseInnerSexEnum] +export type CreateGroupFlowMoveTypeEnum = (typeof CreateGroupFlowMoveTypeEnum)[keyof typeof CreateGroupFlowMoveTypeEnum] /** * @@ -357,49 +511,6 @@ export const CreatePaymentTypeEnum = { export type CreatePaymentTypeEnum = (typeof CreatePaymentTypeEnum)[keyof typeof CreatePaymentTypeEnum] -/** - * - * @export - * @interface CrupdateCourse - */ -export interface CrupdateCourse { - /** - * - * @type {string} - * @memberof CrupdateCourse - */ - main_teacher_id?: string - /** - * - * @type {string} - * @memberof CrupdateCourse - */ - id?: string - /** - * - * @type {string} - * @memberof CrupdateCourse - */ - code?: string - /** - * - * @type {string} - * @memberof CrupdateCourse - */ - name?: string - /** - * - * @type {number} - * @memberof CrupdateCourse - */ - credits?: number - /** - * - * @type {number} - * @memberof CrupdateCourse - */ - total_hours?: number -} /** * * @export @@ -499,6 +610,12 @@ export interface ExamDetail { * @memberof ExamDetail */ examination_date?: string + /** + * + * @type {string} + * @memberof ExamDetail + */ + awarded_course_id?: string } /** * @@ -530,6 +647,12 @@ export interface ExamInfo { * @memberof ExamInfo */ examination_date?: string + /** + * + * @type {string} + * @memberof ExamInfo + */ + awarded_course_id?: string } /** * @@ -638,6 +761,12 @@ export type FeeTypeEnum = (typeof FeeTypeEnum)[keyof typeof FeeTypeEnum] * @interface Grade */ export interface Grade { + /** + * + * @type {string} + * @memberof Grade + */ + id?: string /** * * @type {number} @@ -685,56 +814,101 @@ export interface Group { /** * * @export - * @interface InternalServerException - */ -export interface InternalServerException { - /** - * - * @type {string} - * @memberof InternalServerException - */ - type?: string - /** - * - * @type {string} - * @memberof InternalServerException - */ - message?: string -} -/** - * - * @export - * @interface Manager + * @interface GroupFlow */ -export interface Manager { +export interface GroupFlow { /** * * @type {string} - * @memberof Manager + * @memberof GroupFlow */ id?: string /** * * @type {string} - * @memberof Manager + * @memberof GroupFlow */ - ref?: string + flowdDateTime?: string /** * * @type {string} - * @memberof Manager + * @memberof GroupFlow */ - first_name?: string + MoveType?: GroupFlowMoveTypeEnum /** * * @type {string} - * @memberof Manager + * @memberof GroupFlow */ - last_name?: string + groupId?: string /** * * @type {string} - * @memberof Manager + * @memberof GroupFlow + */ + studentId?: string +} + +export const GroupFlowMoveTypeEnum = { + Join: 'JOIN', + Leave: 'LEAVE' +} as const + +export type GroupFlowMoveTypeEnum = (typeof GroupFlowMoveTypeEnum)[keyof typeof GroupFlowMoveTypeEnum] + +/** + * + * @export + * @interface InternalServerException + */ +export interface InternalServerException { + /** + * + * @type {string} + * @memberof InternalServerException + */ + type?: string + /** + * + * @type {string} + * @memberof InternalServerException + */ + message?: string +} +/** + * + * @export + * @interface Manager + */ +export interface Manager { + /** + * + * @type {string} + * @memberof Manager + */ + id?: string + /** + * + * @type {string} + * @memberof Manager + */ + ref?: string + /** + * + * @type {string} + * @memberof Manager + */ + first_name?: string + /** + * + * @type {string} + * @memberof Manager + */ + last_name?: string + /** + * + * @type {string} + * @memberof Manager */ email?: string /** @@ -801,19 +975,6 @@ export interface NotAuthorizedException { */ message?: string } -/** - * - * @export - * @enum {string} - */ - -export const Order = { - Asc: 'ASC', - Desc: 'DESC' -} as const - -export type Order = (typeof Order)[keyof typeof Order] - /** * * @export @@ -867,6 +1028,19 @@ export const PaymentTypeEnum = { export type PaymentTypeEnum = (typeof PaymentTypeEnum)[keyof typeof PaymentTypeEnum] +/** + * + * @export + * @enum {string} + */ + +export const PlaceEnum = { + Ivandry: 'IVANDRY', + Andraharo: 'ANDRAHARO' +} as const + +export type PlaceEnum = (typeof PlaceEnum)[keyof typeof PlaceEnum] + /** * * @export @@ -970,46 +1144,91 @@ export type StudentSexEnum = (typeof StudentSexEnum)[keyof typeof StudentSexEnum /** * * @export - * @interface StudentCourseExam + * @interface StudentAttendance */ -export interface StudentCourseExam { +export interface StudentAttendance { /** * - * @type {Array} - * @memberof StudentCourseExam + * @type {string} + * @memberof StudentAttendance */ - exams?: Array + id?: string /** * * @type {string} - * @memberof StudentCourseExam + * @memberof StudentAttendance */ - id?: string + created_at?: string + /** + * if the student is late, that defines how late he or she is + * @type {number} + * @memberof StudentAttendance + */ + late_of?: number + /** + * + * @type {PlaceEnum} + * @memberof StudentAttendance + */ + place?: PlaceEnum + /** + * + * @type {boolean} + * @memberof StudentAttendance + */ + is_late?: boolean + /** + * + * @type {CourseSession} + * @memberof StudentAttendance + */ + course_session?: CourseSession + /** + * + * @type {Student} + * @memberof StudentAttendance + */ + student?: Student +} + +/** + * + * @export + * @interface StudentAttendanceMovement + */ +export interface StudentAttendanceMovement { /** * * @type {string} - * @memberof StudentCourseExam + * @memberof StudentAttendanceMovement */ - code?: string + id?: string + /** + * + * @type {AttendanceMovementType} + * @memberof StudentAttendanceMovement + */ + attendance_movement_type?: AttendanceMovementType /** * * @type {string} - * @memberof StudentCourseExam + * @memberof StudentAttendanceMovement */ - name?: string + created_at?: string /** * - * @type {number} - * @memberof StudentCourseExam + * @type {PlaceEnum} + * @memberof StudentAttendanceMovement */ - credits?: number + place?: PlaceEnum /** * - * @type {number} - * @memberof StudentCourseExam + * @type {Student} + * @memberof StudentAttendanceMovement */ - total_hours?: number + student?: Student } + /** * * @export @@ -1046,6 +1265,12 @@ export interface StudentExamGrade { * @memberof StudentExamGrade */ examination_date?: string + /** + * + * @type {string} + * @memberof StudentExamGrade + */ + awarded_course_id?: string } /** * @@ -1190,44 +1415,6 @@ export interface TooManyRequestsException { */ message?: string } -/** - * - * @export - * @interface UpdateStudentCourse - */ -export interface UpdateStudentCourse { - /** - * - * @type {string} - * @memberof UpdateStudentCourse - */ - course_id?: string - /** - * - * @type {CourseStatus} - * @memberof UpdateStudentCourse - */ - status?: CourseStatus -} -/** - * - * @export - * @interface UpdateStudentGrade - */ -export interface UpdateStudentGrade { - /** - * - * @type {string} - * @memberof UpdateStudentGrade - */ - student_id?: string - /** - * - * @type {number} - * @memberof UpdateStudentGrade - */ - score?: number -} /** * * @export @@ -1309,57 +1496,6 @@ export const UserSexEnum = { export type UserSexEnum = (typeof UserSexEnum)[keyof typeof UserSexEnum] -/** - * - * @export - * @interface UserAllOf - */ -export interface UserAllOf { - /** - * - * @type {string} - * @memberof UserAllOf - */ - sex?: UserAllOfSexEnum - /** - * - * @type {string} - * @memberof UserAllOf - */ - birth_date?: string - /** - * - * @type {string} - * @memberof UserAllOf - */ - address?: string - /** - * - * @type {string} - * @memberof UserAllOf - */ - phone?: string - /** - * - * @type {string} - * @memberof UserAllOf - */ - entrance_datetime?: string - /** - * - * @type {EnableStatus} - * @memberof UserAllOf - */ - status?: EnableStatus -} - -export const UserAllOfSexEnum = { - M: 'M', - F: 'F' -} as const - -export type UserAllOfSexEnum = (typeof UserAllOfSexEnum)[keyof typeof UserAllOfSexEnum] - /** * * @export @@ -1432,22 +1568,22 @@ export const WhoamiRoleEnum = { export type WhoamiRoleEnum = (typeof WhoamiRoleEnum)[keyof typeof WhoamiRoleEnum] /** - * PayingApi - axios parameter creator + * AttendanceApi - axios parameter creator * @export */ -export const PayingApiAxiosParamCreator = function (configuration?: Configuration) { +export const AttendanceApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * - * @summary Change current delay penalty configuration - * @param {CreateDelayPenaltyChange} createDelayPenaltyChange Delay penalties to create + * @summary Create attendance movement of one student + * @param {Array} createAttendanceMovement Attendance movement to create * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createDelayPenaltyChange: async (createDelayPenaltyChange: CreateDelayPenaltyChange, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'createDelayPenaltyChange' is not null or undefined - assertParamExists('createDelayPenaltyChange', 'createDelayPenaltyChange', createDelayPenaltyChange) - const localVarPath = `/delay_penalty_change` + createAttendanceMovement: async (createAttendanceMovement: Array, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'createAttendanceMovement' is not null or undefined + assertParamExists('createAttendanceMovement', 'createAttendanceMovement', createAttendanceMovement) + const localVarPath = `/attendance/movement` // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) let baseOptions @@ -1468,7 +1604,7 @@ export const PayingApiAxiosParamCreator = function (configuration?: Configuratio setSearchParams(localVarUrlObj, localVarQueryParameter) let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } - localVarRequestOptions.data = serializeDataIfNeeded(createDelayPenaltyChange, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(createAttendanceMovement, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -1477,18 +1613,30 @@ export const PayingApiAxiosParamCreator = function (configuration?: Configuratio }, /** * - * @summary Create student fees - * @param {string} studentId - * @param {Array} createFee Student fees to create + * @summary Get all attendances by courses ids or student key word + * @param {number} [page] + * @param {number} [pageSize] + * @param {Array} [coursesIds] Filter attendance by courses ids + * @param {Array} [teachersIds] Filter attendance by teachers ids + * @param {string} [studentKeyWord] Filter attendance by student `ref, lastname, firstname` + * @param {string} [from] Filter attendance from a date, return attendances of the current week by default + * @param {string} [to] Filter attendance before a date, return attendances of the current week by default + * @param {Array} [attendanceStatuses] Filter attendance by attendance status value * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createStudentFees: async (studentId: string, createFee: Array, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'studentId' is not null or undefined - assertParamExists('createStudentFees', 'studentId', studentId) - // verify required parameter 'createFee' is not null or undefined - assertParamExists('createStudentFees', 'createFee', createFee) - const localVarPath = `/students/{student_id}/fees`.replace(`{${'student_id'}}`, encodeURIComponent(String(studentId))) + getStudentsAttendance: async ( + page?: number, + pageSize?: number, + coursesIds?: Array, + teachersIds?: Array, + studentKeyWord?: string, + from?: string, + to?: string, + attendanceStatuses?: Array, + options: AxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/attendance` // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) let baseOptions @@ -1496,7 +1644,7 @@ export const PayingApiAxiosParamCreator = function (configuration?: Configuratio baseOptions = configuration.baseOptions } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options } + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options } const localVarHeaderParameter = {} as any const localVarQueryParameter = {} as any @@ -1504,32 +1652,313 @@ export const PayingApiAxiosParamCreator = function (configuration?: Configuratio // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) - localVarHeaderParameter['Content-Type'] = 'application/json' + if (page !== undefined) { + localVarQueryParameter['page'] = page + } + + if (pageSize !== undefined) { + localVarQueryParameter['page_size'] = pageSize + } + + if (coursesIds) { + localVarQueryParameter['courses_ids'] = coursesIds + } + + if (teachersIds) { + localVarQueryParameter['teachers_ids'] = teachersIds + } + + if (studentKeyWord !== undefined) { + localVarQueryParameter['student_key_word'] = studentKeyWord + } + + if (from !== undefined) { + localVarQueryParameter['from'] = (from as any) instanceof Date ? (from as any).toISOString() : from + } + + if (to !== undefined) { + localVarQueryParameter['to'] = (to as any) instanceof Date ? (to as any).toISOString() : to + } + + if (attendanceStatuses) { + localVarQueryParameter['attendance_statuses'] = attendanceStatuses + } setSearchParams(localVarUrlObj, localVarQueryParameter) let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } - localVarRequestOptions.data = serializeDataIfNeeded(createFee, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions } - }, + } + } +} + +/** + * AttendanceApi - functional programming interface + * @export + */ +export const AttendanceApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = AttendanceApiAxiosParamCreator(configuration) + return { /** * - * @summary Create student payments - * @param {string} studentId - * @param {string} feeId - * @param {Array} createPayment Student payments to create + * @summary Create attendance movement of one student + * @param {Array} createAttendanceMovement Attendance movement to create * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createStudentPayments: async ( - studentId: string, - feeId: string, - createPayment: Array, - options: AxiosRequestConfig = {} + async createAttendanceMovement( + createAttendanceMovement: Array, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createAttendanceMovement(createAttendanceMovement, options) + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) + }, + /** + * + * @summary Get all attendances by courses ids or student key word + * @param {number} [page] + * @param {number} [pageSize] + * @param {Array} [coursesIds] Filter attendance by courses ids + * @param {Array} [teachersIds] Filter attendance by teachers ids + * @param {string} [studentKeyWord] Filter attendance by student `ref, lastname, firstname` + * @param {string} [from] Filter attendance from a date, return attendances of the current week by default + * @param {string} [to] Filter attendance before a date, return attendances of the current week by default + * @param {Array} [attendanceStatuses] Filter attendance by attendance status value + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getStudentsAttendance( + page?: number, + pageSize?: number, + coursesIds?: Array, + teachersIds?: Array, + studentKeyWord?: string, + from?: string, + to?: string, + attendanceStatuses?: Array, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getStudentsAttendance( + page, + pageSize, + coursesIds, + teachersIds, + studentKeyWord, + from, + to, + attendanceStatuses, + options + ) + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) + } + } +} + +/** + * AttendanceApi - factory interface + * @export + */ +export const AttendanceApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = AttendanceApiFp(configuration) + return { + /** + * + * @summary Create attendance movement of one student + * @param {Array} createAttendanceMovement Attendance movement to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createAttendanceMovement(createAttendanceMovement: Array, options?: any): AxiosPromise> { + return localVarFp.createAttendanceMovement(createAttendanceMovement, options).then(request => request(axios, basePath)) + }, + /** + * + * @summary Get all attendances by courses ids or student key word + * @param {number} [page] + * @param {number} [pageSize] + * @param {Array} [coursesIds] Filter attendance by courses ids + * @param {Array} [teachersIds] Filter attendance by teachers ids + * @param {string} [studentKeyWord] Filter attendance by student `ref, lastname, firstname` + * @param {string} [from] Filter attendance from a date, return attendances of the current week by default + * @param {string} [to] Filter attendance before a date, return attendances of the current week by default + * @param {Array} [attendanceStatuses] Filter attendance by attendance status value + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getStudentsAttendance( + page?: number, + pageSize?: number, + coursesIds?: Array, + teachersIds?: Array, + studentKeyWord?: string, + from?: string, + to?: string, + attendanceStatuses?: Array, + options?: any + ): AxiosPromise> { + return localVarFp + .getStudentsAttendance(page, pageSize, coursesIds, teachersIds, studentKeyWord, from, to, attendanceStatuses, options) + .then(request => request(axios, basePath)) + } + } +} + +/** + * AttendanceApi - object-oriented interface + * @export + * @class AttendanceApi + * @extends {BaseAPI} + */ +export class AttendanceApi extends BaseAPI { + /** + * + * @summary Create attendance movement of one student + * @param {Array} createAttendanceMovement Attendance movement to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AttendanceApi + */ + public createAttendanceMovement(createAttendanceMovement: Array, options?: AxiosRequestConfig) { + return AttendanceApiFp(this.configuration) + .createAttendanceMovement(createAttendanceMovement, options) + .then(request => request(this.axios, this.basePath)) + } + + /** + * + * @summary Get all attendances by courses ids or student key word + * @param {number} [page] + * @param {number} [pageSize] + * @param {Array} [coursesIds] Filter attendance by courses ids + * @param {Array} [teachersIds] Filter attendance by teachers ids + * @param {string} [studentKeyWord] Filter attendance by student `ref, lastname, firstname` + * @param {string} [from] Filter attendance from a date, return attendances of the current week by default + * @param {string} [to] Filter attendance before a date, return attendances of the current week by default + * @param {Array} [attendanceStatuses] Filter attendance by attendance status value + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AttendanceApi + */ + public getStudentsAttendance( + page?: number, + pageSize?: number, + coursesIds?: Array, + teachersIds?: Array, + studentKeyWord?: string, + from?: string, + to?: string, + attendanceStatuses?: Array, + options?: AxiosRequestConfig + ) { + return AttendanceApiFp(this.configuration) + .getStudentsAttendance(page, pageSize, coursesIds, teachersIds, studentKeyWord, from, to, attendanceStatuses, options) + .then(request => request(this.axios, this.basePath)) + } +} + +/** + * PayingApi - axios parameter creator + * @export + */ +export const PayingApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Change current delay penalty configuration + * @param {CreateDelayPenaltyChange} createDelayPenaltyChange Delay penalties to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createDelayPenaltyChange: async (createDelayPenaltyChange: CreateDelayPenaltyChange, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'createDelayPenaltyChange' is not null or undefined + assertParamExists('createDelayPenaltyChange', 'createDelayPenaltyChange', createDelayPenaltyChange) + const localVarPath = `/delay_penalty_change` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + localVarHeaderParameter['Content-Type'] = 'application/json' + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } + localVarRequestOptions.data = serializeDataIfNeeded(createDelayPenaltyChange, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions + } + }, + /** + * + * @summary Create student fees + * @param {string} studentId + * @param {Array} createFee Student fees to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createStudentFees: async (studentId: string, createFee: Array, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'studentId' is not null or undefined + assertParamExists('createStudentFees', 'studentId', studentId) + // verify required parameter 'createFee' is not null or undefined + assertParamExists('createStudentFees', 'createFee', createFee) + const localVarPath = `/students/{student_id}/fees`.replace(`{${'student_id'}}`, encodeURIComponent(String(studentId))) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + localVarHeaderParameter['Content-Type'] = 'application/json' + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } + localVarRequestOptions.data = serializeDataIfNeeded(createFee, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions + } + }, + /** + * + * @summary Create student payments + * @param {string} studentId + * @param {string} feeId + * @param {Array} createPayment Student payments to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createStudentPayments: async ( + studentId: string, + feeId: string, + createPayment: Array, + options: AxiosRequestConfig = {} ): Promise => { // verify required parameter 'studentId' is not null or undefined assertParamExists('createStudentPayments', 'studentId', studentId) @@ -1602,13 +2031,13 @@ export const PayingApiAxiosParamCreator = function (configuration?: Configuratio /** * * @summary Get all student fees filtered by status - * @param {'UNPAID' | 'LATE' | 'PAID'} [status] See the PaymentStatus object for its value. + * @param {GetFeesStatusEnum} [status] See the PaymentStatus object for its value. * @param {number} [page] * @param {number} [pageSize] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getFees: async (status?: 'UNPAID' | 'LATE' | 'PAID', page?: number, pageSize?: number, options: AxiosRequestConfig = {}): Promise => { + getFees: async (status?: GetFeesStatusEnum, page?: number, pageSize?: number, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/fees` // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) @@ -1692,7 +2121,7 @@ export const PayingApiAxiosParamCreator = function (configuration?: Configuratio * @param {string} studentId * @param {number} [page] * @param {number} [pageSize] - * @param {'UNPAID' | 'PAID' | 'LATE'} [status] + * @param {GetStudentFeesStatusEnum} [status] * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -1700,7 +2129,7 @@ export const PayingApiAxiosParamCreator = function (configuration?: Configuratio studentId: string, page?: number, pageSize?: number, - status?: 'UNPAID' | 'PAID' | 'LATE', + status?: GetStudentFeesStatusEnum, options: AxiosRequestConfig = {} ): Promise => { // verify required parameter 'studentId' is not null or undefined @@ -1863,14 +2292,14 @@ export const PayingApiFp = function (configuration?: Configuration) { /** * * @summary Get all student fees filtered by status - * @param {'UNPAID' | 'LATE' | 'PAID'} [status] See the PaymentStatus object for its value. + * @param {GetFeesStatusEnum} [status] See the PaymentStatus object for its value. * @param {number} [page] * @param {number} [pageSize] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getFees( - status?: 'UNPAID' | 'LATE' | 'PAID', + status?: GetFeesStatusEnum, page?: number, pageSize?: number, options?: AxiosRequestConfig @@ -1900,7 +2329,7 @@ export const PayingApiFp = function (configuration?: Configuration) { * @param {string} studentId * @param {number} [page] * @param {number} [pageSize] - * @param {'UNPAID' | 'PAID' | 'LATE'} [status] + * @param {GetStudentFeesStatusEnum} [status] * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -1908,7 +2337,7 @@ export const PayingApiFp = function (configuration?: Configuration) { studentId: string, page?: number, pageSize?: number, - status?: 'UNPAID' | 'PAID' | 'LATE', + status?: GetStudentFeesStatusEnum, options?: AxiosRequestConfig ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getStudentFees(studentId, page, pageSize, status, options) @@ -1989,13 +2418,13 @@ export const PayingApiFactory = function (configuration?: Configuration, basePat /** * * @summary Get all student fees filtered by status - * @param {'UNPAID' | 'LATE' | 'PAID'} [status] See the PaymentStatus object for its value. + * @param {GetFeesStatusEnum} [status] See the PaymentStatus object for its value. * @param {number} [page] * @param {number} [pageSize] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getFees(status?: 'UNPAID' | 'LATE' | 'PAID', page?: number, pageSize?: number, options?: any): AxiosPromise> { + getFees(status?: GetFeesStatusEnum, page?: number, pageSize?: number, options?: any): AxiosPromise> { return localVarFp.getFees(status, page, pageSize, options).then(request => request(axios, basePath)) }, /** @@ -2015,11 +2444,11 @@ export const PayingApiFactory = function (configuration?: Configuration, basePat * @param {string} studentId * @param {number} [page] * @param {number} [pageSize] - * @param {'UNPAID' | 'PAID' | 'LATE'} [status] + * @param {GetStudentFeesStatusEnum} [status] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getStudentFees(studentId: string, page?: number, pageSize?: number, status?: 'UNPAID' | 'PAID' | 'LATE', options?: any): AxiosPromise> { + getStudentFees(studentId: string, page?: number, pageSize?: number, status?: GetStudentFeesStatusEnum, options?: any): AxiosPromise> { return localVarFp.getStudentFees(studentId, page, pageSize, status, options).then(request => request(axios, basePath)) }, /** @@ -2106,14 +2535,14 @@ export class PayingApi extends BaseAPI { /** * * @summary Get all student fees filtered by status - * @param {'UNPAID' | 'LATE' | 'PAID'} [status] See the PaymentStatus object for its value. + * @param {GetFeesStatusEnum} [status] See the PaymentStatus object for its value. * @param {number} [page] * @param {number} [pageSize] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PayingApi */ - public getFees(status?: 'UNPAID' | 'LATE' | 'PAID', page?: number, pageSize?: number, options?: AxiosRequestConfig) { + public getFees(status?: GetFeesStatusEnum, page?: number, pageSize?: number, options?: AxiosRequestConfig) { return PayingApiFp(this.configuration) .getFees(status, page, pageSize, options) .then(request => request(this.axios, this.basePath)) @@ -2140,12 +2569,12 @@ export class PayingApi extends BaseAPI { * @param {string} studentId * @param {number} [page] * @param {number} [pageSize] - * @param {'UNPAID' | 'PAID' | 'LATE'} [status] + * @param {GetStudentFeesStatusEnum} [status] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PayingApi */ - public getStudentFees(studentId: string, page?: number, pageSize?: number, status?: 'UNPAID' | 'PAID' | 'LATE', options?: AxiosRequestConfig) { + public getStudentFees(studentId: string, page?: number, pageSize?: number, status?: GetStudentFeesStatusEnum, options?: AxiosRequestConfig) { return PayingApiFp(this.configuration) .getStudentFees(studentId, page, pageSize, status, options) .then(request => request(this.axios, this.basePath)) @@ -2169,6 +2598,25 @@ export class PayingApi extends BaseAPI { } } +/** + * @export + */ +export const GetFeesStatusEnum = { + Unpaid: 'UNPAID', + Late: 'LATE', + Paid: 'PAID' +} as const +export type GetFeesStatusEnum = (typeof GetFeesStatusEnum)[keyof typeof GetFeesStatusEnum] +/** + * @export + */ +export const GetStudentFeesStatusEnum = { + Unpaid: 'UNPAID', + Paid: 'PAID', + Late: 'LATE' +} as const +export type GetStudentFeesStatusEnum = (typeof GetStudentFeesStatusEnum)[keyof typeof GetStudentFeesStatusEnum] + /** * SecurityApi - axios parameter creator * @export @@ -2341,16 +2789,23 @@ export class SecurityApi extends BaseAPI { export const TeachingApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * Update groups when `id` are provided, create them otherwise. - * @summary Create new groups or update existing groups - * @param {Array} group Groups to update + * Update awarded_courses when `id` are provided, create them otherwise. + * @summary Create new awarded_courses or update existing awarded_courses + * @param {string} id + * @param {Array} createAwardedCourse Awarded_courses to update * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createOrUpdateGroups: async (group: Array, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'group' is not null or undefined - assertParamExists('createOrUpdateGroups', 'group', group) - const localVarPath = `/groups` + createOrUpdateAwardedCourses: async ( + id: string, + createAwardedCourse: Array, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('createOrUpdateAwardedCourses', 'id', id) + // verify required parameter 'createAwardedCourse' is not null or undefined + assertParamExists('createOrUpdateAwardedCourses', 'createAwardedCourse', createAwardedCourse) + const localVarPath = `/groups/{id}/awarded_courses`.replace(`{${'id'}}`, encodeURIComponent(String(id))) // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) let baseOptions @@ -2371,7 +2826,7 @@ export const TeachingApiAxiosParamCreator = function (configuration?: Configurat setSearchParams(localVarUrlObj, localVarQueryParameter) let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } - localVarRequestOptions.data = serializeDataIfNeeded(group, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(createAwardedCourse, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -2379,15 +2834,15 @@ export const TeachingApiAxiosParamCreator = function (configuration?: Configurat } }, /** - * Update courses when id are provided, create them otherwise. - * @summary Crupdate courses - * @param {Array} crupdateCourse + * Update courses when `id` are provided, create them otherwise. + * @summary Create new courses or update existing courses + * @param {Array} course Courses to update * @param {*} [options] Override http request option. * @throws {RequiredError} */ - crupdateCourses: async (crupdateCourse: Array, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'crupdateCourse' is not null or undefined - assertParamExists('crupdateCourses', 'crupdateCourse', crupdateCourse) + createOrUpdateCourses: async (course: Array, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'course' is not null or undefined + assertParamExists('createOrUpdateCourses', 'course', course) const localVarPath = `/courses` // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) @@ -2409,7 +2864,7 @@ export const TeachingApiAxiosParamCreator = function (configuration?: Configurat setSearchParams(localVarUrlObj, localVarQueryParameter) let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } - localVarRequestOptions.data = serializeDataIfNeeded(crupdateCourse, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(course, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -2417,19 +2872,29 @@ export const TeachingApiAxiosParamCreator = function (configuration?: Configurat } }, /** - * - * @summary Update exams if ID is provided, otherwise create new exams of the specified course. - * @param {string} courseId - * @param {Array} examInfo + * Update exams when `id` are provided, create them otherwise. + * @summary Create new exams or update existing exams + * @param {string} groupId + * @param {string} awardedCourseId + * @param {Array} examInfo Exams to update * @param {*} [options] Override http request option. * @throws {RequiredError} */ - crupdateExams: async (courseId: string, examInfo: Array, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'courseId' is not null or undefined - assertParamExists('crupdateExams', 'courseId', courseId) + createOrUpdateExams: async ( + groupId: string, + awardedCourseId: string, + examInfo: Array, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'groupId' is not null or undefined + assertParamExists('createOrUpdateExams', 'groupId', groupId) + // verify required parameter 'awardedCourseId' is not null or undefined + assertParamExists('createOrUpdateExams', 'awardedCourseId', awardedCourseId) // verify required parameter 'examInfo' is not null or undefined - assertParamExists('crupdateExams', 'examInfo', examInfo) - const localVarPath = `/courses/{course_id}/exams`.replace(`{${'course_id'}}`, encodeURIComponent(String(courseId))) + assertParamExists('createOrUpdateExams', 'examInfo', examInfo) + const localVarPath = `/groups/{group_id}/awarded_courses/{awarded_course_id}/exams` + .replace(`{${'group_id'}}`, encodeURIComponent(String(groupId))) + .replace(`{${'awarded_course_id'}}`, encodeURIComponent(String(awardedCourseId))) // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) let baseOptions @@ -2458,29 +2923,16 @@ export const TeachingApiAxiosParamCreator = function (configuration?: Configurat } }, /** - * - * @summary Update students grades - * @param {string} courseId - * @param {string} examId - * @param {Array} updateStudentGrade + * Update groups when `id` are provided, create them otherwise. + * @summary Create new groups or update existing groups + * @param {Array} group Groups to update * @param {*} [options] Override http request option. * @throws {RequiredError} */ - crupdateStudentsGrade: async ( - courseId: string, - examId: string, - updateStudentGrade: Array, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'courseId' is not null or undefined - assertParamExists('crupdateStudentsGrade', 'courseId', courseId) - // verify required parameter 'examId' is not null or undefined - assertParamExists('crupdateStudentsGrade', 'examId', examId) - // verify required parameter 'updateStudentGrade' is not null or undefined - assertParamExists('crupdateStudentsGrade', 'updateStudentGrade', updateStudentGrade) - const localVarPath = `/courses/{course_id}/exams/{exam_id}/grades` - .replace(`{${'course_id'}}`, encodeURIComponent(String(courseId))) - .replace(`{${'exam_id'}}`, encodeURIComponent(String(examId))) + createOrUpdateGroups: async (group: Array, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'group' is not null or undefined + assertParamExists('createOrUpdateGroups', 'group', group) + const localVarPath = `/groups` // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) let baseOptions @@ -2501,7 +2953,7 @@ export const TeachingApiAxiosParamCreator = function (configuration?: Configurat setSearchParams(localVarUrlObj, localVarQueryParameter) let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } - localVarRequestOptions.data = serializeDataIfNeeded(updateStudentGrade, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(group, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -2510,15 +2962,33 @@ export const TeachingApiAxiosParamCreator = function (configuration?: Configurat }, /** * - * @summary Get course by identifier - * @param {string} id + * @summary Create exam grades + * @param {string} groupId + * @param {string} awardedCourseId + * @param {string} examId + * @param {Array} createGrade Examination with its participants with their note to create. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getCourseById: async (id: string, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('getCourseById', 'id', id) - const localVarPath = `/courses/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id))) + createStudentExamGrade: async ( + groupId: string, + awardedCourseId: string, + examId: string, + createGrade: Array, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'groupId' is not null or undefined + assertParamExists('createStudentExamGrade', 'groupId', groupId) + // verify required parameter 'awardedCourseId' is not null or undefined + assertParamExists('createStudentExamGrade', 'awardedCourseId', awardedCourseId) + // verify required parameter 'examId' is not null or undefined + assertParamExists('createStudentExamGrade', 'examId', examId) + // verify required parameter 'createGrade' is not null or undefined + assertParamExists('createStudentExamGrade', 'createGrade', createGrade) + const localVarPath = `/groups/{group_id}/awarded_courses/{awarded_course_id}/exams/{exam_id}/grades` + .replace(`{${'group_id'}}`, encodeURIComponent(String(groupId))) + .replace(`{${'awarded_course_id'}}`, encodeURIComponent(String(awardedCourseId))) + .replace(`{${'exam_id'}}`, encodeURIComponent(String(examId))) // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) let baseOptions @@ -2526,7 +2996,7 @@ export const TeachingApiAxiosParamCreator = function (configuration?: Configurat baseOptions = configuration.baseOptions } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options } + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options } const localVarHeaderParameter = {} as any const localVarQueryParameter = {} as any @@ -2534,9 +3004,12 @@ export const TeachingApiAxiosParamCreator = function (configuration?: Configurat // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) + localVarHeaderParameter['Content-Type'] = 'application/json' + setSearchParams(localVarUrlObj, localVarQueryParameter) let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } + localVarRequestOptions.data = serializeDataIfNeeded(createGrade, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -2545,32 +3018,197 @@ export const TeachingApiAxiosParamCreator = function (configuration?: Configurat }, /** * - * @summary Get all courses - * @param {string} [code] Filter courses by code, case is ignored - * @param {string} [name] Filter courses by name, case is ignored - * @param {number} [credits] Filter courses by credits - * @param {string} [teacherFirstName] Filter courses by teacher firstname, case is ignored - * @param {string} [teacherLastName] Filter courses by teacher lastname, case is ignored - * @param {CourseDirection} [creditsOrder] - * @param {CourseDirection} [codeOrder] + * @summary Get all group awarded_courses + * @param {string} id * @param {number} [page] Set value to 1 by default if null is provided * @param {number} [pageSize] Set value to 15 by default if null is provided * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getCourses: async ( - code?: string, - name?: string, - credits?: number, - teacherFirstName?: string, - teacherLastName?: string, - creditsOrder?: CourseDirection, - codeOrder?: CourseDirection, - page?: number, - pageSize?: number, - options: AxiosRequestConfig = {} - ): Promise => { - const localVarPath = `/courses` + getAllAwardedCourseByGroup: async (id: string, page?: number, pageSize?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('getAllAwardedCourseByGroup', 'id', id) + const localVarPath = `/groups/{id}/awarded_courses`.replace(`{${'id'}}`, encodeURIComponent(String(id))) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + if (page !== undefined) { + localVarQueryParameter['page'] = page + } + + if (pageSize !== undefined) { + localVarQueryParameter['page_size'] = pageSize + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions + } + }, + /** + * + * @summary Get all students who follow a group + * @param {string} id + * @param {number} [page] + * @param {number} [pageSize] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAllStudentByGroup: async (id: string, page?: number, pageSize?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('getAllStudentByGroup', 'id', id) + const localVarPath = `/groups/{id}/students`.replace(`{${'id'}}`, encodeURIComponent(String(id))) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + if (page !== undefined) { + localVarQueryParameter['page'] = page + } + + if (pageSize !== undefined) { + localVarQueryParameter['page_size'] = pageSize + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions + } + }, + /** + * + * @summary Get a specific group awarded_course + * @param {string} groupId + * @param {string} awardedCourseId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAwardedCoursesByIdAndGroupId: async (groupId: string, awardedCourseId: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'groupId' is not null or undefined + assertParamExists('getAwardedCoursesByIdAndGroupId', 'groupId', groupId) + // verify required parameter 'awardedCourseId' is not null or undefined + assertParamExists('getAwardedCoursesByIdAndGroupId', 'awardedCourseId', awardedCourseId) + const localVarPath = `/groups/{group_id}/awarded_courses/{awarded_course_id}` + .replace(`{${'group_id'}}`, encodeURIComponent(String(groupId))) + .replace(`{${'awarded_course_id'}}`, encodeURIComponent(String(awardedCourseId))) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions + } + }, + /** + * + * @summary Get course by identifier + * @param {string} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getCourseById: async (id: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('getCourseById', 'id', id) + const localVarPath = `/courses/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id))) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions + } + }, + /** + * + * @summary Get all courses + * @param {string} [code] Filter courses by code, case is ignored + * @param {string} [name] Filter courses by name, case is ignored + * @param {number} [credits] Filter courses by credits + * @param {string} [teacherFirstName] Filter courses by teacher firstname, case is ignored + * @param {string} [teacherLastName] Filter courses by teacher lastname, case is ignored + * @param {CourseDirection} [creditsOrder] + * @param {CourseDirection} [codeOrder] + * @param {number} [page] Set value to 1 by default if null is provided + * @param {number} [pageSize] Set value to 15 by default if null is provided + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getCourses: async ( + code?: string, + name?: string, + credits?: number, + teacherFirstName?: string, + teacherLastName?: string, + creditsOrder?: CourseDirection, + codeOrder?: CourseDirection, + page?: number, + pageSize?: number, + options: AxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/courses` // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) let baseOptions @@ -2633,20 +3271,68 @@ export const TeachingApiAxiosParamCreator = function (configuration?: Configurat }, /** * - * @summary Get exam details with the participants and their grades of the specified exam. - * @param {string} courseId + * @summary Get a awarded_course exam. + * @param {string} groupId + * @param {string} awardedCourseId + * @param {string} examId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getExamById: async (groupId: string, awardedCourseId: string, examId: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'groupId' is not null or undefined + assertParamExists('getExamById', 'groupId', groupId) + // verify required parameter 'awardedCourseId' is not null or undefined + assertParamExists('getExamById', 'awardedCourseId', awardedCourseId) + // verify required parameter 'examId' is not null or undefined + assertParamExists('getExamById', 'examId', examId) + const localVarPath = `/groups/{group_id}/awarded_courses/{awarded_course_id}/exams/{exam_id}` + .replace(`{${'group_id'}}`, encodeURIComponent(String(groupId))) + .replace(`{${'awarded_course_id'}}`, encodeURIComponent(String(awardedCourseId))) + .replace(`{${'exam_id'}}`, encodeURIComponent(String(examId))) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions + } + }, + /** + * + * @summary Get exam details with the participants and their grades in a specified awarded_course. + * @param {string} groupId * @param {string} examId + * @param {string} awardedCourseId * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getExamDetail: async (courseId: string, examId: string, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'courseId' is not null or undefined - assertParamExists('getExamDetail', 'courseId', courseId) + getExamGrades: async (groupId: string, examId: string, awardedCourseId: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'groupId' is not null or undefined + assertParamExists('getExamGrades', 'groupId', groupId) // verify required parameter 'examId' is not null or undefined - assertParamExists('getExamDetail', 'examId', examId) - const localVarPath = `/courses/{course_id}/exams/{exam_id}/details` - .replace(`{${'course_id'}}`, encodeURIComponent(String(courseId))) + assertParamExists('getExamGrades', 'examId', examId) + // verify required parameter 'awardedCourseId' is not null or undefined + assertParamExists('getExamGrades', 'awardedCourseId', awardedCourseId) + const localVarPath = `/groups/{group_id}/awarded_courses/{awarded_course_id}/exams/{exam_id}/grades` + .replace(`{${'group_id'}}`, encodeURIComponent(String(groupId))) .replace(`{${'exam_id'}}`, encodeURIComponent(String(examId))) + .replace(`{${'awarded_course_id'}}`, encodeURIComponent(String(awardedCourseId))) // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) let baseOptions @@ -2673,15 +3359,28 @@ export const TeachingApiAxiosParamCreator = function (configuration?: Configurat }, /** * - * @summary Get all exam infos of a specified course - * @param {string} courseId + * @summary Get all exam infos of a specified awarded_course. + * @param {string} groupId + * @param {string} awardedCourseId + * @param {number} [page] Set value to 1 by default if null is provided + * @param {number} [pageSize] Set value to 15 by default if null is provided * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getExamsByCourseId: async (courseId: string, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'courseId' is not null or undefined - assertParamExists('getExamsByCourseId', 'courseId', courseId) - const localVarPath = `/courses/{course_id}/exams`.replace(`{${'course_id'}}`, encodeURIComponent(String(courseId))) + getExamsByGroupIdAndAwardedCourse: async ( + groupId: string, + awardedCourseId: string, + page?: number, + pageSize?: number, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'groupId' is not null or undefined + assertParamExists('getExamsByGroupIdAndAwardedCourse', 'groupId', groupId) + // verify required parameter 'awardedCourseId' is not null or undefined + assertParamExists('getExamsByGroupIdAndAwardedCourse', 'awardedCourseId', awardedCourseId) + const localVarPath = `/groups/{group_id}/awarded_courses/{awarded_course_id}/exams` + .replace(`{${'group_id'}}`, encodeURIComponent(String(groupId))) + .replace(`{${'awarded_course_id'}}`, encodeURIComponent(String(awardedCourseId))) // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) let baseOptions @@ -2697,6 +3396,14 @@ export const TeachingApiAxiosParamCreator = function (configuration?: Configurat // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) + if (page !== undefined) { + localVarQueryParameter['page'] = page + } + + if (pageSize !== undefined) { + localVarQueryParameter['page_size'] = pageSize + } + setSearchParams(localVarUrlObj, localVarQueryParameter) let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } @@ -2744,10 +3451,12 @@ export const TeachingApiAxiosParamCreator = function (configuration?: Configurat /** * * @summary Get all groups + * @param {number} [page] Set value to 1 by default if null is provided + * @param {number} [pageSize] Set value to 15 by default if null is provided * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getGroups: async (options: AxiosRequestConfig = {}): Promise => { + getGroups: async (page?: number, pageSize?: number, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/groups` // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) @@ -2764,6 +3473,68 @@ export const TeachingApiAxiosParamCreator = function (configuration?: Configurat // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) + if (page !== undefined) { + localVarQueryParameter['page'] = page + } + + if (pageSize !== undefined) { + localVarQueryParameter['page_size'] = pageSize + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions + } + }, + /** + * + * @summary Return a participant with his exam grades + * @param {string} groupId + * @param {string} examId + * @param {string} studentId + * @param {string} awardedCourseId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getParticipantGrade: async ( + groupId: string, + examId: string, + studentId: string, + awardedCourseId: string, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'groupId' is not null or undefined + assertParamExists('getParticipantGrade', 'groupId', groupId) + // verify required parameter 'examId' is not null or undefined + assertParamExists('getParticipantGrade', 'examId', examId) + // verify required parameter 'studentId' is not null or undefined + assertParamExists('getParticipantGrade', 'studentId', studentId) + // verify required parameter 'awardedCourseId' is not null or undefined + assertParamExists('getParticipantGrade', 'awardedCourseId', awardedCourseId) + const localVarPath = `/groups/{group_id}/awarded_courses/{awarded_course_id}/exams/{exam_id}/students/{student_id}/grade` + .replace(`{${'group_id'}}`, encodeURIComponent(String(groupId))) + .replace(`{${'exam_id'}}`, encodeURIComponent(String(examId))) + .replace(`{${'student_id'}}`, encodeURIComponent(String(studentId))) + .replace(`{${'awarded_course_id'}}`, encodeURIComponent(String(awardedCourseId))) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + setSearchParams(localVarUrlObj, localVarQueryParameter) let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } @@ -2775,12 +3546,14 @@ export const TeachingApiAxiosParamCreator = function (configuration?: Configurat }, /** * - * @summary Get all grades of a student in every course that had an exam. + * @summary Get student grades. * @param {string} studentId + * @param {number} [page] Set value to 1 by default if null is provided + * @param {number} [pageSize] Set value to 15 by default if null is provided * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getStudentGrades: async (studentId: string, options: AxiosRequestConfig = {}): Promise => { + getStudentGrades: async (studentId: string, page?: number, pageSize?: number, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'studentId' is not null or undefined assertParamExists('getStudentGrades', 'studentId', studentId) const localVarPath = `/students/{student_id}/grades`.replace(`{${'student_id'}}`, encodeURIComponent(String(studentId))) @@ -2799,10 +3572,75 @@ export const TeachingApiAxiosParamCreator = function (configuration?: Configurat // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) + if (page !== undefined) { + localVarQueryParameter['page'] = page + } + + if (pageSize !== undefined) { + localVarQueryParameter['page_size'] = pageSize + } + setSearchParams(localVarUrlObj, localVarQueryParameter) let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions + } + }, + /** + * + * @summary Moving or removing a student from a group. + * @param {string} id + * @param {CreateGroupFlow} createGroupFlow Movement of a student towards a group to create. + * @param {number} [page] Set value to 1 by default if null is provided + * @param {number} [pageSize] Set value to 15 by default if null is provided + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + moveOrDeleteStudentInGroup: async ( + id: string, + createGroupFlow: CreateGroupFlow, + page?: number, + pageSize?: number, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('moveOrDeleteStudentInGroup', 'id', id) + // verify required parameter 'createGroupFlow' is not null or undefined + assertParamExists('moveOrDeleteStudentInGroup', 'createGroupFlow', createGroupFlow) + const localVarPath = `/students/{id}/group_flows`.replace(`{${'id'}}`, encodeURIComponent(String(id))) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + if (page !== undefined) { + localVarQueryParameter['page'] = page + } + + if (pageSize !== undefined) { + localVarQueryParameter['page_size'] = pageSize + } + + localVarHeaderParameter['Content-Type'] = 'application/json' + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } + localVarRequestOptions.data = serializeDataIfNeeded(createGroupFlow, localVarRequestOptions, configuration) + return { url: toPathString(localVarUrlObj), options: localVarRequestOptions @@ -2818,6 +3656,54 @@ export const TeachingApiAxiosParamCreator = function (configuration?: Configurat export const TeachingApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = TeachingApiAxiosParamCreator(configuration) return { + /** + * Update awarded_courses when `id` are provided, create them otherwise. + * @summary Create new awarded_courses or update existing awarded_courses + * @param {string} id + * @param {Array} createAwardedCourse Awarded_courses to update + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createOrUpdateAwardedCourses( + id: string, + createAwardedCourse: Array, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createOrUpdateAwardedCourses(id, createAwardedCourse, options) + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) + }, + /** + * Update courses when `id` are provided, create them otherwise. + * @summary Create new courses or update existing courses + * @param {Array} course Courses to update + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createOrUpdateCourses( + course: Array, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createOrUpdateCourses(course, options) + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) + }, + /** + * Update exams when `id` are provided, create them otherwise. + * @summary Create new exams or update existing exams + * @param {string} groupId + * @param {string} awardedCourseId + * @param {Array} examInfo Exams to update + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createOrUpdateExams( + groupId: string, + awardedCourseId: string, + examInfo: Array, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createOrUpdateExams(groupId, awardedCourseId, examInfo, options) + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) + }, /** * Update groups when `id` are provided, create them otherwise. * @summary Create new groups or update existing groups @@ -2833,51 +3719,75 @@ export const TeachingApiFp = function (configuration?: Configuration) { return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) }, /** - * Update courses when id are provided, create them otherwise. - * @summary Crupdate courses - * @param {Array} crupdateCourse + * + * @summary Create exam grades + * @param {string} groupId + * @param {string} awardedCourseId + * @param {string} examId + * @param {Array} createGrade Examination with its participants with their note to create. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async crupdateCourses( - crupdateCourse: Array, + async createStudentExamGrade( + groupId: string, + awardedCourseId: string, + examId: string, + createGrade: Array, options?: AxiosRequestConfig - ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.crupdateCourses(crupdateCourse, options) + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createStudentExamGrade(groupId, awardedCourseId, examId, createGrade, options) return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) }, /** * - * @summary Update exams if ID is provided, otherwise create new exams of the specified course. - * @param {string} courseId - * @param {Array} examInfo + * @summary Get all group awarded_courses + * @param {string} id + * @param {number} [page] Set value to 1 by default if null is provided + * @param {number} [pageSize] Set value to 15 by default if null is provided * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async crupdateExams( - courseId: string, - examInfo: Array, + async getAllAwardedCourseByGroup( + id: string, + page?: number, + pageSize?: number, options?: AxiosRequestConfig - ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.crupdateExams(courseId, examInfo, options) + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getAllAwardedCourseByGroup(id, page, pageSize, options) return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) }, /** * - * @summary Update students grades - * @param {string} courseId - * @param {string} examId - * @param {Array} updateStudentGrade + * @summary Get all students who follow a group + * @param {string} id + * @param {number} [page] + * @param {number} [pageSize] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async crupdateStudentsGrade( - courseId: string, - examId: string, - updateStudentGrade: Array, + async getAllStudentByGroup( + id: string, + page?: number, + pageSize?: number, options?: AxiosRequestConfig - ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.crupdateStudentsGrade(courseId, examId, updateStudentGrade, options) + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getAllStudentByGroup(id, page, pageSize, options) + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) + }, + /** + * + * @summary Get a specific group awarded_course + * @param {string} groupId + * @param {string} awardedCourseId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getAwardedCoursesByIdAndGroupId( + groupId: string, + awardedCourseId: string, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getAwardedCoursesByIdAndGroupId(groupId, awardedCourseId, options) return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) }, /** @@ -2934,32 +3844,58 @@ export const TeachingApiFp = function (configuration?: Configuration) { }, /** * - * @summary Get exam details with the participants and their grades of the specified exam. - * @param {string} courseId + * @summary Get a awarded_course exam. + * @param {string} groupId + * @param {string} awardedCourseId + * @param {string} examId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getExamById( + groupId: string, + awardedCourseId: string, + examId: string, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getExamById(groupId, awardedCourseId, examId, options) + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) + }, + /** + * + * @summary Get exam details with the participants and their grades in a specified awarded_course. + * @param {string} groupId * @param {string} examId + * @param {string} awardedCourseId * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getExamDetail( - courseId: string, + async getExamGrades( + groupId: string, examId: string, + awardedCourseId: string, options?: AxiosRequestConfig ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getExamDetail(courseId, examId, options) + const localVarAxiosArgs = await localVarAxiosParamCreator.getExamGrades(groupId, examId, awardedCourseId, options) return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) }, /** * - * @summary Get all exam infos of a specified course - * @param {string} courseId + * @summary Get all exam infos of a specified awarded_course. + * @param {string} groupId + * @param {string} awardedCourseId + * @param {number} [page] Set value to 1 by default if null is provided + * @param {number} [pageSize] Set value to 15 by default if null is provided * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getExamsByCourseId( - courseId: string, + async getExamsByGroupIdAndAwardedCourse( + groupId: string, + awardedCourseId: string, + page?: number, + pageSize?: number, options?: AxiosRequestConfig ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getExamsByCourseId(courseId, options) + const localVarAxiosArgs = await localVarAxiosParamCreator.getExamsByGroupIdAndAwardedCourse(groupId, awardedCourseId, page, pageSize, options) return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) }, /** @@ -2976,25 +3912,75 @@ export const TeachingApiFp = function (configuration?: Configuration) { /** * * @summary Get all groups + * @param {number} [page] Set value to 1 by default if null is provided + * @param {number} [pageSize] Set value to 15 by default if null is provided + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getGroups( + page?: number, + pageSize?: number, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getGroups(page, pageSize, options) + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) + }, + /** + * + * @summary Return a participant with his exam grades + * @param {string} groupId + * @param {string} examId + * @param {string} studentId + * @param {string} awardedCourseId * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getGroups(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getGroups(options) + async getParticipantGrade( + groupId: string, + examId: string, + studentId: string, + awardedCourseId: string, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getParticipantGrade(groupId, examId, studentId, awardedCourseId, options) return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) }, /** * - * @summary Get all grades of a student in every course that had an exam. + * @summary Get student grades. * @param {string} studentId + * @param {number} [page] Set value to 1 by default if null is provided + * @param {number} [pageSize] Set value to 15 by default if null is provided * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getStudentGrades( studentId: string, + page?: number, + pageSize?: number, options?: AxiosRequestConfig - ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getStudentGrades(studentId, options) + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getStudentGrades(studentId, page, pageSize, options) + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) + }, + /** + * + * @summary Moving or removing a student from a group. + * @param {string} id + * @param {CreateGroupFlow} createGroupFlow Movement of a student towards a group to create. + * @param {number} [page] Set value to 1 by default if null is provided + * @param {number} [pageSize] Set value to 15 by default if null is provided + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async moveOrDeleteStudentInGroup( + id: string, + createGroupFlow: CreateGroupFlow, + page?: number, + pageSize?: number, + options?: AxiosRequestConfig + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.moveOrDeleteStudentInGroup(id, createGroupFlow, page, pageSize, options) return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) } } @@ -3007,6 +3993,39 @@ export const TeachingApiFp = function (configuration?: Configuration) { export const TeachingApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = TeachingApiFp(configuration) return { + /** + * Update awarded_courses when `id` are provided, create them otherwise. + * @summary Create new awarded_courses or update existing awarded_courses + * @param {string} id + * @param {Array} createAwardedCourse Awarded_courses to update + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createOrUpdateAwardedCourses(id: string, createAwardedCourse: Array, options?: any): AxiosPromise> { + return localVarFp.createOrUpdateAwardedCourses(id, createAwardedCourse, options).then(request => request(axios, basePath)) + }, + /** + * Update courses when `id` are provided, create them otherwise. + * @summary Create new courses or update existing courses + * @param {Array} course Courses to update + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createOrUpdateCourses(course: Array, options?: any): AxiosPromise> { + return localVarFp.createOrUpdateCourses(course, options).then(request => request(axios, basePath)) + }, + /** + * Update exams when `id` are provided, create them otherwise. + * @summary Create new exams or update existing exams + * @param {string} groupId + * @param {string} awardedCourseId + * @param {Array} examInfo Exams to update + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createOrUpdateExams(groupId: string, awardedCourseId: string, examInfo: Array, options?: any): AxiosPromise> { + return localVarFp.createOrUpdateExams(groupId, awardedCourseId, examInfo, options).then(request => request(axios, basePath)) + }, /** * Update groups when `id` are provided, create them otherwise. * @summary Create new groups or update existing groups @@ -3018,37 +4037,58 @@ export const TeachingApiFactory = function (configuration?: Configuration, baseP return localVarFp.createOrUpdateGroups(group, options).then(request => request(axios, basePath)) }, /** - * Update courses when id are provided, create them otherwise. - * @summary Crupdate courses - * @param {Array} crupdateCourse + * + * @summary Create exam grades + * @param {string} groupId + * @param {string} awardedCourseId + * @param {string} examId + * @param {Array} createGrade Examination with its participants with their note to create. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createStudentExamGrade( + groupId: string, + awardedCourseId: string, + examId: string, + createGrade: Array, + options?: any + ): AxiosPromise> { + return localVarFp.createStudentExamGrade(groupId, awardedCourseId, examId, createGrade, options).then(request => request(axios, basePath)) + }, + /** + * + * @summary Get all group awarded_courses + * @param {string} id + * @param {number} [page] Set value to 1 by default if null is provided + * @param {number} [pageSize] Set value to 15 by default if null is provided * @param {*} [options] Override http request option. * @throws {RequiredError} */ - crupdateCourses(crupdateCourse: Array, options?: any): AxiosPromise> { - return localVarFp.crupdateCourses(crupdateCourse, options).then(request => request(axios, basePath)) + getAllAwardedCourseByGroup(id: string, page?: number, pageSize?: number, options?: any): AxiosPromise> { + return localVarFp.getAllAwardedCourseByGroup(id, page, pageSize, options).then(request => request(axios, basePath)) }, /** * - * @summary Update exams if ID is provided, otherwise create new exams of the specified course. - * @param {string} courseId - * @param {Array} examInfo + * @summary Get all students who follow a group + * @param {string} id + * @param {number} [page] + * @param {number} [pageSize] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - crupdateExams(courseId: string, examInfo: Array, options?: any): AxiosPromise> { - return localVarFp.crupdateExams(courseId, examInfo, options).then(request => request(axios, basePath)) + getAllStudentByGroup(id: string, page?: number, pageSize?: number, options?: any): AxiosPromise> { + return localVarFp.getAllStudentByGroup(id, page, pageSize, options).then(request => request(axios, basePath)) }, /** * - * @summary Update students grades - * @param {string} courseId - * @param {string} examId - * @param {Array} updateStudentGrade + * @summary Get a specific group awarded_course + * @param {string} groupId + * @param {string} awardedCourseId * @param {*} [options] Override http request option. * @throws {RequiredError} */ - crupdateStudentsGrade(courseId: string, examId: string, updateStudentGrade: Array, options?: any): AxiosPromise { - return localVarFp.crupdateStudentsGrade(courseId, examId, updateStudentGrade, options).then(request => request(axios, basePath)) + getAwardedCoursesByIdAndGroupId(groupId: string, awardedCourseId: string, options?: any): AxiosPromise> { + return localVarFp.getAwardedCoursesByIdAndGroupId(groupId, awardedCourseId, options).then(request => request(axios, basePath)) }, /** * @@ -3093,24 +4133,46 @@ export const TeachingApiFactory = function (configuration?: Configuration, baseP }, /** * - * @summary Get exam details with the participants and their grades of the specified exam. - * @param {string} courseId + * @summary Get a awarded_course exam. + * @param {string} groupId + * @param {string} awardedCourseId + * @param {string} examId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getExamById(groupId: string, awardedCourseId: string, examId: string, options?: any): AxiosPromise { + return localVarFp.getExamById(groupId, awardedCourseId, examId, options).then(request => request(axios, basePath)) + }, + /** + * + * @summary Get exam details with the participants and their grades in a specified awarded_course. + * @param {string} groupId * @param {string} examId + * @param {string} awardedCourseId * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getExamDetail(courseId: string, examId: string, options?: any): AxiosPromise { - return localVarFp.getExamDetail(courseId, examId, options).then(request => request(axios, basePath)) + getExamGrades(groupId: string, examId: string, awardedCourseId: string, options?: any): AxiosPromise { + return localVarFp.getExamGrades(groupId, examId, awardedCourseId, options).then(request => request(axios, basePath)) }, /** * - * @summary Get all exam infos of a specified course - * @param {string} courseId + * @summary Get all exam infos of a specified awarded_course. + * @param {string} groupId + * @param {string} awardedCourseId + * @param {number} [page] Set value to 1 by default if null is provided + * @param {number} [pageSize] Set value to 15 by default if null is provided * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getExamsByCourseId(courseId: string, options?: any): AxiosPromise> { - return localVarFp.getExamsByCourseId(courseId, options).then(request => request(axios, basePath)) + getExamsByGroupIdAndAwardedCourse( + groupId: string, + awardedCourseId: string, + page?: number, + pageSize?: number, + options?: any + ): AxiosPromise> { + return localVarFp.getExamsByGroupIdAndAwardedCourse(groupId, awardedCourseId, page, pageSize, options).then(request => request(axios, basePath)) }, /** * @@ -3125,21 +4187,51 @@ export const TeachingApiFactory = function (configuration?: Configuration, baseP /** * * @summary Get all groups + * @param {number} [page] Set value to 1 by default if null is provided + * @param {number} [pageSize] Set value to 15 by default if null is provided + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getGroups(page?: number, pageSize?: number, options?: any): AxiosPromise> { + return localVarFp.getGroups(page, pageSize, options).then(request => request(axios, basePath)) + }, + /** + * + * @summary Return a participant with his exam grades + * @param {string} groupId + * @param {string} examId + * @param {string} studentId + * @param {string} awardedCourseId * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getGroups(options?: any): AxiosPromise> { - return localVarFp.getGroups(options).then(request => request(axios, basePath)) + getParticipantGrade(groupId: string, examId: string, studentId: string, awardedCourseId: string, options?: any): AxiosPromise { + return localVarFp.getParticipantGrade(groupId, examId, studentId, awardedCourseId, options).then(request => request(axios, basePath)) }, /** * - * @summary Get all grades of a student in every course that had an exam. + * @summary Get student grades. * @param {string} studentId + * @param {number} [page] Set value to 1 by default if null is provided + * @param {number} [pageSize] Set value to 15 by default if null is provided + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getStudentGrades(studentId: string, page?: number, pageSize?: number, options?: any): AxiosPromise> { + return localVarFp.getStudentGrades(studentId, page, pageSize, options).then(request => request(axios, basePath)) + }, + /** + * + * @summary Moving or removing a student from a group. + * @param {string} id + * @param {CreateGroupFlow} createGroupFlow Movement of a student towards a group to create. + * @param {number} [page] Set value to 1 by default if null is provided + * @param {number} [pageSize] Set value to 15 by default if null is provided * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getStudentGrades(studentId: string, options?: any): AxiosPromise> { - return localVarFp.getStudentGrades(studentId, options).then(request => request(axios, basePath)) + moveOrDeleteStudentInGroup(id: string, createGroupFlow: CreateGroupFlow, page?: number, pageSize?: number, options?: any): AxiosPromise { + return localVarFp.moveOrDeleteStudentInGroup(id, createGroupFlow, page, pageSize, options).then(request => request(axios, basePath)) } } } @@ -3151,6 +4243,51 @@ export const TeachingApiFactory = function (configuration?: Configuration, baseP * @extends {BaseAPI} */ export class TeachingApi extends BaseAPI { + /** + * Update awarded_courses when `id` are provided, create them otherwise. + * @summary Create new awarded_courses or update existing awarded_courses + * @param {string} id + * @param {Array} createAwardedCourse Awarded_courses to update + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TeachingApi + */ + public createOrUpdateAwardedCourses(id: string, createAwardedCourse: Array, options?: AxiosRequestConfig) { + return TeachingApiFp(this.configuration) + .createOrUpdateAwardedCourses(id, createAwardedCourse, options) + .then(request => request(this.axios, this.basePath)) + } + + /** + * Update courses when `id` are provided, create them otherwise. + * @summary Create new courses or update existing courses + * @param {Array} course Courses to update + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TeachingApi + */ + public createOrUpdateCourses(course: Array, options?: AxiosRequestConfig) { + return TeachingApiFp(this.configuration) + .createOrUpdateCourses(course, options) + .then(request => request(this.axios, this.basePath)) + } + + /** + * Update exams when `id` are provided, create them otherwise. + * @summary Create new exams or update existing exams + * @param {string} groupId + * @param {string} awardedCourseId + * @param {Array} examInfo Exams to update + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TeachingApi + */ + public createOrUpdateExams(groupId: string, awardedCourseId: string, examInfo: Array, options?: AxiosRequestConfig) { + return TeachingApiFp(this.configuration) + .createOrUpdateExams(groupId, awardedCourseId, examInfo, options) + .then(request => request(this.axios, this.basePath)) + } + /** * Update groups when `id` are provided, create them otherwise. * @summary Create new groups or update existing groups @@ -3166,47 +4303,66 @@ export class TeachingApi extends BaseAPI { } /** - * Update courses when id are provided, create them otherwise. - * @summary Crupdate courses - * @param {Array} crupdateCourse + * + * @summary Create exam grades + * @param {string} groupId + * @param {string} awardedCourseId + * @param {string} examId + * @param {Array} createGrade Examination with its participants with their note to create. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TeachingApi */ - public crupdateCourses(crupdateCourse: Array, options?: AxiosRequestConfig) { + public createStudentExamGrade(groupId: string, awardedCourseId: string, examId: string, createGrade: Array, options?: AxiosRequestConfig) { return TeachingApiFp(this.configuration) - .crupdateCourses(crupdateCourse, options) + .createStudentExamGrade(groupId, awardedCourseId, examId, createGrade, options) .then(request => request(this.axios, this.basePath)) } /** * - * @summary Update exams if ID is provided, otherwise create new exams of the specified course. - * @param {string} courseId - * @param {Array} examInfo + * @summary Get all group awarded_courses + * @param {string} id + * @param {number} [page] Set value to 1 by default if null is provided + * @param {number} [pageSize] Set value to 15 by default if null is provided * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TeachingApi */ - public crupdateExams(courseId: string, examInfo: Array, options?: AxiosRequestConfig) { + public getAllAwardedCourseByGroup(id: string, page?: number, pageSize?: number, options?: AxiosRequestConfig) { return TeachingApiFp(this.configuration) - .crupdateExams(courseId, examInfo, options) + .getAllAwardedCourseByGroup(id, page, pageSize, options) .then(request => request(this.axios, this.basePath)) } /** * - * @summary Update students grades - * @param {string} courseId - * @param {string} examId - * @param {Array} updateStudentGrade + * @summary Get all students who follow a group + * @param {string} id + * @param {number} [page] + * @param {number} [pageSize] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TeachingApi + */ + public getAllStudentByGroup(id: string, page?: number, pageSize?: number, options?: AxiosRequestConfig) { + return TeachingApiFp(this.configuration) + .getAllStudentByGroup(id, page, pageSize, options) + .then(request => request(this.axios, this.basePath)) + } + + /** + * + * @summary Get a specific group awarded_course + * @param {string} groupId + * @param {string} awardedCourseId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TeachingApi */ - public crupdateStudentsGrade(courseId: string, examId: string, updateStudentGrade: Array, options?: AxiosRequestConfig) { + public getAwardedCoursesByIdAndGroupId(groupId: string, awardedCourseId: string, options?: AxiosRequestConfig) { return TeachingApiFp(this.configuration) - .crupdateStudentsGrade(courseId, examId, updateStudentGrade, options) + .getAwardedCoursesByIdAndGroupId(groupId, awardedCourseId, options) .then(request => request(this.axios, this.basePath)) } @@ -3259,30 +4415,50 @@ export class TeachingApi extends BaseAPI { /** * - * @summary Get exam details with the participants and their grades of the specified exam. - * @param {string} courseId + * @summary Get a awarded_course exam. + * @param {string} groupId + * @param {string} awardedCourseId + * @param {string} examId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TeachingApi + */ + public getExamById(groupId: string, awardedCourseId: string, examId: string, options?: AxiosRequestConfig) { + return TeachingApiFp(this.configuration) + .getExamById(groupId, awardedCourseId, examId, options) + .then(request => request(this.axios, this.basePath)) + } + + /** + * + * @summary Get exam details with the participants and their grades in a specified awarded_course. + * @param {string} groupId * @param {string} examId + * @param {string} awardedCourseId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TeachingApi */ - public getExamDetail(courseId: string, examId: string, options?: AxiosRequestConfig) { + public getExamGrades(groupId: string, examId: string, awardedCourseId: string, options?: AxiosRequestConfig) { return TeachingApiFp(this.configuration) - .getExamDetail(courseId, examId, options) + .getExamGrades(groupId, examId, awardedCourseId, options) .then(request => request(this.axios, this.basePath)) } /** * - * @summary Get all exam infos of a specified course - * @param {string} courseId + * @summary Get all exam infos of a specified awarded_course. + * @param {string} groupId + * @param {string} awardedCourseId + * @param {number} [page] Set value to 1 by default if null is provided + * @param {number} [pageSize] Set value to 15 by default if null is provided * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TeachingApi */ - public getExamsByCourseId(courseId: string, options?: AxiosRequestConfig) { + public getExamsByGroupIdAndAwardedCourse(groupId: string, awardedCourseId: string, page?: number, pageSize?: number, options?: AxiosRequestConfig) { return TeachingApiFp(this.configuration) - .getExamsByCourseId(courseId, options) + .getExamsByGroupIdAndAwardedCourse(groupId, awardedCourseId, page, pageSize, options) .then(request => request(this.axios, this.basePath)) } @@ -3303,27 +4479,65 @@ export class TeachingApi extends BaseAPI { /** * * @summary Get all groups + * @param {number} [page] Set value to 1 by default if null is provided + * @param {number} [pageSize] Set value to 15 by default if null is provided + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TeachingApi + */ + public getGroups(page?: number, pageSize?: number, options?: AxiosRequestConfig) { + return TeachingApiFp(this.configuration) + .getGroups(page, pageSize, options) + .then(request => request(this.axios, this.basePath)) + } + + /** + * + * @summary Return a participant with his exam grades + * @param {string} groupId + * @param {string} examId + * @param {string} studentId + * @param {string} awardedCourseId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TeachingApi */ - public getGroups(options?: AxiosRequestConfig) { + public getParticipantGrade(groupId: string, examId: string, studentId: string, awardedCourseId: string, options?: AxiosRequestConfig) { return TeachingApiFp(this.configuration) - .getGroups(options) + .getParticipantGrade(groupId, examId, studentId, awardedCourseId, options) .then(request => request(this.axios, this.basePath)) } /** * - * @summary Get all grades of a student in every course that had an exam. + * @summary Get student grades. * @param {string} studentId + * @param {number} [page] Set value to 1 by default if null is provided + * @param {number} [pageSize] Set value to 15 by default if null is provided + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TeachingApi + */ + public getStudentGrades(studentId: string, page?: number, pageSize?: number, options?: AxiosRequestConfig) { + return TeachingApiFp(this.configuration) + .getStudentGrades(studentId, page, pageSize, options) + .then(request => request(this.axios, this.basePath)) + } + + /** + * + * @summary Moving or removing a student from a group. + * @param {string} id + * @param {CreateGroupFlow} createGroupFlow Movement of a student towards a group to create. + * @param {number} [page] Set value to 1 by default if null is provided + * @param {number} [pageSize] Set value to 15 by default if null is provided * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof TeachingApi */ - public getStudentGrades(studentId: string, options?: AxiosRequestConfig) { + public moveOrDeleteStudentInGroup(id: string, createGroupFlow: CreateGroupFlow, page?: number, pageSize?: number, options?: AxiosRequestConfig) { return TeachingApiFp(this.configuration) - .getStudentGrades(studentId, options) + .moveOrDeleteStudentInGroup(id, createGroupFlow, page, pageSize, options) .then(request => request(this.axios, this.basePath)) } } @@ -3522,46 +4736,6 @@ export const UsersApiAxiosParamCreator = function (configuration?: Configuration options: localVarRequestOptions } }, - /** - * - * @summary Get a specific student courses - * @param {string} studentId - * @param {CourseStatus} [status] By default, LINKED courses are provided. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getStudentCoursesById: async (studentId: string, status?: CourseStatus, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'studentId' is not null or undefined - assertParamExists('getStudentCoursesById', 'studentId', studentId) - const localVarPath = `/students/{student_id}/courses`.replace(`{${'student_id'}}`, encodeURIComponent(String(studentId))) - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) - let baseOptions - if (configuration) { - baseOptions = configuration.baseOptions - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - // authentication BearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - if (status !== undefined) { - localVarQueryParameter['status'] = status - } - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions - } - }, /** * * @summary Get all students @@ -3726,51 +4900,6 @@ export const UsersApiAxiosParamCreator = function (configuration?: Configuration let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions - } - }, - /** - * - * @summary Link or unlink courses to a specific student - * @param {string} studentId - * @param {Array} updateStudentCourse - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateStudentCourses: async ( - studentId: string, - updateStudentCourse: Array, - options: AxiosRequestConfig = {} - ): Promise => { - // verify required parameter 'studentId' is not null or undefined - assertParamExists('updateStudentCourses', 'studentId', studentId) - // verify required parameter 'updateStudentCourse' is not null or undefined - assertParamExists('updateStudentCourses', 'updateStudentCourse', updateStudentCourse) - const localVarPath = `/students/{student_id}/courses`.replace(`{${'student_id'}}`, encodeURIComponent(String(studentId))) - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) - let baseOptions - if (configuration) { - baseOptions = configuration.baseOptions - } - - const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - // authentication BearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json' - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers } - localVarRequestOptions.data = serializeDataIfNeeded(updateStudentCourse, localVarRequestOptions, configuration) - return { url: toPathString(localVarUrlObj), options: localVarRequestOptions @@ -3796,7 +4925,7 @@ export const UsersApiFp = function (configuration?: Configuration) { async createOrUpdateStudents( student: Array, options?: AxiosRequestConfig - ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.createOrUpdateStudents(student, options) return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) }, @@ -3852,22 +4981,6 @@ export const UsersApiFp = function (configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getStudentById(id, options) return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) }, - /** - * - * @summary Get a specific student courses - * @param {string} studentId - * @param {CourseStatus} [status] By default, LINKED courses are provided. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getStudentCoursesById( - studentId: string, - status?: CourseStatus, - options?: AxiosRequestConfig - ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getStudentCoursesById(studentId, status, options) - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) - }, /** * * @summary Get all students @@ -3924,22 +5037,6 @@ export const UsersApiFp = function (configuration?: Configuration) { ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getTeachers(page, pageSize, ref, firstName, lastName, options) return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) - }, - /** - * - * @summary Link or unlink courses to a specific student - * @param {string} studentId - * @param {Array} updateStudentCourse - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async updateStudentCourses( - studentId: string, - updateStudentCourse: Array, - options?: AxiosRequestConfig - ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateStudentCourses(studentId, updateStudentCourse, options) - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration) } } } @@ -3958,7 +5055,7 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createOrUpdateStudents(student: Array, options?: any): AxiosPromise> { + createOrUpdateStudents(student: Array, options?: any): AxiosPromise> { return localVarFp.createOrUpdateStudents(student, options).then(request => request(axios, basePath)) }, /** @@ -4002,17 +5099,6 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath getStudentById(id: string, options?: any): AxiosPromise { return localVarFp.getStudentById(id, options).then(request => request(axios, basePath)) }, - /** - * - * @summary Get a specific student courses - * @param {string} studentId - * @param {CourseStatus} [status] By default, LINKED courses are provided. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getStudentCoursesById(studentId: string, status?: CourseStatus, options?: any): AxiosPromise> { - return localVarFp.getStudentCoursesById(studentId, status, options).then(request => request(axios, basePath)) - }, /** * * @summary Get all students @@ -4059,17 +5145,6 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath */ getTeachers(page?: number, pageSize?: number, ref?: string, firstName?: string, lastName?: string, options?: any): AxiosPromise> { return localVarFp.getTeachers(page, pageSize, ref, firstName, lastName, options).then(request => request(axios, basePath)) - }, - /** - * - * @summary Link or unlink courses to a specific student - * @param {string} studentId - * @param {Array} updateStudentCourse - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateStudentCourses(studentId: string, updateStudentCourse: Array, options?: any): AxiosPromise> { - return localVarFp.updateStudentCourses(studentId, updateStudentCourse, options).then(request => request(axios, basePath)) } } } @@ -4152,21 +5227,6 @@ export class UsersApi extends BaseAPI { .then(request => request(this.axios, this.basePath)) } - /** - * - * @summary Get a specific student courses - * @param {string} studentId - * @param {CourseStatus} [status] By default, LINKED courses are provided. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UsersApi - */ - public getStudentCoursesById(studentId: string, status?: CourseStatus, options?: AxiosRequestConfig) { - return UsersApiFp(this.configuration) - .getStudentCoursesById(studentId, status, options) - .then(request => request(this.axios, this.basePath)) - } - /** * * @summary Get all students @@ -4217,19 +5277,4 @@ export class UsersApi extends BaseAPI { .getTeachers(page, pageSize, ref, firstName, lastName, options) .then(request => request(this.axios, this.basePath)) } - - /** - * - * @summary Link or unlink courses to a specific student - * @param {string} studentId - * @param {Array} updateStudentCourse - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UsersApi - */ - public updateStudentCourses(studentId: string, updateStudentCourse: Array, options?: AxiosRequestConfig) { - return UsersApiFp(this.configuration) - .updateStudentCourses(studentId, updateStudentCourse, options) - .then(request => request(this.axios, this.basePath)) - } } diff --git a/src/gen/haClient/base.ts b/src/gen/haClient/base.ts index 61edd8e1f..6244b3966 100644 --- a/src/gen/haClient/base.ts +++ b/src/gen/haClient/base.ts @@ -4,7 +4,7 @@ * HEI Admin API * _Programmatically connect to a computer programming [school](https://hei.school)._ After [joining us](mailto:contact@hei.school), you can get an identification token from our [dev](https://dev-hei-admin.auth.eu-west-3.amazoncognito.com/oauth2/authorize?client_id=5s8cg50doahmu855rlc8fr6qmp&response_type=token&scope=email+openid&redirect_uri=https%3A%2F%2Fapi-dev.hei.school%2Fwhoami) or [prod](https://prod-hei-admin.auth.eu-west-3.amazoncognito.com/oauth2/authorize?client_id=i8bg538jpfu6mqmqb61m26trd&response_type=token&scope=email+openid&redirect_uri=https%3A%2F%2Fapi-prod.hei.school%2Fwhoami) authentication service. Then, start playing with our system! The implementation of our API is [publicly disclosed](https://github.com/hei-school/hei-admin-api). You are welcome to try and compromise it. Happy hacking! * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { Configuration } from './configuration' +import type { Configuration } from './configuration' // Some imports not used depending on template conditions // @ts-ignore -import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios' +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios' +import globalAxios from 'axios' -export const BASE_PATH = process?.env?.REACT_APP_API_URL!.replace(/\/+$/, '') +export const BASE_PATH = process.env.REACT_APP_API_URL!.replace(/\/+$/, '') /** * @@ -67,11 +68,11 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - name: 'RequiredError' = 'RequiredError' constructor( public field: string, msg?: string ) { super(msg) + this.name = 'RequiredError' } } diff --git a/src/gen/haClient/common.ts b/src/gen/haClient/common.ts index 6fa396128..dd8ab817c 100644 --- a/src/gen/haClient/common.ts +++ b/src/gen/haClient/common.ts @@ -4,7 +4,7 @@ * HEI Admin API * _Programmatically connect to a computer programming [school](https://hei.school)._ After [joining us](mailto:contact@hei.school), you can get an identification token from our [dev](https://dev-hei-admin.auth.eu-west-3.amazoncognito.com/oauth2/authorize?client_id=5s8cg50doahmu855rlc8fr6qmp&response_type=token&scope=email+openid&redirect_uri=https%3A%2F%2Fapi-dev.hei.school%2Fwhoami) or [prod](https://prod-hei-admin.auth.eu-west-3.amazoncognito.com/oauth2/authorize?client_id=i8bg538jpfu6mqmqb61m26trd&response_type=token&scope=email+openid&redirect_uri=https%3A%2F%2Fapi-prod.hei.school%2Fwhoami) authentication service. Then, start playing with our system! The implementation of our API is [publicly disclosed](https://github.com/hei-school/hei-admin-api). You are welcome to try and compromise it. Happy hacking! * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,9 +12,10 @@ * Do not edit the class manually. */ -import { Configuration } from './configuration' -import { RequiredError, RequestArgs } from './base' -import { AxiosInstance, AxiosResponse } from 'axios' +import type { Configuration } from './configuration' +import type { RequestArgs } from './base' +import type { AxiosInstance, AxiosResponse } from 'axios' +import { RequiredError } from './base' /** * @@ -78,6 +79,7 @@ export const setOAuthToObject = async function (object: any, name: string, scope } function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ''): void { + if (parameter == null) return if (typeof parameter === 'object') { if (Array.isArray(parameter)) { ;(parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)) @@ -130,7 +132,7 @@ export const toPathString = function (url: URL) { */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = { ...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url } + const axiosRequestArgs = { ...axiosArgs.options, url: (configuration?.basePath || axios.defaults.baseURL || basePath) + axiosArgs.url } return axios.request(axiosRequestArgs) } } diff --git a/src/gen/haClient/configuration.ts b/src/gen/haClient/configuration.ts index 0ee2af28c..9b916127c 100644 --- a/src/gen/haClient/configuration.ts +++ b/src/gen/haClient/configuration.ts @@ -4,7 +4,7 @@ * HEI Admin API * _Programmatically connect to a computer programming [school](https://hei.school)._ After [joining us](mailto:contact@hei.school), you can get an identification token from our [dev](https://dev-hei-admin.auth.eu-west-3.amazoncognito.com/oauth2/authorize?client_id=5s8cg50doahmu855rlc8fr6qmp&response_type=token&scope=email+openid&redirect_uri=https%3A%2F%2Fapi-dev.hei.school%2Fwhoami) or [prod](https://prod-hei-admin.auth.eu-west-3.amazoncognito.com/oauth2/authorize?client_id=i8bg538jpfu6mqmqb61m26trd&response_type=token&scope=email+openid&redirect_uri=https%3A%2F%2Fapi-prod.hei.school%2Fwhoami) authentication service. Then, start playing with our system! The implementation of our API is [publicly disclosed](https://github.com/hei-school/hei-admin-api). You are welcome to try and compromise it. Happy hacking! * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).