UNPKG

@sp-api-sdk/vendor-direct-fulfillment-inventory-api-v1

Version:

The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates.

129 lines (128 loc) 9.57 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Selling Partner API for Direct Fulfillment Inventory Updates * The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor\'s inventory updates. * * The version of the OpenAPI document: v1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.VendorDirectFulfillmentInventoryApi = exports.VendorDirectFulfillmentInventoryApiFactory = exports.VendorDirectFulfillmentInventoryApiFp = exports.VendorDirectFulfillmentInventoryApiAxiosParamCreator = void 0; const axios_1 = __importDefault(require("axios")); // Some imports not used depending on template conditions // @ts-ignore const common_1 = require("../common"); // @ts-ignore const base_1 = require("../base"); /** * VendorDirectFulfillmentInventoryApi - axios parameter creator * @export */ const VendorDirectFulfillmentInventoryApiAxiosParamCreator = function (configuration) { return { /** * Submits inventory updates for the specified warehouse for either a partial or full feed of inventory items. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {string} warehouseId Identifier for the warehouse for which to update inventory. * @param {SubmitInventoryUpdateRequest} body The request body containing the inventory update data to submit. * @param {*} [options] Override http request option. * @throws {RequiredError} */ submitInventoryUpdate: async (warehouseId, body, options = {}) => { // verify required parameter 'warehouseId' is not null or undefined (0, common_1.assertParamExists)('submitInventoryUpdate', 'warehouseId', warehouseId); // verify required parameter 'body' is not null or undefined (0, common_1.assertParamExists)('submitInventoryUpdate', 'body', body); const localVarPath = `/vendor/directFulfillment/inventory/v1/warehouses/{warehouseId}/items` .replace(`{${"warehouseId"}}`, encodeURIComponent(String(warehouseId))); // 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 = { method: 'POST', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; exports.VendorDirectFulfillmentInventoryApiAxiosParamCreator = VendorDirectFulfillmentInventoryApiAxiosParamCreator; /** * VendorDirectFulfillmentInventoryApi - functional programming interface * @export */ const VendorDirectFulfillmentInventoryApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.VendorDirectFulfillmentInventoryApiAxiosParamCreator)(configuration); return { /** * Submits inventory updates for the specified warehouse for either a partial or full feed of inventory items. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {string} warehouseId Identifier for the warehouse for which to update inventory. * @param {SubmitInventoryUpdateRequest} body The request body containing the inventory update data to submit. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async submitInventoryUpdate(warehouseId, body, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.submitInventoryUpdate(warehouseId, body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = base_1.operationServerMap['VendorDirectFulfillmentInventoryApi.submitInventoryUpdate']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, }; }; exports.VendorDirectFulfillmentInventoryApiFp = VendorDirectFulfillmentInventoryApiFp; /** * VendorDirectFulfillmentInventoryApi - factory interface * @export */ const VendorDirectFulfillmentInventoryApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.VendorDirectFulfillmentInventoryApiFp)(configuration); return { /** * Submits inventory updates for the specified warehouse for either a partial or full feed of inventory items. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {VendorDirectFulfillmentInventoryApiSubmitInventoryUpdateRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ submitInventoryUpdate(requestParameters, options) { return localVarFp.submitInventoryUpdate(requestParameters.warehouseId, requestParameters.body, options).then((request) => request(axios, basePath)); }, }; }; exports.VendorDirectFulfillmentInventoryApiFactory = VendorDirectFulfillmentInventoryApiFactory; /** * VendorDirectFulfillmentInventoryApi - object-oriented interface * @export * @class VendorDirectFulfillmentInventoryApi * @extends {BaseAPI} */ class VendorDirectFulfillmentInventoryApi extends base_1.BaseAPI { /** * Submits inventory updates for the specified warehouse for either a partial or full feed of inventory items. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {VendorDirectFulfillmentInventoryApiSubmitInventoryUpdateRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof VendorDirectFulfillmentInventoryApi */ submitInventoryUpdate(requestParameters, options) { return (0, exports.VendorDirectFulfillmentInventoryApiFp)(this.configuration).submitInventoryUpdate(requestParameters.warehouseId, requestParameters.body, options).then((request) => request(this.axios, this.basePath)); } } exports.VendorDirectFulfillmentInventoryApi = VendorDirectFulfillmentInventoryApi;