@sp-api-sdk/easy-ship-api-2022-03-23 4.3.12 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +7 -8
  2. package/dist/index.cjs +715 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +877 -0
  5. package/dist/index.d.ts +877 -0
  6. package/dist/index.js +680 -0
  7. package/dist/index.js.map +1 -0
  8. package/package.json +26 -12
  9. package/dist/cjs/api-model/api/easy-ship-api.js +0 -361
  10. package/dist/cjs/api-model/api.js +0 -30
  11. package/dist/cjs/api-model/base.js +0 -52
  12. package/dist/cjs/api-model/common.js +0 -123
  13. package/dist/cjs/api-model/configuration.js +0 -98
  14. package/dist/cjs/api-model/index.js +0 -32
  15. package/dist/cjs/api-model/models/code.js +0 -32
  16. package/dist/cjs/api-model/models/create-scheduled-package-request.js +0 -15
  17. package/dist/cjs/api-model/models/create-scheduled-packages-request.js +0 -15
  18. package/dist/cjs/api-model/models/create-scheduled-packages-response.js +0 -15
  19. package/dist/cjs/api-model/models/dimensions.js +0 -15
  20. package/dist/cjs/api-model/models/error-list.js +0 -15
  21. package/dist/cjs/api-model/models/handover-method.js +0 -23
  22. package/dist/cjs/api-model/models/index.js +0 -43
  23. package/dist/cjs/api-model/models/invoice-data.js +0 -15
  24. package/dist/cjs/api-model/models/item.js +0 -15
  25. package/dist/cjs/api-model/models/label-format.js +0 -23
  26. package/dist/cjs/api-model/models/list-handover-slots-request.js +0 -15
  27. package/dist/cjs/api-model/models/list-handover-slots-response.js +0 -15
  28. package/dist/cjs/api-model/models/model-error.js +0 -15
  29. package/dist/cjs/api-model/models/order-schedule-details.js +0 -15
  30. package/dist/cjs/api-model/models/package-details.js +0 -15
  31. package/dist/cjs/api-model/models/package-status.js +0 -33
  32. package/dist/cjs/api-model/models/package.js +0 -15
  33. package/dist/cjs/api-model/models/packages.js +0 -15
  34. package/dist/cjs/api-model/models/rejected-order.js +0 -15
  35. package/dist/cjs/api-model/models/scheduled-package-id.js +0 -15
  36. package/dist/cjs/api-model/models/time-slot.js +0 -15
  37. package/dist/cjs/api-model/models/tracking-details.js +0 -15
  38. package/dist/cjs/api-model/models/unit-of-length.js +0 -22
  39. package/dist/cjs/api-model/models/unit-of-weight.js +0 -23
  40. package/dist/cjs/api-model/models/update-package-details.js +0 -15
  41. package/dist/cjs/api-model/models/update-scheduled-packages-request.js +0 -15
  42. package/dist/cjs/api-model/models/weight.js +0 -15
  43. package/dist/cjs/client.js +0 -49
  44. package/dist/cjs/index.js +0 -19
  45. package/dist/es/api-model/api/easy-ship-api.js +0 -351
  46. package/dist/es/api-model/api.js +0 -14
  47. package/dist/es/api-model/base.js +0 -44
  48. package/dist/es/api-model/common.js +0 -110
  49. package/dist/es/api-model/configuration.js +0 -94
  50. package/dist/es/api-model/index.js +0 -16
  51. package/dist/es/api-model/models/code.js +0 -29
  52. package/dist/es/api-model/models/create-scheduled-package-request.js +0 -14
  53. package/dist/es/api-model/models/create-scheduled-packages-request.js +0 -14
  54. package/dist/es/api-model/models/create-scheduled-packages-response.js +0 -14
  55. package/dist/es/api-model/models/dimensions.js +0 -14
  56. package/dist/es/api-model/models/error-list.js +0 -14
  57. package/dist/es/api-model/models/handover-method.js +0 -20
  58. package/dist/es/api-model/models/index.js +0 -27
  59. package/dist/es/api-model/models/invoice-data.js +0 -14
  60. package/dist/es/api-model/models/item.js +0 -14
  61. package/dist/es/api-model/models/label-format.js +0 -20
  62. package/dist/es/api-model/models/list-handover-slots-request.js +0 -14
  63. package/dist/es/api-model/models/list-handover-slots-response.js +0 -14
  64. package/dist/es/api-model/models/model-error.js +0 -14
  65. package/dist/es/api-model/models/order-schedule-details.js +0 -14
  66. package/dist/es/api-model/models/package-details.js +0 -14
  67. package/dist/es/api-model/models/package-status.js +0 -30
  68. package/dist/es/api-model/models/package.js +0 -14
  69. package/dist/es/api-model/models/packages.js +0 -14
  70. package/dist/es/api-model/models/rejected-order.js +0 -14
  71. package/dist/es/api-model/models/scheduled-package-id.js +0 -14
  72. package/dist/es/api-model/models/time-slot.js +0 -14
  73. package/dist/es/api-model/models/tracking-details.js +0 -14
  74. package/dist/es/api-model/models/unit-of-length.js +0 -19
  75. package/dist/es/api-model/models/unit-of-weight.js +0 -20
  76. package/dist/es/api-model/models/update-package-details.js +0 -14
  77. package/dist/es/api-model/models/update-scheduled-packages-request.js +0 -14
  78. package/dist/es/api-model/models/weight.js +0 -14
  79. package/dist/es/client.js +0 -45
  80. package/dist/es/index.js +0 -3
  81. package/dist/types/api-model/api/easy-ship-api.d.ts +0 -234
  82. package/dist/types/api-model/api.d.ts +0 -12
  83. package/dist/types/api-model/base.d.ts +0 -42
  84. package/dist/types/api-model/common.d.ts +0 -34
  85. package/dist/types/api-model/configuration.d.ts +0 -98
  86. package/dist/types/api-model/index.d.ts +0 -14
  87. package/dist/types/api-model/models/code.d.ts +0 -28
  88. package/dist/types/api-model/models/create-scheduled-package-request.d.ts +0 -26
  89. package/dist/types/api-model/models/create-scheduled-packages-request.d.ts +0 -27
  90. package/dist/types/api-model/models/create-scheduled-packages-response.d.ts +0 -30
  91. package/dist/types/api-model/models/dimensions.d.ts +0 -34
  92. package/dist/types/api-model/models/error-list.d.ts +0 -20
  93. package/dist/types/api-model/models/handover-method.d.ts +0 -19
  94. package/dist/types/api-model/models/index.d.ts +0 -27
  95. package/dist/types/api-model/models/invoice-data.d.ts +0 -24
  96. package/dist/types/api-model/models/item.d.ts +0 -24
  97. package/dist/types/api-model/models/label-format.d.ts +0 -19
  98. package/dist/types/api-model/models/list-handover-slots-request.d.ts +0 -28
  99. package/dist/types/api-model/models/list-handover-slots-response.d.ts +0 -25
  100. package/dist/types/api-model/models/model-error.d.ts +0 -28
  101. package/dist/types/api-model/models/order-schedule-details.d.ts +0 -22
  102. package/dist/types/api-model/models/package-details.d.ts +0 -27
  103. package/dist/types/api-model/models/package-status.d.ts +0 -29
  104. package/dist/types/api-model/models/package.d.ts +0 -39
  105. package/dist/types/api-model/models/packages.d.ts +0 -21
  106. package/dist/types/api-model/models/rejected-order.d.ts +0 -21
  107. package/dist/types/api-model/models/scheduled-package-id.d.ts +0 -24
  108. package/dist/types/api-model/models/time-slot.d.ts +0 -30
  109. package/dist/types/api-model/models/tracking-details.d.ts +0 -20
  110. package/dist/types/api-model/models/unit-of-length.d.ts +0 -18
  111. package/dist/types/api-model/models/unit-of-weight.d.ts +0 -19
  112. package/dist/types/api-model/models/update-package-details.d.ts +0 -20
  113. package/dist/types/api-model/models/update-scheduled-packages-request.d.ts +0 -25
  114. package/dist/types/api-model/models/weight.d.ts +0 -22
  115. package/dist/types/client.d.ts +0 -6
  116. package/dist/types/index.d.ts +0 -3
