@unified-api/typescript-sdk 1.0.64 → 1.0.66

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 (52) hide show
  1. package/dist/sdk/hris.d.ts +24 -0
  2. package/dist/sdk/hris.js +400 -0
  3. package/dist/sdk/location.d.ts +24 -0
  4. package/dist/sdk/location.js +400 -0
  5. package/dist/sdk/models/operations/createhrislocation.d.ts +28 -0
  6. package/dist/sdk/models/operations/createhrislocation.js +95 -0
  7. package/dist/sdk/models/operations/gethrislocation.d.ts +35 -0
  8. package/dist/sdk/models/operations/gethrislocation.js +99 -0
  9. package/dist/sdk/models/operations/getunifiedintegrationauth.d.ts +2 -0
  10. package/dist/sdk/models/operations/getunifiedintegrationauth.js +2 -0
  11. package/dist/sdk/models/operations/index.d.ts +6 -0
  12. package/dist/sdk/models/operations/index.js +6 -0
  13. package/dist/sdk/models/operations/listhrislocations.d.ts +41 -0
  14. package/dist/sdk/models/operations/listhrislocations.js +111 -0
  15. package/dist/sdk/models/operations/patchhrislocation.d.ts +32 -0
  16. package/dist/sdk/models/operations/patchhrislocation.js +99 -0
  17. package/dist/sdk/models/operations/removehrislocation.d.ts +30 -0
  18. package/dist/sdk/models/operations/removehrislocation.js +71 -0
  19. package/dist/sdk/models/operations/updatehrislocation.d.ts +32 -0
  20. package/dist/sdk/models/operations/updatehrislocation.js +99 -0
  21. package/dist/sdk/models/shared/hrisemployee.d.ts +7 -0
  22. package/dist/sdk/models/shared/hrisemployee.js +14 -0
  23. package/dist/sdk/models/shared/hrislocation.d.ts +20 -0
  24. package/dist/sdk/models/shared/hrislocation.js +127 -0
  25. package/dist/sdk/models/shared/index.d.ts +2 -0
  26. package/dist/sdk/models/shared/index.js +2 -0
  27. package/dist/sdk/models/shared/propertyconnectionpermissions.d.ts +2 -0
  28. package/dist/sdk/models/shared/propertyconnectionpermissions.js +2 -0
  29. package/dist/sdk/models/shared/propertyhrislocationaddress.d.ts +11 -0
  30. package/dist/sdk/models/shared/propertyhrislocationaddress.js +80 -0
  31. package/dist/sdk/models/shared/webhook.d.ts +1 -0
  32. package/dist/sdk/models/shared/webhook.js +1 -0
  33. package/dist/sdk/sdk.js +3 -3
  34. package/docs/sdk/models/operations/createhrislocationrequest.md +9 -0
  35. package/docs/sdk/models/operations/createhrislocationresponse.md +11 -0
  36. package/docs/sdk/models/operations/gethrislocationrequest.md +10 -0
  37. package/docs/sdk/models/operations/gethrislocationresponse.md +11 -0
  38. package/docs/sdk/models/operations/listhrislocationsrequest.md +13 -0
  39. package/docs/sdk/models/operations/listhrislocationsresponse.md +11 -0
  40. package/docs/sdk/models/operations/patchhrislocationrequest.md +10 -0
  41. package/docs/sdk/models/operations/patchhrislocationresponse.md +11 -0
  42. package/docs/sdk/models/operations/removehrislocationrequest.md +9 -0
  43. package/docs/sdk/models/operations/removehrislocationresponse.md +11 -0
  44. package/docs/sdk/models/operations/scopes.md +2 -0
  45. package/docs/sdk/models/operations/updatehrislocationrequest.md +10 -0
  46. package/docs/sdk/models/operations/updatehrislocationresponse.md +11 -0
  47. package/docs/sdk/models/shared/hrisemployee.md +36 -34
  48. package/docs/sdk/models/shared/hrislocation.md +22 -0
  49. package/docs/sdk/models/shared/objecttype.md +1 -0
  50. package/docs/sdk/models/shared/propertyconnectionpermissions.md +2 -0
  51. package/docs/sdk/models/shared/propertyhrislocationaddress.md +15 -0
  52. package/package.json +1 -1
