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.

Files changed (93) hide show
  1. latitudesh_python_sdk/_hooks/types.py +7 -0
  2. latitudesh_python_sdk/_version.py +6 -4
  3. latitudesh_python_sdk/apikeys.py +73 -156
  4. latitudesh_python_sdk/basesdk.py +16 -24
  5. latitudesh_python_sdk/billing.py +13 -32
  6. latitudesh_python_sdk/events_sdk.py +11 -34
  7. latitudesh_python_sdk/firewalls_sdk.py +105 -264
  8. latitudesh_python_sdk/httpclient.py +6 -16
  9. latitudesh_python_sdk/ipaddresses_sdk.py +29 -68
  10. latitudesh_python_sdk/models/__init__.py +2586 -1126
  11. latitudesh_python_sdk/models/apierror.py +30 -14
  12. latitudesh_python_sdk/models/assign_server_virtual_networkop.py +2 -2
  13. latitudesh_python_sdk/models/{bandwidth_plan.py → bandwidth_plan_data.py} +9 -9
  14. latitudesh_python_sdk/models/bandwidth_plans.py +14 -3
  15. latitudesh_python_sdk/models/custom_tag.py +15 -0
  16. latitudesh_python_sdk/models/custom_tag_data.py +54 -0
  17. latitudesh_python_sdk/models/custom_tags.py +26 -0
  18. latitudesh_python_sdk/models/delete_ssh_keyop.py +16 -0
  19. latitudesh_python_sdk/models/delete_user_dataop.py +16 -0
  20. latitudesh_python_sdk/models/deploy_config.py +11 -6
  21. latitudesh_python_sdk/models/error_object.py +11 -6
  22. latitudesh_python_sdk/models/event_data.py +98 -0
  23. latitudesh_python_sdk/models/events.py +16 -1
  24. latitudesh_python_sdk/models/filesystem_data.py +4 -0
  25. latitudesh_python_sdk/models/firewall.py +15 -0
  26. latitudesh_python_sdk/models/firewall_assignment_data.py +50 -0
  27. latitudesh_python_sdk/models/firewall_assignments.py +29 -0
  28. latitudesh_python_sdk/models/firewall_data.py +71 -0
  29. latitudesh_python_sdk/models/firewall_server.py +4 -1
  30. latitudesh_python_sdk/models/firewalls.py +7 -7
  31. latitudesh_python_sdk/models/get_firewall_assignmentsop.py +3 -3
  32. latitudesh_python_sdk/models/get_ssh_keyop.py +30 -0
  33. latitudesh_python_sdk/models/get_ssh_keysop.py +22 -0
  34. latitudesh_python_sdk/models/get_traffic_consumptionop.py +8 -4
  35. latitudesh_python_sdk/models/get_user_dataop.py +31 -0
  36. latitudesh_python_sdk/models/get_users_dataop.py +35 -0
  37. latitudesh_python_sdk/models/latitudesherror.py +26 -0
  38. latitudesh_python_sdk/models/no_response_error.py +13 -0
  39. latitudesh_python_sdk/models/operating_system_data.py +65 -0
  40. latitudesh_python_sdk/models/operating_systems.py +15 -0
  41. latitudesh_python_sdk/models/out_of_band_connection.py +4 -4
  42. latitudesh_python_sdk/models/patch_user_dataop.py +69 -0
  43. latitudesh_python_sdk/models/post_ssh_keyop.py +58 -0
  44. latitudesh_python_sdk/models/post_user_dataop.py +45 -0
  45. latitudesh_python_sdk/models/project_include.py +3 -0
  46. latitudesh_python_sdk/models/put_ssh_keyop.py +80 -0
  47. latitudesh_python_sdk/models/region_resource_data.py +4 -4
  48. latitudesh_python_sdk/models/responsevalidationerror.py +25 -0
  49. latitudesh_python_sdk/models/role.py +11 -0
  50. latitudesh_python_sdk/models/server.py +11 -6
  51. latitudesh_python_sdk/models/server_data.py +14 -3
  52. latitudesh_python_sdk/models/server_region_resource_data.py +40 -0
  53. latitudesh_python_sdk/models/{ssh_key.py → ssh_keys.py} +13 -2
  54. latitudesh_python_sdk/models/storage_plan_data.py +47 -0
  55. latitudesh_python_sdk/models/storage_plans.py +14 -3
  56. latitudesh_python_sdk/models/update_serverop.py +58 -10
  57. latitudesh_python_sdk/models/user_data.py +11 -0
  58. latitudesh_python_sdk/models/virtual_network.py +30 -6
  59. latitudesh_python_sdk/models/virtual_network1.py +15 -0
  60. latitudesh_python_sdk/models/virtual_network_assignment.py +41 -0
  61. latitudesh_python_sdk/models/virtual_network_assignment_data.py +68 -0
  62. latitudesh_python_sdk/models/virtual_network_assignments.py +5 -5
  63. latitudesh_python_sdk/models/virtual_network_data.py +88 -0
  64. latitudesh_python_sdk/models/virtual_networks.py +3 -3
  65. latitudesh_python_sdk/operatingsystems_sdk.py +13 -32
  66. latitudesh_python_sdk/plans.py +99 -214
  67. latitudesh_python_sdk/privatenetworks.py +131 -290
  68. latitudesh_python_sdk/projects_sdk.py +79 -158
  69. latitudesh_python_sdk/regions_sdk.py +25 -66
  70. latitudesh_python_sdk/roles.py +25 -64
  71. latitudesh_python_sdk/sdk.py +110 -73
  72. latitudesh_python_sdk/sdkconfiguration.py +0 -7
  73. latitudesh_python_sdk/servers_sdk.py +305 -646
  74. latitudesh_python_sdk/sshkeys_sdk.py +1856 -0
  75. latitudesh_python_sdk/storage.py +41 -120
  76. latitudesh_python_sdk/tags.py +67 -146
  77. latitudesh_python_sdk/teams_sdk.py +41 -100
  78. latitudesh_python_sdk/teamsmembers.py +37 -96
  79. latitudesh_python_sdk/traffic_sdk.py +37 -76
  80. latitudesh_python_sdk/userdata_sdk.py +959 -149
  81. latitudesh_python_sdk/userprofile.py +37 -100
  82. latitudesh_python_sdk/utils/__init__.py +131 -46
  83. latitudesh_python_sdk/utils/forms.py +49 -28
  84. latitudesh_python_sdk/utils/serializers.py +3 -2
  85. latitudesh_python_sdk/utils/unmarshal_json_response.py +24 -0
  86. latitudesh_python_sdk/virtualmachines.py +71 -140
  87. latitudesh_python_sdk/vpnsessions.py +93 -172
  88. {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/METADATA +76 -43
  89. {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/RECORD +91 -67
  90. {latitudesh_python_sdk-1.1.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/WHEEL +1 -1
  91. latitudesh_python_sdk/models/storage_plan.py +0 -36
  92. latitudesh_python_sdk/sshkeys.py +0 -1050
  93. {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
9
10
 
10
11
 
@@ -14,8 +15,8 @@ class TrafficSDK(BaseSDK):
14
15
  *,
15
16
  filter_date_gte: str,
16
17
  filter_date_lte: str,
17
- filter_server: Optional[int] = None,
18
- filter_project: Optional[int] = None,
18
+ filter_server: Optional[str] = None,
19
+ filter_project: Optional[str] = None,
19
20
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
20
21
  server_url: Optional[str] = None,
21
22
  timeout_ms: Optional[int] = None,
@@ -25,8 +26,8 @@ class TrafficSDK(BaseSDK):
25
26
 
26
27
  :param filter_date_gte: The start timestamp to retrieve the traffic. You must provide in ISO8601 format. Example: filter[date][gte]=2024-04-01T00:00:00Z
27
28
  :param filter_date_lte: The end timestamp to retrieve the traffic. You must provide in ISO8601 format. Example: filter[date][gte]=2024-04-31T23:59:59Z
28
- :param filter_server:
29
- :param filter_project:
29
+ :param filter_server: The server id to filter by
30
+ :param filter_project: The project id to filter by
30
31
  :param retries: Override the default retry configuration for this method
31
32
  :param server_url: Override the default server URL for this method
32
33
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -75,6 +76,7 @@ class TrafficSDK(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-traffic-consumption",
80
82
  oauth2_scopes=[],
@@ -88,34 +90,23 @@ class TrafficSDK(BaseSDK):
88
90
  )
89
91
 
90
92
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
91
- return utils.unmarshal_json(http_res.text, models.Traffic)
93
+ return unmarshal_json_response(models.Traffic, http_res)
92
94
  if utils.match_response(http_res, ["422", "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
- "API error occurred", http_res.status_code, http_res_text, http_res
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 get_async(
113
104
  self,
114
105
  *,
115
106
  filter_date_gte: str,
116
107
  filter_date_lte: str,
117
- filter_server: Optional[int] = None,
118
- filter_project: Optional[int] = None,
108
+ filter_server: Optional[str] = None,
109
+ filter_project: Optional[str] = None,
119
110
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
120
111
  server_url: Optional[str] = None,
121
112
  timeout_ms: Optional[int] = None,
@@ -125,8 +116,8 @@ class TrafficSDK(BaseSDK):
125
116
 
126
117
  :param filter_date_gte: The start timestamp to retrieve the traffic. You must provide in ISO8601 format. Example: filter[date][gte]=2024-04-01T00:00:00Z
127
118
  :param filter_date_lte: The end timestamp to retrieve the traffic. You must provide in ISO8601 format. Example: filter[date][gte]=2024-04-31T23:59:59Z
128
- :param filter_server:
129
- :param filter_project:
119
+ :param filter_server: The server id to filter by
120
+ :param filter_project: The project id to filter by
130
121
  :param retries: Override the default retry configuration for this method
131
122
  :param server_url: Override the default server URL for this method
132
123
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -175,6 +166,7 @@ class TrafficSDK(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-traffic-consumption",
180
172
  oauth2_scopes=[],
@@ -188,26 +180,15 @@ class TrafficSDK(BaseSDK):
188
180
  )
189
181
 
190
182
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
191
- return utils.unmarshal_json(http_res.text, models.Traffic)
183
+ return unmarshal_json_response(models.Traffic, http_res)
192
184
  if utils.match_response(http_res, ["422", "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
- "API error occurred", http_res.status_code, http_res_text, http_res
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)
211
192
 
212
193
  def get_quota(
213
194
  self,
@@ -266,6 +247,7 @@ class TrafficSDK(BaseSDK):
266
247
 
267
248
  http_res = self.do_request(
268
249
  hook_ctx=HookContext(
250
+ config=self.sdk_configuration,
269
251
  base_url=base_url or "",
270
252
  operation_id="get-traffic-quota",
271
253
  oauth2_scopes=[],
@@ -280,29 +262,18 @@ class TrafficSDK(BaseSDK):
280
262
 
281
263
  response_data: Any = None
282
264
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
283
- return utils.unmarshal_json(http_res.text, models.TrafficQuota)
265
+ return unmarshal_json_response(models.TrafficQuota, http_res)
284
266
  if utils.match_response(http_res, "503", "application/vnd.api+json"):
285
- response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
286
- raise models.ErrorObject(data=response_data)
267
+ response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
268
+ raise models.ErrorObject(response_data, http_res)
287
269
  if utils.match_response(http_res, "4XX", "*"):
288
270
  http_res_text = utils.stream_to_text(http_res)
289
- raise models.APIError(
290
- "API error occurred", http_res.status_code, http_res_text, http_res
291
- )
271
+ raise models.APIError("API error occurred", http_res, http_res_text)
292
272
  if utils.match_response(http_res, "5XX", "*"):
293
273
  http_res_text = utils.stream_to_text(http_res)
294
- raise models.APIError(
295
- "API error occurred", http_res.status_code, http_res_text, http_res
296
- )
297
-
298
- content_type = http_res.headers.get("Content-Type")
299
- http_res_text = utils.stream_to_text(http_res)
300
- raise models.APIError(
301
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
302
- http_res.status_code,
303
- http_res_text,
304
- http_res,
305
- )
274
+ raise models.APIError("API error occurred", http_res, http_res_text)
275
+
276
+ raise models.APIError("Unexpected response received", http_res)
306
277
 
307
278
  async def get_quota_async(
308
279
  self,
@@ -361,6 +332,7 @@ class TrafficSDK(BaseSDK):
361
332
 
362
333
  http_res = await self.do_request_async(
363
334
  hook_ctx=HookContext(
335
+ config=self.sdk_configuration,
364
336
  base_url=base_url or "",
365
337
  operation_id="get-traffic-quota",
366
338
  oauth2_scopes=[],
@@ -375,26 +347,15 @@ class TrafficSDK(BaseSDK):
375
347
 
376
348
  response_data: Any = None
377
349
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
378
- return utils.unmarshal_json(http_res.text, models.TrafficQuota)
350
+ return unmarshal_json_response(models.TrafficQuota, http_res)
379
351
  if utils.match_response(http_res, "503", "application/vnd.api+json"):
380
- response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
381
- raise models.ErrorObject(data=response_data)
352
+ response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
353
+ raise models.ErrorObject(response_data, http_res)
382
354
  if utils.match_response(http_res, "4XX", "*"):
383
355
  http_res_text = await utils.stream_to_text_async(http_res)
384
- raise models.APIError(
385
- "API error occurred", http_res.status_code, http_res_text, http_res
386
- )
356
+ raise models.APIError("API error occurred", http_res, http_res_text)
387
357
  if utils.match_response(http_res, "5XX", "*"):
388
358
  http_res_text = await utils.stream_to_text_async(http_res)
389
- raise models.APIError(
390
- "API error occurred", http_res.status_code, http_res_text, http_res
391
- )
392
-
393
- content_type = http_res.headers.get("Content-Type")
394
- http_res_text = await utils.stream_to_text_async(http_res)
395
- raise models.APIError(
396
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
397
- http_res.status_code,
398
- http_res_text,
399
- http_res,
400
- )
359
+ raise models.APIError("API error occurred", http_res, http_res_text)
360
+
361
+ raise models.APIError("Unexpected response received", http_res)