xero-node 4.34.0 → 4.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/gen/api/accountingApi.d.ts +245 -100
  2. package/dist/gen/api/accountingApi.js +506 -101
  3. package/dist/gen/api/accountingApi.js.map +1 -1
  4. package/dist/gen/api/appStoreApi.d.ts +5 -3
  5. package/dist/gen/api/appStoreApi.js +8 -4
  6. package/dist/gen/api/appStoreApi.js.map +1 -1
  7. package/dist/gen/api/assetApi.d.ts +5 -3
  8. package/dist/gen/api/assetApi.js +8 -4
  9. package/dist/gen/api/assetApi.js.map +1 -1
  10. package/dist/gen/api/bankfeedsApi.d.ts +7 -4
  11. package/dist/gen/api/bankfeedsApi.js +11 -5
  12. package/dist/gen/api/bankfeedsApi.js.map +1 -1
  13. package/dist/gen/api/filesApi.d.ts +13 -7
  14. package/dist/gen/api/filesApi.js +20 -8
  15. package/dist/gen/api/filesApi.js.map +1 -1
  16. package/dist/gen/api/financeApi.d.ts +1 -1
  17. package/dist/gen/api/financeApi.js +2 -2
  18. package/dist/gen/api/payrollAUApi.d.ts +74 -14
  19. package/dist/gen/api/payrollAUApi.js +242 -15
  20. package/dist/gen/api/payrollAUApi.js.map +1 -1
  21. package/dist/gen/api/payrollNZApi.d.ts +59 -30
  22. package/dist/gen/api/payrollNZApi.js +89 -31
  23. package/dist/gen/api/payrollNZApi.js.map +1 -1
  24. package/dist/gen/api/payrollUKApi.d.ts +55 -28
  25. package/dist/gen/api/payrollUKApi.js +83 -29
  26. package/dist/gen/api/payrollUKApi.js.map +1 -1
  27. package/dist/gen/api/projectApi.d.ts +15 -8
  28. package/dist/gen/api/projectApi.js +23 -9
  29. package/dist/gen/api/projectApi.js.map +1 -1
  30. package/dist/gen/model/accounting/accountType.d.ts +1 -5
  31. package/dist/gen/model/accounting/accountType.js +0 -4
  32. package/dist/gen/model/accounting/accountType.js.map +1 -1
  33. package/dist/gen/model/accounting/allocation.d.ts +8 -0
  34. package/dist/gen/model/accounting/allocation.js +10 -0
  35. package/dist/gen/model/accounting/allocation.js.map +1 -1
  36. package/dist/gen/model/accounting/contact.d.ts +0 -4
  37. package/dist/gen/model/accounting/contact.js +0 -5
  38. package/dist/gen/model/accounting/contact.js.map +1 -1
  39. package/dist/gen/model/accounting/models.js +1 -0
  40. package/dist/gen/model/accounting/models.js.map +1 -1
  41. package/dist/gen/model/accounting/taxRate.d.ts +6 -1
  42. package/dist/gen/model/accounting/taxRate.js +5 -0
  43. package/dist/gen/model/accounting/taxRate.js.map +1 -1
  44. package/dist/gen/model/accounting/taxType.d.ts +11 -1
  45. package/dist/gen/model/accounting/taxType.js +10 -0
  46. package/dist/gen/model/accounting/taxType.js.map +1 -1
  47. package/dist/gen/model/accounting/tenNinetyNineContact.d.ts +23 -0
  48. package/dist/gen/model/accounting/tenNinetyNineContact.js +28 -0
  49. package/dist/gen/model/accounting/tenNinetyNineContact.js.map +1 -1
  50. package/dist/gen/model/finance/problemType.d.ts +2 -1
  51. package/dist/gen/model/finance/problemType.js +1 -0
  52. package/dist/gen/model/finance/problemType.js.map +1 -1
  53. package/dist/gen/model/payroll-au/leavePeriodStatus.d.ts +3 -1
  54. package/dist/gen/model/payroll-au/leavePeriodStatus.js +2 -0
  55. package/dist/gen/model/payroll-au/leavePeriodStatus.js.map +1 -1
  56. package/package.json +1 -1
