UNPKG

digitalfemsa

Version:
746 lines (745 loc) 47.5 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'; /** * CustomersApi - axios parameter creator * @export */ export const CustomersApiAxiosParamCreator = function (configuration) { return { /** * The purpose of business is to create and keep a customer, you will learn what elements you need to create a customer. * @summary Create customer * @param {Customer} customer requested field for customer * @param {CreateCustomerAcceptLanguageEnum} [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} */ createCustomer: (customer_1, acceptLanguage_1, xChildCompanyId_1, ...args_1) => __awaiter(this, [customer_1, acceptLanguage_1, xChildCompanyId_1, ...args_1], void 0, function* (customer, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'customer' is not null or undefined assertParamExists('createCustomer', 'customer', customer); const localVarPath = `/customers`; // 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(customer, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Create Fiscal entity resource that corresponds to a customer ID. * @summary Create Fiscal Entity * @param {string} id Identifier of the resource * @param {CustomerFiscalEntitiesRequest} customerFiscalEntitiesRequest requested field for customer fiscal entities * @param {CreateCustomerFiscalEntitiesAcceptLanguageEnum} [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} */ createCustomerFiscalEntities: (id_1, customerFiscalEntitiesRequest_1, acceptLanguage_2, xChildCompanyId_2, ...args_2) => __awaiter(this, [id_1, customerFiscalEntitiesRequest_1, acceptLanguage_2, xChildCompanyId_2, ...args_2], void 0, function* (id, customerFiscalEntitiesRequest, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'id' is not null or undefined assertParamExists('createCustomerFiscalEntities', 'id', id); // verify required parameter 'customerFiscalEntitiesRequest' is not null or undefined assertParamExists('createCustomerFiscalEntities', 'customerFiscalEntitiesRequest', customerFiscalEntitiesRequest); const localVarPath = `/customers/{id}/fiscal_entities` .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(customerFiscalEntitiesRequest, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Deleted a customer resource that corresponds to a customer ID. * @summary Delete Customer * @param {string} id Identifier of the resource * @param {DeleteCustomerByIdAcceptLanguageEnum} [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} */ deleteCustomerById: (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('deleteCustomerById', 'id', id); const localVarPath = `/customers/{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: '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, }; }), /** * Gets a customer resource that corresponds to a customer ID. * @summary Get Customer * @param {string} id Identifier of the resource * @param {GetCustomerByIdAcceptLanguageEnum} [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} */ getCustomerById: (id_3, acceptLanguage_4, xChildCompanyId_4, ...args_4) => __awaiter(this, [id_3, acceptLanguage_4, xChildCompanyId_4, ...args_4], void 0, function* (id, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'id' is not null or undefined assertParamExists('getCustomerById', 'id', id); const localVarPath = `/customers/{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, }; }), /** * The purpose of business is to create and maintain a client, you will learn what elements you need to obtain a list of clients, which can be paged. * @summary Get a list of customers * @param {GetCustomersAcceptLanguageEnum} [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} */ getCustomers: (acceptLanguage_5, xChildCompanyId_5, limit_1, search_1, next_1, previous_1, ...args_5) => __awaiter(this, [acceptLanguage_5, xChildCompanyId_5, limit_1, search_1, next_1, previous_1, ...args_5], void 0, function* (acceptLanguage, xChildCompanyId, limit, search, next, previous, options = {}) { const localVarPath = `/customers`; // 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, }; }), /** * You can update customer-related data * @summary Update customer * @param {string} id Identifier of the resource * @param {UpdateCustomer} updateCustomer requested field for customer * @param {UpdateCustomerAcceptLanguageEnum} [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} */ updateCustomer: (id_4, updateCustomer_1, acceptLanguage_6, xChildCompanyId_6, ...args_6) => __awaiter(this, [id_4, updateCustomer_1, acceptLanguage_6, xChildCompanyId_6, ...args_6], void 0, function* (id, updateCustomer, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'id' is not null or undefined assertParamExists('updateCustomer', 'id', id); // verify required parameter 'updateCustomer' is not null or undefined assertParamExists('updateCustomer', 'updateCustomer', updateCustomer); const localVarPath = `/customers/{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); } 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(updateCustomer, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Update Fiscal Entity resource that corresponds to a customer ID. * @summary Update Fiscal Entity * @param {string} id Identifier of the resource * @param {string} fiscalEntitiesId identifier * @param {CustomerUpdateFiscalEntitiesRequest} customerUpdateFiscalEntitiesRequest requested field for customer update fiscal entities * @param {UpdateCustomerFiscalEntitiesAcceptLanguageEnum} [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} */ updateCustomerFiscalEntities: (id_5, fiscalEntitiesId_1, customerUpdateFiscalEntitiesRequest_1, acceptLanguage_7, xChildCompanyId_7, ...args_7) => __awaiter(this, [id_5, fiscalEntitiesId_1, customerUpdateFiscalEntitiesRequest_1, acceptLanguage_7, xChildCompanyId_7, ...args_7], void 0, function* (id, fiscalEntitiesId, customerUpdateFiscalEntitiesRequest, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'id' is not null or undefined assertParamExists('updateCustomerFiscalEntities', 'id', id); // verify required parameter 'fiscalEntitiesId' is not null or undefined assertParamExists('updateCustomerFiscalEntities', 'fiscalEntitiesId', fiscalEntitiesId); // verify required parameter 'customerUpdateFiscalEntitiesRequest' is not null or undefined assertParamExists('updateCustomerFiscalEntities', 'customerUpdateFiscalEntitiesRequest', customerUpdateFiscalEntitiesRequest); const localVarPath = `/customers/{id}/fiscal_entities/{fiscal_entities_id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))) .replace(`{${"fiscal_entities_id"}}`, encodeURIComponent(String(fiscalEntitiesId))); // 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(customerUpdateFiscalEntitiesRequest, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; /** * CustomersApi - functional programming interface * @export */ export const CustomersApiFp = function (configuration) { const localVarAxiosParamCreator = CustomersApiAxiosParamCreator(configuration); return { /** * The purpose of business is to create and keep a customer, you will learn what elements you need to create a customer. * @summary Create customer * @param {Customer} customer requested field for customer * @param {CreateCustomerAcceptLanguageEnum} [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} */ createCustomer(customer, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.createCustomer(customer, 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['CustomersApi.createCustomer']) === 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 Fiscal entity resource that corresponds to a customer ID. * @summary Create Fiscal Entity * @param {string} id Identifier of the resource * @param {CustomerFiscalEntitiesRequest} customerFiscalEntitiesRequest requested field for customer fiscal entities * @param {CreateCustomerFiscalEntitiesAcceptLanguageEnum} [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} */ createCustomerFiscalEntities(id, customerFiscalEntitiesRequest, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.createCustomerFiscalEntities(id, customerFiscalEntitiesRequest, 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['CustomersApi.createCustomerFiscalEntities']) === 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); }); }, /** * Deleted a customer resource that corresponds to a customer ID. * @summary Delete Customer * @param {string} id Identifier of the resource * @param {DeleteCustomerByIdAcceptLanguageEnum} [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} */ deleteCustomerById(id, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteCustomerById(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['CustomersApi.deleteCustomerById']) === 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); }); }, /** * Gets a customer resource that corresponds to a customer ID. * @summary Get Customer * @param {string} id Identifier of the resource * @param {GetCustomerByIdAcceptLanguageEnum} [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} */ getCustomerById(id, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.getCustomerById(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['CustomersApi.getCustomerById']) === 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); }); }, /** * The purpose of business is to create and maintain a client, you will learn what elements you need to obtain a list of clients, which can be paged. * @summary Get a list of customers * @param {GetCustomersAcceptLanguageEnum} [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} */ getCustomers(acceptLanguage, xChildCompanyId, limit, search, next, previous, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.getCustomers(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['CustomersApi.getCustomers']) === 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); }); }, /** * You can update customer-related data * @summary Update customer * @param {string} id Identifier of the resource * @param {UpdateCustomer} updateCustomer requested field for customer * @param {UpdateCustomerAcceptLanguageEnum} [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} */ updateCustomer(id, updateCustomer, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.updateCustomer(id, updateCustomer, 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['CustomersApi.updateCustomer']) === 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 Fiscal Entity resource that corresponds to a customer ID. * @summary Update Fiscal Entity * @param {string} id Identifier of the resource * @param {string} fiscalEntitiesId identifier * @param {CustomerUpdateFiscalEntitiesRequest} customerUpdateFiscalEntitiesRequest requested field for customer update fiscal entities * @param {UpdateCustomerFiscalEntitiesAcceptLanguageEnum} [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} */ updateCustomerFiscalEntities(id, fiscalEntitiesId, customerUpdateFiscalEntitiesRequest, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.updateCustomerFiscalEntities(id, fiscalEntitiesId, customerUpdateFiscalEntitiesRequest, 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['CustomersApi.updateCustomerFiscalEntities']) === 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); }); }, }; }; /** * CustomersApi - factory interface * @export */ export const CustomersApiFactory = function (configuration, basePath, axios) { const localVarFp = CustomersApiFp(configuration); return { /** * The purpose of business is to create and keep a customer, you will learn what elements you need to create a customer. * @summary Create customer * @param {Customer} customer requested field for customer * @param {CreateCustomerAcceptLanguageEnum} [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} */ createCustomer(customer, acceptLanguage, xChildCompanyId, options) { return localVarFp.createCustomer(customer, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, /** * Create Fiscal entity resource that corresponds to a customer ID. * @summary Create Fiscal Entity * @param {string} id Identifier of the resource * @param {CustomerFiscalEntitiesRequest} customerFiscalEntitiesRequest requested field for customer fiscal entities * @param {CreateCustomerFiscalEntitiesAcceptLanguageEnum} [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} */ createCustomerFiscalEntities(id, customerFiscalEntitiesRequest, acceptLanguage, xChildCompanyId, options) { return localVarFp.createCustomerFiscalEntities(id, customerFiscalEntitiesRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, /** * Deleted a customer resource that corresponds to a customer ID. * @summary Delete Customer * @param {string} id Identifier of the resource * @param {DeleteCustomerByIdAcceptLanguageEnum} [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} */ deleteCustomerById(id, acceptLanguage, xChildCompanyId, options) { return localVarFp.deleteCustomerById(id, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, /** * Gets a customer resource that corresponds to a customer ID. * @summary Get Customer * @param {string} id Identifier of the resource * @param {GetCustomerByIdAcceptLanguageEnum} [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} */ getCustomerById(id, acceptLanguage, xChildCompanyId, options) { return localVarFp.getCustomerById(id, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, /** * The purpose of business is to create and maintain a client, you will learn what elements you need to obtain a list of clients, which can be paged. * @summary Get a list of customers * @param {GetCustomersAcceptLanguageEnum} [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} */ getCustomers(acceptLanguage, xChildCompanyId, limit, search, next, previous, options) { return localVarFp.getCustomers(acceptLanguage, xChildCompanyId, limit, search, next, previous, options).then((request) => request(axios, basePath)); }, /** * You can update customer-related data * @summary Update customer * @param {string} id Identifier of the resource * @param {UpdateCustomer} updateCustomer requested field for customer * @param {UpdateCustomerAcceptLanguageEnum} [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} */ updateCustomer(id, updateCustomer, acceptLanguage, xChildCompanyId, options) { return localVarFp.updateCustomer(id, updateCustomer, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, /** * Update Fiscal Entity resource that corresponds to a customer ID. * @summary Update Fiscal Entity * @param {string} id Identifier of the resource * @param {string} fiscalEntitiesId identifier * @param {CustomerUpdateFiscalEntitiesRequest} customerUpdateFiscalEntitiesRequest requested field for customer update fiscal entities * @param {UpdateCustomerFiscalEntitiesAcceptLanguageEnum} [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} */ updateCustomerFiscalEntities(id, fiscalEntitiesId, customerUpdateFiscalEntitiesRequest, acceptLanguage, xChildCompanyId, options) { return localVarFp.updateCustomerFiscalEntities(id, fiscalEntitiesId, customerUpdateFiscalEntitiesRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, }; }; /** * CustomersApi - object-oriented interface * @export * @class CustomersApi * @extends {BaseAPI} */ export class CustomersApi extends BaseAPI { /** * The purpose of business is to create and keep a customer, you will learn what elements you need to create a customer. * @summary Create customer * @param {Customer} customer requested field for customer * @param {CreateCustomerAcceptLanguageEnum} [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 CustomersApi */ createCustomer(customer, acceptLanguage, xChildCompanyId, options) { return CustomersApiFp(this.configuration).createCustomer(customer, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } /** * Create Fiscal entity resource that corresponds to a customer ID. * @summary Create Fiscal Entity * @param {string} id Identifier of the resource * @param {CustomerFiscalEntitiesRequest} customerFiscalEntitiesRequest requested field for customer fiscal entities * @param {CreateCustomerFiscalEntitiesAcceptLanguageEnum} [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 CustomersApi */ createCustomerFiscalEntities(id, customerFiscalEntitiesRequest, acceptLanguage, xChildCompanyId, options) { return CustomersApiFp(this.configuration).createCustomerFiscalEntities(id, customerFiscalEntitiesRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } /** * Deleted a customer resource that corresponds to a customer ID. * @summary Delete Customer * @param {string} id Identifier of the resource * @param {DeleteCustomerByIdAcceptLanguageEnum} [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 CustomersApi */ deleteCustomerById(id, acceptLanguage, xChildCompanyId, options) { return CustomersApiFp(this.configuration).deleteCustomerById(id, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } /** * Gets a customer resource that corresponds to a customer ID. * @summary Get Customer * @param {string} id Identifier of the resource * @param {GetCustomerByIdAcceptLanguageEnum} [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 CustomersApi */ getCustomerById(id, acceptLanguage, xChildCompanyId, options) { return CustomersApiFp(this.configuration).getCustomerById(id, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } /** * The purpose of business is to create and maintain a client, you will learn what elements you need to obtain a list of clients, which can be paged. * @summary Get a list of customers * @param {GetCustomersAcceptLanguageEnum} [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 CustomersApi */ getCustomers(acceptLanguage, xChildCompanyId, limit, search, next, previous, options) { return CustomersApiFp(this.configuration).getCustomers(acceptLanguage, xChildCompanyId, limit, search, next, previous, options).then((request) => request(this.axios, this.basePath)); } /** * You can update customer-related data * @summary Update customer * @param {string} id Identifier of the resource * @param {UpdateCustomer} updateCustomer requested field for customer * @param {UpdateCustomerAcceptLanguageEnum} [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 CustomersApi */ updateCustomer(id, updateCustomer, acceptLanguage, xChildCompanyId, options) { return CustomersApiFp(this.configuration).updateCustomer(id, updateCustomer, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } /** * Update Fiscal Entity resource that corresponds to a customer ID. * @summary Update Fiscal Entity * @param {string} id Identifier of the resource * @param {string} fiscalEntitiesId identifier * @param {CustomerUpdateFiscalEntitiesRequest} customerUpdateFiscalEntitiesRequest requested field for customer update fiscal entities * @param {UpdateCustomerFiscalEntitiesAcceptLanguageEnum} [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 CustomersApi */ updateCustomerFiscalEntities(id, fiscalEntitiesId, customerUpdateFiscalEntitiesRequest, acceptLanguage, xChildCompanyId, options) { return CustomersApiFp(this.configuration).updateCustomerFiscalEntities(id, fiscalEntitiesId, customerUpdateFiscalEntitiesRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } } /** * @export */ export const CreateCustomerAcceptLanguageEnum = { es: 'es', en: 'en' }; /** * @export */ export const CreateCustomerFiscalEntitiesAcceptLanguageEnum = { es: 'es', en: 'en' }; /** * @export */ export const DeleteCustomerByIdAcceptLanguageEnum = { es: 'es', en: 'en' }; /** * @export */ export const GetCustomerByIdAcceptLanguageEnum = { es: 'es', en: 'en' }; /** * @export */ export const GetCustomersAcceptLanguageEnum = { es: 'es', en: 'en' }; /** * @export */ export const UpdateCustomerAcceptLanguageEnum = { es: 'es', en: 'en' }; /** * @export */ export const UpdateCustomerFiscalEntitiesAcceptLanguageEnum = { es: 'es', en: 'en' };