@unified-api/typescript-sdk 1.0.0 → 1.0.1

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 (193) hide show
  1. package/README.md +54 -700
  2. package/dist/sdk/accounting.d.ts +0 -40
  3. package/dist/sdk/accounting.js +44 -696
  4. package/dist/sdk/link.d.ts +31 -0
  5. package/dist/sdk/link.js +503 -0
  6. package/dist/sdk/models/operations/{createaccountingpayment.d.ts → createpaymentlink.d.ts} +7 -7
  7. package/dist/sdk/models/operations/createpaymentlink.js +95 -0
  8. package/dist/sdk/models/operations/createpaymentpayment.d.ts +28 -0
  9. package/dist/sdk/models/operations/{createaccountingpayment.js → createpaymentpayment.js} +20 -20
  10. package/dist/sdk/models/operations/getpaymentlink.d.ts +35 -0
  11. package/dist/sdk/models/operations/getpaymentlink.js +99 -0
  12. package/dist/sdk/models/operations/{getaccountingpayment.d.ts → getpaymentpayment.d.ts} +6 -6
  13. package/dist/sdk/models/operations/{getaccountingpayment.js → getpaymentpayment.js} +20 -20
  14. package/dist/sdk/models/operations/{getaccountingpayout.d.ts → getpaymentpayout.d.ts} +6 -6
  15. package/dist/sdk/models/operations/{getaccountingpayout.js → getpaymentpayout.js} +20 -20
  16. package/dist/sdk/models/operations/{getaccountingrefund.d.ts → getpaymentrefund.d.ts} +6 -6
  17. package/dist/sdk/models/operations/{getaccountingrefund.js → getpaymentrefund.js} +20 -20
  18. package/dist/sdk/models/operations/getunifiedintegrationauth.d.ts +6 -4
  19. package/dist/sdk/models/operations/getunifiedintegrationauth.js +6 -4
  20. package/dist/sdk/models/operations/index.d.ts +16 -10
  21. package/dist/sdk/models/operations/index.js +16 -10
  22. package/dist/sdk/models/operations/listpaymentlinks.d.ts +51 -0
  23. package/dist/sdk/models/operations/listpaymentlinks.js +127 -0
  24. package/dist/sdk/models/operations/{listaccountingpayments.d.ts → listpaymentpayments.d.ts} +6 -6
  25. package/dist/sdk/models/operations/{listaccountingpayments.js → listpaymentpayments.js} +28 -28
  26. package/dist/sdk/models/operations/{listaccountingpayouts.d.ts → listpaymentpayouts.d.ts} +6 -6
  27. package/dist/sdk/models/operations/{listaccountingpayouts.js → listpaymentpayouts.js} +26 -26
  28. package/dist/sdk/models/operations/{listaccountingrefunds.d.ts → listpaymentrefunds.d.ts} +6 -6
  29. package/dist/sdk/models/operations/{listaccountingrefunds.js → listpaymentrefunds.js} +27 -27
  30. package/dist/sdk/models/operations/listunifiedconnections.d.ts +2 -1
  31. package/dist/sdk/models/operations/listunifiedconnections.js +1 -0
  32. package/dist/sdk/models/operations/listunifiedintegrations.d.ts +2 -1
  33. package/dist/sdk/models/operations/listunifiedintegrations.js +1 -0
  34. package/dist/sdk/models/operations/listunifiedintegrationworkspaces.d.ts +2 -1
  35. package/dist/sdk/models/operations/listunifiedintegrationworkspaces.js +1 -0
  36. package/dist/sdk/models/operations/patchpaymentlink.d.ts +32 -0
  37. package/dist/sdk/models/operations/patchpaymentlink.js +99 -0
  38. package/dist/sdk/models/operations/{patchaccountingpayment.d.ts → patchpaymentpayment.d.ts} +7 -7
  39. package/dist/sdk/models/operations/{patchaccountingpayment.js → patchpaymentpayment.js} +21 -21
  40. package/dist/sdk/models/operations/removepaymentlink.d.ts +30 -0
  41. package/dist/sdk/models/operations/{removeaccountingpayment.js → removepaymentlink.js} +17 -17
  42. package/dist/sdk/models/operations/{removeaccountingpayment.d.ts → removepaymentpayment.d.ts} +2 -2
  43. package/dist/sdk/models/operations/removepaymentpayment.js +71 -0
  44. package/dist/sdk/models/operations/updatepaymentlink.d.ts +32 -0
  45. package/dist/sdk/models/operations/updatepaymentlink.js +99 -0
  46. package/dist/sdk/models/operations/{updateaccountingpayment.d.ts → updatepaymentpayment.d.ts} +7 -7
  47. package/dist/sdk/models/operations/{updateaccountingpayment.js → updatepaymentpayment.js} +21 -21
  48. package/dist/sdk/models/shared/index.d.ts +5 -3
  49. package/dist/sdk/models/shared/index.js +5 -3
  50. package/dist/sdk/models/shared/paymenntlinklineitem.d.ts +20 -0
  51. package/dist/sdk/models/shared/paymenntlinklineitem.js +137 -0
  52. package/dist/sdk/models/shared/paymentlink.d.ts +15 -0
  53. package/dist/sdk/models/shared/paymentlink.js +105 -0
  54. package/dist/sdk/models/shared/{accountingpayment.d.ts → paymentpayment.d.ts} +1 -1
  55. package/dist/sdk/models/shared/{accountingpayment.js → paymentpayment.js} +18 -18
  56. package/dist/sdk/models/shared/{accountingpayout.d.ts → paymentpayout.d.ts} +3 -3
  57. package/dist/sdk/models/shared/{accountingpayout.js → paymentpayout.js} +21 -21
  58. package/dist/sdk/models/shared/{accountingrefund.d.ts → paymentrefund.d.ts} +3 -3
  59. package/dist/sdk/models/shared/{accountingrefund.js → paymentrefund.js} +23 -23
  60. package/dist/sdk/models/shared/propertyconnectioncategories.d.ts +2 -1
  61. package/dist/sdk/models/shared/propertyconnectioncategories.js +1 -0
  62. package/dist/sdk/models/shared/propertyconnectionpermissions.d.ts +6 -4
  63. package/dist/sdk/models/shared/propertyconnectionpermissions.js +6 -4
  64. package/dist/sdk/models/shared/propertyintegrationcategories.d.ts +2 -1
  65. package/dist/sdk/models/shared/propertyintegrationcategories.js +1 -0
  66. package/dist/sdk/models/shared/webhook.d.ts +4 -3
  67. package/dist/sdk/models/shared/webhook.js +4 -3
  68. package/dist/sdk/payment.d.ts +46 -6
  69. package/dist/sdk/payment.js +705 -53
  70. package/dist/sdk/payout.d.ts +2 -2
  71. package/dist/sdk/payout.js +11 -11
  72. package/dist/sdk/refund.d.ts +2 -2
  73. package/dist/sdk/refund.js +11 -11
  74. package/dist/sdk/sdk.d.ts +5 -3
  75. package/dist/sdk/sdk.js +7 -5
  76. package/docs/sdk/models/operations/categories.md +2 -1
  77. package/docs/sdk/models/operations/createpaymentlinkrequest.md +9 -0
  78. package/docs/sdk/models/operations/createpaymentlinkresponse.md +11 -0
  79. package/docs/sdk/models/operations/createpaymentpaymentrequest.md +9 -0
  80. package/docs/sdk/models/operations/createpaymentpaymentresponse.md +11 -0
  81. package/docs/sdk/models/operations/getpaymentlinkrequest.md +10 -0
  82. package/docs/sdk/models/operations/getpaymentlinkresponse.md +11 -0
  83. package/docs/sdk/models/operations/{getaccountingpaymentrequest.md → getpaymentpaymentrequest.md} +1 -1
  84. package/docs/sdk/models/operations/getpaymentpaymentresponse.md +11 -0
  85. package/docs/sdk/models/operations/{getaccountingpayoutrequest.md → getpaymentpayoutrequest.md} +1 -1
  86. package/docs/sdk/models/operations/getpaymentpayoutresponse.md +11 -0
  87. package/docs/sdk/models/operations/{getaccountingrefundrequest.md → getpaymentrefundrequest.md} +1 -1
  88. package/docs/sdk/models/operations/getpaymentrefundresponse.md +11 -0
  89. package/docs/sdk/models/operations/listpaymentlinksrequest.md +17 -0
  90. package/docs/sdk/models/operations/listpaymentlinksresponse.md +11 -0
  91. package/docs/sdk/models/operations/{listaccountingpaymentsrequest.md → listpaymentpaymentsrequest.md} +1 -1
  92. package/docs/sdk/models/operations/listpaymentpaymentsresponse.md +11 -0
  93. package/docs/sdk/models/operations/{listaccountingpayoutsrequest.md → listpaymentpayoutsrequest.md} +1 -1
  94. package/docs/sdk/models/operations/listpaymentpayoutsresponse.md +11 -0
  95. package/docs/sdk/models/operations/{listaccountingrefundsrequest.md → listpaymentrefundsrequest.md} +1 -1
  96. package/docs/sdk/models/operations/listpaymentrefundsresponse.md +11 -0
  97. package/docs/sdk/models/operations/listunifiedintegrationsqueryparamcategories.md +2 -1
  98. package/docs/sdk/models/operations/patchpaymentlinkrequest.md +10 -0
  99. package/docs/sdk/models/operations/patchpaymentlinkresponse.md +11 -0
  100. package/docs/sdk/models/operations/patchpaymentpaymentrequest.md +10 -0
  101. package/docs/sdk/models/operations/patchpaymentpaymentresponse.md +11 -0
  102. package/docs/sdk/models/operations/queryparamcategories.md +2 -1
  103. package/docs/sdk/models/operations/{removeaccountingpaymentrequest.md → removepaymentlinkrequest.md} +2 -2
  104. package/docs/sdk/models/operations/{removeaccountingpaymentresponse.md → removepaymentlinkresponse.md} +1 -1
  105. package/docs/sdk/models/operations/removepaymentpaymentrequest.md +9 -0
  106. package/docs/sdk/models/operations/removepaymentpaymentresponse.md +11 -0
  107. package/docs/sdk/models/operations/scopes.md +6 -4
  108. package/docs/sdk/models/operations/updatepaymentlinkrequest.md +10 -0
  109. package/docs/sdk/models/operations/updatepaymentlinkresponse.md +11 -0
  110. package/docs/sdk/models/operations/updatepaymentpaymentrequest.md +10 -0
  111. package/docs/sdk/models/operations/updatepaymentpaymentresponse.md +11 -0
  112. package/docs/sdk/models/shared/objecttype.md +4 -3
  113. package/docs/sdk/models/shared/paymenntlinklineitem.md +24 -0
  114. package/docs/sdk/models/shared/paymentlink.md +18 -0
  115. package/docs/sdk/models/shared/{accountingpayment.md → paymentpayment.md} +1 -1
  116. package/docs/sdk/models/shared/paymentpayout.md +15 -0
  117. package/docs/sdk/models/shared/{accountingpayoutstatus.md → paymentpayoutstatus.md} +1 -1
  118. package/docs/sdk/models/shared/paymentrefund.md +17 -0
  119. package/docs/sdk/models/shared/{accountingrefundstatus.md → paymentrefundstatus.md} +1 -1
  120. package/docs/sdk/models/shared/propertyconnectioncategories.md +2 -1
  121. package/docs/sdk/models/shared/propertyconnectionpermissions.md +6 -4
  122. package/docs/sdk/models/shared/propertyintegrationcategories.md +2 -1
  123. package/package.json +1 -1
  124. package/docs/sdk/models/operations/createaccountingpaymentrequest.md +0 -9
  125. package/docs/sdk/models/operations/createaccountingpaymentresponse.md +0 -11
  126. package/docs/sdk/models/operations/getaccountingpaymentresponse.md +0 -11
  127. package/docs/sdk/models/operations/getaccountingpayoutresponse.md +0 -11
  128. package/docs/sdk/models/operations/getaccountingrefundresponse.md +0 -11
  129. package/docs/sdk/models/operations/listaccountingpaymentsresponse.md +0 -11
  130. package/docs/sdk/models/operations/listaccountingpayoutsresponse.md +0 -11
  131. package/docs/sdk/models/operations/listaccountingrefundsresponse.md +0 -11
  132. package/docs/sdk/models/operations/patchaccountingpaymentrequest.md +0 -10
  133. package/docs/sdk/models/operations/patchaccountingpaymentresponse.md +0 -11
  134. package/docs/sdk/models/operations/updateaccountingpaymentrequest.md +0 -10
  135. package/docs/sdk/models/operations/updateaccountingpaymentresponse.md +0 -11
  136. package/docs/sdk/models/shared/accountingpayout.md +0 -15
  137. package/docs/sdk/models/shared/accountingrefund.md +0 -17
  138. package/docs/sdks/account/README.md +0 -312
  139. package/docs/sdks/accounting/README.md +0 -2198
  140. package/docs/sdks/activity/README.md +0 -321
  141. package/docs/sdks/apicall/README.md +0 -95
  142. package/docs/sdks/application/README.md +0 -333
  143. package/docs/sdks/applicationstatus/README.md +0 -54
  144. package/docs/sdks/ats/README.md +0 -2488
  145. package/docs/sdks/auth/README.md +0 -103
  146. package/docs/sdks/call/README.md +0 -54
  147. package/docs/sdks/candidate/README.md +0 -369
  148. package/docs/sdks/collection/README.md +0 -348
  149. package/docs/sdks/commerce/README.md +0 -1371
  150. package/docs/sdks/company/README.md +0 -517
  151. package/docs/sdks/connection/README.md +0 -359
  152. package/docs/sdks/contact/README.md +0 -1028
  153. package/docs/sdks/crm/README.md +0 -2048
  154. package/docs/sdks/customer/README.md +0 -348
  155. package/docs/sdks/deal/README.md +0 -315
  156. package/docs/sdks/document/README.md +0 -309
  157. package/docs/sdks/employee/README.md +0 -363
  158. package/docs/sdks/enrich/README.md +0 -97
  159. package/docs/sdks/event/README.md +0 -390
  160. package/docs/sdks/file/README.md +0 -330
  161. package/docs/sdks/group/README.md +0 -327
  162. package/docs/sdks/hris/README.md +0 -685
  163. package/docs/sdks/integration/README.md +0 -155
  164. package/docs/sdks/interview/README.md +0 -318
  165. package/docs/sdks/inventory/README.md +0 -309
  166. package/docs/sdks/invoice/README.md +0 -324
  167. package/docs/sdks/issue/README.md +0 -49
  168. package/docs/sdks/item/README.md +0 -417
  169. package/docs/sdks/job/README.md +0 -396
  170. package/docs/sdks/lead/README.md +0 -336
  171. package/docs/sdks/list/README.md +0 -306
  172. package/docs/sdks/location/README.md +0 -312
  173. package/docs/sdks/login/README.md +0 -52
  174. package/docs/sdks/martech/README.md +0 -643
  175. package/docs/sdks/member/README.md +0 -342
  176. package/docs/sdks/note/README.md +0 -306
  177. package/docs/sdks/organization/README.md +0 -104
  178. package/docs/sdks/passthrough/README.md +0 -249
  179. package/docs/sdks/payment/README.md +0 -306
  180. package/docs/sdks/payout/README.md +0 -104
  181. package/docs/sdks/person/README.md +0 -51
  182. package/docs/sdks/pipeline/README.md +0 -306
  183. package/docs/sdks/refund/README.md +0 -104
  184. package/docs/sdks/scorecard/README.md +0 -324
  185. package/docs/sdks/storage/README.md +0 -330
  186. package/docs/sdks/taxrate/README.md +0 -312
  187. package/docs/sdks/ticket/README.md +0 -318
  188. package/docs/sdks/ticketing/README.md +0 -962
  189. package/docs/sdks/transaction/README.md +0 -327
  190. package/docs/sdks/uc/README.md +0 -388
  191. package/docs/sdks/unified/README.md +0 -929
  192. package/docs/sdks/unifiedto/README.md +0 -9
  193. package/docs/sdks/webhook/README.md +0 -291
