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/embed_tokens.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
|
|
|
@@ -109,47 +110,39 @@ class EmbedTokens(BaseSDK):
|
|
|
109
110
|
|
|
110
111
|
response_data: Any = None
|
|
111
112
|
if utils.match_response(http_res, "201", "application/json"):
|
|
112
|
-
return
|
|
113
|
+
return unmarshal_json_response(
|
|
113
114
|
Optional[operations.CreateReferralsEmbedTokenResponseBody], http_res
|
|
114
115
|
)
|
|
115
116
|
if utils.match_response(http_res, "400", "application/json"):
|
|
116
|
-
response_data =
|
|
117
|
-
errors.BadRequestData, http_res
|
|
118
|
-
)
|
|
117
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
119
118
|
raise errors.BadRequest(response_data, http_res)
|
|
120
119
|
if utils.match_response(http_res, "401", "application/json"):
|
|
121
|
-
response_data =
|
|
122
|
-
errors.UnauthorizedData, http_res
|
|
123
|
-
)
|
|
120
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
124
121
|
raise errors.Unauthorized(response_data, http_res)
|
|
125
122
|
if utils.match_response(http_res, "403", "application/json"):
|
|
126
|
-
response_data =
|
|
127
|
-
errors.ForbiddenData, http_res
|
|
128
|
-
)
|
|
123
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
129
124
|
raise errors.Forbidden(response_data, http_res)
|
|
130
125
|
if utils.match_response(http_res, "404", "application/json"):
|
|
131
|
-
response_data =
|
|
126
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
132
127
|
raise errors.NotFound(response_data, http_res)
|
|
133
128
|
if utils.match_response(http_res, "409", "application/json"):
|
|
134
|
-
response_data =
|
|
129
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
135
130
|
raise errors.Conflict(response_data, http_res)
|
|
136
131
|
if utils.match_response(http_res, "410", "application/json"):
|
|
137
|
-
response_data =
|
|
138
|
-
errors.InviteExpiredData, http_res
|
|
139
|
-
)
|
|
132
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
140
133
|
raise errors.InviteExpired(response_data, http_res)
|
|
141
134
|
if utils.match_response(http_res, "422", "application/json"):
|
|
142
|
-
response_data =
|
|
135
|
+
response_data = unmarshal_json_response(
|
|
143
136
|
errors.UnprocessableEntityData, http_res
|
|
144
137
|
)
|
|
145
138
|
raise errors.UnprocessableEntity(response_data, http_res)
|
|
146
139
|
if utils.match_response(http_res, "429", "application/json"):
|
|
147
|
-
response_data =
|
|
140
|
+
response_data = unmarshal_json_response(
|
|
148
141
|
errors.RateLimitExceededData, http_res
|
|
149
142
|
)
|
|
150
143
|
raise errors.RateLimitExceeded(response_data, http_res)
|
|
151
144
|
if utils.match_response(http_res, "500", "application/json"):
|
|
152
|
-
response_data =
|
|
145
|
+
response_data = unmarshal_json_response(
|
|
153
146
|
errors.InternalServerErrorData, http_res
|
|
154
147
|
)
|
|
155
148
|
raise errors.InternalServerError(response_data, http_res)
|
|
@@ -262,47 +255,39 @@ class EmbedTokens(BaseSDK):
|
|
|
262
255
|
|
|
263
256
|
response_data: Any = None
|
|
264
257
|
if utils.match_response(http_res, "201", "application/json"):
|
|
265
|
-
return
|
|
258
|
+
return unmarshal_json_response(
|
|
266
259
|
Optional[operations.CreateReferralsEmbedTokenResponseBody], http_res
|
|
267
260
|
)
|
|
268
261
|
if utils.match_response(http_res, "400", "application/json"):
|
|
269
|
-
response_data =
|
|
270
|
-
errors.BadRequestData, http_res
|
|
271
|
-
)
|
|
262
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
272
263
|
raise errors.BadRequest(response_data, http_res)
|
|
273
264
|
if utils.match_response(http_res, "401", "application/json"):
|
|
274
|
-
response_data =
|
|
275
|
-
errors.UnauthorizedData, http_res
|
|
276
|
-
)
|
|
265
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
277
266
|
raise errors.Unauthorized(response_data, http_res)
|
|
278
267
|
if utils.match_response(http_res, "403", "application/json"):
|
|
279
|
-
response_data =
|
|
280
|
-
errors.ForbiddenData, http_res
|
|
281
|
-
)
|
|
268
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
282
269
|
raise errors.Forbidden(response_data, http_res)
|
|
283
270
|
if utils.match_response(http_res, "404", "application/json"):
|
|
284
|
-
response_data =
|
|
271
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
285
272
|
raise errors.NotFound(response_data, http_res)
|
|
286
273
|
if utils.match_response(http_res, "409", "application/json"):
|
|
287
|
-
response_data =
|
|
274
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
288
275
|
raise errors.Conflict(response_data, http_res)
|
|
289
276
|
if utils.match_response(http_res, "410", "application/json"):
|
|
290
|
-
response_data =
|
|
291
|
-
errors.InviteExpiredData, http_res
|
|
292
|
-
)
|
|
277
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
293
278
|
raise errors.InviteExpired(response_data, http_res)
|
|
294
279
|
if utils.match_response(http_res, "422", "application/json"):
|
|
295
|
-
response_data =
|
|
280
|
+
response_data = unmarshal_json_response(
|
|
296
281
|
errors.UnprocessableEntityData, http_res
|
|
297
282
|
)
|
|
298
283
|
raise errors.UnprocessableEntity(response_data, http_res)
|
|
299
284
|
if utils.match_response(http_res, "429", "application/json"):
|
|
300
|
-
response_data =
|
|
285
|
+
response_data = unmarshal_json_response(
|
|
301
286
|
errors.RateLimitExceededData, http_res
|
|
302
287
|
)
|
|
303
288
|
raise errors.RateLimitExceeded(response_data, http_res)
|
|
304
289
|
if utils.match_response(http_res, "500", "application/json"):
|
|
305
|
-
response_data =
|
|
290
|
+
response_data = unmarshal_json_response(
|
|
306
291
|
errors.InternalServerErrorData, http_res
|
|
307
292
|
)
|
|
308
293
|
raise errors.InternalServerError(response_data, http_res)
|
dub/events.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, List, Mapping, Optional, Union, cast
|
|
9
10
|
|
|
10
11
|
|
|
@@ -95,47 +96,39 @@ class Events(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[List[operations.ListEventsResponseBody]], 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 Events(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[List[operations.ListEventsResponseBody]], 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)
|