@scaleleap/selling-partner-api-sdk
Version:
📦 A fully typed TypeScript and Node.js SDK library for Amazon Selling Partner API
648 lines • 40.4 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* Selling Partner API for Shipping
* Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of <a href=\"https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference\">Amazon Shipping API (v2)</a> on the <a href=\"https://developer-docs.amazon.com/amazon-shipping/\">Amazon Shipping Developer Documentation</a> site.
*
* 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.ShippingApi = exports.ShippingApiFactory = exports.ShippingApiFp = exports.ShippingApiAxiosParamCreator = exports.WeightUnitEnum = exports.ServiceType = exports.LabelSpecificationLabelStockSizeEnum = exports.LabelSpecificationLabelFormatEnum = exports.DimensionsUnitEnum = exports.ContainerContainerTypeEnum = 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 ContainerContainerTypeEnum;
(function (ContainerContainerTypeEnum) {
ContainerContainerTypeEnum["Package"] = "PACKAGE";
})(ContainerContainerTypeEnum || (exports.ContainerContainerTypeEnum = ContainerContainerTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var DimensionsUnitEnum;
(function (DimensionsUnitEnum) {
DimensionsUnitEnum["In"] = "IN";
DimensionsUnitEnum["Cm"] = "CM";
})(DimensionsUnitEnum || (exports.DimensionsUnitEnum = DimensionsUnitEnum = {}));
/**
* @export
* @enum {string}
*/
var LabelSpecificationLabelFormatEnum;
(function (LabelSpecificationLabelFormatEnum) {
LabelSpecificationLabelFormatEnum["Png"] = "PNG";
})(LabelSpecificationLabelFormatEnum || (exports.LabelSpecificationLabelFormatEnum = LabelSpecificationLabelFormatEnum = {}));
/**
* @export
* @enum {string}
*/
var LabelSpecificationLabelStockSizeEnum;
(function (LabelSpecificationLabelStockSizeEnum) {
LabelSpecificationLabelStockSizeEnum["_4x6"] = "4x6";
})(LabelSpecificationLabelStockSizeEnum || (exports.LabelSpecificationLabelStockSizeEnum = LabelSpecificationLabelStockSizeEnum = {}));
/**
* The type of shipping service that will be used for the service offering.
* @export
* @enum {string}
*/
var ServiceType;
(function (ServiceType) {
ServiceType["Ground"] = "Amazon Shipping Ground";
ServiceType["Standard"] = "Amazon Shipping Standard";
ServiceType["Premium"] = "Amazon Shipping Premium";
})(ServiceType || (exports.ServiceType = ServiceType = {}));
/**
* @export
* @enum {string}
*/
var WeightUnitEnum;
(function (WeightUnitEnum) {
WeightUnitEnum["G"] = "g";
WeightUnitEnum["Kg"] = "kg";
WeightUnitEnum["Oz"] = "oz";
WeightUnitEnum["Lb"] = "lb";
})(WeightUnitEnum || (exports.WeightUnitEnum = WeightUnitEnum = {}));
/**
* ShippingApi - axios parameter creator
* @export
*/
const ShippingApiAxiosParamCreator = function (configuration) {
return {
/**
* Cancel a shipment by the given shipmentId. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {string} shipmentId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
cancelShipment: async (shipmentId, options = {}) => {
// verify required parameter 'shipmentId' is not null or undefined
(0, common_1.assertParamExists)('cancelShipment', 'shipmentId', shipmentId);
const localVarPath = `/shipping/v1/shipments/{shipmentId}/cancel`
.replace(`{${"shipmentId"}}`, encodeURIComponent(String(shipmentId)));
// 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 = {};
(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,
};
},
/**
* Create a new shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).
* @param {CreateShipmentRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createShipment: async (body, options = {}) => {
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('createShipment', 'body', body);
const localVarPath = `/shipping/v1/shipments`;
// 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,
};
},
/**
* Verify if the current account is valid. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAccount: async (options = {}) => {
const localVarPath = `/shipping/v1/account`;
// 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,
};
},
/**
* Get service rates. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {GetRatesRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getRates: async (body, options = {}) => {
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('getRates', 'body', body);
const localVarPath = `/shipping/v1/rates`;
// 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,
};
},
/**
* Return the entire shipment object for the shipmentId. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {string} shipmentId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getShipment: async (shipmentId, options = {}) => {
// verify required parameter 'shipmentId' is not null or undefined
(0, common_1.assertParamExists)('getShipment', 'shipmentId', shipmentId);
const localVarPath = `/shipping/v1/shipments/{shipmentId}`
.replace(`{${"shipmentId"}}`, encodeURIComponent(String(shipmentId)));
// 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,
};
},
/**
* Return the tracking information of a shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {string} trackingId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getTrackingInformation: async (trackingId, options = {}) => {
// verify required parameter 'trackingId' is not null or undefined
(0, common_1.assertParamExists)('getTrackingInformation', 'trackingId', trackingId);
const localVarPath = `/shipping/v1/tracking/{trackingId}`
.replace(`{${"trackingId"}}`, encodeURIComponent(String(trackingId)));
// 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,
};
},
/**
* Purchase shipping labels based on a given rate. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {string} shipmentId
* @param {PurchaseLabelsRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
purchaseLabels: async (shipmentId, body, options = {}) => {
// verify required parameter 'shipmentId' is not null or undefined
(0, common_1.assertParamExists)('purchaseLabels', 'shipmentId', shipmentId);
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('purchaseLabels', 'body', body);
const localVarPath = `/shipping/v1/shipments/{shipmentId}/purchaseLabels`
.replace(`{${"shipmentId"}}`, encodeURIComponent(String(shipmentId)));
// 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,
};
},
/**
* Purchase shipping labels. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {PurchaseShipmentRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
purchaseShipment: async (body, options = {}) => {
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('purchaseShipment', 'body', body);
const localVarPath = `/shipping/v1/purchaseShipment`;
// 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,
};
},
/**
* Retrieve shipping label based on the shipment id and tracking id. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {string} shipmentId
* @param {string} trackingId
* @param {RetrieveShippingLabelRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
retrieveShippingLabel: async (shipmentId, trackingId, body, options = {}) => {
// verify required parameter 'shipmentId' is not null or undefined
(0, common_1.assertParamExists)('retrieveShippingLabel', 'shipmentId', shipmentId);
// verify required parameter 'trackingId' is not null or undefined
(0, common_1.assertParamExists)('retrieveShippingLabel', 'trackingId', trackingId);
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('retrieveShippingLabel', 'body', body);
const localVarPath = `/shipping/v1/shipments/{shipmentId}/containers/{trackingId}/label`
.replace(`{${"shipmentId"}}`, encodeURIComponent(String(shipmentId)))
.replace(`{${"trackingId"}}`, encodeURIComponent(String(trackingId)));
// 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.ShippingApiAxiosParamCreator = ShippingApiAxiosParamCreator;
/**
* ShippingApi - functional programming interface
* @export
*/
const ShippingApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.ShippingApiAxiosParamCreator)(configuration);
return {
/**
* Cancel a shipment by the given shipmentId. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {string} shipmentId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async cancelShipment(shipmentId, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.cancelShipment(shipmentId, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Create a new shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).
* @param {CreateShipmentRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createShipment(body, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.createShipment(body, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Verify if the current account is valid. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getAccount(options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getAccount(options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Get service rates. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {GetRatesRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getRates(body, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getRates(body, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Return the entire shipment object for the shipmentId. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {string} shipmentId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getShipment(shipmentId, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getShipment(shipmentId, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Return the tracking information of a shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {string} trackingId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getTrackingInformation(trackingId, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getTrackingInformation(trackingId, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Purchase shipping labels based on a given rate. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {string} shipmentId
* @param {PurchaseLabelsRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async purchaseLabels(shipmentId, body, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.purchaseLabels(shipmentId, body, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Purchase shipping labels. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {PurchaseShipmentRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async purchaseShipment(body, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.purchaseShipment(body, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Retrieve shipping label based on the shipment id and tracking id. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {string} shipmentId
* @param {string} trackingId
* @param {RetrieveShippingLabelRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async retrieveShippingLabel(shipmentId, trackingId, body, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveShippingLabel(shipmentId, trackingId, body, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
};
};
exports.ShippingApiFp = ShippingApiFp;
/**
* ShippingApi - factory interface
* @export
*/
const ShippingApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.ShippingApiFp)(configuration);
return {
/**
* Cancel a shipment by the given shipmentId. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {string} shipmentId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
cancelShipment(shipmentId, options) {
return localVarFp.cancelShipment(shipmentId, options).then((request) => request(axios, basePath));
},
/**
* Create a new shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).
* @param {CreateShipmentRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createShipment(body, options) {
return localVarFp.createShipment(body, options).then((request) => request(axios, basePath));
},
/**
* Verify if the current account is valid. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAccount(options) {
return localVarFp.getAccount(options).then((request) => request(axios, basePath));
},
/**
* Get service rates. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {GetRatesRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getRates(body, options) {
return localVarFp.getRates(body, options).then((request) => request(axios, basePath));
},
/**
* Return the entire shipment object for the shipmentId. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {string} shipmentId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getShipment(shipmentId, options) {
return localVarFp.getShipment(shipmentId, options).then((request) => request(axios, basePath));
},
/**
* Return the tracking information of a shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {string} trackingId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getTrackingInformation(trackingId, options) {
return localVarFp.getTrackingInformation(trackingId, options).then((request) => request(axios, basePath));
},
/**
* Purchase shipping labels based on a given rate. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {string} shipmentId
* @param {PurchaseLabelsRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
purchaseLabels(shipmentId, body, options) {
return localVarFp.purchaseLabels(shipmentId, body, options).then((request) => request(axios, basePath));
},
/**
* Purchase shipping labels. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {PurchaseShipmentRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
purchaseShipment(body, options) {
return localVarFp.purchaseShipment(body, options).then((request) => request(axios, basePath));
},
/**
* Retrieve shipping label based on the shipment id and tracking id. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {string} shipmentId
* @param {string} trackingId
* @param {RetrieveShippingLabelRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
retrieveShippingLabel(shipmentId, trackingId, body, options) {
return localVarFp.retrieveShippingLabel(shipmentId, trackingId, body, options).then((request) => request(axios, basePath));
},
};
};
exports.ShippingApiFactory = ShippingApiFactory;
/**
* ShippingApi - object-oriented interface
* @export
* @class ShippingApi
* @extends {BaseAPI}
*/
class ShippingApi extends base_1.BaseAPI {
/**
* Cancel a shipment by the given shipmentId. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {ShippingApiCancelShipmentRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ShippingApi
*/
cancelShipment(requestParameters, options) {
return (0, exports.ShippingApiFp)(this.configuration).cancelShipment(requestParameters.shipmentId, options).then((request) => request(this.axios, this.basePath));
}
/**
* Create a new shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).
* @param {ShippingApiCreateShipmentRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ShippingApi
*/
createShipment(requestParameters, options) {
return (0, exports.ShippingApiFp)(this.configuration).createShipment(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
}
/**
* Verify if the current account is valid. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ShippingApi
*/
getAccount(options) {
return (0, exports.ShippingApiFp)(this.configuration).getAccount(options).then((request) => request(this.axios, this.basePath));
}
/**
* Get service rates. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {ShippingApiGetRatesRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ShippingApi
*/
getRates(requestParameters, options) {
return (0, exports.ShippingApiFp)(this.configuration).getRates(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
}
/**
* Return the entire shipment object for the shipmentId. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {ShippingApiGetShipmentRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ShippingApi
*/
getShipment(requestParameters, options) {
return (0, exports.ShippingApiFp)(this.configuration).getShipment(requestParameters.shipmentId, options).then((request) => request(this.axios, this.basePath));
}
/**
* Return the tracking information of a shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {ShippingApiGetTrackingInformationRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ShippingApi
*/
getTrackingInformation(requestParameters, options) {
return (0, exports.ShippingApiFp)(this.configuration).getTrackingInformation(requestParameters.trackingId, options).then((request) => request(this.axios, this.basePath));
}
/**
* Purchase shipping labels based on a given rate. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {ShippingApiPurchaseLabelsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ShippingApi
*/
purchaseLabels(requestParameters, options) {
return (0, exports.ShippingApiFp)(this.configuration).purchaseLabels(requestParameters.shipmentId, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
}
/**
* Purchase shipping labels. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {ShippingApiPurchaseShipmentRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ShippingApi
*/
purchaseShipment(requestParameters, options) {
return (0, exports.ShippingApiFp)(this.configuration).purchaseShipment(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
}
/**
* Retrieve shipping label based on the shipment id and tracking id. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 15 | For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {ShippingApiRetrieveShippingLabelRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ShippingApi
*/
retrieveShippingLabel(requestParameters, options) {
return (0, exports.ShippingApiFp)(this.configuration).retrieveShippingLabel(requestParameters.shipmentId, requestParameters.trackingId, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
}
}
exports.ShippingApi = ShippingApi;
//# sourceMappingURL=api.js.map