UNPKG

@scaleleap/selling-partner-api-sdk

Version:

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

583 lines • 95.6 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Selling Partner API for Messaging * With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the <a href=https://tools.ietf.org/html/draft-kelly-json-hal-08>JSON Hypertext Application Language</a> (HAL) standard. * * 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.MessagingApi = exports.MessagingApiFactory = exports.MessagingApiFp = exports.MessagingApiAxiosParamCreator = 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"); /** * MessagingApi - axios parameter creator * @export */ const MessagingApiAxiosParamCreator = function (configuration) { return { /** * Sends a message asking a buyer to provide or verify customization details such as name spelling, images, initials, etc. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {string} amazonOrderId An Amazon order identifier. This identifies the order for which a message is sent. * @param {Array<string>} marketplaceIds A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. * @param {CreateConfirmCustomizationDetailsRequest} body This contains the message body for a message. * @param {*} [options] Override http request option. * @throws {RequiredError} */ confirmCustomizationDetails: async (amazonOrderId, marketplaceIds, body, options = {}) => { // verify required parameter 'amazonOrderId' is not null or undefined (0, common_1.assertParamExists)('confirmCustomizationDetails', 'amazonOrderId', amazonOrderId); // verify required parameter 'marketplaceIds' is not null or undefined (0, common_1.assertParamExists)('confirmCustomizationDetails', 'marketplaceIds', marketplaceIds); // verify required parameter 'body' is not null or undefined (0, common_1.assertParamExists)('confirmCustomizationDetails', 'body', body); const localVarPath = `/messaging/v1/orders/{amazonOrderId}/messages/confirmCustomizationDetails` .replace(`{${"amazonOrderId"}}`, encodeURIComponent(String(amazonOrderId))); // 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 = {}; if (marketplaceIds) { localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv); } 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, }; }, /** * Sends a message to a buyer to provide details about an Amazon Motors order. This message can only be sent by Amazon Motors sellers. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {string} amazonOrderId An Amazon order identifier. This identifies the order for which a message is sent. * @param {Array<string>} marketplaceIds A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. * @param {CreateAmazonMotorsRequest} body This contains the message body for a message. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createAmazonMotors: async (amazonOrderId, marketplaceIds, body, options = {}) => { // verify required parameter 'amazonOrderId' is not null or undefined (0, common_1.assertParamExists)('createAmazonMotors', 'amazonOrderId', amazonOrderId); // verify required parameter 'marketplaceIds' is not null or undefined (0, common_1.assertParamExists)('createAmazonMotors', 'marketplaceIds', marketplaceIds); // verify required parameter 'body' is not null or undefined (0, common_1.assertParamExists)('createAmazonMotors', 'body', body); const localVarPath = `/messaging/v1/orders/{amazonOrderId}/messages/amazonMotors` .replace(`{${"amazonOrderId"}}`, encodeURIComponent(String(amazonOrderId))); // 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 = {}; if (marketplaceIds) { localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv); } 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, }; }, /** * Sends a message to a buyer to arrange a delivery or to confirm contact information for making a delivery. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {string} amazonOrderId An Amazon order identifier. This identifies the order for which a message is sent. * @param {Array<string>} marketplaceIds A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. * @param {CreateConfirmDeliveryDetailsRequest} body This contains the message body for a message. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createConfirmDeliveryDetails: async (amazonOrderId, marketplaceIds, body, options = {}) => { // verify required parameter 'amazonOrderId' is not null or undefined (0, common_1.assertParamExists)('createConfirmDeliveryDetails', 'amazonOrderId', amazonOrderId); // verify required parameter 'marketplaceIds' is not null or undefined (0, common_1.assertParamExists)('createConfirmDeliveryDetails', 'marketplaceIds', marketplaceIds); // verify required parameter 'body' is not null or undefined (0, common_1.assertParamExists)('createConfirmDeliveryDetails', 'body', body); const localVarPath = `/messaging/v1/orders/{amazonOrderId}/messages/confirmDeliveryDetails` .replace(`{${"amazonOrderId"}}`, encodeURIComponent(String(amazonOrderId))); // 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 = {}; if (marketplaceIds) { localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv); } 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, }; }, /** * Sends a message to ask a buyer an order-related question prior to shipping their order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {string} amazonOrderId An Amazon order identifier. This identifies the order for which a message is sent. * @param {Array<string>} marketplaceIds A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. * @param {CreateConfirmOrderDetailsRequest} body This contains the message body for a message. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createConfirmOrderDetails: async (amazonOrderId, marketplaceIds, body, options = {}) => { // verify required parameter 'amazonOrderId' is not null or undefined (0, common_1.assertParamExists)('createConfirmOrderDetails', 'amazonOrderId', amazonOrderId); // verify required parameter 'marketplaceIds' is not null or undefined (0, common_1.assertParamExists)('createConfirmOrderDetails', 'marketplaceIds', marketplaceIds); // verify required parameter 'body' is not null or undefined (0, common_1.assertParamExists)('createConfirmOrderDetails', 'body', body); const localVarPath = `/messaging/v1/orders/{amazonOrderId}/messages/confirmOrderDetails` .replace(`{${"amazonOrderId"}}`, encodeURIComponent(String(amazonOrderId))); // 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 = {}; if (marketplaceIds) { localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv); } 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, }; }, /** * Sends a message to contact a Home Service customer to arrange a service call or to gather information prior to a service call. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {string} amazonOrderId An Amazon order identifier. This identifies the order for which a message is sent. * @param {Array<string>} marketplaceIds A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. * @param {CreateConfirmServiceDetailsRequest} body This contains the message body for a message. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createConfirmServiceDetails: async (amazonOrderId, marketplaceIds, body, options = {}) => { // verify required parameter 'amazonOrderId' is not null or undefined (0, common_1.assertParamExists)('createConfirmServiceDetails', 'amazonOrderId', amazonOrderId); // verify required parameter 'marketplaceIds' is not null or undefined (0, common_1.assertParamExists)('createConfirmServiceDetails', 'marketplaceIds', marketplaceIds); // verify required parameter 'body' is not null or undefined (0, common_1.assertParamExists)('createConfirmServiceDetails', 'body', body); const localVarPath = `/messaging/v1/orders/{amazonOrderId}/messages/confirmServiceDetails` .replace(`{${"amazonOrderId"}}`, encodeURIComponent(String(amazonOrderId))); // 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 = {}; if (marketplaceIds) { localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv); } 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, }; }, /** * Sends a buyer a message to share a digital access key that is required to utilize digital content in their order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {string} amazonOrderId An Amazon order identifier. This identifies the order for which a message is sent. * @param {Array<string>} marketplaceIds A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. * @param {CreateDigitalAccessKeyRequest} body This contains the message body for a message. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createDigitalAccessKey: async (amazonOrderId, marketplaceIds, body, options = {}) => { // verify required parameter 'amazonOrderId' is not null or undefined (0, common_1.assertParamExists)('createDigitalAccessKey', 'amazonOrderId', amazonOrderId); // verify required parameter 'marketplaceIds' is not null or undefined (0, common_1.assertParamExists)('createDigitalAccessKey', 'marketplaceIds', marketplaceIds); // verify required parameter 'body' is not null or undefined (0, common_1.assertParamExists)('createDigitalAccessKey', 'body', body); const localVarPath = `/messaging/v1/orders/{amazonOrderId}/messages/digitalAccessKey` .replace(`{${"amazonOrderId"}}`, encodeURIComponent(String(amazonOrderId))); // 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 = {}; if (marketplaceIds) { localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv); } 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, }; }, /** * Sends a critical message that contains documents that a seller is legally obligated to provide to the buyer. This message should only be used to deliver documents that are required by law. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {string} amazonOrderId An Amazon order identifier. This identifies the order for which a message is sent. * @param {Array<string>} marketplaceIds A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. * @param {CreateLegalDisclosureRequest} body This contains the message body for a message. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createLegalDisclosure: async (amazonOrderId, marketplaceIds, body, options = {}) => { // verify required parameter 'amazonOrderId' is not null or undefined (0, common_1.assertParamExists)('createLegalDisclosure', 'amazonOrderId', amazonOrderId); // verify required parameter 'marketplaceIds' is not null or undefined (0, common_1.assertParamExists)('createLegalDisclosure', 'marketplaceIds', marketplaceIds); // verify required parameter 'body' is not null or undefined (0, common_1.assertParamExists)('createLegalDisclosure', 'body', body); const localVarPath = `/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure` .replace(`{${"amazonOrderId"}}`, encodeURIComponent(String(amazonOrderId))); // 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 = {}; if (marketplaceIds) { localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv); } 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, }; }, /** * Sends a non-critical message that asks a buyer to remove their negative feedback. This message should only be sent after the seller has resolved the buyer\'s problem. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {string} amazonOrderId An Amazon order identifier. This identifies the order for which a message is sent. * @param {Array<string>} marketplaceIds A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createNegativeFeedbackRemoval: async (amazonOrderId, marketplaceIds, options = {}) => { // verify required parameter 'amazonOrderId' is not null or undefined (0, common_1.assertParamExists)('createNegativeFeedbackRemoval', 'amazonOrderId', amazonOrderId); // verify required parameter 'marketplaceIds' is not null or undefined (0, common_1.assertParamExists)('createNegativeFeedbackRemoval', 'marketplaceIds', marketplaceIds); const localVarPath = `/messaging/v1/orders/{amazonOrderId}/messages/negativeFeedbackRemoval` .replace(`{${"amazonOrderId"}}`, encodeURIComponent(String(amazonOrderId))); // 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 = {}; if (marketplaceIds) { localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv); } (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, }; }, /** * Sends a critical message to a buyer that an unexpected problem was encountered affecting the completion of the order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {string} amazonOrderId An Amazon order identifier. This identifies the order for which a message is sent. * @param {Array<string>} marketplaceIds A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. * @param {CreateUnexpectedProblemRequest} body This contains the message body for a message. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createUnexpectedProblem: async (amazonOrderId, marketplaceIds, body, options = {}) => { // verify required parameter 'amazonOrderId' is not null or undefined (0, common_1.assertParamExists)('createUnexpectedProblem', 'amazonOrderId', amazonOrderId); // verify required parameter 'marketplaceIds' is not null or undefined (0, common_1.assertParamExists)('createUnexpectedProblem', 'marketplaceIds', marketplaceIds); // verify required parameter 'body' is not null or undefined (0, common_1.assertParamExists)('createUnexpectedProblem', 'body', body); const localVarPath = `/messaging/v1/orders/{amazonOrderId}/messages/unexpectedProblem` .replace(`{${"amazonOrderId"}}`, encodeURIComponent(String(amazonOrderId))); // 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 = {}; if (marketplaceIds) { localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv); } 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, }; }, /** * Sends a message to a buyer to provide details about warranty information on a purchase in their order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {string} amazonOrderId An Amazon order identifier. This identifies the order for which a message is sent. * @param {Array<string>} marketplaceIds A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. * @param {CreateWarrantyRequest} body This contains the message body for a message. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createWarranty: async (amazonOrderId, marketplaceIds, body, options = {}) => { // verify required parameter 'amazonOrderId' is not null or undefined (0, common_1.assertParamExists)('createWarranty', 'amazonOrderId', amazonOrderId); // verify required parameter 'marketplaceIds' is not null or undefined (0, common_1.assertParamExists)('createWarranty', 'marketplaceIds', marketplaceIds); // verify required parameter 'body' is not null or undefined (0, common_1.assertParamExists)('createWarranty', 'body', body); const localVarPath = `/messaging/v1/orders/{amazonOrderId}/messages/warranty` .replace(`{${"amazonOrderId"}}`, encodeURIComponent(String(amazonOrderId))); // 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 = {}; if (marketplaceIds) { localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv); } 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, }; }, /** * Returns a response containing attributes related to an order. This includes buyer preferences. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | * @param {string} amazonOrderId An Amazon order identifier. This identifies the order for which a message is sent. * @param {Array<string>} marketplaceIds A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAttributes: async (amazonOrderId, marketplaceIds, options = {}) => { // verify required parameter 'amazonOrderId' is not null or undefined (0, common_1.assertParamExists)('getAttributes', 'amazonOrderId', amazonOrderId); // verify required parameter 'marketplaceIds' is not null or undefined (0, common_1.assertParamExists)('getAttributes', 'marketplaceIds', marketplaceIds); const localVarPath = `/messaging/v1/orders/{amazonOrderId}/attributes` .replace(`{${"amazonOrderId"}}`, encodeURIComponent(String(amazonOrderId))); // 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 (marketplaceIds) { localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv); } (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, }; }, /** * Returns a list of message types that are available for an order that you specify. A message type is represented by an actions object, which contains a path and query parameter(s). You can use the path and parameter(s) to call an operation that sends a message. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {string} amazonOrderId An Amazon order identifier. This specifies the order for which you want a list of available message types. * @param {Array<string>} marketplaceIds A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMessagingActionsForOrder: async (amazonOrderId, marketplaceIds, options = {}) => { // verify required parameter 'amazonOrderId' is not null or undefined (0, common_1.assertParamExists)('getMessagingActionsForOrder', 'amazonOrderId', amazonOrderId); // verify required parameter 'marketplaceIds' is not null or undefined (0, common_1.assertParamExists)('getMessagingActionsForOrder', 'marketplaceIds', marketplaceIds); const localVarPath = `/messaging/v1/orders/{amazonOrderId}` .replace(`{${"amazonOrderId"}}`, encodeURIComponent(String(amazonOrderId))); // 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 (marketplaceIds) { localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv); } (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, }; }, /** * Sends a message providing the buyer an invoice * @param {string} amazonOrderId An Amazon order identifier. This identifies the order for which a message is sent. * @param {Array<string>} marketplaceIds A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. * @param {InvoiceRequest} body This contains the message body for a message. * @param {*} [options] Override http request option. * @throws {RequiredError} */ sendInvoice: async (amazonOrderId, marketplaceIds, body, options = {}) => { // verify required parameter 'amazonOrderId' is not null or undefined (0, common_1.assertParamExists)('sendInvoice', 'amazonOrderId', amazonOrderId); // verify required parameter 'marketplaceIds' is not null or undefined (0, common_1.assertParamExists)('sendInvoice', 'marketplaceIds', marketplaceIds); // verify required parameter 'body' is not null or undefined (0, common_1.assertParamExists)('sendInvoice', 'body', body); const localVarPath = `/messaging/v1/orders/{amazonOrderId}/messages/invoice` .replace(`{${"amazonOrderId"}}`, encodeURIComponent(String(amazonOrderId))); // 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 = {}; if (marketplaceIds) { localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv); } 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.MessagingApiAxiosParamCreator = MessagingApiAxiosParamCreator; /** * MessagingApi - functional programming interface * @export */ const MessagingApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.MessagingApiAxiosParamCreator)(configuration); return { /** * Sends a message asking a buyer to provide or verify customization details such as name spelling, images, initials, etc. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {string} amazonOrderId An Amazon order identifier. This identifies the order for which a message is sent. * @param {Array<string>} marketplaceIds A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. * @param {CreateConfirmCustomizationDetailsRequest} body This contains the message body for a message. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async confirmCustomizationDetails(amazonOrderId, marketplaceIds, body, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.confirmCustomizationDetails(amazonOrderId, marketplaceIds, body, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * Sends a message to a buyer to provide details about an Amazon Motors order. This message can only be sent by Amazon Motors sellers. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {string} amazonOrderId An Amazon order identifier. This identifies the order for which a message is sent. * @param {Array<string>} marketplaceIds A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. * @param {CreateAmazonMotorsRequest} body This contains the message body for a message. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createAmazonMotors(amazonOrderId, marketplaceIds, body, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.createAmazonMotors(amazonOrderId, marketplaceIds, body, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * Sends a message to a buyer to arrange a delivery or to confirm contact information for making a delivery. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {string} amazonOrderId An Amazon order identifier. This identifies the order for which a message is sent. * @param {Array<string>} marketplaceIds A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. * @param {CreateConfirmDeliveryDetailsRequest} body This contains the message body for a message. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createConfirmDeliveryDetails(amazonOrderId, marketplaceIds, body, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.createConfirmDeliveryDetails(amazonOrderId, marketplaceIds, body, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * Sends a message to ask a buyer an order-related question prior to shipping their order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {string} amazonOrderId An Amazon order identifier. This identifies the order for which a message is sent. * @param {Array<string>} marketplaceIds A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace. * @param {CreateConfirmOrderDetailsRequest} body This contains the message body for a message. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createConfirmOrderDetails(amazonOrderId, marketplaceIds, body, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.createConfirmOrderDetails(amazonOrderId, marketplaceIds, body, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, /** * Sends a message to contact a Home Service customer to arrange a service call or to gather information prior to a service call. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values fo