@astrada.co/ts-astrada-sdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/.editorconfig +10 -0
  2. package/.github/workflows/on-push.yml +65 -0
  3. package/.releaserc +21 -0
  4. package/CHANGELOG.md +13 -0
  5. package/README.md +1 -0
  6. package/dist/astrada.co-ts-astrada-sdk-1.0.0.tgz +0 -0
  7. package/lib/apis/CardApi.d.ts +57 -0
  8. package/lib/apis/CardApi.js +109 -0
  9. package/lib/apis/CardSubscriptionApi.d.ts +61 -0
  10. package/lib/apis/CardSubscriptionApi.js +133 -0
  11. package/lib/apis/CardholderApi.d.ts +31 -0
  12. package/lib/apis/CardholderApi.js +56 -0
  13. package/lib/apis/EnrollmentMethodsApi.d.ts +31 -0
  14. package/lib/apis/EnrollmentMethodsApi.js +57 -0
  15. package/lib/apis/NetworkBulkFeedsApi.d.ts +60 -0
  16. package/lib/apis/NetworkBulkFeedsApi.js +129 -0
  17. package/lib/apis/SubaccountsApi.d.ts +72 -0
  18. package/lib/apis/SubaccountsApi.js +157 -0
  19. package/lib/apis/TransactionMessagesApi.d.ts +31 -0
  20. package/lib/apis/TransactionMessagesApi.js +56 -0
  21. package/lib/apis/TransactionsApi.d.ts +56 -0
  22. package/lib/apis/TransactionsApi.js +106 -0
  23. package/lib/apis/WebhooksApi.d.ts +86 -0
  24. package/lib/apis/WebhooksApi.js +194 -0
  25. package/lib/apis/index.d.ts +9 -0
  26. package/lib/apis/index.js +27 -0
  27. package/lib/index.d.ts +3 -0
  28. package/lib/index.js +21 -0
  29. package/lib/models/Card.d.ts +112 -0
  30. package/lib/models/Card.js +109 -0
  31. package/lib/models/CardLinks.d.ts +39 -0
  32. package/lib/models/CardLinks.js +53 -0
  33. package/lib/models/CardSubscription.d.ts +118 -0
  34. package/lib/models/CardSubscription.js +109 -0
  35. package/lib/models/CardSubscriptionLinks.d.ts +45 -0
  36. package/lib/models/CardSubscriptionLinks.js +57 -0
  37. package/lib/models/Cardholder.d.ts +64 -0
  38. package/lib/models/Cardholder.js +68 -0
  39. package/lib/models/CardholderCorporate.d.ts +38 -0
  40. package/lib/models/CardholderCorporate.js +50 -0
  41. package/lib/models/CardholderLinks.d.ts +33 -0
  42. package/lib/models/CardholderLinks.js +51 -0
  43. package/lib/models/Conflict.d.ts +57 -0
  44. package/lib/models/Conflict.js +67 -0
  45. package/lib/models/CreateNetworkBulkFeedRequest.d.ts +52 -0
  46. package/lib/models/CreateNetworkBulkFeedRequest.js +66 -0
  47. package/lib/models/CreateSubaccountRequest.d.ts +39 -0
  48. package/lib/models/CreateSubaccountRequest.js +55 -0
  49. package/lib/models/CreateWebhook201Response.d.ts +98 -0
  50. package/lib/models/CreateWebhook201Response.js +96 -0
  51. package/lib/models/CreateWebhookRequest.d.ts +67 -0
  52. package/lib/models/CreateWebhookRequest.js +73 -0
  53. package/lib/models/EnrollmentMethods200Response.d.ts +40 -0
  54. package/lib/models/EnrollmentMethods200Response.js +58 -0
  55. package/lib/models/EnrollmentMethodsRequest.d.ts +32 -0
  56. package/lib/models/EnrollmentMethodsRequest.js +50 -0
  57. package/lib/models/GetSubaccounts200Response.d.ts +40 -0
  58. package/lib/models/GetSubaccounts200Response.js +56 -0
  59. package/lib/models/GetSubaccounts200ResponseEmbedded.d.ts +33 -0
  60. package/lib/models/GetSubaccounts200ResponseEmbedded.js +51 -0
  61. package/lib/models/GetSubaccounts200ResponseLinks.d.ts +39 -0
  62. package/lib/models/GetSubaccounts200ResponseLinks.js +53 -0
  63. package/lib/models/GetTransactions200Response.d.ts +40 -0
  64. package/lib/models/GetTransactions200Response.js +56 -0
  65. package/lib/models/GetTransactions200ResponseEmbedded.d.ts +33 -0
  66. package/lib/models/GetTransactions200ResponseEmbedded.js +51 -0
  67. package/lib/models/InlineObject.d.ts +52 -0
  68. package/lib/models/InlineObject.js +64 -0
  69. package/lib/models/InlineObject1.d.ts +45 -0
  70. package/lib/models/InlineObject1.js +61 -0
  71. package/lib/models/InlineObject2.d.ts +45 -0
  72. package/lib/models/InlineObject2.js +61 -0
  73. package/lib/models/InlineObject3.d.ts +45 -0
  74. package/lib/models/InlineObject3.js +61 -0
  75. package/lib/models/InlineObject4.d.ts +57 -0
  76. package/lib/models/InlineObject4.js +65 -0
  77. package/lib/models/InlineObject5.d.ts +45 -0
  78. package/lib/models/InlineObject5.js +61 -0
  79. package/lib/models/InlineObjectErrorsInner.d.ts +38 -0
  80. package/lib/models/InlineObjectErrorsInner.js +54 -0
  81. package/lib/models/Link.d.ts +74 -0
  82. package/lib/models/Link.js +64 -0
  83. package/lib/models/ListCardSubscriptions200Response.d.ts +46 -0
  84. package/lib/models/ListCardSubscriptions200Response.js +60 -0
  85. package/lib/models/ListCardSubscriptions200ResponseEmbedded.d.ts +33 -0
  86. package/lib/models/ListCardSubscriptions200ResponseEmbedded.js +51 -0
  87. package/lib/models/ListCardSubscriptions200ResponseLinks.d.ts +57 -0
  88. package/lib/models/ListCardSubscriptions200ResponseLinks.js +59 -0
  89. package/lib/models/ListCards200Response.d.ts +46 -0
  90. package/lib/models/ListCards200Response.js +60 -0
  91. package/lib/models/ListCards200ResponseEmbedded.d.ts +33 -0
  92. package/lib/models/ListCards200ResponseEmbedded.js +51 -0
  93. package/lib/models/ListNetworkBulkFeeds200Response.d.ts +46 -0
  94. package/lib/models/ListNetworkBulkFeeds200Response.js +60 -0
  95. package/lib/models/ListNetworkBulkFeeds200ResponseEmbedded.d.ts +33 -0
  96. package/lib/models/ListNetworkBulkFeeds200ResponseEmbedded.js +51 -0
  97. package/lib/models/ListWebhooks200Response.d.ts +40 -0
  98. package/lib/models/ListWebhooks200Response.js +56 -0
  99. package/lib/models/ListWebhooks200ResponseEmbedded.d.ts +33 -0
  100. package/lib/models/ListWebhooks200ResponseEmbedded.js +49 -0
  101. package/lib/models/ListWebhooks200ResponseLinks.d.ts +39 -0
  102. package/lib/models/ListWebhooks200ResponseLinks.js +51 -0
  103. package/lib/models/NetworkBulkFeeds.d.ts +81 -0
  104. package/lib/models/NetworkBulkFeeds.js +83 -0
  105. package/lib/models/Subaccount.d.ts +70 -0
  106. package/lib/models/Subaccount.js +76 -0
  107. package/lib/models/SubaccountConfiguration.d.ts +39 -0
  108. package/lib/models/SubaccountConfiguration.js +51 -0
  109. package/lib/models/SubaccountConfigurationVISA.d.ts +43 -0
  110. package/lib/models/SubaccountConfigurationVISA.js +61 -0
  111. package/lib/models/Transaction.d.ts +140 -0
  112. package/lib/models/Transaction.js +126 -0
  113. package/lib/models/TransactionAcceptor.d.ts +50 -0
  114. package/lib/models/TransactionAcceptor.js +62 -0
  115. package/lib/models/TransactionLinks.d.ts +51 -0
  116. package/lib/models/TransactionLinks.js +57 -0
  117. package/lib/models/TransactionMessage.d.ts +184 -0
  118. package/lib/models/TransactionMessage.js +159 -0
  119. package/lib/models/TransactionMessageAcceptor.d.ts +68 -0
  120. package/lib/models/TransactionMessageAcceptor.js +72 -0
  121. package/lib/models/UnprocessableEntity.d.ts +45 -0
  122. package/lib/models/UnprocessableEntity.js +61 -0
  123. package/lib/models/UpdateCardSubscriptionRequest.d.ts +39 -0
  124. package/lib/models/UpdateCardSubscriptionRequest.js +55 -0
  125. package/lib/models/UpdateSubaccountRequest.d.ts +39 -0
  126. package/lib/models/UpdateSubaccountRequest.js +51 -0
  127. package/lib/models/UpdateWebhookRequest.d.ts +61 -0
  128. package/lib/models/UpdateWebhookRequest.js +65 -0
  129. package/lib/models/Webhook.d.ts +92 -0
  130. package/lib/models/Webhook.js +92 -0
  131. package/lib/models/index.d.ts +51 -0
  132. package/lib/models/index.js +69 -0
  133. package/lib/runtime.d.ts +215 -0
  134. package/lib/runtime.js +394 -0
  135. package/package.json +21 -0
  136. package/src/apis/CardApi.ts +174 -0
  137. package/src/apis/CardSubscriptionApi.ts +223 -0
  138. package/src/apis/CardholderApi.ts +93 -0
  139. package/src/apis/EnrollmentMethodsApi.ts +98 -0
  140. package/src/apis/NetworkBulkFeedsApi.ts +211 -0
  141. package/src/apis/SubaccountsApi.ts +253 -0
  142. package/src/apis/TransactionMessagesApi.ts +93 -0
  143. package/src/apis/TransactionsApi.ts +169 -0
  144. package/src/apis/WebhooksApi.ts +315 -0
  145. package/src/apis/index.ts +11 -0
  146. package/src/index.ts +5 -0
  147. package/src/models/Card.ts +187 -0
  148. package/src/models/CardLinks.ts +82 -0
  149. package/src/models/CardSubscription.ts +194 -0
  150. package/src/models/CardSubscriptionLinks.ts +91 -0
  151. package/src/models/Cardholder.ts +124 -0
  152. package/src/models/CardholderCorporate.ts +73 -0
  153. package/src/models/CardholderLinks.ts +74 -0
  154. package/src/models/Conflict.ts +102 -0
  155. package/src/models/CreateNetworkBulkFeedRequest.ts +95 -0
  156. package/src/models/CreateSubaccountRequest.ts +83 -0
  157. package/src/models/CreateWebhook201Response.ts +168 -0
  158. package/src/models/CreateWebhookRequest.ts +114 -0
  159. package/src/models/EnrollmentMethods200Response.ts +77 -0
  160. package/src/models/EnrollmentMethodsRequest.ts +66 -0
  161. package/src/models/GetSubaccounts200Response.ts +90 -0
  162. package/src/models/GetSubaccounts200ResponseEmbedded.ts +74 -0
  163. package/src/models/GetSubaccounts200ResponseLinks.ts +82 -0
  164. package/src/models/GetTransactions200Response.ts +90 -0
  165. package/src/models/GetTransactions200ResponseEmbedded.ts +74 -0
  166. package/src/models/InlineObject.ts +101 -0
  167. package/src/models/InlineObject1.ts +85 -0
  168. package/src/models/InlineObject2.ts +85 -0
  169. package/src/models/InlineObject3.ts +85 -0
  170. package/src/models/InlineObject4.ts +101 -0
  171. package/src/models/InlineObject5.ts +85 -0
  172. package/src/models/InlineObjectErrorsInner.ts +75 -0
  173. package/src/models/Link.ts +122 -0
  174. package/src/models/ListCardSubscriptions200Response.ts +99 -0
  175. package/src/models/ListCardSubscriptions200ResponseEmbedded.ts +74 -0
  176. package/src/models/ListCardSubscriptions200ResponseLinks.ts +106 -0
  177. package/src/models/ListCards200Response.ts +99 -0
  178. package/src/models/ListCards200ResponseEmbedded.ts +74 -0
  179. package/src/models/ListNetworkBulkFeeds200Response.ts +99 -0
  180. package/src/models/ListNetworkBulkFeeds200ResponseEmbedded.ts +74 -0
  181. package/src/models/ListWebhooks200Response.ts +90 -0
  182. package/src/models/ListWebhooks200ResponseEmbedded.ts +73 -0
  183. package/src/models/ListWebhooks200ResponseLinks.ts +81 -0
  184. package/src/models/NetworkBulkFeeds.ts +143 -0
  185. package/src/models/Subaccount.ts +135 -0
  186. package/src/models/SubaccountConfiguration.ts +81 -0
  187. package/src/models/SubaccountConfigurationVISA.ts +80 -0
  188. package/src/models/Transaction.ts +238 -0
  189. package/src/models/TransactionAcceptor.ts +93 -0
  190. package/src/models/TransactionLinks.ts +98 -0
  191. package/src/models/TransactionMessage.ts +289 -0
  192. package/src/models/TransactionMessageAcceptor.ts +119 -0
  193. package/src/models/UnprocessableEntity.ts +85 -0
  194. package/src/models/UpdateCardSubscriptionRequest.ts +75 -0
  195. package/src/models/UpdateSubaccountRequest.ts +81 -0
  196. package/src/models/UpdateWebhookRequest.ts +103 -0
  197. package/src/models/Webhook.ts +159 -0
  198. package/src/models/index.ts +53 -0
  199. package/src/runtime.ts +524 -0
  200. package/tsconfig.json +13 -0
