digitalfemsa
Version:
OpenAPI client for digitalfemsa
753 lines (752 loc) • 48.9 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());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UpdateCustomerFiscalEntitiesAcceptLanguageEnum = exports.UpdateCustomerAcceptLanguageEnum = exports.GetCustomersAcceptLanguageEnum = exports.GetCustomerByIdAcceptLanguageEnum = exports.DeleteCustomerByIdAcceptLanguageEnum = exports.CreateCustomerFiscalEntitiesAcceptLanguageEnum = exports.CreateCustomerAcceptLanguageEnum = exports.CustomersApi = exports.CustomersApiFactory = exports.CustomersApiFp = exports.CustomersApiAxiosParamCreator = void 0;
const axios_1 = require("axios");
// Some imports not used depending on template conditions
// @ts-ignore
const common_1 = require("../common");
// @ts-ignore
const base_1 = require("../base");
/**
* CustomersApi - axios parameter creator
* @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
(0, common_1.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, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication bearerAuth required
// http bearer authentication required
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
if (xChildCompanyId != null) {
localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(customer, localVarRequestOptions, configuration);
return {
url: (0, common_1.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
(0, common_1.assertParamExists)('createCustomerFiscalEntities', 'id', id);
// verify required parameter 'customerFiscalEntitiesRequest' is not null or undefined
(0, common_1.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, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication bearerAuth required
// http bearer authentication required
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
if (xChildCompanyId != null) {
localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(customerFiscalEntitiesRequest, localVarRequestOptions, configuration);
return {
url: (0, common_1.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
(0, common_1.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, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication bearerAuth required
// http bearer authentication required
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
if (xChildCompanyId != null) {
localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* 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
(0, common_1.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, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication bearerAuth required
// http bearer authentication required
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
if (xChildCompanyId != null) {
localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* 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, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication bearerAuth required
// http bearer authentication required
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (search !== undefined) {
localVarQueryParameter['search'] = search;
}
if (next !== undefined) {
localVarQueryParameter['next'] = next;
}
if (previous !== undefined) {
localVarQueryParameter['previous'] = previous;
}
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
if (xChildCompanyId != null) {
localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* 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
(0, common_1.assertParamExists)('updateCustomer', 'id', id);
// verify required parameter 'updateCustomer' is not null or undefined
(0, common_1.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, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication bearerAuth required
// http bearer authentication required
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
if (xChildCompanyId != null) {
localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateCustomer, localVarRequestOptions, configuration);
return {
url: (0, common_1.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
(0, common_1.assertParamExists)('updateCustomerFiscalEntities', 'id', id);
// verify required parameter 'fiscalEntitiesId' is not null or undefined
(0, common_1.assertParamExists)('updateCustomerFiscalEntities', 'fiscalEntitiesId', fiscalEntitiesId);
// verify required parameter 'customerUpdateFiscalEntitiesRequest' is not null or undefined
(0, common_1.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, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication bearerAuth required
// http bearer authentication required
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
if (acceptLanguage != null) {
localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
}
if (xChildCompanyId != null) {
localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(customerUpdateFiscalEntitiesRequest, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
};
};
exports.CustomersApiAxiosParamCreator = CustomersApiAxiosParamCreator;
/**
* CustomersApi - functional programming interface
* @export
*/
const CustomersApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.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 = base_1.operationServerMap['CustomersApi.createCustomer']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
});
},
/**
* Create 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 = base_1.operationServerMap['CustomersApi.createCustomerFiscalEntities']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
});
},
/**
* 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 = base_1.operationServerMap['CustomersApi.deleteCustomerById']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
});
},
/**
* 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 = base_1.operationServerMap['CustomersApi.getCustomerById']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
});
},
/**
* 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 = base_1.operationServerMap['CustomersApi.getCustomers']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
});
},
/**
* 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 = base_1.operationServerMap['CustomersApi.updateCustomer']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
});
},
/**
* Update 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 = base_1.operationServerMap['CustomersApi.updateCustomerFiscalEntities']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath);
});
},
};
};
exports.CustomersApiFp = CustomersApiFp;
/**
* CustomersApi - factory interface
* @export
*/
const CustomersApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.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));
},
};
};
exports.CustomersApiFactory = CustomersApiFactory;
/**
* CustomersApi - object-oriented interface
* @export
* @class CustomersApi
* @extends {BaseAPI}
*/
class CustomersApi extends base_1.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 (0, exports.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 (0, exports.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 (0, exports.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 (0, exports.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 (0, exports.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 (0, exports.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 (0, exports.CustomersApiFp)(this.configuration).updateCustomerFiscalEntities(id, fiscalEntitiesId, customerUpdateFiscalEntitiesRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath));
}
}
exports.CustomersApi = CustomersApi;
/**
* @export
*/
exports.CreateCustomerAcceptLanguageEnum = {
es: 'es',
en: 'en'
};
/**
* @export
*/
exports.CreateCustomerFiscalEntitiesAcceptLanguageEnum = {
es: 'es',
en: 'en'
};
/**
* @export
*/
exports.DeleteCustomerByIdAcceptLanguageEnum = {
es: 'es',
en: 'en'
};
/**
* @export
*/
exports.GetCustomerByIdAcceptLanguageEnum = {
es: 'es',
en: 'en'
};
/**
* @export
*/
exports.GetCustomersAcceptLanguageEnum = {
es: 'es',
en: 'en'
};
/**
* @export
*/
exports.UpdateCustomerAcceptLanguageEnum = {
es: 'es',
en: 'en'
};
/**
* @export
*/
exports.UpdateCustomerFiscalEntitiesAcceptLanguageEnum = {
es: 'es',
en: 'en'
};