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/qr_codes.py
CHANGED
|
@@ -97,59 +97,54 @@ class QRCodes(BaseSDK):
|
|
|
97
97
|
if utils.match_response(http_res, "200", "image/png"):
|
|
98
98
|
return http_res.text
|
|
99
99
|
if utils.match_response(http_res, "400", "application/json"):
|
|
100
|
-
response_data = utils.
|
|
101
|
-
|
|
100
|
+
response_data = utils.unmarshal_json_response(
|
|
101
|
+
errors.BadRequestData, http_res
|
|
102
|
+
)
|
|
103
|
+
raise errors.BadRequest(response_data, http_res)
|
|
102
104
|
if utils.match_response(http_res, "401", "application/json"):
|
|
103
|
-
response_data = utils.
|
|
104
|
-
|
|
105
|
+
response_data = utils.unmarshal_json_response(
|
|
106
|
+
errors.UnauthorizedData, http_res
|
|
107
|
+
)
|
|
108
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
105
109
|
if utils.match_response(http_res, "403", "application/json"):
|
|
106
|
-
response_data = utils.
|
|
107
|
-
|
|
110
|
+
response_data = utils.unmarshal_json_response(
|
|
111
|
+
errors.ForbiddenData, http_res
|
|
112
|
+
)
|
|
113
|
+
raise errors.Forbidden(response_data, http_res)
|
|
108
114
|
if utils.match_response(http_res, "404", "application/json"):
|
|
109
|
-
response_data = utils.
|
|
110
|
-
raise errors.NotFound(
|
|
115
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
116
|
+
raise errors.NotFound(response_data, http_res)
|
|
111
117
|
if utils.match_response(http_res, "409", "application/json"):
|
|
112
|
-
response_data = utils.
|
|
113
|
-
raise errors.Conflict(
|
|
118
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
119
|
+
raise errors.Conflict(response_data, http_res)
|
|
114
120
|
if utils.match_response(http_res, "410", "application/json"):
|
|
115
|
-
response_data = utils.
|
|
116
|
-
|
|
121
|
+
response_data = utils.unmarshal_json_response(
|
|
122
|
+
errors.InviteExpiredData, http_res
|
|
117
123
|
)
|
|
118
|
-
raise errors.InviteExpired(
|
|
124
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
119
125
|
if utils.match_response(http_res, "422", "application/json"):
|
|
120
|
-
response_data = utils.
|
|
121
|
-
|
|
126
|
+
response_data = utils.unmarshal_json_response(
|
|
127
|
+
errors.UnprocessableEntityData, http_res
|
|
122
128
|
)
|
|
123
|
-
raise errors.UnprocessableEntity(
|
|
129
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
124
130
|
if utils.match_response(http_res, "429", "application/json"):
|
|
125
|
-
response_data = utils.
|
|
126
|
-
|
|
131
|
+
response_data = utils.unmarshal_json_response(
|
|
132
|
+
errors.RateLimitExceededData, http_res
|
|
127
133
|
)
|
|
128
|
-
raise errors.RateLimitExceeded(
|
|
134
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
129
135
|
if utils.match_response(http_res, "500", "application/json"):
|
|
130
|
-
response_data = utils.
|
|
131
|
-
|
|
136
|
+
response_data = utils.unmarshal_json_response(
|
|
137
|
+
errors.InternalServerErrorData, http_res
|
|
132
138
|
)
|
|
133
|
-
raise errors.InternalServerError(
|
|
139
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
134
140
|
if utils.match_response(http_res, "4XX", "*"):
|
|
135
141
|
http_res_text = utils.stream_to_text(http_res)
|
|
136
|
-
raise errors.SDKError(
|
|
137
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
138
|
-
)
|
|
142
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
139
143
|
if utils.match_response(http_res, "5XX", "*"):
|
|
140
144
|
http_res_text = utils.stream_to_text(http_res)
|
|
141
|
-
raise errors.SDKError(
|
|
142
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
143
|
-
)
|
|
145
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
144
146
|
|
|
145
|
-
|
|
146
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
147
|
-
raise errors.SDKError(
|
|
148
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
149
|
-
http_res.status_code,
|
|
150
|
-
http_res_text,
|
|
151
|
-
http_res,
|
|
152
|
-
)
|
|
147
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
153
148
|
|
|
154
149
|
async def get_async(
|
|
155
150
|
self,
|
|
@@ -239,56 +234,51 @@ class QRCodes(BaseSDK):
|
|
|
239
234
|
if utils.match_response(http_res, "200", "image/png"):
|
|
240
235
|
return http_res.text
|
|
241
236
|
if utils.match_response(http_res, "400", "application/json"):
|
|
242
|
-
response_data = utils.
|
|
243
|
-
|
|
237
|
+
response_data = utils.unmarshal_json_response(
|
|
238
|
+
errors.BadRequestData, http_res
|
|
239
|
+
)
|
|
240
|
+
raise errors.BadRequest(response_data, http_res)
|
|
244
241
|
if utils.match_response(http_res, "401", "application/json"):
|
|
245
|
-
response_data = utils.
|
|
246
|
-
|
|
242
|
+
response_data = utils.unmarshal_json_response(
|
|
243
|
+
errors.UnauthorizedData, http_res
|
|
244
|
+
)
|
|
245
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
247
246
|
if utils.match_response(http_res, "403", "application/json"):
|
|
248
|
-
response_data = utils.
|
|
249
|
-
|
|
247
|
+
response_data = utils.unmarshal_json_response(
|
|
248
|
+
errors.ForbiddenData, http_res
|
|
249
|
+
)
|
|
250
|
+
raise errors.Forbidden(response_data, http_res)
|
|
250
251
|
if utils.match_response(http_res, "404", "application/json"):
|
|
251
|
-
response_data = utils.
|
|
252
|
-
raise errors.NotFound(
|
|
252
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
253
|
+
raise errors.NotFound(response_data, http_res)
|
|
253
254
|
if utils.match_response(http_res, "409", "application/json"):
|
|
254
|
-
response_data = utils.
|
|
255
|
-
raise errors.Conflict(
|
|
255
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
256
|
+
raise errors.Conflict(response_data, http_res)
|
|
256
257
|
if utils.match_response(http_res, "410", "application/json"):
|
|
257
|
-
response_data = utils.
|
|
258
|
-
|
|
258
|
+
response_data = utils.unmarshal_json_response(
|
|
259
|
+
errors.InviteExpiredData, http_res
|
|
259
260
|
)
|
|
260
|
-
raise errors.InviteExpired(
|
|
261
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
261
262
|
if utils.match_response(http_res, "422", "application/json"):
|
|
262
|
-
response_data = utils.
|
|
263
|
-
|
|
263
|
+
response_data = utils.unmarshal_json_response(
|
|
264
|
+
errors.UnprocessableEntityData, http_res
|
|
264
265
|
)
|
|
265
|
-
raise errors.UnprocessableEntity(
|
|
266
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
266
267
|
if utils.match_response(http_res, "429", "application/json"):
|
|
267
|
-
response_data = utils.
|
|
268
|
-
|
|
268
|
+
response_data = utils.unmarshal_json_response(
|
|
269
|
+
errors.RateLimitExceededData, http_res
|
|
269
270
|
)
|
|
270
|
-
raise errors.RateLimitExceeded(
|
|
271
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
271
272
|
if utils.match_response(http_res, "500", "application/json"):
|
|
272
|
-
response_data = utils.
|
|
273
|
-
|
|
273
|
+
response_data = utils.unmarshal_json_response(
|
|
274
|
+
errors.InternalServerErrorData, http_res
|
|
274
275
|
)
|
|
275
|
-
raise errors.InternalServerError(
|
|
276
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
276
277
|
if utils.match_response(http_res, "4XX", "*"):
|
|
277
278
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
278
|
-
raise errors.SDKError(
|
|
279
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
280
|
-
)
|
|
279
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
281
280
|
if utils.match_response(http_res, "5XX", "*"):
|
|
282
281
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
283
|
-
raise errors.SDKError(
|
|
284
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
285
|
-
)
|
|
282
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
286
283
|
|
|
287
|
-
|
|
288
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
289
|
-
raise errors.SDKError(
|
|
290
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
291
|
-
http_res.status_code,
|
|
292
|
-
http_res_text,
|
|
293
|
-
http_res,
|
|
294
|
-
)
|
|
284
|
+
raise errors.SDKError("Unexpected response received", http_res)
|