digitalfemsa
Version:
OpenAPI client for digitalfemsa
827 lines (826 loc) • 49.5 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());
});
};
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setBearerAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
// @ts-ignore
import { BASE_PATH, BaseAPI, operationServerMap } from '../base';
/**
* OrdersApi - axios parameter creator
* @export
*/
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
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, 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 setBearerAuthToObject(localVarHeaderParameter, configuration);
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
if (xChildCompanyId != null) {
localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: 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
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, 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 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';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = serializeDataIfNeeded(orderRequest, localVarRequestOptions, configuration);
return {
url: 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
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, 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 setBearerAuthToObject(localVarHeaderParameter, configuration);
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
if (xChildCompanyId != null) {
localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: 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, 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 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);
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: 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
assertParamExists('orderCancelRefund', 'id', id);
// verify required parameter 'refundId' is not null or undefined
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, 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 setBearerAuthToObject(localVarHeaderParameter, configuration);
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
if (xChildCompanyId != null) {
localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: 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
assertParamExists('orderRefund', 'id', id);
// verify required parameter 'orderRefundRequest' is not null or undefined
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, 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 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';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = serializeDataIfNeeded(orderRefundRequest, localVarRequestOptions, configuration);
return {
url: 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
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, 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 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';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = serializeDataIfNeeded(orderCaptureRequest, localVarRequestOptions, configuration);
return {
url: 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
assertParamExists('updateOrder', 'id', id);
// verify required parameter 'orderUpdateRequest' is not null or undefined
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, 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 setBearerAuthToObject(localVarHeaderParameter, configuration);
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = serializeDataIfNeeded(orderUpdateRequest, localVarRequestOptions, configuration);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
}),
};
};
/**
* OrdersApi - functional programming interface
* @export
*/
export const OrdersApiFp = function (configuration) {
const localVarAxiosParamCreator = 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 = operationServerMap['OrdersApi.cancelOrder']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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 = operationServerMap['OrdersApi.createOrder']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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 = operationServerMap['OrdersApi.getOrderById']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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 = operationServerMap['OrdersApi.getOrders']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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 = operationServerMap['OrdersApi.orderCancelRefund']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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 = operationServerMap['OrdersApi.orderRefund']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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 = operationServerMap['OrdersApi.ordersCreateCapture']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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 = operationServerMap['OrdersApi.updateOrder']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
});
},
};
};
/**
* OrdersApi - factory interface
* @export
*/
export const OrdersApiFactory = function (configuration, basePath, axios) {
const localVarFp = 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));
},
};
};
/**
* OrdersApi - object-oriented interface
* @export
* @class OrdersApi
* @extends {BaseAPI}
*/
export class OrdersApi extends 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 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 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 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 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 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 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 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 OrdersApiFp(this.configuration).updateOrder(id, orderUpdateRequest, acceptLanguage, options).then((request) => request(this.axios, this.basePath));
}
}
/**
* @export
*/
export const CancelOrderAcceptLanguageEnum = {
es: 'es',
en: 'en'
};
/**
* @export
*/
export const CreateOrderAcceptLanguageEnum = {
es: 'es',
en: 'en'
};
/**
* @export
*/
export const GetOrderByIdAcceptLanguageEnum = {
es: 'es',
en: 'en'
};
/**
* @export
*/
export const GetOrdersAcceptLanguageEnum = {
es: 'es',
en: 'en'
};
/**
* @export
*/
export const OrderCancelRefundAcceptLanguageEnum = {
es: 'es',
en: 'en'
};
/**
* @export
*/
export const OrderRefundAcceptLanguageEnum = {
es: 'es',
en: 'en'
};
/**
* @export
*/
export const OrdersCreateCaptureAcceptLanguageEnum = {
es: 'es',
en: 'en'
};
/**
* @export
*/
export const UpdateOrderAcceptLanguageEnum = {
es: 'es',
en: 'en'
};