UNPKG

digitalfemsa

Version:
363 lines (362 loc) 21.1 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'; /** * TaxesApi - axios parameter creator * @export */ export const TaxesApiAxiosParamCreator = function (configuration) { return { /** * Create new taxes for an existing orden * @summary Create Tax * @param {string} id Identifier of the resource * @param {OrderTaxRequest} orderTaxRequest requested field for a taxes * @param {OrdersCreateTaxesAcceptLanguageEnum} [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} */ ordersCreateTaxes: (id_1, orderTaxRequest_1, acceptLanguage_1, xChildCompanyId_1, ...args_1) => __awaiter(this, [id_1, orderTaxRequest_1, acceptLanguage_1, xChildCompanyId_1, ...args_1], void 0, function* (id, orderTaxRequest, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'id' is not null or undefined assertParamExists('ordersCreateTaxes', 'id', id); // verify required parameter 'orderTaxRequest' is not null or undefined assertParamExists('ordersCreateTaxes', 'orderTaxRequest', orderTaxRequest); const localVarPath = `/orders/{id}/tax_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(orderTaxRequest, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Delete taxes for an existing orden * @summary Delete Tax * @param {string} id Identifier of the resource * @param {string} taxId identifier * @param {OrdersDeleteTaxesAcceptLanguageEnum} [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} */ ordersDeleteTaxes: (id_2, taxId_1, acceptLanguage_2, xChildCompanyId_2, ...args_2) => __awaiter(this, [id_2, taxId_1, acceptLanguage_2, xChildCompanyId_2, ...args_2], void 0, function* (id, taxId, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'id' is not null or undefined assertParamExists('ordersDeleteTaxes', 'id', id); // verify required parameter 'taxId' is not null or undefined assertParamExists('ordersDeleteTaxes', 'taxId', taxId); const localVarPath = `/orders/{id}/tax_lines/{tax_id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))) .replace(`{${"tax_id"}}`, encodeURIComponent(String(taxId))); // 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, }; }), /** * Update taxes for an existing orden * @summary Update Tax * @param {string} id Identifier of the resource * @param {string} taxId identifier * @param {UpdateOrderTaxRequest} updateOrderTaxRequest requested field for taxes * @param {OrdersUpdateTaxesAcceptLanguageEnum} [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} */ ordersUpdateTaxes: (id_3, taxId_2, updateOrderTaxRequest_1, acceptLanguage_3, xChildCompanyId_3, ...args_3) => __awaiter(this, [id_3, taxId_2, updateOrderTaxRequest_1, acceptLanguage_3, xChildCompanyId_3, ...args_3], void 0, function* (id, taxId, updateOrderTaxRequest, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'id' is not null or undefined assertParamExists('ordersUpdateTaxes', 'id', id); // verify required parameter 'taxId' is not null or undefined assertParamExists('ordersUpdateTaxes', 'taxId', taxId); // verify required parameter 'updateOrderTaxRequest' is not null or undefined assertParamExists('ordersUpdateTaxes', 'updateOrderTaxRequest', updateOrderTaxRequest); const localVarPath = `/orders/{id}/tax_lines/{tax_id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))) .replace(`{${"tax_id"}}`, encodeURIComponent(String(taxId))); // 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(updateOrderTaxRequest, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; /** * TaxesApi - functional programming interface * @export */ export const TaxesApiFp = function (configuration) { const localVarAxiosParamCreator = TaxesApiAxiosParamCreator(configuration); return { /** * Create new taxes for an existing orden * @summary Create Tax * @param {string} id Identifier of the resource * @param {OrderTaxRequest} orderTaxRequest requested field for a taxes * @param {OrdersCreateTaxesAcceptLanguageEnum} [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} */ ordersCreateTaxes(id, orderTaxRequest, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.ordersCreateTaxes(id, orderTaxRequest, 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['TaxesApi.ordersCreateTaxes']) === 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 taxes for an existing orden * @summary Delete Tax * @param {string} id Identifier of the resource * @param {string} taxId identifier * @param {OrdersDeleteTaxesAcceptLanguageEnum} [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} */ ordersDeleteTaxes(id, taxId, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.ordersDeleteTaxes(id, taxId, 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['TaxesApi.ordersDeleteTaxes']) === 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 taxes for an existing orden * @summary Update Tax * @param {string} id Identifier of the resource * @param {string} taxId identifier * @param {UpdateOrderTaxRequest} updateOrderTaxRequest requested field for taxes * @param {OrdersUpdateTaxesAcceptLanguageEnum} [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} */ ordersUpdateTaxes(id, taxId, updateOrderTaxRequest, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.ordersUpdateTaxes(id, taxId, updateOrderTaxRequest, 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['TaxesApi.ordersUpdateTaxes']) === 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); }); }, }; }; /** * TaxesApi - factory interface * @export */ export const TaxesApiFactory = function (configuration, basePath, axios) { const localVarFp = TaxesApiFp(configuration); return { /** * Create new taxes for an existing orden * @summary Create Tax * @param {string} id Identifier of the resource * @param {OrderTaxRequest} orderTaxRequest requested field for a taxes * @param {OrdersCreateTaxesAcceptLanguageEnum} [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} */ ordersCreateTaxes(id, orderTaxRequest, acceptLanguage, xChildCompanyId, options) { return localVarFp.ordersCreateTaxes(id, orderTaxRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, /** * Delete taxes for an existing orden * @summary Delete Tax * @param {string} id Identifier of the resource * @param {string} taxId identifier * @param {OrdersDeleteTaxesAcceptLanguageEnum} [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} */ ordersDeleteTaxes(id, taxId, acceptLanguage, xChildCompanyId, options) { return localVarFp.ordersDeleteTaxes(id, taxId, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, /** * Update taxes for an existing orden * @summary Update Tax * @param {string} id Identifier of the resource * @param {string} taxId identifier * @param {UpdateOrderTaxRequest} updateOrderTaxRequest requested field for taxes * @param {OrdersUpdateTaxesAcceptLanguageEnum} [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} */ ordersUpdateTaxes(id, taxId, updateOrderTaxRequest, acceptLanguage, xChildCompanyId, options) { return localVarFp.ordersUpdateTaxes(id, taxId, updateOrderTaxRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, }; }; /** * TaxesApi - object-oriented interface * @export * @class TaxesApi * @extends {BaseAPI} */ export class TaxesApi extends BaseAPI { /** * Create new taxes for an existing orden * @summary Create Tax * @param {string} id Identifier of the resource * @param {OrderTaxRequest} orderTaxRequest requested field for a taxes * @param {OrdersCreateTaxesAcceptLanguageEnum} [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 TaxesApi */ ordersCreateTaxes(id, orderTaxRequest, acceptLanguage, xChildCompanyId, options) { return TaxesApiFp(this.configuration).ordersCreateTaxes(id, orderTaxRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } /** * Delete taxes for an existing orden * @summary Delete Tax * @param {string} id Identifier of the resource * @param {string} taxId identifier * @param {OrdersDeleteTaxesAcceptLanguageEnum} [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 TaxesApi */ ordersDeleteTaxes(id, taxId, acceptLanguage, xChildCompanyId, options) { return TaxesApiFp(this.configuration).ordersDeleteTaxes(id, taxId, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } /** * Update taxes for an existing orden * @summary Update Tax * @param {string} id Identifier of the resource * @param {string} taxId identifier * @param {UpdateOrderTaxRequest} updateOrderTaxRequest requested field for taxes * @param {OrdersUpdateTaxesAcceptLanguageEnum} [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 TaxesApi */ ordersUpdateTaxes(id, taxId, updateOrderTaxRequest, acceptLanguage, xChildCompanyId, options) { return TaxesApiFp(this.configuration).ordersUpdateTaxes(id, taxId, updateOrderTaxRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } } /** * @export */ export const OrdersCreateTaxesAcceptLanguageEnum = { es: 'es', en: 'en' }; /** * @export */ export const OrdersDeleteTaxesAcceptLanguageEnum = { es: 'es', en: 'en' }; /** * @export */ export const OrdersUpdateTaxesAcceptLanguageEnum = { es: 'es', en: 'en' };