UNPKG

shipstation-client

Version:
893 lines (800 loc) 57 kB
/* 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. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import type { AddNewInventoryWarehouseRequest } from '../models'; // @ts-ignore import type { CreateInventoryLocationRequest } from '../models'; // @ts-ignore import type { GetInventoryLevels200Response } from '../models'; // @ts-ignore import type { GetInventoryWarehouses200Response } from '../models'; // @ts-ignore import type { GetInventoryWarehouses200ResponseInventoryWarehousesInner } from '../models'; // @ts-ignore import type { ListInventoryLocations200Response } from '../models'; // @ts-ignore import type { ListInventoryLocations200ResponseInventoryLocationsInner } from '../models'; // @ts-ignore import type { UpdateInventoryWarehouseRequest } from '../models'; // @ts-ignore import type { UpdateSKUStockLevelsRequest } from '../models'; /** * InventoryApi - axios parameter creator * @export */ export const InventoryApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * * @summary Create a new inventory warehouse * @param {AddNewInventoryWarehouseRequest} addNewInventoryWarehouseRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ addNewInventoryWarehouse: async (addNewInventoryWarehouseRequest: AddNewInventoryWarehouseRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { // verify required parameter 'addNewInventoryWarehouseRequest' is not null or undefined 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, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication api_keys required await setApiKeyToObject(localVarHeaderParameter, "api-key", configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(addNewInventoryWarehouseRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Create a new inventory location * @param {CreateInventoryLocationRequest} createInventoryLocationRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createInventoryLocation: async (createInventoryLocationRequest: CreateInventoryLocationRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { // verify required parameter 'createInventoryLocationRequest' is not null or undefined 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, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication api_keys required await setApiKeyToObject(localVarHeaderParameter, "api-key", configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(createInventoryLocationRequest, localVarRequestOptions, configuration) return { url: 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: async (inventoryLocationId: string, removeInventory?: DeleteInventoryLocationByIdRemoveInventoryEnum, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { // verify required parameter 'inventoryLocationId' is not null or undefined 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, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication api_keys required await setApiKeyToObject(localVarHeaderParameter, "api-key", configuration) if (removeInventory !== undefined) { localVarQueryParameter['remove_inventory'] = removeInventory; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: 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: async (inventoryWarehouseId: string, removeInventory?: DeleteInventoryWarehouseRemoveInventoryEnum, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { // verify required parameter 'inventoryWarehouseId' is not null or undefined 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, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication api_keys required await setApiKeyToObject(localVarHeaderParameter, "api-key", configuration) if (removeInventory !== undefined) { localVarQueryParameter['remove_inventory'] = removeInventory; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: 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: async (sku?: string, inventoryWarehouseId?: string, inventoryLocationId?: string, groupBy?: GetInventoryLevelsGroupByEnum, limit?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { const localVarPath = `/v2/inventory`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication api_keys required await 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; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get inventory location by ID * @param {string} inventoryLocationId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInventoryLocationById: async (inventoryLocationId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { // verify required parameter 'inventoryLocationId' is not null or undefined 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, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication api_keys required await setApiKeyToObject(localVarHeaderParameter, "api-key", configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: 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: async (inventoryWarehouseId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { // verify required parameter 'inventoryWarehouseId' is not null or undefined 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, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication api_keys required await setApiKeyToObject(localVarHeaderParameter, "api-key", configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary List all inventory warehouses * @param {number} [limit] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInventoryWarehouses: async (limit?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { const localVarPath = `/v2/inventory_warehouses`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication api_keys required await setApiKeyToObject(localVarHeaderParameter, "api-key", configuration) if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary List all inventory locations * @param {number} [limit] * @param {*} [options] Override http request option. * @throws {RequiredError} */ listInventoryLocations: async (limit?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { const localVarPath = `/v2/inventory_locations`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication api_keys required await setApiKeyToObject(localVarHeaderParameter, "api-key", configuration) if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: 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: async (inventoryLocationId: string, updateInventoryWarehouseRequest: UpdateInventoryWarehouseRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { // verify required parameter 'inventoryLocationId' is not null or undefined assertParamExists('updateInventoryLocation', 'inventoryLocationId', inventoryLocationId) // verify required parameter 'updateInventoryWarehouseRequest' is not null or undefined 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, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication api_keys required await setApiKeyToObject(localVarHeaderParameter, "api-key", configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(updateInventoryWarehouseRequest, localVarRequestOptions, configuration) return { url: 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: async (inventoryWarehouseId: string, updateInventoryWarehouseRequest: UpdateInventoryWarehouseRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { // verify required parameter 'inventoryWarehouseId' is not null or undefined assertParamExists('updateInventoryWarehouse', 'inventoryWarehouseId', inventoryWarehouseId) // verify required parameter 'updateInventoryWarehouseRequest' is not null or undefined 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, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication api_keys required await setApiKeyToObject(localVarHeaderParameter, "api-key", configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(updateInventoryWarehouseRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Update SKU stock levels and related properties * @param {UpdateSKUStockLevelsRequest} updateSKUStockLevelsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateSKUStockLevels: async (updateSKUStockLevelsRequest: UpdateSKUStockLevelsRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { // verify required parameter 'updateSKUStockLevelsRequest' is not null or undefined 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, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication api_keys required await setApiKeyToObject(localVarHeaderParameter, "api-key", configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(updateSKUStockLevelsRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * InventoryApi - functional programming interface * @export */ export const InventoryApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = InventoryApiAxiosParamCreator(configuration) return { /** * * @summary Create a new inventory warehouse * @param {AddNewInventoryWarehouseRequest} addNewInventoryWarehouseRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async addNewInventoryWarehouse(addNewInventoryWarehouseRequest: AddNewInventoryWarehouseRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetInventoryWarehouses200ResponseInventoryWarehousesInner>> { const localVarAxiosArgs = await localVarAxiosParamCreator.addNewInventoryWarehouse(addNewInventoryWarehouseRequest, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['InventoryApi.addNewInventoryWarehouse']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Create a new inventory location * @param {CreateInventoryLocationRequest} createInventoryLocationRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createInventoryLocation(createInventoryLocationRequest: CreateInventoryLocationRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListInventoryLocations200ResponseInventoryLocationsInner>> { const localVarAxiosArgs = await localVarAxiosParamCreator.createInventoryLocation(createInventoryLocationRequest, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['InventoryApi.createInventoryLocation']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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} */ async deleteInventoryLocationById(inventoryLocationId: string, removeInventory?: DeleteInventoryLocationByIdRemoveInventoryEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteInventoryLocationById(inventoryLocationId, removeInventory, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['InventoryApi.deleteInventoryLocationById']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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} */ async deleteInventoryWarehouse(inventoryWarehouseId: string, removeInventory?: DeleteInventoryWarehouseRemoveInventoryEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteInventoryWarehouse(inventoryWarehouseId, removeInventory, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['InventoryApi.deleteInventoryWarehouse']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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} */ async getInventoryLevels(sku?: string, inventoryWarehouseId?: string, inventoryLocationId?: string, groupBy?: GetInventoryLevelsGroupByEnum, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetInventoryLevels200Response>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getInventoryLevels(sku, inventoryWarehouseId, inventoryLocationId, groupBy, limit, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['InventoryApi.getInventoryLevels']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get inventory location by ID * @param {string} inventoryLocationId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getInventoryLocationById(inventoryLocationId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListInventoryLocations200ResponseInventoryLocationsInner>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getInventoryLocationById(inventoryLocationId, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['InventoryApi.getInventoryLocationById']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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} */ async getInventoryWarehouseById(inventoryWarehouseId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetInventoryWarehouses200ResponseInventoryWarehousesInner>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getInventoryWarehouseById(inventoryWarehouseId, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['InventoryApi.getInventoryWarehouseById']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary List all inventory warehouses * @param {number} [limit] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getInventoryWarehouses(limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetInventoryWarehouses200Response>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getInventoryWarehouses(limit, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['InventoryApi.getInventoryWarehouses']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary List all inventory locations * @param {number} [limit] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listInventoryLocations(limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListInventoryLocations200Response>> { const localVarAxiosArgs = await localVarAxiosParamCreator.listInventoryLocations(limit, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['InventoryApi.listInventoryLocations']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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} */ async updateInventoryLocation(inventoryLocationId: string, updateInventoryWarehouseRequest: UpdateInventoryWarehouseRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateInventoryLocation(inventoryLocationId, updateInventoryWarehouseRequest, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['InventoryApi.updateInventoryLocation']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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} */ async updateInventoryWarehouse(inventoryWarehouseId: string, updateInventoryWarehouseRequest: UpdateInventoryWarehouseRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateInventoryWarehouse(inventoryWarehouseId, updateInventoryWarehouseRequest, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['InventoryApi.updateInventoryWarehouse']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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} */ async updateSKUStockLevels(updateSKUStockLevelsRequest: UpdateSKUStockLevelsRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateSKUStockLevels(updateSKUStockLevelsRequest, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['InventoryApi.updateSKUStockLevels']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * InventoryApi - factory interface * @export */ export const InventoryApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = InventoryApiFp(configuration) return { /** * * @summary Create a new inventory warehouse * @param {AddNewInventoryWarehouseRequest} addNewInventoryWarehouseRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ addNewInventoryWarehouse(addNewInventoryWarehouseRequest: AddNewInventoryWarehouseRequest, options?: RawAxiosRequestConfig): AxiosPromise<GetInventoryWarehouses200ResponseInventoryWarehousesInner> { 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: CreateInventoryLocationRequest, options?: RawAxiosRequestConfig): AxiosPromise<ListInventoryLocations200ResponseInventoryLocationsInner> { 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: string, removeInventory?: DeleteInventoryLocationByIdRemoveInventoryEnum, options?: RawAxiosRequestConfig): AxiosPromise<void> { 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: string, removeInventory?: DeleteInventoryWarehouseRemoveInventoryEnum, options?: RawAxiosRequestConfig): AxiosPromise<void> { 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?: string, inventoryWarehouseId?: string, inventoryLocationId?: string, groupBy?: GetInventoryLevelsGroupByEnum, limit?: number, options?: RawAxiosRequestConfig): AxiosPromise<GetInventoryLevels200Response> { 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: string, options?: RawAxiosRequestConfig): AxiosPromise<ListInventoryLocations200ResponseInventoryLocationsInner> { 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: string, options?: RawAxiosRequestConfig): AxiosPromise<GetInventoryWarehouses200ResponseInventoryWarehousesInner> { 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?: number, options?: RawAxiosRequestConfig): AxiosPromise<GetInventoryWarehouses200Response> { 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?: number, options?: RawAxiosRequestConfig): AxiosPromise<ListInventoryLocations200Response> { 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: string, updateInventoryWarehouseRequest: UpdateInventoryWarehouseRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> { return localVarFp.updateInventoryLocation(inventoryLocationId, updateInventoryWarehouseRequest, options).then((request) => request(axios, basePath)); }, /** * * @summary Update an inventory warehouse name * @param {string} inventoryWarehouseId * @param {UpdateInventoryWarehouseRequest} updateInventoryWarehouseRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateInventoryWarehouse(inventoryWarehouseId: string, updateInventoryWarehouseRequest: UpdateInventoryWarehouseRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> { return localVarFp.updateInventoryWarehouse(inventoryWarehouseId, updateInventoryWarehouseRequest, options).then((request) => request(axios, basePath)); }, /** * * @summary Update SKU stock levels and related properties * @param {UpdateSKUStockLevelsRequest} updateSKUStockLevelsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateSKUStockLevels(updateSKUStockLevelsRequest: UpdateSKUStockLevelsRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> { return localVarFp.updateSKUStockLevels(updateSKUStockLevelsRequest, options).then((request) => request(axios, basePath)); }, }; }; /** * InventoryApi - object-oriented interface * @export * @class InventoryApi * @extends {BaseAPI} */ export class InventoryApi extends BaseAPI { /** * * @summary Create a new inventory warehouse * @param {AddNewInventoryWarehouseRequest} addNewInventoryWarehouseRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InventoryApi */ public addNewInventoryWarehouse(addNewInventoryWarehouseRequest: AddNewInventoryWarehouseRequest, options?: RawAxiosRequestConfig) { return InventoryApiFp(this.configuration).addNewInventoryWarehouse(addNewInventoryWarehouseRequest, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Create a new inventory location * @param {CreateInventoryLocationRequest} createInventoryLocationRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InventoryApi */ public createInventoryLocation(createInventoryLocationRequest: CreateInventoryLocationRequest, options?: RawAxiosRequestConfig) { return InventoryApiFp(this.configuration).createInventoryLocation(createInventoryLocationRequest, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Delete an inventory location * @param {string} inventoryLocationId * @param {DeleteInventoryLocationByIdRemoveInventoryEnum} [removeInventory] If 1, remove all inventory from the location befor