@revenexx/sdk 0.0.2 → 0.0.5
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/cjs/sdk.js +13496 -3442
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +13467 -3443
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +13496 -3442
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/enums/address-type.ts +4 -0
- package/src/enums/cart-export-format.ts +4 -0
- package/src/enums/cart-io-apply-mode.ts +5 -0
- package/src/enums/cart-io-direction.ts +4 -0
- package/src/enums/cart-io-entity.ts +4 -0
- package/src/enums/cart-io-format.ts +4 -0
- package/src/enums/cart-item-type.ts +5 -0
- package/src/enums/channel-status.ts +4 -0
- package/src/enums/channel-type.ts +7 -0
- package/src/enums/contact-role.ts +6 -0
- package/src/enums/contact-status.ts +5 -0
- package/src/enums/location-type.ts +6 -0
- package/src/enums/market-status.ts +4 -0
- package/src/enums/order-comment-visibility.ts +4 -0
- package/src/enums/order-item-type.ts +5 -0
- package/src/enums/order-payment-status.ts +9 -0
- package/src/enums/organization-status.ts +4 -0
- package/src/enums/page-status.ts +5 -0
- package/src/enums/payment-fee-type.ts +5 -0
- package/src/enums/payment-method-kind.ts +4 -0
- package/src/enums/price-entry-type.ts +4 -0
- package/src/enums/price-list-status.ts +4 -0
- package/src/enums/shipping-method-matrix-basis.ts +6 -0
- package/src/enums/shipping-method-pricing-type.ts +5 -0
- package/src/index.ts +30 -0
- package/src/models.ts +5628 -410
- package/src/services/apps.ts +154 -154
- package/src/services/avatars.ts +57 -57
- package/src/services/carts.ts +739 -104
- package/src/services/channels.ts +147 -19
- package/src/services/customers.ts +801 -69
- package/src/services/greetings.ts +18 -18
- package/src/services/inventories.ts +1278 -0
- package/src/services/locale.ts +16 -16
- package/src/services/markets.ts +373 -75
- package/src/services/messaging.ts +273 -273
- package/src/services/orders.ts +1648 -0
- package/src/services/pages.ts +2317 -0
- package/src/services/payments.ts +1334 -0
- package/src/services/prices.ts +1036 -0
- package/src/services/products.ts +1836 -272
- package/src/services/search.ts +24 -24
- package/src/services/shipping.ts +956 -0
- package/src/services/sites.ts +116 -116
- package/src/services/storage.ts +72 -72
- package/src/services/tokens.ts +14 -14
- package/types/enums/address-type.d.ts +4 -0
- package/types/enums/cart-export-format.d.ts +4 -0
- package/types/enums/cart-io-apply-mode.d.ts +5 -0
- package/types/enums/cart-io-direction.d.ts +4 -0
- package/types/enums/cart-io-entity.d.ts +4 -0
- package/types/enums/cart-io-format.d.ts +4 -0
- package/types/enums/cart-item-type.d.ts +5 -0
- package/types/enums/channel-status.d.ts +4 -0
- package/types/enums/channel-type.d.ts +7 -0
- package/types/enums/contact-role.d.ts +6 -0
- package/types/enums/contact-status.d.ts +5 -0
- package/types/enums/location-type.d.ts +6 -0
- package/types/enums/market-status.d.ts +4 -0
- package/types/enums/order-comment-visibility.d.ts +4 -0
- package/types/enums/order-item-type.d.ts +5 -0
- package/types/enums/order-payment-status.d.ts +9 -0
- package/types/enums/organization-status.d.ts +4 -0
- package/types/enums/page-status.d.ts +5 -0
- package/types/enums/payment-fee-type.d.ts +5 -0
- package/types/enums/payment-method-kind.d.ts +4 -0
- package/types/enums/price-entry-type.d.ts +4 -0
- package/types/enums/price-list-status.d.ts +4 -0
- package/types/enums/shipping-method-matrix-basis.d.ts +6 -0
- package/types/enums/shipping-method-pricing-type.d.ts +5 -0
- package/types/index.d.ts +30 -0
- package/types/models.d.ts +5470 -404
- package/types/services/carts.d.ts +271 -12
- package/types/services/channels.d.ts +54 -2
- package/types/services/customers.d.ts +295 -12
- package/types/services/inventories.d.ts +440 -0
- package/types/services/markets.d.ts +123 -6
- package/types/services/orders.d.ts +590 -0
- package/types/services/pages.d.ts +792 -0
- package/types/services/payments.d.ts +480 -0
- package/types/services/prices.d.ts +384 -0
- package/types/services/products.d.ts +646 -32
- package/types/services/shipping.d.ts +351 -0
package/src/services/markets.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Service } from '../service';
|
|
|
2
2
|
import { RevenexxException, Client, type Payload, UploadProgress } from '../client';
|
|
3
3
|
import type { Models } from '../models';
|
|
4
4
|
|
|
5
|
+
import { MarketStatus } from '../enums/market-status';
|
|
5
6
|
|
|
6
7
|
export class Markets {
|
|
7
8
|
client: Client;
|
|
@@ -18,7 +19,7 @@ export class Markets {
|
|
|
18
19
|
marketsList(): Promise<{}> {
|
|
19
20
|
|
|
20
21
|
const apiPath = '/v1/markets';
|
|
21
|
-
const
|
|
22
|
+
const apiPayload: Payload = {};
|
|
22
23
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
23
24
|
|
|
24
25
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -28,19 +29,95 @@ export class Markets {
|
|
|
28
29
|
'get',
|
|
29
30
|
uri,
|
|
30
31
|
apiHeaders,
|
|
31
|
-
|
|
32
|
+
apiPayload
|
|
32
33
|
);
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
37
|
*
|
|
38
|
+
* @param {string} params.code - Market code (unique per tenant).
|
|
39
|
+
* @param {string} params.name -
|
|
40
|
+
* @param {string} params.currency - ISO 4217 code (default 'EUR').
|
|
41
|
+
* @param {boolean} params.isDefault -
|
|
42
|
+
* @param {object} params.labels - Localized display names ({locale: label}).
|
|
43
|
+
* @param {number} params.position - Sort position (default 0).
|
|
44
|
+
* @param {MarketStatus} params.status - Default 'active'.
|
|
37
45
|
* @throws {RevenexxException}
|
|
38
46
|
* @returns {Promise<Models.Market>}
|
|
39
47
|
*/
|
|
40
|
-
marketsCreate(): Promise<Models.Market
|
|
48
|
+
marketsCreate(params: { code: string, name: string, currency?: string, isDefault?: boolean, labels?: object, position?: number, status?: MarketStatus }): Promise<Models.Market>;
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @param {string} code - Market code (unique per tenant).
|
|
52
|
+
* @param {string} name -
|
|
53
|
+
* @param {string} currency - ISO 4217 code (default 'EUR').
|
|
54
|
+
* @param {boolean} isDefault -
|
|
55
|
+
* @param {object} labels - Localized display names ({locale: label}).
|
|
56
|
+
* @param {number} position - Sort position (default 0).
|
|
57
|
+
* @param {MarketStatus} status - Default 'active'.
|
|
58
|
+
* @throws {RevenexxException}
|
|
59
|
+
* @returns {Promise<Models.Market>}
|
|
60
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
61
|
+
*/
|
|
62
|
+
marketsCreate(code: string, name: string, currency?: string, isDefault?: boolean, labels?: object, position?: number, status?: MarketStatus): Promise<Models.Market>;
|
|
63
|
+
marketsCreate(
|
|
64
|
+
paramsOrFirst: { code: string, name: string, currency?: string, isDefault?: boolean, labels?: object, position?: number, status?: MarketStatus } | string,
|
|
65
|
+
...rest: [(string)?, (string)?, (boolean)?, (object)?, (number)?, (MarketStatus)?]
|
|
66
|
+
): Promise<Models.Market> {
|
|
67
|
+
let params: { code: string, name: string, currency?: string, isDefault?: boolean, labels?: object, position?: number, status?: MarketStatus };
|
|
68
|
+
|
|
69
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
70
|
+
params = (paramsOrFirst || {}) as { code: string, name: string, currency?: string, isDefault?: boolean, labels?: object, position?: number, status?: MarketStatus };
|
|
71
|
+
} else {
|
|
72
|
+
params = {
|
|
73
|
+
code: paramsOrFirst as string,
|
|
74
|
+
name: rest[0] as string,
|
|
75
|
+
currency: rest[1] as string,
|
|
76
|
+
isDefault: rest[2] as boolean,
|
|
77
|
+
labels: rest[3] as object,
|
|
78
|
+
position: rest[4] as number,
|
|
79
|
+
status: rest[5] as MarketStatus
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const code = params.code;
|
|
84
|
+
const name = params.name;
|
|
85
|
+
const currency = params.currency;
|
|
86
|
+
const isDefault = params.isDefault;
|
|
87
|
+
const labels = params.labels;
|
|
88
|
+
const position = params.position;
|
|
89
|
+
const status = params.status;
|
|
90
|
+
|
|
91
|
+
if (typeof code === 'undefined') {
|
|
92
|
+
throw new RevenexxException('Missing required parameter: "code"');
|
|
93
|
+
}
|
|
94
|
+
if (typeof name === 'undefined') {
|
|
95
|
+
throw new RevenexxException('Missing required parameter: "name"');
|
|
96
|
+
}
|
|
41
97
|
|
|
42
98
|
const apiPath = '/v1/markets';
|
|
43
|
-
const
|
|
99
|
+
const apiPayload: Payload = {};
|
|
100
|
+
if (typeof code !== 'undefined') {
|
|
101
|
+
apiPayload['code'] = code;
|
|
102
|
+
}
|
|
103
|
+
if (typeof currency !== 'undefined') {
|
|
104
|
+
apiPayload['currency'] = currency;
|
|
105
|
+
}
|
|
106
|
+
if (typeof isDefault !== 'undefined') {
|
|
107
|
+
apiPayload['is_default'] = isDefault;
|
|
108
|
+
}
|
|
109
|
+
if (typeof labels !== 'undefined') {
|
|
110
|
+
apiPayload['labels'] = labels;
|
|
111
|
+
}
|
|
112
|
+
if (typeof name !== 'undefined') {
|
|
113
|
+
apiPayload['name'] = name;
|
|
114
|
+
}
|
|
115
|
+
if (typeof position !== 'undefined') {
|
|
116
|
+
apiPayload['position'] = position;
|
|
117
|
+
}
|
|
118
|
+
if (typeof status !== 'undefined') {
|
|
119
|
+
apiPayload['status'] = status;
|
|
120
|
+
}
|
|
44
121
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45
122
|
|
|
46
123
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -51,7 +128,7 @@ export class Markets {
|
|
|
51
128
|
'post',
|
|
52
129
|
uri,
|
|
53
130
|
apiHeaders,
|
|
54
|
-
|
|
131
|
+
apiPayload
|
|
55
132
|
);
|
|
56
133
|
}
|
|
57
134
|
|
|
@@ -90,7 +167,7 @@ export class Markets {
|
|
|
90
167
|
}
|
|
91
168
|
|
|
92
169
|
const apiPath = '/v1/markets/{id}'.replace('{id}', id);
|
|
93
|
-
const
|
|
170
|
+
const apiPayload: Payload = {};
|
|
94
171
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
95
172
|
|
|
96
173
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -100,7 +177,7 @@ export class Markets {
|
|
|
100
177
|
'delete',
|
|
101
178
|
uri,
|
|
102
179
|
apiHeaders,
|
|
103
|
-
|
|
180
|
+
apiPayload
|
|
104
181
|
);
|
|
105
182
|
}
|
|
106
183
|
|
|
@@ -139,7 +216,7 @@ export class Markets {
|
|
|
139
216
|
}
|
|
140
217
|
|
|
141
218
|
const apiPath = '/v1/markets/{id}'.replace('{id}', id);
|
|
142
|
-
const
|
|
219
|
+
const apiPayload: Payload = {};
|
|
143
220
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
144
221
|
|
|
145
222
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -149,46 +226,96 @@ export class Markets {
|
|
|
149
226
|
'get',
|
|
150
227
|
uri,
|
|
151
228
|
apiHeaders,
|
|
152
|
-
|
|
229
|
+
apiPayload
|
|
153
230
|
);
|
|
154
231
|
}
|
|
155
232
|
|
|
156
233
|
/**
|
|
157
234
|
*
|
|
158
235
|
* @param {string} params.id -
|
|
236
|
+
* @param {string} params.code - Market code (unique per tenant).
|
|
237
|
+
* @param {string} params.currency - ISO 4217 code (default 'EUR').
|
|
238
|
+
* @param {boolean} params.isDefault -
|
|
239
|
+
* @param {object} params.labels - Localized display names ({locale: label}).
|
|
240
|
+
* @param {string} params.name -
|
|
241
|
+
* @param {number} params.position - Sort position (default 0).
|
|
242
|
+
* @param {MarketStatus} params.status - Default 'active'.
|
|
159
243
|
* @throws {RevenexxException}
|
|
160
244
|
* @returns {Promise<Models.Market>}
|
|
161
245
|
*/
|
|
162
|
-
marketsUpdate(params: { id: string }): Promise<Models.Market>;
|
|
246
|
+
marketsUpdate(params: { id: string, code?: string, currency?: string, isDefault?: boolean, labels?: object, name?: string, position?: number, status?: MarketStatus }): Promise<Models.Market>;
|
|
163
247
|
/**
|
|
164
248
|
*
|
|
165
249
|
* @param {string} id -
|
|
250
|
+
* @param {string} code - Market code (unique per tenant).
|
|
251
|
+
* @param {string} currency - ISO 4217 code (default 'EUR').
|
|
252
|
+
* @param {boolean} isDefault -
|
|
253
|
+
* @param {object} labels - Localized display names ({locale: label}).
|
|
254
|
+
* @param {string} name -
|
|
255
|
+
* @param {number} position - Sort position (default 0).
|
|
256
|
+
* @param {MarketStatus} status - Default 'active'.
|
|
166
257
|
* @throws {RevenexxException}
|
|
167
258
|
* @returns {Promise<Models.Market>}
|
|
168
259
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
169
260
|
*/
|
|
170
|
-
marketsUpdate(id: string): Promise<Models.Market>;
|
|
261
|
+
marketsUpdate(id: string, code?: string, currency?: string, isDefault?: boolean, labels?: object, name?: string, position?: number, status?: MarketStatus): Promise<Models.Market>;
|
|
171
262
|
marketsUpdate(
|
|
172
|
-
paramsOrFirst: { id: string } | string
|
|
263
|
+
paramsOrFirst: { id: string, code?: string, currency?: string, isDefault?: boolean, labels?: object, name?: string, position?: number, status?: MarketStatus } | string,
|
|
264
|
+
...rest: [(string)?, (string)?, (boolean)?, (object)?, (string)?, (number)?, (MarketStatus)?]
|
|
173
265
|
): Promise<Models.Market> {
|
|
174
|
-
let params: { id: string };
|
|
266
|
+
let params: { id: string, code?: string, currency?: string, isDefault?: boolean, labels?: object, name?: string, position?: number, status?: MarketStatus };
|
|
175
267
|
|
|
176
268
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
177
|
-
params = (paramsOrFirst || {}) as { id: string };
|
|
269
|
+
params = (paramsOrFirst || {}) as { id: string, code?: string, currency?: string, isDefault?: boolean, labels?: object, name?: string, position?: number, status?: MarketStatus };
|
|
178
270
|
} else {
|
|
179
271
|
params = {
|
|
180
|
-
id: paramsOrFirst as string
|
|
272
|
+
id: paramsOrFirst as string,
|
|
273
|
+
code: rest[0] as string,
|
|
274
|
+
currency: rest[1] as string,
|
|
275
|
+
isDefault: rest[2] as boolean,
|
|
276
|
+
labels: rest[3] as object,
|
|
277
|
+
name: rest[4] as string,
|
|
278
|
+
position: rest[5] as number,
|
|
279
|
+
status: rest[6] as MarketStatus
|
|
181
280
|
};
|
|
182
281
|
}
|
|
183
282
|
|
|
184
283
|
const id = params.id;
|
|
284
|
+
const code = params.code;
|
|
285
|
+
const currency = params.currency;
|
|
286
|
+
const isDefault = params.isDefault;
|
|
287
|
+
const labels = params.labels;
|
|
288
|
+
const name = params.name;
|
|
289
|
+
const position = params.position;
|
|
290
|
+
const status = params.status;
|
|
185
291
|
|
|
186
292
|
if (typeof id === 'undefined') {
|
|
187
293
|
throw new RevenexxException('Missing required parameter: "id"');
|
|
188
294
|
}
|
|
189
295
|
|
|
190
296
|
const apiPath = '/v1/markets/{id}'.replace('{id}', id);
|
|
191
|
-
const
|
|
297
|
+
const apiPayload: Payload = {};
|
|
298
|
+
if (typeof code !== 'undefined') {
|
|
299
|
+
apiPayload['code'] = code;
|
|
300
|
+
}
|
|
301
|
+
if (typeof currency !== 'undefined') {
|
|
302
|
+
apiPayload['currency'] = currency;
|
|
303
|
+
}
|
|
304
|
+
if (typeof isDefault !== 'undefined') {
|
|
305
|
+
apiPayload['is_default'] = isDefault;
|
|
306
|
+
}
|
|
307
|
+
if (typeof labels !== 'undefined') {
|
|
308
|
+
apiPayload['labels'] = labels;
|
|
309
|
+
}
|
|
310
|
+
if (typeof name !== 'undefined') {
|
|
311
|
+
apiPayload['name'] = name;
|
|
312
|
+
}
|
|
313
|
+
if (typeof position !== 'undefined') {
|
|
314
|
+
apiPayload['position'] = position;
|
|
315
|
+
}
|
|
316
|
+
if (typeof status !== 'undefined') {
|
|
317
|
+
apiPayload['status'] = status;
|
|
318
|
+
}
|
|
192
319
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
193
320
|
|
|
194
321
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -199,7 +326,7 @@ export class Markets {
|
|
|
199
326
|
'put',
|
|
200
327
|
uri,
|
|
201
328
|
apiHeaders,
|
|
202
|
-
|
|
329
|
+
apiPayload
|
|
203
330
|
);
|
|
204
331
|
}
|
|
205
332
|
|
|
@@ -238,7 +365,7 @@ export class Markets {
|
|
|
238
365
|
}
|
|
239
366
|
|
|
240
367
|
const apiPath = '/v1/markets/{id}/context'.replace('{id}', id);
|
|
241
|
-
const
|
|
368
|
+
const apiPayload: Payload = {};
|
|
242
369
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
243
370
|
|
|
244
371
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -248,7 +375,7 @@ export class Markets {
|
|
|
248
375
|
'get',
|
|
249
376
|
uri,
|
|
250
377
|
apiHeaders,
|
|
251
|
-
|
|
378
|
+
apiPayload
|
|
252
379
|
);
|
|
253
380
|
}
|
|
254
381
|
|
|
@@ -286,8 +413,8 @@ export class Markets {
|
|
|
286
413
|
throw new RevenexxException('Missing required parameter: "marketId"');
|
|
287
414
|
}
|
|
288
415
|
|
|
289
|
-
const apiPath = '/v1/markets/{market_id}/locales'.replace('{
|
|
290
|
-
const
|
|
416
|
+
const apiPath = '/v1/markets/{market_id}/locales'.replace('{market_id}', marketId);
|
|
417
|
+
const apiPayload: Payload = {};
|
|
291
418
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
292
419
|
|
|
293
420
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -297,46 +424,91 @@ export class Markets {
|
|
|
297
424
|
'get',
|
|
298
425
|
uri,
|
|
299
426
|
apiHeaders,
|
|
300
|
-
|
|
427
|
+
apiPayload
|
|
301
428
|
);
|
|
302
429
|
}
|
|
303
430
|
|
|
304
431
|
/**
|
|
305
432
|
*
|
|
306
433
|
* @param {string} params.marketId -
|
|
434
|
+
* @param {string} params.code - Locale code, e.g. 'de-DE' (unique per market).
|
|
435
|
+
* @param {string} params.country - ISO 3166-1 alpha-2 country code.
|
|
436
|
+
* @param {string} params.language - ISO 639-1 language code.
|
|
437
|
+
* @param {boolean} params.isDefault -
|
|
438
|
+
* @param {number} params.position - Sort position (default 0).
|
|
307
439
|
* @throws {RevenexxException}
|
|
308
440
|
* @returns {Promise<Models.MarketLocale>}
|
|
309
441
|
*/
|
|
310
|
-
marketsLocalesCreate(params: { marketId: string }): Promise<Models.MarketLocale>;
|
|
442
|
+
marketsLocalesCreate(params: { marketId: string, code: string, country: string, language: string, isDefault?: boolean, position?: number }): Promise<Models.MarketLocale>;
|
|
311
443
|
/**
|
|
312
444
|
*
|
|
313
445
|
* @param {string} marketId -
|
|
446
|
+
* @param {string} code - Locale code, e.g. 'de-DE' (unique per market).
|
|
447
|
+
* @param {string} country - ISO 3166-1 alpha-2 country code.
|
|
448
|
+
* @param {string} language - ISO 639-1 language code.
|
|
449
|
+
* @param {boolean} isDefault -
|
|
450
|
+
* @param {number} position - Sort position (default 0).
|
|
314
451
|
* @throws {RevenexxException}
|
|
315
452
|
* @returns {Promise<Models.MarketLocale>}
|
|
316
453
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
317
454
|
*/
|
|
318
|
-
marketsLocalesCreate(marketId: string): Promise<Models.MarketLocale>;
|
|
455
|
+
marketsLocalesCreate(marketId: string, code: string, country: string, language: string, isDefault?: boolean, position?: number): Promise<Models.MarketLocale>;
|
|
319
456
|
marketsLocalesCreate(
|
|
320
|
-
paramsOrFirst: { marketId: string } | string
|
|
457
|
+
paramsOrFirst: { marketId: string, code: string, country: string, language: string, isDefault?: boolean, position?: number } | string,
|
|
458
|
+
...rest: [(string)?, (string)?, (string)?, (boolean)?, (number)?]
|
|
321
459
|
): Promise<Models.MarketLocale> {
|
|
322
|
-
let params: { marketId: string };
|
|
460
|
+
let params: { marketId: string, code: string, country: string, language: string, isDefault?: boolean, position?: number };
|
|
323
461
|
|
|
324
462
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
325
|
-
params = (paramsOrFirst || {}) as { marketId: string };
|
|
463
|
+
params = (paramsOrFirst || {}) as { marketId: string, code: string, country: string, language: string, isDefault?: boolean, position?: number };
|
|
326
464
|
} else {
|
|
327
465
|
params = {
|
|
328
|
-
marketId: paramsOrFirst as string
|
|
466
|
+
marketId: paramsOrFirst as string,
|
|
467
|
+
code: rest[0] as string,
|
|
468
|
+
country: rest[1] as string,
|
|
469
|
+
language: rest[2] as string,
|
|
470
|
+
isDefault: rest[3] as boolean,
|
|
471
|
+
position: rest[4] as number
|
|
329
472
|
};
|
|
330
473
|
}
|
|
331
474
|
|
|
332
475
|
const marketId = params.marketId;
|
|
476
|
+
const code = params.code;
|
|
477
|
+
const country = params.country;
|
|
478
|
+
const language = params.language;
|
|
479
|
+
const isDefault = params.isDefault;
|
|
480
|
+
const position = params.position;
|
|
333
481
|
|
|
334
482
|
if (typeof marketId === 'undefined') {
|
|
335
483
|
throw new RevenexxException('Missing required parameter: "marketId"');
|
|
336
484
|
}
|
|
485
|
+
if (typeof code === 'undefined') {
|
|
486
|
+
throw new RevenexxException('Missing required parameter: "code"');
|
|
487
|
+
}
|
|
488
|
+
if (typeof country === 'undefined') {
|
|
489
|
+
throw new RevenexxException('Missing required parameter: "country"');
|
|
490
|
+
}
|
|
491
|
+
if (typeof language === 'undefined') {
|
|
492
|
+
throw new RevenexxException('Missing required parameter: "language"');
|
|
493
|
+
}
|
|
337
494
|
|
|
338
|
-
const apiPath = '/v1/markets/{market_id}/locales'.replace('{
|
|
339
|
-
const
|
|
495
|
+
const apiPath = '/v1/markets/{market_id}/locales'.replace('{market_id}', marketId);
|
|
496
|
+
const apiPayload: Payload = {};
|
|
497
|
+
if (typeof code !== 'undefined') {
|
|
498
|
+
apiPayload['code'] = code;
|
|
499
|
+
}
|
|
500
|
+
if (typeof country !== 'undefined') {
|
|
501
|
+
apiPayload['country'] = country;
|
|
502
|
+
}
|
|
503
|
+
if (typeof isDefault !== 'undefined') {
|
|
504
|
+
apiPayload['is_default'] = isDefault;
|
|
505
|
+
}
|
|
506
|
+
if (typeof language !== 'undefined') {
|
|
507
|
+
apiPayload['language'] = language;
|
|
508
|
+
}
|
|
509
|
+
if (typeof position !== 'undefined') {
|
|
510
|
+
apiPayload['position'] = position;
|
|
511
|
+
}
|
|
340
512
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
341
513
|
|
|
342
514
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -347,7 +519,7 @@ export class Markets {
|
|
|
347
519
|
'post',
|
|
348
520
|
uri,
|
|
349
521
|
apiHeaders,
|
|
350
|
-
|
|
522
|
+
apiPayload
|
|
351
523
|
);
|
|
352
524
|
}
|
|
353
525
|
|
|
@@ -393,8 +565,8 @@ export class Markets {
|
|
|
393
565
|
throw new RevenexxException('Missing required parameter: "id"');
|
|
394
566
|
}
|
|
395
567
|
|
|
396
|
-
const apiPath = '/v1/markets/{market_id}/locales/{id}'.replace('{
|
|
397
|
-
const
|
|
568
|
+
const apiPath = '/v1/markets/{market_id}/locales/{id}'.replace('{market_id}', marketId).replace('{id}', id);
|
|
569
|
+
const apiPayload: Payload = {};
|
|
398
570
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
399
571
|
|
|
400
572
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -404,7 +576,7 @@ export class Markets {
|
|
|
404
576
|
'delete',
|
|
405
577
|
uri,
|
|
406
578
|
apiHeaders,
|
|
407
|
-
|
|
579
|
+
apiPayload
|
|
408
580
|
);
|
|
409
581
|
}
|
|
410
582
|
|
|
@@ -450,8 +622,8 @@ export class Markets {
|
|
|
450
622
|
throw new RevenexxException('Missing required parameter: "id"');
|
|
451
623
|
}
|
|
452
624
|
|
|
453
|
-
const apiPath = '/v1/markets/{market_id}/locales/{id}'.replace('{
|
|
454
|
-
const
|
|
625
|
+
const apiPath = '/v1/markets/{market_id}/locales/{id}'.replace('{market_id}', marketId).replace('{id}', id);
|
|
626
|
+
const apiPayload: Payload = {};
|
|
455
627
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
456
628
|
|
|
457
629
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -461,7 +633,7 @@ export class Markets {
|
|
|
461
633
|
'get',
|
|
462
634
|
uri,
|
|
463
635
|
apiHeaders,
|
|
464
|
-
|
|
636
|
+
apiPayload
|
|
465
637
|
);
|
|
466
638
|
}
|
|
467
639
|
|
|
@@ -469,36 +641,56 @@ export class Markets {
|
|
|
469
641
|
*
|
|
470
642
|
* @param {string} params.marketId -
|
|
471
643
|
* @param {string} params.id -
|
|
644
|
+
* @param {string} params.code - Locale code, e.g. 'de-DE' (unique per market).
|
|
645
|
+
* @param {string} params.country - ISO 3166-1 alpha-2 country code.
|
|
646
|
+
* @param {boolean} params.isDefault -
|
|
647
|
+
* @param {string} params.language - ISO 639-1 language code.
|
|
648
|
+
* @param {number} params.position - Sort position (default 0).
|
|
472
649
|
* @throws {RevenexxException}
|
|
473
650
|
* @returns {Promise<Models.MarketLocale>}
|
|
474
651
|
*/
|
|
475
|
-
marketsLocalesUpdate(params: { marketId: string, id: string }): Promise<Models.MarketLocale>;
|
|
652
|
+
marketsLocalesUpdate(params: { marketId: string, id: string, code?: string, country?: string, isDefault?: boolean, language?: string, position?: number }): Promise<Models.MarketLocale>;
|
|
476
653
|
/**
|
|
477
654
|
*
|
|
478
655
|
* @param {string} marketId -
|
|
479
656
|
* @param {string} id -
|
|
657
|
+
* @param {string} code - Locale code, e.g. 'de-DE' (unique per market).
|
|
658
|
+
* @param {string} country - ISO 3166-1 alpha-2 country code.
|
|
659
|
+
* @param {boolean} isDefault -
|
|
660
|
+
* @param {string} language - ISO 639-1 language code.
|
|
661
|
+
* @param {number} position - Sort position (default 0).
|
|
480
662
|
* @throws {RevenexxException}
|
|
481
663
|
* @returns {Promise<Models.MarketLocale>}
|
|
482
664
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
483
665
|
*/
|
|
484
|
-
marketsLocalesUpdate(marketId: string, id: string): Promise<Models.MarketLocale>;
|
|
666
|
+
marketsLocalesUpdate(marketId: string, id: string, code?: string, country?: string, isDefault?: boolean, language?: string, position?: number): Promise<Models.MarketLocale>;
|
|
485
667
|
marketsLocalesUpdate(
|
|
486
|
-
paramsOrFirst: { marketId: string, id: string } | string,
|
|
487
|
-
...rest: [(string)?]
|
|
668
|
+
paramsOrFirst: { marketId: string, id: string, code?: string, country?: string, isDefault?: boolean, language?: string, position?: number } | string,
|
|
669
|
+
...rest: [(string)?, (string)?, (string)?, (boolean)?, (string)?, (number)?]
|
|
488
670
|
): Promise<Models.MarketLocale> {
|
|
489
|
-
let params: { marketId: string, id: string };
|
|
671
|
+
let params: { marketId: string, id: string, code?: string, country?: string, isDefault?: boolean, language?: string, position?: number };
|
|
490
672
|
|
|
491
673
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
492
|
-
params = (paramsOrFirst || {}) as { marketId: string, id: string };
|
|
674
|
+
params = (paramsOrFirst || {}) as { marketId: string, id: string, code?: string, country?: string, isDefault?: boolean, language?: string, position?: number };
|
|
493
675
|
} else {
|
|
494
676
|
params = {
|
|
495
677
|
marketId: paramsOrFirst as string,
|
|
496
|
-
id: rest[0] as string
|
|
678
|
+
id: rest[0] as string,
|
|
679
|
+
code: rest[1] as string,
|
|
680
|
+
country: rest[2] as string,
|
|
681
|
+
isDefault: rest[3] as boolean,
|
|
682
|
+
language: rest[4] as string,
|
|
683
|
+
position: rest[5] as number
|
|
497
684
|
};
|
|
498
685
|
}
|
|
499
686
|
|
|
500
687
|
const marketId = params.marketId;
|
|
501
688
|
const id = params.id;
|
|
689
|
+
const code = params.code;
|
|
690
|
+
const country = params.country;
|
|
691
|
+
const isDefault = params.isDefault;
|
|
692
|
+
const language = params.language;
|
|
693
|
+
const position = params.position;
|
|
502
694
|
|
|
503
695
|
if (typeof marketId === 'undefined') {
|
|
504
696
|
throw new RevenexxException('Missing required parameter: "marketId"');
|
|
@@ -507,8 +699,23 @@ export class Markets {
|
|
|
507
699
|
throw new RevenexxException('Missing required parameter: "id"');
|
|
508
700
|
}
|
|
509
701
|
|
|
510
|
-
const apiPath = '/v1/markets/{market_id}/locales/{id}'.replace('{
|
|
511
|
-
const
|
|
702
|
+
const apiPath = '/v1/markets/{market_id}/locales/{id}'.replace('{market_id}', marketId).replace('{id}', id);
|
|
703
|
+
const apiPayload: Payload = {};
|
|
704
|
+
if (typeof code !== 'undefined') {
|
|
705
|
+
apiPayload['code'] = code;
|
|
706
|
+
}
|
|
707
|
+
if (typeof country !== 'undefined') {
|
|
708
|
+
apiPayload['country'] = country;
|
|
709
|
+
}
|
|
710
|
+
if (typeof isDefault !== 'undefined') {
|
|
711
|
+
apiPayload['is_default'] = isDefault;
|
|
712
|
+
}
|
|
713
|
+
if (typeof language !== 'undefined') {
|
|
714
|
+
apiPayload['language'] = language;
|
|
715
|
+
}
|
|
716
|
+
if (typeof position !== 'undefined') {
|
|
717
|
+
apiPayload['position'] = position;
|
|
718
|
+
}
|
|
512
719
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
513
720
|
|
|
514
721
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -519,7 +726,7 @@ export class Markets {
|
|
|
519
726
|
'put',
|
|
520
727
|
uri,
|
|
521
728
|
apiHeaders,
|
|
522
|
-
|
|
729
|
+
apiPayload
|
|
523
730
|
);
|
|
524
731
|
}
|
|
525
732
|
|
|
@@ -557,8 +764,8 @@ export class Markets {
|
|
|
557
764
|
throw new RevenexxException('Missing required parameter: "marketId"');
|
|
558
765
|
}
|
|
559
766
|
|
|
560
|
-
const apiPath = '/v1/markets/{market_id}/tax_classes'.replace('{
|
|
561
|
-
const
|
|
767
|
+
const apiPath = '/v1/markets/{market_id}/tax_classes'.replace('{market_id}', marketId);
|
|
768
|
+
const apiPayload: Payload = {};
|
|
562
769
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
563
770
|
|
|
564
771
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -568,46 +775,95 @@ export class Markets {
|
|
|
568
775
|
'get',
|
|
569
776
|
uri,
|
|
570
777
|
apiHeaders,
|
|
571
|
-
|
|
778
|
+
apiPayload
|
|
572
779
|
);
|
|
573
780
|
}
|
|
574
781
|
|
|
575
782
|
/**
|
|
576
783
|
*
|
|
577
784
|
* @param {string} params.marketId -
|
|
785
|
+
* @param {string} params.code - Tax class code (unique per market).
|
|
786
|
+
* @param {string} params.name -
|
|
787
|
+
* @param {boolean} params.isDefault -
|
|
788
|
+
* @param {object} params.labels - Localized display names ({locale: label}).
|
|
789
|
+
* @param {number} params.position - Sort position (default 0).
|
|
790
|
+
* @param {number} params.rate - Tax rate in percent, 0–100 (default 0).
|
|
578
791
|
* @throws {RevenexxException}
|
|
579
792
|
* @returns {Promise<Models.MarketTaxClass>}
|
|
580
793
|
*/
|
|
581
|
-
marketsTaxClassesCreate(params: { marketId: string }): Promise<Models.MarketTaxClass>;
|
|
794
|
+
marketsTaxClassesCreate(params: { marketId: string, code: string, name: string, isDefault?: boolean, labels?: object, position?: number, rate?: number }): Promise<Models.MarketTaxClass>;
|
|
582
795
|
/**
|
|
583
796
|
*
|
|
584
797
|
* @param {string} marketId -
|
|
798
|
+
* @param {string} code - Tax class code (unique per market).
|
|
799
|
+
* @param {string} name -
|
|
800
|
+
* @param {boolean} isDefault -
|
|
801
|
+
* @param {object} labels - Localized display names ({locale: label}).
|
|
802
|
+
* @param {number} position - Sort position (default 0).
|
|
803
|
+
* @param {number} rate - Tax rate in percent, 0–100 (default 0).
|
|
585
804
|
* @throws {RevenexxException}
|
|
586
805
|
* @returns {Promise<Models.MarketTaxClass>}
|
|
587
806
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
588
807
|
*/
|
|
589
|
-
marketsTaxClassesCreate(marketId: string): Promise<Models.MarketTaxClass>;
|
|
808
|
+
marketsTaxClassesCreate(marketId: string, code: string, name: string, isDefault?: boolean, labels?: object, position?: number, rate?: number): Promise<Models.MarketTaxClass>;
|
|
590
809
|
marketsTaxClassesCreate(
|
|
591
|
-
paramsOrFirst: { marketId: string } | string
|
|
810
|
+
paramsOrFirst: { marketId: string, code: string, name: string, isDefault?: boolean, labels?: object, position?: number, rate?: number } | string,
|
|
811
|
+
...rest: [(string)?, (string)?, (boolean)?, (object)?, (number)?, (number)?]
|
|
592
812
|
): Promise<Models.MarketTaxClass> {
|
|
593
|
-
let params: { marketId: string };
|
|
813
|
+
let params: { marketId: string, code: string, name: string, isDefault?: boolean, labels?: object, position?: number, rate?: number };
|
|
594
814
|
|
|
595
815
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
596
|
-
params = (paramsOrFirst || {}) as { marketId: string };
|
|
816
|
+
params = (paramsOrFirst || {}) as { marketId: string, code: string, name: string, isDefault?: boolean, labels?: object, position?: number, rate?: number };
|
|
597
817
|
} else {
|
|
598
818
|
params = {
|
|
599
|
-
marketId: paramsOrFirst as string
|
|
819
|
+
marketId: paramsOrFirst as string,
|
|
820
|
+
code: rest[0] as string,
|
|
821
|
+
name: rest[1] as string,
|
|
822
|
+
isDefault: rest[2] as boolean,
|
|
823
|
+
labels: rest[3] as object,
|
|
824
|
+
position: rest[4] as number,
|
|
825
|
+
rate: rest[5] as number
|
|
600
826
|
};
|
|
601
827
|
}
|
|
602
828
|
|
|
603
829
|
const marketId = params.marketId;
|
|
830
|
+
const code = params.code;
|
|
831
|
+
const name = params.name;
|
|
832
|
+
const isDefault = params.isDefault;
|
|
833
|
+
const labels = params.labels;
|
|
834
|
+
const position = params.position;
|
|
835
|
+
const rate = params.rate;
|
|
604
836
|
|
|
605
837
|
if (typeof marketId === 'undefined') {
|
|
606
838
|
throw new RevenexxException('Missing required parameter: "marketId"');
|
|
607
839
|
}
|
|
840
|
+
if (typeof code === 'undefined') {
|
|
841
|
+
throw new RevenexxException('Missing required parameter: "code"');
|
|
842
|
+
}
|
|
843
|
+
if (typeof name === 'undefined') {
|
|
844
|
+
throw new RevenexxException('Missing required parameter: "name"');
|
|
845
|
+
}
|
|
608
846
|
|
|
609
|
-
const apiPath = '/v1/markets/{market_id}/tax_classes'.replace('{
|
|
610
|
-
const
|
|
847
|
+
const apiPath = '/v1/markets/{market_id}/tax_classes'.replace('{market_id}', marketId);
|
|
848
|
+
const apiPayload: Payload = {};
|
|
849
|
+
if (typeof code !== 'undefined') {
|
|
850
|
+
apiPayload['code'] = code;
|
|
851
|
+
}
|
|
852
|
+
if (typeof isDefault !== 'undefined') {
|
|
853
|
+
apiPayload['is_default'] = isDefault;
|
|
854
|
+
}
|
|
855
|
+
if (typeof labels !== 'undefined') {
|
|
856
|
+
apiPayload['labels'] = labels;
|
|
857
|
+
}
|
|
858
|
+
if (typeof name !== 'undefined') {
|
|
859
|
+
apiPayload['name'] = name;
|
|
860
|
+
}
|
|
861
|
+
if (typeof position !== 'undefined') {
|
|
862
|
+
apiPayload['position'] = position;
|
|
863
|
+
}
|
|
864
|
+
if (typeof rate !== 'undefined') {
|
|
865
|
+
apiPayload['rate'] = rate;
|
|
866
|
+
}
|
|
611
867
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
612
868
|
|
|
613
869
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -618,7 +874,7 @@ export class Markets {
|
|
|
618
874
|
'post',
|
|
619
875
|
uri,
|
|
620
876
|
apiHeaders,
|
|
621
|
-
|
|
877
|
+
apiPayload
|
|
622
878
|
);
|
|
623
879
|
}
|
|
624
880
|
|
|
@@ -664,8 +920,8 @@ export class Markets {
|
|
|
664
920
|
throw new RevenexxException('Missing required parameter: "id"');
|
|
665
921
|
}
|
|
666
922
|
|
|
667
|
-
const apiPath = '/v1/markets/{market_id}/tax_classes/{id}'.replace('{
|
|
668
|
-
const
|
|
923
|
+
const apiPath = '/v1/markets/{market_id}/tax_classes/{id}'.replace('{market_id}', marketId).replace('{id}', id);
|
|
924
|
+
const apiPayload: Payload = {};
|
|
669
925
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
670
926
|
|
|
671
927
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -675,7 +931,7 @@ export class Markets {
|
|
|
675
931
|
'delete',
|
|
676
932
|
uri,
|
|
677
933
|
apiHeaders,
|
|
678
|
-
|
|
934
|
+
apiPayload
|
|
679
935
|
);
|
|
680
936
|
}
|
|
681
937
|
|
|
@@ -721,8 +977,8 @@ export class Markets {
|
|
|
721
977
|
throw new RevenexxException('Missing required parameter: "id"');
|
|
722
978
|
}
|
|
723
979
|
|
|
724
|
-
const apiPath = '/v1/markets/{market_id}/tax_classes/{id}'.replace('{
|
|
725
|
-
const
|
|
980
|
+
const apiPath = '/v1/markets/{market_id}/tax_classes/{id}'.replace('{market_id}', marketId).replace('{id}', id);
|
|
981
|
+
const apiPayload: Payload = {};
|
|
726
982
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
727
983
|
|
|
728
984
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -732,7 +988,7 @@ export class Markets {
|
|
|
732
988
|
'get',
|
|
733
989
|
uri,
|
|
734
990
|
apiHeaders,
|
|
735
|
-
|
|
991
|
+
apiPayload
|
|
736
992
|
);
|
|
737
993
|
}
|
|
738
994
|
|
|
@@ -740,36 +996,60 @@ export class Markets {
|
|
|
740
996
|
*
|
|
741
997
|
* @param {string} params.marketId -
|
|
742
998
|
* @param {string} params.id -
|
|
999
|
+
* @param {string} params.code - Tax class code (unique per market).
|
|
1000
|
+
* @param {boolean} params.isDefault -
|
|
1001
|
+
* @param {object} params.labels - Localized display names ({locale: label}).
|
|
1002
|
+
* @param {string} params.name -
|
|
1003
|
+
* @param {number} params.position - Sort position (default 0).
|
|
1004
|
+
* @param {number} params.rate - Tax rate in percent, 0–100 (default 0).
|
|
743
1005
|
* @throws {RevenexxException}
|
|
744
1006
|
* @returns {Promise<Models.MarketTaxClass>}
|
|
745
1007
|
*/
|
|
746
|
-
marketsTaxClassesUpdate(params: { marketId: string, id: string }): Promise<Models.MarketTaxClass>;
|
|
1008
|
+
marketsTaxClassesUpdate(params: { marketId: string, id: string, code?: string, isDefault?: boolean, labels?: object, name?: string, position?: number, rate?: number }): Promise<Models.MarketTaxClass>;
|
|
747
1009
|
/**
|
|
748
1010
|
*
|
|
749
1011
|
* @param {string} marketId -
|
|
750
1012
|
* @param {string} id -
|
|
1013
|
+
* @param {string} code - Tax class code (unique per market).
|
|
1014
|
+
* @param {boolean} isDefault -
|
|
1015
|
+
* @param {object} labels - Localized display names ({locale: label}).
|
|
1016
|
+
* @param {string} name -
|
|
1017
|
+
* @param {number} position - Sort position (default 0).
|
|
1018
|
+
* @param {number} rate - Tax rate in percent, 0–100 (default 0).
|
|
751
1019
|
* @throws {RevenexxException}
|
|
752
1020
|
* @returns {Promise<Models.MarketTaxClass>}
|
|
753
1021
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
754
1022
|
*/
|
|
755
|
-
marketsTaxClassesUpdate(marketId: string, id: string): Promise<Models.MarketTaxClass>;
|
|
1023
|
+
marketsTaxClassesUpdate(marketId: string, id: string, code?: string, isDefault?: boolean, labels?: object, name?: string, position?: number, rate?: number): Promise<Models.MarketTaxClass>;
|
|
756
1024
|
marketsTaxClassesUpdate(
|
|
757
|
-
paramsOrFirst: { marketId: string, id: string } | string,
|
|
758
|
-
...rest: [(string)?]
|
|
1025
|
+
paramsOrFirst: { marketId: string, id: string, code?: string, isDefault?: boolean, labels?: object, name?: string, position?: number, rate?: number } | string,
|
|
1026
|
+
...rest: [(string)?, (string)?, (boolean)?, (object)?, (string)?, (number)?, (number)?]
|
|
759
1027
|
): Promise<Models.MarketTaxClass> {
|
|
760
|
-
let params: { marketId: string, id: string };
|
|
1028
|
+
let params: { marketId: string, id: string, code?: string, isDefault?: boolean, labels?: object, name?: string, position?: number, rate?: number };
|
|
761
1029
|
|
|
762
1030
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
763
|
-
params = (paramsOrFirst || {}) as { marketId: string, id: string };
|
|
1031
|
+
params = (paramsOrFirst || {}) as { marketId: string, id: string, code?: string, isDefault?: boolean, labels?: object, name?: string, position?: number, rate?: number };
|
|
764
1032
|
} else {
|
|
765
1033
|
params = {
|
|
766
1034
|
marketId: paramsOrFirst as string,
|
|
767
|
-
id: rest[0] as string
|
|
1035
|
+
id: rest[0] as string,
|
|
1036
|
+
code: rest[1] as string,
|
|
1037
|
+
isDefault: rest[2] as boolean,
|
|
1038
|
+
labels: rest[3] as object,
|
|
1039
|
+
name: rest[4] as string,
|
|
1040
|
+
position: rest[5] as number,
|
|
1041
|
+
rate: rest[6] as number
|
|
768
1042
|
};
|
|
769
1043
|
}
|
|
770
1044
|
|
|
771
1045
|
const marketId = params.marketId;
|
|
772
1046
|
const id = params.id;
|
|
1047
|
+
const code = params.code;
|
|
1048
|
+
const isDefault = params.isDefault;
|
|
1049
|
+
const labels = params.labels;
|
|
1050
|
+
const name = params.name;
|
|
1051
|
+
const position = params.position;
|
|
1052
|
+
const rate = params.rate;
|
|
773
1053
|
|
|
774
1054
|
if (typeof marketId === 'undefined') {
|
|
775
1055
|
throw new RevenexxException('Missing required parameter: "marketId"');
|
|
@@ -778,8 +1058,26 @@ export class Markets {
|
|
|
778
1058
|
throw new RevenexxException('Missing required parameter: "id"');
|
|
779
1059
|
}
|
|
780
1060
|
|
|
781
|
-
const apiPath = '/v1/markets/{market_id}/tax_classes/{id}'.replace('{
|
|
782
|
-
const
|
|
1061
|
+
const apiPath = '/v1/markets/{market_id}/tax_classes/{id}'.replace('{market_id}', marketId).replace('{id}', id);
|
|
1062
|
+
const apiPayload: Payload = {};
|
|
1063
|
+
if (typeof code !== 'undefined') {
|
|
1064
|
+
apiPayload['code'] = code;
|
|
1065
|
+
}
|
|
1066
|
+
if (typeof isDefault !== 'undefined') {
|
|
1067
|
+
apiPayload['is_default'] = isDefault;
|
|
1068
|
+
}
|
|
1069
|
+
if (typeof labels !== 'undefined') {
|
|
1070
|
+
apiPayload['labels'] = labels;
|
|
1071
|
+
}
|
|
1072
|
+
if (typeof name !== 'undefined') {
|
|
1073
|
+
apiPayload['name'] = name;
|
|
1074
|
+
}
|
|
1075
|
+
if (typeof position !== 'undefined') {
|
|
1076
|
+
apiPayload['position'] = position;
|
|
1077
|
+
}
|
|
1078
|
+
if (typeof rate !== 'undefined') {
|
|
1079
|
+
apiPayload['rate'] = rate;
|
|
1080
|
+
}
|
|
783
1081
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
784
1082
|
|
|
785
1083
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -790,7 +1088,7 @@ export class Markets {
|
|
|
790
1088
|
'put',
|
|
791
1089
|
uri,
|
|
792
1090
|
apiHeaders,
|
|
793
|
-
|
|
1091
|
+
apiPayload
|
|
794
1092
|
);
|
|
795
1093
|
}
|
|
796
1094
|
}
|