@sp-api-sdk/finances-transfers-api-2024-06-01 5.0.0 → 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.
package/dist/index.js CHANGED
@@ -1,366 +1,384 @@
1
- // src/client.ts
2
1
  import { createAxiosInstance } from "@sp-api-sdk/common";
3
-
4
- // src/api-model/api/finances-transfers-api.ts
5
- import globalAxios2 from "axios";
6
-
7
- // src/api-model/base.ts
8
2
  import globalAxios from "axios";
9
- var BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
10
- var COLLECTION_FORMATS = {
11
- csv: ",",
12
- ssv: " ",
13
- tsv: " ",
14
- pipes: "|"
3
+ //#region src/api-model/base.ts
4
+ const BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
5
+ const COLLECTION_FORMATS = {
6
+ csv: ",",
7
+ ssv: " ",
8
+ tsv: " ",
9
+ pipes: "|"
15
10
  };
16
11
  var BaseAPI = class {
17
- constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
18
- this.basePath = basePath;
19
- this.axios = axios;
20
- if (configuration) {
21
- this.configuration = configuration;
22
- this.basePath = configuration.basePath ?? basePath;
23
- }
24
- }
25
- basePath;
26
- axios;
27
- configuration;
12
+ basePath;
13
+ axios;
14
+ configuration;
15
+ constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
16
+ this.basePath = basePath;
17
+ this.axios = axios;
18
+ if (configuration) {
19
+ this.configuration = configuration;
20
+ this.basePath = configuration.basePath ?? basePath;
21
+ }
22
+ }
28
23
  };
29
24
  var RequiredError = class extends Error {
30
- constructor(field, msg) {
31
- super(msg);
32
- this.field = field;
33
- this.name = "RequiredError";
34
- }
35
- field;
25
+ field;
26
+ constructor(field, msg) {
27
+ super(msg);
28
+ this.field = field;
29
+ this.name = "RequiredError";
30
+ }
36
31
  };
