moovio_sdk 0.13.0__py3-none-any.whl → 0.13.2__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 (40) hide show
  1. moovio_sdk/_version.py +3 -3
  2. moovio_sdk/account_terminal_applications.py +13 -16
  3. moovio_sdk/accounts.py +29 -56
  4. moovio_sdk/adjustments.py +5 -8
  5. moovio_sdk/apple_pay.py +19 -34
  6. moovio_sdk/authentication.py +11 -18
  7. moovio_sdk/bank_accounts.py +31 -58
  8. moovio_sdk/branding.py +21 -48
  9. moovio_sdk/capabilities.py +13 -28
  10. moovio_sdk/card_issuing.py +17 -32
  11. moovio_sdk/cards.py +19 -34
  12. moovio_sdk/disputes.py +35 -66
  13. moovio_sdk/end_to_end_encryption.py +5 -8
  14. moovio_sdk/enriched_address.py +3 -2
  15. moovio_sdk/enriched_profile.py +3 -2
  16. moovio_sdk/fee_plans.py +19 -38
  17. moovio_sdk/files.py +11 -18
  18. moovio_sdk/industries.py +3 -6
  19. moovio_sdk/institutions.py +7 -10
  20. moovio_sdk/issuing_transactions.py +11 -10
  21. moovio_sdk/models/components/patchtransfer.py +9 -3
  22. moovio_sdk/onboarding.py +11 -22
  23. moovio_sdk/payment_links.py +19 -30
  24. moovio_sdk/payment_methods.py +5 -8
  25. moovio_sdk/receipts.py +7 -10
  26. moovio_sdk/representatives.py +17 -40
  27. moovio_sdk/scheduling.py +21 -44
  28. moovio_sdk/support.py +19 -26
  29. moovio_sdk/sweeps.py +21 -32
  30. moovio_sdk/terminal_applications.py +13 -20
  31. moovio_sdk/transfers.py +63 -100
  32. moovio_sdk/underwriting.py +15 -22
  33. moovio_sdk/utils/__init__.py +0 -3
  34. moovio_sdk/utils/serializers.py +1 -18
  35. moovio_sdk/utils/unmarshal_json_response.py +24 -0
  36. moovio_sdk/wallet_transactions.py +5 -8
  37. moovio_sdk/wallets.py +5 -4
  38. {moovio_sdk-0.13.0.dist-info → moovio_sdk-0.13.2.dist-info}/METADATA +1 -1
  39. {moovio_sdk-0.13.0.dist-info → moovio_sdk-0.13.2.dist-info}/RECORD +40 -39
  40. {moovio_sdk-0.13.0.dist-info → moovio_sdk-0.13.2.dist-info}/WHEEL +0 -0
moovio_sdk/_version.py CHANGED
@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "moovio_sdk"
6
- __version__: str = "0.13.0"
6
+ __version__: str = "0.13.2"
7
7
  __openapi_doc_version__: str = "latest"
8
- __gen_version__: str = "2.648.1"
9
- __user_agent__: str = "speakeasy-sdk/python 0.13.0 2.648.1 latest moovio_sdk"
8
+ __gen_version__: str = "2.654.2"
9
+ __user_agent__: str = "speakeasy-sdk/python 0.13.2 2.654.2 latest moovio_sdk"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
@@ -6,6 +6,7 @@ from moovio_sdk._hooks import HookContext
6
6
  from moovio_sdk.models import components, errors, operations
7
7
  from moovio_sdk.types import OptionalNullable, UNSET
8
8
  from moovio_sdk.utils import get_security_from_env
9
+ from moovio_sdk.utils.unmarshal_json_response import unmarshal_json_response
9
10
  from typing import Any, List, Mapping, Optional
10
11
 
11
12
 
@@ -113,18 +114,16 @@ class AccountTerminalApplications(BaseSDK):
113
114
  response_data: Any = None
114
115
  if utils.match_response(http_res, "200", "application/json"):