@@ -3,7 +3,7 @@
3
3
  * Xero Payroll AU API
4
4
  * This is the Xero Payroll API for orgs in Australia region.
5
5
  *
6
- * The version of the OpenAPI document: 2.37.0
6
+ * The version of the OpenAPI document: 2.40.0
7
7
  * Contact: api@xero.com
8
8
  *
9
9
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -34,7 +34,7 @@ var PayrollAuApiApiKeys;
34
34
  class PayrollAuApi {
35
35
  constructor(basePathOrUsername, password, basePath) {
36
36
  this._basePath = defaultBasePath;
37
- this.defaultHeaders = { 'user-agent': 'xero-node-4.34.0' };
37
+ this.defaultHeaders = { 'user-agent': 'xero-node-4.36.0' };
38
38
  this._useQuerystring = false;
39
39
  this.binaryHeaders = {};
40
40
  this.authentications = {
@@ -70,13 +70,79 @@ class PayrollAuApi {
70
70
  set accessToken(token) {
71
71
  this.authentications.OAuth2.accessToken = token;
72
72
  }
73
+ /**
74
+ *
75
+ * @summary Approve a requested leave application by a unique leave application id
76
+ * @param xeroTenantId Xero identifier for Tenant
77
+ * @param leaveApplicationID Leave Application id for single object
78
+ * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
79
+ */
80
+ approveLeaveApplication(xeroTenantId, leaveApplicationID, idempotencyKey, options = { headers: {} }) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ const localVarPath = this.basePath + '/LeaveApplications/{LeaveApplicationID}/approve'
83
+ .replace('{' + 'LeaveApplicationID' + '}', encodeURIComponent(String(leaveApplicationID)));
84
+ let localVarQueryParameters = {};
85
+ let localVarHeaderParams = Object.assign({}, this.defaultHeaders);
86
+ let localVarFormParams = {};
87
+ // verify required parameter 'xeroTenantId' is not null or undefined
88
+ if (xeroTenantId === null || xeroTenantId === undefined) {
89
+ throw new Error('Required parameter xeroTenantId was null or undefined when calling approveLeaveApplication.');
90
+ }
91
+ // verify required parameter 'leaveApplicationID' is not null or undefined
92
+ if (leaveApplicationID === null || leaveApplicationID === undefined) {
93
+ throw new Error('Required parameter leaveApplicationID was null or undefined when calling approveLeaveApplication.');
94
+ }
95
+ localVarHeaderParams['Xero-Tenant-Id'] = models_1.ObjectSerializer.serialize(xeroTenantId, "string");
96
+ localVarHeaderParams['Idempotency-Key'] = models_1.ObjectSerializer.serialize(idempotencyKey, "string");
97
+ Object.assign(localVarHeaderParams, options.headers);
98
+ let localVarUseFormData = false;
99
+ let localVarRequestOptions = {
100
+ method: 'POST',
101
+ qs: localVarQueryParameters,
102
+ headers: localVarHeaderParams,
103
+ uri: localVarPath,
104
+ useQuerystring: this._useQuerystring,
105
+ json: true,
106
+ };
107
+ let authenticationPromise = Promise.resolve();
108
+ authenticationPromise = authenticationPromise.then(() => this.authentications.OAuth2.applyToRequest(localVarRequestOptions));
109
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
110
+ return authenticationPromise.then(() => {
111
+ if (Object.keys(localVarFormParams).length) {
112
+ if (localVarUseFormData) {
113
+ localVarRequestOptions.formData = localVarFormParams;
114
+ }
115
+ else {
116
+ localVarRequestOptions.form = localVarFormParams;
117
+ }
118
+ }
119
+ return new Promise((resolve, reject) => {
120
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
121
+ if (error) {
122
+ reject(error);
123
+ }
124
+ else {
125
+ body = models_1.ObjectSerializer.deserialize(body, "LeaveApplications");
126
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
127
+ resolve({ response: response, body: body });
128
+ }
129
+ else {
130
+ reject({ response: response, body: body });
131
+ }
132
+ }
133
+ });
134
+ });
135
+ });
136
+ });
137
+ }
73
138
  /**
74
139
  *
75
140
  * @summary Creates a payroll employee
76
141
  * @param xeroTenantId Xero identifier for Tenant
77
142
  * @param employee
143
+ * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
78
144
  */
