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/partners.py
CHANGED
|
@@ -107,63 +107,58 @@ class Partners(BaseSDK):
|
|
|
107
107
|
|
|
108
108
|
response_data: Any = None
|
|
109
109
|
if utils.match_response(http_res, "201", "application/json"):
|
|
110
|
-
return utils.
|
|
111
|
-
|
|
110
|
+
return utils.unmarshal_json_response(
|
|
111
|
+
Optional[operations.CreatePartnerResponseBody], http_res
|
|
112
112
|
)
|
|
113
113
|
if utils.match_response(http_res, "400", "application/json"):
|
|
114
|
-
response_data = utils.
|
|
115
|
-
|
|
114
|
+
response_data = utils.unmarshal_json_response(
|
|
115
|
+
errors.BadRequestData, http_res
|
|
116
|
+
)
|
|
117
|
+
raise errors.BadRequest(response_data, http_res)
|
|
116
118
|
if utils.match_response(http_res, "401", "application/json"):
|
|
117
|
-
response_data = utils.
|
|
118
|
-
|
|
119
|
+
response_data = utils.unmarshal_json_response(
|
|
120
|
+
errors.UnauthorizedData, http_res
|
|
121
|
+
)
|
|
122
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
119
123
|
if utils.match_response(http_res, "403", "application/json"):
|
|
120
|
-
response_data = utils.
|
|
121
|
-
|
|
124
|
+
response_data = utils.unmarshal_json_response(
|
|
125
|
+
errors.ForbiddenData, http_res
|
|
126
|
+
)
|
|
127
|
+
raise errors.Forbidden(response_data, http_res)
|
|
122
128
|
if utils.match_response(http_res, "404", "application/json"):
|
|
123
|
-
response_data = utils.
|
|
124
|
-
raise errors.NotFound(
|
|
129
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
130
|
+
raise errors.NotFound(response_data, http_res)
|
|
125
131
|
if utils.match_response(http_res, "409", "application/json"):
|
|
126
|
-
response_data = utils.
|
|
127
|
-
raise errors.Conflict(
|
|
132
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
133
|
+
raise errors.Conflict(response_data, http_res)
|
|
128
134
|
if utils.match_response(http_res, "410", "application/json"):
|
|
129
|
-
response_data = utils.
|
|
130
|
-
|
|
135
|
+
response_data = utils.unmarshal_json_response(
|
|
136
|
+
errors.InviteExpiredData, http_res
|
|
131
137
|
)
|
|
132
|
-
raise errors.InviteExpired(
|
|
138
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
133
139
|
if utils.match_response(http_res, "422", "application/json"):
|
|
134
|
-
response_data = utils.
|
|
135
|
-
|
|
140
|
+
response_data = utils.unmarshal_json_response(
|
|
141
|
+
errors.UnprocessableEntityData, http_res
|
|
136
142
|
)
|
|
137
|
-
raise errors.UnprocessableEntity(
|
|
143
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
138
144
|
if utils.match_response(http_res, "429", "application/json"):
|
|
139
|
-
response_data = utils.
|
|
140
|
-
|
|
145
|
+
response_data = utils.unmarshal_json_response(
|
|
146
|
+
errors.RateLimitExceededData, http_res
|
|
141
147
|
)
|
|
142
|
-
raise errors.RateLimitExceeded(
|
|
148
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
143
149
|
if utils.match_response(http_res, "500", "application/json"):
|
|
144
|
-
response_data = utils.
|
|
145
|
-
|
|
150
|
+
response_data = utils.unmarshal_json_response(
|
|
151
|
+
errors.InternalServerErrorData, http_res
|
|
146
152
|
)
|
|
147
|
-
raise errors.InternalServerError(
|
|
153
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
148
154
|
if utils.match_response(http_res, "4XX", "*"):
|
|
149
155
|
http_res_text = utils.stream_to_text(http_res)
|
|
150
|
-
raise errors.SDKError(
|
|
151
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
152
|
-
)
|
|
156
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
153
157
|
if utils.match_response(http_res, "5XX", "*"):
|
|
154
158
|
http_res_text = utils.stream_to_text(http_res)
|
|
155
|
-
raise errors.SDKError(
|
|
156
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
157
|
-
)
|
|
159
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
158
160
|
|
|
159
|
-
|
|
160
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
161
|
-
raise errors.SDKError(
|
|
162
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
163
|
-
http_res.status_code,
|
|
164
|
-
http_res_text,
|
|
165
|
-
http_res,
|
|
166
|
-
)
|
|
161
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
167
162
|
|
|
168
163
|
async def create_async(
|
|
169
164
|
self,
|
|
@@ -263,63 +258,58 @@ class Partners(BaseSDK):
|
|
|
263
258
|
|
|
264
259
|
response_data: Any = None
|
|
265
260
|
if utils.match_response(http_res, "201", "application/json"):
|
|
266
|
-
return utils.
|
|
267
|
-
|
|
261
|
+
return utils.unmarshal_json_response(
|
|
262
|
+
Optional[operations.CreatePartnerResponseBody], http_res
|
|
268
263
|
)
|
|
269
264
|
if utils.match_response(http_res, "400", "application/json"):
|
|
270
|
-
response_data = utils.
|
|
271
|
-
|
|
265
|
+
response_data = utils.unmarshal_json_response(
|
|
266
|
+
errors.BadRequestData, http_res
|
|
267
|
+
)
|
|
268
|
+
raise errors.BadRequest(response_data, http_res)
|
|
272
269
|
if utils.match_response(http_res, "401", "application/json"):
|
|
273
|
-
response_data = utils.
|
|
274
|
-
|
|
270
|
+
response_data = utils.unmarshal_json_response(
|
|
271
|
+
errors.UnauthorizedData, http_res
|
|
272
|
+
)
|
|
273
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
275
274
|
if utils.match_response(http_res, "403", "application/json"):
|
|
276
|
-
response_data = utils.
|
|
277
|
-
|
|
275
|
+
response_data = utils.unmarshal_json_response(
|
|
276
|
+
errors.ForbiddenData, http_res
|
|
277
|
+
)
|
|
278
|
+
raise errors.Forbidden(response_data, http_res)
|
|
278
279
|
if utils.match_response(http_res, "404", "application/json"):
|
|
279
|
-
response_data = utils.
|
|
280
|
-
raise errors.NotFound(
|
|
280
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
281
|
+
raise errors.NotFound(response_data, http_res)
|
|
281
282
|
if utils.match_response(http_res, "409", "application/json"):
|
|
282
|
-
response_data = utils.
|
|
283
|
-
raise errors.Conflict(
|
|
283
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
284
|
+
raise errors.Conflict(response_data, http_res)
|
|
284
285
|
if utils.match_response(http_res, "410", "application/json"):
|
|
285
|
-
response_data = utils.
|
|
286
|
-
|
|
286
|
+
response_data = utils.unmarshal_json_response(
|
|
287
|
+
errors.InviteExpiredData, http_res
|
|
287
288
|
)
|
|
288
|
-
raise errors.InviteExpired(
|
|
289
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
289
290
|
if utils.match_response(http_res, "422", "application/json"):
|
|
290
|
-
response_data = utils.
|
|
291
|
-
|
|
291
|
+
response_data = utils.unmarshal_json_response(
|
|
292
|
+
errors.UnprocessableEntityData, http_res
|
|
292
293
|
)
|
|
293
|
-
raise errors.UnprocessableEntity(
|
|
294
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
294
295
|
if utils.match_response(http_res, "429", "application/json"):
|
|
295
|
-
response_data = utils.
|
|
296
|
-
|
|
296
|
+
response_data = utils.unmarshal_json_response(
|
|
297
|
+
errors.RateLimitExceededData, http_res
|
|
297
298
|
)
|
|
298
|
-
raise errors.RateLimitExceeded(
|
|
299
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
299
300
|
if utils.match_response(http_res, "500", "application/json"):
|
|
300
|
-
response_data = utils.
|
|
301
|
-
|
|
301
|
+
response_data = utils.unmarshal_json_response(
|
|
302
|
+
errors.InternalServerErrorData, http_res
|
|
302
303
|
)
|
|
303
|
-
raise errors.InternalServerError(
|
|
304
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
304
305
|
if utils.match_response(http_res, "4XX", "*"):
|
|
305
306
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
306
|
-
raise errors.SDKError(
|
|
307
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
308
|
-
)
|
|
307
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
309
308
|
if utils.match_response(http_res, "5XX", "*"):
|
|
310
309
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
311
|
-
raise errors.SDKError(
|
|
312
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
313
|
-
)
|
|
310
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
314
311
|
|
|
315
|
-
|
|
316
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
317
|
-
raise errors.SDKError(
|
|
318
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
319
|
-
http_res.status_code,
|
|
320
|
-
http_res_text,
|
|
321
|
-
http_res,
|
|
322
|
-
)
|
|
312
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
323
313
|
|
|
324
314
|
def create_link(
|
|
325
315
|
self,
|
|
@@ -419,61 +409,58 @@ class Partners(BaseSDK):
|
|
|
419
409
|
|
|
420
410
|
response_data: Any = None
|
|
421
411
|
if utils.match_response(http_res, "201", "application/json"):
|
|
422
|
-
return utils.
|
|
412
|
+
return utils.unmarshal_json_response(
|
|
413
|
+
Optional[components.LinkSchema], http_res
|
|
414
|
+
)
|
|
423
415
|
if utils.match_response(http_res, "400", "application/json"):
|
|
424
|
-
response_data = utils.
|
|
425
|
-
|
|
416
|
+
response_data = utils.unmarshal_json_response(
|
|
417
|
+
errors.BadRequestData, http_res
|
|
418
|
+
)
|
|
419
|
+
raise errors.BadRequest(response_data, http_res)
|
|
426
420
|
if utils.match_response(http_res, "401", "application/json"):
|
|
427
|
-
response_data = utils.
|
|
428
|
-
|
|
421
|
+
response_data = utils.unmarshal_json_response(
|
|
422
|
+
errors.UnauthorizedData, http_res
|
|
423
|
+
)
|
|
424
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
429
425
|
if utils.match_response(http_res, "403", "application/json"):
|
|
430
|
-
response_data = utils.
|
|
431
|
-
|
|
426
|
+
response_data = utils.unmarshal_json_response(
|
|
427
|
+
errors.ForbiddenData, http_res
|
|
428
|
+
)
|
|
429
|
+
raise errors.Forbidden(response_data, http_res)
|
|
432
430
|
if utils.match_response(http_res, "404", "application/json"):
|
|
433
|
-
response_data = utils.
|
|
434
|
-
raise errors.NotFound(
|
|
431
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
432
|
+
raise errors.NotFound(response_data, http_res)
|
|
435
433
|
if utils.match_response(http_res, "409", "application/json"):
|
|
436
|
-
response_data = utils.
|
|
437
|
-
raise errors.Conflict(
|
|
434
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
435
|
+
raise errors.Conflict(response_data, http_res)
|
|
438
436
|
if utils.match_response(http_res, "410", "application/json"):
|
|
439
|
-
response_data = utils.
|
|
440
|
-
|
|
437
|
+
response_data = utils.unmarshal_json_response(
|
|
438
|
+
errors.InviteExpiredData, http_res
|
|
441
439
|
)
|
|
442
|
-
raise errors.InviteExpired(
|
|
440
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
443
441
|
if utils.match_response(http_res, "422", "application/json"):
|
|
444
|
-
response_data = utils.
|
|
445
|
-
|
|
442
|
+
response_data = utils.unmarshal_json_response(
|
|
443
|
+
errors.UnprocessableEntityData, http_res
|
|
446
444
|
)
|
|
447
|
-
raise errors.UnprocessableEntity(
|
|
445
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
448
446
|
if utils.match_response(http_res, "429", "application/json"):
|
|
449
|
-
response_data = utils.
|
|
450
|
-
|
|
447
|
+
response_data = utils.unmarshal_json_response(
|
|
448
|
+
errors.RateLimitExceededData, http_res
|
|
451
449
|
)
|
|
452
|
-
raise errors.RateLimitExceeded(
|
|
450
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
453
451
|
if utils.match_response(http_res, "500", "application/json"):
|
|
454
|
-
response_data = utils.
|
|
455
|
-
|
|
452
|
+
response_data = utils.unmarshal_json_response(
|
|
453
|
+
errors.InternalServerErrorData, http_res
|
|
456
454
|
)
|
|
457
|
-
raise errors.InternalServerError(
|
|
455
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
458
456
|
if utils.match_response(http_res, "4XX", "*"):
|
|
459
457
|
http_res_text = utils.stream_to_text(http_res)
|
|
460
|
-
raise errors.SDKError(
|
|
461
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
462
|
-
)
|
|
458
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
463
459
|
if utils.match_response(http_res, "5XX", "*"):
|
|
464
460
|
http_res_text = utils.stream_to_text(http_res)
|
|
465
|
-
raise errors.SDKError(
|
|
466
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
467
|
-
)
|
|
461
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
468
462
|
|
|
469
|
-
|
|
470
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
471
|
-
raise errors.SDKError(
|
|
472
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
473
|
-
http_res.status_code,
|
|
474
|
-
http_res_text,
|
|
475
|
-
http_res,
|
|
476
|
-
)
|
|
463
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
477
464
|
|
|
478
465
|
async def create_link_async(
|
|
479
466
|
self,
|
|
@@ -573,61 +560,58 @@ class Partners(BaseSDK):
|
|
|
573
560
|
|
|
574
561
|
response_data: Any = None
|
|
575
562
|
if utils.match_response(http_res, "201", "application/json"):
|
|
576
|
-
return utils.
|
|
563
|
+
return utils.unmarshal_json_response(
|
|
564
|
+
Optional[components.LinkSchema], http_res
|
|
565
|
+
)
|
|
577
566
|
if utils.match_response(http_res, "400", "application/json"):
|
|
578
|
-
response_data = utils.
|
|
579
|
-
|
|
567
|
+
response_data = utils.unmarshal_json_response(
|
|
568
|
+
errors.BadRequestData, http_res
|
|
569
|
+
)
|
|
570
|
+
raise errors.BadRequest(response_data, http_res)
|
|
580
571
|
if utils.match_response(http_res, "401", "application/json"):
|
|
581
|
-
response_data = utils.
|
|
582
|
-
|
|
572
|
+
response_data = utils.unmarshal_json_response(
|
|
573
|
+
errors.UnauthorizedData, http_res
|
|
574
|
+
)
|
|
575
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
583
576
|
if utils.match_response(http_res, "403", "application/json"):
|
|
584
|
-
response_data = utils.
|
|
585
|
-
|
|
577
|
+
response_data = utils.unmarshal_json_response(
|
|
578
|
+
errors.ForbiddenData, http_res
|
|
579
|
+
)
|
|
580
|
+
raise errors.Forbidden(response_data, http_res)
|
|
586
581
|
if utils.match_response(http_res, "404", "application/json"):
|
|
587
|
-
response_data = utils.
|
|
588
|
-
raise errors.NotFound(
|
|
582
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
583
|
+
raise errors.NotFound(response_data, http_res)
|
|
589
584
|
if utils.match_response(http_res, "409", "application/json"):
|
|
590
|
-
response_data = utils.
|
|
591
|
-
raise errors.Conflict(
|
|
585
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
586
|
+
raise errors.Conflict(response_data, http_res)
|
|
592
587
|
if utils.match_response(http_res, "410", "application/json"):
|
|
593
|
-
response_data = utils.
|
|
594
|
-
|
|
588
|
+
response_data = utils.unmarshal_json_response(
|
|
589
|
+
errors.InviteExpiredData, http_res
|
|
595
590
|
)
|
|
596
|
-
raise errors.InviteExpired(
|
|
591
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
597
592
|
if utils.match_response(http_res, "422", "application/json"):
|
|
598
|
-
response_data = utils.
|
|
599
|
-
|
|
593
|
+
response_data = utils.unmarshal_json_response(
|
|
594
|
+
errors.UnprocessableEntityData, http_res
|
|
600
595
|
)
|
|
601
|
-
raise errors.UnprocessableEntity(
|
|
596
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
602
597
|
if utils.match_response(http_res, "429", "application/json"):
|
|
603
|
-
response_data = utils.
|
|
604
|
-
|
|
598
|
+
response_data = utils.unmarshal_json_response(
|
|
599
|
+
errors.RateLimitExceededData, http_res
|
|
605
600
|
)
|
|
606
|
-
raise errors.RateLimitExceeded(
|
|
601
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
607
602
|
if utils.match_response(http_res, "500", "application/json"):
|
|
608
|
-
response_data = utils.
|
|
609
|
-
|
|
603
|
+
response_data = utils.unmarshal_json_response(
|
|
604
|
+
errors.InternalServerErrorData, http_res
|
|
610
605
|
)
|
|
611
|
-
raise errors.InternalServerError(
|
|
606
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
612
607
|
if utils.match_response(http_res, "4XX", "*"):
|
|
613
608
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
614
|
-
raise errors.SDKError(
|
|
615
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
616
|
-
)
|
|
609
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
617
610
|
if utils.match_response(http_res, "5XX", "*"):
|
|
618
611
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
619
|
-
raise errors.SDKError(
|
|
620
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
621
|
-
)
|
|
612
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
622
613
|
|
|
623
|
-
|
|
624
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
625
|
-
raise errors.SDKError(
|
|
626
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
627
|
-
http_res.status_code,
|
|
628
|
-
http_res_text,
|
|
629
|
-
http_res,
|
|
630
|
-
)
|
|
614
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
631
615
|
|
|
632
616
|
def retrieve_links(
|
|
633
617
|
self,
|
|
@@ -715,61 +699,58 @@ class Partners(BaseSDK):
|
|
|
715
699
|
|
|
716
700
|
response_data: Any = None
|
|
717
701
|
if utils.match_response(http_res, "200", "application/json"):
|
|
718
|
-
return utils.
|
|
702
|
+
return utils.unmarshal_json_response(
|
|
703
|
+
Optional[List[operations.Link]], http_res
|
|
704
|
+
)
|
|
719
705
|
if utils.match_response(http_res, "400", "application/json"):
|
|
720
|
-
response_data = utils.
|
|
721
|
-
|
|
706
|
+
response_data = utils.unmarshal_json_response(
|
|
707
|
+
errors.BadRequestData, http_res
|
|
708
|
+
)
|
|
709
|
+
raise errors.BadRequest(response_data, http_res)
|
|
722
710
|
if utils.match_response(http_res, "401", "application/json"):
|
|
723
|
-
response_data = utils.
|
|
724
|
-
|
|
711
|
+
response_data = utils.unmarshal_json_response(
|
|
712
|
+
errors.UnauthorizedData, http_res
|
|
713
|
+
)
|
|
714
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
725
715
|
if utils.match_response(http_res, "403", "application/json"):
|
|
726
|
-
response_data = utils.
|
|
727
|
-
|
|
716
|
+
response_data = utils.unmarshal_json_response(
|
|
717
|
+
errors.ForbiddenData, http_res
|
|
718
|
+
)
|
|
719
|
+
raise errors.Forbidden(response_data, http_res)
|
|
728
720
|
if utils.match_response(http_res, "404", "application/json"):
|
|
729
|
-
response_data = utils.
|
|
730
|
-
raise errors.NotFound(
|
|
721
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
722
|
+
raise errors.NotFound(response_data, http_res)
|
|
731
723
|
if utils.match_response(http_res, "409", "application/json"):
|
|
732
|
-
response_data = utils.
|
|
733
|
-
raise errors.Conflict(
|
|
724
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
725
|
+
raise errors.Conflict(response_data, http_res)
|
|
734
726
|
if utils.match_response(http_res, "410", "application/json"):
|
|
735
|
-
response_data = utils.
|
|
736
|
-
|
|
727
|
+
response_data = utils.unmarshal_json_response(
|
|
728
|
+
errors.InviteExpiredData, http_res
|
|
737
729
|
)
|
|
738
|
-
raise errors.InviteExpired(
|
|
730
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
739
731
|
if utils.match_response(http_res, "422", "application/json"):
|
|
740
|
-
response_data = utils.
|
|
741
|
-
|
|
732
|
+
response_data = utils.unmarshal_json_response(
|
|
733
|
+
errors.UnprocessableEntityData, http_res
|
|
742
734
|
)
|
|
743
|
-
raise errors.UnprocessableEntity(
|
|
735
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
744
736
|
if utils.match_response(http_res, "429", "application/json"):
|
|
745
|
-
response_data = utils.
|
|
746
|
-
|
|
737
|
+
response_data = utils.unmarshal_json_response(
|
|
738
|
+
errors.RateLimitExceededData, http_res
|
|
747
739
|
)
|
|
748
|
-
raise errors.RateLimitExceeded(
|
|
740
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
749
741
|
if utils.match_response(http_res, "500", "application/json"):
|
|
750
|
-
response_data = utils.
|
|
751
|
-
|
|
742
|
+
response_data = utils.unmarshal_json_response(
|
|
743
|
+
errors.InternalServerErrorData, http_res
|
|
752
744
|
)
|
|
753
|
-
raise errors.InternalServerError(
|
|
745
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
754
746
|
if utils.match_response(http_res, "4XX", "*"):
|
|
755
747
|
http_res_text = utils.stream_to_text(http_res)
|
|
756
|
-
raise errors.SDKError(
|
|
757
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
758
|
-
)
|
|
748
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
759
749
|
if utils.match_response(http_res, "5XX", "*"):
|
|
760
750
|
http_res_text = utils.stream_to_text(http_res)
|
|
761
|
-
raise errors.SDKError(
|
|
762
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
763
|
-
)
|
|
751
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
764
752
|
|
|
765
|
-
|
|
766
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
767
|
-
raise errors.SDKError(
|
|
768
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
769
|
-
http_res.status_code,
|
|
770
|
-
http_res_text,
|
|
771
|
-
http_res,
|
|
772
|
-
)
|
|
753
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
773
754
|
|
|
774
755
|
async def retrieve_links_async(
|
|
775
756
|
self,
|
|
@@ -857,61 +838,58 @@ class Partners(BaseSDK):
|
|
|
857
838
|
|
|
858
839
|
response_data: Any = None
|
|
859
840
|
if utils.match_response(http_res, "200", "application/json"):
|
|
860
|
-
return utils.
|
|
841
|
+
return utils.unmarshal_json_response(
|
|
842
|
+
Optional[List[operations.Link]], http_res
|
|
843
|
+
)
|
|
861
844
|
if utils.match_response(http_res, "400", "application/json"):
|
|
862
|
-
response_data = utils.
|
|
863
|
-
|
|
845
|
+
response_data = utils.unmarshal_json_response(
|
|
846
|
+
errors.BadRequestData, http_res
|
|
847
|
+
)
|
|
848
|
+
raise errors.BadRequest(response_data, http_res)
|
|
864
849
|
if utils.match_response(http_res, "401", "application/json"):
|
|
865
|
-
response_data = utils.
|
|
866
|
-
|
|
850
|
+
response_data = utils.unmarshal_json_response(
|
|
851
|
+
errors.UnauthorizedData, http_res
|
|
852
|
+
)
|
|
853
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
867
854
|
if utils.match_response(http_res, "403", "application/json"):
|
|
868
|
-
response_data = utils.
|
|
869
|
-
|
|
855
|
+
response_data = utils.unmarshal_json_response(
|
|
856
|
+
errors.ForbiddenData, http_res
|
|
857
|
+
)
|
|
858
|
+
raise errors.Forbidden(response_data, http_res)
|
|
870
859
|
if utils.match_response(http_res, "404", "application/json"):
|
|
871
|
-
response_data = utils.
|
|
872
|
-
raise errors.NotFound(
|
|
860
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
861
|
+
raise errors.NotFound(response_data, http_res)
|
|
873
862
|
if utils.match_response(http_res, "409", "application/json"):
|
|
874
|
-
response_data = utils.
|
|
875
|
-
raise errors.Conflict(
|
|
863
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
864
|
+
raise errors.Conflict(response_data, http_res)
|
|
876
865
|
if utils.match_response(http_res, "410", "application/json"):
|
|
877
|
-
response_data = utils.
|
|
878
|
-
|
|
866
|
+
response_data = utils.unmarshal_json_response(
|
|
867
|
+
errors.InviteExpiredData, http_res
|
|
879
868
|
)
|
|
880
|
-
raise errors.InviteExpired(
|
|
869
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
881
870
|
if utils.match_response(http_res, "422", "application/json"):
|
|
882
|
-
response_data = utils.
|
|
883
|
-
|
|
871
|
+
response_data = utils.unmarshal_json_response(
|
|
872
|
+
errors.UnprocessableEntityData, http_res
|
|
884
873
|
)
|
|
885
|
-
raise errors.UnprocessableEntity(
|
|
874
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
886
875
|
if utils.match_response(http_res, "429", "application/json"):
|
|
887
|
-
response_data = utils.
|
|
888
|
-
|
|
876
|
+
response_data = utils.unmarshal_json_response(
|
|
877
|
+
errors.RateLimitExceededData, http_res
|
|
889
878
|
)
|
|
890
|
-
raise errors.RateLimitExceeded(
|
|
879
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
891
880
|
if utils.match_response(http_res, "500", "application/json"):
|
|
892
|
-
response_data = utils.
|
|
893
|
-
|
|
881
|
+
response_data = utils.unmarshal_json_response(
|
|
882
|
+
errors.InternalServerErrorData, http_res
|
|
894
883
|
)
|
|
895
|
-
raise errors.InternalServerError(
|
|
884
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
896
885
|
if utils.match_response(http_res, "4XX", "*"):
|
|
897
886
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
898
|
-
raise errors.SDKError(
|
|
899
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
900
|
-
)
|
|
887
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
901
888
|
if utils.match_response(http_res, "5XX", "*"):
|
|
902
889
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
903
|
-
raise errors.SDKError(
|
|
904
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
905
|
-
)
|
|
890
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
906
891
|
|
|
907
|
-
|
|
908
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
909
|
-
raise errors.SDKError(
|
|
910
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
911
|
-
http_res.status_code,
|
|
912
|
-
http_res_text,
|
|
913
|
-
http_res,
|
|
914
|
-
)
|
|
892
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
915
893
|
|
|
916
894
|
def upsert_link(
|
|
917
895
|
self,
|
|
@@ -1011,61 +989,58 @@ class Partners(BaseSDK):
|
|
|
1011
989
|
|
|
1012
990
|
response_data: Any = None
|
|
1013
991
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1014
|
-
return utils.
|
|
992
|
+
return utils.unmarshal_json_response(
|
|
993
|
+
Optional[components.LinkSchema], http_res
|
|
994
|
+
)
|
|
1015
995
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1016
|
-
response_data = utils.
|
|
1017
|
-
|
|
996
|
+
response_data = utils.unmarshal_json_response(
|
|
997
|
+
errors.BadRequestData, http_res
|
|
998
|
+
)
|
|
999
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1018
1000
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1019
|
-
response_data = utils.
|
|
1020
|
-
|
|
1001
|
+
response_data = utils.unmarshal_json_response(
|
|
1002
|
+
errors.UnauthorizedData, http_res
|
|
1003
|
+
)
|
|
1004
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1021
1005
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1022
|
-
response_data = utils.
|
|
1023
|
-
|
|
1006
|
+
response_data = utils.unmarshal_json_response(
|
|
1007
|
+
errors.ForbiddenData, http_res
|
|
1008
|
+
)
|
|
1009
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1024
1010
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1025
|
-
response_data = utils.
|
|
1026
|
-
raise errors.NotFound(
|
|
1011
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1012
|
+
raise errors.NotFound(response_data, http_res)
|
|
1027
1013
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1028
|
-
response_data = utils.
|
|
1029
|
-
raise errors.Conflict(
|
|
1014
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
1015
|
+
raise errors.Conflict(response_data, http_res)
|
|
1030
1016
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1031
|
-
response_data = utils.
|
|
1032
|
-
|
|
1017
|
+
response_data = utils.unmarshal_json_response(
|
|
1018
|
+
errors.InviteExpiredData, http_res
|
|
1033
1019
|
)
|
|
1034
|
-
raise errors.InviteExpired(
|
|
1020
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1035
1021
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1036
|
-
response_data = utils.
|
|
1037
|
-
|
|
1022
|
+
response_data = utils.unmarshal_json_response(
|
|
1023
|
+
errors.UnprocessableEntityData, http_res
|
|
1038
1024
|
)
|
|
1039
|
-
raise errors.UnprocessableEntity(
|
|
1025
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1040
1026
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1041
|
-
response_data = utils.
|
|
1042
|
-
|
|
1027
|
+
response_data = utils.unmarshal_json_response(
|
|
1028
|
+
errors.RateLimitExceededData, http_res
|
|
1043
1029
|
)
|
|
1044
|
-
raise errors.RateLimitExceeded(
|
|
1030
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1045
1031
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1046
|
-
response_data = utils.
|
|
1047
|
-
|
|
1032
|
+
response_data = utils.unmarshal_json_response(
|
|
1033
|
+
errors.InternalServerErrorData, http_res
|
|
1048
1034
|
)
|
|
1049
|
-
raise errors.InternalServerError(
|
|
1035
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1050
1036
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1051
1037
|
http_res_text = utils.stream_to_text(http_res)
|
|
1052
|
-
raise errors.SDKError(
|
|
1053
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1054
|
-
)
|
|
1038
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1055
1039
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1056
1040
|
http_res_text = utils.stream_to_text(http_res)
|
|
1057
|
-
raise errors.SDKError(
|
|
1058
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1059
|
-
)
|
|
1041
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1060
1042
|
|
|
1061
|
-
|
|
1062
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1063
|
-
raise errors.SDKError(
|
|
1064
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1065
|
-
http_res.status_code,
|
|
1066
|
-
http_res_text,
|
|
1067
|
-
http_res,
|
|
1068
|
-
)
|
|
1043
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1069
1044
|
|
|
1070
1045
|
async def upsert_link_async(
|
|
1071
1046
|
self,
|
|
@@ -1165,61 +1140,58 @@ class Partners(BaseSDK):
|
|
|
1165
1140
|
|
|
1166
1141
|
response_data: Any = None
|
|
1167
1142
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1168
|
-
return utils.
|
|
1143
|
+
return utils.unmarshal_json_response(
|
|
1144
|
+
Optional[components.LinkSchema], http_res
|
|
1145
|
+
)
|
|
1169
1146
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1170
|
-
response_data = utils.
|
|
1171
|
-
|
|
1147
|
+
response_data = utils.unmarshal_json_response(
|
|
1148
|
+
errors.BadRequestData, http_res
|
|
1149
|
+
)
|
|
1150
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1172
1151
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1173
|
-
response_data = utils.
|
|
1174
|
-
|
|
1152
|
+
response_data = utils.unmarshal_json_response(
|
|
1153
|
+
errors.UnauthorizedData, http_res
|
|
1154
|
+
)
|
|
1155
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1175
1156
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1176
|
-
response_data = utils.
|
|
1177
|
-
|
|
1157
|
+
response_data = utils.unmarshal_json_response(
|
|
1158
|
+
errors.ForbiddenData, http_res
|
|
1159
|
+
)
|
|
1160
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1178
1161
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1179
|
-
response_data = utils.
|
|
1180
|
-
raise errors.NotFound(
|
|
1162
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1163
|
+
raise errors.NotFound(response_data, http_res)
|
|
1181
1164
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1182
|
-
response_data = utils.
|
|
1183
|
-
raise errors.Conflict(
|
|
1165
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
1166
|
+
raise errors.Conflict(response_data, http_res)
|
|
1184
1167
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1185
|
-
response_data = utils.
|
|
1186
|
-
|
|
1168
|
+
response_data = utils.unmarshal_json_response(
|
|
1169
|
+
errors.InviteExpiredData, http_res
|
|
1187
1170
|
)
|
|
1188
|
-
raise errors.InviteExpired(
|
|
1171
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1189
1172
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1190
|
-
response_data = utils.
|
|
1191
|
-
|
|
1173
|
+
response_data = utils.unmarshal_json_response(
|
|
1174
|
+
errors.UnprocessableEntityData, http_res
|
|
1192
1175
|
)
|
|
1193
|
-
raise errors.UnprocessableEntity(
|
|
1176
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1194
1177
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1195
|
-
response_data = utils.
|
|
1196
|
-
|
|
1178
|
+
response_data = utils.unmarshal_json_response(
|
|
1179
|
+
errors.RateLimitExceededData, http_res
|
|
1197
1180
|
)
|
|
1198
|
-
raise errors.RateLimitExceeded(
|
|
1181
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1199
1182
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1200
|
-
response_data = utils.
|
|
1201
|
-
|
|
1183
|
+
response_data = utils.unmarshal_json_response(
|
|
1184
|
+
errors.InternalServerErrorData, http_res
|
|
1202
1185
|
)
|
|
1203
|
-
raise errors.InternalServerError(
|
|
1186
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1204
1187
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1205
1188
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1206
|
-
raise errors.SDKError(
|
|
1207
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1208
|
-
)
|
|
1189
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1209
1190
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1210
1191
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1211
|
-
raise errors.SDKError(
|
|
1212
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1213
|
-
)
|
|
1192
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1214
1193
|
|
|
1215
|
-
|
|
1216
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1217
|
-
raise errors.SDKError(
|
|
1218
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1219
|
-
http_res.status_code,
|
|
1220
|
-
http_res_text,
|
|
1221
|
-
http_res,
|
|
1222
|
-
)
|
|
1194
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1223
1195
|
|
|
1224
1196
|
def analytics(
|
|
1225
1197
|
self,
|
|
@@ -1310,63 +1282,58 @@ class Partners(BaseSDK):
|
|
|
1310
1282
|
|
|
1311
1283
|
response_data: Any = None
|
|
1312
1284
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1313
|
-
return utils.
|
|
1314
|
-
|
|
1285
|
+
return utils.unmarshal_json_response(
|
|
1286
|
+
Optional[operations.RetrievePartnerAnalyticsResponseBody], http_res
|
|
1315
1287
|
)
|
|
1316
1288
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1317
|
-
response_data = utils.
|
|
1318
|
-
|
|
1289
|
+
response_data = utils.unmarshal_json_response(
|
|
1290
|
+
errors.BadRequestData, http_res
|
|
1291
|
+
)
|
|
1292
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1319
1293
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1320
|
-
response_data = utils.
|
|
1321
|
-
|
|
1294
|
+
response_data = utils.unmarshal_json_response(
|
|
1295
|
+
errors.UnauthorizedData, http_res
|
|
1296
|
+
)
|
|
1297
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1322
1298
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1323
|
-
response_data = utils.
|
|
1324
|
-
|
|
1299
|
+
response_data = utils.unmarshal_json_response(
|
|
1300
|
+
errors.ForbiddenData, http_res
|
|
1301
|
+
)
|
|
1302
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1325
1303
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1326
|
-
response_data = utils.
|
|
1327
|
-
raise errors.NotFound(
|
|
1304
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1305
|
+
raise errors.NotFound(response_data, http_res)
|
|
1328
1306
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1329
|
-
response_data = utils.
|
|
1330
|
-
raise errors.Conflict(
|
|
1307
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
1308
|
+
raise errors.Conflict(response_data, http_res)
|
|
1331
1309
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1332
|
-
response_data = utils.
|
|
1333
|
-
|
|
1310
|
+
response_data = utils.unmarshal_json_response(
|
|
1311
|
+
errors.InviteExpiredData, http_res
|
|
1334
1312
|
)
|
|
1335
|
-
raise errors.InviteExpired(
|
|
1313
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1336
1314
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1337
|
-
response_data = utils.
|
|
1338
|
-
|
|
1315
|
+
response_data = utils.unmarshal_json_response(
|
|
1316
|
+
errors.UnprocessableEntityData, http_res
|
|
1339
1317
|
)
|
|
1340
|
-
raise errors.UnprocessableEntity(
|
|
1318
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1341
1319
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1342
|
-
response_data = utils.
|
|
1343
|
-
|
|
1320
|
+
response_data = utils.unmarshal_json_response(
|
|
1321
|
+
errors.RateLimitExceededData, http_res
|
|
1344
1322
|
)
|
|
1345
|
-
raise errors.RateLimitExceeded(
|
|
1323
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1346
1324
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1347
|
-
response_data = utils.
|
|
1348
|
-
|
|
1325
|
+
response_data = utils.unmarshal_json_response(
|
|
1326
|
+
errors.InternalServerErrorData, http_res
|
|
1349
1327
|
)
|
|
1350
|
-
raise errors.InternalServerError(
|
|
1328
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1351
1329
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1352
1330
|
http_res_text = utils.stream_to_text(http_res)
|
|
1353
|
-
raise errors.SDKError(
|
|
1354
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1355
|
-
)
|
|
1331
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1356
1332
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1357
1333
|
http_res_text = utils.stream_to_text(http_res)
|
|
1358
|
-
raise errors.SDKError(
|
|
1359
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1360
|
-
)
|
|
1334
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1361
1335
|
|
|
1362
|
-
|
|
1363
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1364
|
-
raise errors.SDKError(
|
|
1365
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1366
|
-
http_res.status_code,
|
|
1367
|
-
http_res_text,
|
|
1368
|
-
http_res,
|
|
1369
|
-
)
|
|
1336
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1370
1337
|
|
|
1371
1338
|
async def analytics_async(
|
|
1372
1339
|
self,
|
|
@@ -1457,60 +1424,55 @@ class Partners(BaseSDK):
|
|
|
1457
1424
|
|
|
1458
1425
|
response_data: Any = None
|
|
1459
1426
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1460
|
-
return utils.
|
|
1461
|
-
|
|
1427
|
+
return utils.unmarshal_json_response(
|
|
1428
|
+
Optional[operations.RetrievePartnerAnalyticsResponseBody], http_res
|
|
1462
1429
|
)
|
|
1463
1430
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1464
|
-
response_data = utils.
|
|
1465
|
-
|
|
1431
|
+
response_data = utils.unmarshal_json_response(
|
|
1432
|
+
errors.BadRequestData, http_res
|
|
1433
|
+
)
|
|
1434
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1466
1435
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1467
|
-
response_data = utils.
|
|
1468
|
-
|
|
1436
|
+
response_data = utils.unmarshal_json_response(
|
|
1437
|
+
errors.UnauthorizedData, http_res
|
|
1438
|
+
)
|
|
1439
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1469
1440
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1470
|
-
response_data = utils.
|
|
1471
|
-
|
|
1441
|
+
response_data = utils.unmarshal_json_response(
|
|
1442
|
+
errors.ForbiddenData, http_res
|
|
1443
|
+
)
|
|
1444
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1472
1445
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1473
|
-
response_data = utils.
|
|
1474
|
-
raise errors.NotFound(
|
|
1446
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1447
|
+
raise errors.NotFound(response_data, http_res)
|
|
1475
1448
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1476
|
-
response_data = utils.
|
|
1477
|
-
raise errors.Conflict(
|
|
1449
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
1450
|
+
raise errors.Conflict(response_data, http_res)
|
|
1478
1451
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1479
|
-
response_data = utils.
|
|
1480
|
-
|
|
1452
|
+
response_data = utils.unmarshal_json_response(
|
|
1453
|
+
errors.InviteExpiredData, http_res
|
|
1481
1454
|
)
|
|
1482
|
-
raise errors.InviteExpired(
|
|
1455
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1483
1456
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1484
|
-
response_data = utils.
|
|
1485
|
-
|
|
1457
|
+
response_data = utils.unmarshal_json_response(
|
|
1458
|
+
errors.UnprocessableEntityData, http_res
|
|
1486
1459
|
)
|
|
1487
|
-
raise errors.UnprocessableEntity(
|
|
1460
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1488
1461
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1489
|
-
response_data = utils.
|
|
1490
|
-
|
|
1462
|
+
response_data = utils.unmarshal_json_response(
|
|
1463
|
+
errors.RateLimitExceededData, http_res
|
|
1491
1464
|
)
|
|
1492
|
-
raise errors.RateLimitExceeded(
|
|
1465
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1493
1466
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1494
|
-
response_data = utils.
|
|
1495
|
-
|
|
1467
|
+
response_data = utils.unmarshal_json_response(
|
|
1468
|
+
errors.InternalServerErrorData, http_res
|
|
1496
1469
|
)
|
|
1497
|
-
raise errors.InternalServerError(
|
|
1470
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1498
1471
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1499
1472
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1500
|
-
raise errors.SDKError(
|
|
1501
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1502
|
-
)
|
|
1473
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1503
1474
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1504
1475
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1505
|
-
raise errors.SDKError(
|
|
1506
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1507
|
-
)
|
|
1476
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1508
1477
|
|
|
1509
|
-
|
|
1510
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1511
|
-
raise errors.SDKError(
|
|
1512
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1513
|
-
http_res.status_code,
|
|
1514
|
-
http_res_text,
|
|
1515
|
-
http_res,
|
|
1516
|
-
)
|
|
1478
|
+
raise errors.SDKError("Unexpected response received", http_res)
|