@@ -0,0 +1,315 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Astrada API
5
+ * Welcome to our API Reference. 👋
6
+ *
7
+ * The version of the OpenAPI document: 2024-02-28
8
+ * Contact: developer@astrada.co
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ CreateWebhook201Response,
19
+ CreateWebhookRequest,
20
+ InlineObject,
21
+ InlineObject1,
22
+ InlineObject2,
23
+ InlineObject3,
24
+ InlineObject4,
25
+ ListWebhooks200Response,
26
+ UpdateWebhookRequest,
27
+ Webhook,
28
+ } from '../models/index';
29
+ import {
30
+ CreateWebhook201ResponseFromJSON,
31
+ CreateWebhook201ResponseToJSON,
32
+ CreateWebhookRequestFromJSON,
33
+ CreateWebhookRequestToJSON,
34
+ InlineObjectFromJSON,
35
+ InlineObjectToJSON,
36
+ InlineObject1FromJSON,
37
+ InlineObject1ToJSON,
38
+ InlineObject2FromJSON,
39
+ InlineObject2ToJSON,
40
+ InlineObject3FromJSON,
41
+ InlineObject3ToJSON,
42
+ InlineObject4FromJSON,
43
+ InlineObject4ToJSON,
44
+ ListWebhooks200ResponseFromJSON,
45
+ ListWebhooks200ResponseToJSON,
46
+ UpdateWebhookRequestFromJSON,
47
+ UpdateWebhookRequestToJSON,
48
+ WebhookFromJSON,
49
+ WebhookToJSON,
50
+ } from '../models/index';
51
+
52
+ export interface CreateWebhookOperationRequest {
53
+ createWebhookRequest: CreateWebhookRequest;
54
+ }
55
+
56
+ export interface DeleteWebhookRequest {
57
+ webhookId: string;
58
+ }
59
+
60
+ export interface GetWebhookRequest {
61
+ webhookId: string;
62
+ }
63
+
64
+ export interface ListWebhooksRequest {
65
+ subaccountId?: string;
66
+ limit?: number;
67
+ cursor?: string;
68
+ }
69
+
70
+ export interface UpdateWebhookOperationRequest {
71
+ webhookId: string;
72
+ updateWebhookRequest: UpdateWebhookRequest;
73
+ }
74
+
75
+ /**
76
+ *
77
+ */
78
+ export class WebhooksApi extends runtime.BaseAPI {
79
+
80
+ /**
81
+ * Registers a new webhook for capturing event notifications.
82
+ * Create webhook
83
+ */
84
+ async createWebhookRaw(requestParameters: CreateWebhookOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateWebhook201Response>> {
85
+ if (requestParameters['createWebhookRequest'] == null) {
86
+ throw new runtime.RequiredError(
87
+ 'createWebhookRequest',
88
+ 'Required parameter "createWebhookRequest" was null or undefined when calling createWebhook().'
89
+ );
90
+ }
91
+
92
+ const queryParameters: any = {};
93
+
94
+ const headerParameters: runtime.HTTPHeaders = {};
95
+
96
+ headerParameters['Content-Type'] = 'application/json';
97
+
98
+ if (this.configuration && this.configuration.accessToken) {
99
+ // oauth required
100
+ headerParameters["Authorization"] = await this.configuration.accessToken("main-auth", ["webhooks:write"]);
101
+ }
102
+
103
+
104
+ let urlPath = `/webhooks`;
105
+
106
+ const response = await this.request({
107
+ path: urlPath,
108
+ method: 'POST',
109
+ headers: headerParameters,
110
+ query: queryParameters,
111
+ body: CreateWebhookRequestToJSON(requestParameters['createWebhookRequest']),
112
+ }, initOverrides);
113
+
114
+ return new runtime.JSONApiResponse(response, (jsonValue) => CreateWebhook201ResponseFromJSON(jsonValue));
115
+ }
116
+
117
+ /**
118
+ * Registers a new webhook for capturing event notifications.
119
+ * Create webhook
120
+ */
121
+ async createWebhook(requestParameters: CreateWebhookOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateWebhook201Response> {
122
+ const response = await this.createWebhookRaw(requestParameters, initOverrides);
123
+ return await response.value();
124
+ }
125
+
126
+ /**
127
+ * Remove a configured webhook by its identifier. Results in the resource being deleted and no longer available.
128
+ * Delete webhook
129
+ */
130
+ async deleteWebhookRaw(requestParameters: DeleteWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
131
+ if (requestParameters['webhookId'] == null) {
132
+ throw new runtime.RequiredError(
133
+ 'webhookId',
134
+ 'Required parameter "webhookId" was null or undefined when calling deleteWebhook().'
135
+ );
136
+ }
137
+
138
+ const queryParameters: any = {};
139
+
140
+ const headerParameters: runtime.HTTPHeaders = {};
141
+
142
+ if (this.configuration && this.configuration.accessToken) {
143
+ // oauth required
144
+ headerParameters["Authorization"] = await this.configuration.accessToken("main-auth", ["webhooks:write"]);
145
+ }
146
+
147
+
148
+ let urlPath = `/webhooks/{webhookId}`;
149
+ urlPath = urlPath.replace(`{${"webhookId"}}`, encodeURIComponent(String(requestParameters['webhookId'])));
150
+
151
+ const response = await this.request({
152
+ path: urlPath,
153
+ method: 'DELETE',
154
+ headers: headerParameters,
155
+ query: queryParameters,
156
+ }, initOverrides);
157
+
158
+ return new runtime.VoidApiResponse(response);
159
+ }
160
+
161
+ /**
162
+ * Remove a configured webhook by its identifier. Results in the resource being deleted and no longer available.
163
+ * Delete webhook
164
+ */
165
+ async deleteWebhook(requestParameters: DeleteWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
166
+ await this.deleteWebhookRaw(requestParameters, initOverrides);
167
+ }
168
+
169
+ /**
170
+ * Returns detailed information about a specific webhook by its identifier, including its configuration and event subscription details.
171
+ * Retrieve webhook
172
+ */
173
+ async getWebhookRaw(requestParameters: GetWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Webhook>> {
174
+ if (requestParameters['webhookId'] == null) {
175
+ throw new runtime.RequiredError(
176
+ 'webhookId',
177
+ 'Required parameter "webhookId" was null or undefined when calling getWebhook().'
178
+ );
179
+ }
180
+
181
+ const queryParameters: any = {};
182
+
183
+ const headerParameters: runtime.HTTPHeaders = {};
184
+
185
+ if (this.configuration && this.configuration.accessToken) {
186
+ // oauth required
187
+ headerParameters["Authorization"] = await this.configuration.accessToken("main-auth", ["webhooks:read"]);
188
+ }
189
+
190
+
191
+ let urlPath = `/webhooks/{webhookId}`;
192
+ urlPath = urlPath.replace(`{${"webhookId"}}`, encodeURIComponent(String(requestParameters['webhookId'])));
193
+
194
+ const response = await this.request({
195
+ path: urlPath,
196
+ method: 'GET',
197
+ headers: headerParameters,
198
+ query: queryParameters,
199
+ }, initOverrides);
200
+
201
+ return new runtime.JSONApiResponse(response, (jsonValue) => WebhookFromJSON(jsonValue));
202
+ }
203
+
204
+ /**
205
+ * Returns detailed information about a specific webhook by its identifier, including its configuration and event subscription details.
206
+ * Retrieve webhook
207
+ */
208
+ async getWebhook(requestParameters: GetWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Webhook> {
209
+ const response = await this.getWebhookRaw(requestParameters, initOverrides);
210
+ return await response.value();
211
+ }
212
+
213
+ /**
214
+ * Returns all webhooks configured under the account, optionally filtered by subaccount, including details on the events each webhook is subscribed to. This endpoint supports [cursor-based pagination](https://docs.astrada.co/reference/pagination).
215
+ * List webhooks
216
+ */
217
+ async listWebhooksRaw(requestParameters: ListWebhooksRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListWebhooks200Response>> {
218
+ const queryParameters: any = {};
219
+
220
+ if (requestParameters['subaccountId'] != null) {
221
+ queryParameters['subaccountId'] = requestParameters['subaccountId'];
222
+ }
223
+
224
+ if (requestParameters['limit'] != null) {
225
+ queryParameters['limit'] = requestParameters['limit'];
226
+ }
227
+
228
+ if (requestParameters['cursor'] != null) {
229
+ queryParameters['cursor'] = requestParameters['cursor'];
230
+ }
231
+
232
+ const headerParameters: runtime.HTTPHeaders = {};
233
+
234
+ if (this.configuration && this.configuration.accessToken) {
235
+ // oauth required
236
+ headerParameters["Authorization"] = await this.configuration.accessToken("main-auth", ["webhooks:read"]);
237
+ }
238
+
239
+
240
+ let urlPath = `/webhooks`;
241
+
242
+ const response = await this.request({
243
+ path: urlPath,
244
+ method: 'GET',
245
+ headers: headerParameters,
246
+ query: queryParameters,
247
+ }, initOverrides);
248
+
249
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListWebhooks200ResponseFromJSON(jsonValue));
250
+ }
251
+
252
+ /**
253
+ * Returns all webhooks configured under the account, optionally filtered by subaccount, including details on the events each webhook is subscribed to. This endpoint supports [cursor-based pagination](https://docs.astrada.co/reference/pagination).
254
+ * List webhooks
255
+ */
256
+ async listWebhooks(requestParameters: ListWebhooksRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListWebhooks200Response> {
257
+ const response = await this.listWebhooksRaw(requestParameters, initOverrides);
258
+ return await response.value();
259
+ }
260
+
261
+ /**
262
+ * Updates the configuration of an existing webhook, allowing changes to the event subscriptions or notification URL.
263
+ * Update webhook
264
+ */
265
+ async updateWebhookRaw(requestParameters: UpdateWebhookOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Webhook>> {
266
+ if (requestParameters['webhookId'] == null) {
267
+ throw new runtime.RequiredError(
268
+ 'webhookId',
269
+ 'Required parameter "webhookId" was null or undefined when calling updateWebhook().'
270
+ );
271
+ }
272
+
273
+ if (requestParameters['updateWebhookRequest'] == null) {
274
+ throw new runtime.RequiredError(
275
+ 'updateWebhookRequest',
276
+ 'Required parameter "updateWebhookRequest" was null or undefined when calling updateWebhook().'
277
+ );
278
+ }
279
+
280
+ const queryParameters: any = {};
281
+
282
+ const headerParameters: runtime.HTTPHeaders = {};
283
+
284
+ headerParameters['Content-Type'] = 'application/json';
285
+
286
+ if (this.configuration && this.configuration.accessToken) {
287
+ // oauth required
288
+ headerParameters["Authorization"] = await this.configuration.accessToken("main-auth", ["webhooks:write"]);
289
+ }
290
+
291
+
292
+ let urlPath = `/webhooks/{webhookId}`;
293
+ urlPath = urlPath.replace(`{${"webhookId"}}`, encodeURIComponent(String(requestParameters['webhookId'])));
294
+
295
+ const response = await this.request({
296
+ path: urlPath,
297
+ method: 'PATCH',
298
+ headers: headerParameters,
299
+ query: queryParameters,
300
+ body: UpdateWebhookRequestToJSON(requestParameters['updateWebhookRequest']),
301
+ }, initOverrides);
302
+
303
+ return new runtime.JSONApiResponse(response, (jsonValue) => WebhookFromJSON(jsonValue));
304
+ }
305
+
306
+ /**
307
+ * Updates the configuration of an existing webhook, allowing changes to the event subscriptions or notification URL.
308
+ * Update webhook
309
+ */
310
+ async updateWebhook(requestParameters: UpdateWebhookOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Webhook> {
311
+ const response = await this.updateWebhookRaw(requestParameters, initOverrides);
312
+ return await response.value();
313
+ }
314
+
315
+ }
@@ -0,0 +1,11 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export * from './CardApi';
4
+ export * from './CardSubscriptionApi';
5
+ export * from './CardholderApi';
6
+ export * from './EnrollmentMethodsApi';
7
+ export * from './NetworkBulkFeedsApi';
8
+ export * from './SubaccountsApi';
9
+ export * from './TransactionMessagesApi';
10
+ export * from './TransactionsApi';
11
+ export * from './WebhooksApi';
package/src/index.ts ADDED
@@ -0,0 +1,5 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export * from './runtime';
4
+ export * from './apis/index';
5
+ export * from './models/index';
@@ -0,0 +1,187 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Astrada API
5
+ * Welcome to our API Reference. 👋
6
+ *
7
+ * The version of the OpenAPI document: 2024-02-28
8
+ * Contact: developer@astrada.co
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { CardLinks } from './CardLinks';
17
+ import {
18
+ CardLinksFromJSON,
19
+ CardLinksFromJSONTyped,
20
+ CardLinksToJSON,
21
+ CardLinksToJSONTyped,
22
+ } from './CardLinks';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface Card
28
+ */
29
+ export interface Card {
30
+ /**
31
+ *
32
+ * @type {CardLinks}
33
+ * @memberof Card
34
+ */
35
+ _links: CardLinks;
36
+ /**
37
+ * The unique identifier of this card entity.
38
+ * @type {string}
39
+ * @memberof Card
40
+ */
41
+ id: string;
42
+ /**
43
+ * The unique identifier of the subaccount related to this entity.
44
+ * @type {string}
45
+ * @memberof Card
46
+ */
47
+ subaccountId: string;
48
+ /**
49
+ * The month that the card will expire in MM format.
50
+ * @type {number}
51
+ * @memberof Card
52
+ */
53
+ expiryMonth: number;
54
+ /**
55
+ * The year that the card will expire in YYYY format.
56
+ * @type {number}
57
+ * @memberof Card
58
+ */
59
+ expiryYear: number;
60
+ /**
61
+ * The first 6 digits of the card number (PAN).
62
+ * @type {number}
63
+ * @memberof Card
64
+ */
65
+ first6digits: number;
66
+ /**
67
+ * The last 4 digits of the card number (PAN).
68
+ * @type {number}
69
+ * @memberof Card
70
+ */
71
+ last4digits: number;
72
+ /**
73
+ * The card network that processes payments for this card.
74
+ * @type {string}
75
+ * @memberof Card
76
+ */
77
+ network: CardNetworkEnum;
78
+ /**
79
+ * The country of issuance for this card following ISO 3166 alpha-3.
80
+ * @type {string}
81
+ * @memberof Card
82
+ */
83
+ country: CardCountryEnum;
84
+ /**
85
+ * Date and Time when this entity was created following ISO 8601 format.
86
+ * @type {Date}
87
+ * @memberof Card
88
+ */
89
+ createdAt: Date;
90
+ /**
91
+ * Date and Time when this entity was last updated following ISO 8601 format.
92
+ * @type {Date}
93
+ * @memberof Card
94
+ */
95
+ updatedAt: Date;
96
+ }
97
+
98
+
99
+ /**
100
+ * @export
101
+ */
102
+ export const CardNetworkEnum = {
103
+ Visa: 'visa',
104
+ Mastercard: 'mastercard'
105
+ } as const;
106
+ export type CardNetworkEnum = typeof CardNetworkEnum[keyof typeof CardNetworkEnum];
107
+
108
+ /**
109
+ * @export
110
+ */
111
+ export const CardCountryEnum = {
112
+ Usa: 'USA',
113
+ Can: 'CAN',
114
+ Gbr: 'GBR',
115
+ Swe: 'SWE',
116
+ Ita: 'ITA'
117
+ } as const;
118
+ export type CardCountryEnum = typeof CardCountryEnum[keyof typeof CardCountryEnum];
119
+
120
+
121
+ /**
122
+ * Check if a given object implements the Card interface.
123
+ */
124
+ export function instanceOfCard(value: object): value is Card {
125
+ if (!('_links' in value) || value['_links'] === undefined) return false;
126
+ if (!('id' in value) || value['id'] === undefined) return false;
127
+ if (!('subaccountId' in value) || value['subaccountId'] === undefined) return false;
128
+ if (!('expiryMonth' in value) || value['expiryMonth'] === undefined) return false;
129
+ if (!('expiryYear' in value) || value['expiryYear'] === undefined) return false;
130
+ if (!('first6digits' in value) || value['first6digits'] === undefined) return false;
131
+ if (!('last4digits' in value) || value['last4digits'] === undefined) return false;
132
+ if (!('network' in value) || value['network'] === undefined) return false;
133
+ if (!('country' in value) || value['country'] === undefined) return false;
134
+ if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
135
+ if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
136
+ return true;
137
+ }
138
+
139
+ export function CardFromJSON(json: any): Card {
140
+ return CardFromJSONTyped(json, false);
141
+ }
142
+
143
+ export function CardFromJSONTyped(json: any, ignoreDiscriminator: boolean): Card {
144
+ if (json == null) {
145
+ return json;
146
+ }
147
+ return {
148
+
149
+ '_links': CardLinksFromJSON(json['_links']),
150
+ 'id': json['id'],
151
+ 'subaccountId': json['subaccountId'],
152
+ 'expiryMonth': json['expiryMonth'],
153
+ 'expiryYear': json['expiryYear'],
154
+ 'first6digits': json['first6digits'],
155
+ 'last4digits': json['last4digits'],
156
+ 'network': json['network'],
157
+ 'country': json['country'],
158
+ 'createdAt': (new Date(json['createdAt'])),
159
+ 'updatedAt': (new Date(json['updatedAt'])),
160
+ };
161
+ }
162
+
163
+ export function CardToJSON(json: any): Card {
164
+ return CardToJSONTyped(json, false);
165
+ }
166
+
167
+ export function CardToJSONTyped(value?: Card | null, ignoreDiscriminator: boolean = false): any {
168
+ if (value == null) {
169
+ return value;
170
+ }
171
+
172
+ return {
173
+
174
+ '_links': CardLinksToJSON(value['_links']),
175
+ 'id': value['id'],
176
+ 'subaccountId': value['subaccountId'],
177
+ 'expiryMonth': value['expiryMonth'],
178
+ 'expiryYear': value['expiryYear'],
179
+ 'first6digits': value['first6digits'],
180
+ 'last4digits': value['last4digits'],
181
+ 'network': value['network'],
182
+ 'country': value['country'],
183
+ 'createdAt': ((value['createdAt']).toISOString()),
184
+ 'updatedAt': ((value['updatedAt']).toISOString()),
185
+ };
186
+ }
187
+
@@ -0,0 +1,82 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Astrada API
5
+ * Welcome to our API Reference. 👋
6
+ *
7
+ * The version of the OpenAPI document: 2024-02-28
8
+ * Contact: developer@astrada.co
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { Link } from './Link';
17
+ import {
18
+ LinkFromJSON,
19
+ LinkFromJSONTyped,
20
+ LinkToJSON,
21
+ LinkToJSONTyped,
22
+ } from './Link';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface CardLinks
28
+ */
29
+ export interface CardLinks {
30
+ /**
31
+ *
32
+ * @type {Link}
33
+ * @memberof CardLinks
34
+ */
35
+ self: Link;
36
+ /**
37
+ *
38
+ * @type {Link}
39
+ * @memberof CardLinks
40
+ */
41
+ cardholder?: Link;
42
+ }
43
+
44
+ /**
45
+ * Check if a given object implements the CardLinks interface.
46
+ */
47
+ export function instanceOfCardLinks(value: object): value is CardLinks {
48
+ if (!('self' in value) || value['self'] === undefined) return false;
49
+ return true;
50
+ }
51
+
52
+ export function CardLinksFromJSON(json: any): CardLinks {
53
+ return CardLinksFromJSONTyped(json, false);
54
+ }
55
+
56
+ export function CardLinksFromJSONTyped(json: any, ignoreDiscriminator: boolean): CardLinks {
57
+ if (json == null) {
58
+ return json;
59
+ }
60
+ return {
61
+
62
+ 'self': LinkFromJSON(json['self']),
63
+ 'cardholder': json['cardholder'] == null ? undefined : LinkFromJSON(json['cardholder']),
64
+ };
65
+ }
66
+
67
+ export function CardLinksToJSON(json: any): CardLinks {
68
+ return CardLinksToJSONTyped(json, false);
69
+ }
70
+
71
+ export function CardLinksToJSONTyped(value?: CardLinks | null, ignoreDiscriminator: boolean = false): any {
72
+ if (value == null) {
73
+ return value;
74
+ }
75
+
76
+ return {
77
+
78
+ 'self': LinkToJSON(value['self']),
79
+ 'cardholder': LinkToJSON(value['cardholder']),
80
+ };
81
+ }
82
+