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/tags.py
CHANGED
|
@@ -103,61 +103,58 @@ class Tags(BaseSDK):
|
|
|
103
103
|
|
|
104
104
|
response_data: Any = None
|
|
105
105
|
if utils.match_response(http_res, "201", "application/json"):
|
|
106
|
-
return utils.
|
|
106
|
+
return utils.unmarshal_json_response(
|
|
107
|
+
Optional[components.TagSchema], http_res
|
|
108
|
+
)
|
|
107
109
|
if utils.match_response(http_res, "400", "application/json"):
|
|
108
|
-
response_data = utils.
|
|
109
|
-
|
|
110
|
+
response_data = utils.unmarshal_json_response(
|
|
111
|
+
errors.BadRequestData, http_res
|
|
112
|
+
)
|
|
113
|
+
raise errors.BadRequest(response_data, http_res)
|
|
110
114
|
if utils.match_response(http_res, "401", "application/json"):
|
|
111
|
-
response_data = utils.
|
|
112
|
-
|
|
115
|
+
response_data = utils.unmarshal_json_response(
|
|
116
|
+
errors.UnauthorizedData, http_res
|
|
117
|
+
)
|
|
118
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
113
119
|
if utils.match_response(http_res, "403", "application/json"):
|
|
114
|
-
response_data = utils.
|
|
115
|
-
|
|
120
|
+
response_data = utils.unmarshal_json_response(
|
|
121
|
+
errors.ForbiddenData, http_res
|
|
122
|
+
)
|
|
123
|
+
raise errors.Forbidden(response_data, http_res)
|
|
116
124
|
if utils.match_response(http_res, "404", "application/json"):
|
|
117
|
-
response_data = utils.
|
|
118
|
-
raise errors.NotFound(
|
|
125
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
126
|
+
raise errors.NotFound(response_data, http_res)
|
|
119
127
|
if utils.match_response(http_res, "409", "application/json"):
|
|
120
|
-
response_data = utils.
|
|
121
|
-
raise errors.Conflict(
|
|
128
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
129
|
+
raise errors.Conflict(response_data, http_res)
|
|
122
130
|
if utils.match_response(http_res, "410", "application/json"):
|
|
123
|
-
response_data = utils.
|
|
124
|
-
|
|
131
|
+
response_data = utils.unmarshal_json_response(
|
|
132
|
+
errors.InviteExpiredData, http_res
|
|
125
133
|
)
|
|
126
|
-
raise errors.InviteExpired(
|
|
134
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
127
135
|
if utils.match_response(http_res, "422", "application/json"):
|
|
128
|
-
response_data = utils.
|
|
129
|
-
|
|
136
|
+
response_data = utils.unmarshal_json_response(
|
|
137
|
+
errors.UnprocessableEntityData, http_res
|
|
130
138
|
)
|
|
131
|
-
raise errors.UnprocessableEntity(
|
|
139
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
132
140
|
if utils.match_response(http_res, "429", "application/json"):
|
|
133
|
-
response_data = utils.
|
|
134
|
-
|
|
141
|
+
response_data = utils.unmarshal_json_response(
|
|
142
|
+
errors.RateLimitExceededData, http_res
|
|
135
143
|
)
|
|
136
|
-
raise errors.RateLimitExceeded(
|
|
144
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
137
145
|
if utils.match_response(http_res, "500", "application/json"):
|
|
138
|
-
response_data = utils.
|
|
139
|
-
|
|
146
|
+
response_data = utils.unmarshal_json_response(
|
|
147
|
+
errors.InternalServerErrorData, http_res
|
|
140
148
|
)
|
|
141
|
-
raise errors.InternalServerError(
|
|
149
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
142
150
|
if utils.match_response(http_res, "4XX", "*"):
|
|
143
151
|
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
|
-
)
|
|
152
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
147
153
|
if utils.match_response(http_res, "5XX", "*"):
|
|
148
154
|
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
|
-
)
|
|
155
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
152
156
|
|
|
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
|
-
)
|
|
157
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
161
158
|
|
|
162
159
|
async def create_async(
|
|
163
160
|
self,
|
|
@@ -253,61 +250,58 @@ class Tags(BaseSDK):
|
|
|
253
250
|
|
|
254
251
|
response_data: Any = None
|
|
255
252
|
if utils.match_response(http_res, "201", "application/json"):
|
|
256
|
-
return utils.
|
|
253
|
+
return utils.unmarshal_json_response(
|
|
254
|
+
Optional[components.TagSchema], http_res
|
|
255
|
+
)
|
|
257
256
|
if utils.match_response(http_res, "400", "application/json"):
|
|
258
|
-
response_data = utils.
|
|
259
|
-
|
|
257
|
+
response_data = utils.unmarshal_json_response(
|
|
258
|
+
errors.BadRequestData, http_res
|
|
259
|
+
)
|
|
260
|
+
raise errors.BadRequest(response_data, http_res)
|
|
260
261
|
if utils.match_response(http_res, "401", "application/json"):
|
|
261
|
-
response_data = utils.
|
|
262
|
-
|
|
262
|
+
response_data = utils.unmarshal_json_response(
|
|
263
|
+
errors.UnauthorizedData, http_res
|
|
264
|
+
)
|
|
265
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
263
266
|
if utils.match_response(http_res, "403", "application/json"):
|
|
264
|
-
response_data = utils.
|
|
265
|
-
|
|
267
|
+
response_data = utils.unmarshal_json_response(
|
|
268
|
+
errors.ForbiddenData, http_res
|
|
269
|
+
)
|
|
270
|
+
raise errors.Forbidden(response_data, http_res)
|
|
266
271
|
if utils.match_response(http_res, "404", "application/json"):
|
|
267
|
-
response_data = utils.
|
|
268
|
-
raise errors.NotFound(
|
|
272
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
273
|
+
raise errors.NotFound(response_data, http_res)
|
|
269
274
|
if utils.match_response(http_res, "409", "application/json"):
|
|
270
|
-
response_data = utils.
|
|
271
|
-
raise errors.Conflict(
|
|
275
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
276
|
+
raise errors.Conflict(response_data, http_res)
|
|
272
277
|
if utils.match_response(http_res, "410", "application/json"):
|
|
273
|
-
response_data = utils.
|
|
274
|
-
|
|
278
|
+
response_data = utils.unmarshal_json_response(
|
|
279
|
+
errors.InviteExpiredData, http_res
|
|
275
280
|
)
|
|
276
|
-
raise errors.InviteExpired(
|
|
281
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
277
282
|
if utils.match_response(http_res, "422", "application/json"):
|
|
278
|
-
response_data = utils.
|
|
279
|
-
|
|
283
|
+
response_data = utils.unmarshal_json_response(
|
|
284
|
+
errors.UnprocessableEntityData, http_res
|
|
280
285
|
)
|
|
281
|
-
raise errors.UnprocessableEntity(
|
|
286
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
282
287
|
if utils.match_response(http_res, "429", "application/json"):
|
|
283
|
-
response_data = utils.
|
|
284
|
-
|
|
288
|
+
response_data = utils.unmarshal_json_response(
|
|
289
|
+
errors.RateLimitExceededData, http_res
|
|
285
290
|
)
|
|
286
|
-
raise errors.RateLimitExceeded(
|
|
291
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
287
292
|
if utils.match_response(http_res, "500", "application/json"):
|
|
288
|
-
response_data = utils.
|
|
289
|
-
|
|
293
|
+
response_data = utils.unmarshal_json_response(
|
|
294
|
+
errors.InternalServerErrorData, http_res
|
|
290
295
|
)
|
|
291
|
-
raise errors.InternalServerError(
|
|
296
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
292
297
|
if utils.match_response(http_res, "4XX", "*"):
|
|
293
298
|
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
|
-
)
|
|
299
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
297
300
|
if utils.match_response(http_res, "5XX", "*"):
|
|
298
301
|
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
|
-
)
|
|
302
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
302
303
|
|
|
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
|
-
)
|
|
304
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
311
305
|
|
|
312
306
|
def list(
|
|
313
307
|
self,
|
|
@@ -393,63 +387,58 @@ class Tags(BaseSDK):
|
|
|
393
387
|
|
|
394
388
|
response_data: Any = None
|
|
395
389
|
if utils.match_response(http_res, "200", "application/json"):
|
|
396
|
-
return utils.
|
|
397
|
-
|
|
390
|
+
return utils.unmarshal_json_response(
|
|
391
|
+
Optional[List[components.TagSchema]], http_res
|
|
398
392
|
)
|
|
399
393
|
if utils.match_response(http_res, "400", "application/json"):
|
|
400
|
-
response_data = utils.
|
|
401
|
-
|
|
394
|
+
response_data = utils.unmarshal_json_response(
|
|
395
|
+
errors.BadRequestData, http_res
|
|
396
|
+
)
|
|
397
|
+
raise errors.BadRequest(response_data, http_res)
|
|
402
398
|
if utils.match_response(http_res, "401", "application/json"):
|
|
403
|
-
response_data = utils.
|
|
404
|
-
|
|
399
|
+
response_data = utils.unmarshal_json_response(
|
|
400
|
+
errors.UnauthorizedData, http_res
|
|
401
|
+
)
|
|
402
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
405
403
|
if utils.match_response(http_res, "403", "application/json"):
|
|
406
|
-
response_data = utils.
|
|
407
|
-
|
|
404
|
+
response_data = utils.unmarshal_json_response(
|
|
405
|
+
errors.ForbiddenData, http_res
|
|
406
|
+
)
|
|
407
|
+
raise errors.Forbidden(response_data, http_res)
|
|
408
408
|
if utils.match_response(http_res, "404", "application/json"):
|
|
409
|
-
response_data = utils.
|
|
410
|
-
raise errors.NotFound(
|
|
409
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
410
|
+
raise errors.NotFound(response_data, http_res)
|
|
411
411
|
if utils.match_response(http_res, "409", "application/json"):
|
|
412
|
-
response_data = utils.
|
|
413
|
-
raise errors.Conflict(
|
|
412
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
413
|
+
raise errors.Conflict(response_data, http_res)
|
|
414
414
|
if utils.match_response(http_res, "410", "application/json"):
|
|
415
|
-
response_data = utils.
|
|
416
|
-
|
|
415
|
+
response_data = utils.unmarshal_json_response(
|
|
416
|
+
errors.InviteExpiredData, http_res
|
|
417
417
|
)
|
|
418
|
-
raise errors.InviteExpired(
|
|
418
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
419
419
|
if utils.match_response(http_res, "422", "application/json"):
|
|
420
|
-
response_data = utils.
|
|
421
|
-
|
|
420
|
+
response_data = utils.unmarshal_json_response(
|
|
421
|
+
errors.UnprocessableEntityData, http_res
|
|
422
422
|
)
|
|
423
|
-
raise errors.UnprocessableEntity(
|
|
423
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
424
424
|
if utils.match_response(http_res, "429", "application/json"):
|
|
425
|
-
response_data = utils.
|
|
426
|
-
|
|
425
|
+
response_data = utils.unmarshal_json_response(
|
|
426
|
+
errors.RateLimitExceededData, http_res
|
|
427
427
|
)
|
|
428
|
-
raise errors.RateLimitExceeded(
|
|
428
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
429
429
|
if utils.match_response(http_res, "500", "application/json"):
|
|
430
|
-
response_data = utils.
|
|
431
|
-
|
|
430
|
+
response_data = utils.unmarshal_json_response(
|
|
431
|
+
errors.InternalServerErrorData, http_res
|
|
432
432
|
)
|
|
433
|
-
raise errors.InternalServerError(
|
|
433
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
434
434
|
if utils.match_response(http_res, "4XX", "*"):
|
|
435
435
|
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
|
-
)
|
|
436
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
439
437
|
if utils.match_response(http_res, "5XX", "*"):
|
|
440
438
|
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
|
-
)
|
|
439
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
444
440
|
|
|
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
|
-
)
|
|
441
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
453
442
|
|
|
454
443
|
async def list_async(
|
|
455
444
|
self,
|
|
@@ -535,63 +524,58 @@ class Tags(BaseSDK):
|
|
|
535
524
|
|
|
536
525
|
response_data: Any = None
|
|
537
526
|
if utils.match_response(http_res, "200", "application/json"):
|
|
538
|
-
return utils.
|
|
539
|
-
|
|
527
|
+
return utils.unmarshal_json_response(
|
|
528
|
+
Optional[List[components.TagSchema]], http_res
|
|
540
529
|
)
|
|
541
530
|
if utils.match_response(http_res, "400", "application/json"):
|
|
542
|
-
response_data = utils.
|
|
543
|
-
|
|
531
|
+
response_data = utils.unmarshal_json_response(
|
|
532
|
+
errors.BadRequestData, http_res
|
|
533
|
+
)
|
|
534
|
+
raise errors.BadRequest(response_data, http_res)
|
|
544
535
|
if utils.match_response(http_res, "401", "application/json"):
|
|
545
|
-
response_data = utils.
|
|
546
|
-
|
|
536
|
+
response_data = utils.unmarshal_json_response(
|
|
537
|
+
errors.UnauthorizedData, http_res
|
|
538
|
+
)
|
|
539
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
547
540
|
if utils.match_response(http_res, "403", "application/json"):
|
|
548
|
-
response_data = utils.
|
|
549
|
-
|
|
541
|
+
response_data = utils.unmarshal_json_response(
|
|
542
|
+
errors.ForbiddenData, http_res
|
|
543
|
+
)
|
|
544
|
+
raise errors.Forbidden(response_data, http_res)
|
|
550
545
|
if utils.match_response(http_res, "404", "application/json"):
|
|
551
|
-
response_data = utils.
|
|
552
|
-
raise errors.NotFound(
|
|
546
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
547
|
+
raise errors.NotFound(response_data, http_res)
|
|
553
548
|
if utils.match_response(http_res, "409", "application/json"):
|
|
554
|
-
response_data = utils.
|
|
555
|
-
raise errors.Conflict(
|
|
549
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
550
|
+
raise errors.Conflict(response_data, http_res)
|
|
556
551
|
if utils.match_response(http_res, "410", "application/json"):
|
|
557
|
-
response_data = utils.
|
|
558
|
-
|
|
552
|
+
response_data = utils.unmarshal_json_response(
|
|
553
|
+
errors.InviteExpiredData, http_res
|
|
559
554
|
)
|
|
560
|
-
raise errors.InviteExpired(
|
|
555
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
561
556
|
if utils.match_response(http_res, "422", "application/json"):
|
|
562
|
-
response_data = utils.
|
|
563
|
-
|
|
557
|
+
response_data = utils.unmarshal_json_response(
|
|
558
|
+
errors.UnprocessableEntityData, http_res
|
|
564
559
|
)
|
|
565
|
-
raise errors.UnprocessableEntity(
|
|
560
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
566
561
|
if utils.match_response(http_res, "429", "application/json"):
|
|
567
|
-
response_data = utils.
|
|
568
|
-
|
|
562
|
+
response_data = utils.unmarshal_json_response(
|
|
563
|
+
errors.RateLimitExceededData, http_res
|
|
569
564
|
)
|
|
570
|
-
raise errors.RateLimitExceeded(
|
|
565
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
571
566
|
if utils.match_response(http_res, "500", "application/json"):
|
|
572
|
-
response_data = utils.
|
|
573
|
-
|
|
567
|
+
response_data = utils.unmarshal_json_response(
|
|
568
|
+
errors.InternalServerErrorData, http_res
|
|
574
569
|
)
|
|
575
|
-
raise errors.InternalServerError(
|
|
570
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
576
571
|
if utils.match_response(http_res, "4XX", "*"):
|
|
577
572
|
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
|
-
)
|
|
573
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
581
574
|
if utils.match_response(http_res, "5XX", "*"):
|
|
582
575
|
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
|
-
)
|
|
576
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
586
577
|
|
|
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
|
-
)
|
|
578
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
595
579
|
|
|
596
580
|
def update(
|
|
597
581
|
self,
|
|
@@ -694,61 +678,58 @@ class Tags(BaseSDK):
|
|
|
694
678
|
|
|
695
679
|
response_data: Any = None
|
|
696
680
|
if utils.match_response(http_res, "200", "application/json"):
|
|
697
|
-
return utils.
|
|
681
|
+
return utils.unmarshal_json_response(
|
|
682
|
+
Optional[components.TagSchema], http_res
|
|
683
|
+
)
|
|
698
684
|
if utils.match_response(http_res, "400", "application/json"):
|
|
699
|
-
response_data = utils.
|
|
700
|
-
|
|
685
|
+
response_data = utils.unmarshal_json_response(
|
|
686
|
+
errors.BadRequestData, http_res
|
|
687
|
+
)
|
|
688
|
+
raise errors.BadRequest(response_data, http_res)
|
|
701
689
|
if utils.match_response(http_res, "401", "application/json"):
|
|
702
|
-
response_data = utils.
|
|
703
|
-
|
|
690
|
+
response_data = utils.unmarshal_json_response(
|
|
691
|
+
errors.UnauthorizedData, http_res
|
|
692
|
+
)
|
|
693
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
704
694
|
if utils.match_response(http_res, "403", "application/json"):
|
|
705
|
-
response_data = utils.
|
|
706
|
-
|
|
695
|
+
response_data = utils.unmarshal_json_response(
|
|
696
|
+
errors.ForbiddenData, http_res
|
|
697
|
+
)
|
|
698
|
+
raise errors.Forbidden(response_data, http_res)
|
|
707
699
|
if utils.match_response(http_res, "404", "application/json"):
|
|
708
|
-
response_data = utils.
|
|
709
|
-
raise errors.NotFound(
|
|
700
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
701
|
+
raise errors.NotFound(response_data, http_res)
|
|
710
702
|
if utils.match_response(http_res, "409", "application/json"):
|
|
711
|
-
response_data = utils.
|
|
712
|
-
raise errors.Conflict(
|
|
703
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
704
|
+
raise errors.Conflict(response_data, http_res)
|
|
713
705
|
if utils.match_response(http_res, "410", "application/json"):
|
|
714
|
-
response_data = utils.
|
|
715
|
-
|
|
706
|
+
response_data = utils.unmarshal_json_response(
|
|
707
|
+
errors.InviteExpiredData, http_res
|
|
716
708
|
)
|
|
717
|
-
raise errors.InviteExpired(
|
|
709
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
718
710
|
if utils.match_response(http_res, "422", "application/json"):
|
|
719
|
-
response_data = utils.
|
|
720
|
-
|
|
711
|
+
response_data = utils.unmarshal_json_response(
|
|
712
|
+
errors.UnprocessableEntityData, http_res
|
|
721
713
|
)
|
|
722
|
-
raise errors.UnprocessableEntity(
|
|
714
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
723
715
|
if utils.match_response(http_res, "429", "application/json"):
|
|
724
|
-
response_data = utils.
|
|
725
|
-
|
|
716
|
+
response_data = utils.unmarshal_json_response(
|
|
717
|
+
errors.RateLimitExceededData, http_res
|
|
726
718
|
)
|
|
727
|
-
raise errors.RateLimitExceeded(
|
|
719
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
728
720
|
if utils.match_response(http_res, "500", "application/json"):
|
|
729
|
-
response_data = utils.
|
|
730
|
-
|
|
721
|
+
response_data = utils.unmarshal_json_response(
|
|
722
|
+
errors.InternalServerErrorData, http_res
|
|
731
723
|
)
|
|
732
|
-
raise errors.InternalServerError(
|
|
724
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
733
725
|
if utils.match_response(http_res, "4XX", "*"):
|
|
734
726
|
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
|
-
)
|
|
727
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
738
728
|
if utils.match_response(http_res, "5XX", "*"):
|
|
739
729
|
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
|
-
)
|
|
730
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
743
731
|
|
|
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
|
-
)
|
|
732
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
752
733
|
|
|
753
734
|
async def update_async(
|
|
754
735
|
self,
|
|
@@ -851,61 +832,58 @@ class Tags(BaseSDK):
|
|
|
851
832
|
|
|
852
833
|
response_data: Any = None
|
|
853
834
|
if utils.match_response(http_res, "200", "application/json"):
|
|
854
|
-
return utils.
|
|
835
|
+
return utils.unmarshal_json_response(
|
|
836
|
+
Optional[components.TagSchema], http_res
|
|
837
|
+
)
|
|
855
838
|
if utils.match_response(http_res, "400", "application/json"):
|
|
856
|
-
response_data = utils.
|
|
857
|
-
|
|
839
|
+
response_data = utils.unmarshal_json_response(
|
|
840
|
+
errors.BadRequestData, http_res
|
|
841
|
+
)
|
|
842
|
+
raise errors.BadRequest(response_data, http_res)
|
|
858
843
|
if utils.match_response(http_res, "401", "application/json"):
|
|
859
|
-
response_data = utils.
|
|
860
|
-
|
|
844
|
+
response_data = utils.unmarshal_json_response(
|
|
845
|
+
errors.UnauthorizedData, http_res
|
|
846
|
+
)
|
|
847
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
861
848
|
if utils.match_response(http_res, "403", "application/json"):
|
|
862
|
-
response_data = utils.
|
|
863
|
-
|
|
849
|
+
response_data = utils.unmarshal_json_response(
|
|
850
|
+
errors.ForbiddenData, http_res
|
|
851
|
+
)
|
|
852
|
+
raise errors.Forbidden(response_data, http_res)
|
|
864
853
|
if utils.match_response(http_res, "404", "application/json"):
|
|
865
|
-
response_data = utils.
|
|
866
|
-
raise errors.NotFound(
|
|
854
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
855
|
+
raise errors.NotFound(response_data, http_res)
|
|
867
856
|
if utils.match_response(http_res, "409", "application/json"):
|
|
868
|
-
response_data = utils.
|
|
869
|
-
raise errors.Conflict(
|
|
857
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
858
|
+
raise errors.Conflict(response_data, http_res)
|
|
870
859
|
if utils.match_response(http_res, "410", "application/json"):
|
|
871
|
-
response_data = utils.
|
|
872
|
-
|
|
860
|
+
response_data = utils.unmarshal_json_response(
|
|
861
|
+
errors.InviteExpiredData, http_res
|
|
873
862
|
)
|
|
874
|
-
raise errors.InviteExpired(
|
|
863
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
875
864
|
if utils.match_response(http_res, "422", "application/json"):
|
|
876
|
-
response_data = utils.
|
|
877
|
-
|
|
865
|
+
response_data = utils.unmarshal_json_response(
|
|
866
|
+
errors.UnprocessableEntityData, http_res
|
|
878
867
|
)
|
|
879
|
-
raise errors.UnprocessableEntity(
|
|
868
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
880
869
|
if utils.match_response(http_res, "429", "application/json"):
|
|
881
|
-
response_data = utils.
|
|
882
|
-
|
|
870
|
+
response_data = utils.unmarshal_json_response(
|
|
871
|
+
errors.RateLimitExceededData, http_res
|
|
883
872
|
)
|
|
884
|
-
raise errors.RateLimitExceeded(
|
|
873
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
885
874
|
if utils.match_response(http_res, "500", "application/json"):
|
|
886
|
-
response_data = utils.
|
|
887
|
-
|
|
875
|
+
response_data = utils.unmarshal_json_response(
|
|
876
|
+
errors.InternalServerErrorData, http_res
|
|
888
877
|
)
|
|
889
|
-
raise errors.InternalServerError(
|
|
878
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
890
879
|
if utils.match_response(http_res, "4XX", "*"):
|
|
891
880
|
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
|
-
)
|
|
881
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
895
882
|
if utils.match_response(http_res, "5XX", "*"):
|
|
896
883
|
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
|
-
)
|
|
884
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
900
885
|
|
|
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
|
-
)
|
|
886
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
909
887
|
|
|
910
888
|
def delete(
|
|
911
889
|
self,
|
|
@@ -991,63 +969,58 @@ class Tags(BaseSDK):
|
|
|
991
969
|
|
|
992
970
|
response_data: Any = None
|
|
993
971
|
if utils.match_response(http_res, "200", "application/json"):
|
|
994
|
-
return utils.
|
|
995
|
-
|
|
972
|
+
return utils.unmarshal_json_response(
|
|
973
|
+
Optional[operations.DeleteTagResponseBody], http_res
|
|
996
974
|
)
|
|
997
975
|
if utils.match_response(http_res, "400", "application/json"):
|
|
998
|
-
response_data = utils.
|
|
999
|
-
|
|
976
|
+
response_data = utils.unmarshal_json_response(
|
|
977
|
+
errors.BadRequestData, http_res
|
|
978
|
+
)
|
|
979
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1000
980
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1001
|
-
response_data = utils.
|
|
1002
|
-
|
|
981
|
+
response_data = utils.unmarshal_json_response(
|
|
982
|
+
errors.UnauthorizedData, http_res
|
|
983
|
+
)
|
|
984
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1003
985
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1004
|
-
response_data = utils.
|
|
1005
|
-
|
|
986
|
+
response_data = utils.unmarshal_json_response(
|
|
987
|
+
errors.ForbiddenData, http_res
|
|
988
|
+
)
|
|
989
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1006
990
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1007
|
-
response_data = utils.
|
|
1008
|
-
raise errors.NotFound(
|
|
991
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
992
|
+
raise errors.NotFound(response_data, http_res)
|
|
1009
993
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1010
|
-
response_data = utils.
|
|
1011
|
-
raise errors.Conflict(
|
|
994
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
995
|
+
raise errors.Conflict(response_data, http_res)
|
|
1012
996
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1013
|
-
response_data = utils.
|
|
1014
|
-
|
|
997
|
+
response_data = utils.unmarshal_json_response(
|
|
998
|
+
errors.InviteExpiredData, http_res
|
|
1015
999
|
)
|
|
1016
|
-
raise errors.InviteExpired(
|
|
1000
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1017
1001
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1018
|
-
response_data = utils.
|
|
1019
|
-
|
|
1002
|
+
response_data = utils.unmarshal_json_response(
|
|
1003
|
+
errors.UnprocessableEntityData, http_res
|
|
1020
1004
|
)
|
|
1021
|
-
raise errors.UnprocessableEntity(
|
|
1005
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1022
1006
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1023
|
-
response_data = utils.
|
|
1024
|
-
|
|
1007
|
+
response_data = utils.unmarshal_json_response(
|
|
1008
|
+
errors.RateLimitExceededData, http_res
|
|
1025
1009
|
)
|
|
1026
|
-
raise errors.RateLimitExceeded(
|
|
1010
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1027
1011
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1028
|
-
response_data = utils.
|
|
1029
|
-
|
|
1012
|
+
response_data = utils.unmarshal_json_response(
|
|
1013
|
+
errors.InternalServerErrorData, http_res
|
|
1030
1014
|
)
|
|
1031
|
-
raise errors.InternalServerError(
|
|
1015
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1032
1016
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1033
1017
|
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
|
-
)
|
|
1018
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1037
1019
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1038
1020
|
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
|
-
)
|
|
1021
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1042
1022
|
|
|
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
|
-
)
|
|
1023
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1051
1024
|
|
|
1052
1025
|
async def delete_async(
|
|
1053
1026
|
self,
|
|
@@ -1133,60 +1106,55 @@ class Tags(BaseSDK):
|
|
|
1133
1106
|
|
|
1134
1107
|
response_data: Any = None
|
|
1135
1108
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1136
|
-
return utils.
|
|
1137
|
-
|
|
1109
|
+
return utils.unmarshal_json_response(
|
|
1110
|
+
Optional[operations.DeleteTagResponseBody], http_res
|
|
1138
1111
|
)
|
|
1139
1112
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1140
|
-
response_data = utils.
|
|
1141
|
-
|
|
1113
|
+
response_data = utils.unmarshal_json_response(
|
|
1114
|
+
errors.BadRequestData, http_res
|
|
1115
|
+
)
|
|
1116
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1142
1117
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1143
|
-
response_data = utils.
|
|
1144
|
-
|
|
1118
|
+
response_data = utils.unmarshal_json_response(
|
|
1119
|
+
errors.UnauthorizedData, http_res
|
|
1120
|
+
)
|
|
1121
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1145
1122
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1146
|
-
response_data = utils.
|
|
1147
|
-
|
|
1123
|
+
response_data = utils.unmarshal_json_response(
|
|
1124
|
+
errors.ForbiddenData, http_res
|
|
1125
|
+
)
|
|
1126
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1148
1127
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1149
|
-
response_data = utils.
|
|
1150
|
-
raise errors.NotFound(
|
|
1128
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1129
|
+
raise errors.NotFound(response_data, http_res)
|
|
1151
1130
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1152
|
-
response_data = utils.
|
|
1153
|
-
raise errors.Conflict(
|
|
1131
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
1132
|
+
raise errors.Conflict(response_data, http_res)
|
|
1154
1133
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1155
|
-
response_data = utils.
|
|
1156
|
-
|
|
1134
|
+
response_data = utils.unmarshal_json_response(
|
|
1135
|
+
errors.InviteExpiredData, http_res
|
|
1157
1136
|
)
|
|
1158
|
-
raise errors.InviteExpired(
|
|
1137
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1159
1138
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1160
|
-
response_data = utils.
|
|
1161
|
-
|
|
1139
|
+
response_data = utils.unmarshal_json_response(
|
|
1140
|
+
errors.UnprocessableEntityData, http_res
|
|
1162
1141
|
)
|
|
1163
|
-
raise errors.UnprocessableEntity(
|
|
1142
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1164
1143
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1165
|
-
response_data = utils.
|
|
1166
|
-
|
|
1144
|
+
response_data = utils.unmarshal_json_response(
|
|
1145
|
+
errors.RateLimitExceededData, http_res
|
|
1167
1146
|
)
|
|
1168
|
-
raise errors.RateLimitExceeded(
|
|
1147
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1169
1148
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1170
|
-
response_data = utils.
|
|
1171
|
-
|
|
1149
|
+
response_data = utils.unmarshal_json_response(
|
|
1150
|
+
errors.InternalServerErrorData, http_res
|
|
1172
1151
|
)
|
|
1173
|
-
raise errors.InternalServerError(
|
|
1152
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1174
1153
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1175
1154
|
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
|
-
)
|
|
1155
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1179
1156
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1180
1157
|
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
|
-
)
|
|
1158
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1184
1159
|
|
|
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
|
-
)
|
|
1160
|
+
raise errors.SDKError("Unexpected response received", http_res)
|