package/dist/index.js ADDED
@@ -0,0 +1,680 @@
1
+ import { createAxiosInstance } from "@sp-api-sdk/common";
2
+ import globalAxios from "axios";
3
+ //#region src/api-model/base.ts
4
+ const BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
5
+ var BaseAPI = class {
6
+ basePath;
7
+ axios;
8
+ configuration;
9
+ constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
10
+ this.basePath = basePath;
11
+ this.axios = axios;
12
+ if (configuration) {
13
+ this.configuration = configuration;
14
+ this.basePath = configuration.basePath ?? basePath;
15
+ }
16
+ }
17
+ };
18
+ var RequiredError = class extends Error {
19
+ field;
20
+ constructor(field, msg) {
21
+ super(msg);
22
+ this.field = field;
23
+ this.name = "RequiredError";
24
+ }
25
+ };
26
+ const operationServerMap = {};
27
+ //#endregion
28
+ //#region src/api-model/common.ts
29
+ const DUMMY_BASE_URL = "https://example.com";
30
+ /**
31
+ *
32
+ * @throws {RequiredError}
33
+ */
34
+ const assertParamExists = function(functionName, paramName, paramValue) {
35
+ if (paramValue === null || paramValue === void 0) throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
36
+ };
37
+ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
38
+ if (parameter == null) return;
39
+ if (typeof parameter === "object") if (Array.isArray(parameter) || parameter instanceof Set) parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
40
+ else Object.keys(parameter).forEach((currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`));
41
+ else if (urlSearchParams.has(key)) urlSearchParams.append(key, parameter);
42
+ else urlSearchParams.set(key, parameter);
43
+ }
44
+ const setSearchParams = function(url, ...objects) {
45
+ const searchParams = new URLSearchParams(url.search);
46
+ setFlattenedQueryParams(searchParams, objects);
47
+ url.search = searchParams.toString();
48
+ };
49
+ /**
50
+ * JSON serialization helper function which replaces instances of unserializable types with serializable ones.
51
+ * This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
52
+ * Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
53
+ */
54
+ const replaceWithSerializableTypeIfNeeded = function(key, value) {
55
+ if (value instanceof Set) return Array.from(value);
56
+ else return value;
57
+ };
58
+ const serializeDataIfNeeded = function(value, requestOptions, configuration) {
59
+ const nonString = typeof value !== "string";
60
+ return (nonString && configuration && configuration.isJsonMime ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) : nonString) ? JSON.stringify(value !== void 0 ? value : {}, replaceWithSerializableTypeIfNeeded) : value || "";
61
+ };
62
+ const toPathString = function(url) {
63
+ return url.pathname + url.search + url.hash;
64
+ };
65
+ const createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, configuration) {
66
+ return (axios = globalAxios, basePath = BASE_PATH) => {
67
+ const axiosRequestArgs = {
68
+ ...axiosArgs.options,
69
+ url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url
70
+ };
71
+ return axios.request(axiosRequestArgs);
72
+ };
73
+ };
74
+ //#endregion
75
+ //#region src/api-model/api/easy-ship-api.ts
76
+ /**
77
+ * EasyShipApi - axios parameter creator
78
+ */
79
+ const EasyShipApiAxiosParamCreator = function(configuration) {
80
+ return {
81
+ /**
82
+ * Schedules an Easy Ship order and returns the scheduled package information. This operation does the following: * Specifies the time slot and handover method for the order to be scheduled for delivery. * Updates the Easy Ship order status. * Generates a shipping label and an invoice. Calling `createScheduledPackage` also generates a warranty document if you specify a `SerialNumber` value. To get these documents, see [How to get invoice, shipping label, and warranty documents](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide). * Shows the status of Easy Ship orders when you call the `getOrders` operation of the Selling Partner API for Orders and examine the `EasyShipShipmentStatus` property in the response body. See the **Shipping Label**, **Invoice**, and **Warranty** columns in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace. **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 table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
83
+ * @param {CreateScheduledPackageRequest} createScheduledPackageRequest The request schema for the `createScheduledPackage` operation.
84
+ * @param {*} [options] Override http request option.
85
+ * @throws {RequiredError}
86
+ */
87
+ createScheduledPackage: async (createScheduledPackageRequest, options = {}) => {
88
+ assertParamExists("createScheduledPackage", "createScheduledPackageRequest", createScheduledPackageRequest);
89
+ const localVarUrlObj = new URL(`/easyShip/2022-03-23/package`, DUMMY_BASE_URL);
90
+ let baseOptions;
91
+ if (configuration) baseOptions = configuration.baseOptions;
92
+ const localVarRequestOptions = {
93
+ method: "POST",
94
+ ...baseOptions,
95
+ ...options
96
+ };
97
+ const localVarHeaderParameter = {};
98
+ const localVarQueryParameter = {};
99
+ localVarHeaderParameter["Content-Type"] = "application/json";
100
+ localVarHeaderParameter["Accept"] = "application/json";
101
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
102
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
103
+ localVarRequestOptions.headers = {
104
+ ...localVarHeaderParameter,
105
+ ...headersFromBaseOptions,
106
+ ...options.headers
107
+ };
108
+ localVarRequestOptions.data = serializeDataIfNeeded(createScheduledPackageRequest, localVarRequestOptions, configuration);
109
+ return {
110
+ url: toPathString(localVarUrlObj),
111
+ options: localVarRequestOptions
112
+ };
113
+ },
114
+ /**
115
+ * This operation automatically schedules a time slot for all the `amazonOrderId`s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)). Developers calling this operation may optionally assign a `packageDetails` object, allowing them to input a preferred time slot for each order in ther request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will then pick the earliest time slot possible. Regarding the shipping label\'s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly. This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn\'t be scheduled, then Amazon adds the `rejectedOrders` list into the response, which contains an entry for each order we couldn\'t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action. The table below displays the supported request and burst maximum rates: **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 table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
116
+ * @param {CreateScheduledPackagesRequest} createScheduledPackagesRequest The request schema for the `createScheduledPackageBulk` operation.
117
+ * @param {*} [options] Override http request option.
118
+ * @throws {RequiredError}
119
+ */
120
+ createScheduledPackageBulk: async (createScheduledPackagesRequest, options = {}) => {
121
+ assertParamExists("createScheduledPackageBulk", "createScheduledPackagesRequest", createScheduledPackagesRequest);
122
+ const localVarUrlObj = new URL(`/easyShip/2022-03-23/packages/bulk`, DUMMY_BASE_URL);
123
+ let baseOptions;
124
+ if (configuration) baseOptions = configuration.baseOptions;
125
+ const localVarRequestOptions = {
126
+ method: "POST",
127
+ ...baseOptions,
128
+ ...options
129
+ };
130
+ const localVarHeaderParameter = {};
131
+ const localVarQueryParameter = {};
132
+ localVarHeaderParameter["Content-Type"] = "application/json";
133
+ localVarHeaderParameter["Accept"] = "application/json";
134
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
135
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
136
+ localVarRequestOptions.headers = {
137
+ ...localVarHeaderParameter,
138
+ ...headersFromBaseOptions,
139
+ ...options.headers
140
+ };
141
+ localVarRequestOptions.data = serializeDataIfNeeded(createScheduledPackagesRequest, localVarRequestOptions, configuration);
142
+ return {
143
+ url: toPathString(localVarUrlObj),
144
+ options: localVarRequestOptions
145
+ };
146
+ },
147
+ /**
148
+ * Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status. **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 table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
149
+ * @param {string} amazonOrderId An Amazon-defined order identifier. Identifies the order that the seller wants to deliver using Amazon Easy Ship.
150
+ * @param {string} marketplaceId An identifier for the marketplace in which the seller is selling.
151
+ * @param {*} [options] Override http request option.
152
+ * @throws {RequiredError}
153
+ */
154
+ getScheduledPackage: async (amazonOrderId, marketplaceId, options = {}) => {
155
+ assertParamExists("getScheduledPackage", "amazonOrderId", amazonOrderId);
156
+ assertParamExists("getScheduledPackage", "marketplaceId", marketplaceId);
157
+ const localVarUrlObj = new URL(`/easyShip/2022-03-23/package`, DUMMY_BASE_URL);
158
+ let baseOptions;
159
+ if (configuration) baseOptions = configuration.baseOptions;
160
+ const localVarRequestOptions = {
161
+ method: "GET",
162
+ ...baseOptions,
163
+ ...options
164
+ };
165
+ const localVarHeaderParameter = {};
166
+ const localVarQueryParameter = {};
167
+ if (amazonOrderId !== void 0) localVarQueryParameter["amazonOrderId"] = amazonOrderId;
168
+ if (marketplaceId !== void 0) localVarQueryParameter["marketplaceId"] = marketplaceId;
169
+ localVarHeaderParameter["Accept"] = "application/json";
170
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
171
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
172
+ localVarRequestOptions.headers = {
173
+ ...localVarHeaderParameter,
174
+ ...headersFromBaseOptions,
175
+ ...options.headers
176
+ };
177
+ return {
178
+ url: toPathString(localVarUrlObj),
179
+ options: localVarRequestOptions
180
+ };
181
+ },
182
+ /**
183
+ * Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies. This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). **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 table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
184
+ * @param {ListHandoverSlotsRequest} [listHandoverSlotsRequest] The request schema for the `listHandoverSlots` operation.
185
+ * @param {*} [options] Override http request option.
186
+ * @throws {RequiredError}
187
+ */
188
+ listHandoverSlots: async (listHandoverSlotsRequest, options = {}) => {
189
+ const localVarUrlObj = new URL(`/easyShip/2022-03-23/timeSlot`, DUMMY_BASE_URL);
190
+ let baseOptions;
191
+ if (configuration) baseOptions = configuration.baseOptions;
192
+ const localVarRequestOptions = {
193
+ method: "POST",
194
+ ...baseOptions,
195
+ ...options
196
+ };
197
+ const localVarHeaderParameter = {};
198
+ const localVarQueryParameter = {};
199
+ localVarHeaderParameter["Content-Type"] = "application/json";
200
+ localVarHeaderParameter["Accept"] = "application/json";
201
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
202
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
203
+ localVarRequestOptions.headers = {
204
+ ...localVarHeaderParameter,
205
+ ...headersFromBaseOptions,
206
+ ...options.headers
207
+ };
208
+ localVarRequestOptions.data = serializeDataIfNeeded(listHandoverSlotsRequest, localVarRequestOptions, configuration);
209
+ return {
210
+ url: toPathString(localVarUrlObj),
211
+ options: localVarRequestOptions
212
+ };
213
+ },
214
+ /**
215
+ * Updates the time slot for handing over the package indicated by the specified `scheduledPackageId`. You can get the new `slotId` value for the time slot by calling the `listHandoverSlots` operation before making another `patch` call. See the **Update Package** column in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in. **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 table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
216
+ * @param {UpdateScheduledPackagesRequest} [updateScheduledPackagesRequest] The request schema for the `updateScheduledPackages` operation.
217
+ * @param {*} [options] Override http request option.
218
+ * @throws {RequiredError}
219
+ */
220
+ updateScheduledPackages: async (updateScheduledPackagesRequest, options = {}) => {
221
+ const localVarUrlObj = new URL(`/easyShip/2022-03-23/package`, DUMMY_BASE_URL);
222
+ let baseOptions;
223
+ if (configuration) baseOptions = configuration.baseOptions;
224
+ const localVarRequestOptions = {
225
+ method: "PATCH",
226
+ ...baseOptions,
227
+ ...options
228
+ };
229
+ const localVarHeaderParameter = {};
230
+ const localVarQueryParameter = {};
231
+ localVarHeaderParameter["Content-Type"] = "application/json";
232
+ localVarHeaderParameter["Accept"] = "application/json";
233
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
234
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
235
+ localVarRequestOptions.headers = {
236
+ ...localVarHeaderParameter,
237
+ ...headersFromBaseOptions,
238
+ ...options.headers
239
+ };
240
+ localVarRequestOptions.data = serializeDataIfNeeded(updateScheduledPackagesRequest, localVarRequestOptions, configuration);
241
+ return {
242
+ url: toPathString(localVarUrlObj),
243
+ options: localVarRequestOptions
244
+ };
245
+ }
246
+ };
247
+ };
248
+ /**
249
+ * EasyShipApi - functional programming interface
250
+ */
251
+ const EasyShipApiFp = function(configuration) {
252
+ const localVarAxiosParamCreator = EasyShipApiAxiosParamCreator(configuration);
253
+ return {
254
+ /**
255
+ * Schedules an Easy Ship order and returns the scheduled package information. This operation does the following: * Specifies the time slot and handover method for the order to be scheduled for delivery. * Updates the Easy Ship order status. * Generates a shipping label and an invoice. Calling `createScheduledPackage` also generates a warranty document if you specify a `SerialNumber` value. To get these documents, see [How to get invoice, shipping label, and warranty documents](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide). * Shows the status of Easy Ship orders when you call the `getOrders` operation of the Selling Partner API for Orders and examine the `EasyShipShipmentStatus` property in the response body. See the **Shipping Label**, **Invoice**, and **Warranty** columns in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace. **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 table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
256
+ * @param {CreateScheduledPackageRequest} createScheduledPackageRequest The request schema for the `createScheduledPackage` operation.
257
+ * @param {*} [options] Override http request option.
258
+ * @throws {RequiredError}
259
+ */
260
+ async createScheduledPackage(createScheduledPackageRequest, options) {
261
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createScheduledPackage(createScheduledPackageRequest, options);
262
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
263
+ const localVarOperationServerBasePath = operationServerMap["EasyShipApi.createScheduledPackage"]?.[localVarOperationServerIndex]?.url;
264
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
265
+ },
266
+ /**
267
+ * This operation automatically schedules a time slot for all the `amazonOrderId`s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)). Developers calling this operation may optionally assign a `packageDetails` object, allowing them to input a preferred time slot for each order in ther request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will then pick the earliest time slot possible. Regarding the shipping label\'s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly. This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn\'t be scheduled, then Amazon adds the `rejectedOrders` list into the response, which contains an entry for each order we couldn\'t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action. The table below displays the supported request and burst maximum rates: **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 table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
268
+ * @param {CreateScheduledPackagesRequest} createScheduledPackagesRequest The request schema for the `createScheduledPackageBulk` operation.
269
+ * @param {*} [options] Override http request option.
270
+ * @throws {RequiredError}
271
+ */
272
+ async createScheduledPackageBulk(createScheduledPackagesRequest, options) {
273
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createScheduledPackageBulk(createScheduledPackagesRequest, options);
274
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
275
+ const localVarOperationServerBasePath = operationServerMap["EasyShipApi.createScheduledPackageBulk"]?.[localVarOperationServerIndex]?.url;
276
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
277
+ },
278
+ /**
279
+ * Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status. **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 table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
280
+ * @param {string} amazonOrderId An Amazon-defined order identifier. Identifies the order that the seller wants to deliver using Amazon Easy Ship.
281
+ * @param {string} marketplaceId An identifier for the marketplace in which the seller is selling.
282
+ * @param {*} [options] Override http request option.
283
+ * @throws {RequiredError}
284
+ */
285
+ async getScheduledPackage(amazonOrderId, marketplaceId, options) {
286
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getScheduledPackage(amazonOrderId, marketplaceId, options);
287
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
288
+ const localVarOperationServerBasePath = operationServerMap["EasyShipApi.getScheduledPackage"]?.[localVarOperationServerIndex]?.url;
289
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
290
+ },
291
+ /**
292
+ * Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies. This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). **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 table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
293
+ * @param {ListHandoverSlotsRequest} [listHandoverSlotsRequest] The request schema for the `listHandoverSlots` operation.
294
+ * @param {*} [options] Override http request option.
295
+ * @throws {RequiredError}
296
+ */
297
+ async listHandoverSlots(listHandoverSlotsRequest, options) {
298
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listHandoverSlots(listHandoverSlotsRequest, options);
299
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
300
+ const localVarOperationServerBasePath = operationServerMap["EasyShipApi.listHandoverSlots"]?.[localVarOperationServerIndex]?.url;
301
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
302
+ },
303
+ /**
304
+ * Updates the time slot for handing over the package indicated by the specified `scheduledPackageId`. You can get the new `slotId` value for the time slot by calling the `listHandoverSlots` operation before making another `patch` call. See the **Update Package** column in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in. **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 table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
305
+ * @param {UpdateScheduledPackagesRequest} [updateScheduledPackagesRequest] The request schema for the `updateScheduledPackages` operation.
306
+ * @param {*} [options] Override http request option.
307
+ * @throws {RequiredError}
308
+ */
309
+ async updateScheduledPackages(updateScheduledPackagesRequest, options) {
310
+ const localVarAxiosArgs = await localVarAxiosParamCreator.updateScheduledPackages(updateScheduledPackagesRequest, options);
311
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
312
+ const localVarOperationServerBasePath = operationServerMap["EasyShipApi.updateScheduledPackages"]?.[localVarOperationServerIndex]?.url;
313
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
314
+ }
315
+ };
316
+ };
317
+ /**
318
+ * EasyShipApi - factory interface
319
+ */
320
+ const EasyShipApiFactory = function(configuration, basePath, axios) {
321
+ const localVarFp = EasyShipApiFp(configuration);
322
+ return {
323
+ /**
324
+ * Schedules an Easy Ship order and returns the scheduled package information. This operation does the following: * Specifies the time slot and handover method for the order to be scheduled for delivery. * Updates the Easy Ship order status. * Generates a shipping label and an invoice. Calling `createScheduledPackage` also generates a warranty document if you specify a `SerialNumber` value. To get these documents, see [How to get invoice, shipping label, and warranty documents](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide). * Shows the status of Easy Ship orders when you call the `getOrders` operation of the Selling Partner API for Orders and examine the `EasyShipShipmentStatus` property in the response body. See the **Shipping Label**, **Invoice**, and **Warranty** columns in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace. **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 table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
325
+ * @param {EasyShipApiCreateScheduledPackageRequest} requestParameters Request parameters.
326
+ * @param {*} [options] Override http request option.
327
+ * @throws {RequiredError}
328
+ */
329
+ createScheduledPackage(requestParameters, options) {
330
+ return localVarFp.createScheduledPackage(requestParameters.createScheduledPackageRequest, options).then((request) => request(axios, basePath));
331
+ },
332
+ /**
333
+ * This operation automatically schedules a time slot for all the `amazonOrderId`s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)). Developers calling this operation may optionally assign a `packageDetails` object, allowing them to input a preferred time slot for each order in ther request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will then pick the earliest time slot possible. Regarding the shipping label\'s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly. This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn\'t be scheduled, then Amazon adds the `rejectedOrders` list into the response, which contains an entry for each order we couldn\'t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action. The table below displays the supported request and burst maximum rates: **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 table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
334
+ * @param {EasyShipApiCreateScheduledPackageBulkRequest} requestParameters Request parameters.
335
+ * @param {*} [options] Override http request option.
336
+ * @throws {RequiredError}
337
+ */
338
+ createScheduledPackageBulk(requestParameters, options) {
339
+ return localVarFp.createScheduledPackageBulk(requestParameters.createScheduledPackagesRequest, options).then((request) => request(axios, basePath));
340
+ },
341
+ /**
342
+ * Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status. **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 table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
343
+ * @param {EasyShipApiGetScheduledPackageRequest} requestParameters Request parameters.
344
+ * @param {*} [options] Override http request option.
345
+ * @throws {RequiredError}
346
+ */
347
+ getScheduledPackage(requestParameters, options) {
348
+ return localVarFp.getScheduledPackage(requestParameters.amazonOrderId, requestParameters.marketplaceId, options).then((request) => request(axios, basePath));
349
+ },
350
+ /**
351
+ * Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies. This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). **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 table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
352
+ * @param {EasyShipApiListHandoverSlotsRequest} requestParameters Request parameters.
353
+ * @param {*} [options] Override http request option.
354
+ * @throws {RequiredError}
355
+ */
356
+ listHandoverSlots(requestParameters = {}, options) {
357
+ return localVarFp.listHandoverSlots(requestParameters.listHandoverSlotsRequest, options).then((request) => request(axios, basePath));
358
+ },
359
+ /**
360
+ * Updates the time slot for handing over the package indicated by the specified `scheduledPackageId`. You can get the new `slotId` value for the time slot by calling the `listHandoverSlots` operation before making another `patch` call. See the **Update Package** column in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in. **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 table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
361
+ * @param {EasyShipApiUpdateScheduledPackagesRequest} requestParameters Request parameters.
362
+ * @param {*} [options] Override http request option.
363
+ * @throws {RequiredError}
364
+ */
365
+ updateScheduledPackages(requestParameters = {}, options) {
366
+ return localVarFp.updateScheduledPackages(requestParameters.updateScheduledPackagesRequest, options).then((request) => request(axios, basePath));
367
+ }
368
+ };
369
+ };
370
+ /**
371
+ * EasyShipApi - object-oriented interface
372
+ */
373
+ var EasyShipApi = class extends BaseAPI {
374
+ /**
375
+ * Schedules an Easy Ship order and returns the scheduled package information. This operation does the following: * Specifies the time slot and handover method for the order to be scheduled for delivery. * Updates the Easy Ship order status. * Generates a shipping label and an invoice. Calling `createScheduledPackage` also generates a warranty document if you specify a `SerialNumber` value. To get these documents, see [How to get invoice, shipping label, and warranty documents](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide). * Shows the status of Easy Ship orders when you call the `getOrders` operation of the Selling Partner API for Orders and examine the `EasyShipShipmentStatus` property in the response body. See the **Shipping Label**, **Invoice**, and **Warranty** columns in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace. **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 table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
376
+ * @param {EasyShipApiCreateScheduledPackageRequest} requestParameters Request parameters.
377
+ * @param {*} [options] Override http request option.
378
+ * @throws {RequiredError}
379
+ */
380
+ createScheduledPackage(requestParameters, options) {
381
+ return EasyShipApiFp(this.configuration).createScheduledPackage(requestParameters.createScheduledPackageRequest, options).then((request) => request(this.axios, this.basePath));
382
+ }
383
+ /**
384
+ * This operation automatically schedules a time slot for all the `amazonOrderId`s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)). Developers calling this operation may optionally assign a `packageDetails` object, allowing them to input a preferred time slot for each order in ther request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will then pick the earliest time slot possible. Regarding the shipping label\'s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly. This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn\'t be scheduled, then Amazon adds the `rejectedOrders` list into the response, which contains an entry for each order we couldn\'t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action. The table below displays the supported request and burst maximum rates: **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 table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
385
+ * @param {EasyShipApiCreateScheduledPackageBulkRequest} requestParameters Request parameters.
386
+ * @param {*} [options] Override http request option.
387
+ * @throws {RequiredError}
388
+ */
389
+ createScheduledPackageBulk(requestParameters, options) {
390
+ return EasyShipApiFp(this.configuration).createScheduledPackageBulk(requestParameters.createScheduledPackagesRequest, options).then((request) => request(this.axios, this.basePath));
391
+ }
392
+ /**
393
+ * Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status. **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 table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
394
+ * @param {EasyShipApiGetScheduledPackageRequest} requestParameters Request parameters.
395
+ * @param {*} [options] Override http request option.
396
+ * @throws {RequiredError}
397
+ */
398
+ getScheduledPackage(requestParameters, options) {
399
+ return EasyShipApiFp(this.configuration).getScheduledPackage(requestParameters.amazonOrderId, requestParameters.marketplaceId, options).then((request) => request(this.axios, this.basePath));
400
+ }
401
+ /**
402
+ * Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies. This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). **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 table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
403
+ * @param {EasyShipApiListHandoverSlotsRequest} requestParameters Request parameters.
404
+ * @param {*} [options] Override http request option.
405
+ * @throws {RequiredError}
406
+ */
407
+ listHandoverSlots(requestParameters = {}, options) {
408
+ return EasyShipApiFp(this.configuration).listHandoverSlots(requestParameters.listHandoverSlotsRequest, options).then((request) => request(this.axios, this.basePath));
409
+ }
410
+ /**
411
+ * Updates the time slot for handing over the package indicated by the specified `scheduledPackageId`. You can get the new `slotId` value for the time slot by calling the `listHandoverSlots` operation before making another `patch` call. See the **Update Package** column in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in. **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 table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
412
+ * @param {EasyShipApiUpdateScheduledPackagesRequest} requestParameters Request parameters.
413
+ * @param {*} [options] Override http request option.
414
+ * @throws {RequiredError}
415
+ */
416
+ updateScheduledPackages(requestParameters = {}, options) {
417
+ return EasyShipApiFp(this.configuration).updateScheduledPackages(requestParameters.updateScheduledPackagesRequest, options).then((request) => request(this.axios, this.basePath));
418
+ }
419
+ };
420
+ //#endregion
421
+ //#region src/api-model/configuration.ts
422
+ var Configuration = class {
423
+ /**
424
+ * parameter for apiKey security
425
+ * @param name security name
426
+ */
427
+ apiKey;
428
+ /**
429
+ * parameter for basic security
430
+ */
431
+ username;
432
+ /**
433
+ * parameter for basic security
434
+ */
435
+ password;
436
+ /**
437
+ * parameter for oauth2 security
438
+ * @param name security name
439
+ * @param scopes oauth2 scope
440
+ */
441
+ accessToken;
442
+ /**
443
+ * parameter for aws4 signature security
444
+ * @param {Object} AWS4Signature - AWS4 Signature security
445
+ * @param {string} options.region - aws region
446
+ * @param {string} options.service - name of the service.
447
+ * @param {string} credentials.accessKeyId - aws access key id
448
+ * @param {string} credentials.secretAccessKey - aws access key
449
+ * @param {string} credentials.sessionToken - aws session token
450
+ * @memberof Configuration
451
+ */
452
+ awsv4;
453
+ /**
454
+ * override base path
455
+ */
456
+ basePath;
457
+ /**
458
+ * override server index
459
+ */
460
+ serverIndex;
461
+ /**
462
+ * base options for axios calls
463
+ */
464
+ baseOptions;
465
+ /**
466
+ * The FormData constructor that will be used to create multipart form data
467
+ * requests. You can inject this here so that execution environments that
468
+ * do not support the FormData class can still run the generated client.
469
+ *
470
+ * @type {new () => FormData}
471
+ */
472
+ formDataCtor;
473
+ constructor(param = {}) {
474
+ this.apiKey = param.apiKey;
475
+ this.username = param.username;
476
+ this.password = param.password;
477
+ this.accessToken = param.accessToken;
478
+ this.awsv4 = param.awsv4;
479
+ this.basePath = param.basePath;
480
+ this.serverIndex = param.serverIndex;
481
+ this.baseOptions = {
482
+ ...param.baseOptions,
483
+ headers: { ...param.baseOptions?.headers }
484
+ };
485
+ this.formDataCtor = param.formDataCtor;
486
+ }
487
+ /**
488
+ * Check if the given MIME is a JSON MIME.
489
+ * JSON MIME examples:
490
+ * application/json
491
+ * application/json; charset=UTF8
492
+ * APPLICATION/JSON
493
+ * application/vnd.company+json
494
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
495
+ * @return True if the given MIME is JSON, false otherwise.
496
+ */
497
+ isJsonMime(mime) {
498
+ return mime !== null && /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i.test(mime);
499
+ }
500
+ };
501
+ //#endregion
502
+ //#region src/api-model/models/code.ts
503
+ /**
504
+ * Selling Partner API for Easy Ship
505
+ * Use the Selling Partner API for Easy Ship to build applications for sellers to manage and ship Amazon Easy Ship orders. With this API, you can get available time slots, schedule and reschedule Easy Ship orders, and print shipping labels, invoices, and warranties. To review the differences in Easy Ship operations by marketplace, refer to [Marketplace support](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support).
506
+ *
507
+ * The version of the OpenAPI document: 2022-03-23
508
+ *
509
+ *
510
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
511
+ * https://openapi-generator.tech
512
+ * Do not edit the class manually.
513
+ */
514
+ /**
515
+ * An error code that identifies the type of error that occurred. The error codes listed below are specific to the Easy Ship section.
516
+ */
517
+ const Code = {
518
+ InvalidInput: "InvalidInput",
519
+ InvalidTimeSlotId: "InvalidTimeSlotId",
520
+ ScheduledPackageAlreadyExists: "ScheduledPackageAlreadyExists",
521
+ ScheduleWindowExpired: "ScheduleWindowExpired",
522
+ RetryableAfterGettingNewSlots: "RetryableAfterGettingNewSlots",
523
+ TimeSlotNotAvailable: "TimeSlotNotAvailable",
524
+ ResourceNotFound: "ResourceNotFound",
525
+ InvalidOrderState: "InvalidOrderState",
526
+ RegionNotSupported: "RegionNotSupported",
527
+ OrderNotEligibleForRescheduling: "OrderNotEligibleForRescheduling",
528
+ InternalServerError: "InternalServerError"
529
+ };
530
+ //#endregion
531
+ //#region src/api-model/models/handover-method.ts
532
+ /**
533
+ * Selling Partner API for Easy Ship
534
+ * Use the Selling Partner API for Easy Ship to build applications for sellers to manage and ship Amazon Easy Ship orders. With this API, you can get available time slots, schedule and reschedule Easy Ship orders, and print shipping labels, invoices, and warranties. To review the differences in Easy Ship operations by marketplace, refer to [Marketplace support](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support).
535
+ *
536
+ * The version of the OpenAPI document: 2022-03-23
537
+ *
538
+ *
539
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
540
+ * https://openapi-generator.tech
541
+ * Do not edit the class manually.
542
+ */
543
+ /**
544
+ * Identifies the method by which a seller will hand a package over to Amazon Logistics.
545
+ */
546
+ const HandoverMethod = {
547
+ Pickup: "PICKUP",
548
+ Dropoff: "DROPOFF"
549
+ };
550
+ //#endregion
551
+ //#region src/api-model/models/label-format.ts
552
+ /**
553
+ * Selling Partner API for Easy Ship
554
+ * Use the Selling Partner API for Easy Ship to build applications for sellers to manage and ship Amazon Easy Ship orders. With this API, you can get available time slots, schedule and reschedule Easy Ship orders, and print shipping labels, invoices, and warranties. To review the differences in Easy Ship operations by marketplace, refer to [Marketplace support](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support).
555
+ *
556
+ * The version of the OpenAPI document: 2022-03-23
557
+ *
558
+ *
559
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
560
+ * https://openapi-generator.tech
561
+ * Do not edit the class manually.
562
+ */
563
+ /**
564
+ * The file format in which the shipping label will be created.
565
+ */
566
+ const LabelFormat = {
567
+ Pdf: "PDF",
568
+ Zpl: "ZPL"
569
+ };
570
+ //#endregion
571
+ //#region src/api-model/models/package-status.ts
572
+ /**
573
+ * Selling Partner API for Easy Ship
574
+ * Use the Selling Partner API for Easy Ship to build applications for sellers to manage and ship Amazon Easy Ship orders. With this API, you can get available time slots, schedule and reschedule Easy Ship orders, and print shipping labels, invoices, and warranties. To review the differences in Easy Ship operations by marketplace, refer to [Marketplace support](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support).
575
+ *
576
+ * The version of the OpenAPI document: 2022-03-23
577
+ *
578
+ *
579
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
580
+ * https://openapi-generator.tech
581
+ * Do not edit the class manually.
582
+ */
583
+ /**
584
+ * The status of the package.
585
+ */
586
+ const PackageStatus = {
587
+ ReadyForPickup: "ReadyForPickup",
588
+ PickedUp: "PickedUp",
589
+ AtOriginFc: "AtOriginFC",
590
+ AtDestinationFc: "AtDestinationFC",
591
+ Delivered: "Delivered",
592
+ Rejected: "Rejected",
593
+ Undeliverable: "Undeliverable",
594
+ ReturnedToSeller: "ReturnedToSeller",
595
+ LostInTransit: "LostInTransit",
596
+ LabelCanceled: "LabelCanceled",
597
+ DamagedInTransit: "DamagedInTransit",
598
+ OutForDelivery: "OutForDelivery"
599
+ };
600
+ //#endregion
601
+ //#region src/api-model/models/unit-of-length.ts
602
+ /**
603
+ * Selling Partner API for Easy Ship
604
+ * Use the Selling Partner API for Easy Ship to build applications for sellers to manage and ship Amazon Easy Ship orders. With this API, you can get available time slots, schedule and reschedule Easy Ship orders, and print shipping labels, invoices, and warranties. To review the differences in Easy Ship operations by marketplace, refer to [Marketplace support](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support).
605
+ *
606
+ * The version of the OpenAPI document: 2022-03-23
607
+ *
608
+ *
609
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
610
+ * https://openapi-generator.tech
611
+ * Do not edit the class manually.
612
+ */
613
+ /**
614
+ * The unit of measurement used to measure the length.
615
+ */
616
+ const UnitOfLength = { Cm: "cm" };
617
+ //#endregion
618
+ //#region src/api-model/models/unit-of-weight.ts
619
+ /**
620
+ * Selling Partner API for Easy Ship
621
+ * Use the Selling Partner API for Easy Ship to build applications for sellers to manage and ship Amazon Easy Ship orders. With this API, you can get available time slots, schedule and reschedule Easy Ship orders, and print shipping labels, invoices, and warranties. To review the differences in Easy Ship operations by marketplace, refer to [Marketplace support](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support).
622
+ *
623
+ * The version of the OpenAPI document: 2022-03-23
624
+ *
625
+ *
626
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
627
+ * https://openapi-generator.tech
628
+ * Do not edit the class manually.
629
+ */
630
+ /**
631
+ * The unit of measurement used to measure the weight.
632
+ */
633
+ const UnitOfWeight = {
634
+ Grams: "grams",
635
+ G: "g"
636
+ };
637
+ //#endregion
638
+ //#region src/client.ts
639
+ const clientRateLimits = [
640
+ {
641
+ method: "post",
642
+ urlRegex: /^\/easyShip\/2022\u{2D}03\u{2D}23\/timeSlot$/v,
643
+ rate: 1,
644
+ burst: 5
645
+ },
646
+ {
647
+ method: "get",
648
+ urlRegex: /^\/easyShip\/2022\u{2D}03\u{2D}23\/package$/v,
649
+ rate: 1,
650
+ burst: 5
651
+ },
652
+ {
653
+ method: "post",
654
+ urlRegex: /^\/easyShip\/2022\u{2D}03\u{2D}23\/package$/v,
655
+ rate: 1,
656
+ burst: 5
657
+ },
658
+ {
659
+ method: "patch",
660
+ urlRegex: /^\/easyShip\/2022\u{2D}03\u{2D}23\/package$/v,
661
+ rate: 1,
662
+ burst: 5
663
+ },
664
+ {
665
+ method: "post",
666
+ urlRegex: /^\/easyShip\/2022\u{2D}03\u{2D}23\/packages\/bulk$/v,
667
+ rate: 1,
668
+ burst: 5
669
+ }
670
+ ];
671
+ var EasyShipApiClient = class extends EasyShipApi {
672
+ constructor(configuration) {
673
+ const { axios, endpoint } = createAxiosInstance(configuration, clientRateLimits);
674
+ super(new Configuration(), endpoint, axios);
675
+ }
676
+ };
677
+ //#endregion
678
+ export { Code, EasyShipApi, EasyShipApiAxiosParamCreator, EasyShipApiClient, EasyShipApiFactory, EasyShipApiFp, HandoverMethod, LabelFormat, PackageStatus, UnitOfLength, UnitOfWeight, clientRateLimits };
679
+
680
+ //# sourceMappingURL=index.js.map