@unified-api/typescript-sdk 1.0.35 → 1.0.37

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 (65) hide show
  1. package/dist/sdk/company.d.ts +24 -0
  2. package/dist/sdk/company.js +402 -0
  3. package/dist/sdk/hris.d.ts +24 -0
  4. package/dist/sdk/hris.js +402 -0
  5. package/dist/sdk/models/operations/createhriscompany.d.ts +28 -0
  6. package/dist/sdk/models/operations/createhriscompany.js +95 -0
  7. package/dist/sdk/models/operations/gethriscompany.d.ts +35 -0
  8. package/dist/sdk/models/operations/gethriscompany.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/listhriscompanies.d.ts +43 -0
  14. package/dist/sdk/models/operations/listhriscompanies.js +119 -0
  15. package/dist/sdk/models/operations/listhrisemployees.d.ts +1 -0
  16. package/dist/sdk/models/operations/listhrisemployees.js +4 -0
  17. package/dist/sdk/models/operations/listhrisgroups.d.ts +1 -0
  18. package/dist/sdk/models/operations/listhrisgroups.js +4 -0
  19. package/dist/sdk/models/operations/patchhriscompany.d.ts +32 -0
  20. package/dist/sdk/models/operations/patchhriscompany.js +99 -0
  21. package/dist/sdk/models/operations/removehriscompany.d.ts +30 -0
  22. package/dist/sdk/models/operations/removehriscompany.js +71 -0
  23. package/dist/sdk/models/operations/updatehriscompany.d.ts +32 -0
  24. package/dist/sdk/models/operations/updatehriscompany.js +99 -0
  25. package/dist/sdk/models/shared/hriscompany.d.ts +11 -0
  26. package/dist/sdk/models/shared/hriscompany.js +85 -0
  27. package/dist/sdk/models/shared/hrisemployee.d.ts +1 -0
  28. package/dist/sdk/models/shared/hrisemployee.js +5 -0
  29. package/dist/sdk/models/shared/hrisgroup.d.ts +1 -0
  30. package/dist/sdk/models/shared/hrisgroup.js +5 -0
  31. package/dist/sdk/models/shared/index.d.ts +2 -0
  32. package/dist/sdk/models/shared/index.js +2 -0
  33. package/dist/sdk/models/shared/propertyconnectionpermissions.d.ts +2 -0
  34. package/dist/sdk/models/shared/propertyconnectionpermissions.js +2 -0
  35. package/dist/sdk/models/shared/propertycrmeventtask.d.ts +6 -0
  36. package/dist/sdk/models/shared/propertycrmeventtask.js +12 -1
  37. package/dist/sdk/models/shared/propertyhriscompanyaddress.d.ts +11 -0
  38. package/dist/sdk/models/shared/propertyhriscompanyaddress.js +80 -0
  39. package/dist/sdk/models/shared/webhook.d.ts +1 -0
  40. package/dist/sdk/models/shared/webhook.js +1 -0
  41. package/dist/sdk/sdk.js +3 -3
  42. package/docs/sdk/models/operations/createhriscompanyrequest.md +9 -0
  43. package/docs/sdk/models/operations/createhriscompanyresponse.md +11 -0
  44. package/docs/sdk/models/operations/gethriscompanyrequest.md +10 -0
  45. package/docs/sdk/models/operations/gethriscompanyresponse.md +11 -0
  46. package/docs/sdk/models/operations/listhriscompaniesrequest.md +15 -0
  47. package/docs/sdk/models/operations/listhriscompaniesresponse.md +11 -0
  48. package/docs/sdk/models/operations/listhrisemployeesrequest.md +1 -0
  49. package/docs/sdk/models/operations/listhrisgroupsrequest.md +1 -0
  50. package/docs/sdk/models/operations/patchhriscompanyrequest.md +10 -0
  51. package/docs/sdk/models/operations/patchhriscompanyresponse.md +11 -0
  52. package/docs/sdk/models/operations/removehriscompanyrequest.md +9 -0
  53. package/docs/sdk/models/operations/removehriscompanyresponse.md +11 -0
  54. package/docs/sdk/models/operations/scopes.md +2 -0
  55. package/docs/sdk/models/operations/updatehriscompanyrequest.md +10 -0
  56. package/docs/sdk/models/operations/updatehriscompanyresponse.md +11 -0
  57. package/docs/sdk/models/shared/hriscompany.md +14 -0
  58. package/docs/sdk/models/shared/hrisemployee.md +1 -0
  59. package/docs/sdk/models/shared/hrisgroup.md +1 -0
  60. package/docs/sdk/models/shared/objecttype.md +1 -0
  61. package/docs/sdk/models/shared/priority.md +10 -0
  62. package/docs/sdk/models/shared/propertyconnectionpermissions.md +2 -0
  63. package/docs/sdk/models/shared/propertycrmeventtask.md +1 -0
  64. package/docs/sdk/models/shared/propertyhriscompanyaddress.md +15 -0
  65. package/package.json +1 -1
@@ -8,6 +8,10 @@ export declare class Company {
8
8
  * Create a company
9
9
  */
10
10
  createCrmCompany(req: operations.CreateCrmCompanyRequest, config?: AxiosRequestConfig): Promise<operations.CreateCrmCompanyResponse>;
11
+ /**
12
+ * Create a company
13
+ */
14
+ createHrisCompany(req: operations.CreateHrisCompanyRequest, config?: AxiosRequestConfig): Promise<operations.CreateHrisCompanyResponse>;
11
15
  /**
12
16
  * Retrieve a company
13
17
  */
@@ -16,6 +20,10 @@ export declare class Company {
16
20
  * Retrieve a company
17
21
  */
18
22
  getCrmCompany(req: operations.GetCrmCompanyRequest, config?: AxiosRequestConfig): Promise<operations.GetCrmCompanyResponse>;
23
+ /**
24
+ * Retrieve a company
25
+ */
26
+ getHrisCompany(req: operations.GetHrisCompanyRequest, config?: AxiosRequestConfig): Promise<operations.GetHrisCompanyResponse>;
19
27
  /**
20
28
  * List all companies
21
29
  */
@@ -28,16 +36,32 @@ export declare class Company {
28
36
  * Retrieve enrichment information for a company
29
37
  */
30
38
  listEnrichCompanies(req: operations.ListEnrichCompaniesRequest, config?: AxiosRequestConfig): Promise<operations.ListEnrichCompaniesResponse>;
39
+ /**
40
+ * List all companies
41
+ */
42
+ listHrisCompanies(req: operations.ListHrisCompaniesRequest, config?: AxiosRequestConfig): Promise<operations.ListHrisCompaniesResponse>;
31
43
  /**
32
44
  * Update a company
33
45
  */
34
46
  patchCrmCompany(req: operations.PatchCrmCompanyRequest, config?: AxiosRequestConfig): Promise<operations.PatchCrmCompanyResponse>;
47
+ /**
48
+ * Update a company
49
+ */
50
+ patchHrisCompany(req: operations.PatchHrisCompanyRequest, config?: AxiosRequestConfig): Promise<operations.PatchHrisCompanyResponse>;
35
51
  /**
36
52
  * Remove a company
37
53
  */
38
54
  removeCrmCompany(req: operations.RemoveCrmCompanyRequest, config?: AxiosRequestConfig): Promise<operations.RemoveCrmCompanyResponse>;
55
+ /**
56
+ * Remove a company
57
+ */
58
+ removeHrisCompany(req: operations.RemoveHrisCompanyRequest, config?: AxiosRequestConfig): Promise<operations.RemoveHrisCompanyResponse>;
39
59
  /**
40
60
  * Update a company
41
61
  */
42
62
  updateCrmCompany(req: operations.UpdateCrmCompanyRequest, config?: AxiosRequestConfig): Promise<operations.UpdateCrmCompanyResponse>;
63
+ /**
64
+ * Update a company
65
+ */
66
+ updateHrisCompany(req: operations.UpdateHrisCompanyRequest, config?: AxiosRequestConfig): Promise<operations.UpdateHrisCompanyResponse>;
43
67
  }
@@ -169,6 +169,77 @@ var Company = /** @class */ (function () {
169
169
  });
170
170
  });
