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.
- hostinger_api/__init__.py +105 -0
- hostinger_api/api/__init__.py +21 -0
- hostinger_api/api/billing_catalog_api.py +282 -0
- hostinger_api/api/billing_orders_api.py +313 -0
- hostinger_api/api/billing_payment_methods_api.py +819 -0
- hostinger_api/api/billing_subscriptions_api.py +584 -0
- hostinger_api/api/domains_portfolio_api.py +282 -0
- hostinger_api/api/vps_actions_api.py +599 -0
- hostinger_api/api/vps_backups_api.py +882 -0
- hostinger_api/api/vps_data_centers_api.py +282 -0
- hostinger_api/api/vps_firewall_api.py +2872 -0
- hostinger_api/api/vps_malware_scanner_api.py +842 -0
- hostinger_api/api/vps_post_install_scripts_api.py +1419 -0
- hostinger_api/api/vps_public_keys_api.py +1154 -0
- hostinger_api/api/vps_recovery_api.py +597 -0
- hostinger_api/api/vps_snapshots_api.py +1100 -0
- hostinger_api/api/vps_virtual_machine_api.py +3714 -0
- hostinger_api/api/vpsos_templates_api.py +551 -0
- hostinger_api/api/vpsptr_records_api.py +565 -0
- hostinger_api/api_client.py +795 -0
- hostinger_api/api_response.py +21 -0
- hostinger_api/configuration.py +579 -0
- hostinger_api/exceptions.py +214 -0
- hostinger_api/models/__init__.py +72 -0
- hostinger_api/models/billing_v1_catalog_catalog_item_price_resource.py +107 -0
- hostinger_api/models/billing_v1_catalog_catalog_item_resource.py +99 -0
- hostinger_api/models/billing_v1_order_order_billing_address_resource.py +145 -0
- hostinger_api/models/billing_v1_order_order_resource.py +116 -0
- hostinger_api/models/billing_v1_order_store_request.py +97 -0
- hostinger_api/models/billing_v1_order_store_request_items_inner.py +87 -0
- hostinger_api/models/billing_v1_payment_method_payment_method_resource.py +102 -0
- hostinger_api/models/billing_v1_subscription_cancel_request.py +117 -0
- hostinger_api/models/billing_v1_subscription_subscription_resource.py +130 -0
- hostinger_api/models/common_schema_error_response_schema.py +87 -0
- hostinger_api/models/common_schema_pagination_meta_schema.py +89 -0
- hostinger_api/models/common_schema_unauthorized_response_schema.py +87 -0
- hostinger_api/models/common_schema_unprocessable_content_response_schema.py +93 -0
- hostinger_api/models/common_schema_unprocessable_content_response_schema_errors.py +87 -0
- hostinger_api/models/common_success_empty_resource.py +85 -0
- hostinger_api/models/domains_v1_domain_domain_resource.py +126 -0
- hostinger_api/models/vps_get_action_list_v1200_response.py +99 -0
- hostinger_api/models/vps_get_backup_list_v1200_response.py +99 -0
- hostinger_api/models/vps_get_firewall_list_v1200_response.py +99 -0
- hostinger_api/models/vps_get_post_install_script_list_v1200_response.py +99 -0
- hostinger_api/models/vps_get_public_key_list_v1200_response.py +99 -0
- hostinger_api/models/vpsv1_action_action_resource.py +104 -0
- hostinger_api/models/vpsv1_backup_backup_resource.py +90 -0
- hostinger_api/models/vpsv1_data_center_data_center_resource.py +113 -0
- hostinger_api/models/vpsv1_firewall_firewall_resource.py +104 -0
- hostinger_api/models/vpsv1_firewall_firewall_rule_resource.py +115 -0
- hostinger_api/models/vpsv1_firewall_rules_store_request.py +105 -0
- hostinger_api/models/vpsv1_firewall_store_request.py +85 -0
- hostinger_api/models/vpsv1_ip_address_ip_address_resource.py +94 -0
- hostinger_api/models/vpsv1_malware_metrics_resource.py +101 -0
- hostinger_api/models/vpsv1_metrics_metrics_collection.py +149 -0
- hostinger_api/models/vpsv1_metrics_metrics_collection_cpu_usage.py +127 -0
- hostinger_api/models/vpsv1_metrics_metrics_collection_disk_space.py +127 -0
- hostinger_api/models/vpsv1_metrics_metrics_collection_incoming_traffic.py +127 -0
- hostinger_api/models/vpsv1_metrics_metrics_collection_outgoing_traffic.py +127 -0
- hostinger_api/models/vpsv1_metrics_metrics_collection_ram_usage.py +127 -0
- hostinger_api/models/vpsv1_metrics_metrics_collection_uptime.py +127 -0
- hostinger_api/models/vpsv1_metrics_metrics_resource.py +87 -0
- hostinger_api/models/vpsv1_post_install_script_post_install_script_resource.py +94 -0
- hostinger_api/models/vpsv1_post_install_script_store_request.py +87 -0
- hostinger_api/models/vpsv1_public_key_attach_request.py +85 -0
- hostinger_api/models/vpsv1_public_key_public_key_resource.py +89 -0
- hostinger_api/models/vpsv1_public_key_store_request.py +87 -0
- hostinger_api/models/vpsv1_snapshot_snapshot_resource.py +90 -0
- hostinger_api/models/vpsv1_template_template_resource.py +96 -0
- hostinger_api/models/vpsv1_virtual_machine_hostname_update_request.py +85 -0
- hostinger_api/models/vpsv1_virtual_machine_metric_get_request.py +88 -0
- hostinger_api/models/vpsv1_virtual_machine_nameservers_update_request.py +87 -0
- hostinger_api/models/vpsv1_virtual_machine_panel_password_update_request.py +86 -0
- hostinger_api/models/vpsv1_virtual_machine_recovery_start_request.py +85 -0
- hostinger_api/models/vpsv1_virtual_machine_recreate_request.py +90 -0
- hostinger_api/models/vpsv1_virtual_machine_root_password_update_request.py +86 -0
- hostinger_api/models/vpsv1_virtual_machine_setup_request.py +108 -0
- hostinger_api/models/vpsv1_virtual_machine_setup_request_public_key.py +87 -0
- hostinger_api/models/vpsv1_virtual_machine_virtual_machine_resource.py +190 -0
- hostinger_api/models/vpsv1_virtual_machine_virtual_machine_resource_ipv4.py +131 -0
- hostinger_api/models/vpsv1_virtual_machine_virtual_machine_resource_ipv6.py +131 -0
- hostinger_api/models/vpsv1_virtual_machine_virtual_machine_resource_template.py +127 -0
- hostinger_api/py.typed +0 -0
- hostinger_api/rest.py +256 -0
- hostinger_api-1.0.0.dist-info/METADATA +26 -0
- hostinger_api-1.0.0.dist-info/RECORD +88 -0
- hostinger_api-1.0.0.dist-info/WHEEL +5 -0
- hostinger_api-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,87 @@
|
|
|
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
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
import pprint
|
|
15
|
+
import re # noqa: F401
|
|
16
|
+
import json
|
|
17
|
+
|
|
18
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
19
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
20
|
+
from typing import Optional, Set
|
|
21
|
+
from typing_extensions import Self
|
|
22
|
+
|
|
23
|
+
class VPSV1VirtualMachineNameserversUpdateRequest(BaseModel):
|
|
24
|
+
"""
|
|
25
|
+
VPSV1VirtualMachineNameserversUpdateRequest
|
|
26
|
+
""" # noqa: E501
|
|
27
|
+
ns1: StrictStr
|
|
28
|
+
ns2: Optional[StrictStr] = None
|
|
29
|
+
__properties: ClassVar[List[str]] = ["ns1", "ns2"]
|
|
30
|
+
|
|
31
|
+
model_config = ConfigDict(
|
|
32
|
+
populate_by_name=True,
|
|
33
|
+
validate_assignment=True,
|
|
34
|
+
protected_namespaces=(),
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def to_str(self) -> str:
|
|
39
|
+
"""Returns the string representation of the model using alias"""
|
|
40
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
41
|
+
|
|
42
|
+
def to_json(self) -> str:
|
|
43
|
+
"""Returns the JSON representation of the model using alias"""
|
|
44
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
45
|
+
return json.dumps(self.to_dict())
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
49
|
+
"""Create an instance of VPSV1VirtualMachineNameserversUpdateRequest from a JSON string"""
|
|
50
|
+
return cls.from_dict(json.loads(json_str))
|
|
51
|
+
|
|
52
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
53
|
+
"""Return the dictionary representation of the model using alias.
|
|
54
|
+
|
|
55
|
+
This has the following differences from calling pydantic's
|
|
56
|
+
`self.model_dump(by_alias=True)`:
|
|
57
|
+
|
|
58
|
+
* `None` is only added to the output dict for nullable fields that
|
|
59
|
+
were set at model initialization. Other fields with value `None`
|
|
60
|
+
are ignored.
|
|
61
|
+
"""
|
|
62
|
+
excluded_fields: Set[str] = set([
|
|
63
|
+
])
|
|
64
|
+
|
|
65
|
+
_dict = self.model_dump(
|
|
66
|
+
by_alias=True,
|
|
67
|
+
exclude=excluded_fields,
|
|
68
|
+
exclude_none=True,
|
|
69
|
+
)
|
|
70
|
+
return _dict
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
74
|
+
"""Create an instance of VPSV1VirtualMachineNameserversUpdateRequest from a dict"""
|
|
75
|
+
if obj is None:
|
|
76
|
+
return None
|
|
77
|
+
|
|
78
|
+
if not isinstance(obj, dict):
|
|
79
|
+
return cls.model_validate(obj)
|
|
80
|
+
|
|
81
|
+
_obj = cls.model_validate({
|
|
82
|
+
"ns1": obj.get("ns1"),
|
|
83
|
+
"ns2": obj.get("ns2")
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
import pprint
|
|
15
|
+
import re # noqa: F401
|
|
16
|
+
import json
|
|
17
|
+
|
|
18
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
19
|
+
from typing import Any, ClassVar, Dict, List
|
|
20
|
+
from typing_extensions import Annotated
|
|
21
|
+
from typing import Optional, Set
|
|
22
|
+
from typing_extensions import Self
|
|
23
|
+
|
|
24
|
+
class VPSV1VirtualMachinePanelPasswordUpdateRequest(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
VPSV1VirtualMachinePanelPasswordUpdateRequest
|
|
27
|
+
""" # noqa: E501
|
|
28
|
+
password: Annotated[str, Field(min_length=8, strict=True)] = Field(description="Panel password for the virtual machine")
|
|
29
|
+
__properties: ClassVar[List[str]] = ["password"]
|
|
30
|
+
|
|
31
|
+
model_config = ConfigDict(
|
|
32
|
+
populate_by_name=True,
|
|
33
|
+
validate_assignment=True,
|
|
34
|
+
protected_namespaces=(),
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def to_str(self) -> str:
|
|
39
|
+
"""Returns the string representation of the model using alias"""
|
|
40
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
41
|
+
|
|
42
|
+
def to_json(self) -> str:
|
|
43
|
+
"""Returns the JSON representation of the model using alias"""
|
|
44
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
45
|
+
return json.dumps(self.to_dict())
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
49
|
+
"""Create an instance of VPSV1VirtualMachinePanelPasswordUpdateRequest from a JSON string"""
|
|
50
|
+
return cls.from_dict(json.loads(json_str))
|
|
51
|
+
|
|
52
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
53
|
+
"""Return the dictionary representation of the model using alias.
|
|
54
|
+
|
|
55
|
+
This has the following differences from calling pydantic's
|
|
56
|
+
`self.model_dump(by_alias=True)`:
|
|
57
|
+
|
|
58
|
+
* `None` is only added to the output dict for nullable fields that
|
|
59
|
+
were set at model initialization. Other fields with value `None`
|
|
60
|
+
are ignored.
|
|
61
|
+
"""
|
|
62
|
+
excluded_fields: Set[str] = set([
|
|
63
|
+
])
|
|
64
|
+
|
|
65
|
+
_dict = self.model_dump(
|
|
66
|
+
by_alias=True,
|
|
67
|
+
exclude=excluded_fields,
|
|
68
|
+
exclude_none=True,
|
|
69
|
+
)
|
|
70
|
+
return _dict
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
74
|
+
"""Create an instance of VPSV1VirtualMachinePanelPasswordUpdateRequest from a dict"""
|
|
75
|
+
if obj is None:
|
|
76
|
+
return None
|
|
77
|
+
|
|
78
|
+
if not isinstance(obj, dict):
|
|
79
|
+
return cls.model_validate(obj)
|
|
80
|
+
|
|
81
|
+
_obj = cls.model_validate({
|
|
82
|
+
"password": obj.get("password")
|
|
83
|
+
})
|
|
84
|
+
return _obj
|
|
85
|
+
|
|
86
|
+
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
import pprint
|
|
15
|
+
import re # noqa: F401
|
|
16
|
+
import json
|
|
17
|
+
|
|
18
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
19
|
+
from typing import Any, ClassVar, Dict, List
|
|
20
|
+
from typing import Optional, Set
|
|
21
|
+
from typing_extensions import Self
|
|
22
|
+
|
|
23
|
+
class VPSV1VirtualMachineRecoveryStartRequest(BaseModel):
|
|
24
|
+
"""
|
|
25
|
+
VPSV1VirtualMachineRecoveryStartRequest
|
|
26
|
+
""" # noqa: E501
|
|
27
|
+
root_password: StrictStr = Field(description="Temporary root password for recovery mode")
|
|
28
|
+
__properties: ClassVar[List[str]] = ["root_password"]
|
|
29
|
+
|
|
30
|
+
model_config = ConfigDict(
|
|
31
|
+
populate_by_name=True,
|
|
32
|
+
validate_assignment=True,
|
|
33
|
+
protected_namespaces=(),
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def to_str(self) -> str:
|
|
38
|
+
"""Returns the string representation of the model using alias"""
|
|
39
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
40
|
+
|
|
41
|
+
def to_json(self) -> str:
|
|
42
|
+
"""Returns the JSON representation of the model using alias"""
|
|
43
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
44
|
+
return json.dumps(self.to_dict())
|
|
45
|
+
|
|
46
|
+
@classmethod
|
|
47
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
48
|
+
"""Create an instance of VPSV1VirtualMachineRecoveryStartRequest from a JSON string"""
|
|
49
|
+
return cls.from_dict(json.loads(json_str))
|
|
50
|
+
|
|
51
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
52
|
+
"""Return the dictionary representation of the model using alias.
|
|
53
|
+
|
|
54
|
+
This has the following differences from calling pydantic's
|
|
55
|
+
`self.model_dump(by_alias=True)`:
|
|
56
|
+
|
|
57
|
+
* `None` is only added to the output dict for nullable fields that
|
|
58
|
+
were set at model initialization. Other fields with value `None`
|
|
59
|
+
are ignored.
|
|
60
|
+
"""
|
|
61
|
+
excluded_fields: Set[str] = set([
|
|
62
|
+
])
|
|
63
|
+
|
|
64
|
+
_dict = self.model_dump(
|
|
65
|
+
by_alias=True,
|
|
66
|
+
exclude=excluded_fields,
|
|
67
|
+
exclude_none=True,
|
|
68
|
+
)
|
|
69
|
+
return _dict
|
|
70
|
+
|
|
71
|
+
@classmethod
|
|
72
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
73
|
+
"""Create an instance of VPSV1VirtualMachineRecoveryStartRequest from a dict"""
|
|
74
|
+
if obj is None:
|
|
75
|
+
return None
|
|
76
|
+
|
|
77
|
+
if not isinstance(obj, dict):
|
|
78
|
+
return cls.model_validate(obj)
|
|
79
|
+
|
|
80
|
+
_obj = cls.model_validate({
|
|
81
|
+
"root_password": obj.get("root_password")
|
|
82
|
+
})
|
|
83
|
+
return _obj
|
|
84
|
+
|
|
85
|
+
|
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
import pprint
|
|
15
|
+
import re # noqa: F401
|
|
16
|
+
import json
|
|
17
|
+
|
|
18
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt
|
|
19
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
20
|
+
from typing_extensions import Annotated
|
|
21
|
+
from typing import Optional, Set
|
|
22
|
+
from typing_extensions import Self
|
|
23
|
+
|
|
24
|
+
class VPSV1VirtualMachineRecreateRequest(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
VPSV1VirtualMachineRecreateRequest
|
|
27
|
+
""" # noqa: E501
|
|
28
|
+
template_id: StrictInt = Field(description="Template ID")
|
|
29
|
+
password: Optional[Annotated[str, Field(min_length=8, strict=True)]] = Field(default=None, description="Password for the virtual machine. If not provided, random password will be generated. Password will not be shown in the response.")
|
|
30
|
+
post_install_script_id: Optional[StrictInt] = Field(default=None, description="Post-install script ID")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["template_id", "password", "post_install_script_id"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of VPSV1VirtualMachineRecreateRequest from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
return _dict
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
+
"""Create an instance of VPSV1VirtualMachineRecreateRequest from a dict"""
|
|
77
|
+
if obj is None:
|
|
78
|
+
return None
|
|
79
|
+
|
|
80
|
+
if not isinstance(obj, dict):
|
|
81
|
+
return cls.model_validate(obj)
|
|
82
|
+
|
|
83
|
+
_obj = cls.model_validate({
|
|
84
|
+
"template_id": obj.get("template_id"),
|
|
85
|
+
"password": obj.get("password"),
|
|
86
|
+
"post_install_script_id": obj.get("post_install_script_id")
|
|
87
|
+
})
|
|
88
|
+
return _obj
|
|
89
|
+
|
|
90
|
+
|
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
import pprint
|
|
15
|
+
import re # noqa: F401
|
|
16
|
+
import json
|
|
17
|
+
|
|
18
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
19
|
+
from typing import Any, ClassVar, Dict, List
|
|
20
|
+
from typing_extensions import Annotated
|
|
21
|
+
from typing import Optional, Set
|
|
22
|
+
from typing_extensions import Self
|
|
23
|
+
|
|
24
|
+
class VPSV1VirtualMachineRootPasswordUpdateRequest(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
VPSV1VirtualMachineRootPasswordUpdateRequest
|
|
27
|
+
""" # noqa: E501
|
|
28
|
+
password: Annotated[str, Field(min_length=8, strict=True)] = Field(description="Root password for the virtual machine")
|
|
29
|
+
__properties: ClassVar[List[str]] = ["password"]
|
|
30
|
+
|
|
31
|
+
model_config = ConfigDict(
|
|
32
|
+
populate_by_name=True,
|
|
33
|
+
validate_assignment=True,
|
|
34
|
+
protected_namespaces=(),
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def to_str(self) -> str:
|
|
39
|
+
"""Returns the string representation of the model using alias"""
|
|
40
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
41
|
+
|
|
42
|
+
def to_json(self) -> str:
|
|
43
|
+
"""Returns the JSON representation of the model using alias"""
|
|
44
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
45
|
+
return json.dumps(self.to_dict())
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
49
|
+
"""Create an instance of VPSV1VirtualMachineRootPasswordUpdateRequest from a JSON string"""
|
|
50
|
+
return cls.from_dict(json.loads(json_str))
|
|
51
|
+
|
|
52
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
53
|
+
"""Return the dictionary representation of the model using alias.
|
|
54
|
+
|
|
55
|
+
This has the following differences from calling pydantic's
|
|
56
|
+
`self.model_dump(by_alias=True)`:
|
|
57
|
+
|
|
58
|
+
* `None` is only added to the output dict for nullable fields that
|
|
59
|
+
were set at model initialization. Other fields with value `None`
|
|
60
|
+
are ignored.
|
|
61
|
+
"""
|
|
62
|
+
excluded_fields: Set[str] = set([
|
|
63
|
+
])
|
|
64
|
+
|
|
65
|
+
_dict = self.model_dump(
|
|
66
|
+
by_alias=True,
|
|
67
|
+
exclude=excluded_fields,
|
|
68
|
+
exclude_none=True,
|
|
69
|
+
)
|
|
70
|
+
return _dict
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
74
|
+
"""Create an instance of VPSV1VirtualMachineRootPasswordUpdateRequest from a dict"""
|
|
75
|
+
if obj is None:
|
|
76
|
+
return None
|
|
77
|
+
|
|
78
|
+
if not isinstance(obj, dict):
|
|
79
|
+
return cls.model_validate(obj)
|
|
80
|
+
|
|
81
|
+
_obj = cls.model_validate({
|
|
82
|
+
"password": obj.get("password")
|
|
83
|
+
})
|
|
84
|
+
return _obj
|
|
85
|
+
|
|
86
|
+
|
|
@@ -0,0 +1,108 @@
|
|
|
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
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
import pprint
|
|
15
|
+
import re # noqa: F401
|
|
16
|
+
import json
|
|
17
|
+
|
|
18
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
|
19
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
20
|
+
from typing_extensions import Annotated
|
|
21
|
+
from hostinger_api.models.vpsv1_virtual_machine_setup_request_public_key import VPSV1VirtualMachineSetupRequestPublicKey
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class VPSV1VirtualMachineSetupRequest(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
VPSV1VirtualMachineSetupRequest
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
template_id: StrictInt = Field(description="Template ID")
|
|
30
|
+
data_center_id: StrictInt = Field(description="Data center ID")
|
|
31
|
+
post_install_script_id: Optional[StrictInt] = Field(default=None, description="Post-install script ID")
|
|
32
|
+
password: Optional[Annotated[str, Field(min_length=8, strict=True)]] = Field(default=None, description="Password for the virtual machine. If not provided, random password will be generated. Password will not be shown in the response.")
|
|
33
|
+
hostname: Optional[StrictStr] = Field(default=None, description="Override default hostname of the virtual machine")
|
|
34
|
+
install_monarx: Optional[StrictBool] = Field(default=False, description="Install Monarx malware scanner (if supported)")
|
|
35
|
+
enable_backups: Optional[StrictBool] = Field(default=True, description="Enable weekly backup schedule")
|
|
36
|
+
ns1: Optional[StrictStr] = None
|
|
37
|
+
ns2: Optional[StrictStr] = None
|
|
38
|
+
public_key: Optional[VPSV1VirtualMachineSetupRequestPublicKey] = None
|
|
39
|
+
__properties: ClassVar[List[str]] = ["template_id", "data_center_id", "post_install_script_id", "password", "hostname", "install_monarx", "enable_backups", "ns1", "ns2", "public_key"]
|
|
40
|
+
|
|
41
|
+
model_config = ConfigDict(
|
|
42
|
+
populate_by_name=True,
|
|
43
|
+
validate_assignment=True,
|
|
44
|
+
protected_namespaces=(),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def to_str(self) -> str:
|
|
49
|
+
"""Returns the string representation of the model using alias"""
|
|
50
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
51
|
+
|
|
52
|
+
def to_json(self) -> str:
|
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
|
54
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
55
|
+
return json.dumps(self.to_dict())
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
59
|
+
"""Create an instance of VPSV1VirtualMachineSetupRequest from a JSON string"""
|
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
|
61
|
+
|
|
62
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
63
|
+
"""Return the dictionary representation of the model using alias.
|
|
64
|
+
|
|
65
|
+
This has the following differences from calling pydantic's
|
|
66
|
+
`self.model_dump(by_alias=True)`:
|
|
67
|
+
|
|
68
|
+
* `None` is only added to the output dict for nullable fields that
|
|
69
|
+
were set at model initialization. Other fields with value `None`
|
|
70
|
+
are ignored.
|
|
71
|
+
"""
|
|
72
|
+
excluded_fields: Set[str] = set([
|
|
73
|
+
])
|
|
74
|
+
|
|
75
|
+
_dict = self.model_dump(
|
|
76
|
+
by_alias=True,
|
|
77
|
+
exclude=excluded_fields,
|
|
78
|
+
exclude_none=True,
|
|
79
|
+
)
|
|
80
|
+
# override the default output from pydantic by calling `to_dict()` of public_key
|
|
81
|
+
if self.public_key:
|
|
82
|
+
_dict['public_key'] = self.public_key.to_dict()
|
|
83
|
+
return _dict
|
|
84
|
+
|
|
85
|
+
@classmethod
|
|
86
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
87
|
+
"""Create an instance of VPSV1VirtualMachineSetupRequest from a dict"""
|
|
88
|
+
if obj is None:
|
|
89
|
+
return None
|
|
90
|
+
|
|
91
|
+
if not isinstance(obj, dict):
|
|
92
|
+
return cls.model_validate(obj)
|
|
93
|
+
|
|
94
|
+
_obj = cls.model_validate({
|
|
95
|
+
"template_id": obj.get("template_id"),
|
|
96
|
+
"data_center_id": obj.get("data_center_id"),
|
|
97
|
+
"post_install_script_id": obj.get("post_install_script_id"),
|
|
98
|
+
"password": obj.get("password"),
|
|
99
|
+
"hostname": obj.get("hostname"),
|
|
100
|
+
"install_monarx": obj.get("install_monarx") if obj.get("install_monarx") is not None else False,
|
|
101
|
+
"enable_backups": obj.get("enable_backups") if obj.get("enable_backups") is not None else True,
|
|
102
|
+
"ns1": obj.get("ns1"),
|
|
103
|
+
"ns2": obj.get("ns2"),
|
|
104
|
+
"public_key": VPSV1VirtualMachineSetupRequestPublicKey.from_dict(obj["public_key"]) if obj.get("public_key") is not None else None
|
|
105
|
+
})
|
|
106
|
+
return _obj
|
|
107
|
+
|
|
108
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
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
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
import pprint
|
|
15
|
+
import re # noqa: F401
|
|
16
|
+
import json
|
|
17
|
+
|
|
18
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
19
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
20
|
+
from typing import Optional, Set
|
|
21
|
+
from typing_extensions import Self
|
|
22
|
+
|
|
23
|
+
class VPSV1VirtualMachineSetupRequestPublicKey(BaseModel):
|
|
24
|
+
"""
|
|
25
|
+
VPSV1VirtualMachineSetupRequestPublicKey
|
|
26
|
+
""" # noqa: E501
|
|
27
|
+
name: Optional[StrictStr] = Field(default=None, description="Name of the SSH key")
|
|
28
|
+
key: Optional[StrictStr] = Field(default=None, description="SSH public key")
|
|
29
|
+
__properties: ClassVar[List[str]] = ["name", "key"]
|
|
30
|
+
|
|
31
|
+
model_config = ConfigDict(
|
|
32
|
+
populate_by_name=True,
|
|
33
|
+
validate_assignment=True,
|
|
34
|
+
protected_namespaces=(),
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def to_str(self) -> str:
|
|
39
|
+
"""Returns the string representation of the model using alias"""
|
|
40
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
41
|
+
|
|
42
|
+
def to_json(self) -> str:
|
|
43
|
+
"""Returns the JSON representation of the model using alias"""
|
|
44
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
45
|
+
return json.dumps(self.to_dict())
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
49
|
+
"""Create an instance of VPSV1VirtualMachineSetupRequestPublicKey from a JSON string"""
|
|
50
|
+
return cls.from_dict(json.loads(json_str))
|
|
51
|
+
|
|
52
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
53
|
+
"""Return the dictionary representation of the model using alias.
|
|
54
|
+
|
|
55
|
+
This has the following differences from calling pydantic's
|
|
56
|
+
`self.model_dump(by_alias=True)`:
|
|
57
|
+
|
|
58
|
+
* `None` is only added to the output dict for nullable fields that
|
|
59
|
+
were set at model initialization. Other fields with value `None`
|
|
60
|
+
are ignored.
|
|
61
|
+
"""
|
|
62
|
+
excluded_fields: Set[str] = set([
|
|
63
|
+
])
|
|
64
|
+
|
|
65
|
+
_dict = self.model_dump(
|
|
66
|
+
by_alias=True,
|
|
67
|
+
exclude=excluded_fields,
|
|
68
|
+
exclude_none=True,
|
|
69
|
+
)
|
|
70
|
+
return _dict
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
74
|
+
"""Create an instance of VPSV1VirtualMachineSetupRequestPublicKey from a dict"""
|
|
75
|
+
if obj is None:
|
|
76
|
+
return None
|
|
77
|
+
|
|
78
|
+
if not isinstance(obj, dict):
|
|
79
|
+
return cls.model_validate(obj)
|
|
80
|
+
|
|
81
|
+
_obj = cls.model_validate({
|
|
82
|
+
"name": obj.get("name"),
|
|
83
|
+
"key": obj.get("key")
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|