@solibo/home-api 1.41.0 → 1.42.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 (74) hide show
  1. package/kotlin-kotlin-stdlib.mjs +4 -8
  2. package/kotlin-kotlin-stdlib.mjs.map +1 -1
  3. package/kotlinx-coroutines-core.mjs +7 -7
  4. package/kotlinx-coroutines-core.mjs.map +1 -1
  5. package/kotlinx-serialization-kotlinx-serialization-core.mjs +2 -234
  6. package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
  7. package/ktor-ktor-utils.mjs +2 -2
  8. package/ktor-ktor-websockets.mjs +2 -2
  9. package/package.json +1 -1
  10. package/solibo-sdk-sdk-api-accounting.mjs +581 -514
  11. package/solibo-sdk-sdk-api-accounting.mjs.map +1 -1
  12. package/solibo-sdk-sdk-api-board.mjs +531 -472
  13. package/solibo-sdk-sdk-api-board.mjs.map +1 -1
  14. package/solibo-sdk-sdk-api-communication.mjs +3595 -3221
  15. package/solibo-sdk-sdk-api-communication.mjs.map +1 -1
  16. package/solibo-sdk-sdk-api-company.mjs +4382 -3959
  17. package/solibo-sdk-sdk-api-company.mjs.map +1 -1
  18. package/solibo-sdk-sdk-api-conversation.mjs +9152 -8320
  19. package/solibo-sdk-sdk-api-conversation.mjs.map +1 -1
  20. package/solibo-sdk-sdk-api-document.mjs +7517 -6991
  21. package/solibo-sdk-sdk-api-document.mjs.map +1 -1
  22. package/solibo-sdk-sdk-api-economy.mjs +966 -856
  23. package/solibo-sdk-sdk-api-economy.mjs.map +1 -1
  24. package/solibo-sdk-sdk-api-expense.mjs +1015 -902
  25. package/solibo-sdk-sdk-api-expense.mjs.map +1 -1
  26. package/solibo-sdk-sdk-api-follow-up.mjs +113 -98
  27. package/solibo-sdk-sdk-api-follow-up.mjs.map +1 -1
  28. package/solibo-sdk-sdk-api-homepage.mjs +4147 -3763
  29. package/solibo-sdk-sdk-api-homepage.mjs.map +1 -1
  30. package/solibo-sdk-sdk-api-insurance.mjs +778 -695
  31. package/solibo-sdk-sdk-api-insurance.mjs.map +1 -1
  32. package/solibo-sdk-sdk-api-invoice.mjs +1179 -1050
  33. package/solibo-sdk-sdk-api-invoice.mjs.map +1 -1
  34. package/solibo-sdk-sdk-api-invoicing.mjs +11671 -10553
  35. package/solibo-sdk-sdk-api-invoicing.mjs.map +1 -1
  36. package/solibo-sdk-sdk-api-issue.mjs +1750 -1566
  37. package/solibo-sdk-sdk-api-issue.mjs.map +1 -1
  38. package/solibo-sdk-sdk-api-loan.mjs +1281 -1143
  39. package/solibo-sdk-sdk-api-loan.mjs.map +1 -1
  40. package/solibo-sdk-sdk-api-marketing.mjs +383 -337
  41. package/solibo-sdk-sdk-api-marketing.mjs.map +1 -1
  42. package/solibo-sdk-sdk-api-meeting.mjs +2388 -2154
  43. package/solibo-sdk-sdk-api-meeting.mjs.map +1 -1
  44. package/solibo-sdk-sdk-api-organization.mjs +1577 -1408
  45. package/solibo-sdk-sdk-api-organization.mjs.map +1 -1
  46. package/solibo-sdk-sdk-api-parking.mjs +1660 -1489
  47. package/solibo-sdk-sdk-api-parking.mjs.map +1 -1
  48. package/solibo-sdk-sdk-api-person.mjs +1488 -1339
  49. package/solibo-sdk-sdk-api-person.mjs.map +1 -1
  50. package/solibo-sdk-sdk-api-resident-communication.mjs +5547 -5028
  51. package/solibo-sdk-sdk-api-resident-communication.mjs.map +1 -1
  52. package/solibo-sdk-sdk-api-resident.mjs +2699 -2368
  53. package/solibo-sdk-sdk-api-resident.mjs.map +1 -1
  54. package/solibo-sdk-sdk-api-routines.mjs +1235 -1096
  55. package/solibo-sdk-sdk-api-routines.mjs.map +1 -1
  56. package/solibo-sdk-sdk-api-scoped-contact.mjs +704 -638
  57. package/solibo-sdk-sdk-api-scoped-contact.mjs.map +1 -1
  58. package/solibo-sdk-sdk-api-section.mjs +4076 -3685
  59. package/solibo-sdk-sdk-api-section.mjs.map +1 -1
  60. package/solibo-sdk-sdk-api-settlement.mjs +2151 -1931
  61. package/solibo-sdk-sdk-api-settlement.mjs.map +1 -1
  62. package/solibo-sdk-sdk-api-storage.mjs +1621 -1454
  63. package/solibo-sdk-sdk-api-storage.mjs.map +1 -1
  64. package/solibo-sdk-sdk-api-supplier.mjs +2286 -2044
  65. package/solibo-sdk-sdk-api-supplier.mjs.map +1 -1
  66. package/solibo-sdk-sdk-api-task.mjs +818 -727
  67. package/solibo-sdk-sdk-api-task.mjs.map +1 -1
  68. package/solibo-sdk-sdk-api-third-party-information.mjs +1332 -1185
  69. package/solibo-sdk-sdk-api-third-party-information.mjs.map +1 -1
  70. package/solibo-sdk-sdk-api-user.mjs +1059 -945
  71. package/solibo-sdk-sdk-api-user.mjs.map +1 -1
  72. package/solibo-sdk-sdk-core.mjs +121 -155
  73. package/solibo-sdk-sdk-core.mjs.map +1 -1
  74. package/solibo-sdk-sdk-home-api.d.mts +716 -2
