UNPKG

shipstation-client

Version:
772 lines 58.8 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * ShipStation API v2 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 2.0.0 * * * 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.GetInventoryLevelsGroupByEnum = exports.DeleteInventoryWarehouseRemoveInventoryEnum = exports.DeleteInventoryLocationByIdRemoveInventoryEnum = exports.InventoryApi = exports.InventoryApiFactory = exports.InventoryApiFp = exports.InventoryApiAxiosParamCreator = 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"); /** * InventoryApi - axios parameter creator * @export */ const InventoryApiAxiosParamCreator = function (configuration) { return { /** * * @summary Create a new inventory warehouse * @param {AddNewInventoryWarehouseRequest} addNewInventoryWarehouseRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ addNewInventoryWarehouse: (addNewInventoryWarehouseRequest_1, ...args_1) => __awaiter(this, [addNewInventoryWarehouseRequest_1, ...args_1], void 0, function* (addNewInventoryWarehouseRequest, options = {}) { // verify required parameter 'addNewInventoryWarehouseRequest' is not null or undefined (0, common_1.assertParamExists)('addNewInventoryWarehouse', 'addNewInventoryWarehouseRequest', addNewInventoryWarehouseRequest); const localVarPath = `/v2/inventory_warehouses`; // 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 api_keys required yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "api-key", configuration); 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)(addNewInventoryWarehouseRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Create a new inventory location * @param {CreateInventoryLocationRequest} createInventoryLocationRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createInventoryLocation: (createInventoryLocationRequest_1, ...args_1) => __awaiter(this, [createInventoryLocationRequest_1, ...args_1], void 0, function* (createInventoryLocationRequest, options = {}) { // verify required parameter 'createInventoryLocationRequest' is not null or undefined (0, common_1.assertParamExists)('createInventoryLocation', 'createInventoryLocationRequest', createInventoryLocationRequest); const localVarPath = `/v2/inventory_locations`; // 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 api_keys required yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "api-key", configuration); 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)(createInventoryLocationRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Delete an inventory location * @param {string} inventoryLocationId * @param {DeleteInventoryLocationByIdRemoveInventoryEnum} [removeInventory] If 1, remove all inventory from the location before deleting it. If 0 or missing and the location has On Hand inventory, the request will fail. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteInventoryLocationById: (inventoryLocationId_1, removeInventory_1, ...args_1) => __awaiter(this, [inventoryLocationId_1, removeInventory_1, ...args_1], void 0, function* (inventoryLocationId, removeInventory, options = {}) { // verify required parameter 'inventoryLocationId' is not null or undefined (0, common_1.assertParamExists)('deleteInventoryLocationById', 'inventoryLocationId', inventoryLocationId); const localVarPath = `/v2/inventory_locations/{inventory_location_id}` .replace(`{${"inventory_location_id"}}`, encodeURIComponent(String(inventoryLocationId))); // 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 api_keys required yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "api-key", configuration); if (removeInventory !== undefined) { localVarQueryParameter['remove_inventory'] = removeInventory; } (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, }; }), /** * * @summary Delete an inventory warehouse * @param {string} inventoryWarehouseId * @param {DeleteInventoryWarehouseRemoveInventoryEnum} [removeInventory] If 1, remove all inventory from the warehouse before deleting it. If 0 or missing and the warehouse has On Hand inventory, the request will fail. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteInventoryWarehouse: (inventoryWarehouseId_1, removeInventory_1, ...args_1) => __awaiter(this, [inventoryWarehouseId_1, removeInventory_1, ...args_1], void 0, function* (inventoryWarehouseId, removeInventory, options = {}) { // verify required parameter 'inventoryWarehouseId' is not null or undefined (0, common_1.assertParamExists)('deleteInventoryWarehouse', 'inventoryWarehouseId', inventoryWarehouseId); const localVarPath = `/v2/inventory_warehouses/{inventory_warehouse_id}` .replace(`{${"inventory_warehouse_id"}}`, encodeURIComponent(String(inventoryWarehouseId))); // 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 api_keys required yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "api-key", configuration); if (removeInventory !== undefined) { localVarQueryParameter['remove_inventory'] = removeInventory; } (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, }; }), /** * * @summary List SKU inventory levels * @param {string} [sku] Optional list of SKUs to filter down to * @param {string} [inventoryWarehouseId] * @param {string} [inventoryLocationId] * @param {GetInventoryLevelsGroupByEnum} [groupBy] Get counts for SKUs across locations or warehouses * @param {number} [limit] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInventoryLevels: (sku_1, inventoryWarehouseId_1, inventoryLocationId_1, groupBy_1, limit_1, ...args_1) => __awaiter(this, [sku_1, inventoryWarehouseId_1, inventoryLocationId_1, groupBy_1, limit_1, ...args_1], void 0, function* (sku, inventoryWarehouseId, inventoryLocationId, groupBy, limit, options = {}) { const localVarPath = `/v2/inventory`; // 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 api_keys required yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "api-key", configuration); if (sku !== undefined) { localVarQueryParameter['sku'] = sku; } if (inventoryWarehouseId !== undefined) { localVarQueryParameter['inventory_warehouse_id'] = inventoryWarehouseId; } if (inventoryLocationId !== undefined) { localVarQueryParameter['inventory_location_id'] = inventoryLocationId; } if (groupBy !== undefined) { localVarQueryParameter['group_by'] = groupBy; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } (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, }; }), /** * * @summary Get inventory location by ID * @param {string} inventoryLocationId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInventoryLocationById: (inventoryLocationId_1, ...args_1) => __awaiter(this, [inventoryLocationId_1, ...args_1], void 0, function* (inventoryLocationId, options = {}) { // verify required parameter 'inventoryLocationId' is not null or undefined (0, common_1.assertParamExists)('getInventoryLocationById', 'inventoryLocationId', inventoryLocationId); const localVarPath = `/v2/inventory_locations/{inventory_location_id}` .replace(`{${"inventory_location_id"}}`, encodeURIComponent(String(inventoryLocationId))); // 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 api_keys required yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "api-key", configuration); (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, }; }), /** * * @summary Get a specific inventory warehouse and related properties using its warehouse ID * @param {string} inventoryWarehouseId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInventoryWarehouseById: (inventoryWarehouseId_1, ...args_1) => __awaiter(this, [inventoryWarehouseId_1, ...args_1], void 0, function* (inventoryWarehouseId, options = {}) { // verify required parameter 'inventoryWarehouseId' is not null or undefined (0, common_1.assertParamExists)('getInventoryWarehouseById', 'inventoryWarehouseId', inventoryWarehouseId); const localVarPath = `/v2/inventory_warehouses/{inventory_warehouse_id}` .replace(`{${"inventory_warehouse_id"}}`, encodeURIComponent(String(inventoryWarehouseId))); // 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 api_keys required yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "api-key", configuration); (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, }; }), /** * * @summary List all inventory warehouses * @param {number} [limit] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInventoryWarehouses: (limit_1, ...args_1) => __awaiter(this, [limit_1, ...args_1], void 0, function* (limit, options = {}) { const localVarPath = `/v2/inventory_warehouses`; // 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 api_keys required yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "api-key", configuration); if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } (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, }; }), /** * * @summary List all inventory locations * @param {number} [limit] * @param {*} [options] Override http request option. * @throws {RequiredError} */ listInventoryLocations: (limit_1, ...args_1) => __awaiter(this, [limit_1, ...args_1], void 0, function* (limit, options = {}) { const localVarPath = `/v2/inventory_locations`; // 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 api_keys required yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "api-key", configuration); if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } (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, }; }), /** * * @summary Update an inventory location name * @param {string} inventoryLocationId * @param {UpdateInventoryWarehouseRequest} updateInventoryWarehouseRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateInventoryLocation: (inventoryLocationId_1, updateInventoryWarehouseRequest_1, ...args_1) => __awaiter(this, [inventoryLocationId_1, updateInventoryWarehouseRequest_1, ...args_1], void 0, function* (inventoryLocationId, updateInventoryWarehouseRequest, options = {}) { // verify required parameter 'inventoryLocationId' is not null or undefined (0, common_1.assertParamExists)('updateInventoryLocation', 'inventoryLocationId', inventoryLocationId); // verify required parameter 'updateInventoryWarehouseRequest' is not null or undefined (0, common_1.assertParamExists)('updateInventoryLocation', 'updateInventoryWarehouseRequest', updateInventoryWarehouseRequest); const localVarPath = `/v2/inventory_locations/{inventory_location_id}` .replace(`{${"inventory_location_id"}}`, encodeURIComponent(String(inventoryLocationId))); // 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 api_keys required yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "api-key", configuration); 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)(updateInventoryWarehouseRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Update an inventory warehouse name * @param {string} inventoryWarehouseId * @param {UpdateInventoryWarehouseRequest} updateInventoryWarehouseRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateInventoryWarehouse: (inventoryWarehouseId_1, updateInventoryWarehouseRequest_1, ...args_1) => __awaiter(this, [inventoryWarehouseId_1, updateInventoryWarehouseRequest_1, ...args_1], void 0, function* (inventoryWarehouseId, updateInventoryWarehouseRequest, options = {}) { // verify required parameter 'inventoryWarehouseId' is not null or undefined (0, common_1.assertParamExists)('updateInventoryWarehouse', 'inventoryWarehouseId', inventoryWarehouseId); // verify required parameter 'updateInventoryWarehouseRequest' is not null or undefined (0, common_1.assertParamExists)('updateInventoryWarehouse', 'updateInventoryWarehouseRequest', updateInventoryWarehouseRequest); const localVarPath = `/v2/inventory_warehouses/{inventory_warehouse_id}` .replace(`{${"inventory_warehouse_id"}}`, encodeURIComponent(String(inventoryWarehouseId))); // 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 api_keys required yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "api-key", configuration); 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)(updateInventoryWarehouseRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Update SKU stock levels and related properties * @param {UpdateSKUStockLevelsRequest} updateSKUStockLevelsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateSKUStockLevels: (updateSKUStockLevelsRequest_1, ...args_1) => __awaiter(this, [updateSKUStockLevelsRequest_1, ...args_1], void 0, function* (updateSKUStockLevelsRequest, options = {}) { // verify required parameter 'updateSKUStockLevelsRequest' is not null or undefined (0, common_1.assertParamExists)('updateSKUStockLevels', 'updateSKUStockLevelsRequest', updateSKUStockLevelsRequest); const localVarPath = `/v2/inventory`; // 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 api_keys required yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "api-key", configuration); 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)(updateSKUStockLevelsRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; exports.InventoryApiAxiosParamCreator = InventoryApiAxiosParamCreator; /** * InventoryApi - functional programming interface * @export */ const InventoryApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.InventoryApiAxiosParamCreator)(configuration); return { /** * * @summary Create a new inventory warehouse * @param {AddNewInventoryWarehouseRequest} addNewInventoryWarehouseRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ addNewInventoryWarehouse(addNewInventoryWarehouseRequest, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.addNewInventoryWarehouse(addNewInventoryWarehouseRequest, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['InventoryApi.addNewInventoryWarehouse']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === 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, localVarOperationServerBasePath || basePath); }); }, /** * * @summary Create a new inventory location * @param {CreateInventoryLocationRequest} createInventoryLocationRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createInventoryLocation(createInventoryLocationRequest, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.createInventoryLocation(createInventoryLocationRequest, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['InventoryApi.createInventoryLocation']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === 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, localVarOperationServerBasePath || basePath); }); }, /** * * @summary Delete an inventory location * @param {string} inventoryLocationId * @param {DeleteInventoryLocationByIdRemoveInventoryEnum} [removeInventory] If 1, remove all inventory from the location before deleting it. If 0 or missing and the location has On Hand inventory, the request will fail. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteInventoryLocationById(inventoryLocationId, removeInventory, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteInventoryLocationById(inventoryLocationId, removeInventory, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['InventoryApi.deleteInventoryLocationById']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === 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, localVarOperationServerBasePath || basePath); }); }, /** * * @summary Delete an inventory warehouse * @param {string} inventoryWarehouseId * @param {DeleteInventoryWarehouseRemoveInventoryEnum} [removeInventory] If 1, remove all inventory from the warehouse before deleting it. If 0 or missing and the warehouse has On Hand inventory, the request will fail. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteInventoryWarehouse(inventoryWarehouseId, removeInventory, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteInventoryWarehouse(inventoryWarehouseId, removeInventory, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['InventoryApi.deleteInventoryWarehouse']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === 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, localVarOperationServerBasePath || basePath); }); }, /** * * @summary List SKU inventory levels * @param {string} [sku] Optional list of SKUs to filter down to * @param {string} [inventoryWarehouseId] * @param {string} [inventoryLocationId] * @param {GetInventoryLevelsGroupByEnum} [groupBy] Get counts for SKUs across locations or warehouses * @param {number} [limit] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInventoryLevels(sku, inventoryWarehouseId, inventoryLocationId, groupBy, limit, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.getInventoryLevels(sku, inventoryWarehouseId, inventoryLocationId, groupBy, limit, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['InventoryApi.getInventoryLevels']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === 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, localVarOperationServerBasePath || basePath); }); }, /** * * @summary Get inventory location by ID * @param {string} inventoryLocationId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInventoryLocationById(inventoryLocationId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.getInventoryLocationById(inventoryLocationId, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['InventoryApi.getInventoryLocationById']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === 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, localVarOperationServerBasePath || basePath); }); }, /** * * @summary Get a specific inventory warehouse and related properties using its warehouse ID * @param {string} inventoryWarehouseId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInventoryWarehouseById(inventoryWarehouseId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.getInventoryWarehouseById(inventoryWarehouseId, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['InventoryApi.getInventoryWarehouseById']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === 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, localVarOperationServerBasePath || basePath); }); }, /** * * @summary List all inventory warehouses * @param {number} [limit] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInventoryWarehouses(limit, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.getInventoryWarehouses(limit, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['InventoryApi.getInventoryWarehouses']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === 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, localVarOperationServerBasePath || basePath); }); }, /** * * @summary List all inventory locations * @param {number} [limit] * @param {*} [options] Override http request option. * @throws {RequiredError} */ listInventoryLocations(limit, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.listInventoryLocations(limit, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['InventoryApi.listInventoryLocations']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === 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, localVarOperationServerBasePath || basePath); }); }, /** * * @summary Update an inventory location name * @param {string} inventoryLocationId * @param {UpdateInventoryWarehouseRequest} updateInventoryWarehouseRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateInventoryLocation(inventoryLocationId, updateInventoryWarehouseRequest, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.updateInventoryLocation(inventoryLocationId, updateInventoryWarehouseRequest, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['InventoryApi.updateInventoryLocation']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === 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, localVarOperationServerBasePath || basePath); }); }, /** * * @summary Update an inventory warehouse name * @param {string} inventoryWarehouseId * @param {UpdateInventoryWarehouseRequest} updateInventoryWarehouseRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateInventoryWarehouse(inventoryWarehouseId, updateInventoryWarehouseRequest, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.updateInventoryWarehouse(inventoryWarehouseId, updateInventoryWarehouseRequest, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['InventoryApi.updateInventoryWarehouse']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === 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, localVarOperationServerBasePath || basePath); }); }, /** * * @summary Update SKU stock levels and related properties * @param {UpdateSKUStockLevelsRequest} updateSKUStockLevelsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateSKUStockLevels(updateSKUStockLevelsRequest, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.updateSKUStockLevels(updateSKUStockLevelsRequest, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['InventoryApi.updateSKUStockLevels']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === 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, localVarOperationServerBasePath || basePath); }); }, }; }; exports.InventoryApiFp = InventoryApiFp; /** * InventoryApi - factory interface * @export */ const InventoryApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.InventoryApiFp)(configuration); return { /** * * @summary Create a new inventory warehouse * @param {AddNewInventoryWarehouseRequest} addNewInventoryWarehouseRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ addNewInventoryWarehouse(addNewInventoryWarehouseRequest, options) { return localVarFp.addNewInventoryWarehouse(addNewInventoryWarehouseRequest, options).then((request) => request(axios, basePath)); }, /** * * @summary Create a new inventory location * @param {CreateInventoryLocationRequest} createInventoryLocationRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createInventoryLocation(createInventoryLocationRequest, options) { return localVarFp.createInventoryLocation(createInventoryLocationRequest, options).then((request) => request(axios, basePath)); }, /** * * @summary Delete an inventory location * @param {string} inventoryLocationId * @param {DeleteInventoryLocationByIdRemoveInventoryEnum} [removeInventory] If 1, remove all inventory from the location before deleting it. If 0 or missing and the location has On Hand inventory, the request will fail. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteInventoryLocationById(inventoryLocationId, removeInventory, options) { return localVarFp.deleteInventoryLocationById(inventoryLocationId, removeInventory, options).then((request) => request(axios, basePath)); }, /** * * @summary Delete an inventory warehouse * @param {string} inventoryWarehouseId * @param {DeleteInventoryWarehouseRemoveInventoryEnum} [removeInventory] If 1, remove all inventory from the warehouse before deleting it. If 0 or missing and the warehouse has On Hand inventory, the request will fail. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteInventoryWarehouse(inventoryWarehouseId, removeInventory, options) { return localVarFp.deleteInventoryWarehouse(inventoryWarehouseId, removeInventory, options).then((request) => request(axios, basePath)); }, /** * * @summary List SKU inventory levels * @param {string} [sku] Optional list of SKUs to filter down to * @param {string} [inventoryWarehouseId] * @param {string} [inventoryLocationId] * @param {GetInventoryLevelsGroupByEnum} [groupBy] Get counts for SKUs across locations or warehouses * @param {number} [limit] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInventoryLevels(sku, inventoryWarehouseId, inventoryLocationId, groupBy, limit, options) { return localVarFp.getInventoryLevels(sku, inventoryWarehouseId, inventoryLocationId, groupBy, limit, options).then((request) => request(axios, basePath)); }, /** * * @summary Get inventory location by ID * @param {string} inventoryLocationId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInventoryLocationById(inventoryLocationId, options) { return localVarFp.getInventoryLocationById(inventoryLocationId, options).then((request) => request(axios, basePath)); }, /** * * @summary Get a specific inventory warehouse and related properties using its warehouse ID * @param {string} inventoryWarehouseId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInventoryWarehouseById(inventoryWarehouseId, options) { return localVarFp.getInventoryWarehouseById(inventoryWarehouseId, options).then((request) => request(axios, basePath)); }, /** * * @summary List all inventory warehouses * @param {number} [limit] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInventoryWarehouses(limit, options) { return localVarFp.getInventoryWarehouses(limit, options).then((request) => request(axios, basePath)); }, /** * * @summary List all inventory locations * @param {number} [limit] * @param {*} [options] Override http request option. * @throws {RequiredError} */ listInventoryLocations(limit, options) { return localVarFp.listInventoryLocations(limit, options).then((request) => request(axios, basePath)); }, /** * * @summary Update an inventory location name * @param {string} inventoryLocationId * @param {UpdateInventoryWarehouseRequest} updateInventoryWarehouseRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateInventoryLocation(inventoryLocationId, updateInventoryWarehouseRequest, options) { return localVa