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/folders.py
CHANGED
|
@@ -107,63 +107,58 @@ class Folders(BaseSDK):
|
|
|
107
107
|
|
|
108
108
|
response_data: Any = None
|
|
109
109
|
if utils.match_response(http_res, "201", "application/json"):
|
|
110
|
-
return utils.
|
|
111
|
-
|
|
110
|
+
return utils.unmarshal_json_response(
|
|
111
|
+
Optional[components.FolderSchema], http_res
|
|
112
112
|
)
|
|
113
113
|
if utils.match_response(http_res, "400", "application/json"):
|
|
114
|
-
response_data = utils.
|
|
115
|
-
|
|
114
|
+
response_data = utils.unmarshal_json_response(
|
|
115
|
+
errors.BadRequestData, http_res
|
|
116
|
+
)
|
|
117
|
+
raise errors.BadRequest(response_data, http_res)
|
|
116
118
|
if utils.match_response(http_res, "401", "application/json"):
|
|
117
|
-
response_data = utils.
|
|
118
|
-
|
|
119
|
+
response_data = utils.unmarshal_json_response(
|
|
120
|
+
errors.UnauthorizedData, http_res
|
|
121
|
+
)
|
|
122
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
119
123
|
if utils.match_response(http_res, "403", "application/json"):
|
|
120
|
-
response_data = utils.
|
|
121
|
-
|
|
124
|
+
response_data = utils.unmarshal_json_response(
|
|
125
|
+
errors.ForbiddenData, http_res
|
|
126
|
+
)
|
|
127
|
+
raise errors.Forbidden(response_data, http_res)
|
|
122
128
|
if utils.match_response(http_res, "404", "application/json"):
|
|
123
|
-
response_data = utils.
|
|
124
|
-
raise errors.NotFound(
|
|
129
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
130
|
+
raise errors.NotFound(response_data, http_res)
|
|
125
131
|
if utils.match_response(http_res, "409", "application/json"):
|
|
126
|
-
response_data = utils.
|
|
127
|
-
raise errors.Conflict(
|
|
132
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
133
|
+
raise errors.Conflict(response_data, http_res)
|
|
128
134
|
if utils.match_response(http_res, "410", "application/json"):
|
|
129
|
-
response_data = utils.
|
|
130
|
-
|
|
135
|
+
response_data = utils.unmarshal_json_response(
|
|
136
|
+
errors.InviteExpiredData, http_res
|
|
131
137
|
)
|
|
132
|
-
raise errors.InviteExpired(
|
|
138
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
133
139
|
if utils.match_response(http_res, "422", "application/json"):
|
|
134
|
-
response_data = utils.
|
|
135
|
-
|
|
140
|
+
response_data = utils.unmarshal_json_response(
|
|
141
|
+
errors.UnprocessableEntityData, http_res
|
|
136
142
|
)
|
|
137
|
-
raise errors.UnprocessableEntity(
|
|
143
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
138
144
|
if utils.match_response(http_res, "429", "application/json"):
|
|
139
|
-
response_data = utils.
|
|
140
|
-
|
|
145
|
+
response_data = utils.unmarshal_json_response(
|
|
146
|
+
errors.RateLimitExceededData, http_res
|
|
141
147
|
)
|
|
142
|
-
raise errors.RateLimitExceeded(
|
|
148
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
143
149
|
if utils.match_response(http_res, "500", "application/json"):
|
|
144
|
-
response_data = utils.
|
|
145
|
-
|
|
150
|
+
response_data = utils.unmarshal_json_response(
|
|
151
|
+
errors.InternalServerErrorData, http_res
|
|
146
152
|
)
|
|
147
|
-
raise errors.InternalServerError(
|
|
153
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
148
154
|
if utils.match_response(http_res, "4XX", "*"):
|
|
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
|
if utils.match_response(http_res, "5XX", "*"):
|
|
154
158
|
http_res_text = utils.stream_to_text(http_res)
|
|
155
|
-
raise errors.SDKError(
|
|
156
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
157
|
-
)
|
|
159
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
158
160
|
|
|
159
|
-
|
|
160
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
161
|
-
raise errors.SDKError(
|
|
162
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
163
|
-
http_res.status_code,
|
|
164
|
-
http_res_text,
|
|
165
|
-
http_res,
|
|
166
|
-
)
|
|
161
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
167
162
|
|
|
168
163
|
async def create_async(
|
|
169
164
|
self,
|
|
@@ -263,63 +258,58 @@ class Folders(BaseSDK):
|
|
|
263
258
|
|
|
264
259
|
response_data: Any = None
|
|
265
260
|
if utils.match_response(http_res, "201", "application/json"):
|
|
266
|
-
return utils.
|
|
267
|
-
|
|
261
|
+
return utils.unmarshal_json_response(
|
|
262
|
+
Optional[components.FolderSchema], http_res
|
|
268
263
|
)
|
|
269
264
|
if utils.match_response(http_res, "400", "application/json"):
|
|
270
|
-
response_data = utils.
|
|
271
|
-
|
|
265
|
+
response_data = utils.unmarshal_json_response(
|
|
266
|
+
errors.BadRequestData, http_res
|
|
267
|
+
)
|
|
268
|
+
raise errors.BadRequest(response_data, http_res)
|
|
272
269
|
if utils.match_response(http_res, "401", "application/json"):
|
|
273
|
-
response_data = utils.
|
|
274
|
-
|
|
270
|
+
response_data = utils.unmarshal_json_response(
|
|
271
|
+
errors.UnauthorizedData, http_res
|
|
272
|
+
)
|
|
273
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
275
274
|
if utils.match_response(http_res, "403", "application/json"):
|
|
276
|
-
response_data = utils.
|
|
277
|
-
|
|
275
|
+
response_data = utils.unmarshal_json_response(
|
|
276
|
+
errors.ForbiddenData, http_res
|
|
277
|
+
)
|
|
278
|
+
raise errors.Forbidden(response_data, http_res)
|
|
278
279
|
if utils.match_response(http_res, "404", "application/json"):
|
|
279
|
-
response_data = utils.
|
|
280
|
-
raise errors.NotFound(
|
|
280
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
281
|
+
raise errors.NotFound(response_data, http_res)
|
|
281
282
|
if utils.match_response(http_res, "409", "application/json"):
|
|
282
|
-
response_data = utils.
|
|
283
|
-
raise errors.Conflict(
|
|
283
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
284
|
+
raise errors.Conflict(response_data, http_res)
|
|
284
285
|
if utils.match_response(http_res, "410", "application/json"):
|
|
285
|
-
response_data = utils.
|
|
286
|
-
|
|
286
|
+
response_data = utils.unmarshal_json_response(
|
|
287
|
+
errors.InviteExpiredData, http_res
|
|
287
288
|
)
|
|
288
|
-
raise errors.InviteExpired(
|
|
289
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
289
290
|
if utils.match_response(http_res, "422", "application/json"):
|
|
290
|
-
response_data = utils.
|
|
291
|
-
|
|
291
|
+
response_data = utils.unmarshal_json_response(
|
|
292
|
+
errors.UnprocessableEntityData, http_res
|
|
292
293
|
)
|
|
293
|
-
raise errors.UnprocessableEntity(
|
|
294
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
294
295
|
if utils.match_response(http_res, "429", "application/json"):
|
|
295
|
-
response_data = utils.
|
|
296
|
-
|
|
296
|
+
response_data = utils.unmarshal_json_response(
|
|
297
|
+
errors.RateLimitExceededData, http_res
|
|
297
298
|
)
|
|
298
|
-
raise errors.RateLimitExceeded(
|
|
299
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
299
300
|
if utils.match_response(http_res, "500", "application/json"):
|
|
300
|
-
response_data = utils.
|
|
301
|
-
|
|
301
|
+
response_data = utils.unmarshal_json_response(
|
|
302
|
+
errors.InternalServerErrorData, http_res
|
|
302
303
|
)
|
|
303
|
-
raise errors.InternalServerError(
|
|
304
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
304
305
|
if utils.match_response(http_res, "4XX", "*"):
|
|
305
306
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
306
|
-
raise errors.SDKError(
|
|
307
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
308
|
-
)
|
|
307
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
309
308
|
if utils.match_response(http_res, "5XX", "*"):
|
|
310
309
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
311
|
-
raise errors.SDKError(
|
|
312
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
313
|
-
)
|
|
310
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
314
311
|
|
|
315
|
-
|
|
316
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
317
|
-
raise errors.SDKError(
|
|
318
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
319
|
-
http_res.status_code,
|
|
320
|
-
http_res_text,
|
|
321
|
-
http_res,
|
|
322
|
-
)
|
|
312
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
323
313
|
|
|
324
314
|
def list(
|
|
325
315
|
self,
|
|
@@ -407,63 +397,58 @@ class Folders(BaseSDK):
|
|
|
407
397
|
|
|
408
398
|
response_data: Any = None
|
|
409
399
|
if utils.match_response(http_res, "200", "application/json"):
|
|
410
|
-
return utils.
|
|
411
|
-
|
|
400
|
+
return utils.unmarshal_json_response(
|
|
401
|
+
Optional[List[components.FolderSchema]], http_res
|
|
412
402
|
)
|
|
413
403
|
if utils.match_response(http_res, "400", "application/json"):
|
|
414
|
-
response_data = utils.
|
|
415
|
-
|
|
404
|
+
response_data = utils.unmarshal_json_response(
|
|
405
|
+
errors.BadRequestData, http_res
|
|
406
|
+
)
|
|
407
|
+
raise errors.BadRequest(response_data, http_res)
|
|
416
408
|
if utils.match_response(http_res, "401", "application/json"):
|
|
417
|
-
response_data = utils.
|
|
418
|
-
|
|
409
|
+
response_data = utils.unmarshal_json_response(
|
|
410
|
+
errors.UnauthorizedData, http_res
|
|
411
|
+
)
|
|
412
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
419
413
|
if utils.match_response(http_res, "403", "application/json"):
|
|
420
|
-
response_data = utils.
|
|
421
|
-
|
|
414
|
+
response_data = utils.unmarshal_json_response(
|
|
415
|
+
errors.ForbiddenData, http_res
|
|
416
|
+
)
|
|
417
|
+
raise errors.Forbidden(response_data, http_res)
|
|
422
418
|
if utils.match_response(http_res, "404", "application/json"):
|
|
423
|
-
response_data = utils.
|
|
424
|
-
raise errors.NotFound(
|
|
419
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
420
|
+
raise errors.NotFound(response_data, http_res)
|
|
425
421
|
if utils.match_response(http_res, "409", "application/json"):
|
|
426
|
-
response_data = utils.
|
|
427
|
-
raise errors.Conflict(
|
|
422
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
423
|
+
raise errors.Conflict(response_data, http_res)
|
|
428
424
|
if utils.match_response(http_res, "410", "application/json"):
|
|
429
|
-
response_data = utils.
|
|
430
|
-
|
|
425
|
+
response_data = utils.unmarshal_json_response(
|
|
426
|
+
errors.InviteExpiredData, http_res
|
|
431
427
|
)
|
|
432
|
-
raise errors.InviteExpired(
|
|
428
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
433
429
|
if utils.match_response(http_res, "422", "application/json"):
|
|
434
|
-
response_data = utils.
|
|
435
|
-
|
|
430
|
+
response_data = utils.unmarshal_json_response(
|
|
431
|
+
errors.UnprocessableEntityData, http_res
|
|
436
432
|
)
|
|
437
|
-
raise errors.UnprocessableEntity(
|
|
433
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
438
434
|
if utils.match_response(http_res, "429", "application/json"):
|
|
439
|
-
response_data = utils.
|
|
440
|
-
|
|
435
|
+
response_data = utils.unmarshal_json_response(
|
|
436
|
+
errors.RateLimitExceededData, http_res
|
|
441
437
|
)
|
|
442
|
-
raise errors.RateLimitExceeded(
|
|
438
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
443
439
|
if utils.match_response(http_res, "500", "application/json"):
|
|
444
|
-
response_data = utils.
|
|
445
|
-
|
|
440
|
+
response_data = utils.unmarshal_json_response(
|
|
441
|
+
errors.InternalServerErrorData, http_res
|
|
446
442
|
)
|
|
447
|
-
raise errors.InternalServerError(
|
|
443
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
448
444
|
if utils.match_response(http_res, "4XX", "*"):
|
|
449
445
|
http_res_text = utils.stream_to_text(http_res)
|
|
450
|
-
raise errors.SDKError(
|
|
451
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
452
|
-
)
|
|
446
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
453
447
|
if utils.match_response(http_res, "5XX", "*"):
|
|
454
448
|
http_res_text = utils.stream_to_text(http_res)
|
|
455
|
-
raise errors.SDKError(
|
|
456
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
457
|
-
)
|
|
449
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
458
450
|
|
|
459
|
-
|
|
460
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
461
|
-
raise errors.SDKError(
|
|
462
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
463
|
-
http_res.status_code,
|
|
464
|
-
http_res_text,
|
|
465
|
-
http_res,
|
|
466
|
-
)
|
|
451
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
467
452
|
|
|
468
453
|
async def list_async(
|
|
469
454
|
self,
|
|
@@ -551,63 +536,58 @@ class Folders(BaseSDK):
|
|
|
551
536
|
|
|
552
537
|
response_data: Any = None
|
|
553
538
|
if utils.match_response(http_res, "200", "application/json"):
|
|
554
|
-
return utils.
|
|
555
|
-
|
|
539
|
+
return utils.unmarshal_json_response(
|
|
540
|
+
Optional[List[components.FolderSchema]], http_res
|
|
556
541
|
)
|
|
557
542
|
if utils.match_response(http_res, "400", "application/json"):
|
|
558
|
-
response_data = utils.
|
|
559
|
-
|
|
543
|
+
response_data = utils.unmarshal_json_response(
|
|
544
|
+
errors.BadRequestData, http_res
|
|
545
|
+
)
|
|
546
|
+
raise errors.BadRequest(response_data, http_res)
|
|
560
547
|
if utils.match_response(http_res, "401", "application/json"):
|
|
561
|
-
response_data = utils.
|
|
562
|
-
|
|
548
|
+
response_data = utils.unmarshal_json_response(
|
|
549
|
+
errors.UnauthorizedData, http_res
|
|
550
|
+
)
|
|
551
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
563
552
|
if utils.match_response(http_res, "403", "application/json"):
|
|
564
|
-
response_data = utils.
|
|
565
|
-
|
|
553
|
+
response_data = utils.unmarshal_json_response(
|
|
554
|
+
errors.ForbiddenData, http_res
|
|
555
|
+
)
|
|
556
|
+
raise errors.Forbidden(response_data, http_res)
|
|
566
557
|
if utils.match_response(http_res, "404", "application/json"):
|
|
567
|
-
response_data = utils.
|
|
568
|
-
raise errors.NotFound(
|
|
558
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
559
|
+
raise errors.NotFound(response_data, http_res)
|
|
569
560
|
if utils.match_response(http_res, "409", "application/json"):
|
|
570
|
-
response_data = utils.
|
|
571
|
-
raise errors.Conflict(
|
|
561
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
562
|
+
raise errors.Conflict(response_data, http_res)
|
|
572
563
|
if utils.match_response(http_res, "410", "application/json"):
|
|
573
|
-
response_data = utils.
|
|
574
|
-
|
|
564
|
+
response_data = utils.unmarshal_json_response(
|
|
565
|
+
errors.InviteExpiredData, http_res
|
|
575
566
|
)
|
|
576
|
-
raise errors.InviteExpired(
|
|
567
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
577
568
|
if utils.match_response(http_res, "422", "application/json"):
|
|
578
|
-
response_data = utils.
|
|
579
|
-
|
|
569
|
+
response_data = utils.unmarshal_json_response(
|
|
570
|
+
errors.UnprocessableEntityData, http_res
|
|
580
571
|
)
|
|
581
|
-
raise errors.UnprocessableEntity(
|
|
572
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
582
573
|
if utils.match_response(http_res, "429", "application/json"):
|
|
583
|
-
response_data = utils.
|
|
584
|
-
|
|
574
|
+
response_data = utils.unmarshal_json_response(
|
|
575
|
+
errors.RateLimitExceededData, http_res
|
|
585
576
|
)
|
|
586
|
-
raise errors.RateLimitExceeded(
|
|
577
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
587
578
|
if utils.match_response(http_res, "500", "application/json"):
|
|
588
|
-
response_data = utils.
|
|
589
|
-
|
|
579
|
+
response_data = utils.unmarshal_json_response(
|
|
580
|
+
errors.InternalServerErrorData, http_res
|
|
590
581
|
)
|
|
591
|
-
raise errors.InternalServerError(
|
|
582
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
592
583
|
if utils.match_response(http_res, "4XX", "*"):
|
|
593
584
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
594
|
-
raise errors.SDKError(
|
|
595
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
596
|
-
)
|
|
585
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
597
586
|
if utils.match_response(http_res, "5XX", "*"):
|
|
598
587
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
599
|
-
raise errors.SDKError(
|
|
600
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
601
|
-
)
|
|
588
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
602
589
|
|
|
603
|
-
|
|
604
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
605
|
-
raise errors.SDKError(
|
|
606
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
607
|
-
http_res.status_code,
|
|
608
|
-
http_res_text,
|
|
609
|
-
http_res,
|
|
610
|
-
)
|
|
590
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
611
591
|
|
|
612
592
|
def update(
|
|
613
593
|
self,
|
|
@@ -710,63 +690,58 @@ class Folders(BaseSDK):
|
|
|
710
690
|
|
|
711
691
|
response_data: Any = None
|
|
712
692
|
if utils.match_response(http_res, "200", "application/json"):
|
|
713
|
-
return utils.
|
|
714
|
-
|
|
693
|
+
return utils.unmarshal_json_response(
|
|
694
|
+
Optional[components.FolderSchema], http_res
|
|
715
695
|
)
|
|
716
696
|
if utils.match_response(http_res, "400", "application/json"):
|
|
717
|
-
response_data = utils.
|
|
718
|
-
|
|
697
|
+
response_data = utils.unmarshal_json_response(
|
|
698
|
+
errors.BadRequestData, http_res
|
|
699
|
+
)
|
|
700
|
+
raise errors.BadRequest(response_data, http_res)
|
|
719
701
|
if utils.match_response(http_res, "401", "application/json"):
|
|
720
|
-
response_data = utils.
|
|
721
|
-
|
|
702
|
+
response_data = utils.unmarshal_json_response(
|
|
703
|
+
errors.UnauthorizedData, http_res
|
|
704
|
+
)
|
|
705
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
722
706
|
if utils.match_response(http_res, "403", "application/json"):
|
|
723
|
-
response_data = utils.
|
|
724
|
-
|
|
707
|
+
response_data = utils.unmarshal_json_response(
|
|
708
|
+
errors.ForbiddenData, http_res
|
|
709
|
+
)
|
|
710
|
+
raise errors.Forbidden(response_data, http_res)
|
|
725
711
|
if utils.match_response(http_res, "404", "application/json"):
|
|
726
|
-
response_data = utils.
|
|
727
|
-
raise errors.NotFound(
|
|
712
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
713
|
+
raise errors.NotFound(response_data, http_res)
|
|
728
714
|
if utils.match_response(http_res, "409", "application/json"):
|
|
729
|
-
response_data = utils.
|
|
730
|
-
raise errors.Conflict(
|
|
715
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
716
|
+
raise errors.Conflict(response_data, http_res)
|
|
731
717
|
if utils.match_response(http_res, "410", "application/json"):
|
|
732
|
-
response_data = utils.
|
|
733
|
-
|
|
718
|
+
response_data = utils.unmarshal_json_response(
|
|
719
|
+
errors.InviteExpiredData, http_res
|
|
734
720
|
)
|
|
735
|
-
raise errors.InviteExpired(
|
|
721
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
736
722
|
if utils.match_response(http_res, "422", "application/json"):
|
|
737
|
-
response_data = utils.
|
|
738
|
-
|
|
723
|
+
response_data = utils.unmarshal_json_response(
|
|
724
|
+
errors.UnprocessableEntityData, http_res
|
|
739
725
|
)
|
|
740
|
-
raise errors.UnprocessableEntity(
|
|
726
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
741
727
|
if utils.match_response(http_res, "429", "application/json"):
|
|
742
|
-
response_data = utils.
|
|
743
|
-
|
|
728
|
+
response_data = utils.unmarshal_json_response(
|
|
729
|
+
errors.RateLimitExceededData, http_res
|
|
744
730
|
)
|
|
745
|
-
raise errors.RateLimitExceeded(
|
|
731
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
746
732
|
if utils.match_response(http_res, "500", "application/json"):
|
|
747
|
-
response_data = utils.
|
|
748
|
-
|
|
733
|
+
response_data = utils.unmarshal_json_response(
|
|
734
|
+
errors.InternalServerErrorData, http_res
|
|
749
735
|
)
|
|
750
|
-
raise errors.InternalServerError(
|
|
736
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
751
737
|
if utils.match_response(http_res, "4XX", "*"):
|
|
752
738
|
http_res_text = utils.stream_to_text(http_res)
|
|
753
|
-
raise errors.SDKError(
|
|
754
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
755
|
-
)
|
|
739
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
756
740
|
if utils.match_response(http_res, "5XX", "*"):
|
|
757
741
|
http_res_text = utils.stream_to_text(http_res)
|
|
758
|
-
raise errors.SDKError(
|
|
759
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
760
|
-
)
|
|
742
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
761
743
|
|
|
762
|
-
|
|
763
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
764
|
-
raise errors.SDKError(
|
|
765
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
766
|
-
http_res.status_code,
|
|
767
|
-
http_res_text,
|
|
768
|
-
http_res,
|
|
769
|
-
)
|
|
744
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
770
745
|
|
|
771
746
|
async def update_async(
|
|
772
747
|
self,
|
|
@@ -869,63 +844,58 @@ class Folders(BaseSDK):
|
|
|
869
844
|
|
|
870
845
|
response_data: Any = None
|
|
871
846
|
if utils.match_response(http_res, "200", "application/json"):
|
|
872
|
-
return utils.
|
|
873
|
-
|
|
847
|
+
return utils.unmarshal_json_response(
|
|
848
|
+
Optional[components.FolderSchema], http_res
|
|
874
849
|
)
|
|
875
850
|
if utils.match_response(http_res, "400", "application/json"):
|
|
876
|
-
response_data = utils.
|
|
877
|
-
|
|
851
|
+
response_data = utils.unmarshal_json_response(
|
|
852
|
+
errors.BadRequestData, http_res
|
|
853
|
+
)
|
|
854
|
+
raise errors.BadRequest(response_data, http_res)
|
|
878
855
|
if utils.match_response(http_res, "401", "application/json"):
|
|
879
|
-
response_data = utils.
|
|
880
|
-
|
|
856
|
+
response_data = utils.unmarshal_json_response(
|
|
857
|
+
errors.UnauthorizedData, http_res
|
|
858
|
+
)
|
|
859
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
881
860
|
if utils.match_response(http_res, "403", "application/json"):
|
|
882
|
-
response_data = utils.
|
|
883
|
-
|
|
861
|
+
response_data = utils.unmarshal_json_response(
|
|
862
|
+
errors.ForbiddenData, http_res
|
|
863
|
+
)
|
|
864
|
+
raise errors.Forbidden(response_data, http_res)
|
|
884
865
|
if utils.match_response(http_res, "404", "application/json"):
|
|
885
|
-
response_data = utils.
|
|
886
|
-
raise errors.NotFound(
|
|
866
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
867
|
+
raise errors.NotFound(response_data, http_res)
|
|
887
868
|
if utils.match_response(http_res, "409", "application/json"):
|
|
888
|
-
response_data = utils.
|
|
889
|
-
raise errors.Conflict(
|
|
869
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
870
|
+
raise errors.Conflict(response_data, http_res)
|
|
890
871
|
if utils.match_response(http_res, "410", "application/json"):
|
|
891
|
-
response_data = utils.
|
|
892
|
-
|
|
872
|
+
response_data = utils.unmarshal_json_response(
|
|
873
|
+
errors.InviteExpiredData, http_res
|
|
893
874
|
)
|
|
894
|
-
raise errors.InviteExpired(
|
|
875
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
895
876
|
if utils.match_response(http_res, "422", "application/json"):
|
|
896
|
-
response_data = utils.
|
|
897
|
-
|
|
877
|
+
response_data = utils.unmarshal_json_response(
|
|
878
|
+
errors.UnprocessableEntityData, http_res
|
|
898
879
|
)
|
|
899
|
-
raise errors.UnprocessableEntity(
|
|
880
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
900
881
|
if utils.match_response(http_res, "429", "application/json"):
|
|
901
|
-
response_data = utils.
|
|
902
|
-
|
|
882
|
+
response_data = utils.unmarshal_json_response(
|
|
883
|
+
errors.RateLimitExceededData, http_res
|
|
903
884
|
)
|
|
904
|
-
raise errors.RateLimitExceeded(
|
|
885
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
905
886
|
if utils.match_response(http_res, "500", "application/json"):
|
|
906
|
-
response_data = utils.
|
|
907
|
-
|
|
887
|
+
response_data = utils.unmarshal_json_response(
|
|
888
|
+
errors.InternalServerErrorData, http_res
|
|
908
889
|
)
|
|
909
|
-
raise errors.InternalServerError(
|
|
890
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
910
891
|
if utils.match_response(http_res, "4XX", "*"):
|
|
911
892
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
912
|
-
raise errors.SDKError(
|
|
913
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
914
|
-
)
|
|
893
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
915
894
|
if utils.match_response(http_res, "5XX", "*"):
|
|
916
895
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
917
|
-
raise errors.SDKError(
|
|
918
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
919
|
-
)
|
|
896
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
920
897
|
|
|
921
|
-
|
|
922
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
923
|
-
raise errors.SDKError(
|
|
924
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
925
|
-
http_res.status_code,
|
|
926
|
-
http_res_text,
|
|
927
|
-
http_res,
|
|
928
|
-
)
|
|
898
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
929
899
|
|
|
930
900
|
def delete(
|
|
931
901
|
self,
|
|
@@ -1011,63 +981,58 @@ class Folders(BaseSDK):
|
|
|
1011
981
|
|
|
1012
982
|
response_data: Any = None
|
|
1013
983
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1014
|
-
return utils.
|
|
1015
|
-
|
|
984
|
+
return utils.unmarshal_json_response(
|
|
985
|
+
Optional[operations.DeleteFolderResponseBody], http_res
|
|
1016
986
|
)
|
|
1017
987
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1018
|
-
response_data = utils.
|
|
1019
|
-
|
|
988
|
+
response_data = utils.unmarshal_json_response(
|
|
989
|
+
errors.BadRequestData, http_res
|
|
990
|
+
)
|
|
991
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1020
992
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1021
|
-
response_data = utils.
|
|
1022
|
-
|
|
993
|
+
response_data = utils.unmarshal_json_response(
|
|
994
|
+
errors.UnauthorizedData, http_res
|
|
995
|
+
)
|
|
996
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1023
997
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1024
|
-
response_data = utils.
|
|
1025
|
-
|
|
998
|
+
response_data = utils.unmarshal_json_response(
|
|
999
|
+
errors.ForbiddenData, http_res
|
|
1000
|
+
)
|
|
1001
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1026
1002
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1027
|
-
response_data = utils.
|
|
1028
|
-
raise errors.NotFound(
|
|
1003
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1004
|
+
raise errors.NotFound(response_data, http_res)
|
|
1029
1005
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1030
|
-
response_data = utils.
|
|
1031
|
-
raise errors.Conflict(
|
|
1006
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
1007
|
+
raise errors.Conflict(response_data, http_res)
|
|
1032
1008
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1033
|
-
response_data = utils.
|
|
1034
|
-
|
|
1009
|
+
response_data = utils.unmarshal_json_response(
|
|
1010
|
+
errors.InviteExpiredData, http_res
|
|
1035
1011
|
)
|
|
1036
|
-
raise errors.InviteExpired(
|
|
1012
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1037
1013
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1038
|
-
response_data = utils.
|
|
1039
|
-
|
|
1014
|
+
response_data = utils.unmarshal_json_response(
|
|
1015
|
+
errors.UnprocessableEntityData, http_res
|
|
1040
1016
|
)
|
|
1041
|
-
raise errors.UnprocessableEntity(
|
|
1017
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1042
1018
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1043
|
-
response_data = utils.
|
|
1044
|
-
|
|
1019
|
+
response_data = utils.unmarshal_json_response(
|
|
1020
|
+
errors.RateLimitExceededData, http_res
|
|
1045
1021
|
)
|
|
1046
|
-
raise errors.RateLimitExceeded(
|
|
1022
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1047
1023
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1048
|
-
response_data = utils.
|
|
1049
|
-
|
|
1024
|
+
response_data = utils.unmarshal_json_response(
|
|
1025
|
+
errors.InternalServerErrorData, http_res
|
|
1050
1026
|
)
|
|
1051
|
-
raise errors.InternalServerError(
|
|
1027
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1052
1028
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1053
1029
|
http_res_text = utils.stream_to_text(http_res)
|
|
1054
|
-
raise errors.SDKError(
|
|
1055
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1056
|
-
)
|
|
1030
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1057
1031
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1058
1032
|
http_res_text = utils.stream_to_text(http_res)
|
|
1059
|
-
raise errors.SDKError(
|
|
1060
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1061
|
-
)
|
|
1033
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1062
1034
|
|
|
1063
|
-
|
|
1064
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1065
|
-
raise errors.SDKError(
|
|
1066
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1067
|
-
http_res.status_code,
|
|
1068
|
-
http_res_text,
|
|
1069
|
-
http_res,
|
|
1070
|
-
)
|
|
1035
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1071
1036
|
|
|
1072
1037
|
async def delete_async(
|
|
1073
1038
|
self,
|
|
@@ -1153,60 +1118,55 @@ class Folders(BaseSDK):
|
|
|
1153
1118
|
|
|
1154
1119
|
response_data: Any = None
|
|
1155
1120
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1156
|
-
return utils.
|
|
1157
|
-
|
|
1121
|
+
return utils.unmarshal_json_response(
|
|
1122
|
+
Optional[operations.DeleteFolderResponseBody], http_res
|
|
1158
1123
|
)
|
|
1159
1124
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1160
|
-
response_data = utils.
|
|
1161
|
-
|
|
1125
|
+
response_data = utils.unmarshal_json_response(
|
|
1126
|
+
errors.BadRequestData, http_res
|
|
1127
|
+
)
|
|
1128
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1162
1129
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1163
|
-
response_data = utils.
|
|
1164
|
-
|
|
1130
|
+
response_data = utils.unmarshal_json_response(
|
|
1131
|
+
errors.UnauthorizedData, http_res
|
|
1132
|
+
)
|
|
1133
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1165
1134
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1166
|
-
response_data = utils.
|
|
1167
|
-
|
|
1135
|
+
response_data = utils.unmarshal_json_response(
|
|
1136
|
+
errors.ForbiddenData, http_res
|
|
1137
|
+
)
|
|
1138
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1168
1139
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1169
|
-
response_data = utils.
|
|
1170
|
-
raise errors.NotFound(
|
|
1140
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1141
|
+
raise errors.NotFound(response_data, http_res)
|
|
1171
1142
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1172
|
-
response_data = utils.
|
|
1173
|
-
raise errors.Conflict(
|
|
1143
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
1144
|
+
raise errors.Conflict(response_data, http_res)
|
|
1174
1145
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1175
|
-
response_data = utils.
|
|
1176
|
-
|
|
1146
|
+
response_data = utils.unmarshal_json_response(
|
|
1147
|
+
errors.InviteExpiredData, http_res
|
|
1177
1148
|
)
|
|
1178
|
-
raise errors.InviteExpired(
|
|
1149
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1179
1150
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1180
|
-
response_data = utils.
|
|
1181
|
-
|
|
1151
|
+
response_data = utils.unmarshal_json_response(
|
|
1152
|
+
errors.UnprocessableEntityData, http_res
|
|
1182
1153
|
)
|
|
1183
|
-
raise errors.UnprocessableEntity(
|
|
1154
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1184
1155
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1185
|
-
response_data = utils.
|
|
1186
|
-
|
|
1156
|
+
response_data = utils.unmarshal_json_response(
|
|
1157
|
+
errors.RateLimitExceededData, http_res
|
|
1187
1158
|
)
|
|
1188
|
-
raise errors.RateLimitExceeded(
|
|
1159
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1189
1160
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1190
|
-
response_data = utils.
|
|
1191
|
-
|
|
1161
|
+
response_data = utils.unmarshal_json_response(
|
|
1162
|
+
errors.InternalServerErrorData, http_res
|
|
1192
1163
|
)
|
|
1193
|
-
raise errors.InternalServerError(
|
|
1164
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1194
1165
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1195
1166
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1196
|
-
raise errors.SDKError(
|
|
1197
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1198
|
-
)
|
|
1167
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1199
1168
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1200
1169
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1201
|
-
raise errors.SDKError(
|
|
1202
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1203
|
-
)
|
|
1170
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1204
1171
|
|
|
1205
|
-
|
|
1206
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1207
|
-
raise errors.SDKError(
|
|
1208
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1209
|
-
http_res.status_code,
|
|
1210
|
-
http_res_text,
|
|
1211
|
-
http_res,
|
|
1212
|
-
)
|
|
1172
|
+
raise errors.SDKError("Unexpected response received", http_res)
|