@@ -4,19 +4,19 @@ import {
4
4
  protoOf180f3jzyo7rfj as protoOf,
5
5
  objectCreate1ve4bgxiu4x98 as objectCreate,
6
6
  CoroutineImpl2sn3kjnwmfr10 as CoroutineImpl,
7
+ await3n7kedgocftsv as await_0,
8
+ get_COROUTINE_SUSPENDED3ujt3p13qm4iy as get_COROUTINE_SUSPENDED,
9
+ initMetadataForCoroutine1i7lbatuf5bnt as initMetadataForCoroutine,
10
+ promisify1z0ncraq1ipzh as promisify,
11
+ Unit_instance3kz1zqli6gr1r as Unit_instance,
12
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
7
13
  listOf1jh22dvmctj1r as listOf,
8
14
  LinkedHashMap_init_$Create$s27yccuovnls as LinkedHashMap_init_$Create$,
9
15
  replace3le3ie7l9k8aq as replace,
10
- get_COROUTINE_SUSPENDED3ujt3p13qm4iy as get_COROUTINE_SUSPENDED,
11
16
  arrayOf1akklvh2at202 as arrayOf,
12
17
  createKType31ecntyyaay3k as createKType,
13
- initMetadataForCoroutine1i7lbatuf5bnt as initMetadataForCoroutine,
14
- await3n7kedgocftsv as await_0,
15
18
  Unitkvevlwgzwiuc as Unit,
16
19
  listOfvhqybd2zx248 as listOf_0,
17
- Unit_instance3kz1zqli6gr1r as Unit_instance,
18
- promisify1z0ncraq1ipzh as promisify,
19
- initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
20
20
  initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
21
21
  THROW_CCE2g6jy02ryeudk as THROW_CCE,
22
22
  initMetadataForObject1cxne3s9w65el as initMetadataForObject,
@@ -44,6 +44,7 @@ import {
44
44
  Companion_getInstance1if1t4zy98q04 as Companion_getInstance,
45
45
  ApiClient_init_$Init$1zeqbeizsm394 as ApiClient_init_$Init$,
46
46
  ApiClient_init_$Init$38ftv1s10hf6v as ApiClient_init_$Init$_0,
47
+ ApiClient2azxax1pjdtdm as ApiClient,
47
48
  RequestMethod_PUT_getInstance20qfhqm35d9pr as RequestMethod_PUT_getInstance,
48
49
  RequestConfig10esd7ix0dbbm as RequestConfig,
49
50
  TypedBodyProvider2ertybblisp23 as TypedBodyProvider,
@@ -52,7 +53,6 @@ import {
52
53
  RequestMethod_DELETE_getInstance298derfb6aued as RequestMethod_DELETE_getInstance,
53
54
  RequestMethod_GET_getInstance1hbf807ypkdh8 as RequestMethod_GET_getInstance,
54
55
  toMultiValue5gsdsvx60e2f as toMultiValue,
55
- ApiClient2azxax1pjdtdm as ApiClient,
56
56
  $serializer_getInstance3rdbosraty7sa as $serializer_getInstance,
57
57
  $serializer_getInstance2u6e9d36lcolu as $serializer_getInstance_0,
58
58
  $serializer_getInstance2ubvlf5l752ie as $serializer_getInstance_1,
@@ -80,31 +80,31 @@ import {
80
80
  var imul = Math.imul;
81
81
  //endregion
82
82
  //region block: pre-declaration
83
- initMetadataForCoroutine($correctLoanDetailsCOROUTINE$, CoroutineImpl);
84
83
  initMetadataForCoroutine($correctLoanDetails$suspendBridgeCOROUTINE$, CoroutineImpl);
85
- initMetadataForCoroutine($createLoanCOROUTINE$, CoroutineImpl);
86
84
  initMetadataForCoroutine($createLoan$suspendBridgeCOROUTINE$, CoroutineImpl);
87
- initMetadataForCoroutine($deleteLoanCOROUTINE$, CoroutineImpl);
88
85
  initMetadataForCoroutine($deleteLoan$suspendBridgeCOROUTINE$, CoroutineImpl);
89
- initMetadataForCoroutine($indexLoanAccountsCOROUTINE$, CoroutineImpl);
90
86
  initMetadataForCoroutine($indexLoanAccounts$suspendBridgeCOROUTINE$, CoroutineImpl);
91
- initMetadataForCoroutine($indexLoanLogCOROUTINE$, CoroutineImpl);
92
87
  initMetadataForCoroutine($indexLoanLog$suspendBridgeCOROUTINE$, CoroutineImpl);
93
- initMetadataForCoroutine($indexLoansCOROUTINE$, CoroutineImpl);
94
88
  initMetadataForCoroutine($indexLoans$suspendBridgeCOROUTINE$, CoroutineImpl);
95
- initMetadataForCoroutine($indexLoansUserCOROUTINE$, CoroutineImpl);
96
89
  initMetadataForCoroutine($indexLoansUser$suspendBridgeCOROUTINE$, CoroutineImpl);
97
- initMetadataForCoroutine($showLoanCOROUTINE$, CoroutineImpl);
98
90
  initMetadataForCoroutine($showLoan$suspendBridgeCOROUTINE$, CoroutineImpl);
99
- initMetadataForCoroutine($updateLoanCOROUTINE$, CoroutineImpl);
100
91
  initMetadataForCoroutine($updateLoan$suspendBridgeCOROUTINE$, CoroutineImpl);
101
- initMetadataForCoroutine($updateLoanAgreementCOROUTINE$, CoroutineImpl);
102
92
  initMetadataForCoroutine($updateLoanAgreement$suspendBridgeCOROUTINE$, CoroutineImpl);
103
- initMetadataForCoroutine($updateLoanINCOROUTINE$, CoroutineImpl);
104
93
  initMetadataForCoroutine($updateLoanIN$suspendBridgeCOROUTINE$, CoroutineImpl);
105
- initMetadataForCoroutine($updateLoanInterestCOROUTINE$, CoroutineImpl);
106
94
  initMetadataForCoroutine($updateLoanInterest$suspendBridgeCOROUTINE$, CoroutineImpl);
107
95
  initMetadataForClass(LoanApi, 'LoanApi', create, ApiClient, VOID, [3, 2, 5, 6, 11]);
96
+ initMetadataForCoroutine($correctLoanDetailsOperationCOROUTINE$, CoroutineImpl);
97
+ initMetadataForCoroutine($createLoanOperationCOROUTINE$, CoroutineImpl);
98
+ initMetadataForCoroutine($deleteLoanOperationCOROUTINE$, CoroutineImpl);
99
+ initMetadataForCoroutine($indexLoanAccountsOperationCOROUTINE$, CoroutineImpl);
100
+ initMetadataForCoroutine($indexLoanLogOperationCOROUTINE$, CoroutineImpl);
101
+ initMetadataForCoroutine($indexLoansOperationCOROUTINE$, CoroutineImpl);
102
+ initMetadataForCoroutine($indexLoansUserOperationCOROUTINE$, CoroutineImpl);
103
+ initMetadataForCoroutine($showLoanOperationCOROUTINE$, CoroutineImpl);
104
+ initMetadataForCoroutine($updateLoanAgreementOperationCOROUTINE$, CoroutineImpl);
105
+ initMetadataForCoroutine($updateLoanINOperationCOROUTINE$, CoroutineImpl);
106
+ initMetadataForCoroutine($updateLoanInterestOperationCOROUTINE$, CoroutineImpl);
107
+ initMetadataForCoroutine($updateLoanOperationCOROUTINE$, CoroutineImpl);
108
108
  initMetadataForCompanion(Companion);
109
109
  initMetadataForObject($serializer, '$serializer', VOID, VOID, [GeneratedSerializer]);
110
110
  initMetadataForClass(AddAgreementDocumentToLoanCommand, 'AddAgreementDocumentToLoanCommand', VOID, VOID, VOID, VOID, VOID, {0: $serializer_getInstance_2});
@@ -171,60 +171,53 @@ function LoanApi_init_$Init$_0(baseUrl, httpClient, $this) {
171
171
  function createWithClient(baseUrl, httpClient) {
172
172
  return LoanApi_init_$Init$_0(baseUrl, httpClient, objectCreate(protoOf(LoanApi)));
173
173
  }
174
- function $correctLoanDetailsCOROUTINE$(_this__u8e3s4, companyId, loanId, updateLoanCommand, resultContinuation) {
174
+ function $correctLoanDetails$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, loanId, updateLoanCommand, resultContinuation) {
175
175
  CoroutineImpl.call(this, resultContinuation);
176
176
  this._this__u8e3s4__1 = _this__u8e3s4;
177
177
  this.companyId_1 = companyId;
178
178
  this.loanId_1 = loanId;
179
179
  this.updateLoanCommand_1 = updateLoanCommand;
180
180
  }
181
- protoOf($correctLoanDetailsCOROUTINE$).doResume_5yljmg_k$ = function () {
181
+ protoOf($correctLoanDetails$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
182
182
  var suspendResult = this.result_1;
183
183
  $sm: do
184
184
  try {
185
185
  var tmp = this.state_1;
186
186
  switch (tmp) {
187
187
  case 0:
188
- this.exceptionState_1 = 2;
189
- var localVariableAuthNames = listOf(['cognito', 'cognito-direct']);
190
- var localVariableBody = this.updateLoanCommand_1;
191
- var localVariableQuery = LinkedHashMap_init_$Create$();
192
- var localVariableHeaders = LinkedHashMap_init_$Create$();
193
- var tmp0_method = RequestMethod_PUT_getInstance();
194
- var tmp1_path = replace(replace('/companies/{companyId}/economy/loans/{loanId}', '{companyId}', this.companyId_1.toString()), '{loanId}', this.loanId_1.toString());
195
- var localVariableConfig = new RequestConfig(tmp0_method, tmp1_path, localVariableHeaders, VOID, localVariableQuery, true);
196
- this.state_1 = 1;
197
- suspendResult = this._this__u8e3s4__1.jsonRequest$suspendBridge_ao9kpg_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
198
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
199
- return suspendResult;
200
- }
201
-
202
- continue $sm;
203
- case 1:
204
- var this_0 = suspendResult;
205
- var tmp_0 = getKClass(Loan);
206
- var tmp_1 = null instanceof Loan;
207
- var tmp_2;
208
- try {
209
- tmp_2 = createKType(getKClass(Loan), arrayOf([]), false);
210
- } catch ($p) {
211
- var tmp_3;
212
- if ($p instanceof Error) {
213
- var _unused_var__etf5q3 = $p;
214
- tmp_3 = null;
215
- } else {
216
- throw $p;
188
+ this.exceptionState_1 = 4;
189
+ if (this._this__u8e3s4__1.correctLoanDetails === protoOf(LoanApi).correctLoanDetails) {
190
+ this.state_1 = 2;
191
+ suspendResult = this._this__u8e3s4__1.correctLoanDetails_p5bkrs_k$(this.companyId_1, this.loanId_1, this.updateLoanCommand_1, this);
192
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
193
+ return suspendResult;
217
194
  }
218
- tmp_2 = tmp_3;
195
+ continue $sm;
196
+ } else {
197
+ this.state_1 = 1;
198
+ suspendResult = await_0(this._this__u8e3s4__1.correctLoanDetails(this.companyId_1, this.loanId_1, this.updateLoanCommand_1), this);
199
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
200
+ return suspendResult;
201
+ }
202
+ continue $sm;
219
203
  }
220
204
 
221
- return new HttpResponse(this_0, new TypedBodyProvider(new TypeInfo(tmp_0, tmp_1, tmp_2)));
205
+ case 1:
206
+ this.WHEN_RESULT0__1 = suspendResult;
207
+ this.state_1 = 3;
208
+ continue $sm;
222
209
  case 2:
210
+ this.WHEN_RESULT0__1 = suspendResult;
211
+ this.state_1 = 3;
212
+ continue $sm;
213
+ case 3:
214
+ return this.WHEN_RESULT0__1;
215
+ case 4:
223
216
  throw this.exception_1;
224
217
  }
225
- } catch ($p_0) {
226
- var e = $p_0;
227
- if (this.exceptionState_1 === 2) {
218
+ } catch ($p) {
219
+ var e = $p;
220
+ if (this.exceptionState_1 === 4) {
228
221
  throw e;
229
222
  } else {
230
223
  this.state_1 = this.exceptionState_1;
@@ -233,14 +226,13 @@ protoOf($correctLoanDetailsCOROUTINE$).doResume_5yljmg_k$ = function () {
233
226
  }
234
227
  while (true);
235
228
  };
236
- function $correctLoanDetails$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, loanId, updateLoanCommand, resultContinuation) {
229
+ function $createLoan$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, createLoanCommand, resultContinuation) {
237
230
  CoroutineImpl.call(this, resultContinuation);
238
231
  this._this__u8e3s4__1 = _this__u8e3s4;
239
232
  this.companyId_1 = companyId;
240
- this.loanId_1 = loanId;
241
- this.updateLoanCommand_1 = updateLoanCommand;
233
+ this.createLoanCommand_1 = createLoanCommand;
242
234
  }
243
- protoOf($correctLoanDetails$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
235
+ protoOf($createLoan$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
244
236
  var suspendResult = this.result_1;
245
237
  $sm: do
246
238
  try {
@@ -248,16 +240,16 @@ protoOf($correctLoanDetails$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = functi
248
240
  switch (tmp) {
249
241
  case 0:
250
242
  this.exceptionState_1 = 4;
251
- if (this._this__u8e3s4__1.correctLoanDetails === protoOf(LoanApi).correctLoanDetails) {
243
+ if (this._this__u8e3s4__1.createLoan === protoOf(LoanApi).createLoan) {
252
244
  this.state_1 = 2;
253
- suspendResult = this._this__u8e3s4__1.correctLoanDetails_p5bkrs_k$(this.companyId_1, this.loanId_1, this.updateLoanCommand_1, this);
245
+ suspendResult = this._this__u8e3s4__1.createLoan_p5jh7f_k$(this.companyId_1, this.createLoanCommand_1, this);
254
246
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
255
247
  return suspendResult;
256
248
  }
257
249
  continue $sm;
258
250
  } else {
259
251
  this.state_1 = 1;
260
- suspendResult = await_0(this._this__u8e3s4__1.correctLoanDetails(this.companyId_1, this.loanId_1, this.updateLoanCommand_1), this);
252
+ suspendResult = await_0(this._this__u8e3s4__1.createLoan(this.companyId_1, this.createLoanCommand_1), this);
261
253
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
262
254
  return suspendResult;
263
255
  }
@@ -288,59 +280,52 @@ protoOf($correctLoanDetails$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = functi
288
280
  }
289
281
  while (true);
290
282
  };
291
- function $createLoanCOROUTINE$(_this__u8e3s4, companyId, createLoanCommand, resultContinuation) {
283
+ function $deleteLoan$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, loanId, resultContinuation) {
292
284
  CoroutineImpl.call(this, resultContinuation);
293
285
  this._this__u8e3s4__1 = _this__u8e3s4;
294
286
  this.companyId_1 = companyId;
295
- this.createLoanCommand_1 = createLoanCommand;
287
+ this.loanId_1 = loanId;
296
288
  }
297
- protoOf($createLoanCOROUTINE$).doResume_5yljmg_k$ = function () {
289
+ protoOf($deleteLoan$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
298
290
  var suspendResult = this.result_1;
299
291
  $sm: do
300
292
  try {
301
293
  var tmp = this.state_1;
302
294
  switch (tmp) {
303
295
  case 0:
304
- this.exceptionState_1 = 2;
305
- var localVariableAuthNames = listOf(['cognito', 'cognito-direct']);
306
- var localVariableBody = this.createLoanCommand_1;
307
- var localVariableQuery = LinkedHashMap_init_$Create$();
308
- var localVariableHeaders = LinkedHashMap_init_$Create$();
309
- var tmp0_method = RequestMethod_POST_getInstance();
310
- var tmp1_path = replace('/companies/{companyId}/economy/loans', '{companyId}', this.companyId_1.toString());
311
- var localVariableConfig = new RequestConfig(tmp0_method, tmp1_path, localVariableHeaders, VOID, localVariableQuery, true);
312
- this.state_1 = 1;
313
- suspendResult = this._this__u8e3s4__1.jsonRequest$suspendBridge_ao9kpg_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
314
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
315
- return suspendResult;
316
- }
317
-
318
- continue $sm;
319
- case 1:
320
- var this_0 = suspendResult;
321
- var tmp_0 = getKClass(Loan);
322
- var tmp_1 = null instanceof Loan;
323
- var tmp_2;
324
- try {
325
- tmp_2 = createKType(getKClass(Loan), arrayOf([]), false);
326
- } catch ($p) {
327
- var tmp_3;
328
- if ($p instanceof Error) {
329
- var _unused_var__etf5q3 = $p;
330
- tmp_3 = null;
331
- } else {
332
- throw $p;
296
+ this.exceptionState_1 = 4;
297
+ if (this._this__u8e3s4__1.deleteLoan === protoOf(LoanApi).deleteLoan) {
298
+ this.state_1 = 2;
299
+ suspendResult = this._this__u8e3s4__1.deleteLoan_c43hl5_k$(this.companyId_1, this.loanId_1, this);
300
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
301
+ return suspendResult;
333
302
  }
334
- tmp_2 = tmp_3;
303
+ continue $sm;
304
+ } else {
305
+ this.state_1 = 1;
306
+ suspendResult = await_0(this._this__u8e3s4__1.deleteLoan(this.companyId_1, this.loanId_1), this);
307
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
308
+ return suspendResult;
309
+ }
310
+ continue $sm;
335
311
  }
336
312
 
337
- return new HttpResponse(this_0, new TypedBodyProvider(new TypeInfo(tmp_0, tmp_1, tmp_2)));
313
+ case 1:
314
+ this.WHEN_RESULT0__1 = suspendResult;
315
+ this.state_1 = 3;
316
+ continue $sm;
338
317
  case 2:
318
+ this.WHEN_RESULT0__1 = suspendResult;
319
+ this.state_1 = 3;
320
+ continue $sm;
321
+ case 3:
322
+ return this.WHEN_RESULT0__1;
323
+ case 4:
339
324
  throw this.exception_1;
340
325
  }
341
- } catch ($p_0) {
342
- var e = $p_0;
343
- if (this.exceptionState_1 === 2) {
326
+ } catch ($p) {
327
+ var e = $p;
328
+ if (this.exceptionState_1 === 4) {
344
329
  throw e;
345
330
  } else {
346
331
  this.state_1 = this.exceptionState_1;
@@ -349,13 +334,16 @@ protoOf($createLoanCOROUTINE$).doResume_5yljmg_k$ = function () {
349
334
  }
350
335
  while (true);
351
336
  };
352
- function $createLoan$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, createLoanCommand, resultContinuation) {
337
+ function $indexLoanAccounts$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, fields, pageToken, autoPaginate, count, resultContinuation) {
353
338
  CoroutineImpl.call(this, resultContinuation);
354
339
  this._this__u8e3s4__1 = _this__u8e3s4;
355
340
  this.companyId_1 = companyId;
356
- this.createLoanCommand_1 = createLoanCommand;
341
+ this.fields_1 = fields;
342
+ this.pageToken_1 = pageToken;
343
+ this.autoPaginate_1 = autoPaginate;
344
+ this.count_1 = count;
357
345
  }
358
- protoOf($createLoan$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
346
+ protoOf($indexLoanAccounts$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
359
347
  var suspendResult = this.result_1;
360
348
  $sm: do
361
349
  try {
@@ -363,16 +351,16 @@ protoOf($createLoan$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
363
351
  switch (tmp) {
364
352
  case 0:
365
353
  this.exceptionState_1 = 4;
366
- if (this._this__u8e3s4__1.createLoan === protoOf(LoanApi).createLoan) {
354
+ if (this._this__u8e3s4__1.indexLoanAccounts === protoOf(LoanApi).indexLoanAccounts) {
367
355
  this.state_1 = 2;
368
- suspendResult = this._this__u8e3s4__1.createLoan_p5jh7f_k$(this.companyId_1, this.createLoanCommand_1, this);
356
+ suspendResult = this._this__u8e3s4__1.indexLoanAccounts$default_rzzo4k_k$(this.companyId_1, this.fields_1, this.pageToken_1, this.autoPaginate_1, this.count_1, this);
369
357
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
370
358
  return suspendResult;
371
359
  }
372
360
  continue $sm;
373
361
  } else {
374
362
  this.state_1 = 1;
375
- suspendResult = await_0(this._this__u8e3s4__1.createLoan(this.companyId_1, this.createLoanCommand_1), this);
363
+ suspendResult = await_0(this._this__u8e3s4__1.indexLoanAccounts(this.companyId_1, this.fields_1, this.pageToken_1, this.autoPaginate_1, this.count_1), this);
376
364
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
377
365
  return suspendResult;
378
366
  }
@@ -403,59 +391,56 @@ protoOf($createLoan$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
403
391
  }
404
392
  while (true);
405
393
  };
406
- function $deleteLoanCOROUTINE$(_this__u8e3s4, companyId, loanId, resultContinuation) {
394
+ function $indexLoanLog$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, loanId, fields, pageToken, autoPaginate, count, resultContinuation) {
407
395
  CoroutineImpl.call(this, resultContinuation);
408
396
  this._this__u8e3s4__1 = _this__u8e3s4;
409
397
  this.companyId_1 = companyId;
410
398
  this.loanId_1 = loanId;
399
+ this.fields_1 = fields;
400
+ this.pageToken_1 = pageToken;
401
+ this.autoPaginate_1 = autoPaginate;
402
+ this.count_1 = count;
411
403
  }
412
- protoOf($deleteLoanCOROUTINE$).doResume_5yljmg_k$ = function () {
404
+ protoOf($indexLoanLog$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
413
405
  var suspendResult = this.result_1;
414
406
  $sm: do
415
407
  try {
416
408
  var tmp = this.state_1;
417
409
  switch (tmp) {
418
410
  case 0:
419
- this.exceptionState_1 = 2;
420
- var localVariableAuthNames = listOf(['cognito', 'cognito-direct']);
421
- var localVariableBody = EmptyContent_getInstance();
422
- var localVariableQuery = LinkedHashMap_init_$Create$();
423
- var localVariableHeaders = LinkedHashMap_init_$Create$();
424
- var tmp0_method = RequestMethod_DELETE_getInstance();
425
- var tmp1_path = replace(replace('/companies/{companyId}/economy/loans/{loanId}', '{companyId}', this.companyId_1.toString()), '{loanId}', this.loanId_1.toString());
426
- var localVariableConfig = new RequestConfig(tmp0_method, tmp1_path, localVariableHeaders, VOID, localVariableQuery, true);
427
- this.state_1 = 1;
428
- suspendResult = this._this__u8e3s4__1.request$suspendBridge_gbq0ws_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
429
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
430
- return suspendResult;
431
- }
432
-
433
- continue $sm;
434
- case 1:
435
- var this_0 = suspendResult;
436
- var tmp_0 = getKClass(Unit);
437
- var tmp_1 = null instanceof Unit;
438
- var tmp_2;
439
- try {
440
- tmp_2 = createKType(getKClass(Unit), arrayOf([]), false);
441
- } catch ($p) {
442
- var tmp_3;
443
- if ($p instanceof Error) {
444
- var _unused_var__etf5q3 = $p;
445
- tmp_3 = null;
446
- } else {
447
- throw $p;
411
+ this.exceptionState_1 = 4;
412
+ if (this._this__u8e3s4__1.indexLoanLog === protoOf(LoanApi).indexLoanLog) {
413
+ this.state_1 = 2;
414
+ suspendResult = this._this__u8e3s4__1.indexLoanLog$default_atdzul_k$(this.companyId_1, this.loanId_1, this.fields_1, this.pageToken_1, this.autoPaginate_1, this.count_1, this);
415
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
416
+ return suspendResult;
448
417
  }
449
- tmp_2 = tmp_3;
418
+ continue $sm;
419
+ } else {
420
+ this.state_1 = 1;
421
+ suspendResult = await_0(this._this__u8e3s4__1.indexLoanLog(this.companyId_1, this.loanId_1, this.fields_1, this.pageToken_1, this.autoPaginate_1, this.count_1), this);
422
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
423
+ return suspendResult;
424
+ }
425
+ continue $sm;
450
426
  }
451
427
 
452
- return new HttpResponse(this_0, new TypedBodyProvider(new TypeInfo(tmp_0, tmp_1, tmp_2)));
428
+ case 1:
429
+ this.WHEN_RESULT0__1 = suspendResult;
430
+ this.state_1 = 3;
431
+ continue $sm;
453
432
  case 2:
433
+ this.WHEN_RESULT0__1 = suspendResult;
434
+ this.state_1 = 3;
435
+ continue $sm;
436
+ case 3:
437
+ return this.WHEN_RESULT0__1;
438
+ case 4:
454
439
  throw this.exception_1;
455
440
  }
456
- } catch ($p_0) {
457
- var e = $p_0;
458
- if (this.exceptionState_1 === 2) {
441
+ } catch ($p) {
442
+ var e = $p;
443
+ if (this.exceptionState_1 === 4) {
459
444
  throw e;
460
445
  } else {
461
446
  this.state_1 = this.exceptionState_1;
@@ -464,13 +449,22 @@ protoOf($deleteLoanCOROUTINE$).doResume_5yljmg_k$ = function () {
464
449
  }
465
450
  while (true);
466
451
  };
467
- function $deleteLoan$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, loanId, resultContinuation) {
452
+ function $indexLoans$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, resultContinuation) {
468
453
  CoroutineImpl.call(this, resultContinuation);
469
454
  this._this__u8e3s4__1 = _this__u8e3s4;
470
455
  this.companyId_1 = companyId;
471
- this.loanId_1 = loanId;
456
+ this.active_1 = active;
457
+ this.search_1 = search;
458
+ this.startDateFrom_1 = startDateFrom;
459
+ this.startDateTo_1 = startDateTo;
460
+ this.endDateFrom_1 = endDateFrom;
461
+ this.endDateTo_1 = endDateTo;
462
+ this.fields_1 = fields;
463
+ this.pageToken_1 = pageToken;
464
+ this.autoPaginate_1 = autoPaginate;
465
+ this.count_1 = count;
472
466
  }
473
- protoOf($deleteLoan$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
467
+ protoOf($indexLoans$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
474
468
  var suspendResult = this.result_1;
475
469
  $sm: do
476
470
  try {
@@ -478,16 +472,16 @@ protoOf($deleteLoan$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
478
472
  switch (tmp) {
479
473
  case 0:
480
474
  this.exceptionState_1 = 4;
481
- if (this._this__u8e3s4__1.deleteLoan === protoOf(LoanApi).deleteLoan) {
475
+ if (this._this__u8e3s4__1.indexLoans === protoOf(LoanApi).indexLoans) {
482
476
  this.state_1 = 2;
483
- suspendResult = this._this__u8e3s4__1.deleteLoan_c43hl5_k$(this.companyId_1, this.loanId_1, this);
477
+ suspendResult = this._this__u8e3s4__1.indexLoans$default_qi5mkl_k$(this.companyId_1, this.active_1, this.search_1, this.startDateFrom_1, this.startDateTo_1, this.endDateFrom_1, this.endDateTo_1, this.fields_1, this.pageToken_1, this.autoPaginate_1, this.count_1, this);
484
478
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
485
479
  return suspendResult;
486
480
  }
487
481
  continue $sm;
488
482
  } else {
489
483
  this.state_1 = 1;
490
- suspendResult = await_0(this._this__u8e3s4__1.deleteLoan(this.companyId_1, this.loanId_1), this);
484
+ suspendResult = await_0(this._this__u8e3s4__1.indexLoans(this.companyId_1, this.active_1, this.search_1, this.startDateFrom_1, this.startDateTo_1, this.endDateFrom_1, this.endDateTo_1, this.fields_1, this.pageToken_1, this.autoPaginate_1, this.count_1), this);
491
485
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
492
486
  return suspendResult;
493
487
  }
@@ -518,92 +512,61 @@ protoOf($deleteLoan$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
518
512
  }
519
513
  while (true);
520
514
  };
521
- function $indexLoanAccountsCOROUTINE$(_this__u8e3s4, companyId, fields, pageToken, autoPaginate, count, resultContinuation) {
515
+ function $indexLoansUser$suspendBridgeCOROUTINE$(_this__u8e3s4, search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, resultContinuation) {
522
516
  CoroutineImpl.call(this, resultContinuation);
523
517
  this._this__u8e3s4__1 = _this__u8e3s4;
524
- this.companyId_1 = companyId;
518
+ this.search_1 = search;
519
+ this.companyIds_1 = companyIds;
520
+ this.active_1 = active;
521
+ this.startDateFrom_1 = startDateFrom;
522
+ this.startDateTo_1 = startDateTo;
523
+ this.endDateFrom_1 = endDateFrom;
524
+ this.endDateTo_1 = endDateTo;
525
525
  this.fields_1 = fields;
526
526
  this.pageToken_1 = pageToken;
527
527
  this.autoPaginate_1 = autoPaginate;
528
528
  this.count_1 = count;
529
529
  }
530
- protoOf($indexLoanAccountsCOROUTINE$).doResume_5yljmg_k$ = function () {
530
+ protoOf($indexLoansUser$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
531
531
  var suspendResult = this.result_1;
532
532
  $sm: do
533
533
  try {
534
534
  var tmp = this.state_1;
535
535
  switch (tmp) {
536
536
  case 0:
537
- this.exceptionState_1 = 2;
538
- var localVariableAuthNames = listOf(['cognito', 'cognito-direct']);
539
- var localVariableBody = EmptyContent_getInstance();
540
- var localVariableQuery = LinkedHashMap_init_$Create$();
541
- if (this.fields_1 == null)
542
- null;
543
- else {
544
- var value = listOf_0(this.fields_1);
545
- localVariableQuery.put_4fpzoq_k$('fields', value);
546
- }
547
-
548
- if (this.pageToken_1 == null)
549
- null;
550
- else {
551
- var tmp2 = 'pageToken';
552
- var value_0 = listOf_0(this.pageToken_1);
553
- localVariableQuery.put_4fpzoq_k$(tmp2, value_0);
554
- }
555
-
556
- if (this.autoPaginate_1 == null)
557
- null;
558
- else {
559
- var tmp2_0 = 'autoPaginate';
560
- var value_1 = listOf_0('' + this.autoPaginate_1);
561
- localVariableQuery.put_4fpzoq_k$(tmp2_0, value_1);
562
- }
563
-
564
- if (this.count_1 == null)
565
- null;
566
- else {
567
- var value_2 = listOf_0('' + this.count_1);
568
- localVariableQuery.put_4fpzoq_k$('count', value_2);
569
- }
570
-
571
- var localVariableHeaders = LinkedHashMap_init_$Create$();
572
- var tmp4_method = RequestMethod_GET_getInstance();
573
- var tmp5_path = replace('/companies/{companyId}/economy/loans/accounts', '{companyId}', this.companyId_1.toString());
574
- var localVariableConfig = new RequestConfig(tmp4_method, tmp5_path, localVariableHeaders, VOID, localVariableQuery, true);
575
- this.state_1 = 1;
576
- suspendResult = this._this__u8e3s4__1.request$suspendBridge_gbq0ws_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
577
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
578
- return suspendResult;
579
- }
580
-
581
- continue $sm;
582
- case 1:
583
- var this_0 = suspendResult;
584
- var tmp_0 = getKClass(PagedListAccount);
585
- var tmp_1 = null instanceof PagedListAccount;
586
- var tmp_2;
587
- try {
588
- tmp_2 = createKType(getKClass(PagedListAccount), arrayOf([]), false);
589
- } catch ($p) {
590
- var tmp_3;
591
- if ($p instanceof Error) {
592
- var _unused_var__etf5q3 = $p;
593
- tmp_3 = null;
594
- } else {
595
- throw $p;
537
+ this.exceptionState_1 = 4;
538
+ if (this._this__u8e3s4__1.indexLoansUser === protoOf(LoanApi).indexLoansUser) {
539
+ this.state_1 = 2;
540
+ suspendResult = this._this__u8e3s4__1.indexLoansUser$default_9zom8k_k$(this.search_1, this.companyIds_1, this.active_1, this.startDateFrom_1, this.startDateTo_1, this.endDateFrom_1, this.endDateTo_1, this.fields_1, this.pageToken_1, this.autoPaginate_1, this.count_1, this);
541
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
542
+ return suspendResult;
596
543
  }
597
- tmp_2 = tmp_3;
544
+ continue $sm;
545
+ } else {
546
+ this.state_1 = 1;
547
+ suspendResult = await_0(this._this__u8e3s4__1.indexLoansUser(this.search_1, this.companyIds_1, this.active_1, this.startDateFrom_1, this.startDateTo_1, this.endDateFrom_1, this.endDateTo_1, this.fields_1, this.pageToken_1, this.autoPaginate_1, this.count_1), this);
548
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
549
+ return suspendResult;
550
+ }
551
+ continue $sm;
598
552
  }
599
553
 
600
- return new HttpResponse(this_0, new TypedBodyProvider(new TypeInfo(tmp_0, tmp_1, tmp_2)));
554
+ case 1:
555
+ this.WHEN_RESULT0__1 = suspendResult;
556
+ this.state_1 = 3;
557
+ continue $sm;
601
558
  case 2:
559
+ this.WHEN_RESULT0__1 = suspendResult;
560
+ this.state_1 = 3;
561
+ continue $sm;
562
+ case 3:
563
+ return this.WHEN_RESULT0__1;
564
+ case 4:
602
565
  throw this.exception_1;
603
566
  }
604
- } catch ($p_0) {
605
- var e = $p_0;
606
- if (this.exceptionState_1 === 2) {
567
+ } catch ($p) {
568
+ var e = $p;
569
+ if (this.exceptionState_1 === 4) {
607
570
  throw e;
608
571
  } else {
609
572
  this.state_1 = this.exceptionState_1;
@@ -612,16 +575,14 @@ protoOf($indexLoanAccountsCOROUTINE$).doResume_5yljmg_k$ = function () {
612
575
  }
613
576
  while (true);
614
577
  };
615
- function $indexLoanAccounts$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, fields, pageToken, autoPaginate, count, resultContinuation) {
578
+ function $showLoan$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, loanId, fields, resultContinuation) {
616
579
  CoroutineImpl.call(this, resultContinuation);
617
580
  this._this__u8e3s4__1 = _this__u8e3s4;
618
581
  this.companyId_1 = companyId;
582
+ this.loanId_1 = loanId;
619
583
  this.fields_1 = fields;
620
- this.pageToken_1 = pageToken;
621
- this.autoPaginate_1 = autoPaginate;
622
- this.count_1 = count;
623
584
  }
624
- protoOf($indexLoanAccounts$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
585
+ protoOf($showLoan$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
625
586
  var suspendResult = this.result_1;
626
587
  $sm: do
627
588
  try {
@@ -629,16 +590,16 @@ protoOf($indexLoanAccounts$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = functio
629
590
  switch (tmp) {
630
591
  case 0:
631
592
  this.exceptionState_1 = 4;
632
- if (this._this__u8e3s4__1.indexLoanAccounts === protoOf(LoanApi).indexLoanAccounts) {
593
+ if (this._this__u8e3s4__1.showLoan === protoOf(LoanApi).showLoan) {
633
594
  this.state_1 = 2;
634
- suspendResult = this._this__u8e3s4__1.indexLoanAccounts$default_rzzo4k_k$(this.companyId_1, this.fields_1, this.pageToken_1, this.autoPaginate_1, this.count_1, this);
595
+ suspendResult = this._this__u8e3s4__1.showLoan$default_590974_k$(this.companyId_1, this.loanId_1, this.fields_1, this);
635
596
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
636
597
  return suspendResult;
637
598
  }
638
599
  continue $sm;
639
600
  } else {
640
601
  this.state_1 = 1;
641
- suspendResult = await_0(this._this__u8e3s4__1.indexLoanAccounts(this.companyId_1, this.fields_1, this.pageToken_1, this.autoPaginate_1, this.count_1), this);
602
+ suspendResult = await_0(this._this__u8e3s4__1.showLoan(this.companyId_1, this.loanId_1, this.fields_1), this);
642
603
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
643
604
  return suspendResult;
644
605
  }
@@ -669,93 +630,53 @@ protoOf($indexLoanAccounts$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = functio
669
630
  }
670
631
  while (true);
671
632
  };
672
- function $indexLoanLogCOROUTINE$(_this__u8e3s4, companyId, loanId, fields, pageToken, autoPaginate, count, resultContinuation) {
633
+ function $updateLoan$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, loanId, closeLoanCommand, resultContinuation) {
673
634
  CoroutineImpl.call(this, resultContinuation);
674
635
  this._this__u8e3s4__1 = _this__u8e3s4;
675
636
  this.companyId_1 = companyId;
676
637
  this.loanId_1 = loanId;
677
- this.fields_1 = fields;
678
- this.pageToken_1 = pageToken;
679
- this.autoPaginate_1 = autoPaginate;
680
- this.count_1 = count;
638
+ this.closeLoanCommand_1 = closeLoanCommand;
681
639
  }
682
- protoOf($indexLoanLogCOROUTINE$).doResume_5yljmg_k$ = function () {
640
+ protoOf($updateLoan$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
683
641
  var suspendResult = this.result_1;
684
642
  $sm: do
685
643
  try {
686
644
  var tmp = this.state_1;
687
645
  switch (tmp) {
688
646
  case 0:
689
- this.exceptionState_1 = 2;
690
- var localVariableAuthNames = listOf(['cognito', 'cognito-direct']);
691
- var localVariableBody = EmptyContent_getInstance();
692
- var localVariableQuery = LinkedHashMap_init_$Create$();
693
- if (this.fields_1 == null)
694
- null;
695
- else {
696
- var value = listOf_0(this.fields_1);
697
- localVariableQuery.put_4fpzoq_k$('fields', value);
698
- }
699
-
700
- if (this.pageToken_1 == null)
701
- null;
702
- else {
703
- var tmp2 = 'pageToken';
704
- var value_0 = listOf_0(this.pageToken_1);
705
- localVariableQuery.put_4fpzoq_k$(tmp2, value_0);
706
- }
707
-
708
- if (this.autoPaginate_1 == null)
709
- null;
710
- else {
711
- var tmp2_0 = 'autoPaginate';
712
- var value_1 = listOf_0('' + this.autoPaginate_1);
713
- localVariableQuery.put_4fpzoq_k$(tmp2_0, value_1);
714
- }
715
-
716
- if (this.count_1 == null)
717
- null;
718
- else {
719
- var value_2 = listOf_0('' + this.count_1);
720
- localVariableQuery.put_4fpzoq_k$('count', value_2);
721
- }
722
-
723
- var localVariableHeaders = LinkedHashMap_init_$Create$();
724
- var tmp4_method = RequestMethod_GET_getInstance();
725
- var tmp5_path = replace(replace('/companies/{companyId}/economy/loans/{loanId}/log', '{companyId}', this.companyId_1.toString()), '{loanId}', this.loanId_1.toString());
726
- var localVariableConfig = new RequestConfig(tmp4_method, tmp5_path, localVariableHeaders, VOID, localVariableQuery, true);
727
- this.state_1 = 1;
728
- suspendResult = this._this__u8e3s4__1.request$suspendBridge_gbq0ws_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
729
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
730
- return suspendResult;
731
- }
732
-
733
- continue $sm;
734
- case 1:
735
- var this_0 = suspendResult;
736
- var tmp_0 = getKClass(PagedListLoanLog);
737
- var tmp_1 = null instanceof PagedListLoanLog;
738
- var tmp_2;
739
- try {
740
- tmp_2 = createKType(getKClass(PagedListLoanLog), arrayOf([]), false);
741
- } catch ($p) {
742
- var tmp_3;
743
- if ($p instanceof Error) {
744
- var _unused_var__etf5q3 = $p;
745
- tmp_3 = null;
746
- } else {
747
- throw $p;
647
+ this.exceptionState_1 = 4;
648
+ if (this._this__u8e3s4__1.updateLoan === protoOf(LoanApi).updateLoan) {
649
+ this.state_1 = 2;
650
+ suspendResult = this._this__u8e3s4__1.updateLoan_2fb142_k$(this.companyId_1, this.loanId_1, this.closeLoanCommand_1, this);
651
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
652
+ return suspendResult;
748
653
  }
749
- tmp_2 = tmp_3;
654
+ continue $sm;
655
+ } else {
656
+ this.state_1 = 1;
657
+ suspendResult = await_0(this._this__u8e3s4__1.updateLoan(this.companyId_1, this.loanId_1, this.closeLoanCommand_1), this);
658
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
659
+ return suspendResult;
660
+ }
661
+ continue $sm;
750
662
  }
751
663
 
752
- return new HttpResponse(this_0, new TypedBodyProvider(new TypeInfo(tmp_0, tmp_1, tmp_2)));
664
+ case 1:
665
+ this.WHEN_RESULT0__1 = suspendResult;
666
+ this.state_1 = 3;
667
+ continue $sm;
753
668
  case 2:
669
+ this.WHEN_RESULT0__1 = suspendResult;
670
+ this.state_1 = 3;
671
+ continue $sm;
672
+ case 3:
673
+ return this.WHEN_RESULT0__1;
674
+ case 4:
754
675
  throw this.exception_1;
755
676
  }
756
- } catch ($p_0) {
757
- var e = $p_0;
758
- if (this.exceptionState_1 === 2) {
677
+ } catch ($p) {
678
+ var e = $p;
679
+ if (this.exceptionState_1 === 4) {
759
680
  throw e;
760
681
  } else {
761
682
  this.state_1 = this.exceptionState_1;
@@ -764,17 +685,14 @@ protoOf($indexLoanLogCOROUTINE$).doResume_5yljmg_k$ = function () {
764
685
  }
765
686
  while (true);
766
687
  };
767
- function $indexLoanLog$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, loanId, fields, pageToken, autoPaginate, count, resultContinuation) {
688
+ function $updateLoanAgreement$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, loanId, addAgreementDocumentToLoanCommand, resultContinuation) {
768
689
  CoroutineImpl.call(this, resultContinuation);
769
690
  this._this__u8e3s4__1 = _this__u8e3s4;
770
691
  this.companyId_1 = companyId;
771
692
  this.loanId_1 = loanId;
772
- this.fields_1 = fields;
773
- this.pageToken_1 = pageToken;
774
- this.autoPaginate_1 = autoPaginate;
775
- this.count_1 = count;
693
+ this.addAgreementDocumentToLoanCommand_1 = addAgreementDocumentToLoanCommand;
776
694
  }
777
- protoOf($indexLoanLog$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
695
+ protoOf($updateLoanAgreement$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
778
696
  var suspendResult = this.result_1;
779
697
  $sm: do
780
698
  try {
@@ -782,16 +700,16 @@ protoOf($indexLoanLog$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function ()
782
700
  switch (tmp) {
783
701
  case 0:
784
702
  this.exceptionState_1 = 4;
785
- if (this._this__u8e3s4__1.indexLoanLog === protoOf(LoanApi).indexLoanLog) {
703
+ if (this._this__u8e3s4__1.updateLoanAgreement === protoOf(LoanApi).updateLoanAgreement) {
786
704
  this.state_1 = 2;
787
- suspendResult = this._this__u8e3s4__1.indexLoanLog$default_atdzul_k$(this.companyId_1, this.loanId_1, this.fields_1, this.pageToken_1, this.autoPaginate_1, this.count_1, this);
705
+ suspendResult = this._this__u8e3s4__1.updateLoanAgreement_miylnt_k$(this.companyId_1, this.loanId_1, this.addAgreementDocumentToLoanCommand_1, this);
788
706
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
789
707
  return suspendResult;
790
708
  }
791
709
  continue $sm;
792
710
  } else {
793
711
  this.state_1 = 1;
794
- suspendResult = await_0(this._this__u8e3s4__1.indexLoanLog(this.companyId_1, this.loanId_1, this.fields_1, this.pageToken_1, this.autoPaginate_1, this.count_1), this);
712
+ suspendResult = await_0(this._this__u8e3s4__1.updateLoanAgreement(this.companyId_1, this.loanId_1, this.addAgreementDocumentToLoanCommand_1), this);
795
713
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
796
714
  return suspendResult;
797
715
  }
@@ -822,144 +740,53 @@ protoOf($indexLoanLog$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function ()
822
740
  }
823
741
  while (true);
824
742
  };
825
- function $indexLoansCOROUTINE$(_this__u8e3s4, companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, resultContinuation) {
743
+ function $updateLoanIN$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, loanId, updateINAgreementCommand, resultContinuation) {
826
744
  CoroutineImpl.call(this, resultContinuation);
827
745
  this._this__u8e3s4__1 = _this__u8e3s4;
828
746
  this.companyId_1 = companyId;
829
- this.active_1 = active;
830
- this.search_1 = search;
831
- this.startDateFrom_1 = startDateFrom;
832
- this.startDateTo_1 = startDateTo;
833
- this.endDateFrom_1 = endDateFrom;
834
- this.endDateTo_1 = endDateTo;
835
- this.fields_1 = fields;
836
- this.pageToken_1 = pageToken;
837
- this.autoPaginate_1 = autoPaginate;
838
- this.count_1 = count;
747
+ this.loanId_1 = loanId;
748
+ this.updateINAgreementCommand_1 = updateINAgreementCommand;
839
749
  }
840
- protoOf($indexLoansCOROUTINE$).doResume_5yljmg_k$ = function () {
750
+ protoOf($updateLoanIN$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
841
751
  var suspendResult = this.result_1;
842
752
  $sm: do
843
753
  try {
844
754
  var tmp = this.state_1;
845
755
  switch (tmp) {
846
756
  case 0:
847
- this.exceptionState_1 = 2;
848
- var localVariableAuthNames = listOf(['cognito', 'cognito-direct']);
849
- var localVariableBody = EmptyContent_getInstance();
850
- var localVariableQuery = LinkedHashMap_init_$Create$();
851
- if (this.active_1 == null)
852
- null;
853
- else {
854
- var value = listOf_0('' + this.active_1);
855
- localVariableQuery.put_4fpzoq_k$('active', value);
856
- }
857
-
858
- if (this.search_1 == null)
859
- null;
860
- else {
861
- var value_0 = listOf_0(this.search_1);
862
- localVariableQuery.put_4fpzoq_k$('search', value_0);
863
- }
864
-
865
- if (this.startDateFrom_1 == null)
866
- null;
867
- else {
868
- var tmp2 = 'startDateFrom';
869
- var value_1 = listOf_0(this.startDateFrom_1.toString());
870
- localVariableQuery.put_4fpzoq_k$(tmp2, value_1);
871
- }
872
-
873
- if (this.startDateTo_1 == null)
874
- null;
875
- else {
876
- var tmp2_0 = 'startDateTo';
877
- var value_2 = listOf_0(this.startDateTo_1.toString());
878
- localVariableQuery.put_4fpzoq_k$(tmp2_0, value_2);
879
- }
880
-
881
- if (this.endDateFrom_1 == null)
882
- null;
883
- else {
884
- var tmp2_1 = 'endDateFrom';
885
- var value_3 = listOf_0(this.endDateFrom_1.toString());
886
- localVariableQuery.put_4fpzoq_k$(tmp2_1, value_3);
887
- }
888
-
889
- if (this.endDateTo_1 == null)
890
- null;
891
- else {
892
- var tmp2_2 = 'endDateTo';
893
- var value_4 = listOf_0(this.endDateTo_1.toString());
894
- localVariableQuery.put_4fpzoq_k$(tmp2_2, value_4);
895
- }
896
-
897
- if (this.fields_1 == null)
898
- null;
899
- else {
900
- var value_5 = listOf_0(this.fields_1);
901
- localVariableQuery.put_4fpzoq_k$('fields', value_5);
902
- }
903
-
904
- if (this.pageToken_1 == null)
905
- null;
906
- else {
907
- var tmp2_3 = 'pageToken';
908
- var value_6 = listOf_0(this.pageToken_1);
909
- localVariableQuery.put_4fpzoq_k$(tmp2_3, value_6);
910
- }
911
-
912
- if (this.autoPaginate_1 == null)
913
- null;
914
- else {
915
- var tmp2_4 = 'autoPaginate';
916
- var value_7 = listOf_0('' + this.autoPaginate_1);
917
- localVariableQuery.put_4fpzoq_k$(tmp2_4, value_7);
918
- }
919
-
920
- if (this.count_1 == null)
921
- null;
922
- else {
923
- var value_8 = listOf_0('' + this.count_1);
924
- localVariableQuery.put_4fpzoq_k$('count', value_8);
925
- }
926
-
927
- var localVariableHeaders = LinkedHashMap_init_$Create$();
928
- var tmp10_method = RequestMethod_GET_getInstance();
929
- var tmp11_path = replace('/companies/{companyId}/economy/loans', '{companyId}', this.companyId_1.toString());
930
- var localVariableConfig = new RequestConfig(tmp10_method, tmp11_path, localVariableHeaders, VOID, localVariableQuery, true);
931
- this.state_1 = 1;
932
- suspendResult = this._this__u8e3s4__1.request$suspendBridge_gbq0ws_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
933
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
934
- return suspendResult;
935
- }
936
-
937
- continue $sm;
938
- case 1:
939
- var this_0 = suspendResult;
940
- var tmp_0 = getKClass(PagedListLoan);
941
- var tmp_1 = null instanceof PagedListLoan;
942
- var tmp_2;
943
- try {
944
- tmp_2 = createKType(getKClass(PagedListLoan), arrayOf([]), false);
945
- } catch ($p) {
946
- var tmp_3;
947
- if ($p instanceof Error) {
948
- var _unused_var__etf5q3 = $p;
949
- tmp_3 = null;
950
- } else {
951
- throw $p;
757
+ this.exceptionState_1 = 4;
758
+ if (this._this__u8e3s4__1.updateLoanIN === protoOf(LoanApi).updateLoanIN) {
759
+ this.state_1 = 2;
760
+ suspendResult = this._this__u8e3s4__1.updateLoanIN_rdgr4h_k$(this.companyId_1, this.loanId_1, this.updateINAgreementCommand_1, this);
761
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
762
+ return suspendResult;
952
763
  }
953
- tmp_2 = tmp_3;
764
+ continue $sm;
765
+ } else {
766
+ this.state_1 = 1;
767
+ suspendResult = await_0(this._this__u8e3s4__1.updateLoanIN(this.companyId_1, this.loanId_1, this.updateINAgreementCommand_1), this);
768
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
769
+ return suspendResult;
770
+ }
771
+ continue $sm;
954
772
  }
955
773
 
956
- return new HttpResponse(this_0, new TypedBodyProvider(new TypeInfo(tmp_0, tmp_1, tmp_2)));
774
+ case 1:
775
+ this.WHEN_RESULT0__1 = suspendResult;
776
+ this.state_1 = 3;
777
+ continue $sm;
957
778
  case 2:
779
+ this.WHEN_RESULT0__1 = suspendResult;
780
+ this.state_1 = 3;
781
+ continue $sm;
782
+ case 3:
783
+ return this.WHEN_RESULT0__1;
784
+ case 4:
958
785
  throw this.exception_1;
959
786
  }
960
- } catch ($p_0) {
961
- var e = $p_0;
962
- if (this.exceptionState_1 === 2) {
787
+ } catch ($p) {
788
+ var e = $p;
789
+ if (this.exceptionState_1 === 4) {
963
790
  throw e;
964
791
  } else {
965
792
  this.state_1 = this.exceptionState_1;
@@ -968,22 +795,14 @@ protoOf($indexLoansCOROUTINE$).doResume_5yljmg_k$ = function () {
968
795
  }
969
796
  while (true);
970
797
  };
971
- function $indexLoans$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, resultContinuation) {
798
+ function $updateLoanInterest$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, loanId, updateLoanInterestCommand, resultContinuation) {
972
799
  CoroutineImpl.call(this, resultContinuation);
973
800
  this._this__u8e3s4__1 = _this__u8e3s4;
974
801
  this.companyId_1 = companyId;
975
- this.active_1 = active;
976
- this.search_1 = search;
977
- this.startDateFrom_1 = startDateFrom;
978
- this.startDateTo_1 = startDateTo;
979
- this.endDateFrom_1 = endDateFrom;
980
- this.endDateTo_1 = endDateTo;
981
- this.fields_1 = fields;
982
- this.pageToken_1 = pageToken;
983
- this.autoPaginate_1 = autoPaginate;
984
- this.count_1 = count;
802
+ this.loanId_1 = loanId;
803
+ this.updateLoanInterestCommand_1 = updateLoanInterestCommand;
985
804
  }
986
- protoOf($indexLoans$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
805
+ protoOf($updateLoanInterest$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
987
806
  var suspendResult = this.result_1;
988
807
  $sm: do
989
808
  try {
@@ -991,16 +810,16 @@ protoOf($indexLoans$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
991
810
  switch (tmp) {
992
811
  case 0:
993
812
  this.exceptionState_1 = 4;
994
- if (this._this__u8e3s4__1.indexLoans === protoOf(LoanApi).indexLoans) {
813
+ if (this._this__u8e3s4__1.updateLoanInterest === protoOf(LoanApi).updateLoanInterest) {
995
814
  this.state_1 = 2;
996
- suspendResult = this._this__u8e3s4__1.indexLoans$default_qi5mkl_k$(this.companyId_1, this.active_1, this.search_1, this.startDateFrom_1, this.startDateTo_1, this.endDateFrom_1, this.endDateTo_1, this.fields_1, this.pageToken_1, this.autoPaginate_1, this.count_1, this);
815
+ suspendResult = this._this__u8e3s4__1.updateLoanInterest_lgs6fx_k$(this.companyId_1, this.loanId_1, this.updateLoanInterestCommand_1, this);
997
816
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
998
817
  return suspendResult;
999
818
  }
1000
819
  continue $sm;
1001
820
  } else {
1002
821
  this.state_1 = 1;
1003
- suspendResult = await_0(this._this__u8e3s4__1.indexLoans(this.companyId_1, this.active_1, this.search_1, this.startDateFrom_1, this.startDateTo_1, this.endDateFrom_1, this.endDateTo_1, this.fields_1, this.pageToken_1, this.autoPaginate_1, this.count_1), this);
822
+ suspendResult = await_0(this._this__u8e3s4__1.updateLoanInterest(this.companyId_1, this.loanId_1, this.updateLoanInterestCommand_1), this);
1004
823
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
1005
824
  return suspendResult;
1006
825
  }
@@ -1031,134 +850,280 @@ protoOf($indexLoans$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
1031
850
  }
1032
851
  while (true);
1033
852
  };
1034
- function $indexLoansUserCOROUTINE$(_this__u8e3s4, search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, resultContinuation) {
1035
- CoroutineImpl.call(this, resultContinuation);
1036
- this._this__u8e3s4__1 = _this__u8e3s4;
1037
- this.search_1 = search;
1038
- this.companyIds_1 = companyIds;
1039
- this.active_1 = active;
1040
- this.startDateFrom_1 = startDateFrom;
1041
- this.startDateTo_1 = startDateTo;
1042
- this.endDateFrom_1 = endDateFrom;
1043
- this.endDateTo_1 = endDateTo;
1044
- this.fields_1 = fields;
1045
- this.pageToken_1 = pageToken;
1046
- this.autoPaginate_1 = autoPaginate;
1047
- this.count_1 = count;
1048
- }
1049
- protoOf($indexLoansUserCOROUTINE$).doResume_5yljmg_k$ = function () {
1050
- var suspendResult = this.result_1;
1051
- $sm: do
1052
- try {
1053
- var tmp = this.state_1;
1054
- switch (tmp) {
1055
- case 0:
1056
- this.exceptionState_1 = 2;
1057
- var localVariableAuthNames = listOf(['cognito', 'cognito-direct']);
1058
- var localVariableBody = EmptyContent_getInstance();
1059
- var localVariableQuery = LinkedHashMap_init_$Create$();
1060
- if (this.search_1 == null)
1061
- null;
1062
- else {
1063
- var value = listOf_0(this.search_1);
1064
- localVariableQuery.put_4fpzoq_k$('search', value);
1065
- }
1066
-
1067
- var tmp1_safe_receiver = this.companyIds_1;
1068
- if (tmp1_safe_receiver == null)
1069
- null;
1070
- else {
1071
- var tmp2 = 'companyIds';
1072
- var value_0 = toMultiValue(tmp1_safe_receiver, 'multi');
1073
- localVariableQuery.put_4fpzoq_k$(tmp2, value_0);
1074
- }
1075
-
1076
- if (this.active_1 == null)
1077
- null;
1078
- else {
1079
- var value_1 = listOf_0('' + this.active_1);
1080
- localVariableQuery.put_4fpzoq_k$('active', value_1);
1081
- }
1082
-
1083
- if (this.startDateFrom_1 == null)
1084
- null;
1085
- else {
1086
- var tmp2_0 = 'startDateFrom';
1087
- var value_2 = listOf_0(this.startDateFrom_1.toString());
1088
- localVariableQuery.put_4fpzoq_k$(tmp2_0, value_2);
1089
- }
1090
-
1091
- if (this.startDateTo_1 == null)
1092
- null;
1093
- else {
1094
- var tmp2_1 = 'startDateTo';
1095
- var value_3 = listOf_0(this.startDateTo_1.toString());
1096
- localVariableQuery.put_4fpzoq_k$(tmp2_1, value_3);
1097
- }
1098
-
1099
- if (this.endDateFrom_1 == null)
1100
- null;
1101
- else {
1102
- var tmp2_2 = 'endDateFrom';
1103
- var value_4 = listOf_0(this.endDateFrom_1.toString());
1104
- localVariableQuery.put_4fpzoq_k$(tmp2_2, value_4);
1105
- }
1106
-
1107
- if (this.endDateTo_1 == null)
1108
- null;
1109
- else {
1110
- var tmp2_3 = 'endDateTo';
1111
- var value_5 = listOf_0(this.endDateTo_1.toString());
1112
- localVariableQuery.put_4fpzoq_k$(tmp2_3, value_5);
1113
- }
1114
-
1115
- if (this.fields_1 == null)
1116
- null;
1117
- else {
1118
- var value_6 = listOf_0(this.fields_1);
1119
- localVariableQuery.put_4fpzoq_k$('fields', value_6);
1120
- }
1121
-
1122
- if (this.pageToken_1 == null)
1123
- null;
1124
- else {
1125
- var tmp2_4 = 'pageToken';
1126
- var value_7 = listOf_0(this.pageToken_1);
1127
- localVariableQuery.put_4fpzoq_k$(tmp2_4, value_7);
1128
- }
1129
-
1130
- if (this.autoPaginate_1 == null)
1131
- null;
1132
- else {
1133
- var tmp2_5 = 'autoPaginate';
1134
- var value_8 = listOf_0('' + this.autoPaginate_1);
1135
- localVariableQuery.put_4fpzoq_k$(tmp2_5, value_8);
1136
- }
1137
-
1138
- if (this.count_1 == null)
1139
- null;
1140
- else {
1141
- var value_9 = listOf_0('' + this.count_1);
1142
- localVariableQuery.put_4fpzoq_k$('count', value_9);
1143
- }
1144
-
1145
- var localVariableHeaders = LinkedHashMap_init_$Create$();
1146
- var tmp11_method = RequestMethod_GET_getInstance();
1147
- var localVariableConfig = new RequestConfig(tmp11_method, '/companies/economy/loans', localVariableHeaders, VOID, localVariableQuery, true);
1148
- this.state_1 = 1;
1149
- suspendResult = this._this__u8e3s4__1.request$suspendBridge_gbq0ws_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
1150
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
1151
- return suspendResult;
853
+ protoOf(LoanApi).correctLoanDetails_p5bkrs_k$ = function (companyId, loanId, updateLoanCommand, $completion) {
854
+ return correctLoanDetailsOperation_0(this, companyId, loanId, updateLoanCommand, $completion);
855
+ };
856
+ protoOf(LoanApi).correctLoanDetails = function (companyId, loanId, updateLoanCommand) {
857
+ var tmp = this;
858
+ return promisify(function ($completion) {
859
+ return tmp.correctLoanDetails_p5bkrs_k$(companyId, loanId, updateLoanCommand, $completion);
860
+ });
861
+ };
862
+ protoOf(LoanApi).correctLoanDetails$suspendBridge_pl8hjt_k$ = function (companyId, loanId, updateLoanCommand, $completion) {
863
+ var tmp = new $correctLoanDetails$suspendBridgeCOROUTINE$(this, companyId, loanId, updateLoanCommand, $completion);
864
+ tmp.result_1 = Unit_instance;
865
+ tmp.exception_1 = null;
866
+ return tmp.doResume_5yljmg_k$();
867
+ };
868
+ protoOf(LoanApi).createLoan_p5jh7f_k$ = function (companyId, createLoanCommand, $completion) {
869
+ return createLoanOperation_0(this, companyId, createLoanCommand, $completion);
870
+ };
871
+ protoOf(LoanApi).createLoan = function (companyId, createLoanCommand) {
872
+ var tmp = this;
873
+ return promisify(function ($completion) {
874
+ return tmp.createLoan_p5jh7f_k$(companyId, createLoanCommand, $completion);
875
+ });
876
+ };
877
+ protoOf(LoanApi).createLoan$suspendBridge_b1w91i_k$ = function (companyId, createLoanCommand, $completion) {
878
+ var tmp = new $createLoan$suspendBridgeCOROUTINE$(this, companyId, createLoanCommand, $completion);
879
+ tmp.result_1 = Unit_instance;
880
+ tmp.exception_1 = null;
881
+ return tmp.doResume_5yljmg_k$();
882
+ };
883
+ protoOf(LoanApi).deleteLoan_c43hl5_k$ = function (companyId, loanId, $completion) {
884
+ return deleteLoanOperation_0(this, companyId, loanId, $completion);
885
+ };
886
+ protoOf(LoanApi).deleteLoan = function (companyId, loanId) {
887
+ var tmp = this;
888
+ return promisify(function ($completion) {
889
+ return tmp.deleteLoan_c43hl5_k$(companyId, loanId, $completion);
890
+ });
891
+ };
892
+ protoOf(LoanApi).deleteLoan$suspendBridge_7b4xbs_k$ = function (companyId, loanId, $completion) {
893
+ var tmp = new $deleteLoan$suspendBridgeCOROUTINE$(this, companyId, loanId, $completion);
894
+ tmp.result_1 = Unit_instance;
895
+ tmp.exception_1 = null;
896
+ return tmp.doResume_5yljmg_k$();
897
+ };
898
+ protoOf(LoanApi).indexLoanAccounts_s9a4xy_k$ = function (companyId, fields, pageToken, autoPaginate, count, $completion) {
899
+ return indexLoanAccountsOperation_0(this, companyId, fields, pageToken, autoPaginate, count, $completion);
900
+ };
901
+ protoOf(LoanApi).indexLoanAccounts$default_rzzo4k_k$ = function (companyId, fields, pageToken, autoPaginate, count, $completion, $super) {
902
+ fields = fields === VOID ? null : fields;
903
+ pageToken = pageToken === VOID ? null : pageToken;
904
+ autoPaginate = autoPaginate === VOID ? null : autoPaginate;
905
+ count = count === VOID ? null : count;
906
+ return $super === VOID ? this.indexLoanAccounts_s9a4xy_k$(companyId, fields, pageToken, autoPaginate, count, $completion) : $super.indexLoanAccounts_s9a4xy_k$.call(this, companyId, fields, pageToken, autoPaginate, count, $completion);
907
+ };
908
+ protoOf(LoanApi).indexLoanAccounts = function (companyId, fields, pageToken, autoPaginate, count) {
909
+ var tmp = this;
910
+ return promisify(function ($completion) {
911
+ return tmp.indexLoanAccounts$default_rzzo4k_k$(companyId, fields, pageToken, autoPaginate, count, $completion);
912
+ });
913
+ };
914
+ protoOf(LoanApi).indexLoanAccounts$suspendBridge_krx1b9_k$ = function (companyId, fields, pageToken, autoPaginate, count, $completion) {
915
+ var tmp = new $indexLoanAccounts$suspendBridgeCOROUTINE$(this, companyId, fields, pageToken, autoPaginate, count, $completion);
916
+ tmp.result_1 = Unit_instance;
917
+ tmp.exception_1 = null;
918
+ return tmp.doResume_5yljmg_k$();
919
+ };
920
+ protoOf(LoanApi).indexLoanLog_2knq4b_k$ = function (companyId, loanId, fields, pageToken, autoPaginate, count, $completion) {
921
+ return indexLoanLogOperation_0(this, companyId, loanId, fields, pageToken, autoPaginate, count, $completion);
922
+ };
923
+ protoOf(LoanApi).indexLoanLog$default_atdzul_k$ = function (companyId, loanId, fields, pageToken, autoPaginate, count, $completion, $super) {
924
+ fields = fields === VOID ? null : fields;
925
+ pageToken = pageToken === VOID ? null : pageToken;
926
+ autoPaginate = autoPaginate === VOID ? null : autoPaginate;
927
+ count = count === VOID ? null : count;
928
+ return $super === VOID ? this.indexLoanLog_2knq4b_k$(companyId, loanId, fields, pageToken, autoPaginate, count, $completion) : $super.indexLoanLog_2knq4b_k$.call(this, companyId, loanId, fields, pageToken, autoPaginate, count, $completion);
929
+ };
930
+ protoOf(LoanApi).indexLoanLog = function (companyId, loanId, fields, pageToken, autoPaginate, count) {
931
+ var tmp = this;
932
+ return promisify(function ($completion) {
933
+ return tmp.indexLoanLog$default_atdzul_k$(companyId, loanId, fields, pageToken, autoPaginate, count, $completion);
934
+ });
935
+ };
936
+ protoOf(LoanApi).indexLoanLog$suspendBridge_8dtsje_k$ = function (companyId, loanId, fields, pageToken, autoPaginate, count, $completion) {
937
+ var tmp = new $indexLoanLog$suspendBridgeCOROUTINE$(this, companyId, loanId, fields, pageToken, autoPaginate, count, $completion);
938
+ tmp.result_1 = Unit_instance;
939
+ tmp.exception_1 = null;
940
+ return tmp.doResume_5yljmg_k$();
941
+ };
942
+ protoOf(LoanApi).indexLoans_ii9csp_k$ = function (companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion) {
943
+ return indexLoansOperation_0(this, companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion);
944
+ };
945
+ protoOf(LoanApi).indexLoans$default_qi5mkl_k$ = function (companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion, $super) {
946
+ active = active === VOID ? null : active;
947
+ search = search === VOID ? null : search;
948
+ startDateFrom = startDateFrom === VOID ? null : startDateFrom;
949
+ startDateTo = startDateTo === VOID ? null : startDateTo;
950
+ endDateFrom = endDateFrom === VOID ? null : endDateFrom;
951
+ endDateTo = endDateTo === VOID ? null : endDateTo;
952
+ fields = fields === VOID ? null : fields;
953
+ pageToken = pageToken === VOID ? null : pageToken;
954
+ autoPaginate = autoPaginate === VOID ? null : autoPaginate;
955
+ count = count === VOID ? null : count;
956
+ return $super === VOID ? this.indexLoans_ii9csp_k$(companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion) : $super.indexLoans_ii9csp_k$.call(this, companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion);
957
+ };
958
+ protoOf(LoanApi).indexLoans = function (companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count) {
959
+ var tmp = this;
960
+ return promisify(function ($completion) {
961
+ return tmp.indexLoans$default_qi5mkl_k$(companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion);
962
+ });
963
+ };
964
+ protoOf(LoanApi).indexLoans$suspendBridge_h53u6g_k$ = function (companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion) {
965
+ var tmp = new $indexLoans$suspendBridgeCOROUTINE$(this, companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion);
966
+ tmp.result_1 = Unit_instance;
967
+ tmp.exception_1 = null;
968
+ return tmp.doResume_5yljmg_k$();
969
+ };
970
+ protoOf(LoanApi).indexLoansUser_m4irq5_k$ = function (search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion) {
971
+ return indexLoansUserOperation_0(this, search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion);
972
+ };
973
+ protoOf(LoanApi).indexLoansUser$default_9zom8k_k$ = function (search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion, $super) {
974
+ search = search === VOID ? null : search;
975
+ companyIds = companyIds === VOID ? null : companyIds;
976
+ active = active === VOID ? null : active;
977
+ startDateFrom = startDateFrom === VOID ? null : startDateFrom;
978
+ startDateTo = startDateTo === VOID ? null : startDateTo;
979
+ endDateFrom = endDateFrom === VOID ? null : endDateFrom;
980
+ endDateTo = endDateTo === VOID ? null : endDateTo;
981
+ fields = fields === VOID ? null : fields;
982
+ pageToken = pageToken === VOID ? null : pageToken;
983
+ autoPaginate = autoPaginate === VOID ? null : autoPaginate;
984
+ count = count === VOID ? null : count;
985
+ return $super === VOID ? this.indexLoansUser_m4irq5_k$(search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion) : $super.indexLoansUser_m4irq5_k$.call(this, search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion);
986
+ };
987
+ protoOf(LoanApi).indexLoansUser = function (search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count) {
988
+ var tmp = this;
989
+ return promisify(function ($completion) {
990
+ return tmp.indexLoansUser$default_9zom8k_k$(search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion);
991
+ });
992
+ };
993
+ protoOf(LoanApi).indexLoansUser$suspendBridge_pvzcim_k$ = function (search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion) {
994
+ var tmp = new $indexLoansUser$suspendBridgeCOROUTINE$(this, search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion);
995
+ tmp.result_1 = Unit_instance;
996
+ tmp.exception_1 = null;
997
+ return tmp.doResume_5yljmg_k$();
998
+ };
999
+ protoOf(LoanApi).showLoan_go22zh_k$ = function (companyId, loanId, fields, $completion) {
1000
+ return showLoanOperation_0(this, companyId, loanId, fields, $completion);
1001
+ };
1002
+ protoOf(LoanApi).showLoan$default_590974_k$ = function (companyId, loanId, fields, $completion, $super) {
1003
+ fields = fields === VOID ? null : fields;
1004
+ return $super === VOID ? this.showLoan_go22zh_k$(companyId, loanId, fields, $completion) : $super.showLoan_go22zh_k$.call(this, companyId, loanId, fields, $completion);
1005
+ };
1006
+ protoOf(LoanApi).showLoan = function (companyId, loanId, fields) {
1007
+ var tmp = this;
1008
+ return promisify(function ($completion) {
1009
+ return tmp.showLoan$default_590974_k$(companyId, loanId, fields, $completion);
1010
+ });
1011
+ };
1012
+ protoOf(LoanApi).showLoan$suspendBridge_qtu9uk_k$ = function (companyId, loanId, fields, $completion) {
1013
+ var tmp = new $showLoan$suspendBridgeCOROUTINE$(this, companyId, loanId, fields, $completion);
1014
+ tmp.result_1 = Unit_instance;
1015
+ tmp.exception_1 = null;
1016
+ return tmp.doResume_5yljmg_k$();
1017
+ };
1018
+ protoOf(LoanApi).updateLoan_2fb142_k$ = function (companyId, loanId, closeLoanCommand, $completion) {
1019
+ return updateLoanOperation_0(this, companyId, loanId, closeLoanCommand, $completion);
1020
+ };
1021
+ protoOf(LoanApi).updateLoan = function (companyId, loanId, closeLoanCommand) {
1022
+ var tmp = this;
1023
+ return promisify(function ($completion) {
1024
+ return tmp.updateLoan_2fb142_k$(companyId, loanId, closeLoanCommand, $completion);
1025
+ });
1026
+ };
1027
+ protoOf(LoanApi).updateLoan$suspendBridge_lzgpj5_k$ = function (companyId, loanId, closeLoanCommand, $completion) {
1028
+ var tmp = new $updateLoan$suspendBridgeCOROUTINE$(this, companyId, loanId, closeLoanCommand, $completion);
1029
+ tmp.result_1 = Unit_instance;
1030
+ tmp.exception_1 = null;
1031
+ return tmp.doResume_5yljmg_k$();
1032
+ };
1033
+ protoOf(LoanApi).updateLoanAgreement_miylnt_k$ = function (companyId, loanId, addAgreementDocumentToLoanCommand, $completion) {
1034
+ return updateLoanAgreementOperation_0(this, companyId, loanId, addAgreementDocumentToLoanCommand, $completion);
1035
+ };
1036
+ protoOf(LoanApi).updateLoanAgreement = function (companyId, loanId, addAgreementDocumentToLoanCommand) {
1037
+ var tmp = this;
1038
+ return promisify(function ($completion) {
1039
+ return tmp.updateLoanAgreement_miylnt_k$(companyId, loanId, addAgreementDocumentToLoanCommand, $completion);
1040
+ });
1041
+ };
1042
+ protoOf(LoanApi).updateLoanAgreement$suspendBridge_6rces8_k$ = function (companyId, loanId, addAgreementDocumentToLoanCommand, $completion) {
1043
+ var tmp = new $updateLoanAgreement$suspendBridgeCOROUTINE$(this, companyId, loanId, addAgreementDocumentToLoanCommand, $completion);
1044
+ tmp.result_1 = Unit_instance;
1045
+ tmp.exception_1 = null;
1046
+ return tmp.doResume_5yljmg_k$();
1047
+ };
1048
+ protoOf(LoanApi).updateLoanIN_rdgr4h_k$ = function (companyId, loanId, updateINAgreementCommand, $completion) {
1049
+ return updateLoanINOperation_0(this, companyId, loanId, updateINAgreementCommand, $completion);
1050
+ };
1051
+ protoOf(LoanApi).updateLoanIN = function (companyId, loanId, updateINAgreementCommand) {
1052
+ var tmp = this;
1053
+ return promisify(function ($completion) {
1054
+ return tmp.updateLoanIN_rdgr4h_k$(companyId, loanId, updateINAgreementCommand, $completion);
1055
+ });
1056
+ };
1057
+ protoOf(LoanApi).updateLoanIN$suspendBridge_mt40ls_k$ = function (companyId, loanId, updateINAgreementCommand, $completion) {
1058
+ var tmp = new $updateLoanIN$suspendBridgeCOROUTINE$(this, companyId, loanId, updateINAgreementCommand, $completion);
1059
+ tmp.result_1 = Unit_instance;
1060
+ tmp.exception_1 = null;
1061
+ return tmp.doResume_5yljmg_k$();
1062
+ };
1063
+ protoOf(LoanApi).updateLoanInterest_lgs6fx_k$ = function (companyId, loanId, updateLoanInterestCommand, $completion) {
1064
+ return updateLoanInterestOperation_0(this, companyId, loanId, updateLoanInterestCommand, $completion);
1065
+ };
1066
+ protoOf(LoanApi).updateLoanInterest = function (companyId, loanId, updateLoanInterestCommand) {
1067
+ var tmp = this;
1068
+ return promisify(function ($completion) {
1069
+ return tmp.updateLoanInterest_lgs6fx_k$(companyId, loanId, updateLoanInterestCommand, $completion);
1070
+ });
1071
+ };
1072
+ protoOf(LoanApi).updateLoanInterest$suspendBridge_pmlc0u_k$ = function (companyId, loanId, updateLoanInterestCommand, $completion) {
1073
+ var tmp = new $updateLoanInterest$suspendBridgeCOROUTINE$(this, companyId, loanId, updateLoanInterestCommand, $completion);
1074
+ tmp.result_1 = Unit_instance;
1075
+ tmp.exception_1 = null;
1076
+ return tmp.doResume_5yljmg_k$();
1077
+ };
1078
+ function LoanApi() {
1079
+ }
1080
+ function correctLoanDetailsOperation(client, companyId, loanId, updateLoanCommand) {
1081
+ return promisify(function ($completion) {
1082
+ return correctLoanDetailsOperation_0(client, companyId, loanId, updateLoanCommand, $completion);
1083
+ });
1084
+ }
1085
+ function correctLoanDetailsOperation_0(client, companyId, loanId, updateLoanCommand, $completion) {
1086
+ var tmp = new $correctLoanDetailsOperationCOROUTINE$(client, companyId, loanId, updateLoanCommand, $completion);
1087
+ tmp.result_1 = Unit_instance;
1088
+ tmp.exception_1 = null;
1089
+ return tmp.doResume_5yljmg_k$();
1090
+ }
1091
+ function $correctLoanDetailsOperationCOROUTINE$(client, companyId, loanId, updateLoanCommand, resultContinuation) {
1092
+ CoroutineImpl.call(this, resultContinuation);
1093
+ this.client_1 = client;
1094
+ this.companyId_1 = companyId;
1095
+ this.loanId_1 = loanId;
1096
+ this.updateLoanCommand_1 = updateLoanCommand;
1097
+ }
1098
+ protoOf($correctLoanDetailsOperationCOROUTINE$).doResume_5yljmg_k$ = function () {
1099
+ var suspendResult = this.result_1;
1100
+ $sm: do
1101
+ try {
1102
+ var tmp = this.state_1;
1103
+ switch (tmp) {
1104
+ case 0:
1105
+ this.exceptionState_1 = 2;
1106
+ var localVariableAuthNames = listOf(['cognito', 'cognito-direct']);
1107
+ var localVariableBody = this.updateLoanCommand_1;
1108
+ var localVariableQuery = LinkedHashMap_init_$Create$();
1109
+ var localVariableHeaders = LinkedHashMap_init_$Create$();
1110
+ var tmp0_method = RequestMethod_PUT_getInstance();
1111
+ var tmp1_path = replace(replace('/companies/{companyId}/economy/loans/{loanId}', '{companyId}', this.companyId_1.toString()), '{loanId}', this.loanId_1.toString());
1112
+ var localVariableConfig = new RequestConfig(tmp0_method, tmp1_path, localVariableHeaders, VOID, localVariableQuery, true);
1113
+ this.state_1 = 1;
1114
+ suspendResult = this.client_1.executeJsonRequest_99yh5u_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
1115
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1116
+ return suspendResult;
1152
1117
  }
1153
1118
 
1154
1119
  continue $sm;
1155
1120
  case 1:
1156
1121
  var this_0 = suspendResult;
1157
- var tmp_0 = getKClass(PagedListLoan);
1158
- var tmp_1 = null instanceof PagedListLoan;
1122
+ var tmp_0 = getKClass(Loan);
1123
+ var tmp_1 = null instanceof Loan;
1159
1124
  var tmp_2;
1160
1125
  try {
1161
- tmp_2 = createKType(getKClass(PagedListLoan), arrayOf([]), false);
1126
+ tmp_2 = createKType(getKClass(Loan), arrayOf([]), false);
1162
1127
  } catch ($p) {
1163
1128
  var tmp_3;
1164
1129
  if ($p instanceof Error) {
@@ -1185,77 +1150,24 @@ protoOf($indexLoansUserCOROUTINE$).doResume_5yljmg_k$ = function () {
1185
1150
  }
1186
1151
  while (true);
1187
1152
  };
1188
- function $indexLoansUser$suspendBridgeCOROUTINE$(_this__u8e3s4, search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, resultContinuation) {
1189
- CoroutineImpl.call(this, resultContinuation);
1190
- this._this__u8e3s4__1 = _this__u8e3s4;
1191
- this.search_1 = search;
1192
- this.companyIds_1 = companyIds;
1193
- this.active_1 = active;
1194
- this.startDateFrom_1 = startDateFrom;
1195
- this.startDateTo_1 = startDateTo;
1196
- this.endDateFrom_1 = endDateFrom;
1197
- this.endDateTo_1 = endDateTo;
1198
- this.fields_1 = fields;
1199
- this.pageToken_1 = pageToken;
1200
- this.autoPaginate_1 = autoPaginate;
1201
- this.count_1 = count;
1153
+ function createLoanOperation(client, companyId, createLoanCommand) {
1154
+ return promisify(function ($completion) {
1155
+ return createLoanOperation_0(client, companyId, createLoanCommand, $completion);
1156
+ });
1202
1157
  }
1203
- protoOf($indexLoansUser$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
1204
- var suspendResult = this.result_1;
1205
- $sm: do
1206
- try {
1207
- var tmp = this.state_1;
1208
- switch (tmp) {
1209
- case 0:
1210
- this.exceptionState_1 = 4;
1211
- if (this._this__u8e3s4__1.indexLoansUser === protoOf(LoanApi).indexLoansUser) {
1212
- this.state_1 = 2;
1213
- suspendResult = this._this__u8e3s4__1.indexLoansUser$default_9zom8k_k$(this.search_1, this.companyIds_1, this.active_1, this.startDateFrom_1, this.startDateTo_1, this.endDateFrom_1, this.endDateTo_1, this.fields_1, this.pageToken_1, this.autoPaginate_1, this.count_1, this);
1214
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
1215
- return suspendResult;
1216
- }
1217
- continue $sm;
1218
- } else {
1219
- this.state_1 = 1;
1220
- suspendResult = await_0(this._this__u8e3s4__1.indexLoansUser(this.search_1, this.companyIds_1, this.active_1, this.startDateFrom_1, this.startDateTo_1, this.endDateFrom_1, this.endDateTo_1, this.fields_1, this.pageToken_1, this.autoPaginate_1, this.count_1), this);
1221
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
1222
- return suspendResult;
1223
- }
1224
- continue $sm;
1225
- }
1226
-
1227
- case 1:
1228
- this.WHEN_RESULT0__1 = suspendResult;
1229
- this.state_1 = 3;
1230
- continue $sm;
1231
- case 2:
1232
- this.WHEN_RESULT0__1 = suspendResult;
1233
- this.state_1 = 3;
1234
- continue $sm;
1235
- case 3:
1236
- return this.WHEN_RESULT0__1;
1237
- case 4:
1238
- throw this.exception_1;
1239
- }
1240
- } catch ($p) {
1241
- var e = $p;
1242
- if (this.exceptionState_1 === 4) {
1243
- throw e;
1244
- } else {
1245
- this.state_1 = this.exceptionState_1;
1246
- this.exception_1 = e;
1247
- }
1248
- }
1249
- while (true);
1250
- };
1251
- function $showLoanCOROUTINE$(_this__u8e3s4, companyId, loanId, fields, resultContinuation) {
1158
+ function createLoanOperation_0(client, companyId, createLoanCommand, $completion) {
1159
+ var tmp = new $createLoanOperationCOROUTINE$(client, companyId, createLoanCommand, $completion);
1160
+ tmp.result_1 = Unit_instance;
1161
+ tmp.exception_1 = null;
1162
+ return tmp.doResume_5yljmg_k$();
1163
+ }
1164
+ function $createLoanOperationCOROUTINE$(client, companyId, createLoanCommand, resultContinuation) {
1252
1165
  CoroutineImpl.call(this, resultContinuation);
1253
- this._this__u8e3s4__1 = _this__u8e3s4;
1166
+ this.client_1 = client;
1254
1167
  this.companyId_1 = companyId;
1255
- this.loanId_1 = loanId;
1256
- this.fields_1 = fields;
1168
+ this.createLoanCommand_1 = createLoanCommand;
1257
1169
  }
1258
- protoOf($showLoanCOROUTINE$).doResume_5yljmg_k$ = function () {
1170
+ protoOf($createLoanOperationCOROUTINE$).doResume_5yljmg_k$ = function () {
1259
1171
  var suspendResult = this.result_1;
1260
1172
  $sm: do
1261
1173
  try {
@@ -1264,21 +1176,14 @@ protoOf($showLoanCOROUTINE$).doResume_5yljmg_k$ = function () {
1264
1176
  case 0:
1265
1177
  this.exceptionState_1 = 2;
1266
1178
  var localVariableAuthNames = listOf(['cognito', 'cognito-direct']);
1267
- var localVariableBody = EmptyContent_getInstance();
1179
+ var localVariableBody = this.createLoanCommand_1;
1268
1180
  var localVariableQuery = LinkedHashMap_init_$Create$();
1269
- if (this.fields_1 == null)
1270
- null;
1271
- else {
1272
- var value = listOf_0(this.fields_1);
1273
- localVariableQuery.put_4fpzoq_k$('fields', value);
1274
- }
1275
-
1276
1181
  var localVariableHeaders = LinkedHashMap_init_$Create$();
1277
- var tmp1_method = RequestMethod_GET_getInstance();
1278
- var tmp2_path = replace(replace('/companies/{companyId}/economy/loans/{loanId}', '{companyId}', this.companyId_1.toString()), '{loanId}', this.loanId_1.toString());
1279
- var localVariableConfig = new RequestConfig(tmp1_method, tmp2_path, localVariableHeaders, VOID, localVariableQuery, true);
1182
+ var tmp0_method = RequestMethod_POST_getInstance();
1183
+ var tmp1_path = replace('/companies/{companyId}/economy/loans', '{companyId}', this.companyId_1.toString());
1184
+ var localVariableConfig = new RequestConfig(tmp0_method, tmp1_path, localVariableHeaders, VOID, localVariableQuery, true);
1280
1185
  this.state_1 = 1;
1281
- suspendResult = this._this__u8e3s4__1.request$suspendBridge_gbq0ws_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
1186
+ suspendResult = this.client_1.executeJsonRequest_99yh5u_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
1282
1187
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
1283
1188
  return suspendResult;
1284
1189
  }
@@ -1317,53 +1222,70 @@ protoOf($showLoanCOROUTINE$).doResume_5yljmg_k$ = function () {
1317
1222
  }
1318
1223
  while (true);
1319
1224
  };
1320
- function $showLoan$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, loanId, fields, resultContinuation) {
1225
+ function deleteLoanOperation(client, companyId, loanId) {
1226
+ return promisify(function ($completion) {
1227
+ return deleteLoanOperation_0(client, companyId, loanId, $completion);
1228
+ });
1229
+ }
1230
+ function deleteLoanOperation_0(client, companyId, loanId, $completion) {
1231
+ var tmp = new $deleteLoanOperationCOROUTINE$(client, companyId, loanId, $completion);
1232
+ tmp.result_1 = Unit_instance;
1233
+ tmp.exception_1 = null;
1234
+ return tmp.doResume_5yljmg_k$();
1235
+ }
1236
+ function $deleteLoanOperationCOROUTINE$(client, companyId, loanId, resultContinuation) {
1321
1237
  CoroutineImpl.call(this, resultContinuation);
1322
- this._this__u8e3s4__1 = _this__u8e3s4;
1238
+ this.client_1 = client;
1323
1239
  this.companyId_1 = companyId;
1324
1240
  this.loanId_1 = loanId;
1325
- this.fields_1 = fields;
1326
1241
  }
1327
- protoOf($showLoan$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
1242
+ protoOf($deleteLoanOperationCOROUTINE$).doResume_5yljmg_k$ = function () {
1328
1243
  var suspendResult = this.result_1;
1329
1244
  $sm: do
1330
1245
  try {
1331
1246
  var tmp = this.state_1;
1332
1247
  switch (tmp) {
1333
1248
  case 0:
1334
- this.exceptionState_1 = 4;
1335
- if (this._this__u8e3s4__1.showLoan === protoOf(LoanApi).showLoan) {
1336
- this.state_1 = 2;
1337
- suspendResult = this._this__u8e3s4__1.showLoan$default_590974_k$(this.companyId_1, this.loanId_1, this.fields_1, this);
1338
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
1339
- return suspendResult;
1340
- }
1341
- continue $sm;
1342
- } else {
1343
- this.state_1 = 1;
1344
- suspendResult = await_0(this._this__u8e3s4__1.showLoan(this.companyId_1, this.loanId_1, this.fields_1), this);
1345
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
1346
- return suspendResult;
1347
- }
1348
- continue $sm;
1249
+ this.exceptionState_1 = 2;
1250
+ var localVariableAuthNames = listOf(['cognito', 'cognito-direct']);
1251
+ var localVariableBody = EmptyContent_getInstance();
1252
+ var localVariableQuery = LinkedHashMap_init_$Create$();
1253
+ var localVariableHeaders = LinkedHashMap_init_$Create$();
1254
+ var tmp0_method = RequestMethod_DELETE_getInstance();
1255
+ var tmp1_path = replace(replace('/companies/{companyId}/economy/loans/{loanId}', '{companyId}', this.companyId_1.toString()), '{loanId}', this.loanId_1.toString());
1256
+ var localVariableConfig = new RequestConfig(tmp0_method, tmp1_path, localVariableHeaders, VOID, localVariableQuery, true);
1257
+ this.state_1 = 1;
1258
+ suspendResult = this.client_1.executeRequest_c2mqzq_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
1259
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1260
+ return suspendResult;
1349
1261
  }
1350
1262
 
1351
- case 1:
1352
- this.WHEN_RESULT0__1 = suspendResult;
1353
- this.state_1 = 3;
1354
1263
  continue $sm;
1264
+ case 1:
1265
+ var this_0 = suspendResult;
1266
+ var tmp_0 = getKClass(Unit);
1267
+ var tmp_1 = null instanceof Unit;
1268
+ var tmp_2;
1269
+ try {
1270
+ tmp_2 = createKType(getKClass(Unit), arrayOf([]), false);
1271
+ } catch ($p) {
1272
+ var tmp_3;
1273
+ if ($p instanceof Error) {
1274
+ var _unused_var__etf5q3 = $p;
1275
+ tmp_3 = null;
1276
+ } else {
1277
+ throw $p;
1278
+ }
1279
+ tmp_2 = tmp_3;
1280
+ }
1281
+
1282
+ return new HttpResponse(this_0, new TypedBodyProvider(new TypeInfo(tmp_0, tmp_1, tmp_2)));
1355
1283
  case 2:
1356
- this.WHEN_RESULT0__1 = suspendResult;
1357
- this.state_1 = 3;
1358
- continue $sm;
1359
- case 3:
1360
- return this.WHEN_RESULT0__1;
1361
- case 4:
1362
1284
  throw this.exception_1;
1363
1285
  }
1364
- } catch ($p) {
1365
- var e = $p;
1366
- if (this.exceptionState_1 === 4) {
1286
+ } catch ($p_0) {
1287
+ var e = $p_0;
1288
+ if (this.exceptionState_1 === 2) {
1367
1289
  throw e;
1368
1290
  } else {
1369
1291
  this.state_1 = this.exceptionState_1;
@@ -1372,14 +1294,31 @@ protoOf($showLoan$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
1372
1294
  }
1373
1295
  while (true);
1374
1296
  };
1375
- function $updateLoanCOROUTINE$(_this__u8e3s4, companyId, loanId, closeLoanCommand, resultContinuation) {
1297
+ function indexLoanAccountsOperation(client, companyId, fields, pageToken, autoPaginate, count) {
1298
+ return promisify(function ($completion) {
1299
+ return indexLoanAccountsOperation_0(client, companyId, fields, pageToken, autoPaginate, count, $completion);
1300
+ });
1301
+ }
1302
+ function indexLoanAccountsOperation_0(client, companyId, fields, pageToken, autoPaginate, count, $completion) {
1303
+ fields = fields === VOID ? null : fields;
1304
+ pageToken = pageToken === VOID ? null : pageToken;
1305
+ autoPaginate = autoPaginate === VOID ? null : autoPaginate;
1306
+ count = count === VOID ? null : count;
1307
+ var tmp = new $indexLoanAccountsOperationCOROUTINE$(client, companyId, fields, pageToken, autoPaginate, count, $completion);
1308
+ tmp.result_1 = Unit_instance;
1309
+ tmp.exception_1 = null;
1310
+ return tmp.doResume_5yljmg_k$();
1311
+ }
1312
+ function $indexLoanAccountsOperationCOROUTINE$(client, companyId, fields, pageToken, autoPaginate, count, resultContinuation) {
1376
1313
  CoroutineImpl.call(this, resultContinuation);
1377
- this._this__u8e3s4__1 = _this__u8e3s4;
1314
+ this.client_1 = client;
1378
1315
  this.companyId_1 = companyId;
1379
- this.loanId_1 = loanId;
1380
- this.closeLoanCommand_1 = closeLoanCommand;
1316
+ this.fields_1 = fields;
1317
+ this.pageToken_1 = pageToken;
1318
+ this.autoPaginate_1 = autoPaginate;
1319
+ this.count_1 = count;
1381
1320
  }
1382
- protoOf($updateLoanCOROUTINE$).doResume_5yljmg_k$ = function () {
1321
+ protoOf($indexLoanAccountsOperationCOROUTINE$).doResume_5yljmg_k$ = function () {
1383
1322
  var suspendResult = this.result_1;
1384
1323
  $sm: do
1385
1324
  try {
@@ -1388,14 +1327,44 @@ protoOf($updateLoanCOROUTINE$).doResume_5yljmg_k$ = function () {
1388
1327
  case 0:
1389
1328
  this.exceptionState_1 = 2;
1390
1329
  var localVariableAuthNames = listOf(['cognito', 'cognito-direct']);
1391
- var localVariableBody = this.closeLoanCommand_1;
1330
+ var localVariableBody = EmptyContent_getInstance();
1392
1331
  var localVariableQuery = LinkedHashMap_init_$Create$();
1332
+ if (this.fields_1 == null)
1333
+ null;
1334
+ else {
1335
+ var value = listOf_0(this.fields_1);
1336
+ localVariableQuery.put_4fpzoq_k$('fields', value);
1337
+ }
1338
+
1339
+ if (this.pageToken_1 == null)
1340
+ null;
1341
+ else {
1342
+ var tmp2 = 'pageToken';
1343
+ var value_0 = listOf_0(this.pageToken_1);
1344
+ localVariableQuery.put_4fpzoq_k$(tmp2, value_0);
1345
+ }
1346
+
1347
+ if (this.autoPaginate_1 == null)
1348
+ null;
1349
+ else {
1350
+ var tmp2_0 = 'autoPaginate';
1351
+ var value_1 = listOf_0('' + this.autoPaginate_1);
1352
+ localVariableQuery.put_4fpzoq_k$(tmp2_0, value_1);
1353
+ }
1354
+
1355
+ if (this.count_1 == null)
1356
+ null;
1357
+ else {
1358
+ var value_2 = listOf_0('' + this.count_1);
1359
+ localVariableQuery.put_4fpzoq_k$('count', value_2);
1360
+ }
1361
+
1393
1362
  var localVariableHeaders = LinkedHashMap_init_$Create$();
1394
- var tmp0_method = RequestMethod_PUT_getInstance();
1395
- var tmp1_path = replace(replace('/companies/{companyId}/economy/loans/{loanId}/close', '{companyId}', this.companyId_1.toString()), '{loanId}', this.loanId_1.toString());
1396
- var localVariableConfig = new RequestConfig(tmp0_method, tmp1_path, localVariableHeaders, VOID, localVariableQuery, true);
1363
+ var tmp4_method = RequestMethod_GET_getInstance();
1364
+ var tmp5_path = replace('/companies/{companyId}/economy/loans/accounts', '{companyId}', this.companyId_1.toString());
1365
+ var localVariableConfig = new RequestConfig(tmp4_method, tmp5_path, localVariableHeaders, VOID, localVariableQuery, true);
1397
1366
  this.state_1 = 1;
1398
- suspendResult = this._this__u8e3s4__1.jsonRequest$suspendBridge_ao9kpg_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
1367
+ suspendResult = this.client_1.executeRequest_c2mqzq_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
1399
1368
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
1400
1369
  return suspendResult;
1401
1370
  }
@@ -1403,11 +1372,11 @@ protoOf($updateLoanCOROUTINE$).doResume_5yljmg_k$ = function () {
1403
1372
  continue $sm;
1404
1373
  case 1:
1405
1374
  var this_0 = suspendResult;
1406
- var tmp_0 = getKClass(Loan);
1407
- var tmp_1 = null instanceof Loan;
1375
+ var tmp_0 = getKClass(PagedListAccount);
1376
+ var tmp_1 = null instanceof PagedListAccount;
1408
1377
  var tmp_2;
1409
1378
  try {
1410
- tmp_2 = createKType(getKClass(Loan), arrayOf([]), false);
1379
+ tmp_2 = createKType(getKClass(PagedListAccount), arrayOf([]), false);
1411
1380
  } catch ($p) {
1412
1381
  var tmp_3;
1413
1382
  if ($p instanceof Error) {
@@ -1434,69 +1403,32 @@ protoOf($updateLoanCOROUTINE$).doResume_5yljmg_k$ = function () {
1434
1403
  }
1435
1404
  while (true);
1436
1405
  };
1437
- function $updateLoan$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, loanId, closeLoanCommand, resultContinuation) {
1406
+ function indexLoanLogOperation(client, companyId, loanId, fields, pageToken, autoPaginate, count) {
1407
+ return promisify(function ($completion) {
1408
+ return indexLoanLogOperation_0(client, companyId, loanId, fields, pageToken, autoPaginate, count, $completion);
1409
+ });
1410
+ }
1411
+ function indexLoanLogOperation_0(client, companyId, loanId, fields, pageToken, autoPaginate, count, $completion) {
1412
+ fields = fields === VOID ? null : fields;
1413
+ pageToken = pageToken === VOID ? null : pageToken;
1414
+ autoPaginate = autoPaginate === VOID ? null : autoPaginate;
1415
+ count = count === VOID ? null : count;
1416
+ var tmp = new $indexLoanLogOperationCOROUTINE$(client, companyId, loanId, fields, pageToken, autoPaginate, count, $completion);
1417
+ tmp.result_1 = Unit_instance;
1418
+ tmp.exception_1 = null;
1419
+ return tmp.doResume_5yljmg_k$();
1420
+ }
1421
+ function $indexLoanLogOperationCOROUTINE$(client, companyId, loanId, fields, pageToken, autoPaginate, count, resultContinuation) {
1438
1422
  CoroutineImpl.call(this, resultContinuation);
1439
- this._this__u8e3s4__1 = _this__u8e3s4;
1423
+ this.client_1 = client;
1440
1424
  this.companyId_1 = companyId;
1441
1425
  this.loanId_1 = loanId;
1442
- this.closeLoanCommand_1 = closeLoanCommand;
1426
+ this.fields_1 = fields;
1427
+ this.pageToken_1 = pageToken;
1428
+ this.autoPaginate_1 = autoPaginate;
1429
+ this.count_1 = count;
1443
1430
  }
1444
- protoOf($updateLoan$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
1445
- var suspendResult = this.result_1;
1446
- $sm: do
1447
- try {
1448
- var tmp = this.state_1;
1449
- switch (tmp) {
1450
- case 0:
1451
- this.exceptionState_1 = 4;
1452
- if (this._this__u8e3s4__1.updateLoan === protoOf(LoanApi).updateLoan) {
1453
- this.state_1 = 2;
1454
- suspendResult = this._this__u8e3s4__1.updateLoan_2fb142_k$(this.companyId_1, this.loanId_1, this.closeLoanCommand_1, this);
1455
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
1456
- return suspendResult;
1457
- }
1458
- continue $sm;
1459
- } else {
1460
- this.state_1 = 1;
1461
- suspendResult = await_0(this._this__u8e3s4__1.updateLoan(this.companyId_1, this.loanId_1, this.closeLoanCommand_1), this);
1462
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
1463
- return suspendResult;
1464
- }
1465
- continue $sm;
1466
- }
1467
-
1468
- case 1:
1469
- this.WHEN_RESULT0__1 = suspendResult;
1470
- this.state_1 = 3;
1471
- continue $sm;
1472
- case 2:
1473
- this.WHEN_RESULT0__1 = suspendResult;
1474
- this.state_1 = 3;
1475
- continue $sm;
1476
- case 3:
1477
- return this.WHEN_RESULT0__1;
1478
- case 4:
1479
- throw this.exception_1;
1480
- }
1481
- } catch ($p) {
1482
- var e = $p;
1483
- if (this.exceptionState_1 === 4) {
1484
- throw e;
1485
- } else {
1486
- this.state_1 = this.exceptionState_1;
1487
- this.exception_1 = e;
1488
- }
1489
- }
1490
- while (true);
1491
- };
1492
- function $updateLoanAgreementCOROUTINE$(_this__u8e3s4, companyId, loanId, addAgreementDocumentToLoanCommand, resultContinuation) {
1493
- CoroutineImpl.call(this, resultContinuation);
1494
- this._this__u8e3s4__1 = _this__u8e3s4;
1495
- this.companyId_1 = companyId;
1496
- this.loanId_1 = loanId;
1497
- this.addAgreementDocumentToLoanCommand_1 = addAgreementDocumentToLoanCommand;
1498
- }
1499
- protoOf($updateLoanAgreementCOROUTINE$).doResume_5yljmg_k$ = function () {
1431
+ protoOf($indexLoanLogOperationCOROUTINE$).doResume_5yljmg_k$ = function () {
1500
1432
  var suspendResult = this.result_1;
1501
1433
  $sm: do
1502
1434
  try {
@@ -1505,14 +1437,44 @@ protoOf($updateLoanAgreementCOROUTINE$).doResume_5yljmg_k$ = function () {
1505
1437
  case 0:
1506
1438
  this.exceptionState_1 = 2;
1507
1439
  var localVariableAuthNames = listOf(['cognito', 'cognito-direct']);
1508
- var localVariableBody = this.addAgreementDocumentToLoanCommand_1;
1440
+ var localVariableBody = EmptyContent_getInstance();
1509
1441
  var localVariableQuery = LinkedHashMap_init_$Create$();
1442
+ if (this.fields_1 == null)
1443
+ null;
1444
+ else {
1445
+ var value = listOf_0(this.fields_1);
1446
+ localVariableQuery.put_4fpzoq_k$('fields', value);
1447
+ }
1448
+
1449
+ if (this.pageToken_1 == null)
1450
+ null;
1451
+ else {
1452
+ var tmp2 = 'pageToken';
1453
+ var value_0 = listOf_0(this.pageToken_1);
1454
+ localVariableQuery.put_4fpzoq_k$(tmp2, value_0);
1455
+ }
1456
+
1457
+ if (this.autoPaginate_1 == null)
1458
+ null;
1459
+ else {
1460
+ var tmp2_0 = 'autoPaginate';
1461
+ var value_1 = listOf_0('' + this.autoPaginate_1);
1462
+ localVariableQuery.put_4fpzoq_k$(tmp2_0, value_1);
1463
+ }
1464
+
1465
+ if (this.count_1 == null)
1466
+ null;
1467
+ else {
1468
+ var value_2 = listOf_0('' + this.count_1);
1469
+ localVariableQuery.put_4fpzoq_k$('count', value_2);
1470
+ }
1471
+
1510
1472
  var localVariableHeaders = LinkedHashMap_init_$Create$();
1511
- var tmp0_method = RequestMethod_PUT_getInstance();
1512
- var tmp1_path = replace(replace('/companies/{companyId}/economy/loans/{loanId}/agreement', '{companyId}', this.companyId_1.toString()), '{loanId}', this.loanId_1.toString());
1513
- var localVariableConfig = new RequestConfig(tmp0_method, tmp1_path, localVariableHeaders, VOID, localVariableQuery, true);
1473
+ var tmp4_method = RequestMethod_GET_getInstance();
1474
+ var tmp5_path = replace(replace('/companies/{companyId}/economy/loans/{loanId}/log', '{companyId}', this.companyId_1.toString()), '{loanId}', this.loanId_1.toString());
1475
+ var localVariableConfig = new RequestConfig(tmp4_method, tmp5_path, localVariableHeaders, VOID, localVariableQuery, true);
1514
1476
  this.state_1 = 1;
1515
- suspendResult = this._this__u8e3s4__1.jsonRequest$suspendBridge_ao9kpg_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
1477
+ suspendResult = this.client_1.executeRequest_c2mqzq_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
1516
1478
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
1517
1479
  return suspendResult;
1518
1480
  }
@@ -1520,11 +1482,11 @@ protoOf($updateLoanAgreementCOROUTINE$).doResume_5yljmg_k$ = function () {
1520
1482
  continue $sm;
1521
1483
  case 1:
1522
1484
  var this_0 = suspendResult;
1523
- var tmp_0 = getKClass(Loan);
1524
- var tmp_1 = null instanceof Loan;
1485
+ var tmp_0 = getKClass(PagedListLoanLog);
1486
+ var tmp_1 = null instanceof PagedListLoanLog;
1525
1487
  var tmp_2;
1526
1488
  try {
1527
- tmp_2 = createKType(getKClass(Loan), arrayOf([]), false);
1489
+ tmp_2 = createKType(getKClass(PagedListLoanLog), arrayOf([]), false);
1528
1490
  } catch ($p) {
1529
1491
  var tmp_3;
1530
1492
  if ($p instanceof Error) {
@@ -1551,69 +1513,43 @@ protoOf($updateLoanAgreementCOROUTINE$).doResume_5yljmg_k$ = function () {
1551
1513
  }
1552
1514
  while (true);
1553
1515
  };
1554
- function $updateLoanAgreement$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, loanId, addAgreementDocumentToLoanCommand, resultContinuation) {
1555
- CoroutineImpl.call(this, resultContinuation);
1556
- this._this__u8e3s4__1 = _this__u8e3s4;
1557
- this.companyId_1 = companyId;
1558
- this.loanId_1 = loanId;
1559
- this.addAgreementDocumentToLoanCommand_1 = addAgreementDocumentToLoanCommand;
1516
+ function indexLoansOperation(client, companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count) {
1517
+ return promisify(function ($completion) {
1518
+ return indexLoansOperation_0(client, companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion);
1519
+ });
1560
1520
  }
1561
- protoOf($updateLoanAgreement$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
1562
- var suspendResult = this.result_1;
1563
- $sm: do
1564
- try {
1565
- var tmp = this.state_1;
1566
- switch (tmp) {
1567
- case 0:
1568
- this.exceptionState_1 = 4;
1569
- if (this._this__u8e3s4__1.updateLoanAgreement === protoOf(LoanApi).updateLoanAgreement) {
1570
- this.state_1 = 2;
1571
- suspendResult = this._this__u8e3s4__1.updateLoanAgreement_miylnt_k$(this.companyId_1, this.loanId_1, this.addAgreementDocumentToLoanCommand_1, this);
1572
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
1573
- return suspendResult;
1574
- }
1575
- continue $sm;
1576
- } else {
1577
- this.state_1 = 1;
1578
- suspendResult = await_0(this._this__u8e3s4__1.updateLoanAgreement(this.companyId_1, this.loanId_1, this.addAgreementDocumentToLoanCommand_1), this);
1579
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
1580
- return suspendResult;
1581
- }
1582
- continue $sm;
1583
- }
1584
-
1585
- case 1:
1586
- this.WHEN_RESULT0__1 = suspendResult;
1587
- this.state_1 = 3;
1588
- continue $sm;
1589
- case 2:
1590
- this.WHEN_RESULT0__1 = suspendResult;
1591
- this.state_1 = 3;
1592
- continue $sm;
1593
- case 3:
1594
- return this.WHEN_RESULT0__1;
1595
- case 4:
1596
- throw this.exception_1;
1597
- }
1598
- } catch ($p) {
1599
- var e = $p;
1600
- if (this.exceptionState_1 === 4) {
1601
- throw e;
1602
- } else {
1603
- this.state_1 = this.exceptionState_1;
1604
- this.exception_1 = e;
1605
- }
1606
- }
1607
- while (true);
1608
- };
1609
- function $updateLoanINCOROUTINE$(_this__u8e3s4, companyId, loanId, updateINAgreementCommand, resultContinuation) {
1521
+ function indexLoansOperation_0(client, companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion) {
1522
+ active = active === VOID ? null : active;
1523
+ search = search === VOID ? null : search;
1524
+ startDateFrom = startDateFrom === VOID ? null : startDateFrom;
1525
+ startDateTo = startDateTo === VOID ? null : startDateTo;
1526
+ endDateFrom = endDateFrom === VOID ? null : endDateFrom;
1527
+ endDateTo = endDateTo === VOID ? null : endDateTo;
1528
+ fields = fields === VOID ? null : fields;
1529
+ pageToken = pageToken === VOID ? null : pageToken;
1530
+ autoPaginate = autoPaginate === VOID ? null : autoPaginate;
1531
+ count = count === VOID ? null : count;
1532
+ var tmp = new $indexLoansOperationCOROUTINE$(client, companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion);
1533
+ tmp.result_1 = Unit_instance;
1534
+ tmp.exception_1 = null;
1535
+ return tmp.doResume_5yljmg_k$();
1536
+ }
1537
+ function $indexLoansOperationCOROUTINE$(client, companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, resultContinuation) {
1610
1538
  CoroutineImpl.call(this, resultContinuation);
1611
- this._this__u8e3s4__1 = _this__u8e3s4;
1539
+ this.client_1 = client;
1612
1540
  this.companyId_1 = companyId;
1613
- this.loanId_1 = loanId;
1614
- this.updateINAgreementCommand_1 = updateINAgreementCommand;
1541
+ this.active_1 = active;
1542
+ this.search_1 = search;
1543
+ this.startDateFrom_1 = startDateFrom;
1544
+ this.startDateTo_1 = startDateTo;
1545
+ this.endDateFrom_1 = endDateFrom;
1546
+ this.endDateTo_1 = endDateTo;
1547
+ this.fields_1 = fields;
1548
+ this.pageToken_1 = pageToken;
1549
+ this.autoPaginate_1 = autoPaginate;
1550
+ this.count_1 = count;
1615
1551
  }
1616
- protoOf($updateLoanINCOROUTINE$).doResume_5yljmg_k$ = function () {
1552
+ protoOf($indexLoansOperationCOROUTINE$).doResume_5yljmg_k$ = function () {
1617
1553
  var suspendResult = this.result_1;
1618
1554
  $sm: do
1619
1555
  try {
@@ -1622,14 +1558,90 @@ protoOf($updateLoanINCOROUTINE$).doResume_5yljmg_k$ = function () {
1622
1558
  case 0:
1623
1559
  this.exceptionState_1 = 2;
1624
1560
  var localVariableAuthNames = listOf(['cognito', 'cognito-direct']);
1625
- var localVariableBody = this.updateINAgreementCommand_1;
1561
+ var localVariableBody = EmptyContent_getInstance();
1626
1562
  var localVariableQuery = LinkedHashMap_init_$Create$();
1563
+ if (this.active_1 == null)
1564
+ null;
1565
+ else {
1566
+ var value = listOf_0('' + this.active_1);
1567
+ localVariableQuery.put_4fpzoq_k$('active', value);
1568
+ }
1569
+
1570
+ if (this.search_1 == null)
1571
+ null;
1572
+ else {
1573
+ var value_0 = listOf_0(this.search_1);
1574
+ localVariableQuery.put_4fpzoq_k$('search', value_0);
1575
+ }
1576
+
1577
+ if (this.startDateFrom_1 == null)
1578
+ null;
1579
+ else {
1580
+ var tmp2 = 'startDateFrom';
1581
+ var value_1 = listOf_0(this.startDateFrom_1.toString());
1582
+ localVariableQuery.put_4fpzoq_k$(tmp2, value_1);
1583
+ }
1584
+
1585
+ if (this.startDateTo_1 == null)
1586
+ null;
1587
+ else {
1588
+ var tmp2_0 = 'startDateTo';
1589
+ var value_2 = listOf_0(this.startDateTo_1.toString());
1590
+ localVariableQuery.put_4fpzoq_k$(tmp2_0, value_2);
1591
+ }
1592
+
1593
+ if (this.endDateFrom_1 == null)
1594
+ null;
1595
+ else {
1596
+ var tmp2_1 = 'endDateFrom';
1597
+ var value_3 = listOf_0(this.endDateFrom_1.toString());
1598
+ localVariableQuery.put_4fpzoq_k$(tmp2_1, value_3);
1599
+ }
1600
+
1601
+ if (this.endDateTo_1 == null)
1602
+ null;
1603
+ else {
1604
+ var tmp2_2 = 'endDateTo';
1605
+ var value_4 = listOf_0(this.endDateTo_1.toString());
1606
+ localVariableQuery.put_4fpzoq_k$(tmp2_2, value_4);
1607
+ }
1608
+
1609
+ if (this.fields_1 == null)
1610
+ null;
1611
+ else {
1612
+ var value_5 = listOf_0(this.fields_1);
1613
+ localVariableQuery.put_4fpzoq_k$('fields', value_5);
1614
+ }
1615
+
1616
+ if (this.pageToken_1 == null)
1617
+ null;
1618
+ else {
1619
+ var tmp2_3 = 'pageToken';
1620
+ var value_6 = listOf_0(this.pageToken_1);
1621
+ localVariableQuery.put_4fpzoq_k$(tmp2_3, value_6);
1622
+ }
1623
+
1624
+ if (this.autoPaginate_1 == null)
1625
+ null;
1626
+ else {
1627
+ var tmp2_4 = 'autoPaginate';
1628
+ var value_7 = listOf_0('' + this.autoPaginate_1);
1629
+ localVariableQuery.put_4fpzoq_k$(tmp2_4, value_7);
1630
+ }
1631
+
1632
+ if (this.count_1 == null)
1633
+ null;
1634
+ else {
1635
+ var value_8 = listOf_0('' + this.count_1);
1636
+ localVariableQuery.put_4fpzoq_k$('count', value_8);
1637
+ }
1638
+
1627
1639
  var localVariableHeaders = LinkedHashMap_init_$Create$();
1628
- var tmp0_method = RequestMethod_PUT_getInstance();
1629
- var tmp1_path = replace(replace('/companies/{companyId}/economy/loans/{loanId}/IN', '{companyId}', this.companyId_1.toString()), '{loanId}', this.loanId_1.toString());
1630
- var localVariableConfig = new RequestConfig(tmp0_method, tmp1_path, localVariableHeaders, VOID, localVariableQuery, true);
1640
+ var tmp10_method = RequestMethod_GET_getInstance();
1641
+ var tmp11_path = replace('/companies/{companyId}/economy/loans', '{companyId}', this.companyId_1.toString());
1642
+ var localVariableConfig = new RequestConfig(tmp10_method, tmp11_path, localVariableHeaders, VOID, localVariableQuery, true);
1631
1643
  this.state_1 = 1;
1632
- suspendResult = this._this__u8e3s4__1.jsonRequest$suspendBridge_ao9kpg_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
1644
+ suspendResult = this.client_1.executeRequest_c2mqzq_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
1633
1645
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
1634
1646
  return suspendResult;
1635
1647
  }
@@ -1637,11 +1649,11 @@ protoOf($updateLoanINCOROUTINE$).doResume_5yljmg_k$ = function () {
1637
1649
  continue $sm;
1638
1650
  case 1:
1639
1651
  var this_0 = suspendResult;
1640
- var tmp_0 = getKClass(Loan);
1641
- var tmp_1 = null instanceof Loan;
1652
+ var tmp_0 = getKClass(PagedListLoan);
1653
+ var tmp_1 = null instanceof PagedListLoan;
1642
1654
  var tmp_2;
1643
1655
  try {
1644
- tmp_2 = createKType(getKClass(Loan), arrayOf([]), false);
1656
+ tmp_2 = createKType(getKClass(PagedListLoan), arrayOf([]), false);
1645
1657
  } catch ($p) {
1646
1658
  var tmp_3;
1647
1659
  if ($p instanceof Error) {
@@ -1668,53 +1680,174 @@ protoOf($updateLoanINCOROUTINE$).doResume_5yljmg_k$ = function () {
1668
1680
  }
1669
1681
  while (true);
1670
1682
  };
1671
- function $updateLoanIN$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, loanId, updateINAgreementCommand, resultContinuation) {
1672
- CoroutineImpl.call(this, resultContinuation);
1673
- this._this__u8e3s4__1 = _this__u8e3s4;
1674
- this.companyId_1 = companyId;
1675
- this.loanId_1 = loanId;
1676
- this.updateINAgreementCommand_1 = updateINAgreementCommand;
1683
+ function indexLoansUserOperation(client, search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count) {
1684
+ return promisify(function ($completion) {
1685
+ return indexLoansUserOperation_0(client, search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion);
1686
+ });
1677
1687
  }
1678
- protoOf($updateLoanIN$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
1688
+ function indexLoansUserOperation_0(client, search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion) {
1689
+ search = search === VOID ? null : search;
1690
+ companyIds = companyIds === VOID ? null : companyIds;
1691
+ active = active === VOID ? null : active;
1692
+ startDateFrom = startDateFrom === VOID ? null : startDateFrom;
1693
+ startDateTo = startDateTo === VOID ? null : startDateTo;
1694
+ endDateFrom = endDateFrom === VOID ? null : endDateFrom;
1695
+ endDateTo = endDateTo === VOID ? null : endDateTo;
1696
+ fields = fields === VOID ? null : fields;
1697
+ pageToken = pageToken === VOID ? null : pageToken;
1698
+ autoPaginate = autoPaginate === VOID ? null : autoPaginate;
1699
+ count = count === VOID ? null : count;
1700
+ var tmp = new $indexLoansUserOperationCOROUTINE$(client, search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion);
1701
+ tmp.result_1 = Unit_instance;
1702
+ tmp.exception_1 = null;
1703
+ return tmp.doResume_5yljmg_k$();
1704
+ }
1705
+ function $indexLoansUserOperationCOROUTINE$(client, search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, resultContinuation) {
1706
+ CoroutineImpl.call(this, resultContinuation);
1707
+ this.client_1 = client;
1708
+ this.search_1 = search;
1709
+ this.companyIds_1 = companyIds;
1710
+ this.active_1 = active;
1711
+ this.startDateFrom_1 = startDateFrom;
1712
+ this.startDateTo_1 = startDateTo;
1713
+ this.endDateFrom_1 = endDateFrom;
1714
+ this.endDateTo_1 = endDateTo;
1715
+ this.fields_1 = fields;
1716
+ this.pageToken_1 = pageToken;
1717
+ this.autoPaginate_1 = autoPaginate;
1718
+ this.count_1 = count;
1719
+ }
1720
+ protoOf($indexLoansUserOperationCOROUTINE$).doResume_5yljmg_k$ = function () {
1679
1721
  var suspendResult = this.result_1;
1680
1722
  $sm: do
1681
1723
  try {
1682
1724
  var tmp = this.state_1;
1683
1725
  switch (tmp) {
1684
1726
  case 0:
1685
- this.exceptionState_1 = 4;
1686
- if (this._this__u8e3s4__1.updateLoanIN === protoOf(LoanApi).updateLoanIN) {
1687
- this.state_1 = 2;
1688
- suspendResult = this._this__u8e3s4__1.updateLoanIN_rdgr4h_k$(this.companyId_1, this.loanId_1, this.updateINAgreementCommand_1, this);
1689
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
1690
- return suspendResult;
1691
- }
1692
- continue $sm;
1693
- } else {
1694
- this.state_1 = 1;
1695
- suspendResult = await_0(this._this__u8e3s4__1.updateLoanIN(this.companyId_1, this.loanId_1, this.updateINAgreementCommand_1), this);
1696
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
1697
- return suspendResult;
1698
- }
1699
- continue $sm;
1727
+ this.exceptionState_1 = 2;
1728
+ var localVariableAuthNames = listOf(['cognito', 'cognito-direct']);
1729
+ var localVariableBody = EmptyContent_getInstance();
1730
+ var localVariableQuery = LinkedHashMap_init_$Create$();
1731
+ if (this.search_1 == null)
1732
+ null;
1733
+ else {
1734
+ var value = listOf_0(this.search_1);
1735
+ localVariableQuery.put_4fpzoq_k$('search', value);
1736
+ }
1737
+
1738
+ var tmp1_safe_receiver = this.companyIds_1;
1739
+ if (tmp1_safe_receiver == null)
1740
+ null;
1741
+ else {
1742
+ var tmp2 = 'companyIds';
1743
+ var value_0 = toMultiValue(tmp1_safe_receiver, 'multi');
1744
+ localVariableQuery.put_4fpzoq_k$(tmp2, value_0);
1745
+ }
1746
+
1747
+ if (this.active_1 == null)
1748
+ null;
1749
+ else {
1750
+ var value_1 = listOf_0('' + this.active_1);
1751
+ localVariableQuery.put_4fpzoq_k$('active', value_1);
1752
+ }
1753
+
1754
+ if (this.startDateFrom_1 == null)
1755
+ null;
1756
+ else {
1757
+ var tmp2_0 = 'startDateFrom';
1758
+ var value_2 = listOf_0(this.startDateFrom_1.toString());
1759
+ localVariableQuery.put_4fpzoq_k$(tmp2_0, value_2);
1760
+ }
1761
+
1762
+ if (this.startDateTo_1 == null)
1763
+ null;
1764
+ else {
1765
+ var tmp2_1 = 'startDateTo';
1766
+ var value_3 = listOf_0(this.startDateTo_1.toString());
1767
+ localVariableQuery.put_4fpzoq_k$(tmp2_1, value_3);
1768
+ }
1769
+
1770
+ if (this.endDateFrom_1 == null)
1771
+ null;
1772
+ else {
1773
+ var tmp2_2 = 'endDateFrom';
1774
+ var value_4 = listOf_0(this.endDateFrom_1.toString());
1775
+ localVariableQuery.put_4fpzoq_k$(tmp2_2, value_4);
1776
+ }
1777
+
1778
+ if (this.endDateTo_1 == null)
1779
+ null;
1780
+ else {
1781
+ var tmp2_3 = 'endDateTo';
1782
+ var value_5 = listOf_0(this.endDateTo_1.toString());
1783
+ localVariableQuery.put_4fpzoq_k$(tmp2_3, value_5);
1784
+ }
1785
+
1786
+ if (this.fields_1 == null)
1787
+ null;
1788
+ else {
1789
+ var value_6 = listOf_0(this.fields_1);
1790
+ localVariableQuery.put_4fpzoq_k$('fields', value_6);
1791
+ }
1792
+
1793
+ if (this.pageToken_1 == null)
1794
+ null;
1795
+ else {
1796
+ var tmp2_4 = 'pageToken';
1797
+ var value_7 = listOf_0(this.pageToken_1);
1798
+ localVariableQuery.put_4fpzoq_k$(tmp2_4, value_7);
1799
+ }
1800
+
1801
+ if (this.autoPaginate_1 == null)
1802
+ null;
1803
+ else {
1804
+ var tmp2_5 = 'autoPaginate';
1805
+ var value_8 = listOf_0('' + this.autoPaginate_1);
1806
+ localVariableQuery.put_4fpzoq_k$(tmp2_5, value_8);
1807
+ }
1808
+
1809
+ if (this.count_1 == null)
1810
+ null;
1811
+ else {
1812
+ var value_9 = listOf_0('' + this.count_1);
1813
+ localVariableQuery.put_4fpzoq_k$('count', value_9);
1814
+ }
1815
+
1816
+ var localVariableHeaders = LinkedHashMap_init_$Create$();
1817
+ var tmp11_method = RequestMethod_GET_getInstance();
1818
+ var localVariableConfig = new RequestConfig(tmp11_method, '/companies/economy/loans', localVariableHeaders, VOID, localVariableQuery, true);
1819
+ this.state_1 = 1;
1820
+ suspendResult = this.client_1.executeRequest_c2mqzq_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
1821
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1822
+ return suspendResult;
1700
1823
  }
1701
1824
 
1702
- case 1:
1703
- this.WHEN_RESULT0__1 = suspendResult;
1704
- this.state_1 = 3;
1705
1825
  continue $sm;
1826
+ case 1:
1827
+ var this_0 = suspendResult;
1828
+ var tmp_0 = getKClass(PagedListLoan);
1829
+ var tmp_1 = null instanceof PagedListLoan;
1830
+ var tmp_2;
1831
+ try {
1832
+ tmp_2 = createKType(getKClass(PagedListLoan), arrayOf([]), false);
1833
+ } catch ($p) {
1834
+ var tmp_3;
1835
+ if ($p instanceof Error) {
1836
+ var _unused_var__etf5q3 = $p;
1837
+ tmp_3 = null;
1838
+ } else {
1839
+ throw $p;
1840
+ }
1841
+ tmp_2 = tmp_3;
1842
+ }
1843
+
1844
+ return new HttpResponse(this_0, new TypedBodyProvider(new TypeInfo(tmp_0, tmp_1, tmp_2)));
1706
1845
  case 2:
1707
- this.WHEN_RESULT0__1 = suspendResult;
1708
- this.state_1 = 3;
1709
- continue $sm;
1710
- case 3:
1711
- return this.WHEN_RESULT0__1;
1712
- case 4:
1713
1846
  throw this.exception_1;
1714
1847
  }
1715
- } catch ($p) {
1716
- var e = $p;
1717
- if (this.exceptionState_1 === 4) {
1848
+ } catch ($p_0) {
1849
+ var e = $p_0;
1850
+ if (this.exceptionState_1 === 2) {
1718
1851
  throw e;
1719
1852
  } else {
1720
1853
  this.state_1 = this.exceptionState_1;
@@ -1723,14 +1856,26 @@ protoOf($updateLoanIN$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function ()
1723
1856
  }
1724
1857
  while (true);
1725
1858
  };
1726
- function $updateLoanInterestCOROUTINE$(_this__u8e3s4, companyId, loanId, updateLoanInterestCommand, resultContinuation) {
1859
+ function showLoanOperation(client, companyId, loanId, fields) {
1860
+ return promisify(function ($completion) {
1861
+ return showLoanOperation_0(client, companyId, loanId, fields, $completion);
1862
+ });
1863
+ }
1864
+ function showLoanOperation_0(client, companyId, loanId, fields, $completion) {
1865
+ fields = fields === VOID ? null : fields;
1866
+ var tmp = new $showLoanOperationCOROUTINE$(client, companyId, loanId, fields, $completion);
1867
+ tmp.result_1 = Unit_instance;
1868
+ tmp.exception_1 = null;
1869
+ return tmp.doResume_5yljmg_k$();
1870
+ }
1871
+ function $showLoanOperationCOROUTINE$(client, companyId, loanId, fields, resultContinuation) {
1727
1872
  CoroutineImpl.call(this, resultContinuation);
1728
- this._this__u8e3s4__1 = _this__u8e3s4;
1873
+ this.client_1 = client;
1729
1874
  this.companyId_1 = companyId;
1730
1875
  this.loanId_1 = loanId;
1731
- this.updateLoanInterestCommand_1 = updateLoanInterestCommand;
1876
+ this.fields_1 = fields;
1732
1877
  }
1733
- protoOf($updateLoanInterestCOROUTINE$).doResume_5yljmg_k$ = function () {
1878
+ protoOf($showLoanOperationCOROUTINE$).doResume_5yljmg_k$ = function () {
1734
1879
  var suspendResult = this.result_1;
1735
1880
  $sm: do
1736
1881
  try {
@@ -1739,14 +1884,21 @@ protoOf($updateLoanInterestCOROUTINE$).doResume_5yljmg_k$ = function () {
1739
1884
  case 0:
1740
1885
  this.exceptionState_1 = 2;
1741
1886
  var localVariableAuthNames = listOf(['cognito', 'cognito-direct']);
1742
- var localVariableBody = this.updateLoanInterestCommand_1;
1887
+ var localVariableBody = EmptyContent_getInstance();
1743
1888
  var localVariableQuery = LinkedHashMap_init_$Create$();
1889
+ if (this.fields_1 == null)
1890
+ null;
1891
+ else {
1892
+ var value = listOf_0(this.fields_1);
1893
+ localVariableQuery.put_4fpzoq_k$('fields', value);
1894
+ }
1895
+
1744
1896
  var localVariableHeaders = LinkedHashMap_init_$Create$();
1745
- var tmp0_method = RequestMethod_PUT_getInstance();
1746
- var tmp1_path = replace(replace('/companies/{companyId}/economy/loans/{loanId}/interest', '{companyId}', this.companyId_1.toString()), '{loanId}', this.loanId_1.toString());
1747
- var localVariableConfig = new RequestConfig(tmp0_method, tmp1_path, localVariableHeaders, VOID, localVariableQuery, true);
1897
+ var tmp1_method = RequestMethod_GET_getInstance();
1898
+ var tmp2_path = replace(replace('/companies/{companyId}/economy/loans/{loanId}', '{companyId}', this.companyId_1.toString()), '{loanId}', this.loanId_1.toString());
1899
+ var localVariableConfig = new RequestConfig(tmp1_method, tmp2_path, localVariableHeaders, VOID, localVariableQuery, true);
1748
1900
  this.state_1 = 1;
1749
- suspendResult = this._this__u8e3s4__1.jsonRequest$suspendBridge_ao9kpg_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
1901
+ suspendResult = this.client_1.executeRequest_c2mqzq_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
1750
1902
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
1751
1903
  return suspendResult;
1752
1904
  }
@@ -1785,324 +1937,298 @@ protoOf($updateLoanInterestCOROUTINE$).doResume_5yljmg_k$ = function () {
1785
1937
  }
1786
1938
  while (true);
1787
1939
  };
1788
- function $updateLoanInterest$suspendBridgeCOROUTINE$(_this__u8e3s4, companyId, loanId, updateLoanInterestCommand, resultContinuation) {
1940
+ function updateLoanAgreementOperation(client, companyId, loanId, addAgreementDocumentToLoanCommand) {
1941
+ return promisify(function ($completion) {
1942
+ return updateLoanAgreementOperation_0(client, companyId, loanId, addAgreementDocumentToLoanCommand, $completion);
1943
+ });
1944
+ }
1945
+ function updateLoanAgreementOperation_0(client, companyId, loanId, addAgreementDocumentToLoanCommand, $completion) {
1946
+ var tmp = new $updateLoanAgreementOperationCOROUTINE$(client, companyId, loanId, addAgreementDocumentToLoanCommand, $completion);
1947
+ tmp.result_1 = Unit_instance;
1948
+ tmp.exception_1 = null;
1949
+ return tmp.doResume_5yljmg_k$();
1950
+ }
1951
+ function $updateLoanAgreementOperationCOROUTINE$(client, companyId, loanId, addAgreementDocumentToLoanCommand, resultContinuation) {
1789
1952
  CoroutineImpl.call(this, resultContinuation);
1790
- this._this__u8e3s4__1 = _this__u8e3s4;
1953
+ this.client_1 = client;
1791
1954
  this.companyId_1 = companyId;
1792
1955
  this.loanId_1 = loanId;
1793
- this.updateLoanInterestCommand_1 = updateLoanInterestCommand;
1956
+ this.addAgreementDocumentToLoanCommand_1 = addAgreementDocumentToLoanCommand;
1794
1957
  }
1795
- protoOf($updateLoanInterest$suspendBridgeCOROUTINE$).doResume_5yljmg_k$ = function () {
1958
+ protoOf($updateLoanAgreementOperationCOROUTINE$).doResume_5yljmg_k$ = function () {
1796
1959
  var suspendResult = this.result_1;
1797
1960
  $sm: do
1798
1961
  try {
1799
1962
  var tmp = this.state_1;
1800
1963
  switch (tmp) {
1801
1964
  case 0:
1802
- this.exceptionState_1 = 4;
1803
- if (this._this__u8e3s4__1.updateLoanInterest === protoOf(LoanApi).updateLoanInterest) {
1804
- this.state_1 = 2;
1805
- suspendResult = this._this__u8e3s4__1.updateLoanInterest_lgs6fx_k$(this.companyId_1, this.loanId_1, this.updateLoanInterestCommand_1, this);
1806
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
1807
- return suspendResult;
1808
- }
1809
- continue $sm;
1810
- } else {
1811
- this.state_1 = 1;
1812
- suspendResult = await_0(this._this__u8e3s4__1.updateLoanInterest(this.companyId_1, this.loanId_1, this.updateLoanInterestCommand_1), this);
1813
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
1814
- return suspendResult;
1815
- }
1816
- continue $sm;
1965
+ this.exceptionState_1 = 2;
1966
+ var localVariableAuthNames = listOf(['cognito', 'cognito-direct']);
1967
+ var localVariableBody = this.addAgreementDocumentToLoanCommand_1;
1968
+ var localVariableQuery = LinkedHashMap_init_$Create$();
1969
+ var localVariableHeaders = LinkedHashMap_init_$Create$();
1970
+ var tmp0_method = RequestMethod_PUT_getInstance();
1971
+ var tmp1_path = replace(replace('/companies/{companyId}/economy/loans/{loanId}/agreement', '{companyId}', this.companyId_1.toString()), '{loanId}', this.loanId_1.toString());
1972
+ var localVariableConfig = new RequestConfig(tmp0_method, tmp1_path, localVariableHeaders, VOID, localVariableQuery, true);
1973
+ this.state_1 = 1;
1974
+ suspendResult = this.client_1.executeJsonRequest_99yh5u_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
1975
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1976
+ return suspendResult;
1817
1977
  }
1818
1978
 
1819
- case 1:
1820
- this.WHEN_RESULT0__1 = suspendResult;
1821
- this.state_1 = 3;
1822
- continue $sm;
1823
- case 2:
1824
- this.WHEN_RESULT0__1 = suspendResult;
1825
- this.state_1 = 3;
1826
1979
  continue $sm;
1827
- case 3:
1828
- return this.WHEN_RESULT0__1;
1829
- case 4:
1830
- throw this.exception_1;
1831
- }
1832
- } catch ($p) {
1833
- var e = $p;
1834
- if (this.exceptionState_1 === 4) {
1835
- throw e;
1836
- } else {
1837
- this.state_1 = this.exceptionState_1;
1838
- this.exception_1 = e;
1839
- }
1980
+ case 1:
1981
+ var this_0 = suspendResult;
1982
+ var tmp_0 = getKClass(Loan);
1983
+ var tmp_1 = null instanceof Loan;
1984
+ var tmp_2;
1985
+ try {
1986
+ tmp_2 = createKType(getKClass(Loan), arrayOf([]), false);
1987
+ } catch ($p) {
1988
+ var tmp_3;
1989
+ if ($p instanceof Error) {
1990
+ var _unused_var__etf5q3 = $p;
1991
+ tmp_3 = null;
1992
+ } else {
1993
+ throw $p;
1994
+ }
1995
+ tmp_2 = tmp_3;
1996
+ }
1997
+
1998
+ return new HttpResponse(this_0, new TypedBodyProvider(new TypeInfo(tmp_0, tmp_1, tmp_2)));
1999
+ case 2:
2000
+ throw this.exception_1;
2001
+ }
2002
+ } catch ($p_0) {
2003
+ var e = $p_0;
2004
+ if (this.exceptionState_1 === 2) {
2005
+ throw e;
2006
+ } else {
2007
+ this.state_1 = this.exceptionState_1;
2008
+ this.exception_1 = e;
2009
+ }
1840
2010
  }
1841
2011
  while (true);
1842
2012
  };
1843
- protoOf(LoanApi).correctLoanDetails_p5bkrs_k$ = function (companyId, loanId, updateLoanCommand, $completion) {
1844
- var tmp = new $correctLoanDetailsCOROUTINE$(this, companyId, loanId, updateLoanCommand, $completion);
1845
- tmp.result_1 = Unit_instance;
1846
- tmp.exception_1 = null;
1847
- return tmp.doResume_5yljmg_k$();
1848
- };
1849
- protoOf(LoanApi).correctLoanDetails = function (companyId, loanId, updateLoanCommand) {
1850
- var tmp = this;
1851
- return promisify(function ($completion) {
1852
- return tmp.correctLoanDetails_p5bkrs_k$(companyId, loanId, updateLoanCommand, $completion);
1853
- });
1854
- };
1855
- protoOf(LoanApi).correctLoanDetails$suspendBridge_pl8hjt_k$ = function (companyId, loanId, updateLoanCommand, $completion) {
1856
- var tmp = new $correctLoanDetails$suspendBridgeCOROUTINE$(this, companyId, loanId, updateLoanCommand, $completion);
1857
- tmp.result_1 = Unit_instance;
1858
- tmp.exception_1 = null;
1859
- return tmp.doResume_5yljmg_k$();
1860
- };
1861
- protoOf(LoanApi).createLoan_p5jh7f_k$ = function (companyId, createLoanCommand, $completion) {
1862
- var tmp = new $createLoanCOROUTINE$(this, companyId, createLoanCommand, $completion);
1863
- tmp.result_1 = Unit_instance;
1864
- tmp.exception_1 = null;
1865
- return tmp.doResume_5yljmg_k$();
1866
- };
1867
- protoOf(LoanApi).createLoan = function (companyId, createLoanCommand) {
1868
- var tmp = this;
1869
- return promisify(function ($completion) {
1870
- return tmp.createLoan_p5jh7f_k$(companyId, createLoanCommand, $completion);
1871
- });
1872
- };
1873
- protoOf(LoanApi).createLoan$suspendBridge_b1w91i_k$ = function (companyId, createLoanCommand, $completion) {
1874
- var tmp = new $createLoan$suspendBridgeCOROUTINE$(this, companyId, createLoanCommand, $completion);
1875
- tmp.result_1 = Unit_instance;
1876
- tmp.exception_1 = null;
1877
- return tmp.doResume_5yljmg_k$();
1878
- };
1879
- protoOf(LoanApi).deleteLoan_c43hl5_k$ = function (companyId, loanId, $completion) {
1880
- var tmp = new $deleteLoanCOROUTINE$(this, companyId, loanId, $completion);
1881
- tmp.result_1 = Unit_instance;
1882
- tmp.exception_1 = null;
1883
- return tmp.doResume_5yljmg_k$();
1884
- };
1885
- protoOf(LoanApi).deleteLoan = function (companyId, loanId) {
1886
- var tmp = this;
1887
- return promisify(function ($completion) {
1888
- return tmp.deleteLoan_c43hl5_k$(companyId, loanId, $completion);
1889
- });
1890
- };
1891
- protoOf(LoanApi).deleteLoan$suspendBridge_7b4xbs_k$ = function (companyId, loanId, $completion) {
1892
- var tmp = new $deleteLoan$suspendBridgeCOROUTINE$(this, companyId, loanId, $completion);
1893
- tmp.result_1 = Unit_instance;
1894
- tmp.exception_1 = null;
1895
- return tmp.doResume_5yljmg_k$();
1896
- };
1897
- protoOf(LoanApi).indexLoanAccounts_s9a4xy_k$ = function (companyId, fields, pageToken, autoPaginate, count, $completion) {
1898
- var tmp = new $indexLoanAccountsCOROUTINE$(this, companyId, fields, pageToken, autoPaginate, count, $completion);
1899
- tmp.result_1 = Unit_instance;
1900
- tmp.exception_1 = null;
1901
- return tmp.doResume_5yljmg_k$();
1902
- };
1903
- protoOf(LoanApi).indexLoanAccounts$default_rzzo4k_k$ = function (companyId, fields, pageToken, autoPaginate, count, $completion, $super) {
1904
- fields = fields === VOID ? null : fields;
1905
- pageToken = pageToken === VOID ? null : pageToken;
1906
- autoPaginate = autoPaginate === VOID ? null : autoPaginate;
1907
- count = count === VOID ? null : count;
1908
- return $super === VOID ? this.indexLoanAccounts_s9a4xy_k$(companyId, fields, pageToken, autoPaginate, count, $completion) : $super.indexLoanAccounts_s9a4xy_k$.call(this, companyId, fields, pageToken, autoPaginate, count, $completion);
1909
- };
1910
- protoOf(LoanApi).indexLoanAccounts = function (companyId, fields, pageToken, autoPaginate, count) {
1911
- var tmp = this;
1912
- return promisify(function ($completion) {
1913
- return tmp.indexLoanAccounts$default_rzzo4k_k$(companyId, fields, pageToken, autoPaginate, count, $completion);
1914
- });
1915
- };
1916
- protoOf(LoanApi).indexLoanAccounts$suspendBridge_krx1b9_k$ = function (companyId, fields, pageToken, autoPaginate, count, $completion) {
1917
- var tmp = new $indexLoanAccounts$suspendBridgeCOROUTINE$(this, companyId, fields, pageToken, autoPaginate, count, $completion);
1918
- tmp.result_1 = Unit_instance;
1919
- tmp.exception_1 = null;
1920
- return tmp.doResume_5yljmg_k$();
1921
- };
1922
- protoOf(LoanApi).indexLoanLog_2knq4b_k$ = function (companyId, loanId, fields, pageToken, autoPaginate, count, $completion) {
1923
- var tmp = new $indexLoanLogCOROUTINE$(this, companyId, loanId, fields, pageToken, autoPaginate, count, $completion);
1924
- tmp.result_1 = Unit_instance;
1925
- tmp.exception_1 = null;
1926
- return tmp.doResume_5yljmg_k$();
1927
- };
1928
- protoOf(LoanApi).indexLoanLog$default_atdzul_k$ = function (companyId, loanId, fields, pageToken, autoPaginate, count, $completion, $super) {
1929
- fields = fields === VOID ? null : fields;
1930
- pageToken = pageToken === VOID ? null : pageToken;
1931
- autoPaginate = autoPaginate === VOID ? null : autoPaginate;
1932
- count = count === VOID ? null : count;
1933
- return $super === VOID ? this.indexLoanLog_2knq4b_k$(companyId, loanId, fields, pageToken, autoPaginate, count, $completion) : $super.indexLoanLog_2knq4b_k$.call(this, companyId, loanId, fields, pageToken, autoPaginate, count, $completion);
1934
- };
1935
- protoOf(LoanApi).indexLoanLog = function (companyId, loanId, fields, pageToken, autoPaginate, count) {
1936
- var tmp = this;
1937
- return promisify(function ($completion) {
1938
- return tmp.indexLoanLog$default_atdzul_k$(companyId, loanId, fields, pageToken, autoPaginate, count, $completion);
1939
- });
1940
- };
1941
- protoOf(LoanApi).indexLoanLog$suspendBridge_8dtsje_k$ = function (companyId, loanId, fields, pageToken, autoPaginate, count, $completion) {
1942
- var tmp = new $indexLoanLog$suspendBridgeCOROUTINE$(this, companyId, loanId, fields, pageToken, autoPaginate, count, $completion);
1943
- tmp.result_1 = Unit_instance;
1944
- tmp.exception_1 = null;
1945
- return tmp.doResume_5yljmg_k$();
1946
- };
1947
- protoOf(LoanApi).indexLoans_ii9csp_k$ = function (companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion) {
1948
- var tmp = new $indexLoansCOROUTINE$(this, companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion);
1949
- tmp.result_1 = Unit_instance;
1950
- tmp.exception_1 = null;
1951
- return tmp.doResume_5yljmg_k$();
1952
- };
1953
- protoOf(LoanApi).indexLoans$default_qi5mkl_k$ = function (companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion, $super) {
1954
- active = active === VOID ? null : active;
1955
- search = search === VOID ? null : search;
1956
- startDateFrom = startDateFrom === VOID ? null : startDateFrom;
1957
- startDateTo = startDateTo === VOID ? null : startDateTo;
1958
- endDateFrom = endDateFrom === VOID ? null : endDateFrom;
1959
- endDateTo = endDateTo === VOID ? null : endDateTo;
1960
- fields = fields === VOID ? null : fields;
1961
- pageToken = pageToken === VOID ? null : pageToken;
1962
- autoPaginate = autoPaginate === VOID ? null : autoPaginate;
1963
- count = count === VOID ? null : count;
1964
- return $super === VOID ? this.indexLoans_ii9csp_k$(companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion) : $super.indexLoans_ii9csp_k$.call(this, companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion);
1965
- };
1966
- protoOf(LoanApi).indexLoans = function (companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count) {
1967
- var tmp = this;
1968
- return promisify(function ($completion) {
1969
- return tmp.indexLoans$default_qi5mkl_k$(companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion);
1970
- });
1971
- };
1972
- protoOf(LoanApi).indexLoans$suspendBridge_h53u6g_k$ = function (companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion) {
1973
- var tmp = new $indexLoans$suspendBridgeCOROUTINE$(this, companyId, active, search, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion);
1974
- tmp.result_1 = Unit_instance;
1975
- tmp.exception_1 = null;
1976
- return tmp.doResume_5yljmg_k$();
1977
- };
1978
- protoOf(LoanApi).indexLoansUser_m4irq5_k$ = function (search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion) {
1979
- var tmp = new $indexLoansUserCOROUTINE$(this, search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion);
1980
- tmp.result_1 = Unit_instance;
1981
- tmp.exception_1 = null;
1982
- return tmp.doResume_5yljmg_k$();
1983
- };
1984
- protoOf(LoanApi).indexLoansUser$default_9zom8k_k$ = function (search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion, $super) {
1985
- search = search === VOID ? null : search;
1986
- companyIds = companyIds === VOID ? null : companyIds;
1987
- active = active === VOID ? null : active;
1988
- startDateFrom = startDateFrom === VOID ? null : startDateFrom;
1989
- startDateTo = startDateTo === VOID ? null : startDateTo;
1990
- endDateFrom = endDateFrom === VOID ? null : endDateFrom;
1991
- endDateTo = endDateTo === VOID ? null : endDateTo;
1992
- fields = fields === VOID ? null : fields;
1993
- pageToken = pageToken === VOID ? null : pageToken;
1994
- autoPaginate = autoPaginate === VOID ? null : autoPaginate;
1995
- count = count === VOID ? null : count;
1996
- return $super === VOID ? this.indexLoansUser_m4irq5_k$(search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion) : $super.indexLoansUser_m4irq5_k$.call(this, search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion);
1997
- };
1998
- protoOf(LoanApi).indexLoansUser = function (search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count) {
1999
- var tmp = this;
2000
- return promisify(function ($completion) {
2001
- return tmp.indexLoansUser$default_9zom8k_k$(search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion);
2002
- });
2003
- };
2004
- protoOf(LoanApi).indexLoansUser$suspendBridge_pvzcim_k$ = function (search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion) {
2005
- var tmp = new $indexLoansUser$suspendBridgeCOROUTINE$(this, search, companyIds, active, startDateFrom, startDateTo, endDateFrom, endDateTo, fields, pageToken, autoPaginate, count, $completion);
2006
- tmp.result_1 = Unit_instance;
2007
- tmp.exception_1 = null;
2008
- return tmp.doResume_5yljmg_k$();
2009
- };
2010
- protoOf(LoanApi).showLoan_go22zh_k$ = function (companyId, loanId, fields, $completion) {
2011
- var tmp = new $showLoanCOROUTINE$(this, companyId, loanId, fields, $completion);
2012
- tmp.result_1 = Unit_instance;
2013
- tmp.exception_1 = null;
2014
- return tmp.doResume_5yljmg_k$();
2015
- };
2016
- protoOf(LoanApi).showLoan$default_590974_k$ = function (companyId, loanId, fields, $completion, $super) {
2017
- fields = fields === VOID ? null : fields;
2018
- return $super === VOID ? this.showLoan_go22zh_k$(companyId, loanId, fields, $completion) : $super.showLoan_go22zh_k$.call(this, companyId, loanId, fields, $completion);
2019
- };
2020
- protoOf(LoanApi).showLoan = function (companyId, loanId, fields) {
2021
- var tmp = this;
2022
- return promisify(function ($completion) {
2023
- return tmp.showLoan$default_590974_k$(companyId, loanId, fields, $completion);
2024
- });
2025
- };
2026
- protoOf(LoanApi).showLoan$suspendBridge_qtu9uk_k$ = function (companyId, loanId, fields, $completion) {
2027
- var tmp = new $showLoan$suspendBridgeCOROUTINE$(this, companyId, loanId, fields, $completion);
2028
- tmp.result_1 = Unit_instance;
2029
- tmp.exception_1 = null;
2030
- return tmp.doResume_5yljmg_k$();
2031
- };
2032
- protoOf(LoanApi).updateLoan_2fb142_k$ = function (companyId, loanId, closeLoanCommand, $completion) {
2033
- var tmp = new $updateLoanCOROUTINE$(this, companyId, loanId, closeLoanCommand, $completion);
2034
- tmp.result_1 = Unit_instance;
2035
- tmp.exception_1 = null;
2036
- return tmp.doResume_5yljmg_k$();
2037
- };
2038
- protoOf(LoanApi).updateLoan = function (companyId, loanId, closeLoanCommand) {
2039
- var tmp = this;
2040
- return promisify(function ($completion) {
2041
- return tmp.updateLoan_2fb142_k$(companyId, loanId, closeLoanCommand, $completion);
2042
- });
2043
- };
2044
- protoOf(LoanApi).updateLoan$suspendBridge_lzgpj5_k$ = function (companyId, loanId, closeLoanCommand, $completion) {
2045
- var tmp = new $updateLoan$suspendBridgeCOROUTINE$(this, companyId, loanId, closeLoanCommand, $completion);
2046
- tmp.result_1 = Unit_instance;
2047
- tmp.exception_1 = null;
2048
- return tmp.doResume_5yljmg_k$();
2049
- };
2050
- protoOf(LoanApi).updateLoanAgreement_miylnt_k$ = function (companyId, loanId, addAgreementDocumentToLoanCommand, $completion) {
2051
- var tmp = new $updateLoanAgreementCOROUTINE$(this, companyId, loanId, addAgreementDocumentToLoanCommand, $completion);
2052
- tmp.result_1 = Unit_instance;
2053
- tmp.exception_1 = null;
2054
- return tmp.doResume_5yljmg_k$();
2055
- };
2056
- protoOf(LoanApi).updateLoanAgreement = function (companyId, loanId, addAgreementDocumentToLoanCommand) {
2057
- var tmp = this;
2013
+ function updateLoanINOperation(client, companyId, loanId, updateINAgreementCommand) {
2058
2014
  return promisify(function ($completion) {
2059
- return tmp.updateLoanAgreement_miylnt_k$(companyId, loanId, addAgreementDocumentToLoanCommand, $completion);
2015
+ return updateLoanINOperation_0(client, companyId, loanId, updateINAgreementCommand, $completion);
2060
2016
  });
2061
- };
2062
- protoOf(LoanApi).updateLoanAgreement$suspendBridge_6rces8_k$ = function (companyId, loanId, addAgreementDocumentToLoanCommand, $completion) {
2063
- var tmp = new $updateLoanAgreement$suspendBridgeCOROUTINE$(this, companyId, loanId, addAgreementDocumentToLoanCommand, $completion);
2064
- tmp.result_1 = Unit_instance;
2065
- tmp.exception_1 = null;
2066
- return tmp.doResume_5yljmg_k$();
2067
- };
2068
- protoOf(LoanApi).updateLoanIN_rdgr4h_k$ = function (companyId, loanId, updateINAgreementCommand, $completion) {
2069
- var tmp = new $updateLoanINCOROUTINE$(this, companyId, loanId, updateINAgreementCommand, $completion);
2017
+ }
2018
+ function updateLoanINOperation_0(client, companyId, loanId, updateINAgreementCommand, $completion) {
2019
+ var tmp = new $updateLoanINOperationCOROUTINE$(client, companyId, loanId, updateINAgreementCommand, $completion);
2070
2020
  tmp.result_1 = Unit_instance;
2071
2021
  tmp.exception_1 = null;
2072
2022
  return tmp.doResume_5yljmg_k$();
2023
+ }
2024
+ function $updateLoanINOperationCOROUTINE$(client, companyId, loanId, updateINAgreementCommand, resultContinuation) {
2025
+ CoroutineImpl.call(this, resultContinuation);
2026
+ this.client_1 = client;
2027
+ this.companyId_1 = companyId;
2028
+ this.loanId_1 = loanId;
2029
+ this.updateINAgreementCommand_1 = updateINAgreementCommand;
2030
+ }
2031
+ protoOf($updateLoanINOperationCOROUTINE$).doResume_5yljmg_k$ = function () {
2032
+ var suspendResult = this.result_1;
2033
+ $sm: do
2034
+ try {
2035
+ var tmp = this.state_1;
2036
+ switch (tmp) {
2037
+ case 0:
2038
+ this.exceptionState_1 = 2;
2039
+ var localVariableAuthNames = listOf(['cognito', 'cognito-direct']);
2040
+ var localVariableBody = this.updateINAgreementCommand_1;
2041
+ var localVariableQuery = LinkedHashMap_init_$Create$();
2042
+ var localVariableHeaders = LinkedHashMap_init_$Create$();
2043
+ var tmp0_method = RequestMethod_PUT_getInstance();
2044
+ var tmp1_path = replace(replace('/companies/{companyId}/economy/loans/{loanId}/IN', '{companyId}', this.companyId_1.toString()), '{loanId}', this.loanId_1.toString());
2045
+ var localVariableConfig = new RequestConfig(tmp0_method, tmp1_path, localVariableHeaders, VOID, localVariableQuery, true);
2046
+ this.state_1 = 1;
2047
+ suspendResult = this.client_1.executeJsonRequest_99yh5u_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
2048
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
2049
+ return suspendResult;
2050
+ }
2051
+
2052
+ continue $sm;
2053
+ case 1:
2054
+ var this_0 = suspendResult;
2055
+ var tmp_0 = getKClass(Loan);
2056
+ var tmp_1 = null instanceof Loan;
2057
+ var tmp_2;
2058
+ try {
2059
+ tmp_2 = createKType(getKClass(Loan), arrayOf([]), false);
2060
+ } catch ($p) {
2061
+ var tmp_3;
2062
+ if ($p instanceof Error) {
2063
+ var _unused_var__etf5q3 = $p;
2064
+ tmp_3 = null;
2065
+ } else {
2066
+ throw $p;
2067
+ }
2068
+ tmp_2 = tmp_3;
2069
+ }
2070
+
2071
+ return new HttpResponse(this_0, new TypedBodyProvider(new TypeInfo(tmp_0, tmp_1, tmp_2)));
2072
+ case 2:
2073
+ throw this.exception_1;
2074
+ }
2075
+ } catch ($p_0) {
2076
+ var e = $p_0;
2077
+ if (this.exceptionState_1 === 2) {
2078
+ throw e;
2079
+ } else {
2080
+ this.state_1 = this.exceptionState_1;
2081
+ this.exception_1 = e;
2082
+ }
2083
+ }
2084
+ while (true);
2073
2085
  };
2074
- protoOf(LoanApi).updateLoanIN = function (companyId, loanId, updateINAgreementCommand) {
2075
- var tmp = this;
2086
+ function updateLoanInterestOperation(client, companyId, loanId, updateLoanInterestCommand) {
2076
2087
  return promisify(function ($completion) {
2077
- return tmp.updateLoanIN_rdgr4h_k$(companyId, loanId, updateINAgreementCommand, $completion);
2088
+ return updateLoanInterestOperation_0(client, companyId, loanId, updateLoanInterestCommand, $completion);
2078
2089
  });
2079
- };
2080
- protoOf(LoanApi).updateLoanIN$suspendBridge_mt40ls_k$ = function (companyId, loanId, updateINAgreementCommand, $completion) {
2081
- var tmp = new $updateLoanIN$suspendBridgeCOROUTINE$(this, companyId, loanId, updateINAgreementCommand, $completion);
2082
- tmp.result_1 = Unit_instance;
2083
- tmp.exception_1 = null;
2084
- return tmp.doResume_5yljmg_k$();
2085
- };
2086
- protoOf(LoanApi).updateLoanInterest_lgs6fx_k$ = function (companyId, loanId, updateLoanInterestCommand, $completion) {
2087
- var tmp = new $updateLoanInterestCOROUTINE$(this, companyId, loanId, updateLoanInterestCommand, $completion);
2090
+ }
2091
+ function updateLoanInterestOperation_0(client, companyId, loanId, updateLoanInterestCommand, $completion) {
2092
+ var tmp = new $updateLoanInterestOperationCOROUTINE$(client, companyId, loanId, updateLoanInterestCommand, $completion);
2088
2093
  tmp.result_1 = Unit_instance;
2089
2094
  tmp.exception_1 = null;
2090
2095
  return tmp.doResume_5yljmg_k$();
2096
+ }
2097
+ function $updateLoanInterestOperationCOROUTINE$(client, companyId, loanId, updateLoanInterestCommand, resultContinuation) {
2098
+ CoroutineImpl.call(this, resultContinuation);
2099
+ this.client_1 = client;
2100
+ this.companyId_1 = companyId;
2101
+ this.loanId_1 = loanId;
2102
+ this.updateLoanInterestCommand_1 = updateLoanInterestCommand;
2103
+ }
2104
+ protoOf($updateLoanInterestOperationCOROUTINE$).doResume_5yljmg_k$ = function () {
2105
+ var suspendResult = this.result_1;
2106
+ $sm: do
2107
+ try {
2108
+ var tmp = this.state_1;
2109
+ switch (tmp) {
2110
+ case 0:
2111
+ this.exceptionState_1 = 2;
2112
+ var localVariableAuthNames = listOf(['cognito', 'cognito-direct']);
2113
+ var localVariableBody = this.updateLoanInterestCommand_1;
2114
+ var localVariableQuery = LinkedHashMap_init_$Create$();
2115
+ var localVariableHeaders = LinkedHashMap_init_$Create$();
2116
+ var tmp0_method = RequestMethod_PUT_getInstance();
2117
+ var tmp1_path = replace(replace('/companies/{companyId}/economy/loans/{loanId}/interest', '{companyId}', this.companyId_1.toString()), '{loanId}', this.loanId_1.toString());
2118
+ var localVariableConfig = new RequestConfig(tmp0_method, tmp1_path, localVariableHeaders, VOID, localVariableQuery, true);
2119
+ this.state_1 = 1;
2120
+ suspendResult = this.client_1.executeJsonRequest_99yh5u_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
2121
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
2122
+ return suspendResult;
2123
+ }
2124
+
2125
+ continue $sm;
2126
+ case 1:
2127
+ var this_0 = suspendResult;
2128
+ var tmp_0 = getKClass(Loan);
2129
+ var tmp_1 = null instanceof Loan;
2130
+ var tmp_2;
2131
+ try {
2132
+ tmp_2 = createKType(getKClass(Loan), arrayOf([]), false);
2133
+ } catch ($p) {
2134
+ var tmp_3;
2135
+ if ($p instanceof Error) {
2136
+ var _unused_var__etf5q3 = $p;
2137
+ tmp_3 = null;
2138
+ } else {
2139
+ throw $p;
2140
+ }
2141
+ tmp_2 = tmp_3;
2142
+ }
2143
+
2144
+ return new HttpResponse(this_0, new TypedBodyProvider(new TypeInfo(tmp_0, tmp_1, tmp_2)));
2145
+ case 2:
2146
+ throw this.exception_1;
2147
+ }
2148
+ } catch ($p_0) {
2149
+ var e = $p_0;
2150
+ if (this.exceptionState_1 === 2) {
2151
+ throw e;
2152
+ } else {
2153
+ this.state_1 = this.exceptionState_1;
2154
+ this.exception_1 = e;
2155
+ }
2156
+ }
2157
+ while (true);
2091
2158
  };
2092
- protoOf(LoanApi).updateLoanInterest = function (companyId, loanId, updateLoanInterestCommand) {
2093
- var tmp = this;
2159
+ function updateLoanOperation(client, companyId, loanId, closeLoanCommand) {
2094
2160
  return promisify(function ($completion) {
2095
- return tmp.updateLoanInterest_lgs6fx_k$(companyId, loanId, updateLoanInterestCommand, $completion);
2161
+ return updateLoanOperation_0(client, companyId, loanId, closeLoanCommand, $completion);
2096
2162
  });
2097
- };
2098
- protoOf(LoanApi).updateLoanInterest$suspendBridge_pmlc0u_k$ = function (companyId, loanId, updateLoanInterestCommand, $completion) {
2099
- var tmp = new $updateLoanInterest$suspendBridgeCOROUTINE$(this, companyId, loanId, updateLoanInterestCommand, $completion);
2163
+ }
2164
+ function updateLoanOperation_0(client, companyId, loanId, closeLoanCommand, $completion) {
2165
+ var tmp = new $updateLoanOperationCOROUTINE$(client, companyId, loanId, closeLoanCommand, $completion);
2100
2166
  tmp.result_1 = Unit_instance;
2101
2167
  tmp.exception_1 = null;
2102
2168
  return tmp.doResume_5yljmg_k$();
2103
- };
2104
- function LoanApi() {
2105
2169
  }
2170
+ function $updateLoanOperationCOROUTINE$(client, companyId, loanId, closeLoanCommand, resultContinuation) {
2171
+ CoroutineImpl.call(this, resultContinuation);
2172
+ this.client_1 = client;
2173
+ this.companyId_1 = companyId;
2174
+ this.loanId_1 = loanId;
2175
+ this.closeLoanCommand_1 = closeLoanCommand;
2176
+ }
2177
+ protoOf($updateLoanOperationCOROUTINE$).doResume_5yljmg_k$ = function () {
2178
+ var suspendResult = this.result_1;
2179
+ $sm: do
2180
+ try {
2181
+ var tmp = this.state_1;
2182
+ switch (tmp) {
2183
+ case 0:
2184
+ this.exceptionState_1 = 2;
2185
+ var localVariableAuthNames = listOf(['cognito', 'cognito-direct']);
2186
+ var localVariableBody = this.closeLoanCommand_1;
2187
+ var localVariableQuery = LinkedHashMap_init_$Create$();
2188
+ var localVariableHeaders = LinkedHashMap_init_$Create$();
2189
+ var tmp0_method = RequestMethod_PUT_getInstance();
2190
+ var tmp1_path = replace(replace('/companies/{companyId}/economy/loans/{loanId}/close', '{companyId}', this.companyId_1.toString()), '{loanId}', this.loanId_1.toString());
2191
+ var localVariableConfig = new RequestConfig(tmp0_method, tmp1_path, localVariableHeaders, VOID, localVariableQuery, true);
2192
+ this.state_1 = 1;
2193
+ suspendResult = this.client_1.executeJsonRequest_99yh5u_k$(localVariableConfig, localVariableBody, localVariableAuthNames, this);
2194
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
2195
+ return suspendResult;
2196
+ }
2197
+
2198
+ continue $sm;
2199
+ case 1:
2200
+ var this_0 = suspendResult;
2201
+ var tmp_0 = getKClass(Loan);
2202
+ var tmp_1 = null instanceof Loan;
2203
+ var tmp_2;
2204
+ try {
2205
+ tmp_2 = createKType(getKClass(Loan), arrayOf([]), false);
2206
+ } catch ($p) {
2207
+ var tmp_3;
2208
+ if ($p instanceof Error) {
2209
+ var _unused_var__etf5q3 = $p;
2210
+ tmp_3 = null;
2211
+ } else {
2212
+ throw $p;
2213
+ }
2214
+ tmp_2 = tmp_3;
2215
+ }
2216
+
2217
+ return new HttpResponse(this_0, new TypedBodyProvider(new TypeInfo(tmp_0, tmp_1, tmp_2)));
2218
+ case 2:
2219
+ throw this.exception_1;
2220
+ }
2221
+ } catch ($p_0) {
2222
+ var e = $p_0;
2223
+ if (this.exceptionState_1 === 2) {
2224
+ throw e;
2225
+ } else {
2226
+ this.state_1 = this.exceptionState_1;
2227
+ this.exception_1 = e;
2228
+ }
2229
+ }
2230
+ while (true);
2231
+ };
2106
2232
  function Companion() {
2107
2233
  }
2108
2234
  var Companion_instance_0;
@@ -4481,6 +4607,18 @@ defineProp(LOANLOGTYPE, 'Companion', Companion_getInstance_3, VOID, true);
4481
4607
  export {
4482
4608
  loanApi as loanApi,
4483
4609
  LoanApi as LoanApi,
4610
+ correctLoanDetailsOperation as correctLoanDetailsOperation,
4611
+ createLoanOperation as createLoanOperation,
4612
+ deleteLoanOperation as deleteLoanOperation,
4613
+ indexLoanAccountsOperation as indexLoanAccountsOperation,
4614
+ indexLoanLogOperation as indexLoanLogOperation,
4615
+ indexLoansOperation as indexLoansOperation,
4616
+ indexLoansUserOperation as indexLoansUserOperation,
4617
+ showLoanOperation as showLoanOperation,
4618
+ updateLoanAgreementOperation as updateLoanAgreementOperation,
4619
+ updateLoanINOperation as updateLoanINOperation,
4620
+ updateLoanInterestOperation as updateLoanInterestOperation,
4621
+ updateLoanOperation as updateLoanOperation,
4484
4622
  AddAgreementDocumentToLoanCommand as AddAgreementDocumentToLoanCommand,
4485
4623
  CloseLoanCommand as CloseLoanCommand,
4486
4624
  CreateLoanCommand as CreateLoanCommand,