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/customers.py
CHANGED
|
@@ -96,63 +96,58 @@ class Customers(BaseSDK):
|
|
|
96
96
|
|
|
97
97
|
response_data: Any = None
|
|
98
98
|
if utils.match_response(http_res, "200", "application/json"):
|
|
99
|
-
return utils.
|
|
100
|
-
|
|
99
|
+
return utils.unmarshal_json_response(
|
|
100
|
+
Optional[List[operations.GetCustomersResponseBody]], http_res
|
|
101
101
|
)
|
|
102
102
|
if utils.match_response(http_res, "400", "application/json"):
|
|
103
|
-
response_data = utils.
|
|
104
|
-
|
|
103
|
+
response_data = utils.unmarshal_json_response(
|
|
104
|
+
errors.BadRequestData, http_res
|
|
105
|
+
)
|
|
106
|
+
raise errors.BadRequest(response_data, http_res)
|
|
105
107
|
if utils.match_response(http_res, "401", "application/json"):
|
|
106
|
-
response_data = utils.
|
|
107
|
-
|
|
108
|
+
response_data = utils.unmarshal_json_response(
|
|
109
|
+
errors.UnauthorizedData, http_res
|
|
110
|
+
)
|
|
111
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
108
112
|
if utils.match_response(http_res, "403", "application/json"):
|
|
109
|
-
response_data = utils.
|
|
110
|
-
|
|
113
|
+
response_data = utils.unmarshal_json_response(
|
|
114
|
+
errors.ForbiddenData, http_res
|
|
115
|
+
)
|
|
116
|
+
raise errors.Forbidden(response_data, http_res)
|
|
111
117
|
if utils.match_response(http_res, "404", "application/json"):
|
|
112
|
-
response_data = utils.
|
|
113
|
-
raise errors.NotFound(
|
|
118
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
119
|
+
raise errors.NotFound(response_data, http_res)
|
|
114
120
|
if utils.match_response(http_res, "409", "application/json"):
|
|
115
|
-
response_data = utils.
|
|
116
|
-
raise errors.Conflict(
|
|
121
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
122
|
+
raise errors.Conflict(response_data, http_res)
|
|
117
123
|
if utils.match_response(http_res, "410", "application/json"):
|
|
118
|
-
response_data = utils.
|
|
119
|
-
|
|
124
|
+
response_data = utils.unmarshal_json_response(
|
|
125
|
+
errors.InviteExpiredData, http_res
|
|
120
126
|
)
|
|
121
|
-
raise errors.InviteExpired(
|
|
127
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
122
128
|
if utils.match_response(http_res, "422", "application/json"):
|
|
123
|
-
response_data = utils.
|
|
124
|
-
|
|
129
|
+
response_data = utils.unmarshal_json_response(
|
|
130
|
+
errors.UnprocessableEntityData, http_res
|
|
125
131
|
)
|
|
126
|
-
raise errors.UnprocessableEntity(
|
|
132
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
127
133
|
if utils.match_response(http_res, "429", "application/json"):
|
|
128
|
-
response_data = utils.
|
|
129
|
-
|
|
134
|
+
response_data = utils.unmarshal_json_response(
|
|
135
|
+
errors.RateLimitExceededData, http_res
|
|
130
136
|
)
|
|
131
|
-
raise errors.RateLimitExceeded(
|
|
137
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
132
138
|
if utils.match_response(http_res, "500", "application/json"):
|
|
133
|
-
response_data = utils.
|
|
134
|
-
|
|
139
|
+
response_data = utils.unmarshal_json_response(
|
|
140
|
+
errors.InternalServerErrorData, http_res
|
|
135
141
|
)
|
|
136
|
-
raise errors.InternalServerError(
|
|
142
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
137
143
|
if utils.match_response(http_res, "4XX", "*"):
|
|
138
144
|
http_res_text = utils.stream_to_text(http_res)
|
|
139
|
-
raise errors.SDKError(
|
|
140
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
141
|
-
)
|
|
145
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
142
146
|
if utils.match_response(http_res, "5XX", "*"):
|
|
143
147
|
http_res_text = utils.stream_to_text(http_res)
|
|
144
|
-
raise errors.SDKError(
|
|
145
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
146
|
-
)
|
|
148
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
147
149
|
|
|
148
|
-
|
|
149
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
150
|
-
raise errors.SDKError(
|
|
151
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
152
|
-
http_res.status_code,
|
|
153
|
-
http_res_text,
|
|
154
|
-
http_res,
|
|
155
|
-
)
|
|
150
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
156
151
|
|
|
157
152
|
async def list_async(
|
|
158
153
|
self,
|
|
@@ -240,63 +235,58 @@ class Customers(BaseSDK):
|
|
|
240
235
|
|
|
241
236
|
response_data: Any = None
|
|
242
237
|
if utils.match_response(http_res, "200", "application/json"):
|
|
243
|
-
return utils.
|
|
244
|
-
|
|
238
|
+
return utils.unmarshal_json_response(
|
|
239
|
+
Optional[List[operations.GetCustomersResponseBody]], http_res
|
|
245
240
|
)
|
|
246
241
|
if utils.match_response(http_res, "400", "application/json"):
|
|
247
|
-
response_data = utils.
|
|
248
|
-
|
|
242
|
+
response_data = utils.unmarshal_json_response(
|
|
243
|
+
errors.BadRequestData, http_res
|
|
244
|
+
)
|
|
245
|
+
raise errors.BadRequest(response_data, http_res)
|
|
249
246
|
if utils.match_response(http_res, "401", "application/json"):
|
|
250
|
-
response_data = utils.
|
|
251
|
-
|
|
247
|
+
response_data = utils.unmarshal_json_response(
|
|
248
|
+
errors.UnauthorizedData, http_res
|
|
249
|
+
)
|
|
250
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
252
251
|
if utils.match_response(http_res, "403", "application/json"):
|
|
253
|
-
response_data = utils.
|
|
254
|
-
|
|
252
|
+
response_data = utils.unmarshal_json_response(
|
|
253
|
+
errors.ForbiddenData, http_res
|
|
254
|
+
)
|
|
255
|
+
raise errors.Forbidden(response_data, http_res)
|
|
255
256
|
if utils.match_response(http_res, "404", "application/json"):
|
|
256
|
-
response_data = utils.
|
|
257
|
-
raise errors.NotFound(
|
|
257
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
258
|
+
raise errors.NotFound(response_data, http_res)
|
|
258
259
|
if utils.match_response(http_res, "409", "application/json"):
|
|
259
|
-
response_data = utils.
|
|
260
|
-
raise errors.Conflict(
|
|
260
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
261
|
+
raise errors.Conflict(response_data, http_res)
|
|
261
262
|
if utils.match_response(http_res, "410", "application/json"):
|
|
262
|
-
response_data = utils.
|
|
263
|
-
|
|
263
|
+
response_data = utils.unmarshal_json_response(
|
|
264
|
+
errors.InviteExpiredData, http_res
|
|
264
265
|
)
|
|
265
|
-
raise errors.InviteExpired(
|
|
266
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
266
267
|
if utils.match_response(http_res, "422", "application/json"):
|
|
267
|
-
response_data = utils.
|
|
268
|
-
|
|
268
|
+
response_data = utils.unmarshal_json_response(
|
|
269
|
+
errors.UnprocessableEntityData, http_res
|
|
269
270
|
)
|
|
270
|
-
raise errors.UnprocessableEntity(
|
|
271
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
271
272
|
if utils.match_response(http_res, "429", "application/json"):
|
|
272
|
-
response_data = utils.
|
|
273
|
-
|
|
273
|
+
response_data = utils.unmarshal_json_response(
|
|
274
|
+
errors.RateLimitExceededData, http_res
|
|
274
275
|
)
|
|
275
|
-
raise errors.RateLimitExceeded(
|
|
276
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
276
277
|
if utils.match_response(http_res, "500", "application/json"):
|
|
277
|
-
response_data = utils.
|
|
278
|
-
|
|
278
|
+
response_data = utils.unmarshal_json_response(
|
|
279
|
+
errors.InternalServerErrorData, http_res
|
|
279
280
|
)
|
|
280
|
-
raise errors.InternalServerError(
|
|
281
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
281
282
|
if utils.match_response(http_res, "4XX", "*"):
|
|
282
283
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
283
|
-
raise errors.SDKError(
|
|
284
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
285
|
-
)
|
|
284
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
286
285
|
if utils.match_response(http_res, "5XX", "*"):
|
|
287
286
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
288
|
-
raise errors.SDKError(
|
|
289
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
290
|
-
)
|
|
287
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
291
288
|
|
|
292
|
-
|
|
293
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
294
|
-
raise errors.SDKError(
|
|
295
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
296
|
-
http_res.status_code,
|
|
297
|
-
http_res_text,
|
|
298
|
-
http_res,
|
|
299
|
-
)
|
|
289
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
300
290
|
|
|
301
291
|
@deprecated(
|
|
302
292
|
"warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
@@ -399,63 +389,58 @@ class Customers(BaseSDK):
|
|
|
399
389
|
|
|
400
390
|
response_data: Any = None
|
|
401
391
|
if utils.match_response(http_res, "201", "application/json"):
|
|
402
|
-
return utils.
|
|
403
|
-
|
|
392
|
+
return utils.unmarshal_json_response(
|
|
393
|
+
Optional[operations.CreateCustomerResponseBody], http_res
|
|
404
394
|
)
|
|
405
395
|
if utils.match_response(http_res, "400", "application/json"):
|
|
406
|
-
response_data = utils.
|
|
407
|
-
|
|
396
|
+
response_data = utils.unmarshal_json_response(
|
|
397
|
+
errors.BadRequestData, http_res
|
|
398
|
+
)
|
|
399
|
+
raise errors.BadRequest(response_data, http_res)
|
|
408
400
|
if utils.match_response(http_res, "401", "application/json"):
|
|
409
|
-
response_data = utils.
|
|
410
|
-
|
|
401
|
+
response_data = utils.unmarshal_json_response(
|
|
402
|
+
errors.UnauthorizedData, http_res
|
|
403
|
+
)
|
|
404
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
411
405
|
if utils.match_response(http_res, "403", "application/json"):
|
|
412
|
-
response_data = utils.
|
|
413
|
-
|
|
406
|
+
response_data = utils.unmarshal_json_response(
|
|
407
|
+
errors.ForbiddenData, http_res
|
|
408
|
+
)
|
|
409
|
+
raise errors.Forbidden(response_data, http_res)
|
|
414
410
|
if utils.match_response(http_res, "404", "application/json"):
|
|
415
|
-
response_data = utils.
|
|
416
|
-
raise errors.NotFound(
|
|
411
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
412
|
+
raise errors.NotFound(response_data, http_res)
|
|
417
413
|
if utils.match_response(http_res, "409", "application/json"):
|
|
418
|
-
response_data = utils.
|
|
419
|
-
raise errors.Conflict(
|
|
414
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
415
|
+
raise errors.Conflict(response_data, http_res)
|
|
420
416
|
if utils.match_response(http_res, "410", "application/json"):
|
|
421
|
-
response_data = utils.
|
|
422
|
-
|
|
417
|
+
response_data = utils.unmarshal_json_response(
|
|
418
|
+
errors.InviteExpiredData, http_res
|
|
423
419
|
)
|
|
424
|
-
raise errors.InviteExpired(
|
|
420
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
425
421
|
if utils.match_response(http_res, "422", "application/json"):
|
|
426
|
-
response_data = utils.
|
|
427
|
-
|
|
422
|
+
response_data = utils.unmarshal_json_response(
|
|
423
|
+
errors.UnprocessableEntityData, http_res
|
|
428
424
|
)
|
|
429
|
-
raise errors.UnprocessableEntity(
|
|
425
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
430
426
|
if utils.match_response(http_res, "429", "application/json"):
|
|
431
|
-
response_data = utils.
|
|
432
|
-
|
|
427
|
+
response_data = utils.unmarshal_json_response(
|
|
428
|
+
errors.RateLimitExceededData, http_res
|
|
433
429
|
)
|
|
434
|
-
raise errors.RateLimitExceeded(
|
|
430
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
435
431
|
if utils.match_response(http_res, "500", "application/json"):
|
|
436
|
-
response_data = utils.
|
|
437
|
-
|
|
432
|
+
response_data = utils.unmarshal_json_response(
|
|
433
|
+
errors.InternalServerErrorData, http_res
|
|
438
434
|
)
|
|
439
|
-
raise errors.InternalServerError(
|
|
435
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
440
436
|
if utils.match_response(http_res, "4XX", "*"):
|
|
441
437
|
http_res_text = utils.stream_to_text(http_res)
|
|
442
|
-
raise errors.SDKError(
|
|
443
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
444
|
-
)
|
|
438
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
445
439
|
if utils.match_response(http_res, "5XX", "*"):
|
|
446
440
|
http_res_text = utils.stream_to_text(http_res)
|
|
447
|
-
raise errors.SDKError(
|
|
448
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
449
|
-
)
|
|
441
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
450
442
|
|
|
451
|
-
|
|
452
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
453
|
-
raise errors.SDKError(
|
|
454
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
455
|
-
http_res.status_code,
|
|
456
|
-
http_res_text,
|
|
457
|
-
http_res,
|
|
458
|
-
)
|
|
443
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
459
444
|
|
|
460
445
|
@deprecated(
|
|
461
446
|
"warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
@@ -558,63 +543,58 @@ class Customers(BaseSDK):
|
|
|
558
543
|
|
|
559
544
|
response_data: Any = None
|
|
560
545
|
if utils.match_response(http_res, "201", "application/json"):
|
|
561
|
-
return utils.
|
|
562
|
-
|
|
546
|
+
return utils.unmarshal_json_response(
|
|
547
|
+
Optional[operations.CreateCustomerResponseBody], http_res
|
|
563
548
|
)
|
|
564
549
|
if utils.match_response(http_res, "400", "application/json"):
|
|
565
|
-
response_data = utils.
|
|
566
|
-
|
|
550
|
+
response_data = utils.unmarshal_json_response(
|
|
551
|
+
errors.BadRequestData, http_res
|
|
552
|
+
)
|
|
553
|
+
raise errors.BadRequest(response_data, http_res)
|
|
567
554
|
if utils.match_response(http_res, "401", "application/json"):
|
|
568
|
-
response_data = utils.
|
|
569
|
-
|
|
555
|
+
response_data = utils.unmarshal_json_response(
|
|
556
|
+
errors.UnauthorizedData, http_res
|
|
557
|
+
)
|
|
558
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
570
559
|
if utils.match_response(http_res, "403", "application/json"):
|
|
571
|
-
response_data = utils.
|
|
572
|
-
|
|
560
|
+
response_data = utils.unmarshal_json_response(
|
|
561
|
+
errors.ForbiddenData, http_res
|
|
562
|
+
)
|
|
563
|
+
raise errors.Forbidden(response_data, http_res)
|
|
573
564
|
if utils.match_response(http_res, "404", "application/json"):
|
|
574
|
-
response_data = utils.
|
|
575
|
-
raise errors.NotFound(
|
|
565
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
566
|
+
raise errors.NotFound(response_data, http_res)
|
|
576
567
|
if utils.match_response(http_res, "409", "application/json"):
|
|
577
|
-
response_data = utils.
|
|
578
|
-
raise errors.Conflict(
|
|
568
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
569
|
+
raise errors.Conflict(response_data, http_res)
|
|
579
570
|
if utils.match_response(http_res, "410", "application/json"):
|
|
580
|
-
response_data = utils.
|
|
581
|
-
|
|
571
|
+
response_data = utils.unmarshal_json_response(
|
|
572
|
+
errors.InviteExpiredData, http_res
|
|
582
573
|
)
|
|
583
|
-
raise errors.InviteExpired(
|
|
574
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
584
575
|
if utils.match_response(http_res, "422", "application/json"):
|
|
585
|
-
response_data = utils.
|
|
586
|
-
|
|
576
|
+
response_data = utils.unmarshal_json_response(
|
|
577
|
+
errors.UnprocessableEntityData, http_res
|
|
587
578
|
)
|
|
588
|
-
raise errors.UnprocessableEntity(
|
|
579
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
589
580
|
if utils.match_response(http_res, "429", "application/json"):
|
|
590
|
-
response_data = utils.
|
|
591
|
-
|
|
581
|
+
response_data = utils.unmarshal_json_response(
|
|
582
|
+
errors.RateLimitExceededData, http_res
|
|
592
583
|
)
|
|
593
|
-
raise errors.RateLimitExceeded(
|
|
584
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
594
585
|
if utils.match_response(http_res, "500", "application/json"):
|
|
595
|
-
response_data = utils.
|
|
596
|
-
|
|
586
|
+
response_data = utils.unmarshal_json_response(
|
|
587
|
+
errors.InternalServerErrorData, http_res
|
|
597
588
|
)
|
|
598
|
-
raise errors.InternalServerError(
|
|
589
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
599
590
|
if utils.match_response(http_res, "4XX", "*"):
|
|
600
591
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
601
|
-
raise errors.SDKError(
|
|
602
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
603
|
-
)
|
|
592
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
604
593
|
if utils.match_response(http_res, "5XX", "*"):
|
|
605
594
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
606
|
-
raise errors.SDKError(
|
|
607
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
608
|
-
)
|
|
595
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
609
596
|
|
|
610
|
-
|
|
611
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
612
|
-
raise errors.SDKError(
|
|
613
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
614
|
-
http_res.status_code,
|
|
615
|
-
http_res_text,
|
|
616
|
-
http_res,
|
|
617
|
-
)
|
|
597
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
618
598
|
|
|
619
599
|
def get(
|
|
620
600
|
self,
|
|
@@ -702,63 +682,58 @@ class Customers(BaseSDK):
|
|
|
702
682
|
|
|
703
683
|
response_data: Any = None
|
|
704
684
|
if utils.match_response(http_res, "200", "application/json"):
|
|
705
|
-
return utils.
|
|
706
|
-
|
|
685
|
+
return utils.unmarshal_json_response(
|
|
686
|
+
Optional[operations.GetCustomerResponseBody], http_res
|
|
707
687
|
)
|
|
708
688
|
if utils.match_response(http_res, "400", "application/json"):
|
|
709
|
-
response_data = utils.
|
|
710
|
-
|
|
689
|
+
response_data = utils.unmarshal_json_response(
|
|
690
|
+
errors.BadRequestData, http_res
|
|
691
|
+
)
|
|
692
|
+
raise errors.BadRequest(response_data, http_res)
|
|
711
693
|
if utils.match_response(http_res, "401", "application/json"):
|
|
712
|
-
response_data = utils.
|
|
713
|
-
|
|
694
|
+
response_data = utils.unmarshal_json_response(
|
|
695
|
+
errors.UnauthorizedData, http_res
|
|
696
|
+
)
|
|
697
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
714
698
|
if utils.match_response(http_res, "403", "application/json"):
|
|
715
|
-
response_data = utils.
|
|
716
|
-
|
|
699
|
+
response_data = utils.unmarshal_json_response(
|
|
700
|
+
errors.ForbiddenData, http_res
|
|
701
|
+
)
|
|
702
|
+
raise errors.Forbidden(response_data, http_res)
|
|
717
703
|
if utils.match_response(http_res, "404", "application/json"):
|
|
718
|
-
response_data = utils.
|
|
719
|
-
raise errors.NotFound(
|
|
704
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
705
|
+
raise errors.NotFound(response_data, http_res)
|
|
720
706
|
if utils.match_response(http_res, "409", "application/json"):
|
|
721
|
-
response_data = utils.
|
|
722
|
-
raise errors.Conflict(
|
|
707
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
708
|
+
raise errors.Conflict(response_data, http_res)
|
|
723
709
|
if utils.match_response(http_res, "410", "application/json"):
|
|
724
|
-
response_data = utils.
|
|
725
|
-
|
|
710
|
+
response_data = utils.unmarshal_json_response(
|
|
711
|
+
errors.InviteExpiredData, http_res
|
|
726
712
|
)
|
|
727
|
-
raise errors.InviteExpired(
|
|
713
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
728
714
|
if utils.match_response(http_res, "422", "application/json"):
|
|
729
|
-
response_data = utils.
|
|
730
|
-
|
|
715
|
+
response_data = utils.unmarshal_json_response(
|
|
716
|
+
errors.UnprocessableEntityData, http_res
|
|
731
717
|
)
|
|
732
|
-
raise errors.UnprocessableEntity(
|
|
718
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
733
719
|
if utils.match_response(http_res, "429", "application/json"):
|
|
734
|
-
response_data = utils.
|
|
735
|
-
|
|
720
|
+
response_data = utils.unmarshal_json_response(
|
|
721
|
+
errors.RateLimitExceededData, http_res
|
|
736
722
|
)
|
|
737
|
-
raise errors.RateLimitExceeded(
|
|
723
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
738
724
|
if utils.match_response(http_res, "500", "application/json"):
|
|
739
|
-
response_data = utils.
|
|
740
|
-
|
|
725
|
+
response_data = utils.unmarshal_json_response(
|
|
726
|
+
errors.InternalServerErrorData, http_res
|
|
741
727
|
)
|
|
742
|
-
raise errors.InternalServerError(
|
|
728
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
743
729
|
if utils.match_response(http_res, "4XX", "*"):
|
|
744
730
|
http_res_text = utils.stream_to_text(http_res)
|
|
745
|
-
raise errors.SDKError(
|
|
746
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
747
|
-
)
|
|
731
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
748
732
|
if utils.match_response(http_res, "5XX", "*"):
|
|
749
733
|
http_res_text = utils.stream_to_text(http_res)
|
|
750
|
-
raise errors.SDKError(
|
|
751
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
752
|
-
)
|
|
734
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
753
735
|
|
|
754
|
-
|
|
755
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
756
|
-
raise errors.SDKError(
|
|
757
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
758
|
-
http_res.status_code,
|
|
759
|
-
http_res_text,
|
|
760
|
-
http_res,
|
|
761
|
-
)
|
|
736
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
762
737
|
|
|
763
738
|
async def get_async(
|
|
764
739
|
self,
|
|
@@ -846,63 +821,58 @@ class Customers(BaseSDK):
|
|
|
846
821
|
|
|
847
822
|
response_data: Any = None
|
|
848
823
|
if utils.match_response(http_res, "200", "application/json"):
|
|
849
|
-
return utils.
|
|
850
|
-
|
|
824
|
+
return utils.unmarshal_json_response(
|
|
825
|
+
Optional[operations.GetCustomerResponseBody], http_res
|
|
851
826
|
)
|
|
852
827
|
if utils.match_response(http_res, "400", "application/json"):
|
|
853
|
-
response_data = utils.
|
|
854
|
-
|
|
828
|
+
response_data = utils.unmarshal_json_response(
|
|
829
|
+
errors.BadRequestData, http_res
|
|
830
|
+
)
|
|
831
|
+
raise errors.BadRequest(response_data, http_res)
|
|
855
832
|
if utils.match_response(http_res, "401", "application/json"):
|
|
856
|
-
response_data = utils.
|
|
857
|
-
|
|
833
|
+
response_data = utils.unmarshal_json_response(
|
|
834
|
+
errors.UnauthorizedData, http_res
|
|
835
|
+
)
|
|
836
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
858
837
|
if utils.match_response(http_res, "403", "application/json"):
|
|
859
|
-
response_data = utils.
|
|
860
|
-
|
|
838
|
+
response_data = utils.unmarshal_json_response(
|
|
839
|
+
errors.ForbiddenData, http_res
|
|
840
|
+
)
|
|
841
|
+
raise errors.Forbidden(response_data, http_res)
|
|
861
842
|
if utils.match_response(http_res, "404", "application/json"):
|
|
862
|
-
response_data = utils.
|
|
863
|
-
raise errors.NotFound(
|
|
843
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
844
|
+
raise errors.NotFound(response_data, http_res)
|
|
864
845
|
if utils.match_response(http_res, "409", "application/json"):
|
|
865
|
-
response_data = utils.
|
|
866
|
-
raise errors.Conflict(
|
|
846
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
847
|
+
raise errors.Conflict(response_data, http_res)
|
|
867
848
|
if utils.match_response(http_res, "410", "application/json"):
|
|
868
|
-
response_data = utils.
|
|
869
|
-
|
|
849
|
+
response_data = utils.unmarshal_json_response(
|
|
850
|
+
errors.InviteExpiredData, http_res
|
|
870
851
|
)
|
|
871
|
-
raise errors.InviteExpired(
|
|
852
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
872
853
|
if utils.match_response(http_res, "422", "application/json"):
|
|
873
|
-
response_data = utils.
|
|
874
|
-
|
|
854
|
+
response_data = utils.unmarshal_json_response(
|
|
855
|
+
errors.UnprocessableEntityData, http_res
|
|
875
856
|
)
|
|
876
|
-
raise errors.UnprocessableEntity(
|
|
857
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
877
858
|
if utils.match_response(http_res, "429", "application/json"):
|
|
878
|
-
response_data = utils.
|
|
879
|
-
|
|
859
|
+
response_data = utils.unmarshal_json_response(
|
|
860
|
+
errors.RateLimitExceededData, http_res
|
|
880
861
|
)
|
|
881
|
-
raise errors.RateLimitExceeded(
|
|
862
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
882
863
|
if utils.match_response(http_res, "500", "application/json"):
|
|
883
|
-
response_data = utils.
|
|
884
|
-
|
|
864
|
+
response_data = utils.unmarshal_json_response(
|
|
865
|
+
errors.InternalServerErrorData, http_res
|
|
885
866
|
)
|
|
886
|
-
raise errors.InternalServerError(
|
|
867
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
887
868
|
if utils.match_response(http_res, "4XX", "*"):
|
|
888
869
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
889
|
-
raise errors.SDKError(
|
|
890
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
891
|
-
)
|
|
870
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
892
871
|
if utils.match_response(http_res, "5XX", "*"):
|
|
893
872
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
894
|
-
raise errors.SDKError(
|
|
895
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
896
|
-
)
|
|
873
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
897
874
|
|
|
898
|
-
|
|
899
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
900
|
-
raise errors.SDKError(
|
|
901
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
902
|
-
http_res.status_code,
|
|
903
|
-
http_res_text,
|
|
904
|
-
http_res,
|
|
905
|
-
)
|
|
875
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
906
876
|
|
|
907
877
|
def update(
|
|
908
878
|
self,
|
|
@@ -997,63 +967,58 @@ class Customers(BaseSDK):
|
|
|
997
967
|
|
|
998
968
|
response_data: Any = None
|
|
999
969
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1000
|
-
return utils.
|
|
1001
|
-
|
|
970
|
+
return utils.unmarshal_json_response(
|
|
971
|
+
Optional[operations.UpdateCustomerResponseBody], http_res
|
|
1002
972
|
)
|
|
1003
973
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1004
|
-
response_data = utils.
|
|
1005
|
-
|
|
974
|
+
response_data = utils.unmarshal_json_response(
|
|
975
|
+
errors.BadRequestData, http_res
|
|
976
|
+
)
|
|
977
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1006
978
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1007
|
-
response_data = utils.
|
|
1008
|
-
|
|
979
|
+
response_data = utils.unmarshal_json_response(
|
|
980
|
+
errors.UnauthorizedData, http_res
|
|
981
|
+
)
|
|
982
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1009
983
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1010
|
-
response_data = utils.
|
|
1011
|
-
|
|
984
|
+
response_data = utils.unmarshal_json_response(
|
|
985
|
+
errors.ForbiddenData, http_res
|
|
986
|
+
)
|
|
987
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1012
988
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1013
|
-
response_data = utils.
|
|
1014
|
-
raise errors.NotFound(
|
|
989
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
990
|
+
raise errors.NotFound(response_data, http_res)
|
|
1015
991
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1016
|
-
response_data = utils.
|
|
1017
|
-
raise errors.Conflict(
|
|
992
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
993
|
+
raise errors.Conflict(response_data, http_res)
|
|
1018
994
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1019
|
-
response_data = utils.
|
|
1020
|
-
|
|
995
|
+
response_data = utils.unmarshal_json_response(
|
|
996
|
+
errors.InviteExpiredData, http_res
|
|
1021
997
|
)
|
|
1022
|
-
raise errors.InviteExpired(
|
|
998
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1023
999
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1024
|
-
response_data = utils.
|
|
1025
|
-
|
|
1000
|
+
response_data = utils.unmarshal_json_response(
|
|
1001
|
+
errors.UnprocessableEntityData, http_res
|
|
1026
1002
|
)
|
|
1027
|
-
raise errors.UnprocessableEntity(
|
|
1003
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1028
1004
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1029
|
-
response_data = utils.
|
|
1030
|
-
|
|
1005
|
+
response_data = utils.unmarshal_json_response(
|
|
1006
|
+
errors.RateLimitExceededData, http_res
|
|
1031
1007
|
)
|
|
1032
|
-
raise errors.RateLimitExceeded(
|
|
1008
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1033
1009
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1034
|
-
response_data = utils.
|
|
1035
|
-
|
|
1010
|
+
response_data = utils.unmarshal_json_response(
|
|
1011
|
+
errors.InternalServerErrorData, http_res
|
|
1036
1012
|
)
|
|
1037
|
-
raise errors.InternalServerError(
|
|
1013
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1038
1014
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1039
1015
|
http_res_text = utils.stream_to_text(http_res)
|
|
1040
|
-
raise errors.SDKError(
|
|
1041
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1042
|
-
)
|
|
1016
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1043
1017
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1044
1018
|
http_res_text = utils.stream_to_text(http_res)
|
|
1045
|
-
raise errors.SDKError(
|
|
1046
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1047
|
-
)
|
|
1019
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1048
1020
|
|
|
1049
|
-
|
|
1050
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1051
|
-
raise errors.SDKError(
|
|
1052
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1053
|
-
http_res.status_code,
|
|
1054
|
-
http_res_text,
|
|
1055
|
-
http_res,
|
|
1056
|
-
)
|
|
1021
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1057
1022
|
|
|
1058
1023
|
async def update_async(
|
|
1059
1024
|
self,
|
|
@@ -1148,63 +1113,58 @@ class Customers(BaseSDK):
|
|
|
1148
1113
|
|
|
1149
1114
|
response_data: Any = None
|
|
1150
1115
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1151
|
-
return utils.
|
|
1152
|
-
|
|
1116
|
+
return utils.unmarshal_json_response(
|
|
1117
|
+
Optional[operations.UpdateCustomerResponseBody], http_res
|
|
1153
1118
|
)
|
|
1154
1119
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1155
|
-
response_data = utils.
|
|
1156
|
-
|
|
1120
|
+
response_data = utils.unmarshal_json_response(
|
|
1121
|
+
errors.BadRequestData, http_res
|
|
1122
|
+
)
|
|
1123
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1157
1124
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1158
|
-
response_data = utils.
|
|
1159
|
-
|
|
1125
|
+
response_data = utils.unmarshal_json_response(
|
|
1126
|
+
errors.UnauthorizedData, http_res
|
|
1127
|
+
)
|
|
1128
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1160
1129
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1161
|
-
response_data = utils.
|
|
1162
|
-
|
|
1130
|
+
response_data = utils.unmarshal_json_response(
|
|
1131
|
+
errors.ForbiddenData, http_res
|
|
1132
|
+
)
|
|
1133
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1163
1134
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1164
|
-
response_data = utils.
|
|
1165
|
-
raise errors.NotFound(
|
|
1135
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1136
|
+
raise errors.NotFound(response_data, http_res)
|
|
1166
1137
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1167
|
-
response_data = utils.
|
|
1168
|
-
raise errors.Conflict(
|
|
1138
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
1139
|
+
raise errors.Conflict(response_data, http_res)
|
|
1169
1140
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1170
|
-
response_data = utils.
|
|
1171
|
-
|
|
1141
|
+
response_data = utils.unmarshal_json_response(
|
|
1142
|
+
errors.InviteExpiredData, http_res
|
|
1172
1143
|
)
|
|
1173
|
-
raise errors.InviteExpired(
|
|
1144
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1174
1145
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1175
|
-
response_data = utils.
|
|
1176
|
-
|
|
1146
|
+
response_data = utils.unmarshal_json_response(
|
|
1147
|
+
errors.UnprocessableEntityData, http_res
|
|
1177
1148
|
)
|
|
1178
|
-
raise errors.UnprocessableEntity(
|
|
1149
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1179
1150
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1180
|
-
response_data = utils.
|
|
1181
|
-
|
|
1151
|
+
response_data = utils.unmarshal_json_response(
|
|
1152
|
+
errors.RateLimitExceededData, http_res
|
|
1182
1153
|
)
|
|
1183
|
-
raise errors.RateLimitExceeded(
|
|
1154
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1184
1155
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1185
|
-
response_data = utils.
|
|
1186
|
-
|
|
1156
|
+
response_data = utils.unmarshal_json_response(
|
|
1157
|
+
errors.InternalServerErrorData, http_res
|
|
1187
1158
|
)
|
|
1188
|
-
raise errors.InternalServerError(
|
|
1159
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1189
1160
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1190
1161
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1191
|
-
raise errors.SDKError(
|
|
1192
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1193
|
-
)
|
|
1162
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1194
1163
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1195
1164
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1196
|
-
raise errors.SDKError(
|
|
1197
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1198
|
-
)
|
|
1165
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1199
1166
|
|
|
1200
|
-
|
|
1201
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1202
|
-
raise errors.SDKError(
|
|
1203
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1204
|
-
http_res.status_code,
|
|
1205
|
-
http_res_text,
|
|
1206
|
-
http_res,
|
|
1207
|
-
)
|
|
1167
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1208
1168
|
|
|
1209
1169
|
def delete(
|
|
1210
1170
|
self,
|
|
@@ -1290,63 +1250,58 @@ class Customers(BaseSDK):
|
|
|
1290
1250
|
|
|
1291
1251
|
response_data: Any = None
|
|
1292
1252
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1293
|
-
return utils.
|
|
1294
|
-
|
|
1253
|
+
return utils.unmarshal_json_response(
|
|
1254
|
+
Optional[operations.DeleteCustomerResponseBody], http_res
|
|
1295
1255
|
)
|
|
1296
1256
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1297
|
-
response_data = utils.
|
|
1298
|
-
|
|
1257
|
+
response_data = utils.unmarshal_json_response(
|
|
1258
|
+
errors.BadRequestData, http_res
|
|
1259
|
+
)
|
|
1260
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1299
1261
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1300
|
-
response_data = utils.
|
|
1301
|
-
|
|
1262
|
+
response_data = utils.unmarshal_json_response(
|
|
1263
|
+
errors.UnauthorizedData, http_res
|
|
1264
|
+
)
|
|
1265
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1302
1266
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1303
|
-
response_data = utils.
|
|
1304
|
-
|
|
1267
|
+
response_data = utils.unmarshal_json_response(
|
|
1268
|
+
errors.ForbiddenData, http_res
|
|
1269
|
+
)
|
|
1270
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1305
1271
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1306
|
-
response_data = utils.
|
|
1307
|
-
raise errors.NotFound(
|
|
1272
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1273
|
+
raise errors.NotFound(response_data, http_res)
|
|
1308
1274
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1309
|
-
response_data = utils.
|
|
1310
|
-
raise errors.Conflict(
|
|
1275
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
1276
|
+
raise errors.Conflict(response_data, http_res)
|
|
1311
1277
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1312
|
-
response_data = utils.
|
|
1313
|
-
|
|
1278
|
+
response_data = utils.unmarshal_json_response(
|
|
1279
|
+
errors.InviteExpiredData, http_res
|
|
1314
1280
|
)
|
|
1315
|
-
raise errors.InviteExpired(
|
|
1281
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1316
1282
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1317
|
-
response_data = utils.
|
|
1318
|
-
|
|
1283
|
+
response_data = utils.unmarshal_json_response(
|
|
1284
|
+
errors.UnprocessableEntityData, http_res
|
|
1319
1285
|
)
|
|
1320
|
-
raise errors.UnprocessableEntity(
|
|
1286
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1321
1287
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1322
|
-
response_data = utils.
|
|
1323
|
-
|
|
1288
|
+
response_data = utils.unmarshal_json_response(
|
|
1289
|
+
errors.RateLimitExceededData, http_res
|
|
1324
1290
|
)
|
|
1325
|
-
raise errors.RateLimitExceeded(
|
|
1291
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1326
1292
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1327
|
-
response_data = utils.
|
|
1328
|
-
|
|
1293
|
+
response_data = utils.unmarshal_json_response(
|
|
1294
|
+
errors.InternalServerErrorData, http_res
|
|
1329
1295
|
)
|
|
1330
|
-
raise errors.InternalServerError(
|
|
1296
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1331
1297
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1332
1298
|
http_res_text = utils.stream_to_text(http_res)
|
|
1333
|
-
raise errors.SDKError(
|
|
1334
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1335
|
-
)
|
|
1299
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1336
1300
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1337
1301
|
http_res_text = utils.stream_to_text(http_res)
|
|
1338
|
-
raise errors.SDKError(
|
|
1339
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1340
|
-
)
|
|
1302
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1341
1303
|
|
|
1342
|
-
|
|
1343
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1344
|
-
raise errors.SDKError(
|
|
1345
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1346
|
-
http_res.status_code,
|
|
1347
|
-
http_res_text,
|
|
1348
|
-
http_res,
|
|
1349
|
-
)
|
|
1304
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
1350
1305
|
|
|
1351
1306
|
async def delete_async(
|
|
1352
1307
|
self,
|
|
@@ -1432,60 +1387,55 @@ class Customers(BaseSDK):
|
|
|
1432
1387
|
|
|
1433
1388
|
response_data: Any = None
|
|
1434
1389
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1435
|
-
return utils.
|
|
1436
|
-
|
|
1390
|
+
return utils.unmarshal_json_response(
|
|
1391
|
+
Optional[operations.DeleteCustomerResponseBody], http_res
|
|
1437
1392
|
)
|
|
1438
1393
|
if utils.match_response(http_res, "400", "application/json"):
|
|
1439
|
-
response_data = utils.
|
|
1440
|
-
|
|
1394
|
+
response_data = utils.unmarshal_json_response(
|
|
1395
|
+
errors.BadRequestData, http_res
|
|
1396
|
+
)
|
|
1397
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1441
1398
|
if utils.match_response(http_res, "401", "application/json"):
|
|
1442
|
-
response_data = utils.
|
|
1443
|
-
|
|
1399
|
+
response_data = utils.unmarshal_json_response(
|
|
1400
|
+
errors.UnauthorizedData, http_res
|
|
1401
|
+
)
|
|
1402
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1444
1403
|
if utils.match_response(http_res, "403", "application/json"):
|
|
1445
|
-
response_data = utils.
|
|
1446
|
-
|
|
1404
|
+
response_data = utils.unmarshal_json_response(
|
|
1405
|
+
errors.ForbiddenData, http_res
|
|
1406
|
+
)
|
|
1407
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1447
1408
|
if utils.match_response(http_res, "404", "application/json"):
|
|
1448
|
-
response_data = utils.
|
|
1449
|
-
raise errors.NotFound(
|
|
1409
|
+
response_data = utils.unmarshal_json_response(errors.NotFoundData, http_res)
|
|
1410
|
+
raise errors.NotFound(response_data, http_res)
|
|
1450
1411
|
if utils.match_response(http_res, "409", "application/json"):
|
|
1451
|
-
response_data = utils.
|
|
1452
|
-
raise errors.Conflict(
|
|
1412
|
+
response_data = utils.unmarshal_json_response(errors.ConflictData, http_res)
|
|
1413
|
+
raise errors.Conflict(response_data, http_res)
|
|
1453
1414
|
if utils.match_response(http_res, "410", "application/json"):
|
|
1454
|
-
response_data = utils.
|
|
1455
|
-
|
|
1415
|
+
response_data = utils.unmarshal_json_response(
|
|
1416
|
+
errors.InviteExpiredData, http_res
|
|
1456
1417
|
)
|
|
1457
|
-
raise errors.InviteExpired(
|
|
1418
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
1458
1419
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1459
|
-
response_data = utils.
|
|
1460
|
-
|
|
1420
|
+
response_data = utils.unmarshal_json_response(
|
|
1421
|
+
errors.UnprocessableEntityData, http_res
|
|
1461
1422
|
)
|
|
1462
|
-
raise errors.UnprocessableEntity(
|
|
1423
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
1463
1424
|
if utils.match_response(http_res, "429", "application/json"):
|
|
1464
|
-
response_data = utils.
|
|
1465
|
-
|
|
1425
|
+
response_data = utils.unmarshal_json_response(
|
|
1426
|
+
errors.RateLimitExceededData, http_res
|
|
1466
1427
|
)
|
|
1467
|
-
raise errors.RateLimitExceeded(
|
|
1428
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
1468
1429
|
if utils.match_response(http_res, "500", "application/json"):
|
|
1469
|
-
response_data = utils.
|
|
1470
|
-
|
|
1430
|
+
response_data = utils.unmarshal_json_response(
|
|
1431
|
+
errors.InternalServerErrorData, http_res
|
|
1471
1432
|
)
|
|
1472
|
-
raise errors.InternalServerError(
|
|
1433
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1473
1434
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1474
1435
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1475
|
-
raise errors.SDKError(
|
|
1476
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1477
|
-
)
|
|
1436
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1478
1437
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1479
1438
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1480
|
-
raise errors.SDKError(
|
|
1481
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1482
|
-
)
|
|
1439
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
1483
1440
|
|
|
1484
|
-
|
|
1485
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1486
|
-
raise errors.SDKError(
|
|
1487
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1488
|
-
http_res.status_code,
|
|
1489
|
-
http_res_text,
|
|
1490
|
-
http_res,
|
|
1491
|
-
)
|
|
1441
|
+
raise errors.SDKError("Unexpected response received", http_res)
|