115
116
  return operations.LinkAccountTerminalApplicationResponse(
116
- result=utils.unmarshal_json_response(
117
+ result=unmarshal_json_response(
117
118
  components.TerminalApplication, http_res
118
119
  ),
119
120
  headers=utils.get_response_headers(http_res.headers),
120
121
  )
121
122
  if utils.match_response(http_res, ["400", "409"], "application/json"):
122
- response_data = utils.unmarshal_json_response(
123
- errors.GenericErrorData, http_res
124
- )
123
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
125
124
  raise errors.GenericError(response_data, http_res)
126
125
  if utils.match_response(http_res, "422", "application/json"):
127
- response_data = utils.unmarshal_json_response(
126
+ response_data = unmarshal_json_response(
128
127
  errors.AccountTerminalApplicationErrorData, http_res
129
128
  )
130
129
  raise errors.AccountTerminalApplicationError(response_data, http_res)
@@ -246,18 +245,16 @@ class AccountTerminalApplications(BaseSDK):
246
245
  response_data: Any = None
247
246
  if utils.match_response(http_res, "200", "application/json"):
248
247
  return operations.LinkAccountTerminalApplicationResponse(
249
- result=utils.unmarshal_json_response(
248
+ result=unmarshal_json_response(
250
249
  components.TerminalApplication, http_res
251
250
  ),
252
251
  headers=utils.get_response_headers(http_res.headers),
253
252
  )
254
253
  if utils.match_response(http_res, ["400", "409"], "application/json"):
255
- response_data = utils.unmarshal_json_response(
256
- errors.GenericErrorData, http_res
257
- )
254
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
258
255
  raise errors.GenericError(response_data, http_res)
259
256
  if utils.match_response(http_res, "422", "application/json"):
260
- response_data = utils.unmarshal_json_response(
257
+ response_data = unmarshal_json_response(
261
258
  errors.AccountTerminalApplicationErrorData, http_res
262
259
  )
263
260
  raise errors.AccountTerminalApplicationError(response_data, http_res)
@@ -354,7 +351,7 @@ class AccountTerminalApplications(BaseSDK):
354
351
 
355
352
  if utils.match_response(http_res, "200", "application/json"):
356
353
  return operations.ListAccountTerminalApplicationsResponse(
357
- result=utils.unmarshal_json_response(
354
+ result=unmarshal_json_response(
358
355
  List[components.TerminalApplication], http_res
359
356
  ),
360
357
  headers=utils.get_response_headers(http_res.headers),
@@ -452,7 +449,7 @@ class AccountTerminalApplications(BaseSDK):
452
449
 
453
450
  if utils.match_response(http_res, "200", "application/json"):
454
451
  return operations.ListAccountTerminalApplicationsResponse(
455
- result=utils.unmarshal_json_response(
452
+ result=unmarshal_json_response(
456
453
  List[components.TerminalApplication], http_res
457
454
  ),
458
455
  headers=utils.get_response_headers(http_res.headers),
@@ -553,7 +550,7 @@ class AccountTerminalApplications(BaseSDK):
553
550
 
554
551
  if utils.match_response(http_res, "200", "application/json"):
555
552
  return operations.GetAccountTerminalApplicationResponse(
556
- result=utils.unmarshal_json_response(
553
+ result=unmarshal_json_response(
557
554
  components.TerminalApplication, http_res
558
555
  ),
559
556
  headers=utils.get_response_headers(http_res.headers),
@@ -654,7 +651,7 @@ class AccountTerminalApplications(BaseSDK):
654
651
 
655
652
  if utils.match_response(http_res, "200", "application/json"):
656
653
  return operations.GetAccountTerminalApplicationResponse(
657
- result=utils.unmarshal_json_response(
654
+ result=unmarshal_json_response(
658
655
  components.TerminalApplication, http_res
659
656
  ),
660
657
  headers=utils.get_response_headers(http_res.headers),
@@ -755,7 +752,7 @@ class AccountTerminalApplications(BaseSDK):
755
752
 
756
753
  if utils.match_response(http_res, "200", "application/json"):
757
754
  return operations.GetTerminalConfigurationResponse(
758
- result=utils.unmarshal_json_response(
755
+ result=unmarshal_json_response(
759
756
  components.TerminalConfiguration, http_res
760
757
  ),
761
758
  headers=utils.get_response_headers(http_res.headers),
@@ -856,7 +853,7 @@ class AccountTerminalApplications(BaseSDK):
856
853
 
857
854
  if utils.match_response(http_res, "200", "application/json"):
858
855
  return operations.GetTerminalConfigurationResponse(
859
- result=utils.unmarshal_json_response(
856
+ result=unmarshal_json_response(
860
857
  components.TerminalConfiguration, http_res
861
858
  ),
862
859
  headers=utils.get_response_headers(http_res.headers),
moovio_sdk/accounts.py CHANGED
@@ -6,6 +6,7 @@ from moovio_sdk._hooks import HookContext
6
6
  from moovio_sdk.models import components, errors, operations
7
7
  from moovio_sdk.types import OptionalNullable, UNSET
8
8
  from moovio_sdk.utils import get_security_from_env
9
+ from moovio_sdk.utils.unmarshal_json_response import unmarshal_json_response
9
10
  from typing import Any, Dict, List, Mapping, Optional, Union
10
11
 
11
12
 
@@ -152,16 +153,14 @@ class Accounts(BaseSDK):
152
153
  response_data: Any = None
153
154
  if utils.match_response(http_res, "200", "application/json"):
154
155
  return operations.CreateAccountResponse(
155
- result=utils.unmarshal_json_response(components.Account, http_res),
156
+ result=unmarshal_json_response(components.Account, http_res),
156
157
  headers=utils.get_response_headers(http_res.headers),
157
158
  )
158
159
  if utils.match_response(http_res, ["400", "409"], "application/json"):
159
- response_data = utils.unmarshal_json_response(
160
- errors.GenericErrorData, http_res
161
- )
160
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
162
161
  raise errors.GenericError(response_data, http_res)
163
162
  if utils.match_response(http_res, "422", "application/json"):
164
- response_data = utils.unmarshal_json_response(
163
+ response_data = unmarshal_json_response(
165
164
  errors.CreateAccountResponseBodyData, http_res
166
165
  )
167
166
  raise errors.CreateAccountResponseBody(response_data, http_res)
@@ -322,16 +321,14 @@ class Accounts(BaseSDK):
322
321
  response_data: Any = None
323
322
  if utils.match_response(http_res, "200", "application/json"):
324
323
  return operations.CreateAccountResponse(
325
- result=utils.unmarshal_json_response(components.Account, http_res),
324
+ result=unmarshal_json_response(components.Account, http_res),
326
325
  headers=utils.get_response_headers(http_res.headers),
327
326
  )
328
327
  if utils.match_response(http_res, ["400", "409"], "application/json"):
329
- response_data = utils.unmarshal_json_response(
330
- errors.GenericErrorData, http_res
331
- )
328
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
332
329
  raise errors.GenericError(response_data, http_res)
333
330
  if utils.match_response(http_res, "422", "application/json"):
334
- response_data = utils.unmarshal_json_response(
331
+ response_data = unmarshal_json_response(
335
332
  errors.CreateAccountResponseBodyData, http_res
336
333
  )
337
334
  raise errors.CreateAccountResponseBody(response_data, http_res)
@@ -459,9 +456,7 @@ class Accounts(BaseSDK):
459
456
 
460
457
  if utils.match_response(http_res, "200", "application/json"):
461
458
  return operations.ListAccountsResponse(
462
- result=utils.unmarshal_json_response(
463
- List[components.Account], http_res
464
- ),
459
+ result=unmarshal_json_response(List[components.Account], http_res),
465
460
  headers=utils.get_response_headers(http_res.headers),
466
461
  )
467
462
  if utils.match_response(http_res, ["401", "403", "429"], "*"):
@@ -588,9 +583,7 @@ class Accounts(BaseSDK):
588
583
 
589
584
  if utils.match_response(http_res, "200", "application/json"):
590
585
  return operations.ListAccountsResponse(
591
- result=utils.unmarshal_json_response(
592
- List[components.Account], http_res
593
- ),
586
+ result=unmarshal_json_response(List[components.Account], http_res),
594
587
  headers=utils.get_response_headers(http_res.headers),
595
588
  )
596
589
  if utils.match_response(http_res, ["401", "403", "429"], "*"):
@@ -686,7 +679,7 @@ class Accounts(BaseSDK):
686
679
 
687
680
  if utils.match_response(http_res, "200", "application/json"):
688
681
  return operations.GetAccountResponse(
689
- result=utils.unmarshal_json_response(components.Account, http_res),
682
+ result=unmarshal_json_response(components.Account, http_res),
690
683
  headers=utils.get_response_headers(http_res.headers),
691
684
  )
692
685
  if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
@@ -782,7 +775,7 @@ class Accounts(BaseSDK):
782
775
 
783
776
  if utils.match_response(http_res, "200", "application/json"):
784
777
  return operations.GetAccountResponse(
785
- result=utils.unmarshal_json_response(components.Account, http_res),
778
+ result=unmarshal_json_response(components.Account, http_res),
786
779
  headers=utils.get_response_headers(http_res.headers),
787
780
  )
788
781
  if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
@@ -948,16 +941,14 @@ class Accounts(BaseSDK):
948
941
  response_data: Any = None
949
942
  if utils.match_response(http_res, "200", "application/json"):
950
943
  return operations.UpdateAccountResponse(
951
- result=utils.unmarshal_json_response(components.Account, http_res),
944
+ result=unmarshal_json_response(components.Account, http_res),
952
945
  headers=utils.get_response_headers(http_res.headers),
953
946
  )
954
947
  if utils.match_response(http_res, ["400", "409"], "application/json"):
955
- response_data = utils.unmarshal_json_response(
956
- errors.GenericErrorData, http_res
957
- )
948
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
958
949
  raise errors.GenericError(response_data, http_res)
959
950
  if utils.match_response(http_res, "422", "application/json"):
960
- response_data = utils.unmarshal_json_response(
951
+ response_data = unmarshal_json_response(
961
952
  errors.UpdateAccountResponseBodyData, http_res
962
953
  )
963
954
  raise errors.UpdateAccountResponseBody(response_data, http_res)
@@ -1124,16 +1115,14 @@ class Accounts(BaseSDK):
1124
1115
  response_data: Any = None
1125
1116
  if utils.match_response(http_res, "200", "application/json"):
1126
1117
  return operations.UpdateAccountResponse(
1127
- result=utils.unmarshal_json_response(components.Account, http_res),
1118
+ result=unmarshal_json_response(components.Account, http_res),
1128
1119
  headers=utils.get_response_headers(http_res.headers),
1129
1120
  )
1130
1121
  if utils.match_response(http_res, ["400", "409"], "application/json"):
1131
- response_data = utils.unmarshal_json_response(
1132
- errors.GenericErrorData, http_res
1133
- )
1122
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
1134
1123
  raise errors.GenericError(response_data, http_res)
1135
1124
  if utils.match_response(http_res, "422", "application/json"):
1136
- response_data = utils.unmarshal_json_response(
1125
+ response_data = unmarshal_json_response(
1137
1126
  errors.UpdateAccountResponseBodyData, http_res
1138
1127
  )
1139
1128
  raise errors.UpdateAccountResponseBody(response_data, http_res)
@@ -1247,9 +1236,7 @@ class Accounts(BaseSDK):
1247
1236
  headers=utils.get_response_headers(http_res.headers)
1248
1237
  )
1249
1238
  if utils.match_response(http_res, ["400", "409"], "application/json"):
1250
- response_data = utils.unmarshal_json_response(
1251
- errors.GenericErrorData, http_res
1252
- )
1239
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
1253
1240
  raise errors.GenericError(response_data, http_res)
1254
1241
  if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
1255
1242
  http_res_text = utils.stream_to_text(http_res)
@@ -1361,9 +1348,7 @@ class Accounts(BaseSDK):
1361
1348
  headers=utils.get_response_headers(http_res.headers)
1362
1349
  )
1363
1350
  if utils.match_response(http_res, ["400", "409"], "application/json"):
1364
- response_data = utils.unmarshal_json_response(
1365
- errors.GenericErrorData, http_res
1366
- )
1351
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
1367
1352
  raise errors.GenericError(response_data, http_res)
1368
1353
  if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
1369
1354
  http_res_text = await utils.stream_to_text_async(http_res)
@@ -1458,9 +1443,7 @@ class Accounts(BaseSDK):
1458
1443
 
1459
1444
  if utils.match_response(http_res, "200", "application/json"):
1460
1445
  return operations.GetAccountCountriesResponse(
1461
- result=utils.unmarshal_json_response(
1462
- components.AccountCountries, http_res
1463
- ),
1446
+ result=unmarshal_json_response(components.AccountCountries, http_res),
1464
1447
  headers=utils.get_response_headers(http_res.headers),
1465
1448
  )
1466
1449
  if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
@@ -1556,9 +1539,7 @@ class Accounts(BaseSDK):
1556
1539
 
1557
1540
  if utils.match_response(http_res, "200", "application/json"):
1558
1541
  return operations.GetAccountCountriesResponse(
1559
- result=utils.unmarshal_json_response(
1560
- components.AccountCountries, http_res
1561
- ),
1542
+ result=unmarshal_json_response(components.AccountCountries, http_res),
1562
1543
  headers=utils.get_response_headers(http_res.headers),
1563
1544
  )
1564
1545
  if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
@@ -1681,18 +1662,14 @@ class Accounts(BaseSDK):
1681
1662
  response_data: Any = None
1682
1663
  if utils.match_response(http_res, "200", "application/json"):
1683
1664
  return operations.AssignAccountCountriesResponse(
1684
- result=utils.unmarshal_json_response(
1685
- components.AccountCountries, http_res
1686
- ),
1665
+ result=unmarshal_json_response(components.AccountCountries, http_res),
1687
1666
  headers=utils.get_response_headers(http_res.headers),
1688
1667
  )
1689
1668
  if utils.match_response(http_res, ["400", "409"], "application/json"):
1690
- response_data = utils.unmarshal_json_response(
1691
- errors.GenericErrorData, http_res
1692
- )
1669
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
1693
1670
  raise errors.GenericError(response_data, http_res)
1694
1671
  if utils.match_response(http_res, "422", "application/json"):
1695
- response_data = utils.unmarshal_json_response(
1672
+ response_data = unmarshal_json_response(
1696
1673
  errors.AssignCountriesErrorData, http_res
1697
1674
  )
1698
1675
  raise errors.AssignCountriesError(response_data, http_res)
@@ -1816,18 +1793,14 @@ class Accounts(BaseSDK):
1816
1793
  response_data: Any = None
1817
1794
  if utils.match_response(http_res, "200", "application/json"):
1818
1795
  return operations.AssignAccountCountriesResponse(
1819
- result=utils.unmarshal_json_response(
1820
- components.AccountCountries, http_res
1821
- ),
1796
+ result=unmarshal_json_response(components.AccountCountries, http_res),
1822
1797
  headers=utils.get_response_headers(http_res.headers),
1823
1798
  )
1824
1799
  if utils.match_response(http_res, ["400", "409"], "application/json"):
1825
- response_data = utils.unmarshal_json_response(
1826
- errors.GenericErrorData, http_res
1827
- )
1800
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
1828
1801
  raise errors.GenericError(response_data, http_res)
1829
1802
  if utils.match_response(http_res, "422", "application/json"):
1830
- response_data = utils.unmarshal_json_response(
1803
+ response_data = unmarshal_json_response(
1831
1804
  errors.AssignCountriesErrorData, http_res
1832
1805
  )
1833
1806
  raise errors.AssignCountriesError(response_data, http_res)
@@ -2122,7 +2095,7 @@ class Accounts(BaseSDK):
2122
2095
 
2123
2096
  if utils.match_response(http_res, "200", "application/json"):
2124
2097
  return operations.GetTermsOfServiceTokenResponse(
2125
- result=utils.unmarshal_json_response(
2098
+ result=unmarshal_json_response(
2126
2099
  components.TermsOfServiceToken, http_res
2127
2100
  ),
2128
2101
  headers=utils.get_response_headers(http_res.headers),
@@ -2224,7 +2197,7 @@ class Accounts(BaseSDK):
2224
2197
 
2225
2198
  if utils.match_response(http_res, "200", "application/json"):
2226
2199
  return operations.GetTermsOfServiceTokenResponse(
2227
- result=utils.unmarshal_json_response(
2200
+ result=unmarshal_json_response(
2228
2201
  components.TermsOfServiceToken, http_res
2229
2202
  ),
2230
2203
  headers=utils.get_response_headers(http_res.headers),
moovio_sdk/adjustments.py CHANGED
@@ -6,6 +6,7 @@ from moovio_sdk._hooks import HookContext
6
6
  from moovio_sdk.models import components, errors, operations
7
7
  from moovio_sdk.types import OptionalNullable, UNSET
8
8
  from moovio_sdk.utils import get_security_from_env
9
+ from moovio_sdk.utils.unmarshal_json_response import unmarshal_json_response
9
10
  from typing import List, Mapping, Optional
10
11
 
11
12
 
@@ -91,9 +92,7 @@ class Adjustments(BaseSDK):
91
92
 
92
93
  if utils.match_response(http_res, "200", "application/json"):
93
94
  return operations.ListAdjustmentsResponse(
94
- result=utils.unmarshal_json_response(
95
- List[components.Adjustment], http_res
96
- ),
95
+ result=unmarshal_json_response(List[components.Adjustment], http_res),
97
96
  headers=utils.get_response_headers(http_res.headers),
98
97
  )
99
98
  if utils.match_response(http_res, ["401", "403", "429"], "*"):
@@ -192,9 +191,7 @@ class Adjustments(BaseSDK):
192
191
 
193
192
  if utils.match_response(http_res, "200", "application/json"):
194
193
  return operations.ListAdjustmentsResponse(
195
- result=utils.unmarshal_json_response(
196
- List[components.Adjustment], http_res
197
- ),
194
+ result=unmarshal_json_response(List[components.Adjustment], http_res),
198
195
  headers=utils.get_response_headers(http_res.headers),
199
196
  )
200
197
  if utils.match_response(http_res, ["401", "403", "429"], "*"):
@@ -293,7 +290,7 @@ class Adjustments(BaseSDK):
293
290
 
294
291
  if utils.match_response(http_res, "200", "application/json"):
295
292
  return operations.GetAdjustmentResponse(
296
- result=utils.unmarshal_json_response(components.Adjustment, http_res),
293
+ result=unmarshal_json_response(components.Adjustment, http_res),
297
294
  headers=utils.get_response_headers(http_res.headers),
298
295
  )
299
296
  if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
@@ -392,7 +389,7 @@ class Adjustments(BaseSDK):
392
389
 
393
390
  if utils.match_response(http_res, "200", "application/json"):
394
391
  return operations.GetAdjustmentResponse(
395
- result=utils.unmarshal_json_response(components.Adjustment, http_res),
392
+ result=unmarshal_json_response(components.Adjustment, http_res),
396
393
  headers=utils.get_response_headers(http_res.headers),
397
394
  )
398
395
  if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
moovio_sdk/apple_pay.py CHANGED
@@ -6,6 +6,7 @@ from moovio_sdk._hooks import HookContext
6
6
  from moovio_sdk.models import components, errors, operations
7
7
  from moovio_sdk.types import OptionalNullable, UNSET
8
8
  from moovio_sdk.utils import get_security_from_env
9
+ from moovio_sdk.utils.unmarshal_json_response import unmarshal_json_response
9
10
  from typing import Any, List, Mapping, Optional, Union
10
11
 
11
12
 
@@ -118,15 +119,13 @@ class ApplePay(BaseSDK):
118
119
  response_data: Any = None
119
120
  if utils.match_response(http_res, "200", "application/json"):
120
121
  return operations.RegisterApplePayMerchantDomainsResponse(
121
- result=utils.unmarshal_json_response(
122
+ result=unmarshal_json_response(
122
123
  components.ApplePayMerchantDomains, http_res
123
124
  ),
124
125
  headers=utils.get_response_headers(http_res.headers),
125
126
  )
126
127
  if utils.match_response(http_res, "400", "application/json"):
127
- response_data = utils.unmarshal_json_response(
128
- errors.GenericErrorData, http_res
129
- )
128
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
130
129
  raise errors.GenericError(response_data, http_res)
131
130
  if utils.match_response(http_res, ["401", "403", "409", "417", "429"], "*"):
132
131
  http_res_text = utils.stream_to_text(http_res)
@@ -251,15 +250,13 @@ class ApplePay(BaseSDK):
251
250
  response_data: Any = None
252
251
  if utils.match_response(http_res, "200", "application/json"):
253
252
  return operations.RegisterApplePayMerchantDomainsResponse(
254
- result=utils.unmarshal_json_response(
253
+ result=unmarshal_json_response(
255
254
  components.ApplePayMerchantDomains, http_res
256
255
  ),
257
256
  headers=utils.get_response_headers(http_res.headers),
258
257
  )
259
258
  if utils.match_response(http_res, "400", "application/json"):
260
- response_data = utils.unmarshal_json_response(
261
- errors.GenericErrorData, http_res
262
- )
259
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
263
260
  raise errors.GenericError(response_data, http_res)
264
261
  if utils.match_response(http_res, ["401", "403", "409", "417", "429"], "*"):
265
262
  http_res_text = await utils.stream_to_text_async(http_res)
@@ -388,9 +385,7 @@ class ApplePay(BaseSDK):
388
385
  headers=utils.get_response_headers(http_res.headers)
389
386
  )
390
387
  if utils.match_response(http_res, "400", "application/json"):
391
- response_data = utils.unmarshal_json_response(
392
- errors.GenericErrorData, http_res
393
- )
388
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
394
389
  raise errors.GenericError(response_data, http_res)
395
390
  if utils.match_response(
396
391
  http_res, ["401", "403", "404", "409", "417", "429"], "*"
@@ -521,9 +516,7 @@ class ApplePay(BaseSDK):
521
516
  headers=utils.get_response_headers(http_res.headers)
522
517
  )
523
518
  if utils.match_response(http_res, "400", "application/json"):
524
- response_data = utils.unmarshal_json_response(
525
- errors.GenericErrorData, http_res
526
- )
519
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
527
520
  raise errors.GenericError(response_data, http_res)
528
521
  if utils.match_response(
529
522
  http_res, ["401", "403", "404", "409", "417", "429"], "*"
@@ -622,7 +615,7 @@ class ApplePay(BaseSDK):
622
615
 
623
616
  if utils.match_response(http_res, "200", "application/json"):
624
617
  return operations.GetApplePayMerchantDomainsResponse(
625
- result=utils.unmarshal_json_response(
618
+ result=unmarshal_json_response(
626
619
  components.ApplePayMerchantDomains, http_res
627
620
  ),
628
621
  headers=utils.get_response_headers(http_res.headers),
@@ -722,7 +715,7 @@ class ApplePay(BaseSDK):
722
715
 
723
716
  if utils.match_response(http_res, "200", "application/json"):
724
717
  return operations.GetApplePayMerchantDomainsResponse(
725
- result=utils.unmarshal_json_response(
718
+ result=unmarshal_json_response(
726
719
  components.ApplePayMerchantDomains, http_res
727
720
  ),
728
721
  headers=utils.get_response_headers(http_res.headers),
@@ -851,13 +844,11 @@ class ApplePay(BaseSDK):
851
844
  response_data: Any = None
852
845
  if utils.match_response(http_res, "200", "application/json"):
853
846
  return operations.CreateApplePaySessionResponse(
854
- result=utils.unmarshal_json_response(str, http_res),
847
+ result=unmarshal_json_response(str, http_res),
855
848
  headers=utils.get_response_headers(http_res.headers),
856
849
  )
857
850
  if utils.match_response(http_res, ["400", "409", "422"], "application/json"):
858
- response_data = utils.unmarshal_json_response(
859
- errors.GenericErrorData, http_res
860
- )
851
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
861
852
  raise errors.GenericError(response_data, http_res)
862
853
  if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
863
854
  http_res_text = utils.stream_to_text(http_res)
@@ -983,13 +974,11 @@ class ApplePay(BaseSDK):
983
974
  response_data: Any = None
984
975
  if utils.match_response(http_res, "200", "application/json"):
985
976
  return operations.CreateApplePaySessionResponse(
986
- result=utils.unmarshal_json_response(str, http_res),
977
+ result=unmarshal_json_response(str, http_res),
987
978
  headers=utils.get_response_headers(http_res.headers),
988
979
  )
989
980
  if utils.match_response(http_res, ["400", "409", "422"], "application/json"):
990
- response_data = utils.unmarshal_json_response(
991
- errors.GenericErrorData, http_res
992
- )
981
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
993
982
  raise errors.GenericError(response_data, http_res)
994
983
  if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
995
984
  http_res_text = await utils.stream_to_text_async(http_res)
@@ -1119,18 +1108,16 @@ class ApplePay(BaseSDK):
1119
1108
  response_data: Any = None
1120
1109
  if utils.match_response(http_res, "200", "application/json"):
1121
1110
  return operations.LinkApplePayTokenResponse(
1122
- result=utils.unmarshal_json_response(
1111
+ result=unmarshal_json_response(
1123
1112
  components.LinkedApplePayPaymentMethod, http_res
1124
1113
  ),
1125
1114
  headers=utils.get_response_headers(http_res.headers),
1126
1115
  )
1127
1116
  if utils.match_response(http_res, ["400", "409"], "application/json"):
1128
- response_data = utils.unmarshal_json_response(
1129
- errors.GenericErrorData, http_res
1130
- )
1117
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
1131
1118
  raise errors.GenericError(response_data, http_res)
1132
1119
  if utils.match_response(http_res, "422", "application/json"):
1133
- response_data = utils.unmarshal_json_response(
1120
+ response_data = unmarshal_json_response(
1134
1121
  errors.LinkApplePayErrorData, http_res
1135
1122
  )
1136
1123
  raise errors.LinkApplePayError(response_data, http_res)
@@ -1262,18 +1249,16 @@ class ApplePay(BaseSDK):
1262
1249
  response_data: Any = None
1263
1250
  if utils.match_response(http_res, "200", "application/json"):
1264
1251
  return operations.LinkApplePayTokenResponse(
1265
- result=utils.unmarshal_json_response(
1252
+ result=unmarshal_json_response(
1266
1253
  components.LinkedApplePayPaymentMethod, http_res
1267
1254
  ),
1268
1255
  headers=utils.get_response_headers(http_res.headers),
1269
1256
  )
1270
1257
  if utils.match_response(http_res, ["400", "409"], "application/json"):
1271
- response_data = utils.unmarshal_json_response(
1272
- errors.GenericErrorData, http_res
1273
- )
1258
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
1274
1259
  raise errors.GenericError(response_data, http_res)
1275
1260
  if utils.match_response(http_res, "422", "application/json"):
1276
- response_data = utils.unmarshal_json_response(
1261
+ response_data = unmarshal_json_response(
1277
1262
  errors.LinkApplePayErrorData, http_res
1278
1263
  )
1279
1264
  raise errors.LinkApplePayError(response_data, http_res)
@@ -6,6 +6,7 @@ from moovio_sdk._hooks import HookContext
6
6
  from moovio_sdk.models import components, errors, operations
7
7
  from moovio_sdk.types import OptionalNullable, UNSET
8
8
  from moovio_sdk.utils import get_security_from_env
9
+ from moovio_sdk.utils.unmarshal_json_response import unmarshal_json_response
9
10
  from typing import Any, Mapping, Optional
10
11
 
11
12
 
@@ -103,12 +104,10 @@ class Authentication(BaseSDK):
103
104
  headers=utils.get_response_headers(http_res.headers)
104
105
  )
105
106
  if utils.match_response(http_res, "400", "application/json"):
106
- response_data = utils.unmarshal_json_response(
107
- errors.GenericErrorData, http_res
108
- )
107
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
109
108
  raise errors.GenericError(response_data, http_res)
110
109
  if utils.match_response(http_res, "422", "application/json"):
111
- response_data = utils.unmarshal_json_response(
110
+ response_data = unmarshal_json_response(
112
111
  errors.RevokeTokenRequestErrorData, http_res
113
112
  )
114
113
  raise errors.RevokeTokenRequestError(response_data, http_res)
@@ -220,12 +219,10 @@ class Authentication(BaseSDK):
220
219
  headers=utils.get_response_headers(http_res.headers)
221
220
  )
222
221
  if utils.match_response(http_res, "400", "application/json"):
223
- response_data = utils.unmarshal_json_response(
224
- errors.GenericErrorData, http_res
225
- )
222
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
226
223
  raise errors.GenericError(response_data, http_res)
227
224
  if utils.match_response(http_res, "422", "application/json"):
228
- response_data = utils.unmarshal_json_response(
225
+ response_data = unmarshal_json_response(
229
226
  errors.RevokeTokenRequestErrorData, http_res
230
227
  )
231
228
  raise errors.RevokeTokenRequestError(response_data, http_res)
@@ -335,16 +332,14 @@ class Authentication(BaseSDK):
335
332
  response_data: Any = None
336
333
  if utils.match_response(http_res, "200", "application/json"):
337
334
  return operations.CreateAccessTokenResponse(
338
- result=utils.unmarshal_json_response(components.AuthToken, http_res),
335
+ result=unmarshal_json_response(components.AuthToken, http_res),
339
336
  headers=utils.get_response_headers(http_res.headers),
340
337
  )
341
338
  if utils.match_response(http_res, "400", "application/json"):
342
- response_data = utils.unmarshal_json_response(
343
- errors.GenericErrorData, http_res
344
- )
339
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
345
340
  raise errors.GenericError(response_data, http_res)
346
341
  if utils.match_response(http_res, "422", "application/json"):
347
- response_data = utils.unmarshal_json_response(
342
+ response_data = unmarshal_json_response(
348
343
  errors.AuthTokenRequestErrorData, http_res
349
344
  )
350
345
  raise errors.AuthTokenRequestError(response_data, http_res)
@@ -454,16 +449,14 @@ class Authentication(BaseSDK):
454
449
  response_data: Any = None
455
450
  if utils.match_response(http_res, "200", "application/json"):
456
451
  return operations.CreateAccessTokenResponse(
457
- result=utils.unmarshal_json_response(components.AuthToken, http_res),
452
+ result=unmarshal_json_response(components.AuthToken, http_res),
458
453
  headers=utils.get_response_headers(http_res.headers),
459
454
  )
460
455
  if utils.match_response(http_res, "400", "application/json"):
461
- response_data = utils.unmarshal_json_response(
462
- errors.GenericErrorData, http_res
463
- )
456
+ response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
464
457
  raise errors.GenericError(response_data, http_res)
465
458
  if utils.match_response(http_res, "422", "application/json"):
466
- response_data = utils.unmarshal_json_response(
459
+ response_data = unmarshal_json_response(
467
460
  errors.AuthTokenRequestErrorData, http_res
468
461
  )
469
462
  raise errors.AuthTokenRequestError(response_data, http_res)