ha-sdk-python 1.0.10__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.
Files changed (237) hide show
  1. ha_sdk_python/__init__.py +490 -0
  2. ha_sdk_python/api/__init__.py +15 -0
  3. ha_sdk_python/api/backups_api.py +2434 -0
  4. ha_sdk_python/api/console_access_api.py +334 -0
  5. ha_sdk_python/api/dns_api.py +896 -0
  6. ha_sdk_python/api/firewall_api.py +1534 -0
  7. ha_sdk_python/api/monitoring_api.py +1234 -0
  8. ha_sdk_python/api/power_management_api.py +2434 -0
  9. ha_sdk_python/api/security_api.py +1243 -0
  10. ha_sdk_python/api/service_management_api.py +1797 -0
  11. ha_sdk_python/api/snapshots_api.py +1534 -0
  12. ha_sdk_python/api/user_management_api.py +331 -0
  13. ha_sdk_python/api/vps_management_api.py +2399 -0
  14. ha_sdk_python/api_client.py +805 -0
  15. ha_sdk_python/api_response.py +21 -0
  16. ha_sdk_python/configuration.py +593 -0
  17. ha_sdk_python/exceptions.py +218 -0
  18. ha_sdk_python/models/__init__.py +227 -0
  19. ha_sdk_python/models/backup_create_response_data.py +97 -0
  20. ha_sdk_python/models/backup_creation_info.py +95 -0
  21. ha_sdk_python/models/backup_item.py +95 -0
  22. ha_sdk_python/models/backup_mode.py +89 -0
  23. ha_sdk_python/models/backup_mode_type.py +38 -0
  24. ha_sdk_python/models/backup_schedule.py +98 -0
  25. ha_sdk_python/models/backup_schedule_list_response_data.py +97 -0
  26. ha_sdk_python/models/bad_request_error_response_content.py +89 -0
  27. ha_sdk_python/models/billing_cycle.py +37 -0
  28. ha_sdk_python/models/cancel_vps_request_content.py +90 -0
  29. ha_sdk_python/models/cancel_vps_response_content.py +94 -0
  30. ha_sdk_python/models/catalogue_config_option.py +105 -0
  31. ha_sdk_python/models/catalogue_config_suboption.py +96 -0
  32. ha_sdk_python/models/catalogue_currency.py +91 -0
  33. ha_sdk_python/models/catalogue_data.py +107 -0
  34. ha_sdk_python/models/catalogue_group.py +99 -0
  35. ha_sdk_python/models/catalogue_plan.py +108 -0
  36. ha_sdk_python/models/catalogue_product.py +131 -0
  37. ha_sdk_python/models/change_password_request_content.py +90 -0
  38. ha_sdk_python/models/change_password_response_content.py +94 -0
  39. ha_sdk_python/models/compression_method.py +89 -0
  40. ha_sdk_python/models/compression_type.py +39 -0
  41. ha_sdk_python/models/create_backup_request_content.py +93 -0
  42. ha_sdk_python/models/create_backup_response_content.py +94 -0
  43. ha_sdk_python/models/create_backup_schedule_request_content.py +108 -0
  44. ha_sdk_python/models/create_backup_schedule_response_content.py +94 -0
  45. ha_sdk_python/models/create_firewall_rule_request_content.py +115 -0
  46. ha_sdk_python/models/create_firewall_rule_response_content.py +94 -0
  47. ha_sdk_python/models/create_notification_request_content.py +111 -0
  48. ha_sdk_python/models/create_notification_response_content.py +94 -0
  49. ha_sdk_python/models/create_order_domain_item.py +101 -0
  50. ha_sdk_python/models/create_order_items.py +105 -0
  51. ha_sdk_python/models/create_order_product.py +108 -0
  52. ha_sdk_python/models/create_order_product_item.py +101 -0
  53. ha_sdk_python/models/create_order_request_content.py +97 -0
  54. ha_sdk_python/models/create_order_response_content.py +94 -0
  55. ha_sdk_python/models/create_order_response_data.py +126 -0
  56. ha_sdk_python/models/create_order_total.py +91 -0
  57. ha_sdk_python/models/create_power_task_request_content.py +160 -0
  58. ha_sdk_python/models/create_power_task_response_content.py +94 -0
  59. ha_sdk_python/models/create_rdns_record_request_content.py +96 -0
  60. ha_sdk_python/models/create_rdns_record_response_content.py +94 -0
  61. ha_sdk_python/models/create_rdns_record_response_data.py +91 -0
  62. ha_sdk_python/models/create_snapshot_request_content.py +91 -0
  63. ha_sdk_python/models/create_snapshot_response_content.py +94 -0
  64. ha_sdk_python/models/day_of_week.py +42 -0
  65. ha_sdk_python/models/delete_backup_request_content.py +89 -0
  66. ha_sdk_python/models/delete_backup_response_content.py +94 -0
  67. ha_sdk_python/models/delete_backup_schedule_request_content.py +89 -0
  68. ha_sdk_python/models/delete_backup_schedule_response_content.py +94 -0
  69. ha_sdk_python/models/delete_firewall_rule_request_content.py +89 -0
  70. ha_sdk_python/models/delete_firewall_rule_response_content.py +94 -0
  71. ha_sdk_python/models/delete_notification_request_content.py +89 -0
  72. ha_sdk_python/models/delete_notification_response_content.py +94 -0
  73. ha_sdk_python/models/delete_power_task_request_content.py +89 -0
  74. ha_sdk_python/models/delete_power_task_response_content.py +94 -0
  75. ha_sdk_python/models/delete_rdns_record_request_content.py +88 -0
  76. ha_sdk_python/models/delete_rdns_record_response_content.py +94 -0
  77. ha_sdk_python/models/delete_snapshot_request_content.py +89 -0
  78. ha_sdk_python/models/delete_snapshot_response_content.py +94 -0
  79. ha_sdk_python/models/edit_backup_schedule_request_content.py +110 -0
  80. ha_sdk_python/models/edit_backup_schedule_response_content.py +94 -0
  81. ha_sdk_python/models/firewall_list_response_data.py +125 -0
  82. ha_sdk_python/models/firewall_move_direction.py +39 -0
  83. ha_sdk_python/models/firewall_move_response_data.py +91 -0
  84. ha_sdk_python/models/firewall_option.py +89 -0
  85. ha_sdk_python/models/firewall_rule.py +113 -0
  86. ha_sdk_python/models/firewall_rule_action.py +38 -0
  87. ha_sdk_python/models/firewall_rule_type.py +38 -0
  88. ha_sdk_python/models/forbidden_error_response_content.py +89 -0
  89. ha_sdk_python/models/get_catalogue_request_content.py +89 -0
  90. ha_sdk_python/models/get_catalogue_response_content.py +94 -0
  91. ha_sdk_python/models/get_no_vnc_console_request_content.py +87 -0
  92. ha_sdk_python/models/get_no_vnc_console_response_content.py +94 -0
  93. ha_sdk_python/models/get_private_ssh_key_request_content.py +87 -0
  94. ha_sdk_python/models/get_private_ssh_key_response_content.py +94 -0
  95. ha_sdk_python/models/get_public_ssh_key_request_content.py +87 -0
  96. ha_sdk_python/models/get_public_ssh_key_response_content.py +94 -0
  97. ha_sdk_python/models/get_vps_config_request_content.py +87 -0
  98. ha_sdk_python/models/get_vps_config_response_content.py +94 -0
  99. ha_sdk_python/models/get_vps_details_request_content.py +87 -0
  100. ha_sdk_python/models/get_vps_details_response_content.py +94 -0
  101. ha_sdk_python/models/internal_service_error_response_content.py +89 -0
  102. ha_sdk_python/models/invalid_state_error_response_content.py +89 -0
  103. ha_sdk_python/models/list_backup_schedules_request_content.py +87 -0
  104. ha_sdk_python/models/list_backup_schedules_response_content.py +94 -0
  105. ha_sdk_python/models/list_backups_request_content.py +87 -0
  106. ha_sdk_python/models/list_backups_response_content.py +94 -0
  107. ha_sdk_python/models/list_firewall_rules_request_content.py +87 -0
  108. ha_sdk_python/models/list_firewall_rules_response_content.py +94 -0
  109. ha_sdk_python/models/list_isos_request_content.py +87 -0
  110. ha_sdk_python/models/list_isos_response_content.py +94 -0
  111. ha_sdk_python/models/list_isos_response_data.py +89 -0
  112. ha_sdk_python/models/list_notifications_request_content.py +87 -0
  113. ha_sdk_python/models/list_notifications_response_content.py +94 -0
  114. ha_sdk_python/models/list_orders_response_content.py +94 -0
  115. ha_sdk_python/models/list_orders_response_data.py +95 -0
  116. ha_sdk_python/models/list_power_tasks_request_content.py +87 -0
  117. ha_sdk_python/models/list_power_tasks_response_content.py +94 -0
  118. ha_sdk_python/models/list_rdns_records_response_content.py +94 -0
  119. ha_sdk_python/models/list_rdns_response_data.py +115 -0
  120. ha_sdk_python/models/list_reinstall_os_request_content.py +87 -0
  121. ha_sdk_python/models/list_reinstall_os_response_content.py +94 -0
  122. ha_sdk_python/models/list_reinstall_os_response_data.py +89 -0
  123. ha_sdk_python/models/list_snapshots_request_content.py +87 -0
  124. ha_sdk_python/models/list_snapshots_response_content.py +94 -0
  125. ha_sdk_python/models/list_vps_services_data.py +95 -0
  126. ha_sdk_python/models/list_vps_services_response_content.py +94 -0
  127. ha_sdk_python/models/mount_iso_request_content.py +91 -0
  128. ha_sdk_python/models/mount_iso_response_content.py +94 -0
  129. ha_sdk_python/models/move_firewall_rule_request_content.py +94 -0
  130. ha_sdk_python/models/move_firewall_rule_response_content.py +94 -0
  131. ha_sdk_python/models/no_vnc_console_details.py +95 -0
  132. ha_sdk_python/models/no_vnc_console_response_data.py +93 -0
  133. ha_sdk_python/models/notification.py +105 -0
  134. ha_sdk_python/models/notification_create_response_data.py +93 -0
  135. ha_sdk_python/models/notification_dialog_rules.py +95 -0
  136. ha_sdk_python/models/notification_list_response_data.py +103 -0
  137. ha_sdk_python/models/notification_status.py +43 -0
  138. ha_sdk_python/models/operation_status.py +37 -0
  139. ha_sdk_python/models/order.py +109 -0
  140. ha_sdk_python/models/order_last_attempt.py +93 -0
  141. ha_sdk_python/models/order_warning.py +89 -0
  142. ha_sdk_python/models/payment_error.py +89 -0
  143. ha_sdk_python/models/payment_status.py +38 -0
  144. ha_sdk_python/models/power_task.py +105 -0
  145. ha_sdk_python/models/power_task_action.py +38 -0
  146. ha_sdk_python/models/power_task_create_response_data.py +93 -0
  147. ha_sdk_python/models/power_task_dialog_rules.py +95 -0
  148. ha_sdk_python/models/power_task_job_type.py +38 -0
  149. ha_sdk_python/models/power_task_list_response_data.py +107 -0
  150. ha_sdk_python/models/public_ssh_key_response_data.py +93 -0
  151. ha_sdk_python/models/rdns_available_item.py +111 -0
  152. ha_sdk_python/models/rdns_pool.py +89 -0
  153. ha_sdk_python/models/rdns_record.py +109 -0
  154. ha_sdk_python/models/reboot_vps_request_content.py +87 -0
  155. ha_sdk_python/models/reboot_vps_response_content.py +94 -0
  156. ha_sdk_python/models/resource_not_found_error_response_content.py +89 -0
  157. ha_sdk_python/models/restore_backup_request_content.py +89 -0
  158. ha_sdk_python/models/restore_backup_response_content.py +94 -0
  159. ha_sdk_python/models/retry_payment_request_content.py +89 -0
  160. ha_sdk_python/models/retry_payment_response_content.py +94 -0
  161. ha_sdk_python/models/retry_payment_response_data.py +98 -0
  162. ha_sdk_python/models/retry_payment_total.py +91 -0
  163. ha_sdk_python/models/rollback_snapshot_request_content.py +89 -0
  164. ha_sdk_python/models/rollback_snapshot_response_content.py +94 -0
  165. ha_sdk_python/models/service_backups_response_data.py +131 -0
  166. ha_sdk_python/models/service_snapshots_response_data.py +101 -0
  167. ha_sdk_python/models/service_unavailable_error_response_content.py +89 -0
  168. ha_sdk_python/models/shutdown_vps_request_content.py +87 -0
  169. ha_sdk_python/models/shutdown_vps_response_content.py +94 -0
  170. ha_sdk_python/models/snapshot_create_response_data.py +89 -0
  171. ha_sdk_python/models/snapshot_item.py +95 -0
  172. ha_sdk_python/models/ssh_key_details.py +89 -0
  173. ha_sdk_python/models/start_vps_request_content.py +87 -0
  174. ha_sdk_python/models/start_vps_response_content.py +94 -0
  175. ha_sdk_python/models/stop_vps_request_content.py +87 -0
  176. ha_sdk_python/models/stop_vps_response_content.py +94 -0
  177. ha_sdk_python/models/too_many_requests_error_response_content.py +89 -0
  178. ha_sdk_python/models/trigger_reinstall_request_content.py +89 -0
  179. ha_sdk_python/models/trigger_reinstall_response_content.py +94 -0
  180. ha_sdk_python/models/trigger_reinstall_response_data.py +89 -0
  181. ha_sdk_python/models/unauthorized_error_response_content.py +89 -0
  182. ha_sdk_python/models/update_firewall_rule_request_content.py +94 -0
  183. ha_sdk_python/models/update_firewall_rule_response_content.py +94 -0
  184. ha_sdk_python/models/update_notification_request_content.py +113 -0
  185. ha_sdk_python/models/update_notification_response_content.py +94 -0
  186. ha_sdk_python/models/update_power_task_request_content.py +164 -0
  187. ha_sdk_python/models/update_power_task_response_content.py +94 -0
  188. ha_sdk_python/models/update_snapshot_request_content.py +91 -0
  189. ha_sdk_python/models/update_snapshot_response_content.py +94 -0
  190. ha_sdk_python/models/update_ssh_keys_request_content.py +97 -0
  191. ha_sdk_python/models/update_ssh_keys_response_content.py +94 -0
  192. ha_sdk_python/models/update_vps_config_request_content.py +99 -0
  193. ha_sdk_python/models/update_vps_config_response_content.py +94 -0
  194. ha_sdk_python/models/user_change_password_details.py +91 -0
  195. ha_sdk_python/models/user_change_password_request_content.py +92 -0
  196. ha_sdk_python/models/user_change_password_response_content.py +94 -0
  197. ha_sdk_python/models/user_change_password_response_data.py +95 -0
  198. ha_sdk_python/models/validate_pricing_base.py +89 -0
  199. ha_sdk_python/models/validate_pricing_breakdown.py +103 -0
  200. ha_sdk_python/models/validate_pricing_config_item.py +116 -0
  201. ha_sdk_python/models/validate_pricing_currency.py +93 -0
  202. ha_sdk_python/models/validate_pricing_discount.py +97 -0
  203. ha_sdk_python/models/validate_pricing_plan_config.py +97 -0
  204. ha_sdk_python/models/validate_pricing_plan_pricing.py +89 -0
  205. ha_sdk_python/models/validate_pricing_price_range.py +91 -0
  206. ha_sdk_python/models/validate_pricing_product.py +101 -0
  207. ha_sdk_python/models/validate_pricing_product_result.py +121 -0
  208. ha_sdk_python/models/validate_pricing_prorata.py +95 -0
  209. ha_sdk_python/models/validate_pricing_request_content.py +97 -0
  210. ha_sdk_python/models/validate_pricing_response_content.py +94 -0
  211. ha_sdk_python/models/validate_pricing_response_data.py +109 -0
  212. ha_sdk_python/models/validate_pricing_summary.py +101 -0
  213. ha_sdk_python/models/validate_pricing_summary_recurring.py +91 -0
  214. ha_sdk_python/models/validation_error_response_content.py +89 -0
  215. ha_sdk_python/models/vps_available_features.py +115 -0
  216. ha_sdk_python/models/vps_bandwidth_info.py +94 -0
  217. ha_sdk_python/models/vps_cancel_response_data.py +93 -0
  218. ha_sdk_python/models/vps_cancel_type.py +37 -0
  219. ha_sdk_python/models/vps_config_response_data.py +108 -0
  220. ha_sdk_python/models/vps_cpu_info.py +92 -0
  221. ha_sdk_python/models/vps_credentials.py +89 -0
  222. ha_sdk_python/models/vps_details_response.py +143 -0
  223. ha_sdk_python/models/vps_disk_info.py +96 -0
  224. ha_sdk_python/models/vps_memory_info.py +96 -0
  225. ha_sdk_python/models/vps_network_rate.py +92 -0
  226. ha_sdk_python/models/vps_os_info.py +89 -0
  227. ha_sdk_python/models/vps_service_info.py +97 -0
  228. ha_sdk_python/models/vps_simple_action_response_data.py +87 -0
  229. ha_sdk_python/models/vps_vm_info.py +102 -0
  230. ha_sdk_python/py.typed +0 -0
  231. ha_sdk_python/rest.py +263 -0
  232. ha_sdk_python/retryable_paths.py +26 -0
  233. ha_sdk_python-1.0.10.dist-info/METADATA +131 -0
  234. ha_sdk_python-1.0.10.dist-info/RECORD +237 -0
  235. ha_sdk_python-1.0.10.dist-info/WHEEL +5 -0
  236. ha_sdk_python-1.0.10.dist-info/licenses/LICENSE +21 -0
  237. ha_sdk_python-1.0.10.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1243 @@
