dub 0.26.12__py3-none-any.whl → 0.27.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.
- dub/_version.py +3 -3
- dub/analytics.py +53 -78
- dub/basesdk.py +4 -4
- dub/commissions.py +105 -156
- dub/customers.py +261 -390
- dub/domains.py +309 -472
- dub/embed_tokens.py +53 -80
- dub/events.py +53 -78
- dub/folders.py +205 -316
- dub/links.py +511 -770
- dub/models/errors/__init__.py +9 -0
- dub/models/errors/badrequest.py +12 -6
- dub/models/errors/conflict.py +12 -6
- dub/models/errors/duberror.py +26 -0
- dub/models/errors/forbidden.py +12 -6
- dub/models/errors/internalservererror.py +12 -6
- dub/models/errors/inviteexpired.py +12 -6
- dub/models/errors/no_response_error.py +13 -0
- dub/models/errors/notfound.py +12 -6
- dub/models/errors/ratelimitexceeded.py +12 -6
- dub/models/errors/responsevalidationerror.py +25 -0
- dub/models/errors/sdkerror.py +30 -14
- dub/models/errors/unauthorized.py +12 -6
- dub/models/errors/unprocessableentity.py +12 -6
- dub/models/operations/createcustomer.py +3 -0
- dub/models/operations/getcustomer.py +3 -0
- dub/models/operations/getcustomers.py +3 -0
- dub/models/operations/tracklead.py +2 -2
- dub/models/operations/tracksale.py +2 -2
- dub/models/operations/updatecustomer.py +3 -0
- dub/partners.py +255 -384
- dub/qr_codes.py +49 -74
- dub/tags.py +205 -308
- dub/track.py +105 -156
- dub/utils/serializers.py +3 -2
- dub/utils/unmarshal_json_response.py +24 -0
- dub/workspaces.py +105 -156
- {dub-0.26.12.dist-info → dub-0.27.1.dist-info}/METADATA +50 -56
- {dub-0.26.12.dist-info → dub-0.27.1.dist-info}/RECORD +41 -37
- {dub-0.26.12.dist-info → dub-0.27.1.dist-info}/LICENSE +0 -0
- {dub-0.26.12.dist-info → dub-0.27.1.dist-info}/WHEEL +0 -0
dub/links.py
CHANGED
|
@@ -5,6 +5,7 @@ from dub import utils
|
|
|
5
5
|
from dub._hooks import HookContext
|
|
6
6
|
from dub.models import components, errors, operations
|
|
7
7
|
from dub.types import BaseModel, OptionalNullable, UNSET
|
|
8
|
+
from dub.utils.unmarshal_json_response import unmarshal_json_response
|
|
8
9
|
from jsonpath import JSONPath
|
|
9
10
|
from typing import Any, Dict, List, Mapping, Optional, Union, cast
|
|
10
11
|
|
|
@@ -104,61 +105,48 @@ class Links(BaseSDK):
|
|
|
104
105
|
|
|
105
106
|
response_data: Any = None
|
|
106
107
|
if utils.match_response(http_res, "200", "application/json"):
|
|
107
|
-
return
|
|
108
|
+
return unmarshal_json_response(Optional[components.LinkSchema], http_res)
|
|
108
109
|
if utils.match_response(http_res, "400", "application/json"):
|
|
109
|
-
response_data =
|
|
110
|
-
raise errors.BadRequest(
|
|
110
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
111
|
+
raise errors.BadRequest(response_data, http_res)
|
|
111
112
|
if utils.match_response(http_res, "401", "application/json"):
|
|
112
|
-
response_data =
|
|
113
|
-
raise errors.Unauthorized(
|
|
113
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
114
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
114
115
|
if utils.match_response(http_res, "403", "application/json"):
|
|
115
|
-
response_data =
|
|
116
|
-
raise errors.Forbidden(
|
|
116
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
117
|
+
raise errors.Forbidden(response_data, http_res)
|
|
117
118
|
if utils.match_response(http_res, "404", "application/json"):
|
|
118
|
-
response_data =
|
|
119
|
-
raise errors.NotFound(
|
|
119
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
120
|
+
raise errors.NotFound(response_data, http_res)
|
|
120
121
|
if utils.match_response(http_res, "409", "application/json"):
|
|
121
|
-
response_data =
|
|
122
|
-
raise errors.Conflict(
|
|
122
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
123
|
+
raise errors.Conflict(response_data, http_res)
|
|
123
124
|
if utils.match_response(http_res, "410", "application/json"):
|
|
124
|
-
response_data =
|
|
125
|
-
|
|
126
|
-
)
|
|
127
|
-
raise errors.InviteExpired(data=response_data)
|
|
125
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
126
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
128
127
|
if utils.match_response(http_res, "422", "application/json"):
|
|
129
|
-
response_data =
|
|
130
|
-
|
|
128
|
+
response_data = unmarshal_json_response(
|
|
129
|
+
errors.UnprocessableEntityData, http_res
|
|
131
130
|
)
|
|
132
|
-
raise errors.UnprocessableEntity(
|
|
131
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
133
132
|
if utils.match_response(http_res, "429", "application/json"):
|
|
134
|
-
response_data =
|
|
135
|
-
|
|
133
|
+
response_data = unmarshal_json_response(
|
|
134
|
+
errors.RateLimitExceededData, http_res
|
|
136
135
|
)
|
|
137
|
-
raise errors.RateLimitExceeded(
|
|
136
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
138
137
|
if utils.match_response(http_res, "500", "application/json"):
|
|
139
|
-
response_data =
|
|
140
|
-
|
|
138
|
+
response_data = unmarshal_json_response(
|
|
139
|
+
errors.InternalServerErrorData, http_res
|
|
141
140
|
)
|
|
142
|
-
raise errors.InternalServerError(
|
|
141
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
143
142
|
if utils.match_response(http_res, "4XX", "*"):
|
|
144
143
|
http_res_text = utils.stream_to_text(http_res)
|
|
145
|
-
raise errors.SDKError(
|
|
146
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
147
|
-
)
|
|
144
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
148
145
|
if utils.match_response(http_res, "5XX", "*"):
|
|
149
146
|
http_res_text = utils.stream_to_text(http_res)
|
|
150
|
-
raise errors.SDKError(
|
|
151
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
152
|
-
)
|
|
147
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
153
148
|
|
|
154
|
-
|
|
155
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
156
|
-
raise errors.SDKError(
|
|
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
|
-
)
|
|
149
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
162
150
|
|
|
163
151
|
async def create_async(
|
|
164
152
|
self,
|
|
@@ -254,61 +242,48 @@ class Links(BaseSDK):
|
|
|
254
242
|
|
|
255
243
|
response_data: Any = None
|
|
256
244
|
if utils.match_response(http_res, "200", "application/json"):
|
|
257
|
-
return
|
|
245
|
+
return unmarshal_json_response(Optional[components.LinkSchema], http_res)
|
|
258
246
|
if utils.match_response(http_res, "400", "application/json"):
|
|
259
|
-
response_data =
|
|
260
|
-
raise errors.BadRequest(
|
|
247
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
248
|
+
raise errors.BadRequest(response_data, http_res)
|
|
261
249
|
if utils.match_response(http_res, "401", "application/json"):
|
|
262
|
-
response_data =
|
|
263
|
-
raise errors.Unauthorized(
|
|
250
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
251
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
264
252
|
if utils.match_response(http_res, "403", "application/json"):
|
|
265
|
-
response_data =
|
|
266
|
-
raise errors.Forbidden(
|
|
253
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
254
|
+
raise errors.Forbidden(response_data, http_res)
|
|
267
255
|
if utils.match_response(http_res, "404", "application/json"):
|
|
268
|
-
response_data =
|
|
269
|
-
raise errors.NotFound(
|
|
256
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
257
|
+
raise errors.NotFound(response_data, http_res)
|
|
270
258
|
if utils.match_response(http_res, "409", "application/json"):
|
|
271
|
-
response_data =
|
|
272
|
-
raise errors.Conflict(
|
|
259
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
260
|
+
raise errors.Conflict(response_data, http_res)
|
|
273
261
|
if utils.match_response(http_res, "410", "application/json"):
|
|
274
|
-
response_data =
|
|
275
|
-
|
|
276
|
-
)
|
|
277
|
-
raise errors.InviteExpired(data=response_data)
|
|
262
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
263
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
278
264
|
if utils.match_response(http_res, "422", "application/json"):
|
|
279
|
-
response_data =
|
|
280
|
-
|
|
265
|
+
response_data = unmarshal_json_response(
|
|
266
|
+
errors.UnprocessableEntityData, http_res
|
|
281
267
|
)
|
|
282
|
-
raise errors.UnprocessableEntity(
|
|
268
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
283
269
|
if utils.match_response(http_res, "429", "application/json"):
|
|
284
|
-
response_data =
|
|
285
|
-
|
|
270
|
+
response_data = unmarshal_json_response(
|
|
271
|
+
errors.RateLimitExceededData, http_res
|
|
286
272
|
)
|
|
287
|
-
raise errors.RateLimitExceeded(
|
|
273
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
288
274
|
if utils.match_response(http_res, "500", "application/json"):
|
|
289
|
-
response_data =
|
|
290
|
-
|
|
275
|
+
response_data = unmarshal_json_response(
|
|
276
|
+
errors.InternalServerErrorData, http_res
|
|
291
277
|
)
|
|
292
|
-
raise errors.InternalServerError(
|
|
278
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
293
279
|
if utils.match_response(http_res, "4XX", "*"):
|
|
294
280
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
295
|
-
raise errors.SDKError(
|
|
296
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
297
|
-
)
|
|
281
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
298
282
|
if utils.match_response(http_res, "5XX", "*"):
|
|
299
283
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
300
|
-
raise errors.SDKError(
|
|
301
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
302
|
-
)
|
|
284
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
303
285
|
|
|
304
|
-
|
|
305
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
306
|
-
raise errors.SDKError(
|
|
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
|
-
)
|
|
286
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
312
287
|
|
|
313
288
|
def list(
|
|
314
289
|
self,
|
|
@@ -430,65 +405,52 @@ class Links(BaseSDK):
|
|
|
430
405
|
response_data: Any = None
|
|
431
406
|
if utils.match_response(http_res, "200", "application/json"):
|
|
432
407
|
return operations.GetLinksResponse(
|
|
433
|
-
result=
|
|
434
|
-
|
|
408
|
+
result=unmarshal_json_response(
|
|
409
|
+
Optional[List[components.LinkSchema]], http_res
|
|
435
410
|
),
|
|
436
411
|
next=next_func,
|
|
437
412
|
)
|
|
438
413
|
if utils.match_response(http_res, "400", "application/json"):
|
|
439
|
-
response_data =
|
|
440
|
-
raise errors.BadRequest(
|
|
414
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
415
|
+
raise errors.BadRequest(response_data, http_res)
|
|
441
416
|
if utils.match_response(http_res, "401", "application/json"):
|
|
442
|
-
response_data =
|
|
443
|
-
raise errors.Unauthorized(
|
|
417
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
418
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
444
419
|
if utils.match_response(http_res, "403", "application/json"):
|
|
445
|
-
response_data =
|
|
446
|
-
raise errors.Forbidden(
|
|
420
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
421
|
+
raise errors.Forbidden(response_data, http_res)
|
|
447
422
|
if utils.match_response(http_res, "404", "application/json"):
|
|
448
|
-
response_data =
|
|
449
|
-
raise errors.NotFound(
|
|
423
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
424
|
+
raise errors.NotFound(response_data, http_res)
|
|
450
425
|
if utils.match_response(http_res, "409", "application/json"):
|
|
451
|
-
response_data =
|
|
452
|
-
raise errors.Conflict(
|
|
426
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
427
|
+
raise errors.Conflict(response_data, http_res)
|
|
453
428
|
if utils.match_response(http_res, "410", "application/json"):
|
|
454
|
-
response_data =
|
|
455
|
-
|
|
456
|
-
)
|
|
457
|
-
raise errors.InviteExpired(data=response_data)
|
|
429
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
430
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
458
431
|
if utils.match_response(http_res, "422", "application/json"):
|
|
459
|
-
response_data =
|
|
460
|
-
|
|
432
|
+
response_data = unmarshal_json_response(
|
|
433
|
+
errors.UnprocessableEntityData, http_res
|
|
461
434
|
)
|
|
462
|
-
raise errors.UnprocessableEntity(
|
|
435
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
463
436
|
if utils.match_response(http_res, "429", "application/json"):
|
|
464
|
-
response_data =
|
|
465
|
-
|
|
437
|
+
response_data = unmarshal_json_response(
|
|
438
|
+
errors.RateLimitExceededData, http_res
|
|
466
439
|
)
|
|
467
|
-
raise errors.RateLimitExceeded(
|
|
440
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
468
441
|
if utils.match_response(http_res, "500", "application/json"):
|
|
469
|
-
response_data =
|
|
470
|
-
|
|
442
|
+
response_data = unmarshal_json_response(
|
|
443
|
+
errors.InternalServerErrorData, http_res
|
|
471
444
|
)
|
|
472
|
-
raise errors.InternalServerError(
|
|
445
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
473
446
|
if utils.match_response(http_res, "4XX", "*"):
|
|
474
447
|
http_res_text = utils.stream_to_text(http_res)
|
|
475
|
-
raise errors.SDKError(
|
|
476
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
477
|
-
)
|
|
448
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
478
449
|
if utils.match_response(http_res, "5XX", "*"):
|
|
479
450
|
http_res_text = utils.stream_to_text(http_res)
|
|
480
|
-
raise errors.SDKError(
|
|
481
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
482
|
-
)
|
|
451
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
483
452
|
|
|
484
|
-
|
|
485
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
486
|
-
raise errors.SDKError(
|
|
487
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
488
|
-
http_res.status_code,
|
|
489
|
-
http_res_text,
|
|
490
|
-
http_res,
|
|
491
|
-
)
|
|
453
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
492
454
|
|
|
493
455
|
async def list_async(
|
|
494
456
|
self,
|
|
@@ -610,65 +572,52 @@ class Links(BaseSDK):
|
|
|
610
572
|
response_data: Any = None
|
|
611
573
|
if utils.match_response(http_res, "200", "application/json"):
|
|
612
574
|
return operations.GetLinksResponse(
|
|
613
|
-
result=
|
|
614
|
-
|
|
575
|
+
result=unmarshal_json_response(
|
|
576
|
+
Optional[List[components.LinkSchema]], http_res
|
|
615
577
|
),
|
|
616
578
|
next=next_func,
|
|
617
579
|
)
|
|
618
580
|
if utils.match_response(http_res, "400", "application/json"):
|
|
619
|
-
response_data =
|
|
620
|
-
raise errors.BadRequest(
|
|
581
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
582
|
+
raise errors.BadRequest(response_data, http_res)
|
|
621
583
|
if utils.match_response(http_res, "401", "application/json"):
|
|
622
|
-
response_data =
|
|
623
|
-
raise errors.Unauthorized(
|
|
584
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
585
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
624
586
|
if utils.match_response(http_res, "403", "application/json"):
|
|
625
|
-
response_data =
|
|
626
|
-
raise errors.Forbidden(
|
|
587
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
588
|
+
raise errors.Forbidden(response_data, http_res)
|
|
627
589
|
if utils.match_response(http_res, "404", "application/json"):
|
|
628
|
-
response_data =
|
|
629
|
-
raise errors.NotFound(
|
|
590
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
591
|
+
raise errors.NotFound(response_data, http_res)
|
|
630
592
|
if utils.match_response(http_res, "409", "application/json"):
|
|
631
|
-
response_data =
|
|
632
|
-
raise errors.Conflict(
|
|
593
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
594
|
+
raise errors.Conflict(response_data, http_res)
|
|
633
595
|
if utils.match_response(http_res, "410", "application/json"):
|
|
634
|
-
response_data =
|
|
635
|
-
|
|
636
|
-
)
|
|
637
|
-
raise errors.InviteExpired(data=response_data)
|
|
596
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
597
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
638
598
|
if utils.match_response(http_res, "422", "application/json"):
|
|
639
|
-
response_data =
|
|
640
|
-
|
|
599
|
+
response_data = unmarshal_json_response(
|
|
600
|
+
errors.UnprocessableEntityData, http_res
|
|
641
601
|
)
|
|
642
|
-
raise errors.UnprocessableEntity(
|
|
602
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
643
603
|
if utils.match_response(http_res, "429", "application/json"):
|
|
644
|
-
response_data =
|
|
645
|
-
|
|
604
|
+
response_data = unmarshal_json_response(
|
|
605
|
+
errors.RateLimitExceededData, http_res
|
|
646
606
|
)
|
|
647
|
-
raise errors.RateLimitExceeded(
|
|
607
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
648
608
|
if utils.match_response(http_res, "500", "application/json"):
|
|
649
|
-
response_data =
|
|
650
|
-
|
|
609
|
+
response_data = unmarshal_json_response(
|
|
610
|
+
errors.InternalServerErrorData, http_res
|
|
651
611
|
)
|
|
652
|
-
raise errors.InternalServerError(
|
|
612
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
653
613
|
if utils.match_response(http_res, "4XX", "*"):
|
|
654
614
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
655
|
-
raise errors.SDKError(
|
|
656
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
657
|
-
)
|
|
615
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
658
616
|
if utils.match_response(http_res, "5XX", "*"):
|
|
659
617
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
660
|
-
raise errors.SDKError(
|
|
661
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
662
|
-
)
|
|
618
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
663
619
|
|
|
664
|
-
|
|
665
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
666
|
-
raise errors.SDKError(
|
|
667
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
668
|
-
http_res.status_code,
|
|
669
|
-
http_res_text,
|
|
670
|
-
http_res,
|
|
671
|
-
)
|
|
620
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
672
621
|
|
|
673
622
|
def count(
|
|
674
623
|
self,
|
|
@@ -756,61 +705,48 @@ class Links(BaseSDK):
|
|
|
756
705
|
|
|
757
706
|
response_data: Any = None
|
|
758
707
|
if utils.match_response(http_res, "200", "application/json"):
|
|
759
|
-
return
|
|
708
|
+
return unmarshal_json_response(Optional[float], http_res)
|
|
760
709
|
if utils.match_response(http_res, "400", "application/json"):
|
|
761
|
-
response_data =
|
|
762
|
-
raise errors.BadRequest(
|
|
710
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
711
|
+
raise errors.BadRequest(response_data, http_res)
|
|
763
712
|
if utils.match_response(http_res, "401", "application/json"):
|
|
764
|
-
response_data =
|
|
765
|
-
raise errors.Unauthorized(
|
|
713
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
714
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
766
715
|
if utils.match_response(http_res, "403", "application/json"):
|
|
767
|
-
response_data =
|
|
768
|
-
raise errors.Forbidden(
|
|
716
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
717
|
+
raise errors.Forbidden(response_data, http_res)
|
|
769
718
|
if utils.match_response(http_res, "404", "application/json"):
|
|
770
|
-
response_data =
|
|
771
|
-
raise errors.NotFound(
|
|
719
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
720
|
+
raise errors.NotFound(response_data, http_res)
|
|
772
721
|
if utils.match_response(http_res, "409", "application/json"):
|
|
773
|
-
response_data =
|
|
774
|
-
raise errors.Conflict(
|
|
722
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
723
|
+
raise errors.Conflict(response_data, http_res)
|
|
775
724
|
if utils.match_response(http_res, "410", "application/json"):
|
|
776
|
-
response_data =
|
|
777
|
-
|
|
778
|
-
)
|
|
779
|
-
raise errors.InviteExpired(data=response_data)
|
|
725
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
726
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
780
727
|
if utils.match_response(http_res, "422", "application/json"):
|
|
781
|
-
response_data =
|
|
782
|
-
|
|
728
|
+
response_data = unmarshal_json_response(
|
|
729
|
+
errors.UnprocessableEntityData, http_res
|
|
783
730
|
)
|
|
784
|
-
raise errors.UnprocessableEntity(
|
|
731
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
785
732
|
if utils.match_response(http_res, "429", "application/json"):
|
|
786
|
-
response_data =
|
|
787
|
-
|
|
733
|
+
response_data = unmarshal_json_response(
|
|
734
|
+
errors.RateLimitExceededData, http_res
|
|
788
735
|
)
|
|
789
|
-
raise errors.RateLimitExceeded(
|
|
736
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
790
737
|
if utils.match_response(http_res, "500", "application/json"):
|
|
791
|
-
response_data =
|
|
792
|
-
|
|
738
|
+
response_data = unmarshal_json_response(
|
|
739
|
+
errors.InternalServerErrorData, http_res
|
|
793
740
|
)
|
|
794
|
-
raise errors.InternalServerError(
|
|
741
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
795
742
|
if utils.match_response(http_res, "4XX", "*"):
|
|
796
743
|
http_res_text = utils.stream_to_text(http_res)
|
|
797
|
-
raise errors.SDKError(
|
|
798
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
799
|
-
)
|
|
744
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
800
745
|
if utils.match_response(http_res, "5XX", "*"):
|
|
801
746
|
http_res_text = utils.stream_to_text(http_res)
|
|
802
|
-
raise errors.SDKError(
|
|
803
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
804
|
-
)
|
|
747
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
805
748
|
|
|
806
|
-
|
|
807
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
808
|
-
raise errors.SDKError(
|
|
809
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
810
|
-
http_res.status_code,
|
|
811
|
-
http_res_text,
|
|
812
|
-
http_res,
|
|
813
|
-
)
|
|
749
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
814
750
|
|
|
815
751
|
async def count_async(
|
|
816
752
|
self,
|
|
@@ -898,61 +834,48 @@ class Links(BaseSDK):
|
|
|
898
834
|
|
|
899
835
|
response_data: Any = None
|
|
900
836
|
if utils.match_response(http_res, "200", "application/json"):
|
|
901
|
-
return
|
|
837
|
+
return unmarshal_json_response(Optional[float], http_res)
|
|
902
838
|
if utils.match_response(http_res, "400", "application/json"):
|
|
903
|
-
response_data =
|
|
904
|
-
raise errors.BadRequest(
|
|
839
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
840
|
+
raise errors.BadRequest(response_data, http_res)
|
|
905
841
|
if utils.match_response(http_res, "401", "application/json"):
|
|
906
|
-
response_data =
|
|
907
|
-
raise errors.Unauthorized(
|
|
842
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
843
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
908
844
|
if utils.match_response(http_res, "403", "application/json"):
|
|
909
|
-
response_data =
|
|
910
|
-
raise errors.Forbidden(
|
|
845
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
846
|
+
raise errors.Forbidden(response_data, http_res)
|
|
911
847
|
if utils.match_response(http_res, "404", "application/json"):
|
|
912
|
-
response_data =
|
|
913
|
-
raise errors.NotFound(
|
|
848
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
849
|
+
raise errors.NotFound(response_data, http_res)
|
|
914
850
|
if utils.match_response(http_res, "409", "application/json"):
|
|
915
|
-
response_data =
|
|
916
|
-
raise errors.Conflict(
|
|
851
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
852
|
+
raise errors.Conflict(response_data, http_res)
|
|
917
853
|
if utils.match_response(http_res, "410", "application/json"):
|
|
918
|
-
response_data =
|
|
919
|
-
|
|
920
|
-
)
|
|
921
|
-
raise errors.InviteExpired(data=response_data)
|
|
854
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
855
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
922
856
|
if utils.match_response(http_res, "422", "application/json"):
|
|
923
|
-
response_data =
|
|
924
|
-
|
|
857
|
+
response_data = unmarshal_json_response(
|
|
858
|
+
errors.UnprocessableEntityData, http_res
|
|
925
859
|
)
|
|
926
|
-
raise errors.UnprocessableEntity(
|
|
860
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
927
861
|
if utils.match_response(http_res, "429", "application/json"):
|
|
928
|
-
response_data =
|
|
929
|
-
|
|
862
|
+
response_data = unmarshal_json_response(
|
|
863
|
+
errors.RateLimitExceededData, http_res
|
|
930
864
|
)
|
|
931
|
-
raise errors.RateLimitExceeded(
|
|
865
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
932
866
|
if utils.match_response(http_res, "500", "application/json"):
|
|
933
|
-
response_data =
|
|
934
|
-
|
|
867
|
+
response_data = unmarshal_json_response(
|
|
868
|
+
errors.InternalServerErrorData, http_res
|
|
935
869
|
)
|
|
936
|
-
raise errors.InternalServerError(
|
|
870
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
937
871
|
if utils.match_response(http_res, "4XX", "*"):
|
|
938
872
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
939
|
-
raise errors.SDKError(
|
|
940
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
941
|
-
)
|
|
873
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
942
874
|
if utils.match_response(http_res, "5XX", "*"):
|
|
943
875
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
944
|
-
raise errors.SDKError(
|
|
945
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
946
|
-
)
|
|
876
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
947
877
|
|
|
948
|
-
|
|
949
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
950
|
-
raise errors.SDKError(
|
|
951
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
952
|
-
http_res.status_code,
|
|
953
|
-
http_res_text,
|
|
954
|
-
http_res,
|
|
955
|
-
)
|
|
878
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
956
879
|
|
|
957
880
|
def get(
|
|
958
881
|
self,
|
|
@@ -1040,61 +963,48 @@ class Links(BaseSDK):
|
|
|
1040
963
|
|
|
1041
964
|
response_data: Any = None
|
|
1042
965
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1043
|
-
return
|
|
966
|
+
return unmarshal_json_response(Optional[components.LinkSchema], http_res)
|
|
1044
967
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1045
|
-
response_data =
|
|
1046
|
-
raise errors.BadRequest(
|
|
968
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
969
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1047
970
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1048
|
-
response_data =
|
|
1049
|
-
raise errors.Unauthorized(
|
|
971
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
972
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1050
973
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1051
|
-
response_data =
|
|
1052
|
-
raise errors.Forbidden(
|
|
974
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
975
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1053
976
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1054
|
-
response_data =
|
|
1055
|
-
raise errors.NotFound(
|
|
977
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
978
|
+
raise errors.NotFound(response_data, http_res)
|
|
1056
979
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1057
|
-
response_data =
|
|
1058
|
-
raise errors.Conflict(
|
|
980
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
981
|
+
raise errors.Conflict(response_data, http_res)
|
|
1059
982
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1060
|
-
response_data =
|
|
1061
|
-
|
|
1062
|
-
)
|
|
1063
|
-
raise errors.InviteExpired(data=response_data)
|
|
983
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
984
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1064
985
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1065
|
-
response_data =
|
|
1066
|
-
|
|
986
|
+
response_data = unmarshal_json_response(
|
|
987
|
+
errors.UnprocessableEntityData, http_res
|
|
1067
988
|
)
|
|
1068
|
-
raise errors.UnprocessableEntity(
|
|
989
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1069
990
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1070
|
-
response_data =
|
|
1071
|
-
|
|
991
|
+
response_data = unmarshal_json_response(
|
|
992
|
+
errors.RateLimitExceededData, http_res
|
|
1072
993
|
)
|
|
1073
|
-
raise errors.RateLimitExceeded(
|
|
994
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1074
995
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1075
|
-
response_data =
|
|
1076
|
-
|
|
996
|
+
response_data = unmarshal_json_response(
|
|
997
|
+
errors.InternalServerErrorData, http_res
|
|
1077
998
|
)
|
|
1078
|
-
raise errors.InternalServerError(
|
|
999
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1079
1000
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1080
1001
|
http_res_text = utils.stream_to_text(http_res)
|
|
1081
|
-
raise errors.SDKError(
|
|
1082
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1083
|
-
)
|
|
1002
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1084
1003
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1085
1004
|
http_res_text = utils.stream_to_text(http_res)
|
|
1086
|
-
raise errors.SDKError(
|
|
1087
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1088
|
-
)
|
|
1005
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1089
1006
|
|
|
1090
|
-
|
|
1091
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1092
|
-
raise errors.SDKError(
|
|
1093
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1094
|
-
http_res.status_code,
|
|
1095
|
-
http_res_text,
|
|
1096
|
-
http_res,
|
|
1097
|
-
)
|
|
1007
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1098
1008
|
|
|
1099
1009
|
async def get_async(
|
|
1100
1010
|
self,
|
|
@@ -1182,61 +1092,48 @@ class Links(BaseSDK):
|
|
|
1182
1092
|
|
|
1183
1093
|
response_data: Any = None
|
|
1184
1094
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1185
|
-
return
|
|
1095
|
+
return unmarshal_json_response(Optional[components.LinkSchema], http_res)
|
|
1186
1096
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1187
|
-
response_data =
|
|
1188
|
-
raise errors.BadRequest(
|
|
1097
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
1098
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1189
1099
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1190
|
-
response_data =
|
|
1191
|
-
raise errors.Unauthorized(
|
|
1100
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
1101
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1192
1102
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1193
|
-
response_data =
|
|
1194
|
-
raise errors.Forbidden(
|
|
1103
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
1104
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1195
1105
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1196
|
-
response_data =
|
|
1197
|
-
raise errors.NotFound(
|
|
1106
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1107
|
+
raise errors.NotFound(response_data, http_res)
|
|
1198
1108
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1199
|
-
response_data =
|
|
1200
|
-
raise errors.Conflict(
|
|
1109
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
1110
|
+
raise errors.Conflict(response_data, http_res)
|
|
1201
1111
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1202
|
-
response_data =
|
|
1203
|
-
|
|
1204
|
-
)
|
|
1205
|
-
raise errors.InviteExpired(data=response_data)
|
|
1112
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
1113
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1206
1114
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1207
|
-
response_data =
|
|
1208
|
-
|
|
1115
|
+
response_data = unmarshal_json_response(
|
|
1116
|
+
errors.UnprocessableEntityData, http_res
|
|
1209
1117
|
)
|
|
1210
|
-
raise errors.UnprocessableEntity(
|
|
1118
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1211
1119
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1212
|
-
response_data =
|
|
1213
|
-
|
|
1120
|
+
response_data = unmarshal_json_response(
|
|
1121
|
+
errors.RateLimitExceededData, http_res
|
|
1214
1122
|
)
|
|
1215
|
-
raise errors.RateLimitExceeded(
|
|
1123
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1216
1124
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1217
|
-
response_data =
|
|
1218
|
-
|
|
1125
|
+
response_data = unmarshal_json_response(
|
|
1126
|
+
errors.InternalServerErrorData, http_res
|
|
1219
1127
|
)
|
|
1220
|
-
raise errors.InternalServerError(
|
|
1128
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1221
1129
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1222
1130
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1223
|
-
raise errors.SDKError(
|
|
1224
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1225
|
-
)
|
|
1131
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1226
1132
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1227
1133
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1228
|
-
raise errors.SDKError(
|
|
1229
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1230
|
-
)
|
|
1134
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1231
1135
|
|
|
1232
|
-
|
|
1233
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1234
|
-
raise errors.SDKError(
|
|
1235
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1236
|
-
http_res.status_code,
|
|
1237
|
-
http_res_text,
|
|
1238
|
-
http_res,
|
|
1239
|
-
)
|
|
1136
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1240
1137
|
|
|
1241
1138
|
def update(
|
|
1242
1139
|
self,
|
|
@@ -1339,61 +1236,48 @@ class Links(BaseSDK):
|
|
|
1339
1236
|
|
|
1340
1237
|
response_data: Any = None
|
|
1341
1238
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1342
|
-
return
|
|
1239
|
+
return unmarshal_json_response(Optional[components.LinkSchema], http_res)
|
|
1343
1240
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1344
|
-
response_data =
|
|
1345
|
-
raise errors.BadRequest(
|
|
1241
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
1242
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1346
1243
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1347
|
-
response_data =
|
|
1348
|
-
raise errors.Unauthorized(
|
|
1244
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
1245
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1349
1246
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1350
|
-
response_data =
|
|
1351
|
-
raise errors.Forbidden(
|
|
1247
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
1248
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1352
1249
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1353
|
-
response_data =
|
|
1354
|
-
raise errors.NotFound(
|
|
1250
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1251
|
+
raise errors.NotFound(response_data, http_res)
|
|
1355
1252
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1356
|
-
response_data =
|
|
1357
|
-
raise errors.Conflict(
|
|
1253
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
1254
|
+
raise errors.Conflict(response_data, http_res)
|
|
1358
1255
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1359
|
-
response_data =
|
|
1360
|
-
|
|
1361
|
-
)
|
|
1362
|
-
raise errors.InviteExpired(data=response_data)
|
|
1256
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
1257
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1363
1258
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1364
|
-
response_data =
|
|
1365
|
-
|
|
1259
|
+
response_data = unmarshal_json_response(
|
|
1260
|
+
errors.UnprocessableEntityData, http_res
|
|
1366
1261
|
)
|
|
1367
|
-
raise errors.UnprocessableEntity(
|
|
1262
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1368
1263
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1369
|
-
response_data =
|
|
1370
|
-
|
|
1264
|
+
response_data = unmarshal_json_response(
|
|
1265
|
+
errors.RateLimitExceededData, http_res
|
|
1371
1266
|
)
|
|
1372
|
-
raise errors.RateLimitExceeded(
|
|
1267
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1373
1268
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1374
|
-
response_data =
|
|
1375
|
-
|
|
1269
|
+
response_data = unmarshal_json_response(
|
|
1270
|
+
errors.InternalServerErrorData, http_res
|
|
1376
1271
|
)
|
|
1377
|
-
raise errors.InternalServerError(
|
|
1272
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1378
1273
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1379
1274
|
http_res_text = utils.stream_to_text(http_res)
|
|
1380
|
-
raise errors.SDKError(
|
|
1381
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1382
|
-
)
|
|
1275
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1383
1276
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1384
1277
|
http_res_text = utils.stream_to_text(http_res)
|
|
1385
|
-
raise errors.SDKError(
|
|
1386
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1387
|
-
)
|
|
1278
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1388
1279
|
|
|
1389
|
-
|
|
1390
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1391
|
-
raise errors.SDKError(
|
|
1392
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1393
|
-
http_res.status_code,
|
|
1394
|
-
http_res_text,
|
|
1395
|
-
http_res,
|
|
1396
|
-
)
|
|
1280
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1397
1281
|
|
|
1398
1282
|
async def update_async(
|
|
1399
1283
|
self,
|
|
@@ -1496,61 +1380,48 @@ class Links(BaseSDK):
|
|
|
1496
1380
|
|
|
1497
1381
|
response_data: Any = None
|
|
1498
1382
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1499
|
-
return
|
|
1383
|
+
return unmarshal_json_response(Optional[components.LinkSchema], http_res)
|
|
1500
1384
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1501
|
-
response_data =
|
|
1502
|
-
raise errors.BadRequest(
|
|
1385
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
1386
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1503
1387
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1504
|
-
response_data =
|
|
1505
|
-
raise errors.Unauthorized(
|
|
1388
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
1389
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1506
1390
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1507
|
-
response_data =
|
|
1508
|
-
raise errors.Forbidden(
|
|
1391
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
1392
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1509
1393
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1510
|
-
response_data =
|
|
1511
|
-
raise errors.NotFound(
|
|
1394
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1395
|
+
raise errors.NotFound(response_data, http_res)
|
|
1512
1396
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1513
|
-
response_data =
|
|
1514
|
-
raise errors.Conflict(
|
|
1397
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
1398
|
+
raise errors.Conflict(response_data, http_res)
|
|
1515
1399
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1516
|
-
response_data =
|
|
1517
|
-
|
|
1518
|
-
)
|
|
1519
|
-
raise errors.InviteExpired(data=response_data)
|
|
1400
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
1401
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1520
1402
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1521
|
-
response_data =
|
|
1522
|
-
|
|
1403
|
+
response_data = unmarshal_json_response(
|
|
1404
|
+
errors.UnprocessableEntityData, http_res
|
|
1523
1405
|
)
|
|
1524
|
-
raise errors.UnprocessableEntity(
|
|
1406
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1525
1407
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1526
|
-
response_data =
|
|
1527
|
-
|
|
1408
|
+
response_data = unmarshal_json_response(
|
|
1409
|
+
errors.RateLimitExceededData, http_res
|
|
1528
1410
|
)
|
|
1529
|
-
raise errors.RateLimitExceeded(
|
|
1411
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1530
1412
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1531
|
-
response_data =
|
|
1532
|
-
|
|
1413
|
+
response_data = unmarshal_json_response(
|
|
1414
|
+
errors.InternalServerErrorData, http_res
|
|
1533
1415
|
)
|
|
1534
|
-
raise errors.InternalServerError(
|
|
1416
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1535
1417
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1536
1418
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1537
|
-
raise errors.SDKError(
|
|
1538
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1539
|
-
)
|
|
1419
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1540
1420
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1541
1421
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1542
|
-
raise errors.SDKError(
|
|
1543
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1544
|
-
)
|
|
1422
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1545
1423
|
|
|
1546
|
-
|
|
1547
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1548
|
-
raise errors.SDKError(
|
|
1549
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1550
|
-
http_res.status_code,
|
|
1551
|
-
http_res_text,
|
|
1552
|
-
http_res,
|
|
1553
|
-
)
|
|
1424
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1554
1425
|
|
|
1555
1426
|
def delete(
|
|
1556
1427
|
self,
|
|
@@ -1636,63 +1507,50 @@ class Links(BaseSDK):
|
|
|
1636
1507
|
|
|
1637
1508
|
response_data: Any = None
|
|
1638
1509
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1639
|
-
return
|
|
1640
|
-
|
|
1510
|
+
return unmarshal_json_response(
|
|
1511
|
+
Optional[operations.DeleteLinkResponseBody], http_res
|
|
1641
1512
|
)
|
|
1642
1513
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1643
|
-
response_data =
|
|
1644
|
-
raise errors.BadRequest(
|
|
1514
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
1515
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1645
1516
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1646
|
-
response_data =
|
|
1647
|
-
raise errors.Unauthorized(
|
|
1517
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
1518
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1648
1519
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1649
|
-
response_data =
|
|
1650
|
-
raise errors.Forbidden(
|
|
1520
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
1521
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1651
1522
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1652
|
-
response_data =
|
|
1653
|
-
raise errors.NotFound(
|
|
1523
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1524
|
+
raise errors.NotFound(response_data, http_res)
|
|
1654
1525
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1655
|
-
response_data =
|
|
1656
|
-
raise errors.Conflict(
|
|
1526
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
1527
|
+
raise errors.Conflict(response_data, http_res)
|
|
1657
1528
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1658
|
-
response_data =
|
|
1659
|
-
|
|
1660
|
-
)
|
|
1661
|
-
raise errors.InviteExpired(data=response_data)
|
|
1529
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
1530
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1662
1531
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1663
|
-
response_data =
|
|
1664
|
-
|
|
1532
|
+
response_data = unmarshal_json_response(
|
|
1533
|
+
errors.UnprocessableEntityData, http_res
|
|
1665
1534
|
)
|
|
1666
|
-
raise errors.UnprocessableEntity(
|
|
1535
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1667
1536
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1668
|
-
response_data =
|
|
1669
|
-
|
|
1537
|
+
response_data = unmarshal_json_response(
|
|
1538
|
+
errors.RateLimitExceededData, http_res
|
|
1670
1539
|
)
|
|
1671
|
-
raise errors.RateLimitExceeded(
|
|
1540
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1672
1541
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1673
|
-
response_data =
|
|
1674
|
-
|
|
1542
|
+
response_data = unmarshal_json_response(
|
|
1543
|
+
errors.InternalServerErrorData, http_res
|
|
1675
1544
|
)
|
|
1676
|
-
raise errors.InternalServerError(
|
|
1545
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1677
1546
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1678
1547
|
http_res_text = utils.stream_to_text(http_res)
|
|
1679
|
-
raise errors.SDKError(
|
|
1680
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1681
|
-
)
|
|
1548
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1682
1549
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1683
1550
|
http_res_text = utils.stream_to_text(http_res)
|
|
1684
|
-
raise errors.SDKError(
|
|
1685
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1686
|
-
)
|
|
1551
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1687
1552
|
|
|
1688
|
-
|
|
1689
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1690
|
-
raise errors.SDKError(
|
|
1691
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1692
|
-
http_res.status_code,
|
|
1693
|
-
http_res_text,
|
|
1694
|
-
http_res,
|
|
1695
|
-
)
|
|
1553
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1696
1554
|
|
|
1697
1555
|
async def delete_async(
|
|
1698
1556
|
self,
|
|
@@ -1778,63 +1636,50 @@ class Links(BaseSDK):
|
|
|
1778
1636
|
|
|
1779
1637
|
response_data: Any = None
|
|
1780
1638
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1781
|
-
return
|
|
1782
|
-
|
|
1639
|
+
return unmarshal_json_response(
|
|
1640
|
+
Optional[operations.DeleteLinkResponseBody], http_res
|
|
1783
1641
|
)
|
|
1784
1642
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1785
|
-
response_data =
|
|
1786
|
-
raise errors.BadRequest(
|
|
1643
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
1644
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1787
1645
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1788
|
-
response_data =
|
|
1789
|
-
raise errors.Unauthorized(
|
|
1646
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
1647
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1790
1648
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1791
|
-
response_data =
|
|
1792
|
-
raise errors.Forbidden(
|
|
1649
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
1650
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1793
1651
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1794
|
-
response_data =
|
|
1795
|
-
raise errors.NotFound(
|
|
1652
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1653
|
+
raise errors.NotFound(response_data, http_res)
|
|
1796
1654
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1797
|
-
response_data =
|
|
1798
|
-
raise errors.Conflict(
|
|
1655
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
1656
|
+
raise errors.Conflict(response_data, http_res)
|
|
1799
1657
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1800
|
-
response_data =
|
|
1801
|
-
|
|
1802
|
-
)
|
|
1803
|
-
raise errors.InviteExpired(data=response_data)
|
|
1658
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
1659
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1804
1660
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1805
|
-
response_data =
|
|
1806
|
-
|
|
1661
|
+
response_data = unmarshal_json_response(
|
|
1662
|
+
errors.UnprocessableEntityData, http_res
|
|
1807
1663
|
)
|
|
1808
|
-
raise errors.UnprocessableEntity(
|
|
1664
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1809
1665
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1810
|
-
response_data =
|
|
1811
|
-
|
|
1666
|
+
response_data = unmarshal_json_response(
|
|
1667
|
+
errors.RateLimitExceededData, http_res
|
|
1812
1668
|
)
|
|
1813
|
-
raise errors.RateLimitExceeded(
|
|
1669
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1814
1670
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1815
|
-
response_data =
|
|
1816
|
-
|
|
1671
|
+
response_data = unmarshal_json_response(
|
|
1672
|
+
errors.InternalServerErrorData, http_res
|
|
1817
1673
|
)
|
|
1818
|
-
raise errors.InternalServerError(
|
|
1674
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1819
1675
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1820
1676
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1821
|
-
raise errors.SDKError(
|
|
1822
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1823
|
-
)
|
|
1677
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1824
1678
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1825
1679
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1826
|
-
raise errors.SDKError(
|
|
1827
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1828
|
-
)
|
|
1680
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1829
1681
|
|
|
1830
|
-
|
|
1831
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1832
|
-
raise errors.SDKError(
|
|
1833
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1834
|
-
http_res.status_code,
|
|
1835
|
-
http_res_text,
|
|
1836
|
-
http_res,
|
|
1837
|
-
)
|
|
1682
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1838
1683
|
|
|
1839
1684
|
def create_many(
|
|
1840
1685
|
self,
|
|
@@ -1925,63 +1770,50 @@ class Links(BaseSDK):
|
|
|
1925
1770
|
|
|
1926
1771
|
response_data: Any = None
|
|
1927
1772
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1928
|
-
return
|
|
1929
|
-
|
|
1773
|
+
return unmarshal_json_response(
|
|
1774
|
+
Optional[List[operations.ResponseBody]], http_res
|
|
1930
1775
|
)
|
|
1931
1776
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1932
|
-
response_data =
|
|
1933
|
-
raise errors.BadRequest(
|
|
1777
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
1778
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1934
1779
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1935
|
-
response_data =
|
|
1936
|
-
raise errors.Unauthorized(
|
|
1780
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
1781
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1937
1782
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1938
|
-
response_data =
|
|
1939
|
-
raise errors.Forbidden(
|
|
1783
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
1784
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1940
1785
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1941
|
-
response_data =
|
|
1942
|
-
raise errors.NotFound(
|
|
1786
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1787
|
+
raise errors.NotFound(response_data, http_res)
|
|
1943
1788
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1944
|
-
response_data =
|
|
1945
|
-
raise errors.Conflict(
|
|
1789
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
1790
|
+
raise errors.Conflict(response_data, http_res)
|
|
1946
1791
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1947
|
-
response_data =
|
|
1948
|
-
|
|
1949
|
-
)
|
|
1950
|
-
raise errors.InviteExpired(data=response_data)
|
|
1792
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
1793
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1951
1794
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1952
|
-
response_data =
|
|
1953
|
-
|
|
1795
|
+
response_data = unmarshal_json_response(
|
|
1796
|
+
errors.UnprocessableEntityData, http_res
|
|
1954
1797
|
)
|
|
1955
|
-
raise errors.UnprocessableEntity(
|
|
1798
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1956
1799
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1957
|
-
response_data =
|
|
1958
|
-
|
|
1800
|
+
response_data = unmarshal_json_response(
|
|
1801
|
+
errors.RateLimitExceededData, http_res
|
|
1959
1802
|
)
|
|
1960
|
-
raise errors.RateLimitExceeded(
|
|
1803
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1961
1804
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1962
|
-
response_data =
|
|
1963
|
-
|
|
1805
|
+
response_data = unmarshal_json_response(
|
|
1806
|
+
errors.InternalServerErrorData, http_res
|
|
1964
1807
|
)
|
|
1965
|
-
raise errors.InternalServerError(
|
|
1808
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1966
1809
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1967
1810
|
http_res_text = utils.stream_to_text(http_res)
|
|
1968
|
-
raise errors.SDKError(
|
|
1969
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1970
|
-
)
|
|
1811
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1971
1812
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1972
1813
|
http_res_text = utils.stream_to_text(http_res)
|
|
1973
|
-
raise errors.SDKError(
|
|
1974
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1975
|
-
)
|
|
1814
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1976
1815
|
|
|
1977
|
-
|
|
1978
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1979
|
-
raise errors.SDKError(
|
|
1980
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1981
|
-
http_res.status_code,
|
|
1982
|
-
http_res_text,
|
|
1983
|
-
http_res,
|
|
1984
|
-
)
|
|
1816
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1985
1817
|
|
|
1986
1818
|
async def create_many_async(
|
|
1987
1819
|
self,
|
|
@@ -2072,63 +1904,50 @@ class Links(BaseSDK):
|
|
|
2072
1904
|
|
|
2073
1905
|
response_data: Any = None
|
|
2074
1906
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2075
|
-
return
|
|
2076
|
-
|
|
1907
|
+
return unmarshal_json_response(
|
|
1908
|
+
Optional[List[operations.ResponseBody]], http_res
|
|
2077
1909
|
)
|
|
2078
1910
|
if utils.match_response(http_res, "400", "application/json"):
|
|
2079
|
-
response_data =
|
|
2080
|
-
raise errors.BadRequest(
|
|
1911
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
1912
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2081
1913
|
if utils.match_response(http_res, "401", "application/json"):
|
|
2082
|
-
response_data =
|
|
2083
|
-
raise errors.Unauthorized(
|
|
1914
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
1915
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2084
1916
|
if utils.match_response(http_res, "403", "application/json"):
|
|
2085
|
-
response_data =
|
|
2086
|
-
raise errors.Forbidden(
|
|
1917
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
1918
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2087
1919
|
if utils.match_response(http_res, "404", "application/json"):
|
|
2088
|
-
response_data =
|
|
2089
|
-
raise errors.NotFound(
|
|
1920
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1921
|
+
raise errors.NotFound(response_data, http_res)
|
|
2090
1922
|
if utils.match_response(http_res, "409", "application/json"):
|
|
2091
|
-
response_data =
|
|
2092
|
-
raise errors.Conflict(
|
|
1923
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
1924
|
+
raise errors.Conflict(response_data, http_res)
|
|
2093
1925
|
if utils.match_response(http_res, "410", "application/json"):
|
|
2094
|
-
response_data =
|
|
2095
|
-
|
|
2096
|
-
)
|
|
2097
|
-
raise errors.InviteExpired(data=response_data)
|
|
1926
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
1927
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
2098
1928
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2099
|
-
response_data =
|
|
2100
|
-
|
|
1929
|
+
response_data = unmarshal_json_response(
|
|
1930
|
+
errors.UnprocessableEntityData, http_res
|
|
2101
1931
|
)
|
|
2102
|
-
raise errors.UnprocessableEntity(
|
|
1932
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
2103
1933
|
if utils.match_response(http_res, "429", "application/json"):
|
|
2104
|
-
response_data =
|
|
2105
|
-
|
|
1934
|
+
response_data = unmarshal_json_response(
|
|
1935
|
+
errors.RateLimitExceededData, http_res
|
|
2106
1936
|
)
|
|
2107
|
-
raise errors.RateLimitExceeded(
|
|
1937
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
2108
1938
|
if utils.match_response(http_res, "500", "application/json"):
|
|
2109
|
-
response_data =
|
|
2110
|
-
|
|
1939
|
+
response_data = unmarshal_json_response(
|
|
1940
|
+
errors.InternalServerErrorData, http_res
|
|
2111
1941
|
)
|
|
2112
|
-
raise errors.InternalServerError(
|
|
1942
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2113
1943
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2114
1944
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2115
|
-
raise errors.SDKError(
|
|
2116
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2117
|
-
)
|
|
1945
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2118
1946
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2119
1947
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2120
|
-
raise errors.SDKError(
|
|
2121
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2122
|
-
)
|
|
1948
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2123
1949
|
|
|
2124
|
-
|
|
2125
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2126
|
-
raise errors.SDKError(
|
|
2127
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2128
|
-
http_res.status_code,
|
|
2129
|
-
http_res_text,
|
|
2130
|
-
http_res,
|
|
2131
|
-
)
|
|
1950
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
2132
1951
|
|
|
2133
1952
|
def update_many(
|
|
2134
1953
|
self,
|
|
@@ -2228,63 +2047,50 @@ class Links(BaseSDK):
|
|
|
2228
2047
|
|
|
2229
2048
|
response_data: Any = None
|
|
2230
2049
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2231
|
-
return
|
|
2232
|
-
|
|
2050
|
+
return unmarshal_json_response(
|
|
2051
|
+
Optional[List[components.LinkSchema]], http_res
|
|
2233
2052
|
)
|
|
2234
2053
|
if utils.match_response(http_res, "400", "application/json"):
|
|
2235
|
-
response_data =
|
|
2236
|
-
raise errors.BadRequest(
|
|
2054
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
2055
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2237
2056
|
if utils.match_response(http_res, "401", "application/json"):
|
|
2238
|
-
response_data =
|
|
2239
|
-
raise errors.Unauthorized(
|
|
2057
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
2058
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2240
2059
|
if utils.match_response(http_res, "403", "application/json"):
|
|
2241
|
-
response_data =
|
|
2242
|
-
raise errors.Forbidden(
|
|
2060
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
2061
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2243
2062
|
if utils.match_response(http_res, "404", "application/json"):
|
|
2244
|
-
response_data =
|
|
2245
|
-
raise errors.NotFound(
|
|
2063
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
2064
|
+
raise errors.NotFound(response_data, http_res)
|
|
2246
2065
|
if utils.match_response(http_res, "409", "application/json"):
|
|
2247
|
-
response_data =
|
|
2248
|
-
raise errors.Conflict(
|
|
2066
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
2067
|
+
raise errors.Conflict(response_data, http_res)
|
|
2249
2068
|
if utils.match_response(http_res, "410", "application/json"):
|
|
2250
|
-
response_data =
|
|
2251
|
-
|
|
2252
|
-
)
|
|
2253
|
-
raise errors.InviteExpired(data=response_data)
|
|
2069
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
2070
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
2254
2071
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2255
|
-
response_data =
|
|
2256
|
-
|
|
2072
|
+
response_data = unmarshal_json_response(
|
|
2073
|
+
errors.UnprocessableEntityData, http_res
|
|
2257
2074
|
)
|
|
2258
|
-
raise errors.UnprocessableEntity(
|
|
2075
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
2259
2076
|
if utils.match_response(http_res, "429", "application/json"):
|
|
2260
|
-
response_data =
|
|
2261
|
-
|
|
2077
|
+
response_data = unmarshal_json_response(
|
|
2078
|
+
errors.RateLimitExceededData, http_res
|
|
2262
2079
|
)
|
|
2263
|
-
raise errors.RateLimitExceeded(
|
|
2080
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
2264
2081
|
if utils.match_response(http_res, "500", "application/json"):
|
|
2265
|
-
response_data =
|
|
2266
|
-
|
|
2082
|
+
response_data = unmarshal_json_response(
|
|
2083
|
+
errors.InternalServerErrorData, http_res
|
|
2267
2084
|
)
|
|
2268
|
-
raise errors.InternalServerError(
|
|
2085
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2269
2086
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2270
2087
|
http_res_text = utils.stream_to_text(http_res)
|
|
2271
|
-
raise errors.SDKError(
|
|
2272
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2273
|
-
)
|
|
2088
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2274
2089
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2275
2090
|
http_res_text = utils.stream_to_text(http_res)
|
|
2276
|
-
raise errors.SDKError(
|
|
2277
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2278
|
-
)
|
|
2091
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2279
2092
|
|
|
2280
|
-
|
|
2281
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
2282
|
-
raise errors.SDKError(
|
|
2283
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2284
|
-
http_res.status_code,
|
|
2285
|
-
http_res_text,
|
|
2286
|
-
http_res,
|
|
2287
|
-
)
|
|
2093
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
2288
2094
|
|
|
2289
2095
|
async def update_many_async(
|
|
2290
2096
|
self,
|
|
@@ -2384,63 +2190,50 @@ class Links(BaseSDK):
|
|
|
2384
2190
|
|
|
2385
2191
|
response_data: Any = None
|
|
2386
2192
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2387
|
-
return
|
|
2388
|
-
|
|
2193
|
+
return unmarshal_json_response(
|
|
2194
|
+
Optional[List[components.LinkSchema]], http_res
|
|
2389
2195
|
)
|
|
2390
2196
|
if utils.match_response(http_res, "400", "application/json"):
|
|
2391
|
-
response_data =
|
|
2392
|
-
raise errors.BadRequest(
|
|
2197
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
2198
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2393
2199
|
if utils.match_response(http_res, "401", "application/json"):
|
|
2394
|
-
response_data =
|
|
2395
|
-
raise errors.Unauthorized(
|
|
2200
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
2201
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2396
2202
|
if utils.match_response(http_res, "403", "application/json"):
|
|
2397
|
-
response_data =
|
|
2398
|
-
raise errors.Forbidden(
|
|
2203
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
2204
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2399
2205
|
if utils.match_response(http_res, "404", "application/json"):
|
|
2400
|
-
response_data =
|
|
2401
|
-
raise errors.NotFound(
|
|
2206
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
2207
|
+
raise errors.NotFound(response_data, http_res)
|
|
2402
2208
|
if utils.match_response(http_res, "409", "application/json"):
|
|
2403
|
-
response_data =
|
|
2404
|
-
raise errors.Conflict(
|
|
2209
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
2210
|
+
raise errors.Conflict(response_data, http_res)
|
|
2405
2211
|
if utils.match_response(http_res, "410", "application/json"):
|
|
2406
|
-
response_data =
|
|
2407
|
-
|
|
2408
|
-
)
|
|
2409
|
-
raise errors.InviteExpired(data=response_data)
|
|
2212
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
2213
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
2410
2214
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2411
|
-
response_data =
|
|
2412
|
-
|
|
2215
|
+
response_data = unmarshal_json_response(
|
|
2216
|
+
errors.UnprocessableEntityData, http_res
|
|
2413
2217
|
)
|
|
2414
|
-
raise errors.UnprocessableEntity(
|
|
2218
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
2415
2219
|
if utils.match_response(http_res, "429", "application/json"):
|
|
2416
|
-
response_data =
|
|
2417
|
-
|
|
2220
|
+
response_data = unmarshal_json_response(
|
|
2221
|
+
errors.RateLimitExceededData, http_res
|
|
2418
2222
|
)
|
|
2419
|
-
raise errors.RateLimitExceeded(
|
|
2223
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
2420
2224
|
if utils.match_response(http_res, "500", "application/json"):
|
|
2421
|
-
response_data =
|
|
2422
|
-
|
|
2225
|
+
response_data = unmarshal_json_response(
|
|
2226
|
+
errors.InternalServerErrorData, http_res
|
|
2423
2227
|
)
|
|
2424
|
-
raise errors.InternalServerError(
|
|
2228
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2425
2229
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2426
2230
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2427
|
-
raise errors.SDKError(
|
|
2428
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2429
|
-
)
|
|
2231
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2430
2232
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2431
2233
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2432
|
-
raise errors.SDKError(
|
|
2433
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2434
|
-
)
|
|
2234
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2435
2235
|
|
|
2436
|
-
|
|
2437
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2438
|
-
raise errors.SDKError(
|
|
2439
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2440
|
-
http_res.status_code,
|
|
2441
|
-
http_res_text,
|
|
2442
|
-
http_res,
|
|
2443
|
-
)
|
|
2236
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
2444
2237
|
|
|
2445
2238
|
def delete_many(
|
|
2446
2239
|
self,
|
|
@@ -2529,63 +2322,50 @@ class Links(BaseSDK):
|
|
|
2529
2322
|
|
|
2530
2323
|
response_data: Any = None
|
|
2531
2324
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2532
|
-
return
|
|
2533
|
-
|
|
2325
|
+
return unmarshal_json_response(
|
|
2326
|
+
Optional[operations.BulkDeleteLinksResponseBody], http_res
|
|
2534
2327
|
)
|
|
2535
2328
|
if utils.match_response(http_res, "400", "application/json"):
|
|
2536
|
-
response_data =
|
|
2537
|
-
raise errors.BadRequest(
|
|
2329
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
2330
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2538
2331
|
if utils.match_response(http_res, "401", "application/json"):
|
|
2539
|
-
response_data =
|
|
2540
|
-
raise errors.Unauthorized(
|
|
2332
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
2333
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2541
2334
|
if utils.match_response(http_res, "403", "application/json"):
|
|
2542
|
-
response_data =
|
|
2543
|
-
raise errors.Forbidden(
|
|
2335
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
2336
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2544
2337
|
if utils.match_response(http_res, "404", "application/json"):
|
|
2545
|
-
response_data =
|
|
2546
|
-
raise errors.NotFound(
|
|
2338
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
2339
|
+
raise errors.NotFound(response_data, http_res)
|
|
2547
2340
|
if utils.match_response(http_res, "409", "application/json"):
|
|
2548
|
-
response_data =
|
|
2549
|
-
raise errors.Conflict(
|
|
2341
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
2342
|
+
raise errors.Conflict(response_data, http_res)
|
|
2550
2343
|
if utils.match_response(http_res, "410", "application/json"):
|
|
2551
|
-
response_data =
|
|
2552
|
-
|
|
2553
|
-
)
|
|
2554
|
-
raise errors.InviteExpired(data=response_data)
|
|
2344
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
2345
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
2555
2346
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2556
|
-
response_data =
|
|
2557
|
-
|
|
2347
|
+
response_data = unmarshal_json_response(
|
|
2348
|
+
errors.UnprocessableEntityData, http_res
|
|
2558
2349
|
)
|
|
2559
|
-
raise errors.UnprocessableEntity(
|
|
2350
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
2560
2351
|
if utils.match_response(http_res, "429", "application/json"):
|
|
2561
|
-
response_data =
|
|
2562
|
-
|
|
2352
|
+
response_data = unmarshal_json_response(
|
|
2353
|
+
errors.RateLimitExceededData, http_res
|
|
2563
2354
|
)
|
|
2564
|
-
raise errors.RateLimitExceeded(
|
|
2355
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
2565
2356
|
if utils.match_response(http_res, "500", "application/json"):
|
|
2566
|
-
response_data =
|
|
2567
|
-
|
|
2357
|
+
response_data = unmarshal_json_response(
|
|
2358
|
+
errors.InternalServerErrorData, http_res
|
|
2568
2359
|
)
|
|
2569
|
-
raise errors.InternalServerError(
|
|
2360
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2570
2361
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2571
2362
|
http_res_text = utils.stream_to_text(http_res)
|
|
2572
|
-
raise errors.SDKError(
|
|
2573
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2574
|
-
)
|
|
2363
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2575
2364
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2576
2365
|
http_res_text = utils.stream_to_text(http_res)
|
|
2577
|
-
raise errors.SDKError(
|
|
2578
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2579
|
-
)
|
|
2366
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2580
2367
|
|
|
2581
|
-
|
|
2582
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
2583
|
-
raise errors.SDKError(
|
|
2584
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2585
|
-
http_res.status_code,
|
|
2586
|
-
http_res_text,
|
|
2587
|
-
http_res,
|
|
2588
|
-
)
|
|
2368
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
2589
2369
|
|
|
2590
2370
|
async def delete_many_async(
|
|
2591
2371
|
self,
|
|
@@ -2674,63 +2454,50 @@ class Links(BaseSDK):
|
|
|
2674
2454
|
|
|
2675
2455
|
response_data: Any = None
|
|
2676
2456
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2677
|
-
return
|
|
2678
|
-
|
|
2457
|
+
return unmarshal_json_response(
|
|
2458
|
+
Optional[operations.BulkDeleteLinksResponseBody], http_res
|
|
2679
2459
|
)
|
|
2680
2460
|
if utils.match_response(http_res, "400", "application/json"):
|
|
2681
|
-
response_data =
|
|
2682
|
-
raise errors.BadRequest(
|
|
2461
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
2462
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2683
2463
|
if utils.match_response(http_res, "401", "application/json"):
|
|
2684
|
-
response_data =
|
|
2685
|
-
raise errors.Unauthorized(
|
|
2464
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
2465
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2686
2466
|
if utils.match_response(http_res, "403", "application/json"):
|
|
2687
|
-
response_data =
|
|
2688
|
-
raise errors.Forbidden(
|
|
2467
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
2468
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2689
2469
|
if utils.match_response(http_res, "404", "application/json"):
|
|
2690
|
-
response_data =
|
|
2691
|
-
raise errors.NotFound(
|
|
2470
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
2471
|
+
raise errors.NotFound(response_data, http_res)
|
|
2692
2472
|
if utils.match_response(http_res, "409", "application/json"):
|
|
2693
|
-
response_data =
|
|
2694
|
-
raise errors.Conflict(
|
|
2473
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
2474
|
+
raise errors.Conflict(response_data, http_res)
|
|
2695
2475
|
if utils.match_response(http_res, "410", "application/json"):
|
|
2696
|
-
response_data =
|
|
2697
|
-
|
|
2698
|
-
)
|
|
2699
|
-
raise errors.InviteExpired(data=response_data)
|
|
2476
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
2477
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
2700
2478
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2701
|
-
response_data =
|
|
2702
|
-
|
|
2479
|
+
response_data = unmarshal_json_response(
|
|
2480
|
+
errors.UnprocessableEntityData, http_res
|
|
2703
2481
|
)
|
|
2704
|
-
raise errors.UnprocessableEntity(
|
|
2482
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
2705
2483
|
if utils.match_response(http_res, "429", "application/json"):
|
|
2706
|
-
response_data =
|
|
2707
|
-
|
|
2484
|
+
response_data = unmarshal_json_response(
|
|
2485
|
+
errors.RateLimitExceededData, http_res
|
|
2708
2486
|
)
|
|
2709
|
-
raise errors.RateLimitExceeded(
|
|
2487
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
2710
2488
|
if utils.match_response(http_res, "500", "application/json"):
|
|
2711
|
-
response_data =
|
|
2712
|
-
|
|
2489
|
+
response_data = unmarshal_json_response(
|
|
2490
|
+
errors.InternalServerErrorData, http_res
|
|
2713
2491
|
)
|
|
2714
|
-
raise errors.InternalServerError(
|
|
2492
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2715
2493
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2716
2494
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2717
|
-
raise errors.SDKError(
|
|
2718
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2719
|
-
)
|
|
2495
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2720
2496
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2721
2497
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2722
|
-
raise errors.SDKError(
|
|
2723
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2724
|
-
)
|
|
2498
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2725
2499
|
|
|
2726
|
-
|
|
2727
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2728
|
-
raise errors.SDKError(
|
|
2729
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2730
|
-
http_res.status_code,
|
|
2731
|
-
http_res_text,
|
|
2732
|
-
http_res,
|
|
2733
|
-
)
|
|
2500
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
2734
2501
|
|
|
2735
2502
|
def upsert(
|
|
2736
2503
|
self,
|
|
@@ -2826,61 +2593,48 @@ class Links(BaseSDK):
|
|
|
2826
2593
|
|
|
2827
2594
|
response_data: Any = None
|
|
2828
2595
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2829
|
-
return
|
|
2596
|
+
return unmarshal_json_response(Optional[components.LinkSchema], http_res)
|
|
2830
2597
|
if utils.match_response(http_res, "400", "application/json"):
|
|
2831
|
-
response_data =
|
|
2832
|
-
raise errors.BadRequest(
|
|
2598
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
2599
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2833
2600
|
if utils.match_response(http_res, "401", "application/json"):
|
|
2834
|
-
response_data =
|
|
2835
|
-
raise errors.Unauthorized(
|
|
2601
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
2602
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2836
2603
|
if utils.match_response(http_res, "403", "application/json"):
|
|
2837
|
-
response_data =
|
|
2838
|
-
raise errors.Forbidden(
|
|
2604
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
2605
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2839
2606
|
if utils.match_response(http_res, "404", "application/json"):
|
|
2840
|
-
response_data =
|
|
2841
|
-
raise errors.NotFound(
|
|
2607
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
2608
|
+
raise errors.NotFound(response_data, http_res)
|
|
2842
2609
|
if utils.match_response(http_res, "409", "application/json"):
|
|
2843
|
-
response_data =
|
|
2844
|
-
raise errors.Conflict(
|
|
2610
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
2611
|
+
raise errors.Conflict(response_data, http_res)
|
|
2845
2612
|
if utils.match_response(http_res, "410", "application/json"):
|
|
2846
|
-
response_data =
|
|
2847
|
-
|
|
2848
|
-
)
|
|
2849
|
-
raise errors.InviteExpired(data=response_data)
|
|
2613
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
2614
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
2850
2615
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2851
|
-
response_data =
|
|
2852
|
-
|
|
2616
|
+
response_data = unmarshal_json_response(
|
|
2617
|
+
errors.UnprocessableEntityData, http_res
|
|
2853
2618
|
)
|
|
2854
|
-
raise errors.UnprocessableEntity(
|
|
2619
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
2855
2620
|
if utils.match_response(http_res, "429", "application/json"):
|
|
2856
|
-
response_data =
|
|
2857
|
-
|
|
2621
|
+
response_data = unmarshal_json_response(
|
|
2622
|
+
errors.RateLimitExceededData, http_res
|
|
2858
2623
|
)
|
|
2859
|
-
raise errors.RateLimitExceeded(
|
|
2624
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
2860
2625
|
if utils.match_response(http_res, "500", "application/json"):
|
|
2861
|
-
response_data =
|
|
2862
|
-
|
|
2626
|
+
response_data = unmarshal_json_response(
|
|
2627
|
+
errors.InternalServerErrorData, http_res
|
|
2863
2628
|
)
|
|
2864
|
-
raise errors.InternalServerError(
|
|
2629
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2865
2630
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2866
2631
|
http_res_text = utils.stream_to_text(http_res)
|
|
2867
|
-
raise errors.SDKError(
|
|
2868
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2869
|
-
)
|
|
2632
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2870
2633
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2871
2634
|
http_res_text = utils.stream_to_text(http_res)
|
|
2872
|
-
raise errors.SDKError(
|
|
2873
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2874
|
-
)
|
|
2635
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2875
2636
|
|
|
2876
|
-
|
|
2877
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
2878
|
-
raise errors.SDKError(
|
|
2879
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2880
|
-
http_res.status_code,
|
|
2881
|
-
http_res_text,
|
|
2882
|
-
http_res,
|
|
2883
|
-
)
|
|
2637
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
2884
2638
|
|
|
2885
2639
|
async def upsert_async(
|
|
2886
2640
|
self,
|
|
@@ -2976,58 +2730,45 @@ class Links(BaseSDK):
|
|
|
2976
2730
|
|
|
2977
2731
|
response_data: Any = None
|
|
2978
2732
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2979
|
-
return
|
|
2733
|
+
return unmarshal_json_response(Optional[components.LinkSchema], http_res)
|
|
2980
2734
|
if utils.match_response(http_res, "400", "application/json"):
|
|
2981
|
-
response_data =
|
|
2982
|
-
raise errors.BadRequest(
|
|
2735
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
2736
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2983
2737
|
if utils.match_response(http_res, "401", "application/json"):
|
|
2984
|
-
response_data =
|
|
2985
|
-
raise errors.Unauthorized(
|
|
2738
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
2739
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2986
2740
|
if utils.match_response(http_res, "403", "application/json"):
|
|
2987
|
-
response_data =
|
|
2988
|
-
raise errors.Forbidden(
|
|
2741
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
2742
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2989
2743
|
if utils.match_response(http_res, "404", "application/json"):
|
|
2990
|
-
response_data =
|
|
2991
|
-
raise errors.NotFound(
|
|
2744
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
2745
|
+
raise errors.NotFound(response_data, http_res)
|
|
2992
2746
|
if utils.match_response(http_res, "409", "application/json"):
|
|
2993
|
-
response_data =
|
|
2994
|
-
raise errors.Conflict(
|
|
2747
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
2748
|
+
raise errors.Conflict(response_data, http_res)
|
|
2995
2749
|
if utils.match_response(http_res, "410", "application/json"):
|
|
2996
|
-
response_data =
|
|
2997
|
-
|
|
2998
|
-
)
|
|
2999
|
-
raise errors.InviteExpired(data=response_data)
|
|
2750
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
2751
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
3000
2752
|
if utils.match_response(http_res, "422", "application/json"):
|
|
3001
|
-
response_data =
|
|
3002
|
-
|
|
2753
|
+
response_data = unmarshal_json_response(
|
|
2754
|
+
errors.UnprocessableEntityData, http_res
|
|
3003
2755
|
)
|
|
3004
|
-
raise errors.UnprocessableEntity(
|
|
2756
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
3005
2757
|
if utils.match_response(http_res, "429", "application/json"):
|
|
3006
|
-
response_data =
|
|
3007
|
-
|
|
2758
|
+
response_data = unmarshal_json_response(
|
|
2759
|
+
errors.RateLimitExceededData, http_res
|
|
3008
2760
|
)
|
|
3009
|
-
raise errors.RateLimitExceeded(
|
|
2761
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
3010
2762
|
if utils.match_response(http_res, "500", "application/json"):
|
|
3011
|
-
response_data =
|
|
3012
|
-
|
|
2763
|
+
response_data = unmarshal_json_response(
|
|
2764
|
+
errors.InternalServerErrorData, http_res
|
|
3013
2765
|
)
|
|
3014
|
-
raise errors.InternalServerError(
|
|
2766
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3015
2767
|
if utils.match_response(http_res, "4XX", "*"):
|
|
3016
2768
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3017
|
-
raise errors.SDKError(
|
|
3018
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3019
|
-
)
|
|
2769
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
3020
2770
|
if utils.match_response(http_res, "5XX", "*"):
|
|
3021
2771
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3022
|
-
raise errors.SDKError(
|
|
3023
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3024
|
-
)
|
|
2772
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
3025
2773
|
|
|
3026
|
-
|
|
3027
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3028
|
-
raise errors.SDKError(
|
|
3029
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
3030
|
-
http_res.status_code,
|
|
3031
|
-
http_res_text,
|
|
3032
|
-
http_res,
|
|
3033
|
-
)
|
|
2774
|
+
raise errors.SDKError("Unexpected response received", http_res)
|