@@ -169,6 +169,77 @@ var Location = /** @class */ (function () {
169
169
  });
170
170
  });
171
171
  };
172
+ /**
173
+ * Create a location
174
+ */
175
+ Location.prototype.createHrisLocation = function (req, config) {
176
+ var _a, _b;
177
+ return __awaiter(this, void 0, void 0, function () {
178
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
179
+ var _d;
180
+ return __generator(this, function (_e) {
181
+ switch (_e.label) {
182
+ case 0:
183
+ if (!(req instanceof utils.SpeakeasyBase)) {
184
+ req = new operations.CreateHrisLocationRequest(req);
185
+ }
186
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
187
+ operationUrl = utils.generateURL(baseURL, "/hris/{connection_id}/location", req);
188
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
189
+ try {
190
+ _d = __read(utils.serializeRequestBody(req, "hrisLocation", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
191
+ }
192
+ catch (e) {
193
+ if (e instanceof Error) {
194
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
195
+ }
196
+ }
197
+ client = this.sdkConfiguration.defaultClient;
198
+ globalSecurity = this.sdkConfiguration.security;
199
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
200
+ return [4 /*yield*/, globalSecurity()];
201
+ case 1:
202
+ globalSecurity = _e.sent();
203
+ _e.label = 2;
204
+ case 2:
205
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
206
+ globalSecurity = new shared.Security(globalSecurity);
207
+ }
208
+ properties = utils.parseSecurityProperties(globalSecurity);
209
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
210
+ headers["Accept"] = "application/json";
211
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
212
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
213
+ case 3:
214
+ httpRes = _e.sent();
215
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
216
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
217
+ throw new Error("status code not found in response: ".concat(httpRes));
218
+ }
219
+ res = new operations.CreateHrisLocationResponse({
220
+ statusCode: httpRes.status,
221
+ contentType: responseContentType,
222
+ rawResponse: httpRes,
223
+ });
224
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
225
+ switch (true) {
226
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
227
+ if (utils.matchContentType(responseContentType, "application/json")) {
228
+ res.hrisLocation = utils.objectToClass(JSON.parse(decodedRes), shared.HrisLocation);
229
+ }
230
+ else {
231
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
232
+ }
233
+ break;
234
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
235
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
236
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
237
+ }
238
+ return [2 /*return*/, res];
239
+ }
240
+ });
241
+ });
242
+ };
172
243
  /**
173
244
  * Retrieve a location
174
245
  */
@@ -231,6 +302,68 @@ var Location = /** @class */ (function () {
231
302
  });
232
303
  });
233
304
  };
305
+ /**
306
+ * Retrieve a location
307
+ */
308
+ Location.prototype.getHrisLocation = function (req, config) {
309
+ var _a, _b;
310
+ return __awaiter(this, void 0, void 0, function () {
311
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes;
312
+ return __generator(this, function (_c) {
313
+ switch (_c.label) {
314
+ case 0:
315
+ if (!(req instanceof utils.SpeakeasyBase)) {
316
+ req = new operations.GetHrisLocationRequest(req);
317
+ }
318
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
319
+ operationUrl = utils.generateURL(baseURL, "/hris/{connection_id}/location/{id}", req);
320
+ client = this.sdkConfiguration.defaultClient;
321
+ globalSecurity = this.sdkConfiguration.security;
322
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
323
+ return [4 /*yield*/, globalSecurity()];
324
+ case 1:
325
+ globalSecurity = _c.sent();
326
+ _c.label = 2;
327
+ case 2:
328
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
329
+ globalSecurity = new shared.Security(globalSecurity);
330
+ }
331
+ properties = utils.parseSecurityProperties(globalSecurity);
332
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
333
+ queryParams = utils.serializeQueryParams(req);
334
+ headers["Accept"] = "application/json";
335
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
336
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
337
+ case 3:
338
+ httpRes = _c.sent();
339
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
340
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
341
+ throw new Error("status code not found in response: ".concat(httpRes));
342
+ }
343
+ res = new operations.GetHrisLocationResponse({
344
+ statusCode: httpRes.status,
345
+ contentType: responseContentType,
346
+ rawResponse: httpRes,
347
+ });
348
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
349
+ switch (true) {
350
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
351
+ if (utils.matchContentType(responseContentType, "application/json")) {
352
+ res.hrisLocation = utils.objectToClass(JSON.parse(decodedRes), shared.HrisLocation);
353
+ }
354
+ else {
355
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
356
+ }
357
+ break;
358
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
359
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
360
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
361
+ }
362
+ return [2 /*return*/, res];
363
+ }
364
+ });
365
+ });
366
+ };
234
367
  /**
235
368
  * List all locations
236
369
  */
