hostinger-api 1.0.0__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 (88) hide show
  1. hostinger_api/__init__.py +105 -0
  2. hostinger_api/api/__init__.py +21 -0
  3. hostinger_api/api/billing_catalog_api.py +282 -0
  4. hostinger_api/api/billing_orders_api.py +313 -0
  5. hostinger_api/api/billing_payment_methods_api.py +819 -0
  6. hostinger_api/api/billing_subscriptions_api.py +584 -0
  7. hostinger_api/api/domains_portfolio_api.py +282 -0
  8. hostinger_api/api/vps_actions_api.py +599 -0
  9. hostinger_api/api/vps_backups_api.py +882 -0
  10. hostinger_api/api/vps_data_centers_api.py +282 -0
  11. hostinger_api/api/vps_firewall_api.py +2872 -0
  12. hostinger_api/api/vps_malware_scanner_api.py +842 -0
  13. hostinger_api/api/vps_post_install_scripts_api.py +1419 -0
  14. hostinger_api/api/vps_public_keys_api.py +1154 -0
  15. hostinger_api/api/vps_recovery_api.py +597 -0
  16. hostinger_api/api/vps_snapshots_api.py +1100 -0
  17. hostinger_api/api/vps_virtual_machine_api.py +3714 -0
  18. hostinger_api/api/vpsos_templates_api.py +551 -0
  19. hostinger_api/api/vpsptr_records_api.py +565 -0
  20. hostinger_api/api_client.py +795 -0
  21. hostinger_api/api_response.py +21 -0
  22. hostinger_api/configuration.py +579 -0
  23. hostinger_api/exceptions.py +214 -0
  24. hostinger_api/models/__init__.py +72 -0
  25. hostinger_api/models/billing_v1_catalog_catalog_item_price_resource.py +107 -0
  26. hostinger_api/models/billing_v1_catalog_catalog_item_resource.py +99 -0
  27. hostinger_api/models/billing_v1_order_order_billing_address_resource.py +145 -0
  28. hostinger_api/models/billing_v1_order_order_resource.py +116 -0
  29. hostinger_api/models/billing_v1_order_store_request.py +97 -0
  30. hostinger_api/models/billing_v1_order_store_request_items_inner.py +87 -0
  31. hostinger_api/models/billing_v1_payment_method_payment_method_resource.py +102 -0
  32. hostinger_api/models/billing_v1_subscription_cancel_request.py +117 -0
  33. hostinger_api/models/billing_v1_subscription_subscription_resource.py +130 -0
  34. hostinger_api/models/common_schema_error_response_schema.py +87 -0
  35. hostinger_api/models/common_schema_pagination_meta_schema.py +89 -0
  36. hostinger_api/models/common_schema_unauthorized_response_schema.py +87 -0
  37. hostinger_api/models/common_schema_unprocessable_content_response_schema.py +93 -0
  38. hostinger_api/models/common_schema_unprocessable_content_response_schema_errors.py +87 -0
  39. hostinger_api/models/common_success_empty_resource.py +85 -0
  40. hostinger_api/models/domains_v1_domain_domain_resource.py +126 -0
  41. hostinger_api/models/vps_get_action_list_v1200_response.py +99 -0
  42. hostinger_api/models/vps_get_backup_list_v1200_response.py +99 -0
  43. hostinger_api/models/vps_get_firewall_list_v1200_response.py +99 -0
  44. hostinger_api/models/vps_get_post_install_script_list_v1200_response.py +99 -0
  45. hostinger_api/models/vps_get_public_key_list_v1200_response.py +99 -0
  46. hostinger_api/models/vpsv1_action_action_resource.py +104 -0
  47. hostinger_api/models/vpsv1_backup_backup_resource.py +90 -0
  48. hostinger_api/models/vpsv1_data_center_data_center_resource.py +113 -0
  49. hostinger_api/models/vpsv1_firewall_firewall_resource.py +104 -0
  50. hostinger_api/models/vpsv1_firewall_firewall_rule_resource.py +115 -0
  51. hostinger_api/models/vpsv1_firewall_rules_store_request.py +105 -0
  52. hostinger_api/models/vpsv1_firewall_store_request.py +85 -0
  53. hostinger_api/models/vpsv1_ip_address_ip_address_resource.py +94 -0
  54. hostinger_api/models/vpsv1_malware_metrics_resource.py +101 -0
  55. hostinger_api/models/vpsv1_metrics_metrics_collection.py +149 -0
  56. hostinger_api/models/vpsv1_metrics_metrics_collection_cpu_usage.py +127 -0
  57. hostinger_api/models/vpsv1_metrics_metrics_collection_disk_space.py +127 -0
  58. hostinger_api/models/vpsv1_metrics_metrics_collection_incoming_traffic.py +127 -0
  59. hostinger_api/models/vpsv1_metrics_metrics_collection_outgoing_traffic.py +127 -0
  60. hostinger_api/models/vpsv1_metrics_metrics_collection_ram_usage.py +127 -0
  61. hostinger_api/models/vpsv1_metrics_metrics_collection_uptime.py +127 -0
  62. hostinger_api/models/vpsv1_metrics_metrics_resource.py +87 -0
  63. hostinger_api/models/vpsv1_post_install_script_post_install_script_resource.py +94 -0
  64. hostinger_api/models/vpsv1_post_install_script_store_request.py +87 -0
  65. hostinger_api/models/vpsv1_public_key_attach_request.py +85 -0
  66. hostinger_api/models/vpsv1_public_key_public_key_resource.py +89 -0
  67. hostinger_api/models/vpsv1_public_key_store_request.py +87 -0
  68. hostinger_api/models/vpsv1_snapshot_snapshot_resource.py +90 -0
  69. hostinger_api/models/vpsv1_template_template_resource.py +96 -0
  70. hostinger_api/models/vpsv1_virtual_machine_hostname_update_request.py +85 -0
  71. hostinger_api/models/vpsv1_virtual_machine_metric_get_request.py +88 -0
  72. hostinger_api/models/vpsv1_virtual_machine_nameservers_update_request.py +87 -0
  73. hostinger_api/models/vpsv1_virtual_machine_panel_password_update_request.py +86 -0
  74. hostinger_api/models/vpsv1_virtual_machine_recovery_start_request.py +85 -0
  75. hostinger_api/models/vpsv1_virtual_machine_recreate_request.py +90 -0
  76. hostinger_api/models/vpsv1_virtual_machine_root_password_update_request.py +86 -0
  77. hostinger_api/models/vpsv1_virtual_machine_setup_request.py +108 -0
  78. hostinger_api/models/vpsv1_virtual_machine_setup_request_public_key.py +87 -0
  79. hostinger_api/models/vpsv1_virtual_machine_virtual_machine_resource.py +190 -0
  80. hostinger_api/models/vpsv1_virtual_machine_virtual_machine_resource_ipv4.py +131 -0
  81. hostinger_api/models/vpsv1_virtual_machine_virtual_machine_resource_ipv6.py +131 -0
  82. hostinger_api/models/vpsv1_virtual_machine_virtual_machine_resource_template.py +127 -0
  83. hostinger_api/py.typed +0 -0
  84. hostinger_api/rest.py +256 -0
  85. hostinger_api-1.0.0.dist-info/METADATA +26 -0
  86. hostinger_api-1.0.0.dist-info/RECORD +88 -0
  87. hostinger_api-1.0.0.dist-info/WHEEL +5 -0
  88. hostinger_api-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,565 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Hostinger API Python SDK
