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.
Files changed (99) hide show
  1. moovio_sdk/_version.py +3 -3
  2. moovio_sdk/account_terminal_applications.py +70 -186
  3. moovio_sdk/accounts.py +168 -408
  4. moovio_sdk/adjustments.py +28 -84
  5. moovio_sdk/apple_pay.py +102 -236
  6. moovio_sdk/authentication.py +50 -102
  7. moovio_sdk/avatars.py +10 -38
  8. moovio_sdk/bank_accounts.py +174 -420
  9. moovio_sdk/basesdk.py +4 -4
  10. moovio_sdk/branding.py +106 -198
  11. moovio_sdk/capabilities.py +76 -180
  12. moovio_sdk/card_issuing.py +94 -228
  13. moovio_sdk/cards.py +94 -232
  14. moovio_sdk/disputes.py +204 -500
  15. moovio_sdk/end_to_end_encryption.py +28 -80
  16. moovio_sdk/enriched_address.py +14 -44
  17. moovio_sdk/enriched_profile.py +14 -44
  18. moovio_sdk/fee_plans.py +116 -314
  19. moovio_sdk/files.py +52 -138
  20. moovio_sdk/industries.py +14 -44
  21. moovio_sdk/institutions.py +36 -92
  22. moovio_sdk/issuing_transactions.py +70 -220
  23. moovio_sdk/models/components/__init__.py +39 -0
  24. moovio_sdk/models/components/createticket.py +24 -0
  25. moovio_sdk/models/components/createticketcontacterror.py +17 -0
  26. moovio_sdk/models/components/ticket.py +44 -0
  27. moovio_sdk/models/components/ticketcontact.py +17 -0
  28. moovio_sdk/models/components/ticketmessage.py +21 -0
  29. moovio_sdk/models/components/ticketstatus.py +11 -0
  30. moovio_sdk/models/components/updateticket.py +19 -0
  31. moovio_sdk/models/components/updateticketstatus.py +8 -0
  32. moovio_sdk/models/errors/__init__.py +19 -0
  33. moovio_sdk/models/errors/accountterminalapplicationerror.py +11 -6
  34. moovio_sdk/models/errors/addcapabilitieserror.py +11 -6
  35. moovio_sdk/models/errors/apierror.py +30 -14
  36. moovio_sdk/models/errors/assigncountrieserror.py +12 -6
  37. moovio_sdk/models/errors/authtokenrequesterror.py +11 -6
  38. moovio_sdk/models/errors/bankaccountvalidationerror.py +11 -6
  39. moovio_sdk/models/errors/brandvalidationerror.py +11 -6
  40. moovio_sdk/models/errors/cardacquiringrefund.py +11 -6
  41. moovio_sdk/models/errors/createaccount.py +12 -6
  42. moovio_sdk/models/errors/createpaymentlinkerror.py +11 -6
  43. moovio_sdk/models/errors/createsweepconfigerror.py +11 -6
  44. moovio_sdk/models/errors/createticketerror.py +34 -0
  45. moovio_sdk/models/errors/feeplanagreementerror.py +11 -6
  46. moovio_sdk/models/errors/fileuploadvalidationerror.py +11 -6
  47. moovio_sdk/models/errors/filevalidationerror.py +11 -6
  48. moovio_sdk/models/errors/genericerror.py +12 -6
  49. moovio_sdk/models/errors/linkapplepayerror.py +11 -6
  50. moovio_sdk/models/errors/linkcarderror.py +11 -6
  51. moovio_sdk/models/errors/microdepositvalidationerror.py +11 -6
  52. moovio_sdk/models/errors/mooverror.py +26 -0
  53. moovio_sdk/models/errors/no_response_error.py +13 -0
  54. moovio_sdk/models/errors/onboardinginviteerror.py +11 -6
  55. moovio_sdk/models/errors/patchsweepconfigerror.py +11 -6
  56. moovio_sdk/models/errors/refundvalidationerror.py +11 -6
  57. moovio_sdk/models/errors/representativevalidationerror.py +11 -6
  58. moovio_sdk/models/errors/requestcarderror.py +11 -6
  59. moovio_sdk/models/errors/responsevalidationerror.py +25 -0
  60. moovio_sdk/models/errors/reversalvalidationerror.py +11 -6
  61. moovio_sdk/models/errors/revoketokenrequesterror.py +11 -6
  62. moovio_sdk/models/errors/schedulevalidationerror.py +11 -6
  63. moovio_sdk/models/errors/terminalapplicationerror.py +11 -6
  64. moovio_sdk/models/errors/transfer.py +11 -6
  65. moovio_sdk/models/errors/transferoptionsvalidationerror.py +11 -6
  66. moovio_sdk/models/errors/transfervalidationerror.py +11 -6
  67. moovio_sdk/models/errors/updateaccount.py +12 -6
  68. moovio_sdk/models/errors/updatecarderror.py +11 -6
  69. moovio_sdk/models/errors/updateissuedcarderror.py +11 -6
  70. moovio_sdk/models/errors/updatepaymentlinkerror.py +11 -6
  71. moovio_sdk/models/errors/updateticketerror.py +25 -0
  72. moovio_sdk/models/errors/updateunderwritingerror.py +11 -6
  73. moovio_sdk/models/errors/upsertunderwritingerror.py +11 -6
  74. moovio_sdk/models/operations/__init__.py +100 -0
  75. moovio_sdk/models/operations/createticket.py +78 -0
  76. moovio_sdk/models/operations/getticket.py +71 -0
  77. moovio_sdk/models/operations/listticketmessages.py +88 -0
  78. moovio_sdk/models/operations/listtickets.py +81 -0
  79. moovio_sdk/models/operations/updateticket.py +85 -0
  80. moovio_sdk/onboarding.py +66 -166
  81. moovio_sdk/payment_links.py +106 -272
  82. moovio_sdk/payment_methods.py +30 -86
  83. moovio_sdk/ping.py +10 -40
  84. moovio_sdk/receipts.py +36 -92
  85. moovio_sdk/representatives.py +102 -228
  86. moovio_sdk/scheduling.py +122 -278
  87. moovio_sdk/sdk.py +3 -0
  88. moovio_sdk/support.py +1153 -0
  89. moovio_sdk/sweeps.py +102 -274
  90. moovio_sdk/terminal_applications.py +74 -186
  91. moovio_sdk/transfers.py +266 -582
  92. moovio_sdk/underwriting.py +64 -146
  93. moovio_sdk/utils/__init__.py +3 -0
  94. moovio_sdk/utils/serializers.py +21 -3
  95. moovio_sdk/wallet_transactions.py +28 -88
  96. moovio_sdk/wallets.py +24 -84
  97. {moovio_sdk-0.12.0.dist-info → moovio_sdk-0.13.1.dist-info}/METADATA +103 -28
  98. {moovio_sdk-0.12.0.dist-info → moovio_sdk-0.13.1.dist-info}/RECORD +99 -80
  99. {moovio_sdk-0.12.0.dist-info → moovio_sdk-0.13.1.dist-info}/WHEEL +0 -0
