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
latitudesh_python_sdk/billing.py
CHANGED
|
@@ -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 List, Mapping, Optional
|
|
9
10
|
|
|
10
11
|
|
|
@@ -75,6 +76,7 @@ class Billing(BaseSDK):
|
|
|
75
76
|
|
|
76
77
|
http_res = self.do_request(
|
|
77
78
|
hook_ctx=HookContext(
|
|
79
|
+
config=self.sdk_configuration,
|
|
78
80
|
base_url=base_url or "",
|
|
79
81
|
operation_id="get-billing-usage",
|
|
80
82
|
oauth2_scopes=[],
|
|
@@ -88,26 +90,15 @@ class Billing(BaseSDK):
|
|
|
88
90
|
)
|
|
89
91
|
|
|
90
92
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
91
|
-
return
|
|
93
|
+
return unmarshal_json_response(models.BillingUsage, http_res)
|
|
92
94
|
if utils.match_response(http_res, "4XX", "*"):
|
|
93
95
|
http_res_text = utils.stream_to_text(http_res)
|
|
94
|
-
raise models.APIError(
|
|
95
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
96
|
-
)
|
|
96
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
97
97
|
if utils.match_response(http_res, "5XX", "*"):
|
|
98
98
|
http_res_text = utils.stream_to_text(http_res)
|
|
99
|
-
raise models.APIError(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
content_type = http_res.headers.get("Content-Type")
|
|
104
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
105
|
-
raise models.APIError(
|
|
106
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
107
|
-
http_res.status_code,
|
|
108
|
-
http_res_text,
|
|
109
|
-
http_res,
|
|
110
|
-
)
|
|
99
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
100
|
+
|
|
101
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
111
102
|
|
|
112
103
|
async def list_usage_async(
|
|
113
104
|
self,
|
|
@@ -175,6 +166,7 @@ class Billing(BaseSDK):
|
|
|
175
166
|
|
|
176
167
|
http_res = await self.do_request_async(
|
|
177
168
|
hook_ctx=HookContext(
|
|
169
|
+
config=self.sdk_configuration,
|
|
178
170
|
base_url=base_url or "",
|
|
179
171
|
operation_id="get-billing-usage",
|
|
180
172
|
oauth2_scopes=[],
|
|
@@ -188,23 +180,12 @@ class Billing(BaseSDK):
|
|
|
188
180
|
)
|
|
189
181
|
|
|
190
182
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
191
|
-
return
|
|
183
|
+
return unmarshal_json_response(models.BillingUsage, http_res)
|
|
192
184
|
if utils.match_response(http_res, "4XX", "*"):
|
|
193
185
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
194
|
-
raise models.APIError(
|
|
195
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
196
|
-
)
|
|
186
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
197
187
|
if utils.match_response(http_res, "5XX", "*"):
|
|
198
188
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
199
|
-
raise models.APIError(
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
content_type = http_res.headers.get("Content-Type")
|
|
204
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
205
|
-
raise models.APIError(
|
|
206
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
207
|
-
http_res.status_code,
|
|
208
|
-
http_res_text,
|
|
209
|
-
http_res,
|
|
210
|
-
)
|
|
189
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
190
|
+
|
|
191
|
+
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
|
|
|
@@ -97,6 +98,7 @@ class EventsSDK(BaseSDK):
|
|
|
97
98
|
|
|
98
99
|
http_res = self.do_request(
|
|
99
100
|
hook_ctx=HookContext(
|
|
101
|
+
config=self.sdk_configuration,
|
|
100
102
|
base_url=base_url or "",
|
|
101
103
|
operation_id="get-events",
|
|
102
104
|
oauth2_scopes=[],
|
|
@@ -139,30 +141,17 @@ class EventsSDK(BaseSDK):
|
|
|
139
141
|
|
|
140
142
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
141
143
|
return models.GetEventsResponse(
|
|
142
|
-
result=
|
|
143
|
-
http_res.text, models.GetEventsResponseBody
|
|
144
|
-
),
|
|
144
|
+
result=unmarshal_json_response(models.GetEventsResponseBody, http_res),
|
|
145
145
|
next=next_func,
|
|
146
146
|
)
|
|
147
147
|
if utils.match_response(http_res, "4XX", "*"):
|
|
148
148
|
http_res_text = utils.stream_to_text(http_res)
|
|
149
|
-
raise models.APIError(
|
|
150
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
151
|
-
)
|
|
149
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
152
150
|
if utils.match_response(http_res, "5XX", "*"):
|
|
153
151
|
http_res_text = utils.stream_to_text(http_res)
|
|
154
|
-
raise models.APIError(
|
|
155
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
156
|
-
)
|
|
152
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
157
153
|
|
|
158
|
-
|
|
159
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
160
|
-
raise models.APIError(
|
|
161
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
162
|
-
http_res.status_code,
|
|
163
|
-
http_res_text,
|
|
164
|
-
http_res,
|
|
165
|
-
)
|
|
154
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
166
155
|
|
|
167
156
|
async def list_async(
|
|
168
157
|
self,
|
|
@@ -251,6 +240,7 @@ class EventsSDK(BaseSDK):
|
|
|
251
240
|
|
|
252
241
|
http_res = await self.do_request_async(
|
|
253
242
|
hook_ctx=HookContext(
|
|
243
|
+
config=self.sdk_configuration,
|
|
254
244
|
base_url=base_url or "",
|
|
255
245
|
operation_id="get-events",
|
|
256
246
|
oauth2_scopes=[],
|
|
@@ -293,27 +283,14 @@ class EventsSDK(BaseSDK):
|
|
|
293
283
|
|
|
294
284
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
295
285
|
return models.GetEventsResponse(
|
|
296
|
-
result=
|
|
297
|
-
http_res.text, models.GetEventsResponseBody
|
|
298
|
-
),
|
|
286
|
+
result=unmarshal_json_response(models.GetEventsResponseBody, http_res),
|
|
299
287
|
next=next_func,
|
|
300
288
|
)
|
|
301
289
|
if utils.match_response(http_res, "4XX", "*"):
|
|
302
290
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
303
|
-
raise models.APIError(
|
|
304
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
305
|
-
)
|
|
291
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
306
292
|
if utils.match_response(http_res, "5XX", "*"):
|
|
307
293
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
308
|
-
raise models.APIError(
|
|
309
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
310
|
-
)
|
|
294
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
311
295
|
|
|
312
|
-
|
|
313
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
314
|
-
raise models.APIError(
|
|
315
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
316
|
-
http_res.status_code,
|
|
317
|
-
http_res_text,
|
|
318
|
-
http_res,
|
|
319
|
-
)
|
|
296
|
+
raise models.APIError("Unexpected response received", http_res)
|