UNPKG

digitalfemsa

Version:
370 lines (369 loc) 24.3 kB
"use strict"; /* 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.UpdateCustomerShippingContactsAcceptLanguageEnum = exports.DeleteCustomerShippingContactsAcceptLanguageEnum = exports.CreateCustomerShippingContactsAcceptLanguageEnum = exports.ShippingContactsApi = exports.ShippingContactsApiFactory = exports.ShippingContactsApiFp = exports.ShippingContactsApiAxiosParamCreator = 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"); /** * ShippingContactsApi - axios parameter creator * @export */ const ShippingContactsApiAxiosParamCreator = function (configuration) { return { /** * Create a shipping contacts for a customer. * @summary Create a shipping contacts * @param {string} id Identifier of the resource * @param {CustomerShippingContacts} customerShippingContacts requested field for customer shippings contacts * @param {CreateCustomerShippingContactsAcceptLanguageEnum} [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} */ createCustomerShippingContacts: (id_1, customerShippingContacts_1, acceptLanguage_1, xChildCompanyId_1, ...args_1) => __awaiter(this, [id_1, customerShippingContacts_1, acceptLanguage_1, xChildCompanyId_1, ...args_1], void 0, function* (id, customerShippingContacts, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('createCustomerShippingContacts', 'id', id); // verify required parameter 'customerShippingContacts' is not null or undefined (0, common_1.assertParamExists)('createCustomerShippingContacts', 'customerShippingContacts', customerShippingContacts); const localVarPath = `/customers/{id}/shipping_contacts` .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)(customerShippingContacts, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Delete shipping contact that corresponds to a customer ID. * @summary Delete shipping contacts * @param {string} id Identifier of the resource * @param {string} shippingContactsId identifier * @param {DeleteCustomerShippingContactsAcceptLanguageEnum} [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} */ deleteCustomerShippingContacts: (id_2, shippingContactsId_1, acceptLanguage_2, xChildCompanyId_2, ...args_2) => __awaiter(this, [id_2, shippingContactsId_1, acceptLanguage_2, xChildCompanyId_2, ...args_2], void 0, function* (id, shippingContactsId, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('deleteCustomerShippingContacts', 'id', id); // verify required parameter 'shippingContactsId' is not null or undefined (0, common_1.assertParamExists)('deleteCustomerShippingContacts', 'shippingContactsId', shippingContactsId); const localVarPath = `/customers/{id}/shipping_contacts/{shipping_contacts_id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))) .replace(`{${"shipping_contacts_id"}}`, encodeURIComponent(String(shippingContactsId))); // 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, }; }), /** * Update shipping contact that corresponds to a customer ID. * @summary Update shipping contacts * @param {string} id Identifier of the resource * @param {string} shippingContactsId identifier * @param {CustomerUpdateShippingContacts} customerUpdateShippingContacts requested field for customer update shippings contacts * @param {UpdateCustomerShippingContactsAcceptLanguageEnum} [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} */ updateCustomerShippingContacts: (id_3, shippingContactsId_2, customerUpdateShippingContacts_1, acceptLanguage_3, xChildCompanyId_3, ...args_3) => __awaiter(this, [id_3, shippingContactsId_2, customerUpdateShippingContacts_1, acceptLanguage_3, xChildCompanyId_3, ...args_3], void 0, function* (id, shippingContactsId, customerUpdateShippingContacts, acceptLanguage, xChildCompanyId, options = {}) { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('updateCustomerShippingContacts', 'id', id); // verify required parameter 'shippingContactsId' is not null or undefined (0, common_1.assertParamExists)('updateCustomerShippingContacts', 'shippingContactsId', shippingContactsId); // verify required parameter 'customerUpdateShippingContacts' is not null or undefined (0, common_1.assertParamExists)('updateCustomerShippingContacts', 'customerUpdateShippingContacts', customerUpdateShippingContacts); const localVarPath = `/customers/{id}/shipping_contacts/{shipping_contacts_id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))) .replace(`{${"shipping_contacts_id"}}`, encodeURIComponent(String(shippingContactsId))); // 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)(customerUpdateShippingContacts, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; exports.ShippingContactsApiAxiosParamCreator = ShippingContactsApiAxiosParamCreator; /** * ShippingContactsApi - functional programming interface * @export */ const ShippingContactsApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.ShippingContactsApiAxiosParamCreator)(configuration); return { /** * Create a shipping contacts for a customer. * @summary Create a shipping contacts * @param {string} id Identifier of the resource * @param {CustomerShippingContacts} customerShippingContacts requested field for customer shippings contacts * @param {CreateCustomerShippingContactsAcceptLanguageEnum} [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} */ createCustomerShippingContacts(id, customerShippingContacts, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.createCustomerShippingContacts(id, customerShippingContacts, 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['ShippingContactsApi.createCustomerShippingContacts']) === 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); }); }, /** * Delete shipping contact that corresponds to a customer ID. * @summary Delete shipping contacts * @param {string} id Identifier of the resource * @param {string} shippingContactsId identifier * @param {DeleteCustomerShippingContactsAcceptLanguageEnum} [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} */ deleteCustomerShippingContacts(id, shippingContactsId, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteCustomerShippingContacts(id, shippingContactsId, 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['ShippingContactsApi.deleteCustomerShippingContacts']) === 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 shipping contact that corresponds to a customer ID. * @summary Update shipping contacts * @param {string} id Identifier of the resource * @param {string} shippingContactsId identifier * @param {CustomerUpdateShippingContacts} customerUpdateShippingContacts requested field for customer update shippings contacts * @param {UpdateCustomerShippingContactsAcceptLanguageEnum} [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} */ updateCustomerShippingContacts(id, shippingContactsId, customerUpdateShippingContacts, acceptLanguage, xChildCompanyId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.updateCustomerShippingContacts(id, shippingContactsId, customerUpdateShippingContacts, 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['ShippingContactsApi.updateCustomerShippingContacts']) === 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.ShippingContactsApiFp = ShippingContactsApiFp; /** * ShippingContactsApi - factory interface * @export */ const ShippingContactsApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.ShippingContactsApiFp)(configuration); return { /** * Create a shipping contacts for a customer. * @summary Create a shipping contacts * @param {string} id Identifier of the resource * @param {CustomerShippingContacts} customerShippingContacts requested field for customer shippings contacts * @param {CreateCustomerShippingContactsAcceptLanguageEnum} [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} */ createCustomerShippingContacts(id, customerShippingContacts, acceptLanguage, xChildCompanyId, options) { return localVarFp.createCustomerShippingContacts(id, customerShippingContacts, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, /** * Delete shipping contact that corresponds to a customer ID. * @summary Delete shipping contacts * @param {string} id Identifier of the resource * @param {string} shippingContactsId identifier * @param {DeleteCustomerShippingContactsAcceptLanguageEnum} [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} */ deleteCustomerShippingContacts(id, shippingContactsId, acceptLanguage, xChildCompanyId, options) { return localVarFp.deleteCustomerShippingContacts(id, shippingContactsId, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, /** * Update shipping contact that corresponds to a customer ID. * @summary Update shipping contacts * @param {string} id Identifier of the resource * @param {string} shippingContactsId identifier * @param {CustomerUpdateShippingContacts} customerUpdateShippingContacts requested field for customer update shippings contacts * @param {UpdateCustomerShippingContactsAcceptLanguageEnum} [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} */ updateCustomerShippingContacts(id, shippingContactsId, customerUpdateShippingContacts, acceptLanguage, xChildCompanyId, options) { return localVarFp.updateCustomerShippingContacts(id, shippingContactsId, customerUpdateShippingContacts, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath)); }, }; }; exports.ShippingContactsApiFactory = ShippingContactsApiFactory; /** * ShippingContactsApi - object-oriented interface * @export * @class ShippingContactsApi * @extends {BaseAPI} */ class ShippingContactsApi extends base_1.BaseAPI { /** * Create a shipping contacts for a customer. * @summary Create a shipping contacts * @param {string} id Identifier of the resource * @param {CustomerShippingContacts} customerShippingContacts requested field for customer shippings contacts * @param {CreateCustomerShippingContactsAcceptLanguageEnum} [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 ShippingContactsApi */ createCustomerShippingContacts(id, customerShippingContacts, acceptLanguage, xChildCompanyId, options) { return (0, exports.ShippingContactsApiFp)(this.configuration).createCustomerShippingContacts(id, customerShippingContacts, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } /** * Delete shipping contact that corresponds to a customer ID. * @summary Delete shipping contacts * @param {string} id Identifier of the resource * @param {string} shippingContactsId identifier * @param {DeleteCustomerShippingContactsAcceptLanguageEnum} [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 ShippingContactsApi */ deleteCustomerShippingContacts(id, shippingContactsId, acceptLanguage, xChildCompanyId, options) { return (0, exports.ShippingContactsApiFp)(this.configuration).deleteCustomerShippingContacts(id, shippingContactsId, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } /** * Update shipping contact that corresponds to a customer ID. * @summary Update shipping contacts * @param {string} id Identifier of the resource * @param {string} shippingContactsId identifier * @param {CustomerUpdateShippingContacts} customerUpdateShippingContacts requested field for customer update shippings contacts * @param {UpdateCustomerShippingContactsAcceptLanguageEnum} [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 ShippingContactsApi */ updateCustomerShippingContacts(id, shippingContactsId, customerUpdateShippingContacts, acceptLanguage, xChildCompanyId, options) { return (0, exports.ShippingContactsApiFp)(this.configuration).updateCustomerShippingContacts(id, shippingContactsId, customerUpdateShippingContacts, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath)); } } exports.ShippingContactsApi = ShippingContactsApi; /** * @export */ exports.CreateCustomerShippingContactsAcceptLanguageEnum = { es: 'es', en: 'en' }; /** * @export */ exports.DeleteCustomerShippingContactsAcceptLanguageEnum = { es: 'es', en: 'en' }; /** * @export */ exports.UpdateCustomerShippingContactsAcceptLanguageEnum = { es: 'es', en: 'en' };