UNPKG

@scaleleap/selling-partner-api-sdk

Version:

📦 A fully typed TypeScript and Node.js SDK library for Amazon Selling Partner API

189 lines • 13.4 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Selling Partner API for Listings Restrictions * The Selling Partner API for Listings Restrictions provides programmatic access to restrictions on Amazon catalog listings. For more information, see the [Listings Restrictions API Use Case Guide](doc:listings-restrictions-api-v2021-08-01-use-case-guide). * * The version of the OpenAPI document: 2021-08-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.ListingsApi = exports.ListingsApiFactory = exports.ListingsApiFp = exports.ListingsApiAxiosParamCreator = exports.RestrictionConditionTypeEnum = exports.ReasonReasonCodeEnum = exports.LinkVerbEnum = 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 LinkVerbEnum; (function (LinkVerbEnum) { LinkVerbEnum["Get"] = "GET"; })(LinkVerbEnum || (exports.LinkVerbEnum = LinkVerbEnum = {})); /** * @export * @enum {string} */ var ReasonReasonCodeEnum; (function (ReasonReasonCodeEnum) { ReasonReasonCodeEnum["ApprovalRequired"] = "APPROVAL_REQUIRED"; ReasonReasonCodeEnum["AsinNotFound"] = "ASIN_NOT_FOUND"; ReasonReasonCodeEnum["NotEligible"] = "NOT_ELIGIBLE"; })(ReasonReasonCodeEnum || (exports.ReasonReasonCodeEnum = ReasonReasonCodeEnum = {})); /** * @export * @enum {string} */ var RestrictionConditionTypeEnum; (function (RestrictionConditionTypeEnum) { RestrictionConditionTypeEnum["NewNew"] = "new_new"; RestrictionConditionTypeEnum["NewOpenBox"] = "new_open_box"; RestrictionConditionTypeEnum["NewOem"] = "new_oem"; RestrictionConditionTypeEnum["RefurbishedRefurbished"] = "refurbished_refurbished"; RestrictionConditionTypeEnum["UsedLikeNew"] = "used_like_new"; RestrictionConditionTypeEnum["UsedVeryGood"] = "used_very_good"; RestrictionConditionTypeEnum["UsedGood"] = "used_good"; RestrictionConditionTypeEnum["UsedAcceptable"] = "used_acceptable"; RestrictionConditionTypeEnum["CollectibleLikeNew"] = "collectible_like_new"; RestrictionConditionTypeEnum["CollectibleVeryGood"] = "collectible_very_good"; RestrictionConditionTypeEnum["CollectibleGood"] = "collectible_good"; RestrictionConditionTypeEnum["CollectibleAcceptable"] = "collectible_acceptable"; RestrictionConditionTypeEnum["ClubClub"] = "club_club"; })(RestrictionConditionTypeEnum || (exports.RestrictionConditionTypeEnum = RestrictionConditionTypeEnum = {})); /** * ListingsApi - axios parameter creator * @export */ const ListingsApiAxiosParamCreator = function (configuration) { return { /** * Returns listing restrictions for an item in the Amazon Catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 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 then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). * @param {string} asin The Amazon Standard Identification Number (ASIN) of the item. * @param {string} sellerId A selling partner identifier, such as a merchant account. * @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers for the request. * @param {'new_new' | 'new_open_box' | 'new_oem' | 'refurbished_refurbished' | 'used_like_new' | 'used_very_good' | 'used_good' | 'used_acceptable' | 'collectible_like_new' | 'collectible_very_good' | 'collectible_good' | 'collectible_acceptable' | 'club_club'} [conditionType] The condition used to filter restrictions. * @param {string} [reasonLocale] A locale for reason text localization. When not provided, the default language code of the first marketplace is used. Examples: \&quot;en_US\&quot;, \&quot;fr_CA\&quot;, \&quot;fr_FR\&quot;. Localized messages default to \&quot;en_US\&quot; when a localization is not available in the specified locale. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getListingsRestrictions: async (asin, sellerId, marketplaceIds, conditionType, reasonLocale, options = {}) => { // verify required parameter 'asin' is not null or undefined (0, common_1.assertParamExists)('getListingsRestrictions', 'asin', asin); // verify required parameter 'sellerId' is not null or undefined (0, common_1.assertParamExists)('getListingsRestrictions', 'sellerId', sellerId); // verify required parameter 'marketplaceIds' is not null or undefined (0, common_1.assertParamExists)('getListingsRestrictions', 'marketplaceIds', marketplaceIds); const localVarPath = `/listings/2021-08-01/restrictions`; // 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 = {}; if (asin !== undefined) { localVarQueryParameter['asin'] = asin; } if (conditionType !== undefined) { localVarQueryParameter['conditionType'] = conditionType; } if (sellerId !== undefined) { localVarQueryParameter['sellerId'] = sellerId; } if (marketplaceIds) { localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv); } if (reasonLocale !== undefined) { localVarQueryParameter['reasonLocale'] = reasonLocale; } (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.ListingsApiAxiosParamCreator = ListingsApiAxiosParamCreator; /** * ListingsApi - functional programming interface * @export */ const ListingsApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.ListingsApiAxiosParamCreator)(configuration); return { /** * Returns listing restrictions for an item in the Amazon Catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 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 then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). * @param {string} asin The Amazon Standard Identification Number (ASIN) of the item. * @param {string} sellerId A selling partner identifier, such as a merchant account. * @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers for the request. * @param {'new_new' | 'new_open_box' | 'new_oem' | 'refurbished_refurbished' | 'used_like_new' | 'used_very_good' | 'used_good' | 'used_acceptable' | 'collectible_like_new' | 'collectible_very_good' | 'collectible_good' | 'collectible_acceptable' | 'club_club'} [conditionType] The condition used to filter restrictions. * @param {string} [reasonLocale] A locale for reason text localization. When not provided, the default language code of the first marketplace is used. Examples: \&quot;en_US\&quot;, \&quot;fr_CA\&quot;, \&quot;fr_FR\&quot;. Localized messages default to \&quot;en_US\&quot; when a localization is not available in the specified locale. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getListingsRestrictions(asin, sellerId, marketplaceIds, conditionType, reasonLocale, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getListingsRestrictions(asin, sellerId, marketplaceIds, conditionType, reasonLocale, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, }; }; exports.ListingsApiFp = ListingsApiFp; /** * ListingsApi - factory interface * @export */ const ListingsApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.ListingsApiFp)(configuration); return { /** * Returns listing restrictions for an item in the Amazon Catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 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 then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). * @param {string} asin The Amazon Standard Identification Number (ASIN) of the item. * @param {string} sellerId A selling partner identifier, such as a merchant account. * @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers for the request. * @param {'new_new' | 'new_open_box' | 'new_oem' | 'refurbished_refurbished' | 'used_like_new' | 'used_very_good' | 'used_good' | 'used_acceptable' | 'collectible_like_new' | 'collectible_very_good' | 'collectible_good' | 'collectible_acceptable' | 'club_club'} [conditionType] The condition used to filter restrictions. * @param {string} [reasonLocale] A locale for reason text localization. When not provided, the default language code of the first marketplace is used. Examples: \&quot;en_US\&quot;, \&quot;fr_CA\&quot;, \&quot;fr_FR\&quot;. Localized messages default to \&quot;en_US\&quot; when a localization is not available in the specified locale. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getListingsRestrictions(asin, sellerId, marketplaceIds, conditionType, reasonLocale, options) { return localVarFp.getListingsRestrictions(asin, sellerId, marketplaceIds, conditionType, reasonLocale, options).then((request) => request(axios, basePath)); }, }; }; exports.ListingsApiFactory = ListingsApiFactory; /** * ListingsApi - object-oriented interface * @export * @class ListingsApi * @extends {BaseAPI} */ class ListingsApi extends base_1.BaseAPI { /** * Returns listing restrictions for an item in the Amazon Catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 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 then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). * @param {ListingsApiGetListingsRestrictionsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ListingsApi */ getListingsRestrictions(requestParameters, options) { return (0, exports.ListingsApiFp)(this.configuration).getListingsRestrictions(requestParameters.asin, requestParameters.sellerId, requestParameters.marketplaceIds, requestParameters.conditionType, requestParameters.reasonLocale, options).then((request) => request(this.axios, this.basePath)); } } exports.ListingsApi = ListingsApi; //# sourceMappingURL=api.js.map