digitalfemsa
Version:
OpenAPI client for digitalfemsa
361 lines (360 loc) • 19.7 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* Femsa API
* Femsa sdk
*
* The version of the OpenAPI document: 2.1.0
* Contact: engineering@femsa.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ResendEventAcceptLanguageEnum = exports.GetEventsAcceptLanguageEnum = exports.GetEventAcceptLanguageEnum = exports.EventsApi = exports.EventsApiFactory = exports.EventsApiFp = exports.EventsApiAxiosParamCreator = void 0;
const axios_1 = require("axios");
// Some imports not used depending on template conditions
// @ts-ignore
const common_1 = require("../common");
// @ts-ignore
const base_1 = require("../base");
/**
* EventsApi - axios parameter creator
* @export
*/
const EventsApiAxiosParamCreator = function (configuration) {
return {
/**
* Returns a single event
* @summary Get Event
* @param {string} id Identifier of the resource
* @param {GetEventAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getEvent: (id_1, acceptLanguage_1, xChildCompanyId_1, ...args_1) => __awaiter(this, [id_1, acceptLanguage_1, xChildCompanyId_1, ...args_1], void 0, function* (id, acceptLanguage, xChildCompanyId, options = {}) {
// verify required parameter 'id' is not null or undefined
(0, common_1.assertParamExists)('getEvent', 'id', id);
const localVarPath = `/events/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication bearerAuth required
// http bearer authentication required
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
if (xChildCompanyId != null) {
localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
*
* @summary Get list of Events
* @param {GetEventsAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {number} [limit] The numbers of items to return, the maximum value is 250
* @param {string} [search] General order search, e.g. by mail, reference etc.
* @param {string} [next] next page
* @param {string} [previous] previous page
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getEvents: (acceptLanguage_2, xChildCompanyId_2, limit_1, search_1, next_1, previous_1, ...args_2) => __awaiter(this, [acceptLanguage_2, xChildCompanyId_2, limit_1, search_1, next_1, previous_1, ...args_2], void 0, function* (acceptLanguage, xChildCompanyId, limit, search, next, previous, options = {}) {
const localVarPath = `/events`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication bearerAuth required
// http bearer authentication required
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (search !== undefined) {
localVarQueryParameter['search'] = search;
}
if (next !== undefined) {
localVarQueryParameter['next'] = next;
}
if (previous !== undefined) {
localVarQueryParameter['previous'] = previous;
}
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
if (xChildCompanyId != null) {
localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Try to send an event
* @summary Resend Event
* @param {string} eventId event identifier
* @param {string} webhookLogId webhook log identifier
* @param {ResendEventAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
resendEvent: (eventId_1, webhookLogId_1, acceptLanguage_3, ...args_3) => __awaiter(this, [eventId_1, webhookLogId_1, acceptLanguage_3, ...args_3], void 0, function* (eventId, webhookLogId, acceptLanguage, options = {}) {
// verify required parameter 'eventId' is not null or undefined
(0, common_1.assertParamExists)('resendEvent', 'eventId', eventId);
// verify required parameter 'webhookLogId' is not null or undefined
(0, common_1.assertParamExists)('resendEvent', 'webhookLogId', webhookLogId);
const localVarPath = `/events/{event_id}/webhook_logs/{webhook_log_id}/resend`
.replace(`{${"event_id"}}`, encodeURIComponent(String(eventId)))
.replace(`{${"webhook_log_id"}}`, encodeURIComponent(String(webhookLogId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication bearerAuth required
// http bearer authentication required
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
};
};
exports.EventsApiAxiosParamCreator = EventsApiAxiosParamCreator;
/**
* EventsApi - functional programming interface
* @export
*/
const EventsApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.EventsApiAxiosParamCreator)(configuration);
return {
/**
* Returns a single event
* @summary Get Event
* @param {string} id Identifier of the resource
* @param {GetEventAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getEvent(id, acceptLanguage, xChildCompanyId, options) {
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
const localVarAxiosArgs = yield localVarAxiosParamCreator.getEvent(id, acceptLanguage, xChildCompanyId, options);
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const operationBasePath = (_c = (_b = base_1.operationServerMap['EventsApi.getEvent']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
});
},
/**
*
* @summary Get list of Events
* @param {GetEventsAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {number} [limit] The numbers of items to return, the maximum value is 250
* @param {string} [search] General order search, e.g. by mail, reference etc.
* @param {string} [next] next page
* @param {string} [previous] previous page
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getEvents(acceptLanguage, xChildCompanyId, limit, search, next, previous, options) {
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
const localVarAxiosArgs = yield localVarAxiosParamCreator.getEvents(acceptLanguage, xChildCompanyId, limit, search, next, previous, options);
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const operationBasePath = (_c = (_b = base_1.operationServerMap['EventsApi.getEvents']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
});
},
/**
* Try to send an event
* @summary Resend Event
* @param {string} eventId event identifier
* @param {string} webhookLogId webhook log identifier
* @param {ResendEventAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
resendEvent(eventId, webhookLogId, acceptLanguage, options) {
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
const localVarAxiosArgs = yield localVarAxiosParamCreator.resendEvent(eventId, webhookLogId, acceptLanguage, options);
const index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const operationBasePath = (_c = (_b = base_1.operationServerMap['EventsApi.resendEvent']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
});
},
};
};
exports.EventsApiFp = EventsApiFp;
/**
* EventsApi - factory interface
* @export
*/
const EventsApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.EventsApiFp)(configuration);
return {
/**
* Returns a single event
* @summary Get Event
* @param {string} id Identifier of the resource
* @param {GetEventAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getEvent(id, acceptLanguage, xChildCompanyId, options) {
return localVarFp.getEvent(id, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Get list of Events
* @param {GetEventsAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {number} [limit] The numbers of items to return, the maximum value is 250
* @param {string} [search] General order search, e.g. by mail, reference etc.
* @param {string} [next] next page
* @param {string} [previous] previous page
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getEvents(acceptLanguage, xChildCompanyId, limit, search, next, previous, options) {
return localVarFp.getEvents(acceptLanguage, xChildCompanyId, limit, search, next, previous, options).then((request) => request(axios, basePath));
},
/**
* Try to send an event
* @summary Resend Event
* @param {string} eventId event identifier
* @param {string} webhookLogId webhook log identifier
* @param {ResendEventAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
resendEvent(eventId, webhookLogId, acceptLanguage, options) {
return localVarFp.resendEvent(eventId, webhookLogId, acceptLanguage, options).then((request) => request(axios, basePath));
},
};
};
exports.EventsApiFactory = EventsApiFactory;
/**
* EventsApi - object-oriented interface
* @export
* @class EventsApi
* @extends {BaseAPI}
*/
class EventsApi extends base_1.BaseAPI {
/**
* Returns a single event
* @summary Get Event
* @param {string} id Identifier of the resource
* @param {GetEventAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof EventsApi
*/
getEvent(id, acceptLanguage, xChildCompanyId, options) {
return (0, exports.EventsApiFp)(this.configuration).getEvent(id, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Get list of Events
* @param {GetEventsAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
* @param {number} [limit] The numbers of items to return, the maximum value is 250
* @param {string} [search] General order search, e.g. by mail, reference etc.
* @param {string} [next] next page
* @param {string} [previous] previous page
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof EventsApi
*/
getEvents(acceptLanguage, xChildCompanyId, limit, search, next, previous, options) {
return (0, exports.EventsApiFp)(this.configuration).getEvents(acceptLanguage, xChildCompanyId, limit, search, next, previous, options).then((request) => request(this.axios, this.basePath));
}
/**
* Try to send an event
* @summary Resend Event
* @param {string} eventId event identifier
* @param {string} webhookLogId webhook log identifier
* @param {ResendEventAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof EventsApi
*/
resendEvent(eventId, webhookLogId, acceptLanguage, options) {
return (0, exports.EventsApiFp)(this.configuration).resendEvent(eventId, webhookLogId, acceptLanguage, options).then((request) => request(this.axios, this.basePath));
}
}
exports.EventsApi = EventsApi;
/**
* @export
*/
exports.GetEventAcceptLanguageEnum = {
es: 'es',
en: 'en'
};
/**
* @export
*/
exports.GetEventsAcceptLanguageEnum = {
es: 'es',
en: 'en'
};
/**
* @export
*/
exports.ResendEventAcceptLanguageEnum = {
es: 'es',
en: 'en'
};