/** * Organizer * Dies ist eine API, die es ermöglicht Daten zu Stunden-, Vertretungs-, oder Klausurplänen zu erhalten. * * OpenAPI spec version: 1.0.0 * Contact: info@jonasfranz.software * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. * */ import ApiClient from "../ApiClient"; import ReplacementLesson from '../model/ReplacementLesson'; /** * ReplacementLessons service. * @module api/ReplacementLessonsApi * @version 1.0.0 */ export default class ReplacementLessonsApi { /** * Constructs a new ReplacementLessonsApi. * @alias module:api/ReplacementLessonsApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, * default to {@link module:ApiClient#instance} if unspecified. */ constructor(apiClient) { this.apiClient = apiClient || ApiClient.instance; } /** * Callback function to receive the result of the findReplacementLessons operation. * @callback module:api/ReplacementLessonsApi~findReplacementLessonsCallback * @param {String} error Error message, if any. * @param {Array.} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Finds all available replacement lessons * @param {module:api/ReplacementLessonsApi~findReplacementLessonsCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link Array.} */ findReplacementLessons(callback) { let postBody = null; let pathParams = { }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = ['passwordAuth']; let contentTypes = []; let accepts = ['application/json']; let returnType = [ReplacementLesson]; return this.apiClient.callApi( '/replacement/findAll', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the findReplacementLessonsByDate operation. * @callback module:api/ReplacementLessonsApi~findReplacementLessonsByDateCallback * @param {String} error Error message, if any. * @param {Array.} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Finds replacement lessons by date * @param {Date} _date Date of the searched replacement lessons * @param {module:api/ReplacementLessonsApi~findReplacementLessonsByDateCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link Array.} */ findReplacementLessonsByDate(_date, callback) { let postBody = null; // verify the required parameter '_date' is set if (_date === undefined || _date === null) { throw new Error("Missing the required parameter '_date' when calling findReplacementLessonsByDate"); } let pathParams = { }; let queryParams = { 'date': _date }; let headerParams = { }; let formParams = { }; let authNames = ['passwordAuth']; let contentTypes = []; let accepts = ['application/json']; let returnType = [ReplacementLesson]; return this.apiClient.callApi( '/replacement/findByDate', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the getReplacement operation. * @callback module:api/ReplacementLessonsApi~getReplacementCallback * @param {String} error Error message, if any. * @param {module:model/ReplacementLesson} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Get replacement lesson by id * @param {Number} id Replacement lesson's id * @param {module:api/ReplacementLessonsApi~getReplacementCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/ReplacementLesson} */ getReplacement(id, callback) { let postBody = null; // verify the required parameter 'id' is set if (id === undefined || id === null) { throw new Error("Missing the required parameter 'id' when calling getReplacement"); } let pathParams = { 'id': id }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = ['passwordAuth']; let contentTypes = []; let accepts = ['application/json']; let returnType = ReplacementLesson; return this.apiClient.callApi( '/replacement/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the getReplacementByCourse operation. * @callback module:api/ReplacementLessonsApi~getReplacementByCourseCallback * @param {String} error Error message, if any. * @param {Array.} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Get replacement lesson of a course/class * @param {String} course * @param {module:api/ReplacementLessonsApi~getReplacementByCourseCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link Array.} */ getReplacementByCourse(course, callback) { let postBody = null; // verify the required parameter 'course' is set if (course === undefined || course === null) { throw new Error("Missing the required parameter 'course' when calling getReplacementByCourse"); } let pathParams = { 'course': course }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = ['passwordAuth']; let contentTypes = []; let accepts = ['application/json']; let returnType = [ReplacementLesson]; return this.apiClient.callApi( '/course/{course}/replacements', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } }