dub 0.27.0__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 +21 -36
- dub/commissions.py +41 -72
- dub/customers.py +101 -180
- dub/domains.py +121 -224
- dub/embed_tokens.py +21 -36
- dub/events.py +21 -36
- dub/folders.py +81 -152
- dub/links.py +201 -376
- dub/models/operations/tracklead.py +2 -2
- dub/models/operations/tracksale.py +2 -2
- dub/partners.py +101 -192
- dub/qr_codes.py +19 -34
- dub/tags.py +81 -152
- dub/track.py +41 -72
- dub/utils/__init__.py +0 -3
- dub/utils/serializers.py +1 -18
- dub/utils/unmarshal_json_response.py +24 -0
- dub/workspaces.py +41 -72
- {dub-0.27.0.dist-info → dub-0.27.1.dist-info}/METADATA +1 -1
- {dub-0.27.0.dist-info → dub-0.27.1.dist-info}/RECORD +23 -22
- {dub-0.27.0.dist-info → dub-0.27.1.dist-info}/LICENSE +0 -0
- {dub-0.27.0.dist-info → dub-0.27.1.dist-info}/WHEEL +0 -0
dub/track.py
CHANGED
|
@@ -5,6 +5,7 @@ from dub import utils
|
|
|
5
5
|
from dub._hooks import HookContext
|
|
6
6
|
from dub.models import 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, Mapping, Optional, Union, cast
|
|
9
10
|
|
|
10
11
|
|
|
@@ -103,47 +104,39 @@ class Track(BaseSDK):
|
|
|
103
104
|
|
|
104
105
|
response_data: Any = None
|
|
105
106
|
if utils.match_response(http_res, "200", "application/json"):
|
|
106
|
-
return
|
|
107
|
+
return unmarshal_json_response(
|
|
107
108
|
Optional[operations.TrackLeadResponseBody], http_res
|
|
108
109
|
)
|
|
109
110
|
if utils.match_response(http_res, "400", "application/json"):
|
|
110
|
-
response_data =
|
|
111
|
-
errors.BadRequestData, http_res
|
|
112
|
-
)
|
|
111
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
113
112
|
raise errors.BadRequest(response_data, http_res)
|
|
114
113
|
if utils.match_response(http_res, "401", "application/json"):
|
|
115
|
-
response_data =
|
|
116
|
-
errors.UnauthorizedData, http_res
|
|
117
|
-
)
|
|
114
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
118
115
|
raise errors.Unauthorized(response_data, http_res)
|
|
119
116
|
if utils.match_response(http_res, "403", "application/json"):
|
|
120
|
-
response_data =
|
|
121
|
-
errors.ForbiddenData, http_res
|
|
122
|
-
)
|
|
117
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
123
118
|
raise errors.Forbidden(response_data, http_res)
|
|
124
119
|
if utils.match_response(http_res, "404", "application/json"):
|
|
125
|
-
response_data =
|
|
120
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
126
121
|
raise errors.NotFound(response_data, http_res)
|
|
127
122
|
if utils.match_response(http_res, "409", "application/json"):
|
|
128
|
-
response_data =
|
|
123
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
129
124
|
raise errors.Conflict(response_data, http_res)
|
|
130
125
|
if utils.match_response(http_res, "410", "application/json"):
|
|
131
|
-
response_data =
|
|
132
|
-
errors.InviteExpiredData, http_res
|
|
133
|
-
)
|
|
126
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
134
127
|
raise errors.InviteExpired(response_data, http_res)
|
|
135
128
|
if utils.match_response(http_res, "422", "application/json"):
|
|
136
|
-
response_data =
|
|
129
|
+
response_data = unmarshal_json_response(
|
|
137
130
|
errors.UnprocessableEntityData, http_res
|
|
138
131
|
)
|
|
139
132
|
raise errors.UnprocessableEntity(response_data, http_res)
|
|
140
133
|
if utils.match_response(http_res, "429", "application/json"):
|
|
141
|
-
response_data =
|
|
134
|
+
response_data = unmarshal_json_response(
|
|
142
135
|
errors.RateLimitExceededData, http_res
|
|
143
136
|
)
|
|
144
137
|
raise errors.RateLimitExceeded(response_data, http_res)
|
|
145
138
|
if utils.match_response(http_res, "500", "application/json"):
|
|
146
|
-
response_data =
|
|
139
|
+
response_data = unmarshal_json_response(
|
|
147
140
|
errors.InternalServerErrorData, http_res
|
|
148
141
|
)
|
|
149
142
|
raise errors.InternalServerError(response_data, http_res)
|
|
@@ -250,47 +243,39 @@ class Track(BaseSDK):
|
|
|
250
243
|
|
|
251
244
|
response_data: Any = None
|
|
252
245
|
if utils.match_response(http_res, "200", "application/json"):
|
|
253
|
-
return
|
|
246
|
+
return unmarshal_json_response(
|
|
254
247
|
Optional[operations.TrackLeadResponseBody], http_res
|
|
255
248
|
)
|
|
256
249
|
if utils.match_response(http_res, "400", "application/json"):
|
|
257
|
-
response_data =
|
|
258
|
-
errors.BadRequestData, http_res
|
|
259
|
-
)
|
|
250
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
260
251
|
raise errors.BadRequest(response_data, http_res)
|
|
261
252
|
if utils.match_response(http_res, "401", "application/json"):
|
|
262
|
-
response_data =
|
|
263
|
-
errors.UnauthorizedData, http_res
|
|
264
|
-
)
|
|
253
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
265
254
|
raise errors.Unauthorized(response_data, http_res)
|
|
266
255
|
if utils.match_response(http_res, "403", "application/json"):
|
|
267
|
-
response_data =
|
|
268
|
-
errors.ForbiddenData, http_res
|
|
269
|
-
)
|
|
256
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
270
257
|
raise errors.Forbidden(response_data, http_res)
|
|
271
258
|
if utils.match_response(http_res, "404", "application/json"):
|
|
272
|
-
response_data =
|
|
259
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
273
260
|
raise errors.NotFound(response_data, http_res)
|
|
274
261
|
if utils.match_response(http_res, "409", "application/json"):
|
|
275
|
-
response_data =
|
|
262
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
276
263
|
raise errors.Conflict(response_data, http_res)
|
|
277
264
|
if utils.match_response(http_res, "410", "application/json"):
|
|
278
|
-
response_data =
|
|
279
|
-
errors.InviteExpiredData, http_res
|
|
280
|
-
)
|
|
265
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
281
266
|
raise errors.InviteExpired(response_data, http_res)
|
|
282
267
|
if utils.match_response(http_res, "422", "application/json"):
|
|
283
|
-
response_data =
|
|
268
|
+
response_data = unmarshal_json_response(
|
|
284
269
|
errors.UnprocessableEntityData, http_res
|
|
285
270
|
)
|
|
286
271
|
raise errors.UnprocessableEntity(response_data, http_res)
|
|
287
272
|
if utils.match_response(http_res, "429", "application/json"):
|
|
288
|
-
response_data =
|
|
273
|
+
response_data = unmarshal_json_response(
|
|
289
274
|
errors.RateLimitExceededData, http_res
|
|
290
275
|
)
|
|
291
276
|
raise errors.RateLimitExceeded(response_data, http_res)
|
|
292
277
|
if utils.match_response(http_res, "500", "application/json"):
|
|
293
|
-
response_data =
|
|
278
|
+
response_data = unmarshal_json_response(
|
|
294
279
|
errors.InternalServerErrorData, http_res
|
|
295
280
|
)
|
|
296
281
|
raise errors.InternalServerError(response_data, http_res)
|
|
@@ -397,47 +382,39 @@ class Track(BaseSDK):
|
|
|
397
382
|
|
|
398
383
|
response_data: Any = None
|
|
399
384
|
if utils.match_response(http_res, "200", "application/json"):
|
|
400
|
-
return
|
|
385
|
+
return unmarshal_json_response(
|
|
401
386
|
Optional[operations.TrackSaleResponseBody], http_res
|
|
402
387
|
)
|
|
403
388
|
if utils.match_response(http_res, "400", "application/json"):
|
|
404
|
-
response_data =
|
|
405
|
-
errors.BadRequestData, http_res
|
|
406
|
-
)
|
|
389
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
407
390
|
raise errors.BadRequest(response_data, http_res)
|
|
408
391
|
if utils.match_response(http_res, "401", "application/json"):
|
|
409
|
-
response_data =
|
|
410
|
-
errors.UnauthorizedData, http_res
|
|
411
|
-
)
|
|
392
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
412
393
|
raise errors.Unauthorized(response_data, http_res)
|
|
413
394
|
if utils.match_response(http_res, "403", "application/json"):
|
|
414
|
-
response_data =
|
|
415
|
-
errors.ForbiddenData, http_res
|
|
416
|
-
)
|
|
395
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
417
396
|
raise errors.Forbidden(response_data, http_res)
|
|
418
397
|
if utils.match_response(http_res, "404", "application/json"):
|
|
419
|
-
response_data =
|
|
398
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
420
399
|
raise errors.NotFound(response_data, http_res)
|
|
421
400
|
if utils.match_response(http_res, "409", "application/json"):
|
|
422
|
-
response_data =
|
|
401
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
423
402
|
raise errors.Conflict(response_data, http_res)
|
|
424
403
|
if utils.match_response(http_res, "410", "application/json"):
|
|
425
|
-
response_data =
|
|
426
|
-
errors.InviteExpiredData, http_res
|
|
427
|
-
)
|
|
404
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
428
405
|
raise errors.InviteExpired(response_data, http_res)
|
|
429
406
|
if utils.match_response(http_res, "422", "application/json"):
|
|
430
|
-
response_data =
|
|
407
|
+
response_data = unmarshal_json_response(
|
|
431
408
|
errors.UnprocessableEntityData, http_res
|
|
432
409
|
)
|
|
433
410
|
raise errors.UnprocessableEntity(response_data, http_res)
|
|
434
411
|
if utils.match_response(http_res, "429", "application/json"):
|
|
435
|
-
response_data =
|
|
412
|
+
response_data = unmarshal_json_response(
|
|
436
413
|
errors.RateLimitExceededData, http_res
|
|
437
414
|
)
|
|
438
415
|
raise errors.RateLimitExceeded(response_data, http_res)
|
|
439
416
|
if utils.match_response(http_res, "500", "application/json"):
|
|
440
|
-
response_data =
|
|
417
|
+
response_data = unmarshal_json_response(
|
|
441
418
|
errors.InternalServerErrorData, http_res
|
|
442
419
|
)
|
|
443
420
|
raise errors.InternalServerError(response_data, http_res)
|
|
@@ -544,47 +521,39 @@ class Track(BaseSDK):
|
|
|
544
521
|
|
|
545
522
|
response_data: Any = None
|
|
546
523
|
if utils.match_response(http_res, "200", "application/json"):
|
|
547
|
-
return
|
|
524
|
+
return unmarshal_json_response(
|
|
548
525
|
Optional[operations.TrackSaleResponseBody], http_res
|
|
549
526
|
)
|
|
550
527
|
if utils.match_response(http_res, "400", "application/json"):
|
|
551
|
-
response_data =
|
|
552
|
-
errors.BadRequestData, http_res
|
|
553
|
-
)
|
|
528
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
554
529
|
raise errors.BadRequest(response_data, http_res)
|
|
555
530
|
if utils.match_response(http_res, "401", "application/json"):
|
|
556
|
-
response_data =
|
|
557
|
-
errors.UnauthorizedData, http_res
|
|
558
|
-
)
|
|
531
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
559
532
|
raise errors.Unauthorized(response_data, http_res)
|
|
560
533
|
if utils.match_response(http_res, "403", "application/json"):
|
|
561
|
-
response_data =
|
|
562
|
-
errors.ForbiddenData, http_res
|
|
563
|
-
)
|
|
534
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
564
535
|
raise errors.Forbidden(response_data, http_res)
|
|
565
536
|
if utils.match_response(http_res, "404", "application/json"):
|
|
566
|
-
response_data =
|
|
537
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
567
538
|
raise errors.NotFound(response_data, http_res)
|
|
568
539
|
if utils.match_response(http_res, "409", "application/json"):
|
|
569
|
-
response_data =
|
|
540
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
570
541
|
raise errors.Conflict(response_data, http_res)
|
|
571
542
|
if utils.match_response(http_res, "410", "application/json"):
|
|
572
|
-
response_data =
|
|
573
|
-
errors.InviteExpiredData, http_res
|
|
574
|
-
)
|
|
543
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
575
544
|
raise errors.InviteExpired(response_data, http_res)
|
|
576
545
|
if utils.match_response(http_res, "422", "application/json"):
|
|
577
|
-
response_data =
|
|
546
|
+
response_data = unmarshal_json_response(
|
|
578
547
|
errors.UnprocessableEntityData, http_res
|
|
579
548
|
)
|
|
580
549
|
raise errors.UnprocessableEntity(response_data, http_res)
|
|
581
550
|
if utils.match_response(http_res, "429", "application/json"):
|
|
582
|
-
response_data =
|
|
551
|
+
response_data = unmarshal_json_response(
|
|
583
552
|
errors.RateLimitExceededData, http_res
|
|
584
553
|
)
|
|
585
554
|
raise errors.RateLimitExceeded(response_data, http_res)
|
|
586
555
|
if utils.match_response(http_res, "500", "application/json"):
|
|
587
|
-
response_data =
|
|
556
|
+
response_data = unmarshal_json_response(
|
|
588
557
|
errors.InternalServerErrorData, http_res
|
|
589
558
|
)
|
|
590
559
|
raise errors.InternalServerError(response_data, http_res)
|
dub/utils/__init__.py
CHANGED
|
@@ -28,7 +28,6 @@ if TYPE_CHECKING:
|
|
|
28
28
|
marshal_json,
|
|
29
29
|
unmarshal,
|
|
30
30
|
unmarshal_json,
|
|
31
|
-
unmarshal_json_response,
|
|
32
31
|
serialize_decimal,
|
|
33
32
|
serialize_float,
|
|
34
33
|
serialize_int,
|
|
@@ -97,7 +96,6 @@ __all__ = [
|
|
|
97
96
|
"template_url",
|
|
98
97
|
"unmarshal",
|
|
99
98
|
"unmarshal_json",
|
|
100
|
-
"unmarshal_json_response",
|
|
101
99
|
"validate_decimal",
|
|
102
100
|
"validate_const",
|
|
103
101
|
"validate_float",
|
|
@@ -151,7 +149,6 @@ _dynamic_imports: dict[str, str] = {
|
|
|
151
149
|
"template_url": ".url",
|
|
152
150
|
"unmarshal": ".serializers",
|
|
153
151
|
"unmarshal_json": ".serializers",
|
|
154
|
-
"unmarshal_json_response": ".serializers",
|
|
155
152
|
"validate_decimal": ".serializers",
|
|
156
153
|
"validate_const": ".serializers",
|
|
157
154
|
"validate_float": ".serializers",
|
dub/utils/serializers.py
CHANGED
|
@@ -4,7 +4,7 @@ from decimal import Decimal
|
|
|
4
4
|
import functools
|
|
5
5
|
import json
|
|
6
6
|
import typing
|
|
7
|
-
from typing import Any, Dict, List,
|
|
7
|
+
from typing import Any, Dict, List, Tuple, Union, get_args
|
|
8
8
|
import typing_extensions
|
|
9
9
|
from typing_extensions import get_origin
|
|
10
10
|
|
|
@@ -13,7 +13,6 @@ from pydantic import ConfigDict, create_model
|
|
|
13
13
|
from pydantic_core import from_json
|
|
14
14
|
|
|
15
15
|
from ..types.basemodel import BaseModel, Nullable, OptionalNullable, Unset
|
|
16
|
-
from dub.models import errors
|
|
17
16
|
|
|
18
17
|
|
|
19
18
|
def serialize_decimal(as_str: bool):
|
|
@@ -141,22 +140,6 @@ def unmarshal_json(raw, typ: Any) -> Any:
|
|
|
141
140
|
return unmarshal(from_json(raw), typ)
|
|
142
141
|
|
|
143
142
|
|
|
144
|
-
def unmarshal_json_response(
|
|
145
|
-
typ: Any, http_res: httpx.Response, body: Optional[str] = None
|
|
146
|
-
) -> Any:
|
|
147
|
-
if body is None:
|
|
148
|
-
body = http_res.text
|
|
149
|
-
try:
|
|
150
|
-
return unmarshal_json(body, typ)
|
|
151
|
-
except Exception as e:
|
|
152
|
-
raise errors.ResponseValidationError(
|
|
153
|
-
"Response validation failed",
|
|
154
|
-
http_res,
|
|
155
|
-
e,
|
|
156
|
-
body,
|
|
157
|
-
) from e
|
|
158
|
-
|
|
159
|
-
|
|
160
143
|
def unmarshal(val, typ: Any) -> Any:
|
|
161
144
|
unmarshaller = create_model(
|
|
162
145
|
"Unmarshaller",
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from typing import Any, Optional
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from .serializers import unmarshal_json
|
|
8
|
+
from dub.models import errors
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def unmarshal_json_response(
|
|
12
|
+
typ: Any, http_res: httpx.Response, body: Optional[str] = None
|
|
13
|
+
) -> Any:
|
|
14
|
+
if body is None:
|
|
15
|
+
body = http_res.text
|
|
16
|
+
try:
|
|
17
|
+
return unmarshal_json(body, typ)
|
|
18
|
+
except Exception as e:
|
|
19
|
+
raise errors.ResponseValidationError(
|
|
20
|
+
"Response validation failed",
|
|
21
|
+
http_res,
|
|
22
|
+
e,
|
|
23
|
+
body,
|
|
24
|
+
) from e
|
dub/workspaces.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, Mapping, Optional, Union, cast
|
|
9
10
|
|
|
10
11
|
|
|
@@ -95,47 +96,39 @@ class Workspaces(BaseSDK):
|
|
|
95
96
|
|
|
96
97
|
response_data: Any = None
|
|
97
98
|
if utils.match_response(http_res, "200", "application/json"):
|
|
98
|
-
return
|
|
99
|
+
return unmarshal_json_response(
|
|
99
100
|
Optional[components.WorkspaceSchema], http_res
|
|
100
101
|
)
|
|
101
102
|
if utils.match_response(http_res, "400", "application/json"):
|
|
102
|
-
response_data =
|
|
103
|
-
errors.BadRequestData, http_res
|
|
104
|
-
)
|
|
103
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
105
104
|
raise errors.BadRequest(response_data, http_res)
|
|
106
105
|
if utils.match_response(http_res, "401", "application/json"):
|
|
107
|
-
response_data =
|
|
108
|
-
errors.UnauthorizedData, http_res
|
|
109
|
-
)
|
|
106
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
110
107
|
raise errors.Unauthorized(response_data, http_res)
|
|
111
108
|
if utils.match_response(http_res, "403", "application/json"):
|
|
112
|
-
response_data =
|
|
113
|
-
errors.ForbiddenData, http_res
|
|
114
|
-
)
|
|
109
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
115
110
|
raise errors.Forbidden(response_data, http_res)
|
|
116
111
|
if utils.match_response(http_res, "404", "application/json"):
|
|
117
|
-
response_data =
|
|
112
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
118
113
|
raise errors.NotFound(response_data, http_res)
|
|
119
114
|
if utils.match_response(http_res, "409", "application/json"):
|
|
120
|
-
response_data =
|
|
115
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
121
116
|
raise errors.Conflict(response_data, http_res)
|
|
122
117
|
if utils.match_response(http_res, "410", "application/json"):
|
|
123
|
-
response_data =
|
|
124
|
-
errors.InviteExpiredData, http_res
|
|
125
|
-
)
|
|
118
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
126
119
|
raise errors.InviteExpired(response_data, http_res)
|
|
127
120
|
if utils.match_response(http_res, "422", "application/json"):
|
|
128
|
-
response_data =
|
|
121
|
+
response_data = unmarshal_json_response(
|
|
129
122
|
errors.UnprocessableEntityData, http_res
|
|
130
123
|
)
|
|
131
124
|
raise errors.UnprocessableEntity(response_data, http_res)
|
|
132
125
|
if utils.match_response(http_res, "429", "application/json"):
|
|
133
|
-
response_data =
|
|
126
|
+
response_data = unmarshal_json_response(
|
|
134
127
|
errors.RateLimitExceededData, http_res
|
|
135
128
|
)
|
|
136
129
|
raise errors.RateLimitExceeded(response_data, http_res)
|
|
137
130
|
if utils.match_response(http_res, "500", "application/json"):
|
|
138
|
-
response_data =
|
|
131
|
+
response_data = unmarshal_json_response(
|
|
139
132
|
errors.InternalServerErrorData, http_res
|
|
140
133
|
)
|
|
141
134
|
raise errors.InternalServerError(response_data, http_res)
|
|
@@ -234,47 +227,39 @@ class Workspaces(BaseSDK):
|
|
|
234
227
|
|
|
235
228
|
response_data: Any = None
|
|
236
229
|
if utils.match_response(http_res, "200", "application/json"):
|
|
237
|
-
return
|
|
230
|
+
return unmarshal_json_response(
|
|
238
231
|
Optional[components.WorkspaceSchema], http_res
|
|
239
232
|
)
|
|
240
233
|
if utils.match_response(http_res, "400", "application/json"):
|
|
241
|
-
response_data =
|
|
242
|
-
errors.BadRequestData, http_res
|
|
243
|
-
)
|
|
234
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
244
235
|
raise errors.BadRequest(response_data, http_res)
|
|
245
236
|
if utils.match_response(http_res, "401", "application/json"):
|
|
246
|
-
response_data =
|
|
247
|
-
errors.UnauthorizedData, http_res
|
|
248
|
-
)
|
|
237
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
249
238
|
raise errors.Unauthorized(response_data, http_res)
|
|
250
239
|
if utils.match_response(http_res, "403", "application/json"):
|
|
251
|
-
response_data =
|
|
252
|
-
errors.ForbiddenData, http_res
|
|
253
|
-
)
|
|
240
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
254
241
|
raise errors.Forbidden(response_data, http_res)
|
|
255
242
|
if utils.match_response(http_res, "404", "application/json"):
|
|
256
|
-
response_data =
|
|
243
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
257
244
|
raise errors.NotFound(response_data, http_res)
|
|
258
245
|
if utils.match_response(http_res, "409", "application/json"):
|
|
259
|
-
response_data =
|
|
246
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
260
247
|
raise errors.Conflict(response_data, http_res)
|
|
261
248
|
if utils.match_response(http_res, "410", "application/json"):
|
|
262
|
-
response_data =
|
|
263
|
-
errors.InviteExpiredData, http_res
|
|
264
|
-
)
|
|
249
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
265
250
|
raise errors.InviteExpired(response_data, http_res)
|
|
266
251
|
if utils.match_response(http_res, "422", "application/json"):
|
|
267
|
-
response_data =
|
|
252
|
+
response_data = unmarshal_json_response(
|
|
268
253
|
errors.UnprocessableEntityData, http_res
|
|
269
254
|
)
|
|
270
255
|
raise errors.UnprocessableEntity(response_data, http_res)
|
|
271
256
|
if utils.match_response(http_res, "429", "application/json"):
|
|
272
|
-
response_data =
|
|
257
|
+
response_data = unmarshal_json_response(
|
|
273
258
|
errors.RateLimitExceededData, http_res
|
|
274
259
|
)
|
|
275
260
|
raise errors.RateLimitExceeded(response_data, http_res)
|
|
276
261
|
if utils.match_response(http_res, "500", "application/json"):
|
|
277
|
-
response_data =
|
|
262
|
+
response_data = unmarshal_json_response(
|
|
278
263
|
errors.InternalServerErrorData, http_res
|
|
279
264
|
)
|
|
280
265
|
raise errors.InternalServerError(response_data, http_res)
|
|
@@ -388,47 +373,39 @@ class Workspaces(BaseSDK):
|
|
|
388
373
|
|
|
389
374
|
response_data: Any = None
|
|
390
375
|
if utils.match_response(http_res, "200", "application/json"):
|
|
391
|
-
return
|
|
376
|
+
return unmarshal_json_response(
|
|
392
377
|
Optional[components.WorkspaceSchema], http_res
|
|
393
378
|
)
|
|
394
379
|
if utils.match_response(http_res, "400", "application/json"):
|
|
395
|
-
response_data =
|
|
396
|
-
errors.BadRequestData, http_res
|
|
397
|
-
)
|
|
380
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
398
381
|
raise errors.BadRequest(response_data, http_res)
|
|
399
382
|
if utils.match_response(http_res, "401", "application/json"):
|
|
400
|
-
response_data =
|
|
401
|
-
errors.UnauthorizedData, http_res
|
|
402
|
-
)
|
|
383
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
403
384
|
raise errors.Unauthorized(response_data, http_res)
|
|
404
385
|
if utils.match_response(http_res, "403", "application/json"):
|
|
405
|
-
response_data =
|
|
406
|
-
errors.ForbiddenData, http_res
|
|
407
|
-
)
|
|
386
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
408
387
|
raise errors.Forbidden(response_data, http_res)
|
|
409
388
|
if utils.match_response(http_res, "404", "application/json"):
|
|
410
|
-
response_data =
|
|
389
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
411
390
|
raise errors.NotFound(response_data, http_res)
|
|
412
391
|
if utils.match_response(http_res, "409", "application/json"):
|
|
413
|
-
response_data =
|
|
392
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
414
393
|
raise errors.Conflict(response_data, http_res)
|
|
415
394
|
if utils.match_response(http_res, "410", "application/json"):
|
|
416
|
-
response_data =
|
|
417
|
-
errors.InviteExpiredData, http_res
|
|
418
|
-
)
|
|
395
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
419
396
|
raise errors.InviteExpired(response_data, http_res)
|
|
420
397
|
if utils.match_response(http_res, "422", "application/json"):
|
|
421
|
-
response_data =
|
|
398
|
+
response_data = unmarshal_json_response(
|
|
422
399
|
errors.UnprocessableEntityData, http_res
|
|
423
400
|
)
|
|
424
401
|
raise errors.UnprocessableEntity(response_data, http_res)
|
|
425
402
|
if utils.match_response(http_res, "429", "application/json"):
|
|
426
|
-
response_data =
|
|
403
|
+
response_data = unmarshal_json_response(
|
|
427
404
|
errors.RateLimitExceededData, http_res
|
|
428
405
|
)
|
|
429
406
|
raise errors.RateLimitExceeded(response_data, http_res)
|
|
430
407
|
if utils.match_response(http_res, "500", "application/json"):
|
|
431
|
-
response_data =
|
|
408
|
+
response_data = unmarshal_json_response(
|
|
432
409
|
errors.InternalServerErrorData, http_res
|
|
433
410
|
)
|
|
434
411
|
raise errors.InternalServerError(response_data, http_res)
|
|
@@ -542,47 +519,39 @@ class Workspaces(BaseSDK):
|
|
|
542
519
|
|
|
543
520
|
response_data: Any = None
|
|
544
521
|
if utils.match_response(http_res, "200", "application/json"):
|
|
545
|
-
return
|
|
522
|
+
return unmarshal_json_response(
|
|
546
523
|
Optional[components.WorkspaceSchema], http_res
|
|
547
524
|
)
|
|
548
525
|
if utils.match_response(http_res, "400", "application/json"):
|
|
549
|
-
response_data =
|
|
550
|
-
errors.BadRequestData, http_res
|
|
551
|
-
)
|
|
526
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
552
527
|
raise errors.BadRequest(response_data, http_res)
|
|
553
528
|
if utils.match_response(http_res, "401", "application/json"):
|
|
554
|
-
response_data =
|
|
555
|
-
errors.UnauthorizedData, http_res
|
|
556
|
-
)
|
|
529
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
557
530
|
raise errors.Unauthorized(response_data, http_res)
|
|
558
531
|
if utils.match_response(http_res, "403", "application/json"):
|
|
559
|
-
response_data =
|
|
560
|
-
errors.ForbiddenData, http_res
|
|
561
|
-
)
|
|
532
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
562
533
|
raise errors.Forbidden(response_data, http_res)
|
|
563
534
|
if utils.match_response(http_res, "404", "application/json"):
|
|
564
|
-
response_data =
|
|
535
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
565
536
|
raise errors.NotFound(response_data, http_res)
|
|
566
537
|
if utils.match_response(http_res, "409", "application/json"):
|
|
567
|
-
response_data =
|
|
538
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
568
539
|
raise errors.Conflict(response_data, http_res)
|
|
569
540
|
if utils.match_response(http_res, "410", "application/json"):
|
|
570
|
-
response_data =
|
|
571
|
-
errors.InviteExpiredData, http_res
|
|
572
|
-
)
|
|
541
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
573
542
|
raise errors.InviteExpired(response_data, http_res)
|
|
574
543
|
if utils.match_response(http_res, "422", "application/json"):
|
|
575
|
-
response_data =
|
|
544
|
+
response_data = unmarshal_json_response(
|
|
576
545
|
errors.UnprocessableEntityData, http_res
|
|
577
546
|
)
|
|
578
547
|
raise errors.UnprocessableEntity(response_data, http_res)
|
|
579
548
|
if utils.match_response(http_res, "429", "application/json"):
|
|
580
|
-
response_data =
|
|
549
|
+
response_data = unmarshal_json_response(
|
|
581
550
|
errors.RateLimitExceededData, http_res
|
|
582
551
|
)
|
|
583
552
|
raise errors.RateLimitExceeded(response_data, http_res)
|
|
584
553
|
if utils.match_response(http_res, "500", "application/json"):
|
|
585
|
-
response_data =
|
|
554
|
+
response_data = unmarshal_json_response(
|
|
586
555
|
errors.InternalServerErrorData, http_res
|
|
587
556
|
)
|
|
588
557
|
raise errors.InternalServerError(response_data, http_res)
|