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/tags.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 typing import Any, List, Mapping, Optional, Union, cast
|
|
9
10
|
|
|
10
11
|
|
|
@@ -103,61 +104,48 @@ class Tags(BaseSDK):
|
|
|
103
104
|
|
|
104
105
|
response_data: Any = None
|
|
105
106
|
if utils.match_response(http_res, "201", "application/json"):
|
|
106
|
-
return
|
|
107
|
+
return unmarshal_json_response(Optional[components.TagSchema], http_res)
|
|
107
108
|
if utils.match_response(http_res, "400", "application/json"):
|
|
108
|
-
response_data =
|
|
109
|
-
raise errors.BadRequest(
|
|
109
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
110
|
+
raise errors.BadRequest(response_data, http_res)
|
|
110
111
|
if utils.match_response(http_res, "401", "application/json"):
|
|
111
|
-
response_data =
|
|
112
|
-
raise errors.Unauthorized(
|
|
112
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
113
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
113
114
|
if utils.match_response(http_res, "403", "application/json"):
|
|
114
|
-
response_data =
|
|
115
|
-
raise errors.Forbidden(
|
|
115
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
116
|
+
raise errors.Forbidden(response_data, http_res)
|
|
116
117
|
if utils.match_response(http_res, "404", "application/json"):
|
|
117
|
-
response_data =
|
|
118
|
-
raise errors.NotFound(
|
|
118
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
119
|
+
raise errors.NotFound(response_data, http_res)
|
|
119
120
|
if utils.match_response(http_res, "409", "application/json"):
|
|
120
|
-
response_data =
|
|
121
|
-
raise errors.Conflict(
|
|
121
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
122
|
+
raise errors.Conflict(response_data, http_res)
|
|
122
123
|
if utils.match_response(http_res, "410", "application/json"):
|
|
123
|
-
response_data =
|
|
124
|
-
|
|
125
|
-
)
|
|
126
|
-
raise errors.InviteExpired(data=response_data)
|
|
124
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
125
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
127
126
|
if utils.match_response(http_res, "422", "application/json"):
|
|
128
|
-
response_data =
|
|
129
|
-
|
|
127
|
+
response_data = unmarshal_json_response(
|
|
128
|
+
errors.UnprocessableEntityData, http_res
|
|
130
129
|
)
|
|
131
|
-
raise errors.UnprocessableEntity(
|
|
130
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
132
131
|
if utils.match_response(http_res, "429", "application/json"):
|
|
133
|
-
response_data =
|
|
134
|
-
|
|
132
|
+
response_data = unmarshal_json_response(
|
|
133
|
+
errors.RateLimitExceededData, http_res
|
|
135
134
|
)
|
|
136
|
-
raise errors.RateLimitExceeded(
|
|
135
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
137
136
|
if utils.match_response(http_res, "500", "application/json"):
|
|
138
|
-
response_data =
|
|
139
|
-
|
|
137
|
+
response_data = unmarshal_json_response(
|
|
138
|
+
errors.InternalServerErrorData, http_res
|
|
140
139
|
)
|
|
141
|
-
raise errors.InternalServerError(
|
|
140
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
142
141
|
if utils.match_response(http_res, "4XX", "*"):
|
|
143
142
|
http_res_text = utils.stream_to_text(http_res)
|
|
144
|
-
raise errors.SDKError(
|
|
145
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
146
|
-
)
|
|
143
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
147
144
|
if utils.match_response(http_res, "5XX", "*"):
|
|
148
145
|
http_res_text = utils.stream_to_text(http_res)
|
|
149
|
-
raise errors.SDKError(
|
|
150
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
151
|
-
)
|
|
146
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
152
147
|
|
|
153
|
-
|
|
154
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
155
|
-
raise errors.SDKError(
|
|
156
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
157
|
-
http_res.status_code,
|
|
158
|
-
http_res_text,
|
|
159
|
-
http_res,
|
|
160
|
-
)
|
|
148
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
161
149
|
|
|
162
150
|
async def create_async(
|
|
163
151
|
self,
|
|
@@ -253,61 +241,48 @@ class Tags(BaseSDK):
|
|
|
253
241
|
|
|
254
242
|
response_data: Any = None
|
|
255
243
|
if utils.match_response(http_res, "201", "application/json"):
|
|
256
|
-
return
|
|
244
|
+
return unmarshal_json_response(Optional[components.TagSchema], http_res)
|
|
257
245
|
if utils.match_response(http_res, "400", "application/json"):
|
|
258
|
-
response_data =
|
|
259
|
-
raise errors.BadRequest(
|
|
246
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
247
|
+
raise errors.BadRequest(response_data, http_res)
|
|
260
248
|
if utils.match_response(http_res, "401", "application/json"):
|
|
261
|
-
response_data =
|
|
262
|
-
raise errors.Unauthorized(
|
|
249
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
250
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
263
251
|
if utils.match_response(http_res, "403", "application/json"):
|
|
264
|
-
response_data =
|
|
265
|
-
raise errors.Forbidden(
|
|
252
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
253
|
+
raise errors.Forbidden(response_data, http_res)
|
|
266
254
|
if utils.match_response(http_res, "404", "application/json"):
|
|
267
|
-
response_data =
|
|
268
|
-
raise errors.NotFound(
|
|
255
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
256
|
+
raise errors.NotFound(response_data, http_res)
|
|
269
257
|
if utils.match_response(http_res, "409", "application/json"):
|
|
270
|
-
response_data =
|
|
271
|
-
raise errors.Conflict(
|
|
258
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
259
|
+
raise errors.Conflict(response_data, http_res)
|
|
272
260
|
if utils.match_response(http_res, "410", "application/json"):
|
|
273
|
-
response_data =
|
|
274
|
-
|
|
275
|
-
)
|
|
276
|
-
raise errors.InviteExpired(data=response_data)
|
|
261
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
262
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
277
263
|
if utils.match_response(http_res, "422", "application/json"):
|
|
278
|
-
response_data =
|
|
279
|
-
|
|
264
|
+
response_data = unmarshal_json_response(
|
|
265
|
+
errors.UnprocessableEntityData, http_res
|
|
280
266
|
)
|
|
281
|
-
raise errors.UnprocessableEntity(
|
|
267
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
282
268
|
if utils.match_response(http_res, "429", "application/json"):
|
|
283
|
-
response_data =
|
|
284
|
-
|
|
269
|
+
response_data = unmarshal_json_response(
|
|
270
|
+
errors.RateLimitExceededData, http_res
|
|
285
271
|
)
|
|
286
|
-
raise errors.RateLimitExceeded(
|
|
272
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
287
273
|
if utils.match_response(http_res, "500", "application/json"):
|
|
288
|
-
response_data =
|
|
289
|
-
|
|
274
|
+
response_data = unmarshal_json_response(
|
|
275
|
+
errors.InternalServerErrorData, http_res
|
|
290
276
|
)
|
|
291
|
-
raise errors.InternalServerError(
|
|
277
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
292
278
|
if utils.match_response(http_res, "4XX", "*"):
|
|
293
279
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
294
|
-
raise errors.SDKError(
|
|
295
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
296
|
-
)
|
|
280
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
297
281
|
if utils.match_response(http_res, "5XX", "*"):
|
|
298
282
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
299
|
-
raise errors.SDKError(
|
|
300
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
301
|
-
)
|
|
283
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
302
284
|
|
|
303
|
-
|
|
304
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
305
|
-
raise errors.SDKError(
|
|
306
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
307
|
-
http_res.status_code,
|
|
308
|
-
http_res_text,
|
|
309
|
-
http_res,
|
|
310
|
-
)
|
|
285
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
311
286
|
|
|
312
287
|
def list(
|
|
313
288
|
self,
|
|
@@ -393,63 +368,50 @@ class Tags(BaseSDK):
|
|
|
393
368
|
|
|
394
369
|
response_data: Any = None
|
|
395
370
|
if utils.match_response(http_res, "200", "application/json"):
|
|
396
|
-
return
|
|
397
|
-
|
|
371
|
+
return unmarshal_json_response(
|
|
372
|
+
Optional[List[components.TagSchema]], http_res
|
|
398
373
|
)
|
|
399
374
|
if utils.match_response(http_res, "400", "application/json"):
|
|
400
|
-
response_data =
|
|
401
|
-
raise errors.BadRequest(
|
|
375
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
376
|
+
raise errors.BadRequest(response_data, http_res)
|
|
402
377
|
if utils.match_response(http_res, "401", "application/json"):
|
|
403
|
-
response_data =
|
|
404
|
-
raise errors.Unauthorized(
|
|
378
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
379
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
405
380
|
if utils.match_response(http_res, "403", "application/json"):
|
|
406
|
-
response_data =
|
|
407
|
-
raise errors.Forbidden(
|
|
381
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
382
|
+
raise errors.Forbidden(response_data, http_res)
|
|
408
383
|
if utils.match_response(http_res, "404", "application/json"):
|
|
409
|
-
response_data =
|
|
410
|
-
raise errors.NotFound(
|
|
384
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
385
|
+
raise errors.NotFound(response_data, http_res)
|
|
411
386
|
if utils.match_response(http_res, "409", "application/json"):
|
|
412
|
-
response_data =
|
|
413
|
-
raise errors.Conflict(
|
|
387
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
388
|
+
raise errors.Conflict(response_data, http_res)
|
|
414
389
|
if utils.match_response(http_res, "410", "application/json"):
|
|
415
|
-
response_data =
|
|
416
|
-
|
|
417
|
-
)
|
|
418
|
-
raise errors.InviteExpired(data=response_data)
|
|
390
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
391
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
419
392
|
if utils.match_response(http_res, "422", "application/json"):
|
|
420
|
-
response_data =
|
|
421
|
-
|
|
393
|
+
response_data = unmarshal_json_response(
|
|
394
|
+
errors.UnprocessableEntityData, http_res
|
|
422
395
|
)
|
|
423
|
-
raise errors.UnprocessableEntity(
|
|
396
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
424
397
|
if utils.match_response(http_res, "429", "application/json"):
|
|
425
|
-
response_data =
|
|
426
|
-
|
|
398
|
+
response_data = unmarshal_json_response(
|
|
399
|
+
errors.RateLimitExceededData, http_res
|
|
427
400
|
)
|
|
428
|
-
raise errors.RateLimitExceeded(
|
|
401
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
429
402
|
if utils.match_response(http_res, "500", "application/json"):
|
|
430
|
-
response_data =
|
|
431
|
-
|
|
403
|
+
response_data = unmarshal_json_response(
|
|
404
|
+
errors.InternalServerErrorData, http_res
|
|
432
405
|
)
|
|
433
|
-
raise errors.InternalServerError(
|
|
406
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
434
407
|
if utils.match_response(http_res, "4XX", "*"):
|
|
435
408
|
http_res_text = utils.stream_to_text(http_res)
|
|
436
|
-
raise errors.SDKError(
|
|
437
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
438
|
-
)
|
|
409
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
439
410
|
if utils.match_response(http_res, "5XX", "*"):
|
|
440
411
|
http_res_text = utils.stream_to_text(http_res)
|
|
441
|
-
raise errors.SDKError(
|
|
442
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
443
|
-
)
|
|
412
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
444
413
|
|
|
445
|
-
|
|
446
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
447
|
-
raise errors.SDKError(
|
|
448
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
449
|
-
http_res.status_code,
|
|
450
|
-
http_res_text,
|
|
451
|
-
http_res,
|
|
452
|
-
)
|
|
414
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
453
415
|
|
|
454
416
|
async def list_async(
|
|
455
417
|
self,
|
|
@@ -535,63 +497,50 @@ class Tags(BaseSDK):
|
|
|
535
497
|
|
|
536
498
|
response_data: Any = None
|
|
537
499
|
if utils.match_response(http_res, "200", "application/json"):
|
|
538
|
-
return
|
|
539
|
-
|
|
500
|
+
return unmarshal_json_response(
|
|
501
|
+
Optional[List[components.TagSchema]], http_res
|
|
540
502
|
)
|
|
541
503
|
if utils.match_response(http_res, "400", "application/json"):
|
|
542
|
-
response_data =
|
|
543
|
-
raise errors.BadRequest(
|
|
504
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
505
|
+
raise errors.BadRequest(response_data, http_res)
|
|
544
506
|
if utils.match_response(http_res, "401", "application/json"):
|
|
545
|
-
response_data =
|
|
546
|
-
raise errors.Unauthorized(
|
|
507
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
508
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
547
509
|
if utils.match_response(http_res, "403", "application/json"):
|
|
548
|
-
response_data =
|
|
549
|
-
raise errors.Forbidden(
|
|
510
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
511
|
+
raise errors.Forbidden(response_data, http_res)
|
|
550
512
|
if utils.match_response(http_res, "404", "application/json"):
|
|
551
|
-
response_data =
|
|
552
|
-
raise errors.NotFound(
|
|
513
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
514
|
+
raise errors.NotFound(response_data, http_res)
|
|
553
515
|
if utils.match_response(http_res, "409", "application/json"):
|
|
554
|
-
response_data =
|
|
555
|
-
raise errors.Conflict(
|
|
516
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
517
|
+
raise errors.Conflict(response_data, http_res)
|
|
556
518
|
if utils.match_response(http_res, "410", "application/json"):
|
|
557
|
-
response_data =
|
|
558
|
-
|
|
559
|
-
)
|
|
560
|
-
raise errors.InviteExpired(data=response_data)
|
|
519
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
520
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
561
521
|
if utils.match_response(http_res, "422", "application/json"):
|
|
562
|
-
response_data =
|
|
563
|
-
|
|
522
|
+
response_data = unmarshal_json_response(
|
|
523
|
+
errors.UnprocessableEntityData, http_res
|
|
564
524
|
)
|
|
565
|
-
raise errors.UnprocessableEntity(
|
|
525
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
566
526
|
if utils.match_response(http_res, "429", "application/json"):
|
|
567
|
-
response_data =
|
|
568
|
-
|
|
527
|
+
response_data = unmarshal_json_response(
|
|
528
|
+
errors.RateLimitExceededData, http_res
|
|
569
529
|
)
|
|
570
|
-
raise errors.RateLimitExceeded(
|
|
530
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
571
531
|
if utils.match_response(http_res, "500", "application/json"):
|
|
572
|
-
response_data =
|
|
573
|
-
|
|
532
|
+
response_data = unmarshal_json_response(
|
|
533
|
+
errors.InternalServerErrorData, http_res
|
|
574
534
|
)
|
|
575
|
-
raise errors.InternalServerError(
|
|
535
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
576
536
|
if utils.match_response(http_res, "4XX", "*"):
|
|
577
537
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
578
|
-
raise errors.SDKError(
|
|
579
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
580
|
-
)
|
|
538
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
581
539
|
if utils.match_response(http_res, "5XX", "*"):
|
|
582
540
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
583
|
-
raise errors.SDKError(
|
|
584
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
585
|
-
)
|
|
541
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
586
542
|
|
|
587
|
-
|
|
588
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
589
|
-
raise errors.SDKError(
|
|
590
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
591
|
-
http_res.status_code,
|
|
592
|
-
http_res_text,
|
|
593
|
-
http_res,
|
|
594
|
-
)
|
|
543
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
595
544
|
|
|
596
545
|
def update(
|
|
597
546
|
self,
|
|
@@ -694,61 +643,48 @@ class Tags(BaseSDK):
|
|
|
694
643
|
|
|
695
644
|
response_data: Any = None
|
|
696
645
|
if utils.match_response(http_res, "200", "application/json"):
|
|
697
|
-
return
|
|
646
|
+
return unmarshal_json_response(Optional[components.TagSchema], http_res)
|
|
698
647
|
if utils.match_response(http_res, "400", "application/json"):
|
|
699
|
-
response_data =
|
|
700
|
-
raise errors.BadRequest(
|
|
648
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
649
|
+
raise errors.BadRequest(response_data, http_res)
|
|
701
650
|
if utils.match_response(http_res, "401", "application/json"):
|
|
702
|
-
response_data =
|
|
703
|
-
raise errors.Unauthorized(
|
|
651
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
652
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
704
653
|
if utils.match_response(http_res, "403", "application/json"):
|
|
705
|
-
response_data =
|
|
706
|
-
raise errors.Forbidden(
|
|
654
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
655
|
+
raise errors.Forbidden(response_data, http_res)
|
|
707
656
|
if utils.match_response(http_res, "404", "application/json"):
|
|
708
|
-
response_data =
|
|
709
|
-
raise errors.NotFound(
|
|
657
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
658
|
+
raise errors.NotFound(response_data, http_res)
|
|
710
659
|
if utils.match_response(http_res, "409", "application/json"):
|
|
711
|
-
response_data =
|
|
712
|
-
raise errors.Conflict(
|
|
660
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
661
|
+
raise errors.Conflict(response_data, http_res)
|
|
713
662
|
if utils.match_response(http_res, "410", "application/json"):
|
|
714
|
-
response_data =
|
|
715
|
-
|
|
716
|
-
)
|
|
717
|
-
raise errors.InviteExpired(data=response_data)
|
|
663
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
664
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
718
665
|
if utils.match_response(http_res, "422", "application/json"):
|
|
719
|
-
response_data =
|
|
720
|
-
|
|
666
|
+
response_data = unmarshal_json_response(
|
|
667
|
+
errors.UnprocessableEntityData, http_res
|
|
721
668
|
)
|
|
722
|
-
raise errors.UnprocessableEntity(
|
|
669
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
723
670
|
if utils.match_response(http_res, "429", "application/json"):
|
|
724
|
-
response_data =
|
|
725
|
-
|
|
671
|
+
response_data = unmarshal_json_response(
|
|
672
|
+
errors.RateLimitExceededData, http_res
|
|
726
673
|
)
|
|
727
|
-
raise errors.RateLimitExceeded(
|
|
674
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
728
675
|
if utils.match_response(http_res, "500", "application/json"):
|
|
729
|
-
response_data =
|
|
730
|
-
|
|
676
|
+
response_data = unmarshal_json_response(
|
|
677
|
+
errors.InternalServerErrorData, http_res
|
|
731
678
|
)
|
|
732
|
-
raise errors.InternalServerError(
|
|
679
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
733
680
|
if utils.match_response(http_res, "4XX", "*"):
|
|
734
681
|
http_res_text = utils.stream_to_text(http_res)
|
|
735
|
-
raise errors.SDKError(
|
|
736
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
737
|
-
)
|
|
682
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
738
683
|
if utils.match_response(http_res, "5XX", "*"):
|
|
739
684
|
http_res_text = utils.stream_to_text(http_res)
|
|
740
|
-
raise errors.SDKError(
|
|
741
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
742
|
-
)
|
|
685
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
743
686
|
|
|
744
|
-
|
|
745
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
746
|
-
raise errors.SDKError(
|
|
747
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
748
|
-
http_res.status_code,
|
|
749
|
-
http_res_text,
|
|
750
|
-
http_res,
|
|
751
|
-
)
|
|
687
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
752
688
|
|
|
753
689
|
async def update_async(
|
|
754
690
|
self,
|
|
@@ -851,61 +787,48 @@ class Tags(BaseSDK):
|
|
|
851
787
|
|
|
852
788
|
response_data: Any = None
|
|
853
789
|
if utils.match_response(http_res, "200", "application/json"):
|
|
854
|
-
return
|
|
790
|
+
return unmarshal_json_response(Optional[components.TagSchema], http_res)
|
|
855
791
|
if utils.match_response(http_res, "400", "application/json"):
|
|
856
|
-
response_data =
|
|
857
|
-
raise errors.BadRequest(
|
|
792
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
793
|
+
raise errors.BadRequest(response_data, http_res)
|
|
858
794
|
if utils.match_response(http_res, "401", "application/json"):
|
|
859
|
-
response_data =
|
|
860
|
-
raise errors.Unauthorized(
|
|
795
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
796
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
861
797
|
if utils.match_response(http_res, "403", "application/json"):
|
|
862
|
-
response_data =
|
|
863
|
-
raise errors.Forbidden(
|
|
798
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
799
|
+
raise errors.Forbidden(response_data, http_res)
|
|
864
800
|
if utils.match_response(http_res, "404", "application/json"):
|
|
865
|
-
response_data =
|
|
866
|
-
raise errors.NotFound(
|
|
801
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
802
|
+
raise errors.NotFound(response_data, http_res)
|
|
867
803
|
if utils.match_response(http_res, "409", "application/json"):
|
|
868
|
-
response_data =
|
|
869
|
-
raise errors.Conflict(
|
|
804
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
805
|
+
raise errors.Conflict(response_data, http_res)
|
|
870
806
|
if utils.match_response(http_res, "410", "application/json"):
|
|
871
|
-
response_data =
|
|
872
|
-
|
|
873
|
-
)
|
|
874
|
-
raise errors.InviteExpired(data=response_data)
|
|
807
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
808
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
875
809
|
if utils.match_response(http_res, "422", "application/json"):
|
|
876
|
-
response_data =
|
|
877
|
-
|
|
810
|
+
response_data = unmarshal_json_response(
|
|
811
|
+
errors.UnprocessableEntityData, http_res
|
|
878
812
|
)
|
|
879
|
-
raise errors.UnprocessableEntity(
|
|
813
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
880
814
|
if utils.match_response(http_res, "429", "application/json"):
|
|
881
|
-
response_data =
|
|
882
|
-
|
|
815
|
+
response_data = unmarshal_json_response(
|
|
816
|
+
errors.RateLimitExceededData, http_res
|
|
883
817
|
)
|
|
884
|
-
raise errors.RateLimitExceeded(
|
|
818
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
885
819
|
if utils.match_response(http_res, "500", "application/json"):
|
|
886
|
-
response_data =
|
|
887
|
-
|
|
820
|
+
response_data = unmarshal_json_response(
|
|
821
|
+
errors.InternalServerErrorData, http_res
|
|
888
822
|
)
|
|
889
|
-
raise errors.InternalServerError(
|
|
823
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
890
824
|
if utils.match_response(http_res, "4XX", "*"):
|
|
891
825
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
892
|
-
raise errors.SDKError(
|
|
893
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
894
|
-
)
|
|
826
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
895
827
|
if utils.match_response(http_res, "5XX", "*"):
|
|
896
828
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
897
|
-
raise errors.SDKError(
|
|
898
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
899
|
-
)
|
|
829
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
900
830
|
|
|
901
|
-
|
|
902
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
903
|
-
raise errors.SDKError(
|
|
904
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
905
|
-
http_res.status_code,
|
|
906
|
-
http_res_text,
|
|
907
|
-
http_res,
|
|
908
|
-
)
|
|
831
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
909
832
|
|
|
910
833
|
def delete(
|
|
911
834
|
self,
|
|
@@ -991,63 +914,50 @@ class Tags(BaseSDK):
|
|
|
991
914
|
|
|
992
915
|
response_data: Any = None
|
|
993
916
|
if utils.match_response(http_res, "200", "application/json"):
|
|
994
|
-
return
|
|
995
|
-
|
|
917
|
+
return unmarshal_json_response(
|
|
918
|
+
Optional[operations.DeleteTagResponseBody], http_res
|
|
996
919
|
)
|
|
997
920
|
if utils.match_response(http_res, "400", "application/json"):
|
|
998
|
-
response_data =
|
|
999
|
-
raise errors.BadRequest(
|
|
921
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
922
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1000
923
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1001
|
-
response_data =
|
|
1002
|
-
raise errors.Unauthorized(
|
|
924
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
925
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1003
926
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1004
|
-
response_data =
|
|
1005
|
-
raise errors.Forbidden(
|
|
927
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
928
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1006
929
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1007
|
-
response_data =
|
|
1008
|
-
raise errors.NotFound(
|
|
930
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
931
|
+
raise errors.NotFound(response_data, http_res)
|
|
1009
932
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1010
|
-
response_data =
|
|
1011
|
-
raise errors.Conflict(
|
|
933
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
934
|
+
raise errors.Conflict(response_data, http_res)
|
|
1012
935
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1013
|
-
response_data =
|
|
1014
|
-
|
|
1015
|
-
)
|
|
1016
|
-
raise errors.InviteExpired(data=response_data)
|
|
936
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
937
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1017
938
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1018
|
-
response_data =
|
|
1019
|
-
|
|
939
|
+
response_data = unmarshal_json_response(
|
|
940
|
+
errors.UnprocessableEntityData, http_res
|
|
1020
941
|
)
|
|
1021
|
-
raise errors.UnprocessableEntity(
|
|
942
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1022
943
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1023
|
-
response_data =
|
|
1024
|
-
|
|
944
|
+
response_data = unmarshal_json_response(
|
|
945
|
+
errors.RateLimitExceededData, http_res
|
|
1025
946
|
)
|
|
1026
|
-
raise errors.RateLimitExceeded(
|
|
947
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1027
948
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1028
|
-
response_data =
|
|
1029
|
-
|
|
949
|
+
response_data = unmarshal_json_response(
|
|
950
|
+
errors.InternalServerErrorData, http_res
|
|
1030
951
|
)
|
|
1031
|
-
raise errors.InternalServerError(
|
|
952
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1032
953
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1033
954
|
http_res_text = utils.stream_to_text(http_res)
|
|
1034
|
-
raise errors.SDKError(
|
|
1035
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1036
|
-
)
|
|
955
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1037
956
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1038
957
|
http_res_text = utils.stream_to_text(http_res)
|
|
1039
|
-
raise errors.SDKError(
|
|
1040
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1041
|
-
)
|
|
958
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1042
959
|
|
|
1043
|
-
|
|
1044
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1045
|
-
raise errors.SDKError(
|
|
1046
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1047
|
-
http_res.status_code,
|
|
1048
|
-
http_res_text,
|
|
1049
|
-
http_res,
|
|
1050
|
-
)
|
|
960
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1051
961
|
|
|
1052
962
|
async def delete_async(
|
|
1053
963
|
self,
|
|
@@ -1133,60 +1043,47 @@ class Tags(BaseSDK):
|
|
|
1133
1043
|
|
|
1134
1044
|
response_data: Any = None
|
|
1135
1045
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1136
|
-
return
|
|
1137
|
-
|
|
1046
|
+
return unmarshal_json_response(
|
|
1047
|
+
Optional[operations.DeleteTagResponseBody], http_res
|
|
1138
1048
|
)
|
|
1139
1049
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1140
|
-
response_data =
|
|
1141
|
-
raise errors.BadRequest(
|
|
1050
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
1051
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1142
1052
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1143
|
-
response_data =
|
|
1144
|
-
raise errors.Unauthorized(
|
|
1053
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
1054
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1145
1055
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1146
|
-
response_data =
|
|
1147
|
-
raise errors.Forbidden(
|
|
1056
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
1057
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1148
1058
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1149
|
-
response_data =
|
|
1150
|
-
raise errors.NotFound(
|
|
1059
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1060
|
+
raise errors.NotFound(response_data, http_res)
|
|
1151
1061
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1152
|
-
response_data =
|
|
1153
|
-
raise errors.Conflict(
|
|
1062
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
1063
|
+
raise errors.Conflict(response_data, http_res)
|
|
1154
1064
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1155
|
-
response_data =
|
|
1156
|
-
|
|
1157
|
-
)
|
|
1158
|
-
raise errors.InviteExpired(data=response_data)
|
|
1065
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
1066
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1159
1067
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1160
|
-
response_data =
|
|
1161
|
-
|
|
1068
|
+
response_data = unmarshal_json_response(
|
|
1069
|
+
errors.UnprocessableEntityData, http_res
|
|
1162
1070
|
)
|
|
1163
|
-
raise errors.UnprocessableEntity(
|
|
1071
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1164
1072
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1165
|
-
response_data =
|
|
1166
|
-
|
|
1073
|
+
response_data = unmarshal_json_response(
|
|
1074
|
+
errors.RateLimitExceededData, http_res
|
|
1167
1075
|
)
|
|
1168
|
-
raise errors.RateLimitExceeded(
|
|
1076
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1169
1077
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1170
|
-
response_data =
|
|
1171
|
-
|
|
1078
|
+
response_data = unmarshal_json_response(
|
|
1079
|
+
errors.InternalServerErrorData, http_res
|
|
1172
1080
|
)
|
|
1173
|
-
raise errors.InternalServerError(
|
|
1081
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1174
1082
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1175
1083
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1176
|
-
raise errors.SDKError(
|
|
1177
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1178
|
-
)
|
|
1084
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1179
1085
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1180
1086
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1181
|
-
raise errors.SDKError(
|
|
1182
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1183
|
-
)
|
|
1087
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1184
1088
|
|
|
1185
|
-
|
|
1186
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1187
|
-
raise errors.SDKError(
|
|
1188
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1189
|
-
http_res.status_code,
|
|
1190
|
-
http_res_text,
|
|
1191
|
-
http_res,
|
|
1192
|
-
)
|
|
1089
|
+
raise errors.SDKError("Unexpected response received", http_res)
|