latitudesh-python-sdk 1.1.0__py3-none-any.whl → 2.0.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.
Potentially problematic release.
This version of latitudesh-python-sdk might be problematic. Click here for more details.
- latitudesh_python_sdk/_hooks/types.py +7 -0
- latitudesh_python_sdk/_version.py +6 -4
- latitudesh_python_sdk/apikeys.py +73 -156
- latitudesh_python_sdk/basesdk.py +16 -24
- latitudesh_python_sdk/billing.py +13 -32
- latitudesh_python_sdk/events_sdk.py +11 -34
- latitudesh_python_sdk/firewalls_sdk.py +105 -264
- latitudesh_python_sdk/httpclient.py +6 -16
- latitudesh_python_sdk/ipaddresses_sdk.py +29 -68
- latitudesh_python_sdk/models/__init__.py +2586 -1126
- latitudesh_python_sdk/models/apierror.py +30 -14
- latitudesh_python_sdk/models/assign_server_virtual_networkop.py +2 -2
- latitudesh_python_sdk/models/{bandwidth_plan.py → bandwidth_plan_data.py} +9 -9
- latitudesh_python_sdk/models/bandwidth_plans.py +14 -3
- latitudesh_python_sdk/models/custom_tag.py +15 -0
- latitudesh_python_sdk/models/custom_tag_data.py +54 -0
- latitudesh_python_sdk/models/custom_tags.py +26 -0
- latitudesh_python_sdk/models/delete_ssh_keyop.py +16 -0
- latitudesh_python_sdk/models/delete_user_dataop.py +16 -0
- latitudesh_python_sdk/models/deploy_config.py +11 -6
- latitudesh_python_sdk/models/error_object.py +11 -6
- latitudesh_python_sdk/models/event_data.py +98 -0
- latitudesh_python_sdk/models/events.py +16 -1
- latitudesh_python_sdk/models/filesystem_data.py +4 -0
- latitudesh_python_sdk/models/firewall.py +15 -0
- latitudesh_python_sdk/models/firewall_assignment_data.py +50 -0
- latitudesh_python_sdk/models/firewall_assignments.py +29 -0
- latitudesh_python_sdk/models/firewall_data.py +71 -0
- latitudesh_python_sdk/models/firewall_server.py +4 -1
- latitudesh_python_sdk/models/firewalls.py +7 -7
- latitudesh_python_sdk/models/get_firewall_assignmentsop.py +3 -3
- latitudesh_python_sdk/models/get_ssh_keyop.py +30 -0
- latitudesh_python_sdk/models/get_ssh_keysop.py +22 -0
- latitudesh_python_sdk/models/get_traffic_consumptionop.py +8 -4
- latitudesh_python_sdk/models/get_user_dataop.py +31 -0
- latitudesh_python_sdk/models/get_users_dataop.py +35 -0
- latitudesh_python_sdk/models/latitudesherror.py +26 -0
- latitudesh_python_sdk/models/no_response_error.py +13 -0
- latitudesh_python_sdk/models/operating_system_data.py +65 -0
- latitudesh_python_sdk/models/operating_systems.py +15 -0
- latitudesh_python_sdk/models/out_of_band_connection.py +4 -4
- latitudesh_python_sdk/models/patch_user_dataop.py +69 -0
- latitudesh_python_sdk/models/post_ssh_keyop.py +58 -0
- latitudesh_python_sdk/models/post_user_dataop.py +45 -0
- latitudesh_python_sdk/models/project_include.py +3 -0
- latitudesh_python_sdk/models/put_ssh_keyop.py +80 -0
- latitudesh_python_sdk/models/region_resource_data.py +4 -4
- latitudesh_python_sdk/models/responsevalidationerror.py +25 -0
- latitudesh_python_sdk/models/role.py +11 -0
- latitudesh_python_sdk/models/server.py +11 -6
- latitudesh_python_sdk/models/server_data.py +14 -3
- latitudesh_python_sdk/models/server_region_resource_data.py +40 -0
- latitudesh_python_sdk/models/{ssh_key.py → ssh_keys.py} +13 -2
- latitudesh_python_sdk/models/storage_plan_data.py +47 -0
- latitudesh_python_sdk/models/storage_plans.py +14 -3
- latitudesh_python_sdk/models/update_serverop.py +58 -10
- latitudesh_python_sdk/models/user_data.py +11 -0
- latitudesh_python_sdk/models/virtual_network.py +30 -6
- latitudesh_python_sdk/models/virtual_network1.py +15 -0
- latitudesh_python_sdk/models/virtual_network_assignment.py +41 -0
- latitudesh_python_sdk/models/virtual_network_assignment_data.py +68 -0
- latitudesh_python_sdk/models/virtual_network_assignments.py +5 -5
- latitudesh_python_sdk/models/virtual_network_data.py +88 -0
- latitudesh_python_sdk/models/virtual_networks.py +3 -3
- latitudesh_python_sdk/operatingsystems_sdk.py +13 -32
- latitudesh_python_sdk/plans.py +99 -214
- latitudesh_python_sdk/privatenetworks.py +131 -290
- latitudesh_python_sdk/projects_sdk.py +79 -158
- latitudesh_python_sdk/regions_sdk.py +25 -66
- latitudesh_python_sdk/roles.py +25 -64
- latitudesh_python_sdk/sdk.py +110 -73
- latitudesh_python_sdk/sdkconfiguration.py +0 -7
- latitudesh_python_sdk/servers_sdk.py +305 -646
- latitudesh_python_sdk/sshkeys_sdk.py +1856 -0
- latitudesh_python_sdk/storage.py +41 -120
- latitudesh_python_sdk/tags.py +67 -146
- latitudesh_python_sdk/teams_sdk.py +41 -100
- latitudesh_python_sdk/teamsmembers.py +37 -96
- latitudesh_python_sdk/traffic_sdk.py +37 -76
- latitudesh_python_sdk/userdata_sdk.py +959 -149
- latitudesh_python_sdk/userprofile.py +37 -100
- latitudesh_python_sdk/utils/__init__.py +131 -46
- latitudesh_python_sdk/utils/forms.py +49 -28
- latitudesh_python_sdk/utils/serializers.py +3 -2
- latitudesh_python_sdk/utils/unmarshal_json_response.py +24 -0
- latitudesh_python_sdk/virtualmachines.py +71 -140
- latitudesh_python_sdk/vpnsessions.py +93 -172
- {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/METADATA +76 -43
- {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/RECORD +91 -67
- {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/WHEEL +1 -1
- latitudesh_python_sdk/models/storage_plan.py +0 -36
- latitudesh_python_sdk/sshkeys.py +0 -1050
- {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/LICENSE +0 -0
|
@@ -5,6 +5,7 @@ from latitudesh_python_sdk import models, utils
|
|
|
5
5
|
from latitudesh_python_sdk._hooks import HookContext
|
|
6
6
|
from latitudesh_python_sdk.types import OptionalNullable, UNSET
|
|
7
7
|
from latitudesh_python_sdk.utils import get_security_from_env
|
|
8
|
+
from latitudesh_python_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
8
9
|
from typing import Any, Mapping, Optional, Union
|
|
9
10
|
|
|
10
11
|
|
|
@@ -59,6 +60,7 @@ class TeamsSDK(BaseSDK):
|
|
|
59
60
|
|
|
60
61
|
http_res = self.do_request(
|
|
61
62
|
hook_ctx=HookContext(
|
|
63
|
+
config=self.sdk_configuration,
|
|
62
64
|
base_url=base_url or "",
|
|
63
65
|
operation_id="get-team",
|
|
64
66
|
oauth2_scopes=[],
|
|
@@ -72,26 +74,15 @@ class TeamsSDK(BaseSDK):
|
|
|
72
74
|
)
|
|
73
75
|
|
|
74
76
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
75
|
-
return
|
|
77
|
+
return unmarshal_json_response(models.Teams, http_res)
|
|
76
78
|
if utils.match_response(http_res, "4XX", "*"):
|
|
77
79
|
http_res_text = utils.stream_to_text(http_res)
|
|
78
|
-
raise models.APIError(
|
|
79
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
80
|
-
)
|
|
80
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
81
81
|
if utils.match_response(http_res, "5XX", "*"):
|
|
82
82
|
http_res_text = utils.stream_to_text(http_res)
|
|
83
|
-
raise models.APIError(
|
|
84
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
85
|
-
)
|
|
83
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
86
84
|
|
|
87
|
-
|
|
88
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
89
|
-
raise models.APIError(
|
|
90
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
91
|
-
http_res.status_code,
|
|
92
|
-
http_res_text,
|
|
93
|
-
http_res,
|
|
94
|
-
)
|
|
85
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
95
86
|
|
|
96
87
|
async def get_async(
|
|
97
88
|
self,
|
|
@@ -143,6 +134,7 @@ class TeamsSDK(BaseSDK):
|
|
|
143
134
|
|
|
144
135
|
http_res = await self.do_request_async(
|
|
145
136
|
hook_ctx=HookContext(
|
|
137
|
+
config=self.sdk_configuration,
|
|
146
138
|
base_url=base_url or "",
|
|
147
139
|
operation_id="get-team",
|
|
148
140
|
oauth2_scopes=[],
|
|
@@ -156,26 +148,15 @@ class TeamsSDK(BaseSDK):
|
|
|
156
148
|
)
|
|
157
149
|
|
|
158
150
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
159
|
-
return
|
|
151
|
+
return unmarshal_json_response(models.Teams, http_res)
|
|
160
152
|
if utils.match_response(http_res, "4XX", "*"):
|
|
161
153
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
162
|
-
raise models.APIError(
|
|
163
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
164
|
-
)
|
|
154
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
165
155
|
if utils.match_response(http_res, "5XX", "*"):
|
|
166
156
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
167
|
-
raise models.APIError(
|
|
168
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
169
|
-
)
|
|
157
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
170
158
|
|
|
171
|
-
|
|
172
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
173
|
-
raise models.APIError(
|
|
174
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
175
|
-
http_res.status_code,
|
|
176
|
-
http_res_text,
|
|
177
|
-
http_res,
|
|
178
|
-
)
|
|
159
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
179
160
|
|
|
180
161
|
def create(
|
|
181
162
|
self,
|
|
@@ -237,6 +218,7 @@ class TeamsSDK(BaseSDK):
|
|
|
237
218
|
|
|
238
219
|
http_res = self.do_request(
|
|
239
220
|
hook_ctx=HookContext(
|
|
221
|
+
config=self.sdk_configuration,
|
|
240
222
|
base_url=base_url or "",
|
|
241
223
|
operation_id="post-team",
|
|
242
224
|
oauth2_scopes=[],
|
|
@@ -251,29 +233,18 @@ class TeamsSDK(BaseSDK):
|
|
|
251
233
|
|
|
252
234
|
response_data: Any = None
|
|
253
235
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
254
|
-
return
|
|
236
|
+
return unmarshal_json_response(models.PostTeamResponseBody, http_res)
|
|
255
237
|
if utils.match_response(http_res, ["406", "422"], "application/vnd.api+json"):
|
|
256
|
-
response_data =
|
|
257
|
-
raise models.ErrorObject(
|
|
238
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
239
|
+
raise models.ErrorObject(response_data, http_res)
|
|
258
240
|
if utils.match_response(http_res, "4XX", "*"):
|
|
259
241
|
http_res_text = utils.stream_to_text(http_res)
|
|
260
|
-
raise models.APIError(
|
|
261
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
262
|
-
)
|
|
242
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
263
243
|
if utils.match_response(http_res, "5XX", "*"):
|
|
264
244
|
http_res_text = utils.stream_to_text(http_res)
|
|
265
|
-
raise models.APIError(
|
|
266
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
267
|
-
)
|
|
245
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
268
246
|
|
|
269
|
-
|
|
270
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
271
|
-
raise models.APIError(
|
|
272
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
273
|
-
http_res.status_code,
|
|
274
|
-
http_res_text,
|
|
275
|
-
http_res,
|
|
276
|
-
)
|
|
247
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
277
248
|
|
|
278
249
|
async def create_async(
|
|
279
250
|
self,
|
|
@@ -335,6 +306,7 @@ class TeamsSDK(BaseSDK):
|
|
|
335
306
|
|
|
336
307
|
http_res = await self.do_request_async(
|
|
337
308
|
hook_ctx=HookContext(
|
|
309
|
+
config=self.sdk_configuration,
|
|
338
310
|
base_url=base_url or "",
|
|
339
311
|
operation_id="post-team",
|
|
340
312
|
oauth2_scopes=[],
|
|
@@ -349,29 +321,18 @@ class TeamsSDK(BaseSDK):
|
|
|
349
321
|
|
|
350
322
|
response_data: Any = None
|
|
351
323
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
352
|
-
return
|
|
324
|
+
return unmarshal_json_response(models.PostTeamResponseBody, http_res)
|
|
353
325
|
if utils.match_response(http_res, ["406", "422"], "application/vnd.api+json"):
|
|
354
|
-
response_data =
|
|
355
|
-
raise models.ErrorObject(
|
|
326
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
327
|
+
raise models.ErrorObject(response_data, http_res)
|
|
356
328
|
if utils.match_response(http_res, "4XX", "*"):
|
|
357
329
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
358
|
-
raise models.APIError(
|
|
359
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
360
|
-
)
|
|
330
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
361
331
|
if utils.match_response(http_res, "5XX", "*"):
|
|
362
332
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
363
|
-
raise models.APIError(
|
|
364
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
365
|
-
)
|
|
333
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
366
334
|
|
|
367
|
-
|
|
368
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
369
|
-
raise models.APIError(
|
|
370
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
371
|
-
http_res.status_code,
|
|
372
|
-
http_res_text,
|
|
373
|
-
http_res,
|
|
374
|
-
)
|
|
335
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
375
336
|
|
|
376
337
|
def update(
|
|
377
338
|
self,
|
|
@@ -444,6 +405,7 @@ class TeamsSDK(BaseSDK):
|
|
|
444
405
|
|
|
445
406
|
http_res = self.do_request(
|
|
446
407
|
hook_ctx=HookContext(
|
|
408
|
+
config=self.sdk_configuration,
|
|
447
409
|
base_url=base_url or "",
|
|
448
410
|
operation_id="patch-current-team",
|
|
449
411
|
oauth2_scopes=[],
|
|
@@ -458,31 +420,20 @@ class TeamsSDK(BaseSDK):
|
|
|
458
420
|
|
|
459
421
|
response_data: Any = None
|
|
460
422
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
461
|
-
return
|
|
462
|
-
|
|
423
|
+
return unmarshal_json_response(
|
|
424
|
+
models.PatchCurrentTeamResponseBody, http_res
|
|
463
425
|
)
|
|
464
426
|
if utils.match_response(http_res, ["403", "404"], "application/vnd.api+json"):
|
|
465
|
-
response_data =
|
|
466
|
-
raise models.ErrorObject(
|
|
427
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
428
|
+
raise models.ErrorObject(response_data, http_res)
|
|
467
429
|
if utils.match_response(http_res, "4XX", "*"):
|
|
468
430
|
http_res_text = utils.stream_to_text(http_res)
|
|
469
|
-
raise models.APIError(
|
|
470
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
471
|
-
)
|
|
431
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
472
432
|
if utils.match_response(http_res, "5XX", "*"):
|
|
473
433
|
http_res_text = utils.stream_to_text(http_res)
|
|
474
|
-
raise models.APIError(
|
|
475
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
476
|
-
)
|
|
434
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
477
435
|
|
|
478
|
-
|
|
479
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
480
|
-
raise models.APIError(
|
|
481
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
482
|
-
http_res.status_code,
|
|
483
|
-
http_res_text,
|
|
484
|
-
http_res,
|
|
485
|
-
)
|
|
436
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
486
437
|
|
|
487
438
|
async def update_async(
|
|
488
439
|
self,
|
|
@@ -555,6 +506,7 @@ class TeamsSDK(BaseSDK):
|
|
|
555
506
|
|
|
556
507
|
http_res = await self.do_request_async(
|
|
557
508
|
hook_ctx=HookContext(
|
|
509
|
+
config=self.sdk_configuration,
|
|
558
510
|
base_url=base_url or "",
|
|
559
511
|
operation_id="patch-current-team",
|
|
560
512
|
oauth2_scopes=[],
|
|
@@ -569,28 +521,17 @@ class TeamsSDK(BaseSDK):
|
|
|
569
521
|
|
|
570
522
|
response_data: Any = None
|
|
571
523
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
572
|
-
return
|
|
573
|
-
|
|
524
|
+
return unmarshal_json_response(
|
|
525
|
+
models.PatchCurrentTeamResponseBody, http_res
|
|
574
526
|
)
|
|
575
527
|
if utils.match_response(http_res, ["403", "404"], "application/vnd.api+json"):
|
|
576
|
-
response_data =
|
|
577
|
-
raise models.ErrorObject(
|
|
528
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
529
|
+
raise models.ErrorObject(response_data, http_res)
|
|
578
530
|
if utils.match_response(http_res, "4XX", "*"):
|
|
579
531
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
580
|
-
raise models.APIError(
|
|
581
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
582
|
-
)
|
|
532
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
583
533
|
if utils.match_response(http_res, "5XX", "*"):
|
|
584
534
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
585
|
-
raise models.APIError(
|
|
586
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
587
|
-
)
|
|
535
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
588
536
|
|
|
589
|
-
|
|
590
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
591
|
-
raise models.APIError(
|
|
592
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
593
|
-
http_res.status_code,
|
|
594
|
-
http_res_text,
|
|
595
|
-
http_res,
|
|
596
|
-
)
|
|
537
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
@@ -6,6 +6,7 @@ from latitudesh_python_sdk import models, utils
|
|
|
6
6
|
from latitudesh_python_sdk._hooks import HookContext
|
|
7
7
|
from latitudesh_python_sdk.types import OptionalNullable, UNSET
|
|
8
8
|
from latitudesh_python_sdk.utils import get_security_from_env
|
|
9
|
+
from latitudesh_python_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
9
10
|
from typing import Any, Dict, List, Mapping, Optional, Union
|
|
10
11
|
|
|
11
12
|
|
|
@@ -70,6 +71,7 @@ class TeamsMembers(BaseSDK):
|
|
|
70
71
|
|
|
71
72
|
http_res = self.do_request(
|
|
72
73
|
hook_ctx=HookContext(
|
|
74
|
+
config=self.sdk_configuration,
|
|
73
75
|
base_url=base_url or "",
|
|
74
76
|
operation_id="get-team-members",
|
|
75
77
|
oauth2_scopes=[],
|
|
@@ -104,28 +106,17 @@ class TeamsMembers(BaseSDK):
|
|
|
104
106
|
|
|
105
107
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
106
108
|
return models.GetTeamMembersResponse(
|
|
107
|
-
result=
|
|
109
|
+
result=unmarshal_json_response(models.TeamMembers, http_res),
|
|
108
110
|
next=next_func,
|
|
109
111
|
)
|
|
110
112
|
if utils.match_response(http_res, "4XX", "*"):
|
|
111
113
|
http_res_text = utils.stream_to_text(http_res)
|
|
112
|
-
raise models.APIError(
|
|
113
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
114
|
-
)
|
|
114
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
115
115
|
if utils.match_response(http_res, "5XX", "*"):
|
|
116
116
|
http_res_text = utils.stream_to_text(http_res)
|
|
117
|
-
raise models.APIError(
|
|
118
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
119
|
-
)
|
|
117
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
120
118
|
|
|
121
|
-
|
|
122
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
123
|
-
raise models.APIError(
|
|
124
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
125
|
-
http_res.status_code,
|
|
126
|
-
http_res_text,
|
|
127
|
-
http_res,
|
|
128
|
-
)
|
|
119
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
129
120
|
|
|
130
121
|
async def list_async(
|
|
131
122
|
self,
|
|
@@ -187,6 +178,7 @@ class TeamsMembers(BaseSDK):
|
|
|
187
178
|
|
|
188
179
|
http_res = await self.do_request_async(
|
|
189
180
|
hook_ctx=HookContext(
|
|
181
|
+
config=self.sdk_configuration,
|
|
190
182
|
base_url=base_url or "",
|
|
191
183
|
operation_id="get-team-members",
|
|
192
184
|
oauth2_scopes=[],
|
|
@@ -221,28 +213,17 @@ class TeamsMembers(BaseSDK):
|
|
|
221
213
|
|
|
222
214
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
223
215
|
return models.GetTeamMembersResponse(
|
|
224
|
-
result=
|
|
216
|
+
result=unmarshal_json_response(models.TeamMembers, http_res),
|
|
225
217
|
next=next_func,
|
|
226
218
|
)
|
|
227
219
|
if utils.match_response(http_res, "4XX", "*"):
|
|
228
220
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
229
|
-
raise models.APIError(
|
|
230
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
231
|
-
)
|
|
221
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
232
222
|
if utils.match_response(http_res, "5XX", "*"):
|
|
233
223
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
234
|
-
raise models.APIError(
|
|
235
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
236
|
-
)
|
|
224
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
237
225
|
|
|
238
|
-
|
|
239
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
240
|
-
raise models.APIError(
|
|
241
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
242
|
-
http_res.status_code,
|
|
243
|
-
http_res_text,
|
|
244
|
-
http_res,
|
|
245
|
-
)
|
|
226
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
246
227
|
|
|
247
228
|
def add(
|
|
248
229
|
self,
|
|
@@ -311,6 +292,7 @@ class TeamsMembers(BaseSDK):
|
|
|
311
292
|
|
|
312
293
|
http_res = self.do_request(
|
|
313
294
|
hook_ctx=HookContext(
|
|
295
|
+
config=self.sdk_configuration,
|
|
314
296
|
base_url=base_url or "",
|
|
315
297
|
operation_id="post-team-members",
|
|
316
298
|
oauth2_scopes=[],
|
|
@@ -325,29 +307,18 @@ class TeamsMembers(BaseSDK):
|
|
|
325
307
|
|
|
326
308
|
response_data: Any = None
|
|
327
309
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
328
|
-
return
|
|
310
|
+
return unmarshal_json_response(models.Membership, http_res)
|
|
329
311
|
if utils.match_response(http_res, ["403", "422"], "application/vnd.api+json"):
|
|
330
|
-
response_data =
|
|
331
|
-
raise models.ErrorObject(
|
|
312
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
313
|
+
raise models.ErrorObject(response_data, http_res)
|
|
332
314
|
if utils.match_response(http_res, "4XX", "*"):
|
|
333
315
|
http_res_text = utils.stream_to_text(http_res)
|
|
334
|
-
raise models.APIError(
|
|
335
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
336
|
-
)
|
|
316
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
337
317
|
if utils.match_response(http_res, "5XX", "*"):
|
|
338
318
|
http_res_text = utils.stream_to_text(http_res)
|
|
339
|
-
raise models.APIError(
|
|
340
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
341
|
-
)
|
|
319
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
342
320
|
|
|
343
|
-
|
|
344
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
345
|
-
raise models.APIError(
|
|
346
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
347
|
-
http_res.status_code,
|
|
348
|
-
http_res_text,
|
|
349
|
-
http_res,
|
|
350
|
-
)
|
|
321
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
351
322
|
|
|
352
323
|
async def add_async(
|
|
353
324
|
self,
|
|
@@ -416,6 +387,7 @@ class TeamsMembers(BaseSDK):
|
|
|
416
387
|
|
|
417
388
|
http_res = await self.do_request_async(
|
|
418
389
|
hook_ctx=HookContext(
|
|
390
|
+
config=self.sdk_configuration,
|
|
419
391
|
base_url=base_url or "",
|
|
420
392
|
operation_id="post-team-members",
|
|
421
393
|
oauth2_scopes=[],
|
|
@@ -430,29 +402,18 @@ class TeamsMembers(BaseSDK):
|
|
|
430
402
|
|
|
431
403
|
response_data: Any = None
|
|
432
404
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
433
|
-
return
|
|
405
|
+
return unmarshal_json_response(models.Membership, http_res)
|
|
434
406
|
if utils.match_response(http_res, ["403", "422"], "application/vnd.api+json"):
|
|
435
|
-
response_data =
|
|
436
|
-
raise models.ErrorObject(
|
|
407
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
408
|
+
raise models.ErrorObject(response_data, http_res)
|
|
437
409
|
if utils.match_response(http_res, "4XX", "*"):
|
|
438
410
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
439
|
-
raise models.APIError(
|
|
440
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
441
|
-
)
|
|
411
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
442
412
|
if utils.match_response(http_res, "5XX", "*"):
|
|
443
413
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
444
|
-
raise models.APIError(
|
|
445
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
446
|
-
)
|
|
414
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
447
415
|
|
|
448
|
-
|
|
449
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
450
|
-
raise models.APIError(
|
|
451
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
452
|
-
http_res.status_code,
|
|
453
|
-
http_res_text,
|
|
454
|
-
http_res,
|
|
455
|
-
)
|
|
416
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
456
417
|
|
|
457
418
|
def remove_member(
|
|
458
419
|
self,
|
|
@@ -511,6 +472,7 @@ class TeamsMembers(BaseSDK):
|
|
|
511
472
|
|
|
512
473
|
http_res = self.do_request(
|
|
513
474
|
hook_ctx=HookContext(
|
|
475
|
+
config=self.sdk_configuration,
|
|
514
476
|
base_url=base_url or "",
|
|
515
477
|
operation_id="destroy-team-member",
|
|
516
478
|
oauth2_scopes=[],
|
|
@@ -527,27 +489,16 @@ class TeamsMembers(BaseSDK):
|
|
|
527
489
|
if utils.match_response(http_res, "200", "*"):
|
|
528
490
|
return
|
|
529
491
|
if utils.match_response(http_res, "404", "application/vnd.api+json"):
|
|
530
|
-
response_data =
|
|
531
|
-
raise models.ErrorObject(
|
|
492
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
493
|
+
raise models.ErrorObject(response_data, http_res)
|
|
532
494
|
if utils.match_response(http_res, ["403", "4XX"], "*"):
|
|
533
495
|
http_res_text = utils.stream_to_text(http_res)
|
|
534
|
-
raise models.APIError(
|
|
535
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
536
|
-
)
|
|
496
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
537
497
|
if utils.match_response(http_res, "5XX", "*"):
|
|
538
498
|
http_res_text = utils.stream_to_text(http_res)
|
|
539
|
-
raise models.APIError(
|
|
540
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
541
|
-
)
|
|
499
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
542
500
|
|
|
543
|
-
|
|
544
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
545
|
-
raise models.APIError(
|
|
546
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
547
|
-
http_res.status_code,
|
|
548
|
-
http_res_text,
|
|
549
|
-
http_res,
|
|
550
|
-
)
|
|
501
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
551
502
|
|
|
552
503
|
async def remove_member_async(
|
|
553
504
|
self,
|
|
@@ -606,6 +557,7 @@ class TeamsMembers(BaseSDK):
|
|
|
606
557
|
|
|
607
558
|
http_res = await self.do_request_async(
|
|
608
559
|
hook_ctx=HookContext(
|
|
560
|
+
config=self.sdk_configuration,
|
|
609
561
|
base_url=base_url or "",
|
|
610
562
|
operation_id="destroy-team-member",
|
|
611
563
|
oauth2_scopes=[],
|
|
@@ -622,24 +574,13 @@ class TeamsMembers(BaseSDK):
|
|
|
622
574
|
if utils.match_response(http_res, "200", "*"):
|
|
623
575
|
return
|
|
624
576
|
if utils.match_response(http_res, "404", "application/vnd.api+json"):
|
|
625
|
-
response_data =
|
|
626
|
-
raise models.ErrorObject(
|
|
577
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
578
|
+
raise models.ErrorObject(response_data, http_res)
|
|
627
579
|
if utils.match_response(http_res, ["403", "4XX"], "*"):
|
|
628
580
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
629
|
-
raise models.APIError(
|
|
630
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
631
|
-
)
|
|
581
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
632
582
|
if utils.match_response(http_res, "5XX", "*"):
|
|
633
583
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
634
|
-
raise models.APIError(
|
|
635
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
636
|
-
)
|
|
584
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
637
585
|
|
|
638
|
-
|
|
639
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
640
|
-
raise models.APIError(
|
|
641
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
642
|
-
http_res.status_code,
|
|
643
|
-
http_res_text,
|
|
644
|
-
http_res,
|
|
645
|
-
)
|
|
586
|
+
raise models.APIError("Unexpected response received", http_res)
|