dub 0.26.12__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 +53 -78
- dub/basesdk.py +4 -4
- dub/commissions.py +105 -156
- dub/customers.py +261 -390
- dub/domains.py +309 -472
- dub/embed_tokens.py +53 -80
- dub/events.py +53 -78
- dub/folders.py +205 -316
- dub/links.py +511 -770
- 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/tracklead.py +2 -2
- dub/models/operations/tracksale.py +2 -2
- dub/models/operations/updatecustomer.py +3 -0
- dub/partners.py +255 -384
- dub/qr_codes.py +49 -74
- dub/tags.py +205 -308
- dub/track.py +105 -156
- dub/utils/serializers.py +3 -2
- dub/utils/unmarshal_json_response.py +24 -0
- dub/workspaces.py +105 -156
- {dub-0.26.12.dist-info → dub-0.27.1.dist-info}/METADATA +50 -56
- {dub-0.26.12.dist-info → dub-0.27.1.dist-info}/RECORD +41 -37
- {dub-0.26.12.dist-info → dub-0.27.1.dist-info}/LICENSE +0 -0
- {dub-0.26.12.dist-info → dub-0.27.1.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.1"
|
|
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.656.5"
|
|
9
|
+
__user_agent__: str = "speakeasy-sdk/python 0.27.1 2.656.5 0.0.1 dub"
|
|
10
10
|
|
|
11
11
|
try:
|
|
12
12
|
if __package__ is not None:
|
dub/analytics.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
|
|
|
@@ -96,63 +97,50 @@ class Analytics(BaseSDK):
|
|
|
96
97
|
|
|
97
98
|
response_data: Any = None
|
|
98
99
|
if utils.match_response(http_res, "200", "application/json"):
|
|
99
|
-
return
|
|
100
|
-
|
|
100
|
+
return unmarshal_json_response(
|
|
101
|
+
Optional[operations.RetrieveAnalyticsResponseBody], http_res
|
|
101
102
|
)
|
|
102
103
|
if utils.match_response(http_res, "400", "application/json"):
|
|
103
|
-
response_data =
|
|
104
|
-
raise errors.BadRequest(
|
|
104
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
105
|
+
raise errors.BadRequest(response_data, http_res)
|
|
105
106
|
if utils.match_response(http_res, "401", "application/json"):
|
|
106
|
-
response_data =
|
|
107
|
-
raise errors.Unauthorized(
|
|
107
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
108
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
108
109
|
if utils.match_response(http_res, "403", "application/json"):
|
|
109
|
-
response_data =
|
|
110
|
-
raise errors.Forbidden(
|
|
110
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
111
|
+
raise errors.Forbidden(response_data, http_res)
|
|
111
112
|
if utils.match_response(http_res, "404", "application/json"):
|
|
112
|
-
response_data =
|
|
113
|
-
raise errors.NotFound(
|
|
113
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
114
|
+
raise errors.NotFound(response_data, http_res)
|
|
114
115
|
if utils.match_response(http_res, "409", "application/json"):
|
|
115
|
-
response_data =
|
|
116
|
-
raise errors.Conflict(
|
|
116
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
117
|
+
raise errors.Conflict(response_data, http_res)
|
|
117
118
|
if utils.match_response(http_res, "410", "application/json"):
|
|
118
|
-
response_data =
|
|
119
|
-
|
|
120
|
-
)
|
|
121
|
-
raise errors.InviteExpired(data=response_data)
|
|
119
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
120
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
122
121
|
if utils.match_response(http_res, "422", "application/json"):
|
|
123
|
-
response_data =
|
|
124
|
-
|
|
122
|
+
response_data = unmarshal_json_response(
|
|
123
|
+
errors.UnprocessableEntityData, http_res
|
|
125
124
|
)
|
|
126
|
-
raise errors.UnprocessableEntity(
|
|
125
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
127
126
|
if utils.match_response(http_res, "429", "application/json"):
|
|
128
|
-
response_data =
|
|
129
|
-
|
|
127
|
+
response_data = unmarshal_json_response(
|
|
128
|
+
errors.RateLimitExceededData, http_res
|
|
130
129
|
)
|
|
131
|
-
raise errors.RateLimitExceeded(
|
|
130
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
132
131
|
if utils.match_response(http_res, "500", "application/json"):
|
|
133
|
-
response_data =
|
|
134
|
-
|
|
132
|
+
response_data = unmarshal_json_response(
|
|
133
|
+
errors.InternalServerErrorData, http_res
|
|
135
134
|
)
|
|
136
|
-
raise errors.InternalServerError(
|
|
135
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
137
136
|
if utils.match_response(http_res, "4XX", "*"):
|
|
138
137
|
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
|
-
)
|
|
138
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
142
139
|
if utils.match_response(http_res, "5XX", "*"):
|
|
143
140
|
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
|
-
)
|
|
141
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
147
142
|
|
|
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
|
-
)
|
|
143
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
156
144
|
|
|
157
145
|
async def retrieve_async(
|
|
158
146
|
self,
|
|
@@ -241,60 +229,47 @@ class Analytics(BaseSDK):
|
|
|
241
229
|
|
|
242
230
|
response_data: Any = None
|
|
243
231
|
if utils.match_response(http_res, "200", "application/json"):
|
|
244
|
-
return
|
|
245
|
-
|
|
232
|
+
return unmarshal_json_response(
|
|
233
|
+
Optional[operations.RetrieveAnalyticsResponseBody], http_res
|
|
246
234
|
)
|
|
247
235
|
if utils.match_response(http_res, "400", "application/json"):
|
|
248
|
-
response_data =
|
|
249
|
-
raise errors.BadRequest(
|
|
236
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
237
|
+
raise errors.BadRequest(response_data, http_res)
|
|
250
238
|
if utils.match_response(http_res, "401", "application/json"):
|
|
251
|
-
response_data =
|
|
252
|
-
raise errors.Unauthorized(
|
|
239
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
240
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
253
241
|
if utils.match_response(http_res, "403", "application/json"):
|
|
254
|
-
response_data =
|
|
255
|
-
raise errors.Forbidden(
|
|
242
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
243
|
+
raise errors.Forbidden(response_data, http_res)
|
|
256
244
|
if utils.match_response(http_res, "404", "application/json"):
|
|
257
|
-
response_data =
|
|
258
|
-
raise errors.NotFound(
|
|
245
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
246
|
+
raise errors.NotFound(response_data, http_res)
|
|
259
247
|
if utils.match_response(http_res, "409", "application/json"):
|
|
260
|
-
response_data =
|
|
261
|
-
raise errors.Conflict(
|
|
248
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
249
|
+
raise errors.Conflict(response_data, http_res)
|
|
262
250
|
if utils.match_response(http_res, "410", "application/json"):
|
|
263
|
-
response_data =
|
|
264
|
-
|
|
265
|
-
)
|
|
266
|
-
raise errors.InviteExpired(data=response_data)
|
|
251
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
252
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
267
253
|
if utils.match_response(http_res, "422", "application/json"):
|
|
268
|
-
response_data =
|
|
269
|
-
|
|
254
|
+
response_data = unmarshal_json_response(
|
|
255
|
+
errors.UnprocessableEntityData, http_res
|
|
270
256
|
)
|
|
271
|
-
raise errors.UnprocessableEntity(
|
|
257
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
272
258
|
if utils.match_response(http_res, "429", "application/json"):
|
|
273
|
-
response_data =
|
|
274
|
-
|
|
259
|
+
response_data = unmarshal_json_response(
|
|
260
|
+
errors.RateLimitExceededData, http_res
|
|
275
261
|
)
|
|
276
|
-
raise errors.RateLimitExceeded(
|
|
262
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
277
263
|
if utils.match_response(http_res, "500", "application/json"):
|
|
278
|
-
response_data =
|
|
279
|
-
|
|
264
|
+
response_data = unmarshal_json_response(
|
|
265
|
+
errors.InternalServerErrorData, http_res
|
|
280
266
|
)
|
|
281
|
-
raise errors.InternalServerError(
|
|
267
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
282
268
|
if utils.match_response(http_res, "4XX", "*"):
|
|
283
269
|
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
|
-
)
|
|
270
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
287
271
|
if utils.match_response(http_res, "5XX", "*"):
|
|
288
272
|
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
|
-
)
|
|
273
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
292
274
|
|
|
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
|
-
)
|
|
275
|
+
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
|
@@ -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
|
|
|
@@ -96,63 +97,50 @@ class Commissions(BaseSDK):
|
|
|
96
97
|
|
|
97
98
|
response_data: Any = None
|
|
98
99
|
if utils.match_response(http_res, "200", "application/json"):
|
|
99
|
-
return
|
|
100
|
-
|
|
100
|
+
return unmarshal_json_response(
|
|
101
|
+
Optional[List[operations.ListCommissionsResponseBody]], http_res
|
|
101
102
|
)
|
|
102
103
|
if utils.match_response(http_res, "400", "application/json"):
|
|
103
|
-
response_data =
|
|
104
|
-
raise errors.BadRequest(
|
|
104
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
105
|
+
raise errors.BadRequest(response_data, http_res)
|
|
105
106
|
if utils.match_response(http_res, "401", "application/json"):
|
|
106
|
-
response_data =
|
|
107
|
-
raise errors.Unauthorized(
|
|
107
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
108
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
108
109
|
if utils.match_response(http_res, "403", "application/json"):
|
|
109
|
-
response_data =
|
|
110
|
-
raise errors.Forbidden(
|
|
110
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
111
|
+
raise errors.Forbidden(response_data, http_res)
|
|
111
112
|
if utils.match_response(http_res, "404", "application/json"):
|
|
112
|
-
response_data =
|
|
113
|
-
raise errors.NotFound(
|
|
113
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
114
|
+
raise errors.NotFound(response_data, http_res)
|
|
114
115
|
if utils.match_response(http_res, "409", "application/json"):
|
|
115
|
-
response_data =
|
|
116
|
-
raise errors.Conflict(
|
|
116
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
117
|
+
raise errors.Conflict(response_data, http_res)
|
|
117
118
|
if utils.match_response(http_res, "410", "application/json"):
|
|
118
|
-
response_data =
|
|
119
|
-
|
|
120
|
-
)
|
|
121
|
-
raise errors.InviteExpired(data=response_data)
|
|
119
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
120
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
122
121
|
if utils.match_response(http_res, "422", "application/json"):
|
|
123
|
-
response_data =
|
|
124
|
-
|
|
122
|
+
response_data = unmarshal_json_response(
|
|
123
|
+
errors.UnprocessableEntityData, http_res
|
|
125
124
|
)
|
|
126
|
-
raise errors.UnprocessableEntity(
|
|
125
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
127
126
|
if utils.match_response(http_res, "429", "application/json"):
|
|
128
|
-
response_data =
|
|
129
|
-
|
|
127
|
+
response_data = unmarshal_json_response(
|
|
128
|
+
errors.RateLimitExceededData, http_res
|
|
130
129
|
)
|
|
131
|
-
raise errors.RateLimitExceeded(
|
|
130
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
132
131
|
if utils.match_response(http_res, "500", "application/json"):
|
|
133
|
-
response_data =
|
|
134
|
-
|
|
132
|
+
response_data = unmarshal_json_response(
|
|
133
|
+
errors.InternalServerErrorData, http_res
|
|
135
134
|
)
|
|
136
|
-
raise errors.InternalServerError(
|
|
135
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
137
136
|
if utils.match_response(http_res, "4XX", "*"):
|
|
138
137
|
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
|
-
)
|
|
138
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
142
139
|
if utils.match_response(http_res, "5XX", "*"):
|
|
143
140
|
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
|
-
)
|
|
141
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
147
142
|
|
|
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
|
-
)
|
|
143
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
156
144
|
|
|
157
145
|
async def list_async(
|
|
158
146
|
self,
|
|
@@ -241,63 +229,50 @@ class Commissions(BaseSDK):
|
|
|
241
229
|
|
|
242
230
|
response_data: Any = None
|
|
243
231
|
if utils.match_response(http_res, "200", "application/json"):
|
|
244
|
-
return
|
|
245
|
-
|
|
232
|
+
return unmarshal_json_response(
|
|
233
|
+
Optional[List[operations.ListCommissionsResponseBody]], http_res
|
|
246
234
|
)
|
|
247
235
|
if utils.match_response(http_res, "400", "application/json"):
|
|
248
|
-
response_data =
|
|
249
|
-
raise errors.BadRequest(
|
|
236
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
237
|
+
raise errors.BadRequest(response_data, http_res)
|
|
250
238
|
if utils.match_response(http_res, "401", "application/json"):
|
|
251
|
-
response_data =
|
|
252
|
-
raise errors.Unauthorized(
|
|
239
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
240
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
253
241
|
if utils.match_response(http_res, "403", "application/json"):
|
|
254
|
-
response_data =
|
|
255
|
-
raise errors.Forbidden(
|
|
242
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
243
|
+
raise errors.Forbidden(response_data, http_res)
|
|
256
244
|
if utils.match_response(http_res, "404", "application/json"):
|
|
257
|
-
response_data =
|
|
258
|
-
raise errors.NotFound(
|
|
245
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
246
|
+
raise errors.NotFound(response_data, http_res)
|
|
259
247
|
if utils.match_response(http_res, "409", "application/json"):
|
|
260
|
-
response_data =
|
|
261
|
-
raise errors.Conflict(
|
|
248
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
249
|
+
raise errors.Conflict(response_data, http_res)
|
|
262
250
|
if utils.match_response(http_res, "410", "application/json"):
|
|
263
|
-
response_data =
|
|
264
|
-
|
|
265
|
-
)
|
|
266
|
-
raise errors.InviteExpired(data=response_data)
|
|
251
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
252
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
267
253
|
if utils.match_response(http_res, "422", "application/json"):
|
|
268
|
-
response_data =
|
|
269
|
-
|
|
254
|
+
response_data = unmarshal_json_response(
|
|
255
|
+
errors.UnprocessableEntityData, http_res
|
|
270
256
|
)
|
|
271
|
-
raise errors.UnprocessableEntity(
|
|
257
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
272
258
|
if utils.match_response(http_res, "429", "application/json"):
|
|
273
|
-
response_data =
|
|
274
|
-
|
|
259
|
+
response_data = unmarshal_json_response(
|
|
260
|
+
errors.RateLimitExceededData, http_res
|
|
275
261
|
)
|
|
276
|
-
raise errors.RateLimitExceeded(
|
|
262
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
277
263
|
if utils.match_response(http_res, "500", "application/json"):
|
|
278
|
-
response_data =
|
|
279
|
-
|
|
264
|
+
response_data = unmarshal_json_response(
|
|
265
|
+
errors.InternalServerErrorData, http_res
|
|
280
266
|
)
|
|
281
|
-
raise errors.InternalServerError(
|
|
267
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
282
268
|
if utils.match_response(http_res, "4XX", "*"):
|
|
283
269
|
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
|
-
)
|
|
270
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
287
271
|
if utils.match_response(http_res, "5XX", "*"):
|
|
288
272
|
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
|
-
)
|
|
273
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
292
274
|
|
|
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
|
-
)
|
|
275
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
301
276
|
|
|
302
277
|
def update(
|
|
303
278
|
self,
|
|
@@ -393,63 +368,50 @@ class Commissions(BaseSDK):
|
|
|
393
368
|
|
|
394
369
|
response_data: Any = None
|
|
395
370
|
if utils.match_response(http_res, "200", "application/json"):
|
|
396
|
-
return
|
|
397
|
-
|
|
371
|
+
return unmarshal_json_response(
|
|
372
|
+
Optional[operations.UpdateCommissionResponseBody], http_res
|
|
398
373
|
)
|
|
399
374
|
if utils.match_response(http_res, "400", "application/json"):
|
|
400
|
-
response_data =
|
|
401
|
-
raise errors.BadRequest(
|
|
375
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
376
|
+
raise errors.BadRequest(response_data, http_res)
|
|
402
377
|
if utils.match_response(http_res, "401", "application/json"):
|
|
403
|
-
response_data =
|
|
404
|
-
raise errors.Unauthorized(
|
|
378
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
379
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
405
380
|
if utils.match_response(http_res, "403", "application/json"):
|
|
406
|
-
response_data =
|
|
407
|
-
raise errors.Forbidden(
|
|
381
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
382
|
+
raise errors.Forbidden(response_data, http_res)
|
|
408
383
|
if utils.match_response(http_res, "404", "application/json"):
|
|
409
|
-
response_data =
|
|
410
|
-
raise errors.NotFound(
|
|
384
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
385
|
+
raise errors.NotFound(response_data, http_res)
|
|
411
386
|
if utils.match_response(http_res, "409", "application/json"):
|
|
412
|
-
response_data =
|
|
413
|
-
raise errors.Conflict(
|
|
387
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
388
|
+
raise errors.Conflict(response_data, http_res)
|
|
414
389
|
if utils.match_response(http_res, "410", "application/json"):
|
|
415
|
-
response_data =
|
|
416
|
-
|
|
417
|
-
)
|
|
418
|
-
raise errors.InviteExpired(data=response_data)
|
|
390
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
391
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
419
392
|
if utils.match_response(http_res, "422", "application/json"):
|
|
420
|
-
response_data =
|
|
421
|
-
|
|
393
|
+
response_data = unmarshal_json_response(
|
|
394
|
+
errors.UnprocessableEntityData, http_res
|
|
422
395
|
)
|
|
423
|
-
raise errors.UnprocessableEntity(
|
|
396
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
424
397
|
if utils.match_response(http_res, "429", "application/json"):
|
|
425
|
-
response_data =
|
|
426
|
-
|
|
398
|
+
response_data = unmarshal_json_response(
|
|
399
|
+
errors.RateLimitExceededData, http_res
|
|
427
400
|
)
|
|
428
|
-
raise errors.RateLimitExceeded(
|
|
401
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
429
402
|
if utils.match_response(http_res, "500", "application/json"):
|
|
430
|
-
response_data =
|
|
431
|
-
|
|
403
|
+
response_data = unmarshal_json_response(
|
|
404
|
+
errors.InternalServerErrorData, http_res
|
|
432
405
|
)
|
|
433
|
-
raise errors.InternalServerError(
|
|
406
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
434
407
|
if utils.match_response(http_res, "4XX", "*"):
|
|
435
408
|
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
|
-
)
|
|
409
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
439
410
|
if utils.match_response(http_res, "5XX", "*"):
|
|
440
411
|
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
|
-
)
|
|
412
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
444
413
|
|
|
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
|
-
)
|
|
414
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
453
415
|
|
|
454
416
|
async def update_async(
|
|
455
417
|
self,
|
|
@@ -545,60 +507,47 @@ class Commissions(BaseSDK):
|
|
|
545
507
|
|
|
546
508
|
response_data: Any = None
|
|
547
509
|
if utils.match_response(http_res, "200", "application/json"):
|
|
548
|
-
return
|
|
549
|
-
|
|
510
|
+
return unmarshal_json_response(
|
|
511
|
+
Optional[operations.UpdateCommissionResponseBody], http_res
|
|
550
512
|
)
|
|
551
513
|
if utils.match_response(http_res, "400", "application/json"):
|
|
552
|
-
response_data =
|
|
553
|
-
raise errors.BadRequest(
|
|
514
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
515
|
+
raise errors.BadRequest(response_data, http_res)
|
|
554
516
|
if utils.match_response(http_res, "401", "application/json"):
|
|
555
|
-
response_data =
|
|
556
|
-
raise errors.Unauthorized(
|
|
517
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
518
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
557
519
|
if utils.match_response(http_res, "403", "application/json"):
|
|
558
|
-
response_data =
|
|
559
|
-
raise errors.Forbidden(
|
|
520
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
521
|
+
raise errors.Forbidden(response_data, http_res)
|
|
560
522
|
if utils.match_response(http_res, "404", "application/json"):
|
|
561
|
-
response_data =
|
|
562
|
-
raise errors.NotFound(
|
|
523
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
524
|
+
raise errors.NotFound(response_data, http_res)
|
|
563
525
|
if utils.match_response(http_res, "409", "application/json"):
|
|
564
|
-
response_data =
|
|
565
|
-
raise errors.Conflict(
|
|
526
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
527
|
+
raise errors.Conflict(response_data, http_res)
|
|
566
528
|
if utils.match_response(http_res, "410", "application/json"):
|
|
567
|
-
response_data =
|
|
568
|
-
|
|
569
|
-
)
|
|
570
|
-
raise errors.InviteExpired(data=response_data)
|
|
529
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
530
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
571
531
|
if utils.match_response(http_res, "422", "application/json"):
|
|
572
|
-
response_data =
|
|
573
|
-
|
|
532
|
+
response_data = unmarshal_json_response(
|
|
533
|
+
errors.UnprocessableEntityData, http_res
|
|
574
534
|
)
|
|
575
|
-
raise errors.UnprocessableEntity(
|
|
535
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
576
536
|
if utils.match_response(http_res, "429", "application/json"):
|
|
577
|
-
response_data =
|
|
578
|
-
|
|
537
|
+
response_data = unmarshal_json_response(
|
|
538
|
+
errors.RateLimitExceededData, http_res
|
|
579
539
|
)
|
|
580
|
-
raise errors.RateLimitExceeded(
|
|
540
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
581
541
|
if utils.match_response(http_res, "500", "application/json"):
|
|
582
|
-
response_data =
|
|
583
|
-
|
|
542
|
+
response_data = unmarshal_json_response(
|
|
543
|
+
errors.InternalServerErrorData, http_res
|
|
584
544
|
)
|
|
585
|
-
raise errors.InternalServerError(
|
|
545
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
586
546
|
if utils.match_response(http_res, "4XX", "*"):
|
|
587
547
|
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
|
-
)
|
|
548
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
591
549
|
if utils.match_response(http_res, "5XX", "*"):
|
|
592
550
|
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
|
-
)
|
|
551
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
596
552
|
|
|
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
|
-
)
|
|
553
|
+
raise errors.SDKError("Unexpected response received", http_res)
|