37
- var operationServerMap = {};
38
-
39
- // src/api-model/common.ts
40
- var DUMMY_BASE_URL = "https://example.com";
41
- var assertParamExists = function(functionName, paramName, paramValue) {
42
- if (paramValue === null || paramValue === void 0) {
43
- throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
44
- }
32
+ const operationServerMap = {};
33
+ //#endregion
34
+ //#region src/api-model/common.ts
35
+ const DUMMY_BASE_URL = "https://example.com";
36
+ /**
37
+ *
38
+ * @throws {RequiredError}
39
+ */
40
+ const assertParamExists = function(functionName, paramName, paramValue) {
41
+ if (paramValue === null || paramValue === void 0) throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
45
42
  };
46
43
  function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
47
- if (parameter == null) return;
48
- if (typeof parameter === "object") {
49
- if (Array.isArray(parameter) || parameter instanceof Set) {
50
- parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
51
- } else {
52
- Object.keys(parameter).forEach(
53
- (currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`)
54
- );
55
- }
56
- } else {
57
- if (urlSearchParams.has(key)) {
58
- urlSearchParams.append(key, parameter);
59
- } else {
60
- urlSearchParams.set(key, parameter);
61
- }
62
- }
44
+ if (parameter == null) return;
45
+ if (typeof parameter === "object") if (Array.isArray(parameter) || parameter instanceof Set) parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
46
+ else Object.keys(parameter).forEach((currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`));
47
+ else if (urlSearchParams.has(key)) urlSearchParams.append(key, parameter);
48
+ else urlSearchParams.set(key, parameter);
63
49
  }
64
- var setSearchParams = function(url, ...objects) {
65
- const searchParams = new URLSearchParams(url.search);
66
- setFlattenedQueryParams(searchParams, objects);
67
- url.search = searchParams.toString();
50
+ const setSearchParams = function(url, ...objects) {
51
+ const searchParams = new URLSearchParams(url.search);
52
+ setFlattenedQueryParams(searchParams, objects);
53
+ url.search = searchParams.toString();
68
54
  };
69
- var replaceWithSerializableTypeIfNeeded = function(key, value) {
70
- if (value instanceof Set) {
71
- return Array.from(value);
72
- } else {
73
- return value;
74
- }
55
+ /**
56
+ * JSON serialization helper function which replaces instances of unserializable types with serializable ones.
57
+ * This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
58
+ * Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
59
+ */
60
+ const replaceWithSerializableTypeIfNeeded = function(key, value) {
61
+ if (value instanceof Set) return Array.from(value);
62
+ else return value;
75
63
  };
76
- var serializeDataIfNeeded = function(value, requestOptions, configuration) {
77
- const nonString = typeof value !== "string";
78
- const needsSerialization = nonString && configuration && configuration.isJsonMime ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) : nonString;
79
- return needsSerialization ? JSON.stringify(value !== void 0 ? value : {}, replaceWithSerializableTypeIfNeeded) : value || "";
64
+ const serializeDataIfNeeded = function(value, requestOptions, configuration) {
65
+ const nonString = typeof value !== "string";
66
+ return (nonString && configuration && configuration.isJsonMime ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) : nonString) ? JSON.stringify(value !== void 0 ? value : {}, replaceWithSerializableTypeIfNeeded) : value || "";
80
67
  };
81
- var toPathString = function(url) {
82
- return url.pathname + url.search + url.hash;
68
+ const toPathString = function(url) {
69
+ return url.pathname + url.search + url.hash;
83
70
  };
84
- var createRequestFunction = function(axiosArgs, globalAxios3, BASE_PATH2, configuration) {
85
- return (axios = globalAxios3, basePath = BASE_PATH2) => {
86
- const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url };
87
- return axios.request(axiosRequestArgs);
88
- };
71
+ const createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, configuration) {
72
+ return (axios = globalAxios, basePath = BASE_PATH) => {
73
+ const axiosRequestArgs = {
74
+ ...axiosArgs.options,
75
+ url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url
76
+ };
77
+ return axios.request(axiosRequestArgs);
78
+ };
89
79
  };
90
-
91
- // src/api-model/api/finances-transfers-api.ts
92
- var FinancesTransfersApiAxiosParamCreator = function(configuration) {
93
- return {
94
- /**
95
- * Returns the list of payment methods for the seller, which can be filtered by method type. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | .5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
96
- * @param {string} marketplaceId The identifier of the marketplace from which you want to retrieve payment methods. For the list of possible marketplace identifiers, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
97
- * @param {Set<GetPaymentMethodsPaymentMethodTypesEnum>} [paymentMethodTypes] A comma-separated list of the payment method types you want to include in the response.
98
- * @param {*} [options] Override http request option.
99
- * @throws {RequiredError}
100
- */
101
- getPaymentMethods: async (marketplaceId, paymentMethodTypes, options = {}) => {
102
- assertParamExists("getPaymentMethods", "marketplaceId", marketplaceId);
103
- const localVarPath = `/finances/transfers/2024-06-01/paymentMethods`;
104
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
105
- let baseOptions;
106
- if (configuration) {
107
- baseOptions = configuration.baseOptions;
108
- }
109
- const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
110
- const localVarHeaderParameter = {};
111
- const localVarQueryParameter = {};
112
- if (marketplaceId !== void 0) {
113
- localVarQueryParameter["marketplaceId"] = marketplaceId;
114
- }
115
- if (paymentMethodTypes) {
116
- localVarQueryParameter["paymentMethodTypes"] = Array.from(paymentMethodTypes).join(COLLECTION_FORMATS.csv);
117
- }
118
- localVarHeaderParameter["Accept"] = "application/json";
119
- setSearchParams(localVarUrlObj, localVarQueryParameter);
120
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
121
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
122
- return {
123
- url: toPathString(localVarUrlObj),
124
- options: localVarRequestOptions
125
- };
126
- },
127
- /**
128
- * Initiates an on-demand payout to the seller\'s default deposit method in Seller Central for the given `marketplaceId` and `accountType`, if eligible. You can only initiate one on-demand payout for each marketplace and account type within a 24-hour period. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.017 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
129
- * @param {InitiatePayoutRequest} body The request body for the &#x60;initiatePayout&#x60; operation.
130
- * @param {*} [options] Override http request option.
131
- * @throws {RequiredError}
132
- */
133
- initiatePayout: async (body, options = {}) => {
134
- assertParamExists("initiatePayout", "body", body);
135
- const localVarPath = `/finances/transfers/2024-06-01/payouts`;
136
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
137
- let baseOptions;
138
- if (configuration) {
139
- baseOptions = configuration.baseOptions;
140
- }
141
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
142
- const localVarHeaderParameter = {};
143
- const localVarQueryParameter = {};
144
- localVarHeaderParameter["Content-Type"] = "application/json";
145
- localVarHeaderParameter["Accept"] = "application/json";
146
- setSearchParams(localVarUrlObj, localVarQueryParameter);
147
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
148
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
149
- localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
150
- return {
151
- url: toPathString(localVarUrlObj),
152
- options: localVarRequestOptions
153
- };
154
- }
155
- };
80
+ //#endregion
81
+ //#region src/api-model/api/finances-transfers-api.ts
82
+ /**
83
+ * FinancesTransfersApi - axios parameter creator
84
+ */
85
+ const FinancesTransfersApiAxiosParamCreator = function(configuration) {
86
+ return {
87
+ /**
88
+ * Returns the list of payment methods for the seller, which can be filtered by method type. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | .5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
89
+ * @param {string} marketplaceId The identifier of the marketplace from which you want to retrieve payment methods. For the list of possible marketplace identifiers, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
90
+ * @param {Set<GetPaymentMethodsPaymentMethodTypesEnum>} [paymentMethodTypes] A comma-separated list of the payment method types you want to include in the response.
91
+ * @param {*} [options] Override http request option.
92
+ * @throws {RequiredError}
93
+ */
94
+ getPaymentMethods: async (marketplaceId, paymentMethodTypes, options = {}) => {
95
+ assertParamExists("getPaymentMethods", "marketplaceId", marketplaceId);
96
+ const localVarUrlObj = new URL(`/finances/transfers/2024-06-01/paymentMethods`, DUMMY_BASE_URL);
97
+ let baseOptions;
98
+ if (configuration) baseOptions = configuration.baseOptions;
99
+ const localVarRequestOptions = {
100
+ method: "GET",
101
+ ...baseOptions,
102
+ ...options
103
+ };
104
+ const localVarHeaderParameter = {};
105
+ const localVarQueryParameter = {};
106
+ if (marketplaceId !== void 0) localVarQueryParameter["marketplaceId"] = marketplaceId;
107
+ if (paymentMethodTypes) localVarQueryParameter["paymentMethodTypes"] = Array.from(paymentMethodTypes).join(COLLECTION_FORMATS.csv);
108
+ localVarHeaderParameter["Accept"] = "application/json";
109
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
110
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
111
+ localVarRequestOptions.headers = {
112
+ ...localVarHeaderParameter,
113
+ ...headersFromBaseOptions,
114
+ ...options.headers
115
+ };
116
+ return {
117
+ url: toPathString(localVarUrlObj),
118
+ options: localVarRequestOptions
119
+ };
120
+ },
121
+ /**
122
+ * Initiates an on-demand payout to the seller\'s default deposit method in Seller Central for the given `marketplaceId` and `accountType`, if eligible. You can only initiate one on-demand payout for each marketplace and account type within a 24-hour period. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.017 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
123
+ * @param {InitiatePayoutRequest} body The request body for the &#x60;initiatePayout&#x60; operation.
124
+ * @param {*} [options] Override http request option.
125
+ * @throws {RequiredError}
126
+ */
127
+ initiatePayout: async (body, options = {}) => {
128
+ assertParamExists("initiatePayout", "body", body);
129
+ const localVarUrlObj = new URL(`/finances/transfers/2024-06-01/payouts`, DUMMY_BASE_URL);
130
+ let baseOptions;
131
+ if (configuration) baseOptions = configuration.baseOptions;
132
+ const localVarRequestOptions = {
133
+ method: "POST",
134
+ ...baseOptions,
135
+ ...options
136
+ };
137
+ const localVarHeaderParameter = {};
138
+ const localVarQueryParameter = {};
139
+ localVarHeaderParameter["Content-Type"] = "application/json";
140
+ localVarHeaderParameter["Accept"] = "application/json";
141
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
142
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
143
+ localVarRequestOptions.headers = {
144
+ ...localVarHeaderParameter,
145
+ ...headersFromBaseOptions,
146
+ ...options.headers
147
+ };
148
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
149
+ return {
150
+ url: toPathString(localVarUrlObj),
151
+ options: localVarRequestOptions
152
+ };
153
+ }
154
+ };
156
155
  };
157
- var FinancesTransfersApiFp = function(configuration) {
158
- const localVarAxiosParamCreator = FinancesTransfersApiAxiosParamCreator(configuration);
159
- return {
160
- /**
161
- * Returns the list of payment methods for the seller, which can be filtered by method type. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | .5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
162
- * @param {string} marketplaceId The identifier of the marketplace from which you want to retrieve payment methods. For the list of possible marketplace identifiers, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
163
- * @param {Set<GetPaymentMethodsPaymentMethodTypesEnum>} [paymentMethodTypes] A comma-separated list of the payment method types you want to include in the response.
164
- * @param {*} [options] Override http request option.
165
- * @throws {RequiredError}
166
- */
167
- async getPaymentMethods(marketplaceId, paymentMethodTypes, options) {
168
- const localVarAxiosArgs = await localVarAxiosParamCreator.getPaymentMethods(marketplaceId, paymentMethodTypes, options);
169
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
170
- const localVarOperationServerBasePath = operationServerMap["FinancesTransfersApi.getPaymentMethods"]?.[localVarOperationServerIndex]?.url;
171
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
172
- },
173
- /**
174
- * Initiates an on-demand payout to the seller\'s default deposit method in Seller Central for the given `marketplaceId` and `accountType`, if eligible. You can only initiate one on-demand payout for each marketplace and account type within a 24-hour period. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.017 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
175
- * @param {InitiatePayoutRequest} body The request body for the &#x60;initiatePayout&#x60; operation.
176
- * @param {*} [options] Override http request option.
177
- * @throws {RequiredError}
178
- */
179
- async initiatePayout(body, options) {
180
- const localVarAxiosArgs = await localVarAxiosParamCreator.initiatePayout(body, options);
181
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
182
- const localVarOperationServerBasePath = operationServerMap["FinancesTransfersApi.initiatePayout"]?.[localVarOperationServerIndex]?.url;
183
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
184
- }
185
- };
156
+ /**
157
+ * FinancesTransfersApi - functional programming interface
158
+ */
159
+ const FinancesTransfersApiFp = function(configuration) {
160
+ const localVarAxiosParamCreator = FinancesTransfersApiAxiosParamCreator(configuration);
161
+ return {
162
+ /**
163
+ * Returns the list of payment methods for the seller, which can be filtered by method type. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | .5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
164
+ * @param {string} marketplaceId The identifier of the marketplace from which you want to retrieve payment methods. For the list of possible marketplace identifiers, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
165
+ * @param {Set<GetPaymentMethodsPaymentMethodTypesEnum>} [paymentMethodTypes] A comma-separated list of the payment method types you want to include in the response.
166
+ * @param {*} [options] Override http request option.
167
+ * @throws {RequiredError}
168
+ */
169
+ async getPaymentMethods(marketplaceId, paymentMethodTypes, options) {
170
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getPaymentMethods(marketplaceId, paymentMethodTypes, options);
171
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
172
+ const localVarOperationServerBasePath = operationServerMap["FinancesTransfersApi.getPaymentMethods"]?.[localVarOperationServerIndex]?.url;
173
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
174
+ },
175
+ /**
176
+ * Initiates an on-demand payout to the seller\'s default deposit method in Seller Central for the given `marketplaceId` and `accountType`, if eligible. You can only initiate one on-demand payout for each marketplace and account type within a 24-hour period. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.017 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
177
+ * @param {InitiatePayoutRequest} body The request body for the &#x60;initiatePayout&#x60; operation.
178
+ * @param {*} [options] Override http request option.
179
+ * @throws {RequiredError}
180
+ */
181
+ async initiatePayout(body, options) {
182
+ const localVarAxiosArgs = await localVarAxiosParamCreator.initiatePayout(body, options);
183
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
184
+ const localVarOperationServerBasePath = operationServerMap["FinancesTransfersApi.initiatePayout"]?.[localVarOperationServerIndex]?.url;
185
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
186
+ }
187
+ };
186
188
  };
187
- var FinancesTransfersApiFactory = function(configuration, basePath, axios) {
188
- const localVarFp = FinancesTransfersApiFp(configuration);
189
- return {
190
- /**
191
- * Returns the list of payment methods for the seller, which can be filtered by method type. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | .5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
192
- * @param {FinancesTransfersApiGetPaymentMethodsRequest} requestParameters Request parameters.
193
- * @param {*} [options] Override http request option.
194
- * @throws {RequiredError}
195
- */
196
- getPaymentMethods(requestParameters, options) {
197
- return localVarFp.getPaymentMethods(requestParameters.marketplaceId, requestParameters.paymentMethodTypes, options).then((request) => request(axios, basePath));
198
- },
199
- /**
200
- * Initiates an on-demand payout to the seller\'s default deposit method in Seller Central for the given `marketplaceId` and `accountType`, if eligible. You can only initiate one on-demand payout for each marketplace and account type within a 24-hour period. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.017 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
201
- * @param {FinancesTransfersApiInitiatePayoutRequest} requestParameters Request parameters.
202
- * @param {*} [options] Override http request option.
203
- * @throws {RequiredError}
204
- */
205
- initiatePayout(requestParameters, options) {
206
- return localVarFp.initiatePayout(requestParameters.body, options).then((request) => request(axios, basePath));
207
- }
208
- };
189
+ /**
190
+ * FinancesTransfersApi - factory interface
191
+ */
192
+ const FinancesTransfersApiFactory = function(configuration, basePath, axios) {
193
+ const localVarFp = FinancesTransfersApiFp(configuration);
194
+ return {
195
+ /**
196
+ * Returns the list of payment methods for the seller, which can be filtered by method type. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | .5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
197
+ * @param {FinancesTransfersApiGetPaymentMethodsRequest} requestParameters Request parameters.
198
+ * @param {*} [options] Override http request option.
199
+ * @throws {RequiredError}
200
+ */
201
+ getPaymentMethods(requestParameters, options) {
202
+ return localVarFp.getPaymentMethods(requestParameters.marketplaceId, requestParameters.paymentMethodTypes, options).then((request) => request(axios, basePath));
203
+ },
204
+ /**
205
+ * Initiates an on-demand payout to the seller\'s default deposit method in Seller Central for the given `marketplaceId` and `accountType`, if eligible. You can only initiate one on-demand payout for each marketplace and account type within a 24-hour period. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.017 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
206
+ * @param {FinancesTransfersApiInitiatePayoutRequest} requestParameters Request parameters.
207
+ * @param {*} [options] Override http request option.
208
+ * @throws {RequiredError}
209
+ */
210
+ initiatePayout(requestParameters, options) {
211
+ return localVarFp.initiatePayout(requestParameters.body, options).then((request) => request(axios, basePath));
212
+ }
213
+ };
209
214
  };
215
+ /**
216
+ * FinancesTransfersApi - object-oriented interface
217
+ */
210
218
  var FinancesTransfersApi = class extends BaseAPI {
211
- /**
212
- * Returns the list of payment methods for the seller, which can be filtered by method type. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | .5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
213
- * @param {FinancesTransfersApiGetPaymentMethodsRequest} requestParameters Request parameters.
214
- * @param {*} [options] Override http request option.
215
- * @throws {RequiredError}
216
- */
217
- getPaymentMethods(requestParameters, options) {
218
- return FinancesTransfersApiFp(this.configuration).getPaymentMethods(requestParameters.marketplaceId, requestParameters.paymentMethodTypes, options).then((request) => request(this.axios, this.basePath));
219
- }
220
- /**
221
- * Initiates an on-demand payout to the seller\'s default deposit method in Seller Central for the given `marketplaceId` and `accountType`, if eligible. You can only initiate one on-demand payout for each marketplace and account type within a 24-hour period. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.017 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
222
- * @param {FinancesTransfersApiInitiatePayoutRequest} requestParameters Request parameters.
223
- * @param {*} [options] Override http request option.
224
- * @throws {RequiredError}
225
- */
226
- initiatePayout(requestParameters, options) {
227
- return FinancesTransfersApiFp(this.configuration).initiatePayout(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
228
- }
219
+ /**
220
+ * Returns the list of payment methods for the seller, which can be filtered by method type. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | .5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
221
+ * @param {FinancesTransfersApiGetPaymentMethodsRequest} requestParameters Request parameters.
222
+ * @param {*} [options] Override http request option.
223
+ * @throws {RequiredError}
224
+ */
225
+ getPaymentMethods(requestParameters, options) {
226
+ return FinancesTransfersApiFp(this.configuration).getPaymentMethods(requestParameters.marketplaceId, requestParameters.paymentMethodTypes, options).then((request) => request(this.axios, this.basePath));
227
+ }
228
+ /**
229
+ * Initiates an on-demand payout to the seller\'s default deposit method in Seller Central for the given `marketplaceId` and `accountType`, if eligible. You can only initiate one on-demand payout for each marketplace and account type within a 24-hour period. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.017 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
230
+ * @param {FinancesTransfersApiInitiatePayoutRequest} requestParameters Request parameters.
231
+ * @param {*} [options] Override http request option.
232
+ * @throws {RequiredError}
233
+ */
234
+ initiatePayout(requestParameters, options) {
235
+ return FinancesTransfersApiFp(this.configuration).initiatePayout(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
236
+ }
229
237
  };
230
- var GetPaymentMethodsPaymentMethodTypesEnum = {
231
- BankAccount: "BANK_ACCOUNT",
232
- Card: "CARD",
233
- SellerWallet: "SELLER_WALLET"
238
+ const GetPaymentMethodsPaymentMethodTypesEnum = {
239
+ BankAccount: "BANK_ACCOUNT",
240
+ Card: "CARD",
241
+ SellerWallet: "SELLER_WALLET"
234
242
  };
235
-
236
- // src/api-model/configuration.ts
243
+ //#endregion
244
+ //#region src/api-model/configuration.ts
237
245
  var Configuration = class {
238
- /**
239
- * parameter for apiKey security
240
- * @param name security name
241
- */
242
- apiKey;
243
- /**
244
- * parameter for basic security
245
- */
246
- username;
247
- /**
248
- * parameter for basic security
249
- */
250
- password;
251
- /**
252
- * parameter for oauth2 security
253
- * @param name security name
254
- * @param scopes oauth2 scope
255
- */
256
- accessToken;
257
- /**
258
- * parameter for aws4 signature security
259
- * @param {Object} AWS4Signature - AWS4 Signature security
260
- * @param {string} options.region - aws region
261
- * @param {string} options.service - name of the service.
262
- * @param {string} credentials.accessKeyId - aws access key id
263
- * @param {string} credentials.secretAccessKey - aws access key
264
- * @param {string} credentials.sessionToken - aws session token
265
- * @memberof Configuration
266
- */
267
- awsv4;
268
- /**
269
- * override base path
270
- */
271
- basePath;
272
- /**
273
- * override server index
274
- */
275
- serverIndex;
276
- /**
277
- * base options for axios calls
278
- */
279
- baseOptions;
280
- /**
281
- * The FormData constructor that will be used to create multipart form data
282
- * requests. You can inject this here so that execution environments that
283
- * do not support the FormData class can still run the generated client.
284
- *
285
- * @type {new () => FormData}
286
- */
287
- formDataCtor;
288
- constructor(param = {}) {
289
- this.apiKey = param.apiKey;
290
- this.username = param.username;
291
- this.password = param.password;
292
- this.accessToken = param.accessToken;
293
- this.awsv4 = param.awsv4;
294
- this.basePath = param.basePath;
295
- this.serverIndex = param.serverIndex;
296
- this.baseOptions = {
297
- ...param.baseOptions,
298
- headers: {
299
- ...param.baseOptions?.headers
300
- }
301
- };
302
- this.formDataCtor = param.formDataCtor;
303
- }
304
- /**
305
- * Check if the given MIME is a JSON MIME.
306
- * JSON MIME examples:
307
- * application/json
308
- * application/json; charset=UTF8
309
- * APPLICATION/JSON
310
- * application/vnd.company+json
311
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
312
- * @return True if the given MIME is JSON, false otherwise.
313
- */
314
- isJsonMime(mime) {
315
- const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
316
- return mime !== null && jsonMime.test(mime);
317
- }
246
+ /**
247
+ * parameter for apiKey security
248
+ * @param name security name
249
+ */
250
+ apiKey;
251
+ /**
252
+ * parameter for basic security
253
+ */
254
+ username;
255
+ /**
256
+ * parameter for basic security
257
+ */
258
+ password;
259
+ /**
260
+ * parameter for oauth2 security
261
+ * @param name security name
262
+ * @param scopes oauth2 scope
263
+ */
264
+ accessToken;
265
+ /**
266
+ * parameter for aws4 signature security
267
+ * @param {Object} AWS4Signature - AWS4 Signature security
268
+ * @param {string} options.region - aws region
269
+ * @param {string} options.service - name of the service.
270
+ * @param {string} credentials.accessKeyId - aws access key id
271
+ * @param {string} credentials.secretAccessKey - aws access key
272
+ * @param {string} credentials.sessionToken - aws session token
273
+ * @memberof Configuration
274
+ */
275
+ awsv4;
276
+ /**
277
+ * override base path
278
+ */
279
+ basePath;
280
+ /**
281
+ * override server index
282
+ */
283
+ serverIndex;
284
+ /**
285
+ * base options for axios calls
286
+ */
287
+ baseOptions;
288
+ /**
289
+ * The FormData constructor that will be used to create multipart form data
290
+ * requests. You can inject this here so that execution environments that
291
+ * do not support the FormData class can still run the generated client.
292
+ *
293
+ * @type {new () => FormData}
294
+ */
295
+ formDataCtor;
296
+ constructor(param = {}) {
297
+ this.apiKey = param.apiKey;
298
+ this.username = param.username;
299
+ this.password = param.password;
300
+ this.accessToken = param.accessToken;
301
+ this.awsv4 = param.awsv4;
302
+ this.basePath = param.basePath;
303
+ this.serverIndex = param.serverIndex;
304
+ this.baseOptions = {
305
+ ...param.baseOptions,
306
+ headers: { ...param.baseOptions?.headers }
307
+ };
308
+ this.formDataCtor = param.formDataCtor;
309
+ }
310
+ /**
311
+ * Check if the given MIME is a JSON MIME.
312
+ * JSON MIME examples:
313
+ * application/json
314
+ * application/json; charset=UTF8
315
+ * APPLICATION/JSON
316
+ * application/vnd.company+json
317
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
318
+ * @return True if the given MIME is JSON, false otherwise.
319
+ */
320
+ isJsonMime(mime) {
321
+ return mime !== null && /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i.test(mime);
322
+ }
318
323
  };
319
-
320
- // src/api-model/models/assignment-type.ts
321
- var AssignmentType = {
322
- DefaultDepositMethod: "DEFAULT_DEPOSIT_METHOD"
324
+ //#endregion
325
+ //#region src/api-model/models/assignment-type.ts
326
+ /**
327
+ * The Selling Partner API for Transfers.
328
+ * The Selling Partner API for Transfers enables selling partners to retrieve payment methods and initiate payouts for their seller accounts. This API supports the following marketplaces: DE, FR, IT, ES, SE, NL, PL, and BE.
329
+ *
330
+ * The version of the OpenAPI document: 2024-06-01
331
+ *
332
+ *
333
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
334
+ * https://openapi-generator.tech
335
+ * Do not edit the class manually.
336
+ */
337
+ /**
338
+ * The default payment method type.
339
+ */
340
+ const AssignmentType = { DefaultDepositMethod: "DEFAULT_DEPOSIT_METHOD" };
341
+ //#endregion
342
+ //#region src/api-model/models/payment-method-type.ts
343
+ /**
344
+ * The Selling Partner API for Transfers.
345
+ * The Selling Partner API for Transfers enables selling partners to retrieve payment methods and initiate payouts for their seller accounts. This API supports the following marketplaces: DE, FR, IT, ES, SE, NL, PL, and BE.
346
+ *
347
+ * The version of the OpenAPI document: 2024-06-01
348
+ *
349
+ *
350
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
351
+ * https://openapi-generator.tech
352
+ * Do not edit the class manually.
353
+ */
354
+ /**
355
+ * The type of payment method.
356
+ */
357
+ const PaymentMethodType = {
358
+ BankAccount: "BANK_ACCOUNT",
359
+ Card: "CARD",
360
+ SellerWallet: "SELLER_WALLET"
323
361
  };
324
-
325
- // src/api-model/models/payment-method-type.ts
326
- var PaymentMethodType = {
327
- BankAccount: "BANK_ACCOUNT",
328
- Card: "CARD",
329
- SellerWallet: "SELLER_WALLET"
330
- };
331
-
332
- // src/client.ts
333
- var clientRateLimits = [
334
- {
335
- method: "post",
336
- // eslint-disable-next-line prefer-regex-literals
337
- urlRegex: new RegExp("^/finances/transfers/2024-06-01/payouts$"),
338
- rate: 0.017,
339
- burst: 2
340
- },
341
- {
342
- method: "get",
343
- // eslint-disable-next-line prefer-regex-literals
344
- urlRegex: new RegExp("^/finances/transfers/2024-06-01/paymentMethods$"),
345
- rate: 0.5,
346
- burst: 30
347
- }
348
- ];
362
+ //#endregion
363
+ //#region src/client.ts
364
+ const clientRateLimits = [{
365
+ method: "post",
366
+ urlRegex: /^\/finances\/transfers\/2024\u{2D}06\u{2D}01\/payouts$/v,
367
+ rate: .017,
368
+ burst: 2
369
+ }, {
370
+ method: "get",
371
+ urlRegex: /^\/finances\/transfers\/2024\u{2D}06\u{2D}01\/paymentMethods$/v,
372
+ rate: .5,
373
+ burst: 30
374
+ }];
349
375
  var FinancesTransfersApiClient = class extends FinancesTransfersApi {
350
- constructor(configuration) {
351
- const { axios, endpoint } = createAxiosInstance(configuration, clientRateLimits);
352
- super(new Configuration(), endpoint, axios);
353
- }
354
- };
355
- export {
356
- AssignmentType,
357
- FinancesTransfersApi,
358
- FinancesTransfersApiAxiosParamCreator,
359
- FinancesTransfersApiClient,
360
- FinancesTransfersApiFactory,
361
- FinancesTransfersApiFp,
362
- GetPaymentMethodsPaymentMethodTypesEnum,
363
- PaymentMethodType,
364
- clientRateLimits
376
+ constructor(configuration) {
377
+ const { axios, endpoint } = createAxiosInstance(configuration, clientRateLimits);
378
+ super(new Configuration(), endpoint, axios);
379
+ }
365
380
  };
381
+ //#endregion
382
+ export { AssignmentType, FinancesTransfersApi, FinancesTransfersApiAxiosParamCreator, FinancesTransfersApiClient, FinancesTransfersApiFactory, FinancesTransfersApiFp, GetPaymentMethodsPaymentMethodTypesEnum, PaymentMethodType, clientRateLimits };
383
+
366
384
  //# sourceMappingURL=index.js.map