1
+ """
2
+ HostAfricaApi
3
+
4
+ HostAfrica API
5
+
6
+ The version of the OpenAPI document: 2026-01-01
7
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+
9
+ Do not edit the class manually.
10
+ """ # noqa: E501
11
+
12
+
13
+ import warnings
14
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
15
+ from typing import Any, Dict, List, Optional, Tuple, Union
16
+ from typing_extensions import Annotated
17
+
18
+ from ha_sdk_python.models.change_password_request_content import ChangePasswordRequestContent
19
+ from ha_sdk_python.models.change_password_response_content import ChangePasswordResponseContent
20
+ from ha_sdk_python.models.get_private_ssh_key_request_content import GetPrivateSshKeyRequestContent
21
+ from ha_sdk_python.models.get_private_ssh_key_response_content import GetPrivateSshKeyResponseContent
22
+ from ha_sdk_python.models.get_public_ssh_key_request_content import GetPublicSshKeyRequestContent
23
+ from ha_sdk_python.models.get_public_ssh_key_response_content import GetPublicSshKeyResponseContent
24
+ from ha_sdk_python.models.update_ssh_keys_request_content import UpdateSshKeysRequestContent
25
+ from ha_sdk_python.models.update_ssh_keys_response_content import UpdateSshKeysResponseContent
26
+
27
+ from ha_sdk_python.api_client import ApiClient, RequestSerialized
28
+ from ha_sdk_python.api_response import ApiResponse
29
+ from ha_sdk_python.rest import RESTResponseType
30
+
31
+
32
+ class SecurityApi:
33
+ """NOTE: This class is auto generated by OpenAPI Generator
34
+ Ref: https://openapi-generator.tech
35
+
36
+ Do not edit the class manually.
37
+ """
38
+
39
+ def __init__(self, api_client=None) -> None:
40
+ if api_client is None:
41
+ api_client = ApiClient.get_default()
42
+ self.api_client = api_client
43
+
44
+
45
+ @validate_call
46
+ def change_password(
47
+ self,
48
+ change_password_request_content: ChangePasswordRequestContent,
49
+ _request_timeout: Union[
50
+ None,
51
+ Annotated[StrictFloat, Field(gt=0)],
52
+ Tuple[
53
+ Annotated[StrictFloat, Field(gt=0)],
54
+ Annotated[StrictFloat, Field(gt=0)]
55
+ ]
56
+ ] = None,
57
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
58
+ _content_type: Optional[StrictStr] = None,
59
+ _headers: Optional[Dict[StrictStr, Any]] = None,
60
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
61
+ ) -> ChangePasswordResponseContent:
62
+ """change_password
63
+
64
+ Change the root password for a VPS service
65
+
66
+ :param change_password_request_content: (required)
67
+ :type change_password_request_content: ChangePasswordRequestContent
68
+ :param _request_timeout: timeout setting for this request. If one
69
+ number provided, it will be total request
70
+ timeout. It can also be a pair (tuple) of
71
+ (connection, read) timeouts.
72
+ :type _request_timeout: int, tuple(int, int), optional
73
+ :param _request_auth: set to override the auth_settings for an a single
74
+ request; this effectively ignores the
75
+ authentication in the spec for a single request.
76
+ :type _request_auth: dict, optional
77
+ :param _content_type: force content-type for the request.
78
+ :type _content_type: str, Optional
79
+ :param _headers: set to override the headers for a single
80
+ request; this effectively ignores the headers
81
+ in the spec for a single request.
82
+ :type _headers: dict, optional
83
+ :param _host_index: set to override the host_index for a single
84
+ request; this effectively ignores the host_index
85
+ in the spec for a single request.
86
+ :type _host_index: int, optional
87
+ :return: Returns the result object.
88
+ """ # noqa: E501
89
+
90
+ _param = self._change_password_serialize(
91
+ change_password_request_content=change_password_request_content,
92
+ _request_auth=_request_auth,
93
+ _content_type=_content_type,
94
+ _headers=_headers,
95
+ _host_index=_host_index
96
+ )
97
+
98
+ _response_types_map: Dict[str, Optional[str]] = {
99
+ '200': "ChangePasswordResponseContent",
100
+ '400': "BadRequestErrorResponseContent",
101
+ '401': "UnauthorizedErrorResponseContent",
102
+ '403': "ForbiddenErrorResponseContent",
103
+ '404': "ResourceNotFoundErrorResponseContent",
104
+ '422': "ValidationErrorResponseContent",
105
+ '429': "TooManyRequestsErrorResponseContent",
106
+ '500': "InternalServiceErrorResponseContent",
107
+ '503': "ServiceUnavailableErrorResponseContent",
108
+ }
109
+ response_data = self.api_client.call_api(
110
+ *_param,
111
+ _request_timeout=_request_timeout
112
+ )
113
+ response_data.read()
114
+ return self.api_client.response_deserialize(
115
+ response_data=response_data,
116
+ response_types_map=_response_types_map,
117
+ ).data
118
+
119
+
120
+ @validate_call
121
+ def change_password_with_http_info(
122
+ self,
123
+ change_password_request_content: ChangePasswordRequestContent,
124
+ _request_timeout: Union[
125
+ None,
126
+ Annotated[StrictFloat, Field(gt=0)],
127
+ Tuple[
128
+ Annotated[StrictFloat, Field(gt=0)],
129
+ Annotated[StrictFloat, Field(gt=0)]
130
+ ]
131
+ ] = None,
132
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
133
+ _content_type: Optional[StrictStr] = None,
134
+ _headers: Optional[Dict[StrictStr, Any]] = None,
135
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
136
+ ) -> ApiResponse[ChangePasswordResponseContent]:
137
+ """change_password
138
+
139
+ Change the root password for a VPS service
140
+
141
+ :param change_password_request_content: (required)
142
+ :type change_password_request_content: ChangePasswordRequestContent
143
+ :param _request_timeout: timeout setting for this request. If one
144
+ number provided, it will be total request
145
+ timeout. It can also be a pair (tuple) of
146
+ (connection, read) timeouts.
147
+ :type _request_timeout: int, tuple(int, int), optional
148
+ :param _request_auth: set to override the auth_settings for an a single
149
+ request; this effectively ignores the
150
+ authentication in the spec for a single request.
151
+ :type _request_auth: dict, optional
152
+ :param _content_type: force content-type for the request.
153
+ :type _content_type: str, Optional
154
+ :param _headers: set to override the headers for a single
155
+ request; this effectively ignores the headers
156
+ in the spec for a single request.
157
+ :type _headers: dict, optional
158
+ :param _host_index: set to override the host_index for a single
159
+ request; this effectively ignores the host_index
160
+ in the spec for a single request.
161
+ :type _host_index: int, optional
162
+ :return: Returns the result object.
163
+ """ # noqa: E501
164
+
165
+ _param = self._change_password_serialize(
166
+ change_password_request_content=change_password_request_content,
167
+ _request_auth=_request_auth,
168
+ _content_type=_content_type,
169
+ _headers=_headers,
170
+ _host_index=_host_index
171
+ )
172
+
173
+ _response_types_map: Dict[str, Optional[str]] = {
174
+ '200': "ChangePasswordResponseContent",
175
+ '400': "BadRequestErrorResponseContent",
176
+ '401': "UnauthorizedErrorResponseContent",
177
+ '403': "ForbiddenErrorResponseContent",
178
+ '404': "ResourceNotFoundErrorResponseContent",
179
+ '422': "ValidationErrorResponseContent",
180
+ '429': "TooManyRequestsErrorResponseContent",
181
+ '500': "InternalServiceErrorResponseContent",
182
+ '503': "ServiceUnavailableErrorResponseContent",
183
+ }
184
+ response_data = self.api_client.call_api(
185
+ *_param,
186
+ _request_timeout=_request_timeout
187
+ )
188
+ response_data.read()
189
+ return self.api_client.response_deserialize(
190
+ response_data=response_data,
191
+ response_types_map=_response_types_map,
192
+ )
193
+
194
+
195
+ @validate_call
196
+ def change_password_without_preload_content(
197
+ self,
198
+ change_password_request_content: ChangePasswordRequestContent,
199
+ _request_timeout: Union[
200
+ None,
201
+ Annotated[StrictFloat, Field(gt=0)],
202
+ Tuple[
203
+ Annotated[StrictFloat, Field(gt=0)],
204
+ Annotated[StrictFloat, Field(gt=0)]
205
+ ]
206
+ ] = None,
207
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
208
+ _content_type: Optional[StrictStr] = None,
209
+ _headers: Optional[Dict[StrictStr, Any]] = None,
210
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
211
+ ) -> RESTResponseType:
212
+ """change_password
213
+
214
+ Change the root password for a VPS service
215
+
216
+ :param change_password_request_content: (required)
217
+ :type change_password_request_content: ChangePasswordRequestContent
218
+ :param _request_timeout: timeout setting for this request. If one
219
+ number provided, it will be total request
220
+ timeout. It can also be a pair (tuple) of
221
+ (connection, read) timeouts.
222
+ :type _request_timeout: int, tuple(int, int), optional
223
+ :param _request_auth: set to override the auth_settings for an a single
224
+ request; this effectively ignores the
225
+ authentication in the spec for a single request.
226
+ :type _request_auth: dict, optional
227
+ :param _content_type: force content-type for the request.
228
+ :type _content_type: str, Optional
229
+ :param _headers: set to override the headers for a single
230
+ request; this effectively ignores the headers
231
+ in the spec for a single request.
232
+ :type _headers: dict, optional
233
+ :param _host_index: set to override the host_index for a single
234
+ request; this effectively ignores the host_index
235
+ in the spec for a single request.
236
+ :type _host_index: int, optional
237
+ :return: Returns the result object.
238
+ """ # noqa: E501
239
+
240
+ _param = self._change_password_serialize(
241
+ change_password_request_content=change_password_request_content,
242
+ _request_auth=_request_auth,
243
+ _content_type=_content_type,
244
+ _headers=_headers,
245
+ _host_index=_host_index
246
+ )
247
+
248
+ _response_types_map: Dict[str, Optional[str]] = {
249
+ '200': "ChangePasswordResponseContent",
250
+ '400': "BadRequestErrorResponseContent",
251
+ '401': "UnauthorizedErrorResponseContent",
252
+ '403': "ForbiddenErrorResponseContent",
253
+ '404': "ResourceNotFoundErrorResponseContent",
254
+ '422': "ValidationErrorResponseContent",
255
+ '429': "TooManyRequestsErrorResponseContent",
256
+ '500': "InternalServiceErrorResponseContent",
257
+ '503': "ServiceUnavailableErrorResponseContent",
258
+ }
259
+ response_data = self.api_client.call_api(
260
+ *_param,
261
+ _request_timeout=_request_timeout
262
+ )
263
+ return response_data.response
264
+
265
+
266
+ def _change_password_serialize(
267
+ self,
268
+ change_password_request_content,
269
+ _request_auth,
270
+ _content_type,
271
+ _headers,
272
+ _host_index,
273
+ ) -> RequestSerialized:
274
+
275
+ _host = None
276
+
277
+ _collection_formats: Dict[str, str] = {
278
+ }
279
+
280
+ _path_params: Dict[str, str] = {}
281
+ _query_params: List[Tuple[str, str]] = []
282
+ _header_params: Dict[str, Optional[str]] = _headers or {}
283
+ _form_params: List[Tuple[str, str]] = []
284
+ _files: Dict[
285
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
286
+ ] = {}
287
+ _body_params: Optional[bytes] = None
288
+
289
+ # process the path parameters
290
+ # process the query parameters
291
+ # process the header parameters
292
+ # process the form parameters
293
+ # process the body parameter
294
+ if change_password_request_content is not None:
295
+ _body_params = change_password_request_content
296
+
297
+
298
+ # set the HTTP header `Accept`
299
+ if 'Accept' not in _header_params:
300
+ _header_params['Accept'] = self.api_client.select_header_accept(
301
+ [
302
+ 'application/json'
303
+ ]
304
+ )
305
+
306
+ # set the HTTP header `Content-Type`
307
+ if _content_type:
308
+ _header_params['Content-Type'] = _content_type
309
+ else:
310
+ _default_content_type = (
311
+ self.api_client.select_header_content_type(
312
+ [
313
+ 'application/json'
314
+ ]
315
+ )
316
+ )
317
+ if _default_content_type is not None:
318
+ _header_params['Content-Type'] = _default_content_type
319
+
320
+ # authentication setting
321
+ _auth_settings: List[str] = [
322
+ 'BearerAuth'
323
+ ]
324
+
325
+ return self.api_client.param_serialize(
326
+ method='POST',
327
+ resource_path='/vps/change-password',
328
+ path_params=_path_params,
329
+ query_params=_query_params,
330
+ header_params=_header_params,
331
+ body=_body_params,
332
+ post_params=_form_params,
333
+ files=_files,
334
+ auth_settings=_auth_settings,
335
+ collection_formats=_collection_formats,
336
+ _host=_host,
337
+ _request_auth=_request_auth
338
+ )
339
+
340
+
341
+
342
+
343
+ @validate_call
344
+ def get_private_ssh_key(
345
+ self,
346
+ get_private_ssh_key_request_content: GetPrivateSshKeyRequestContent,
347
+ _request_timeout: Union[
348
+ None,
349
+ Annotated[StrictFloat, Field(gt=0)],
350
+ Tuple[
351
+ Annotated[StrictFloat, Field(gt=0)],
352
+ Annotated[StrictFloat, Field(gt=0)]
353
+ ]
354
+ ] = None,
355
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
356
+ _content_type: Optional[StrictStr] = None,
357
+ _headers: Optional[Dict[StrictStr, Any]] = None,
358
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
359
+ ) -> GetPrivateSshKeyResponseContent:
360
+ """get_private_ssh_key
361
+
362
+ Retrieves the private SSH key configured for a VPS service
363
+
364
+ :param get_private_ssh_key_request_content: (required)
365
+ :type get_private_ssh_key_request_content: GetPrivateSshKeyRequestContent
366
+ :param _request_timeout: timeout setting for this request. If one
367
+ number provided, it will be total request
368
+ timeout. It can also be a pair (tuple) of
369
+ (connection, read) timeouts.
370
+ :type _request_timeout: int, tuple(int, int), optional
371
+ :param _request_auth: set to override the auth_settings for an a single
372
+ request; this effectively ignores the
373
+ authentication in the spec for a single request.
374
+ :type _request_auth: dict, optional
375
+ :param _content_type: force content-type for the request.
376
+ :type _content_type: str, Optional
377
+ :param _headers: set to override the headers for a single
378
+ request; this effectively ignores the headers
379
+ in the spec for a single request.
380
+ :type _headers: dict, optional
381
+ :param _host_index: set to override the host_index for a single
382
+ request; this effectively ignores the host_index
383
+ in the spec for a single request.
384
+ :type _host_index: int, optional
385
+ :return: Returns the result object.
386
+ """ # noqa: E501
387
+
388
+ _param = self._get_private_ssh_key_serialize(
389
+ get_private_ssh_key_request_content=get_private_ssh_key_request_content,
390
+ _request_auth=_request_auth,
391
+ _content_type=_content_type,
392
+ _headers=_headers,
393
+ _host_index=_host_index
394
+ )
395
+
396
+ _response_types_map: Dict[str, Optional[str]] = {
397
+ '200': "GetPrivateSshKeyResponseContent",
398
+ '400': "BadRequestErrorResponseContent",
399
+ '401': "UnauthorizedErrorResponseContent",
400
+ '403': "ForbiddenErrorResponseContent",
401
+ '404': "ResourceNotFoundErrorResponseContent",
402
+ '409': "InvalidStateErrorResponseContent",
403
+ '422': "ValidationErrorResponseContent",
404
+ '429': "TooManyRequestsErrorResponseContent",
405
+ '500': "InternalServiceErrorResponseContent",
406
+ '503': "ServiceUnavailableErrorResponseContent",
407
+ }
408
+ response_data = self.api_client.call_api(
409
+ *_param,
410
+ _request_timeout=_request_timeout
411
+ )
412
+ response_data.read()
413
+ return self.api_client.response_deserialize(
414
+ response_data=response_data,
415
+ response_types_map=_response_types_map,
416
+ ).data
417
+
418
+
419
+ @validate_call
420
+ def get_private_ssh_key_with_http_info(
421
+ self,
422
+ get_private_ssh_key_request_content: GetPrivateSshKeyRequestContent,
423
+ _request_timeout: Union[
424
+ None,
425
+ Annotated[StrictFloat, Field(gt=0)],
426
+ Tuple[
427
+ Annotated[StrictFloat, Field(gt=0)],
428
+ Annotated[StrictFloat, Field(gt=0)]
429
+ ]
430
+ ] = None,
431
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
432
+ _content_type: Optional[StrictStr] = None,
433
+ _headers: Optional[Dict[StrictStr, Any]] = None,
434
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
435
+ ) -> ApiResponse[GetPrivateSshKeyResponseContent]:
436
+ """get_private_ssh_key
437
+
438
+ Retrieves the private SSH key configured for a VPS service
439
+
440
+ :param get_private_ssh_key_request_content: (required)
441
+ :type get_private_ssh_key_request_content: GetPrivateSshKeyRequestContent
442
+ :param _request_timeout: timeout setting for this request. If one
443
+ number provided, it will be total request
444
+ timeout. It can also be a pair (tuple) of
445
+ (connection, read) timeouts.
446
+ :type _request_timeout: int, tuple(int, int), optional
447
+ :param _request_auth: set to override the auth_settings for an a single
448
+ request; this effectively ignores the
449
+ authentication in the spec for a single request.
450
+ :type _request_auth: dict, optional
451
+ :param _content_type: force content-type for the request.
452
+ :type _content_type: str, Optional
453
+ :param _headers: set to override the headers for a single
454
+ request; this effectively ignores the headers
455
+ in the spec for a single request.
456
+ :type _headers: dict, optional
457
+ :param _host_index: set to override the host_index for a single
458
+ request; this effectively ignores the host_index
459
+ in the spec for a single request.
460
+ :type _host_index: int, optional
461
+ :return: Returns the result object.
462
+ """ # noqa: E501
463
+
464
+ _param = self._get_private_ssh_key_serialize(
465
+ get_private_ssh_key_request_content=get_private_ssh_key_request_content,
466
+ _request_auth=_request_auth,
467
+ _content_type=_content_type,
468
+ _headers=_headers,
469
+ _host_index=_host_index
470
+ )
471
+
472
+ _response_types_map: Dict[str, Optional[str]] = {
473
+ '200': "GetPrivateSshKeyResponseContent",
474
+ '400': "BadRequestErrorResponseContent",
475
+ '401': "UnauthorizedErrorResponseContent",
476
+ '403': "ForbiddenErrorResponseContent",
477
+ '404': "ResourceNotFoundErrorResponseContent",
478
+ '409': "InvalidStateErrorResponseContent",
479
+ '422': "ValidationErrorResponseContent",
480
+ '429': "TooManyRequestsErrorResponseContent",
481
+ '500': "InternalServiceErrorResponseContent",
482
+ '503': "ServiceUnavailableErrorResponseContent",
483
+ }
484
+ response_data = self.api_client.call_api(
485
+ *_param,
486
+ _request_timeout=_request_timeout
487
+ )
488
+ response_data.read()
489
+ return self.api_client.response_deserialize(
490
+ response_data=response_data,
491
+ response_types_map=_response_types_map,
492
+ )
493
+
494
+
495
+ @validate_call
496
+ def get_private_ssh_key_without_preload_content(
497
+ self,
498
+ get_private_ssh_key_request_content: GetPrivateSshKeyRequestContent,
499
+ _request_timeout: Union[
500
+ None,
501
+ Annotated[StrictFloat, Field(gt=0)],
502
+ Tuple[
503
+ Annotated[StrictFloat, Field(gt=0)],
504
+ Annotated[StrictFloat, Field(gt=0)]
505
+ ]
506
+ ] = None,
507
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
508
+ _content_type: Optional[StrictStr] = None,
509
+ _headers: Optional[Dict[StrictStr, Any]] = None,
510
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
511
+ ) -> RESTResponseType:
512
+ """get_private_ssh_key
513
+
514
+ Retrieves the private SSH key configured for a VPS service
515
+
516
+ :param get_private_ssh_key_request_content: (required)
517
+ :type get_private_ssh_key_request_content: GetPrivateSshKeyRequestContent
518
+ :param _request_timeout: timeout setting for this request. If one
519
+ number provided, it will be total request
520
+ timeout. It can also be a pair (tuple) of
521
+ (connection, read) timeouts.
522
+ :type _request_timeout: int, tuple(int, int), optional
523
+ :param _request_auth: set to override the auth_settings for an a single
524
+ request; this effectively ignores the
525
+ authentication in the spec for a single request.
526
+ :type _request_auth: dict, optional
527
+ :param _content_type: force content-type for the request.
528
+ :type _content_type: str, Optional
529
+ :param _headers: set to override the headers for a single
530
+ request; this effectively ignores the headers
531
+ in the spec for a single request.
532
+ :type _headers: dict, optional
533
+ :param _host_index: set to override the host_index for a single
534
+ request; this effectively ignores the host_index
535
+ in the spec for a single request.
536
+ :type _host_index: int, optional
537
+ :return: Returns the result object.
538
+ """ # noqa: E501
539
+
540
+ _param = self._get_private_ssh_key_serialize(
541
+ get_private_ssh_key_request_content=get_private_ssh_key_request_content,
542
+ _request_auth=_request_auth,
543
+ _content_type=_content_type,
544
+ _headers=_headers,
545
+ _host_index=_host_index
546
+ )
547
+
548
+ _response_types_map: Dict[str, Optional[str]] = {
549
+ '200': "GetPrivateSshKeyResponseContent",
550
+ '400': "BadRequestErrorResponseContent",
551
+ '401': "UnauthorizedErrorResponseContent",
552
+ '403': "ForbiddenErrorResponseContent",
553
+ '404': "ResourceNotFoundErrorResponseContent",
554
+ '409': "InvalidStateErrorResponseContent",
555
+ '422': "ValidationErrorResponseContent",
556
+ '429': "TooManyRequestsErrorResponseContent",
557
+ '500': "InternalServiceErrorResponseContent",
558
+ '503': "ServiceUnavailableErrorResponseContent",
559
+ }
560
+ response_data = self.api_client.call_api(
561
+ *_param,
562
+ _request_timeout=_request_timeout
563
+ )
564
+ return response_data.response
565
+
566
+
567
+ def _get_private_ssh_key_serialize(
568
+ self,
569
+ get_private_ssh_key_request_content,
570
+ _request_auth,
571
+ _content_type,
572
+ _headers,
573
+ _host_index,
574
+ ) -> RequestSerialized:
575
+
576
+ _host = None
577
+
578
+ _collection_formats: Dict[str, str] = {
579
+ }
580
+
581
+ _path_params: Dict[str, str] = {}
582
+ _query_params: List[Tuple[str, str]] = []
583
+ _header_params: Dict[str, Optional[str]] = _headers or {}
584
+ _form_params: List[Tuple[str, str]] = []
585
+ _files: Dict[
586
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
587
+ ] = {}
588
+ _body_params: Optional[bytes] = None
589
+
590
+ # process the path parameters
591
+ # process the query parameters
592
+ # process the header parameters
593
+ # process the form parameters
594
+ # process the body parameter
595
+ if get_private_ssh_key_request_content is not None:
596
+ _body_params = get_private_ssh_key_request_content
597
+
598
+
599
+ # set the HTTP header `Accept`
600
+ if 'Accept' not in _header_params:
601
+ _header_params['Accept'] = self.api_client.select_header_accept(
602
+ [
603
+ 'application/json'
604
+ ]
605
+ )
606
+
607
+ # set the HTTP header `Content-Type`
608
+ if _content_type:
609
+ _header_params['Content-Type'] = _content_type
610
+ else:
611
+ _default_content_type = (
612
+ self.api_client.select_header_content_type(
613
+ [
614
+ 'application/json'
615
+ ]
616
+ )
617
+ )
618
+ if _default_content_type is not None:
619
+ _header_params['Content-Type'] = _default_content_type
620
+
621
+ # authentication setting
622
+ _auth_settings: List[str] = [
623
+ 'BearerAuth'
624
+ ]
625
+
626
+ return self.api_client.param_serialize(
627
+ method='POST',
628
+ resource_path='/vps/get-private-ssh-keys',
629
+ path_params=_path_params,
630
+ query_params=_query_params,
631
+ header_params=_header_params,
632
+ body=_body_params,
633
+ post_params=_form_params,
634
+ files=_files,
635
+ auth_settings=_auth_settings,
636
+ collection_formats=_collection_formats,
637
+ _host=_host,
638
+ _request_auth=_request_auth
639
+ )
640
+
641
+
642
+
643
+
644
+ @validate_call
645
+ def get_public_ssh_key(
646
+ self,
647
+ get_public_ssh_key_request_content: GetPublicSshKeyRequestContent,
648
+ _request_timeout: Union[
649
+ None,
650
+ Annotated[StrictFloat, Field(gt=0)],
651
+ Tuple[
652
+ Annotated[StrictFloat, Field(gt=0)],
653
+ Annotated[StrictFloat, Field(gt=0)]
654
+ ]
655
+ ] = None,
656
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
657
+ _content_type: Optional[StrictStr] = None,
658
+ _headers: Optional[Dict[StrictStr, Any]] = None,
659
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
660
+ ) -> GetPublicSshKeyResponseContent:
661
+ """get_public_ssh_key
662
+
663
+ Retrieves the public SSH key configured for a VPS service
664
+
665
+ :param get_public_ssh_key_request_content: (required)
666
+ :type get_public_ssh_key_request_content: GetPublicSshKeyRequestContent
667
+ :param _request_timeout: timeout setting for this request. If one
668
+ number provided, it will be total request
669
+ timeout. It can also be a pair (tuple) of
670
+ (connection, read) timeouts.
671
+ :type _request_timeout: int, tuple(int, int), optional
672
+ :param _request_auth: set to override the auth_settings for an a single
673
+ request; this effectively ignores the
674
+ authentication in the spec for a single request.
675
+ :type _request_auth: dict, optional
676
+ :param _content_type: force content-type for the request.
677
+ :type _content_type: str, Optional
678
+ :param _headers: set to override the headers for a single
679
+ request; this effectively ignores the headers
680
+ in the spec for a single request.
681
+ :type _headers: dict, optional
682
+ :param _host_index: set to override the host_index for a single
683
+ request; this effectively ignores the host_index
684
+ in the spec for a single request.
685
+ :type _host_index: int, optional
686
+ :return: Returns the result object.
687
+ """ # noqa: E501
688
+
689
+ _param = self._get_public_ssh_key_serialize(
690
+ get_public_ssh_key_request_content=get_public_ssh_key_request_content,
691
+ _request_auth=_request_auth,
692
+ _content_type=_content_type,
693
+ _headers=_headers,
694
+ _host_index=_host_index
695
+ )
696
+
697
+ _response_types_map: Dict[str, Optional[str]] = {
698
+ '200': "GetPublicSshKeyResponseContent",
699
+ '400': "BadRequestErrorResponseContent",
700
+ '401': "UnauthorizedErrorResponseContent",
701
+ '403': "ForbiddenErrorResponseContent",
702
+ '404': "ResourceNotFoundErrorResponseContent",
703
+ '409': "InvalidStateErrorResponseContent",
704
+ '422': "ValidationErrorResponseContent",
705
+ '429': "TooManyRequestsErrorResponseContent",
706
+ '500': "InternalServiceErrorResponseContent",
707
+ '503': "ServiceUnavailableErrorResponseContent",
708
+ }
709
+ response_data = self.api_client.call_api(
710
+ *_param,
711
+ _request_timeout=_request_timeout
712
+ )
713
+ response_data.read()
714
+ return self.api_client.response_deserialize(
715
+ response_data=response_data,
716
+ response_types_map=_response_types_map,
717
+ ).data
718
+
719
+
720
+ @validate_call
721
+ def get_public_ssh_key_with_http_info(
722
+ self,
723
+ get_public_ssh_key_request_content: GetPublicSshKeyRequestContent,
724
+ _request_timeout: Union[
725
+ None,
726
+ Annotated[StrictFloat, Field(gt=0)],
727
+ Tuple[
728
+ Annotated[StrictFloat, Field(gt=0)],
729
+ Annotated[StrictFloat, Field(gt=0)]
730
+ ]
731
+ ] = None,
732
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
733
+ _content_type: Optional[StrictStr] = None,
734
+ _headers: Optional[Dict[StrictStr, Any]] = None,
735
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
736
+ ) -> ApiResponse[GetPublicSshKeyResponseContent]:
737
+ """get_public_ssh_key
738
+
739
+ Retrieves the public SSH key configured for a VPS service
740
+
741
+ :param get_public_ssh_key_request_content: (required)
742
+ :type get_public_ssh_key_request_content: GetPublicSshKeyRequestContent
743
+ :param _request_timeout: timeout setting for this request. If one
744
+ number provided, it will be total request
745
+ timeout. It can also be a pair (tuple) of
746
+ (connection, read) timeouts.
747
+ :type _request_timeout: int, tuple(int, int), optional
748
+ :param _request_auth: set to override the auth_settings for an a single
749
+ request; this effectively ignores the
750
+ authentication in the spec for a single request.
751
+ :type _request_auth: dict, optional
752
+ :param _content_type: force content-type for the request.
753
+ :type _content_type: str, Optional
754
+ :param _headers: set to override the headers for a single
755
+ request; this effectively ignores the headers
756
+ in the spec for a single request.
757
+ :type _headers: dict, optional
758
+ :param _host_index: set to override the host_index for a single
759
+ request; this effectively ignores the host_index
760
+ in the spec for a single request.
761
+ :type _host_index: int, optional
762
+ :return: Returns the result object.
763
+ """ # noqa: E501
764
+
765
+ _param = self._get_public_ssh_key_serialize(
766
+ get_public_ssh_key_request_content=get_public_ssh_key_request_content,
767
+ _request_auth=_request_auth,
768
+ _content_type=_content_type,
769
+ _headers=_headers,
770
+ _host_index=_host_index
771
+ )
772
+
773
+ _response_types_map: Dict[str, Optional[str]] = {
774
+ '200': "GetPublicSshKeyResponseContent",
775
+ '400': "BadRequestErrorResponseContent",
776
+ '401': "UnauthorizedErrorResponseContent",
777
+ '403': "ForbiddenErrorResponseContent",
778
+ '404': "ResourceNotFoundErrorResponseContent",
779
+ '409': "InvalidStateErrorResponseContent",
780
+ '422': "ValidationErrorResponseContent",
781
+ '429': "TooManyRequestsErrorResponseContent",
782
+ '500': "InternalServiceErrorResponseContent",
783
+ '503': "ServiceUnavailableErrorResponseContent",
784
+ }
785
+ response_data = self.api_client.call_api(
786
+ *_param,
787
+ _request_timeout=_request_timeout
788
+ )
789
+ response_data.read()
790
+ return self.api_client.response_deserialize(
791
+ response_data=response_data,
792
+ response_types_map=_response_types_map,
793
+ )
794
+
795
+
796
+ @validate_call
797
+ def get_public_ssh_key_without_preload_content(
798
+ self,
799
+ get_public_ssh_key_request_content: GetPublicSshKeyRequestContent,
800
+ _request_timeout: Union[
801
+ None,
802
+ Annotated[StrictFloat, Field(gt=0)],
803
+ Tuple[
804
+ Annotated[StrictFloat, Field(gt=0)],
805
+ Annotated[StrictFloat, Field(gt=0)]
806
+ ]
807
+ ] = None,
808
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
809
+ _content_type: Optional[StrictStr] = None,
810
+ _headers: Optional[Dict[StrictStr, Any]] = None,
811
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
812
+ ) -> RESTResponseType:
813
+ """get_public_ssh_key
814
+
815
+ Retrieves the public SSH key configured for a VPS service
816
+
817
+ :param get_public_ssh_key_request_content: (required)
818
+ :type get_public_ssh_key_request_content: GetPublicSshKeyRequestContent
819
+ :param _request_timeout: timeout setting for this request. If one
820
+ number provided, it will be total request
821
+ timeout. It can also be a pair (tuple) of
822
+ (connection, read) timeouts.
823
+ :type _request_timeout: int, tuple(int, int), optional
824
+ :param _request_auth: set to override the auth_settings for an a single
825
+ request; this effectively ignores the
826
+ authentication in the spec for a single request.
827
+ :type _request_auth: dict, optional
828
+ :param _content_type: force content-type for the request.
829
+ :type _content_type: str, Optional
830
+ :param _headers: set to override the headers for a single
831
+ request; this effectively ignores the headers
832
+ in the spec for a single request.
833
+ :type _headers: dict, optional
834
+ :param _host_index: set to override the host_index for a single
835
+ request; this effectively ignores the host_index
836
+ in the spec for a single request.
837
+ :type _host_index: int, optional
838
+ :return: Returns the result object.
839
+ """ # noqa: E501
840
+
841
+ _param = self._get_public_ssh_key_serialize(
842
+ get_public_ssh_key_request_content=get_public_ssh_key_request_content,
843
+ _request_auth=_request_auth,
844
+ _content_type=_content_type,
845
+ _headers=_headers,
846
+ _host_index=_host_index
847
+ )
848
+
849
+ _response_types_map: Dict[str, Optional[str]] = {
850
+ '200': "GetPublicSshKeyResponseContent",
851
+ '400': "BadRequestErrorResponseContent",
852
+ '401': "UnauthorizedErrorResponseContent",
853
+ '403': "ForbiddenErrorResponseContent",
854
+ '404': "ResourceNotFoundErrorResponseContent",
855
+ '409': "InvalidStateErrorResponseContent",
856
+ '422': "ValidationErrorResponseContent",
857
+ '429': "TooManyRequestsErrorResponseContent",
858
+ '500': "InternalServiceErrorResponseContent",
859
+ '503': "ServiceUnavailableErrorResponseContent",
860
+ }
861
+ response_data = self.api_client.call_api(
862
+ *_param,
863
+ _request_timeout=_request_timeout
864
+ )
865
+ return response_data.response
866
+
867
+
868
+ def _get_public_ssh_key_serialize(
869
+ self,
870
+ get_public_ssh_key_request_content,
871
+ _request_auth,
872
+ _content_type,
873
+ _headers,
874
+ _host_index,
875
+ ) -> RequestSerialized:
876
+
877
+ _host = None
878
+
879
+ _collection_formats: Dict[str, str] = {
880
+ }
881
+
882
+ _path_params: Dict[str, str] = {}
883
+ _query_params: List[Tuple[str, str]] = []
884
+ _header_params: Dict[str, Optional[str]] = _headers or {}
885
+ _form_params: List[Tuple[str, str]] = []
886
+ _files: Dict[
887
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
888
+ ] = {}
889
+ _body_params: Optional[bytes] = None
890
+
891
+ # process the path parameters
892
+ # process the query parameters
893
+ # process the header parameters
894
+ # process the form parameters
895
+ # process the body parameter
896
+ if get_public_ssh_key_request_content is not None:
897
+ _body_params = get_public_ssh_key_request_content
898
+
899
+
900
+ # set the HTTP header `Accept`
901
+ if 'Accept' not in _header_params:
902
+ _header_params['Accept'] = self.api_client.select_header_accept(
903
+ [
904
+ 'application/json'
905
+ ]
906
+ )
907
+
908
+ # set the HTTP header `Content-Type`
909
+ if _content_type:
910
+ _header_params['Content-Type'] = _content_type
911
+ else:
912
+ _default_content_type = (
913
+ self.api_client.select_header_content_type(
914
+ [
915
+ 'application/json'
916
+ ]
917
+ )
918
+ )
919
+ if _default_content_type is not None:
920
+ _header_params['Content-Type'] = _default_content_type
921
+
922
+ # authentication setting
923
+ _auth_settings: List[str] = [
924
+ 'BearerAuth'
925
+ ]
926
+
927
+ return self.api_client.param_serialize(
928
+ method='POST',
929
+ resource_path='/vps/get-public-ssh-keys',
930
+ path_params=_path_params,
931
+ query_params=_query_params,
932
+ header_params=_header_params,
933
+ body=_body_params,
934
+ post_params=_form_params,
935
+ files=_files,
936
+ auth_settings=_auth_settings,
937
+ collection_formats=_collection_formats,
938
+ _host=_host,
939
+ _request_auth=_request_auth
940
+ )
941
+
942
+
943
+
944
+
945
+ @validate_call
946
+ def update_ssh_keys(
947
+ self,
948
+ update_ssh_keys_request_content: UpdateSshKeysRequestContent,
949
+ _request_timeout: Union[
950
+ None,
951
+ Annotated[StrictFloat, Field(gt=0)],
952
+ Tuple[
953
+ Annotated[StrictFloat, Field(gt=0)],
954
+ Annotated[StrictFloat, Field(gt=0)]
955
+ ]
956
+ ] = None,
957
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
958
+ _content_type: Optional[StrictStr] = None,
959
+ _headers: Optional[Dict[StrictStr, Any]] = None,
960
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
961
+ ) -> UpdateSshKeysResponseContent:
962
+ """update_ssh_keys
963
+
964
+ Updates SSH public keys for a VPS service for root access.
965
+
966
+ :param update_ssh_keys_request_content: (required)
967
+ :type update_ssh_keys_request_content: UpdateSshKeysRequestContent
968
+ :param _request_timeout: timeout setting for this request. If one
969
+ number provided, it will be total request
970
+ timeout. It can also be a pair (tuple) of
971
+ (connection, read) timeouts.
972
+ :type _request_timeout: int, tuple(int, int), optional
973
+ :param _request_auth: set to override the auth_settings for an a single
974
+ request; this effectively ignores the
975
+ authentication in the spec for a single request.
976
+ :type _request_auth: dict, optional
977
+ :param _content_type: force content-type for the request.
978
+ :type _content_type: str, Optional
979
+ :param _headers: set to override the headers for a single
980
+ request; this effectively ignores the headers
981
+ in the spec for a single request.
982
+ :type _headers: dict, optional
983
+ :param _host_index: set to override the host_index for a single
984
+ request; this effectively ignores the host_index
985
+ in the spec for a single request.
986
+ :type _host_index: int, optional
987
+ :return: Returns the result object.
988
+ """ # noqa: E501
989
+
990
+ _param = self._update_ssh_keys_serialize(
991
+ update_ssh_keys_request_content=update_ssh_keys_request_content,
992
+ _request_auth=_request_auth,
993
+ _content_type=_content_type,
994
+ _headers=_headers,
995
+ _host_index=_host_index
996
+ )
997
+
998
+ _response_types_map: Dict[str, Optional[str]] = {
999
+ '200': "UpdateSshKeysResponseContent",
1000
+ '400': "BadRequestErrorResponseContent",
1001
+ '401': "UnauthorizedErrorResponseContent",
1002
+ '403': "ForbiddenErrorResponseContent",
1003
+ '404': "ResourceNotFoundErrorResponseContent",
1004
+ '409': "InvalidStateErrorResponseContent",
1005
+ '422': "ValidationErrorResponseContent",
1006
+ '429': "TooManyRequestsErrorResponseContent",
1007
+ '500': "InternalServiceErrorResponseContent",
1008
+ '503': "ServiceUnavailableErrorResponseContent",
1009
+ }
1010
+ response_data = self.api_client.call_api(
1011
+ *_param,
1012
+ _request_timeout=_request_timeout
1013
+ )
1014
+ response_data.read()
1015
+ return self.api_client.response_deserialize(
1016
+ response_data=response_data,
1017
+ response_types_map=_response_types_map,
1018
+ ).data
1019
+
1020
+
1021
+ @validate_call
1022
+ def update_ssh_keys_with_http_info(
1023
+ self,
1024
+ update_ssh_keys_request_content: UpdateSshKeysRequestContent,
1025
+ _request_timeout: Union[
1026
+ None,
1027
+ Annotated[StrictFloat, Field(gt=0)],
1028
+ Tuple[
1029
+ Annotated[StrictFloat, Field(gt=0)],
1030
+ Annotated[StrictFloat, Field(gt=0)]
1031
+ ]
1032
+ ] = None,
1033
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1034
+ _content_type: Optional[StrictStr] = None,
1035
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1036
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1037
+ ) -> ApiResponse[UpdateSshKeysResponseContent]:
1038
+ """update_ssh_keys
1039
+
1040
+ Updates SSH public keys for a VPS service for root access.
1041
+
1042
+ :param update_ssh_keys_request_content: (required)
1043
+ :type update_ssh_keys_request_content: UpdateSshKeysRequestContent
1044
+ :param _request_timeout: timeout setting for this request. If one
1045
+ number provided, it will be total request
1046
+ timeout. It can also be a pair (tuple) of
1047
+ (connection, read) timeouts.
1048
+ :type _request_timeout: int, tuple(int, int), optional
1049
+ :param _request_auth: set to override the auth_settings for an a single
1050
+ request; this effectively ignores the
1051
+ authentication in the spec for a single request.
1052
+ :type _request_auth: dict, optional
1053
+ :param _content_type: force content-type for the request.
1054
+ :type _content_type: str, Optional
1055
+ :param _headers: set to override the headers for a single
1056
+ request; this effectively ignores the headers
1057
+ in the spec for a single request.
1058
+ :type _headers: dict, optional
1059
+ :param _host_index: set to override the host_index for a single
1060
+ request; this effectively ignores the host_index
1061
+ in the spec for a single request.
1062
+ :type _host_index: int, optional
1063
+ :return: Returns the result object.
1064
+ """ # noqa: E501
1065
+
1066
+ _param = self._update_ssh_keys_serialize(
1067
+ update_ssh_keys_request_content=update_ssh_keys_request_content,
1068
+ _request_auth=_request_auth,
1069
+ _content_type=_content_type,
1070
+ _headers=_headers,
1071
+ _host_index=_host_index
1072
+ )
1073
+
1074
+ _response_types_map: Dict[str, Optional[str]] = {
1075
+ '200': "UpdateSshKeysResponseContent",
1076
+ '400': "BadRequestErrorResponseContent",
1077
+ '401': "UnauthorizedErrorResponseContent",
1078
+ '403': "ForbiddenErrorResponseContent",
1079
+ '404': "ResourceNotFoundErrorResponseContent",
1080
+ '409': "InvalidStateErrorResponseContent",
1081
+ '422': "ValidationErrorResponseContent",
1082
+ '429': "TooManyRequestsErrorResponseContent",
1083
+ '500': "InternalServiceErrorResponseContent",
1084
+ '503': "ServiceUnavailableErrorResponseContent",
1085
+ }
1086
+ response_data = self.api_client.call_api(
1087
+ *_param,
1088
+ _request_timeout=_request_timeout
1089
+ )
1090
+ response_data.read()
1091
+ return self.api_client.response_deserialize(
1092
+ response_data=response_data,
1093
+ response_types_map=_response_types_map,
1094
+ )
1095
+
1096
+
1097
+ @validate_call
1098
+ def update_ssh_keys_without_preload_content(
1099
+ self,
1100
+ update_ssh_keys_request_content: UpdateSshKeysRequestContent,
1101
+ _request_timeout: Union[
1102
+ None,
1103
+ Annotated[StrictFloat, Field(gt=0)],
1104
+ Tuple[
1105
+ Annotated[StrictFloat, Field(gt=0)],
1106
+ Annotated[StrictFloat, Field(gt=0)]
1107
+ ]
1108
+ ] = None,
1109
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1110
+ _content_type: Optional[StrictStr] = None,
1111
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1112
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1113
+ ) -> RESTResponseType:
1114
+ """update_ssh_keys
1115
+
1116
+ Updates SSH public keys for a VPS service for root access.
1117
+
1118
+ :param update_ssh_keys_request_content: (required)
1119
+ :type update_ssh_keys_request_content: UpdateSshKeysRequestContent
1120
+ :param _request_timeout: timeout setting for this request. If one
1121
+ number provided, it will be total request
1122
+ timeout. It can also be a pair (tuple) of
1123
+ (connection, read) timeouts.
1124
+ :type _request_timeout: int, tuple(int, int), optional
1125
+ :param _request_auth: set to override the auth_settings for an a single
1126
+ request; this effectively ignores the
1127
+ authentication in the spec for a single request.
1128
+ :type _request_auth: dict, optional
1129
+ :param _content_type: force content-type for the request.
1130
+ :type _content_type: str, Optional
1131
+ :param _headers: set to override the headers for a single
1132
+ request; this effectively ignores the headers
1133
+ in the spec for a single request.
1134
+ :type _headers: dict, optional
1135
+ :param _host_index: set to override the host_index for a single
1136
+ request; this effectively ignores the host_index
1137
+ in the spec for a single request.
1138
+ :type _host_index: int, optional
1139
+ :return: Returns the result object.
1140
+ """ # noqa: E501
1141
+
1142
+ _param = self._update_ssh_keys_serialize(
1143
+ update_ssh_keys_request_content=update_ssh_keys_request_content,
1144
+ _request_auth=_request_auth,
1145
+ _content_type=_content_type,
1146
+ _headers=_headers,
1147
+ _host_index=_host_index
1148
+ )
1149
+
1150
+ _response_types_map: Dict[str, Optional[str]] = {
1151
+ '200': "UpdateSshKeysResponseContent",
1152
+ '400': "BadRequestErrorResponseContent",
1153
+ '401': "UnauthorizedErrorResponseContent",
1154
+ '403': "ForbiddenErrorResponseContent",
1155
+ '404': "ResourceNotFoundErrorResponseContent",
1156
+ '409': "InvalidStateErrorResponseContent",
1157
+ '422': "ValidationErrorResponseContent",
1158
+ '429': "TooManyRequestsErrorResponseContent",
1159
+ '500': "InternalServiceErrorResponseContent",
1160
+ '503': "ServiceUnavailableErrorResponseContent",
1161
+ }
1162
+ response_data = self.api_client.call_api(
1163
+ *_param,
1164
+ _request_timeout=_request_timeout
1165
+ )
1166
+ return response_data.response
1167
+
1168
+
1169
+ def _update_ssh_keys_serialize(
1170
+ self,
1171
+ update_ssh_keys_request_content,
1172
+ _request_auth,
1173
+ _content_type,
1174
+ _headers,
1175
+ _host_index,
1176
+ ) -> RequestSerialized:
1177
+
1178
+ _host = None
1179
+
1180
+ _collection_formats: Dict[str, str] = {
1181
+ }
1182
+
1183
+ _path_params: Dict[str, str] = {}
1184
+ _query_params: List[Tuple[str, str]] = []
1185
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1186
+ _form_params: List[Tuple[str, str]] = []
1187
+ _files: Dict[
1188
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1189
+ ] = {}
1190
+ _body_params: Optional[bytes] = None
1191
+
1192
+ # process the path parameters
1193
+ # process the query parameters
1194
+ # process the header parameters
1195
+ # process the form parameters
1196
+ # process the body parameter
1197
+ if update_ssh_keys_request_content is not None:
1198
+ _body_params = update_ssh_keys_request_content
1199
+
1200
+
1201
+ # set the HTTP header `Accept`
1202
+ if 'Accept' not in _header_params:
1203
+ _header_params['Accept'] = self.api_client.select_header_accept(
1204
+ [
1205
+ 'application/json'
1206
+ ]
1207
+ )
1208
+
1209
+ # set the HTTP header `Content-Type`
1210
+ if _content_type:
1211
+ _header_params['Content-Type'] = _content_type
1212
+ else:
1213
+ _default_content_type = (
1214
+ self.api_client.select_header_content_type(
1215
+ [
1216
+ 'application/json'
1217
+ ]
1218
+ )
1219
+ )
1220
+ if _default_content_type is not None:
1221
+ _header_params['Content-Type'] = _default_content_type
1222
+
1223
+ # authentication setting
1224
+ _auth_settings: List[str] = [
1225
+ 'BearerAuth'
1226
+ ]
1227
+
1228
+ return self.api_client.param_serialize(
1229
+ method='POST',
1230
+ resource_path='/vps/update-ssh-keys',
1231
+ path_params=_path_params,
1232
+ query_params=_query_params,
1233
+ header_params=_header_params,
1234
+ body=_body_params,
1235
+ post_params=_form_params,
1236
+ files=_files,
1237
+ auth_settings=_auth_settings,
1238
+ collection_formats=_collection_formats,
1239
+ _host=_host,
1240
+ _request_auth=_request_auth
1241
+ )
1242
+
1243
+