@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
@@ -2,6 +2,10 @@ 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 { AddressType } from '../enums/address-type';
6
+ import { ContactRole } from '../enums/contact-role';
7
+ import { ContactStatus } from '../enums/contact-status';
8
+ import { OrganizationStatus } from '../enums/organization-status';
5
9
 
6
10
  export class Customers {
7
11
  client: Client;
@@ -18,7 +22,7 @@ export class Customers {
18
22
  customersAddressesList(): Promise<{}> {
19
23
 
20
24
  const apiPath = '/v1/customers/addresses';
21
- const payload: Payload = {};
25
+ const apiPayload: Payload = {};
22
26
  const uri = new URL(this.client.config.endpoint + apiPath);
23
27
 
24
28
  const apiHeaders: { [header: string]: string } = {
@@ -28,19 +32,143 @@ export class Customers {
28
32
  'get',
29
33
  uri,
30
34
  apiHeaders,
31
- payload
35
+ apiPayload
32
36
  );
33
37
  }
34
38
 
35
39
  /**
36
40
  *
41
+ * @param {string} params.city -
42
+ * @param {string} params.country - ISO 3166-1 alpha-2 code.
43
+ * @param {string} params.street -
44
+ * @param {string} params.zip -
45
+ * @param {string} params.company -
46
+ * @param {string} params.contactId - Owning contact (personal address).
47
+ * @param {boolean} params.isDefault - The default address of its owner and type.
48
+ * @param {string} params.name - Recipient name.
49
+ * @param {string} params.organizationId - Owning organization (company address).
50
+ * @param {string} params.phone -
51
+ * @param {string} params.region -
52
+ * @param {string} params.street2 -
53
+ * @param {AddressType} params.type - Default 'shipping'.
37
54
  * @throws {RevenexxException}
38
55
  * @returns {Promise<Models.Address>}
39
56
  */
40
- customersAddressesCreate(): Promise<Models.Address> {
57
+ customersAddressesCreate(params: { city: string, country: string, street: string, zip: string, company?: string, contactId?: string, isDefault?: boolean, name?: string, organizationId?: string, phone?: string, region?: string, street2?: string, type?: AddressType }): Promise<Models.Address>;
58
+ /**
59
+ *
60
+ * @param {string} city -
61
+ * @param {string} country - ISO 3166-1 alpha-2 code.
62
+ * @param {string} street -
63
+ * @param {string} zip -
64
+ * @param {string} company -
65
+ * @param {string} contactId - Owning contact (personal address).
66
+ * @param {boolean} isDefault - The default address of its owner and type.
67
+ * @param {string} name - Recipient name.
68
+ * @param {string} organizationId - Owning organization (company address).
69
+ * @param {string} phone -
70
+ * @param {string} region -
71
+ * @param {string} street2 -
72
+ * @param {AddressType} type - Default 'shipping'.
73
+ * @throws {RevenexxException}
74
+ * @returns {Promise<Models.Address>}
75
+ * @deprecated Use the object parameter style method for a better developer experience.
76
+ */
77
+ customersAddressesCreate(city: string, country: string, street: string, zip: string, company?: string, contactId?: string, isDefault?: boolean, name?: string, organizationId?: string, phone?: string, region?: string, street2?: string, type?: AddressType): Promise<Models.Address>;
78
+ customersAddressesCreate(
79
+ paramsOrFirst: { city: string, country: string, street: string, zip: string, company?: string, contactId?: string, isDefault?: boolean, name?: string, organizationId?: string, phone?: string, region?: string, street2?: string, type?: AddressType } | string,
80
+ ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (AddressType)?]
81
+ ): Promise<Models.Address> {
82
+ let params: { city: string, country: string, street: string, zip: string, company?: string, contactId?: string, isDefault?: boolean, name?: string, organizationId?: string, phone?: string, region?: string, street2?: string, type?: AddressType };
83
+
84
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
85
+ params = (paramsOrFirst || {}) as { city: string, country: string, street: string, zip: string, company?: string, contactId?: string, isDefault?: boolean, name?: string, organizationId?: string, phone?: string, region?: string, street2?: string, type?: AddressType };
86
+ } else {
87
+ params = {
88
+ city: paramsOrFirst as string,
89
+ country: rest[0] as string,
90
+ street: rest[1] as string,
91
+ zip: rest[2] as string,
92
+ company: rest[3] as string,
93
+ contactId: rest[4] as string,
94
+ isDefault: rest[5] as boolean,
95
+ name: rest[6] as string,
96
+ organizationId: rest[7] as string,
97
+ phone: rest[8] as string,
98
+ region: rest[9] as string,
99
+ street2: rest[10] as string,
100
+ type: rest[11] as AddressType
101
+ };
102
+ }
103
+
104
+ const city = params.city;
105
+ const country = params.country;
106
+ const street = params.street;
107
+ const zip = params.zip;
108
+ const company = params.company;
109
+ const contactId = params.contactId;
110
+ const isDefault = params.isDefault;
111
+ const name = params.name;
112
+ const organizationId = params.organizationId;
113
+ const phone = params.phone;
114
+ const region = params.region;
115
+ const street2 = params.street2;
116
+ const type = params.type;
117
+
118
+ if (typeof city === 'undefined') {
119
+ throw new RevenexxException('Missing required parameter: "city"');
120
+ }
121
+ if (typeof country === 'undefined') {
122
+ throw new RevenexxException('Missing required parameter: "country"');
123
+ }
124
+ if (typeof street === 'undefined') {
125
+ throw new RevenexxException('Missing required parameter: "street"');
126
+ }
127
+ if (typeof zip === 'undefined') {
128
+ throw new RevenexxException('Missing required parameter: "zip"');
129
+ }
41
130
 
42
131
  const apiPath = '/v1/customers/addresses';
43
- const payload: Payload = {};
132
+ const apiPayload: Payload = {};
133
+ if (typeof city !== 'undefined') {
134
+ apiPayload['city'] = city;
135
+ }
136
+ if (typeof company !== 'undefined') {
137
+ apiPayload['company'] = company;
138
+ }
139
+ if (typeof contactId !== 'undefined') {
140
+ apiPayload['contact_id'] = contactId;
141
+ }
142
+ if (typeof country !== 'undefined') {
143
+ apiPayload['country'] = country;
144
+ }
145
+ if (typeof isDefault !== 'undefined') {
146
+ apiPayload['is_default'] = isDefault;
147
+ }
148
+ if (typeof name !== 'undefined') {
149
+ apiPayload['name'] = name;
150
+ }
151
+ if (typeof organizationId !== 'undefined') {
152
+ apiPayload['organization_id'] = organizationId;
153
+ }
154
+ if (typeof phone !== 'undefined') {
155
+ apiPayload['phone'] = phone;
156
+ }
157
+ if (typeof region !== 'undefined') {
158
+ apiPayload['region'] = region;
159
+ }
160
+ if (typeof street !== 'undefined') {
161
+ apiPayload['street'] = street;
162
+ }
163
+ if (typeof street2 !== 'undefined') {
164
+ apiPayload['street2'] = street2;
165
+ }
166
+ if (typeof type !== 'undefined') {
167
+ apiPayload['type'] = type;
168
+ }
169
+ if (typeof zip !== 'undefined') {
170
+ apiPayload['zip'] = zip;
171
+ }
44
172
  const uri = new URL(this.client.config.endpoint + apiPath);
45
173
 
46
174
  const apiHeaders: { [header: string]: string } = {
@@ -51,7 +179,7 @@ export class Customers {
51
179
  'post',
52
180
  uri,
53
181
  apiHeaders,
54
- payload
182
+ apiPayload
55
183
  );
56
184
  }
57
185
 
@@ -90,7 +218,7 @@ export class Customers {
90
218
  }
91
219
 
92
220
  const apiPath = '/v1/customers/addresses/{id}'.replace('{id}', id);
93
- const payload: Payload = {};
221
+ const apiPayload: Payload = {};
94
222
  const uri = new URL(this.client.config.endpoint + apiPath);
95
223
 
96
224
  const apiHeaders: { [header: string]: string } = {
@@ -100,7 +228,7 @@ export class Customers {
100
228
  'delete',
101
229
  uri,
102
230
  apiHeaders,
103
- payload
231
+ apiPayload
104
232
  );
105
233
  }
106
234
 
@@ -139,7 +267,7 @@ export class Customers {
139
267
  }
140
268
 
141
269
  const apiPath = '/v1/customers/addresses/{id}'.replace('{id}', id);
142
- const payload: Payload = {};
270
+ const apiPayload: Payload = {};
143
271
  const uri = new URL(this.client.config.endpoint + apiPath);
144
272
 
145
273
  const apiHeaders: { [header: string]: string } = {
@@ -149,46 +277,138 @@ export class Customers {
149
277
  'get',
150
278
  uri,
151
279
  apiHeaders,
152
- payload
280
+ apiPayload
153
281
  );
154
282
  }
155
283
 
156
284
  /**
157
285
  *
158
286
  * @param {string} params.id -
287
+ * @param {string} params.city -
288
+ * @param {string} params.company -
289
+ * @param {string} params.contactId - Owning contact (personal address).
290
+ * @param {string} params.country - ISO 3166-1 alpha-2 code.
291
+ * @param {boolean} params.isDefault - The default address of its owner and type.
292
+ * @param {string} params.name - Recipient name.
293
+ * @param {string} params.organizationId - Owning organization (company address).
294
+ * @param {string} params.phone -
295
+ * @param {string} params.region -
296
+ * @param {string} params.street -
297
+ * @param {string} params.street2 -
298
+ * @param {AddressType} params.type - Default 'shipping'.
299
+ * @param {string} params.zip -
159
300
  * @throws {RevenexxException}
160
301
  * @returns {Promise<Models.Address>}
161
302
  */
162
- customersAddressesUpdate(params: { id: string }): Promise<Models.Address>;
303
+ customersAddressesUpdate(params: { id: string, city?: string, company?: string, contactId?: string, country?: string, isDefault?: boolean, name?: string, organizationId?: string, phone?: string, region?: string, street?: string, street2?: string, type?: AddressType, zip?: string }): Promise<Models.Address>;
163
304
  /**
164
305
  *
165
306
  * @param {string} id -
307
+ * @param {string} city -
308
+ * @param {string} company -
309
+ * @param {string} contactId - Owning contact (personal address).
310
+ * @param {string} country - ISO 3166-1 alpha-2 code.
311
+ * @param {boolean} isDefault - The default address of its owner and type.
312
+ * @param {string} name - Recipient name.
313
+ * @param {string} organizationId - Owning organization (company address).
314
+ * @param {string} phone -
315
+ * @param {string} region -
316
+ * @param {string} street -
317
+ * @param {string} street2 -
318
+ * @param {AddressType} type - Default 'shipping'.
319
+ * @param {string} zip -
166
320
  * @throws {RevenexxException}
167
321
  * @returns {Promise<Models.Address>}
168
322
  * @deprecated Use the object parameter style method for a better developer experience.
169
323
  */
170
- customersAddressesUpdate(id: string): Promise<Models.Address>;
324
+ customersAddressesUpdate(id: string, city?: string, company?: string, contactId?: string, country?: string, isDefault?: boolean, name?: string, organizationId?: string, phone?: string, region?: string, street?: string, street2?: string, type?: AddressType, zip?: string): Promise<Models.Address>;
171
325
  customersAddressesUpdate(
172
- paramsOrFirst: { id: string } | string
326
+ paramsOrFirst: { id: string, city?: string, company?: string, contactId?: string, country?: string, isDefault?: boolean, name?: string, organizationId?: string, phone?: string, region?: string, street?: string, street2?: string, type?: AddressType, zip?: string } | string,
327
+ ...rest: [(string)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (AddressType)?, (string)?]
173
328
  ): Promise<Models.Address> {
174
- let params: { id: string };
329
+ let params: { id: string, city?: string, company?: string, contactId?: string, country?: string, isDefault?: boolean, name?: string, organizationId?: string, phone?: string, region?: string, street?: string, street2?: string, type?: AddressType, zip?: string };
175
330
 
176
331
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
177
- params = (paramsOrFirst || {}) as { id: string };
332
+ params = (paramsOrFirst || {}) as { id: string, city?: string, company?: string, contactId?: string, country?: string, isDefault?: boolean, name?: string, organizationId?: string, phone?: string, region?: string, street?: string, street2?: string, type?: AddressType, zip?: string };
178
333
  } else {
179
334
  params = {
180
- id: paramsOrFirst as string
335
+ id: paramsOrFirst as string,
336
+ city: rest[0] as string,
337
+ company: rest[1] as string,
338
+ contactId: rest[2] as string,
339
+ country: rest[3] as string,
340
+ isDefault: rest[4] as boolean,
341
+ name: rest[5] as string,
342
+ organizationId: rest[6] as string,
343
+ phone: rest[7] as string,
344
+ region: rest[8] as string,
345
+ street: rest[9] as string,
346
+ street2: rest[10] as string,
347
+ type: rest[11] as AddressType,
348
+ zip: rest[12] as string
181
349
  };
182
350
  }
183
351
 
184
352
  const id = params.id;
353
+ const city = params.city;
354
+ const company = params.company;
355
+ const contactId = params.contactId;
356
+ const country = params.country;
357
+ const isDefault = params.isDefault;
358
+ const name = params.name;
359
+ const organizationId = params.organizationId;
360
+ const phone = params.phone;
361
+ const region = params.region;
362
+ const street = params.street;
363
+ const street2 = params.street2;
364
+ const type = params.type;
365
+ const zip = params.zip;
185
366
 
186
367
  if (typeof id === 'undefined') {
187
368
  throw new RevenexxException('Missing required parameter: "id"');
188
369
  }
189
370
 
190
371
  const apiPath = '/v1/customers/addresses/{id}'.replace('{id}', id);
191
- const payload: Payload = {};
372
+ const apiPayload: Payload = {};
373
+ if (typeof city !== 'undefined') {
374
+ apiPayload['city'] = city;
375
+ }
376
+ if (typeof company !== 'undefined') {
377
+ apiPayload['company'] = company;
378
+ }
379
+ if (typeof contactId !== 'undefined') {
380
+ apiPayload['contact_id'] = contactId;
381
+ }
382
+ if (typeof country !== 'undefined') {
383
+ apiPayload['country'] = country;
384
+ }
385
+ if (typeof isDefault !== 'undefined') {
386
+ apiPayload['is_default'] = isDefault;
387
+ }
388
+ if (typeof name !== 'undefined') {
389
+ apiPayload['name'] = name;
390
+ }
391
+ if (typeof organizationId !== 'undefined') {
392
+ apiPayload['organization_id'] = organizationId;
393
+ }
394
+ if (typeof phone !== 'undefined') {
395
+ apiPayload['phone'] = phone;
396
+ }
397
+ if (typeof region !== 'undefined') {
398
+ apiPayload['region'] = region;
399
+ }
400
+ if (typeof street !== 'undefined') {
401
+ apiPayload['street'] = street;
402
+ }
403
+ if (typeof street2 !== 'undefined') {
404
+ apiPayload['street2'] = street2;
405
+ }
406
+ if (typeof type !== 'undefined') {
407
+ apiPayload['type'] = type;
408
+ }
409
+ if (typeof zip !== 'undefined') {
410
+ apiPayload['zip'] = zip;
411
+ }
192
412
  const uri = new URL(this.client.config.endpoint + apiPath);
193
413
 
194
414
  const apiHeaders: { [header: string]: string } = {
@@ -199,19 +419,60 @@ export class Customers {
199
419
  'put',
200
420
  uri,
201
421
  apiHeaders,
202
- payload
422
+ apiPayload
203
423
  );
204
424
  }
205
425
 
206
426
  /**
207
427
  *
428
+ * @param {string} params.email -
429
+ * @param {string} params.password -
430
+ * @throws {RevenexxException}
431
+ * @returns {Promise<Models.AuthLoginResponse>}
432
+ */
433
+ customersAuthLogin(params: { email: string, password: string }): Promise<Models.AuthLoginResponse>;
434
+ /**
435
+ *
436
+ * @param {string} email -
437
+ * @param {string} password -
208
438
  * @throws {RevenexxException}
209
439
  * @returns {Promise<Models.AuthLoginResponse>}
440
+ * @deprecated Use the object parameter style method for a better developer experience.
210
441
  */
211
- customersAuthLogin(): Promise<Models.AuthLoginResponse> {
442
+ customersAuthLogin(email: string, password: string): Promise<Models.AuthLoginResponse>;
443
+ customersAuthLogin(
444
+ paramsOrFirst: { email: string, password: string } | string,
445
+ ...rest: [(string)?]
446
+ ): Promise<Models.AuthLoginResponse> {
447
+ let params: { email: string, password: string };
448
+
449
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
450
+ params = (paramsOrFirst || {}) as { email: string, password: string };
451
+ } else {
452
+ params = {
453
+ email: paramsOrFirst as string,
454
+ password: rest[0] as string
455
+ };
456
+ }
457
+
458
+ const email = params.email;
459
+ const password = params.password;
460
+
461
+ if (typeof email === 'undefined') {
462
+ throw new RevenexxException('Missing required parameter: "email"');
463
+ }
464
+ if (typeof password === 'undefined') {
465
+ throw new RevenexxException('Missing required parameter: "password"');
466
+ }
212
467
 
213
468
  const apiPath = '/v1/customers/auth/login';
214
- const payload: Payload = {};
469
+ const apiPayload: Payload = {};
470
+ if (typeof email !== 'undefined') {
471
+ apiPayload['email'] = email;
472
+ }
473
+ if (typeof password !== 'undefined') {
474
+ apiPayload['password'] = password;
475
+ }
215
476
  const uri = new URL(this.client.config.endpoint + apiPath);
216
477
 
217
478
  const apiHeaders: { [header: string]: string } = {
@@ -222,19 +483,60 @@ export class Customers {
222
483
  'post',
223
484
  uri,
224
485
  apiHeaders,
225
- payload
486
+ apiPayload
226
487
  );
227
488
  }
228
489
 
229
490
  /**
230
491
  *
492
+ * @param {string} params.sessionId -
493
+ * @param {string} params.userId -
231
494
  * @throws {RevenexxException}
232
495
  * @returns {Promise<{}>}
233
496
  */
234
- customersAuthLogout(): Promise<{}> {
497
+ customersAuthLogout(params: { sessionId: string, userId: string }): Promise<{}>;
498
+ /**
499
+ *
500
+ * @param {string} sessionId -
501
+ * @param {string} userId -
502
+ * @throws {RevenexxException}
503
+ * @returns {Promise<{}>}
504
+ * @deprecated Use the object parameter style method for a better developer experience.
505
+ */
506
+ customersAuthLogout(sessionId: string, userId: string): Promise<{}>;
507
+ customersAuthLogout(
508
+ paramsOrFirst: { sessionId: string, userId: string } | string,
509
+ ...rest: [(string)?]
510
+ ): Promise<{}> {
511
+ let params: { sessionId: string, userId: string };
512
+
513
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
514
+ params = (paramsOrFirst || {}) as { sessionId: string, userId: string };
515
+ } else {
516
+ params = {
517
+ sessionId: paramsOrFirst as string,
518
+ userId: rest[0] as string
519
+ };
520
+ }
521
+
522
+ const sessionId = params.sessionId;
523
+ const userId = params.userId;
524
+
525
+ if (typeof sessionId === 'undefined') {
526
+ throw new RevenexxException('Missing required parameter: "sessionId"');
527
+ }
528
+ if (typeof userId === 'undefined') {
529
+ throw new RevenexxException('Missing required parameter: "userId"');
530
+ }
235
531
 
236
532
  const apiPath = '/v1/customers/auth/logout';
237
- const payload: Payload = {};
533
+ const apiPayload: Payload = {};
534
+ if (typeof sessionId !== 'undefined') {
535
+ apiPayload['session_id'] = sessionId;
536
+ }
537
+ if (typeof userId !== 'undefined') {
538
+ apiPayload['user_id'] = userId;
539
+ }
238
540
  const uri = new URL(this.client.config.endpoint + apiPath);
239
541
 
240
542
  const apiHeaders: { [header: string]: string } = {
@@ -245,19 +547,49 @@ export class Customers {
245
547
  'post',
246
548
  uri,
247
549
  apiHeaders,
248
- payload
550
+ apiPayload
249
551
  );
250
552
  }
251
553
 
252
554
  /**
253
555
  *
556
+ * @param {string} params.userId -
254
557
  * @throws {RevenexxException}
255
558
  * @returns {Promise<Models.AuthMeResponse>}
256
559
  */
257
- customersAuthMe(): Promise<Models.AuthMeResponse> {
560
+ customersAuthMe(params: { userId: string }): Promise<Models.AuthMeResponse>;
561
+ /**
562
+ *
563
+ * @param {string} userId -
564
+ * @throws {RevenexxException}
565
+ * @returns {Promise<Models.AuthMeResponse>}
566
+ * @deprecated Use the object parameter style method for a better developer experience.
567
+ */
568
+ customersAuthMe(userId: string): Promise<Models.AuthMeResponse>;
569
+ customersAuthMe(
570
+ paramsOrFirst: { userId: string } | string
571
+ ): Promise<Models.AuthMeResponse> {
572
+ let params: { userId: string };
573
+
574
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
575
+ params = (paramsOrFirst || {}) as { userId: string };
576
+ } else {
577
+ params = {
578
+ userId: paramsOrFirst as string
579
+ };
580
+ }
581
+
582
+ const userId = params.userId;
583
+
584
+ if (typeof userId === 'undefined') {
585
+ throw new RevenexxException('Missing required parameter: "userId"');
586
+ }
258
587
 
259
588
  const apiPath = '/v1/customers/auth/me';
260
- const payload: Payload = {};
589
+ const apiPayload: Payload = {};
590
+ if (typeof userId !== 'undefined') {
591
+ apiPayload['user_id'] = userId;
592
+ }
261
593
  const uri = new URL(this.client.config.endpoint + apiPath);
262
594
 
263
595
  const apiHeaders: { [header: string]: string } = {
@@ -268,19 +600,60 @@ export class Customers {
268
600
  'post',
269
601
  uri,
270
602
  apiHeaders,
271
- payload
603
+ apiPayload
272
604
  );
273
605
  }
274
606
 
275
607
  /**
276
608
  *
609
+ * @param {string} params.email -
610
+ * @param {string} params.url - Redirect URL carrying userId + secret.
277
611
  * @throws {RevenexxException}
278
612
  * @returns {Promise<{}>}
279
613
  */
280
- customersAuthRecovery(): Promise<{}> {
614
+ customersAuthRecovery(params: { email: string, url: string }): Promise<{}>;
615
+ /**
616
+ *
617
+ * @param {string} email -
618
+ * @param {string} url - Redirect URL carrying userId + secret.
619
+ * @throws {RevenexxException}
620
+ * @returns {Promise<{}>}
621
+ * @deprecated Use the object parameter style method for a better developer experience.
622
+ */
623
+ customersAuthRecovery(email: string, url: string): Promise<{}>;
624
+ customersAuthRecovery(
625
+ paramsOrFirst: { email: string, url: string } | string,
626
+ ...rest: [(string)?]
627
+ ): Promise<{}> {
628
+ let params: { email: string, url: string };
629
+
630
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
631
+ params = (paramsOrFirst || {}) as { email: string, url: string };
632
+ } else {
633
+ params = {
634
+ email: paramsOrFirst as string,
635
+ url: rest[0] as string
636
+ };
637
+ }
638
+
639
+ const email = params.email;
640
+ const url = params.url;
641
+
642
+ if (typeof email === 'undefined') {
643
+ throw new RevenexxException('Missing required parameter: "email"');
644
+ }
645
+ if (typeof url === 'undefined') {
646
+ throw new RevenexxException('Missing required parameter: "url"');
647
+ }
281
648
 
282
649
  const apiPath = '/v1/customers/auth/recovery';
283
- const payload: Payload = {};
650
+ const apiPayload: Payload = {};
651
+ if (typeof email !== 'undefined') {
652
+ apiPayload['email'] = email;
653
+ }
654
+ if (typeof url !== 'undefined') {
655
+ apiPayload['url'] = url;
656
+ }
284
657
  const uri = new URL(this.client.config.endpoint + apiPath);
285
658
 
286
659
  const apiHeaders: { [header: string]: string } = {
@@ -291,19 +664,70 @@ export class Customers {
291
664
  'post',
292
665
  uri,
293
666
  apiHeaders,
294
- payload
667
+ apiPayload
295
668
  );
296
669
  }
297
670
 
298
671
  /**
299
672
  *
673
+ * @param {string} params.password -
674
+ * @param {string} params.secret -
675
+ * @param {string} params.userId -
300
676
  * @throws {RevenexxException}
301
677
  * @returns {Promise<{}>}
302
678
  */
303
- customersAuthRecoveryConfirm(): Promise<{}> {
679
+ customersAuthRecoveryConfirm(params: { password: string, secret: string, userId: string }): Promise<{}>;
680
+ /**
681
+ *
682
+ * @param {string} password -
683
+ * @param {string} secret -
684
+ * @param {string} userId -
685
+ * @throws {RevenexxException}
686
+ * @returns {Promise<{}>}
687
+ * @deprecated Use the object parameter style method for a better developer experience.
688
+ */
689
+ customersAuthRecoveryConfirm(password: string, secret: string, userId: string): Promise<{}>;
690
+ customersAuthRecoveryConfirm(
691
+ paramsOrFirst: { password: string, secret: string, userId: string } | string,
692
+ ...rest: [(string)?, (string)?]
693
+ ): Promise<{}> {
694
+ let params: { password: string, secret: string, userId: string };
695
+
696
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
697
+ params = (paramsOrFirst || {}) as { password: string, secret: string, userId: string };
698
+ } else {
699
+ params = {
700
+ password: paramsOrFirst as string,
701
+ secret: rest[0] as string,
702
+ userId: rest[1] as string
703
+ };
704
+ }
705
+
706
+ const password = params.password;
707
+ const secret = params.secret;
708
+ const userId = params.userId;
709
+
710
+ if (typeof password === 'undefined') {
711
+ throw new RevenexxException('Missing required parameter: "password"');
712
+ }
713
+ if (typeof secret === 'undefined') {
714
+ throw new RevenexxException('Missing required parameter: "secret"');
715
+ }
716
+ if (typeof userId === 'undefined') {
717
+ throw new RevenexxException('Missing required parameter: "userId"');
718
+ }
304
719
 
305
720
  const apiPath = '/v1/customers/auth/recovery';
306
- const payload: Payload = {};
721
+ const apiPayload: Payload = {};
722
+ if (typeof password !== 'undefined') {
723
+ apiPayload['password'] = password;
724
+ }
725
+ if (typeof secret !== 'undefined') {
726
+ apiPayload['secret'] = secret;
727
+ }
728
+ if (typeof userId !== 'undefined') {
729
+ apiPayload['user_id'] = userId;
730
+ }
307
731
  const uri = new URL(this.client.config.endpoint + apiPath);
308
732
 
309
733
  const apiHeaders: { [header: string]: string } = {
@@ -314,19 +738,95 @@ export class Customers {
314
738
  'put',
315
739
  uri,
316
740
  apiHeaders,
317
- payload
741
+ apiPayload
318
742
  );
319
743
  }
320
744
 
321
745
  /**
322
746
  *
747
+ * @param {string} params.email -
748
+ * @param {string} params.password -
749
+ * @param {string} params.firstName -
750
+ * @param {string} params.lastName -
751
+ * @param {string} params.locale - BCP 47, e.g. de-DE
752
+ * @param {string} params.organizationId - Join an existing organization.
753
+ * @param {string} params.organizationName - Found a new organization; the contact becomes its admin.
323
754
  * @throws {RevenexxException}
324
755
  * @returns {Promise<Models.AuthRegisterResponse>}
325
756
  */
326
- customersAuthRegister(): Promise<Models.AuthRegisterResponse> {
757
+ customersAuthRegister(params: { email: string, password: string, firstName?: string, lastName?: string, locale?: string, organizationId?: string, organizationName?: string }): Promise<Models.AuthRegisterResponse>;
758
+ /**
759
+ *
760
+ * @param {string} email -
761
+ * @param {string} password -
762
+ * @param {string} firstName -
763
+ * @param {string} lastName -
764
+ * @param {string} locale - BCP 47, e.g. de-DE
765
+ * @param {string} organizationId - Join an existing organization.
766
+ * @param {string} organizationName - Found a new organization; the contact becomes its admin.
767
+ * @throws {RevenexxException}
768
+ * @returns {Promise<Models.AuthRegisterResponse>}
769
+ * @deprecated Use the object parameter style method for a better developer experience.
770
+ */
771
+ customersAuthRegister(email: string, password: string, firstName?: string, lastName?: string, locale?: string, organizationId?: string, organizationName?: string): Promise<Models.AuthRegisterResponse>;
772
+ customersAuthRegister(
773
+ paramsOrFirst: { email: string, password: string, firstName?: string, lastName?: string, locale?: string, organizationId?: string, organizationName?: string } | string,
774
+ ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?]
775
+ ): Promise<Models.AuthRegisterResponse> {
776
+ let params: { email: string, password: string, firstName?: string, lastName?: string, locale?: string, organizationId?: string, organizationName?: string };
777
+
778
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
779
+ params = (paramsOrFirst || {}) as { email: string, password: string, firstName?: string, lastName?: string, locale?: string, organizationId?: string, organizationName?: string };
780
+ } else {
781
+ params = {
782
+ email: paramsOrFirst as string,
783
+ password: rest[0] as string,
784
+ firstName: rest[1] as string,
785
+ lastName: rest[2] as string,
786
+ locale: rest[3] as string,
787
+ organizationId: rest[4] as string,
788
+ organizationName: rest[5] as string
789
+ };
790
+ }
791
+
792
+ const email = params.email;
793
+ const password = params.password;
794
+ const firstName = params.firstName;
795
+ const lastName = params.lastName;
796
+ const locale = params.locale;
797
+ const organizationId = params.organizationId;
798
+ const organizationName = params.organizationName;
799
+
800
+ if (typeof email === 'undefined') {
801
+ throw new RevenexxException('Missing required parameter: "email"');
802
+ }
803
+ if (typeof password === 'undefined') {
804
+ throw new RevenexxException('Missing required parameter: "password"');
805
+ }
327
806
 
328
807
  const apiPath = '/v1/customers/auth/register';
329
- const payload: Payload = {};
808
+ const apiPayload: Payload = {};
809
+ if (typeof email !== 'undefined') {
810
+ apiPayload['email'] = email;
811
+ }
812
+ if (typeof firstName !== 'undefined') {
813
+ apiPayload['first_name'] = firstName;
814
+ }
815
+ if (typeof lastName !== 'undefined') {
816
+ apiPayload['last_name'] = lastName;
817
+ }
818
+ if (typeof locale !== 'undefined') {
819
+ apiPayload['locale'] = locale;
820
+ }
821
+ if (typeof organizationId !== 'undefined') {
822
+ apiPayload['organization_id'] = organizationId;
823
+ }
824
+ if (typeof organizationName !== 'undefined') {
825
+ apiPayload['organization_name'] = organizationName;
826
+ }
827
+ if (typeof password !== 'undefined') {
828
+ apiPayload['password'] = password;
829
+ }
330
830
  const uri = new URL(this.client.config.endpoint + apiPath);
331
831
 
332
832
  const apiHeaders: { [header: string]: string } = {
@@ -337,7 +837,7 @@ export class Customers {
337
837
  'post',
338
838
  uri,
339
839
  apiHeaders,
340
- payload
840
+ apiPayload
341
841
  );
342
842
  }
343
843
 
@@ -349,7 +849,7 @@ export class Customers {
349
849
  customersContactsList(): Promise<{}> {
350
850
 
351
851
  const apiPath = '/v1/customers/contacts';
352
- const payload: Payload = {};
852
+ const apiPayload: Payload = {};
353
853
  const uri = new URL(this.client.config.endpoint + apiPath);
354
854
 
355
855
  const apiHeaders: { [header: string]: string } = {
@@ -359,19 +859,106 @@ export class Customers {
359
859
  'get',
360
860
  uri,
361
861
  apiHeaders,
362
- payload
862
+ apiPayload
363
863
  );
364
864
  }
365
865
 
366
866
  /**
367
867
  *
868
+ * @param {string} params.email -
869
+ * @param {string} params.firstName -
870
+ * @param {boolean} params.isPrimary - The primary contact of its organization.
871
+ * @param {string} params.lastName -
872
+ * @param {string} params.locale - BCP 47, e.g. de-DE
873
+ * @param {string} params.organizationId - Owning organization — membership is mirrored to the platform team.
874
+ * @param {string} params.phone -
875
+ * @param {ContactRole} params.role - Default 'buyer' — also the team role on the platform mirror.
876
+ * @param {ContactStatus} params.status - Default 'invited' on create.
877
+ * @throws {RevenexxException}
878
+ * @returns {Promise<Models.Contact>}
879
+ */
880
+ customersContactsCreate(params: { email: string, firstName?: string, isPrimary?: boolean, lastName?: string, locale?: string, organizationId?: string, phone?: string, role?: ContactRole, status?: ContactStatus }): Promise<Models.Contact>;
881
+ /**
882
+ *
883
+ * @param {string} email -
884
+ * @param {string} firstName -
885
+ * @param {boolean} isPrimary - The primary contact of its organization.
886
+ * @param {string} lastName -
887
+ * @param {string} locale - BCP 47, e.g. de-DE
888
+ * @param {string} organizationId - Owning organization — membership is mirrored to the platform team.
889
+ * @param {string} phone -
890
+ * @param {ContactRole} role - Default 'buyer' — also the team role on the platform mirror.
891
+ * @param {ContactStatus} status - Default 'invited' on create.
368
892
  * @throws {RevenexxException}
369
893
  * @returns {Promise<Models.Contact>}
894
+ * @deprecated Use the object parameter style method for a better developer experience.
370
895
  */
371
- customersContactsCreate(): Promise<Models.Contact> {
896
+ customersContactsCreate(email: string, firstName?: string, isPrimary?: boolean, lastName?: string, locale?: string, organizationId?: string, phone?: string, role?: ContactRole, status?: ContactStatus): Promise<Models.Contact>;
897
+ customersContactsCreate(
898
+ paramsOrFirst: { email: string, firstName?: string, isPrimary?: boolean, lastName?: string, locale?: string, organizationId?: string, phone?: string, role?: ContactRole, status?: ContactStatus } | string,
899
+ ...rest: [(string)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (ContactRole)?, (ContactStatus)?]
900
+ ): Promise<Models.Contact> {
901
+ let params: { email: string, firstName?: string, isPrimary?: boolean, lastName?: string, locale?: string, organizationId?: string, phone?: string, role?: ContactRole, status?: ContactStatus };
902
+
903
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
904
+ params = (paramsOrFirst || {}) as { email: string, firstName?: string, isPrimary?: boolean, lastName?: string, locale?: string, organizationId?: string, phone?: string, role?: ContactRole, status?: ContactStatus };
905
+ } else {
906
+ params = {
907
+ email: paramsOrFirst as string,
908
+ firstName: rest[0] as string,
909
+ isPrimary: rest[1] as boolean,
910
+ lastName: rest[2] as string,
911
+ locale: rest[3] as string,
912
+ organizationId: rest[4] as string,
913
+ phone: rest[5] as string,
914
+ role: rest[6] as ContactRole,
915
+ status: rest[7] as ContactStatus
916
+ };
917
+ }
918
+
919
+ const email = params.email;
920
+ const firstName = params.firstName;
921
+ const isPrimary = params.isPrimary;
922
+ const lastName = params.lastName;
923
+ const locale = params.locale;
924
+ const organizationId = params.organizationId;
925
+ const phone = params.phone;
926
+ const role = params.role;
927
+ const status = params.status;
928
+
929
+ if (typeof email === 'undefined') {
930
+ throw new RevenexxException('Missing required parameter: "email"');
931
+ }
372
932
 
373
933
  const apiPath = '/v1/customers/contacts';
374
- const payload: Payload = {};
934
+ const apiPayload: Payload = {};
935
+ if (typeof email !== 'undefined') {
936
+ apiPayload['email'] = email;
937
+ }
938
+ if (typeof firstName !== 'undefined') {
939
+ apiPayload['first_name'] = firstName;
940
+ }
941
+ if (typeof isPrimary !== 'undefined') {
942
+ apiPayload['is_primary'] = isPrimary;
943
+ }
944
+ if (typeof lastName !== 'undefined') {
945
+ apiPayload['last_name'] = lastName;
946
+ }
947
+ if (typeof locale !== 'undefined') {
948
+ apiPayload['locale'] = locale;
949
+ }
950
+ if (typeof organizationId !== 'undefined') {
951
+ apiPayload['organization_id'] = organizationId;
952
+ }
953
+ if (typeof phone !== 'undefined') {
954
+ apiPayload['phone'] = phone;
955
+ }
956
+ if (typeof role !== 'undefined') {
957
+ apiPayload['role'] = role;
958
+ }
959
+ if (typeof status !== 'undefined') {
960
+ apiPayload['status'] = status;
961
+ }
375
962
  const uri = new URL(this.client.config.endpoint + apiPath);
376
963
 
377
964
  const apiHeaders: { [header: string]: string } = {
@@ -382,7 +969,7 @@ export class Customers {
382
969
  'post',
383
970
  uri,
384
971
  apiHeaders,
385
- payload
972
+ apiPayload
386
973
  );
387
974
  }
388
975
 
@@ -421,7 +1008,7 @@ export class Customers {
421
1008
  }
422
1009
 
423
1010
  const apiPath = '/v1/customers/contacts/{id}'.replace('{id}', id);
424
- const payload: Payload = {};
1011
+ const apiPayload: Payload = {};
425
1012
  const uri = new URL(this.client.config.endpoint + apiPath);
426
1013
 
427
1014
  const apiHeaders: { [header: string]: string } = {
@@ -431,7 +1018,7 @@ export class Customers {
431
1018
  'delete',
432
1019
  uri,
433
1020
  apiHeaders,
434
- payload
1021
+ apiPayload
435
1022
  );
436
1023
  }
437
1024
 
@@ -470,7 +1057,7 @@ export class Customers {
470
1057
  }
471
1058
 
472
1059
  const apiPath = '/v1/customers/contacts/{id}'.replace('{id}', id);
473
- const payload: Payload = {};
1060
+ const apiPayload: Payload = {};
474
1061
  const uri = new URL(this.client.config.endpoint + apiPath);
475
1062
 
476
1063
  const apiHeaders: { [header: string]: string } = {
@@ -480,46 +1067,110 @@ export class Customers {
480
1067
  'get',
481
1068
  uri,
482
1069
  apiHeaders,
483
- payload
1070
+ apiPayload
484
1071
  );
485
1072
  }
486
1073
 
487
1074
  /**
488
1075
  *
489
1076
  * @param {string} params.id -
1077
+ * @param {string} params.email -
1078
+ * @param {string} params.firstName -
1079
+ * @param {boolean} params.isPrimary - The primary contact of its organization.
1080
+ * @param {string} params.lastName -
1081
+ * @param {string} params.locale - BCP 47, e.g. de-DE
1082
+ * @param {string} params.organizationId - Owning organization — membership is mirrored to the platform team.
1083
+ * @param {string} params.phone -
1084
+ * @param {ContactRole} params.role - Default 'buyer' — also the team role on the platform mirror.
1085
+ * @param {ContactStatus} params.status - Default 'invited' on create.
490
1086
  * @throws {RevenexxException}
491
1087
  * @returns {Promise<Models.Contact>}
492
1088
  */
493
- customersContactsUpdate(params: { id: string }): Promise<Models.Contact>;
1089
+ customersContactsUpdate(params: { id: string, email?: string, firstName?: string, isPrimary?: boolean, lastName?: string, locale?: string, organizationId?: string, phone?: string, role?: ContactRole, status?: ContactStatus }): Promise<Models.Contact>;
494
1090
  /**
495
1091
  *
496
1092
  * @param {string} id -
1093
+ * @param {string} email -
1094
+ * @param {string} firstName -
1095
+ * @param {boolean} isPrimary - The primary contact of its organization.
1096
+ * @param {string} lastName -
1097
+ * @param {string} locale - BCP 47, e.g. de-DE
1098
+ * @param {string} organizationId - Owning organization — membership is mirrored to the platform team.
1099
+ * @param {string} phone -
1100
+ * @param {ContactRole} role - Default 'buyer' — also the team role on the platform mirror.
1101
+ * @param {ContactStatus} status - Default 'invited' on create.
497
1102
  * @throws {RevenexxException}
498
1103
  * @returns {Promise<Models.Contact>}
499
1104
  * @deprecated Use the object parameter style method for a better developer experience.
500
1105
  */
501
- customersContactsUpdate(id: string): Promise<Models.Contact>;
1106
+ customersContactsUpdate(id: string, email?: string, firstName?: string, isPrimary?: boolean, lastName?: string, locale?: string, organizationId?: string, phone?: string, role?: ContactRole, status?: ContactStatus): Promise<Models.Contact>;
502
1107
  customersContactsUpdate(
503
- paramsOrFirst: { id: string } | string
1108
+ paramsOrFirst: { id: string, email?: string, firstName?: string, isPrimary?: boolean, lastName?: string, locale?: string, organizationId?: string, phone?: string, role?: ContactRole, status?: ContactStatus } | string,
1109
+ ...rest: [(string)?, (string)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (ContactRole)?, (ContactStatus)?]
504
1110
  ): Promise<Models.Contact> {
505
- let params: { id: string };
1111
+ let params: { id: string, email?: string, firstName?: string, isPrimary?: boolean, lastName?: string, locale?: string, organizationId?: string, phone?: string, role?: ContactRole, status?: ContactStatus };
506
1112
 
507
1113
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
508
- params = (paramsOrFirst || {}) as { id: string };
1114
+ params = (paramsOrFirst || {}) as { id: string, email?: string, firstName?: string, isPrimary?: boolean, lastName?: string, locale?: string, organizationId?: string, phone?: string, role?: ContactRole, status?: ContactStatus };
509
1115
  } else {
510
1116
  params = {
511
- id: paramsOrFirst as string
1117
+ id: paramsOrFirst as string,
1118
+ email: rest[0] as string,
1119
+ firstName: rest[1] as string,
1120
+ isPrimary: rest[2] as boolean,
1121
+ lastName: rest[3] as string,
1122
+ locale: rest[4] as string,
1123
+ organizationId: rest[5] as string,
1124
+ phone: rest[6] as string,
1125
+ role: rest[7] as ContactRole,
1126
+ status: rest[8] as ContactStatus
512
1127
  };
513
1128
  }
514
1129
 
515
1130
  const id = params.id;
1131
+ const email = params.email;
1132
+ const firstName = params.firstName;
1133
+ const isPrimary = params.isPrimary;
1134
+ const lastName = params.lastName;
1135
+ const locale = params.locale;
1136
+ const organizationId = params.organizationId;
1137
+ const phone = params.phone;
1138
+ const role = params.role;
1139
+ const status = params.status;
516
1140
 
517
1141
  if (typeof id === 'undefined') {
518
1142
  throw new RevenexxException('Missing required parameter: "id"');
519
1143
  }
520
1144
 
521
1145
  const apiPath = '/v1/customers/contacts/{id}'.replace('{id}', id);
522
- const payload: Payload = {};
1146
+ const apiPayload: Payload = {};
1147
+ if (typeof email !== 'undefined') {
1148
+ apiPayload['email'] = email;
1149
+ }
1150
+ if (typeof firstName !== 'undefined') {
1151
+ apiPayload['first_name'] = firstName;
1152
+ }
1153
+ if (typeof isPrimary !== 'undefined') {
1154
+ apiPayload['is_primary'] = isPrimary;
1155
+ }
1156
+ if (typeof lastName !== 'undefined') {
1157
+ apiPayload['last_name'] = lastName;
1158
+ }
1159
+ if (typeof locale !== 'undefined') {
1160
+ apiPayload['locale'] = locale;
1161
+ }
1162
+ if (typeof organizationId !== 'undefined') {
1163
+ apiPayload['organization_id'] = organizationId;
1164
+ }
1165
+ if (typeof phone !== 'undefined') {
1166
+ apiPayload['phone'] = phone;
1167
+ }
1168
+ if (typeof role !== 'undefined') {
1169
+ apiPayload['role'] = role;
1170
+ }
1171
+ if (typeof status !== 'undefined') {
1172
+ apiPayload['status'] = status;
1173
+ }
523
1174
  const uri = new URL(this.client.config.endpoint + apiPath);
524
1175
 
525
1176
  const apiHeaders: { [header: string]: string } = {
@@ -530,7 +1181,7 @@ export class Customers {
530
1181
  'put',
531
1182
  uri,
532
1183
  apiHeaders,
533
- payload
1184
+ apiPayload
534
1185
  );
535
1186
  }
536
1187
 
@@ -542,7 +1193,7 @@ export class Customers {
542
1193
  customersOrganizationsList(): Promise<{}> {
543
1194
 
544
1195
  const apiPath = '/v1/customers/organizations';
545
- const payload: Payload = {};
1196
+ const apiPayload: Payload = {};
546
1197
  const uri = new URL(this.client.config.endpoint + apiPath);
547
1198
 
548
1199
  const apiHeaders: { [header: string]: string } = {
@@ -552,19 +1203,71 @@ export class Customers {
552
1203
  'get',
553
1204
  uri,
554
1205
  apiHeaders,
555
- payload
1206
+ apiPayload
556
1207
  );
557
1208
  }
558
1209
 
559
1210
  /**
560
1211
  *
1212
+ * @param {string} params.name - Company name — mirrored to the platform team.
1213
+ * @param {object} params.settings - Free-form organization settings.
1214
+ * @param {OrganizationStatus} params.status - Default 'active'.
1215
+ * @param {string} params.vatId -
561
1216
  * @throws {RevenexxException}
562
1217
  * @returns {Promise<Models.Organization>}
563
1218
  */
564
- customersOrganizationsCreate(): Promise<Models.Organization> {
1219
+ customersOrganizationsCreate(params: { name: string, settings?: object, status?: OrganizationStatus, vatId?: string }): Promise<Models.Organization>;
1220
+ /**
1221
+ *
1222
+ * @param {string} name - Company name — mirrored to the platform team.
1223
+ * @param {object} settings - Free-form organization settings.
1224
+ * @param {OrganizationStatus} status - Default 'active'.
1225
+ * @param {string} vatId -
1226
+ * @throws {RevenexxException}
1227
+ * @returns {Promise<Models.Organization>}
1228
+ * @deprecated Use the object parameter style method for a better developer experience.
1229
+ */
1230
+ customersOrganizationsCreate(name: string, settings?: object, status?: OrganizationStatus, vatId?: string): Promise<Models.Organization>;
1231
+ customersOrganizationsCreate(
1232
+ paramsOrFirst: { name: string, settings?: object, status?: OrganizationStatus, vatId?: string } | string,
1233
+ ...rest: [(object)?, (OrganizationStatus)?, (string)?]
1234
+ ): Promise<Models.Organization> {
1235
+ let params: { name: string, settings?: object, status?: OrganizationStatus, vatId?: string };
1236
+
1237
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1238
+ params = (paramsOrFirst || {}) as { name: string, settings?: object, status?: OrganizationStatus, vatId?: string };
1239
+ } else {
1240
+ params = {
1241
+ name: paramsOrFirst as string,
1242
+ settings: rest[0] as object,
1243
+ status: rest[1] as OrganizationStatus,
1244
+ vatId: rest[2] as string
1245
+ };
1246
+ }
1247
+
1248
+ const name = params.name;
1249
+ const settings = params.settings;
1250
+ const status = params.status;
1251
+ const vatId = params.vatId;
1252
+
1253
+ if (typeof name === 'undefined') {
1254
+ throw new RevenexxException('Missing required parameter: "name"');
1255
+ }
565
1256
 
566
1257
  const apiPath = '/v1/customers/organizations';
567
- const payload: Payload = {};
1258
+ const apiPayload: Payload = {};
1259
+ if (typeof name !== 'undefined') {
1260
+ apiPayload['name'] = name;
1261
+ }
1262
+ if (typeof settings !== 'undefined') {
1263
+ apiPayload['settings'] = settings;
1264
+ }
1265
+ if (typeof status !== 'undefined') {
1266
+ apiPayload['status'] = status;
1267
+ }
1268
+ if (typeof vatId !== 'undefined') {
1269
+ apiPayload['vat_id'] = vatId;
1270
+ }
568
1271
  const uri = new URL(this.client.config.endpoint + apiPath);
569
1272
 
570
1273
  const apiHeaders: { [header: string]: string } = {
@@ -575,7 +1278,7 @@ export class Customers {
575
1278
  'post',
576
1279
  uri,
577
1280
  apiHeaders,
578
- payload
1281
+ apiPayload
579
1282
  );
580
1283
  }
581
1284
 
@@ -614,7 +1317,7 @@ export class Customers {
614
1317
  }
615
1318
 
616
1319
  const apiPath = '/v1/customers/organizations/{id}'.replace('{id}', id);
617
- const payload: Payload = {};
1320
+ const apiPayload: Payload = {};
618
1321
  const uri = new URL(this.client.config.endpoint + apiPath);
619
1322
 
620
1323
  const apiHeaders: { [header: string]: string } = {
@@ -624,7 +1327,7 @@ export class Customers {
624
1327
  'delete',
625
1328
  uri,
626
1329
  apiHeaders,
627
- payload
1330
+ apiPayload
628
1331
  );
629
1332
  }
630
1333
 
@@ -663,7 +1366,7 @@ export class Customers {
663
1366
  }
664
1367
 
665
1368
  const apiPath = '/v1/customers/organizations/{id}'.replace('{id}', id);
666
- const payload: Payload = {};
1369
+ const apiPayload: Payload = {};
667
1370
  const uri = new URL(this.client.config.endpoint + apiPath);
668
1371
 
669
1372
  const apiHeaders: { [header: string]: string } = {
@@ -673,46 +1376,75 @@ export class Customers {
673
1376
  'get',
674
1377
  uri,
675
1378
  apiHeaders,
676
- payload
1379
+ apiPayload
677
1380
  );
678
1381
  }
679
1382
 
680
1383
  /**
681
1384
  *
682
1385
  * @param {string} params.id -
1386
+ * @param {string} params.name - Company name — mirrored to the platform team.
1387
+ * @param {object} params.settings - Free-form organization settings.
1388
+ * @param {OrganizationStatus} params.status - Default 'active'.
1389
+ * @param {string} params.vatId -
683
1390
  * @throws {RevenexxException}
684
1391
  * @returns {Promise<Models.Organization>}
685
1392
  */
686
- customersOrganizationsUpdate(params: { id: string }): Promise<Models.Organization>;
1393
+ customersOrganizationsUpdate(params: { id: string, name?: string, settings?: object, status?: OrganizationStatus, vatId?: string }): Promise<Models.Organization>;
687
1394
  /**
688
1395
  *
689
1396
  * @param {string} id -
1397
+ * @param {string} name - Company name — mirrored to the platform team.
1398
+ * @param {object} settings - Free-form organization settings.
1399
+ * @param {OrganizationStatus} status - Default 'active'.
1400
+ * @param {string} vatId -
690
1401
  * @throws {RevenexxException}
691
1402
  * @returns {Promise<Models.Organization>}
692
1403
  * @deprecated Use the object parameter style method for a better developer experience.
693
1404
  */
694
- customersOrganizationsUpdate(id: string): Promise<Models.Organization>;
1405
+ customersOrganizationsUpdate(id: string, name?: string, settings?: object, status?: OrganizationStatus, vatId?: string): Promise<Models.Organization>;
695
1406
  customersOrganizationsUpdate(
696
- paramsOrFirst: { id: string } | string
1407
+ paramsOrFirst: { id: string, name?: string, settings?: object, status?: OrganizationStatus, vatId?: string } | string,
1408
+ ...rest: [(string)?, (object)?, (OrganizationStatus)?, (string)?]
697
1409
  ): Promise<Models.Organization> {
698
- let params: { id: string };
1410
+ let params: { id: string, name?: string, settings?: object, status?: OrganizationStatus, vatId?: string };
699
1411
 
700
1412
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
701
- params = (paramsOrFirst || {}) as { id: string };
1413
+ params = (paramsOrFirst || {}) as { id: string, name?: string, settings?: object, status?: OrganizationStatus, vatId?: string };
702
1414
  } else {
703
1415
  params = {
704
- id: paramsOrFirst as string
1416
+ id: paramsOrFirst as string,
1417
+ name: rest[0] as string,
1418
+ settings: rest[1] as object,
1419
+ status: rest[2] as OrganizationStatus,
1420
+ vatId: rest[3] as string
705
1421
  };
706
1422
  }
707
1423
 
708
1424
  const id = params.id;
1425
+ const name = params.name;
1426
+ const settings = params.settings;
1427
+ const status = params.status;
1428
+ const vatId = params.vatId;
709
1429
 
710
1430
  if (typeof id === 'undefined') {
711
1431
  throw new RevenexxException('Missing required parameter: "id"');
712
1432
  }
713
1433
 
714
1434
  const apiPath = '/v1/customers/organizations/{id}'.replace('{id}', id);
715
- const payload: Payload = {};
1435
+ const apiPayload: Payload = {};
1436
+ if (typeof name !== 'undefined') {
1437
+ apiPayload['name'] = name;
1438
+ }
1439
+ if (typeof settings !== 'undefined') {
1440
+ apiPayload['settings'] = settings;
1441
+ }
1442
+ if (typeof status !== 'undefined') {
1443
+ apiPayload['status'] = status;
1444
+ }
1445
+ if (typeof vatId !== 'undefined') {
1446
+ apiPayload['vat_id'] = vatId;
1447
+ }
716
1448
  const uri = new URL(this.client.config.endpoint + apiPath);
717
1449
 
718
1450
  const apiHeaders: { [header: string]: string } = {
@@ -723,7 +1455,7 @@ export class Customers {
723
1455
  'put',
724
1456
  uri,
725
1457
  apiHeaders,
726
- payload
1458
+ apiPayload
727
1459
  );
728
1460
  }
729
1461
  }