@@ -295,6 +428,70 @@ var Location = /** @class */ (function () {
295
428
  });
296
429
  });
297
430
  };
431
+ /**
432
+ * List all locations
433
+ */
434
+ Location.prototype.listHrisLocations = function (req, config) {
435
+ var _a, _b;
436
+ return __awaiter(this, void 0, void 0, function () {
437
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes, resFieldDepth;
438
+ return __generator(this, function (_c) {
439
+ switch (_c.label) {
440
+ case 0:
441
+ if (!(req instanceof utils.SpeakeasyBase)) {
442
+ req = new operations.ListHrisLocationsRequest(req);
443
+ }
444
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
445
+ operationUrl = utils.generateURL(baseURL, "/hris/{connection_id}/location", req);
446
+ client = this.sdkConfiguration.defaultClient;
447
+ globalSecurity = this.sdkConfiguration.security;
448
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
449
+ return [4 /*yield*/, globalSecurity()];
450
+ case 1:
451
+ globalSecurity = _c.sent();
452
+ _c.label = 2;
453
+ case 2:
454
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
455
+ globalSecurity = new shared.Security(globalSecurity);
456
+ }
457
+ properties = utils.parseSecurityProperties(globalSecurity);
458
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
459
+ queryParams = utils.serializeQueryParams(req);
460
+ headers["Accept"] = "application/json";
461
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
462
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
463
+ case 3:
464
+ httpRes = _c.sent();
465
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
466
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
467
+ throw new Error("status code not found in response: ".concat(httpRes));
468
+ }
469
+ res = new operations.ListHrisLocationsResponse({
470
+ statusCode: httpRes.status,
471
+ contentType: responseContentType,
472
+ rawResponse: httpRes,
473
+ });
474
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
475
+ switch (true) {
476
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
477
+ if (utils.matchContentType(responseContentType, "application/json")) {
478
+ res.hrisLocations = [];
479
+ resFieldDepth = utils.getResFieldDepth(res);
480
+ res.hrisLocations = utils.objectToClass(JSON.parse(decodedRes), shared.HrisLocation, resFieldDepth);
481
+ }
482
+ else {
483
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
484
+ }
485
+ break;
486
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
487
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
488
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
489
+ }
490
+ return [2 /*return*/, res];
491
+ }
492
+ });
493
+ });
494
+ };
298
495
  /**
299
496
  * Update a location
300
497
  */
@@ -366,6 +563,77 @@ var Location = /** @class */ (function () {
366
563
  });
367
564
  });
368
565
  };
