@scaleleap/selling-partner-api-sdk
Version:
📦 A fully typed TypeScript and Node.js SDK library for Amazon Selling Partner API
128 lines • 8.9 kB
JavaScript
;
/* 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.UpdateInventoryApi = exports.UpdateInventoryApiFactory = exports.UpdateInventoryApiFp = exports.UpdateInventoryApiAxiosParamCreator = 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");
/**
* UpdateInventoryApi - axios parameter creator
* @export
*/
const UpdateInventoryApiAxiosParamCreator = 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, options.query);
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.UpdateInventoryApiAxiosParamCreator = UpdateInventoryApiAxiosParamCreator;
/**
* UpdateInventoryApi - functional programming interface
* @export
*/
const UpdateInventoryApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.UpdateInventoryApiAxiosParamCreator)(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);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
};
};
exports.UpdateInventoryApiFp = UpdateInventoryApiFp;
/**
* UpdateInventoryApi - factory interface
* @export
*/
const UpdateInventoryApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.UpdateInventoryApiFp)(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(warehouseId, body, options) {
return localVarFp.submitInventoryUpdate(warehouseId, body, options).then((request) => request(axios, basePath));
},
};
};
exports.UpdateInventoryApiFactory = UpdateInventoryApiFactory;
/**
* UpdateInventoryApi - object-oriented interface
* @export
* @class UpdateInventoryApi
* @extends {BaseAPI}
*/
class UpdateInventoryApi 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 {UpdateInventoryApiSubmitInventoryUpdateRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UpdateInventoryApi
*/
submitInventoryUpdate(requestParameters, options) {
return (0, exports.UpdateInventoryApiFp)(this.configuration).submitInventoryUpdate(requestParameters.warehouseId, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
}
}
exports.UpdateInventoryApi = UpdateInventoryApi;
//# sourceMappingURL=api.js.map