moovio_sdk 0.13.1__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.
- moovio_sdk/_version.py +3 -3
- moovio_sdk/account_terminal_applications.py +13 -16
- moovio_sdk/accounts.py +29 -56
- moovio_sdk/adjustments.py +5 -8
- moovio_sdk/apple_pay.py +19 -34
- moovio_sdk/authentication.py +11 -18
- moovio_sdk/bank_accounts.py +31 -58
- moovio_sdk/branding.py +21 -48
- moovio_sdk/capabilities.py +13 -28
- moovio_sdk/card_issuing.py +17 -32
- moovio_sdk/cards.py +19 -34
- moovio_sdk/disputes.py +35 -66
- moovio_sdk/end_to_end_encryption.py +5 -8
- moovio_sdk/enriched_address.py +3 -2
- moovio_sdk/enriched_profile.py +3 -2
- moovio_sdk/fee_plans.py +19 -38
- moovio_sdk/files.py +11 -18
- moovio_sdk/industries.py +3 -6
- moovio_sdk/institutions.py +7 -10
- moovio_sdk/issuing_transactions.py +11 -10
- moovio_sdk/models/components/patchtransfer.py +9 -3
- moovio_sdk/onboarding.py +11 -22
- moovio_sdk/payment_links.py +19 -30
- moovio_sdk/payment_methods.py +5 -8
- moovio_sdk/receipts.py +7 -10
- moovio_sdk/representatives.py +17 -40
- moovio_sdk/scheduling.py +21 -44
- moovio_sdk/support.py +19 -26
- moovio_sdk/sweeps.py +21 -32
- moovio_sdk/terminal_applications.py +13 -20
- moovio_sdk/transfers.py +63 -100
- moovio_sdk/underwriting.py +15 -22
- moovio_sdk/utils/__init__.py +0 -3
- moovio_sdk/utils/serializers.py +1 -18
- moovio_sdk/utils/unmarshal_json_response.py +24 -0
- moovio_sdk/wallet_transactions.py +5 -8
- moovio_sdk/wallets.py +5 -4
- {moovio_sdk-0.13.1.dist-info → moovio_sdk-0.13.2.dist-info}/METADATA +1 -1
- {moovio_sdk-0.13.1.dist-info → moovio_sdk-0.13.2.dist-info}/RECORD +40 -39
- {moovio_sdk-0.13.1.dist-info → moovio_sdk-0.13.2.dist-info}/WHEEL +0 -0
moovio_sdk/payment_links.py
CHANGED
@@ -8,6 +8,7 @@ from moovio_sdk._hooks import HookContext
|
|
8
8
|
from moovio_sdk.models import components, errors, operations
|
9
9
|
from moovio_sdk.types import OptionalNullable, UNSET
|
10
10
|
from moovio_sdk.utils import get_security_from_env
|
11
|
+
from moovio_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
11
12
|
from typing import Any, List, Mapping, Optional, Union
|
12
13
|
|
13
14
|
|
@@ -170,16 +171,14 @@ class PaymentLinks(BaseSDK):
|
|
170
171
|
response_data: Any = None
|
171
172
|
if utils.match_response(http_res, "200", "application/json"):
|
172
173
|
return operations.CreatePaymentLinkResponse(
|
173
|
-
result=
|
174
|
+
result=unmarshal_json_response(components.PaymentLink, http_res),
|
174
175
|
headers=utils.get_response_headers(http_res.headers),
|
175
176
|
)
|
176
177
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
177
|
-
response_data =
|
178
|
-
errors.GenericErrorData, http_res
|
179
|
-
)
|
178
|
+
response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
|
180
179
|
raise errors.GenericError(response_data, http_res)
|
181
180
|
if utils.match_response(http_res, "422", "application/json"):
|
182
|
-
response_data =
|
181
|
+
response_data = unmarshal_json_response(
|
183
182
|
errors.CreatePaymentLinkErrorData, http_res
|
184
183
|
)
|
185
184
|
raise errors.CreatePaymentLinkError(response_data, http_res)
|
@@ -351,16 +350,14 @@ class PaymentLinks(BaseSDK):
|
|
351
350
|
response_data: Any = None
|
352
351
|
if utils.match_response(http_res, "200", "application/json"):
|
353
352
|
return operations.CreatePaymentLinkResponse(
|
354
|
-
result=
|
353
|
+
result=unmarshal_json_response(components.PaymentLink, http_res),
|
355
354
|
headers=utils.get_response_headers(http_res.headers),
|
356
355
|
)
|
357
356
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
358
|
-
response_data =
|
359
|
-
errors.GenericErrorData, http_res
|
360
|
-
)
|
357
|
+
response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
|
361
358
|
raise errors.GenericError(response_data, http_res)
|
362
359
|
if utils.match_response(http_res, "422", "application/json"):
|
363
|
-
response_data =
|
360
|
+
response_data = unmarshal_json_response(
|
364
361
|
errors.CreatePaymentLinkErrorData, http_res
|
365
362
|
)
|
366
363
|
raise errors.CreatePaymentLinkError(response_data, http_res)
|
@@ -457,9 +454,7 @@ class PaymentLinks(BaseSDK):
|
|
457
454
|
|
458
455
|
if utils.match_response(http_res, "200", "application/json"):
|
459
456
|
return operations.ListPaymentLinksResponse(
|
460
|
-
result=
|
461
|
-
List[components.PaymentLink], http_res
|
462
|
-
),
|
457
|
+
result=unmarshal_json_response(List[components.PaymentLink], http_res),
|
463
458
|
headers=utils.get_response_headers(http_res.headers),
|
464
459
|
)
|
465
460
|
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
@@ -555,9 +550,7 @@ class PaymentLinks(BaseSDK):
|
|
555
550
|
|
556
551
|
if utils.match_response(http_res, "200", "application/json"):
|
557
552
|
return operations.ListPaymentLinksResponse(
|
558
|
-
result=
|
559
|
-
List[components.PaymentLink], http_res
|
560
|
-
),
|
553
|
+
result=unmarshal_json_response(List[components.PaymentLink], http_res),
|
561
554
|
headers=utils.get_response_headers(http_res.headers),
|
562
555
|
)
|
563
556
|
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
@@ -656,7 +649,7 @@ class PaymentLinks(BaseSDK):
|
|
656
649
|
|
657
650
|
if utils.match_response(http_res, "200", "application/json"):
|
658
651
|
return operations.GetPaymentLinkResponse(
|
659
|
-
result=
|
652
|
+
result=unmarshal_json_response(components.PaymentLink, http_res),
|
660
653
|
headers=utils.get_response_headers(http_res.headers),
|
661
654
|
)
|
662
655
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
@@ -755,7 +748,7 @@ class PaymentLinks(BaseSDK):
|
|
755
748
|
|
756
749
|
if utils.match_response(http_res, "200", "application/json"):
|
757
750
|
return operations.GetPaymentLinkResponse(
|
758
|
-
result=
|
751
|
+
result=unmarshal_json_response(components.PaymentLink, http_res),
|
759
752
|
headers=utils.get_response_headers(http_res.headers),
|
760
753
|
)
|
761
754
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
@@ -926,16 +919,14 @@ class PaymentLinks(BaseSDK):
|
|
926
919
|
response_data: Any = None
|
927
920
|
if utils.match_response(http_res, "200", "application/json"):
|
928
921
|
return operations.UpdatePaymentLinkResponse(
|
929
|
-
result=
|
922
|
+
result=unmarshal_json_response(components.PaymentLink, http_res),
|
930
923
|
headers=utils.get_response_headers(http_res.headers),
|
931
924
|
)
|
932
925
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
933
|
-
response_data =
|
934
|
-
errors.GenericErrorData, http_res
|
935
|
-
)
|
926
|
+
response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
|
936
927
|
raise errors.GenericError(response_data, http_res)
|
937
928
|
if utils.match_response(http_res, "422", "application/json"):
|
938
|
-
response_data =
|
929
|
+
response_data = unmarshal_json_response(
|
939
930
|
errors.UpdatePaymentLinkErrorData, http_res
|
940
931
|
)
|
941
932
|
raise errors.UpdatePaymentLinkError(response_data, http_res)
|
@@ -1107,16 +1098,14 @@ class PaymentLinks(BaseSDK):
|
|
1107
1098
|
response_data: Any = None
|
1108
1099
|
if utils.match_response(http_res, "200", "application/json"):
|
1109
1100
|
return operations.UpdatePaymentLinkResponse(
|
1110
|
-
result=
|
1101
|
+
result=unmarshal_json_response(components.PaymentLink, http_res),
|
1111
1102
|
headers=utils.get_response_headers(http_res.headers),
|
1112
1103
|
)
|
1113
1104
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
1114
|
-
response_data =
|
1115
|
-
errors.GenericErrorData, http_res
|
1116
|
-
)
|
1105
|
+
response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
|
1117
1106
|
raise errors.GenericError(response_data, http_res)
|
1118
1107
|
if utils.match_response(http_res, "422", "application/json"):
|
1119
|
-
response_data =
|
1108
|
+
response_data = unmarshal_json_response(
|
1120
1109
|
errors.UpdatePaymentLinkErrorData, http_res
|
1121
1110
|
)
|
1122
1111
|
raise errors.UpdatePaymentLinkError(response_data, http_res)
|
@@ -1420,7 +1409,7 @@ class PaymentLinks(BaseSDK):
|
|
1420
1409
|
if utils.match_response(http_res, "200", "application/json"):
|
1421
1410
|
http_res_text = utils.stream_to_text(http_res)
|
1422
1411
|
return operations.GetPaymentLinkQRCodeResponse(
|
1423
|
-
result=
|
1412
|
+
result=unmarshal_json_response(
|
1424
1413
|
components.QRCode, http_res, http_res_text
|
1425
1414
|
),
|
1426
1415
|
headers=utils.get_response_headers(http_res.headers),
|
@@ -1534,7 +1523,7 @@ class PaymentLinks(BaseSDK):
|
|
1534
1523
|
if utils.match_response(http_res, "200", "application/json"):
|
1535
1524
|
http_res_text = await utils.stream_to_text_async(http_res)
|
1536
1525
|
return operations.GetPaymentLinkQRCodeResponse(
|
1537
|
-
result=
|
1526
|
+
result=unmarshal_json_response(
|
1538
1527
|
components.QRCode, http_res, http_res_text
|
1539
1528
|
),
|
1540
1529
|
headers=utils.get_response_headers(http_res.headers),
|
moovio_sdk/payment_methods.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
|
|
@@ -95,7 +96,7 @@ class PaymentMethods(BaseSDK):
|
|
95
96
|
|
96
97
|
if utils.match_response(http_res, "200", "application/json"):
|
97
98
|
return operations.ListPaymentMethodsResponse(
|
98
|
-
result=
|
99
|
+
result=unmarshal_json_response(
|
99
100
|
List[components.PaymentMethod], http_res
|
100
101
|
),
|
101
102
|
headers=utils.get_response_headers(http_res.headers),
|
@@ -200,7 +201,7 @@ class PaymentMethods(BaseSDK):
|
|
200
201
|
|
201
202
|
if utils.match_response(http_res, "200", "application/json"):
|
202
203
|
return operations.ListPaymentMethodsResponse(
|
203
|
-
result=
|
204
|
+
result=unmarshal_json_response(
|
204
205
|
List[components.PaymentMethod], http_res
|
205
206
|
),
|
206
207
|
headers=utils.get_response_headers(http_res.headers),
|
@@ -301,9 +302,7 @@ class PaymentMethods(BaseSDK):
|
|
301
302
|
|
302
303
|
if utils.match_response(http_res, "200", "application/json"):
|
303
304
|
return operations.GetPaymentMethodResponse(
|
304
|
-
result=
|
305
|
-
components.PaymentMethod, http_res
|
306
|
-
),
|
305
|
+
result=unmarshal_json_response(components.PaymentMethod, http_res),
|
307
306
|
headers=utils.get_response_headers(http_res.headers),
|
308
307
|
)
|
309
308
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
@@ -402,9 +401,7 @@ class PaymentMethods(BaseSDK):
|
|
402
401
|
|
403
402
|
if utils.match_response(http_res, "200", "application/json"):
|
404
403
|
return operations.GetPaymentMethodResponse(
|
405
|
-
result=
|
406
|
-
components.PaymentMethod, http_res
|
407
|
-
),
|
404
|
+
result=unmarshal_json_response(components.PaymentMethod, http_res),
|
408
405
|
headers=utils.get_response_headers(http_res.headers),
|
409
406
|
)
|
410
407
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
moovio_sdk/receipts.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 BaseModel, 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, cast
|
10
11
|
|
11
12
|
|
@@ -106,15 +107,13 @@ class Receipts(BaseSDK):
|
|
106
107
|
response_data: Any = None
|
107
108
|
if utils.match_response(http_res, "201", "application/json"):
|
108
109
|
return operations.CreateReceiptsResponse(
|
109
|
-
result=
|
110
|
+
result=unmarshal_json_response(
|
110
111
|
List[components.ReceiptResponse], http_res
|
111
112
|
),
|
112
113
|
headers=utils.get_response_headers(http_res.headers),
|
113
114
|
)
|
114
115
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
115
|
-
response_data =
|
116
|
-
errors.GenericErrorData, http_res
|
117
|
-
)
|
116
|
+
response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
|
118
117
|
raise errors.GenericError(response_data, http_res)
|
119
118
|
if utils.match_response(http_res, ["401", "403", "404", "422", "429"], "*"):
|
120
119
|
http_res_text = utils.stream_to_text(http_res)
|
@@ -227,15 +226,13 @@ class Receipts(BaseSDK):
|
|
227
226
|
response_data: Any = None
|
228
227
|
if utils.match_response(http_res, "201", "application/json"):
|
229
228
|
return operations.CreateReceiptsResponse(
|
230
|
-
result=
|
229
|
+
result=unmarshal_json_response(
|
231
230
|
List[components.ReceiptResponse], http_res
|
232
231
|
),
|
233
232
|
headers=utils.get_response_headers(http_res.headers),
|
234
233
|
)
|
235
234
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
236
|
-
response_data =
|
237
|
-
errors.GenericErrorData, http_res
|
238
|
-
)
|
235
|
+
response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
|
239
236
|
raise errors.GenericError(response_data, http_res)
|
240
237
|
if utils.match_response(http_res, ["401", "403", "404", "422", "429"], "*"):
|
241
238
|
http_res_text = await utils.stream_to_text_async(http_res)
|
@@ -330,7 +327,7 @@ class Receipts(BaseSDK):
|
|
330
327
|
|
331
328
|
if utils.match_response(http_res, "200", "application/json"):
|
332
329
|
return operations.ListReceiptsResponse(
|
333
|
-
result=
|
330
|
+
result=unmarshal_json_response(
|
334
331
|
List[components.ReceiptResponse], http_res
|
335
332
|
),
|
336
333
|
headers=utils.get_response_headers(http_res.headers),
|
@@ -428,7 +425,7 @@ class Receipts(BaseSDK):
|
|
428
425
|
|
429
426
|
if utils.match_response(http_res, "200", "application/json"):
|
430
427
|
return operations.ListReceiptsResponse(
|
431
|
-
result=
|
428
|
+
result=unmarshal_json_response(
|
432
429
|
List[components.ReceiptResponse], http_res
|
433
430
|
),
|
434
431
|
headers=utils.get_response_headers(http_res.headers),
|
moovio_sdk/representatives.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
|
|
@@ -153,18 +154,14 @@ class Representatives(BaseSDK):
|
|
153
154
|
response_data: Any = None
|
154
155
|
if utils.match_response(http_res, "200", "application/json"):
|
155
156
|
return operations.CreateRepresentativeResponse(
|
156
|
-
result=
|
157
|
-
components.Representative, http_res
|
158
|
-
),
|
157
|
+
result=unmarshal_json_response(components.Representative, http_res),
|
159
158
|
headers=utils.get_response_headers(http_res.headers),
|
160
159
|
)
|
161
160
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
162
|
-
response_data =
|
163
|
-
errors.GenericErrorData, http_res
|
164
|
-
)
|
161
|
+
response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
|
165
162
|
raise errors.GenericError(response_data, http_res)
|
166
163
|
if utils.match_response(http_res, "422", "application/json"):
|
167
|
-
response_data =
|
164
|
+
response_data = unmarshal_json_response(
|
168
165
|
errors.RepresentativeValidationErrorData, http_res
|
169
166
|
)
|
170
167
|
raise errors.RepresentativeValidationError(response_data, http_res)
|
@@ -326,18 +323,14 @@ class Representatives(BaseSDK):
|
|
326
323
|
response_data: Any = None
|
327
324
|
if utils.match_response(http_res, "200", "application/json"):
|
328
325
|
return operations.CreateRepresentativeResponse(
|
329
|
-
result=
|
330
|
-
components.Representative, http_res
|
331
|
-
),
|
326
|
+
result=unmarshal_json_response(components.Representative, http_res),
|
332
327
|
headers=utils.get_response_headers(http_res.headers),
|
333
328
|
)
|
334
329
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
335
|
-
response_data =
|
336
|
-
errors.GenericErrorData, http_res
|
337
|
-
)
|
330
|
+
response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
|
338
331
|
raise errors.GenericError(response_data, http_res)
|
339
332
|
if utils.match_response(http_res, "422", "application/json"):
|
340
|
-
response_data =
|
333
|
+
response_data = unmarshal_json_response(
|
341
334
|
errors.RepresentativeValidationErrorData, http_res
|
342
335
|
)
|
343
336
|
raise errors.RepresentativeValidationError(response_data, http_res)
|
@@ -437,7 +430,7 @@ class Representatives(BaseSDK):
|
|
437
430
|
|
438
431
|
if utils.match_response(http_res, "200", "application/json"):
|
439
432
|
return operations.ListRepresentativesResponse(
|
440
|
-
result=
|
433
|
+
result=unmarshal_json_response(
|
441
434
|
List[components.Representative], http_res
|
442
435
|
),
|
443
436
|
headers=utils.get_response_headers(http_res.headers),
|
@@ -538,7 +531,7 @@ class Representatives(BaseSDK):
|
|
538
531
|
|
539
532
|
if utils.match_response(http_res, "200", "application/json"):
|
540
533
|
return operations.ListRepresentativesResponse(
|
541
|
-
result=
|
534
|
+
result=unmarshal_json_response(
|
542
535
|
List[components.Representative], http_res
|
543
536
|
),
|
544
537
|
headers=utils.get_response_headers(http_res.headers),
|
@@ -654,9 +647,7 @@ class Representatives(BaseSDK):
|
|
654
647
|
headers=utils.get_response_headers(http_res.headers)
|
655
648
|
)
|
656
649
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
657
|
-
response_data =
|
658
|
-
errors.GenericErrorData, http_res
|
659
|
-
)
|
650
|
+
response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
|
660
651
|
raise errors.GenericError(response_data, http_res)
|
661
652
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
662
653
|
http_res_text = utils.stream_to_text(http_res)
|
@@ -769,9 +760,7 @@ class Representatives(BaseSDK):
|
|
769
760
|
headers=utils.get_response_headers(http_res.headers)
|
770
761
|
)
|
771
762
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
772
|
-
response_data =
|
773
|
-
errors.GenericErrorData, http_res
|
774
|
-
)
|
763
|
+
response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
|
775
764
|
raise errors.GenericError(response_data, http_res)
|
776
765
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
777
766
|
http_res_text = await utils.stream_to_text_async(http_res)
|
@@ -869,9 +858,7 @@ class Representatives(BaseSDK):
|
|
869
858
|
|
870
859
|
if utils.match_response(http_res, "200", "application/json"):
|
871
860
|
return operations.GetRepresentativeResponse(
|
872
|
-
result=
|
873
|
-
components.Representative, http_res
|
874
|
-
),
|
861
|
+
result=unmarshal_json_response(components.Representative, http_res),
|
875
862
|
headers=utils.get_response_headers(http_res.headers),
|
876
863
|
)
|
877
864
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
@@ -970,9 +957,7 @@ class Representatives(BaseSDK):
|
|
970
957
|
|
971
958
|
if utils.match_response(http_res, "200", "application/json"):
|
972
959
|
return operations.GetRepresentativeResponse(
|
973
|
-
result=
|
974
|
-
components.Representative, http_res
|
975
|
-
),
|
960
|
+
result=unmarshal_json_response(components.Representative, http_res),
|
976
961
|
headers=utils.get_response_headers(http_res.headers),
|
977
962
|
)
|
978
963
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
@@ -1168,15 +1153,11 @@ class Representatives(BaseSDK):
|
|
1168
1153
|
response_data: Any = None
|
1169
1154
|
if utils.match_response(http_res, "200", "application/json"):
|
1170
1155
|
return operations.UpdateRepresentativeResponse(
|
1171
|
-
result=
|
1172
|
-
components.Representative, http_res
|
1173
|
-
),
|
1156
|
+
result=unmarshal_json_response(components.Representative, http_res),
|
1174
1157
|
headers=utils.get_response_headers(http_res.headers),
|
1175
1158
|
)
|
1176
1159
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
1177
|
-
response_data =
|
1178
|
-
errors.GenericErrorData, http_res
|
1179
|
-
)
|
1160
|
+
response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
|
1180
1161
|
raise errors.GenericError(response_data, http_res)
|
1181
1162
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1182
1163
|
http_res_text = utils.stream_to_text(http_res)
|
@@ -1371,15 +1352,11 @@ class Representatives(BaseSDK):
|
|
1371
1352
|
response_data: Any = None
|
1372
1353
|
if utils.match_response(http_res, "200", "application/json"):
|
1373
1354
|
return operations.UpdateRepresentativeResponse(
|
1374
|
-
result=
|
1375
|
-
components.Representative, http_res
|
1376
|
-
),
|
1355
|
+
result=unmarshal_json_response(components.Representative, http_res),
|
1377
1356
|
headers=utils.get_response_headers(http_res.headers),
|
1378
1357
|
)
|
1379
1358
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
1380
|
-
response_data =
|
1381
|
-
errors.GenericErrorData, http_res
|
1382
|
-
)
|
1359
|
+
response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
|
1383
1360
|
raise errors.GenericError(response_data, http_res)
|
1384
1361
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1385
1362
|
http_res_text = await utils.stream_to_text_async(http_res)
|
moovio_sdk/scheduling.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
|
|
@@ -119,18 +120,14 @@ class Scheduling(BaseSDK):
|
|
119
120
|
response_data: Any = None
|
120
121
|
if utils.match_response(http_res, "200", "application/json"):
|
121
122
|
return operations.CreateScheduleResponse(
|
122
|
-
result=
|
123
|
-
components.ScheduleResponse, http_res
|
124
|
-
),
|
123
|
+
result=unmarshal_json_response(components.ScheduleResponse, http_res),
|
125
124
|
headers=utils.get_response_headers(http_res.headers),
|
126
125
|
)
|
127
126
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
128
|
-
response_data =
|
129
|
-
errors.GenericErrorData, http_res
|
130
|
-
)
|
127
|
+
response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
|
131
128
|
raise errors.GenericError(response_data, http_res)
|
132
129
|
if utils.match_response(http_res, "422", "application/json"):
|
133
|
-
response_data =
|
130
|
+
response_data = unmarshal_json_response(
|
134
131
|
errors.ScheduleValidationErrorData, http_res
|
135
132
|
)
|
136
133
|
raise errors.ScheduleValidationError(response_data, http_res)
|
@@ -258,18 +255,14 @@ class Scheduling(BaseSDK):
|
|
258
255
|
response_data: Any = None
|
259
256
|
if utils.match_response(http_res, "200", "application/json"):
|
260
257
|
return operations.CreateScheduleResponse(
|
261
|
-
result=
|
262
|
-
components.ScheduleResponse, http_res
|
263
|
-
),
|
258
|
+
result=unmarshal_json_response(components.ScheduleResponse, http_res),
|
264
259
|
headers=utils.get_response_headers(http_res.headers),
|
265
260
|
)
|
266
261
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
267
|
-
response_data =
|
268
|
-
errors.GenericErrorData, http_res
|
269
|
-
)
|
262
|
+
response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
|
270
263
|
raise errors.GenericError(response_data, http_res)
|
271
264
|
if utils.match_response(http_res, "422", "application/json"):
|
272
|
-
response_data =
|
265
|
+
response_data = unmarshal_json_response(
|
273
266
|
errors.ScheduleValidationErrorData, http_res
|
274
267
|
)
|
275
268
|
raise errors.ScheduleValidationError(response_data, http_res)
|
@@ -375,7 +368,7 @@ class Scheduling(BaseSDK):
|
|
375
368
|
|
376
369
|
if utils.match_response(http_res, "200", "application/json"):
|
377
370
|
return operations.ListSchedulesResponse(
|
378
|
-
result=
|
371
|
+
result=unmarshal_json_response(
|
379
372
|
List[components.ScheduleListResponse], http_res
|
380
373
|
),
|
381
374
|
headers=utils.get_response_headers(http_res.headers),
|
@@ -482,7 +475,7 @@ class Scheduling(BaseSDK):
|
|
482
475
|
|
483
476
|
if utils.match_response(http_res, "200", "application/json"):
|
484
477
|
return operations.ListSchedulesResponse(
|
485
|
-
result=
|
478
|
+
result=unmarshal_json_response(
|
486
479
|
List[components.ScheduleListResponse], http_res
|
487
480
|
),
|
488
481
|
headers=utils.get_response_headers(http_res.headers),
|
@@ -614,18 +607,14 @@ class Scheduling(BaseSDK):
|
|
614
607
|
response_data: Any = None
|
615
608
|
if utils.match_response(http_res, "200", "application/json"):
|
616
609
|
return operations.UpdateScheduleResponse(
|
617
|
-
result=
|
618
|
-
components.ScheduleResponse, http_res
|
619
|
-
),
|
610
|
+
result=unmarshal_json_response(components.ScheduleResponse, http_res),
|
620
611
|
headers=utils.get_response_headers(http_res.headers),
|
621
612
|
)
|
622
613
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
623
|
-
response_data =
|
624
|
-
errors.GenericErrorData, http_res
|
625
|
-
)
|
614
|
+
response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
|
626
615
|
raise errors.GenericError(response_data, http_res)
|
627
616
|
if utils.match_response(http_res, "422", "application/json"):
|
628
|
-
response_data =
|
617
|
+
response_data = unmarshal_json_response(
|
629
618
|
errors.ScheduleValidationErrorData, http_res
|
630
619
|
)
|
631
620
|
raise errors.ScheduleValidationError(response_data, http_res)
|
@@ -756,18 +745,14 @@ class Scheduling(BaseSDK):
|
|
756
745
|
response_data: Any = None
|
757
746
|
if utils.match_response(http_res, "200", "application/json"):
|
758
747
|
return operations.UpdateScheduleResponse(
|
759
|
-
result=
|
760
|
-
components.ScheduleResponse, http_res
|
761
|
-
),
|
748
|
+
result=unmarshal_json_response(components.ScheduleResponse, http_res),
|
762
749
|
headers=utils.get_response_headers(http_res.headers),
|
763
750
|
)
|
764
751
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
765
|
-
response_data =
|
766
|
-
errors.GenericErrorData, http_res
|
767
|
-
)
|
752
|
+
response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
|
768
753
|
raise errors.GenericError(response_data, http_res)
|
769
754
|
if utils.match_response(http_res, "422", "application/json"):
|
770
|
-
response_data =
|
755
|
+
response_data = unmarshal_json_response(
|
771
756
|
errors.ScheduleValidationErrorData, http_res
|
772
757
|
)
|
773
758
|
raise errors.ScheduleValidationError(response_data, http_res)
|
@@ -867,9 +852,7 @@ class Scheduling(BaseSDK):
|
|
867
852
|
|
868
853
|
if utils.match_response(http_res, "200", "application/json"):
|
869
854
|
return operations.GetSchedulesResponse(
|
870
|
-
result=
|
871
|
-
components.ScheduleResponse, http_res
|
872
|
-
),
|
855
|
+
result=unmarshal_json_response(components.ScheduleResponse, http_res),
|
873
856
|
headers=utils.get_response_headers(http_res.headers),
|
874
857
|
)
|
875
858
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
@@ -968,9 +951,7 @@ class Scheduling(BaseSDK):
|
|
968
951
|
|
969
952
|
if utils.match_response(http_res, "200", "application/json"):
|
970
953
|
return operations.GetSchedulesResponse(
|
971
|
-
result=
|
972
|
-
components.ScheduleResponse, http_res
|
973
|
-
),
|
954
|
+
result=unmarshal_json_response(components.ScheduleResponse, http_res),
|
974
955
|
headers=utils.get_response_headers(http_res.headers),
|
975
956
|
)
|
976
957
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
@@ -1084,9 +1065,7 @@ class Scheduling(BaseSDK):
|
|
1084
1065
|
headers=utils.get_response_headers(http_res.headers)
|
1085
1066
|
)
|
1086
1067
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
1087
|
-
response_data =
|
1088
|
-
errors.GenericErrorData, http_res
|
1089
|
-
)
|
1068
|
+
response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
|
1090
1069
|
raise errors.GenericError(response_data, http_res)
|
1091
1070
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1092
1071
|
http_res_text = utils.stream_to_text(http_res)
|
@@ -1199,9 +1178,7 @@ class Scheduling(BaseSDK):
|
|
1199
1178
|
headers=utils.get_response_headers(http_res.headers)
|
1200
1179
|
)
|
1201
1180
|
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
1202
|
-
response_data =
|
1203
|
-
errors.GenericErrorData, http_res
|
1204
|
-
)
|
1181
|
+
response_data = unmarshal_json_response(errors.GenericErrorData, http_res)
|
1205
1182
|
raise errors.GenericError(response_data, http_res)
|
1206
1183
|
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1207
1184
|
http_res_text = await utils.stream_to_text_async(http_res)
|
@@ -1302,7 +1279,7 @@ class Scheduling(BaseSDK):
|
|
1302
1279
|
|
1303
1280
|
if utils.match_response(http_res, "200", "application/json"):
|
1304
1281
|
return operations.GetScheduledOccurrenceResponse(
|
1305
|
-
result=
|
1282
|
+
result=unmarshal_json_response(
|
1306
1283
|
components.OccurrencesResponse, http_res
|
1307
1284
|
),
|
1308
1285
|
headers=utils.get_response_headers(http_res.headers),
|
@@ -1406,7 +1383,7 @@ class Scheduling(BaseSDK):
|
|
1406
1383
|
|
1407
1384
|
if utils.match_response(http_res, "200", "application/json"):
|
1408
1385
|
return operations.GetScheduledOccurrenceResponse(
|
1409
|
-
result=
|
1386
|
+
result=unmarshal_json_response(
|
1410
1387
|
components.OccurrencesResponse, http_res
|
1411
1388
|
),
|
1412
1389
|
headers=utils.get_response_headers(http_res.headers),
|