566
+ /**
567
+ * Update a location
568
+ */
569
+ Location.prototype.patchHrisLocation = function (req, config) {
570
+ var _a, _b;
571
+ return __awaiter(this, void 0, void 0, function () {
572
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
573
+ var _d;
574
+ return __generator(this, function (_e) {
575
+ switch (_e.label) {
576
+ case 0:
577
+ if (!(req instanceof utils.SpeakeasyBase)) {
578
+ req = new operations.PatchHrisLocationRequest(req);
579
+ }
580
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
581
+ operationUrl = utils.generateURL(baseURL, "/hris/{connection_id}/location/{id}", req);
582
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
583
+ try {
584
+ _d = __read(utils.serializeRequestBody(req, "hrisLocation", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
585
+ }
586
+ catch (e) {
587
+ if (e instanceof Error) {
588
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
589
+ }
590
+ }
591
+ client = this.sdkConfiguration.defaultClient;
592
+ globalSecurity = this.sdkConfiguration.security;
593
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
594
+ return [4 /*yield*/, globalSecurity()];
595
+ case 1:
596
+ globalSecurity = _e.sent();
597
+ _e.label = 2;
598
+ case 2:
599
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
600
+ globalSecurity = new shared.Security(globalSecurity);
601
+ }
602
+ properties = utils.parseSecurityProperties(globalSecurity);
603
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
604
+ headers["Accept"] = "application/json";
605
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
606
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "patch", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
607
+ case 3:
608
+ httpRes = _e.sent();
609
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
610
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
611
+ throw new Error("status code not found in response: ".concat(httpRes));
612
+ }
613
+ res = new operations.PatchHrisLocationResponse({
614
+ statusCode: httpRes.status,
615
+ contentType: responseContentType,
616
+ rawResponse: httpRes,
617
+ });
618
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
619
+ switch (true) {
620
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
621
+ if (utils.matchContentType(responseContentType, "application/json")) {
622
+ res.hrisLocation = utils.objectToClass(JSON.parse(decodedRes), shared.HrisLocation);
623
+ }
624
+ else {
625
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
626
+ }
627
+ break;
628
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
629
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
630
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
631
+ }
632
+ return [2 /*return*/, res];
633
+ }
634
+ });
635
+ });
636
+ };
369
637
  /**
370
638
  * Remove a location
371
639
  */
@@ -427,6 +695,67 @@ var Location = /** @class */ (function () {
427
695
  });
428
696
  });
429
697
  };
698
+ /**
699
+ * Remove a location
700
+ */
701
+ Location.prototype.removeHrisLocation = function (req, config) {
702
+ var _a, _b;
703
+ return __awaiter(this, void 0, void 0, function () {
704
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
705
+ return __generator(this, function (_c) {
706
+ switch (_c.label) {
707
+ case 0:
708
+ if (!(req instanceof utils.SpeakeasyBase)) {
709
+ req = new operations.RemoveHrisLocationRequest(req);
710
+ }
711
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
712
+ operationUrl = utils.generateURL(baseURL, "/hris/{connection_id}/location/{id}", req);
713
+ client = this.sdkConfiguration.defaultClient;
714
+ globalSecurity = this.sdkConfiguration.security;
715
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
716
+ return [4 /*yield*/, globalSecurity()];
717
+ case 1:
718
+ globalSecurity = _c.sent();
719
+ _c.label = 2;
720
+ case 2:
721
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
722
+ globalSecurity = new shared.Security(globalSecurity);
723
+ }
724
+ properties = utils.parseSecurityProperties(globalSecurity);
725
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
726
+ headers["Accept"] = "application/json";
727
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
728
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
729
+ case 3:
730
+ httpRes = _c.sent();
731
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
732
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
733
+ throw new Error("status code not found in response: ".concat(httpRes));
734
+ }
735
+ res = new operations.RemoveHrisLocationResponse({
736
+ statusCode: httpRes.status,
737
+ contentType: responseContentType,
738
+ rawResponse: httpRes,
739
+ });
740
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
741
+ switch (true) {
742
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
743
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
744
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
745
+ default:
746
+ if (utils.matchContentType(responseContentType, "application/json")) {
747
+ res.string = JSON.parse(decodedRes);
748
+ }
749
+ else {
750
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
751
+ }
752
+ break;
753
+ }
754
+ return [2 /*return*/, res];
755
+ }
756
+ });
757
+ });
758
+ };
430
759
  /**
431
760
  * Update a location
432
761
  */
@@ -498,6 +827,77 @@ var Location = /** @class */ (function () {
498
827
  });
499
828
  });
500
829
  };