5
+
6
+ API Version: 0.0.1-beta
7
+
8
+ NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
9
+ If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
10
+ """ # noqa: E501
11
+
12
+ import warnings
13
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
14
+ from typing import Any, Dict, List, Optional, Tuple, Union
15
+ from typing_extensions import Annotated
16
+
17
+ from pydantic import Field, StrictInt
18
+ from typing_extensions import Annotated
19
+ from hostinger_api.models.vpsv1_action_action_resource import VPSV1ActionActionResource
20
+
21
+ from hostinger_api.api_client import ApiClient, RequestSerialized
22
+ from hostinger_api.api_response import ApiResponse
23
+ from hostinger_api.rest import RESTResponseType
24
+
25
+
26
+ class VPSPTRRecordsApi:
27
+
28
+ def __init__(self, api_client=None) -> None:
29
+ if api_client is None:
30
+ api_client = ApiClient.get_default()
31
+ self.api_client = api_client
32
+
33
+
34
+ @validate_call
35
+ def create_ptr_record_v1(
36
+ self,
37
+ virtual_machine_id: Annotated[StrictInt, Field(description="Virtual Machine ID")],
38
+ _request_timeout: Union[
39
+ None,
40
+ Annotated[StrictFloat, Field(gt=0)],
41
+ Tuple[
42
+ Annotated[StrictFloat, Field(gt=0)],
43
+ Annotated[StrictFloat, Field(gt=0)]
44
+ ]
45
+ ] = None,
46
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
47
+ _content_type: Optional[StrictStr] = None,
48
+ _headers: Optional[Dict[StrictStr, Any]] = None,
49
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
50
+ ) -> VPSV1ActionActionResource:
51
+ """Create PTR record
52
+
53
+ This endpoint creates or updates a PTR (Pointer) record for a specified virtual machine.
54
+
55
+ :param virtual_machine_id: Virtual Machine ID (required)
56
+ :type virtual_machine_id: int
57
+ :param _request_timeout: timeout setting for this request. If one
58
+ number provided, it will be total request
59
+ timeout. It can also be a pair (tuple) of
60
+ (connection, read) timeouts.
61
+ :type _request_timeout: int, tuple(int, int), optional
62
+ :param _request_auth: set to override the auth_settings for an a single
63
+ request; this effectively ignores the
64
+ authentication in the spec for a single request.
65
+ :type _request_auth: dict, optional
66
+ :param _content_type: force content-type for the request.
67
+ :type _content_type: str, Optional
68
+ :param _headers: set to override the headers for a single
69
+ request; this effectively ignores the headers
70
+ in the spec for a single request.
71
+ :type _headers: dict, optional
72
+ :param _host_index: set to override the host_index for a single
73
+ request; this effectively ignores the host_index
74
+ in the spec for a single request.
75
+ :type _host_index: int, optional
76
+ :return: Returns the result object.
77
+ """ # noqa: E501
78
+
79
+ _param = self._create_ptr_record_v1_serialize(
80
+ virtual_machine_id=virtual_machine_id,
81
+ _request_auth=_request_auth,
82
+ _content_type=_content_type,
83
+ _headers=_headers,
84
+ _host_index=_host_index
85
+ )
86
+
87
+ _response_types_map: Dict[str, Optional[str]] = {
88
+ '200': "VPSV1ActionActionResource",
89
+ '401': "CommonSchemaUnauthorizedResponseSchema",
90
+ '500': "CommonSchemaErrorResponseSchema",
91
+ }
92
+ response_data = self.api_client.call_api(
93
+ *_param,
94
+ _request_timeout=_request_timeout
95
+ )
96
+ response_data.read()
97
+ return self.api_client.response_deserialize(
98
+ response_data=response_data,
99
+ response_types_map=_response_types_map,
100
+ ).data
101
+
102
+
103
+ @validate_call
104
+ def create_ptr_record_v1_with_http_info(
105
+ self,
106
+ virtual_machine_id: Annotated[StrictInt, Field(description="Virtual Machine ID")],
107
+ _request_timeout: Union[
108
+ None,
109
+ Annotated[StrictFloat, Field(gt=0)],
110
+ Tuple[
111
+ Annotated[StrictFloat, Field(gt=0)],
112
+ Annotated[StrictFloat, Field(gt=0)]
113
+ ]
114
+ ] = None,
115
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
116
+ _content_type: Optional[StrictStr] = None,
117
+ _headers: Optional[Dict[StrictStr, Any]] = None,
118
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
119
+ ) -> ApiResponse[VPSV1ActionActionResource]:
120
+ """Create PTR record
121
+
122
+ This endpoint creates or updates a PTR (Pointer) record for a specified virtual machine.
123
+
124
+ :param virtual_machine_id: Virtual Machine ID (required)
125
+ :type virtual_machine_id: int
126
+ :param _request_timeout: timeout setting for this request. If one
127
+ number provided, it will be total request
128
+ timeout. It can also be a pair (tuple) of
129
+ (connection, read) timeouts.
130
+ :type _request_timeout: int, tuple(int, int), optional
131
+ :param _request_auth: set to override the auth_settings for an a single
132
+ request; this effectively ignores the
133
+ authentication in the spec for a single request.
134
+ :type _request_auth: dict, optional
135
+ :param _content_type: force content-type for the request.
136
+ :type _content_type: str, Optional
137
+ :param _headers: set to override the headers for a single
138
+ request; this effectively ignores the headers
139
+ in the spec for a single request.
140
+ :type _headers: dict, optional
141
+ :param _host_index: set to override the host_index for a single
142
+ request; this effectively ignores the host_index
143
+ in the spec for a single request.
144
+ :type _host_index: int, optional
145
+ :return: Returns the result object.
146
+ """ # noqa: E501
147
+
148
+ _param = self._create_ptr_record_v1_serialize(
149
+ virtual_machine_id=virtual_machine_id,
150
+ _request_auth=_request_auth,
151
+ _content_type=_content_type,
152
+ _headers=_headers,
153
+ _host_index=_host_index
154
+ )
155
+
156
+ _response_types_map: Dict[str, Optional[str]] = {
157
+ '200': "VPSV1ActionActionResource",
158
+ '401': "CommonSchemaUnauthorizedResponseSchema",
159
+ '500': "CommonSchemaErrorResponseSchema",
160
+ }
161
+ response_data = self.api_client.call_api(
162
+ *_param,
163
+ _request_timeout=_request_timeout
164
+ )
165
+ response_data.read()
166
+ return self.api_client.response_deserialize(
167
+ response_data=response_data,
168
+ response_types_map=_response_types_map,
169
+ )
170
+
171
+
172
+ @validate_call
173
+ def create_ptr_record_v1_without_preload_content(
174
+ self,
175
+ virtual_machine_id: Annotated[StrictInt, Field(description="Virtual Machine ID")],
176
+ _request_timeout: Union[
177
+ None,
178
+ Annotated[StrictFloat, Field(gt=0)],
179
+ Tuple[
180
+ Annotated[StrictFloat, Field(gt=0)],
181
+ Annotated[StrictFloat, Field(gt=0)]
182
+ ]
183
+ ] = None,
184
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
185
+ _content_type: Optional[StrictStr] = None,
186
+ _headers: Optional[Dict[StrictStr, Any]] = None,
187
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
188
+ ) -> RESTResponseType:
189
+ """Create PTR record
190
+
191
+ This endpoint creates or updates a PTR (Pointer) record for a specified virtual machine.
192
+
193
+ :param virtual_machine_id: Virtual Machine ID (required)
194
+ :type virtual_machine_id: int
195
+ :param _request_timeout: timeout setting for this request. If one
196
+ number provided, it will be total request
197
+ timeout. It can also be a pair (tuple) of
198
+ (connection, read) timeouts.
199
+ :type _request_timeout: int, tuple(int, int), optional
200
+ :param _request_auth: set to override the auth_settings for an a single
201
+ request; this effectively ignores the
202
+ authentication in the spec for a single request.
203
+ :type _request_auth: dict, optional
204
+ :param _content_type: force content-type for the request.
205
+ :type _content_type: str, Optional
206
+ :param _headers: set to override the headers for a single
207
+ request; this effectively ignores the headers
208
+ in the spec for a single request.
209
+ :type _headers: dict, optional
210
+ :param _host_index: set to override the host_index for a single
211
+ request; this effectively ignores the host_index
212
+ in the spec for a single request.
213
+ :type _host_index: int, optional
214
+ :return: Returns the result object.
215
+ """ # noqa: E501
216
+
217
+ _param = self._create_ptr_record_v1_serialize(
218
+ virtual_machine_id=virtual_machine_id,
219
+ _request_auth=_request_auth,
220
+ _content_type=_content_type,
221
+ _headers=_headers,
222
+ _host_index=_host_index
223
+ )
224
+
225
+ _response_types_map: Dict[str, Optional[str]] = {
226
+ '200': "VPSV1ActionActionResource",
227
+ '401': "CommonSchemaUnauthorizedResponseSchema",
228
+ '500': "CommonSchemaErrorResponseSchema",
229
+ }
230
+ response_data = self.api_client.call_api(
231
+ *_param,
232
+ _request_timeout=_request_timeout
233
+ )
234
+ return response_data.response
235
+
236
+
237
+ def _create_ptr_record_v1_serialize(
238
+ self,
239
+ virtual_machine_id,
240
+ _request_auth,
241
+ _content_type,
242
+ _headers,
243
+ _host_index,
244
+ ) -> RequestSerialized:
245
+
246
+ _host = None
247
+
248
+ _collection_formats: Dict[str, str] = {
249
+ }
250
+
251
+ _path_params: Dict[str, str] = {}
252
+ _query_params: List[Tuple[str, str]] = []
253
+ _header_params: Dict[str, Optional[str]] = _headers or {}
254
+ _form_params: List[Tuple[str, str]] = []
255
+ _files: Dict[
256
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
257
+ ] = {}
258
+ _body_params: Optional[bytes] = None
259
+
260
+ # process the path parameters
261
+ if virtual_machine_id is not None:
262
+ _path_params['virtualMachineId'] = virtual_machine_id
263
+ # process the query parameters
264
+ # process the header parameters
265
+ # process the form parameters
266
+ # process the body parameter
267
+
268
+
269
+ # set the HTTP header `Accept`
270
+ if 'Accept' not in _header_params:
271
+ _header_params['Accept'] = self.api_client.select_header_accept(
272
+ [
273
+ 'application/json'
274
+ ]
275
+ )
276
+
277
+
278
+ # authentication setting
279
+ _auth_settings: List[str] = [
280
+ 'apiToken'
281
+ ]
282
+
283
+ return self.api_client.param_serialize(
284
+ method='POST',
285
+ resource_path='/api/vps/v1/virtual-machines/{virtualMachineId}/ptr',
286
+ path_params=_path_params,
287
+ query_params=_query_params,
288
+ header_params=_header_params,
289
+ body=_body_params,
290
+ post_params=_form_params,
291
+ files=_files,
292
+ auth_settings=_auth_settings,
293
+ collection_formats=_collection_formats,
294
+ _host=_host,
295
+ _request_auth=_request_auth
296
+ )
297
+
298
+
299
+
300
+
301
+ @validate_call
302
+ def delete_ptr_record_v1(
303
+ self,
304
+ virtual_machine_id: Annotated[StrictInt, Field(description="Virtual Machine ID")],
305
+ _request_timeout: Union[
306
+ None,
307
+ Annotated[StrictFloat, Field(gt=0)],
308
+ Tuple[
309
+ Annotated[StrictFloat, Field(gt=0)],
310
+ Annotated[StrictFloat, Field(gt=0)]
311
+ ]
312
+ ] = None,
313
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
314
+ _content_type: Optional[StrictStr] = None,
315
+ _headers: Optional[Dict[StrictStr, Any]] = None,
316
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
317
+ ) -> VPSV1ActionActionResource:
318
+ """Delete PTR record
319
+
320
+ This endpoint deletes a PTR (Pointer) record for a specified virtual machine. Once deleted, reverse DNS lookups to the virtual machine's IP address will no longer return the previously configured hostname.
321
+
322
+ :param virtual_machine_id: Virtual Machine ID (required)
323
+ :type virtual_machine_id: int
324
+ :param _request_timeout: timeout setting for this request. If one
325
+ number provided, it will be total request
326
+ timeout. It can also be a pair (tuple) of
327
+ (connection, read) timeouts.
328
+ :type _request_timeout: int, tuple(int, int), optional
329
+ :param _request_auth: set to override the auth_settings for an a single
330
+ request; this effectively ignores the
331
+ authentication in the spec for a single request.
332
+ :type _request_auth: dict, optional
333
+ :param _content_type: force content-type for the request.
334
+ :type _content_type: str, Optional
335
+ :param _headers: set to override the headers for a single
336
+ request; this effectively ignores the headers
337
+ in the spec for a single request.
338
+ :type _headers: dict, optional
339
+ :param _host_index: set to override the host_index for a single
340
+ request; this effectively ignores the host_index
341
+ in the spec for a single request.
342
+ :type _host_index: int, optional
343
+ :return: Returns the result object.
344
+ """ # noqa: E501
345
+
346
+ _param = self._delete_ptr_record_v1_serialize(
347
+ virtual_machine_id=virtual_machine_id,
348
+ _request_auth=_request_auth,
349
+ _content_type=_content_type,
350
+ _headers=_headers,
351
+ _host_index=_host_index
352
+ )
353
+
354
+ _response_types_map: Dict[str, Optional[str]] = {
355
+ '200': "VPSV1ActionActionResource",
356
+ '401': "CommonSchemaUnauthorizedResponseSchema",
357
+ '500': "CommonSchemaErrorResponseSchema",
358
+ }
359
+ response_data = self.api_client.call_api(
360
+ *_param,
361
+ _request_timeout=_request_timeout
362
+ )
363
+ response_data.read()
364
+ return self.api_client.response_deserialize(
365
+ response_data=response_data,
366
+ response_types_map=_response_types_map,
367
+ ).data
368
+
369
+
370
+ @validate_call
371
+ def delete_ptr_record_v1_with_http_info(
372
+ self,
373
+ virtual_machine_id: Annotated[StrictInt, Field(description="Virtual Machine ID")],
374
+ _request_timeout: Union[
375
+ None,
376
+ Annotated[StrictFloat, Field(gt=0)],
377
+ Tuple[
378
+ Annotated[StrictFloat, Field(gt=0)],
379
+ Annotated[StrictFloat, Field(gt=0)]
380
+ ]
381
+ ] = None,
382
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
383
+ _content_type: Optional[StrictStr] = None,
384
+ _headers: Optional[Dict[StrictStr, Any]] = None,
385
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
386
+ ) -> ApiResponse[VPSV1ActionActionResource]:
387
+ """Delete PTR record
388
+
389
+ This endpoint deletes a PTR (Pointer) record for a specified virtual machine. Once deleted, reverse DNS lookups to the virtual machine's IP address will no longer return the previously configured hostname.
390
+
391
+ :param virtual_machine_id: Virtual Machine ID (required)
392
+ :type virtual_machine_id: int
393
+ :param _request_timeout: timeout setting for this request. If one
394
+ number provided, it will be total request
395
+ timeout. It can also be a pair (tuple) of
396
+ (connection, read) timeouts.
397
+ :type _request_timeout: int, tuple(int, int), optional
398
+ :param _request_auth: set to override the auth_settings for an a single
399
+ request; this effectively ignores the
400
+ authentication in the spec for a single request.
401
+ :type _request_auth: dict, optional
402
+ :param _content_type: force content-type for the request.
403
+ :type _content_type: str, Optional
404
+ :param _headers: set to override the headers for a single
405
+ request; this effectively ignores the headers
406
+ in the spec for a single request.
407
+ :type _headers: dict, optional
408
+ :param _host_index: set to override the host_index for a single
409
+ request; this effectively ignores the host_index
410
+ in the spec for a single request.
411
+ :type _host_index: int, optional
412
+ :return: Returns the result object.
413
+ """ # noqa: E501
414
+
415
+ _param = self._delete_ptr_record_v1_serialize(
416
+ virtual_machine_id=virtual_machine_id,
417
+ _request_auth=_request_auth,
418
+ _content_type=_content_type,
419
+ _headers=_headers,
420
+ _host_index=_host_index
421
+ )
422
+
423
+ _response_types_map: Dict[str, Optional[str]] = {
424
+ '200': "VPSV1ActionActionResource",
425
+ '401': "CommonSchemaUnauthorizedResponseSchema",
426
+ '500': "CommonSchemaErrorResponseSchema",
427
+ }
428
+ response_data = self.api_client.call_api(
429
+ *_param,
430
+ _request_timeout=_request_timeout
431
+ )
432
+ response_data.read()
433
+ return self.api_client.response_deserialize(
434
+ response_data=response_data,
435
+ response_types_map=_response_types_map,
436
+ )
437
+
438
+
439
+ @validate_call
440
+ def delete_ptr_record_v1_without_preload_content(
441
+ self,
442
+ virtual_machine_id: Annotated[StrictInt, Field(description="Virtual Machine ID")],
443
+ _request_timeout: Union[
444
+ None,
445
+ Annotated[StrictFloat, Field(gt=0)],
446
+ Tuple[
447
+ Annotated[StrictFloat, Field(gt=0)],
448
+ Annotated[StrictFloat, Field(gt=0)]
449
+ ]
450
+ ] = None,
451
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
452
+ _content_type: Optional[StrictStr] = None,
453
+ _headers: Optional[Dict[StrictStr, Any]] = None,
454
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
455
+ ) -> RESTResponseType:
456
+ """Delete PTR record
457
+
458
+ This endpoint deletes a PTR (Pointer) record for a specified virtual machine. Once deleted, reverse DNS lookups to the virtual machine's IP address will no longer return the previously configured hostname.
459
+
460
+ :param virtual_machine_id: Virtual Machine ID (required)
461
+ :type virtual_machine_id: int
462
+ :param _request_timeout: timeout setting for this request. If one
463
+ number provided, it will be total request
464
+ timeout. It can also be a pair (tuple) of
465
+ (connection, read) timeouts.
466
+ :type _request_timeout: int, tuple(int, int), optional
467
+ :param _request_auth: set to override the auth_settings for an a single
468
+ request; this effectively ignores the
469
+ authentication in the spec for a single request.
470
+ :type _request_auth: dict, optional
471
+ :param _content_type: force content-type for the request.
472
+ :type _content_type: str, Optional
473
+ :param _headers: set to override the headers for a single
474
+ request; this effectively ignores the headers
475
+ in the spec for a single request.
476
+ :type _headers: dict, optional
477
+ :param _host_index: set to override the host_index for a single
478
+ request; this effectively ignores the host_index
479
+ in the spec for a single request.
480
+ :type _host_index: int, optional
481
+ :return: Returns the result object.
482
+ """ # noqa: E501
483
+
484
+ _param = self._delete_ptr_record_v1_serialize(
485
+ virtual_machine_id=virtual_machine_id,
486
+ _request_auth=_request_auth,
487
+ _content_type=_content_type,
488
+ _headers=_headers,
489
+ _host_index=_host_index
490
+ )
491
+
492
+ _response_types_map: Dict[str, Optional[str]] = {
493
+ '200': "VPSV1ActionActionResource",
494
+ '401': "CommonSchemaUnauthorizedResponseSchema",
495
+ '500': "CommonSchemaErrorResponseSchema",
496
+ }
497
+ response_data = self.api_client.call_api(
498
+ *_param,
499
+ _request_timeout=_request_timeout
500
+ )
501
+ return response_data.response
502
+
503
+
504
+ def _delete_ptr_record_v1_serialize(
505
+ self,
506
+ virtual_machine_id,
507
+ _request_auth,
508
+ _content_type,
509
+ _headers,
510
+ _host_index,
511
+ ) -> RequestSerialized:
512
+
513
+ _host = None
514
+
515
+ _collection_formats: Dict[str, str] = {
516
+ }
517
+
518
+ _path_params: Dict[str, str] = {}
519
+ _query_params: List[Tuple[str, str]] = []
520
+ _header_params: Dict[str, Optional[str]] = _headers or {}
521
+ _form_params: List[Tuple[str, str]] = []
522
+ _files: Dict[
523
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
524
+ ] = {}
525
+ _body_params: Optional[bytes] = None
526
+
527
+ # process the path parameters
528
+ if virtual_machine_id is not None:
529
+ _path_params['virtualMachineId'] = virtual_machine_id
530
+ # process the query parameters
531
+ # process the header parameters
532
+ # process the form parameters
533
+ # process the body parameter
534
+
535
+
536
+ # set the HTTP header `Accept`
537
+ if 'Accept' not in _header_params:
538
+ _header_params['Accept'] = self.api_client.select_header_accept(
539
+ [
540
+ 'application/json'
541
+ ]
542
+ )
543
+
544
+
545
+ # authentication setting
546
+ _auth_settings: List[str] = [
547
+ 'apiToken'
548
+ ]
549
+
550
+ return self.api_client.param_serialize(
551
+ method='DELETE',
552
+ resource_path='/api/vps/v1/virtual-machines/{virtualMachineId}/ptr',
553
+ path_params=_path_params,
554
+ query_params=_query_params,
555
+ header_params=_header_params,
556
+ body=_body_params,
557
+ post_params=_form_params,
558
+ files=_files,
559
+ auth_settings=_auth_settings,
560
+ collection_formats=_collection_formats,
561
+ _host=_host,
562
+ _request_auth=_request_auth
563
+ )
564
+
565
+