moovio_sdk/scheduling.py CHANGED
@@ -119,46 +119,35 @@ class Scheduling(BaseSDK):
119
119
  response_data: Any = None
120
120
  if utils.match_response(http_res, "200", "application/json"):
121
121
  return operations.CreateScheduleResponse(
122
- result=utils.unmarshal_json(http_res.text, components.ScheduleResponse),
122
+ result=utils.unmarshal_json_response(
123
+ components.ScheduleResponse, http_res
124
+ ),
123
125
  headers=utils.get_response_headers(http_res.headers),
124
126
  )
125
127
  if utils.match_response(http_res, ["400", "409"], "application/json"):
126
- response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
127
- raise errors.GenericError(data=response_data)
128
+ response_data = utils.unmarshal_json_response(
129
+ errors.GenericErrorData, http_res
130
+ )
131
+ raise errors.GenericError(response_data, http_res)
128
132
  if utils.match_response(http_res, "422", "application/json"):
129
- response_data = utils.unmarshal_json(
130
- http_res.text, errors.ScheduleValidationErrorData
133
+ response_data = utils.unmarshal_json_response(
134
+ errors.ScheduleValidationErrorData, http_res
131
135
  )
132
- raise errors.ScheduleValidationError(data=response_data)
136
+ raise errors.ScheduleValidationError(response_data, http_res)
133
137
  if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
134
138
  http_res_text = utils.stream_to_text(http_res)
135
- raise errors.APIError(
136
- "API error occurred", http_res.status_code, http_res_text, http_res
137
- )
139
+ raise errors.APIError("API error occurred", http_res, http_res_text)
138
140
  if utils.match_response(http_res, ["500", "504"], "*"):
139
141
  http_res_text = utils.stream_to_text(http_res)
140
- raise errors.APIError(
141
- "API error occurred", http_res.status_code, http_res_text, http_res
142
- )
142
+ raise errors.APIError("API error occurred", http_res, http_res_text)
143
143
  if utils.match_response(http_res, "4XX", "*"):
144
144
  http_res_text = utils.stream_to_text(http_res)
145
- raise errors.APIError(
146
- "API error occurred", http_res.status_code, http_res_text, http_res
147
- )
145
+ raise errors.APIError("API error occurred", http_res, http_res_text)
148
146
  if utils.match_response(http_res, "5XX", "*"):
149
147
  http_res_text = utils.stream_to_text(http_res)
150
- raise errors.APIError(
151
- "API error occurred", http_res.status_code, http_res_text, http_res
152
- )
148
+ raise errors.APIError("API error occurred", http_res, http_res_text)
153
149
 
154
- content_type = http_res.headers.get("Content-Type")
155
- http_res_text = utils.stream_to_text(http_res)
156
- raise errors.APIError(
157
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
158
- http_res.status_code,
159
- http_res_text,
160
- http_res,
161
- )
150
+ raise errors.APIError("Unexpected response received", http_res)
162
151
 
163
152
  async def create_async(
164
153
  self,
@@ -269,46 +258,35 @@ class Scheduling(BaseSDK):
269
258
  response_data: Any = None
270
259
  if utils.match_response(http_res, "200", "application/json"):
271
260
  return operations.CreateScheduleResponse(
272
- result=utils.unmarshal_json(http_res.text, components.ScheduleResponse),
261
+ result=utils.unmarshal_json_response(
262
+ components.ScheduleResponse, http_res
263
+ ),
273
264
  headers=utils.get_response_headers(http_res.headers),
274
265
  )
275
266
  if utils.match_response(http_res, ["400", "409"], "application/json"):
276
- response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
277
- raise errors.GenericError(data=response_data)
267
+ response_data = utils.unmarshal_json_response(
268
+ errors.GenericErrorData, http_res
269
+ )
270
+ raise errors.GenericError(response_data, http_res)
278
271
  if utils.match_response(http_res, "422", "application/json"):
279
- response_data = utils.unmarshal_json(
280
- http_res.text, errors.ScheduleValidationErrorData
272
+ response_data = utils.unmarshal_json_response(
273
+ errors.ScheduleValidationErrorData, http_res
281
274
  )
282
- raise errors.ScheduleValidationError(data=response_data)
275
+ raise errors.ScheduleValidationError(response_data, http_res)
283
276
  if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
284
277
  http_res_text = await utils.stream_to_text_async(http_res)
285
- raise errors.APIError(
286
- "API error occurred", http_res.status_code, http_res_text, http_res
287
- )
278
+ raise errors.APIError("API error occurred", http_res, http_res_text)
288
279
  if utils.match_response(http_res, ["500", "504"], "*"):
289
280
  http_res_text = await utils.stream_to_text_async(http_res)
290
- raise errors.APIError(
291
- "API error occurred", http_res.status_code, http_res_text, http_res
292
- )
281
+ raise errors.APIError("API error occurred", http_res, http_res_text)
293
282
  if utils.match_response(http_res, "4XX", "*"):
294
283
  http_res_text = await utils.stream_to_text_async(http_res)
295
- raise errors.APIError(
296
- "API error occurred", http_res.status_code, http_res_text, http_res
297
- )
284
+ raise errors.APIError("API error occurred", http_res, http_res_text)
298
285
  if utils.match_response(http_res, "5XX", "*"):
299
286
  http_res_text = await utils.stream_to_text_async(http_res)
300
- raise errors.APIError(
301
- "API error occurred", http_res.status_code, http_res_text, http_res
302
- )
287
+ raise errors.APIError("API error occurred", http_res, http_res_text)
303
288
 
304
- content_type = http_res.headers.get("Content-Type")
305
- http_res_text = await utils.stream_to_text_async(http_res)
306
- raise errors.APIError(
307
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
308
- http_res.status_code,
309
- http_res_text,
310
- http_res,
311
- )
289
+ raise errors.APIError("Unexpected response received", http_res)
312
290
 
313
291
  def list(
314
292
  self,
@@ -397,40 +375,25 @@ class Scheduling(BaseSDK):
397
375
 
398
376
  if utils.match_response(http_res, "200", "application/json"):
399
377
  return operations.ListSchedulesResponse(
400
- result=utils.unmarshal_json(
401
- http_res.text, List[components.ScheduleListResponse]
378
+ result=utils.unmarshal_json_response(
379
+ List[components.ScheduleListResponse], http_res
402
380
  ),
403
381
  headers=utils.get_response_headers(http_res.headers),
404
382
  )
405
383
  if utils.match_response(http_res, ["401", "403", "429"], "*"):
406
384
  http_res_text = utils.stream_to_text(http_res)
407
- raise errors.APIError(
408
- "API error occurred", http_res.status_code, http_res_text, http_res
409
- )
385
+ raise errors.APIError("API error occurred", http_res, http_res_text)
410
386
  if utils.match_response(http_res, ["500", "504"], "*"):
411
387
  http_res_text = utils.stream_to_text(http_res)
412
- raise errors.APIError(
413
- "API error occurred", http_res.status_code, http_res_text, http_res
414
- )
388
+ raise errors.APIError("API error occurred", http_res, http_res_text)
415
389
  if utils.match_response(http_res, "4XX", "*"):
416
390
  http_res_text = utils.stream_to_text(http_res)
417
- raise errors.APIError(
418
- "API error occurred", http_res.status_code, http_res_text, http_res
419
- )
391
+ raise errors.APIError("API error occurred", http_res, http_res_text)
420
392
  if utils.match_response(http_res, "5XX", "*"):
421
393
  http_res_text = utils.stream_to_text(http_res)
422
- raise errors.APIError(
423
- "API error occurred", http_res.status_code, http_res_text, http_res
424
- )
394
+ raise errors.APIError("API error occurred", http_res, http_res_text)
425
395
 
426
- content_type = http_res.headers.get("Content-Type")
427
- http_res_text = utils.stream_to_text(http_res)
428
- raise errors.APIError(
429
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
430
- http_res.status_code,
431
- http_res_text,
432
- http_res,
433
- )
396
+ raise errors.APIError("Unexpected response received", http_res)
434
397
 
435
398
  async def list_async(
436
399
  self,
@@ -519,40 +482,25 @@ class Scheduling(BaseSDK):
519
482
 
520
483
  if utils.match_response(http_res, "200", "application/json"):
521
484
  return operations.ListSchedulesResponse(
522
- result=utils.unmarshal_json(
523
- http_res.text, List[components.ScheduleListResponse]
485
+ result=utils.unmarshal_json_response(
486
+ List[components.ScheduleListResponse], http_res
524
487
  ),
525
488
  headers=utils.get_response_headers(http_res.headers),
526
489
  )
527
490
  if utils.match_response(http_res, ["401", "403", "429"], "*"):
528
491
  http_res_text = await utils.stream_to_text_async(http_res)
529
- raise errors.APIError(
530
- "API error occurred", http_res.status_code, http_res_text, http_res
531
- )
492
+ raise errors.APIError("API error occurred", http_res, http_res_text)
532
493
  if utils.match_response(http_res, ["500", "504"], "*"):
533
494
  http_res_text = await utils.stream_to_text_async(http_res)
534
- raise errors.APIError(
535
- "API error occurred", http_res.status_code, http_res_text, http_res
536
- )
495
+ raise errors.APIError("API error occurred", http_res, http_res_text)
537
496
  if utils.match_response(http_res, "4XX", "*"):
538
497
  http_res_text = await utils.stream_to_text_async(http_res)
539
- raise errors.APIError(
540
- "API error occurred", http_res.status_code, http_res_text, http_res
541
- )
498
+ raise errors.APIError("API error occurred", http_res, http_res_text)
542
499
  if utils.match_response(http_res, "5XX", "*"):
543
500
  http_res_text = await utils.stream_to_text_async(http_res)
544
- raise errors.APIError(
545
- "API error occurred", http_res.status_code, http_res_text, http_res
546
- )
501
+ raise errors.APIError("API error occurred", http_res, http_res_text)
547
502
 
548
- content_type = http_res.headers.get("Content-Type")
549
- http_res_text = await utils.stream_to_text_async(http_res)
550
- raise errors.APIError(
551
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
552
- http_res.status_code,
553
- http_res_text,
554
- http_res,
555
- )
503
+ raise errors.APIError("Unexpected response received", http_res)
556
504
 
557
505
  def update(
558
506
  self,
@@ -666,46 +614,35 @@ class Scheduling(BaseSDK):
666
614
  response_data: Any = None
667
615
  if utils.match_response(http_res, "200", "application/json"):
668
616
  return operations.UpdateScheduleResponse(
669
- result=utils.unmarshal_json(http_res.text, components.ScheduleResponse),
617
+ result=utils.unmarshal_json_response(
618
+ components.ScheduleResponse, http_res
619
+ ),
670
620
  headers=utils.get_response_headers(http_res.headers),
671
621
  )
672
622
  if utils.match_response(http_res, ["400", "409"], "application/json"):
673
- response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
674
- raise errors.GenericError(data=response_data)
623
+ response_data = utils.unmarshal_json_response(
624
+ errors.GenericErrorData, http_res
625
+ )
626
+ raise errors.GenericError(response_data, http_res)
675
627
  if utils.match_response(http_res, "422", "application/json"):
676
- response_data = utils.unmarshal_json(
677
- http_res.text, errors.ScheduleValidationErrorData
628
+ response_data = utils.unmarshal_json_response(
629
+ errors.ScheduleValidationErrorData, http_res
678
630
  )
679
- raise errors.ScheduleValidationError(data=response_data)
631
+ raise errors.ScheduleValidationError(response_data, http_res)
680
632
  if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
681
633
  http_res_text = utils.stream_to_text(http_res)
682
- raise errors.APIError(
683
- "API error occurred", http_res.status_code, http_res_text, http_res
684
- )
634
+ raise errors.APIError("API error occurred", http_res, http_res_text)
685
635
  if utils.match_response(http_res, ["500", "504"], "*"):
686
636
  http_res_text = utils.stream_to_text(http_res)
687
- raise errors.APIError(
688
- "API error occurred", http_res.status_code, http_res_text, http_res
689
- )
637
+ raise errors.APIError("API error occurred", http_res, http_res_text)
690
638
  if utils.match_response(http_res, "4XX", "*"):
691
639
  http_res_text = utils.stream_to_text(http_res)
692
- raise errors.APIError(
693
- "API error occurred", http_res.status_code, http_res_text, http_res
694
- )
640
+ raise errors.APIError("API error occurred", http_res, http_res_text)
695
641
  if utils.match_response(http_res, "5XX", "*"):
696
642
  http_res_text = utils.stream_to_text(http_res)
697
- raise errors.APIError(
698
- "API error occurred", http_res.status_code, http_res_text, http_res
699
- )
643
+ raise errors.APIError("API error occurred", http_res, http_res_text)
700
644
 
701
- content_type = http_res.headers.get("Content-Type")
702
- http_res_text = utils.stream_to_text(http_res)
703
- raise errors.APIError(
704
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
705
- http_res.status_code,
706
- http_res_text,
707
- http_res,
708
- )
645
+ raise errors.APIError("Unexpected response received", http_res)
709
646
 
710
647
  async def update_async(
711
648
  self,
@@ -819,46 +756,35 @@ class Scheduling(BaseSDK):
819
756
  response_data: Any = None
820
757
  if utils.match_response(http_res, "200", "application/json"):
821
758
  return operations.UpdateScheduleResponse(
822
- result=utils.unmarshal_json(http_res.text, components.ScheduleResponse),
759
+ result=utils.unmarshal_json_response(
760
+ components.ScheduleResponse, http_res
761
+ ),
823
762
  headers=utils.get_response_headers(http_res.headers),
824
763
  )
825
764
  if utils.match_response(http_res, ["400", "409"], "application/json"):
826
- response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
827
- raise errors.GenericError(data=response_data)
765
+ response_data = utils.unmarshal_json_response(
766
+ errors.GenericErrorData, http_res
767
+ )
768
+ raise errors.GenericError(response_data, http_res)
828
769
  if utils.match_response(http_res, "422", "application/json"):
829
- response_data = utils.unmarshal_json(
830
- http_res.text, errors.ScheduleValidationErrorData
770
+ response_data = utils.unmarshal_json_response(
771
+ errors.ScheduleValidationErrorData, http_res
831
772
  )
832
- raise errors.ScheduleValidationError(data=response_data)
773
+ raise errors.ScheduleValidationError(response_data, http_res)
833
774
  if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
834
775
  http_res_text = await utils.stream_to_text_async(http_res)
835
- raise errors.APIError(
836
- "API error occurred", http_res.status_code, http_res_text, http_res
837
- )
776
+ raise errors.APIError("API error occurred", http_res, http_res_text)
838
777
  if utils.match_response(http_res, ["500", "504"], "*"):
839
778
  http_res_text = await utils.stream_to_text_async(http_res)
840
- raise errors.APIError(
841
- "API error occurred", http_res.status_code, http_res_text, http_res
842
- )
779
+ raise errors.APIError("API error occurred", http_res, http_res_text)
843
780
  if utils.match_response(http_res, "4XX", "*"):
844
781
  http_res_text = await utils.stream_to_text_async(http_res)
845
- raise errors.APIError(
846
- "API error occurred", http_res.status_code, http_res_text, http_res
847
- )
782
+ raise errors.APIError("API error occurred", http_res, http_res_text)
848
783
  if utils.match_response(http_res, "5XX", "*"):
849
784
  http_res_text = await utils.stream_to_text_async(http_res)
850
- raise errors.APIError(
851
- "API error occurred", http_res.status_code, http_res_text, http_res
852
- )
785
+ raise errors.APIError("API error occurred", http_res, http_res_text)
853
786
 
854
- content_type = http_res.headers.get("Content-Type")
855
- http_res_text = await utils.stream_to_text_async(http_res)
856
- raise errors.APIError(
857
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
858
- http_res.status_code,
859
- http_res_text,
860
- http_res,
861
- )
787
+ raise errors.APIError("Unexpected response received", http_res)
862
788
 
863
789
  def get(
864
790
  self,
@@ -941,38 +867,25 @@ class Scheduling(BaseSDK):
941
867
 
942
868
  if utils.match_response(http_res, "200", "application/json"):
943
869
  return operations.GetSchedulesResponse(
944
- result=utils.unmarshal_json(http_res.text, components.ScheduleResponse),
870
+ result=utils.unmarshal_json_response(
871
+ components.ScheduleResponse, http_res
872
+ ),
945
873
  headers=utils.get_response_headers(http_res.headers),
946
874
  )
947
875
  if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
948
876
  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
- )
877
+ raise errors.APIError("API error occurred", http_res, http_res_text)
952
878
  if utils.match_response(http_res, ["500", "504"], "*"):
953
879
  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
- )
880
+ raise errors.APIError("API error occurred", http_res, http_res_text)
957
881
  if utils.match_response(http_res, "4XX", "*"):
958
882
  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
- )
883
+ raise errors.APIError("API error occurred", http_res, http_res_text)
962
884
  if utils.match_response(http_res, "5XX", "*"):
963
885
  http_res_text = utils.stream_to_text(http_res)
964
- raise errors.APIError(
965
- "API error occurred", http_res.status_code, http_res_text, http_res
966
- )
886
+ raise errors.APIError("API error occurred", http_res, http_res_text)
967
887
 
968
- content_type = http_res.headers.get("Content-Type")
969
- http_res_text = utils.stream_to_text(http_res)
970
- raise errors.APIError(
971
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
972
- http_res.status_code,
973
- http_res_text,
974
- http_res,
975
- )
888
+ raise errors.APIError("Unexpected response received", http_res)
976
889
 
977
890
  async def get_async(
978
891
  self,
@@ -1055,38 +968,25 @@ class Scheduling(BaseSDK):
1055
968
 
1056
969
  if utils.match_response(http_res, "200", "application/json"):
1057
970
  return operations.GetSchedulesResponse(
1058
- result=utils.unmarshal_json(http_res.text, components.ScheduleResponse),
971
+ result=utils.unmarshal_json_response(
972
+ components.ScheduleResponse, http_res
973
+ ),
1059
974
  headers=utils.get_response_headers(http_res.headers),
1060
975
  )
1061
976
  if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
1062
977
  http_res_text = await utils.stream_to_text_async(http_res)
1063
- raise errors.APIError(
1064
- "API error occurred", http_res.status_code, http_res_text, http_res
1065
- )
978
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1066
979
  if utils.match_response(http_res, ["500", "504"], "*"):
1067
980
  http_res_text = await utils.stream_to_text_async(http_res)
1068
- raise errors.APIError(
1069
- "API error occurred", http_res.status_code, http_res_text, http_res
1070
- )
981
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1071
982
  if utils.match_response(http_res, "4XX", "*"):
1072
983
  http_res_text = await utils.stream_to_text_async(http_res)
1073
- raise errors.APIError(
1074
- "API error occurred", http_res.status_code, http_res_text, http_res
1075
- )
984
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1076
985
  if utils.match_response(http_res, "5XX", "*"):
1077
986
  http_res_text = await utils.stream_to_text_async(http_res)
1078
- raise errors.APIError(
1079
- "API error occurred", http_res.status_code, http_res_text, http_res
1080
- )
987
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1081
988
 
1082
- content_type = http_res.headers.get("Content-Type")
1083
- http_res_text = await utils.stream_to_text_async(http_res)
1084
- raise errors.APIError(
1085
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1086
- http_res.status_code,
1087
- http_res_text,
1088
- http_res,
1089
- )
989
+ raise errors.APIError("Unexpected response received", http_res)
1090
990
 
1091
991
  def cancel(
1092
992
  self,
@@ -1184,37 +1084,24 @@ class Scheduling(BaseSDK):
1184
1084
  headers=utils.get_response_headers(http_res.headers)
1185
1085
  )
1186
1086
  if utils.match_response(http_res, ["400", "409"], "application/json"):
1187
- response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
1188
- raise errors.GenericError(data=response_data)
1087
+ response_data = utils.unmarshal_json_response(
1088
+ errors.GenericErrorData, http_res
1089
+ )
1090
+ raise errors.GenericError(response_data, http_res)
1189
1091
  if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
1190
1092
  http_res_text = utils.stream_to_text(http_res)
1191
- raise errors.APIError(
1192
- "API error occurred", http_res.status_code, http_res_text, http_res
1193
- )
1093
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1194
1094
  if utils.match_response(http_res, ["500", "504"], "*"):
1195
1095
  http_res_text = utils.stream_to_text(http_res)
1196
- raise errors.APIError(
1197
- "API error occurred", http_res.status_code, http_res_text, http_res
1198
- )
1096
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1199
1097
  if utils.match_response(http_res, "4XX", "*"):
1200
1098
  http_res_text = utils.stream_to_text(http_res)
1201
- raise errors.APIError(
1202
- "API error occurred", http_res.status_code, http_res_text, http_res
1203
- )
1099
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1204
1100
  if utils.match_response(http_res, "5XX", "*"):
1205
1101
  http_res_text = utils.stream_to_text(http_res)
1206
- raise errors.APIError(
1207
- "API error occurred", http_res.status_code, http_res_text, http_res
1208
- )
1102
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1209
1103
 
1210
- content_type = http_res.headers.get("Content-Type")
1211
- http_res_text = utils.stream_to_text(http_res)
1212
- raise errors.APIError(
1213
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1214
- http_res.status_code,
1215
- http_res_text,
1216
- http_res,
1217
- )
1104
+ raise errors.APIError("Unexpected response received", http_res)
1218
1105
 
1219
1106
  async def cancel_async(
1220
1107
  self,
@@ -1312,37 +1199,24 @@ class Scheduling(BaseSDK):
1312
1199
  headers=utils.get_response_headers(http_res.headers)
1313
1200
  )
1314
1201
  if utils.match_response(http_res, ["400", "409"], "application/json"):
1315
- response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
1316
- raise errors.GenericError(data=response_data)
1202
+ response_data = utils.unmarshal_json_response(
1203
+ errors.GenericErrorData, http_res
1204
+ )
1205
+ raise errors.GenericError(response_data, http_res)
1317
1206
  if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
1318
1207
  http_res_text = await utils.stream_to_text_async(http_res)
1319
- raise errors.APIError(
1320
- "API error occurred", http_res.status_code, http_res_text, http_res
1321
- )
1208
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1322
1209
  if utils.match_response(http_res, ["500", "504"], "*"):
1323
1210
  http_res_text = await utils.stream_to_text_async(http_res)
1324
- raise errors.APIError(
1325
- "API error occurred", http_res.status_code, http_res_text, http_res
1326
- )
1211
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1327
1212
  if utils.match_response(http_res, "4XX", "*"):
1328
1213
  http_res_text = await utils.stream_to_text_async(http_res)
1329
- raise errors.APIError(
1330
- "API error occurred", http_res.status_code, http_res_text, http_res
1331
- )
1214
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1332
1215
  if utils.match_response(http_res, "5XX", "*"):
1333
1216
  http_res_text = await utils.stream_to_text_async(http_res)
1334
- raise errors.APIError(
1335
- "API error occurred", http_res.status_code, http_res_text, http_res
1336
- )
1217
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1337
1218
 
1338
- content_type = http_res.headers.get("Content-Type")
1339
- http_res_text = await utils.stream_to_text_async(http_res)
1340
- raise errors.APIError(
1341
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1342
- http_res.status_code,
1343
- http_res_text,
1344
- http_res,
1345
- )
1219
+ raise errors.APIError("Unexpected response received", http_res)
1346
1220
 
1347
1221
  def get_occurrance(
1348
1222
  self,
@@ -1428,40 +1302,25 @@ class Scheduling(BaseSDK):
1428
1302
 
1429
1303
  if utils.match_response(http_res, "200", "application/json"):
1430
1304
  return operations.GetScheduledOccurrenceResponse(
1431
- result=utils.unmarshal_json(
1432
- http_res.text, components.OccurrencesResponse
1305
+ result=utils.unmarshal_json_response(
1306
+ components.OccurrencesResponse, http_res
1433
1307
  ),
1434
1308
  headers=utils.get_response_headers(http_res.headers),
1435
1309
  )
1436
1310
  if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
1437
1311
  http_res_text = utils.stream_to_text(http_res)
1438
- raise errors.APIError(
1439
- "API error occurred", http_res.status_code, http_res_text, http_res
1440
- )
1312
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1441
1313
  if utils.match_response(http_res, ["500", "504"], "*"):
1442
1314
  http_res_text = utils.stream_to_text(http_res)
1443
- raise errors.APIError(
1444
- "API error occurred", http_res.status_code, http_res_text, http_res
1445
- )
1315
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1446
1316
  if utils.match_response(http_res, "4XX", "*"):
1447
1317
  http_res_text = utils.stream_to_text(http_res)
1448
- raise errors.APIError(
1449
- "API error occurred", http_res.status_code, http_res_text, http_res
1450
- )
1318
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1451
1319
  if utils.match_response(http_res, "5XX", "*"):
1452
1320
  http_res_text = utils.stream_to_text(http_res)
1453
- raise errors.APIError(
1454
- "API error occurred", http_res.status_code, http_res_text, http_res
1455
- )
1321
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1456
1322
 
1457
- content_type = http_res.headers.get("Content-Type")
1458
- http_res_text = utils.stream_to_text(http_res)
1459
- raise errors.APIError(
1460
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1461
- http_res.status_code,
1462
- http_res_text,
1463
- http_res,
1464
- )
1323
+ raise errors.APIError("Unexpected response received", http_res)
1465
1324
 
1466
1325
  async def get_occurrance_async(
1467
1326
  self,
@@ -1547,37 +1406,22 @@ class Scheduling(BaseSDK):
1547
1406
 
1548
1407
  if utils.match_response(http_res, "200", "application/json"):
1549
1408
  return operations.GetScheduledOccurrenceResponse(
1550
- result=utils.unmarshal_json(
1551
- http_res.text, components.OccurrencesResponse
1409
+ result=utils.unmarshal_json_response(
1410
+ components.OccurrencesResponse, http_res
1552
1411
  ),
1553
1412
  headers=utils.get_response_headers(http_res.headers),
1554
1413
  )
1555
1414
  if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
1556
1415
  http_res_text = await utils.stream_to_text_async(http_res)
1557
- raise errors.APIError(
1558
- "API error occurred", http_res.status_code, http_res_text, http_res
1559
- )
1416
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1560
1417
  if utils.match_response(http_res, ["500", "504"], "*"):
1561
1418
  http_res_text = await utils.stream_to_text_async(http_res)
1562
- raise errors.APIError(
1563
- "API error occurred", http_res.status_code, http_res_text, http_res
1564
- )
1419
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1565
1420
  if utils.match_response(http_res, "4XX", "*"):
1566
1421
  http_res_text = await utils.stream_to_text_async(http_res)
1567
- raise errors.APIError(
1568
- "API error occurred", http_res.status_code, http_res_text, http_res
1569
- )
1422
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1570
1423
  if utils.match_response(http_res, "5XX", "*"):
1571
1424
  http_res_text = await utils.stream_to_text_async(http_res)
1572
- raise errors.APIError(
1573
- "API error occurred", http_res.status_code, http_res_text, http_res
1574
- )
1425
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1575
1426
 
1576
- content_type = http_res.headers.get("Content-Type")
1577
- http_res_text = await utils.stream_to_text_async(http_res)
1578
- raise errors.APIError(
1579
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1580
- http_res.status_code,
1581
- http_res_text,
1582
- http_res,
1583
- )
1427
+ raise errors.APIError("Unexpected response received", http_res)
moovio_sdk/sdk.py CHANGED
@@ -42,6 +42,7 @@ if TYPE_CHECKING:
42
42
  from moovio_sdk.receipts import Receipts
43
43
  from moovio_sdk.representatives import Representatives
44
44
  from moovio_sdk.scheduling import Scheduling
45
+ from moovio_sdk.support import Support
45
46
  from moovio_sdk.sweeps import Sweeps
46
47
  from moovio_sdk.terminal_applications import TerminalApplications
47
48
  from moovio_sdk.transfers import Transfers
@@ -73,6 +74,7 @@ class Moov(BaseSDK):
73
74
  scheduling: "Scheduling"
74
75
  sweeps: "Sweeps"
75
76
  account_terminal_applications: "AccountTerminalApplications"
77
+ support: "Support"
76
78
  transfers: "Transfers"
77
79
  underwriting: "Underwriting"
78
80
  wallets: "Wallets"
@@ -110,6 +112,7 @@ class Moov(BaseSDK):
110
112
  "moovio_sdk.account_terminal_applications",
111
113
  "AccountTerminalApplications",
112
114
  ),
115
+ "support": ("moovio_sdk.support", "Support"),
113
116
  "transfers": ("moovio_sdk.transfers", "Transfers"),
114
117
  "underwriting": ("moovio_sdk.underwriting", "Underwriting"),
115
118
  "wallets": ("moovio_sdk.wallets", "Wallets"),