@scaleleap/selling-partner-api-sdk
Version:
📦 A fully typed TypeScript and Node.js SDK library for Amazon Selling Partner API
261 lines • 21.5 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* The Selling Partner API for third party application integrations.
* With the AppIntegrations API v2024-04-01, you can send notifications to Amazon Selling Partners and display the notifications in Seller Central.
*
* The version of the OpenAPI document: 2024-04-01
*
*
* 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.AppIntegrationsApi = exports.AppIntegrationsApiFactory = exports.AppIntegrationsApiFp = exports.AppIntegrationsApiAxiosParamCreator = exports.RecordActionFeedbackRequestFeedbackActionCodeEnum = exports.DeleteNotificationsRequestDeletionReasonEnum = 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 DeleteNotificationsRequestDeletionReasonEnum;
(function (DeleteNotificationsRequestDeletionReasonEnum) {
DeleteNotificationsRequestDeletionReasonEnum["Content"] = "INCORRECT_CONTENT";
DeleteNotificationsRequestDeletionReasonEnum["Recipient"] = "INCORRECT_RECIPIENT";
})(DeleteNotificationsRequestDeletionReasonEnum || (exports.DeleteNotificationsRequestDeletionReasonEnum = DeleteNotificationsRequestDeletionReasonEnum = {}));
/**
* @export
* @enum {string}
*/
var RecordActionFeedbackRequestFeedbackActionCodeEnum;
(function (RecordActionFeedbackRequestFeedbackActionCodeEnum) {
RecordActionFeedbackRequestFeedbackActionCodeEnum["SellerActionCompleted"] = "SELLER_ACTION_COMPLETED";
})(RecordActionFeedbackRequestFeedbackActionCodeEnum || (exports.RecordActionFeedbackRequestFeedbackActionCodeEnum = RecordActionFeedbackRequestFeedbackActionCodeEnum = {}));
/**
* AppIntegrationsApi - axios parameter creator
* @export
*/
const AppIntegrationsApiAxiosParamCreator = function (configuration) {
return {
/**
* Create a notification for sellers in Seller Central. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [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 {CreateNotificationRequest} body The request body for the `createNotification` operation.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createNotification: async (body, options = {}) => {
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('createNotification', 'body', body);
const localVarPath = `/appIntegrations/2024-04-01/notifications`;
// 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,
};
},
/**
* Remove your application\'s notifications from the Appstore notifications dashboard. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [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 {DeleteNotificationsRequest} body The request body for the `deleteNotifications` operation.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteNotifications: async (body, options = {}) => {
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('deleteNotifications', 'body', body);
const localVarPath = `/appIntegrations/2024-04-01/notifications/deletion`;
// 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,
};
},
/**
* Records the seller\'s response to a notification. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [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} notificationId A `notificationId` uniquely identifies a notification.
* @param {RecordActionFeedbackRequest} body The request body for the `recordActionFeedback` operation.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
recordActionFeedback: async (notificationId, body, options = {}) => {
// verify required parameter 'notificationId' is not null or undefined
(0, common_1.assertParamExists)('recordActionFeedback', 'notificationId', notificationId);
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('recordActionFeedback', 'body', body);
const localVarPath = `/appIntegrations/2024-04-01/notifications/{notificationId}/feedback`
.replace(`{${"notificationId"}}`, encodeURIComponent(String(notificationId)));
// 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.AppIntegrationsApiAxiosParamCreator = AppIntegrationsApiAxiosParamCreator;
/**
* AppIntegrationsApi - functional programming interface
* @export
*/
const AppIntegrationsApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.AppIntegrationsApiAxiosParamCreator)(configuration);
return {
/**
* Create a notification for sellers in Seller Central. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [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 {CreateNotificationRequest} body The request body for the `createNotification` operation.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createNotification(body, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.createNotification(body, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Remove your application\'s notifications from the Appstore notifications dashboard. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [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 {DeleteNotificationsRequest} body The request body for the `deleteNotifications` operation.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteNotifications(body, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteNotifications(body, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Records the seller\'s response to a notification. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [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} notificationId A `notificationId` uniquely identifies a notification.
* @param {RecordActionFeedbackRequest} body The request body for the `recordActionFeedback` operation.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async recordActionFeedback(notificationId, body, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.recordActionFeedback(notificationId, body, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
};
};
exports.AppIntegrationsApiFp = AppIntegrationsApiFp;
/**
* AppIntegrationsApi - factory interface
* @export
*/
const AppIntegrationsApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.AppIntegrationsApiFp)(configuration);
return {
/**
* Create a notification for sellers in Seller Central. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [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 {CreateNotificationRequest} body The request body for the `createNotification` operation.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createNotification(body, options) {
return localVarFp.createNotification(body, options).then((request) => request(axios, basePath));
},
/**
* Remove your application\'s notifications from the Appstore notifications dashboard. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [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 {DeleteNotificationsRequest} body The request body for the `deleteNotifications` operation.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteNotifications(body, options) {
return localVarFp.deleteNotifications(body, options).then((request) => request(axios, basePath));
},
/**
* Records the seller\'s response to a notification. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [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} notificationId A `notificationId` uniquely identifies a notification.
* @param {RecordActionFeedbackRequest} body The request body for the `recordActionFeedback` operation.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
recordActionFeedback(notificationId, body, options) {
return localVarFp.recordActionFeedback(notificationId, body, options).then((request) => request(axios, basePath));
},
};
};
exports.AppIntegrationsApiFactory = AppIntegrationsApiFactory;
/**
* AppIntegrationsApi - object-oriented interface
* @export
* @class AppIntegrationsApi
* @extends {BaseAPI}
*/
class AppIntegrationsApi extends base_1.BaseAPI {
/**
* Create a notification for sellers in Seller Central. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [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 {AppIntegrationsApiCreateNotificationRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AppIntegrationsApi
*/
createNotification(requestParameters, options) {
return (0, exports.AppIntegrationsApiFp)(this.configuration).createNotification(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
}
/**
* Remove your application\'s notifications from the Appstore notifications dashboard. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [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 {AppIntegrationsApiDeleteNotificationsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AppIntegrationsApi
*/
deleteNotifications(requestParameters, options) {
return (0, exports.AppIntegrationsApiFp)(this.configuration).deleteNotifications(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
}
/**
* Records the seller\'s response to a notification. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [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 {AppIntegrationsApiRecordActionFeedbackRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AppIntegrationsApi
*/
recordActionFeedback(requestParameters, options) {
return (0, exports.AppIntegrationsApiFp)(this.configuration).recordActionFeedback(requestParameters.notificationId, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
}
}
exports.AppIntegrationsApi = AppIntegrationsApi;
//# sourceMappingURL=api.js.map