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/domains.py
CHANGED
|
@@ -5,6 +5,7 @@ from dub import utils
|
|
|
5
5
|
from dub._hooks import HookContext
|
|
6
6
|
from dub.models import components, 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 jsonpath import JSONPath
|
|
9
10
|
from typing import Any, Dict, List, Mapping, Optional, Union, cast
|
|
10
11
|
|
|
@@ -108,63 +109,48 @@ class Domains(BaseSDK):
|
|
|
108
109
|
|
|
109
110
|
response_data: Any = None
|
|
110
111
|
if utils.match_response(http_res, "201", "application/json"):
|
|
111
|
-
return
|
|
112
|
-
http_res.text, Optional[components.DomainSchema]
|
|
113
|
-
)
|
|
112
|
+
return unmarshal_json_response(Optional[components.DomainSchema], http_res)
|
|
114
113
|
if utils.match_response(http_res, "400", "application/json"):
|
|
115
|
-
response_data =
|
|
116
|
-
raise errors.BadRequest(
|
|
114
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
115
|
+
raise errors.BadRequest(response_data, http_res)
|
|
117
116
|
if utils.match_response(http_res, "401", "application/json"):
|
|
118
|
-
response_data =
|
|
119
|
-
raise errors.Unauthorized(
|
|
117
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
118
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
120
119
|
if utils.match_response(http_res, "403", "application/json"):
|
|
121
|
-
response_data =
|
|
122
|
-
raise errors.Forbidden(
|
|
120
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
121
|
+
raise errors.Forbidden(response_data, http_res)
|
|
123
122
|
if utils.match_response(http_res, "404", "application/json"):
|
|
124
|
-
response_data =
|
|
125
|
-
raise errors.NotFound(
|
|
123
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
124
|
+
raise errors.NotFound(response_data, http_res)
|
|
126
125
|
if utils.match_response(http_res, "409", "application/json"):
|
|
127
|
-
response_data =
|
|
128
|
-
raise errors.Conflict(
|
|
126
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
127
|
+
raise errors.Conflict(response_data, http_res)
|
|
129
128
|
if utils.match_response(http_res, "410", "application/json"):
|
|
130
|
-
response_data =
|
|
131
|
-
|
|
132
|
-
)
|
|
133
|
-
raise errors.InviteExpired(data=response_data)
|
|
129
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
130
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
134
131
|
if utils.match_response(http_res, "422", "application/json"):
|
|
135
|
-
response_data =
|
|
136
|
-
|
|
132
|
+
response_data = unmarshal_json_response(
|
|
133
|
+
errors.UnprocessableEntityData, http_res
|
|
137
134
|
)
|
|
138
|
-
raise errors.UnprocessableEntity(
|
|
135
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
139
136
|
if utils.match_response(http_res, "429", "application/json"):
|
|
140
|
-
response_data =
|
|
141
|
-
|
|
137
|
+
response_data = unmarshal_json_response(
|
|
138
|
+
errors.RateLimitExceededData, http_res
|
|
142
139
|
)
|
|
143
|
-
raise errors.RateLimitExceeded(
|
|
140
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
144
141
|
if utils.match_response(http_res, "500", "application/json"):
|
|
145
|
-
response_data =
|
|
146
|
-
|
|
142
|
+
response_data = unmarshal_json_response(
|
|
143
|
+
errors.InternalServerErrorData, http_res
|
|
147
144
|
)
|
|
148
|
-
raise errors.InternalServerError(
|
|
145
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
149
146
|
if utils.match_response(http_res, "4XX", "*"):
|
|
150
147
|
http_res_text = utils.stream_to_text(http_res)
|
|
151
|
-
raise errors.SDKError(
|
|
152
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
153
|
-
)
|
|
148
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
154
149
|
if utils.match_response(http_res, "5XX", "*"):
|
|
155
150
|
http_res_text = utils.stream_to_text(http_res)
|
|
156
|
-
raise errors.SDKError(
|
|
157
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
158
|
-
)
|
|
151
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
159
152
|
|
|
160
|
-
|
|
161
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
162
|
-
raise errors.SDKError(
|
|
163
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
164
|
-
http_res.status_code,
|
|
165
|
-
http_res_text,
|
|
166
|
-
http_res,
|
|
167
|
-
)
|
|
153
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
168
154
|
|
|
169
155
|
async def create_async(
|
|
170
156
|
self,
|
|
@@ -264,63 +250,48 @@ class Domains(BaseSDK):
|
|
|
264
250
|
|
|
265
251
|
response_data: Any = None
|
|
266
252
|
if utils.match_response(http_res, "201", "application/json"):
|
|
267
|
-
return
|
|
268
|
-
http_res.text, Optional[components.DomainSchema]
|
|
269
|
-
)
|
|
253
|
+
return unmarshal_json_response(Optional[components.DomainSchema], http_res)
|
|
270
254
|
if utils.match_response(http_res, "400", "application/json"):
|
|
271
|
-
response_data =
|
|
272
|
-
raise errors.BadRequest(
|
|
255
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
256
|
+
raise errors.BadRequest(response_data, http_res)
|
|
273
257
|
if utils.match_response(http_res, "401", "application/json"):
|
|
274
|
-
response_data =
|
|
275
|
-
raise errors.Unauthorized(
|
|
258
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
259
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
276
260
|
if utils.match_response(http_res, "403", "application/json"):
|
|
277
|
-
response_data =
|
|
278
|
-
raise errors.Forbidden(
|
|
261
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
262
|
+
raise errors.Forbidden(response_data, http_res)
|
|
279
263
|
if utils.match_response(http_res, "404", "application/json"):
|
|
280
|
-
response_data =
|
|
281
|
-
raise errors.NotFound(
|
|
264
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
265
|
+
raise errors.NotFound(response_data, http_res)
|
|
282
266
|
if utils.match_response(http_res, "409", "application/json"):
|
|
283
|
-
response_data =
|
|
284
|
-
raise errors.Conflict(
|
|
267
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
268
|
+
raise errors.Conflict(response_data, http_res)
|
|
285
269
|
if utils.match_response(http_res, "410", "application/json"):
|
|
286
|
-
response_data =
|
|
287
|
-
|
|
288
|
-
)
|
|
289
|
-
raise errors.InviteExpired(data=response_data)
|
|
270
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
271
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
290
272
|
if utils.match_response(http_res, "422", "application/json"):
|
|
291
|
-
response_data =
|
|
292
|
-
|
|
273
|
+
response_data = unmarshal_json_response(
|
|
274
|
+
errors.UnprocessableEntityData, http_res
|
|
293
275
|
)
|
|
294
|
-
raise errors.UnprocessableEntity(
|
|
276
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
295
277
|
if utils.match_response(http_res, "429", "application/json"):
|
|
296
|
-
response_data =
|
|
297
|
-
|
|
278
|
+
response_data = unmarshal_json_response(
|
|
279
|
+
errors.RateLimitExceededData, http_res
|
|
298
280
|
)
|
|
299
|
-
raise errors.RateLimitExceeded(
|
|
281
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
300
282
|
if utils.match_response(http_res, "500", "application/json"):
|
|
301
|
-
response_data =
|
|
302
|
-
|
|
283
|
+
response_data = unmarshal_json_response(
|
|
284
|
+
errors.InternalServerErrorData, http_res
|
|
303
285
|
)
|
|
304
|
-
raise errors.InternalServerError(
|
|
286
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
305
287
|
if utils.match_response(http_res, "4XX", "*"):
|
|
306
288
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
307
|
-
raise errors.SDKError(
|
|
308
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
309
|
-
)
|
|
289
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
310
290
|
if utils.match_response(http_res, "5XX", "*"):
|
|
311
291
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
312
|
-
raise errors.SDKError(
|
|
313
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
314
|
-
)
|
|
292
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
315
293
|
|
|
316
|
-
|
|
317
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
318
|
-
raise errors.SDKError(
|
|
319
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
320
|
-
http_res.status_code,
|
|
321
|
-
http_res_text,
|
|
322
|
-
http_res,
|
|
323
|
-
)
|
|
294
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
324
295
|
|
|
325
296
|
def list(
|
|
326
297
|
self,
|
|
@@ -433,65 +404,52 @@ class Domains(BaseSDK):
|
|
|
433
404
|
response_data: Any = None
|
|
434
405
|
if utils.match_response(http_res, "200", "application/json"):
|
|
435
406
|
return operations.ListDomainsResponse(
|
|
436
|
-
result=
|
|
437
|
-
|
|
407
|
+
result=unmarshal_json_response(
|
|
408
|
+
Optional[List[components.DomainSchema]], http_res
|
|
438
409
|
),
|
|
439
410
|
next=next_func,
|
|
440
411
|
)
|
|
441
412
|
if utils.match_response(http_res, "400", "application/json"):
|
|
442
|
-
response_data =
|
|
443
|
-
raise errors.BadRequest(
|
|
413
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
414
|
+
raise errors.BadRequest(response_data, http_res)
|
|
444
415
|
if utils.match_response(http_res, "401", "application/json"):
|
|
445
|
-
response_data =
|
|
446
|
-
raise errors.Unauthorized(
|
|
416
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
417
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
447
418
|
if utils.match_response(http_res, "403", "application/json"):
|
|
448
|
-
response_data =
|
|
449
|
-
raise errors.Forbidden(
|
|
419
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
420
|
+
raise errors.Forbidden(response_data, http_res)
|
|
450
421
|
if utils.match_response(http_res, "404", "application/json"):
|
|
451
|
-
response_data =
|
|
452
|
-
raise errors.NotFound(
|
|
422
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
423
|
+
raise errors.NotFound(response_data, http_res)
|
|
453
424
|
if utils.match_response(http_res, "409", "application/json"):
|
|
454
|
-
response_data =
|
|
455
|
-
raise errors.Conflict(
|
|
425
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
426
|
+
raise errors.Conflict(response_data, http_res)
|
|
456
427
|
if utils.match_response(http_res, "410", "application/json"):
|
|
457
|
-
response_data =
|
|
458
|
-
|
|
459
|
-
)
|
|
460
|
-
raise errors.InviteExpired(data=response_data)
|
|
428
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
429
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
461
430
|
if utils.match_response(http_res, "422", "application/json"):
|
|
462
|
-
response_data =
|
|
463
|
-
|
|
431
|
+
response_data = unmarshal_json_response(
|
|
432
|
+
errors.UnprocessableEntityData, http_res
|
|
464
433
|
)
|
|
465
|
-
raise errors.UnprocessableEntity(
|
|
434
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
466
435
|
if utils.match_response(http_res, "429", "application/json"):
|
|
467
|
-
response_data =
|
|
468
|
-
|
|
436
|
+
response_data = unmarshal_json_response(
|
|
437
|
+
errors.RateLimitExceededData, http_res
|
|
469
438
|
)
|
|
470
|
-
raise errors.RateLimitExceeded(
|
|
439
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
471
440
|
if utils.match_response(http_res, "500", "application/json"):
|
|
472
|
-
response_data =
|
|
473
|
-
|
|
441
|
+
response_data = unmarshal_json_response(
|
|
442
|
+
errors.InternalServerErrorData, http_res
|
|
474
443
|
)
|
|
475
|
-
raise errors.InternalServerError(
|
|
444
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
476
445
|
if utils.match_response(http_res, "4XX", "*"):
|
|
477
446
|
http_res_text = utils.stream_to_text(http_res)
|
|
478
|
-
raise errors.SDKError(
|
|
479
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
480
|
-
)
|
|
447
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
481
448
|
if utils.match_response(http_res, "5XX", "*"):
|
|
482
449
|
http_res_text = utils.stream_to_text(http_res)
|
|
483
|
-
raise errors.SDKError(
|
|
484
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
485
|
-
)
|
|
450
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
486
451
|
|
|
487
|
-
|
|
488
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
489
|
-
raise errors.SDKError(
|
|
490
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
491
|
-
http_res.status_code,
|
|
492
|
-
http_res_text,
|
|
493
|
-
http_res,
|
|
494
|
-
)
|
|
452
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
495
453
|
|
|
496
454
|
async def list_async(
|
|
497
455
|
self,
|
|
@@ -604,65 +562,52 @@ class Domains(BaseSDK):
|
|
|
604
562
|
response_data: Any = None
|
|
605
563
|
if utils.match_response(http_res, "200", "application/json"):
|
|
606
564
|
return operations.ListDomainsResponse(
|
|
607
|
-
result=
|
|
608
|
-
|
|
565
|
+
result=unmarshal_json_response(
|
|
566
|
+
Optional[List[components.DomainSchema]], http_res
|
|
609
567
|
),
|
|
610
568
|
next=next_func,
|
|
611
569
|
)
|
|
612
570
|
if utils.match_response(http_res, "400", "application/json"):
|
|
613
|
-
response_data =
|
|
614
|
-
raise errors.BadRequest(
|
|
571
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
572
|
+
raise errors.BadRequest(response_data, http_res)
|
|
615
573
|
if utils.match_response(http_res, "401", "application/json"):
|
|
616
|
-
response_data =
|
|
617
|
-
raise errors.Unauthorized(
|
|
574
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
575
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
618
576
|
if utils.match_response(http_res, "403", "application/json"):
|
|
619
|
-
response_data =
|
|
620
|
-
raise errors.Forbidden(
|
|
577
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
578
|
+
raise errors.Forbidden(response_data, http_res)
|
|
621
579
|
if utils.match_response(http_res, "404", "application/json"):
|
|
622
|
-
response_data =
|
|
623
|
-
raise errors.NotFound(
|
|
580
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
581
|
+
raise errors.NotFound(response_data, http_res)
|
|
624
582
|
if utils.match_response(http_res, "409", "application/json"):
|
|
625
|
-
response_data =
|
|
626
|
-
raise errors.Conflict(
|
|
583
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
584
|
+
raise errors.Conflict(response_data, http_res)
|
|
627
585
|
if utils.match_response(http_res, "410", "application/json"):
|
|
628
|
-
response_data =
|
|
629
|
-
|
|
630
|
-
)
|
|
631
|
-
raise errors.InviteExpired(data=response_data)
|
|
586
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
587
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
632
588
|
if utils.match_response(http_res, "422", "application/json"):
|
|
633
|
-
response_data =
|
|
634
|
-
|
|
589
|
+
response_data = unmarshal_json_response(
|
|
590
|
+
errors.UnprocessableEntityData, http_res
|
|
635
591
|
)
|
|
636
|
-
raise errors.UnprocessableEntity(
|
|
592
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
637
593
|
if utils.match_response(http_res, "429", "application/json"):
|
|
638
|
-
response_data =
|
|
639
|
-
|
|
594
|
+
response_data = unmarshal_json_response(
|
|
595
|
+
errors.RateLimitExceededData, http_res
|
|
640
596
|
)
|
|
641
|
-
raise errors.RateLimitExceeded(
|
|
597
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
642
598
|
if utils.match_response(http_res, "500", "application/json"):
|
|
643
|
-
response_data =
|
|
644
|
-
|
|
599
|
+
response_data = unmarshal_json_response(
|
|
600
|
+
errors.InternalServerErrorData, http_res
|
|
645
601
|
)
|
|
646
|
-
raise errors.InternalServerError(
|
|
602
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
647
603
|
if utils.match_response(http_res, "4XX", "*"):
|
|
648
604
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
649
|
-
raise errors.SDKError(
|
|
650
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
651
|
-
)
|
|
605
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
652
606
|
if utils.match_response(http_res, "5XX", "*"):
|
|
653
607
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
654
|
-
raise errors.SDKError(
|
|
655
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
656
|
-
)
|
|
608
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
657
609
|
|
|
658
|
-
|
|
659
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
660
|
-
raise errors.SDKError(
|
|
661
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
662
|
-
http_res.status_code,
|
|
663
|
-
http_res_text,
|
|
664
|
-
http_res,
|
|
665
|
-
)
|
|
610
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
666
611
|
|
|
667
612
|
def update(
|
|
668
613
|
self,
|
|
@@ -765,63 +710,48 @@ class Domains(BaseSDK):
|
|
|
765
710
|
|
|
766
711
|
response_data: Any = None
|
|
767
712
|
if utils.match_response(http_res, "200", "application/json"):
|
|
768
|
-
return
|
|
769
|
-
http_res.text, Optional[components.DomainSchema]
|
|
770
|
-
)
|
|
713
|
+
return unmarshal_json_response(Optional[components.DomainSchema], http_res)
|
|
771
714
|
if utils.match_response(http_res, "400", "application/json"):
|
|
772
|
-
response_data =
|
|
773
|
-
raise errors.BadRequest(
|
|
715
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
716
|
+
raise errors.BadRequest(response_data, http_res)
|
|
774
717
|
if utils.match_response(http_res, "401", "application/json"):
|
|
775
|
-
response_data =
|
|
776
|
-
raise errors.Unauthorized(
|
|
718
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
719
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
777
720
|
if utils.match_response(http_res, "403", "application/json"):
|
|
778
|
-
response_data =
|
|
779
|
-
raise errors.Forbidden(
|
|
721
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
722
|
+
raise errors.Forbidden(response_data, http_res)
|
|
780
723
|
if utils.match_response(http_res, "404", "application/json"):
|
|
781
|
-
response_data =
|
|
782
|
-
raise errors.NotFound(
|
|
724
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
725
|
+
raise errors.NotFound(response_data, http_res)
|
|
783
726
|
if utils.match_response(http_res, "409", "application/json"):
|
|
784
|
-
response_data =
|
|
785
|
-
raise errors.Conflict(
|
|
727
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
728
|
+
raise errors.Conflict(response_data, http_res)
|
|
786
729
|
if utils.match_response(http_res, "410", "application/json"):
|
|
787
|
-
response_data =
|
|
788
|
-
|
|
789
|
-
)
|
|
790
|
-
raise errors.InviteExpired(data=response_data)
|
|
730
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
731
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
791
732
|
if utils.match_response(http_res, "422", "application/json"):
|
|
792
|
-
response_data =
|
|
793
|
-
|
|
733
|
+
response_data = unmarshal_json_response(
|
|
734
|
+
errors.UnprocessableEntityData, http_res
|
|
794
735
|
)
|
|
795
|
-
raise errors.UnprocessableEntity(
|
|
736
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
796
737
|
if utils.match_response(http_res, "429", "application/json"):
|
|
797
|
-
response_data =
|
|
798
|
-
|
|
738
|
+
response_data = unmarshal_json_response(
|
|
739
|
+
errors.RateLimitExceededData, http_res
|
|
799
740
|
)
|
|
800
|
-
raise errors.RateLimitExceeded(
|
|
741
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
801
742
|
if utils.match_response(http_res, "500", "application/json"):
|
|
802
|
-
response_data =
|
|
803
|
-
|
|
743
|
+
response_data = unmarshal_json_response(
|
|
744
|
+
errors.InternalServerErrorData, http_res
|
|
804
745
|
)
|
|
805
|
-
raise errors.InternalServerError(
|
|
746
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
806
747
|
if utils.match_response(http_res, "4XX", "*"):
|
|
807
748
|
http_res_text = utils.stream_to_text(http_res)
|
|
808
|
-
raise errors.SDKError(
|
|
809
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
810
|
-
)
|
|
749
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
811
750
|
if utils.match_response(http_res, "5XX", "*"):
|
|
812
751
|
http_res_text = utils.stream_to_text(http_res)
|
|
813
|
-
raise errors.SDKError(
|
|
814
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
815
|
-
)
|
|
752
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
816
753
|
|
|
817
|
-
|
|
818
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
819
|
-
raise errors.SDKError(
|
|
820
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
821
|
-
http_res.status_code,
|
|
822
|
-
http_res_text,
|
|
823
|
-
http_res,
|
|
824
|
-
)
|
|
754
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
825
755
|
|
|
826
756
|
async def update_async(
|
|
827
757
|
self,
|
|
@@ -924,63 +854,48 @@ class Domains(BaseSDK):
|
|
|
924
854
|
|
|
925
855
|
response_data: Any = None
|
|
926
856
|
if utils.match_response(http_res, "200", "application/json"):
|
|
927
|
-
return
|
|
928
|
-
http_res.text, Optional[components.DomainSchema]
|
|
929
|
-
)
|
|
857
|
+
return unmarshal_json_response(Optional[components.DomainSchema], http_res)
|
|
930
858
|
if utils.match_response(http_res, "400", "application/json"):
|
|
931
|
-
response_data =
|
|
932
|
-
raise errors.BadRequest(
|
|
859
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
860
|
+
raise errors.BadRequest(response_data, http_res)
|
|
933
861
|
if utils.match_response(http_res, "401", "application/json"):
|
|
934
|
-
response_data =
|
|
935
|
-
raise errors.Unauthorized(
|
|
862
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
863
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
936
864
|
if utils.match_response(http_res, "403", "application/json"):
|
|
937
|
-
response_data =
|
|
938
|
-
raise errors.Forbidden(
|
|
865
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
866
|
+
raise errors.Forbidden(response_data, http_res)
|
|
939
867
|
if utils.match_response(http_res, "404", "application/json"):
|
|
940
|
-
response_data =
|
|
941
|
-
raise errors.NotFound(
|
|
868
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
869
|
+
raise errors.NotFound(response_data, http_res)
|
|
942
870
|
if utils.match_response(http_res, "409", "application/json"):
|
|
943
|
-
response_data =
|
|
944
|
-
raise errors.Conflict(
|
|
871
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
872
|
+
raise errors.Conflict(response_data, http_res)
|
|
945
873
|
if utils.match_response(http_res, "410", "application/json"):
|
|
946
|
-
response_data =
|
|
947
|
-
|
|
948
|
-
)
|
|
949
|
-
raise errors.InviteExpired(data=response_data)
|
|
874
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
875
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
950
876
|
if utils.match_response(http_res, "422", "application/json"):
|
|
951
|
-
response_data =
|
|
952
|
-
|
|
877
|
+
response_data = unmarshal_json_response(
|
|
878
|
+
errors.UnprocessableEntityData, http_res
|
|
953
879
|
)
|
|
954
|
-
raise errors.UnprocessableEntity(
|
|
880
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
955
881
|
if utils.match_response(http_res, "429", "application/json"):
|
|
956
|
-
response_data =
|
|
957
|
-
|
|
882
|
+
response_data = unmarshal_json_response(
|
|
883
|
+
errors.RateLimitExceededData, http_res
|
|
958
884
|
)
|
|
959
|
-
raise errors.RateLimitExceeded(
|
|
885
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
960
886
|
if utils.match_response(http_res, "500", "application/json"):
|
|
961
|
-
response_data =
|
|
962
|
-
|
|
887
|
+
response_data = unmarshal_json_response(
|
|
888
|
+
errors.InternalServerErrorData, http_res
|
|
963
889
|
)
|
|
964
|
-
raise errors.InternalServerError(
|
|
890
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
965
891
|
if utils.match_response(http_res, "4XX", "*"):
|
|
966
892
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
967
|
-
raise errors.SDKError(
|
|
968
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
969
|
-
)
|
|
893
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
970
894
|
if utils.match_response(http_res, "5XX", "*"):
|
|
971
895
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
972
|
-
raise errors.SDKError(
|
|
973
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
974
|
-
)
|
|
896
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
975
897
|
|
|
976
|
-
|
|
977
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
978
|
-
raise errors.SDKError(
|
|
979
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
980
|
-
http_res.status_code,
|
|
981
|
-
http_res_text,
|
|
982
|
-
http_res,
|
|
983
|
-
)
|
|
898
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
984
899
|
|
|
985
900
|
def delete(
|
|
986
901
|
self,
|
|
@@ -1066,63 +981,50 @@ class Domains(BaseSDK):
|
|
|
1066
981
|
|
|
1067
982
|
response_data: Any = None
|
|
1068
983
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1069
|
-
return
|
|
1070
|
-
|
|
984
|
+
return unmarshal_json_response(
|
|
985
|
+
Optional[operations.DeleteDomainResponseBody], http_res
|
|
1071
986
|
)
|
|
1072
987
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1073
|
-
response_data =
|
|
1074
|
-
raise errors.BadRequest(
|
|
988
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
989
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1075
990
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1076
|
-
response_data =
|
|
1077
|
-
raise errors.Unauthorized(
|
|
991
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
992
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1078
993
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1079
|
-
response_data =
|
|
1080
|
-
raise errors.Forbidden(
|
|
994
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
995
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1081
996
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1082
|
-
response_data =
|
|
1083
|
-
raise errors.NotFound(
|
|
997
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
998
|
+
raise errors.NotFound(response_data, http_res)
|
|
1084
999
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1085
|
-
response_data =
|
|
1086
|
-
raise errors.Conflict(
|
|
1000
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
1001
|
+
raise errors.Conflict(response_data, http_res)
|
|
1087
1002
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1088
|
-
response_data =
|
|
1089
|
-
|
|
1090
|
-
)
|
|
1091
|
-
raise errors.InviteExpired(data=response_data)
|
|
1003
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
1004
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1092
1005
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1093
|
-
response_data =
|
|
1094
|
-
|
|
1006
|
+
response_data = unmarshal_json_response(
|
|
1007
|
+
errors.UnprocessableEntityData, http_res
|
|
1095
1008
|
)
|
|
1096
|
-
raise errors.UnprocessableEntity(
|
|
1009
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1097
1010
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1098
|
-
response_data =
|
|
1099
|
-
|
|
1011
|
+
response_data = unmarshal_json_response(
|
|
1012
|
+
errors.RateLimitExceededData, http_res
|
|
1100
1013
|
)
|
|
1101
|
-
raise errors.RateLimitExceeded(
|
|
1014
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1102
1015
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1103
|
-
response_data =
|
|
1104
|
-
|
|
1016
|
+
response_data = unmarshal_json_response(
|
|
1017
|
+
errors.InternalServerErrorData, http_res
|
|
1105
1018
|
)
|
|
1106
|
-
raise errors.InternalServerError(
|
|
1019
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1107
1020
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1108
1021
|
http_res_text = utils.stream_to_text(http_res)
|
|
1109
|
-
raise errors.SDKError(
|
|
1110
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1111
|
-
)
|
|
1022
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1112
1023
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1113
1024
|
http_res_text = utils.stream_to_text(http_res)
|
|
1114
|
-
raise errors.SDKError(
|
|
1115
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1116
|
-
)
|
|
1025
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1117
1026
|
|
|
1118
|
-
|
|
1119
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1120
|
-
raise errors.SDKError(
|
|
1121
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1122
|
-
http_res.status_code,
|
|
1123
|
-
http_res_text,
|
|
1124
|
-
http_res,
|
|
1125
|
-
)
|
|
1027
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1126
1028
|
|
|
1127
1029
|
async def delete_async(
|
|
1128
1030
|
self,
|
|
@@ -1208,63 +1110,50 @@ class Domains(BaseSDK):
|
|
|
1208
1110
|
|
|
1209
1111
|
response_data: Any = None
|
|
1210
1112
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1211
|
-
return
|
|
1212
|
-
|
|
1113
|
+
return unmarshal_json_response(
|
|
1114
|
+
Optional[operations.DeleteDomainResponseBody], http_res
|
|
1213
1115
|
)
|
|
1214
1116
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1215
|
-
response_data =
|
|
1216
|
-
raise errors.BadRequest(
|
|
1117
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
1118
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1217
1119
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1218
|
-
response_data =
|
|
1219
|
-
raise errors.Unauthorized(
|
|
1120
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
1121
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1220
1122
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1221
|
-
response_data =
|
|
1222
|
-
raise errors.Forbidden(
|
|
1123
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
1124
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1223
1125
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1224
|
-
response_data =
|
|
1225
|
-
raise errors.NotFound(
|
|
1126
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1127
|
+
raise errors.NotFound(response_data, http_res)
|
|
1226
1128
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1227
|
-
response_data =
|
|
1228
|
-
raise errors.Conflict(
|
|
1129
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
1130
|
+
raise errors.Conflict(response_data, http_res)
|
|
1229
1131
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1230
|
-
response_data =
|
|
1231
|
-
|
|
1232
|
-
)
|
|
1233
|
-
raise errors.InviteExpired(data=response_data)
|
|
1132
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
1133
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1234
1134
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1235
|
-
response_data =
|
|
1236
|
-
|
|
1135
|
+
response_data = unmarshal_json_response(
|
|
1136
|
+
errors.UnprocessableEntityData, http_res
|
|
1237
1137
|
)
|
|
1238
|
-
raise errors.UnprocessableEntity(
|
|
1138
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1239
1139
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1240
|
-
response_data =
|
|
1241
|
-
|
|
1140
|
+
response_data = unmarshal_json_response(
|
|
1141
|
+
errors.RateLimitExceededData, http_res
|
|
1242
1142
|
)
|
|
1243
|
-
raise errors.RateLimitExceeded(
|
|
1143
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1244
1144
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1245
|
-
response_data =
|
|
1246
|
-
|
|
1145
|
+
response_data = unmarshal_json_response(
|
|
1146
|
+
errors.InternalServerErrorData, http_res
|
|
1247
1147
|
)
|
|
1248
|
-
raise errors.InternalServerError(
|
|
1148
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1249
1149
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1250
1150
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1251
|
-
raise errors.SDKError(
|
|
1252
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1253
|
-
)
|
|
1151
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1254
1152
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1255
1153
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1256
|
-
raise errors.SDKError(
|
|
1257
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1258
|
-
)
|
|
1154
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1259
1155
|
|
|
1260
|
-
|
|
1261
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1262
|
-
raise errors.SDKError(
|
|
1263
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1264
|
-
http_res.status_code,
|
|
1265
|
-
http_res_text,
|
|
1266
|
-
http_res,
|
|
1267
|
-
)
|
|
1156
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1268
1157
|
|
|
1269
1158
|
def register(
|
|
1270
1159
|
self,
|
|
@@ -1364,63 +1253,50 @@ class Domains(BaseSDK):
|
|
|
1364
1253
|
|
|
1365
1254
|
response_data: Any = None
|
|
1366
1255
|
if utils.match_response(http_res, "201", "application/json"):
|
|
1367
|
-
return
|
|
1368
|
-
|
|
1256
|
+
return unmarshal_json_response(
|
|
1257
|
+
Optional[operations.RegisterDomainResponseBody], http_res
|
|
1369
1258
|
)
|
|
1370
1259
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1371
|
-
response_data =
|
|
1372
|
-
raise errors.BadRequest(
|
|
1260
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
1261
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1373
1262
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1374
|
-
response_data =
|
|
1375
|
-
raise errors.Unauthorized(
|
|
1263
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
1264
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1376
1265
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1377
|
-
response_data =
|
|
1378
|
-
raise errors.Forbidden(
|
|
1266
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
1267
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1379
1268
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1380
|
-
response_data =
|
|
1381
|
-
raise errors.NotFound(
|
|
1269
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1270
|
+
raise errors.NotFound(response_data, http_res)
|
|
1382
1271
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1383
|
-
response_data =
|
|
1384
|
-
raise errors.Conflict(
|
|
1272
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
1273
|
+
raise errors.Conflict(response_data, http_res)
|
|
1385
1274
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1386
|
-
response_data =
|
|
1387
|
-
|
|
1388
|
-
)
|
|
1389
|
-
raise errors.InviteExpired(data=response_data)
|
|
1275
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
1276
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1390
1277
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1391
|
-
response_data =
|
|
1392
|
-
|
|
1278
|
+
response_data = unmarshal_json_response(
|
|
1279
|
+
errors.UnprocessableEntityData, http_res
|
|
1393
1280
|
)
|
|
1394
|
-
raise errors.UnprocessableEntity(
|
|
1281
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1395
1282
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1396
|
-
response_data =
|
|
1397
|
-
|
|
1283
|
+
response_data = unmarshal_json_response(
|
|
1284
|
+
errors.RateLimitExceededData, http_res
|
|
1398
1285
|
)
|
|
1399
|
-
raise errors.RateLimitExceeded(
|
|
1286
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1400
1287
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1401
|
-
response_data =
|
|
1402
|
-
|
|
1288
|
+
response_data = unmarshal_json_response(
|
|
1289
|
+
errors.InternalServerErrorData, http_res
|
|
1403
1290
|
)
|
|
1404
|
-
raise errors.InternalServerError(
|
|
1291
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1405
1292
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1406
1293
|
http_res_text = utils.stream_to_text(http_res)
|
|
1407
|
-
raise errors.SDKError(
|
|
1408
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1409
|
-
)
|
|
1294
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1410
1295
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1411
1296
|
http_res_text = utils.stream_to_text(http_res)
|
|
1412
|
-
raise errors.SDKError(
|
|
1413
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1414
|
-
)
|
|
1297
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1415
1298
|
|
|
1416
|
-
|
|
1417
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1418
|
-
raise errors.SDKError(
|
|
1419
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1420
|
-
http_res.status_code,
|
|
1421
|
-
http_res_text,
|
|
1422
|
-
http_res,
|
|
1423
|
-
)
|
|
1299
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1424
1300
|
|
|
1425
1301
|
async def register_async(
|
|
1426
1302
|
self,
|
|
@@ -1520,63 +1396,50 @@ class Domains(BaseSDK):
|
|
|
1520
1396
|
|
|
1521
1397
|
response_data: Any = None
|
|
1522
1398
|
if utils.match_response(http_res, "201", "application/json"):
|
|
1523
|
-
return
|
|
1524
|
-
|
|
1399
|
+
return unmarshal_json_response(
|
|
1400
|
+
Optional[operations.RegisterDomainResponseBody], http_res
|
|
1525
1401
|
)
|
|
1526
1402
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1527
|
-
response_data =
|
|
1528
|
-
raise errors.BadRequest(
|
|
1403
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
1404
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1529
1405
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1530
|
-
response_data =
|
|
1531
|
-
raise errors.Unauthorized(
|
|
1406
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
1407
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1532
1408
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1533
|
-
response_data =
|
|
1534
|
-
raise errors.Forbidden(
|
|
1409
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
1410
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1535
1411
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1536
|
-
response_data =
|
|
1537
|
-
raise errors.NotFound(
|
|
1412
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1413
|
+
raise errors.NotFound(response_data, http_res)
|
|
1538
1414
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1539
|
-
response_data =
|
|
1540
|
-
raise errors.Conflict(
|
|
1415
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
1416
|
+
raise errors.Conflict(response_data, http_res)
|
|
1541
1417
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1542
|
-
response_data =
|
|
1543
|
-
|
|
1544
|
-
)
|
|
1545
|
-
raise errors.InviteExpired(data=response_data)
|
|
1418
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
1419
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1546
1420
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1547
|
-
response_data =
|
|
1548
|
-
|
|
1421
|
+
response_data = unmarshal_json_response(
|
|
1422
|
+
errors.UnprocessableEntityData, http_res
|
|
1549
1423
|
)
|
|
1550
|
-
raise errors.UnprocessableEntity(
|
|
1424
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1551
1425
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1552
|
-
response_data =
|
|
1553
|
-
|
|
1426
|
+
response_data = unmarshal_json_response(
|
|
1427
|
+
errors.RateLimitExceededData, http_res
|
|
1554
1428
|
)
|
|
1555
|
-
raise errors.RateLimitExceeded(
|
|
1429
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1556
1430
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1557
|
-
response_data =
|
|
1558
|
-
|
|
1431
|
+
response_data = unmarshal_json_response(
|
|
1432
|
+
errors.InternalServerErrorData, http_res
|
|
1559
1433
|
)
|
|
1560
|
-
raise errors.InternalServerError(
|
|
1434
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1561
1435
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1562
1436
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1563
|
-
raise errors.SDKError(
|
|
1564
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1565
|
-
)
|
|
1437
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1566
1438
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1567
1439
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1568
|
-
raise errors.SDKError(
|
|
1569
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1570
|
-
)
|
|
1440
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1571
1441
|
|
|
1572
|
-
|
|
1573
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1574
|
-
raise errors.SDKError(
|
|
1575
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1576
|
-
http_res.status_code,
|
|
1577
|
-
http_res_text,
|
|
1578
|
-
http_res,
|
|
1579
|
-
)
|
|
1442
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1580
1443
|
|
|
1581
1444
|
def check_status(
|
|
1582
1445
|
self,
|
|
@@ -1665,63 +1528,50 @@ class Domains(BaseSDK):
|
|
|
1665
1528
|
|
|
1666
1529
|
response_data: Any = None
|
|
1667
1530
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1668
|
-
return
|
|
1669
|
-
|
|
1531
|
+
return unmarshal_json_response(
|
|
1532
|
+
Optional[List[operations.CheckDomainStatusResponseBody]], http_res
|
|
1670
1533
|
)
|
|
1671
1534
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1672
|
-
response_data =
|
|
1673
|
-
raise errors.BadRequest(
|
|
1535
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
1536
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1674
1537
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1675
|
-
response_data =
|
|
1676
|
-
raise errors.Unauthorized(
|
|
1538
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
1539
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1677
1540
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1678
|
-
response_data =
|
|
1679
|
-
raise errors.Forbidden(
|
|
1541
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
1542
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1680
1543
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1681
|
-
response_data =
|
|
1682
|
-
raise errors.NotFound(
|
|
1544
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1545
|
+
raise errors.NotFound(response_data, http_res)
|
|
1683
1546
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1684
|
-
response_data =
|
|
1685
|
-
raise errors.Conflict(
|
|
1547
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
1548
|
+
raise errors.Conflict(response_data, http_res)
|
|
1686
1549
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1687
|
-
response_data =
|
|
1688
|
-
|
|
1689
|
-
)
|
|
1690
|
-
raise errors.InviteExpired(data=response_data)
|
|
1550
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
1551
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1691
1552
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1692
|
-
response_data =
|
|
1693
|
-
|
|
1553
|
+
response_data = unmarshal_json_response(
|
|
1554
|
+
errors.UnprocessableEntityData, http_res
|
|
1694
1555
|
)
|
|
1695
|
-
raise errors.UnprocessableEntity(
|
|
1556
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1696
1557
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1697
|
-
response_data =
|
|
1698
|
-
|
|
1558
|
+
response_data = unmarshal_json_response(
|
|
1559
|
+
errors.RateLimitExceededData, http_res
|
|
1699
1560
|
)
|
|
1700
|
-
raise errors.RateLimitExceeded(
|
|
1561
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1701
1562
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1702
|
-
response_data =
|
|
1703
|
-
|
|
1563
|
+
response_data = unmarshal_json_response(
|
|
1564
|
+
errors.InternalServerErrorData, http_res
|
|
1704
1565
|
)
|
|
1705
|
-
raise errors.InternalServerError(
|
|
1566
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1706
1567
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1707
1568
|
http_res_text = utils.stream_to_text(http_res)
|
|
1708
|
-
raise errors.SDKError(
|
|
1709
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1710
|
-
)
|
|
1569
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1711
1570
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1712
1571
|
http_res_text = utils.stream_to_text(http_res)
|
|
1713
|
-
raise errors.SDKError(
|
|
1714
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1715
|
-
)
|
|
1572
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1716
1573
|
|
|
1717
|
-
|
|
1718
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1719
|
-
raise errors.SDKError(
|
|
1720
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1721
|
-
http_res.status_code,
|
|
1722
|
-
http_res_text,
|
|
1723
|
-
http_res,
|
|
1724
|
-
)
|
|
1574
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1725
1575
|
|
|
1726
1576
|
async def check_status_async(
|
|
1727
1577
|
self,
|
|
@@ -1810,60 +1660,47 @@ class Domains(BaseSDK):
|
|
|
1810
1660
|
|
|
1811
1661
|
response_data: Any = None
|
|
1812
1662
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1813
|
-
return
|
|
1814
|
-
|
|
1663
|
+
return unmarshal_json_response(
|
|
1664
|
+
Optional[List[operations.CheckDomainStatusResponseBody]], http_res
|
|
1815
1665
|
)
|
|
1816
1666
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1817
|
-
response_data =
|
|
1818
|
-
raise errors.BadRequest(
|
|
1667
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
1668
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1819
1669
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1820
|
-
response_data =
|
|
1821
|
-
raise errors.Unauthorized(
|
|
1670
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
1671
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1822
1672
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1823
|
-
response_data =
|
|
1824
|
-
raise errors.Forbidden(
|
|
1673
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
1674
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1825
1675
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1826
|
-
response_data =
|
|
1827
|
-
raise errors.NotFound(
|
|
1676
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1677
|
+
raise errors.NotFound(response_data, http_res)
|
|
1828
1678
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1829
|
-
response_data =
|
|
1830
|
-
raise errors.Conflict(
|
|
1679
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
1680
|
+
raise errors.Conflict(response_data, http_res)
|
|
1831
1681
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1832
|
-
response_data =
|
|
1833
|
-
|
|
1834
|
-
)
|
|
1835
|
-
raise errors.InviteExpired(data=response_data)
|
|
1682
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
1683
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1836
1684
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1837
|
-
response_data =
|
|
1838
|
-
|
|
1685
|
+
response_data = unmarshal_json_response(
|
|
1686
|
+
errors.UnprocessableEntityData, http_res
|
|
1839
1687
|
)
|
|
1840
|
-
raise errors.UnprocessableEntity(
|
|
1688
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1841
1689
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1842
|
-
response_data =
|
|
1843
|
-
|
|
1690
|
+
response_data = unmarshal_json_response(
|
|
1691
|
+
errors.RateLimitExceededData, http_res
|
|
1844
1692
|
)
|
|
1845
|
-
raise errors.RateLimitExceeded(
|
|
1693
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1846
1694
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1847
|
-
response_data =
|
|
1848
|
-
|
|
1695
|
+
response_data = unmarshal_json_response(
|
|
1696
|
+
errors.InternalServerErrorData, http_res
|
|
1849
1697
|
)
|
|
1850
|
-
raise errors.InternalServerError(
|
|
1698
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1851
1699
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1852
1700
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1853
|
-
raise errors.SDKError(
|
|
1854
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1855
|
-
)
|
|
1701
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1856
1702
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1857
1703
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1858
|
-
raise errors.SDKError(
|
|
1859
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1860
|
-
)
|
|
1704
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1861
1705
|
|
|
1862
|
-
|
|
1863
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1864
|
-
raise errors.SDKError(
|
|
1865
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1866
|
-
http_res.status_code,
|
|
1867
|
-
http_res_text,
|
|
1868
|
-
http_res,
|
|
1869
|
-
)
|
|
1706
|
+
raise errors.SDKError("Unexpected response received", http_res)
|