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/card_issuing.py
CHANGED
@@ -135,46 +135,33 @@ class CardIssuing(BaseSDK):
|
|
135
135
|
response_data: Any = None
|
136
136
|
if utils.match_response(http_res, "200", "application/json"):
|
137
137
|
return operations.RequestCardResponse(
|
138
|
-
result=utils.
|
138
|
+
result=utils.unmarshal_json_response(components.IssuedCard, http_res),
|
139
139
|
headers=utils.get_response_headers(http_res.headers),
|
140
140
|
)
|
141
141
|
if utils.match_response(http_res, "400", "application/json"):
|
142
|
-
response_data = utils.
|
143
|
-
|
142
|
+
response_data = utils.unmarshal_json_response(
|
143
|
+
errors.GenericErrorData, http_res
|
144
|
+
)
|
145
|
+
raise errors.GenericError(response_data, http_res)
|
144
146
|
if utils.match_response(http_res, "422", "application/json"):
|
145
|
-
response_data = utils.
|
146
|
-
|
147
|
+
response_data = utils.unmarshal_json_response(
|
148
|
+
errors.RequestCardErrorData, http_res
|
147
149
|
)
|
148
|
-
raise errors.RequestCardError(
|
150
|
+
raise errors.RequestCardError(response_data, http_res)
|
149
151
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
150
152
|
http_res_text = utils.stream_to_text(http_res)
|
151
|
-
raise errors.APIError(
|
152
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
153
|
-
)
|
153
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
154
154
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
155
155
|
http_res_text = utils.stream_to_text(http_res)
|
156
|
-
raise errors.APIError(
|
157
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
158
|
-
)
|
156
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
159
157
|
if utils.match_response(http_res, "4XX", "*"):
|
160
158
|
http_res_text = utils.stream_to_text(http_res)
|
161
|
-
raise errors.APIError(
|
162
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
163
|
-
)
|
159
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
164
160
|
if utils.match_response(http_res, "5XX", "*"):
|
165
161
|
http_res_text = utils.stream_to_text(http_res)
|
166
|
-
raise errors.APIError(
|
167
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
168
|
-
)
|
162
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
169
163
|
|
170
|
-
|
171
|
-
http_res_text = utils.stream_to_text(http_res)
|
172
|
-
raise errors.APIError(
|
173
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
174
|
-
http_res.status_code,
|
175
|
-
http_res_text,
|
176
|
-
http_res,
|
177
|
-
)
|
164
|
+
raise errors.APIError("Unexpected response received", http_res)
|
178
165
|
|
179
166
|
async def request_async(
|
180
167
|
self,
|
@@ -301,46 +288,33 @@ class CardIssuing(BaseSDK):
|
|
301
288
|
response_data: Any = None
|
302
289
|
if utils.match_response(http_res, "200", "application/json"):
|
303
290
|
return operations.RequestCardResponse(
|
304
|
-
result=utils.
|
291
|
+
result=utils.unmarshal_json_response(components.IssuedCard, http_res),
|
305
292
|
headers=utils.get_response_headers(http_res.headers),
|
306
293
|
)
|
307
294
|
if utils.match_response(http_res, "400", "application/json"):
|
308
|
-
response_data = utils.
|
309
|
-
|
295
|
+
response_data = utils.unmarshal_json_response(
|
296
|
+
errors.GenericErrorData, http_res
|
297
|
+
)
|
298
|
+
raise errors.GenericError(response_data, http_res)
|
310
299
|
if utils.match_response(http_res, "422", "application/json"):
|
311
|
-
response_data = utils.
|
312
|
-
|
300
|
+
response_data = utils.unmarshal_json_response(
|
301
|
+
errors.RequestCardErrorData, http_res
|
313
302
|
)
|
314
|
-
raise errors.RequestCardError(
|
303
|
+
raise errors.RequestCardError(response_data, http_res)
|
315
304
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
316
305
|
http_res_text = await utils.stream_to_text_async(http_res)
|
317
|
-
raise errors.APIError(
|
318
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
319
|
-
)
|
306
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
320
307
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
321
308
|
http_res_text = await utils.stream_to_text_async(http_res)
|
322
|
-
raise errors.APIError(
|
323
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
324
|
-
)
|
309
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
325
310
|
if utils.match_response(http_res, "4XX", "*"):
|
326
311
|
http_res_text = await utils.stream_to_text_async(http_res)
|
327
|
-
raise errors.APIError(
|
328
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
329
|
-
)
|
312
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
330
313
|
if utils.match_response(http_res, "5XX", "*"):
|
331
314
|
http_res_text = await utils.stream_to_text_async(http_res)
|
332
|
-
raise errors.APIError(
|
333
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
334
|
-
)
|
315
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
335
316
|
|
336
|
-
|
337
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
338
|
-
raise errors.APIError(
|
339
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
340
|
-
http_res.status_code,
|
341
|
-
http_res_text,
|
342
|
-
http_res,
|
343
|
-
)
|
317
|
+
raise errors.APIError("Unexpected response received", http_res)
|
344
318
|
|
345
319
|
def list(
|
346
320
|
self,
|
@@ -429,38 +403,25 @@ class CardIssuing(BaseSDK):
|
|
429
403
|
|
430
404
|
if utils.match_response(http_res, "200", "application/json"):
|
431
405
|
return operations.ListIssuedCardsResponse(
|
432
|
-
result=utils.
|
406
|
+
result=utils.unmarshal_json_response(
|
407
|
+
List[components.IssuedCard], http_res
|
408
|
+
),
|
433
409
|
headers=utils.get_response_headers(http_res.headers),
|
434
410
|
)
|
435
411
|
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
436
412
|
http_res_text = utils.stream_to_text(http_res)
|
437
|
-
raise errors.APIError(
|
438
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
439
|
-
)
|
413
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
440
414
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
441
415
|
http_res_text = utils.stream_to_text(http_res)
|
442
|
-
raise errors.APIError(
|
443
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
444
|
-
)
|
416
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
445
417
|
if utils.match_response(http_res, "4XX", "*"):
|
446
418
|
http_res_text = utils.stream_to_text(http_res)
|
447
|
-
raise errors.APIError(
|
448
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
449
|
-
)
|
419
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
450
420
|
if utils.match_response(http_res, "5XX", "*"):
|
451
421
|
http_res_text = utils.stream_to_text(http_res)
|
452
|
-
raise errors.APIError(
|
453
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
454
|
-
)
|
422
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
455
423
|
|
456
|
-
|
457
|
-
http_res_text = utils.stream_to_text(http_res)
|
458
|
-
raise errors.APIError(
|
459
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
460
|
-
http_res.status_code,
|
461
|
-
http_res_text,
|
462
|
-
http_res,
|
463
|
-
)
|
424
|
+
raise errors.APIError("Unexpected response received", http_res)
|
464
425
|
|
465
426
|
async def list_async(
|
466
427
|
self,
|
@@ -549,38 +510,25 @@ class CardIssuing(BaseSDK):
|
|
549
510
|
|
550
511
|
if utils.match_response(http_res, "200", "application/json"):
|
551
512
|
return operations.ListIssuedCardsResponse(
|
552
|
-
result=utils.
|
513
|
+
result=utils.unmarshal_json_response(
|
514
|
+
List[components.IssuedCard], http_res
|
515
|
+
),
|
553
516
|
headers=utils.get_response_headers(http_res.headers),
|
554
517
|
)
|
555
518
|
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
556
519
|
http_res_text = await utils.stream_to_text_async(http_res)
|
557
|
-
raise errors.APIError(
|
558
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
559
|
-
)
|
520
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
560
521
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
561
522
|
http_res_text = await utils.stream_to_text_async(http_res)
|
562
|
-
raise errors.APIError(
|
563
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
564
|
-
)
|
523
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
565
524
|
if utils.match_response(http_res, "4XX", "*"):
|
566
525
|
http_res_text = await utils.stream_to_text_async(http_res)
|
567
|
-
raise errors.APIError(
|
568
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
569
|
-
)
|
526
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
570
527
|
if utils.match_response(http_res, "5XX", "*"):
|
571
528
|
http_res_text = await utils.stream_to_text_async(http_res)
|
572
|
-
raise errors.APIError(
|
573
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
574
|
-
)
|
529
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
575
530
|
|
576
|
-
|
577
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
578
|
-
raise errors.APIError(
|
579
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
580
|
-
http_res.status_code,
|
581
|
-
http_res_text,
|
582
|
-
http_res,
|
583
|
-
)
|
531
|
+
raise errors.APIError("Unexpected response received", http_res)
|
584
532
|
|
585
533
|
def get(
|
586
534
|
self,
|
@@ -663,38 +611,23 @@ class CardIssuing(BaseSDK):
|
|
663
611
|
|
664
612
|
if utils.match_response(http_res, "200", "application/json"):
|
665
613
|
return operations.GetIssuedCardResponse(
|
666
|
-
result=utils.
|
614
|
+
result=utils.unmarshal_json_response(components.IssuedCard, http_res),
|
667
615
|
headers=utils.get_response_headers(http_res.headers),
|
668
616
|
)
|
669
617
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
670
618
|
http_res_text = utils.stream_to_text(http_res)
|
671
|
-
raise errors.APIError(
|
672
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
673
|
-
)
|
619
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
674
620
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
675
621
|
http_res_text = utils.stream_to_text(http_res)
|
676
|
-
raise errors.APIError(
|
677
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
678
|
-
)
|
622
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
679
623
|
if utils.match_response(http_res, "4XX", "*"):
|
680
624
|
http_res_text = utils.stream_to_text(http_res)
|
681
|
-
raise errors.APIError(
|
682
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
683
|
-
)
|
625
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
684
626
|
if utils.match_response(http_res, "5XX", "*"):
|
685
627
|
http_res_text = utils.stream_to_text(http_res)
|
686
|
-
raise errors.APIError(
|
687
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
688
|
-
)
|
628
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
689
629
|
|
690
|
-
|
691
|
-
http_res_text = utils.stream_to_text(http_res)
|
692
|
-
raise errors.APIError(
|
693
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
694
|
-
http_res.status_code,
|
695
|
-
http_res_text,
|
696
|
-
http_res,
|
697
|
-
)
|
630
|
+
raise errors.APIError("Unexpected response received", http_res)
|
698
631
|
|
699
632
|
async def get_async(
|
700
633
|
self,
|
@@ -777,38 +710,23 @@ class CardIssuing(BaseSDK):
|
|
777
710
|
|
778
711
|
if utils.match_response(http_res, "200", "application/json"):
|
779
712
|
return operations.GetIssuedCardResponse(
|
780
|
-
result=utils.
|
713
|
+
result=utils.unmarshal_json_response(components.IssuedCard, http_res),
|
781
714
|
headers=utils.get_response_headers(http_res.headers),
|
782
715
|
)
|
783
716
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
784
717
|
http_res_text = await utils.stream_to_text_async(http_res)
|
785
|
-
raise errors.APIError(
|
786
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
787
|
-
)
|
718
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
788
719
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
789
720
|
http_res_text = await utils.stream_to_text_async(http_res)
|
790
|
-
raise errors.APIError(
|
791
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
792
|
-
)
|
721
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
793
722
|
if utils.match_response(http_res, "4XX", "*"):
|
794
723
|
http_res_text = await utils.stream_to_text_async(http_res)
|
795
|
-
raise errors.APIError(
|
796
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
797
|
-
)
|
724
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
798
725
|
if utils.match_response(http_res, "5XX", "*"):
|
799
726
|
http_res_text = await utils.stream_to_text_async(http_res)
|
800
|
-
raise errors.APIError(
|
801
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
802
|
-
)
|
727
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
803
728
|
|
804
|
-
|
805
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
806
|
-
raise errors.APIError(
|
807
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
808
|
-
http_res.status_code,
|
809
|
-
http_res_text,
|
810
|
-
http_res,
|
811
|
-
)
|
729
|
+
raise errors.APIError("Unexpected response received", http_res)
|
812
730
|
|
813
731
|
def update(
|
814
732
|
self,
|
@@ -932,42 +850,29 @@ class CardIssuing(BaseSDK):
|
|
932
850
|
headers=utils.get_response_headers(http_res.headers)
|
933
851
|
)
|
934
852
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
935
|
-
response_data = utils.
|
936
|
-
|
853
|
+
response_data = utils.unmarshal_json_response(
|
854
|
+
errors.GenericErrorData, http_res
|
855
|
+
)
|
856
|
+
raise errors.GenericError(response_data, http_res)
|
937
857
|
if utils.match_response(http_res, "422", "application/json"):
|
938
|
-
response_data = utils.
|
939
|
-
|
858
|
+
response_data = utils.unmarshal_json_response(
|
859
|
+
errors.UpdateIssuedCardErrorData, http_res
|
940
860
|
)
|
941
|
-
raise errors.UpdateIssuedCardError(
|
861
|
+
raise errors.UpdateIssuedCardError(response_data, http_res)
|
942
862
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
943
863
|
http_res_text = utils.stream_to_text(http_res)
|
944
|
-
raise errors.APIError(
|
945
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
946
|
-
)
|
864
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
947
865
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
948
866
|
http_res_text = utils.stream_to_text(http_res)
|
949
|
-
raise errors.APIError(
|
950
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
951
|
-
)
|
867
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
952
868
|
if utils.match_response(http_res, "4XX", "*"):
|
953
869
|
http_res_text = utils.stream_to_text(http_res)
|
954
|
-
raise errors.APIError(
|
955
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
956
|
-
)
|
870
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
957
871
|
if utils.match_response(http_res, "5XX", "*"):
|
958
872
|
http_res_text = utils.stream_to_text(http_res)
|
959
|
-
raise errors.APIError(
|
960
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
961
|
-
)
|
873
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
962
874
|
|
963
|
-
|
964
|
-
http_res_text = utils.stream_to_text(http_res)
|
965
|
-
raise errors.APIError(
|
966
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
967
|
-
http_res.status_code,
|
968
|
-
http_res_text,
|
969
|
-
http_res,
|
970
|
-
)
|
875
|
+
raise errors.APIError("Unexpected response received", http_res)
|
971
876
|
|
972
877
|
async def update_async(
|
973
878
|
self,
|
@@ -1091,42 +996,29 @@ class CardIssuing(BaseSDK):
|
|
1091
996
|
headers=utils.get_response_headers(http_res.headers)
|
1092
997
|
)
|
1093
998
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
1094
|
-
response_data = utils.
|
1095
|
-
|
999
|
+
response_data = utils.unmarshal_json_response(
|
1000
|
+
errors.GenericErrorData, http_res
|
1001
|
+
)
|
1002
|
+
raise errors.GenericError(response_data, http_res)
|
1096
1003
|
if utils.match_response(http_res, "422", "application/json"):
|
1097
|
-
response_data = utils.
|
1098
|
-
|
1004
|
+
response_data = utils.unmarshal_json_response(
|
1005
|
+
errors.UpdateIssuedCardErrorData, http_res
|
1099
1006
|
)
|
1100
|
-
raise errors.UpdateIssuedCardError(
|
1007
|
+
raise errors.UpdateIssuedCardError(response_data, http_res)
|
1101
1008
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1102
1009
|
http_res_text = await utils.stream_to_text_async(http_res)
|
1103
|
-
raise errors.APIError(
|
1104
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
1105
|
-
)
|
1010
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
1106
1011
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
1107
1012
|
http_res_text = await utils.stream_to_text_async(http_res)
|
1108
|
-
raise errors.APIError(
|
1109
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
1110
|
-
)
|
1013
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
1111
1014
|
if utils.match_response(http_res, "4XX", "*"):
|
1112
1015
|
http_res_text = await utils.stream_to_text_async(http_res)
|
1113
|
-
raise errors.APIError(
|
1114
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
1115
|
-
)
|
1016
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
1116
1017
|
if utils.match_response(http_res, "5XX", "*"):
|
1117
1018
|
http_res_text = await utils.stream_to_text_async(http_res)
|
1118
|
-
raise errors.APIError(
|
1119
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
1120
|
-
)
|
1019
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
1121
1020
|
|
1122
|
-
|
1123
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
1124
|
-
raise errors.APIError(
|
1125
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1126
|
-
http_res.status_code,
|
1127
|
-
http_res_text,
|
1128
|
-
http_res,
|
1129
|
-
)
|
1021
|
+
raise errors.APIError("Unexpected response received", http_res)
|
1130
1022
|
|
1131
1023
|
def get_full(
|
1132
1024
|
self,
|
@@ -1211,38 +1103,25 @@ class CardIssuing(BaseSDK):
|
|
1211
1103
|
|
1212
1104
|
if utils.match_response(http_res, "200", "application/json"):
|
1213
1105
|
return operations.GetFullIssuedCardResponse(
|
1214
|
-
result=utils.
|
1106
|
+
result=utils.unmarshal_json_response(
|
1107
|
+
components.FullIssuedCard, http_res
|
1108
|
+
),
|
1215
1109
|
headers=utils.get_response_headers(http_res.headers),
|
1216
1110
|
)
|
1217
1111
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1218
1112
|
http_res_text = utils.stream_to_text(http_res)
|
1219
|
-
raise errors.APIError(
|
1220
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
1221
|
-
)
|
1113
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
1222
1114
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
1223
1115
|
http_res_text = utils.stream_to_text(http_res)
|
1224
|
-
raise errors.APIError(
|
1225
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
1226
|
-
)
|
1116
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
1227
1117
|
if utils.match_response(http_res, "4XX", "*"):
|
1228
1118
|
http_res_text = utils.stream_to_text(http_res)
|
1229
|
-
raise errors.APIError(
|
1230
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
1231
|
-
)
|
1119
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
1232
1120
|
if utils.match_response(http_res, "5XX", "*"):
|
1233
1121
|
http_res_text = utils.stream_to_text(http_res)
|
1234
|
-
raise errors.APIError(
|
1235
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
1236
|
-
)
|
1122
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
1237
1123
|
|
1238
|
-
|
1239
|
-
http_res_text = utils.stream_to_text(http_res)
|
1240
|
-
raise errors.APIError(
|
1241
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1242
|
-
http_res.status_code,
|
1243
|
-
http_res_text,
|
1244
|
-
http_res,
|
1245
|
-
)
|
1124
|
+
raise errors.APIError("Unexpected response received", http_res)
|
1246
1125
|
|
1247
1126
|
async def get_full_async(
|
1248
1127
|
self,
|
@@ -1327,35 +1206,22 @@ class CardIssuing(BaseSDK):
|
|
1327
1206
|
|
1328
1207
|
if utils.match_response(http_res, "200", "application/json"):
|
1329
1208
|
return operations.GetFullIssuedCardResponse(
|
1330
|
-
result=utils.
|
1209
|
+
result=utils.unmarshal_json_response(
|
1210
|
+
components.FullIssuedCard, http_res
|
1211
|
+
),
|
1331
1212
|
headers=utils.get_response_headers(http_res.headers),
|
1332
1213
|
)
|
1333
1214
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1334
1215
|
http_res_text = await utils.stream_to_text_async(http_res)
|
1335
|
-
raise errors.APIError(
|
1336
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
1337
|
-
)
|
1216
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
1338
1217
|
if utils.match_response(http_res, ["500", "504"], "*"):
|
1339
1218
|
http_res_text = await utils.stream_to_text_async(http_res)
|
1340
|
-
raise errors.APIError(
|
1341
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
1342
|
-
)
|
1219
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
1343
1220
|
if utils.match_response(http_res, "4XX", "*"):
|
1344
1221
|
http_res_text = await utils.stream_to_text_async(http_res)
|
1345
|
-
raise errors.APIError(
|
1346
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
1347
|
-
)
|
1222
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
1348
1223
|
if utils.match_response(http_res, "5XX", "*"):
|
1349
1224
|
http_res_text = await utils.stream_to_text_async(http_res)
|
1350
|
-
raise errors.APIError(
|
1351
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
1352
|
-
)
|
1225
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
1353
1226
|
|
1354
|
-
|
1355
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
1356
|
-
raise errors.APIError(
|
1357
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1358
|
-
http_res.status_code,
|
1359
|
-
http_res_text,
|
1360
|
-
http_res,
|
1361
|
-
)
|
1227
|
+
raise errors.APIError("Unexpected response received", http_res)
|