171
171
  };
172
+ /**
173
+ * Create a company
174
+ */
175
+ Company.prototype.createHrisCompany = 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.CreateHrisCompanyRequest(req);
185
+ }
186
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
187
+ operationUrl = utils.generateURL(baseURL, "/hris/{connection_id}/company", req);
188
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
189
+ try {
190
+ _d = __read(utils.serializeRequestBody(req, "hrisCompany", "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.CreateHrisCompanyResponse({
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.hrisCompany = utils.objectToClass(JSON.parse(decodedRes), shared.HrisCompany);
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 company
174
245
  */
@@ -293,6 +364,68 @@ var Company = /** @class */ (function () {
293
364
  });
294
365
  });
295
366
  };
367
+ /**
368
+ * Retrieve a company
369
+ */
370
+ Company.prototype.getHrisCompany = function (req, config) {
371
+ var _a, _b;
372
+ return __awaiter(this, void 0, void 0, function () {
373
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes;
374
+ return __generator(this, function (_c) {
375
+ switch (_c.label) {
376
+ case 0:
377
+ if (!(req instanceof utils.SpeakeasyBase)) {
378
+ req = new operations.GetHrisCompanyRequest(req);
379
+ }
380
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
381
+ operationUrl = utils.generateURL(baseURL, "/hris/{connection_id}/company/{id}", req);
382
+ client = this.sdkConfiguration.defaultClient;
383
+ globalSecurity = this.sdkConfiguration.security;
384
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
385
+ return [4 /*yield*/, globalSecurity()];
386
+ case 1:
387
+ globalSecurity = _c.sent();
388
+ _c.label = 2;
389
+ case 2:
390
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
391
+ globalSecurity = new shared.Security(globalSecurity);
392
+ }
393
+ properties = utils.parseSecurityProperties(globalSecurity);
394
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
395
+ queryParams = utils.serializeQueryParams(req);
396
+ headers["Accept"] = "application/json";
397
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
398
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
399
+ case 3:
400
+ httpRes = _c.sent();
401
+ 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 : "";
402
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
403
+ throw new Error("status code not found in response: ".concat(httpRes));
404
+ }
405
+ res = new operations.GetHrisCompanyResponse({
406
+ statusCode: httpRes.status,
407
+ contentType: responseContentType,
408
+ rawResponse: httpRes,
409
+ });
410
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
411
+ switch (true) {
412
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
413
+ if (utils.matchContentType(responseContentType, "application/json")) {
414
+ res.hrisCompany = utils.objectToClass(JSON.parse(decodedRes), shared.HrisCompany);
415
+ }
416
+ else {
417
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
418
+ }
419
+ break;
420
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
421
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
422
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
423
+ }
424
+ return [2 /*return*/, res];
425
+ }
426
+ });
427
+ });
428
+ };
296
429
  /**
297
430
  * List all companies
298
431
  */
@@ -483,6 +616,70 @@ var Company = /** @class */ (function () {
483
616
  });
484
617
  });
485
618
  };
