@scaleleap/selling-partner-api-sdk
Version:
📦 A fully typed TypeScript and Node.js SDK library for Amazon Selling Partner API
131 lines • 8.54 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* Selling Partner API for Retail Procurement Transaction Status
* The Selling Partner API for Retail Procurement Transaction Status provides programmatic access to status information on specific asynchronous POST transactions for vendors.
*
* 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.VendorTransactionApi = exports.VendorTransactionApiFactory = exports.VendorTransactionApiFp = exports.VendorTransactionApiAxiosParamCreator = exports.TransactionStatusEnum = 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");
/**
* @export
* @enum {string}
*/
var TransactionStatusEnum;
(function (TransactionStatusEnum) {
TransactionStatusEnum["Failure"] = "Failure";
TransactionStatusEnum["Processing"] = "Processing";
TransactionStatusEnum["Success"] = "Success";
})(TransactionStatusEnum || (exports.TransactionStatusEnum = TransactionStatusEnum = {}));
/**
* VendorTransactionApi - axios parameter creator
* @export
*/
const VendorTransactionApiAxiosParamCreator = function (configuration) {
return {
/**
* Returns the status of the transaction that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 20 | 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} transactionId The GUID provided by Amazon in the \'transactionId\' field in response to the post request of a specific transaction.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getTransaction: async (transactionId, options = {}) => {
// verify required parameter 'transactionId' is not null or undefined
(0, common_1.assertParamExists)('getTransaction', 'transactionId', transactionId);
const localVarPath = `/vendor/transactions/v1/transactions/{transactionId}`
.replace(`{${"transactionId"}}`, encodeURIComponent(String(transactionId)));
// 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: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
exports.VendorTransactionApiAxiosParamCreator = VendorTransactionApiAxiosParamCreator;
/**
* VendorTransactionApi - functional programming interface
* @export
*/
const VendorTransactionApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.VendorTransactionApiAxiosParamCreator)(configuration);
return {
/**
* Returns the status of the transaction that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 20 | 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} transactionId The GUID provided by Amazon in the \'transactionId\' field in response to the post request of a specific transaction.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getTransaction(transactionId, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getTransaction(transactionId, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
};
};
exports.VendorTransactionApiFp = VendorTransactionApiFp;
/**
* VendorTransactionApi - factory interface
* @export
*/
const VendorTransactionApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.VendorTransactionApiFp)(configuration);
return {
/**
* Returns the status of the transaction that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 20 | 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} transactionId The GUID provided by Amazon in the \'transactionId\' field in response to the post request of a specific transaction.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getTransaction(transactionId, options) {
return localVarFp.getTransaction(transactionId, options).then((request) => request(axios, basePath));
},
};
};
exports.VendorTransactionApiFactory = VendorTransactionApiFactory;
/**
* VendorTransactionApi - object-oriented interface
* @export
* @class VendorTransactionApi
* @extends {BaseAPI}
*/
class VendorTransactionApi extends base_1.BaseAPI {
/**
* Returns the status of the transaction that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 20 | 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 {VendorTransactionApiGetTransactionRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof VendorTransactionApi
*/
getTransaction(requestParameters, options) {
return (0, exports.VendorTransactionApiFp)(this.configuration).getTransaction(requestParameters.transactionId, options).then((request) => request(this.axios, this.basePath));
}
}
exports.VendorTransactionApi = VendorTransactionApi;
//# sourceMappingURL=api.js.map