UNPKG

digitalfemsa

Version:
774 lines 50.9 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.UpdateOrderAcceptLanguageEnum = exports.OrdersCreateCaptureAcceptLanguageEnum = exports.OrderRefundAcceptLanguageEnum = exports.OrderCancelRefundAcceptLanguageEnum = exports.GetOrdersAcceptLanguageEnum = exports.GetOrderByIdAcceptLanguageEnum = exports.CreateOrderAcceptLanguageEnum = exports.CancelOrderAcceptLanguageEnum = exports.OrdersApi = exports.OrdersApiFactory = exports.OrdersApiFp = exports.OrdersApiAxiosParamCreator = 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"); /** * OrdersApi - axios parameter creator * @export */ const OrdersApiAxiosParamCreator = function (configuration) { return { /** * Cancel an order that has been previously created. * @summary Cancel Order * @param {string} id Identifier of the resource * @param {CancelOrderAcceptLanguageEnum} [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} */ cancelOrder: (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)('cancelOrder', 'id', id); const localVarPath = `/orders/{id}/cancel` .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); } 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, }; }), /** * Create a new order. * @summary Create order * @param {OrderRequest} orderRequest requested field for order * @param {CreateOrderAcceptLanguageEnum} [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} */ createOrder: (orderRequest_1, acceptLanguage_2, xChildCompanyId_2, ...args_2) => __awaiter(this, [orderRequest_1, acceptLanguage_2, xChildCompanyId_2, ...args_2], void 0, function* (orderRequest, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'orderRequest' is not null or undefined (0, common_1.assertParamExists)('createOrder', 'orderRequest', orderRequest); const localVarPath = `/orders`; // 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); } 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)(orderRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Info for a specific order * @summary Get Order * @param {string} id Identifier of the resource * @param {GetOrderByIdAcceptLanguageEnum} [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} */ getOrderById: (id_2, acceptLanguage_3, xChildCompanyId_3, ...args_3) => __awaiter(this, [id_2, acceptLanguage_3, xChildCompanyId_3, ...args_3], void 0, function* (id, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('getOrderById', 'id', id); const localVarPath = `/orders/{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, }; }), /** * Get order details in the form of a list * @summary Get a list of Orders * @param {GetOrdersAcceptLanguageEnum} [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} */ getOrders: (acceptLanguage_4, xChildCompanyId_4, limit_1, search_1, next_1, previous_1, ...args_4) => __awaiter(this, [acceptLanguage_4, xChildCompanyId_4, limit_1, search_1, next_1, previous_1, ...args_4], void 0, function* (acceptLanguage, xChildCompanyId, limit, search, next, previous, options = {}) { const localVarPath = `/orders`; // 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, }; }), /** * A refunded order describes the items, amount, and reason an order is being refunded. * @summary Cancel Refund * @param {string} id Identifier of the resource * @param {string} refundId refund identifier * @param {OrderCancelRefundAcceptLanguageEnum} [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} */ orderCancelRefund: (id_3, refundId_1, acceptLanguage_5, xChildCompanyId_5, ...args_5) => __awaiter(this, [id_3, refundId_1, acceptLanguage_5, xChildCompanyId_5, ...args_5], void 0, function* (id, refundId, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('orderCancelRefund', 'id', id); // verify required parameter 'refundId' is not null or undefined (0, common_1.assertParamExists)('orderCancelRefund', 'refundId', refundId); const localVarPath = `/orders/{id}/refunds/{refund_id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))) .replace(`{${"refund_id"}}`, encodeURIComponent(String(refundId))); // 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); } 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, }; }), /** * A refunded order describes the items, amount, and reason an order is being refunded. * @summary Refund Order * @param {string} id Identifier of the resource * @param {OrderRefundRequest} orderRefundRequest requested field for a refund * @param {OrderRefundAcceptLanguageEnum} [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} */ orderRefund: (id_4, orderRefundRequest_1, acceptLanguage_6, xChildCompanyId_6, ...args_6) => __awaiter(this, [id_4, orderRefundRequest_1, acceptLanguage_6, xChildCompanyId_6, ...args_6], void 0, function* (id, orderRefundRequest, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('orderRefund', 'id', id); // verify required parameter 'orderRefundRequest' is not null or undefined (0, common_1.assertParamExists)('orderRefund', 'orderRefundRequest', orderRefundRequest); const localVarPath = `/orders/{id}/refunds` .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); } 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)(orderRefundRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Processes an order that has been previously authorized. * @summary Capture Order * @param {string} id Identifier of the resource * @param {OrdersCreateCaptureAcceptLanguageEnum} [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 {OrderCaptureRequest} [orderCaptureRequest] requested fields for capture order * @param {*} [options] Override http request option. * @throws {RequiredError} */ ordersCreateCapture: (id_5, acceptLanguage_7, xChildCompanyId_7, orderCaptureRequest_1, ...args_7) => __awaiter(this, [id_5, acceptLanguage_7, xChildCompanyId_7, orderCaptureRequest_1, ...args_7], void 0, function* (id, acceptLanguage, xChildCompanyId, orderCaptureRequest, options = {}) { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('ordersCreateCapture', 'id', id); const localVarPath = `/orders/{id}/capture` .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); } 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)(orderCaptureRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Update an existing Order. * @summary Update Order * @param {string} id Identifier of the resource * @param {OrderUpdateRequest} orderUpdateRequest requested field for an order * @param {UpdateOrderAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateOrder: (id_6, orderUpdateRequest_1, acceptLanguage_8, ...args_8) => __awaiter(this, [id_6, orderUpdateRequest_1, acceptLanguage_8, ...args_8], void 0, function* (id, orderUpdateRequest, acceptLanguage, options = {}) { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('updateOrder', 'id', id); // verify required parameter 'orderUpdateRequest' is not null or undefined (0, common_1.assertParamExists)('updateOrder', 'orderUpdateRequest', orderUpdateRequest); const localVarPath = `/orders/{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); } 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)(orderUpdateRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; exports.OrdersApiAxiosParamCreator = OrdersApiAxiosParamCreator; /** * OrdersApi - functional programming interface * @export */ const OrdersApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.OrdersApiAxiosParamCreator)(configuration); return { /** * Cancel an order that has been previously created. * @summary Cancel Order * @param {string} id Identifier of the resource * @param {CancelOrderAcceptLanguageEnum} [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} */ cancelOrder(id, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.cancelOrder(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['OrdersApi.cancelOrder']) === 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); }); }, /** * Create a new order. * @summary Create order * @param {OrderRequest} orderRequest requested field for order * @param {CreateOrderAcceptLanguageEnum} [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} */ createOrder(orderRequest, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.createOrder(orderRequest, 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['OrdersApi.createOrder']) === 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); }); }, /** * Info for a specific order * @summary Get Order * @param {string} id Identifier of the resource * @param {GetOrderByIdAcceptLanguageEnum} [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} */ getOrderById(id, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.getOrderById(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['OrdersApi.getOrderById']) === 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); }); }, /** * Get order details in the form of a list * @summary Get a list of Orders * @param {GetOrdersAcceptLanguageEnum} [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} */ getOrders(acceptLanguage, xChildCompanyId, limit, search, next, previous, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.getOrders(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['OrdersApi.getOrders']) === 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); }); }, /** * A refunded order describes the items, amount, and reason an order is being refunded. * @summary Cancel Refund * @param {string} id Identifier of the resource * @param {string} refundId refund identifier * @param {OrderCancelRefundAcceptLanguageEnum} [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} */ orderCancelRefund(id, refundId, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.orderCancelRefund(id, refundId, 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['OrdersApi.orderCancelRefund']) === 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); }); }, /** * A refunded order describes the items, amount, and reason an order is being refunded. * @summary Refund Order * @param {string} id Identifier of the resource * @param {OrderRefundRequest} orderRefundRequest requested field for a refund * @param {OrderRefundAcceptLanguageEnum} [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} */ orderRefund(id, orderRefundRequest, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.orderRefund(id, orderRefundRequest, 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['OrdersApi.orderRefund']) === 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); }); }, /** * Processes an order that has been previously authorized. * @summary Capture Order * @param {string} id Identifier of the resource * @param {OrdersCreateCaptureAcceptLanguageEnum} [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 {OrderCaptureRequest} [orderCaptureRequest] requested fields for capture order * @param {*} [options] Override http request option. * @throws {RequiredError} */ ordersCreateCapture(id, acceptLanguage, xChildCompanyId, orderCaptureRequest, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.ordersCreateCapture(id, acceptLanguage, xChildCompanyId, orderCaptureRequest, 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['OrdersApi.ordersCreateCapture']) === 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); }); }, /** * Update an existing Order. * @summary Update Order * @param {string} id Identifier of the resource * @param {OrderUpdateRequest} orderUpdateRequest requested field for an order * @param {UpdateOrderAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateOrder(id, orderUpdateRequest, acceptLanguage, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.updateOrder(id, orderUpdateRequest, 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['OrdersApi.updateOrder']) === 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.OrdersApiFp = OrdersApiFp; /** * OrdersApi - factory interface * @export */ const OrdersApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.OrdersApiFp)(configuration); return { /** * Cancel an order that has been previously created. * @summary Cancel Order * @param {string} id Identifier of the resource * @param {CancelOrderAcceptLanguageEnum} [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} */ cancelOrder(id, acceptLanguage, xChildCompanyId, options) { return localVarFp.cancelOrder(id, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, /** * Create a new order. * @summary Create order * @param {OrderRequest} orderRequest requested field for order * @param {CreateOrderAcceptLanguageEnum} [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} */ createOrder(orderRequest, acceptLanguage, xChildCompanyId, options) { return localVarFp.createOrder(orderRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, /** * Info for a specific order * @summary Get Order * @param {string} id Identifier of the resource * @param {GetOrderByIdAcceptLanguageEnum} [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} */ getOrderById(id, acceptLanguage, xChildCompanyId, options) { return localVarFp.getOrderById(id, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, /** * Get order details in the form of a list * @summary Get a list of Orders * @param {GetOrdersAcceptLanguageEnum} [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} */ getOrders(acceptLanguage, xChildCompanyId, limit, search, next, previous, options) { return localVarFp.getOrders(acceptLanguage, xChildCompanyId, limit, search, next, previous, options).then((request) => request(axios, basePath)); }, /** * A refunded order describes the items, amount, and reason an order is being refunded. * @summary Cancel Refund * @param {string} id Identifier of the resource * @param {string} refundId refund identifier * @param {OrderCancelRefundAcceptLanguageEnum} [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} */ orderCancelRefund(id, refundId, acceptLanguage, xChildCompanyId, options) { return localVarFp.orderCancelRefund(id, refundId, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, /** * A refunded order describes the items, amount, and reason an order is being refunded. * @summary Refund Order * @param {string} id Identifier of the resource * @param {OrderRefundRequest} orderRefundRequest requested field for a refund * @param {OrderRefundAcceptLanguageEnum} [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} */ orderRefund(id, orderRefundRequest, acceptLanguage, xChildCompanyId, options) { return localVarFp.orderRefund(id, orderRefundRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, /** * Processes an order that has been previously authorized. * @summary Capture Order * @param {string} id Identifier of the resource * @param {OrdersCreateCaptureAcceptLanguageEnum} [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 {OrderCaptureRequest} [orderCaptureRequest] requested fields for capture order * @param {*} [options] Override http request option. * @throws {RequiredError} */ ordersCreateCapture(id, acceptLanguage, xChildCompanyId, orderCaptureRequest, options) { return localVarFp.ordersCreateCapture(id, acceptLanguage, xChildCompanyId, orderCaptureRequest, options).then((request) => request(axios, basePath)); }, /** * Update an existing Order. * @summary Update Order * @param {string} id Identifier of the resource * @param {OrderUpdateRequest} orderUpdateRequest requested field for an order * @param {UpdateOrderAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateOrder(id, orderUpdateRequest, acceptLanguage, options) { return localVarFp.updateOrder(id, orderUpdateRequest, acceptLanguage, options).then((request) => request(axios, basePath)); }, }; }; exports.OrdersApiFactory = OrdersApiFactory; /** * OrdersApi - object-oriented interface * @export * @class OrdersApi * @extends {BaseAPI} */ class OrdersApi extends base_1.BaseAPI { /** * Cancel an order that has been previously created. * @summary Cancel Order * @param {string} id Identifier of the resource * @param {CancelOrderAcceptLanguageEnum} [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 OrdersApi */ cancelOrder(id, acceptLanguage, xChildCompanyId, options) { return (0, exports.OrdersApiFp)(this.configuration).cancelOrder(id, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } /** * Create a new order. * @summary Create order * @param {OrderRequest} orderRequest requested field for order * @param {CreateOrderAcceptLanguageEnum} [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 OrdersApi */ createOrder(orderRequest, acceptLanguage, xChildCompanyId, options) { return (0, exports.OrdersApiFp)(this.configuration).createOrder(orderRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } /** * Info for a specific order * @summary Get Order * @param {string} id Identifier of the resource * @param {GetOrderByIdAcceptLanguageEnum} [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 OrdersApi */ getOrderById(id, acceptLanguage, xChildCompanyId, options) { return (0, exports.OrdersApiFp)(this.configuration).getOrderById(id, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } /** * Get order details in the form of a list * @summary Get a list of Orders * @param {GetOrdersAcceptLanguageEnum} [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 OrdersApi */ getOrders(acceptLanguage, xChildCompanyId, limit, search, next, previous, options) { return (0, exports.OrdersApiFp)(this.configuration).getOrders(acceptLanguage, xChildCompanyId, limit, search, next, previous, options).then((request) => request(this.axios, this.basePath)); } /** * A refunded order describes the items, amount, and reason an order is being refunded. * @summary Cancel Refund * @param {string} id Identifier of the resource * @param {string} refundId refund identifier * @param {OrderCancelRefundAcceptLanguageEnum} [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 OrdersApi */ orderCancelRefund(id, refundId, acceptLanguage, xChildCompanyId, options) { return (0, exports.OrdersApiFp)(this.configuration).orderCancelRefund(id, refundId, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } /** * A refunded order describes the items, amount, and reason an order is being refunded. * @summary Refund Order * @param {string} id Identifier of the resource * @param {OrderRefundRequest} orderRefundRequest requested field for a refund * @param {OrderRefundAcceptLanguageEnum} [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 OrdersApi */ orderRefund(id, orderRefundRequest, acceptLanguage, xChildCompanyId, options) { return (0, exports.OrdersApiFp)(this.configuration).orderRefund(id, orderRefundRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } /** * Processes an order that has been previously authorized. * @summary Capture Order * @param {string} id Identifier of the resource * @param {OrdersCreateCaptureAcceptLanguageEnum} [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 {OrderCaptureRequest} [orderCaptureRequest] requested fields for capture order * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OrdersApi */ ordersCreateCapture(id, acceptLanguage, xChildCompanyId, orderCaptureRequest, options) { return (0, exports.OrdersApiFp)(this.configuration).ordersCreateCapture(id, acceptLanguage, xChildCompanyId, orderCaptureRequest, options).then((request) => request(this.axios, this.basePath)); } /** * Update an existing Order. * @summary Update Order * @param {string} id Identifier of the resource * @param {OrderUpdateRequest} orderUpdateRequest requested field for an order * @param {UpdateOrderAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OrdersApi */ updateOrder(id, orderUpdateRequest, acceptLanguage, options) { return (0, exports