619
+ /**
620
+ * List all companies
621
+ */
622
+ Company.prototype.listHrisCompanies = function (req, config) {
623
+ var _a, _b;
624
+ return __awaiter(this, void 0, void 0, function () {
625
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes, resFieldDepth;
626
+ return __generator(this, function (_c) {
627
+ switch (_c.label) {
628
+ case 0:
629
+ if (!(req instanceof utils.SpeakeasyBase)) {
630
+ req = new operations.ListHrisCompaniesRequest(req);
631
+ }
632
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
633
+ operationUrl = utils.generateURL(baseURL, "/hris/{connection_id}/company", req);
634
+ client = this.sdkConfiguration.defaultClient;
635
+ globalSecurity = this.sdkConfiguration.security;
636
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
637
+ return [4 /*yield*/, globalSecurity()];
638
+ case 1:
639
+ globalSecurity = _c.sent();
640
+ _c.label = 2;
641
+ case 2:
642
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
643
+ globalSecurity = new shared.Security(globalSecurity);
644
+ }
645
+ properties = utils.parseSecurityProperties(globalSecurity);
646
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
647
+ queryParams = utils.serializeQueryParams(req);
648
+ headers["Accept"] = "application/json";
649
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
650
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
651
+ case 3:
652
+ httpRes = _c.sent();
653
+ 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 : "";
654
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
655
+ throw new Error("status code not found in response: ".concat(httpRes));
656
+ }
657
+ res = new operations.ListHrisCompaniesResponse({
658
+ statusCode: httpRes.status,
659
+ contentType: responseContentType,
660
+ rawResponse: httpRes,
661
+ });
662
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
663
+ switch (true) {
664
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
665
+ if (utils.matchContentType(responseContentType, "application/json")) {
666
+ res.hrisCompanies = [];
667
+ resFieldDepth = utils.getResFieldDepth(res);
668
+ res.hrisCompanies = utils.objectToClass(JSON.parse(decodedRes), shared.HrisCompany, resFieldDepth);
669
+ }
670
+ else {
671
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
672
+ }
673
+ break;
674
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
675
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
676
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
677
+ }
678
+ return [2 /*return*/, res];
679
+ }
680
+ });
681
+ });
682
+ };
486
683
  /**
487
684
  * Update a company
488
685
  */
@@ -554,6 +751,77 @@ var Company = /** @class */ (function () {
554
751
  });
555
752
  });
556
753
  };
754
+ /**
755
+ * Update a company
756
+ */
757
+ Company.prototype.patchHrisCompany = function (req, config) {
758
+ var _a, _b;
759
+ return __awaiter(this, void 0, void 0, function () {
760
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
761
+ var _d;
762
+ return __generator(this, function (_e) {
763
+ switch (_e.label) {
764
+ case 0:
765
+ if (!(req instanceof utils.SpeakeasyBase)) {
766
+ req = new operations.PatchHrisCompanyRequest(req);
767
+ }
768
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
769
+ operationUrl = utils.generateURL(baseURL, "/hris/{connection_id}/company/{id}", req);
770
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
771
+ try {
772
+ _d = __read(utils.serializeRequestBody(req, "hrisCompany", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
773
+ }
774
+ catch (e) {
775
+ if (e instanceof Error) {
776
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
777
+ }
778
+ }
779
+ client = this.sdkConfiguration.defaultClient;
780
+ globalSecurity = this.sdkConfiguration.security;
781
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
782
+ return [4 /*yield*/, globalSecurity()];
783
+ case 1:
784
+ globalSecurity = _e.sent();
785
+ _e.label = 2;
786
+ case 2:
787
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
788
+ globalSecurity = new shared.Security(globalSecurity);
789
+ }
790
+ properties = utils.parseSecurityProperties(globalSecurity);
791
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
792
+ headers["Accept"] = "application/json";
793
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
794
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "patch", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
795
+ case 3:
796
+ httpRes = _e.sent();
797
+ 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 : "";
798
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
799
+ throw new Error("status code not found in response: ".concat(httpRes));
800
+ }
801
+ res = new operations.PatchHrisCompanyResponse({
802
+ statusCode: httpRes.status,
803
+ contentType: responseContentType,
804
+ rawResponse: httpRes,
805
+ });
806
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
807
+ switch (true) {
808
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
809
+ if (utils.matchContentType(responseContentType, "application/json")) {
810
+ res.hrisCompany = utils.objectToClass(JSON.parse(decodedRes), shared.HrisCompany);
811
+ }
812
+ else {
813
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
814
+ }
815
+ break;
816
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
817
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
818
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
819
+ }
820
+ return [2 /*return*/, res];
821
+ }
822
+ });
823
+ });
824
+ };
557
825
  /**
558
826
  * Remove a company
559
827
  */
@@ -617,6 +885,69 @@ var Company = /** @class */ (function () {
617
885
  });
618
886
  });
619
887
  };
