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
|
@@ -4,9 +4,10 @@ from .basesdk import BaseSDK
|
|
|
4
4
|
from jsonpath import JSONPath
|
|
5
5
|
from latitudesh_python_sdk import models, utils
|
|
6
6
|
from latitudesh_python_sdk._hooks import HookContext
|
|
7
|
-
from latitudesh_python_sdk.types import
|
|
7
|
+
from latitudesh_python_sdk.types import OptionalNullable, UNSET
|
|
8
8
|
from latitudesh_python_sdk.utils import get_security_from_env
|
|
9
|
-
from
|
|
9
|
+
from latitudesh_python_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
10
|
+
from typing import Any, Dict, List, Mapping, Optional, Union
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
class PrivateNetworks(BaseSDK):
|
|
@@ -82,6 +83,7 @@ class PrivateNetworks(BaseSDK):
|
|
|
82
83
|
|
|
83
84
|
http_res = self.do_request(
|
|
84
85
|
hook_ctx=HookContext(
|
|
86
|
+
config=self.sdk_configuration,
|
|
85
87
|
base_url=base_url or "",
|
|
86
88
|
operation_id="get-virtual-networks",
|
|
87
89
|
oauth2_scopes=[],
|
|
@@ -119,28 +121,17 @@ class PrivateNetworks(BaseSDK):
|
|
|
119
121
|
|
|
120
122
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
121
123
|
return models.GetVirtualNetworksResponse(
|
|
122
|
-
result=
|
|
124
|
+
result=unmarshal_json_response(models.VirtualNetworks, http_res),
|
|
123
125
|
next=next_func,
|
|
124
126
|
)
|
|
125
127
|
if utils.match_response(http_res, "4XX", "*"):
|
|
126
128
|
http_res_text = utils.stream_to_text(http_res)
|
|
127
|
-
raise models.APIError(
|
|
128
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
129
|
-
)
|
|
129
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
130
130
|
if utils.match_response(http_res, "5XX", "*"):
|
|
131
131
|
http_res_text = utils.stream_to_text(http_res)
|
|
132
|
-
raise models.APIError(
|
|
133
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
134
|
-
)
|
|
132
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
135
133
|
|
|
136
|
-
|
|
137
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
138
|
-
raise models.APIError(
|
|
139
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
140
|
-
http_res.status_code,
|
|
141
|
-
http_res_text,
|
|
142
|
-
http_res,
|
|
143
|
-
)
|
|
134
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
144
135
|
|
|
145
136
|
async def list_async(
|
|
146
137
|
self,
|
|
@@ -214,6 +205,7 @@ class PrivateNetworks(BaseSDK):
|
|
|
214
205
|
|
|
215
206
|
http_res = await self.do_request_async(
|
|
216
207
|
hook_ctx=HookContext(
|
|
208
|
+
config=self.sdk_configuration,
|
|
217
209
|
base_url=base_url or "",
|
|
218
210
|
operation_id="get-virtual-networks",
|
|
219
211
|
oauth2_scopes=[],
|
|
@@ -251,28 +243,17 @@ class PrivateNetworks(BaseSDK):
|
|
|
251
243
|
|
|
252
244
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
253
245
|
return models.GetVirtualNetworksResponse(
|
|
254
|
-
result=
|
|
246
|
+
result=unmarshal_json_response(models.VirtualNetworks, http_res),
|
|
255
247
|
next=next_func,
|
|
256
248
|
)
|
|
257
249
|
if utils.match_response(http_res, "4XX", "*"):
|
|
258
250
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
259
|
-
raise models.APIError(
|
|
260
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
261
|
-
)
|
|
251
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
262
252
|
if utils.match_response(http_res, "5XX", "*"):
|
|
263
253
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
264
|
-
raise models.APIError(
|
|
265
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
266
|
-
)
|
|
254
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
267
255
|
|
|
268
|
-
|
|
269
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
270
|
-
raise models.APIError(
|
|
271
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
272
|
-
http_res.status_code,
|
|
273
|
-
http_res_text,
|
|
274
|
-
http_res,
|
|
275
|
-
)
|
|
256
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
276
257
|
|
|
277
258
|
def create(
|
|
278
259
|
self,
|
|
@@ -346,6 +327,7 @@ class PrivateNetworks(BaseSDK):
|
|
|
346
327
|
|
|
347
328
|
http_res = self.do_request(
|
|
348
329
|
hook_ctx=HookContext(
|
|
330
|
+
config=self.sdk_configuration,
|
|
349
331
|
base_url=base_url or "",
|
|
350
332
|
operation_id="create-virtual-network",
|
|
351
333
|
oauth2_scopes=[],
|
|
@@ -360,29 +342,18 @@ class PrivateNetworks(BaseSDK):
|
|
|
360
342
|
|
|
361
343
|
response_data: Any = None
|
|
362
344
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
363
|
-
return
|
|
345
|
+
return unmarshal_json_response(models.VirtualNetwork, http_res)
|
|
364
346
|
if utils.match_response(http_res, "422", "application/vnd.api+json"):
|
|
365
|
-
response_data =
|
|
366
|
-
raise models.ErrorObject(
|
|
347
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
348
|
+
raise models.ErrorObject(response_data, http_res)
|
|
367
349
|
if utils.match_response(http_res, "4XX", "*"):
|
|
368
350
|
http_res_text = utils.stream_to_text(http_res)
|
|
369
|
-
raise models.APIError(
|
|
370
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
371
|
-
)
|
|
351
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
372
352
|
if utils.match_response(http_res, "5XX", "*"):
|
|
373
353
|
http_res_text = utils.stream_to_text(http_res)
|
|
374
|
-
raise models.APIError(
|
|
375
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
376
|
-
)
|
|
354
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
377
355
|
|
|
378
|
-
|
|
379
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
380
|
-
raise models.APIError(
|
|
381
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
382
|
-
http_res.status_code,
|
|
383
|
-
http_res_text,
|
|
384
|
-
http_res,
|
|
385
|
-
)
|
|
356
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
386
357
|
|
|
387
358
|
async def create_async(
|
|
388
359
|
self,
|
|
@@ -456,6 +427,7 @@ class PrivateNetworks(BaseSDK):
|
|
|
456
427
|
|
|
457
428
|
http_res = await self.do_request_async(
|
|
458
429
|
hook_ctx=HookContext(
|
|
430
|
+
config=self.sdk_configuration,
|
|
459
431
|
base_url=base_url or "",
|
|
460
432
|
operation_id="create-virtual-network",
|
|
461
433
|
oauth2_scopes=[],
|
|
@@ -470,29 +442,18 @@ class PrivateNetworks(BaseSDK):
|
|
|
470
442
|
|
|
471
443
|
response_data: Any = None
|
|
472
444
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
473
|
-
return
|
|
445
|
+
return unmarshal_json_response(models.VirtualNetwork, http_res)
|
|
474
446
|
if utils.match_response(http_res, "422", "application/vnd.api+json"):
|
|
475
|
-
response_data =
|
|
476
|
-
raise models.ErrorObject(
|
|
447
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
448
|
+
raise models.ErrorObject(response_data, http_res)
|
|
477
449
|
if utils.match_response(http_res, "4XX", "*"):
|
|
478
450
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
479
|
-
raise models.APIError(
|
|
480
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
481
|
-
)
|
|
451
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
482
452
|
if utils.match_response(http_res, "5XX", "*"):
|
|
483
453
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
484
|
-
raise models.APIError(
|
|
485
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
486
|
-
)
|
|
454
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
487
455
|
|
|
488
|
-
|
|
489
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
490
|
-
raise models.APIError(
|
|
491
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
492
|
-
http_res.status_code,
|
|
493
|
-
http_res_text,
|
|
494
|
-
http_res,
|
|
495
|
-
)
|
|
456
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
496
457
|
|
|
497
458
|
def update(
|
|
498
459
|
self,
|
|
@@ -574,6 +535,7 @@ class PrivateNetworks(BaseSDK):
|
|
|
574
535
|
|
|
575
536
|
http_res = self.do_request(
|
|
576
537
|
hook_ctx=HookContext(
|
|
538
|
+
config=self.sdk_configuration,
|
|
577
539
|
base_url=base_url or "",
|
|
578
540
|
operation_id="update-virtual-network",
|
|
579
541
|
oauth2_scopes=[],
|
|
@@ -588,31 +550,20 @@ class PrivateNetworks(BaseSDK):
|
|
|
588
550
|
|
|
589
551
|
response_data: Any = None
|
|
590
552
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
591
|
-
return
|
|
553
|
+
return unmarshal_json_response(models.VirtualNetwork, http_res)
|
|
592
554
|
if utils.match_response(http_res, "403", "application/vnd.api+json"):
|
|
593
|
-
response_data =
|
|
594
|
-
|
|
555
|
+
response_data = unmarshal_json_response(
|
|
556
|
+
models.VirtualNetworkErrorData, http_res
|
|
595
557
|
)
|
|
596
|
-
raise models.VirtualNetworkError(
|
|
558
|
+
raise models.VirtualNetworkError(response_data, http_res)
|
|
597
559
|
if utils.match_response(http_res, "4XX", "*"):
|
|
598
560
|
http_res_text = utils.stream_to_text(http_res)
|
|
599
|
-
raise models.APIError(
|
|
600
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
601
|
-
)
|
|
561
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
602
562
|
if utils.match_response(http_res, "5XX", "*"):
|
|
603
563
|
http_res_text = utils.stream_to_text(http_res)
|
|
604
|
-
raise models.APIError(
|
|
605
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
606
|
-
)
|
|
564
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
607
565
|
|
|
608
|
-
|
|
609
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
610
|
-
raise models.APIError(
|
|
611
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
612
|
-
http_res.status_code,
|
|
613
|
-
http_res_text,
|
|
614
|
-
http_res,
|
|
615
|
-
)
|
|
566
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
616
567
|
|
|
617
568
|
async def update_async(
|
|
618
569
|
self,
|
|
@@ -694,6 +645,7 @@ class PrivateNetworks(BaseSDK):
|
|
|
694
645
|
|
|
695
646
|
http_res = await self.do_request_async(
|
|
696
647
|
hook_ctx=HookContext(
|
|
648
|
+
config=self.sdk_configuration,
|
|
697
649
|
base_url=base_url or "",
|
|
698
650
|
operation_id="update-virtual-network",
|
|
699
651
|
oauth2_scopes=[],
|
|
@@ -708,31 +660,20 @@ class PrivateNetworks(BaseSDK):
|
|
|
708
660
|
|
|
709
661
|
response_data: Any = None
|
|
710
662
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
711
|
-
return
|
|
663
|
+
return unmarshal_json_response(models.VirtualNetwork, http_res)
|
|
712
664
|
if utils.match_response(http_res, "403", "application/vnd.api+json"):
|
|
713
|
-
response_data =
|
|
714
|
-
|
|
665
|
+
response_data = unmarshal_json_response(
|
|
666
|
+
models.VirtualNetworkErrorData, http_res
|
|
715
667
|
)
|
|
716
|
-
raise models.VirtualNetworkError(
|
|
668
|
+
raise models.VirtualNetworkError(response_data, http_res)
|
|
717
669
|
if utils.match_response(http_res, "4XX", "*"):
|
|
718
670
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
719
|
-
raise models.APIError(
|
|
720
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
721
|
-
)
|
|
671
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
722
672
|
if utils.match_response(http_res, "5XX", "*"):
|
|
723
673
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
724
|
-
raise models.APIError(
|
|
725
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
726
|
-
)
|
|
674
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
727
675
|
|
|
728
|
-
|
|
729
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
730
|
-
raise models.APIError(
|
|
731
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
732
|
-
http_res.status_code,
|
|
733
|
-
http_res_text,
|
|
734
|
-
http_res,
|
|
735
|
-
)
|
|
676
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
736
677
|
|
|
737
678
|
def delete_virtual_network(
|
|
738
679
|
self,
|
|
@@ -794,6 +735,7 @@ class PrivateNetworks(BaseSDK):
|
|
|
794
735
|
|
|
795
736
|
http_res = self.do_request(
|
|
796
737
|
hook_ctx=HookContext(
|
|
738
|
+
config=self.sdk_configuration,
|
|
797
739
|
base_url=base_url or "",
|
|
798
740
|
operation_id="destroy-virtual-network",
|
|
799
741
|
oauth2_scopes=[],
|
|
@@ -810,27 +752,16 @@ class PrivateNetworks(BaseSDK):
|
|
|
810
752
|
if utils.match_response(http_res, "204", "*"):
|
|
811
753
|
return
|
|
812
754
|
if utils.match_response(http_res, "406", "application/vnd.api+json"):
|
|
813
|
-
response_data =
|
|
814
|
-
raise models.ErrorObject(
|
|
755
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
756
|
+
raise models.ErrorObject(response_data, http_res)
|
|
815
757
|
if utils.match_response(http_res, "4XX", "*"):
|
|
816
758
|
http_res_text = utils.stream_to_text(http_res)
|
|
817
|
-
raise models.APIError(
|
|
818
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
819
|
-
)
|
|
759
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
820
760
|
if utils.match_response(http_res, "5XX", "*"):
|
|
821
761
|
http_res_text = utils.stream_to_text(http_res)
|
|
822
|
-
raise models.APIError(
|
|
823
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
824
|
-
)
|
|
762
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
825
763
|
|
|
826
|
-
|
|
827
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
828
|
-
raise models.APIError(
|
|
829
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
830
|
-
http_res.status_code,
|
|
831
|
-
http_res_text,
|
|
832
|
-
http_res,
|
|
833
|
-
)
|
|
764
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
834
765
|
|
|
835
766
|
async def delete_virtual_network_async(
|
|
836
767
|
self,
|
|
@@ -892,6 +823,7 @@ class PrivateNetworks(BaseSDK):
|
|
|
892
823
|
|
|
893
824
|
http_res = await self.do_request_async(
|
|
894
825
|
hook_ctx=HookContext(
|
|
826
|
+
config=self.sdk_configuration,
|
|
895
827
|
base_url=base_url or "",
|
|
896
828
|
operation_id="destroy-virtual-network",
|
|
897
829
|
oauth2_scopes=[],
|
|
@@ -908,27 +840,16 @@ class PrivateNetworks(BaseSDK):
|
|
|
908
840
|
if utils.match_response(http_res, "204", "*"):
|
|
909
841
|
return
|
|
910
842
|
if utils.match_response(http_res, "406", "application/vnd.api+json"):
|
|
911
|
-
response_data =
|
|
912
|
-
raise models.ErrorObject(
|
|
843
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
844
|
+
raise models.ErrorObject(response_data, http_res)
|
|
913
845
|
if utils.match_response(http_res, "4XX", "*"):
|
|
914
846
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
915
|
-
raise models.APIError(
|
|
916
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
917
|
-
)
|
|
847
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
918
848
|
if utils.match_response(http_res, "5XX", "*"):
|
|
919
849
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
920
|
-
raise models.APIError(
|
|
921
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
922
|
-
)
|
|
850
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
923
851
|
|
|
924
|
-
|
|
925
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
926
|
-
raise models.APIError(
|
|
927
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
928
|
-
http_res.status_code,
|
|
929
|
-
http_res_text,
|
|
930
|
-
http_res,
|
|
931
|
-
)
|
|
852
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
932
853
|
|
|
933
854
|
def get(
|
|
934
855
|
self,
|
|
@@ -990,6 +911,7 @@ class PrivateNetworks(BaseSDK):
|
|
|
990
911
|
|
|
991
912
|
http_res = self.do_request(
|
|
992
913
|
hook_ctx=HookContext(
|
|
914
|
+
config=self.sdk_configuration,
|
|
993
915
|
base_url=base_url or "",
|
|
994
916
|
operation_id="get-virtual-network",
|
|
995
917
|
oauth2_scopes=[],
|
|
@@ -1003,28 +925,17 @@ class PrivateNetworks(BaseSDK):
|
|
|
1003
925
|
)
|
|
1004
926
|
|
|
1005
927
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1006
|
-
return
|
|
1007
|
-
|
|
928
|
+
return unmarshal_json_response(
|
|
929
|
+
models.GetVirtualNetworkResponseBody, http_res
|
|
1008
930
|
)
|
|
1009
931
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1010
932
|
http_res_text = utils.stream_to_text(http_res)
|
|
1011
|
-
raise models.APIError(
|
|
1012
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1013
|
-
)
|
|
933
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1014
934
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1015
935
|
http_res_text = utils.stream_to_text(http_res)
|
|
1016
|
-
raise models.APIError(
|
|
1017
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1018
|
-
)
|
|
936
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1019
937
|
|
|
1020
|
-
|
|
1021
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1022
|
-
raise models.APIError(
|
|
1023
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1024
|
-
http_res.status_code,
|
|
1025
|
-
http_res_text,
|
|
1026
|
-
http_res,
|
|
1027
|
-
)
|
|
938
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
1028
939
|
|
|
1029
940
|
async def get_async(
|
|
1030
941
|
self,
|
|
@@ -1086,6 +997,7 @@ class PrivateNetworks(BaseSDK):
|
|
|
1086
997
|
|
|
1087
998
|
http_res = await self.do_request_async(
|
|
1088
999
|
hook_ctx=HookContext(
|
|
1000
|
+
config=self.sdk_configuration,
|
|
1089
1001
|
base_url=base_url or "",
|
|
1090
1002
|
operation_id="get-virtual-network",
|
|
1091
1003
|
oauth2_scopes=[],
|
|
@@ -1099,28 +1011,17 @@ class PrivateNetworks(BaseSDK):
|
|
|
1099
1011
|
)
|
|
1100
1012
|
|
|
1101
1013
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1102
|
-
return
|
|
1103
|
-
|
|
1014
|
+
return unmarshal_json_response(
|
|
1015
|
+
models.GetVirtualNetworkResponseBody, http_res
|
|
1104
1016
|
)
|
|
1105
1017
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1106
1018
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1107
|
-
raise models.APIError(
|
|
1108
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1109
|
-
)
|
|
1019
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1110
1020
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1111
1021
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1112
|
-
raise models.APIError(
|
|
1113
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1114
|
-
)
|
|
1022
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1115
1023
|
|
|
1116
|
-
|
|
1117
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1118
|
-
raise models.APIError(
|
|
1119
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1120
|
-
http_res.status_code,
|
|
1121
|
-
http_res_text,
|
|
1122
|
-
http_res,
|
|
1123
|
-
)
|
|
1024
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
1124
1025
|
|
|
1125
1026
|
def list_assignments(
|
|
1126
1027
|
self,
|
|
@@ -1194,6 +1095,7 @@ class PrivateNetworks(BaseSDK):
|
|
|
1194
1095
|
|
|
1195
1096
|
http_res = self.do_request(
|
|
1196
1097
|
hook_ctx=HookContext(
|
|
1098
|
+
config=self.sdk_configuration,
|
|
1197
1099
|
base_url=base_url or "",
|
|
1198
1100
|
operation_id="get-virtual-networks-assignments",
|
|
1199
1101
|
oauth2_scopes=[],
|
|
@@ -1231,30 +1133,19 @@ class PrivateNetworks(BaseSDK):
|
|
|
1231
1133
|
|
|
1232
1134
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1233
1135
|
return models.GetVirtualNetworksAssignmentsResponse(
|
|
1234
|
-
result=
|
|
1235
|
-
|
|
1136
|
+
result=unmarshal_json_response(
|
|
1137
|
+
models.VirtualNetworkAssignments, http_res
|
|
1236
1138
|
),
|
|
1237
1139
|
next=next_func,
|
|
1238
1140
|
)
|
|
1239
1141
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1240
1142
|
http_res_text = utils.stream_to_text(http_res)
|
|
1241
|
-
raise models.APIError(
|
|
1242
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1243
|
-
)
|
|
1143
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1244
1144
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1245
1145
|
http_res_text = utils.stream_to_text(http_res)
|
|
1246
|
-
raise models.APIError(
|
|
1247
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1248
|
-
)
|
|
1146
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1249
1147
|
|
|
1250
|
-
|
|
1251
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1252
|
-
raise models.APIError(
|
|
1253
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1254
|
-
http_res.status_code,
|
|
1255
|
-
http_res_text,
|
|
1256
|
-
http_res,
|
|
1257
|
-
)
|
|
1148
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
1258
1149
|
|
|
1259
1150
|
async def list_assignments_async(
|
|
1260
1151
|
self,
|
|
@@ -1328,6 +1219,7 @@ class PrivateNetworks(BaseSDK):
|
|
|
1328
1219
|
|
|
1329
1220
|
http_res = await self.do_request_async(
|
|
1330
1221
|
hook_ctx=HookContext(
|
|
1222
|
+
config=self.sdk_configuration,
|
|
1331
1223
|
base_url=base_url or "",
|
|
1332
1224
|
operation_id="get-virtual-networks-assignments",
|
|
1333
1225
|
oauth2_scopes=[],
|
|
@@ -1365,38 +1257,29 @@ class PrivateNetworks(BaseSDK):
|
|
|
1365
1257
|
|
|
1366
1258
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1367
1259
|
return models.GetVirtualNetworksAssignmentsResponse(
|
|
1368
|
-
result=
|
|
1369
|
-
|
|
1260
|
+
result=unmarshal_json_response(
|
|
1261
|
+
models.VirtualNetworkAssignments, http_res
|
|
1370
1262
|
),
|
|
1371
1263
|
next=next_func,
|
|
1372
1264
|
)
|
|
1373
1265
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1374
1266
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1375
|
-
raise models.APIError(
|
|
1376
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1377
|
-
)
|
|
1267
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1378
1268
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1379
1269
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1380
|
-
raise models.APIError(
|
|
1381
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1382
|
-
)
|
|
1270
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1383
1271
|
|
|
1384
|
-
|
|
1385
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1386
|
-
raise models.APIError(
|
|
1387
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1388
|
-
http_res.status_code,
|
|
1389
|
-
http_res_text,
|
|
1390
|
-
http_res,
|
|
1391
|
-
)
|
|
1272
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
1392
1273
|
|
|
1393
1274
|
def assign(
|
|
1394
1275
|
self,
|
|
1395
1276
|
*,
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1277
|
+
data: Optional[
|
|
1278
|
+
Union[
|
|
1279
|
+
models.AssignServerVirtualNetworkPrivateNetworksData,
|
|
1280
|
+
models.AssignServerVirtualNetworkPrivateNetworksDataTypedDict,
|
|
1281
|
+
]
|
|
1282
|
+
] = None,
|
|
1400
1283
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1401
1284
|
server_url: Optional[str] = None,
|
|
1402
1285
|
timeout_ms: Optional[int] = None,
|
|
@@ -1404,7 +1287,7 @@ class PrivateNetworks(BaseSDK):
|
|
|
1404
1287
|
) -> models.VirtualNetworkAssignment:
|
|
1405
1288
|
r"""Assign Virtual network
|
|
1406
1289
|
|
|
1407
|
-
:param
|
|
1290
|
+
:param data:
|
|
1408
1291
|
:param retries: Override the default retry configuration for this method
|
|
1409
1292
|
:param server_url: Override the default server URL for this method
|
|
1410
1293
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -1420,12 +1303,10 @@ class PrivateNetworks(BaseSDK):
|
|
|
1420
1303
|
else:
|
|
1421
1304
|
base_url = self._get_url(base_url, url_variables)
|
|
1422
1305
|
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
)
|
|
1427
|
-
request = cast(
|
|
1428
|
-
models.AssignServerVirtualNetworkPrivateNetworksRequestBody, request
|
|
1306
|
+
request = models.AssignServerVirtualNetworkPrivateNetworksRequestBody(
|
|
1307
|
+
data=utils.get_pydantic_model(
|
|
1308
|
+
data, Optional[models.AssignServerVirtualNetworkPrivateNetworksData]
|
|
1309
|
+
),
|
|
1429
1310
|
)
|
|
1430
1311
|
|
|
1431
1312
|
req = self._build_request(
|
|
@@ -1444,9 +1325,9 @@ class PrivateNetworks(BaseSDK):
|
|
|
1444
1325
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1445
1326
|
request,
|
|
1446
1327
|
False,
|
|
1447
|
-
|
|
1328
|
+
False,
|
|
1448
1329
|
"json",
|
|
1449
|
-
|
|
1330
|
+
models.AssignServerVirtualNetworkPrivateNetworksRequestBody,
|
|
1450
1331
|
),
|
|
1451
1332
|
timeout_ms=timeout_ms,
|
|
1452
1333
|
)
|
|
@@ -1461,6 +1342,7 @@ class PrivateNetworks(BaseSDK):
|
|
|
1461
1342
|
|
|
1462
1343
|
http_res = self.do_request(
|
|
1463
1344
|
hook_ctx=HookContext(
|
|
1345
|
+
config=self.sdk_configuration,
|
|
1464
1346
|
base_url=base_url or "",
|
|
1465
1347
|
operation_id="assign-server-virtual-network",
|
|
1466
1348
|
oauth2_scopes=[],
|
|
@@ -1475,37 +1357,28 @@ class PrivateNetworks(BaseSDK):
|
|
|
1475
1357
|
|
|
1476
1358
|
response_data: Any = None
|
|
1477
1359
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
1478
|
-
return
|
|
1360
|
+
return unmarshal_json_response(models.VirtualNetworkAssignment, http_res)
|
|
1479
1361
|
if utils.match_response(http_res, ["403", "422"], "application/vnd.api+json"):
|
|
1480
|
-
response_data =
|
|
1481
|
-
raise models.ErrorObject(
|
|
1362
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
1363
|
+
raise models.ErrorObject(response_data, http_res)
|
|
1482
1364
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1483
1365
|
http_res_text = utils.stream_to_text(http_res)
|
|
1484
|
-
raise models.APIError(
|
|
1485
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1486
|
-
)
|
|
1366
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1487
1367
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1488
1368
|
http_res_text = utils.stream_to_text(http_res)
|
|
1489
|
-
raise models.APIError(
|
|
1490
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1491
|
-
)
|
|
1369
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1492
1370
|
|
|
1493
|
-
|
|
1494
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1495
|
-
raise models.APIError(
|
|
1496
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1497
|
-
http_res.status_code,
|
|
1498
|
-
http_res_text,
|
|
1499
|
-
http_res,
|
|
1500
|
-
)
|
|
1371
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
1501
1372
|
|
|
1502
1373
|
async def assign_async(
|
|
1503
1374
|
self,
|
|
1504
1375
|
*,
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1376
|
+
data: Optional[
|
|
1377
|
+
Union[
|
|
1378
|
+
models.AssignServerVirtualNetworkPrivateNetworksData,
|
|
1379
|
+
models.AssignServerVirtualNetworkPrivateNetworksDataTypedDict,
|
|
1380
|
+
]
|
|
1381
|
+
] = None,
|
|
1509
1382
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1510
1383
|
server_url: Optional[str] = None,
|
|
1511
1384
|
timeout_ms: Optional[int] = None,
|
|
@@ -1513,7 +1386,7 @@ class PrivateNetworks(BaseSDK):
|
|
|
1513
1386
|
) -> models.VirtualNetworkAssignment:
|
|
1514
1387
|
r"""Assign Virtual network
|
|
1515
1388
|
|
|
1516
|
-
:param
|
|
1389
|
+
:param data:
|
|
1517
1390
|
:param retries: Override the default retry configuration for this method
|
|
1518
1391
|
:param server_url: Override the default server URL for this method
|
|
1519
1392
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -1529,12 +1402,10 @@ class PrivateNetworks(BaseSDK):
|
|
|
1529
1402
|
else:
|
|
1530
1403
|
base_url = self._get_url(base_url, url_variables)
|
|
1531
1404
|
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
)
|
|
1536
|
-
request = cast(
|
|
1537
|
-
models.AssignServerVirtualNetworkPrivateNetworksRequestBody, request
|
|
1405
|
+
request = models.AssignServerVirtualNetworkPrivateNetworksRequestBody(
|
|
1406
|
+
data=utils.get_pydantic_model(
|
|
1407
|
+
data, Optional[models.AssignServerVirtualNetworkPrivateNetworksData]
|
|
1408
|
+
),
|
|
1538
1409
|
)
|
|
1539
1410
|
|
|
1540
1411
|
req = self._build_request_async(
|
|
@@ -1553,9 +1424,9 @@ class PrivateNetworks(BaseSDK):
|
|
|
1553
1424
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1554
1425
|
request,
|
|
1555
1426
|
False,
|
|
1556
|
-
|
|
1427
|
+
False,
|
|
1557
1428
|
"json",
|
|
1558
|
-
|
|
1429
|
+
models.AssignServerVirtualNetworkPrivateNetworksRequestBody,
|
|
1559
1430
|
),
|
|
1560
1431
|
timeout_ms=timeout_ms,
|
|
1561
1432
|
)
|
|
@@ -1570,6 +1441,7 @@ class PrivateNetworks(BaseSDK):
|
|
|
1570
1441
|
|
|
1571
1442
|
http_res = await self.do_request_async(
|
|
1572
1443
|
hook_ctx=HookContext(
|
|
1444
|
+
config=self.sdk_configuration,
|
|
1573
1445
|
base_url=base_url or "",
|
|
1574
1446
|
operation_id="assign-server-virtual-network",
|
|
1575
1447
|
oauth2_scopes=[],
|
|
@@ -1584,29 +1456,18 @@ class PrivateNetworks(BaseSDK):
|
|
|
1584
1456
|
|
|
1585
1457
|
response_data: Any = None
|
|
1586
1458
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
1587
|
-
return
|
|
1459
|
+
return unmarshal_json_response(models.VirtualNetworkAssignment, http_res)
|
|
1588
1460
|
if utils.match_response(http_res, ["403", "422"], "application/vnd.api+json"):
|
|
1589
|
-
response_data =
|
|
1590
|
-
raise models.ErrorObject(
|
|
1461
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
1462
|
+
raise models.ErrorObject(response_data, http_res)
|
|
1591
1463
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1592
1464
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1593
|
-
raise models.APIError(
|
|
1594
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1595
|
-
)
|
|
1465
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1596
1466
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1597
1467
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1598
|
-
raise models.APIError(
|
|
1599
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1600
|
-
)
|
|
1468
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1601
1469
|
|
|
1602
|
-
|
|
1603
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1604
|
-
raise models.APIError(
|
|
1605
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1606
|
-
http_res.status_code,
|
|
1607
|
-
http_res_text,
|
|
1608
|
-
http_res,
|
|
1609
|
-
)
|
|
1470
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
1610
1471
|
|
|
1611
1472
|
def remove_assignment(
|
|
1612
1473
|
self,
|
|
@@ -1668,6 +1529,7 @@ class PrivateNetworks(BaseSDK):
|
|
|
1668
1529
|
|
|
1669
1530
|
http_res = self.do_request(
|
|
1670
1531
|
hook_ctx=HookContext(
|
|
1532
|
+
config=self.sdk_configuration,
|
|
1671
1533
|
base_url=base_url or "",
|
|
1672
1534
|
operation_id="delete-virtual-networks-assignments",
|
|
1673
1535
|
oauth2_scopes=[],
|
|
@@ -1684,27 +1546,16 @@ class PrivateNetworks(BaseSDK):
|
|
|
1684
1546
|
if utils.match_response(http_res, "204", "*"):
|
|
1685
1547
|
return
|
|
1686
1548
|
if utils.match_response(http_res, ["403", "423"], "application/vnd.api+json"):
|
|
1687
|
-
response_data =
|
|
1688
|
-
raise models.ErrorObject(
|
|
1549
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
1550
|
+
raise models.ErrorObject(response_data, http_res)
|
|
1689
1551
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1690
1552
|
http_res_text = utils.stream_to_text(http_res)
|
|
1691
|
-
raise models.APIError(
|
|
1692
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1693
|
-
)
|
|
1553
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1694
1554
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1695
1555
|
http_res_text = utils.stream_to_text(http_res)
|
|
1696
|
-
raise models.APIError(
|
|
1697
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1698
|
-
)
|
|
1556
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1699
1557
|
|
|
1700
|
-
|
|
1701
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1702
|
-
raise models.APIError(
|
|
1703
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1704
|
-
http_res.status_code,
|
|
1705
|
-
http_res_text,
|
|
1706
|
-
http_res,
|
|
1707
|
-
)
|
|
1558
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
1708
1559
|
|
|
1709
1560
|
async def remove_assignment_async(
|
|
1710
1561
|
self,
|
|
@@ -1766,6 +1617,7 @@ class PrivateNetworks(BaseSDK):
|
|
|
1766
1617
|
|
|
1767
1618
|
http_res = await self.do_request_async(
|
|
1768
1619
|
hook_ctx=HookContext(
|
|
1620
|
+
config=self.sdk_configuration,
|
|
1769
1621
|
base_url=base_url or "",
|
|
1770
1622
|
operation_id="delete-virtual-networks-assignments",
|
|
1771
1623
|
oauth2_scopes=[],
|
|
@@ -1782,24 +1634,13 @@ class PrivateNetworks(BaseSDK):
|
|
|
1782
1634
|
if utils.match_response(http_res, "204", "*"):
|
|
1783
1635
|
return
|
|
1784
1636
|
if utils.match_response(http_res, ["403", "423"], "application/vnd.api+json"):
|
|
1785
|
-
response_data =
|
|
1786
|
-
raise models.ErrorObject(
|
|
1637
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
1638
|
+
raise models.ErrorObject(response_data, http_res)
|
|
1787
1639
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1788
1640
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1789
|
-
raise models.APIError(
|
|
1790
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1791
|
-
)
|
|
1641
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1792
1642
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1793
1643
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1794
|
-
raise models.APIError(
|
|
1795
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1796
|
-
)
|
|
1644
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1797
1645
|
|
|
1798
|
-
|
|
1799
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1800
|
-
raise models.APIError(
|
|
1801
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1802
|
-
http_res.status_code,
|
|
1803
|
-
http_res_text,
|
|
1804
|
-
http_res,
|
|
1805
|
-
)
|
|
1646
|
+
raise models.APIError("Unexpected response received", http_res)
|