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.

119 lines (118 loc) 8.73 kB
/* 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. */ import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore import { BASE_PATH, BaseAPI, operationServerMap } from '../base'; /** * VendorDirectFulfillmentInventoryApi - axios parameter creator * @export */ 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 assertParamExists('submitInventoryUpdate', 'warehouseId', warehouseId); // verify required parameter 'body' is not null or undefined 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, 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'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * VendorDirectFulfillmentInventoryApi - functional programming interface * @export */ export const VendorDirectFulfillmentInventoryApiFp = function (configuration) { const localVarAxiosParamCreator = 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 = operationServerMap['VendorDirectFulfillmentInventoryApi.submitInventoryUpdate']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * VendorDirectFulfillmentInventoryApi - factory interface * @export */ export const VendorDirectFulfillmentInventoryApiFactory = function (configuration, basePath, axios) { const localVarFp = 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)); }, }; }; /** * VendorDirectFulfillmentInventoryApi - object-oriented interface * @export * @class VendorDirectFulfillmentInventoryApi * @extends {BaseAPI} */ export class VendorDirectFulfillmentInventoryApi extends 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 VendorDirectFulfillmentInventoryApiFp(this.configuration).submitInventoryUpdate(requestParameters.warehouseId, requestParameters.body, options).then((request) => request(this.axios, this.basePath)); } }