dub 0.26.12__py3-none-any.whl → 0.27.0__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 +66 -76
- dub/basesdk.py +4 -4
- dub/commissions.py +132 -152
- dub/customers.py +330 -380
- dub/domains.py +396 -456
- dub/embed_tokens.py +66 -78
- dub/events.py +66 -76
- dub/folders.py +264 -304
- dub/links.py +666 -750
- 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/updatecustomer.py +3 -0
- dub/partners.py +336 -374
- dub/qr_codes.py +62 -72
- dub/tags.py +268 -300
- dub/track.py +132 -152
- dub/utils/__init__.py +3 -0
- dub/utils/serializers.py +21 -3
- dub/workspaces.py +132 -152
- {dub-0.26.12.dist-info → dub-0.27.0.dist-info}/METADATA +50 -56
- {dub-0.26.12.dist-info → dub-0.27.0.dist-info}/RECORD +39 -36
- {dub-0.26.12.dist-info → dub-0.27.0.dist-info}/LICENSE +0 -0
- {dub-0.26.12.dist-info → dub-0.27.0.dist-info}/WHEEL +0 -0
dub/links.py
CHANGED
|
@@ -104,61 +104,58 @@ class Links(BaseSDK):
|
|
|
104
104
|
|
|
105
105
|
response_data: Any = None
|
|
106
106
|
if utils.match_response(http_res, "200", "application/json"):
|
|
107
|
-
return utils.
|
|
107
|
+
return utils.unmarshal_json_response(
|
|
108
|
+
Optional[components.LinkSchema], http_res
|
|
109
|
+
)
|
|
108
110
|
if utils.match_response(http_res, "400", "application/json"):
|
|
109
|
-
response_data = utils.
|
|
110
|
-
|
|
111
|
+
response_data = utils.unmarshal_json_response(
|
|
112
|
+
errors.BadRequestData, http_res
|
|
113
|
+
)
|
|
114
|
+
raise errors.BadRequest(response_data, http_res)
|
|
111
115
|
if utils.match_response(http_res, "401", "application/json"):
|
|
112
|
-
response_data = utils.
|
|
113
|
-
|
|
116
|
+
response_data = utils.unmarshal_json_response(
|
|
117
|
+
errors.UnauthorizedData, http_res
|
|
118
|
+
)
|
|
119
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
114
120
|
if utils.match_response(http_res, "403", "application/json"):
|
|
115
|
-
response_data = utils.
|
|
116
|
-
|
|
121
|
+
response_data = utils.unmarshal_json_response(
|
|
122
|
+
errors.ForbiddenData, http_res
|
|
123
|
+
)
|
|
124
|
+
raise errors.Forbidden(response_data, http_res)
|
|
117
125
|
if utils.match_response(http_res, "404", "application/json"):
|
|
118
|
-
response_data = utils.
|
|
119
|
-
raise errors.NotFound(
|
|
126
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
127
|
+
raise errors.NotFound(response_data, http_res)
|
|
120
128
|
if utils.match_response(http_res, "409", "application/json"):
|
|
121
|
-
response_data = utils.
|
|
122
|
-
raise errors.Conflict(
|
|
129
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
130
|
+
raise errors.Conflict(response_data, http_res)
|
|
123
131
|
if utils.match_response(http_res, "410", "application/json"):
|
|
124
|
-
response_data = utils.
|
|
125
|
-
|
|
132
|
+
response_data = utils.unmarshal_json_response(
|
|
133
|
+
errors.InviteExpiredData, http_res
|
|
126
134
|
)
|
|
127
|
-
raise errors.InviteExpired(
|
|
135
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
128
136
|
if utils.match_response(http_res, "422", "application/json"):
|
|
129
|
-
response_data = utils.
|
|
130
|
-
|
|
137
|
+
response_data = utils.unmarshal_json_response(
|
|
138
|
+
errors.UnprocessableEntityData, http_res
|
|
131
139
|
)
|
|
132
|
-
raise errors.UnprocessableEntity(
|
|
140
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
133
141
|
if utils.match_response(http_res, "429", "application/json"):
|
|
134
|
-
response_data = utils.
|
|
135
|
-
|
|
142
|
+
response_data = utils.unmarshal_json_response(
|
|
143
|
+
errors.RateLimitExceededData, http_res
|
|
136
144
|
)
|
|
137
|
-
raise errors.RateLimitExceeded(
|
|
145
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
138
146
|
if utils.match_response(http_res, "500", "application/json"):
|
|
139
|
-
response_data = utils.
|
|
140
|
-
|
|
147
|
+
response_data = utils.unmarshal_json_response(
|
|
148
|
+
errors.InternalServerErrorData, http_res
|
|
141
149
|
)
|
|
142
|
-
raise errors.InternalServerError(
|
|
150
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
143
151
|
if utils.match_response(http_res, "4XX", "*"):
|
|
144
152
|
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
|
-
)
|
|
153
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
148
154
|
if utils.match_response(http_res, "5XX", "*"):
|
|
149
155
|
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
|
-
)
|
|
156
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
153
157
|
|
|
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
|
-
)
|
|
158
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
162
159
|
|
|
163
160
|
async def create_async(
|
|
164
161
|
self,
|
|
@@ -254,61 +251,58 @@ class Links(BaseSDK):
|
|
|
254
251
|
|
|
255
252
|
response_data: Any = None
|
|
256
253
|
if utils.match_response(http_res, "200", "application/json"):
|
|
257
|
-
return utils.
|
|
254
|
+
return utils.unmarshal_json_response(
|
|
255
|
+
Optional[components.LinkSchema], http_res
|
|
256
|
+
)
|
|
258
257
|
if utils.match_response(http_res, "400", "application/json"):
|
|
259
|
-
response_data = utils.
|
|
260
|
-
|
|
258
|
+
response_data = utils.unmarshal_json_response(
|
|
259
|
+
errors.BadRequestData, http_res
|
|
260
|
+
)
|
|
261
|
+
raise errors.BadRequest(response_data, http_res)
|
|
261
262
|
if utils.match_response(http_res, "401", "application/json"):
|
|
262
|
-
response_data = utils.
|
|
263
|
-
|
|
263
|
+
response_data = utils.unmarshal_json_response(
|
|
264
|
+
errors.UnauthorizedData, http_res
|
|
265
|
+
)
|
|
266
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
264
267
|
if utils.match_response(http_res, "403", "application/json"):
|
|
265
|
-
response_data = utils.
|
|
266
|
-
|
|
268
|
+
response_data = utils.unmarshal_json_response(
|
|
269
|
+
errors.ForbiddenData, http_res
|
|
270
|
+
)
|
|
271
|
+
raise errors.Forbidden(response_data, http_res)
|
|
267
272
|
if utils.match_response(http_res, "404", "application/json"):
|
|
268
|
-
response_data = utils.
|
|
269
|
-
raise errors.NotFound(
|
|
273
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
274
|
+
raise errors.NotFound(response_data, http_res)
|
|
270
275
|
if utils.match_response(http_res, "409", "application/json"):
|
|
271
|
-
response_data = utils.
|
|
272
|
-
raise errors.Conflict(
|
|
276
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
277
|
+
raise errors.Conflict(response_data, http_res)
|
|
273
278
|
if utils.match_response(http_res, "410", "application/json"):
|
|
274
|
-
response_data = utils.
|
|
275
|
-
|
|
279
|
+
response_data = utils.unmarshal_json_response(
|
|
280
|
+
errors.InviteExpiredData, http_res
|
|
276
281
|
)
|
|
277
|
-
raise errors.InviteExpired(
|
|
282
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
278
283
|
if utils.match_response(http_res, "422", "application/json"):
|
|
279
|
-
response_data = utils.
|
|
280
|
-
|
|
284
|
+
response_data = utils.unmarshal_json_response(
|
|
285
|
+
errors.UnprocessableEntityData, http_res
|
|
281
286
|
)
|
|
282
|
-
raise errors.UnprocessableEntity(
|
|
287
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
283
288
|
if utils.match_response(http_res, "429", "application/json"):
|
|
284
|
-
response_data = utils.
|
|
285
|
-
|
|
289
|
+
response_data = utils.unmarshal_json_response(
|
|
290
|
+
errors.RateLimitExceededData, http_res
|
|
286
291
|
)
|
|
287
|
-
raise errors.RateLimitExceeded(
|
|
292
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
288
293
|
if utils.match_response(http_res, "500", "application/json"):
|
|
289
|
-
response_data = utils.
|
|
290
|
-
|
|
294
|
+
response_data = utils.unmarshal_json_response(
|
|
295
|
+
errors.InternalServerErrorData, http_res
|
|
291
296
|
)
|
|
292
|
-
raise errors.InternalServerError(
|
|
297
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
293
298
|
if utils.match_response(http_res, "4XX", "*"):
|
|
294
299
|
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
|
-
)
|
|
300
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
298
301
|
if utils.match_response(http_res, "5XX", "*"):
|
|
299
302
|
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
|
-
)
|
|
303
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
303
304
|
|
|
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
|
-
)
|
|
305
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
312
306
|
|
|
313
307
|
def list(
|
|
314
308
|
self,
|
|
@@ -430,65 +424,60 @@ class Links(BaseSDK):
|
|
|
430
424
|
response_data: Any = None
|
|
431
425
|
if utils.match_response(http_res, "200", "application/json"):
|
|
432
426
|
return operations.GetLinksResponse(
|
|
433
|
-
result=utils.
|
|
434
|
-
|
|
427
|
+
result=utils.unmarshal_json_response(
|
|
428
|
+
Optional[List[components.LinkSchema]], http_res
|
|
435
429
|
),
|
|
436
430
|
next=next_func,
|
|
437
431
|
)
|
|
438
432
|
if utils.match_response(http_res, "400", "application/json"):
|
|
439
|
-
response_data = utils.
|
|
440
|
-
|
|
433
|
+
response_data = utils.unmarshal_json_response(
|
|
434
|
+
errors.BadRequestData, http_res
|
|
435
|
+
)
|
|
436
|
+
raise errors.BadRequest(response_data, http_res)
|
|
441
437
|
if utils.match_response(http_res, "401", "application/json"):
|
|
442
|
-
response_data = utils.
|
|
443
|
-
|
|
438
|
+
response_data = utils.unmarshal_json_response(
|
|
439
|
+
errors.UnauthorizedData, http_res
|
|
440
|
+
)
|
|
441
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
444
442
|
if utils.match_response(http_res, "403", "application/json"):
|
|
445
|
-
response_data = utils.
|
|
446
|
-
|
|
443
|
+
response_data = utils.unmarshal_json_response(
|
|
444
|
+
errors.ForbiddenData, http_res
|
|
445
|
+
)
|
|
446
|
+
raise errors.Forbidden(response_data, http_res)
|
|
447
447
|
if utils.match_response(http_res, "404", "application/json"):
|
|
448
|
-
response_data = utils.
|
|
449
|
-
raise errors.NotFound(
|
|
448
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
449
|
+
raise errors.NotFound(response_data, http_res)
|
|
450
450
|
if utils.match_response(http_res, "409", "application/json"):
|
|
451
|
-
response_data = utils.
|
|
452
|
-
raise errors.Conflict(
|
|
451
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
452
|
+
raise errors.Conflict(response_data, http_res)
|
|
453
453
|
if utils.match_response(http_res, "410", "application/json"):
|
|
454
|
-
response_data = utils.
|
|
455
|
-
|
|
454
|
+
response_data = utils.unmarshal_json_response(
|
|
455
|
+
errors.InviteExpiredData, http_res
|
|
456
456
|
)
|
|
457
|
-
raise errors.InviteExpired(
|
|
457
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
458
458
|
if utils.match_response(http_res, "422", "application/json"):
|
|
459
|
-
response_data = utils.
|
|
460
|
-
|
|
459
|
+
response_data = utils.unmarshal_json_response(
|
|
460
|
+
errors.UnprocessableEntityData, http_res
|
|
461
461
|
)
|
|
462
|
-
raise errors.UnprocessableEntity(
|
|
462
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
463
463
|
if utils.match_response(http_res, "429", "application/json"):
|
|
464
|
-
response_data = utils.
|
|
465
|
-
|
|
464
|
+
response_data = utils.unmarshal_json_response(
|
|
465
|
+
errors.RateLimitExceededData, http_res
|
|
466
466
|
)
|
|
467
|
-
raise errors.RateLimitExceeded(
|
|
467
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
468
468
|
if utils.match_response(http_res, "500", "application/json"):
|
|
469
|
-
response_data = utils.
|
|
470
|
-
|
|
469
|
+
response_data = utils.unmarshal_json_response(
|
|
470
|
+
errors.InternalServerErrorData, http_res
|
|
471
471
|
)
|
|
472
|
-
raise errors.InternalServerError(
|
|
472
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
473
473
|
if utils.match_response(http_res, "4XX", "*"):
|
|
474
474
|
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
|
-
)
|
|
475
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
478
476
|
if utils.match_response(http_res, "5XX", "*"):
|
|
479
477
|
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
|
-
)
|
|
478
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
483
479
|
|
|
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
|
-
)
|
|
480
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
492
481
|
|
|
493
482
|
async def list_async(
|
|
494
483
|
self,
|
|
@@ -610,65 +599,60 @@ class Links(BaseSDK):
|
|
|
610
599
|
response_data: Any = None
|
|
611
600
|
if utils.match_response(http_res, "200", "application/json"):
|
|
612
601
|
return operations.GetLinksResponse(
|
|
613
|
-
result=utils.
|
|
614
|
-
|
|
602
|
+
result=utils.unmarshal_json_response(
|
|
603
|
+
Optional[List[components.LinkSchema]], http_res
|
|
615
604
|
),
|
|
616
605
|
next=next_func,
|
|
617
606
|
)
|
|
618
607
|
if utils.match_response(http_res, "400", "application/json"):
|
|
619
|
-
response_data = utils.
|
|
620
|
-
|
|
608
|
+
response_data = utils.unmarshal_json_response(
|
|
609
|
+
errors.BadRequestData, http_res
|
|
610
|
+
)
|
|
611
|
+
raise errors.BadRequest(response_data, http_res)
|
|
621
612
|
if utils.match_response(http_res, "401", "application/json"):
|
|
622
|
-
response_data = utils.
|
|
623
|
-
|
|
613
|
+
response_data = utils.unmarshal_json_response(
|
|
614
|
+
errors.UnauthorizedData, http_res
|
|
615
|
+
)
|
|
616
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
624
617
|
if utils.match_response(http_res, "403", "application/json"):
|
|
625
|
-
response_data = utils.
|
|
626
|
-
|
|
618
|
+
response_data = utils.unmarshal_json_response(
|
|
619
|
+
errors.ForbiddenData, http_res
|
|
620
|
+
)
|
|
621
|
+
raise errors.Forbidden(response_data, http_res)
|
|
627
622
|
if utils.match_response(http_res, "404", "application/json"):
|
|
628
|
-
response_data = utils.
|
|
629
|
-
raise errors.NotFound(
|
|
623
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
624
|
+
raise errors.NotFound(response_data, http_res)
|
|
630
625
|
if utils.match_response(http_res, "409", "application/json"):
|
|
631
|
-
response_data = utils.
|
|
632
|
-
raise errors.Conflict(
|
|
626
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
627
|
+
raise errors.Conflict(response_data, http_res)
|
|
633
628
|
if utils.match_response(http_res, "410", "application/json"):
|
|
634
|
-
response_data = utils.
|
|
635
|
-
|
|
629
|
+
response_data = utils.unmarshal_json_response(
|
|
630
|
+
errors.InviteExpiredData, http_res
|
|
636
631
|
)
|
|
637
|
-
raise errors.InviteExpired(
|
|
632
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
638
633
|
if utils.match_response(http_res, "422", "application/json"):
|
|
639
|
-
response_data = utils.
|
|
640
|
-
|
|
634
|
+
response_data = utils.unmarshal_json_response(
|
|
635
|
+
errors.UnprocessableEntityData, http_res
|
|
641
636
|
)
|
|
642
|
-
raise errors.UnprocessableEntity(
|
|
637
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
643
638
|
if utils.match_response(http_res, "429", "application/json"):
|
|
644
|
-
response_data = utils.
|
|
645
|
-
|
|
639
|
+
response_data = utils.unmarshal_json_response(
|
|
640
|
+
errors.RateLimitExceededData, http_res
|
|
646
641
|
)
|
|
647
|
-
raise errors.RateLimitExceeded(
|
|
642
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
648
643
|
if utils.match_response(http_res, "500", "application/json"):
|
|
649
|
-
response_data = utils.
|
|
650
|
-
|
|
644
|
+
response_data = utils.unmarshal_json_response(
|
|
645
|
+
errors.InternalServerErrorData, http_res
|
|
651
646
|
)
|
|
652
|
-
raise errors.InternalServerError(
|
|
647
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
653
648
|
if utils.match_response(http_res, "4XX", "*"):
|
|
654
649
|
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
|
-
)
|
|
650
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
658
651
|
if utils.match_response(http_res, "5XX", "*"):
|
|
659
652
|
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
|
-
)
|
|
653
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
663
654
|
|
|
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
|
-
)
|
|
655
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
672
656
|
|
|
673
657
|
def count(
|
|
674
658
|
self,
|
|
@@ -756,61 +740,56 @@ class Links(BaseSDK):
|
|
|
756
740
|
|
|
757
741
|
response_data: Any = None
|
|
758
742
|
if utils.match_response(http_res, "200", "application/json"):
|
|
759
|
-
return utils.
|
|
743
|
+
return utils.unmarshal_json_response(Optional[float], http_res)
|
|
760
744
|
if utils.match_response(http_res, "400", "application/json"):
|
|
761
|
-
response_data = utils.
|
|
762
|
-
|
|
745
|
+
response_data = utils.unmarshal_json_response(
|
|
746
|
+
errors.BadRequestData, http_res
|
|
747
|
+
)
|
|
748
|
+
raise errors.BadRequest(response_data, http_res)
|
|
763
749
|
if utils.match_response(http_res, "401", "application/json"):
|
|
764
|
-
response_data = utils.
|
|
765
|
-
|
|
750
|
+
response_data = utils.unmarshal_json_response(
|
|
751
|
+
errors.UnauthorizedData, http_res
|
|
752
|
+
)
|
|
753
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
766
754
|
if utils.match_response(http_res, "403", "application/json"):
|
|
767
|
-
response_data = utils.
|
|
768
|
-
|
|
755
|
+
response_data = utils.unmarshal_json_response(
|
|
756
|
+
errors.ForbiddenData, http_res
|
|
757
|
+
)
|
|
758
|
+
raise errors.Forbidden(response_data, http_res)
|
|
769
759
|
if utils.match_response(http_res, "404", "application/json"):
|
|
770
|
-
response_data = utils.
|
|
771
|
-
raise errors.NotFound(
|
|
760
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
761
|
+
raise errors.NotFound(response_data, http_res)
|
|
772
762
|
if utils.match_response(http_res, "409", "application/json"):
|
|
773
|
-
response_data = utils.
|
|
774
|
-
raise errors.Conflict(
|
|
763
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
764
|
+
raise errors.Conflict(response_data, http_res)
|
|
775
765
|
if utils.match_response(http_res, "410", "application/json"):
|
|
776
|
-
response_data = utils.
|
|
777
|
-
|
|
766
|
+
response_data = utils.unmarshal_json_response(
|
|
767
|
+
errors.InviteExpiredData, http_res
|
|
778
768
|
)
|
|
779
|
-
raise errors.InviteExpired(
|
|
769
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
780
770
|
if utils.match_response(http_res, "422", "application/json"):
|
|
781
|
-
response_data = utils.
|
|
782
|
-
|
|
771
|
+
response_data = utils.unmarshal_json_response(
|
|
772
|
+
errors.UnprocessableEntityData, http_res
|
|
783
773
|
)
|
|
784
|
-
raise errors.UnprocessableEntity(
|
|
774
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
785
775
|
if utils.match_response(http_res, "429", "application/json"):
|
|
786
|
-
response_data = utils.
|
|
787
|
-
|
|
776
|
+
response_data = utils.unmarshal_json_response(
|
|
777
|
+
errors.RateLimitExceededData, http_res
|
|
788
778
|
)
|
|
789
|
-
raise errors.RateLimitExceeded(
|
|
779
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
790
780
|
if utils.match_response(http_res, "500", "application/json"):
|
|
791
|
-
response_data = utils.
|
|
792
|
-
|
|
781
|
+
response_data = utils.unmarshal_json_response(
|
|
782
|
+
errors.InternalServerErrorData, http_res
|
|
793
783
|
)
|
|
794
|
-
raise errors.InternalServerError(
|
|
784
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
795
785
|
if utils.match_response(http_res, "4XX", "*"):
|
|
796
786
|
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
|
-
)
|
|
787
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
800
788
|
if utils.match_response(http_res, "5XX", "*"):
|
|
801
789
|
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
|
-
)
|
|
790
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
805
791
|
|
|
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
|
-
)
|
|
792
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
814
793
|
|
|
815
794
|
async def count_async(
|
|
816
795
|
self,
|
|
@@ -898,61 +877,56 @@ class Links(BaseSDK):
|
|
|
898
877
|
|
|
899
878
|
response_data: Any = None
|
|
900
879
|
if utils.match_response(http_res, "200", "application/json"):
|
|
901
|
-
return utils.
|
|
880
|
+
return utils.unmarshal_json_response(Optional[float], http_res)
|
|
902
881
|
if utils.match_response(http_res, "400", "application/json"):
|
|
903
|
-
response_data = utils.
|
|
904
|
-
|
|
882
|
+
response_data = utils.unmarshal_json_response(
|
|
883
|
+
errors.BadRequestData, http_res
|
|
884
|
+
)
|
|
885
|
+
raise errors.BadRequest(response_data, http_res)
|
|
905
886
|
if utils.match_response(http_res, "401", "application/json"):
|
|
906
|
-
response_data = utils.
|
|
907
|
-
|
|
887
|
+
response_data = utils.unmarshal_json_response(
|
|
888
|
+
errors.UnauthorizedData, http_res
|
|
889
|
+
)
|
|
890
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
908
891
|
if utils.match_response(http_res, "403", "application/json"):
|
|
909
|
-
response_data = utils.
|
|
910
|
-
|
|
892
|
+
response_data = utils.unmarshal_json_response(
|
|
893
|
+
errors.ForbiddenData, http_res
|
|
894
|
+
)
|
|
895
|
+
raise errors.Forbidden(response_data, http_res)
|
|
911
896
|
if utils.match_response(http_res, "404", "application/json"):
|
|
912
|
-
response_data = utils.
|
|
913
|
-
raise errors.NotFound(
|
|
897
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
898
|
+
raise errors.NotFound(response_data, http_res)
|
|
914
899
|
if utils.match_response(http_res, "409", "application/json"):
|
|
915
|
-
response_data = utils.
|
|
916
|
-
raise errors.Conflict(
|
|
900
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
901
|
+
raise errors.Conflict(response_data, http_res)
|
|
917
902
|
if utils.match_response(http_res, "410", "application/json"):
|
|
918
|
-
response_data = utils.
|
|
919
|
-
|
|
903
|
+
response_data = utils.unmarshal_json_response(
|
|
904
|
+
errors.InviteExpiredData, http_res
|
|
920
905
|
)
|
|
921
|
-
raise errors.InviteExpired(
|
|
906
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
922
907
|
if utils.match_response(http_res, "422", "application/json"):
|
|
923
|
-
response_data = utils.
|
|
924
|
-
|
|
908
|
+
response_data = utils.unmarshal_json_response(
|
|
909
|
+
errors.UnprocessableEntityData, http_res
|
|
925
910
|
)
|
|
926
|
-
raise errors.UnprocessableEntity(
|
|
911
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
927
912
|
if utils.match_response(http_res, "429", "application/json"):
|
|
928
|
-
response_data = utils.
|
|
929
|
-
|
|
913
|
+
response_data = utils.unmarshal_json_response(
|
|
914
|
+
errors.RateLimitExceededData, http_res
|
|
930
915
|
)
|
|
931
|
-
raise errors.RateLimitExceeded(
|
|
916
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
932
917
|
if utils.match_response(http_res, "500", "application/json"):
|
|
933
|
-
response_data = utils.
|
|
934
|
-
|
|
918
|
+
response_data = utils.unmarshal_json_response(
|
|
919
|
+
errors.InternalServerErrorData, http_res
|
|
935
920
|
)
|
|
936
|
-
raise errors.InternalServerError(
|
|
921
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
937
922
|
if utils.match_response(http_res, "4XX", "*"):
|
|
938
923
|
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
|
-
)
|
|
924
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
942
925
|
if utils.match_response(http_res, "5XX", "*"):
|
|
943
926
|
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
|
-
)
|
|
927
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
947
928
|
|
|
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
|
-
)
|
|
929
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
956
930
|
|
|
957
931
|
def get(
|
|
958
932
|
self,
|
|
@@ -1040,61 +1014,58 @@ class Links(BaseSDK):
|
|
|
1040
1014
|
|
|
1041
1015
|
response_data: Any = None
|
|
1042
1016
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1043
|
-
return utils.
|
|
1017
|
+
return utils.unmarshal_json_response(
|
|
1018
|
+
Optional[components.LinkSchema], http_res
|
|
1019
|
+
)
|
|
1044
1020
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1045
|
-
response_data = utils.
|
|
1046
|
-
|
|
1021
|
+
response_data = utils.unmarshal_json_response(
|
|
1022
|
+
errors.BadRequestData, http_res
|
|
1023
|
+
)
|
|
1024
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1047
1025
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1048
|
-
response_data = utils.
|
|
1049
|
-
|
|
1026
|
+
response_data = utils.unmarshal_json_response(
|
|
1027
|
+
errors.UnauthorizedData, http_res
|
|
1028
|
+
)
|
|
1029
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1050
1030
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1051
|
-
response_data = utils.
|
|
1052
|
-
|
|
1031
|
+
response_data = utils.unmarshal_json_response(
|
|
1032
|
+
errors.ForbiddenData, http_res
|
|
1033
|
+
)
|
|
1034
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1053
1035
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1054
|
-
response_data = utils.
|
|
1055
|
-
raise errors.NotFound(
|
|
1036
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1037
|
+
raise errors.NotFound(response_data, http_res)
|
|
1056
1038
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1057
|
-
response_data = utils.
|
|
1058
|
-
raise errors.Conflict(
|
|
1039
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
1040
|
+
raise errors.Conflict(response_data, http_res)
|
|
1059
1041
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1060
|
-
response_data = utils.
|
|
1061
|
-
|
|
1042
|
+
response_data = utils.unmarshal_json_response(
|
|
1043
|
+
errors.InviteExpiredData, http_res
|
|
1062
1044
|
)
|
|
1063
|
-
raise errors.InviteExpired(
|
|
1045
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1064
1046
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1065
|
-
response_data = utils.
|
|
1066
|
-
|
|
1047
|
+
response_data = utils.unmarshal_json_response(
|
|
1048
|
+
errors.UnprocessableEntityData, http_res
|
|
1067
1049
|
)
|
|
1068
|
-
raise errors.UnprocessableEntity(
|
|
1050
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1069
1051
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1070
|
-
response_data = utils.
|
|
1071
|
-
|
|
1052
|
+
response_data = utils.unmarshal_json_response(
|
|
1053
|
+
errors.RateLimitExceededData, http_res
|
|
1072
1054
|
)
|
|
1073
|
-
raise errors.RateLimitExceeded(
|
|
1055
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1074
1056
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1075
|
-
response_data = utils.
|
|
1076
|
-
|
|
1057
|
+
response_data = utils.unmarshal_json_response(
|
|
1058
|
+
errors.InternalServerErrorData, http_res
|
|
1077
1059
|
)
|
|
1078
|
-
raise errors.InternalServerError(
|
|
1060
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1079
1061
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1080
1062
|
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
|
-
)
|
|
1063
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1084
1064
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1085
1065
|
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
|
-
)
|
|
1066
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1089
1067
|
|
|
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
|
-
)
|
|
1068
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1098
1069
|
|
|
1099
1070
|
async def get_async(
|
|
1100
1071
|
self,
|
|
@@ -1182,61 +1153,58 @@ class Links(BaseSDK):
|
|
|
1182
1153
|
|
|
1183
1154
|
response_data: Any = None
|
|
1184
1155
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1185
|
-
return utils.
|
|
1156
|
+
return utils.unmarshal_json_response(
|
|
1157
|
+
Optional[components.LinkSchema], http_res
|
|
1158
|
+
)
|
|
1186
1159
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1187
|
-
response_data = utils.
|
|
1188
|
-
|
|
1160
|
+
response_data = utils.unmarshal_json_response(
|
|
1161
|
+
errors.BadRequestData, http_res
|
|
1162
|
+
)
|
|
1163
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1189
1164
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1190
|
-
response_data = utils.
|
|
1191
|
-
|
|
1165
|
+
response_data = utils.unmarshal_json_response(
|
|
1166
|
+
errors.UnauthorizedData, http_res
|
|
1167
|
+
)
|
|
1168
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1192
1169
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1193
|
-
response_data = utils.
|
|
1194
|
-
|
|
1170
|
+
response_data = utils.unmarshal_json_response(
|
|
1171
|
+
errors.ForbiddenData, http_res
|
|
1172
|
+
)
|
|
1173
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1195
1174
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1196
|
-
response_data = utils.
|
|
1197
|
-
raise errors.NotFound(
|
|
1175
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1176
|
+
raise errors.NotFound(response_data, http_res)
|
|
1198
1177
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1199
|
-
response_data = utils.
|
|
1200
|
-
raise errors.Conflict(
|
|
1178
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
1179
|
+
raise errors.Conflict(response_data, http_res)
|
|
1201
1180
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1202
|
-
response_data = utils.
|
|
1203
|
-
|
|
1181
|
+
response_data = utils.unmarshal_json_response(
|
|
1182
|
+
errors.InviteExpiredData, http_res
|
|
1204
1183
|
)
|
|
1205
|
-
raise errors.InviteExpired(
|
|
1184
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1206
1185
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1207
|
-
response_data = utils.
|
|
1208
|
-
|
|
1186
|
+
response_data = utils.unmarshal_json_response(
|
|
1187
|
+
errors.UnprocessableEntityData, http_res
|
|
1209
1188
|
)
|
|
1210
|
-
raise errors.UnprocessableEntity(
|
|
1189
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1211
1190
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1212
|
-
response_data = utils.
|
|
1213
|
-
|
|
1191
|
+
response_data = utils.unmarshal_json_response(
|
|
1192
|
+
errors.RateLimitExceededData, http_res
|
|
1214
1193
|
)
|
|
1215
|
-
raise errors.RateLimitExceeded(
|
|
1194
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1216
1195
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1217
|
-
response_data = utils.
|
|
1218
|
-
|
|
1196
|
+
response_data = utils.unmarshal_json_response(
|
|
1197
|
+
errors.InternalServerErrorData, http_res
|
|
1219
1198
|
)
|
|
1220
|
-
raise errors.InternalServerError(
|
|
1199
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1221
1200
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1222
1201
|
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
|
-
)
|
|
1202
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1226
1203
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1227
1204
|
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
|
-
)
|
|
1205
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1231
1206
|
|
|
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
|
-
)
|
|
1207
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1240
1208
|
|
|
1241
1209
|
def update(
|
|
1242
1210
|
self,
|
|
@@ -1339,61 +1307,58 @@ class Links(BaseSDK):
|
|
|
1339
1307
|
|
|
1340
1308
|
response_data: Any = None
|
|
1341
1309
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1342
|
-
return utils.
|
|
1310
|
+
return utils.unmarshal_json_response(
|
|
1311
|
+
Optional[components.LinkSchema], http_res
|
|
1312
|
+
)
|
|
1343
1313
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1344
|
-
response_data = utils.
|
|
1345
|
-
|
|
1314
|
+
response_data = utils.unmarshal_json_response(
|
|
1315
|
+
errors.BadRequestData, http_res
|
|
1316
|
+
)
|
|
1317
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1346
1318
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1347
|
-
response_data = utils.
|
|
1348
|
-
|
|
1319
|
+
response_data = utils.unmarshal_json_response(
|
|
1320
|
+
errors.UnauthorizedData, http_res
|
|
1321
|
+
)
|
|
1322
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1349
1323
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1350
|
-
response_data = utils.
|
|
1351
|
-
|
|
1324
|
+
response_data = utils.unmarshal_json_response(
|
|
1325
|
+
errors.ForbiddenData, http_res
|
|
1326
|
+
)
|
|
1327
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1352
1328
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1353
|
-
response_data = utils.
|
|
1354
|
-
raise errors.NotFound(
|
|
1329
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1330
|
+
raise errors.NotFound(response_data, http_res)
|
|
1355
1331
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1356
|
-
response_data = utils.
|
|
1357
|
-
raise errors.Conflict(
|
|
1332
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
1333
|
+
raise errors.Conflict(response_data, http_res)
|
|
1358
1334
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1359
|
-
response_data = utils.
|
|
1360
|
-
|
|
1335
|
+
response_data = utils.unmarshal_json_response(
|
|
1336
|
+
errors.InviteExpiredData, http_res
|
|
1361
1337
|
)
|
|
1362
|
-
raise errors.InviteExpired(
|
|
1338
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1363
1339
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1364
|
-
response_data = utils.
|
|
1365
|
-
|
|
1340
|
+
response_data = utils.unmarshal_json_response(
|
|
1341
|
+
errors.UnprocessableEntityData, http_res
|
|
1366
1342
|
)
|
|
1367
|
-
raise errors.UnprocessableEntity(
|
|
1343
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1368
1344
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1369
|
-
response_data = utils.
|
|
1370
|
-
|
|
1345
|
+
response_data = utils.unmarshal_json_response(
|
|
1346
|
+
errors.RateLimitExceededData, http_res
|
|
1371
1347
|
)
|
|
1372
|
-
raise errors.RateLimitExceeded(
|
|
1348
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1373
1349
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1374
|
-
response_data = utils.
|
|
1375
|
-
|
|
1350
|
+
response_data = utils.unmarshal_json_response(
|
|
1351
|
+
errors.InternalServerErrorData, http_res
|
|
1376
1352
|
)
|
|
1377
|
-
raise errors.InternalServerError(
|
|
1353
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1378
1354
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1379
1355
|
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
|
-
)
|
|
1356
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1383
1357
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1384
1358
|
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
|
-
)
|
|
1359
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1388
1360
|
|
|
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
|
-
)
|
|
1361
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1397
1362
|
|
|
1398
1363
|
async def update_async(
|
|
1399
1364
|
self,
|
|
@@ -1496,61 +1461,58 @@ class Links(BaseSDK):
|
|
|
1496
1461
|
|
|
1497
1462
|
response_data: Any = None
|
|
1498
1463
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1499
|
-
return utils.
|
|
1464
|
+
return utils.unmarshal_json_response(
|
|
1465
|
+
Optional[components.LinkSchema], http_res
|
|
1466
|
+
)
|
|
1500
1467
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1501
|
-
response_data = utils.
|
|
1502
|
-
|
|
1468
|
+
response_data = utils.unmarshal_json_response(
|
|
1469
|
+
errors.BadRequestData, http_res
|
|
1470
|
+
)
|
|
1471
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1503
1472
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1504
|
-
response_data = utils.
|
|
1505
|
-
|
|
1473
|
+
response_data = utils.unmarshal_json_response(
|
|
1474
|
+
errors.UnauthorizedData, http_res
|
|
1475
|
+
)
|
|
1476
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1506
1477
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1507
|
-
response_data = utils.
|
|
1508
|
-
|
|
1478
|
+
response_data = utils.unmarshal_json_response(
|
|
1479
|
+
errors.ForbiddenData, http_res
|
|
1480
|
+
)
|
|
1481
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1509
1482
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1510
|
-
response_data = utils.
|
|
1511
|
-
raise errors.NotFound(
|
|
1483
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1484
|
+
raise errors.NotFound(response_data, http_res)
|
|
1512
1485
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1513
|
-
response_data = utils.
|
|
1514
|
-
raise errors.Conflict(
|
|
1486
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
1487
|
+
raise errors.Conflict(response_data, http_res)
|
|
1515
1488
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1516
|
-
response_data = utils.
|
|
1517
|
-
|
|
1489
|
+
response_data = utils.unmarshal_json_response(
|
|
1490
|
+
errors.InviteExpiredData, http_res
|
|
1518
1491
|
)
|
|
1519
|
-
raise errors.InviteExpired(
|
|
1492
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1520
1493
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1521
|
-
response_data = utils.
|
|
1522
|
-
|
|
1494
|
+
response_data = utils.unmarshal_json_response(
|
|
1495
|
+
errors.UnprocessableEntityData, http_res
|
|
1523
1496
|
)
|
|
1524
|
-
raise errors.UnprocessableEntity(
|
|
1497
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1525
1498
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1526
|
-
response_data = utils.
|
|
1527
|
-
|
|
1499
|
+
response_data = utils.unmarshal_json_response(
|
|
1500
|
+
errors.RateLimitExceededData, http_res
|
|
1528
1501
|
)
|
|
1529
|
-
raise errors.RateLimitExceeded(
|
|
1502
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1530
1503
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1531
|
-
response_data = utils.
|
|
1532
|
-
|
|
1504
|
+
response_data = utils.unmarshal_json_response(
|
|
1505
|
+
errors.InternalServerErrorData, http_res
|
|
1533
1506
|
)
|
|
1534
|
-
raise errors.InternalServerError(
|
|
1507
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1535
1508
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1536
1509
|
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
|
-
)
|
|
1510
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1540
1511
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1541
1512
|
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
|
-
)
|
|
1513
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1545
1514
|
|
|
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
|
-
)
|
|
1515
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1554
1516
|
|
|
1555
1517
|
def delete(
|
|
1556
1518
|
self,
|
|
@@ -1636,63 +1598,58 @@ class Links(BaseSDK):
|
|
|
1636
1598
|
|
|
1637
1599
|
response_data: Any = None
|
|
1638
1600
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1639
|
-
return utils.
|
|
1640
|
-
|
|
1601
|
+
return utils.unmarshal_json_response(
|
|
1602
|
+
Optional[operations.DeleteLinkResponseBody], http_res
|
|
1641
1603
|
)
|
|
1642
1604
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1643
|
-
response_data = utils.
|
|
1644
|
-
|
|
1605
|
+
response_data = utils.unmarshal_json_response(
|
|
1606
|
+
errors.BadRequestData, http_res
|
|
1607
|
+
)
|
|
1608
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1645
1609
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1646
|
-
response_data = utils.
|
|
1647
|
-
|
|
1610
|
+
response_data = utils.unmarshal_json_response(
|
|
1611
|
+
errors.UnauthorizedData, http_res
|
|
1612
|
+
)
|
|
1613
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1648
1614
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1649
|
-
response_data = utils.
|
|
1650
|
-
|
|
1615
|
+
response_data = utils.unmarshal_json_response(
|
|
1616
|
+
errors.ForbiddenData, http_res
|
|
1617
|
+
)
|
|
1618
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1651
1619
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1652
|
-
response_data = utils.
|
|
1653
|
-
raise errors.NotFound(
|
|
1620
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1621
|
+
raise errors.NotFound(response_data, http_res)
|
|
1654
1622
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1655
|
-
response_data = utils.
|
|
1656
|
-
raise errors.Conflict(
|
|
1623
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
1624
|
+
raise errors.Conflict(response_data, http_res)
|
|
1657
1625
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1658
|
-
response_data = utils.
|
|
1659
|
-
|
|
1626
|
+
response_data = utils.unmarshal_json_response(
|
|
1627
|
+
errors.InviteExpiredData, http_res
|
|
1660
1628
|
)
|
|
1661
|
-
raise errors.InviteExpired(
|
|
1629
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1662
1630
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1663
|
-
response_data = utils.
|
|
1664
|
-
|
|
1631
|
+
response_data = utils.unmarshal_json_response(
|
|
1632
|
+
errors.UnprocessableEntityData, http_res
|
|
1665
1633
|
)
|
|
1666
|
-
raise errors.UnprocessableEntity(
|
|
1634
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1667
1635
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1668
|
-
response_data = utils.
|
|
1669
|
-
|
|
1636
|
+
response_data = utils.unmarshal_json_response(
|
|
1637
|
+
errors.RateLimitExceededData, http_res
|
|
1670
1638
|
)
|
|
1671
|
-
raise errors.RateLimitExceeded(
|
|
1639
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1672
1640
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1673
|
-
response_data = utils.
|
|
1674
|
-
|
|
1641
|
+
response_data = utils.unmarshal_json_response(
|
|
1642
|
+
errors.InternalServerErrorData, http_res
|
|
1675
1643
|
)
|
|
1676
|
-
raise errors.InternalServerError(
|
|
1644
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1677
1645
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1678
1646
|
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
|
-
)
|
|
1647
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1682
1648
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1683
1649
|
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
|
-
)
|
|
1650
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1687
1651
|
|
|
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
|
-
)
|
|
1652
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1696
1653
|
|
|
1697
1654
|
async def delete_async(
|
|
1698
1655
|
self,
|
|
@@ -1778,63 +1735,58 @@ class Links(BaseSDK):
|
|
|
1778
1735
|
|
|
1779
1736
|
response_data: Any = None
|
|
1780
1737
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1781
|
-
return utils.
|
|
1782
|
-
|
|
1738
|
+
return utils.unmarshal_json_response(
|
|
1739
|
+
Optional[operations.DeleteLinkResponseBody], http_res
|
|
1783
1740
|
)
|
|
1784
1741
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1785
|
-
response_data = utils.
|
|
1786
|
-
|
|
1742
|
+
response_data = utils.unmarshal_json_response(
|
|
1743
|
+
errors.BadRequestData, http_res
|
|
1744
|
+
)
|
|
1745
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1787
1746
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1788
|
-
response_data = utils.
|
|
1789
|
-
|
|
1747
|
+
response_data = utils.unmarshal_json_response(
|
|
1748
|
+
errors.UnauthorizedData, http_res
|
|
1749
|
+
)
|
|
1750
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1790
1751
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1791
|
-
response_data = utils.
|
|
1792
|
-
|
|
1752
|
+
response_data = utils.unmarshal_json_response(
|
|
1753
|
+
errors.ForbiddenData, http_res
|
|
1754
|
+
)
|
|
1755
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1793
1756
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1794
|
-
response_data = utils.
|
|
1795
|
-
raise errors.NotFound(
|
|
1757
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1758
|
+
raise errors.NotFound(response_data, http_res)
|
|
1796
1759
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1797
|
-
response_data = utils.
|
|
1798
|
-
raise errors.Conflict(
|
|
1760
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
1761
|
+
raise errors.Conflict(response_data, http_res)
|
|
1799
1762
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1800
|
-
response_data = utils.
|
|
1801
|
-
|
|
1763
|
+
response_data = utils.unmarshal_json_response(
|
|
1764
|
+
errors.InviteExpiredData, http_res
|
|
1802
1765
|
)
|
|
1803
|
-
raise errors.InviteExpired(
|
|
1766
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1804
1767
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1805
|
-
response_data = utils.
|
|
1806
|
-
|
|
1768
|
+
response_data = utils.unmarshal_json_response(
|
|
1769
|
+
errors.UnprocessableEntityData, http_res
|
|
1807
1770
|
)
|
|
1808
|
-
raise errors.UnprocessableEntity(
|
|
1771
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1809
1772
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1810
|
-
response_data = utils.
|
|
1811
|
-
|
|
1773
|
+
response_data = utils.unmarshal_json_response(
|
|
1774
|
+
errors.RateLimitExceededData, http_res
|
|
1812
1775
|
)
|
|
1813
|
-
raise errors.RateLimitExceeded(
|
|
1776
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1814
1777
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1815
|
-
response_data = utils.
|
|
1816
|
-
|
|
1778
|
+
response_data = utils.unmarshal_json_response(
|
|
1779
|
+
errors.InternalServerErrorData, http_res
|
|
1817
1780
|
)
|
|
1818
|
-
raise errors.InternalServerError(
|
|
1781
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1819
1782
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1820
1783
|
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
|
-
)
|
|
1784
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1824
1785
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1825
1786
|
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
|
-
)
|
|
1787
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1829
1788
|
|
|
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
|
-
)
|
|
1789
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1838
1790
|
|
|
1839
1791
|
def create_many(
|
|
1840
1792
|
self,
|
|
@@ -1925,63 +1877,58 @@ class Links(BaseSDK):
|
|
|
1925
1877
|
|
|
1926
1878
|
response_data: Any = None
|
|
1927
1879
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1928
|
-
return utils.
|
|
1929
|
-
|
|
1880
|
+
return utils.unmarshal_json_response(
|
|
1881
|
+
Optional[List[operations.ResponseBody]], http_res
|
|
1930
1882
|
)
|
|
1931
1883
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1932
|
-
response_data = utils.
|
|
1933
|
-
|
|
1884
|
+
response_data = utils.unmarshal_json_response(
|
|
1885
|
+
errors.BadRequestData, http_res
|
|
1886
|
+
)
|
|
1887
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1934
1888
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1935
|
-
response_data = utils.
|
|
1936
|
-
|
|
1889
|
+
response_data = utils.unmarshal_json_response(
|
|
1890
|
+
errors.UnauthorizedData, http_res
|
|
1891
|
+
)
|
|
1892
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1937
1893
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1938
|
-
response_data = utils.
|
|
1939
|
-
|
|
1894
|
+
response_data = utils.unmarshal_json_response(
|
|
1895
|
+
errors.ForbiddenData, http_res
|
|
1896
|
+
)
|
|
1897
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1940
1898
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1941
|
-
response_data = utils.
|
|
1942
|
-
raise errors.NotFound(
|
|
1899
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1900
|
+
raise errors.NotFound(response_data, http_res)
|
|
1943
1901
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1944
|
-
response_data = utils.
|
|
1945
|
-
raise errors.Conflict(
|
|
1902
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
1903
|
+
raise errors.Conflict(response_data, http_res)
|
|
1946
1904
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1947
|
-
response_data = utils.
|
|
1948
|
-
|
|
1905
|
+
response_data = utils.unmarshal_json_response(
|
|
1906
|
+
errors.InviteExpiredData, http_res
|
|
1949
1907
|
)
|
|
1950
|
-
raise errors.InviteExpired(
|
|
1908
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1951
1909
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1952
|
-
response_data = utils.
|
|
1953
|
-
|
|
1910
|
+
response_data = utils.unmarshal_json_response(
|
|
1911
|
+
errors.UnprocessableEntityData, http_res
|
|
1954
1912
|
)
|
|
1955
|
-
raise errors.UnprocessableEntity(
|
|
1913
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1956
1914
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1957
|
-
response_data = utils.
|
|
1958
|
-
|
|
1915
|
+
response_data = utils.unmarshal_json_response(
|
|
1916
|
+
errors.RateLimitExceededData, http_res
|
|
1959
1917
|
)
|
|
1960
|
-
raise errors.RateLimitExceeded(
|
|
1918
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1961
1919
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1962
|
-
response_data = utils.
|
|
1963
|
-
|
|
1920
|
+
response_data = utils.unmarshal_json_response(
|
|
1921
|
+
errors.InternalServerErrorData, http_res
|
|
1964
1922
|
)
|
|
1965
|
-
raise errors.InternalServerError(
|
|
1923
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1966
1924
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1967
1925
|
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
|
-
)
|
|
1926
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1971
1927
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1972
1928
|
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
|
-
)
|
|
1929
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1976
1930
|
|
|
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
|
-
)
|
|
1931
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1985
1932
|
|
|
1986
1933
|
async def create_many_async(
|
|
1987
1934
|
self,
|
|
@@ -2072,63 +2019,58 @@ class Links(BaseSDK):
|
|
|
2072
2019
|
|
|
2073
2020
|
response_data: Any = None
|
|
2074
2021
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2075
|
-
return utils.
|
|
2076
|
-
|
|
2022
|
+
return utils.unmarshal_json_response(
|
|
2023
|
+
Optional[List[operations.ResponseBody]], http_res
|
|
2077
2024
|
)
|
|
2078
2025
|
if utils.match_response(http_res, "400", "application/json"):
|
|
2079
|
-
response_data = utils.
|
|
2080
|
-
|
|
2026
|
+
response_data = utils.unmarshal_json_response(
|
|
2027
|
+
errors.BadRequestData, http_res
|
|
2028
|
+
)
|
|
2029
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2081
2030
|
if utils.match_response(http_res, "401", "application/json"):
|
|
2082
|
-
response_data = utils.
|
|
2083
|
-
|
|
2031
|
+
response_data = utils.unmarshal_json_response(
|
|
2032
|
+
errors.UnauthorizedData, http_res
|
|
2033
|
+
)
|
|
2034
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2084
2035
|
if utils.match_response(http_res, "403", "application/json"):
|
|
2085
|
-
response_data = utils.
|
|
2086
|
-
|
|
2036
|
+
response_data = utils.unmarshal_json_response(
|
|
2037
|
+
errors.ForbiddenData, http_res
|
|
2038
|
+
)
|
|
2039
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2087
2040
|
if utils.match_response(http_res, "404", "application/json"):
|
|
2088
|
-
response_data = utils.
|
|
2089
|
-
raise errors.NotFound(
|
|
2041
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
2042
|
+
raise errors.NotFound(response_data, http_res)
|
|
2090
2043
|
if utils.match_response(http_res, "409", "application/json"):
|
|
2091
|
-
response_data = utils.
|
|
2092
|
-
raise errors.Conflict(
|
|
2044
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
2045
|
+
raise errors.Conflict(response_data, http_res)
|
|
2093
2046
|
if utils.match_response(http_res, "410", "application/json"):
|
|
2094
|
-
response_data = utils.
|
|
2095
|
-
|
|
2047
|
+
response_data = utils.unmarshal_json_response(
|
|
2048
|
+
errors.InviteExpiredData, http_res
|
|
2096
2049
|
)
|
|
2097
|
-
raise errors.InviteExpired(
|
|
2050
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
2098
2051
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2099
|
-
response_data = utils.
|
|
2100
|
-
|
|
2052
|
+
response_data = utils.unmarshal_json_response(
|
|
2053
|
+
errors.UnprocessableEntityData, http_res
|
|
2101
2054
|
)
|
|
2102
|
-
raise errors.UnprocessableEntity(
|
|
2055
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
2103
2056
|
if utils.match_response(http_res, "429", "application/json"):
|
|
2104
|
-
response_data = utils.
|
|
2105
|
-
|
|
2057
|
+
response_data = utils.unmarshal_json_response(
|
|
2058
|
+
errors.RateLimitExceededData, http_res
|
|
2106
2059
|
)
|
|
2107
|
-
raise errors.RateLimitExceeded(
|
|
2060
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
2108
2061
|
if utils.match_response(http_res, "500", "application/json"):
|
|
2109
|
-
response_data = utils.
|
|
2110
|
-
|
|
2062
|
+
response_data = utils.unmarshal_json_response(
|
|
2063
|
+
errors.InternalServerErrorData, http_res
|
|
2111
2064
|
)
|
|
2112
|
-
raise errors.InternalServerError(
|
|
2065
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2113
2066
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2114
2067
|
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
|
-
)
|
|
2068
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2118
2069
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2119
2070
|
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
|
-
)
|
|
2071
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2123
2072
|
|
|
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
|
-
)
|
|
2073
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
2132
2074
|
|
|
2133
2075
|
def update_many(
|
|
2134
2076
|
self,
|
|
@@ -2228,63 +2170,58 @@ class Links(BaseSDK):
|
|
|
2228
2170
|
|
|
2229
2171
|
response_data: Any = None
|
|
2230
2172
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2231
|
-
return utils.
|
|
2232
|
-
|
|
2173
|
+
return utils.unmarshal_json_response(
|
|
2174
|
+
Optional[List[components.LinkSchema]], http_res
|
|
2233
2175
|
)
|
|
2234
2176
|
if utils.match_response(http_res, "400", "application/json"):
|
|
2235
|
-
response_data = utils.
|
|
2236
|
-
|
|
2177
|
+
response_data = utils.unmarshal_json_response(
|
|
2178
|
+
errors.BadRequestData, http_res
|
|
2179
|
+
)
|
|
2180
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2237
2181
|
if utils.match_response(http_res, "401", "application/json"):
|
|
2238
|
-
response_data = utils.
|
|
2239
|
-
|
|
2182
|
+
response_data = utils.unmarshal_json_response(
|
|
2183
|
+
errors.UnauthorizedData, http_res
|
|
2184
|
+
)
|
|
2185
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2240
2186
|
if utils.match_response(http_res, "403", "application/json"):
|
|
2241
|
-
response_data = utils.
|
|
2242
|
-
|
|
2187
|
+
response_data = utils.unmarshal_json_response(
|
|
2188
|
+
errors.ForbiddenData, http_res
|
|
2189
|
+
)
|
|
2190
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2243
2191
|
if utils.match_response(http_res, "404", "application/json"):
|
|
2244
|
-
response_data = utils.
|
|
2245
|
-
raise errors.NotFound(
|
|
2192
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
2193
|
+
raise errors.NotFound(response_data, http_res)
|
|
2246
2194
|
if utils.match_response(http_res, "409", "application/json"):
|
|
2247
|
-
response_data = utils.
|
|
2248
|
-
raise errors.Conflict(
|
|
2195
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
2196
|
+
raise errors.Conflict(response_data, http_res)
|
|
2249
2197
|
if utils.match_response(http_res, "410", "application/json"):
|
|
2250
|
-
response_data = utils.
|
|
2251
|
-
|
|
2198
|
+
response_data = utils.unmarshal_json_response(
|
|
2199
|
+
errors.InviteExpiredData, http_res
|
|
2252
2200
|
)
|
|
2253
|
-
raise errors.InviteExpired(
|
|
2201
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
2254
2202
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2255
|
-
response_data = utils.
|
|
2256
|
-
|
|
2203
|
+
response_data = utils.unmarshal_json_response(
|
|
2204
|
+
errors.UnprocessableEntityData, http_res
|
|
2257
2205
|
)
|
|
2258
|
-
raise errors.UnprocessableEntity(
|
|
2206
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
2259
2207
|
if utils.match_response(http_res, "429", "application/json"):
|
|
2260
|
-
response_data = utils.
|
|
2261
|
-
|
|
2208
|
+
response_data = utils.unmarshal_json_response(
|
|
2209
|
+
errors.RateLimitExceededData, http_res
|
|
2262
2210
|
)
|
|
2263
|
-
raise errors.RateLimitExceeded(
|
|
2211
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
2264
2212
|
if utils.match_response(http_res, "500", "application/json"):
|
|
2265
|
-
response_data = utils.
|
|
2266
|
-
|
|
2213
|
+
response_data = utils.unmarshal_json_response(
|
|
2214
|
+
errors.InternalServerErrorData, http_res
|
|
2267
2215
|
)
|
|
2268
|
-
raise errors.InternalServerError(
|
|
2216
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2269
2217
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2270
2218
|
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
|
-
)
|
|
2219
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2274
2220
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2275
2221
|
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
|
-
)
|
|
2222
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2279
2223
|
|
|
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
|
-
)
|
|
2224
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
2288
2225
|
|
|
2289
2226
|
async def update_many_async(
|
|
2290
2227
|
self,
|
|
@@ -2384,63 +2321,58 @@ class Links(BaseSDK):
|
|
|
2384
2321
|
|
|
2385
2322
|
response_data: Any = None
|
|
2386
2323
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2387
|
-
return utils.
|
|
2388
|
-
|
|
2324
|
+
return utils.unmarshal_json_response(
|
|
2325
|
+
Optional[List[components.LinkSchema]], http_res
|
|
2389
2326
|
)
|
|
2390
2327
|
if utils.match_response(http_res, "400", "application/json"):
|
|
2391
|
-
response_data = utils.
|
|
2392
|
-
|
|
2328
|
+
response_data = utils.unmarshal_json_response(
|
|
2329
|
+
errors.BadRequestData, http_res
|
|
2330
|
+
)
|
|
2331
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2393
2332
|
if utils.match_response(http_res, "401", "application/json"):
|
|
2394
|
-
response_data = utils.
|
|
2395
|
-
|
|
2333
|
+
response_data = utils.unmarshal_json_response(
|
|
2334
|
+
errors.UnauthorizedData, http_res
|
|
2335
|
+
)
|
|
2336
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2396
2337
|
if utils.match_response(http_res, "403", "application/json"):
|
|
2397
|
-
response_data = utils.
|
|
2398
|
-
|
|
2338
|
+
response_data = utils.unmarshal_json_response(
|
|
2339
|
+
errors.ForbiddenData, http_res
|
|
2340
|
+
)
|
|
2341
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2399
2342
|
if utils.match_response(http_res, "404", "application/json"):
|
|
2400
|
-
response_data = utils.
|
|
2401
|
-
raise errors.NotFound(
|
|
2343
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
2344
|
+
raise errors.NotFound(response_data, http_res)
|
|
2402
2345
|
if utils.match_response(http_res, "409", "application/json"):
|
|
2403
|
-
response_data = utils.
|
|
2404
|
-
raise errors.Conflict(
|
|
2346
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
2347
|
+
raise errors.Conflict(response_data, http_res)
|
|
2405
2348
|
if utils.match_response(http_res, "410", "application/json"):
|
|
2406
|
-
response_data = utils.
|
|
2407
|
-
|
|
2349
|
+
response_data = utils.unmarshal_json_response(
|
|
2350
|
+
errors.InviteExpiredData, http_res
|
|
2408
2351
|
)
|
|
2409
|
-
raise errors.InviteExpired(
|
|
2352
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
2410
2353
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2411
|
-
response_data = utils.
|
|
2412
|
-
|
|
2354
|
+
response_data = utils.unmarshal_json_response(
|
|
2355
|
+
errors.UnprocessableEntityData, http_res
|
|
2413
2356
|
)
|
|
2414
|
-
raise errors.UnprocessableEntity(
|
|
2357
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
2415
2358
|
if utils.match_response(http_res, "429", "application/json"):
|
|
2416
|
-
response_data = utils.
|
|
2417
|
-
|
|
2359
|
+
response_data = utils.unmarshal_json_response(
|
|
2360
|
+
errors.RateLimitExceededData, http_res
|
|
2418
2361
|
)
|
|
2419
|
-
raise errors.RateLimitExceeded(
|
|
2362
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
2420
2363
|
if utils.match_response(http_res, "500", "application/json"):
|
|
2421
|
-
response_data = utils.
|
|
2422
|
-
|
|
2364
|
+
response_data = utils.unmarshal_json_response(
|
|
2365
|
+
errors.InternalServerErrorData, http_res
|
|
2423
2366
|
)
|
|
2424
|
-
raise errors.InternalServerError(
|
|
2367
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2425
2368
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2426
2369
|
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
|
-
)
|
|
2370
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2430
2371
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2431
2372
|
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
|
-
)
|
|
2373
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2435
2374
|
|
|
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
|
-
)
|
|
2375
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
2444
2376
|
|
|
2445
2377
|
def delete_many(
|
|
2446
2378
|
self,
|
|
@@ -2529,63 +2461,58 @@ class Links(BaseSDK):
|
|
|
2529
2461
|
|
|
2530
2462
|
response_data: Any = None
|
|
2531
2463
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2532
|
-
return utils.
|
|
2533
|
-
|
|
2464
|
+
return utils.unmarshal_json_response(
|
|
2465
|
+
Optional[operations.BulkDeleteLinksResponseBody], http_res
|
|
2534
2466
|
)
|
|
2535
2467
|
if utils.match_response(http_res, "400", "application/json"):
|
|
2536
|
-
response_data = utils.
|
|
2537
|
-
|
|
2468
|
+
response_data = utils.unmarshal_json_response(
|
|
2469
|
+
errors.BadRequestData, http_res
|
|
2470
|
+
)
|
|
2471
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2538
2472
|
if utils.match_response(http_res, "401", "application/json"):
|
|
2539
|
-
response_data = utils.
|
|
2540
|
-
|
|
2473
|
+
response_data = utils.unmarshal_json_response(
|
|
2474
|
+
errors.UnauthorizedData, http_res
|
|
2475
|
+
)
|
|
2476
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2541
2477
|
if utils.match_response(http_res, "403", "application/json"):
|
|
2542
|
-
response_data = utils.
|
|
2543
|
-
|
|
2478
|
+
response_data = utils.unmarshal_json_response(
|
|
2479
|
+
errors.ForbiddenData, http_res
|
|
2480
|
+
)
|
|
2481
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2544
2482
|
if utils.match_response(http_res, "404", "application/json"):
|
|
2545
|
-
response_data = utils.
|
|
2546
|
-
raise errors.NotFound(
|
|
2483
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
2484
|
+
raise errors.NotFound(response_data, http_res)
|
|
2547
2485
|
if utils.match_response(http_res, "409", "application/json"):
|
|
2548
|
-
response_data = utils.
|
|
2549
|
-
raise errors.Conflict(
|
|
2486
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
2487
|
+
raise errors.Conflict(response_data, http_res)
|
|
2550
2488
|
if utils.match_response(http_res, "410", "application/json"):
|
|
2551
|
-
response_data = utils.
|
|
2552
|
-
|
|
2489
|
+
response_data = utils.unmarshal_json_response(
|
|
2490
|
+
errors.InviteExpiredData, http_res
|
|
2553
2491
|
)
|
|
2554
|
-
raise errors.InviteExpired(
|
|
2492
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
2555
2493
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2556
|
-
response_data = utils.
|
|
2557
|
-
|
|
2494
|
+
response_data = utils.unmarshal_json_response(
|
|
2495
|
+
errors.UnprocessableEntityData, http_res
|
|
2558
2496
|
)
|
|
2559
|
-
raise errors.UnprocessableEntity(
|
|
2497
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
2560
2498
|
if utils.match_response(http_res, "429", "application/json"):
|
|
2561
|
-
response_data = utils.
|
|
2562
|
-
|
|
2499
|
+
response_data = utils.unmarshal_json_response(
|
|
2500
|
+
errors.RateLimitExceededData, http_res
|
|
2563
2501
|
)
|
|
2564
|
-
raise errors.RateLimitExceeded(
|
|
2502
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
2565
2503
|
if utils.match_response(http_res, "500", "application/json"):
|
|
2566
|
-
response_data = utils.
|
|
2567
|
-
|
|
2504
|
+
response_data = utils.unmarshal_json_response(
|
|
2505
|
+
errors.InternalServerErrorData, http_res
|
|
2568
2506
|
)
|
|
2569
|
-
raise errors.InternalServerError(
|
|
2507
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2570
2508
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2571
2509
|
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
|
-
)
|
|
2510
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2575
2511
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2576
2512
|
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
|
-
)
|
|
2513
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2580
2514
|
|
|
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
|
-
)
|
|
2515
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
2589
2516
|
|
|
2590
2517
|
async def delete_many_async(
|
|
2591
2518
|
self,
|
|
@@ -2674,63 +2601,58 @@ class Links(BaseSDK):
|
|
|
2674
2601
|
|
|
2675
2602
|
response_data: Any = None
|
|
2676
2603
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2677
|
-
return utils.
|
|
2678
|
-
|
|
2604
|
+
return utils.unmarshal_json_response(
|
|
2605
|
+
Optional[operations.BulkDeleteLinksResponseBody], http_res
|
|
2679
2606
|
)
|
|
2680
2607
|
if utils.match_response(http_res, "400", "application/json"):
|
|
2681
|
-
response_data = utils.
|
|
2682
|
-
|
|
2608
|
+
response_data = utils.unmarshal_json_response(
|
|
2609
|
+
errors.BadRequestData, http_res
|
|
2610
|
+
)
|
|
2611
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2683
2612
|
if utils.match_response(http_res, "401", "application/json"):
|
|
2684
|
-
response_data = utils.
|
|
2685
|
-
|
|
2613
|
+
response_data = utils.unmarshal_json_response(
|
|
2614
|
+
errors.UnauthorizedData, http_res
|
|
2615
|
+
)
|
|
2616
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2686
2617
|
if utils.match_response(http_res, "403", "application/json"):
|
|
2687
|
-
response_data = utils.
|
|
2688
|
-
|
|
2618
|
+
response_data = utils.unmarshal_json_response(
|
|
2619
|
+
errors.ForbiddenData, http_res
|
|
2620
|
+
)
|
|
2621
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2689
2622
|
if utils.match_response(http_res, "404", "application/json"):
|
|
2690
|
-
response_data = utils.
|
|
2691
|
-
raise errors.NotFound(
|
|
2623
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
2624
|
+
raise errors.NotFound(response_data, http_res)
|
|
2692
2625
|
if utils.match_response(http_res, "409", "application/json"):
|
|
2693
|
-
response_data = utils.
|
|
2694
|
-
raise errors.Conflict(
|
|
2626
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
2627
|
+
raise errors.Conflict(response_data, http_res)
|
|
2695
2628
|
if utils.match_response(http_res, "410", "application/json"):
|
|
2696
|
-
response_data = utils.
|
|
2697
|
-
|
|
2629
|
+
response_data = utils.unmarshal_json_response(
|
|
2630
|
+
errors.InviteExpiredData, http_res
|
|
2698
2631
|
)
|
|
2699
|
-
raise errors.InviteExpired(
|
|
2632
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
2700
2633
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2701
|
-
response_data = utils.
|
|
2702
|
-
|
|
2634
|
+
response_data = utils.unmarshal_json_response(
|
|
2635
|
+
errors.UnprocessableEntityData, http_res
|
|
2703
2636
|
)
|
|
2704
|
-
raise errors.UnprocessableEntity(
|
|
2637
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
2705
2638
|
if utils.match_response(http_res, "429", "application/json"):
|
|
2706
|
-
response_data = utils.
|
|
2707
|
-
|
|
2639
|
+
response_data = utils.unmarshal_json_response(
|
|
2640
|
+
errors.RateLimitExceededData, http_res
|
|
2708
2641
|
)
|
|
2709
|
-
raise errors.RateLimitExceeded(
|
|
2642
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
2710
2643
|
if utils.match_response(http_res, "500", "application/json"):
|
|
2711
|
-
response_data = utils.
|
|
2712
|
-
|
|
2644
|
+
response_data = utils.unmarshal_json_response(
|
|
2645
|
+
errors.InternalServerErrorData, http_res
|
|
2713
2646
|
)
|
|
2714
|
-
raise errors.InternalServerError(
|
|
2647
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2715
2648
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2716
2649
|
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
|
-
)
|
|
2650
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2720
2651
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2721
2652
|
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
|
-
)
|
|
2653
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2725
2654
|
|
|
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
|
-
)
|
|
2655
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
2734
2656
|
|
|
2735
2657
|
def upsert(
|
|
2736
2658
|
self,
|
|
@@ -2826,61 +2748,58 @@ class Links(BaseSDK):
|
|
|
2826
2748
|
|
|
2827
2749
|
response_data: Any = None
|
|
2828
2750
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2829
|
-
return utils.
|
|
2751
|
+
return utils.unmarshal_json_response(
|
|
2752
|
+
Optional[components.LinkSchema], http_res
|
|
2753
|
+
)
|
|
2830
2754
|
if utils.match_response(http_res, "400", "application/json"):
|
|
2831
|
-
response_data = utils.
|
|
2832
|
-
|
|
2755
|
+
response_data = utils.unmarshal_json_response(
|
|
2756
|
+
errors.BadRequestData, http_res
|
|
2757
|
+
)
|
|
2758
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2833
2759
|
if utils.match_response(http_res, "401", "application/json"):
|
|
2834
|
-
response_data = utils.
|
|
2835
|
-
|
|
2760
|
+
response_data = utils.unmarshal_json_response(
|
|
2761
|
+
errors.UnauthorizedData, http_res
|
|
2762
|
+
)
|
|
2763
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2836
2764
|
if utils.match_response(http_res, "403", "application/json"):
|
|
2837
|
-
response_data = utils.
|
|
2838
|
-
|
|
2765
|
+
response_data = utils.unmarshal_json_response(
|
|
2766
|
+
errors.ForbiddenData, http_res
|
|
2767
|
+
)
|
|
2768
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2839
2769
|
if utils.match_response(http_res, "404", "application/json"):
|
|
2840
|
-
response_data = utils.
|
|
2841
|
-
raise errors.NotFound(
|
|
2770
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
2771
|
+
raise errors.NotFound(response_data, http_res)
|
|
2842
2772
|
if utils.match_response(http_res, "409", "application/json"):
|
|
2843
|
-
response_data = utils.
|
|
2844
|
-
raise errors.Conflict(
|
|
2773
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
2774
|
+
raise errors.Conflict(response_data, http_res)
|
|
2845
2775
|
if utils.match_response(http_res, "410", "application/json"):
|
|
2846
|
-
response_data = utils.
|
|
2847
|
-
|
|
2776
|
+
response_data = utils.unmarshal_json_response(
|
|
2777
|
+
errors.InviteExpiredData, http_res
|
|
2848
2778
|
)
|
|
2849
|
-
raise errors.InviteExpired(
|
|
2779
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
2850
2780
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2851
|
-
response_data = utils.
|
|
2852
|
-
|
|
2781
|
+
response_data = utils.unmarshal_json_response(
|
|
2782
|
+
errors.UnprocessableEntityData, http_res
|
|
2853
2783
|
)
|
|
2854
|
-
raise errors.UnprocessableEntity(
|
|
2784
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
2855
2785
|
if utils.match_response(http_res, "429", "application/json"):
|
|
2856
|
-
response_data = utils.
|
|
2857
|
-
|
|
2786
|
+
response_data = utils.unmarshal_json_response(
|
|
2787
|
+
errors.RateLimitExceededData, http_res
|
|
2858
2788
|
)
|
|
2859
|
-
raise errors.RateLimitExceeded(
|
|
2789
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
2860
2790
|
if utils.match_response(http_res, "500", "application/json"):
|
|
2861
|
-
response_data = utils.
|
|
2862
|
-
|
|
2791
|
+
response_data = utils.unmarshal_json_response(
|
|
2792
|
+
errors.InternalServerErrorData, http_res
|
|
2863
2793
|
)
|
|
2864
|
-
raise errors.InternalServerError(
|
|
2794
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2865
2795
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2866
2796
|
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
|
-
)
|
|
2797
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2870
2798
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2871
2799
|
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
|
-
)
|
|
2800
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
2875
2801
|
|
|
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
|
-
)
|
|
2802
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
2884
2803
|
|
|
2885
2804
|
async def upsert_async(
|
|
2886
2805
|
self,
|
|
@@ -2976,58 +2895,55 @@ class Links(BaseSDK):
|
|
|
2976
2895
|
|
|
2977
2896
|
response_data: Any = None
|
|
2978
2897
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2979
|
-
return utils.
|
|
2898
|
+
return utils.unmarshal_json_response(
|
|
2899
|
+
Optional[components.LinkSchema], http_res
|
|
2900
|
+
)
|
|
2980
2901
|
if utils.match_response(http_res, "400", "application/json"):
|
|
2981
|
-
response_data = utils.
|
|
2982
|
-
|
|
2902
|
+
response_data = utils.unmarshal_json_response(
|
|
2903
|
+
errors.BadRequestData, http_res
|
|
2904
|
+
)
|
|
2905
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2983
2906
|
if utils.match_response(http_res, "401", "application/json"):
|
|
2984
|
-
response_data = utils.
|
|
2985
|
-
|
|
2907
|
+
response_data = utils.unmarshal_json_response(
|
|
2908
|
+
errors.UnauthorizedData, http_res
|
|
2909
|
+
)
|
|
2910
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2986
2911
|
if utils.match_response(http_res, "403", "application/json"):
|
|
2987
|
-
response_data = utils.
|
|
2988
|
-
|
|
2912
|
+
response_data = utils.unmarshal_json_response(
|
|
2913
|
+
errors.ForbiddenData, http_res
|
|
2914
|
+
)
|
|
2915
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2989
2916
|
if utils.match_response(http_res, "404", "application/json"):
|
|
2990
|
-
response_data = utils.
|
|
2991
|
-
raise errors.NotFound(
|
|
2917
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
2918
|
+
raise errors.NotFound(response_data, http_res)
|
|
2992
2919
|
if utils.match_response(http_res, "409", "application/json"):
|
|
2993
|
-
response_data = utils.
|
|
2994
|
-
raise errors.Conflict(
|
|
2920
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
2921
|
+
raise errors.Conflict(response_data, http_res)
|
|
2995
2922
|
if utils.match_response(http_res, "410", "application/json"):
|
|
2996
|
-
response_data = utils.
|
|
2997
|
-
|
|
2923
|
+
response_data = utils.unmarshal_json_response(
|
|
2924
|
+
errors.InviteExpiredData, http_res
|
|
2998
2925
|
)
|
|
2999
|
-
raise errors.InviteExpired(
|
|
2926
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
3000
2927
|
if utils.match_response(http_res, "422", "application/json"):
|
|
3001
|
-
response_data = utils.
|
|
3002
|
-
|
|
2928
|
+
response_data = utils.unmarshal_json_response(
|
|
2929
|
+
errors.UnprocessableEntityData, http_res
|
|
3003
2930
|
)
|
|
3004
|
-
raise errors.UnprocessableEntity(
|
|
2931
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
3005
2932
|
if utils.match_response(http_res, "429", "application/json"):
|
|
3006
|
-
response_data = utils.
|
|
3007
|
-
|
|
2933
|
+
response_data = utils.unmarshal_json_response(
|
|
2934
|
+
errors.RateLimitExceededData, http_res
|
|
3008
2935
|
)
|
|
3009
|
-
raise errors.RateLimitExceeded(
|
|
2936
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
3010
2937
|
if utils.match_response(http_res, "500", "application/json"):
|
|
3011
|
-
response_data = utils.
|
|
3012
|
-
|
|
2938
|
+
response_data = utils.unmarshal_json_response(
|
|
2939
|
+
errors.InternalServerErrorData, http_res
|
|
3013
2940
|
)
|
|
3014
|
-
raise errors.InternalServerError(
|
|
2941
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3015
2942
|
if utils.match_response(http_res, "4XX", "*"):
|
|
3016
2943
|
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
|
-
)
|
|
2944
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
3020
2945
|
if utils.match_response(http_res, "5XX", "*"):
|
|
3021
2946
|
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
|
-
)
|
|
2947
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
3025
2948
|
|
|
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
|
-
)
|
|
2949
|
+
raise errors.SDKError("Unexpected response received", http_res)
|