888
+ /**
889
+ * Remove a company
890
+ */
891
+ Company.prototype.removeHrisCompany = function (req, config) {
892
+ var _a, _b;
893
+ return __awaiter(this, void 0, void 0, function () {
894
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
895
+ return __generator(this, function (_c) {
896
+ switch (_c.label) {
897
+ case 0:
898
+ if (!(req instanceof utils.SpeakeasyBase)) {
899
+ req = new operations.RemoveHrisCompanyRequest(req);
900
+ }
901
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
902
+ operationUrl = utils.generateURL(baseURL, "/hris/{connection_id}/company/{id}", req);
903
+ client = this.sdkConfiguration.defaultClient;
904
+ globalSecurity = this.sdkConfiguration.security;
905
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
906
+ return [4 /*yield*/, globalSecurity()];
907
+ case 1:
908
+ globalSecurity = _c.sent();
909
+ _c.label = 2;
910
+ case 2:
911
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
912
+ globalSecurity = new shared.Security(globalSecurity);
913
+ }
914
+ properties = utils.parseSecurityProperties(globalSecurity);
915
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
916
+ headers["Accept"] = "application/json";
917
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
918
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
919
+ case 3:
920
+ httpRes = _c.sent();
921
+ 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 : "";
922
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
923
+ throw new Error("status code not found in response: ".concat(httpRes));
924
+ }
925
+ res = new operations.RemoveHrisCompanyResponse({
926
+ statusCode: httpRes.status,
927
+ contentType: responseContentType,
928
+ rawResponse: httpRes,
929
+ });
930
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
931
+ switch (true) {
932
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 200 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 300:
933
+ break;
934
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
935
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
936
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
937
+ default:
938
+ if (utils.matchContentType(responseContentType, "application/json")) {
939
+ res.string = JSON.parse(decodedRes);
940
+ }
941
+ else {
942
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
943
+ }
944
+ break;
945
+ }
946
+ return [2 /*return*/, res];
947
+ }
948
+ });
949
+ });
950
+ };
620
951
  /**
621
952
  * Update a company
622
953
  */
@@ -688,6 +1019,77 @@ var Company = /** @class */ (function () {
688
1019
  });
689
1020
  });
690
1021
  };
1022
+ /**
1023
+ * Update a company
1024
+ */
1025
+ Company.prototype.updateHrisCompany = function (req, config) {
1026
+ var _a, _b;
1027
+ return __awaiter(this, void 0, void 0, function () {
1028
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
1029
+ var _d;
1030
+ return __generator(this, function (_e) {
1031
+ switch (_e.label) {
1032
+ case 0:
1033
+ if (!(req instanceof utils.SpeakeasyBase)) {
1034
+ req = new operations.UpdateHrisCompanyRequest(req);
1035
+ }
1036
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1037
+ operationUrl = utils.generateURL(baseURL, "/hris/{connection_id}/company/{id}", req);
1038
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1039
+ try {
1040
+ _d = __read(utils.serializeRequestBody(req, "hrisCompany", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1041
+ }
1042
+ catch (e) {
1043
+ if (e instanceof Error) {
1044
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
1045
+ }
1046
+ }
1047
+ client = this.sdkConfiguration.defaultClient;
1048
+ globalSecurity = this.sdkConfiguration.security;
1049
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1050
+ return [4 /*yield*/, globalSecurity()];
1051
+ case 1:
1052
+ globalSecurity = _e.sent();
1053
+ _e.label = 2;
1054
+ case 2:
1055
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1056
+ globalSecurity = new shared.Security(globalSecurity);
1057
+ }
1058
+ properties = utils.parseSecurityProperties(globalSecurity);
1059
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1060
+ headers["Accept"] = "application/json";
1061
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
1062
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "put", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1063
+ case 3:
1064
+ httpRes = _e.sent();
1065
+ 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 : "";
1066
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1067
+ throw new Error("status code not found in response: ".concat(httpRes));
1068
+ }
1069
+ res = new operations.UpdateHrisCompanyResponse({
1070
+ statusCode: httpRes.status,
1071
+ contentType: responseContentType,
1072
+ rawResponse: httpRes,
1073
+ });
1074
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1075
+ switch (true) {
1076
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1077
+ if (utils.matchContentType(responseContentType, "application/json")) {
1078
+ res.hrisCompany = utils.objectToClass(JSON.parse(decodedRes), shared.HrisCompany);
1079
+ }
1080
+ else {
1081
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
1082
+ }
1083
+ break;
1084
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1085
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1086
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1087
+ }
1088
+ return [2 /*return*/, res];
1089
+ }
1090
+ });
1091
+ });
1092
+ };
691
1093
  return Company;