830
+ /**
831
+ * Update a location
832
+ */
833
+ Location.prototype.updateHrisLocation = function (req, config) {
834
+ var _a, _b;
835
+ return __awaiter(this, void 0, void 0, function () {
836
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
837
+ var _d;
838
+ return __generator(this, function (_e) {
839
+ switch (_e.label) {
840
+ case 0:
841
+ if (!(req instanceof utils.SpeakeasyBase)) {
842
+ req = new operations.UpdateHrisLocationRequest(req);
843
+ }
844
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
845
+ operationUrl = utils.generateURL(baseURL, "/hris/{connection_id}/location/{id}", req);
846
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
847
+ try {
848
+ _d = __read(utils.serializeRequestBody(req, "hrisLocation", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
849
+ }
850
+ catch (e) {
851
+ if (e instanceof Error) {
852
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
853
+ }
854
+ }
855
+ client = this.sdkConfiguration.defaultClient;
856
+ globalSecurity = this.sdkConfiguration.security;
857
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
858
+ return [4 /*yield*/, globalSecurity()];
859
+ case 1:
860
+ globalSecurity = _e.sent();
861
+ _e.label = 2;
862
+ case 2:
863
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
864
+ globalSecurity = new shared.Security(globalSecurity);
865
+ }
866
+ properties = utils.parseSecurityProperties(globalSecurity);
867
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
868
+ headers["Accept"] = "application/json";
869
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
870
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "put", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
871
+ case 3:
872
+ httpRes = _e.sent();
873
+ responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
874
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
875
+ throw new Error("status code not found in response: ".concat(httpRes));
876
+ }
877
+ res = new operations.UpdateHrisLocationResponse({
878
+ statusCode: httpRes.status,
879
+ contentType: responseContentType,
880
+ rawResponse: httpRes,
881
+ });
882
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
883
+ switch (true) {
884
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
885
+ if (utils.matchContentType(responseContentType, "application/json")) {
886
+ res.hrisLocation = utils.objectToClass(JSON.parse(decodedRes), shared.HrisLocation);
887
+ }
888
+ else {
889
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
890
+ }
891
+ break;
892
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
893
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
894
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
895
+ }
896
+ return [2 /*return*/, res];
897
+ }
898
+ });
899
+ });
900
+ };
501
901
  return Location;
502
902
  }());
503
903
  exports.Location = Location;
