latitudesh-python-sdk 2.0.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 (43) hide show
  1. latitudesh_python_sdk/_version.py +3 -3
  2. latitudesh_python_sdk/apikeys.py +51 -138
  3. latitudesh_python_sdk/basesdk.py +4 -4
  4. latitudesh_python_sdk/billing.py +11 -32
  5. latitudesh_python_sdk/events_sdk.py +9 -34
  6. latitudesh_python_sdk/firewalls_sdk.py +89 -264
  7. latitudesh_python_sdk/ipaddresses_sdk.py +25 -68
  8. latitudesh_python_sdk/models/__init__.py +27 -4
  9. latitudesh_python_sdk/models/apierror.py +30 -14
  10. latitudesh_python_sdk/models/deploy_config.py +11 -6
  11. latitudesh_python_sdk/models/error_object.py +11 -6
  12. latitudesh_python_sdk/models/latitudesherror.py +26 -0
  13. latitudesh_python_sdk/models/no_response_error.py +13 -0
  14. latitudesh_python_sdk/models/region_resource_data.py +4 -4
  15. latitudesh_python_sdk/models/responsevalidationerror.py +25 -0
  16. latitudesh_python_sdk/models/server.py +11 -6
  17. latitudesh_python_sdk/models/server_data.py +6 -3
  18. latitudesh_python_sdk/models/server_region_resource_data.py +40 -0
  19. latitudesh_python_sdk/models/update_serverop.py +1 -3
  20. latitudesh_python_sdk/models/virtual_network.py +11 -6
  21. latitudesh_python_sdk/operatingsystems_sdk.py +11 -32
  22. latitudesh_python_sdk/plans.py +57 -188
  23. latitudesh_python_sdk/privatenetworks.py +87 -262
  24. latitudesh_python_sdk/projects_sdk.py +43 -130
  25. latitudesh_python_sdk/regions_sdk.py +21 -66
  26. latitudesh_python_sdk/roles.py +21 -64
  27. latitudesh_python_sdk/servers_sdk.py +207 -604
  28. latitudesh_python_sdk/sshkeys_sdk.py +85 -304
  29. latitudesh_python_sdk/storage.py +33 -120
  30. latitudesh_python_sdk/tags.py +39 -126
  31. latitudesh_python_sdk/teams_sdk.py +35 -100
  32. latitudesh_python_sdk/teamsmembers.py +31 -96
  33. latitudesh_python_sdk/traffic_sdk.py +25 -68
  34. latitudesh_python_sdk/userdata_sdk.py +79 -298
  35. latitudesh_python_sdk/userprofile.py +31 -100
  36. latitudesh_python_sdk/utils/serializers.py +3 -2
  37. latitudesh_python_sdk/utils/unmarshal_json_response.py +24 -0
  38. latitudesh_python_sdk/virtualmachines.py +35 -122
  39. latitudesh_python_sdk/vpnsessions.py +55 -146
  40. {latitudesh_python_sdk-2.0.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/METADATA +47 -24
  41. {latitudesh_python_sdk-2.0.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/RECORD +43 -38
  42. {latitudesh_python_sdk-2.0.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/LICENSE +0 -0
  43. {latitudesh_python_sdk-2.0.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/WHEEL +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
  from typing_extensions import deprecated
10
11
 
@@ -90,26 +91,15 @@ class SSHKeysSDK(BaseSDK):
90
91
  )
91
92
 
92
93
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
93
- return utils.unmarshal_json(http_res.text, models.SSHKeys)
94
+ return unmarshal_json_response(models.SSHKeys, http_res)
94
95
  if utils.match_response(http_res, "4XX", "*"):
95
96
  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
- )
97
+ raise models.APIError("API error occurred", http_res, http_res_text)
99
98
  if utils.match_response(http_res, "5XX", "*"):
100
99
  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
- )
100
+ raise models.APIError("API error occurred", http_res, http_res_text)
104
101
 
105
- content_type = http_res.headers.get("Content-Type")
106
- http_res_text = utils.stream_to_text(http_res)
107
- raise models.APIError(
108
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
109
- http_res.status_code,
110
- http_res_text,
111
- http_res,
112
- )
102
+ raise models.APIError("Unexpected response received", http_res)
113
103
 
114
104
  @deprecated(
115
105
  "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
@@ -191,26 +181,15 @@ class SSHKeysSDK(BaseSDK):
191
181
  )
192
182
 
193
183
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
194
- return utils.unmarshal_json(http_res.text, models.SSHKeys)
184
+ return unmarshal_json_response(models.SSHKeys, http_res)
195
185
  if utils.match_response(http_res, "4XX", "*"):
196
186
  http_res_text = await utils.stream_to_text_async(http_res)
197
- raise models.APIError(
198
- "API error occurred", http_res.status_code, http_res_text, http_res
199
- )
187
+ raise models.APIError("API error occurred", http_res, http_res_text)
200
188
  if utils.match_response(http_res, "5XX", "*"):
201
189
  http_res_text = await utils.stream_to_text_async(http_res)
202
- raise models.APIError(
203
- "API error occurred", http_res.status_code, http_res_text, http_res
204
- )
190
+ raise models.APIError("API error occurred", http_res, http_res_text)
205
191
 
206
- content_type = http_res.headers.get("Content-Type")
207
- http_res_text = await utils.stream_to_text_async(http_res)
208
- raise models.APIError(
209
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
210
- http_res.status_code,
211
- http_res_text,
212
- http_res,
213
- )
192
+ raise models.APIError("Unexpected response received", http_res)
214
193
 
215
194
  @deprecated(
216
195
  "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
@@ -306,28 +285,17 @@ class SSHKeysSDK(BaseSDK):
306
285
  )
307
286
 
308
287
  if utils.match_response(http_res, "201", "application/vnd.api+json"):
309
- return utils.unmarshal_json(
310
- http_res.text, models.PostProjectSSHKeyResponseBody
288
+ return unmarshal_json_response(
289
+ models.PostProjectSSHKeyResponseBody, http_res
311
290
  )
312
291
  if utils.match_response(http_res, ["400", "422", "4XX"], "*"):
313
292
  http_res_text = utils.stream_to_text(http_res)
314
- raise models.APIError(
315
- "API error occurred", http_res.status_code, http_res_text, http_res
316
- )
293
+ raise models.APIError("API error occurred", http_res, http_res_text)
317
294
  if utils.match_response(http_res, "5XX", "*"):
318
295
  http_res_text = utils.stream_to_text(http_res)
319
- raise models.APIError(
320
- "API error occurred", http_res.status_code, http_res_text, http_res
321
- )
296
+ raise models.APIError("API error occurred", http_res, http_res_text)
322
297
 
323
- content_type = http_res.headers.get("Content-Type")
324
- http_res_text = utils.stream_to_text(http_res)
325
- raise models.APIError(
326
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
327
- http_res.status_code,
328
- http_res_text,
329
- http_res,
330
- )
298
+ raise models.APIError("Unexpected response received", http_res)
331
299
 
332
300
  @deprecated(
333
301
  "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
@@ -423,28 +391,17 @@ class SSHKeysSDK(BaseSDK):
423
391
  )
424
392
 
425
393
  if utils.match_response(http_res, "201", "application/vnd.api+json"):
426
- return utils.unmarshal_json(
427
- http_res.text, models.PostProjectSSHKeyResponseBody
394
+ return unmarshal_json_response(
395
+ models.PostProjectSSHKeyResponseBody, http_res
428
396
  )
429
397
  if utils.match_response(http_res, ["400", "422", "4XX"], "*"):
430
398
  http_res_text = await utils.stream_to_text_async(http_res)
431
- raise models.APIError(
432
- "API error occurred", http_res.status_code, http_res_text, http_res
433
- )
399
+ raise models.APIError("API error occurred", http_res, http_res_text)
434
400
  if utils.match_response(http_res, "5XX", "*"):
435
401
  http_res_text = await utils.stream_to_text_async(http_res)
436
- raise models.APIError(
437
- "API error occurred", http_res.status_code, http_res_text, http_res
438
- )
402
+ raise models.APIError("API error occurred", http_res, http_res_text)
439
403
 
440
- content_type = http_res.headers.get("Content-Type")
441
- http_res_text = await utils.stream_to_text_async(http_res)
442
- raise models.APIError(
443
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
444
- http_res.status_code,
445
- http_res_text,
446
- http_res,
447
- )
404
+ raise models.APIError("Unexpected response received", http_res)
448
405
 
449
406
  @deprecated(
450
407
  "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
@@ -526,28 +483,17 @@ class SSHKeysSDK(BaseSDK):
526
483
  )
527
484
 
528
485
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
529
- return utils.unmarshal_json(
530
- http_res.text, models.GetProjectSSHKeyResponseBody
486
+ return unmarshal_json_response(
487
+ models.GetProjectSSHKeyResponseBody, http_res
531
488
  )
532
489
  if utils.match_response(http_res, "4XX", "*"):
533
490
  http_res_text = utils.stream_to_text(http_res)
534
- raise models.APIError(
535
- "API error occurred", http_res.status_code, http_res_text, http_res
536
- )
491
+ raise models.APIError("API error occurred", http_res, http_res_text)
537
492
  if utils.match_response(http_res, "5XX", "*"):
538
493
  http_res_text = utils.stream_to_text(http_res)
539
- raise models.APIError(
540
- "API error occurred", http_res.status_code, http_res_text, http_res
541
- )
494
+ raise models.APIError("API error occurred", http_res, http_res_text)
542
495
 
543
- content_type = http_res.headers.get("Content-Type")
544
- http_res_text = utils.stream_to_text(http_res)
545
- raise models.APIError(
546
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
547
- http_res.status_code,
548
- http_res_text,
549
- http_res,
550
- )
496
+ raise models.APIError("Unexpected response received", http_res)
551
497
 
552
498
  @deprecated(
553
499
  "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
@@ -629,28 +575,17 @@ class SSHKeysSDK(BaseSDK):
629
575
  )
630
576
 
631
577
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
632
- return utils.unmarshal_json(
633
- http_res.text, models.GetProjectSSHKeyResponseBody
578
+ return unmarshal_json_response(
579
+ models.GetProjectSSHKeyResponseBody, http_res
634
580
  )
635
581
  if utils.match_response(http_res, "4XX", "*"):
636
582
  http_res_text = await utils.stream_to_text_async(http_res)
637
- raise models.APIError(
638
- "API error occurred", http_res.status_code, http_res_text, http_res
639
- )
583
+ raise models.APIError("API error occurred", http_res, http_res_text)
640
584
  if utils.match_response(http_res, "5XX", "*"):
641
585
  http_res_text = await utils.stream_to_text_async(http_res)
642
- raise models.APIError(
643
- "API error occurred", http_res.status_code, http_res_text, http_res
644
- )
586
+ raise models.APIError("API error occurred", http_res, http_res_text)
645
587
 
646
- content_type = http_res.headers.get("Content-Type")
647
- http_res_text = await utils.stream_to_text_async(http_res)
648
- raise models.APIError(
649
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
650
- http_res.status_code,
651
- http_res_text,
652
- http_res,
653
- )
588
+ raise models.APIError("Unexpected response received", http_res)
654
589
 
655
590
  @deprecated(
656
591
  "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
@@ -747,28 +682,17 @@ class SSHKeysSDK(BaseSDK):
747
682
  )
748
683
 
749
684
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
750
- return utils.unmarshal_json(
751
- http_res.text, models.PutProjectSSHKeyResponseBody
685
+ return unmarshal_json_response(
686
+ models.PutProjectSSHKeyResponseBody, http_res
752
687
  )
753
688
  if utils.match_response(http_res, ["400", "422", "4XX"], "*"):
754
689
  http_res_text = utils.stream_to_text(http_res)
755
- raise models.APIError(
756
- "API error occurred", http_res.status_code, http_res_text, http_res
757
- )
690
+ raise models.APIError("API error occurred", http_res, http_res_text)
758
691
  if utils.match_response(http_res, "5XX", "*"):
759
692
  http_res_text = utils.stream_to_text(http_res)
760
- raise models.APIError(
761
- "API error occurred", http_res.status_code, http_res_text, http_res
762
- )
693
+ raise models.APIError("API error occurred", http_res, http_res_text)
763
694
 
764
- content_type = http_res.headers.get("Content-Type")
765
- http_res_text = utils.stream_to_text(http_res)
766
- raise models.APIError(
767
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
768
- http_res.status_code,
769
- http_res_text,
770
- http_res,
771
- )
695
+ raise models.APIError("Unexpected response received", http_res)
772
696
 
773
697
  @deprecated(
774
698
  "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
@@ -865,28 +789,17 @@ class SSHKeysSDK(BaseSDK):
865
789
  )
866
790
 
867
791
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
868
- return utils.unmarshal_json(
869
- http_res.text, models.PutProjectSSHKeyResponseBody
792
+ return unmarshal_json_response(
793
+ models.PutProjectSSHKeyResponseBody, http_res
870
794
  )
871
795
  if utils.match_response(http_res, ["400", "422", "4XX"], "*"):
872
796
  http_res_text = await utils.stream_to_text_async(http_res)
873
- raise models.APIError(
874
- "API error occurred", http_res.status_code, http_res_text, http_res
875
- )
797
+ raise models.APIError("API error occurred", http_res, http_res_text)
876
798
  if utils.match_response(http_res, "5XX", "*"):
877
799
  http_res_text = await utils.stream_to_text_async(http_res)
878
- raise models.APIError(
879
- "API error occurred", http_res.status_code, http_res_text, http_res
880
- )
800
+ raise models.APIError("API error occurred", http_res, http_res_text)
881
801
 
882
- content_type = http_res.headers.get("Content-Type")
883
- http_res_text = await utils.stream_to_text_async(http_res)
884
- raise models.APIError(
885
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
886
- http_res.status_code,
887
- http_res_text,
888
- http_res,
889
- )
802
+ raise models.APIError("Unexpected response received", http_res)
890
803
 
891
804
  @deprecated(
892
805
  "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
@@ -971,23 +884,12 @@ class SSHKeysSDK(BaseSDK):
971
884
  return
972
885
  if utils.match_response(http_res, ["404", "4XX"], "*"):
973
886
  http_res_text = utils.stream_to_text(http_res)
974
- raise models.APIError(
975
- "API error occurred", http_res.status_code, http_res_text, http_res
976
- )
887
+ raise models.APIError("API error occurred", http_res, http_res_text)
977
888
  if utils.match_response(http_res, "5XX", "*"):
978
889
  http_res_text = utils.stream_to_text(http_res)
979
- raise models.APIError(
980
- "API error occurred", http_res.status_code, http_res_text, http_res
981
- )
890
+ raise models.APIError("API error occurred", http_res, http_res_text)
982
891
 
983
- content_type = http_res.headers.get("Content-Type")
984
- http_res_text = utils.stream_to_text(http_res)
985
- raise models.APIError(
986
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
987
- http_res.status_code,
988
- http_res_text,
989
- http_res,
990
- )
892
+ raise models.APIError("Unexpected response received", http_res)
991
893
 
992
894
  @deprecated(
993
895
  "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
@@ -1072,23 +974,12 @@ class SSHKeysSDK(BaseSDK):
1072
974
  return
1073
975
  if utils.match_response(http_res, ["404", "4XX"], "*"):
1074
976
  http_res_text = await utils.stream_to_text_async(http_res)
1075
- raise models.APIError(
1076
- "API error occurred", http_res.status_code, http_res_text, http_res
1077
- )
977
+ raise models.APIError("API error occurred", http_res, http_res_text)
1078
978
  if utils.match_response(http_res, "5XX", "*"):
1079
979
  http_res_text = await utils.stream_to_text_async(http_res)
1080
- raise models.APIError(
1081
- "API error occurred", http_res.status_code, http_res_text, http_res
1082
- )
980
+ raise models.APIError("API error occurred", http_res, http_res_text)
1083
981
 
1084
- content_type = http_res.headers.get("Content-Type")
1085
- http_res_text = await utils.stream_to_text_async(http_res)
1086
- raise models.APIError(
1087
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1088
- http_res.status_code,
1089
- http_res_text,
1090
- http_res,
1091
- )
982
+ raise models.APIError("Unexpected response received", http_res)
1092
983
 
1093
984
  def get_ssh_keys(
1094
985
  self,
@@ -1164,26 +1055,15 @@ class SSHKeysSDK(BaseSDK):
1164
1055
  )
1165
1056
 
1166
1057
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
1167
- return utils.unmarshal_json(http_res.text, models.SSHKeys)
1058
+ return unmarshal_json_response(models.SSHKeys, http_res)
1168
1059
  if utils.match_response(http_res, "4XX", "*"):
1169
1060
  http_res_text = utils.stream_to_text(http_res)
1170
- raise models.APIError(
1171
- "API error occurred", http_res.status_code, http_res_text, http_res
1172
- )
1061
+ raise models.APIError("API error occurred", http_res, http_res_text)
1173
1062
  if utils.match_response(http_res, "5XX", "*"):
1174
1063
  http_res_text = utils.stream_to_text(http_res)
1175
- raise models.APIError(
1176
- "API error occurred", http_res.status_code, http_res_text, http_res
1177
- )
1064
+ raise models.APIError("API error occurred", http_res, http_res_text)
1178
1065
 
1179
- content_type = http_res.headers.get("Content-Type")
1180
- http_res_text = utils.stream_to_text(http_res)
1181
- raise models.APIError(
1182
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1183
- http_res.status_code,
1184
- http_res_text,
1185
- http_res,
1186
- )
1066
+ raise models.APIError("Unexpected response received", http_res)
1187
1067
 
1188
1068
  async def get_ssh_keys_async(
1189
1069
  self,
@@ -1259,26 +1139,15 @@ class SSHKeysSDK(BaseSDK):
1259
1139
  )
1260
1140
 
1261
1141
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
1262
- return utils.unmarshal_json(http_res.text, models.SSHKeys)
1142
+ return unmarshal_json_response(models.SSHKeys, http_res)
1263
1143
  if utils.match_response(http_res, "4XX", "*"):
1264
1144
  http_res_text = await utils.stream_to_text_async(http_res)
1265
- raise models.APIError(
1266
- "API error occurred", http_res.status_code, http_res_text, http_res
1267
- )
1145
+ raise models.APIError("API error occurred", http_res, http_res_text)
1268
1146
  if utils.match_response(http_res, "5XX", "*"):
1269
1147
  http_res_text = await utils.stream_to_text_async(http_res)
1270
- raise models.APIError(
1271
- "API error occurred", http_res.status_code, http_res_text, http_res
1272
- )
1148
+ raise models.APIError("API error occurred", http_res, http_res_text)
1273
1149
 
1274
- content_type = http_res.headers.get("Content-Type")
1275
- http_res_text = await utils.stream_to_text_async(http_res)
1276
- raise models.APIError(
1277
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1278
- http_res.status_code,
1279
- http_res_text,
1280
- http_res,
1281
- )
1150
+ raise models.APIError("Unexpected response received", http_res)
1282
1151
 
1283
1152
  def post_ssh_key(
1284
1153
  self,
@@ -1293,7 +1162,7 @@ class SSHKeysSDK(BaseSDK):
1293
1162
  ) -> models.PostSSHKeyResponseBody:
1294
1163
  r"""Create a SSH Key
1295
1164
 
1296
- Allow you create SSH Keys in a project. These keys can be used to access servers after deploy and reinstall actions.
1165
+ Allow you create SSH Keys. These keys can be used to access servers after deploy and reinstall actions.
1297
1166
 
1298
1167
 
1299
1168
  :param data:
@@ -1359,26 +1228,15 @@ class SSHKeysSDK(BaseSDK):
1359
1228
  )
1360
1229
 
1361
1230
  if utils.match_response(http_res, "201", "application/vnd.api+json"):
1362
- return utils.unmarshal_json(http_res.text, models.PostSSHKeyResponseBody)
1231
+ return unmarshal_json_response(models.PostSSHKeyResponseBody, http_res)
1363
1232
  if utils.match_response(http_res, ["400", "422", "4XX"], "*"):
1364
1233
  http_res_text = utils.stream_to_text(http_res)
1365
- raise models.APIError(
1366
- "API error occurred", http_res.status_code, http_res_text, http_res
1367
- )
1234
+ raise models.APIError("API error occurred", http_res, http_res_text)
1368
1235
  if utils.match_response(http_res, "5XX", "*"):
1369
1236
  http_res_text = utils.stream_to_text(http_res)
1370
- raise models.APIError(
1371
- "API error occurred", http_res.status_code, http_res_text, http_res
1372
- )
1237
+ raise models.APIError("API error occurred", http_res, http_res_text)
1373
1238
 
1374
- content_type = http_res.headers.get("Content-Type")
1375
- http_res_text = utils.stream_to_text(http_res)
1376
- raise models.APIError(
1377
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1378
- http_res.status_code,
1379
- http_res_text,
1380
- http_res,
1381
- )
1239
+ raise models.APIError("Unexpected response received", http_res)
1382
1240
 
1383
1241
  async def post_ssh_key_async(
1384
1242
  self,
@@ -1393,7 +1251,7 @@ class SSHKeysSDK(BaseSDK):
1393
1251
  ) -> models.PostSSHKeyResponseBody:
1394
1252
  r"""Create a SSH Key
1395
1253
 
1396
- Allow you create SSH Keys in a project. These keys can be used to access servers after deploy and reinstall actions.
1254
+ Allow you create SSH Keys. These keys can be used to access servers after deploy and reinstall actions.
1397
1255
 
1398
1256
 
1399
1257
  :param data:
@@ -1459,26 +1317,15 @@ class SSHKeysSDK(BaseSDK):
1459
1317
  )
1460
1318
 
1461
1319
  if utils.match_response(http_res, "201", "application/vnd.api+json"):
1462
- return utils.unmarshal_json(http_res.text, models.PostSSHKeyResponseBody)
1320
+ return unmarshal_json_response(models.PostSSHKeyResponseBody, http_res)
1463
1321
  if utils.match_response(http_res, ["400", "422", "4XX"], "*"):
1464
1322
  http_res_text = await utils.stream_to_text_async(http_res)
1465
- raise models.APIError(
1466
- "API error occurred", http_res.status_code, http_res_text, http_res
1467
- )
1323
+ raise models.APIError("API error occurred", http_res, http_res_text)
1468
1324
  if utils.match_response(http_res, "5XX", "*"):
1469
1325
  http_res_text = await utils.stream_to_text_async(http_res)
1470
- raise models.APIError(
1471
- "API error occurred", http_res.status_code, http_res_text, http_res
1472
- )
1326
+ raise models.APIError("API error occurred", http_res, http_res_text)
1473
1327
 
1474
- content_type = http_res.headers.get("Content-Type")
1475
- http_res_text = await utils.stream_to_text_async(http_res)
1476
- raise models.APIError(
1477
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1478
- http_res.status_code,
1479
- http_res_text,
1480
- http_res,
1481
- )
1328
+ raise models.APIError("Unexpected response received", http_res)
1482
1329
 
1483
1330
  def get_ssh_key(
1484
1331
  self,
@@ -1554,26 +1401,15 @@ class SSHKeysSDK(BaseSDK):
1554
1401
  )
1555
1402
 
1556
1403
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
1557
- return utils.unmarshal_json(http_res.text, models.GetSSHKeyResponseBody)
1404
+ return unmarshal_json_response(models.GetSSHKeyResponseBody, http_res)
1558
1405
  if utils.match_response(http_res, "4XX", "*"):
1559
1406
  http_res_text = utils.stream_to_text(http_res)
1560
- raise models.APIError(
1561
- "API error occurred", http_res.status_code, http_res_text, http_res
1562
- )
1407
+ raise models.APIError("API error occurred", http_res, http_res_text)
1563
1408
  if utils.match_response(http_res, "5XX", "*"):
1564
1409
  http_res_text = utils.stream_to_text(http_res)
1565
- raise models.APIError(
1566
- "API error occurred", http_res.status_code, http_res_text, http_res
1567
- )
1410
+ raise models.APIError("API error occurred", http_res, http_res_text)
1568
1411
 
1569
- content_type = http_res.headers.get("Content-Type")
1570
- http_res_text = utils.stream_to_text(http_res)
1571
- raise models.APIError(
1572
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1573
- http_res.status_code,
1574
- http_res_text,
1575
- http_res,
1576
- )
1412
+ raise models.APIError("Unexpected response received", http_res)
1577
1413
 
1578
1414
  async def get_ssh_key_async(
1579
1415
  self,
@@ -1649,26 +1485,15 @@ class SSHKeysSDK(BaseSDK):
1649
1485
  )
1650
1486
 
1651
1487
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
1652
- return utils.unmarshal_json(http_res.text, models.GetSSHKeyResponseBody)
1488
+ return unmarshal_json_response(models.GetSSHKeyResponseBody, http_res)
1653
1489
  if utils.match_response(http_res, "4XX", "*"):
1654
1490
  http_res_text = await utils.stream_to_text_async(http_res)
1655
- raise models.APIError(
1656
- "API error occurred", http_res.status_code, http_res_text, http_res
1657
- )
1491
+ raise models.APIError("API error occurred", http_res, http_res_text)
1658
1492
  if utils.match_response(http_res, "5XX", "*"):
1659
1493
  http_res_text = await utils.stream_to_text_async(http_res)
1660
- raise models.APIError(
1661
- "API error occurred", http_res.status_code, http_res_text, http_res
1662
- )
1494
+ raise models.APIError("API error occurred", http_res, http_res_text)
1663
1495
 
1664
- content_type = http_res.headers.get("Content-Type")
1665
- http_res_text = await utils.stream_to_text_async(http_res)
1666
- raise models.APIError(
1667
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1668
- http_res.status_code,
1669
- http_res_text,
1670
- http_res,
1671
- )
1496
+ raise models.APIError("Unexpected response received", http_res)
1672
1497
 
1673
1498
  def put_ssh_key(
1674
1499
  self,
@@ -1756,26 +1581,15 @@ class SSHKeysSDK(BaseSDK):
1756
1581
  )
1757
1582
 
1758
1583
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
1759
- return utils.unmarshal_json(http_res.text, models.PutSSHKeyResponseBody)
1584
+ return unmarshal_json_response(models.PutSSHKeyResponseBody, http_res)
1760
1585
  if utils.match_response(http_res, ["400", "422", "4XX"], "*"):
1761
1586
  http_res_text = utils.stream_to_text(http_res)
1762
- raise models.APIError(
1763
- "API error occurred", http_res.status_code, http_res_text, http_res
1764
- )
1587
+ raise models.APIError("API error occurred", http_res, http_res_text)
1765
1588
  if utils.match_response(http_res, "5XX", "*"):
1766
1589
  http_res_text = utils.stream_to_text(http_res)
1767
- raise models.APIError(
1768
- "API error occurred", http_res.status_code, http_res_text, http_res
1769
- )
1590
+ raise models.APIError("API error occurred", http_res, http_res_text)
1770
1591
 
1771
- content_type = http_res.headers.get("Content-Type")
1772
- http_res_text = utils.stream_to_text(http_res)
1773
- raise models.APIError(
1774
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1775
- http_res.status_code,
1776
- http_res_text,
1777
- http_res,
1778
- )
1592
+ raise models.APIError("Unexpected response received", http_res)
1779
1593
 
1780
1594
  async def put_ssh_key_async(
1781
1595
  self,
@@ -1863,26 +1677,15 @@ class SSHKeysSDK(BaseSDK):
1863
1677
  )
1864
1678
 
1865
1679
  if utils.match_response(http_res, "200", "application/vnd.api+json"):
1866
- return utils.unmarshal_json(http_res.text, models.PutSSHKeyResponseBody)
1680
+ return unmarshal_json_response(models.PutSSHKeyResponseBody, http_res)
1867
1681
  if utils.match_response(http_res, ["400", "422", "4XX"], "*"):
1868
1682
  http_res_text = await utils.stream_to_text_async(http_res)
1869
- raise models.APIError(
1870
- "API error occurred", http_res.status_code, http_res_text, http_res
1871
- )
1683
+ raise models.APIError("API error occurred", http_res, http_res_text)
1872
1684
  if utils.match_response(http_res, "5XX", "*"):
1873
1685
  http_res_text = await utils.stream_to_text_async(http_res)
1874
- raise models.APIError(
1875
- "API error occurred", http_res.status_code, http_res_text, http_res
1876
- )
1686
+ raise models.APIError("API error occurred", http_res, http_res_text)
1877
1687
 
1878
- content_type = http_res.headers.get("Content-Type")
1879
- http_res_text = await utils.stream_to_text_async(http_res)
1880
- raise models.APIError(
1881
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1882
- http_res.status_code,
1883
- http_res_text,
1884
- http_res,
1885
- )
1688
+ raise models.APIError("Unexpected response received", http_res)
1886
1689
 
1887
1690
  def delete_ssh_key(
1888
1691
  self,
@@ -1961,23 +1764,12 @@ class SSHKeysSDK(BaseSDK):
1961
1764
  return
1962
1765
  if utils.match_response(http_res, ["404", "4XX"], "*"):
1963
1766
  http_res_text = utils.stream_to_text(http_res)
1964
- raise models.APIError(
1965
- "API error occurred", http_res.status_code, http_res_text, http_res
1966
- )
1767
+ raise models.APIError("API error occurred", http_res, http_res_text)
1967
1768
  if utils.match_response(http_res, "5XX", "*"):
1968
1769
  http_res_text = utils.stream_to_text(http_res)
1969
- raise models.APIError(
1970
- "API error occurred", http_res.status_code, http_res_text, http_res
1971
- )
1770
+ raise models.APIError("API error occurred", http_res, http_res_text)
1972
1771
 
1973
- content_type = http_res.headers.get("Content-Type")
1974
- http_res_text = utils.stream_to_text(http_res)
1975
- raise models.APIError(
1976
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1977
- http_res.status_code,
1978
- http_res_text,
1979
- http_res,
1980
- )
1772
+ raise models.APIError("Unexpected response received", http_res)
1981
1773
 
1982
1774
  async def delete_ssh_key_async(
1983
1775
  self,
@@ -2056,20 +1848,9 @@ class SSHKeysSDK(BaseSDK):
2056
1848
  return
2057
1849
  if utils.match_response(http_res, ["404", "4XX"], "*"):
2058
1850
  http_res_text = await utils.stream_to_text_async(http_res)
2059
- raise models.APIError(
2060
- "API error occurred", http_res.status_code, http_res_text, http_res
2061
- )
1851
+ raise models.APIError("API error occurred", http_res, http_res_text)
2062
1852
  if utils.match_response(http_res, "5XX", "*"):
2063
1853
  http_res_text = await utils.stream_to_text_async(http_res)
2064
- raise models.APIError(
2065
- "API error occurred", http_res.status_code, http_res_text, http_res
2066
- )
1854
+ raise models.APIError("API error occurred", http_res, http_res_text)
2067
1855
 
2068
- content_type = http_res.headers.get("Content-Type")
2069
- http_res_text = await utils.stream_to_text_async(http_res)
2070
- raise models.APIError(
2071
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
2072
- http_res.status_code,
2073
- http_res_text,
2074
- http_res,
2075
- )
1856
+ raise models.APIError("Unexpected response received", http_res)