Auth.js
/*
* API para la gestión de turnos
* Esta API se encarga de la gestión de los turnos para las secciones que estén activadas en
* los dispositivos que sean de tipo 'Expendedor'. Se podrá solicitar un nuevo turno para
* la sección seleccionada. Para ello mostrará las secciones que estén activadas para tal fin
* y los mostrará en pantalla con sus colores distintivos, nombre de la sección, el turno actual, etc.
* También podrá mostrar los turnos ya atendidos filtrando por fecha y turno, por rango de fechas,
* seccion, etc. Además, también se podrá mostrar los tickets expedidos pudiendo filtrar
* por rango de fechas, turno y fecha, sección, terminal, etc.
*
* OpenAPI spec version: 3.0.1
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 3.0.51
*
* Do not edit the class manually.
*
*/
import {ApiClient} from "../ApiClient";
import {AuthBody} from '../model/AuthBody';
import {Model400} from '../model/Model400';
import {Model401} from '../model/Model401';
import {Model403} from '../model/Model403';
import {Model404} from '../model/Model404';
import {Model405} from '../model/Model405';
import {Model500} from '../model/Model500';
import {RespuestaOkAuth} from '../model/RespuestaOkAuth';
/**
* Auth service.
* @module api/AuthApi
* @version 3.0.1
*/
export class AuthApi {
/**
* Constructs a new AuthApi.
* @alias module:api/AuthApi
* @class
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
* default to {@link module:ApiClient#instanc
e} if unspecified.
*/
constructor(apiClient) {
this.apiClient = apiClient || ApiClient.instance;
}
/**
* Callback function to receive the result of the authPost operation.
* @callback moduleapi/AuthApi~authPostCallback
* @param {String} error Error message, if any.
* @param {module:model/RespuestaOkAuth{ data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Autenticación de usuario
* Autenticación mediante credenciales de usuario con generación de token una vez logueado
* correctamente o por ApiKey con token de larga duración.
* @param {module:model/AuthBody} body
* @param {module:api/AuthApi~authPostCallback} callback The callback function, accepting
* three arguments: error, data, response
* data is of type: {@link <&vendorExtensions.x-jsdoc-type>}
*/
authPost(body, callback) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling authPost");
}
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = ['Authorization'];
let contentTypes = ['application/json'];
let accepts = ['application/json'];
let returnType = RespuestaOkAuth;
return this.apiClient.callApi(
'/auth', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
}