@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.
Files changed (90) hide show
  1. package/dist/cjs/sdk.js +13496 -3442
  2. package/dist/cjs/sdk.js.map +1 -1
  3. package/dist/esm/sdk.js +13467 -3443
  4. package/dist/esm/sdk.js.map +1 -1
  5. package/dist/iife/sdk.js +13496 -3442
  6. package/package.json +1 -1
  7. package/src/client.ts +1 -1
  8. package/src/enums/address-type.ts +4 -0
  9. package/src/enums/cart-export-format.ts +4 -0
  10. package/src/enums/cart-io-apply-mode.ts +5 -0
  11. package/src/enums/cart-io-direction.ts +4 -0
  12. package/src/enums/cart-io-entity.ts +4 -0
  13. package/src/enums/cart-io-format.ts +4 -0
  14. package/src/enums/cart-item-type.ts +5 -0
  15. package/src/enums/channel-status.ts +4 -0
  16. package/src/enums/channel-type.ts +7 -0
  17. package/src/enums/contact-role.ts +6 -0
  18. package/src/enums/contact-status.ts +5 -0
  19. package/src/enums/location-type.ts +6 -0
  20. package/src/enums/market-status.ts +4 -0
  21. package/src/enums/order-comment-visibility.ts +4 -0
  22. package/src/enums/order-item-type.ts +5 -0
  23. package/src/enums/order-payment-status.ts +9 -0
  24. package/src/enums/organization-status.ts +4 -0
  25. package/src/enums/page-status.ts +5 -0
  26. package/src/enums/payment-fee-type.ts +5 -0
  27. package/src/enums/payment-method-kind.ts +4 -0
  28. package/src/enums/price-entry-type.ts +4 -0
  29. package/src/enums/price-list-status.ts +4 -0
  30. package/src/enums/shipping-method-matrix-basis.ts +6 -0
  31. package/src/enums/shipping-method-pricing-type.ts +5 -0
  32. package/src/index.ts +30 -0
  33. package/src/models.ts +5628 -410
  34. package/src/services/apps.ts +154 -154
  35. package/src/services/avatars.ts +57 -57
  36. package/src/services/carts.ts +739 -104
  37. package/src/services/channels.ts +147 -19
  38. package/src/services/customers.ts +801 -69
  39. package/src/services/greetings.ts +18 -18
  40. package/src/services/inventories.ts +1278 -0
  41. package/src/services/locale.ts +16 -16
  42. package/src/services/markets.ts +373 -75
  43. package/src/services/messaging.ts +273 -273
  44. package/src/services/orders.ts +1648 -0
  45. package/src/services/pages.ts +2317 -0
  46. package/src/services/payments.ts +1334 -0
  47. package/src/services/prices.ts +1036 -0
  48. package/src/services/products.ts +1836 -272
  49. package/src/services/search.ts +24 -24
  50. package/src/services/shipping.ts +956 -0
  51. package/src/services/sites.ts +116 -116
  52. package/src/services/storage.ts +72 -72
  53. package/src/services/tokens.ts +14 -14
  54. package/types/enums/address-type.d.ts +4 -0
  55. package/types/enums/cart-export-format.d.ts +4 -0
  56. package/types/enums/cart-io-apply-mode.d.ts +5 -0
  57. package/types/enums/cart-io-direction.d.ts +4 -0
  58. package/types/enums/cart-io-entity.d.ts +4 -0
  59. package/types/enums/cart-io-format.d.ts +4 -0
  60. package/types/enums/cart-item-type.d.ts +5 -0
  61. package/types/enums/channel-status.d.ts +4 -0
  62. package/types/enums/channel-type.d.ts +7 -0
  63. package/types/enums/contact-role.d.ts +6 -0
  64. package/types/enums/contact-status.d.ts +5 -0
  65. package/types/enums/location-type.d.ts +6 -0
  66. package/types/enums/market-status.d.ts +4 -0
  67. package/types/enums/order-comment-visibility.d.ts +4 -0
  68. package/types/enums/order-item-type.d.ts +5 -0
  69. package/types/enums/order-payment-status.d.ts +9 -0
  70. package/types/enums/organization-status.d.ts +4 -0
  71. package/types/enums/page-status.d.ts +5 -0
  72. package/types/enums/payment-fee-type.d.ts +5 -0
  73. package/types/enums/payment-method-kind.d.ts +4 -0
  74. package/types/enums/price-entry-type.d.ts +4 -0
  75. package/types/enums/price-list-status.d.ts +4 -0
  76. package/types/enums/shipping-method-matrix-basis.d.ts +6 -0
  77. package/types/enums/shipping-method-pricing-type.d.ts +5 -0
  78. package/types/index.d.ts +30 -0
  79. package/types/models.d.ts +5470 -404
  80. package/types/services/carts.d.ts +271 -12
  81. package/types/services/channels.d.ts +54 -2
  82. package/types/services/customers.d.ts +295 -12
  83. package/types/services/inventories.d.ts +440 -0
  84. package/types/services/markets.d.ts +123 -6
  85. package/types/services/orders.d.ts +590 -0
  86. package/types/services/pages.d.ts +792 -0
  87. package/types/services/payments.d.ts +480 -0
  88. package/types/services/prices.d.ts +384 -0
  89. package/types/services/products.d.ts +646 -32
  90. package/types/services/shipping.d.ts +351 -0
