moovio_sdk 0.12.0__py3-none-any.whl → 0.13.1__py3-none-any.whl
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.
- moovio_sdk/_version.py +3 -3
- moovio_sdk/account_terminal_applications.py +70 -186
- moovio_sdk/accounts.py +168 -408
- moovio_sdk/adjustments.py +28 -84
- moovio_sdk/apple_pay.py +102 -236
- moovio_sdk/authentication.py +50 -102
- moovio_sdk/avatars.py +10 -38
- moovio_sdk/bank_accounts.py +174 -420
- moovio_sdk/basesdk.py +4 -4
- moovio_sdk/branding.py +106 -198
- moovio_sdk/capabilities.py +76 -180
- moovio_sdk/card_issuing.py +94 -228
- moovio_sdk/cards.py +94 -232
- moovio_sdk/disputes.py +204 -500
- moovio_sdk/end_to_end_encryption.py +28 -80
- moovio_sdk/enriched_address.py +14 -44
- moovio_sdk/enriched_profile.py +14 -44
- moovio_sdk/fee_plans.py +116 -314
- moovio_sdk/files.py +52 -138
- moovio_sdk/industries.py +14 -44
- moovio_sdk/institutions.py +36 -92
- moovio_sdk/issuing_transactions.py +70 -220
- moovio_sdk/models/components/__init__.py +39 -0
- moovio_sdk/models/components/createticket.py +24 -0
- moovio_sdk/models/components/createticketcontacterror.py +17 -0
- moovio_sdk/models/components/ticket.py +44 -0
- moovio_sdk/models/components/ticketcontact.py +17 -0
- moovio_sdk/models/components/ticketmessage.py +21 -0
- moovio_sdk/models/components/ticketstatus.py +11 -0
- moovio_sdk/models/components/updateticket.py +19 -0
- moovio_sdk/models/components/updateticketstatus.py +8 -0
- moovio_sdk/models/errors/__init__.py +19 -0
- moovio_sdk/models/errors/accountterminalapplicationerror.py +11 -6
- moovio_sdk/models/errors/addcapabilitieserror.py +11 -6
- moovio_sdk/models/errors/apierror.py +30 -14
- moovio_sdk/models/errors/assigncountrieserror.py +12 -6
- moovio_sdk/models/errors/authtokenrequesterror.py +11 -6
- moovio_sdk/models/errors/bankaccountvalidationerror.py +11 -6
- moovio_sdk/models/errors/brandvalidationerror.py +11 -6
- moovio_sdk/models/errors/cardacquiringrefund.py +11 -6
- moovio_sdk/models/errors/createaccount.py +12 -6
- moovio_sdk/models/errors/createpaymentlinkerror.py +11 -6
- moovio_sdk/models/errors/createsweepconfigerror.py +11 -6
- moovio_sdk/models/errors/createticketerror.py +34 -0
- moovio_sdk/models/errors/feeplanagreementerror.py +11 -6
- moovio_sdk/models/errors/fileuploadvalidationerror.py +11 -6
- moovio_sdk/models/errors/filevalidationerror.py +11 -6
- moovio_sdk/models/errors/genericerror.py +12 -6
- moovio_sdk/models/errors/linkapplepayerror.py +11 -6
- moovio_sdk/models/errors/linkcarderror.py +11 -6
- moovio_sdk/models/errors/microdepositvalidationerror.py +11 -6
- moovio_sdk/models/errors/mooverror.py +26 -0
- moovio_sdk/models/errors/no_response_error.py +13 -0
- moovio_sdk/models/errors/onboardinginviteerror.py +11 -6
- moovio_sdk/models/errors/patchsweepconfigerror.py +11 -6
- moovio_sdk/models/errors/refundvalidationerror.py +11 -6
- moovio_sdk/models/errors/representativevalidationerror.py +11 -6
- moovio_sdk/models/errors/requestcarderror.py +11 -6
- moovio_sdk/models/errors/responsevalidationerror.py +25 -0
- moovio_sdk/models/errors/reversalvalidationerror.py +11 -6
- moovio_sdk/models/errors/revoketokenrequesterror.py +11 -6
- moovio_sdk/models/errors/schedulevalidationerror.py +11 -6
- moovio_sdk/models/errors/terminalapplicationerror.py +11 -6
- moovio_sdk/models/errors/transfer.py +11 -6
- moovio_sdk/models/errors/transferoptionsvalidationerror.py +11 -6
- moovio_sdk/models/errors/transfervalidationerror.py +11 -6
- moovio_sdk/models/errors/updateaccount.py +12 -6
- moovio_sdk/models/errors/updatecarderror.py +11 -6
- moovio_sdk/models/errors/updateissuedcarderror.py +11 -6
- moovio_sdk/models/errors/updatepaymentlinkerror.py +11 -6
- moovio_sdk/models/errors/updateticketerror.py +25 -0
- moovio_sdk/models/errors/updateunderwritingerror.py +11 -6
- moovio_sdk/models/errors/upsertunderwritingerror.py +11 -6
- moovio_sdk/models/operations/__init__.py +100 -0
- moovio_sdk/models/operations/createticket.py +78 -0
- moovio_sdk/models/operations/getticket.py +71 -0
- moovio_sdk/models/operations/listticketmessages.py +88 -0
- moovio_sdk/models/operations/listtickets.py +81 -0
- moovio_sdk/models/operations/updateticket.py +85 -0
- moovio_sdk/onboarding.py +66 -166
- moovio_sdk/payment_links.py +106 -272
- moovio_sdk/payment_methods.py +30 -86
- moovio_sdk/ping.py +10 -40
- moovio_sdk/receipts.py +36 -92
- moovio_sdk/representatives.py +102 -228
- moovio_sdk/scheduling.py +122 -278
- moovio_sdk/sdk.py +3 -0
- moovio_sdk/support.py +1153 -0
- moovio_sdk/sweeps.py +102 -274
- moovio_sdk/terminal_applications.py +74 -186
- moovio_sdk/transfers.py +266 -582
- moovio_sdk/underwriting.py +64 -146
- moovio_sdk/utils/__init__.py +3 -0
- moovio_sdk/utils/serializers.py +21 -3
- moovio_sdk/wallet_transactions.py +28 -88
- moovio_sdk/wallets.py +24 -84
- {moovio_sdk-0.12.0.dist-info → moovio_sdk-0.13.1.dist-info}/METADATA +103 -28
- {moovio_sdk-0.12.0.dist-info → moovio_sdk-0.13.1.dist-info}/RECORD +99 -80
- {moovio_sdk-0.12.0.dist-info → moovio_sdk-0.13.1.dist-info}/WHEEL +0 -0
moovio_sdk/files.py
CHANGED
@@ -127,46 +127,33 @@ class Files(BaseSDK):
|
|
127
127
|
response_data: Any = None
|
128
128
|
if utils.match_response(http_res, "200", "application/json"):
|
129
129
|
return operations.UploadFileResponse(
|
130
|
-
result=utils.
|
130
|
+
result=utils.unmarshal_json_response(components.FileDetails, http_res),
|
131
131
|
headers=utils.get_response_headers(http_res.headers),
|
132
132
|
)
|
133
133
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
134
|
-
response_data = utils.
|
135
|
-
|
134
|
+
response_data = utils.unmarshal_json_response(
|
135
|
+
errors.GenericErrorData, http_res
|
136
|
+
)
|
137
|
+
raise errors.GenericError(response_data, http_res)
|
136
138
|
if utils.match_response(http_res, "422", "application/json"):
|
137
|
-
response_data = utils.
|
138
|
-
|
139
|
+
response_data = utils.unmarshal_json_response(
|
140
|
+
errors.FileValidationErrorData, http_res
|
139
141
|
)
|
140
|
-
raise errors.FileValidationError(
|
142
|
+
raise errors.FileValidationError(response_data, http_res)
|
141
143
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
142
144
|
http_res_text = utils.stream_to_text(http_res)
|
143
|
-
raise errors.APIError(
|
144
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
145
|
-
)
|
145
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
146
146
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
147
147
|
http_res_text = utils.stream_to_text(http_res)
|
148
|
-
raise errors.APIError(
|
149
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
150
|
-
)
|
148
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
151
149
|
if utils.match_response(http_res, "4XX", "*"):
|
152
150
|
http_res_text = utils.stream_to_text(http_res)
|
153
|
-
raise errors.APIError(
|
154
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
155
|
-
)
|
151
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
156
152
|
if utils.match_response(http_res, "5XX", "*"):
|
157
153
|
http_res_text = utils.stream_to_text(http_res)
|
158
|
-
raise errors.APIError(
|
159
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
160
|
-
)
|
154
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
161
155
|
|
162
|
-
|
163
|
-
http_res_text = utils.stream_to_text(http_res)
|
164
|
-
raise errors.APIError(
|
165
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
166
|
-
http_res.status_code,
|
167
|
-
http_res_text,
|
168
|
-
http_res,
|
169
|
-
)
|
156
|
+
raise errors.APIError("Unexpected response received", http_res)
|
170
157
|
|
171
158
|
async def upload_async(
|
172
159
|
self,
|
@@ -285,46 +272,33 @@ class Files(BaseSDK):
|
|
285
272
|
response_data: Any = None
|
286
273
|
if utils.match_response(http_res, "200", "application/json"):
|
287
274
|
return operations.UploadFileResponse(
|
288
|
-
result=utils.
|
275
|
+
result=utils.unmarshal_json_response(components.FileDetails, http_res),
|
289
276
|
headers=utils.get_response_headers(http_res.headers),
|
290
277
|
)
|
291
278
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
292
|
-
response_data = utils.
|
293
|
-
|
279
|
+
response_data = utils.unmarshal_json_response(
|
280
|
+
errors.GenericErrorData, http_res
|
281
|
+
)
|
282
|
+
raise errors.GenericError(response_data, http_res)
|
294
283
|
if utils.match_response(http_res, "422", "application/json"):
|
295
|
-
response_data = utils.
|
296
|
-
|
284
|
+
response_data = utils.unmarshal_json_response(
|
285
|
+
errors.FileValidationErrorData, http_res
|
297
286
|
)
|
298
|
-
raise errors.FileValidationError(
|
287
|
+
raise errors.FileValidationError(response_data, http_res)
|
299
288
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
300
289
|
http_res_text = await utils.stream_to_text_async(http_res)
|
301
|
-
raise errors.APIError(
|
302
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
303
|
-
)
|
290
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
304
291
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
305
292
|
http_res_text = await utils.stream_to_text_async(http_res)
|
306
|
-
raise errors.APIError(
|
307
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
308
|
-
)
|
293
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
309
294
|
if utils.match_response(http_res, "4XX", "*"):
|
310
295
|
http_res_text = await utils.stream_to_text_async(http_res)
|
311
|
-
raise errors.APIError(
|
312
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
313
|
-
)
|
296
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
314
297
|
if utils.match_response(http_res, "5XX", "*"):
|
315
298
|
http_res_text = await utils.stream_to_text_async(http_res)
|
316
|
-
raise errors.APIError(
|
317
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
318
|
-
)
|
299
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
319
300
|
|
320
|
-
|
321
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
322
|
-
raise errors.APIError(
|
323
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
324
|
-
http_res.status_code,
|
325
|
-
http_res_text,
|
326
|
-
http_res,
|
327
|
-
)
|
301
|
+
raise errors.APIError("Unexpected response received", http_res)
|
328
302
|
|
329
303
|
def list(
|
330
304
|
self,
|
@@ -404,40 +378,25 @@ class Files(BaseSDK):
|
|
404
378
|
|
405
379
|
if utils.match_response(http_res, "200", "application/json"):
|
406
380
|
return operations.ListFilesResponse(
|
407
|
-
result=utils.
|
408
|
-
|
381
|
+
result=utils.unmarshal_json_response(
|
382
|
+
List[components.FileDetails], http_res
|
409
383
|
),
|
410
384
|
headers=utils.get_response_headers(http_res.headers),
|
411
385
|
)
|
412
386
|
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
413
387
|
http_res_text = utils.stream_to_text(http_res)
|
414
|
-
raise errors.APIError(
|
415
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
416
|
-
)
|
388
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
417
389
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
418
390
|
http_res_text = utils.stream_to_text(http_res)
|
419
|
-
raise errors.APIError(
|
420
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
421
|
-
)
|
391
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
422
392
|
if utils.match_response(http_res, "4XX", "*"):
|
423
393
|
http_res_text = utils.stream_to_text(http_res)
|
424
|
-
raise errors.APIError(
|
425
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
426
|
-
)
|
394
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
427
395
|
if utils.match_response(http_res, "5XX", "*"):
|
428
396
|
http_res_text = utils.stream_to_text(http_res)
|
429
|
-
raise errors.APIError(
|
430
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
431
|
-
)
|
397
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
432
398
|
|
433
|
-
|
434
|
-
http_res_text = utils.stream_to_text(http_res)
|
435
|
-
raise errors.APIError(
|
436
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
437
|
-
http_res.status_code,
|
438
|
-
http_res_text,
|
439
|
-
http_res,
|
440
|
-
)
|
399
|
+
raise errors.APIError("Unexpected response received", http_res)
|
441
400
|
|
442
401
|
async def list_async(
|
443
402
|
self,
|
@@ -517,40 +476,25 @@ class Files(BaseSDK):
|
|
517
476
|
|
518
477
|
if utils.match_response(http_res, "200", "application/json"):
|
519
478
|
return operations.ListFilesResponse(
|
520
|
-
result=utils.
|
521
|
-
|
479
|
+
result=utils.unmarshal_json_response(
|
480
|
+
List[components.FileDetails], http_res
|
522
481
|
),
|
523
482
|
headers=utils.get_response_headers(http_res.headers),
|
524
483
|
)
|
525
484
|
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
526
485
|
http_res_text = await utils.stream_to_text_async(http_res)
|
527
|
-
raise errors.APIError(
|
528
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
529
|
-
)
|
486
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
530
487
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
531
488
|
http_res_text = await utils.stream_to_text_async(http_res)
|
532
|
-
raise errors.APIError(
|
533
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
534
|
-
)
|
489
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
535
490
|
if utils.match_response(http_res, "4XX", "*"):
|
536
491
|
http_res_text = await utils.stream_to_text_async(http_res)
|
537
|
-
raise errors.APIError(
|
538
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
539
|
-
)
|
492
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
540
493
|
if utils.match_response(http_res, "5XX", "*"):
|
541
494
|
http_res_text = await utils.stream_to_text_async(http_res)
|
542
|
-
raise errors.APIError(
|
543
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
544
|
-
)
|
495
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
545
496
|
|
546
|
-
|
547
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
548
|
-
raise errors.APIError(
|
549
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
550
|
-
http_res.status_code,
|
551
|
-
http_res_text,
|
552
|
-
http_res,
|
553
|
-
)
|
497
|
+
raise errors.APIError("Unexpected response received", http_res)
|
554
498
|
|
555
499
|
def get(
|
556
500
|
self,
|
@@ -633,38 +577,23 @@ class Files(BaseSDK):
|
|
633
577
|
|
634
578
|
if utils.match_response(http_res, "200", "application/json"):
|
635
579
|
return operations.GetFileDetailsResponse(
|
636
|
-
result=utils.
|
580
|
+
result=utils.unmarshal_json_response(components.FileDetails, http_res),
|
637
581
|
headers=utils.get_response_headers(http_res.headers),
|
638
582
|
)
|
639
583
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
640
584
|
http_res_text = utils.stream_to_text(http_res)
|
641
|
-
raise errors.APIError(
|
642
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
643
|
-
)
|
585
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
644
586
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
645
587
|
http_res_text = utils.stream_to_text(http_res)
|
646
|
-
raise errors.APIError(
|
647
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
648
|
-
)
|
588
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
649
589
|
if utils.match_response(http_res, "4XX", "*"):
|
650
590
|
http_res_text = utils.stream_to_text(http_res)
|
651
|
-
raise errors.APIError(
|
652
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
653
|
-
)
|
591
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
654
592
|
if utils.match_response(http_res, "5XX", "*"):
|
655
593
|
http_res_text = utils.stream_to_text(http_res)
|
656
|
-
raise errors.APIError(
|
657
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
658
|
-
)
|
594
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
659
595
|
|
660
|
-
|
661
|
-
http_res_text = utils.stream_to_text(http_res)
|
662
|
-
raise errors.APIError(
|
663
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
664
|
-
http_res.status_code,
|
665
|
-
http_res_text,
|
666
|
-
http_res,
|
667
|
-
)
|
596
|
+
raise errors.APIError("Unexpected response received", http_res)
|
668
597
|
|
669
598
|
async def get_async(
|
670
599
|
self,
|
@@ -747,35 +676,20 @@ class Files(BaseSDK):
|
|
747
676
|
|
748
677
|
if utils.match_response(http_res, "200", "application/json"):
|
749
678
|
return operations.GetFileDetailsResponse(
|
750
|
-
result=utils.
|
679
|
+
result=utils.unmarshal_json_response(components.FileDetails, http_res),
|
751
680
|
headers=utils.get_response_headers(http_res.headers),
|
752
681
|
)
|
753
682
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
754
683
|
http_res_text = await utils.stream_to_text_async(http_res)
|
755
|
-
raise errors.APIError(
|
756
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
757
|
-
)
|
684
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
758
685
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
759
686
|
http_res_text = await utils.stream_to_text_async(http_res)
|
760
|
-
raise errors.APIError(
|
761
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
762
|
-
)
|
687
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
763
688
|
if utils.match_response(http_res, "4XX", "*"):
|
764
689
|
http_res_text = await utils.stream_to_text_async(http_res)
|
765
|
-
raise errors.APIError(
|
766
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
767
|
-
)
|
690
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
768
691
|
if utils.match_response(http_res, "5XX", "*"):
|
769
692
|
http_res_text = await utils.stream_to_text_async(http_res)
|
770
|
-
raise errors.APIError(
|
771
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
772
|
-
)
|
693
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
773
694
|
|
774
|
-
|
775
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
776
|
-
raise errors.APIError(
|
777
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
778
|
-
http_res.status_code,
|
779
|
-
http_res_text,
|
780
|
-
http_res,
|
781
|
-
)
|
695
|
+
raise errors.APIError("Unexpected response received", http_res)
|
moovio_sdk/industries.py
CHANGED
@@ -90,40 +90,25 @@ class Industries(BaseSDK):
|
|
90
90
|
|
91
91
|
if utils.match_response(http_res, "200", "application/json"):
|
92
92
|
return operations.ListIndustriesResponse(
|
93
|
-
result=utils.
|
94
|
-
|
93
|
+
result=utils.unmarshal_json_response(
|
94
|
+
components.EnrichedIndustries, http_res
|
95
95
|
),
|
96
96
|
headers=utils.get_response_headers(http_res.headers),
|
97
97
|
)
|
98
98
|
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
99
99
|
http_res_text = utils.stream_to_text(http_res)
|
100
|
-
raise errors.APIError(
|
101
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
102
|
-
)
|
100
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
103
101
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
104
102
|
http_res_text = utils.stream_to_text(http_res)
|
105
|
-
raise errors.APIError(
|
106
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
107
|
-
)
|
103
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
108
104
|
if utils.match_response(http_res, "4XX", "*"):
|
109
105
|
http_res_text = utils.stream_to_text(http_res)
|
110
|
-
raise errors.APIError(
|
111
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
112
|
-
)
|
106
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
113
107
|
if utils.match_response(http_res, "5XX", "*"):
|
114
108
|
http_res_text = utils.stream_to_text(http_res)
|
115
|
-
raise errors.APIError(
|
116
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
117
|
-
)
|
109
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
118
110
|
|
119
|
-
|
120
|
-
http_res_text = utils.stream_to_text(http_res)
|
121
|
-
raise errors.APIError(
|
122
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
123
|
-
http_res.status_code,
|
124
|
-
http_res_text,
|
125
|
-
http_res,
|
126
|
-
)
|
111
|
+
raise errors.APIError("Unexpected response received", http_res)
|
127
112
|
|
128
113
|
async def list_async(
|
129
114
|
self,
|
@@ -205,37 +190,22 @@ class Industries(BaseSDK):
|
|
205
190
|
|
206
191
|
if utils.match_response(http_res, "200", "application/json"):
|
207
192
|
return operations.ListIndustriesResponse(
|
208
|
-
result=utils.
|
209
|
-
|
193
|
+
result=utils.unmarshal_json_response(
|
194
|
+
components.EnrichedIndustries, http_res
|
210
195
|
),
|
211
196
|
headers=utils.get_response_headers(http_res.headers),
|
212
197
|
)
|
213
198
|
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
214
199
|
http_res_text = await utils.stream_to_text_async(http_res)
|
215
|
-
raise errors.APIError(
|
216
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
217
|
-
)
|
200
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
218
201
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
219
202
|
http_res_text = await utils.stream_to_text_async(http_res)
|
220
|
-
raise errors.APIError(
|
221
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
222
|
-
)
|
203
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
223
204
|
if utils.match_response(http_res, "4XX", "*"):
|
224
205
|
http_res_text = await utils.stream_to_text_async(http_res)
|
225
|
-
raise errors.APIError(
|
226
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
227
|
-
)
|
206
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
228
207
|
if utils.match_response(http_res, "5XX", "*"):
|
229
208
|
http_res_text = await utils.stream_to_text_async(http_res)
|
230
|
-
raise errors.APIError(
|
231
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
232
|
-
)
|
209
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
233
210
|
|
234
|
-
|
235
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
236
|
-
raise errors.APIError(
|
237
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
238
|
-
http_res.status_code,
|
239
|
-
http_res_text,
|
240
|
-
http_res,
|
241
|
-
)
|
211
|
+
raise errors.APIError("Unexpected response received", http_res)
|
moovio_sdk/institutions.py
CHANGED
@@ -98,40 +98,25 @@ class Institutions(BaseSDK):
|
|
98
98
|
|
99
99
|
if utils.match_response(http_res, "200", "application/json"):
|
100
100
|
return operations.SearchInstitutionsResponse(
|
101
|
-
result=utils.
|
102
|
-
|
101
|
+
result=utils.unmarshal_json_response(
|
102
|
+
components.InstitutionsSearchResponse, http_res
|
103
103
|
),
|
104
104
|
headers=utils.get_response_headers(http_res.headers),
|
105
105
|
)
|
106
106
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
107
107
|
http_res_text = utils.stream_to_text(http_res)
|
108
|
-
raise errors.APIError(
|
109
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
110
|
-
)
|
108
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
111
109
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
112
110
|
http_res_text = utils.stream_to_text(http_res)
|
113
|
-
raise errors.APIError(
|
114
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
115
|
-
)
|
111
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
116
112
|
if utils.match_response(http_res, "4XX", "*"):
|
117
113
|
http_res_text = utils.stream_to_text(http_res)
|
118
|
-
raise errors.APIError(
|
119
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
120
|
-
)
|
114
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
121
115
|
if utils.match_response(http_res, "5XX", "*"):
|
122
116
|
http_res_text = utils.stream_to_text(http_res)
|
123
|
-
raise errors.APIError(
|
124
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
125
|
-
)
|
117
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
126
118
|
|
127
|
-
|
128
|
-
http_res_text = utils.stream_to_text(http_res)
|
129
|
-
raise errors.APIError(
|
130
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
131
|
-
http_res.status_code,
|
132
|
-
http_res_text,
|
133
|
-
http_res,
|
134
|
-
)
|
119
|
+
raise errors.APIError("Unexpected response received", http_res)
|
135
120
|
|
136
121
|
async def search_institutions_async(
|
137
122
|
self,
|
@@ -221,40 +206,25 @@ class Institutions(BaseSDK):
|
|
221
206
|
|
222
207
|
if utils.match_response(http_res, "200", "application/json"):
|
223
208
|
return operations.SearchInstitutionsResponse(
|
224
|
-
result=utils.
|
225
|
-
|
209
|
+
result=utils.unmarshal_json_response(
|
210
|
+
components.InstitutionsSearchResponse, http_res
|
226
211
|
),
|
227
212
|
headers=utils.get_response_headers(http_res.headers),
|
228
213
|
)
|
229
214
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
230
215
|
http_res_text = await utils.stream_to_text_async(http_res)
|
231
|
-
raise errors.APIError(
|
232
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
233
|
-
)
|
216
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
234
217
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
235
218
|
http_res_text = await utils.stream_to_text_async(http_res)
|
236
|
-
raise errors.APIError(
|
237
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
238
|
-
)
|
219
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
239
220
|
if utils.match_response(http_res, "4XX", "*"):
|
240
221
|
http_res_text = await utils.stream_to_text_async(http_res)
|
241
|
-
raise errors.APIError(
|
242
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
243
|
-
)
|
222
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
244
223
|
if utils.match_response(http_res, "5XX", "*"):
|
245
224
|
http_res_text = await utils.stream_to_text_async(http_res)
|
246
|
-
raise errors.APIError(
|
247
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
248
|
-
)
|
225
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
249
226
|
|
250
|
-
|
251
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
252
|
-
raise errors.APIError(
|
253
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
254
|
-
http_res.status_code,
|
255
|
-
http_res_text,
|
256
|
-
http_res,
|
257
|
-
)
|
227
|
+
raise errors.APIError("Unexpected response received", http_res)
|
258
228
|
|
259
229
|
def search(
|
260
230
|
self,
|
@@ -344,43 +314,30 @@ class Institutions(BaseSDK):
|
|
344
314
|
response_data: Any = None
|
345
315
|
if utils.match_response(http_res, "200", "application/json"):
|
346
316
|
return operations.ListInstitutionsResponse(
|
347
|
-
result=utils.
|
348
|
-
|
317
|
+
result=utils.unmarshal_json_response(
|
318
|
+
components.FinancialInstitutions, http_res
|
349
319
|
),
|
350
320
|
headers=utils.get_response_headers(http_res.headers),
|
351
321
|
)
|
352
322
|
if utils.match_response(http_res, "400", "application/json"):
|
353
|
-
response_data = utils.
|
354
|
-
|
323
|
+
response_data = utils.unmarshal_json_response(
|
324
|
+
errors.GenericErrorData, http_res
|
325
|
+
)
|
326
|
+
raise errors.GenericError(response_data, http_res)
|
355
327
|
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
356
328
|
http_res_text = utils.stream_to_text(http_res)
|
357
|
-
raise errors.APIError(
|
358
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
359
|
-
)
|
329
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
360
330
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
361
331
|
http_res_text = utils.stream_to_text(http_res)
|
362
|
-
raise errors.APIError(
|
363
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
364
|
-
)
|
332
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
365
333
|
if utils.match_response(http_res, "4XX", "*"):
|
366
334
|
http_res_text = utils.stream_to_text(http_res)
|
367
|
-
raise errors.APIError(
|
368
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
369
|
-
)
|
335
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
370
336
|
if utils.match_response(http_res, "5XX", "*"):
|
371
337
|
http_res_text = utils.stream_to_text(http_res)
|
372
|
-
raise errors.APIError(
|
373
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
374
|
-
)
|
338
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
375
339
|
|
376
|
-
|
377
|
-
http_res_text = utils.stream_to_text(http_res)
|
378
|
-
raise errors.APIError(
|
379
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
380
|
-
http_res.status_code,
|
381
|
-
http_res_text,
|
382
|
-
http_res,
|
383
|
-
)
|
340
|
+
raise errors.APIError("Unexpected response received", http_res)
|
384
341
|
|
385
342
|
async def search_async(
|
386
343
|
self,
|
@@ -470,40 +427,27 @@ class Institutions(BaseSDK):
|
|
470
427
|
response_data: Any = None
|
471
428
|
if utils.match_response(http_res, "200", "application/json"):
|
472
429
|
return operations.ListInstitutionsResponse(
|
473
|
-
result=utils.
|
474
|
-
|
430
|
+
result=utils.unmarshal_json_response(
|
431
|
+
components.FinancialInstitutions, http_res
|
475
432
|
),
|
476
433
|
headers=utils.get_response_headers(http_res.headers),
|
477
434
|
)
|
478
435
|
if utils.match_response(http_res, "400", "application/json"):
|
479
|
-
response_data = utils.
|
480
|
-
|
436
|
+
response_data = utils.unmarshal_json_response(
|
437
|
+
errors.GenericErrorData, http_res
|
438
|
+
)
|
439
|
+
raise errors.GenericError(response_data, http_res)
|
481
440
|
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
482
441
|
http_res_text = await utils.stream_to_text_async(http_res)
|
483
|
-
raise errors.APIError(
|
484
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
485
|
-
)
|
442
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
486
443
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
487
444
|
http_res_text = await utils.stream_to_text_async(http_res)
|
488
|
-
raise errors.APIError(
|
489
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
490
|
-
)
|
445
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
491
446
|
if utils.match_response(http_res, "4XX", "*"):
|
492
447
|
http_res_text = await utils.stream_to_text_async(http_res)
|
493
|
-
raise errors.APIError(
|
494
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
495
|
-
)
|
448
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
496
449
|
if utils.match_response(http_res, "5XX", "*"):
|
497
450
|
http_res_text = await utils.stream_to_text_async(http_res)
|
498
|
-
raise errors.APIError(
|
499
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
500
|
-
)
|
451
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
501
452
|
|
502
|
-
|
503
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
504
|
-
raise errors.APIError(
|
505
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
506
|
-
http_res.status_code,
|
507
|
-
http_res_text,
|
508
|
-
http_res,
|
509
|
-
)
|
453
|
+
raise errors.APIError("Unexpected response received", http_res)
|