@@ -0,0 +1,31 @@
1
+ import * as operations from "../sdk/models/operations";
2
+ import { SDKConfiguration } from "./sdk";
3
+ import { AxiosRequestConfig } from "axios";
4
+ export declare class Link {
5
+ private sdkConfiguration;
6
+ constructor(sdkConfig: SDKConfiguration);
7
+ /**
8
+ * Create a payment link
9
+ */
10
+ createPaymentLink(req: operations.CreatePaymentLinkRequest, config?: AxiosRequestConfig): Promise<operations.CreatePaymentLinkResponse>;
11
+ /**
12
+ * Retrieve a payment link
13
+ */
14
+ getPaymentLink(req: operations.GetPaymentLinkRequest, config?: AxiosRequestConfig): Promise<operations.GetPaymentLinkResponse>;
15
+ /**
16
+ * List all payment links
17
+ */
18
+ listPaymentLinks(req: operations.ListPaymentLinksRequest, config?: AxiosRequestConfig): Promise<operations.ListPaymentLinksResponse>;
19
+ /**
20
+ * Update a payment link
21
+ */
22
+ patchPaymentLink(req: operations.PatchPaymentLinkRequest, config?: AxiosRequestConfig): Promise<operations.PatchPaymentLinkResponse>;
23
+ /**
24
+ * Remove a payment link
25
+ */
26
+ removePaymentLink(req: operations.RemovePaymentLinkRequest, config?: AxiosRequestConfig): Promise<operations.RemovePaymentLinkResponse>;
27
+ /**
28
+ * Update a payment link
29
+ */
30
+ updatePaymentLink(req: operations.UpdatePaymentLinkRequest, config?: AxiosRequestConfig): Promise<operations.UpdatePaymentLinkResponse>;
31
+ }
@@ -0,0 +1,503 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
4
+ */
5
+ var __assign = (this && this.__assign) || function () {
6
+ __assign = Object.assign || function(t) {
7
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
8
+ s = arguments[i];
9
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
+ t[p] = s[p];
11
+ }
12
+ return t;
13
+ };
14
+ return __assign.apply(this, arguments);
15
+ };
16
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ var desc = Object.getOwnPropertyDescriptor(m, k);
19
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
20
+ desc = { enumerable: true, get: function() { return m[k]; } };
21
+ }
22
+ Object.defineProperty(o, k2, desc);
23
+ }) : (function(o, m, k, k2) {
24
+ if (k2 === undefined) k2 = k;
25
+ o[k2] = m[k];
26
+ }));
27
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
28
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
29
+ }) : function(o, v) {
30
+ o["default"] = v;
31
+ });
32
+ var __importStar = (this && this.__importStar) || function (mod) {
33
+ if (mod && mod.__esModule) return mod;
34
+ var result = {};
35
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
36
+ __setModuleDefault(result, mod);
37
+ return result;
38
+ };
39
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
40
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
41
+ return new (P || (P = Promise))(function (resolve, reject) {
42
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
43
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
44
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
45
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
46
+ });
47
+ };
48
+ var __generator = (this && this.__generator) || function (thisArg, body) {
49
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
50
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
51
+ function verb(n) { return function (v) { return step([n, v]); }; }
52
+ function step(op) {
53
+ if (f) throw new TypeError("Generator is already executing.");
54
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
55
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
56
+ if (y = 0, t) op = [op[0] & 2, t.value];
57
+ switch (op[0]) {
58
+ case 0: case 1: t = op; break;
59
+ case 4: _.label++; return { value: op[1], done: false };
60
+ case 5: _.label++; y = op[1]; op = [0]; continue;
61
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
62
+ default:
63
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
64
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
65
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
66
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
67
+ if (t[2]) _.ops.pop();
68
+ _.trys.pop(); continue;
69
+ }
70
+ op = body.call(thisArg, _);
71
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
72
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
73
+ }
74
+ };
75
+ var __read = (this && this.__read) || function (o, n) {
76
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
77
+ if (!m) return o;
78
+ var i = m.call(o), r, ar = [], e;
79
+ try {
80
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
81
+ }
82
+ catch (error) { e = { error: error }; }
83
+ finally {
84
+ try {
85
+ if (r && !r.done && (m = i["return"])) m.call(i);
86
+ }
87
+ finally { if (e) throw e.error; }
88
+ }
89
+ return ar;
90
+ };
91
+ Object.defineProperty(exports, "__esModule", { value: true });
92
+ exports.Link = void 0;
93
+ var utils = __importStar(require("../internal/utils"));
94
+ var errors = __importStar(require("../sdk/models/errors"));
95
+ var operations = __importStar(require("../sdk/models/operations"));
96
+ var shared = __importStar(require("../sdk/models/shared"));
97
+ var Link = /** @class */ (function () {
98
+ function Link(sdkConfig) {
99
+ this.sdkConfiguration = sdkConfig;
100
+ }
101
+ /**
102
+ * Create a payment link
103
+ */
104
+ Link.prototype.createPaymentLink = function (req, config) {
105
+ var _a, _b;
106
+ return __awaiter(this, void 0, void 0, function () {
107
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
108
+ var _d;
109
+ return __generator(this, function (_e) {
110
+ switch (_e.label) {
111
+ case 0:
112
+ if (!(req instanceof utils.SpeakeasyBase)) {
113
+ req = new operations.CreatePaymentLinkRequest(req);
114
+ }
115
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
116
+ operationUrl = utils.generateURL(baseURL, "/payment/{connection_id}/link", req);
117
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
118
+ try {
119
+ _d = __read(utils.serializeRequestBody(req, "paymentLink", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
120
+ }
121
+ catch (e) {
122
+ if (e instanceof Error) {
123
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
124
+ }
125
+ }
126
+ client = this.sdkConfiguration.defaultClient;
127
+ globalSecurity = this.sdkConfiguration.security;
128
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
129
+ return [4 /*yield*/, globalSecurity()];
130
+ case 1:
131
+ globalSecurity = _e.sent();
132
+ _e.label = 2;
133
+ case 2:
134
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
135
+ globalSecurity = new shared.Security(globalSecurity);
136
+ }
137
+ properties = utils.parseSecurityProperties(globalSecurity);
138
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
139
+ headers["Accept"] = "application/json";
140
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
141
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
142
+ case 3:
143
+ httpRes = _e.sent();
144
+ 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 : "";
145
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
146
+ throw new Error("status code not found in response: ".concat(httpRes));
147
+ }
148
+ res = new operations.CreatePaymentLinkResponse({
149
+ statusCode: httpRes.status,
150
+ contentType: responseContentType,
151
+ rawResponse: httpRes,
152
+ });
153
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
154
+ switch (true) {
155
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
156
+ if (utils.matchContentType(responseContentType, "application/json")) {
157
+ res.paymentLink = utils.objectToClass(JSON.parse(decodedRes), shared.PaymentLink);
158
+ }
159
+ else {
160
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
161
+ }
162
+ break;
163
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
164
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
165
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
166
+ }
167
+ return [2 /*return*/, res];
168
+ }
169
+ });
170
+ });
171
+ };
172
+ /**
173
+ * Retrieve a payment link
174
+ */
175
+ Link.prototype.getPaymentLink = function (req, config) {
176
+ var _a, _b;
177
+ return __awaiter(this, void 0, void 0, function () {
178
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes;
179
+ return __generator(this, function (_c) {
180
+ switch (_c.label) {
181
+ case 0:
182
+ if (!(req instanceof utils.SpeakeasyBase)) {
183
+ req = new operations.GetPaymentLinkRequest(req);
184
+ }
185
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
186
+ operationUrl = utils.generateURL(baseURL, "/payment/{connection_id}/link/{id}", req);
187
+ client = this.sdkConfiguration.defaultClient;
188
+ globalSecurity = this.sdkConfiguration.security;
189
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
190
+ return [4 /*yield*/, globalSecurity()];
191
+ case 1:
192
+ globalSecurity = _c.sent();
193
+ _c.label = 2;
194
+ case 2:
195
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
196
+ globalSecurity = new shared.Security(globalSecurity);
197
+ }
198
+ properties = utils.parseSecurityProperties(globalSecurity);
199
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
200
+ queryParams = utils.serializeQueryParams(req);
201
+ headers["Accept"] = "application/json";
202
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
203
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
204
+ case 3:
205
+ httpRes = _c.sent();
206
+ 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 : "";
207
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
208
+ throw new Error("status code not found in response: ".concat(httpRes));
209
+ }
210
+ res = new operations.GetPaymentLinkResponse({
211
+ statusCode: httpRes.status,
212
+ contentType: responseContentType,
213
+ rawResponse: httpRes,
214
+ });
215
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
216
+ switch (true) {
217
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
218
+ if (utils.matchContentType(responseContentType, "application/json")) {
219
+ res.paymentLink = utils.objectToClass(JSON.parse(decodedRes), shared.PaymentLink);
220
+ }
221
+ else {
222
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
223
+ }
224
+ break;
225
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
226
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
227
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
228
+ }
229
+ return [2 /*return*/, res];
230
+ }
231
+ });
232
+ });
233
+ };
234
+ /**
235
+ * List all payment links
236
+ */
237
+ Link.prototype.listPaymentLinks = function (req, config) {
238
+ var _a, _b;
239
+ return __awaiter(this, void 0, void 0, function () {
240
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes, resFieldDepth;
241
+ return __generator(this, function (_c) {
242
+ switch (_c.label) {
243
+ case 0:
244
+ if (!(req instanceof utils.SpeakeasyBase)) {
245
+ req = new operations.ListPaymentLinksRequest(req);
246
+ }
247
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
248
+ operationUrl = utils.generateURL(baseURL, "/payment/{connection_id}/link", req);
249
+ client = this.sdkConfiguration.defaultClient;
250
+ globalSecurity = this.sdkConfiguration.security;
251
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
252
+ return [4 /*yield*/, globalSecurity()];
253
+ case 1:
254
+ globalSecurity = _c.sent();
255
+ _c.label = 2;
256
+ case 2:
257
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
258
+ globalSecurity = new shared.Security(globalSecurity);
259
+ }
260
+ properties = utils.parseSecurityProperties(globalSecurity);
261
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
262
+ queryParams = utils.serializeQueryParams(req);
263
+ headers["Accept"] = "application/json";
264
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
265
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
266
+ case 3:
267
+ httpRes = _c.sent();
268
+ 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 : "";
269
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
270
+ throw new Error("status code not found in response: ".concat(httpRes));
271
+ }
272
+ res = new operations.ListPaymentLinksResponse({
273
+ statusCode: httpRes.status,
274
+ contentType: responseContentType,
275
+ rawResponse: httpRes,
276
+ });
277
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
278
+ switch (true) {
279
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
280
+ if (utils.matchContentType(responseContentType, "application/json")) {
281
+ res.paymentLinks = [];
282
+ resFieldDepth = utils.getResFieldDepth(res);
283
+ res.paymentLinks = utils.objectToClass(JSON.parse(decodedRes), shared.PaymentLink, resFieldDepth);
284
+ }
285
+ else {
286
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
287
+ }
288
+ break;
289
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
290
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
291
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
292
+ }
293
+ return [2 /*return*/, res];
294
+ }
295
+ });
296
+ });
297
+ };
298
+ /**
299
+ * Update a payment link
300
+ */
301
+ Link.prototype.patchPaymentLink = function (req, config) {
302
+ var _a, _b;
303
+ return __awaiter(this, void 0, void 0, function () {
304
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
305
+ var _d;
306
+ return __generator(this, function (_e) {
307
+ switch (_e.label) {
308
+ case 0:
309
+ if (!(req instanceof utils.SpeakeasyBase)) {
310
+ req = new operations.PatchPaymentLinkRequest(req);
311
+ }
312
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
313
+ operationUrl = utils.generateURL(baseURL, "/payment/{connection_id}/link/{id}", req);
314
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
315
+ try {
316
+ _d = __read(utils.serializeRequestBody(req, "paymentLink", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
317
+ }
318
+ catch (e) {
319
+ if (e instanceof Error) {
320
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
321
+ }
322
+ }
323
+ client = this.sdkConfiguration.defaultClient;
324
+ globalSecurity = this.sdkConfiguration.security;
325
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
326
+ return [4 /*yield*/, globalSecurity()];
327
+ case 1:
328
+ globalSecurity = _e.sent();
329
+ _e.label = 2;
330
+ case 2:
331
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
332
+ globalSecurity = new shared.Security(globalSecurity);
333
+ }
334
+ properties = utils.parseSecurityProperties(globalSecurity);
335
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
336
+ headers["Accept"] = "application/json";
337
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
338
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "patch", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
339
+ case 3:
340
+ httpRes = _e.sent();
341
+ 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 : "";
342
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
343
+ throw new Error("status code not found in response: ".concat(httpRes));
344
+ }
345
+ res = new operations.PatchPaymentLinkResponse({
346
+ statusCode: httpRes.status,
347
+ contentType: responseContentType,
348
+ rawResponse: httpRes,
349
+ });
350
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
351
+ switch (true) {
352
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
353
+ if (utils.matchContentType(responseContentType, "application/json")) {
354
+ res.paymentLink = utils.objectToClass(JSON.parse(decodedRes), shared.PaymentLink);
355
+ }
356
+ else {
357
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
358
+ }
359
+ break;
360
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
361
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
362
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
363
+ }
364
+ return [2 /*return*/, res];
365
+ }
366
+ });
367
+ });
368
+ };
369
+ /**
370
+ * Remove a payment link
371
+ */
372
+ Link.prototype.removePaymentLink = function (req, config) {
373
+ var _a, _b;
374
+ return __awaiter(this, void 0, void 0, function () {
375
+ var baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
376
+ return __generator(this, function (_c) {
377
+ switch (_c.label) {
378
+ case 0:
379
+ if (!(req instanceof utils.SpeakeasyBase)) {
380
+ req = new operations.RemovePaymentLinkRequest(req);
381
+ }
382
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
383
+ operationUrl = utils.generateURL(baseURL, "/payment/{connection_id}/link/{id}", req);
384
+ client = this.sdkConfiguration.defaultClient;
385
+ globalSecurity = this.sdkConfiguration.security;
386
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
387
+ return [4 /*yield*/, globalSecurity()];
388
+ case 1:
389
+ globalSecurity = _c.sent();
390
+ _c.label = 2;
391
+ case 2:
392
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
393
+ globalSecurity = new shared.Security(globalSecurity);
394
+ }
395
+ properties = utils.parseSecurityProperties(globalSecurity);
396
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
397
+ headers["Accept"] = "application/json";
398
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
399
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
400
+ case 3:
401
+ httpRes = _c.sent();
402
+ 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 : "";
403
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
404
+ throw new Error("status code not found in response: ".concat(httpRes));
405
+ }
406
+ res = new operations.RemovePaymentLinkResponse({
407
+ statusCode: httpRes.status,
408
+ contentType: responseContentType,
409
+ rawResponse: httpRes,
410
+ });
411
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
412
+ switch (true) {
413
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
414
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
415
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
416
+ default:
417
+ if (utils.matchContentType(responseContentType, "application/json")) {
418
+ res.res = decodedRes;
419
+ }
420
+ else {
421
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
422
+ }
423
+ break;
424
+ }
425
+ return [2 /*return*/, res];
426
+ }
427
+ });
428
+ });
429
+ };
430
+ /**
431
+ * Update a payment link
432
+ */
433
+ Link.prototype.updatePaymentLink = function (req, config) {
434
+ var _a, _b;
435
+ return __awaiter(this, void 0, void 0, function () {
436
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
437
+ var _d;
438
+ return __generator(this, function (_e) {
439
+ switch (_e.label) {
440
+ case 0:
441
+ if (!(req instanceof utils.SpeakeasyBase)) {
442
+ req = new operations.UpdatePaymentLinkRequest(req);
443
+ }
444
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
445
+ operationUrl = utils.generateURL(baseURL, "/payment/{connection_id}/link/{id}", req);
446
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
447
+ try {
448
+ _d = __read(utils.serializeRequestBody(req, "paymentLink", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
449
+ }
450
+ catch (e) {
451
+ if (e instanceof Error) {
452
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
453
+ }
454
+ }
455
+ client = this.sdkConfiguration.defaultClient;
456
+ globalSecurity = this.sdkConfiguration.security;
457
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
458
+ return [4 /*yield*/, globalSecurity()];
459
+ case 1:
460
+ globalSecurity = _e.sent();
461
+ _e.label = 2;
462
+ case 2:
463
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
464
+ globalSecurity = new shared.Security(globalSecurity);
465
+ }
466
+ properties = utils.parseSecurityProperties(globalSecurity);
467
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
468
+ headers["Accept"] = "application/json";
469
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
470
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "put", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
471
+ case 3:
472
+ httpRes = _e.sent();
473
+ 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 : "";
474
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
475
+ throw new Error("status code not found in response: ".concat(httpRes));
476
+ }
477
+ res = new operations.UpdatePaymentLinkResponse({
478
+ statusCode: httpRes.status,
479
+ contentType: responseContentType,
480
+ rawResponse: httpRes,
481
+ });
482
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
483
+ switch (true) {
484
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
485
+ if (utils.matchContentType(responseContentType, "application/json")) {
486
+ res.paymentLink = utils.objectToClass(JSON.parse(decodedRes), shared.PaymentLink);
487
+ }
488
+ else {
489
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
490
+ }
491
+ break;
492
+ case ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
493
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
494
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
495
+ }
496
+ return [2 /*return*/, res];
497
+ }
498
+ });
499
+ });
500
+ };
501
+ return Link;
502
+ }());
503
+ exports.Link = Link;
@@ -1,22 +1,22 @@
1
1
  import { SpeakeasyBase } from "../../../internal/utils";
2
2
  import * as shared from "../../../sdk/models/shared";
3
3
  import { AxiosResponse } from "axios";
4
- export declare class CreateAccountingPaymentRequest extends SpeakeasyBase {
5
- accountingPayment?: shared.AccountingPayment;
4
+ export declare class CreatePaymentLinkRequest extends SpeakeasyBase {
5
+ paymentLink?: shared.PaymentLink;
6
6
  /**
7
7
  * ID of the connection
8
8
  */
9
9
  connectionId: string;
10
10
  }
11
- export declare class CreateAccountingPaymentResponse extends SpeakeasyBase {
12
- /**
13
- * Successful
14
- */
15
- accountingPayment?: shared.AccountingPayment;
11
+ export declare class CreatePaymentLinkResponse extends SpeakeasyBase {
16
12
  /**
17
13
  * HTTP response content type for this operation
18
14
  */
19
15
  contentType: string;
16
+ /**
17
+ * Successful
18
+ */
19
+ paymentLink?: shared.PaymentLink;
20
20
  /**
21
21
  * HTTP response status code for this operation
22
22
  */