@@ -0,0 +1,28 @@
1
+ import { SpeakeasyBase } from "../../../internal/utils";
2
+ import * as shared from "../../../sdk/models/shared";
3
+ import { AxiosResponse } from "axios";
4
+ export declare class CreateHrisLocationRequest extends SpeakeasyBase {
5
+ hrisLocation?: shared.HrisLocation;
6
+ /**
7
+ * ID of the connection
8
+ */
9
+ connectionId: string;
10
+ }
11
+ export declare class CreateHrisLocationResponse extends SpeakeasyBase {
12
+ /**
13
+ * HTTP response content type for this operation
14
+ */
15
+ contentType: string;
16
+ /**
17
+ * Successful
18
+ */
19
+ hrisLocation?: shared.HrisLocation;
20
+ /**
21
+ * HTTP response status code for this operation
22
+ */
23
+ statusCode: number;
24
+ /**
25
+ * Raw HTTP response; suitable for custom response parsing
26
+ */
27
+ rawResponse: AxiosResponse;
28
+ }
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
+ */
5
+ var __extends = (this && this.__extends) || (function () {
6
+ var extendStatics = function (d, b) {
7
+ extendStatics = Object.setPrototypeOf ||
8
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
9
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
10
+ return extendStatics(d, b);
11
+ };
12
+ return function (d, b) {
13
+ if (typeof b !== "function" && b !== null)
14
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
15
+ extendStatics(d, b);
16
+ function __() { this.constructor = d; }
17
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
18
+ };
19
+ })();
20
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ var desc = Object.getOwnPropertyDescriptor(m, k);
23
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
24
+ desc = { enumerable: true, get: function() { return m[k]; } };
25
+ }
26
+ Object.defineProperty(o, k2, desc);
27
+ }) : (function(o, m, k, k2) {
28
+ if (k2 === undefined) k2 = k;
29
+ o[k2] = m[k];
30
+ }));
31
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
32
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
33
+ }) : function(o, v) {
34
+ o["default"] = v;
35
+ });
36
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
37
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
38
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
39
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
40
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
41
+ };
42
+ var __importStar = (this && this.__importStar) || function (mod) {
43
+ if (mod && mod.__esModule) return mod;
44
+ var result = {};
45
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
46
+ __setModuleDefault(result, mod);
47
+ return result;
48
+ };
49
+ var __metadata = (this && this.__metadata) || function (k, v) {
50
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
51
+ };
52
+ Object.defineProperty(exports, "__esModule", { value: true });
53
+ exports.CreateHrisLocationResponse = exports.CreateHrisLocationRequest = void 0;
54
+ var utils_1 = require("../../../internal/utils");
55
+ var shared = __importStar(require("../../../sdk/models/shared"));
56
+ var CreateHrisLocationRequest = /** @class */ (function (_super) {
57
+ __extends(CreateHrisLocationRequest, _super);
58
+ function CreateHrisLocationRequest() {
59
+ return _super !== null && _super.apply(this, arguments) || this;
60
+ }
61
+ __decorate([
62
+ (0, utils_1.SpeakeasyMetadata)({ data: "request, media_type=application/json" }),
63
+ __metadata("design:type", shared.HrisLocation)
64
+ ], CreateHrisLocationRequest.prototype, "hrisLocation", void 0);
65
+ __decorate([
66
+ (0, utils_1.SpeakeasyMetadata)({ data: "pathParam, style=simple;explode=false;name=connection_id" }),
67
+ __metadata("design:type", String)
68
+ ], CreateHrisLocationRequest.prototype, "connectionId", void 0);
69
+ return CreateHrisLocationRequest;
70
+ }(utils_1.SpeakeasyBase));
71
+ exports.CreateHrisLocationRequest = CreateHrisLocationRequest;
72
+ var CreateHrisLocationResponse = /** @class */ (function (_super) {
73
+ __extends(CreateHrisLocationResponse, _super);
74
+ function CreateHrisLocationResponse() {
75
+ return _super !== null && _super.apply(this, arguments) || this;
76
+ }
77
+ __decorate([
78
+ (0, utils_1.SpeakeasyMetadata)(),
79
+ __metadata("design:type", String)
80
+ ], CreateHrisLocationResponse.prototype, "contentType", void 0);
81
+ __decorate([
82
+ (0, utils_1.SpeakeasyMetadata)(),
83
+ __metadata("design:type", shared.HrisLocation)
84
+ ], CreateHrisLocationResponse.prototype, "hrisLocation", void 0);
85
+ __decorate([
86
+ (0, utils_1.SpeakeasyMetadata)(),
87
+ __metadata("design:type", Number)
88
+ ], CreateHrisLocationResponse.prototype, "statusCode", void 0);
89
+ __decorate([
90
+ (0, utils_1.SpeakeasyMetadata)(),
91
+ __metadata("design:type", Object)
92
+ ], CreateHrisLocationResponse.prototype, "rawResponse", void 0);
93
+ return CreateHrisLocationResponse;
94
+ }(utils_1.SpeakeasyBase));
95
+ exports.CreateHrisLocationResponse = CreateHrisLocationResponse;
@@ -0,0 +1,35 @@
1
+ import { SpeakeasyBase } from "../../../internal/utils";
2
+ import * as shared from "../../../sdk/models/shared";
3
+ import { AxiosResponse } from "axios";
4
+ export declare class GetHrisLocationRequest extends SpeakeasyBase {
5
+ /**
6
+ * ID of the connection
7
+ */
8
+ connectionId: string;
9
+ /**
10
+ * Comma-delimited fields to return
11
+ */
12
+ fields?: string[];
13
+ /**
14
+ * ID of the Location
15
+ */
16
+ id: string;
17
+ }
18
+ export declare class GetHrisLocationResponse extends SpeakeasyBase {
19
+ /**
20
+ * HTTP response content type for this operation
21
+ */
22
+ contentType: string;
23
+ /**
24
+ * Successful
25
+ */
26
+ hrisLocation?: shared.HrisLocation;
27
+ /**
28
+ * HTTP response status code for this operation
29
+ */
30
+ statusCode: number;
31
+ /**
32
+ * Raw HTTP response; suitable for custom response parsing
33
+ */
34
+ rawResponse: AxiosResponse;
35
+ }