UNPKG

digitalfemsa

Version:
619 lines (618 loc) 36.5 kB
"use strict"; /* 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.UpdateWebhookAcceptLanguageEnum = exports.TestWebhookAcceptLanguageEnum = exports.GetWebhooksAcceptLanguageEnum = exports.GetWebhookAcceptLanguageEnum = exports.DeleteWebhookAcceptLanguageEnum = exports.CreateWebhookAcceptLanguageEnum = exports.WebhooksApi = exports.WebhooksApiFactory = exports.WebhooksApiFp = exports.WebhooksApiAxiosParamCreator = 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"); /** * WebhooksApi - axios parameter creator * @export */ const WebhooksApiAxiosParamCreator = function (configuration) { return { /** * What we do at Femsa translates into events. For example, an event of interest to us occurs at the time a payment is successfully processed. At that moment we will be interested in doing several things: Send an email to the buyer, generate an invoice, start the process of shipping the product, etc. * @summary Create Webhook * @param {WebhookRequest} webhookRequest requested field for webhook * @param {CreateWebhookAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use * @param {*} [options] Override http request option. * @throws {RequiredError} */ createWebhook: (webhookRequest_1, acceptLanguage_1, ...args_1) => __awaiter(this, [webhookRequest_1, acceptLanguage_1, ...args_1], void 0, function* (webhookRequest, acceptLanguage, options = {}) { // verify required parameter 'webhookRequest' is not null or undefined (0, common_1.assertParamExists)('createWebhook', 'webhookRequest', webhookRequest); const localVarPath = `/webhooks`; // 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); } localVarHeaderParameter['Content-Type'] = 'application/json'; (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); localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(webhookRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Delete Webhook * @param {string} id Identifier of the resource * @param {DeleteWebhookAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteWebhook: (id_1, acceptLanguage_2, ...args_2) => __awaiter(this, [id_1, acceptLanguage_2, ...args_2], void 0, function* (id, acceptLanguage, options = {}) { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('deleteWebhook', 'id', id); const localVarPath = `/webhooks/{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: 'DELETE' }, 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, }; }), /** * * @summary Get Webhook * @param {string} id Identifier of the resource * @param {GetWebhookAcceptLanguageEnum} [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} */ getWebhook: (id_2, acceptLanguage_3, xChildCompanyId_1, ...args_3) => __awaiter(this, [id_2, acceptLanguage_3, xChildCompanyId_1, ...args_3], void 0, function* (id, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('getWebhook', 'id', id); const localVarPath = `/webhooks/{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, }; }), /** * Consume the list of webhooks you have, each environment supports 10 webhooks (For production and testing) * @summary Get List of Webhooks * @param {GetWebhooksAcceptLanguageEnum} [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} */ getWebhooks: (acceptLanguage_4, xChildCompanyId_2, limit_1, search_1, next_1, previous_1, ...args_4) => __awaiter(this, [acceptLanguage_4, xChildCompanyId_2, limit_1, search_1, next_1, previous_1, ...args_4], void 0, function* (acceptLanguage, xChildCompanyId, limit, search, next, previous, options = {}) { const localVarPath = `/webhooks`; // 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, }; }), /** * Send a webhook.ping event * @summary Test Webhook * @param {string} id Identifier of the resource * @param {TestWebhookAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use * @param {*} [options] Override http request option. * @throws {RequiredError} */ testWebhook: (id_3, acceptLanguage_5, ...args_5) => __awaiter(this, [id_3, acceptLanguage_5, ...args_5], void 0, function* (id, acceptLanguage, options = {}) { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('testWebhook', 'id', id); const localVarPath = `/webhooks/{id}/test` .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: '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, }; }), /** * updates an existing webhook * @summary Update Webhook * @param {string} id Identifier of the resource * @param {WebhookUpdateRequest} webhookUpdateRequest requested fields in order to update a webhook * @param {UpdateWebhookAcceptLanguageEnum} [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} */ updateWebhook: (id_4, webhookUpdateRequest_1, acceptLanguage_6, xChildCompanyId_3, ...args_6) => __awaiter(this, [id_4, webhookUpdateRequest_1, acceptLanguage_6, xChildCompanyId_3, ...args_6], void 0, function* (id, webhookUpdateRequest, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('updateWebhook', 'id', id); // verify required parameter 'webhookUpdateRequest' is not null or undefined (0, common_1.assertParamExists)('updateWebhook', 'webhookUpdateRequest', webhookUpdateRequest); const localVarPath = `/webhooks/{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: 'PUT' }, 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); } localVarHeaderParameter['Content-Type'] = 'application/json'; (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); localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(webhookUpdateRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; exports.WebhooksApiAxiosParamCreator = WebhooksApiAxiosParamCreator; /** * WebhooksApi - functional programming interface * @export */ const WebhooksApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.WebhooksApiAxiosParamCreator)(configuration); return { /** * What we do at Femsa translates into events. For example, an event of interest to us occurs at the time a payment is successfully processed. At that moment we will be interested in doing several things: Send an email to the buyer, generate an invoice, start the process of shipping the product, etc. * @summary Create Webhook * @param {WebhookRequest} webhookRequest requested field for webhook * @param {CreateWebhookAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use * @param {*} [options] Override http request option. * @throws {RequiredError} */ createWebhook(webhookRequest, acceptLanguage, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.createWebhook(webhookRequest, 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['WebhooksApi.createWebhook']) === 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 Delete Webhook * @param {string} id Identifier of the resource * @param {DeleteWebhookAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteWebhook(id, acceptLanguage, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteWebhook(id, 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['WebhooksApi.deleteWebhook']) === 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 Webhook * @param {string} id Identifier of the resource * @param {GetWebhookAcceptLanguageEnum} [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} */ getWebhook(id, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.getWebhook(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['WebhooksApi.getWebhook']) === 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); }); }, /** * Consume the list of webhooks you have, each environment supports 10 webhooks (For production and testing) * @summary Get List of Webhooks * @param {GetWebhooksAcceptLanguageEnum} [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} */ getWebhooks(acceptLanguage, xChildCompanyId, limit, search, next, previous, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.getWebhooks(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['WebhooksApi.getWebhooks']) === 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); }); }, /** * Send a webhook.ping event * @summary Test Webhook * @param {string} id Identifier of the resource * @param {TestWebhookAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use * @param {*} [options] Override http request option. * @throws {RequiredError} */ testWebhook(id, acceptLanguage, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.testWebhook(id, 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['WebhooksApi.testWebhook']) === 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); }); }, /** * updates an existing webhook * @summary Update Webhook * @param {string} id Identifier of the resource * @param {WebhookUpdateRequest} webhookUpdateRequest requested fields in order to update a webhook * @param {UpdateWebhookAcceptLanguageEnum} [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} */ updateWebhook(id, webhookUpdateRequest, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.updateWebhook(id, webhookUpdateRequest, 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['WebhooksApi.updateWebhook']) === 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.WebhooksApiFp = WebhooksApiFp; /** * WebhooksApi - factory interface * @export */ const WebhooksApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.WebhooksApiFp)(configuration); return { /** * What we do at Femsa translates into events. For example, an event of interest to us occurs at the time a payment is successfully processed. At that moment we will be interested in doing several things: Send an email to the buyer, generate an invoice, start the process of shipping the product, etc. * @summary Create Webhook * @param {WebhookRequest} webhookRequest requested field for webhook * @param {CreateWebhookAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use * @param {*} [options] Override http request option. * @throws {RequiredError} */ createWebhook(webhookRequest, acceptLanguage, options) { return localVarFp.createWebhook(webhookRequest, acceptLanguage, options).then((request) => request(axios, basePath)); }, /** * * @summary Delete Webhook * @param {string} id Identifier of the resource * @param {DeleteWebhookAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteWebhook(id, acceptLanguage, options) { return localVarFp.deleteWebhook(id, acceptLanguage, options).then((request) => request(axios, basePath)); }, /** * * @summary Get Webhook * @param {string} id Identifier of the resource * @param {GetWebhookAcceptLanguageEnum} [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} */ getWebhook(id, acceptLanguage, xChildCompanyId, options) { return localVarFp.getWebhook(id, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, /** * Consume the list of webhooks you have, each environment supports 10 webhooks (For production and testing) * @summary Get List of Webhooks * @param {GetWebhooksAcceptLanguageEnum} [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} */ getWebhooks(acceptLanguage, xChildCompanyId, limit, search, next, previous, options) { return localVarFp.getWebhooks(acceptLanguage, xChildCompanyId, limit, search, next, previous, options).then((request) => request(axios, basePath)); }, /** * Send a webhook.ping event * @summary Test Webhook * @param {string} id Identifier of the resource * @param {TestWebhookAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use * @param {*} [options] Override http request option. * @throws {RequiredError} */ testWebhook(id, acceptLanguage, options) { return localVarFp.testWebhook(id, acceptLanguage, options).then((request) => request(axios, basePath)); }, /** * updates an existing webhook * @summary Update Webhook * @param {string} id Identifier of the resource * @param {WebhookUpdateRequest} webhookUpdateRequest requested fields in order to update a webhook * @param {UpdateWebhookAcceptLanguageEnum} [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} */ updateWebhook(id, webhookUpdateRequest, acceptLanguage, xChildCompanyId, options) { return localVarFp.updateWebhook(id, webhookUpdateRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, }; }; exports.WebhooksApiFactory = WebhooksApiFactory; /** * WebhooksApi - object-oriented interface * @export * @class WebhooksApi * @extends {BaseAPI} */ class WebhooksApi extends base_1.BaseAPI { /** * What we do at Femsa translates into events. For example, an event of interest to us occurs at the time a payment is successfully processed. At that moment we will be interested in doing several things: Send an email to the buyer, generate an invoice, start the process of shipping the product, etc. * @summary Create Webhook * @param {WebhookRequest} webhookRequest requested field for webhook * @param {CreateWebhookAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksApi */ createWebhook(webhookRequest, acceptLanguage, options) { return (0, exports.WebhooksApiFp)(this.configuration).createWebhook(webhookRequest, acceptLanguage, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Delete Webhook * @param {string} id Identifier of the resource * @param {DeleteWebhookAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksApi */ deleteWebhook(id, acceptLanguage, options) { return (0, exports.WebhooksApiFp)(this.configuration).deleteWebhook(id, acceptLanguage, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Get Webhook * @param {string} id Identifier of the resource * @param {GetWebhookAcceptLanguageEnum} [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 WebhooksApi */ getWebhook(id, acceptLanguage, xChildCompanyId, options) { return (0, exports.WebhooksApiFp)(this.configuration).getWebhook(id, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } /** * Consume the list of webhooks you have, each environment supports 10 webhooks (For production and testing) * @summary Get List of Webhooks * @param {GetWebhooksAcceptLanguageEnum} [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 WebhooksApi */ getWebhooks(acceptLanguage, xChildCompanyId, limit, search, next, previous, options) { return (0, exports.WebhooksApiFp)(this.configuration).getWebhooks(acceptLanguage, xChildCompanyId, limit, search, next, previous, options).then((request) => request(this.axios, this.basePath)); } /** * Send a webhook.ping event * @summary Test Webhook * @param {string} id Identifier of the resource * @param {TestWebhookAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksApi */ testWebhook(id, acceptLanguage, options) { return (0, exports.WebhooksApiFp)(this.configuration).testWebhook(id, acceptLanguage, options).then((request) => request(this.axios, this.basePath)); } /** * updates an existing webhook * @summary Update Webhook * @param {string} id Identifier of the resource * @param {WebhookUpdateRequest} webhookUpdateRequest requested fields in order to update a webhook * @param {UpdateWebhookAcceptLanguageEnum} [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 WebhooksApi */ updateWebhook(id, webhookUpdateRequest, acceptLanguage, xChildCompanyId, options) { return (0, exports.WebhooksApiFp)(this.configuration).updateWebhook(id, webhookUpdateRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } } exports.WebhooksApi = WebhooksApi; /** * @export */ exports.CreateWebhookAcceptLanguageEnum = { es: 'es', en: 'en' }; /** * @export */ exports.DeleteWebhookAcceptLanguageEnum = { es: 'es', en: 'en' }; /** * @export */ exports.GetWebhookAcceptLanguageEnum = { es: 'es', en: 'en' }; /** * @export */ exports.GetWebhooksAcceptLanguageEnum = { es: 'es', en: 'en' }; /** * @export */ exports.TestWebhookAcceptLanguageEnum = { es: 'es', en: 'en' }; /** * @export */ exports.UpdateWebhookAcceptLanguageEnum = { es: 'es', en: 'en' };