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/_version.py
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import importlib.metadata
|
|
4
4
|
|
|
5
5
|
__title__: str = "dub"
|
|
6
|
-
__version__: str = "0.
|
|
6
|
+
__version__: str = "0.27.0"
|
|
7
7
|
__openapi_doc_version__: str = "0.0.1"
|
|
8
|
-
__gen_version__: str = "2.
|
|
9
|
-
__user_agent__: str = "speakeasy-sdk/python 0.
|
|
8
|
+
__gen_version__: str = "2.651.2"
|
|
9
|
+
__user_agent__: str = "speakeasy-sdk/python 0.27.0 2.651.2 0.0.1 dub"
|
|
10
10
|
|
|
11
11
|
try:
|
|
12
12
|
if __package__ is not None:
|
dub/analytics.py
CHANGED
|
@@ -96,63 +96,58 @@ class Analytics(BaseSDK):
|
|
|
96
96
|
|
|
97
97
|
response_data: Any = None
|
|
98
98
|
if utils.match_response(http_res, "200", "application/json"):
|
|
99
|
-
return utils.
|
|
100
|
-
|
|
99
|
+
return utils.unmarshal_json_response(
|
|
100
|
+
Optional[operations.RetrieveAnalyticsResponseBody], http_res
|
|
101
101
|
)
|
|
102
102
|
if utils.match_response(http_res, "400", "application/json"):
|
|
103
|
-
response_data = utils.
|
|
104
|
-
|
|
103
|
+
response_data = utils.unmarshal_json_response(
|
|
104
|
+
errors.BadRequestData, http_res
|
|
105
|
+
)
|
|
106
|
+
raise errors.BadRequest(response_data, http_res)
|
|
105
107
|
if utils.match_response(http_res, "401", "application/json"):
|
|
106
|
-
response_data = utils.
|
|
107
|
-
|
|
108
|
+
response_data = utils.unmarshal_json_response(
|
|
109
|
+
errors.UnauthorizedData, http_res
|
|
110
|
+
)
|
|
111
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
108
112
|
if utils.match_response(http_res, "403", "application/json"):
|
|
109
|
-
response_data = utils.
|
|
110
|
-
|
|
113
|
+
response_data = utils.unmarshal_json_response(
|
|
114
|
+
errors.ForbiddenData, http_res
|
|
115
|
+
)
|
|
116
|
+
raise errors.Forbidden(response_data, http_res)
|
|
111
117
|
if utils.match_response(http_res, "404", "application/json"):
|
|
112
|
-
response_data = utils.
|
|
113
|
-
raise errors.NotFound(
|
|
118
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
119
|
+
raise errors.NotFound(response_data, http_res)
|
|
114
120
|
if utils.match_response(http_res, "409", "application/json"):
|
|
115
|
-
response_data = utils.
|
|
116
|
-
raise errors.Conflict(
|
|
121
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
122
|
+
raise errors.Conflict(response_data, http_res)
|
|
117
123
|
if utils.match_response(http_res, "410", "application/json"):
|
|
118
|
-
response_data = utils.
|
|
119
|
-
|
|
124
|
+
response_data = utils.unmarshal_json_response(
|
|
125
|
+
errors.InviteExpiredData, http_res
|
|
120
126
|
)
|
|
121
|
-
raise errors.InviteExpired(
|
|
127
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
122
128
|
if utils.match_response(http_res, "422", "application/json"):
|
|
123
|
-
response_data = utils.
|
|
124
|
-
|
|
129
|
+
response_data = utils.unmarshal_json_response(
|
|
130
|
+
errors.UnprocessableEntityData, http_res
|
|
125
131
|
)
|
|
126
|
-
raise errors.UnprocessableEntity(
|
|
132
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
127
133
|
if utils.match_response(http_res, "429", "application/json"):
|
|
128
|
-
response_data = utils.
|
|
129
|
-
|
|
134
|
+
response_data = utils.unmarshal_json_response(
|
|
135
|
+
errors.RateLimitExceededData, http_res
|
|
130
136
|
)
|
|
131
|
-
raise errors.RateLimitExceeded(
|
|
137
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
132
138
|
if utils.match_response(http_res, "500", "application/json"):
|
|
133
|
-
response_data = utils.
|
|
134
|
-
|
|
139
|
+
response_data = utils.unmarshal_json_response(
|
|
140
|
+
errors.InternalServerErrorData, http_res
|
|
135
141
|
)
|
|
136
|
-
raise errors.InternalServerError(
|
|
142
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
137
143
|
if utils.match_response(http_res, "4XX", "*"):
|
|
138
144
|
http_res_text = utils.stream_to_text(http_res)
|
|
139
|
-
raise errors.SDKError(
|
|
140
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
141
|
-
)
|
|
145
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
142
146
|
if utils.match_response(http_res, "5XX", "*"):
|
|
143
147
|
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
|
-
)
|
|
148
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
147
149
|
|
|
148
|
-
|
|
149
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
150
|
-
raise errors.SDKError(
|
|
151
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
152
|
-
http_res.status_code,
|
|
153
|
-
http_res_text,
|
|
154
|
-
http_res,
|
|
155
|
-
)
|
|
150
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
156
151
|
|
|
157
152
|
async def retrieve_async(
|
|
158
153
|
self,
|
|
@@ -241,60 +236,55 @@ class Analytics(BaseSDK):
|
|
|
241
236
|
|
|
242
237
|
response_data: Any = None
|
|
243
238
|
if utils.match_response(http_res, "200", "application/json"):
|
|
244
|
-
return utils.
|
|
245
|
-
|
|
239
|
+
return utils.unmarshal_json_response(
|
|
240
|
+
Optional[operations.RetrieveAnalyticsResponseBody], http_res
|
|
246
241
|
)
|
|
247
242
|
if utils.match_response(http_res, "400", "application/json"):
|
|
248
|
-
response_data = utils.
|
|
249
|
-
|
|
243
|
+
response_data = utils.unmarshal_json_response(
|
|
244
|
+
errors.BadRequestData, http_res
|
|
245
|
+
)
|
|
246
|
+
raise errors.BadRequest(response_data, http_res)
|
|
250
247
|
if utils.match_response(http_res, "401", "application/json"):
|
|
251
|
-
response_data = utils.
|
|
252
|
-
|
|
248
|
+
response_data = utils.unmarshal_json_response(
|
|
249
|
+
errors.UnauthorizedData, http_res
|
|
250
|
+
)
|
|
251
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
253
252
|
if utils.match_response(http_res, "403", "application/json"):
|
|
254
|
-
response_data = utils.
|
|
255
|
-
|
|
253
|
+
response_data = utils.unmarshal_json_response(
|
|
254
|
+
errors.ForbiddenData, http_res
|
|
255
|
+
)
|
|
256
|
+
raise errors.Forbidden(response_data, http_res)
|
|
256
257
|
if utils.match_response(http_res, "404", "application/json"):
|
|
257
|
-
response_data = utils.
|
|
258
|
-
raise errors.NotFound(
|
|
258
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
259
|
+
raise errors.NotFound(response_data, http_res)
|
|
259
260
|
if utils.match_response(http_res, "409", "application/json"):
|
|
260
|
-
response_data = utils.
|
|
261
|
-
raise errors.Conflict(
|
|
261
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
262
|
+
raise errors.Conflict(response_data, http_res)
|
|
262
263
|
if utils.match_response(http_res, "410", "application/json"):
|
|
263
|
-
response_data = utils.
|
|
264
|
-
|
|
264
|
+
response_data = utils.unmarshal_json_response(
|
|
265
|
+
errors.InviteExpiredData, http_res
|
|
265
266
|
)
|
|
266
|
-
raise errors.InviteExpired(
|
|
267
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
267
268
|
if utils.match_response(http_res, "422", "application/json"):
|
|
268
|
-
response_data = utils.
|
|
269
|
-
|
|
269
|
+
response_data = utils.unmarshal_json_response(
|
|
270
|
+
errors.UnprocessableEntityData, http_res
|
|
270
271
|
)
|
|
271
|
-
raise errors.UnprocessableEntity(
|
|
272
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
272
273
|
if utils.match_response(http_res, "429", "application/json"):
|
|
273
|
-
response_data = utils.
|
|
274
|
-
|
|
274
|
+
response_data = utils.unmarshal_json_response(
|
|
275
|
+
errors.RateLimitExceededData, http_res
|
|
275
276
|
)
|
|
276
|
-
raise errors.RateLimitExceeded(
|
|
277
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
277
278
|
if utils.match_response(http_res, "500", "application/json"):
|
|
278
|
-
response_data = utils.
|
|
279
|
-
|
|
279
|
+
response_data = utils.unmarshal_json_response(
|
|
280
|
+
errors.InternalServerErrorData, http_res
|
|
280
281
|
)
|
|
281
|
-
raise errors.InternalServerError(
|
|
282
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
282
283
|
if utils.match_response(http_res, "4XX", "*"):
|
|
283
284
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
284
|
-
raise errors.SDKError(
|
|
285
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
286
|
-
)
|
|
285
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
287
286
|
if utils.match_response(http_res, "5XX", "*"):
|
|
288
287
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
289
|
-
raise errors.SDKError(
|
|
290
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
291
|
-
)
|
|
288
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
292
289
|
|
|
293
|
-
|
|
294
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
295
|
-
raise errors.SDKError(
|
|
296
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
297
|
-
http_res.status_code,
|
|
298
|
-
http_res_text,
|
|
299
|
-
http_res,
|
|
300
|
-
)
|
|
290
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
dub/basesdk.py
CHANGED
|
@@ -241,7 +241,7 @@ class BaseSDK:
|
|
|
241
241
|
|
|
242
242
|
if http_res is None:
|
|
243
243
|
logger.debug("Raising no response SDK error")
|
|
244
|
-
raise errors.
|
|
244
|
+
raise errors.NoResponseError("No response received")
|
|
245
245
|
|
|
246
246
|
logger.debug(
|
|
247
247
|
"Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s",
|
|
@@ -262,7 +262,7 @@ class BaseSDK:
|
|
|
262
262
|
http_res = result
|
|
263
263
|
else:
|
|
264
264
|
logger.debug("Raising unexpected SDK error")
|
|
265
|
-
raise errors.SDKError("Unexpected error occurred")
|
|
265
|
+
raise errors.SDKError("Unexpected error occurred", http_res)
|
|
266
266
|
|
|
267
267
|
return http_res
|
|
268
268
|
|
|
@@ -313,7 +313,7 @@ class BaseSDK:
|
|
|
313
313
|
|
|
314
314
|
if http_res is None:
|
|
315
315
|
logger.debug("Raising no response SDK error")
|
|
316
|
-
raise errors.
|
|
316
|
+
raise errors.NoResponseError("No response received")
|
|
317
317
|
|
|
318
318
|
logger.debug(
|
|
319
319
|
"Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s",
|
|
@@ -334,7 +334,7 @@ class BaseSDK:
|
|
|
334
334
|
http_res = result
|
|
335
335
|
else:
|
|
336
336
|
logger.debug("Raising unexpected SDK error")
|
|
337
|
-
raise errors.SDKError("Unexpected error occurred")
|
|
337
|
+
raise errors.SDKError("Unexpected error occurred", http_res)
|
|
338
338
|
|
|
339
339
|
return http_res
|
|
340
340
|
|
dub/commissions.py
CHANGED
|
@@ -96,63 +96,58 @@ class Commissions(BaseSDK):
|
|
|
96
96
|
|
|
97
97
|
response_data: Any = None
|
|
98
98
|
if utils.match_response(http_res, "200", "application/json"):
|
|
99
|
-
return utils.
|
|
100
|
-
|
|
99
|
+
return utils.unmarshal_json_response(
|
|
100
|
+
Optional[List[operations.ListCommissionsResponseBody]], http_res
|
|
101
101
|
)
|
|
102
102
|
if utils.match_response(http_res, "400", "application/json"):
|
|
103
|
-
response_data = utils.
|
|
104
|
-
|
|
103
|
+
response_data = utils.unmarshal_json_response(
|
|
104
|
+
errors.BadRequestData, http_res
|
|
105
|
+
)
|
|
106
|
+
raise errors.BadRequest(response_data, http_res)
|
|
105
107
|
if utils.match_response(http_res, "401", "application/json"):
|
|
106
|
-
response_data = utils.
|
|
107
|
-
|
|
108
|
+
response_data = utils.unmarshal_json_response(
|
|
109
|
+
errors.UnauthorizedData, http_res
|
|
110
|
+
)
|
|
111
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
108
112
|
if utils.match_response(http_res, "403", "application/json"):
|
|
109
|
-
response_data = utils.
|
|
110
|
-
|
|
113
|
+
response_data = utils.unmarshal_json_response(
|
|
114
|
+
errors.ForbiddenData, http_res
|
|
115
|
+
)
|
|
116
|
+
raise errors.Forbidden(response_data, http_res)
|
|
111
117
|
if utils.match_response(http_res, "404", "application/json"):
|
|
112
|
-
response_data = utils.
|
|
113
|
-
raise errors.NotFound(
|
|
118
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
119
|
+
raise errors.NotFound(response_data, http_res)
|
|
114
120
|
if utils.match_response(http_res, "409", "application/json"):
|
|
115
|
-
response_data = utils.
|
|
116
|
-
raise errors.Conflict(
|
|
121
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
122
|
+
raise errors.Conflict(response_data, http_res)
|
|
117
123
|
if utils.match_response(http_res, "410", "application/json"):
|
|
118
|
-
response_data = utils.
|
|
119
|
-
|
|
124
|
+
response_data = utils.unmarshal_json_response(
|
|
125
|
+
errors.InviteExpiredData, http_res
|
|
120
126
|
)
|
|
121
|
-
raise errors.InviteExpired(
|
|
127
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
122
128
|
if utils.match_response(http_res, "422", "application/json"):
|
|
123
|
-
response_data = utils.
|
|
124
|
-
|
|
129
|
+
response_data = utils.unmarshal_json_response(
|
|
130
|
+
errors.UnprocessableEntityData, http_res
|
|
125
131
|
)
|
|
126
|
-
raise errors.UnprocessableEntity(
|
|
132
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
127
133
|
if utils.match_response(http_res, "429", "application/json"):
|
|
128
|
-
response_data = utils.
|
|
129
|
-
|
|
134
|
+
response_data = utils.unmarshal_json_response(
|
|
135
|
+
errors.RateLimitExceededData, http_res
|
|
130
136
|
)
|
|
131
|
-
raise errors.RateLimitExceeded(
|
|
137
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
132
138
|
if utils.match_response(http_res, "500", "application/json"):
|
|
133
|
-
response_data = utils.
|
|
134
|
-
|
|
139
|
+
response_data = utils.unmarshal_json_response(
|
|
140
|
+
errors.InternalServerErrorData, http_res
|
|
135
141
|
)
|
|
136
|
-
raise errors.InternalServerError(
|
|
142
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
137
143
|
if utils.match_response(http_res, "4XX", "*"):
|
|
138
144
|
http_res_text = utils.stream_to_text(http_res)
|
|
139
|
-
raise errors.SDKError(
|
|
140
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
141
|
-
)
|
|
145
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
142
146
|
if utils.match_response(http_res, "5XX", "*"):
|
|
143
147
|
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
|
-
)
|
|
148
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
147
149
|
|
|
148
|
-
|
|
149
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
150
|
-
raise errors.SDKError(
|
|
151
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
152
|
-
http_res.status_code,
|
|
153
|
-
http_res_text,
|
|
154
|
-
http_res,
|
|
155
|
-
)
|
|
150
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
156
151
|
|
|
157
152
|
async def list_async(
|
|
158
153
|
self,
|
|
@@ -241,63 +236,58 @@ class Commissions(BaseSDK):
|
|
|
241
236
|
|
|
242
237
|
response_data: Any = None
|
|
243
238
|
if utils.match_response(http_res, "200", "application/json"):
|
|
244
|
-
return utils.
|
|
245
|
-
|
|
239
|
+
return utils.unmarshal_json_response(
|
|
240
|
+
Optional[List[operations.ListCommissionsResponseBody]], http_res
|
|
246
241
|
)
|
|
247
242
|
if utils.match_response(http_res, "400", "application/json"):
|
|
248
|
-
response_data = utils.
|
|
249
|
-
|
|
243
|
+
response_data = utils.unmarshal_json_response(
|
|
244
|
+
errors.BadRequestData, http_res
|
|
245
|
+
)
|
|
246
|
+
raise errors.BadRequest(response_data, http_res)
|
|
250
247
|
if utils.match_response(http_res, "401", "application/json"):
|
|
251
|
-
response_data = utils.
|
|
252
|
-
|
|
248
|
+
response_data = utils.unmarshal_json_response(
|
|
249
|
+
errors.UnauthorizedData, http_res
|
|
250
|
+
)
|
|
251
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
253
252
|
if utils.match_response(http_res, "403", "application/json"):
|
|
254
|
-
response_data = utils.
|
|
255
|
-
|
|
253
|
+
response_data = utils.unmarshal_json_response(
|
|
254
|
+
errors.ForbiddenData, http_res
|
|
255
|
+
)
|
|
256
|
+
raise errors.Forbidden(response_data, http_res)
|
|
256
257
|
if utils.match_response(http_res, "404", "application/json"):
|
|
257
|
-
response_data = utils.
|
|
258
|
-
raise errors.NotFound(
|
|
258
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
259
|
+
raise errors.NotFound(response_data, http_res)
|
|
259
260
|
if utils.match_response(http_res, "409", "application/json"):
|
|
260
|
-
response_data = utils.
|
|
261
|
-
raise errors.Conflict(
|
|
261
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
262
|
+
raise errors.Conflict(response_data, http_res)
|
|
262
263
|
if utils.match_response(http_res, "410", "application/json"):
|
|
263
|
-
response_data = utils.
|
|
264
|
-
|
|
264
|
+
response_data = utils.unmarshal_json_response(
|
|
265
|
+
errors.InviteExpiredData, http_res
|
|
265
266
|
)
|
|
266
|
-
raise errors.InviteExpired(
|
|
267
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
267
268
|
if utils.match_response(http_res, "422", "application/json"):
|
|
268
|
-
response_data = utils.
|
|
269
|
-
|
|
269
|
+
response_data = utils.unmarshal_json_response(
|
|
270
|
+
errors.UnprocessableEntityData, http_res
|
|
270
271
|
)
|
|
271
|
-
raise errors.UnprocessableEntity(
|
|
272
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
272
273
|
if utils.match_response(http_res, "429", "application/json"):
|
|
273
|
-
response_data = utils.
|
|
274
|
-
|
|
274
|
+
response_data = utils.unmarshal_json_response(
|
|
275
|
+
errors.RateLimitExceededData, http_res
|
|
275
276
|
)
|
|
276
|
-
raise errors.RateLimitExceeded(
|
|
277
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
277
278
|
if utils.match_response(http_res, "500", "application/json"):
|
|
278
|
-
response_data = utils.
|
|
279
|
-
|
|
279
|
+
response_data = utils.unmarshal_json_response(
|
|
280
|
+
errors.InternalServerErrorData, http_res
|
|
280
281
|
)
|
|
281
|
-
raise errors.InternalServerError(
|
|
282
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
282
283
|
if utils.match_response(http_res, "4XX", "*"):
|
|
283
284
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
284
|
-
raise errors.SDKError(
|
|
285
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
286
|
-
)
|
|
285
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
287
286
|
if utils.match_response(http_res, "5XX", "*"):
|
|
288
287
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
289
|
-
raise errors.SDKError(
|
|
290
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
291
|
-
)
|
|
288
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
292
289
|
|
|
293
|
-
|
|
294
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
295
|
-
raise errors.SDKError(
|
|
296
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
297
|
-
http_res.status_code,
|
|
298
|
-
http_res_text,
|
|
299
|
-
http_res,
|
|
300
|
-
)
|
|
290
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
301
291
|
|
|
302
292
|
def update(
|
|
303
293
|
self,
|
|
@@ -393,63 +383,58 @@ class Commissions(BaseSDK):
|
|
|
393
383
|
|
|
394
384
|
response_data: Any = None
|
|
395
385
|
if utils.match_response(http_res, "200", "application/json"):
|
|
396
|
-
return utils.
|
|
397
|
-
|
|
386
|
+
return utils.unmarshal_json_response(
|
|
387
|
+
Optional[operations.UpdateCommissionResponseBody], http_res
|
|
398
388
|
)
|
|
399
389
|
if utils.match_response(http_res, "400", "application/json"):
|
|
400
|
-
response_data = utils.
|
|
401
|
-
|
|
390
|
+
response_data = utils.unmarshal_json_response(
|
|
391
|
+
errors.BadRequestData, http_res
|
|
392
|
+
)
|
|
393
|
+
raise errors.BadRequest(response_data, http_res)
|
|
402
394
|
if utils.match_response(http_res, "401", "application/json"):
|
|
403
|
-
response_data = utils.
|
|
404
|
-
|
|
395
|
+
response_data = utils.unmarshal_json_response(
|
|
396
|
+
errors.UnauthorizedData, http_res
|
|
397
|
+
)
|
|
398
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
405
399
|
if utils.match_response(http_res, "403", "application/json"):
|
|
406
|
-
response_data = utils.
|
|
407
|
-
|
|
400
|
+
response_data = utils.unmarshal_json_response(
|
|
401
|
+
errors.ForbiddenData, http_res
|
|
402
|
+
)
|
|
403
|
+
raise errors.Forbidden(response_data, http_res)
|
|
408
404
|
if utils.match_response(http_res, "404", "application/json"):
|
|
409
|
-
response_data = utils.
|
|
410
|
-
raise errors.NotFound(
|
|
405
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
406
|
+
raise errors.NotFound(response_data, http_res)
|
|
411
407
|
if utils.match_response(http_res, "409", "application/json"):
|
|
412
|
-
response_data = utils.
|
|
413
|
-
raise errors.Conflict(
|
|
408
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
409
|
+
raise errors.Conflict(response_data, http_res)
|
|
414
410
|
if utils.match_response(http_res, "410", "application/json"):
|
|
415
|
-
response_data = utils.
|
|
416
|
-
|
|
411
|
+
response_data = utils.unmarshal_json_response(
|
|
412
|
+
errors.InviteExpiredData, http_res
|
|
417
413
|
)
|
|
418
|
-
raise errors.InviteExpired(
|
|
414
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
419
415
|
if utils.match_response(http_res, "422", "application/json"):
|
|
420
|
-
response_data = utils.
|
|
421
|
-
|
|
416
|
+
response_data = utils.unmarshal_json_response(
|
|
417
|
+
errors.UnprocessableEntityData, http_res
|
|
422
418
|
)
|
|
423
|
-
raise errors.UnprocessableEntity(
|
|
419
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
424
420
|
if utils.match_response(http_res, "429", "application/json"):
|
|
425
|
-
response_data = utils.
|
|
426
|
-
|
|
421
|
+
response_data = utils.unmarshal_json_response(
|
|
422
|
+
errors.RateLimitExceededData, http_res
|
|
427
423
|
)
|
|
428
|
-
raise errors.RateLimitExceeded(
|
|
424
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
429
425
|
if utils.match_response(http_res, "500", "application/json"):
|
|
430
|
-
response_data = utils.
|
|
431
|
-
|
|
426
|
+
response_data = utils.unmarshal_json_response(
|
|
427
|
+
errors.InternalServerErrorData, http_res
|
|
432
428
|
)
|
|
433
|
-
raise errors.InternalServerError(
|
|
429
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
434
430
|
if utils.match_response(http_res, "4XX", "*"):
|
|
435
431
|
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
|
-
)
|
|
432
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
439
433
|
if utils.match_response(http_res, "5XX", "*"):
|
|
440
434
|
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
|
-
)
|
|
435
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
444
436
|
|
|
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
|
-
)
|
|
437
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
453
438
|
|
|
454
439
|
async def update_async(
|
|
455
440
|
self,
|
|
@@ -545,60 +530,55 @@ class Commissions(BaseSDK):
|
|
|
545
530
|
|
|
546
531
|
response_data: Any = None
|
|
547
532
|
if utils.match_response(http_res, "200", "application/json"):
|
|
548
|
-
return utils.
|
|
549
|
-
|
|
533
|
+
return utils.unmarshal_json_response(
|
|
534
|
+
Optional[operations.UpdateCommissionResponseBody], http_res
|
|
550
535
|
)
|
|
551
536
|
if utils.match_response(http_res, "400", "application/json"):
|
|
552
|
-
response_data = utils.
|
|
553
|
-
|
|
537
|
+
response_data = utils.unmarshal_json_response(
|
|
538
|
+
errors.BadRequestData, http_res
|
|
539
|
+
)
|
|
540
|
+
raise errors.BadRequest(response_data, http_res)
|
|
554
541
|
if utils.match_response(http_res, "401", "application/json"):
|
|
555
|
-
response_data = utils.
|
|
556
|
-
|
|
542
|
+
response_data = utils.unmarshal_json_response(
|
|
543
|
+
errors.UnauthorizedData, http_res
|
|
544
|
+
)
|
|
545
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
557
546
|
if utils.match_response(http_res, "403", "application/json"):
|
|
558
|
-
response_data = utils.
|
|
559
|
-
|
|
547
|
+
response_data = utils.unmarshal_json_response(
|
|
548
|
+
errors.ForbiddenData, http_res
|
|
549
|
+
)
|
|
550
|
+
raise errors.Forbidden(response_data, http_res)
|
|
560
551
|
if utils.match_response(http_res, "404", "application/json"):
|
|
561
|
-
response_data = utils.
|
|
562
|
-
raise errors.NotFound(
|
|
552
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
553
|
+
raise errors.NotFound(response_data, http_res)
|
|
563
554
|
if utils.match_response(http_res, "409", "application/json"):
|
|
564
|
-
response_data = utils.
|
|
565
|
-
raise errors.Conflict(
|
|
555
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
556
|
+
raise errors.Conflict(response_data, http_res)
|
|
566
557
|
if utils.match_response(http_res, "410", "application/json"):
|
|
567
|
-
response_data = utils.
|
|
568
|
-
|
|
558
|
+
response_data = utils.unmarshal_json_response(
|
|
559
|
+
errors.InviteExpiredData, http_res
|
|
569
560
|
)
|
|
570
|
-
raise errors.InviteExpired(
|
|
561
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
571
562
|
if utils.match_response(http_res, "422", "application/json"):
|
|
572
|
-
response_data = utils.
|
|
573
|
-
|
|
563
|
+
response_data = utils.unmarshal_json_response(
|
|
564
|
+
errors.UnprocessableEntityData, http_res
|
|
574
565
|
)
|
|
575
|
-
raise errors.UnprocessableEntity(
|
|
566
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
576
567
|
if utils.match_response(http_res, "429", "application/json"):
|
|
577
|
-
response_data = utils.
|
|
578
|
-
|
|
568
|
+
response_data = utils.unmarshal_json_response(
|
|
569
|
+
errors.RateLimitExceededData, http_res
|
|
579
570
|
)
|
|
580
|
-
raise errors.RateLimitExceeded(
|
|
571
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
581
572
|
if utils.match_response(http_res, "500", "application/json"):
|
|
582
|
-
response_data = utils.
|
|
583
|
-
|
|
573
|
+
response_data = utils.unmarshal_json_response(
|
|
574
|
+
errors.InternalServerErrorData, http_res
|
|
584
575
|
)
|
|
585
|
-
raise errors.InternalServerError(
|
|
576
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
586
577
|
if utils.match_response(http_res, "4XX", "*"):
|
|
587
578
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
588
|
-
raise errors.SDKError(
|
|
589
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
590
|
-
)
|
|
579
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
591
580
|
if utils.match_response(http_res, "5XX", "*"):
|
|
592
581
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
593
|
-
raise errors.SDKError(
|
|
594
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
595
|
-
)
|
|
582
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
596
583
|
|
|
597
|
-
|
|
598
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
599
|
-
raise errors.SDKError(
|
|
600
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
601
|
-
http_res.status_code,
|
|
602
|
-
http_res_text,
|
|
603
|
-
http_res,
|
|
604
|
-
)
|
|
584
|
+
raise errors.SDKError("Unexpected response received", http_res)
|