79
- createEmployee(xeroTenantId, employee, options = { headers: {} }) {
145
+ createEmployee(xeroTenantId, employee, idempotencyKey, options = { headers: {} }) {
80
146
  return __awaiter(this, void 0, void 0, function* () {
81
147
  const localVarPath = this.basePath + '/Employees';
82
148
  let localVarQueryParameters = {};
@@ -91,6 +157,7 @@ class PayrollAuApi {
91
157
  throw new Error('Required parameter employee was null or undefined when calling createEmployee.');
92
158
  }
93
159
  localVarHeaderParams['Xero-Tenant-Id'] = models_1.ObjectSerializer.serialize(xeroTenantId, "string");
160
+ localVarHeaderParams['Idempotency-Key'] = models_1.ObjectSerializer.serialize(idempotencyKey, "string");
94
161
  Object.assign(localVarHeaderParams, options.headers);
95
162
  let localVarUseFormData = false;
96
163
  let localVarRequestOptions = {
@@ -138,8 +205,9 @@ class PayrollAuApi {
138
205
  * @summary Creates a leave application
139
206
  * @param xeroTenantId Xero identifier for Tenant
140
207
  * @param leaveApplication
208
+ * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
141
209
  */
142
- createLeaveApplication(xeroTenantId, leaveApplication, options = { headers: {} }) {
210
+ createLeaveApplication(xeroTenantId, leaveApplication, idempotencyKey, options = { headers: {} }) {
143
211
  return __awaiter(this, void 0, void 0, function* () {
144
212
  const localVarPath = this.basePath + '/LeaveApplications';
145
213
  let localVarQueryParameters = {};
@@ -154,6 +222,7 @@ class PayrollAuApi {
154
222
  throw new Error('Required parameter leaveApplication was null or undefined when calling createLeaveApplication.');
155
223
  }
156
224
  localVarHeaderParams['Xero-Tenant-Id'] = models_1.ObjectSerializer.serialize(xeroTenantId, "string");
225
+ localVarHeaderParams['Idempotency-Key'] = models_1.ObjectSerializer.serialize(idempotencyKey, "string");
157
226
  Object.assign(localVarHeaderParams, options.headers);
158
227
  let localVarUseFormData = false;
159
228
  let localVarRequestOptions = {
@@ -201,8 +270,9 @@ class PayrollAuApi {
201
270
  * @summary Creates a pay item
202
271
  * @param xeroTenantId Xero identifier for Tenant
203
272
  * @param payItem
273
+ * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
204
274
  */
205
- createPayItem(xeroTenantId, payItem, options = { headers: {} }) {
275
+ createPayItem(xeroTenantId, payItem, idempotencyKey, options = { headers: {} }) {
206
276
  return __awaiter(this, void 0, void 0, function* () {
207
277
  const localVarPath = this.basePath + '/PayItems';
208
278
  let localVarQueryParameters = {};
@@ -217,6 +287,7 @@ class PayrollAuApi {
217
287
  throw new Error('Required parameter payItem was null or undefined when calling createPayItem.');
218
288
  }
219
289
  localVarHeaderParams['Xero-Tenant-Id'] = models_1.ObjectSerializer.serialize(xeroTenantId, "string");
290
+ localVarHeaderParams['Idempotency-Key'] = models_1.ObjectSerializer.serialize(idempotencyKey, "string");
220
291
  Object.assign(localVarHeaderParams, options.headers);
221
292
  let localVarUseFormData = false;
222
293
  let localVarRequestOptions = {
@@ -264,8 +335,9 @@ class PayrollAuApi {
264
335
  * @summary Creates a pay run
265
336
  * @param xeroTenantId Xero identifier for Tenant
266
337
  * @param payRun
338
+ * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
267
339
  */
268
- createPayRun(xeroTenantId, payRun, options = { headers: {} }) {
340
+ createPayRun(xeroTenantId, payRun, idempotencyKey, options = { headers: {} }) {
269
341
  return __awaiter(this, void 0, void 0, function* () {
270
342
  const localVarPath = this.basePath + '/PayRuns';
271
343
  let localVarQueryParameters = {};
@@ -280,6 +352,7 @@ class PayrollAuApi {
280
352
  throw new Error('Required parameter payRun was null or undefined when calling createPayRun.');
281
353
  }
282
354
  localVarHeaderParams['Xero-Tenant-Id'] = models_1.ObjectSerializer.serialize(xeroTenantId, "string");
355
+ localVarHeaderParams['Idempotency-Key'] = models_1.ObjectSerializer.serialize(idempotencyKey, "string");
283
356
  Object.assign(localVarHeaderParams, options.headers);
284
357
  let localVarUseFormData = false;
285
358
  let localVarRequestOptions = {
@@ -327,8 +400,9 @@ class PayrollAuApi {
327
400
  * @summary Creates a Payroll Calendar
328
401
  * @param xeroTenantId Xero identifier for Tenant
329
402
  * @param payrollCalendar
403
+ * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
330
404
  */
331
- createPayrollCalendar(xeroTenantId, payrollCalendar, options = { headers: {} }) {
405
+ createPayrollCalendar(xeroTenantId, payrollCalendar, idempotencyKey, options = { headers: {} }) {
332
406
  return __awaiter(this, void 0, void 0, function* () {
333
407
  const localVarPath = this.basePath + '/PayrollCalendars';
334
408
  let localVarQueryParameters = {};
@@ -343,6 +417,7 @@ class PayrollAuApi {
343
417
  throw new Error('Required parameter payrollCalendar was null or undefined when calling createPayrollCalendar.');
344
418
  }
345
419
  localVarHeaderParams['Xero-Tenant-Id'] = models_1.ObjectSerializer.serialize(xeroTenantId, "string");
420
+ localVarHeaderParams['Idempotency-Key'] = models_1.ObjectSerializer.serialize(idempotencyKey, "string");
346
421
  Object.assign(localVarHeaderParams, options.headers);
347
422
  let localVarUseFormData = false;
348
423
  let localVarRequestOptions = {
@@ -390,8 +465,9 @@ class PayrollAuApi {
390
465
  * @summary Creates a superfund
391
466
  * @param xeroTenantId Xero identifier for Tenant
392
467
  * @param superFund
468
+ * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
393
469
  */
394
- createSuperfund(xeroTenantId, superFund, options = { headers: {} }) {
470
+ createSuperfund(xeroTenantId, superFund, idempotencyKey, options = { headers: {} }) {
395
471
  return __awaiter(this, void 0, void 0, function* () {
396
472
  const localVarPath = this.basePath + '/Superfunds';
397
473
  let localVarQueryParameters = {};
@@ -406,6 +482,7 @@ class PayrollAuApi {
406
482
  throw new Error('Required parameter superFund was null or undefined when calling createSuperfund.');
407
483
  }
408
484
  localVarHeaderParams['Xero-Tenant-Id'] = models_1.ObjectSerializer.serialize(xeroTenantId, "string");
485
+ localVarHeaderParams['Idempotency-Key'] = models_1.ObjectSerializer.serialize(idempotencyKey, "string");
409
486
  Object.assign(localVarHeaderParams, options.headers);
410
487
  let localVarUseFormData = false;
411
488
  let localVarRequestOptions = {
@@ -453,8 +530,9 @@ class PayrollAuApi {
453
530
  * @summary Creates a timesheet
454
531
  * @param xeroTenantId Xero identifier for Tenant
455
532
  * @param timesheet
533
+ * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
456
534
  */
457
- createTimesheet(xeroTenantId, timesheet, options = { headers: {} }) {
535
+ createTimesheet(xeroTenantId, timesheet, idempotencyKey, options = { headers: {} }) {
458
536
  return __awaiter(this, void 0, void 0, function* () {
459
537
  const localVarPath = this.basePath + '/Timesheets';
460
538
  let localVarQueryParameters = {};
@@ -469,6 +547,7 @@ class PayrollAuApi {
469
547
  throw new Error('Required parameter timesheet was null or undefined when calling createTimesheet.');
470
548
  }
471
549
  localVarHeaderParams['Xero-Tenant-Id'] = models_1.ObjectSerializer.serialize(xeroTenantId, "string");
550
+ localVarHeaderParams['Idempotency-Key'] = models_1.ObjectSerializer.serialize(idempotencyKey, "string");
472
551
  Object.assign(localVarHeaderParams, options.headers);
473
552
  let localVarUseFormData = false;
474
553
  let localVarRequestOptions = {
@@ -779,6 +858,77 @@ class PayrollAuApi {
779
858
  });
780
859
  });
781
860
  }
861
+ /**
862
+ *
863
+ * @summary Retrieves leave applications including leave requests
864
+ * @param xeroTenantId Xero identifier for Tenant
865
+ * @param ifModifiedSince Only records created or modified since this timestamp will be returned
866
+ * @param where Filter by an any element
867
+ * @param order Order by an any element
868
+ * @param page e.g. page&#x3D;1 – Up to 100 objects will be returned in a single API call
869
+ */
870
+ getLeaveApplicationsV2(xeroTenantId, ifModifiedSince, where, order, page, options = { headers: {} }) {
871
+ return __awaiter(this, void 0, void 0, function* () {
872
+ const localVarPath = this.basePath + '/LeaveApplications/v2';
873
+ let localVarQueryParameters = {};
874
+ let localVarHeaderParams = Object.assign({}, this.defaultHeaders);
875
+ let localVarFormParams = {};
876
+ // verify required parameter 'xeroTenantId' is not null or undefined
877
+ if (xeroTenantId === null || xeroTenantId === undefined) {
878
+ throw new Error('Required parameter xeroTenantId was null or undefined when calling getLeaveApplicationsV2.');
879
+ }
880
+ if (where !== undefined) {
881
+ localVarQueryParameters['where'] = models_1.ObjectSerializer.serialize(where, "string");
882
+ }
883
+ if (order !== undefined) {
884
+ localVarQueryParameters['order'] = models_1.ObjectSerializer.serialize(order, "string");
885
+ }
886
+ if (page !== undefined) {
887
+ localVarQueryParameters['page'] = models_1.ObjectSerializer.serialize(page, "number");
888
+ }
889
+ localVarHeaderParams['Xero-Tenant-Id'] = models_1.ObjectSerializer.serialize(xeroTenantId, "string");
890
+ localVarHeaderParams['If-Modified-Since'] = models_1.ObjectSerializer.serialize(ifModifiedSince, "Date");
891
+ Object.assign(localVarHeaderParams, options.headers);
892
+ let localVarUseFormData = false;
893
+ let localVarRequestOptions = {
894
+ method: 'GET',
895
+ qs: localVarQueryParameters,
896
+ headers: localVarHeaderParams,
897
+ uri: localVarPath,
898
+ useQuerystring: this._useQuerystring,
899
+ json: true,
900
+ };
901
+ let authenticationPromise = Promise.resolve();
902
+ authenticationPromise = authenticationPromise.then(() => this.authentications.OAuth2.applyToRequest(localVarRequestOptions));
903
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
904
+ return authenticationPromise.then(() => {
905
+ if (Object.keys(localVarFormParams).length) {
906
+ if (localVarUseFormData) {
907
+ localVarRequestOptions.formData = localVarFormParams;
908
+ }
909
+ else {
910
+ localVarRequestOptions.form = localVarFormParams;
911
+ }
912
+ }
913
+ return new Promise((resolve, reject) => {
914
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
915
+ if (error) {
916
+ reject(error);
917
+ }
918
+ else {
919
+ body = models_1.ObjectSerializer.deserialize(body, "LeaveApplications");
920
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
921
+ resolve({ response: response, body: body });
922
+ }
923
+ else {
924
+ reject({ response: response, body: body });
925
+ }
926
+ }
927
+ });
928
+ });
929
+ });
930
+ });
931
+ }
782
932
  /**
783
933
  *
784
934
  * @summary Retrieves pay items
@@ -1571,14 +1721,80 @@ class PayrollAuApi {
1571
1721
  });
1572
1722
  });
1573
1723
  }
1724
+ /**
1725
+ *
1726
+ * @summary Reject a leave application by a unique leave application id
1727
+ * @param xeroTenantId Xero identifier for Tenant
1728
+ * @param leaveApplicationID Leave Application id for single object
1729
+ * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
1730
+ */
1731
+ rejectLeaveApplication(xeroTenantId, leaveApplicationID, idempotencyKey, options = { headers: {} }) {
1732
+ return __awaiter(this, void 0, void 0, function* () {
1733
+ const localVarPath = this.basePath + '/LeaveApplications/{LeaveApplicationID}/reject'
1734
+ .replace('{' + 'LeaveApplicationID' + '}', encodeURIComponent(String(leaveApplicationID)));
1735
+ let localVarQueryParameters = {};
1736
+ let localVarHeaderParams = Object.assign({}, this.defaultHeaders);
1737
+ let localVarFormParams = {};
1738
+ // verify required parameter 'xeroTenantId' is not null or undefined
1739
+ if (xeroTenantId === null || xeroTenantId === undefined) {
1740
+ throw new Error('Required parameter xeroTenantId was null or undefined when calling rejectLeaveApplication.');
1741
+ }
1742
+ // verify required parameter 'leaveApplicationID' is not null or undefined
1743
+ if (leaveApplicationID === null || leaveApplicationID === undefined) {
1744
+ throw new Error('Required parameter leaveApplicationID was null or undefined when calling rejectLeaveApplication.');
1745
+ }
1746
+ localVarHeaderParams['Xero-Tenant-Id'] = models_1.ObjectSerializer.serialize(xeroTenantId, "string");
1747
+ localVarHeaderParams['Idempotency-Key'] = models_1.ObjectSerializer.serialize(idempotencyKey, "string");
1748
+ Object.assign(localVarHeaderParams, options.headers);
1749
+ let localVarUseFormData = false;
1750
+ let localVarRequestOptions = {
1751
+ method: 'POST',
1752
+ qs: localVarQueryParameters,
1753
+ headers: localVarHeaderParams,
1754
+ uri: localVarPath,
1755
+ useQuerystring: this._useQuerystring,
1756
+ json: true,
1757
+ };
1758
+ let authenticationPromise = Promise.resolve();
1759
+ authenticationPromise = authenticationPromise.then(() => this.authentications.OAuth2.applyToRequest(localVarRequestOptions));
1760
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1761
+ return authenticationPromise.then(() => {
1762
+ if (Object.keys(localVarFormParams).length) {
1763
+ if (localVarUseFormData) {
1764
+ localVarRequestOptions.formData = localVarFormParams;
1765
+ }
1766
+ else {
1767
+ localVarRequestOptions.form = localVarFormParams;
1768
+ }
1769
+ }
1770
+ return new Promise((resolve, reject) => {
1771
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1772
+ if (error) {
1773
+ reject(error);
1774
+ }
1775
+ else {
1776
+ body = models_1.ObjectSerializer.deserialize(body, "LeaveApplications");
1777
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1778
+ resolve({ response: response, body: body });
1779
+ }
1780
+ else {
1781
+ reject({ response: response, body: body });
1782
+ }
1783
+ }
1784
+ });
1785
+ });
1786
+ });
1787
+ });
1788
+ }
1574
1789
  /**
1575
1790
  * Update properties on a single employee
1576
1791
  * @summary Updates an employee\'s detail
1577
1792
  * @param xeroTenantId Xero identifier for Tenant
1578
1793
  * @param employeeID Employee id for single object
1794
+ * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
1579
1795
  * @param employee
1580
1796
  */
1581
- updateEmployee(xeroTenantId, employeeID, employee, options = { headers: {} }) {
1797
+ updateEmployee(xeroTenantId, employeeID, idempotencyKey, employee, options = { headers: {} }) {
1582
1798
  return __awaiter(this, void 0, void 0, function* () {
1583
1799
  const localVarPath = this.basePath + '/Employees/{EmployeeID}'
1584
1800
  .replace('{' + 'EmployeeID' + '}', encodeURIComponent(String(employeeID)));
@@ -1594,6 +1810,7 @@ class PayrollAuApi {
1594
1810
  throw new Error('Required parameter employeeID was null or undefined when calling updateEmployee.');
1595
1811
  }
1596
1812
  localVarHeaderParams['Xero-Tenant-Id'] = models_1.ObjectSerializer.serialize(xeroTenantId, "string");
1813
+ localVarHeaderParams['Idempotency-Key'] = models_1.ObjectSerializer.serialize(idempotencyKey, "string");
1597
1814
  Object.assign(localVarHeaderParams, options.headers);
1598
1815
  let localVarUseFormData = false;
1599
1816
  let localVarRequestOptions = {
@@ -1642,8 +1859,9 @@ class PayrollAuApi {
1642
1859
  * @param xeroTenantId Xero identifier for Tenant
1643
1860
  * @param leaveApplicationID Leave Application id for single object
1644
1861
  * @param leaveApplication
1862
+ * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
1645
1863
  */
1646
- updateLeaveApplication(xeroTenantId, leaveApplicationID, leaveApplication, options = { headers: {} }) {
1864
+ updateLeaveApplication(xeroTenantId, leaveApplicationID, leaveApplication, idempotencyKey, options = { headers: {} }) {
1647
1865
  return __awaiter(this, void 0, void 0, function* () {
1648
1866
  const localVarPath = this.basePath + '/LeaveApplications/{LeaveApplicationID}'
1649
1867
  .replace('{' + 'LeaveApplicationID' + '}', encodeURIComponent(String(leaveApplicationID)));
@@ -1663,6 +1881,7 @@ class PayrollAuApi {
1663
1881
  throw new Error('Required parameter leaveApplication was null or undefined when calling updateLeaveApplication.');
1664
1882
  }
1665
1883
  localVarHeaderParams['Xero-Tenant-Id'] = models_1.ObjectSerializer.serialize(xeroTenantId, "string");
1884
+ localVarHeaderParams['Idempotency-Key'] = models_1.ObjectSerializer.serialize(idempotencyKey, "string");
1666
1885
  Object.assign(localVarHeaderParams, options.headers);
1667
1886
  let localVarUseFormData = false;
1668
1887
  let localVarRequestOptions = {
@@ -1710,9 +1929,10 @@ class PayrollAuApi {
1710
1929
  * @summary Updates a pay run
1711
1930
  * @param xeroTenantId Xero identifier for Tenant
1712
1931
  * @param payRunID PayRun id for single object
1932
+ * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
1713
1933
  * @param payRun
1714
1934
  */
1715
- updatePayRun(xeroTenantId, payRunID, payRun, options = { headers: {} }) {
1935
+ updatePayRun(xeroTenantId, payRunID, idempotencyKey, payRun, options = { headers: {} }) {
1716
1936
  return __awaiter(this, void 0, void 0, function* () {
1717
1937
  const localVarPath = this.basePath + '/PayRuns/{PayRunID}'
1718
1938
  .replace('{' + 'PayRunID' + '}', encodeURIComponent(String(payRunID)));
@@ -1728,6 +1948,7 @@ class PayrollAuApi {
1728
1948
  throw new Error('Required parameter payRunID was null or undefined when calling updatePayRun.');
1729
1949
  }
1730
1950
  localVarHeaderParams['Xero-Tenant-Id'] = models_1.ObjectSerializer.serialize(xeroTenantId, "string");
1951
+ localVarHeaderParams['Idempotency-Key'] = models_1.ObjectSerializer.serialize(idempotencyKey, "string");
1731
1952
  Object.assign(localVarHeaderParams, options.headers);
1732
1953
  let localVarUseFormData = false;
1733
1954
  let localVarRequestOptions = {
@@ -1775,9 +1996,10 @@ class PayrollAuApi {
1775
1996
  * @summary Updates a payslip
1776
1997
  * @param xeroTenantId Xero identifier for Tenant
1777
1998
  * @param payslipID Payslip id for single object
1999
+ * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
1778
2000
  * @param payslipLines
1779
2001
  */
1780
- updatePayslip(xeroTenantId, payslipID, payslipLines, options = { headers: {} }) {
2002
+ updatePayslip(xeroTenantId, payslipID, idempotencyKey, payslipLines, options = { headers: {} }) {
1781
2003
  return __awaiter(this, void 0, void 0, function* () {
1782
2004
  const localVarPath = this.basePath + '/Payslip/{PayslipID}'
1783
2005
  .replace('{' + 'PayslipID' + '}', encodeURIComponent(String(payslipID)));
@@ -1793,6 +2015,7 @@ class PayrollAuApi {
1793
2015
  throw new Error('Required parameter payslipID was null or undefined when calling updatePayslip.');
1794
2016
  }
1795
2017
  localVarHeaderParams['Xero-Tenant-Id'] = models_1.ObjectSerializer.serialize(xeroTenantId, "string");
2018
+ localVarHeaderParams['Idempotency-Key'] = models_1.ObjectSerializer.serialize(idempotencyKey, "string");
1796
2019
  Object.assign(localVarHeaderParams, options.headers);
1797
2020
  let localVarUseFormData = false;
1798
2021
  let localVarRequestOptions = {
@@ -1840,9 +2063,10 @@ class PayrollAuApi {
1840
2063
  * @summary Updates a superfund
1841
2064
  * @param xeroTenantId Xero identifier for Tenant
1842
2065
  * @param superFundID Superfund id for single object
2066
+ * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
1843
2067
  * @param superFund
1844
2068
  */
1845
- updateSuperfund(xeroTenantId, superFundID, superFund, options = { headers: {} }) {
2069
+ updateSuperfund(xeroTenantId, superFundID, idempotencyKey, superFund, options = { headers: {} }) {
1846
2070
  return __awaiter(this, void 0, void 0, function* () {
1847
2071
  const localVarPath = this.basePath + '/Superfunds/{SuperFundID}'
1848
2072
  .replace('{' + 'SuperFundID' + '}', encodeURIComponent(String(superFundID)));
@@ -1858,6 +2082,7 @@ class PayrollAuApi {
1858
2082
  throw new Error('Required parameter superFundID was null or undefined when calling updateSuperfund.');
1859
2083
  }
1860
2084
  localVarHeaderParams['Xero-Tenant-Id'] = models_1.ObjectSerializer.serialize(xeroTenantId, "string");
2085
+ localVarHeaderParams['Idempotency-Key'] = models_1.ObjectSerializer.serialize(idempotencyKey, "string");
1861
2086
  Object.assign(localVarHeaderParams, options.headers);
1862
2087
  let localVarUseFormData = false;
1863
2088
  let localVarRequestOptions = {
@@ -1905,9 +2130,10 @@ class PayrollAuApi {
1905
2130
  * @summary Updates a timesheet
1906
2131
  * @param xeroTenantId Xero identifier for Tenant
1907
2132
  * @param timesheetID Timesheet id for single object
2133
+ * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
1908
2134
  * @param timesheet
1909
2135
  */
1910
- updateTimesheet(xeroTenantId, timesheetID, timesheet, options = { headers: {} }) {
2136
+ updateTimesheet(xeroTenantId, timesheetID, idempotencyKey, timesheet, options = { headers: {} }) {
1911
2137
  return __awaiter(this, void 0, void 0, function* () {
1912
2138
  const localVarPath = this.basePath + '/Timesheets/{TimesheetID}'
1913
2139
  .replace('{' + 'TimesheetID' + '}', encodeURIComponent(String(timesheetID)));
@@ -1923,6 +2149,7 @@ class PayrollAuApi {
1923
2149
  throw new Error('Required parameter timesheetID was null or undefined when calling updateTimesheet.');
1924
2150
  }
1925
2151
  localVarHeaderParams['Xero-Tenant-Id'] = models_1.ObjectSerializer.serialize(xeroTenantId, "string");
2152
+ localVarHeaderParams['Idempotency-Key'] = models_1.ObjectSerializer.serialize(idempotencyKey, "string");
1926
2153
  Object.assign(localVarHeaderParams, options.headers);
1927
2154
  let localVarUseFormData = false;
1928
2155
  let localVarRequestOptions = {