UNPKG

digitalfemsa

Version:
578 lines (577 loc) 36.6 kB
/* 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'; /** * DiscountsApi - axios parameter creator * @export */ export const DiscountsApiAxiosParamCreator = function (configuration) { return { /** * Create discount lines for an existing orden * @summary Create Discount * @param {string} id Identifier of the resource * @param {OrderDiscountLinesRequest} orderDiscountLinesRequest requested field for a discount lines * @param {OrdersCreateDiscountLineAcceptLanguageEnum} [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} */ ordersCreateDiscountLine: (id_1, orderDiscountLinesRequest_1, acceptLanguage_1, xChildCompanyId_1, ...args_1) => __awaiter(this, [id_1, orderDiscountLinesRequest_1, acceptLanguage_1, xChildCompanyId_1, ...args_1], void 0, function* (id, orderDiscountLinesRequest, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'id' is not null or undefined assertParamExists('ordersCreateDiscountLine', 'id', id); // verify required parameter 'orderDiscountLinesRequest' is not null or undefined assertParamExists('ordersCreateDiscountLine', 'orderDiscountLinesRequest', orderDiscountLinesRequest); const localVarPath = `/orders/{id}/discount_lines` .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(orderDiscountLinesRequest, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Delete an existing discount lines for an existing orden * @summary Delete Discount * @param {string} id Identifier of the resource * @param {string} discountLinesId discount line id identifier * @param {OrdersDeleteDiscountLinesAcceptLanguageEnum} [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} */ ordersDeleteDiscountLines: (id_2, discountLinesId_1, acceptLanguage_2, xChildCompanyId_2, ...args_2) => __awaiter(this, [id_2, discountLinesId_1, acceptLanguage_2, xChildCompanyId_2, ...args_2], void 0, function* (id, discountLinesId, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'id' is not null or undefined assertParamExists('ordersDeleteDiscountLines', 'id', id); // verify required parameter 'discountLinesId' is not null or undefined assertParamExists('ordersDeleteDiscountLines', 'discountLinesId', discountLinesId); const localVarPath = `/orders/{id}/discount_lines/{discount_lines_id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))) .replace(`{${"discount_lines_id"}}`, encodeURIComponent(String(discountLinesId))); // 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, }; }), /** * Get an existing discount lines for an existing orden * @summary Get Discount * @param {string} id Identifier of the resource * @param {string} discountLinesId discount line id identifier * @param {OrdersGetDiscountLineAcceptLanguageEnum} [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} */ ordersGetDiscountLine: (id_3, discountLinesId_2, acceptLanguage_3, xChildCompanyId_3, ...args_3) => __awaiter(this, [id_3, discountLinesId_2, acceptLanguage_3, xChildCompanyId_3, ...args_3], void 0, function* (id, discountLinesId, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'id' is not null or undefined assertParamExists('ordersGetDiscountLine', 'id', id); // verify required parameter 'discountLinesId' is not null or undefined assertParamExists('ordersGetDiscountLine', 'discountLinesId', discountLinesId); const localVarPath = `/orders/{id}/discount_lines/{discount_lines_id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))) .replace(`{${"discount_lines_id"}}`, encodeURIComponent(String(discountLinesId))); // 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 discount lines for an existing orden * @summary Get a List of Discount * @param {string} id Identifier of the resource * @param {OrdersGetDiscountLinesAcceptLanguageEnum} [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} */ ordersGetDiscountLines: (id_4, acceptLanguage_4, xChildCompanyId_4, limit_1, search_1, next_1, previous_1, ...args_4) => __awaiter(this, [id_4, acceptLanguage_4, xChildCompanyId_4, limit_1, search_1, next_1, previous_1, ...args_4], void 0, function* (id, acceptLanguage, xChildCompanyId, limit, search, next, previous, options = {}) { // verify required parameter 'id' is not null or undefined assertParamExists('ordersGetDiscountLines', 'id', id); const localVarPath = `/orders/{id}/discount_lines` .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 (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, }; }), /** * Update an existing discount lines for an existing orden * @summary Update Discount * @param {string} id Identifier of the resource * @param {string} discountLinesId discount line id identifier * @param {UpdateOrderDiscountLinesRequest} updateOrderDiscountLinesRequest requested field for a discount lines * @param {OrdersUpdateDiscountLinesAcceptLanguageEnum} [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} */ ordersUpdateDiscountLines: (id_5, discountLinesId_3, updateOrderDiscountLinesRequest_1, acceptLanguage_5, xChildCompanyId_5, ...args_5) => __awaiter(this, [id_5, discountLinesId_3, updateOrderDiscountLinesRequest_1, acceptLanguage_5, xChildCompanyId_5, ...args_5], void 0, function* (id, discountLinesId, updateOrderDiscountLinesRequest, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'id' is not null or undefined assertParamExists('ordersUpdateDiscountLines', 'id', id); // verify required parameter 'discountLinesId' is not null or undefined assertParamExists('ordersUpdateDiscountLines', 'discountLinesId', discountLinesId); // verify required parameter 'updateOrderDiscountLinesRequest' is not null or undefined assertParamExists('ordersUpdateDiscountLines', 'updateOrderDiscountLinesRequest', updateOrderDiscountLinesRequest); const localVarPath = `/orders/{id}/discount_lines/{discount_lines_id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))) .replace(`{${"discount_lines_id"}}`, encodeURIComponent(String(discountLinesId))); // 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); } 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(updateOrderDiscountLinesRequest, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; /** * DiscountsApi - functional programming interface * @export */ export const DiscountsApiFp = function (configuration) { const localVarAxiosParamCreator = DiscountsApiAxiosParamCreator(configuration); return { /** * Create discount lines for an existing orden * @summary Create Discount * @param {string} id Identifier of the resource * @param {OrderDiscountLinesRequest} orderDiscountLinesRequest requested field for a discount lines * @param {OrdersCreateDiscountLineAcceptLanguageEnum} [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} */ ordersCreateDiscountLine(id, orderDiscountLinesRequest, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.ordersCreateDiscountLine(id, orderDiscountLinesRequest, 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['DiscountsApi.ordersCreateDiscountLine']) === 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); }); }, /** * Delete an existing discount lines for an existing orden * @summary Delete Discount * @param {string} id Identifier of the resource * @param {string} discountLinesId discount line id identifier * @param {OrdersDeleteDiscountLinesAcceptLanguageEnum} [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} */ ordersDeleteDiscountLines(id, discountLinesId, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.ordersDeleteDiscountLines(id, discountLinesId, 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['DiscountsApi.ordersDeleteDiscountLines']) === 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 an existing discount lines for an existing orden * @summary Get Discount * @param {string} id Identifier of the resource * @param {string} discountLinesId discount line id identifier * @param {OrdersGetDiscountLineAcceptLanguageEnum} [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} */ ordersGetDiscountLine(id, discountLinesId, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.ordersGetDiscountLine(id, discountLinesId, 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['DiscountsApi.ordersGetDiscountLine']) === 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 discount lines for an existing orden * @summary Get a List of Discount * @param {string} id Identifier of the resource * @param {OrdersGetDiscountLinesAcceptLanguageEnum} [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} */ ordersGetDiscountLines(id, acceptLanguage, xChildCompanyId, limit, search, next, previous, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.ordersGetDiscountLines(id, 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['DiscountsApi.ordersGetDiscountLines']) === 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 discount lines for an existing orden * @summary Update Discount * @param {string} id Identifier of the resource * @param {string} discountLinesId discount line id identifier * @param {UpdateOrderDiscountLinesRequest} updateOrderDiscountLinesRequest requested field for a discount lines * @param {OrdersUpdateDiscountLinesAcceptLanguageEnum} [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} */ ordersUpdateDiscountLines(id, discountLinesId, updateOrderDiscountLinesRequest, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.ordersUpdateDiscountLines(id, discountLinesId, updateOrderDiscountLinesRequest, 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['DiscountsApi.ordersUpdateDiscountLines']) === 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); }); }, }; }; /** * DiscountsApi - factory interface * @export */ export const DiscountsApiFactory = function (configuration, basePath, axios) { const localVarFp = DiscountsApiFp(configuration); return { /** * Create discount lines for an existing orden * @summary Create Discount * @param {string} id Identifier of the resource * @param {OrderDiscountLinesRequest} orderDiscountLinesRequest requested field for a discount lines * @param {OrdersCreateDiscountLineAcceptLanguageEnum} [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} */ ordersCreateDiscountLine(id, orderDiscountLinesRequest, acceptLanguage, xChildCompanyId, options) { return localVarFp.ordersCreateDiscountLine(id, orderDiscountLinesRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, /** * Delete an existing discount lines for an existing orden * @summary Delete Discount * @param {string} id Identifier of the resource * @param {string} discountLinesId discount line id identifier * @param {OrdersDeleteDiscountLinesAcceptLanguageEnum} [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} */ ordersDeleteDiscountLines(id, discountLinesId, acceptLanguage, xChildCompanyId, options) { return localVarFp.ordersDeleteDiscountLines(id, discountLinesId, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, /** * Get an existing discount lines for an existing orden * @summary Get Discount * @param {string} id Identifier of the resource * @param {string} discountLinesId discount line id identifier * @param {OrdersGetDiscountLineAcceptLanguageEnum} [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} */ ordersGetDiscountLine(id, discountLinesId, acceptLanguage, xChildCompanyId, options) { return localVarFp.ordersGetDiscountLine(id, discountLinesId, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, /** * Get discount lines for an existing orden * @summary Get a List of Discount * @param {string} id Identifier of the resource * @param {OrdersGetDiscountLinesAcceptLanguageEnum} [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} */ ordersGetDiscountLines(id, acceptLanguage, xChildCompanyId, limit, search, next, previous, options) { return localVarFp.ordersGetDiscountLines(id, acceptLanguage, xChildCompanyId, limit, search, next, previous, options).then((request) => request(axios, basePath)); }, /** * Update an existing discount lines for an existing orden * @summary Update Discount * @param {string} id Identifier of the resource * @param {string} discountLinesId discount line id identifier * @param {UpdateOrderDiscountLinesRequest} updateOrderDiscountLinesRequest requested field for a discount lines * @param {OrdersUpdateDiscountLinesAcceptLanguageEnum} [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} */ ordersUpdateDiscountLines(id, discountLinesId, updateOrderDiscountLinesRequest, acceptLanguage, xChildCompanyId, options) { return localVarFp.ordersUpdateDiscountLines(id, discountLinesId, updateOrderDiscountLinesRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, }; }; /** * DiscountsApi - object-oriented interface * @export * @class DiscountsApi * @extends {BaseAPI} */ export class DiscountsApi extends BaseAPI { /** * Create discount lines for an existing orden * @summary Create Discount * @param {string} id Identifier of the resource * @param {OrderDiscountLinesRequest} orderDiscountLinesRequest requested field for a discount lines * @param {OrdersCreateDiscountLineAcceptLanguageEnum} [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 DiscountsApi */ ordersCreateDiscountLine(id, orderDiscountLinesRequest, acceptLanguage, xChildCompanyId, options) { return DiscountsApiFp(this.configuration).ordersCreateDiscountLine(id, orderDiscountLinesRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } /** * Delete an existing discount lines for an existing orden * @summary Delete Discount * @param {string} id Identifier of the resource * @param {string} discountLinesId discount line id identifier * @param {OrdersDeleteDiscountLinesAcceptLanguageEnum} [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 DiscountsApi */ ordersDeleteDiscountLines(id, discountLinesId, acceptLanguage, xChildCompanyId, options) { return DiscountsApiFp(this.configuration).ordersDeleteDiscountLines(id, discountLinesId, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } /** * Get an existing discount lines for an existing orden * @summary Get Discount * @param {string} id Identifier of the resource * @param {string} discountLinesId discount line id identifier * @param {OrdersGetDiscountLineAcceptLanguageEnum} [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 DiscountsApi */ ordersGetDiscountLine(id, discountLinesId, acceptLanguage, xChildCompanyId, options) { return DiscountsApiFp(this.configuration).ordersGetDiscountLine(id, discountLinesId, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } /** * Get discount lines for an existing orden * @summary Get a List of Discount * @param {string} id Identifier of the resource * @param {OrdersGetDiscountLinesAcceptLanguageEnum} [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 DiscountsApi */ ordersGetDiscountLines(id, acceptLanguage, xChildCompanyId, limit, search, next, previous, options) { return DiscountsApiFp(this.configuration).ordersGetDiscountLines(id, acceptLanguage, xChildCompanyId, limit, search, next, previous, options).then((request) => request(this.axios, this.basePath)); } /** * Update an existing discount lines for an existing orden * @summary Update Discount * @param {string} id Identifier of the resource * @param {string} discountLinesId discount line id identifier * @param {UpdateOrderDiscountLinesRequest} updateOrderDiscountLinesRequest requested field for a discount lines * @param {OrdersUpdateDiscountLinesAcceptLanguageEnum} [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 DiscountsApi */ ordersUpdateDiscountLines(id, discountLinesId, updateOrderDiscountLinesRequest, acceptLanguage, xChildCompanyId, options) { return DiscountsApiFp(this.configuration).ordersUpdateDiscountLines(id, discountLinesId, updateOrderDiscountLinesRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } } /** * @export */ export const OrdersCreateDiscountLineAcceptLanguageEnum = { es: 'es', en: 'en' }; /** * @export */ export const OrdersDeleteDiscountLinesAcceptLanguageEnum = { es: 'es', en: 'en' }; /** * @export */ export const OrdersGetDiscountLineAcceptLanguageEnum = { es: 'es', en: 'en' }; /** * @export */ export const OrdersGetDiscountLinesAcceptLanguageEnum = { es: 'es', en: 'en' }; /** * @export */ export const OrdersUpdateDiscountLinesAcceptLanguageEnum = { es: 'es', en: 'en' };