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 Mapping, Optional, Union
9
10
 
10
11
 
@@ -80,6 +81,7 @@ class Storage(BaseSDK):
80
81
 
81
82
  http_res = self.do_request(
82
83
  hook_ctx=HookContext(
84
+ config=self.sdk_configuration,
83
85
  base_url=base_url or "",
84
86
  operation_id="post-storage-filesystems",
85
87
  oauth2_scopes=[],
@@ -93,28 +95,17 @@ class Storage(BaseSDK):
93
95
  )
94
96
 
95
97
  if utils.match_response(http_res, "201", "application/vnd.api+json"):
96
- return utils.unmarshal_json(
97
- http_res.text, models.PostStorageFilesystemsResponseBody
98
+ return unmarshal_json_response(
99
+ models.PostStorageFilesystemsResponseBody, http_res
98
100
  )
99
101
  if utils.match_response(http_res, ["403", "409", "422", "4XX"], "*"):
100
102
  http_res_text = utils.stream_to_text(http_res)
101
- raise models.APIError(
102
- "API error occurred", http_res.status_code, http_res_text, http_res
103
- )
103
+ raise models.APIError("API error occurred", http_res, http_res_text)
104
104
  if utils.match_response(http_res, "5XX", "*"):
105
105
  http_res_text = utils.stream_to_text(http_res)
106
- raise models.APIError(
107
- "API error occurred", http_res.status_code, http_res_text, http_res
108
- )
106
+ raise models.APIError("API error occurred", http_res, http_res_text)
109
107
 
110
- content_type = http_res.headers.get("Content-Type")
111
- http_res_text = utils.stream_to_text(http_res)
112
- raise models.APIError(
113
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
114
- http_res.status_code,
115
- http_res_text,
116
- http_res,
117
- )
108
+ raise models.APIError("Unexpected response received", http_res)
118
109
 
119
110
  async def create_filesystem_async(
120
111
  self,
@@ -187,6 +178,7 @@ class Storage(BaseSDK):
187
178
 
188
179
  http_res = await self.do_request_async(
189
180
  hook_ctx=HookContext(
181
+ config=self.sdk_configuration,
190
182
  base_url=base_url or "",
191
183
  operation_id="post-storage-filesystems",
192
184
  oauth2_scopes=[],
@@ -200,28 +192,17 @@ class Storage(BaseSDK):
200
192
  )
201
193
 
202
194
  if utils.match_response(http_res, "201", "application/vnd.api+json"):
203
- return utils.unmarshal_json(
204
- http_res.text, models.PostStorageFilesystemsResponseBody
195
+ return unmarshal_json_response(
196
+ models.PostStorageFilesystemsResponseBody, http_res
205
197
  )
206
198
  if utils.match_response(http_res, ["403", "409", "422", "4XX"], "*"):
207
199
  http_res_text = await utils.stream_to_text_async(http_res)
208
- raise models.APIError(
209
- "API error occurred", http_res.status_code, http_res_text, http_res
210
- )
200
+ raise models.APIError("API error occurred", http_res, http_res_text)
211
201
  if utils.match_response(http_res, "5XX", "*"):
212
202
  http_res_text = await utils.stream_to_text_async(http_res)
213
- raise models.APIError(
214
- "API error occurred", http_res.status_code, http_res_text, http_res
215
- )
203
+ raise models.APIError("API error occurred", http_res, http_res_text)
216
204
 
217
- content_type = http_res.headers.get("Content-Type")
218
- http_res_text = await utils.stream_to_text_async(http_res)
219
- raise models.APIError(
220
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
221
- http_res.status_code,
222
- http_res_text,
223
- http_res,
224
- )
205
+ raise models.APIError("Unexpected response received", http_res)
225
206
 
226
207
  def list_filesystems(
227
208
  self,
@@ -282,6 +263,7 @@ class Storage(BaseSDK):
282
263
 
283
264
  http_res = self.do_request(
284
265
  hook_ctx=HookContext(
266
+ config=self.sdk_configuration,
285
267
  base_url=base_url or "",
286
268
  operation_id="get-storage-filesystems",
287
269
  oauth2_scopes=[],
@@ -298,23 +280,12 @@ class Storage(BaseSDK):
298
280
  return
299
281
  if utils.match_response(http_res, "4XX", "*"):
300
282
  http_res_text = utils.stream_to_text(http_res)
301
- raise models.APIError(
302
- "API error occurred", http_res.status_code, http_res_text, http_res
303
- )
283
+ raise models.APIError("API error occurred", http_res, http_res_text)
304
284
  if utils.match_response(http_res, "5XX", "*"):
305
285
  http_res_text = utils.stream_to_text(http_res)
306
- raise models.APIError(
307
- "API error occurred", http_res.status_code, http_res_text, http_res
308
- )
286
+ raise models.APIError("API error occurred", http_res, http_res_text)
309
287
 
310
- content_type = http_res.headers.get("Content-Type")
311
- http_res_text = utils.stream_to_text(http_res)
312
- raise models.APIError(
313
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
314
- http_res.status_code,
315
- http_res_text,
316
- http_res,
317
- )
288
+ raise models.APIError("Unexpected response received", http_res)
318
289
 
319
290
  async def list_filesystems_async(
320
291
  self,
@@ -375,6 +346,7 @@ class Storage(BaseSDK):
375
346
 
376
347
  http_res = await self.do_request_async(
377
348
  hook_ctx=HookContext(
349
+ config=self.sdk_configuration,
378
350
  base_url=base_url or "",
379
351
  operation_id="get-storage-filesystems",
380
352
  oauth2_scopes=[],
@@ -391,23 +363,12 @@ class Storage(BaseSDK):
391
363
  return
392
364
  if utils.match_response(http_res, "4XX", "*"):
393
365
  http_res_text = await utils.stream_to_text_async(http_res)
394
- raise models.APIError(
395
- "API error occurred", http_res.status_code, http_res_text, http_res
396
- )
366
+ raise models.APIError("API error occurred", http_res, http_res_text)
397
367
  if utils.match_response(http_res, "5XX", "*"):
398
368
  http_res_text = await utils.stream_to_text_async(http_res)
399
- raise models.APIError(
400
- "API error occurred", http_res.status_code, http_res_text, http_res
401
- )
369
+ raise models.APIError("API error occurred", http_res, http_res_text)
402
370
 
403
- content_type = http_res.headers.get("Content-Type")
404
- http_res_text = await utils.stream_to_text_async(http_res)
405
- raise models.APIError(
406
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
407
- http_res.status_code,
408
- http_res_text,
409
- http_res,
410
- )
371
+ raise models.APIError("Unexpected response received", http_res)
411
372
 
412
373
  def delete_filesystem(
413
374
  self,
@@ -468,6 +429,7 @@ class Storage(BaseSDK):
468
429
 
469
430
  http_res = self.do_request(
470
431
  hook_ctx=HookContext(
432
+ config=self.sdk_configuration,
471
433
  base_url=base_url or "",
472
434
  operation_id="delete-storage-filesystems",
473
435
  oauth2_scopes=[],
@@ -484,23 +446,12 @@ class Storage(BaseSDK):
484
446
  return
485
447
  if utils.match_response(http_res, ["403", "404", "4XX"], "*"):
486
448
  http_res_text = utils.stream_to_text(http_res)
487
- raise models.APIError(
488
- "API error occurred", http_res.status_code, http_res_text, http_res
489
- )
449
+ raise models.APIError("API error occurred", http_res, http_res_text)
490
450
  if utils.match_response(http_res, "5XX", "*"):
491
451
  http_res_text = utils.stream_to_text(http_res)
492
- raise models.APIError(
493
- "API error occurred", http_res.status_code, http_res_text, http_res
494
- )
452
+ raise models.APIError("API error occurred", http_res, http_res_text)
495
453
 
496
- content_type = http_res.headers.get("Content-Type")
497
- http_res_text = utils.stream_to_text(http_res)
498
- raise models.APIError(
499
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
500
- http_res.status_code,
501
- http_res_text,
502
- http_res,
503
- )
454
+ raise models.APIError("Unexpected response received", http_res)
504
455
 
505
456
  async def delete_filesystem_async(
506
457
  self,
@@ -561,6 +512,7 @@ class Storage(BaseSDK):
561
512
 
562
513
  http_res = await self.do_request_async(
563
514
  hook_ctx=HookContext(
515
+ config=self.sdk_configuration,
564
516
  base_url=base_url or "",
565
517
  operation_id="delete-storage-filesystems",
566
518
  oauth2_scopes=[],
@@ -577,23 +529,12 @@ class Storage(BaseSDK):
577
529
  return
578
530
  if utils.match_response(http_res, ["403", "404", "4XX"], "*"):
579
531
  http_res_text = await utils.stream_to_text_async(http_res)
580
- raise models.APIError(
581
- "API error occurred", http_res.status_code, http_res_text, http_res
582
- )
532
+ raise models.APIError("API error occurred", http_res, http_res_text)
583
533
  if utils.match_response(http_res, "5XX", "*"):
584
534
  http_res_text = await utils.stream_to_text_async(http_res)
585
- raise models.APIError(
586
- "API error occurred", http_res.status_code, http_res_text, http_res
587
- )
535
+ raise models.APIError("API error occurred", http_res, http_res_text)
588
536
 
589
- content_type = http_res.headers.get("Content-Type")
590
- http_res_text = await utils.stream_to_text_async(http_res)
591
- raise models.APIError(
592
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
593
- http_res.status_code,
594
- http_res_text,
595
- http_res,
596
- )
537
+ raise models.APIError("Unexpected response received", http_res)
597
538
 
598
539
  def update_filesystem(
599
540
  self,
@@ -671,6 +612,7 @@ class Storage(BaseSDK):
671
612
 
672
613
  http_res = self.do_request(
673
614
  hook_ctx=HookContext(
615
+ config=self.sdk_configuration,
674
616
  base_url=base_url or "",
675
617
  operation_id="patch-storage-filesystems",
676
618
  oauth2_scopes=[],
@@ -684,28 +626,17 @@ class Storage(BaseSDK):
684
626
  )
685
627
 
686
628
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
687
- return utils.unmarshal_json(
688
- http_res.text, models.PatchStorageFilesystemsResponseBody
629
+ return unmarshal_json_response(
630
+ models.PatchStorageFilesystemsResponseBody, http_res
689
631
  )
690
632
  if utils.match_response(http_res, ["403", "422", "4XX"], "*"):
691
633
  http_res_text = utils.stream_to_text(http_res)
692
- raise models.APIError(
693
- "API error occurred", http_res.status_code, http_res_text, http_res
694
- )
634
+ raise models.APIError("API error occurred", http_res, http_res_text)
695
635
  if utils.match_response(http_res, "5XX", "*"):
696
636
  http_res_text = utils.stream_to_text(http_res)
697
- raise models.APIError(
698
- "API error occurred", http_res.status_code, http_res_text, http_res
699
- )
637
+ raise models.APIError("API error occurred", http_res, http_res_text)
700
638
 
701
- content_type = http_res.headers.get("Content-Type")
702
- http_res_text = utils.stream_to_text(http_res)
703
- raise models.APIError(
704
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
705
- http_res.status_code,
706
- http_res_text,
707
- http_res,
708
- )
639
+ raise models.APIError("Unexpected response received", http_res)
709
640
 
710
641
  async def update_filesystem_async(
711
642
  self,
@@ -783,6 +714,7 @@ class Storage(BaseSDK):
783
714
 
784
715
  http_res = await self.do_request_async(
785
716
  hook_ctx=HookContext(
717
+ config=self.sdk_configuration,
786
718
  base_url=base_url or "",
787
719
  operation_id="patch-storage-filesystems",
788
720
  oauth2_scopes=[],
@@ -796,25 +728,14 @@ class Storage(BaseSDK):
796
728
  )
797
729
 
798
730
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
799
- return utils.unmarshal_json(
800
- http_res.text, models.PatchStorageFilesystemsResponseBody
731
+ return unmarshal_json_response(
732
+ models.PatchStorageFilesystemsResponseBody, http_res
801
733
  )
802
734
  if utils.match_response(http_res, ["403", "422", "4XX"], "*"):
803
735
  http_res_text = await utils.stream_to_text_async(http_res)
804
- raise models.APIError(
805
- "API error occurred", http_res.status_code, http_res_text, http_res
806
- )
736
+ raise models.APIError("API error occurred", http_res, http_res_text)
807
737
  if utils.match_response(http_res, "5XX", "*"):
808
738
  http_res_text = await utils.stream_to_text_async(http_res)
809
- raise models.APIError(
810
- "API error occurred", http_res.status_code, http_res_text, http_res
811
- )
739
+ raise models.APIError("API error occurred", http_res, http_res_text)
812
740
 
813
- content_type = http_res.headers.get("Content-Type")
814
- http_res_text = await utils.stream_to_text_async(http_res)
815
- raise models.APIError(
816
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
817
- http_res.status_code,
818
- http_res_text,
819
- http_res,
820
- )
741
+ raise models.APIError("Unexpected response received", http_res)