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
@@ -3,9 +3,10 @@
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 BaseModel, OptionalNullable, UNSET
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 Any, Mapping, Optional, Union, cast
8
+ from latitudesh_python_sdk.utils.unmarshal_json_response import unmarshal_json_response
9
+ from typing import Any, Mapping, Optional, Union
9
10
 
10
11
 
11
12
  class VpnSessions(BaseSDK):
@@ -66,6 +67,7 @@ class VpnSessions(BaseSDK):
66
67
 
67
68
  http_res = self.do_request(
68
69
  hook_ctx=HookContext(
70
+ config=self.sdk_configuration,
69
71
  base_url=base_url or "",
70
72
  operation_id="get-vpn-sessions",
71
73
  oauth2_scopes=[],
@@ -80,31 +82,18 @@ class VpnSessions(BaseSDK):
80
82
 
81
83
  response_data: Any = None
82
84
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
83
- return utils.unmarshal_json(
84
- http_res.text, models.GetVpnSessionsResponseBody
85
- )
85
+ return unmarshal_json_response(models.GetVpnSessionsResponseBody, http_res)
86
86
  if utils.match_response(http_res, "422", "application/vnd.api+json"):
87
- response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
88
- raise models.ErrorObject(data=response_data)
87
+ response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
88
+ raise models.ErrorObject(response_data, http_res)
89
89
  if utils.match_response(http_res, "4XX", "*"):
90
90
  http_res_text = utils.stream_to_text(http_res)
91
- raise models.APIError(
92
- "API error occurred", http_res.status_code, http_res_text, http_res
93
- )
91
+ raise models.APIError("API error occurred", http_res, http_res_text)
94
92
  if utils.match_response(http_res, "5XX", "*"):
95
93
  http_res_text = utils.stream_to_text(http_res)
96
- raise models.APIError(
97
- "API error occurred", http_res.status_code, http_res_text, http_res
98
- )
99
-
100
- content_type = http_res.headers.get("Content-Type")
101
- http_res_text = utils.stream_to_text(http_res)
102
- raise models.APIError(
103
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
104
- http_res.status_code,
105
- http_res_text,
106
- http_res,
107
- )
94
+ raise models.APIError("API error occurred", http_res, http_res_text)
95
+
96
+ raise models.APIError("Unexpected response received", http_res)
108
97
 
109
98
  async def list_async(
110
99
  self,
@@ -163,6 +152,7 @@ class VpnSessions(BaseSDK):
163
152
 
164
153
  http_res = await self.do_request_async(
165
154
  hook_ctx=HookContext(
155
+ config=self.sdk_configuration,
166
156
  base_url=base_url or "",
167
157
  operation_id="get-vpn-sessions",
168
158
  oauth2_scopes=[],
@@ -177,39 +167,28 @@ class VpnSessions(BaseSDK):
177
167
 
178
168
  response_data: Any = None
179
169
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
180
- return utils.unmarshal_json(
181
- http_res.text, models.GetVpnSessionsResponseBody
182
- )
170
+ return unmarshal_json_response(models.GetVpnSessionsResponseBody, http_res)
183
171
  if utils.match_response(http_res, "422", "application/vnd.api+json"):
184
- response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
185
- raise models.ErrorObject(data=response_data)
172
+ response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
173
+ raise models.ErrorObject(response_data, http_res)
186
174
  if utils.match_response(http_res, "4XX", "*"):
187
175
  http_res_text = await utils.stream_to_text_async(http_res)
188
- raise models.APIError(
189
- "API error occurred", http_res.status_code, http_res_text, http_res
190
- )
176
+ raise models.APIError("API error occurred", http_res, http_res_text)
191
177
  if utils.match_response(http_res, "5XX", "*"):
192
178
  http_res_text = await utils.stream_to_text_async(http_res)
193
- raise models.APIError(
194
- "API error occurred", http_res.status_code, http_res_text, http_res
195
- )
196
-
197
- content_type = http_res.headers.get("Content-Type")
198
- http_res_text = await utils.stream_to_text_async(http_res)
199
- raise models.APIError(
200
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
201
- http_res.status_code,
202
- http_res_text,
203
- http_res,
204
- )
179
+ raise models.APIError("API error occurred", http_res, http_res_text)
180
+
181
+ raise models.APIError("Unexpected response received", http_res)
205
182
 
206
183
  def create(
207
184
  self,
208
185
  *,
209
- request: Union[
210
- models.PostVpnSessionVpnSessionsRequestBody,
211
- models.PostVpnSessionVpnSessionsRequestBodyTypedDict,
212
- ] = models.PostVpnSessionVpnSessionsRequestBody(),
186
+ data: Optional[
187
+ Union[
188
+ models.PostVpnSessionVpnSessionsData,
189
+ models.PostVpnSessionVpnSessionsDataTypedDict,
190
+ ]
191
+ ] = None,
213
192
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
214
193
  server_url: Optional[str] = None,
215
194
  timeout_ms: Optional[int] = None,
@@ -221,7 +200,7 @@ class VpnSessions(BaseSDK):
221
200
  `NOTE:` The VPN credentials are only listed ONCE upon creation. They can however be refreshed or deleted.
222
201
 
223
202
 
224
- :param request: The request object to send.
203
+ :param data:
225
204
  :param retries: Override the default retry configuration for this method
226
205
  :param server_url: Override the default server URL for this method
227
206
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -237,11 +216,11 @@ class VpnSessions(BaseSDK):
237
216
  else:
238
217
  base_url = self._get_url(base_url, url_variables)
239
218
 
240
- if not isinstance(request, BaseModel):
241
- request = utils.unmarshal(
242
- request, models.PostVpnSessionVpnSessionsRequestBody
243
- )
244
- request = cast(models.PostVpnSessionVpnSessionsRequestBody, request)
219
+ request = models.PostVpnSessionVpnSessionsRequestBody(
220
+ data=utils.get_pydantic_model(
221
+ data, Optional[models.PostVpnSessionVpnSessionsData]
222
+ ),
223
+ )
245
224
 
246
225
  req = self._build_request(
247
226
  method="POST",
@@ -259,9 +238,9 @@ class VpnSessions(BaseSDK):
259
238
  get_serialized_body=lambda: utils.serialize_request_body(
260
239
  request,
261
240
  False,
262
- True,
241
+ False,
263
242
  "json",
264
- Optional[models.PostVpnSessionVpnSessionsRequestBody],
243
+ models.PostVpnSessionVpnSessionsRequestBody,
265
244
  ),
266
245
  timeout_ms=timeout_ms,
267
246
  )
@@ -276,6 +255,7 @@ class VpnSessions(BaseSDK):
276
255
 
277
256
  http_res = self.do_request(
278
257
  hook_ctx=HookContext(
258
+ config=self.sdk_configuration,
279
259
  base_url=base_url or "",
280
260
  operation_id="post-vpn-session",
281
261
  oauth2_scopes=[],
@@ -290,37 +270,28 @@ class VpnSessions(BaseSDK):
290
270
 
291
271
  response_data: Any = None
292
272
  if utils.match_response(http_res, "201", "application/vnd.api+json"):
293
- return utils.unmarshal_json(http_res.text, models.VpnSessionWithPassword)
273
+ return unmarshal_json_response(models.VpnSessionWithPassword, http_res)
294
274
  if utils.match_response(http_res, "422", "application/vnd.api+json"):
295
- response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
296
- raise models.ErrorObject(data=response_data)
275
+ response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
276
+ raise models.ErrorObject(response_data, http_res)
297
277
  if utils.match_response(http_res, "4XX", "*"):
298
278
  http_res_text = utils.stream_to_text(http_res)
299
- raise models.APIError(
300
- "API error occurred", http_res.status_code, http_res_text, http_res
301
- )
279
+ raise models.APIError("API error occurred", http_res, http_res_text)
302
280
  if utils.match_response(http_res, "5XX", "*"):
303
281
  http_res_text = utils.stream_to_text(http_res)
304
- raise models.APIError(
305
- "API error occurred", http_res.status_code, http_res_text, http_res
306
- )
307
-
308
- content_type = http_res.headers.get("Content-Type")
309
- http_res_text = utils.stream_to_text(http_res)
310
- raise models.APIError(
311
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
312
- http_res.status_code,
313
- http_res_text,
314
- http_res,
315
- )
282
+ raise models.APIError("API error occurred", http_res, http_res_text)
283
+
284
+ raise models.APIError("Unexpected response received", http_res)
316
285
 
317
286
  async def create_async(
318
287
  self,
319
288
  *,
320
- request: Union[
321
- models.PostVpnSessionVpnSessionsRequestBody,
322
- models.PostVpnSessionVpnSessionsRequestBodyTypedDict,
323
- ] = models.PostVpnSessionVpnSessionsRequestBody(),
289
+ data: Optional[
290
+ Union[
291
+ models.PostVpnSessionVpnSessionsData,
292
+ models.PostVpnSessionVpnSessionsDataTypedDict,
293
+ ]
294
+ ] = None,
324
295
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
325
296
  server_url: Optional[str] = None,
326
297
  timeout_ms: Optional[int] = None,
@@ -332,7 +303,7 @@ class VpnSessions(BaseSDK):
332
303
  `NOTE:` The VPN credentials are only listed ONCE upon creation. They can however be refreshed or deleted.
333
304
 
334
305
 
335
- :param request: The request object to send.
306
+ :param data:
336
307
  :param retries: Override the default retry configuration for this method
337
308
  :param server_url: Override the default server URL for this method
338
309
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -348,11 +319,11 @@ class VpnSessions(BaseSDK):
348
319
  else:
349
320
  base_url = self._get_url(base_url, url_variables)
350
321
 
351
- if not isinstance(request, BaseModel):
352
- request = utils.unmarshal(
353
- request, models.PostVpnSessionVpnSessionsRequestBody
354
- )
355
- request = cast(models.PostVpnSessionVpnSessionsRequestBody, request)
322
+ request = models.PostVpnSessionVpnSessionsRequestBody(
323
+ data=utils.get_pydantic_model(
324
+ data, Optional[models.PostVpnSessionVpnSessionsData]
325
+ ),
326
+ )
356
327
 
357
328
  req = self._build_request_async(
358
329
  method="POST",
@@ -370,9 +341,9 @@ class VpnSessions(BaseSDK):
370
341
  get_serialized_body=lambda: utils.serialize_request_body(
371
342
  request,
372
343
  False,
373
- True,
344
+ False,
374
345
  "json",
375
- Optional[models.PostVpnSessionVpnSessionsRequestBody],
346
+ models.PostVpnSessionVpnSessionsRequestBody,
376
347
  ),
377
348
  timeout_ms=timeout_ms,
378
349
  )
@@ -387,6 +358,7 @@ class VpnSessions(BaseSDK):
387
358
 
388
359
  http_res = await self.do_request_async(
389
360
  hook_ctx=HookContext(
361
+ config=self.sdk_configuration,
390
362
  base_url=base_url or "",
391
363
  operation_id="post-vpn-session",
392
364
  oauth2_scopes=[],
@@ -401,29 +373,18 @@ class VpnSessions(BaseSDK):
401
373
 
402
374
  response_data: Any = None
403
375
  if utils.match_response(http_res, "201", "application/vnd.api+json"):
404
- return utils.unmarshal_json(http_res.text, models.VpnSessionWithPassword)
376
+ return unmarshal_json_response(models.VpnSessionWithPassword, http_res)
405
377
  if utils.match_response(http_res, "422", "application/vnd.api+json"):
406
- response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
407
- raise models.ErrorObject(data=response_data)
378
+ response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
379
+ raise models.ErrorObject(response_data, http_res)
408
380
  if utils.match_response(http_res, "4XX", "*"):
409
381
  http_res_text = await utils.stream_to_text_async(http_res)
410
- raise models.APIError(
411
- "API error occurred", http_res.status_code, http_res_text, http_res
412
- )
382
+ raise models.APIError("API error occurred", http_res, http_res_text)
413
383
  if utils.match_response(http_res, "5XX", "*"):
414
384
  http_res_text = await utils.stream_to_text_async(http_res)
415
- raise models.APIError(
416
- "API error occurred", http_res.status_code, http_res_text, http_res
417
- )
418
-
419
- content_type = http_res.headers.get("Content-Type")
420
- http_res_text = await utils.stream_to_text_async(http_res)
421
- raise models.APIError(
422
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
423
- http_res.status_code,
424
- http_res_text,
425
- http_res,
426
- )
385
+ raise models.APIError("API error occurred", http_res, http_res_text)
386
+
387
+ raise models.APIError("Unexpected response received", http_res)
427
388
 
428
389
  def refresh_password(
429
390
  self,
@@ -485,6 +446,7 @@ class VpnSessions(BaseSDK):
485
446
 
486
447
  http_res = self.do_request(
487
448
  hook_ctx=HookContext(
449
+ config=self.sdk_configuration,
488
450
  base_url=base_url or "",
489
451
  operation_id="put-vpn-session",
490
452
  oauth2_scopes=[],
@@ -499,29 +461,18 @@ class VpnSessions(BaseSDK):
499
461
 
500
462
  response_data: Any = None
501
463
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
502
- return utils.unmarshal_json(http_res.text, models.VpnSessionWithPassword)
464
+ return unmarshal_json_response(models.VpnSessionWithPassword, http_res)
503
465
  if utils.match_response(http_res, "404", "application/vnd.api+json"):
504
- response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
505
- raise models.ErrorObject(data=response_data)
466
+ response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
467
+ raise models.ErrorObject(response_data, http_res)
506
468
  if utils.match_response(http_res, "4XX", "*"):
507
469
  http_res_text = utils.stream_to_text(http_res)
508
- raise models.APIError(
509
- "API error occurred", http_res.status_code, http_res_text, http_res
510
- )
470
+ raise models.APIError("API error occurred", http_res, http_res_text)
511
471
  if utils.match_response(http_res, "5XX", "*"):
512
472
  http_res_text = utils.stream_to_text(http_res)
513
- raise models.APIError(
514
- "API error occurred", http_res.status_code, http_res_text, http_res
515
- )
516
-
517
- content_type = http_res.headers.get("Content-Type")
518
- http_res_text = utils.stream_to_text(http_res)
519
- raise models.APIError(
520
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
521
- http_res.status_code,
522
- http_res_text,
523
- http_res,
524
- )
473
+ raise models.APIError("API error occurred", http_res, http_res_text)
474
+
475
+ raise models.APIError("Unexpected response received", http_res)
525
476
 
526
477
  async def refresh_password_async(
527
478
  self,
@@ -583,6 +534,7 @@ class VpnSessions(BaseSDK):
583
534
 
584
535
  http_res = await self.do_request_async(
585
536
  hook_ctx=HookContext(
537
+ config=self.sdk_configuration,
586
538
  base_url=base_url or "",
587
539
  operation_id="put-vpn-session",
588
540
  oauth2_scopes=[],
@@ -597,29 +549,18 @@ class VpnSessions(BaseSDK):
597
549
 
598
550
  response_data: Any = None
599
551
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
600
- return utils.unmarshal_json(http_res.text, models.VpnSessionWithPassword)
552
+ return unmarshal_json_response(models.VpnSessionWithPassword, http_res)
601
553
  if utils.match_response(http_res, "404", "application/vnd.api+json"):
602
- response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
603
- raise models.ErrorObject(data=response_data)
554
+ response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
555
+ raise models.ErrorObject(response_data, http_res)
604
556
  if utils.match_response(http_res, "4XX", "*"):
605
557
  http_res_text = await utils.stream_to_text_async(http_res)
606
- raise models.APIError(
607
- "API error occurred", http_res.status_code, http_res_text, http_res
608
- )
558
+ raise models.APIError("API error occurred", http_res, http_res_text)
609
559
  if utils.match_response(http_res, "5XX", "*"):
610
560
  http_res_text = await utils.stream_to_text_async(http_res)
611
- raise models.APIError(
612
- "API error occurred", http_res.status_code, http_res_text, http_res
613
- )
614
-
615
- content_type = http_res.headers.get("Content-Type")
616
- http_res_text = await utils.stream_to_text_async(http_res)
617
- raise models.APIError(
618
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
619
- http_res.status_code,
620
- http_res_text,
621
- http_res,
622
- )
561
+ raise models.APIError("API error occurred", http_res, http_res_text)
562
+
563
+ raise models.APIError("Unexpected response received", http_res)
623
564
 
624
565
  def delete(
625
566
  self,
@@ -681,6 +622,7 @@ class VpnSessions(BaseSDK):
681
622
 
682
623
  http_res = self.do_request(
683
624
  hook_ctx=HookContext(
625
+ config=self.sdk_configuration,
684
626
  base_url=base_url or "",
685
627
  operation_id="delete-vpn-session",
686
628
  oauth2_scopes=[],
@@ -697,27 +639,16 @@ class VpnSessions(BaseSDK):
697
639
  if utils.match_response(http_res, "204", "*"):
698
640
  return
699
641
  if utils.match_response(http_res, "404", "application/vnd.api+json"):
700
- response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
701
- raise models.ErrorObject(data=response_data)
642
+ response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
643
+ raise models.ErrorObject(response_data, http_res)
702
644
  if utils.match_response(http_res, "4XX", "*"):
703
645
  http_res_text = utils.stream_to_text(http_res)
704
- raise models.APIError(
705
- "API error occurred", http_res.status_code, http_res_text, http_res
706
- )
646
+ raise models.APIError("API error occurred", http_res, http_res_text)
707
647
  if utils.match_response(http_res, "5XX", "*"):
708
648
  http_res_text = utils.stream_to_text(http_res)
709
- raise models.APIError(
710
- "API error occurred", http_res.status_code, http_res_text, http_res
711
- )
712
-
713
- content_type = http_res.headers.get("Content-Type")
714
- http_res_text = utils.stream_to_text(http_res)
715
- raise models.APIError(
716
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
717
- http_res.status_code,
718
- http_res_text,
719
- http_res,
720
- )
649
+ raise models.APIError("API error occurred", http_res, http_res_text)
650
+
651
+ raise models.APIError("Unexpected response received", http_res)
721
652
 
722
653
  async def delete_async(
723
654
  self,
@@ -779,6 +710,7 @@ class VpnSessions(BaseSDK):
779
710
 
780
711
  http_res = await self.do_request_async(
781
712
  hook_ctx=HookContext(
713
+ config=self.sdk_configuration,
782
714
  base_url=base_url or "",
783
715
  operation_id="delete-vpn-session",
784
716
  oauth2_scopes=[],
@@ -795,24 +727,13 @@ class VpnSessions(BaseSDK):
795
727
  if utils.match_response(http_res, "204", "*"):
796
728
  return
797
729
  if utils.match_response(http_res, "404", "application/vnd.api+json"):
798
- response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
799
- raise models.ErrorObject(data=response_data)
730
+ response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
731
+ raise models.ErrorObject(response_data, http_res)
800
732
  if utils.match_response(http_res, "4XX", "*"):
801
733
  http_res_text = await utils.stream_to_text_async(http_res)
802
- raise models.APIError(
803
- "API error occurred", http_res.status_code, http_res_text, http_res
804
- )
734
+ raise models.APIError("API error occurred", http_res, http_res_text)
805
735
  if utils.match_response(http_res, "5XX", "*"):
806
736
  http_res_text = await utils.stream_to_text_async(http_res)
807
- raise models.APIError(
808
- "API error occurred", http_res.status_code, http_res_text, http_res
809
- )
810
-
811
- content_type = http_res.headers.get("Content-Type")
812
- http_res_text = await utils.stream_to_text_async(http_res)
813
- raise models.APIError(
814
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
815
- http_res.status_code,
816
- http_res_text,
817
- http_res,
818
- )
737
+ raise models.APIError("API error occurred", http_res, http_res_text)
738
+
739
+ raise models.APIError("Unexpected response received", http_res)
@@ -1,15 +1,15 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: latitudesh-python-sdk
3
- Version: 1.1.0
3
+ Version: 2.0.1
4
4
  Summary: Python Client SDK Generated by Speakeasy.
5
5
  Author: Speakeasy
6
- Requires-Python: >=3.9
6
+ Requires-Python: >=3.9.2
7
7
  Classifier: Programming Language :: Python :: 3
8
- Classifier: Programming Language :: Python :: 3.9
9
8
  Classifier: Programming Language :: Python :: 3.10
10
9
  Classifier: Programming Language :: Python :: 3.11
11
10
  Classifier: Programming Language :: Python :: 3.12
12
11
  Classifier: Programming Language :: Python :: 3.13
12
+ Requires-Dist: httpcore (>=1.0.9)
13
13
  Requires-Dist: httpx (>=0.28.1)
14
14
  Requires-Dist: jsonpath-python (>=1.0.6)
15
15
  Requires-Dist: pydantic (>=2.11.2)
@@ -353,13 +353,18 @@ with Latitudesh(
353
353
  * [unschedule_deletion](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/serverssdk/README.md#unschedule_deletion) - Unschedule the server deletion
354
354
  * [reinstall](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/serverssdk/README.md#reinstall) - Run Server Reinstall
355
355
 
356
- ### [ssh_keys](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/sshkeys/README.md)
356
+ ### [ssh_keys](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/sshkeyssdk/README.md)
357
357
 
358
- * [list_for_project](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/sshkeys/README.md#list_for_project) - List all Project SSH Keys
359
- * [create](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/sshkeys/README.md#create) - Create a Project SSH Key
360
- * [get](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/sshkeys/README.md#get) - Retrieve a Project SSH Key
361
- * [update](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/sshkeys/README.md#update) - Update a Project SSH Key
362
- * [delete](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/sshkeys/README.md#delete) - Delete a Project SSH Key
358
+ * [~~list_for_project~~](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/sshkeyssdk/README.md#list_for_project) - List all Project SSH Keys :warning: **Deprecated**
359
+ * [~~create~~](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/sshkeyssdk/README.md#create) - Create a Project SSH Key :warning: **Deprecated**
360
+ * [~~get~~](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/sshkeyssdk/README.md#get) - Retrieve a Project SSH Key :warning: **Deprecated**
361
+ * [~~update~~](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/sshkeyssdk/README.md#update) - Update a Project SSH Key :warning: **Deprecated**
362
+ * [~~delete~~](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/sshkeyssdk/README.md#delete) - Delete a Project SSH Key :warning: **Deprecated**
363
+ * [get_ssh_keys](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/sshkeyssdk/README.md#get_ssh_keys) - List all SSH Keys
364
+ * [post_ssh_key](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/sshkeyssdk/README.md#post_ssh_key) - Create a SSH Key
365
+ * [get_ssh_key](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/sshkeyssdk/README.md#get_ssh_key) - Retrieve a SSH Key
366
+ * [put_ssh_key](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/sshkeyssdk/README.md#put_ssh_key) - Update a SSH Key
367
+ * [delete_ssh_key](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/sshkeyssdk/README.md#delete_ssh_key) - Delete a SSH Key
363
368
 
364
369
  ### [storage](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/storage/README.md)
365
370
 
@@ -394,11 +399,16 @@ with Latitudesh(
394
399
 
395
400
  ### [user_data](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/userdatasdk/README.md)
396
401
 
397
- * [list_project_user_data](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/userdatasdk/README.md#list_project_user_data) - List all Project User Data
398
- * [create](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/userdatasdk/README.md#create) - Create a Project User Data
399
- * [get_project_user_data](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/userdatasdk/README.md#get_project_user_data) - Retrieve a Project User Data
400
- * [update](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/userdatasdk/README.md#update) - Update a Project User Data
401
- * [delete](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/userdatasdk/README.md#delete) - Delete a Project User Data
402
+ * [~~list_project_user_data~~](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/userdatasdk/README.md#list_project_user_data) - List all Project User Data :warning: **Deprecated**
403
+ * [~~create~~](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/userdatasdk/README.md#create) - Create a Project User Data :warning: **Deprecated**
404
+ * [~~get_project_user_data~~](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/userdatasdk/README.md#get_project_user_data) - Retrieve a Project User Data :warning: **Deprecated**
405
+ * [~~update~~](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/userdatasdk/README.md#update) - Update a Project User Data :warning: **Deprecated**
406
+ * [~~delete~~](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/userdatasdk/README.md#delete) - Delete a Project User Data :warning: **Deprecated**
407
+ * [get_users_data](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/userdatasdk/README.md#get_users_data) - List all User Data
408
+ * [post_user_data](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/userdatasdk/README.md#post_user_data) - Create an User Data
409
+ * [get_user_data](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/userdatasdk/README.md#get_user_data) - Retrieve an User Data
410
+ * [patch_user_data](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/userdatasdk/README.md#patch_user_data) - Update an User Data
411
+ * [delete_user_data](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/userdatasdk/README.md#delete_user_data) - Delete an User Data
402
412
 
403
413
  ### [user_profile](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/userprofile/README.md)
404
414
 
@@ -440,7 +450,7 @@ with Latitudesh(
440
450
  bearer=os.getenv("LATITUDESH_BEARER", ""),
441
451
  ) as latitudesh:
442
452
 
443
- res = latitudesh.events.list()
453
+ res = latitudesh.events.list(page_size=20, page_number=1)
444
454
 
445
455
  while res is not None:
446
456
  # Handle items
@@ -497,26 +507,18 @@ with Latitudesh(
497
507
  <!-- Start Error Handling [errors] -->
498
508
  ## Error Handling
499
509
 
500
- Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.
510
+ [`LatitudeshError`](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/./src/latitudesh_python_sdk/models/latitudesherror.py) is the base class for all HTTP error responses. It has the following properties:
501
511
 
502
- By default, an API error will raise a models.APIError exception, which has the following properties:
503
-
504
- | Property | Type | Description |
505
- |-----------------|------------------|-----------------------|
506
- | `.status_code` | *int* | The HTTP status code |
507
- | `.message` | *str* | The error message |
508
- | `.raw_response` | *httpx.Response* | The raw HTTP response |
509
- | `.body` | *str* | The response content |
510
-
511
- When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `create_async` method may raise the following exceptions:
512
-
513
- | Error Type | Status Code | Content Type |
514
- | ------------------ | ----------- | ------------------------ |
515
- | models.ErrorObject | 400, 422 | application/vnd.api+json |
516
- | models.APIError | 4XX, 5XX | \*/\* |
512
+ | Property | Type | Description |
513
+ | ------------------ | ---------------- | --------------------------------------------------------------------------------------- |
514
+ | `err.message` | `str` | Error message |
515
+ | `err.status_code` | `int` | HTTP response status code eg `404` |
516
+ | `err.headers` | `httpx.Headers` | HTTP response headers |
517
+ | `err.body` | `str` | HTTP body. Can be empty string if no body is returned. |
518
+ | `err.raw_response` | `httpx.Response` | Raw HTTP response |
519
+ | `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/#error-classes). |
517
520
 
518
521
  ### Example
519
-
520
522
  ```python
521
523
  import latitudesh_python_sdk
522
524
  from latitudesh_python_sdk import Latitudesh, models
@@ -529,23 +531,54 @@ with Latitudesh(
529
531
  res = None
530
532
  try:
531
533
 
532
- res = latitudesh.api_keys.create(request={
533
- "data": {
534
- "type": latitudesh_python_sdk.CreateAPIKeyType.API_KEYS,
535
- "attributes": {},
534
+ res = latitudesh.api_keys.create(data={
535
+ "type": latitudesh_python_sdk.CreateAPIKeyType.API_KEYS,
536
+ "attributes": {
537
+ "name": "App Token",
536
538
  },
537
539
  })
538
540
 
539
541
  # Handle response
540
542
  print(res)
541
543
 
542
- except models.ErrorObject as e:
543
- # handle e.data: models.ErrorObjectData
544
- raise(e)
545
- except models.APIError as e:
546
- # handle exception
547
- raise(e)
544
+
545
+ except models.LatitudeshError as e:
546
+ # The base class for HTTP error responses
547
+ print(e.message)
548
+ print(e.status_code)
549
+ print(e.body)
550
+ print(e.headers)
551
+ print(e.raw_response)
552
+
553
+ # Depending on the method different errors may be thrown
554
+ if isinstance(e, models.ErrorObject):
555
+ print(e.data.errors) # Optional[List[latitudesh_python_sdk.Errors]]
548
556
  ```
557
+
558
+ ### Error Classes
559
+ **Primary error:**
560
+ * [`LatitudeshError`](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/./src/latitudesh_python_sdk/models/latitudesherror.py): The base class for HTTP error responses.
561
+
562
+ <details><summary>Less common errors (9)</summary>
563
+
564
+ <br />
565
+
566
+ **Network errors:**
567
+ * [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors.
568
+ * [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server.
569
+ * [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out.
570
+
571
+
572
+ **Inherit from [`LatitudeshError`](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/./src/latitudesh_python_sdk/models/latitudesherror.py)**:
573
+ * [`ErrorObject`](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/./src/latitudesh_python_sdk/models/errorobject.py): Applicable to 47 of 104 methods.*
574
+ * [`ServerError`](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/./src/latitudesh_python_sdk/models/servererror.py): Applicable to 2 of 104 methods.*
575
+ * [`VirtualNetworkError`](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/./src/latitudesh_python_sdk/models/virtualnetworkerror.py): Success. Status code `403`. Applicable to 1 of 104 methods.*
576
+ * [`DeployConfigError`](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/./src/latitudesh_python_sdk/models/deployconfigerror.py): Success. Status code `422`. Applicable to 1 of 104 methods.*
577
+ * [`ResponseValidationError`](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/./src/latitudesh_python_sdk/models/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.
578
+
579
+ </details>
580
+
581
+ \* Check [the method documentation](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/#available-resources-and-operations) to see if the error is applicable.
549
582
  <!-- End Error Handling [errors] -->
550
583
 
551
584
  <!-- Start Server Selection [server] -->
@@ -595,7 +628,7 @@ import os
595
628
 
596
629
 
597
630
  with Latitudesh(
598
- server_url="https://api.latitude.sh",
631
+ server_url="http://api.latitude.sh",
599
632
  bearer=os.getenv("LATITUDESH_BEARER", ""),
600
633
  ) as latitudesh:
601
634