692
1094
  }());
693
1095
  exports.Company = Company;
@@ -4,6 +4,10 @@ import { AxiosRequestConfig } from "axios";
4
4
  export declare class Hris {
5
5
  private sdkConfiguration;
6
6
  constructor(sdkConfig: SDKConfiguration);
7
+ /**
8
+ * Create a company
9
+ */
10
+ createHrisCompany(req: operations.CreateHrisCompanyRequest, config?: AxiosRequestConfig): Promise<operations.CreateHrisCompanyResponse>;
7
11
  /**
8
12
  * Create an employee
9
13
  */
@@ -12,6 +16,10 @@ export declare class Hris {
12
16
  * Create a group
13
17
  */
14
18
  createHrisGroup(req: operations.CreateHrisGroupRequest, config?: AxiosRequestConfig): Promise<operations.CreateHrisGroupResponse>;
19
+ /**
20
+ * Retrieve a company
21
+ */
22
+ getHrisCompany(req: operations.GetHrisCompanyRequest, config?: AxiosRequestConfig): Promise<operations.GetHrisCompanyResponse>;
15
23
  /**
16
24
  * Retrieve an employee
17
25
  */
@@ -28,6 +36,10 @@ export declare class Hris {
28
36
  * Retrieve a timeoff
29
37
  */
30
38
  getHrisTimeoff(req: operations.GetHrisTimeoffRequest, config?: AxiosRequestConfig): Promise<operations.GetHrisTimeoffResponse>;
39
+ /**
40
+ * List all companies
41
+ */
42
+ listHrisCompanies(req: operations.ListHrisCompaniesRequest, config?: AxiosRequestConfig): Promise<operations.ListHrisCompaniesResponse>;
31
43
  /**
32
44
  * List all employees
33
45
  */
@@ -44,6 +56,10 @@ export declare class Hris {
44
56
  * List all timeoffs
45
57
  */
46
58
  listHrisTimeoffs(req: operations.ListHrisTimeoffsRequest, config?: AxiosRequestConfig): Promise<operations.ListHrisTimeoffsResponse>;
59
+ /**
60
+ * Update a company
61
+ */
62
+ patchHrisCompany(req: operations.PatchHrisCompanyRequest, config?: AxiosRequestConfig): Promise<operations.PatchHrisCompanyResponse>;
47
63
  /**
48
64
  * Update an employee
49
65
  */
@@ -52,6 +68,10 @@ export declare class Hris {
52
68
  * Update a group
53
69
  */
54
70
  patchHrisGroup(req: operations.PatchHrisGroupRequest, config?: AxiosRequestConfig): Promise<operations.PatchHrisGroupResponse>;
71
+ /**
72
+ * Remove a company
73
+ */
74
+ removeHrisCompany(req: operations.RemoveHrisCompanyRequest, config?: AxiosRequestConfig): Promise<operations.RemoveHrisCompanyResponse>;
55
75
  /**
56
76
  * Remove an employee
57
77
  */
@@ -60,6 +80,10 @@ export declare class Hris {
60
80
  * Remove a group
61
81
  */
62
82
  removeHrisGroup(req: operations.RemoveHrisGroupRequest, config?: AxiosRequestConfig): Promise<operations.RemoveHrisGroupResponse>;
83
+ /**
84
+ * Update a company
85
+ */
86
+ updateHrisCompany(req: operations.UpdateHrisCompanyRequest, config?: AxiosRequestConfig): Promise<operations.UpdateHrisCompanyResponse>;
63
87
  /**
64
88
  * Update an employee
65
89
  */