@@ -0,0 +1,1036 @@
1
+ import { Service } from '../service';
2
+ import { RevenexxException, Client, type Payload, UploadProgress } from '../client';
3
+ import type { Models } from '../models';
4
+
5
+ import { PriceListStatus } from '../enums/price-list-status';
6
+ import { PriceEntryType } from '../enums/price-entry-type';
7
+
8
+ export class Prices {
9
+ client: Client;
10
+
11
+ constructor(client: Client) {
12
+ this.client = client;
13
+ }
14
+
15
+ /**
16
+ *
17
+ * @throws {RevenexxException}
18
+ * @returns {Promise<{}>}
19
+ */
20
+ pricesListsList(): Promise<{}> {
21
+
22
+ const apiPath = '/v1/prices/lists';
23
+ const apiPayload: Payload = {};
24
+ const uri = new URL(this.client.config.endpoint + apiPath);
25
+
26
+ const apiHeaders: { [header: string]: string } = {
27
+ }
28
+
29
+ return this.client.call(
30
+ 'get',
31
+ uri,
32
+ apiHeaders,
33
+ apiPayload
34
+ );
35
+ }
36
+
37
+ /**
38
+ *
39
+ * @param {string} params.code - Unique list code per tenant.
40
+ * @param {string} params.name -
41
+ * @param {string} params.channelId - Scope: only this channel.
42
+ * @param {string} params.contactId - Scope: only this contact — beats every other scope.
43
+ * @param {string} params.currency - ISO 4217 code (default EUR) — resolution only considers lists matching the requested currency.
44
+ * @param {string} params.description -
45
+ * @param {boolean} params.isDefault - Default lists resolve last within their group.
46
+ * @param {object} params.labels - Localised names ({de, en, …}).
47
+ * @param {string} params.marketId - Scope: only this market.
48
+ * @param {object} params.metadata - Free-form metadata.
49
+ * @param {string} params.organizationId - Scope: only this organization.
50
+ * @param {number} params.priority - Tie-breaker within a specificity group (higher wins, default 0).
51
+ * @param {PriceListStatus} params.status - Default 'active' — only active lists resolve.
52
+ * @param {boolean} params.taxIncluded - Gross (true) or net (false, default) prices.
53
+ * @param {string} params.validFrom - Validity window start.
54
+ * @param {string} params.validUntil - Validity window end.
55
+ * @throws {RevenexxException}
56
+ * @returns {Promise<Models.PriceList>}
57
+ */
58
+ pricesListsCreate(params: { code: string, name: string, channelId?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, marketId?: string, metadata?: object, organizationId?: string, priority?: number, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string }): Promise<Models.PriceList>;
59
+ /**
60
+ *
61
+ * @param {string} code - Unique list code per tenant.
62
+ * @param {string} name -
63
+ * @param {string} channelId - Scope: only this channel.
64
+ * @param {string} contactId - Scope: only this contact — beats every other scope.
65
+ * @param {string} currency - ISO 4217 code (default EUR) — resolution only considers lists matching the requested currency.
66
+ * @param {string} description -
67
+ * @param {boolean} isDefault - Default lists resolve last within their group.
68
+ * @param {object} labels - Localised names ({de, en, …}).
69
+ * @param {string} marketId - Scope: only this market.
70
+ * @param {object} metadata - Free-form metadata.
71
+ * @param {string} organizationId - Scope: only this organization.
72
+ * @param {number} priority - Tie-breaker within a specificity group (higher wins, default 0).
73
+ * @param {PriceListStatus} status - Default 'active' — only active lists resolve.
74
+ * @param {boolean} taxIncluded - Gross (true) or net (false, default) prices.
75
+ * @param {string} validFrom - Validity window start.
76
+ * @param {string} validUntil - Validity window end.
77
+ * @throws {RevenexxException}
78
+ * @returns {Promise<Models.PriceList>}
79
+ * @deprecated Use the object parameter style method for a better developer experience.
80
+ */
81
+ pricesListsCreate(code: string, name: string, channelId?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, marketId?: string, metadata?: object, organizationId?: string, priority?: number, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string): Promise<Models.PriceList>;
82
+ pricesListsCreate(
83
+ paramsOrFirst: { code: string, name: string, channelId?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, marketId?: string, metadata?: object, organizationId?: string, priority?: number, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string } | string,
84
+ ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (object)?, (string)?, (object)?, (string)?, (number)?, (PriceListStatus)?, (boolean)?, (string)?, (string)?]
85
+ ): Promise<Models.PriceList> {
86
+ let params: { code: string, name: string, channelId?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, marketId?: string, metadata?: object, organizationId?: string, priority?: number, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string };
87
+
88
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
89
+ params = (paramsOrFirst || {}) as { code: string, name: string, channelId?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, marketId?: string, metadata?: object, organizationId?: string, priority?: number, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string };
90
+ } else {
91
+ params = {
92
+ code: paramsOrFirst as string,
93
+ name: rest[0] as string,
94
+ channelId: rest[1] as string,
95
+ contactId: rest[2] as string,
96
+ currency: rest[3] as string,
97
+ description: rest[4] as string,
98
+ isDefault: rest[5] as boolean,
99
+ labels: rest[6] as object,
100
+ marketId: rest[7] as string,
101
+ metadata: rest[8] as object,
102
+ organizationId: rest[9] as string,
103
+ priority: rest[10] as number,
104
+ status: rest[11] as PriceListStatus,
105
+ taxIncluded: rest[12] as boolean,
106
+ validFrom: rest[13] as string,
107
+ validUntil: rest[14] as string
108
+ };
109
+ }
110
+
111
+ const code = params.code;
112
+ const name = params.name;
113
+ const channelId = params.channelId;
114
+ const contactId = params.contactId;
115
+ const currency = params.currency;
116
+ const description = params.description;
117
+ const isDefault = params.isDefault;
118
+ const labels = params.labels;
119
+ const marketId = params.marketId;
120
+ const metadata = params.metadata;
121
+ const organizationId = params.organizationId;
122
+ const priority = params.priority;
123
+ const status = params.status;
124
+ const taxIncluded = params.taxIncluded;
125
+ const validFrom = params.validFrom;
126
+ const validUntil = params.validUntil;
127
+
128
+ if (typeof code === 'undefined') {
129
+ throw new RevenexxException('Missing required parameter: "code"');
130
+ }
131
+ if (typeof name === 'undefined') {
132
+ throw new RevenexxException('Missing required parameter: "name"');
133
+ }
134
+
135
+ const apiPath = '/v1/prices/lists';
136
+ const apiPayload: Payload = {};
137
+ if (typeof channelId !== 'undefined') {
138
+ apiPayload['channel_id'] = channelId;
139
+ }
140
+ if (typeof code !== 'undefined') {
141
+ apiPayload['code'] = code;
142
+ }
143
+ if (typeof contactId !== 'undefined') {
144
+ apiPayload['contact_id'] = contactId;
145
+ }
146
+ if (typeof currency !== 'undefined') {
147
+ apiPayload['currency'] = currency;
148
+ }
149
+ if (typeof description !== 'undefined') {
150
+ apiPayload['description'] = description;
151
+ }
152
+ if (typeof isDefault !== 'undefined') {
153
+ apiPayload['is_default'] = isDefault;
154
+ }
155
+ if (typeof labels !== 'undefined') {
156
+ apiPayload['labels'] = labels;
157
+ }
158
+ if (typeof marketId !== 'undefined') {
159
+ apiPayload['market_id'] = marketId;
160
+ }
161
+ if (typeof metadata !== 'undefined') {
162
+ apiPayload['metadata'] = metadata;
163
+ }
164
+ if (typeof name !== 'undefined') {
165
+ apiPayload['name'] = name;
166
+ }
167
+ if (typeof organizationId !== 'undefined') {
168
+ apiPayload['organization_id'] = organizationId;
169
+ }
170
+ if (typeof priority !== 'undefined') {
171
+ apiPayload['priority'] = priority;
172
+ }
173
+ if (typeof status !== 'undefined') {
174
+ apiPayload['status'] = status;
175
+ }
176
+ if (typeof taxIncluded !== 'undefined') {
177
+ apiPayload['tax_included'] = taxIncluded;
178
+ }
179
+ if (typeof validFrom !== 'undefined') {
180
+ apiPayload['valid_from'] = validFrom;
181
+ }
182
+ if (typeof validUntil !== 'undefined') {
183
+ apiPayload['valid_until'] = validUntil;
184
+ }
185
+ const uri = new URL(this.client.config.endpoint + apiPath);
186
+
187
+ const apiHeaders: { [header: string]: string } = {
188
+ 'content-type': 'application/json',
189
+ }
190
+
191
+ return this.client.call(
192
+ 'post',
193
+ uri,
194
+ apiHeaders,
195
+ apiPayload
196
+ );
197
+ }
198
+
199
+ /**
200
+ *
201
+ * @throws {RevenexxException}
202
+ * @returns {Promise<{}>}
203
+ */
204
+ pricesListsDefaults(): Promise<{}> {
205
+
206
+ const apiPath = '/v1/prices/lists/defaults';
207
+ const apiPayload: Payload = {};
208
+ const uri = new URL(this.client.config.endpoint + apiPath);
209
+
210
+ const apiHeaders: { [header: string]: string } = {
211
+ }
212
+
213
+ return this.client.call(
214
+ 'post',
215
+ uri,
216
+ apiHeaders,
217
+ apiPayload
218
+ );
219
+ }
220
+
221
+ /**
222
+ *
223
+ * @param {string} params.id -
224
+ * @throws {RevenexxException}
225
+ * @returns {Promise<{}>}
226
+ */
227
+ pricesListsDelete(params: { id: string }): Promise<{}>;
228
+ /**
229
+ *
230
+ * @param {string} id -
231
+ * @throws {RevenexxException}
232
+ * @returns {Promise<{}>}
233
+ * @deprecated Use the object parameter style method for a better developer experience.
234
+ */
235
+ pricesListsDelete(id: string): Promise<{}>;
236
+ pricesListsDelete(
237
+ paramsOrFirst: { id: string } | string
238
+ ): Promise<{}> {
239
+ let params: { id: string };
240
+
241
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
242
+ params = (paramsOrFirst || {}) as { id: string };
243
+ } else {
244
+ params = {
245
+ id: paramsOrFirst as string
246
+ };
247
+ }
248
+
249
+ const id = params.id;
250
+
251
+ if (typeof id === 'undefined') {
252
+ throw new RevenexxException('Missing required parameter: "id"');
253
+ }
254
+
255
+ const apiPath = '/v1/prices/lists/{id}'.replace('{id}', id);
256
+ const apiPayload: Payload = {};
257
+ const uri = new URL(this.client.config.endpoint + apiPath);
258
+
259
+ const apiHeaders: { [header: string]: string } = {
260
+ }
261
+
262
+ return this.client.call(
263
+ 'delete',
264
+ uri,
265
+ apiHeaders,
266
+ apiPayload
267
+ );
268
+ }
269
+
270
+ /**
271
+ *
272
+ * @param {string} params.id -
273
+ * @throws {RevenexxException}
274
+ * @returns {Promise<Models.PriceList>}
275
+ */
276
+ pricesListsGet(params: { id: string }): Promise<Models.PriceList>;
277
+ /**
278
+ *
279
+ * @param {string} id -
280
+ * @throws {RevenexxException}
281
+ * @returns {Promise<Models.PriceList>}
282
+ * @deprecated Use the object parameter style method for a better developer experience.
283
+ */
284
+ pricesListsGet(id: string): Promise<Models.PriceList>;
285
+ pricesListsGet(
286
+ paramsOrFirst: { id: string } | string
287
+ ): Promise<Models.PriceList> {
288
+ let params: { id: string };
289
+
290
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
291
+ params = (paramsOrFirst || {}) as { id: string };
292
+ } else {
293
+ params = {
294
+ id: paramsOrFirst as string
295
+ };
296
+ }
297
+
298
+ const id = params.id;
299
+
300
+ if (typeof id === 'undefined') {
301
+ throw new RevenexxException('Missing required parameter: "id"');
302
+ }
303
+
304
+ const apiPath = '/v1/prices/lists/{id}'.replace('{id}', id);
305
+ const apiPayload: Payload = {};
306
+ const uri = new URL(this.client.config.endpoint + apiPath);
307
+
308
+ const apiHeaders: { [header: string]: string } = {
309
+ }
310
+
311
+ return this.client.call(
312
+ 'get',
313
+ uri,
314
+ apiHeaders,
315
+ apiPayload
316
+ );
317
+ }
318
+
319
+ /**
320
+ *
321
+ * @param {string} params.id -
322
+ * @param {string} params.channelId - Scope: only this channel.
323
+ * @param {string} params.code - Unique list code per tenant.
324
+ * @param {string} params.contactId - Scope: only this contact — beats every other scope.
325
+ * @param {string} params.currency - ISO 4217 code (default EUR) — resolution only considers lists matching the requested currency.
326
+ * @param {string} params.description -
327
+ * @param {boolean} params.isDefault - Default lists resolve last within their group.
328
+ * @param {object} params.labels - Localised names ({de, en, …}).
329
+ * @param {string} params.marketId - Scope: only this market.
330
+ * @param {object} params.metadata - Free-form metadata.
331
+ * @param {string} params.name -
332
+ * @param {string} params.organizationId - Scope: only this organization.
333
+ * @param {number} params.priority - Tie-breaker within a specificity group (higher wins, default 0).
334
+ * @param {PriceListStatus} params.status - Default 'active' — only active lists resolve.
335
+ * @param {boolean} params.taxIncluded - Gross (true) or net (false, default) prices.
336
+ * @param {string} params.validFrom - Validity window start.
337
+ * @param {string} params.validUntil - Validity window end.
338
+ * @throws {RevenexxException}
339
+ * @returns {Promise<Models.PriceList>}
340
+ */
341
+ pricesListsUpdate(params: { id: string, channelId?: string, code?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, marketId?: string, metadata?: object, name?: string, organizationId?: string, priority?: number, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string }): Promise<Models.PriceList>;
342
+ /**
343
+ *
344
+ * @param {string} id -
345
+ * @param {string} channelId - Scope: only this channel.
346
+ * @param {string} code - Unique list code per tenant.
347
+ * @param {string} contactId - Scope: only this contact — beats every other scope.
348
+ * @param {string} currency - ISO 4217 code (default EUR) — resolution only considers lists matching the requested currency.
349
+ * @param {string} description -
350
+ * @param {boolean} isDefault - Default lists resolve last within their group.
351
+ * @param {object} labels - Localised names ({de, en, …}).
352
+ * @param {string} marketId - Scope: only this market.
353
+ * @param {object} metadata - Free-form metadata.
354
+ * @param {string} name -
355
+ * @param {string} organizationId - Scope: only this organization.
356
+ * @param {number} priority - Tie-breaker within a specificity group (higher wins, default 0).
357
+ * @param {PriceListStatus} status - Default 'active' — only active lists resolve.
358
+ * @param {boolean} taxIncluded - Gross (true) or net (false, default) prices.
359
+ * @param {string} validFrom - Validity window start.
360
+ * @param {string} validUntil - Validity window end.
361
+ * @throws {RevenexxException}
362
+ * @returns {Promise<Models.PriceList>}
363
+ * @deprecated Use the object parameter style method for a better developer experience.
364
+ */
365
+ pricesListsUpdate(id: string, channelId?: string, code?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, marketId?: string, metadata?: object, name?: string, organizationId?: string, priority?: number, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string): Promise<Models.PriceList>;
366
+ pricesListsUpdate(
367
+ paramsOrFirst: { id: string, channelId?: string, code?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, marketId?: string, metadata?: object, name?: string, organizationId?: string, priority?: number, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string } | string,
368
+ ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (object)?, (string)?, (object)?, (string)?, (string)?, (number)?, (PriceListStatus)?, (boolean)?, (string)?, (string)?]
369
+ ): Promise<Models.PriceList> {
370
+ let params: { id: string, channelId?: string, code?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, marketId?: string, metadata?: object, name?: string, organizationId?: string, priority?: number, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string };
371
+
372
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
373
+ params = (paramsOrFirst || {}) as { id: string, channelId?: string, code?: string, contactId?: string, currency?: string, description?: string, isDefault?: boolean, labels?: object, marketId?: string, metadata?: object, name?: string, organizationId?: string, priority?: number, status?: PriceListStatus, taxIncluded?: boolean, validFrom?: string, validUntil?: string };
374
+ } else {
375
+ params = {
376
+ id: paramsOrFirst as string,
377
+ channelId: rest[0] as string,
378
+ code: rest[1] as string,
379
+ contactId: rest[2] as string,
380
+ currency: rest[3] as string,
381
+ description: rest[4] as string,
382
+ isDefault: rest[5] as boolean,
383
+ labels: rest[6] as object,
384
+ marketId: rest[7] as string,
385
+ metadata: rest[8] as object,
386
+ name: rest[9] as string,
387
+ organizationId: rest[10] as string,
388
+ priority: rest[11] as number,
389
+ status: rest[12] as PriceListStatus,
390
+ taxIncluded: rest[13] as boolean,
391
+ validFrom: rest[14] as string,
392
+ validUntil: rest[15] as string
393
+ };
394
+ }
395
+
396
+ const id = params.id;
397
+ const channelId = params.channelId;
398
+ const code = params.code;
399
+ const contactId = params.contactId;
400
+ const currency = params.currency;
401
+ const description = params.description;
402
+ const isDefault = params.isDefault;
403
+ const labels = params.labels;
404
+ const marketId = params.marketId;
405
+ const metadata = params.metadata;
406
+ const name = params.name;
407
+ const organizationId = params.organizationId;
408
+ const priority = params.priority;
409
+ const status = params.status;
410
+ const taxIncluded = params.taxIncluded;
411
+ const validFrom = params.validFrom;
412
+ const validUntil = params.validUntil;
413
+
414
+ if (typeof id === 'undefined') {
415
+ throw new RevenexxException('Missing required parameter: "id"');
416
+ }
417
+
418
+ const apiPath = '/v1/prices/lists/{id}'.replace('{id}', id);
419
+ const apiPayload: Payload = {};
420
+ if (typeof channelId !== 'undefined') {
421
+ apiPayload['channel_id'] = channelId;
422
+ }
423
+ if (typeof code !== 'undefined') {
424
+ apiPayload['code'] = code;
425
+ }
426
+ if (typeof contactId !== 'undefined') {
427
+ apiPayload['contact_id'] = contactId;
428
+ }
429
+ if (typeof currency !== 'undefined') {
430
+ apiPayload['currency'] = currency;
431
+ }
432
+ if (typeof description !== 'undefined') {
433
+ apiPayload['description'] = description;
434
+ }
435
+ if (typeof isDefault !== 'undefined') {
436
+ apiPayload['is_default'] = isDefault;
437
+ }
438
+ if (typeof labels !== 'undefined') {
439
+ apiPayload['labels'] = labels;
440
+ }
441
+ if (typeof marketId !== 'undefined') {
442
+ apiPayload['market_id'] = marketId;
443
+ }
444
+ if (typeof metadata !== 'undefined') {
445
+ apiPayload['metadata'] = metadata;
446
+ }
447
+ if (typeof name !== 'undefined') {
448
+ apiPayload['name'] = name;
449
+ }
450
+ if (typeof organizationId !== 'undefined') {
451
+ apiPayload['organization_id'] = organizationId;
452
+ }
453
+ if (typeof priority !== 'undefined') {
454
+ apiPayload['priority'] = priority;
455
+ }
456
+ if (typeof status !== 'undefined') {
457
+ apiPayload['status'] = status;
458
+ }
459
+ if (typeof taxIncluded !== 'undefined') {
460
+ apiPayload['tax_included'] = taxIncluded;
461
+ }
462
+ if (typeof validFrom !== 'undefined') {
463
+ apiPayload['valid_from'] = validFrom;
464
+ }
465
+ if (typeof validUntil !== 'undefined') {
466
+ apiPayload['valid_until'] = validUntil;
467
+ }
468
+ const uri = new URL(this.client.config.endpoint + apiPath);
469
+
470
+ const apiHeaders: { [header: string]: string } = {
471
+ 'content-type': 'application/json',
472
+ }
473
+
474
+ return this.client.call(
475
+ 'put',
476
+ uri,
477
+ apiHeaders,
478
+ apiPayload
479
+ );
480
+ }
481
+
482
+ /**
483
+ *
484
+ * @param {string} params.listId -
485
+ * @throws {RevenexxException}
486
+ * @returns {Promise<{}>}
487
+ */
488
+ pricesEntriesList(params: { listId: string }): Promise<{}>;
489
+ /**
490
+ *
491
+ * @param {string} listId -
492
+ * @throws {RevenexxException}
493
+ * @returns {Promise<{}>}
494
+ * @deprecated Use the object parameter style method for a better developer experience.
495
+ */
496
+ pricesEntriesList(listId: string): Promise<{}>;
497
+ pricesEntriesList(
498
+ paramsOrFirst: { listId: string } | string
499
+ ): Promise<{}> {
500
+ let params: { listId: string };
501
+
502
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
503
+ params = (paramsOrFirst || {}) as { listId: string };
504
+ } else {
505
+ params = {
506
+ listId: paramsOrFirst as string
507
+ };
508
+ }
509
+
510
+ const listId = params.listId;
511
+
512
+ if (typeof listId === 'undefined') {
513
+ throw new RevenexxException('Missing required parameter: "listId"');
514
+ }
515
+
516
+ const apiPath = '/v1/prices/lists/{list_id}/entries'.replace('{list_id}', listId);
517
+ const apiPayload: Payload = {};
518
+ const uri = new URL(this.client.config.endpoint + apiPath);
519
+
520
+ const apiHeaders: { [header: string]: string } = {
521
+ }
522
+
523
+ return this.client.call(
524
+ 'get',
525
+ uri,
526
+ apiHeaders,
527
+ apiPayload
528
+ );
529
+ }
530
+
531
+ /**
532
+ *
533
+ * @param {string} params.listId -
534
+ * @param {object} params.metadata - Free-form metadata.
535
+ * @param {PriceEntryType} params.priceType - Default 'standard'; 'on_request' is the explicit no-price marker — it stops resolution and answers "price on request".
536
+ * @param {string} params.productId - Priced product.
537
+ * @param {number} params.quantityMin - Tier threshold (Staffelpreis): this price applies from this quantity (default 1).
538
+ * @param {string} params.sku - Priced SKU (alternative to product_id).
539
+ * @param {string} params.unit -
540
+ * @param {number} params.unitPrice - Per-unit price (default 0).
541
+ * @param {string} params.validFrom - Per-entry validity start (promo prices).
542
+ * @param {string} params.validUntil - Per-entry validity end.
543
+ * @throws {RevenexxException}
544
+ * @returns {Promise<Models.PriceEntry>}
545
+ */
546
+ pricesEntriesCreate(params: { listId: string, metadata?: object, priceType?: PriceEntryType, productId?: string, quantityMin?: number, sku?: string, unit?: string, unitPrice?: number, validFrom?: string, validUntil?: string }): Promise<Models.PriceEntry>;
547
+ /**
548
+ *
549
+ * @param {string} listId -
550
+ * @param {object} metadata - Free-form metadata.
551
+ * @param {PriceEntryType} priceType - Default 'standard'; 'on_request' is the explicit no-price marker — it stops resolution and answers "price on request".
552
+ * @param {string} productId - Priced product.
553
+ * @param {number} quantityMin - Tier threshold (Staffelpreis): this price applies from this quantity (default 1).
554
+ * @param {string} sku - Priced SKU (alternative to product_id).
555
+ * @param {string} unit -
556
+ * @param {number} unitPrice - Per-unit price (default 0).
557
+ * @param {string} validFrom - Per-entry validity start (promo prices).
558
+ * @param {string} validUntil - Per-entry validity end.
559
+ * @throws {RevenexxException}
560
+ * @returns {Promise<Models.PriceEntry>}
561
+ * @deprecated Use the object parameter style method for a better developer experience.
562
+ */
563
+ pricesEntriesCreate(listId: string, metadata?: object, priceType?: PriceEntryType, productId?: string, quantityMin?: number, sku?: string, unit?: string, unitPrice?: number, validFrom?: string, validUntil?: string): Promise<Models.PriceEntry>;
564
+ pricesEntriesCreate(
565
+ paramsOrFirst: { listId: string, metadata?: object, priceType?: PriceEntryType, productId?: string, quantityMin?: number, sku?: string, unit?: string, unitPrice?: number, validFrom?: string, validUntil?: string } | string,
566
+ ...rest: [(object)?, (PriceEntryType)?, (string)?, (number)?, (string)?, (string)?, (number)?, (string)?, (string)?]
567
+ ): Promise<Models.PriceEntry> {
568
+ let params: { listId: string, metadata?: object, priceType?: PriceEntryType, productId?: string, quantityMin?: number, sku?: string, unit?: string, unitPrice?: number, validFrom?: string, validUntil?: string };
569
+
570
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
571
+ params = (paramsOrFirst || {}) as { listId: string, metadata?: object, priceType?: PriceEntryType, productId?: string, quantityMin?: number, sku?: string, unit?: string, unitPrice?: number, validFrom?: string, validUntil?: string };
572
+ } else {
573
+ params = {
574
+ listId: paramsOrFirst as string,
575
+ metadata: rest[0] as object,
576
+ priceType: rest[1] as PriceEntryType,
577
+ productId: rest[2] as string,
578
+ quantityMin: rest[3] as number,
579
+ sku: rest[4] as string,
580
+ unit: rest[5] as string,
581
+ unitPrice: rest[6] as number,
582
+ validFrom: rest[7] as string,
583
+ validUntil: rest[8] as string
584
+ };
585
+ }
586
+
587
+ const listId = params.listId;
588
+ const metadata = params.metadata;
589
+ const priceType = params.priceType;
590
+ const productId = params.productId;
591
+ const quantityMin = params.quantityMin;
592
+ const sku = params.sku;
593
+ const unit = params.unit;
594
+ const unitPrice = params.unitPrice;
595
+ const validFrom = params.validFrom;
596
+ const validUntil = params.validUntil;
597
+
598
+ if (typeof listId === 'undefined') {
599
+ throw new RevenexxException('Missing required parameter: "listId"');
600
+ }
601
+
602
+ const apiPath = '/v1/prices/lists/{list_id}/entries'.replace('{list_id}', listId);
603
+ const apiPayload: Payload = {};
604
+ if (typeof metadata !== 'undefined') {
605
+ apiPayload['metadata'] = metadata;
606
+ }
607
+ if (typeof priceType !== 'undefined') {
608
+ apiPayload['price_type'] = priceType;
609
+ }
610
+ if (typeof productId !== 'undefined') {
611
+ apiPayload['product_id'] = productId;
612
+ }
613
+ if (typeof quantityMin !== 'undefined') {
614
+ apiPayload['quantity_min'] = quantityMin;
615
+ }
616
+ if (typeof sku !== 'undefined') {
617
+ apiPayload['sku'] = sku;
618
+ }
619
+ if (typeof unit !== 'undefined') {
620
+ apiPayload['unit'] = unit;
621
+ }
622
+ if (typeof unitPrice !== 'undefined') {
623
+ apiPayload['unit_price'] = unitPrice;
624
+ }
625
+ if (typeof validFrom !== 'undefined') {
626
+ apiPayload['valid_from'] = validFrom;
627
+ }
628
+ if (typeof validUntil !== 'undefined') {
629
+ apiPayload['valid_until'] = validUntil;
630
+ }
631
+ const uri = new URL(this.client.config.endpoint + apiPath);
632
+
633
+ const apiHeaders: { [header: string]: string } = {
634
+ 'content-type': 'application/json',
635
+ }
636
+
637
+ return this.client.call(
638
+ 'post',
639
+ uri,
640
+ apiHeaders,
641
+ apiPayload
642
+ );
643
+ }
644
+
645
+ /**
646
+ *
647
+ * @param {string} params.listId -
648
+ * @param {Models.PriceEntryCreateRequest[]} params.entries - The complete new entry set (set semantics).
649
+ * @throws {RevenexxException}
650
+ * @returns {Promise<{}>}
651
+ */
652
+ pricesEntriesReplace(params: { listId: string, entries: Models.PriceEntryCreateRequest[] }): Promise<{}>;
653
+ /**
654
+ *
655
+ * @param {string} listId -
656
+ * @param {Models.PriceEntryCreateRequest[]} entries - The complete new entry set (set semantics).
657
+ * @throws {RevenexxException}
658
+ * @returns {Promise<{}>}
659
+ * @deprecated Use the object parameter style method for a better developer experience.
660
+ */
661
+ pricesEntriesReplace(listId: string, entries: Models.PriceEntryCreateRequest[]): Promise<{}>;
662
+ pricesEntriesReplace(
663
+ paramsOrFirst: { listId: string, entries: Models.PriceEntryCreateRequest[] } | string,
664
+ ...rest: [(Models.PriceEntryCreateRequest[])?]
665
+ ): Promise<{}> {
666
+ let params: { listId: string, entries: Models.PriceEntryCreateRequest[] };
667
+
668
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
669
+ params = (paramsOrFirst || {}) as { listId: string, entries: Models.PriceEntryCreateRequest[] };
670
+ } else {
671
+ params = {
672
+ listId: paramsOrFirst as string,
673
+ entries: rest[0] as Models.PriceEntryCreateRequest[]
674
+ };
675
+ }
676
+
677
+ const listId = params.listId;
678
+ const entries = params.entries;
679
+
680
+ if (typeof listId === 'undefined') {
681
+ throw new RevenexxException('Missing required parameter: "listId"');
682
+ }
683
+ if (typeof entries === 'undefined') {
684
+ throw new RevenexxException('Missing required parameter: "entries"');
685
+ }
686
+
687
+ const apiPath = '/v1/prices/lists/{list_id}/entries'.replace('{list_id}', listId);
688
+ const apiPayload: Payload = {};
689
+ if (typeof entries !== 'undefined') {
690
+ apiPayload['entries'] = entries;
691
+ }
692
+ const uri = new URL(this.client.config.endpoint + apiPath);
693
+
694
+ const apiHeaders: { [header: string]: string } = {
695
+ 'content-type': 'application/json',
696
+ }
697
+
698
+ return this.client.call(
699
+ 'put',
700
+ uri,
701
+ apiHeaders,
702
+ apiPayload
703
+ );
704
+ }
705
+
706
+ /**
707
+ *
708
+ * @param {string} params.listId -
709
+ * @param {string} params.id -
710
+ * @throws {RevenexxException}
711
+ * @returns {Promise<{}>}
712
+ */
713
+ pricesEntriesDelete(params: { listId: string, id: string }): Promise<{}>;
714
+ /**
715
+ *
716
+ * @param {string} listId -
717
+ * @param {string} id -
718
+ * @throws {RevenexxException}
719
+ * @returns {Promise<{}>}
720
+ * @deprecated Use the object parameter style method for a better developer experience.
721
+ */
722
+ pricesEntriesDelete(listId: string, id: string): Promise<{}>;
723
+ pricesEntriesDelete(
724
+ paramsOrFirst: { listId: string, id: string } | string,
725
+ ...rest: [(string)?]
726
+ ): Promise<{}> {
727
+ let params: { listId: string, id: string };
728
+
729
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
730
+ params = (paramsOrFirst || {}) as { listId: string, id: string };
731
+ } else {
732
+ params = {
733
+ listId: paramsOrFirst as string,
734
+ id: rest[0] as string
735
+ };
736
+ }
737
+
738
+ const listId = params.listId;
739
+ const id = params.id;
740
+
741
+ if (typeof listId === 'undefined') {
742
+ throw new RevenexxException('Missing required parameter: "listId"');
743
+ }
744
+ if (typeof id === 'undefined') {
745
+ throw new RevenexxException('Missing required parameter: "id"');
746
+ }
747
+
748
+ const apiPath = '/v1/prices/lists/{list_id}/entries/{id}'.replace('{list_id}', listId).replace('{id}', id);
749
+ const apiPayload: Payload = {};
750
+ const uri = new URL(this.client.config.endpoint + apiPath);
751
+
752
+ const apiHeaders: { [header: string]: string } = {
753
+ }
754
+
755
+ return this.client.call(
756
+ 'delete',
757
+ uri,
758
+ apiHeaders,
759
+ apiPayload
760
+ );
761
+ }
762
+
763
+ /**
764
+ *
765
+ * @param {string} params.listId -
766
+ * @param {string} params.id -
767
+ * @throws {RevenexxException}
768
+ * @returns {Promise<Models.PriceEntry>}
769
+ */
770
+ pricesEntriesGet(params: { listId: string, id: string }): Promise<Models.PriceEntry>;
771
+ /**
772
+ *
773
+ * @param {string} listId -
774
+ * @param {string} id -
775
+ * @throws {RevenexxException}
776
+ * @returns {Promise<Models.PriceEntry>}
777
+ * @deprecated Use the object parameter style method for a better developer experience.
778
+ */
779
+ pricesEntriesGet(listId: string, id: string): Promise<Models.PriceEntry>;
780
+ pricesEntriesGet(
781
+ paramsOrFirst: { listId: string, id: string } | string,
782
+ ...rest: [(string)?]
783
+ ): Promise<Models.PriceEntry> {
784
+ let params: { listId: string, id: string };
785
+
786
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
787
+ params = (paramsOrFirst || {}) as { listId: string, id: string };
788
+ } else {
789
+ params = {
790
+ listId: paramsOrFirst as string,
791
+ id: rest[0] as string
792
+ };
793
+ }
794
+
795
+ const listId = params.listId;
796
+ const id = params.id;
797
+
798
+ if (typeof listId === 'undefined') {
799
+ throw new RevenexxException('Missing required parameter: "listId"');
800
+ }
801
+ if (typeof id === 'undefined') {
802
+ throw new RevenexxException('Missing required parameter: "id"');
803
+ }
804
+
805
+ const apiPath = '/v1/prices/lists/{list_id}/entries/{id}'.replace('{list_id}', listId).replace('{id}', id);
806
+ const apiPayload: Payload = {};
807
+ const uri = new URL(this.client.config.endpoint + apiPath);
808
+
809
+ const apiHeaders: { [header: string]: string } = {
810
+ }
811
+
812
+ return this.client.call(
813
+ 'get',
814
+ uri,
815
+ apiHeaders,
816
+ apiPayload
817
+ );
818
+ }
819
+
820
+ /**
821
+ *
822
+ * @param {string} params.listId -
823
+ * @param {string} params.id -
824
+ * @param {object} params.metadata - Free-form metadata.
825
+ * @param {PriceEntryType} params.priceType - Default 'standard'; 'on_request' is the explicit no-price marker — it stops resolution and answers "price on request".
826
+ * @param {string} params.productId - Priced product.
827
+ * @param {number} params.quantityMin - Tier threshold (Staffelpreis): this price applies from this quantity (default 1).
828
+ * @param {string} params.sku - Priced SKU (alternative to product_id).
829
+ * @param {string} params.unit -
830
+ * @param {number} params.unitPrice - Per-unit price (default 0).
831
+ * @param {string} params.validFrom - Per-entry validity start (promo prices).
832
+ * @param {string} params.validUntil - Per-entry validity end.
833
+ * @throws {RevenexxException}
834
+ * @returns {Promise<Models.PriceEntry>}
835
+ */
836
+ pricesEntriesUpdate(params: { listId: string, id: string, metadata?: object, priceType?: PriceEntryType, productId?: string, quantityMin?: number, sku?: string, unit?: string, unitPrice?: number, validFrom?: string, validUntil?: string }): Promise<Models.PriceEntry>;
837
+ /**
838
+ *
839
+ * @param {string} listId -
840
+ * @param {string} id -
841
+ * @param {object} metadata - Free-form metadata.
842
+ * @param {PriceEntryType} priceType - Default 'standard'; 'on_request' is the explicit no-price marker — it stops resolution and answers "price on request".
843
+ * @param {string} productId - Priced product.
844
+ * @param {number} quantityMin - Tier threshold (Staffelpreis): this price applies from this quantity (default 1).
845
+ * @param {string} sku - Priced SKU (alternative to product_id).
846
+ * @param {string} unit -
847
+ * @param {number} unitPrice - Per-unit price (default 0).
848
+ * @param {string} validFrom - Per-entry validity start (promo prices).
849
+ * @param {string} validUntil - Per-entry validity end.
850
+ * @throws {RevenexxException}
851
+ * @returns {Promise<Models.PriceEntry>}
852
+ * @deprecated Use the object parameter style method for a better developer experience.
853
+ */
854
+ pricesEntriesUpdate(listId: string, id: string, metadata?: object, priceType?: PriceEntryType, productId?: string, quantityMin?: number, sku?: string, unit?: string, unitPrice?: number, validFrom?: string, validUntil?: string): Promise<Models.PriceEntry>;
855
+ pricesEntriesUpdate(
856
+ paramsOrFirst: { listId: string, id: string, metadata?: object, priceType?: PriceEntryType, productId?: string, quantityMin?: number, sku?: string, unit?: string, unitPrice?: number, validFrom?: string, validUntil?: string } | string,
857
+ ...rest: [(string)?, (object)?, (PriceEntryType)?, (string)?, (number)?, (string)?, (string)?, (number)?, (string)?, (string)?]
858
+ ): Promise<Models.PriceEntry> {
859
+ let params: { listId: string, id: string, metadata?: object, priceType?: PriceEntryType, productId?: string, quantityMin?: number, sku?: string, unit?: string, unitPrice?: number, validFrom?: string, validUntil?: string };
860
+
861
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
862
+ params = (paramsOrFirst || {}) as { listId: string, id: string, metadata?: object, priceType?: PriceEntryType, productId?: string, quantityMin?: number, sku?: string, unit?: string, unitPrice?: number, validFrom?: string, validUntil?: string };
863
+ } else {
864
+ params = {
865
+ listId: paramsOrFirst as string,
866
+ id: rest[0] as string,
867
+ metadata: rest[1] as object,
868
+ priceType: rest[2] as PriceEntryType,
869
+ productId: rest[3] as string,
870
+ quantityMin: rest[4] as number,
871
+ sku: rest[5] as string,
872
+ unit: rest[6] as string,
873
+ unitPrice: rest[7] as number,
874
+ validFrom: rest[8] as string,
875
+ validUntil: rest[9] as string
876
+ };
877
+ }
878
+
879
+ const listId = params.listId;
880
+ const id = params.id;
881
+ const metadata = params.metadata;
882
+ const priceType = params.priceType;
883
+ const productId = params.productId;
884
+ const quantityMin = params.quantityMin;
885
+ const sku = params.sku;
886
+ const unit = params.unit;
887
+ const unitPrice = params.unitPrice;
888
+ const validFrom = params.validFrom;
889
+ const validUntil = params.validUntil;
890
+
891
+ if (typeof listId === 'undefined') {
892
+ throw new RevenexxException('Missing required parameter: "listId"');
893
+ }
894
+ if (typeof id === 'undefined') {
895
+ throw new RevenexxException('Missing required parameter: "id"');
896
+ }
897
+
898
+ const apiPath = '/v1/prices/lists/{list_id}/entries/{id}'.replace('{list_id}', listId).replace('{id}', id);
899
+ const apiPayload: Payload = {};
900
+ if (typeof metadata !== 'undefined') {
901
+ apiPayload['metadata'] = metadata;
902
+ }
903
+ if (typeof priceType !== 'undefined') {
904
+ apiPayload['price_type'] = priceType;
905
+ }
906
+ if (typeof productId !== 'undefined') {
907
+ apiPayload['product_id'] = productId;
908
+ }
909
+ if (typeof quantityMin !== 'undefined') {
910
+ apiPayload['quantity_min'] = quantityMin;
911
+ }
912
+ if (typeof sku !== 'undefined') {
913
+ apiPayload['sku'] = sku;
914
+ }
915
+ if (typeof unit !== 'undefined') {
916
+ apiPayload['unit'] = unit;
917
+ }
918
+ if (typeof unitPrice !== 'undefined') {
919
+ apiPayload['unit_price'] = unitPrice;
920
+ }
921
+ if (typeof validFrom !== 'undefined') {
922
+ apiPayload['valid_from'] = validFrom;
923
+ }
924
+ if (typeof validUntil !== 'undefined') {
925
+ apiPayload['valid_until'] = validUntil;
926
+ }
927
+ const uri = new URL(this.client.config.endpoint + apiPath);
928
+
929
+ const apiHeaders: { [header: string]: string } = {
930
+ 'content-type': 'application/json',
931
+ }
932
+
933
+ return this.client.call(
934
+ 'put',
935
+ uri,
936
+ apiHeaders,
937
+ apiPayload
938
+ );
939
+ }
940
+
941
+ /**
942
+ *
943
+ * @param {Models.PriceResolveItem[]} params.items - Items to price (at most 200 per call).
944
+ * @param {string} params.at - Point in time for validity windows (ISO 8601 timestamp, default now).
945
+ * @param {string} params.channelId - Buyer context: channel.
946
+ * @param {string} params.contactId - Buyer context: contact — most specific scope.
947
+ * @param {string} params.currency - ISO 4217 code (default EUR) — only lists in this currency resolve.
948
+ * @param {string} params.marketId - Buyer context: market.
949
+ * @param {string} params.organizationId - Buyer context: organization.
950
+ * @throws {RevenexxException}
951
+ * @returns {Promise<{}>}
952
+ */
953
+ pricesResolve(params: { items: Models.PriceResolveItem[], at?: string, channelId?: string, contactId?: string, currency?: string, marketId?: string, organizationId?: string }): Promise<{}>;
954
+ /**
955
+ *
956
+ * @param {Models.PriceResolveItem[]} items - Items to price (at most 200 per call).
957
+ * @param {string} at - Point in time for validity windows (ISO 8601 timestamp, default now).
958
+ * @param {string} channelId - Buyer context: channel.
959
+ * @param {string} contactId - Buyer context: contact — most specific scope.
960
+ * @param {string} currency - ISO 4217 code (default EUR) — only lists in this currency resolve.
961
+ * @param {string} marketId - Buyer context: market.
962
+ * @param {string} organizationId - Buyer context: organization.
963
+ * @throws {RevenexxException}
964
+ * @returns {Promise<{}>}
965
+ * @deprecated Use the object parameter style method for a better developer experience.
966
+ */
967
+ pricesResolve(items: Models.PriceResolveItem[], at?: string, channelId?: string, contactId?: string, currency?: string, marketId?: string, organizationId?: string): Promise<{}>;
968
+ pricesResolve(
969
+ paramsOrFirst: { items: Models.PriceResolveItem[], at?: string, channelId?: string, contactId?: string, currency?: string, marketId?: string, organizationId?: string } | Models.PriceResolveItem[],
970
+ ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?]
971
+ ): Promise<{}> {
972
+ let params: { items: Models.PriceResolveItem[], at?: string, channelId?: string, contactId?: string, currency?: string, marketId?: string, organizationId?: string };
973
+
974
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('items' in paramsOrFirst || 'at' in paramsOrFirst || 'channelId' in paramsOrFirst || 'contactId' in paramsOrFirst || 'currency' in paramsOrFirst || 'marketId' in paramsOrFirst || 'organizationId' in paramsOrFirst))) {
975
+ params = (paramsOrFirst || {}) as { items: Models.PriceResolveItem[], at?: string, channelId?: string, contactId?: string, currency?: string, marketId?: string, organizationId?: string };
976
+ } else {
977
+ params = {
978
+ items: paramsOrFirst as Models.PriceResolveItem[],
979
+ at: rest[0] as string,
980
+ channelId: rest[1] as string,
981
+ contactId: rest[2] as string,
982
+ currency: rest[3] as string,
983
+ marketId: rest[4] as string,
984
+ organizationId: rest[5] as string
985
+ };
986
+ }
987
+
988
+ const items = params.items;
989
+ const at = params.at;
990
+ const channelId = params.channelId;
991
+ const contactId = params.contactId;
992
+ const currency = params.currency;
993
+ const marketId = params.marketId;
994
+ const organizationId = params.organizationId;
995
+
996
+ if (typeof items === 'undefined') {
997
+ throw new RevenexxException('Missing required parameter: "items"');
998
+ }
999
+
1000
+ const apiPath = '/v1/prices/resolve';
1001
+ const apiPayload: Payload = {};
1002
+ if (typeof at !== 'undefined') {
1003
+ apiPayload['at'] = at;
1004
+ }
1005
+ if (typeof channelId !== 'undefined') {
1006
+ apiPayload['channel_id'] = channelId;
1007
+ }
1008
+ if (typeof contactId !== 'undefined') {
1009
+ apiPayload['contact_id'] = contactId;
1010
+ }
1011
+ if (typeof currency !== 'undefined') {
1012
+ apiPayload['currency'] = currency;
1013
+ }
1014
+ if (typeof items !== 'undefined') {
1015
+ apiPayload['items'] = items;
1016
+ }
1017
+ if (typeof marketId !== 'undefined') {
1018
+ apiPayload['market_id'] = marketId;
1019
+ }
1020
+ if (typeof organizationId !== 'undefined') {
1021
+ apiPayload['organization_id'] = organizationId;
1022
+ }
1023
+ const uri = new URL(this.client.config.endpoint + apiPath);
1024
+
1025
+ const apiHeaders: { [header: string]: string } = {
1026
+ 'content-type': 'application/json',
1027
+ }
1028
+
1029
+ return this.client.call(
1030
+ 'post',
1031
+ uri,
1032
+ apiHeaders,
1033
+ apiPayload
1034
+ );
1035
+ }
1036
+ }