latitudesh-python-sdk 1.1.0__py3-none-any.whl → 2.0.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.
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 +22 -18
- latitudesh_python_sdk/basesdk.py +12 -20
- latitudesh_python_sdk/billing.py +2 -0
- latitudesh_python_sdk/events_sdk.py +2 -0
- latitudesh_python_sdk/firewalls_sdk.py +18 -2
- latitudesh_python_sdk/httpclient.py +6 -16
- latitudesh_python_sdk/ipaddresses_sdk.py +4 -0
- latitudesh_python_sdk/models/__init__.py +2563 -1126
- 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/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/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/role.py +11 -0
- latitudesh_python_sdk/models/server_data.py +8 -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 +60 -10
- latitudesh_python_sdk/models/user_data.py +11 -0
- latitudesh_python_sdk/models/virtual_network.py +19 -0
- 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 +2 -0
- latitudesh_python_sdk/plans.py +42 -26
- latitudesh_python_sdk/privatenetworks.py +44 -28
- latitudesh_python_sdk/projects_sdk.py +36 -28
- latitudesh_python_sdk/regions_sdk.py +4 -0
- latitudesh_python_sdk/roles.py +4 -0
- latitudesh_python_sdk/sdk.py +110 -73
- latitudesh_python_sdk/sdkconfiguration.py +0 -7
- latitudesh_python_sdk/servers_sdk.py +102 -46
- latitudesh_python_sdk/{sshkeys.py → sshkeys_sdk.py} +1030 -5
- latitudesh_python_sdk/storage.py +8 -0
- latitudesh_python_sdk/tags.py +30 -22
- latitudesh_python_sdk/teams_sdk.py +6 -0
- latitudesh_python_sdk/teamsmembers.py +6 -0
- latitudesh_python_sdk/traffic_sdk.py +12 -8
- latitudesh_python_sdk/userdata_sdk.py +1029 -0
- latitudesh_python_sdk/userprofile.py +6 -0
- latitudesh_python_sdk/utils/__init__.py +131 -46
- latitudesh_python_sdk/utils/forms.py +49 -28
- latitudesh_python_sdk/virtualmachines.py +36 -18
- latitudesh_python_sdk/vpnsessions.py +38 -26
- {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.0.dist-info}/METADATA +30 -20
- {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.0.dist-info}/RECORD +80 -61
- {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.0.dist-info}/WHEEL +1 -1
- latitudesh_python_sdk/models/storage_plan.py +0 -36
- {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.0.dist-info}/LICENSE +0 -0
|
@@ -62,6 +62,7 @@ class UserProfile(BaseSDK):
|
|
|
62
62
|
|
|
63
63
|
http_res = self.do_request(
|
|
64
64
|
hook_ctx=HookContext(
|
|
65
|
+
config=self.sdk_configuration,
|
|
65
66
|
base_url=base_url or "",
|
|
66
67
|
operation_id="get-user-profile",
|
|
67
68
|
oauth2_scopes=[],
|
|
@@ -151,6 +152,7 @@ class UserProfile(BaseSDK):
|
|
|
151
152
|
|
|
152
153
|
http_res = await self.do_request_async(
|
|
153
154
|
hook_ctx=HookContext(
|
|
155
|
+
config=self.sdk_configuration,
|
|
154
156
|
base_url=base_url or "",
|
|
155
157
|
operation_id="get-user-profile",
|
|
156
158
|
oauth2_scopes=[],
|
|
@@ -264,6 +266,7 @@ class UserProfile(BaseSDK):
|
|
|
264
266
|
|
|
265
267
|
http_res = self.do_request(
|
|
266
268
|
hook_ctx=HookContext(
|
|
269
|
+
config=self.sdk_configuration,
|
|
267
270
|
base_url=base_url or "",
|
|
268
271
|
operation_id="patch-user-profile",
|
|
269
272
|
oauth2_scopes=[],
|
|
@@ -381,6 +384,7 @@ class UserProfile(BaseSDK):
|
|
|
381
384
|
|
|
382
385
|
http_res = await self.do_request_async(
|
|
383
386
|
hook_ctx=HookContext(
|
|
387
|
+
config=self.sdk_configuration,
|
|
384
388
|
base_url=base_url or "",
|
|
385
389
|
operation_id="patch-user-profile",
|
|
386
390
|
oauth2_scopes=[],
|
|
@@ -474,6 +478,7 @@ class UserProfile(BaseSDK):
|
|
|
474
478
|
|
|
475
479
|
http_res = self.do_request(
|
|
476
480
|
hook_ctx=HookContext(
|
|
481
|
+
config=self.sdk_configuration,
|
|
477
482
|
base_url=base_url or "",
|
|
478
483
|
operation_id="get-user-teams",
|
|
479
484
|
oauth2_scopes=[],
|
|
@@ -561,6 +566,7 @@ class UserProfile(BaseSDK):
|
|
|
561
566
|
|
|
562
567
|
http_res = await self.do_request_async(
|
|
563
568
|
hook_ctx=HookContext(
|
|
569
|
+
config=self.sdk_configuration,
|
|
564
570
|
base_url=base_url or "",
|
|
565
571
|
operation_id="get-user-teams",
|
|
566
572
|
oauth2_scopes=[],
|
|
@@ -1,52 +1,56 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
|
-
from
|
|
4
|
-
from
|
|
5
|
-
from .enums import OpenEnumMeta
|
|
6
|
-
from .headers import get_headers, get_response_headers
|
|
7
|
-
from .metadata import (
|
|
8
|
-
FieldMetadata,
|
|
9
|
-
find_metadata,
|
|
10
|
-
FormMetadata,
|
|
11
|
-
HeaderMetadata,
|
|
12
|
-
MultipartFormMetadata,
|
|
13
|
-
PathParamMetadata,
|
|
14
|
-
QueryParamMetadata,
|
|
15
|
-
RequestMetadata,
|
|
16
|
-
SecurityMetadata,
|
|
17
|
-
)
|
|
18
|
-
from .queryparams import get_query_params
|
|
19
|
-
from .retries import BackoffStrategy, Retries, retry, retry_async, RetryConfig
|
|
20
|
-
from .requestbodies import serialize_request_body, SerializedRequestBody
|
|
21
|
-
from .security import get_security, get_security_from_env
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
from importlib import import_module
|
|
22
5
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
from .
|
|
42
|
-
from .
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from .annotations import get_discriminator
|
|
8
|
+
from .datetimes import parse_datetime
|
|
9
|
+
from .enums import OpenEnumMeta
|
|
10
|
+
from .headers import get_headers, get_response_headers
|
|
11
|
+
from .metadata import (
|
|
12
|
+
FieldMetadata,
|
|
13
|
+
find_metadata,
|
|
14
|
+
FormMetadata,
|
|
15
|
+
HeaderMetadata,
|
|
16
|
+
MultipartFormMetadata,
|
|
17
|
+
PathParamMetadata,
|
|
18
|
+
QueryParamMetadata,
|
|
19
|
+
RequestMetadata,
|
|
20
|
+
SecurityMetadata,
|
|
21
|
+
)
|
|
22
|
+
from .queryparams import get_query_params
|
|
23
|
+
from .retries import BackoffStrategy, Retries, retry, retry_async, RetryConfig
|
|
24
|
+
from .requestbodies import serialize_request_body, SerializedRequestBody
|
|
25
|
+
from .security import get_security, get_security_from_env
|
|
26
|
+
|
|
27
|
+
from .serializers import (
|
|
28
|
+
get_pydantic_model,
|
|
29
|
+
marshal_json,
|
|
30
|
+
unmarshal,
|
|
31
|
+
unmarshal_json,
|
|
32
|
+
serialize_decimal,
|
|
33
|
+
serialize_float,
|
|
34
|
+
serialize_int,
|
|
35
|
+
stream_to_text,
|
|
36
|
+
stream_to_text_async,
|
|
37
|
+
stream_to_bytes,
|
|
38
|
+
stream_to_bytes_async,
|
|
39
|
+
validate_const,
|
|
40
|
+
validate_decimal,
|
|
41
|
+
validate_float,
|
|
42
|
+
validate_int,
|
|
43
|
+
validate_open_enum,
|
|
44
|
+
)
|
|
45
|
+
from .url import generate_url, template_url, remove_suffix
|
|
46
|
+
from .values import (
|
|
47
|
+
get_global_from_env,
|
|
48
|
+
match_content_type,
|
|
49
|
+
match_status_codes,
|
|
50
|
+
match_response,
|
|
51
|
+
cast_partial,
|
|
52
|
+
)
|
|
53
|
+
from .logger import Logger, get_body_content, get_default_logger
|
|
50
54
|
|
|
51
55
|
__all__ = [
|
|
52
56
|
"BackoffStrategy",
|
|
@@ -57,6 +61,7 @@ __all__ = [
|
|
|
57
61
|
"get_body_content",
|
|
58
62
|
"get_default_logger",
|
|
59
63
|
"get_discriminator",
|
|
64
|
+
"parse_datetime",
|
|
60
65
|
"get_global_from_env",
|
|
61
66
|
"get_headers",
|
|
62
67
|
"get_pydantic_model",
|
|
@@ -100,3 +105,83 @@ __all__ = [
|
|
|
100
105
|
"validate_open_enum",
|
|
101
106
|
"cast_partial",
|
|
102
107
|
]
|
|
108
|
+
|
|
109
|
+
_dynamic_imports: dict[str, str] = {
|
|
110
|
+
"BackoffStrategy": ".retries",
|
|
111
|
+
"FieldMetadata": ".metadata",
|
|
112
|
+
"find_metadata": ".metadata",
|
|
113
|
+
"FormMetadata": ".metadata",
|
|
114
|
+
"generate_url": ".url",
|
|
115
|
+
"get_body_content": ".logger",
|
|
116
|
+
"get_default_logger": ".logger",
|
|
117
|
+
"get_discriminator": ".annotations",
|
|
118
|
+
"parse_datetime": ".datetimes",
|
|
119
|
+
"get_global_from_env": ".values",
|
|
120
|
+
"get_headers": ".headers",
|
|
121
|
+
"get_pydantic_model": ".serializers",
|
|
122
|
+
"get_query_params": ".queryparams",
|
|
123
|
+
"get_response_headers": ".headers",
|
|
124
|
+
"get_security": ".security",
|
|
125
|
+
"get_security_from_env": ".security",
|
|
126
|
+
"HeaderMetadata": ".metadata",
|
|
127
|
+
"Logger": ".logger",
|
|
128
|
+
"marshal_json": ".serializers",
|
|
129
|
+
"match_content_type": ".values",
|
|
130
|
+
"match_status_codes": ".values",
|
|
131
|
+
"match_response": ".values",
|
|
132
|
+
"MultipartFormMetadata": ".metadata",
|
|
133
|
+
"OpenEnumMeta": ".enums",
|
|
134
|
+
"PathParamMetadata": ".metadata",
|
|
135
|
+
"QueryParamMetadata": ".metadata",
|
|
136
|
+
"remove_suffix": ".url",
|
|
137
|
+
"Retries": ".retries",
|
|
138
|
+
"retry": ".retries",
|
|
139
|
+
"retry_async": ".retries",
|
|
140
|
+
"RetryConfig": ".retries",
|
|
141
|
+
"RequestMetadata": ".metadata",
|
|
142
|
+
"SecurityMetadata": ".metadata",
|
|
143
|
+
"serialize_decimal": ".serializers",
|
|
144
|
+
"serialize_float": ".serializers",
|
|
145
|
+
"serialize_int": ".serializers",
|
|
146
|
+
"serialize_request_body": ".requestbodies",
|
|
147
|
+
"SerializedRequestBody": ".requestbodies",
|
|
148
|
+
"stream_to_text": ".serializers",
|
|
149
|
+
"stream_to_text_async": ".serializers",
|
|
150
|
+
"stream_to_bytes": ".serializers",
|
|
151
|
+
"stream_to_bytes_async": ".serializers",
|
|
152
|
+
"template_url": ".url",
|
|
153
|
+
"unmarshal": ".serializers",
|
|
154
|
+
"unmarshal_json": ".serializers",
|
|
155
|
+
"validate_decimal": ".serializers",
|
|
156
|
+
"validate_const": ".serializers",
|
|
157
|
+
"validate_float": ".serializers",
|
|
158
|
+
"validate_int": ".serializers",
|
|
159
|
+
"validate_open_enum": ".serializers",
|
|
160
|
+
"cast_partial": ".values",
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
def __getattr__(attr_name: str) -> object:
|
|
165
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
166
|
+
if module_name is None:
|
|
167
|
+
raise AttributeError(
|
|
168
|
+
f"no {attr_name} found in _dynamic_imports, module name -> {__name__} "
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
try:
|
|
172
|
+
module = import_module(module_name, __package__)
|
|
173
|
+
result = getattr(module, attr_name)
|
|
174
|
+
return result
|
|
175
|
+
except ImportError as e:
|
|
176
|
+
raise ImportError(
|
|
177
|
+
f"Failed to import {attr_name} from {module_name}: {e}"
|
|
178
|
+
) from e
|
|
179
|
+
except AttributeError as e:
|
|
180
|
+
raise AttributeError(
|
|
181
|
+
f"Failed to get {attr_name} from {module_name}: {e}"
|
|
182
|
+
) from e
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def __dir__():
|
|
186
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
187
|
+
return sorted(lazy_attrs)
|
|
@@ -86,11 +86,39 @@ def _populate_form(
|
|
|
86
86
|
return form
|
|
87
87
|
|
|
88
88
|
|
|
89
|
+
def _extract_file_properties(file_obj: Any) -> Tuple[str, Any, Any]:
|
|
90
|
+
"""Extract file name, content, and content type from a file object."""
|
|
91
|
+
file_fields: Dict[str, FieldInfo] = file_obj.__class__.model_fields
|
|
92
|
+
|
|
93
|
+
file_name = ""
|
|
94
|
+
content = None
|
|
95
|
+
content_type = None
|
|
96
|
+
|
|
97
|
+
for file_field_name in file_fields:
|
|
98
|
+
file_field = file_fields[file_field_name]
|
|
99
|
+
|
|
100
|
+
file_metadata = find_field_metadata(file_field, MultipartFormMetadata)
|
|
101
|
+
if file_metadata is None:
|
|
102
|
+
continue
|
|
103
|
+
|
|
104
|
+
if file_metadata.content:
|
|
105
|
+
content = getattr(file_obj, file_field_name, None)
|
|
106
|
+
elif file_field_name == "content_type":
|
|
107
|
+
content_type = getattr(file_obj, file_field_name, None)
|
|
108
|
+
else:
|
|
109
|
+
file_name = getattr(file_obj, file_field_name)
|
|
110
|
+
|
|
111
|
+
if file_name == "" or content is None:
|
|
112
|
+
raise ValueError("invalid multipart/form-data file")
|
|
113
|
+
|
|
114
|
+
return file_name, content, content_type
|
|
115
|
+
|
|
116
|
+
|
|
89
117
|
def serialize_multipart_form(
|
|
90
118
|
media_type: str, request: Any
|
|
91
|
-
) -> Tuple[str, Dict[str, Any],
|
|
119
|
+
) -> Tuple[str, Dict[str, Any], List[Tuple[str, Any]]]:
|
|
92
120
|
form: Dict[str, Any] = {}
|
|
93
|
-
files:
|
|
121
|
+
files: List[Tuple[str, Any]] = []
|
|
94
122
|
|
|
95
123
|
if not isinstance(request, BaseModel):
|
|
96
124
|
raise TypeError("invalid request body type")
|
|
@@ -112,39 +140,32 @@ def serialize_multipart_form(
|
|
|
112
140
|
f_name = field.alias if field.alias else name
|
|
113
141
|
|
|
114
142
|
if field_metadata.file:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
file_field = file_fields[file_field_name]
|
|
143
|
+
if isinstance(val, List):
|
|
144
|
+
# Handle array of files
|
|
145
|
+
for file_obj in val:
|
|
146
|
+
if not _is_set(file_obj):
|
|
147
|
+
continue
|
|
148
|
+
|
|
149
|
+
file_name, content, content_type = _extract_file_properties(file_obj)
|
|
123
150
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
151
|
+
if content_type is not None:
|
|
152
|
+
files.append((f_name + "[]", (file_name, content, content_type)))
|
|
153
|
+
else:
|
|
154
|
+
files.append((f_name + "[]", (file_name, content)))
|
|
155
|
+
else:
|
|
156
|
+
# Handle single file
|
|
157
|
+
file_name, content, content_type = _extract_file_properties(val)
|
|
127
158
|
|
|
128
|
-
if
|
|
129
|
-
|
|
130
|
-
elif file_field_name == "content_type":
|
|
131
|
-
content_type = getattr(val, file_field_name, None)
|
|
159
|
+
if content_type is not None:
|
|
160
|
+
files.append((f_name, (file_name, content, content_type)))
|
|
132
161
|
else:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
if file_name == "" or content is None:
|
|
136
|
-
raise ValueError("invalid multipart/form-data file")
|
|
137
|
-
|
|
138
|
-
if content_type is not None:
|
|
139
|
-
files[f_name] = (file_name, content, content_type)
|
|
140
|
-
else:
|
|
141
|
-
files[f_name] = (file_name, content)
|
|
162
|
+
files.append((f_name, (file_name, content)))
|
|
142
163
|
elif field_metadata.json:
|
|
143
|
-
files
|
|
164
|
+
files.append((f_name, (
|
|
144
165
|
None,
|
|
145
166
|
marshal_json(val, request_field_types[name]),
|
|
146
167
|
"application/json",
|
|
147
|
-
)
|
|
168
|
+
)))
|
|
148
169
|
else:
|
|
149
170
|
if isinstance(val, List):
|
|
150
171
|
values = []
|
|
@@ -3,18 +3,21 @@
|
|
|
3
3
|
from .basesdk import BaseSDK
|
|
4
4
|
from latitudesh_python_sdk import models, utils
|
|
5
5
|
from latitudesh_python_sdk._hooks import HookContext
|
|
6
|
-
from latitudesh_python_sdk.types import
|
|
6
|
+
from latitudesh_python_sdk.types import OptionalNullable, UNSET
|
|
7
7
|
from latitudesh_python_sdk.utils import get_security_from_env
|
|
8
|
-
from typing import Mapping, Optional, Union
|
|
8
|
+
from typing import Mapping, Optional, Union
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class VirtualMachines(BaseSDK):
|
|
12
12
|
def create(
|
|
13
13
|
self,
|
|
14
14
|
*,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
data: Optional[
|
|
16
|
+
Union[
|
|
17
|
+
models.VirtualMachinePayloadData,
|
|
18
|
+
models.VirtualMachinePayloadDataTypedDict,
|
|
19
|
+
]
|
|
20
|
+
] = None,
|
|
18
21
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
19
22
|
server_url: Optional[str] = None,
|
|
20
23
|
timeout_ms: Optional[int] = None,
|
|
@@ -25,7 +28,7 @@ class VirtualMachines(BaseSDK):
|
|
|
25
28
|
Creates a new Virtual Machine.
|
|
26
29
|
|
|
27
30
|
|
|
28
|
-
:param
|
|
31
|
+
:param data:
|
|
29
32
|
:param retries: Override the default retry configuration for this method
|
|
30
33
|
:param server_url: Override the default server URL for this method
|
|
31
34
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -41,9 +44,11 @@ class VirtualMachines(BaseSDK):
|
|
|
41
44
|
else:
|
|
42
45
|
base_url = self._get_url(base_url, url_variables)
|
|
43
46
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
request = models.VirtualMachinePayload(
|
|
48
|
+
data=utils.get_pydantic_model(
|
|
49
|
+
data, Optional[models.VirtualMachinePayloadData]
|
|
50
|
+
),
|
|
51
|
+
)
|
|
47
52
|
|
|
48
53
|
req = self._build_request(
|
|
49
54
|
method="POST",
|
|
@@ -59,7 +64,7 @@ class VirtualMachines(BaseSDK):
|
|
|
59
64
|
http_headers=http_headers,
|
|
60
65
|
security=self.sdk_configuration.security,
|
|
61
66
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
62
|
-
request, False,
|
|
67
|
+
request, False, False, "json", models.VirtualMachinePayload
|
|
63
68
|
),
|
|
64
69
|
timeout_ms=timeout_ms,
|
|
65
70
|
)
|
|
@@ -74,6 +79,7 @@ class VirtualMachines(BaseSDK):
|
|
|
74
79
|
|
|
75
80
|
http_res = self.do_request(
|
|
76
81
|
hook_ctx=HookContext(
|
|
82
|
+
config=self.sdk_configuration,
|
|
77
83
|
base_url=base_url or "",
|
|
78
84
|
operation_id="create-virtual-machine",
|
|
79
85
|
oauth2_scopes=[],
|
|
@@ -111,9 +117,12 @@ class VirtualMachines(BaseSDK):
|
|
|
111
117
|
async def create_async(
|
|
112
118
|
self,
|
|
113
119
|
*,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
120
|
+
data: Optional[
|
|
121
|
+
Union[
|
|
122
|
+
models.VirtualMachinePayloadData,
|
|
123
|
+
models.VirtualMachinePayloadDataTypedDict,
|
|
124
|
+
]
|
|
125
|
+
] = None,
|
|
117
126
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
118
127
|
server_url: Optional[str] = None,
|
|
119
128
|
timeout_ms: Optional[int] = None,
|
|
@@ -124,7 +133,7 @@ class VirtualMachines(BaseSDK):
|
|
|
124
133
|
Creates a new Virtual Machine.
|
|
125
134
|
|
|
126
135
|
|
|
127
|
-
:param
|
|
136
|
+
:param data:
|
|
128
137
|
:param retries: Override the default retry configuration for this method
|
|
129
138
|
:param server_url: Override the default server URL for this method
|
|
130
139
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -140,9 +149,11 @@ class VirtualMachines(BaseSDK):
|
|
|
140
149
|
else:
|
|
141
150
|
base_url = self._get_url(base_url, url_variables)
|
|
142
151
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
152
|
+
request = models.VirtualMachinePayload(
|
|
153
|
+
data=utils.get_pydantic_model(
|
|
154
|
+
data, Optional[models.VirtualMachinePayloadData]
|
|
155
|
+
),
|
|
156
|
+
)
|
|
146
157
|
|
|
147
158
|
req = self._build_request_async(
|
|
148
159
|
method="POST",
|
|
@@ -158,7 +169,7 @@ class VirtualMachines(BaseSDK):
|
|
|
158
169
|
http_headers=http_headers,
|
|
159
170
|
security=self.sdk_configuration.security,
|
|
160
171
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
161
|
-
request, False,
|
|
172
|
+
request, False, False, "json", models.VirtualMachinePayload
|
|
162
173
|
),
|
|
163
174
|
timeout_ms=timeout_ms,
|
|
164
175
|
)
|
|
@@ -173,6 +184,7 @@ class VirtualMachines(BaseSDK):
|
|
|
173
184
|
|
|
174
185
|
http_res = await self.do_request_async(
|
|
175
186
|
hook_ctx=HookContext(
|
|
187
|
+
config=self.sdk_configuration,
|
|
176
188
|
base_url=base_url or "",
|
|
177
189
|
operation_id="create-virtual-machine",
|
|
178
190
|
oauth2_scopes=[],
|
|
@@ -267,6 +279,7 @@ class VirtualMachines(BaseSDK):
|
|
|
267
279
|
|
|
268
280
|
http_res = self.do_request(
|
|
269
281
|
hook_ctx=HookContext(
|
|
282
|
+
config=self.sdk_configuration,
|
|
270
283
|
base_url=base_url or "",
|
|
271
284
|
operation_id="index-virtual-machine",
|
|
272
285
|
oauth2_scopes=[],
|
|
@@ -361,6 +374,7 @@ class VirtualMachines(BaseSDK):
|
|
|
361
374
|
|
|
362
375
|
http_res = await self.do_request_async(
|
|
363
376
|
hook_ctx=HookContext(
|
|
377
|
+
config=self.sdk_configuration,
|
|
364
378
|
base_url=base_url or "",
|
|
365
379
|
operation_id="index-virtual-machine",
|
|
366
380
|
oauth2_scopes=[],
|
|
@@ -455,6 +469,7 @@ class VirtualMachines(BaseSDK):
|
|
|
455
469
|
|
|
456
470
|
http_res = self.do_request(
|
|
457
471
|
hook_ctx=HookContext(
|
|
472
|
+
config=self.sdk_configuration,
|
|
458
473
|
base_url=base_url or "",
|
|
459
474
|
operation_id="show-virtual-machine",
|
|
460
475
|
oauth2_scopes=[],
|
|
@@ -549,6 +564,7 @@ class VirtualMachines(BaseSDK):
|
|
|
549
564
|
|
|
550
565
|
http_res = await self.do_request_async(
|
|
551
566
|
hook_ctx=HookContext(
|
|
567
|
+
config=self.sdk_configuration,
|
|
552
568
|
base_url=base_url or "",
|
|
553
569
|
operation_id="show-virtual-machine",
|
|
554
570
|
oauth2_scopes=[],
|
|
@@ -643,6 +659,7 @@ class VirtualMachines(BaseSDK):
|
|
|
643
659
|
|
|
644
660
|
http_res = self.do_request(
|
|
645
661
|
hook_ctx=HookContext(
|
|
662
|
+
config=self.sdk_configuration,
|
|
646
663
|
base_url=base_url or "",
|
|
647
664
|
operation_id="destroy-virtual-machine",
|
|
648
665
|
oauth2_scopes=[],
|
|
@@ -737,6 +754,7 @@ class VirtualMachines(BaseSDK):
|
|
|
737
754
|
|
|
738
755
|
http_res = await self.do_request_async(
|
|
739
756
|
hook_ctx=HookContext(
|
|
757
|
+
config=self.sdk_configuration,
|
|
740
758
|
base_url=base_url or "",
|
|
741
759
|
operation_id="destroy-virtual-machine",
|
|
742
760
|
oauth2_scopes=[],
|