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.
- ha_sdk_python/__init__.py +490 -0
- ha_sdk_python/api/__init__.py +15 -0
- ha_sdk_python/api/backups_api.py +2434 -0
- ha_sdk_python/api/console_access_api.py +334 -0
- ha_sdk_python/api/dns_api.py +896 -0
- ha_sdk_python/api/firewall_api.py +1534 -0
- ha_sdk_python/api/monitoring_api.py +1234 -0
- ha_sdk_python/api/power_management_api.py +2434 -0
- ha_sdk_python/api/security_api.py +1243 -0
- ha_sdk_python/api/service_management_api.py +1797 -0
- ha_sdk_python/api/snapshots_api.py +1534 -0
- ha_sdk_python/api/user_management_api.py +331 -0
- ha_sdk_python/api/vps_management_api.py +2399 -0
- ha_sdk_python/api_client.py +805 -0
- ha_sdk_python/api_response.py +21 -0
- ha_sdk_python/configuration.py +593 -0
- ha_sdk_python/exceptions.py +218 -0
- ha_sdk_python/models/__init__.py +227 -0
- ha_sdk_python/models/backup_create_response_data.py +97 -0
- ha_sdk_python/models/backup_creation_info.py +95 -0
- ha_sdk_python/models/backup_item.py +95 -0
- ha_sdk_python/models/backup_mode.py +89 -0
- ha_sdk_python/models/backup_mode_type.py +38 -0
- ha_sdk_python/models/backup_schedule.py +98 -0
- ha_sdk_python/models/backup_schedule_list_response_data.py +97 -0
- ha_sdk_python/models/bad_request_error_response_content.py +89 -0
- ha_sdk_python/models/billing_cycle.py +37 -0
- ha_sdk_python/models/cancel_vps_request_content.py +90 -0
- ha_sdk_python/models/cancel_vps_response_content.py +94 -0
- ha_sdk_python/models/catalogue_config_option.py +105 -0
- ha_sdk_python/models/catalogue_config_suboption.py +96 -0
- ha_sdk_python/models/catalogue_currency.py +91 -0
- ha_sdk_python/models/catalogue_data.py +107 -0
- ha_sdk_python/models/catalogue_group.py +99 -0
- ha_sdk_python/models/catalogue_plan.py +108 -0
- ha_sdk_python/models/catalogue_product.py +131 -0
- ha_sdk_python/models/change_password_request_content.py +90 -0
- ha_sdk_python/models/change_password_response_content.py +94 -0
- ha_sdk_python/models/compression_method.py +89 -0
- ha_sdk_python/models/compression_type.py +39 -0
- ha_sdk_python/models/create_backup_request_content.py +93 -0
- ha_sdk_python/models/create_backup_response_content.py +94 -0
- ha_sdk_python/models/create_backup_schedule_request_content.py +108 -0
- ha_sdk_python/models/create_backup_schedule_response_content.py +94 -0
- ha_sdk_python/models/create_firewall_rule_request_content.py +115 -0
- ha_sdk_python/models/create_firewall_rule_response_content.py +94 -0
- ha_sdk_python/models/create_notification_request_content.py +111 -0
- ha_sdk_python/models/create_notification_response_content.py +94 -0
- ha_sdk_python/models/create_order_domain_item.py +101 -0
- ha_sdk_python/models/create_order_items.py +105 -0
- ha_sdk_python/models/create_order_product.py +108 -0
- ha_sdk_python/models/create_order_product_item.py +101 -0
- ha_sdk_python/models/create_order_request_content.py +97 -0
- ha_sdk_python/models/create_order_response_content.py +94 -0
- ha_sdk_python/models/create_order_response_data.py +126 -0
- ha_sdk_python/models/create_order_total.py +91 -0
- ha_sdk_python/models/create_power_task_request_content.py +160 -0
- ha_sdk_python/models/create_power_task_response_content.py +94 -0
- ha_sdk_python/models/create_rdns_record_request_content.py +96 -0
- ha_sdk_python/models/create_rdns_record_response_content.py +94 -0
- ha_sdk_python/models/create_rdns_record_response_data.py +91 -0
- ha_sdk_python/models/create_snapshot_request_content.py +91 -0
- ha_sdk_python/models/create_snapshot_response_content.py +94 -0
- ha_sdk_python/models/day_of_week.py +42 -0
- ha_sdk_python/models/delete_backup_request_content.py +89 -0
- ha_sdk_python/models/delete_backup_response_content.py +94 -0
- ha_sdk_python/models/delete_backup_schedule_request_content.py +89 -0
- ha_sdk_python/models/delete_backup_schedule_response_content.py +94 -0
- ha_sdk_python/models/delete_firewall_rule_request_content.py +89 -0
- ha_sdk_python/models/delete_firewall_rule_response_content.py +94 -0
- ha_sdk_python/models/delete_notification_request_content.py +89 -0
- ha_sdk_python/models/delete_notification_response_content.py +94 -0
- ha_sdk_python/models/delete_power_task_request_content.py +89 -0
- ha_sdk_python/models/delete_power_task_response_content.py +94 -0
- ha_sdk_python/models/delete_rdns_record_request_content.py +88 -0
- ha_sdk_python/models/delete_rdns_record_response_content.py +94 -0
- ha_sdk_python/models/delete_snapshot_request_content.py +89 -0
- ha_sdk_python/models/delete_snapshot_response_content.py +94 -0
- ha_sdk_python/models/edit_backup_schedule_request_content.py +110 -0
- ha_sdk_python/models/edit_backup_schedule_response_content.py +94 -0
- ha_sdk_python/models/firewall_list_response_data.py +125 -0
- ha_sdk_python/models/firewall_move_direction.py +39 -0
- ha_sdk_python/models/firewall_move_response_data.py +91 -0
- ha_sdk_python/models/firewall_option.py +89 -0
- ha_sdk_python/models/firewall_rule.py +113 -0
- ha_sdk_python/models/firewall_rule_action.py +38 -0
- ha_sdk_python/models/firewall_rule_type.py +38 -0
- ha_sdk_python/models/forbidden_error_response_content.py +89 -0
- ha_sdk_python/models/get_catalogue_request_content.py +89 -0
- ha_sdk_python/models/get_catalogue_response_content.py +94 -0
- ha_sdk_python/models/get_no_vnc_console_request_content.py +87 -0
- ha_sdk_python/models/get_no_vnc_console_response_content.py +94 -0
- ha_sdk_python/models/get_private_ssh_key_request_content.py +87 -0
- ha_sdk_python/models/get_private_ssh_key_response_content.py +94 -0
- ha_sdk_python/models/get_public_ssh_key_request_content.py +87 -0
- ha_sdk_python/models/get_public_ssh_key_response_content.py +94 -0
- ha_sdk_python/models/get_vps_config_request_content.py +87 -0
- ha_sdk_python/models/get_vps_config_response_content.py +94 -0
- ha_sdk_python/models/get_vps_details_request_content.py +87 -0
- ha_sdk_python/models/get_vps_details_response_content.py +94 -0
- ha_sdk_python/models/internal_service_error_response_content.py +89 -0
- ha_sdk_python/models/invalid_state_error_response_content.py +89 -0
- ha_sdk_python/models/list_backup_schedules_request_content.py +87 -0
- ha_sdk_python/models/list_backup_schedules_response_content.py +94 -0
- ha_sdk_python/models/list_backups_request_content.py +87 -0
- ha_sdk_python/models/list_backups_response_content.py +94 -0
- ha_sdk_python/models/list_firewall_rules_request_content.py +87 -0
- ha_sdk_python/models/list_firewall_rules_response_content.py +94 -0
- ha_sdk_python/models/list_isos_request_content.py +87 -0
- ha_sdk_python/models/list_isos_response_content.py +94 -0
- ha_sdk_python/models/list_isos_response_data.py +89 -0
- ha_sdk_python/models/list_notifications_request_content.py +87 -0
- ha_sdk_python/models/list_notifications_response_content.py +94 -0
- ha_sdk_python/models/list_orders_response_content.py +94 -0
- ha_sdk_python/models/list_orders_response_data.py +95 -0
- ha_sdk_python/models/list_power_tasks_request_content.py +87 -0
- ha_sdk_python/models/list_power_tasks_response_content.py +94 -0
- ha_sdk_python/models/list_rdns_records_response_content.py +94 -0
- ha_sdk_python/models/list_rdns_response_data.py +115 -0
- ha_sdk_python/models/list_reinstall_os_request_content.py +87 -0
- ha_sdk_python/models/list_reinstall_os_response_content.py +94 -0
- ha_sdk_python/models/list_reinstall_os_response_data.py +89 -0
- ha_sdk_python/models/list_snapshots_request_content.py +87 -0
- ha_sdk_python/models/list_snapshots_response_content.py +94 -0
- ha_sdk_python/models/list_vps_services_data.py +95 -0
- ha_sdk_python/models/list_vps_services_response_content.py +94 -0
- ha_sdk_python/models/mount_iso_request_content.py +91 -0
- ha_sdk_python/models/mount_iso_response_content.py +94 -0
- ha_sdk_python/models/move_firewall_rule_request_content.py +94 -0
- ha_sdk_python/models/move_firewall_rule_response_content.py +94 -0
- ha_sdk_python/models/no_vnc_console_details.py +95 -0
- ha_sdk_python/models/no_vnc_console_response_data.py +93 -0
- ha_sdk_python/models/notification.py +105 -0
- ha_sdk_python/models/notification_create_response_data.py +93 -0
- ha_sdk_python/models/notification_dialog_rules.py +95 -0
- ha_sdk_python/models/notification_list_response_data.py +103 -0
- ha_sdk_python/models/notification_status.py +43 -0
- ha_sdk_python/models/operation_status.py +37 -0
- ha_sdk_python/models/order.py +109 -0
- ha_sdk_python/models/order_last_attempt.py +93 -0
- ha_sdk_python/models/order_warning.py +89 -0
- ha_sdk_python/models/payment_error.py +89 -0
- ha_sdk_python/models/payment_status.py +38 -0
- ha_sdk_python/models/power_task.py +105 -0
- ha_sdk_python/models/power_task_action.py +38 -0
- ha_sdk_python/models/power_task_create_response_data.py +93 -0
- ha_sdk_python/models/power_task_dialog_rules.py +95 -0
- ha_sdk_python/models/power_task_job_type.py +38 -0
- ha_sdk_python/models/power_task_list_response_data.py +107 -0
- ha_sdk_python/models/public_ssh_key_response_data.py +93 -0
- ha_sdk_python/models/rdns_available_item.py +111 -0
- ha_sdk_python/models/rdns_pool.py +89 -0
- ha_sdk_python/models/rdns_record.py +109 -0
- ha_sdk_python/models/reboot_vps_request_content.py +87 -0
- ha_sdk_python/models/reboot_vps_response_content.py +94 -0
- ha_sdk_python/models/resource_not_found_error_response_content.py +89 -0
- ha_sdk_python/models/restore_backup_request_content.py +89 -0
- ha_sdk_python/models/restore_backup_response_content.py +94 -0
- ha_sdk_python/models/retry_payment_request_content.py +89 -0
- ha_sdk_python/models/retry_payment_response_content.py +94 -0
- ha_sdk_python/models/retry_payment_response_data.py +98 -0
- ha_sdk_python/models/retry_payment_total.py +91 -0
- ha_sdk_python/models/rollback_snapshot_request_content.py +89 -0
- ha_sdk_python/models/rollback_snapshot_response_content.py +94 -0
- ha_sdk_python/models/service_backups_response_data.py +131 -0
- ha_sdk_python/models/service_snapshots_response_data.py +101 -0
- ha_sdk_python/models/service_unavailable_error_response_content.py +89 -0
- ha_sdk_python/models/shutdown_vps_request_content.py +87 -0
- ha_sdk_python/models/shutdown_vps_response_content.py +94 -0
- ha_sdk_python/models/snapshot_create_response_data.py +89 -0
- ha_sdk_python/models/snapshot_item.py +95 -0
- ha_sdk_python/models/ssh_key_details.py +89 -0
- ha_sdk_python/models/start_vps_request_content.py +87 -0
- ha_sdk_python/models/start_vps_response_content.py +94 -0
- ha_sdk_python/models/stop_vps_request_content.py +87 -0
- ha_sdk_python/models/stop_vps_response_content.py +94 -0
- ha_sdk_python/models/too_many_requests_error_response_content.py +89 -0
- ha_sdk_python/models/trigger_reinstall_request_content.py +89 -0
- ha_sdk_python/models/trigger_reinstall_response_content.py +94 -0
- ha_sdk_python/models/trigger_reinstall_response_data.py +89 -0
- ha_sdk_python/models/unauthorized_error_response_content.py +89 -0
- ha_sdk_python/models/update_firewall_rule_request_content.py +94 -0
- ha_sdk_python/models/update_firewall_rule_response_content.py +94 -0
- ha_sdk_python/models/update_notification_request_content.py +113 -0
- ha_sdk_python/models/update_notification_response_content.py +94 -0
- ha_sdk_python/models/update_power_task_request_content.py +164 -0
- ha_sdk_python/models/update_power_task_response_content.py +94 -0
- ha_sdk_python/models/update_snapshot_request_content.py +91 -0
- ha_sdk_python/models/update_snapshot_response_content.py +94 -0
- ha_sdk_python/models/update_ssh_keys_request_content.py +97 -0
- ha_sdk_python/models/update_ssh_keys_response_content.py +94 -0
- ha_sdk_python/models/update_vps_config_request_content.py +99 -0
- ha_sdk_python/models/update_vps_config_response_content.py +94 -0
- ha_sdk_python/models/user_change_password_details.py +91 -0
- ha_sdk_python/models/user_change_password_request_content.py +92 -0
- ha_sdk_python/models/user_change_password_response_content.py +94 -0
- ha_sdk_python/models/user_change_password_response_data.py +95 -0
- ha_sdk_python/models/validate_pricing_base.py +89 -0
- ha_sdk_python/models/validate_pricing_breakdown.py +103 -0
- ha_sdk_python/models/validate_pricing_config_item.py +116 -0
- ha_sdk_python/models/validate_pricing_currency.py +93 -0
- ha_sdk_python/models/validate_pricing_discount.py +97 -0
- ha_sdk_python/models/validate_pricing_plan_config.py +97 -0
- ha_sdk_python/models/validate_pricing_plan_pricing.py +89 -0
- ha_sdk_python/models/validate_pricing_price_range.py +91 -0
- ha_sdk_python/models/validate_pricing_product.py +101 -0
- ha_sdk_python/models/validate_pricing_product_result.py +121 -0
- ha_sdk_python/models/validate_pricing_prorata.py +95 -0
- ha_sdk_python/models/validate_pricing_request_content.py +97 -0
- ha_sdk_python/models/validate_pricing_response_content.py +94 -0
- ha_sdk_python/models/validate_pricing_response_data.py +109 -0
- ha_sdk_python/models/validate_pricing_summary.py +101 -0
- ha_sdk_python/models/validate_pricing_summary_recurring.py +91 -0
- ha_sdk_python/models/validation_error_response_content.py +89 -0
- ha_sdk_python/models/vps_available_features.py +115 -0
- ha_sdk_python/models/vps_bandwidth_info.py +94 -0
- ha_sdk_python/models/vps_cancel_response_data.py +93 -0
- ha_sdk_python/models/vps_cancel_type.py +37 -0
- ha_sdk_python/models/vps_config_response_data.py +108 -0
- ha_sdk_python/models/vps_cpu_info.py +92 -0
- ha_sdk_python/models/vps_credentials.py +89 -0
- ha_sdk_python/models/vps_details_response.py +143 -0
- ha_sdk_python/models/vps_disk_info.py +96 -0
- ha_sdk_python/models/vps_memory_info.py +96 -0
- ha_sdk_python/models/vps_network_rate.py +92 -0
- ha_sdk_python/models/vps_os_info.py +89 -0
- ha_sdk_python/models/vps_service_info.py +97 -0
- ha_sdk_python/models/vps_simple_action_response_data.py +87 -0
- ha_sdk_python/models/vps_vm_info.py +102 -0
- ha_sdk_python/py.typed +0 -0
- ha_sdk_python/rest.py +263 -0
- ha_sdk_python/retryable_paths.py +26 -0
- ha_sdk_python-1.0.10.dist-info/METADATA +131 -0
- ha_sdk_python-1.0.10.dist-info/RECORD +237 -0
- ha_sdk_python-1.0.10.dist-info/WHEEL +5 -0
- ha_sdk_python-1.0.10.dist-info/licenses/LICENSE +21 -0
- ha_sdk_python-1.0.10.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
HostAfricaApi
|
|
5
|
+
|
|
6
|
+
HostAfrica API
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 2026-01-01
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from ha_sdk_python.models.create_order_response_data import CreateOrderResponseData
|
|
23
|
+
from ha_sdk_python.models.operation_status import OperationStatus
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class CreateOrderResponseContent(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
CreateOrderResponseContent
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
status: OperationStatus
|
|
32
|
+
data: CreateOrderResponseData
|
|
33
|
+
__properties: ClassVar[List[str]] = ["status", "data"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
populate_by_name=True,
|
|
37
|
+
validate_assignment=True,
|
|
38
|
+
protected_namespaces=(),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
49
|
+
return json.dumps(self.to_dict())
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of CreateOrderResponseContent from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of data
|
|
75
|
+
if self.data:
|
|
76
|
+
_dict['data'] = self.data.to_dict()
|
|
77
|
+
return _dict
|
|
78
|
+
|
|
79
|
+
@classmethod
|
|
80
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
|
+
"""Create an instance of CreateOrderResponseContent from a dict"""
|
|
82
|
+
if obj is None:
|
|
83
|
+
return None
|
|
84
|
+
|
|
85
|
+
if not isinstance(obj, dict):
|
|
86
|
+
return cls.model_validate(obj)
|
|
87
|
+
|
|
88
|
+
_obj = cls.model_validate({
|
|
89
|
+
"status": obj.get("status"),
|
|
90
|
+
"data": CreateOrderResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None
|
|
91
|
+
})
|
|
92
|
+
return _obj
|
|
93
|
+
|
|
94
|
+
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
HostAfricaApi
|
|
5
|
+
|
|
6
|
+
HostAfrica API
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 2026-01-01
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from ha_sdk_python.models.create_order_items import CreateOrderItems
|
|
23
|
+
from ha_sdk_python.models.create_order_total import CreateOrderTotal
|
|
24
|
+
from ha_sdk_python.models.order_warning import OrderWarning
|
|
25
|
+
from ha_sdk_python.models.payment_error import PaymentError
|
|
26
|
+
from ha_sdk_python.models.payment_status import PaymentStatus
|
|
27
|
+
from typing import Optional, Set
|
|
28
|
+
from typing_extensions import Self
|
|
29
|
+
|
|
30
|
+
class CreateOrderResponseData(BaseModel):
|
|
31
|
+
"""
|
|
32
|
+
Response data for a successful or pending order
|
|
33
|
+
""" # noqa: E501
|
|
34
|
+
order_id: StrictInt = Field(description="Order identifier")
|
|
35
|
+
invoice_id: StrictInt = Field(description="Invoice identifier for this order")
|
|
36
|
+
order_number: StrictStr = Field(description="Human-readable order reference number")
|
|
37
|
+
total: CreateOrderTotal
|
|
38
|
+
promo_applied: Optional[StrictStr] = Field(default=None, description="Promotional code that was applied")
|
|
39
|
+
payment_method: StrictStr = Field(description="Payment method used (e.g. stripe)")
|
|
40
|
+
payment_status: PaymentStatus
|
|
41
|
+
items: CreateOrderItems
|
|
42
|
+
payment_error: Optional[PaymentError] = None
|
|
43
|
+
warnings: Optional[List[OrderWarning]] = Field(default=None, description="Warnings present when non-critical issues occurred (e.g. autorenew deferred)")
|
|
44
|
+
__properties: ClassVar[List[str]] = ["order_id", "invoice_id", "order_number", "total", "promo_applied", "payment_method", "payment_status", "items", "payment_error", "warnings"]
|
|
45
|
+
|
|
46
|
+
model_config = ConfigDict(
|
|
47
|
+
populate_by_name=True,
|
|
48
|
+
validate_assignment=True,
|
|
49
|
+
protected_namespaces=(),
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def to_str(self) -> str:
|
|
54
|
+
"""Returns the string representation of the model using alias"""
|
|
55
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
56
|
+
|
|
57
|
+
def to_json(self) -> str:
|
|
58
|
+
"""Returns the JSON representation of the model using alias"""
|
|
59
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
60
|
+
return json.dumps(self.to_dict())
|
|
61
|
+
|
|
62
|
+
@classmethod
|
|
63
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
64
|
+
"""Create an instance of CreateOrderResponseData from a JSON string"""
|
|
65
|
+
return cls.from_dict(json.loads(json_str))
|
|
66
|
+
|
|
67
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
68
|
+
"""Return the dictionary representation of the model using alias.
|
|
69
|
+
|
|
70
|
+
This has the following differences from calling pydantic's
|
|
71
|
+
`self.model_dump(by_alias=True)`:
|
|
72
|
+
|
|
73
|
+
* `None` is only added to the output dict for nullable fields that
|
|
74
|
+
were set at model initialization. Other fields with value `None`
|
|
75
|
+
are ignored.
|
|
76
|
+
"""
|
|
77
|
+
excluded_fields: Set[str] = set([
|
|
78
|
+
])
|
|
79
|
+
|
|
80
|
+
_dict = self.model_dump(
|
|
81
|
+
by_alias=True,
|
|
82
|
+
exclude=excluded_fields,
|
|
83
|
+
exclude_none=True,
|
|
84
|
+
)
|
|
85
|
+
# override the default output from pydantic by calling `to_dict()` of total
|
|
86
|
+
if self.total:
|
|
87
|
+
_dict['total'] = self.total.to_dict()
|
|
88
|
+
# override the default output from pydantic by calling `to_dict()` of items
|
|
89
|
+
if self.items:
|
|
90
|
+
_dict['items'] = self.items.to_dict()
|
|
91
|
+
# override the default output from pydantic by calling `to_dict()` of payment_error
|
|
92
|
+
if self.payment_error:
|
|
93
|
+
_dict['payment_error'] = self.payment_error.to_dict()
|
|
94
|
+
# override the default output from pydantic by calling `to_dict()` of each item in warnings (list)
|
|
95
|
+
_items = []
|
|
96
|
+
if self.warnings:
|
|
97
|
+
for _item_warnings in self.warnings:
|
|
98
|
+
if _item_warnings:
|
|
99
|
+
_items.append(_item_warnings.to_dict())
|
|
100
|
+
_dict['warnings'] = _items
|
|
101
|
+
return _dict
|
|
102
|
+
|
|
103
|
+
@classmethod
|
|
104
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
105
|
+
"""Create an instance of CreateOrderResponseData from a dict"""
|
|
106
|
+
if obj is None:
|
|
107
|
+
return None
|
|
108
|
+
|
|
109
|
+
if not isinstance(obj, dict):
|
|
110
|
+
return cls.model_validate(obj)
|
|
111
|
+
|
|
112
|
+
_obj = cls.model_validate({
|
|
113
|
+
"order_id": obj.get("order_id"),
|
|
114
|
+
"invoice_id": obj.get("invoice_id"),
|
|
115
|
+
"order_number": obj.get("order_number"),
|
|
116
|
+
"total": CreateOrderTotal.from_dict(obj["total"]) if obj.get("total") is not None else None,
|
|
117
|
+
"promo_applied": obj.get("promo_applied"),
|
|
118
|
+
"payment_method": obj.get("payment_method"),
|
|
119
|
+
"payment_status": obj.get("payment_status"),
|
|
120
|
+
"items": CreateOrderItems.from_dict(obj["items"]) if obj.get("items") is not None else None,
|
|
121
|
+
"payment_error": PaymentError.from_dict(obj["payment_error"]) if obj.get("payment_error") is not None else None,
|
|
122
|
+
"warnings": [OrderWarning.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None
|
|
123
|
+
})
|
|
124
|
+
return _obj
|
|
125
|
+
|
|
126
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
HostAfricaApi
|
|
5
|
+
|
|
6
|
+
HostAfrica API
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 2026-01-01
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class CreateOrderTotal(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
Total amount breakdown for an order
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
amount: StrictStr = Field(description="Total amount charged (decimal string, e.g. \"2333.33\")")
|
|
30
|
+
currency: StrictStr = Field(description="Currency code (e.g. USD)")
|
|
31
|
+
prefix: StrictStr = Field(description="Currency prefix symbol (e.g. $)")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["amount", "currency", "prefix"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of CreateOrderTotal from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
return _dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
+
"""Create an instance of CreateOrderTotal from a dict"""
|
|
78
|
+
if obj is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
if not isinstance(obj, dict):
|
|
82
|
+
return cls.model_validate(obj)
|
|
83
|
+
|
|
84
|
+
_obj = cls.model_validate({
|
|
85
|
+
"amount": obj.get("amount"),
|
|
86
|
+
"currency": obj.get("currency"),
|
|
87
|
+
"prefix": obj.get("prefix")
|
|
88
|
+
})
|
|
89
|
+
return _obj
|
|
90
|
+
|
|
91
|
+
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
HostAfricaApi
|
|
5
|
+
|
|
6
|
+
HostAfrica API
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 2026-01-01
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from ha_sdk_python.models.day_of_week import DayOfWeek
|
|
24
|
+
from ha_sdk_python.models.power_task_action import PowerTaskAction
|
|
25
|
+
from ha_sdk_python.models.power_task_job_type import PowerTaskJobType
|
|
26
|
+
from typing import Optional, Set
|
|
27
|
+
from typing_extensions import Self
|
|
28
|
+
|
|
29
|
+
class CreatePowerTaskRequestContent(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
CreatePowerTaskRequestContent
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
service_id: StrictStr = Field(description="Service ID - must be sent as a string")
|
|
34
|
+
power_task_action: PowerTaskAction
|
|
35
|
+
start_date: Annotated[str, Field(strict=True)] = Field(description="Start date in Y-m-d format (e.g., 2026-03-25)")
|
|
36
|
+
description: Optional[StrictStr] = Field(default=None, description="Description of the power task")
|
|
37
|
+
start_time: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Start time in HH:MM or HH:MM:SS format")
|
|
38
|
+
end_date: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="End date in Y-m-d format (e.g., 2026-12-31)")
|
|
39
|
+
end_time: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="End time in HH:MM or HH:MM:SS format")
|
|
40
|
+
job_type: Optional[PowerTaskJobType] = None
|
|
41
|
+
job_time: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Job execution time in HH:MM or HH:MM:SS format")
|
|
42
|
+
job_hour: Optional[Annotated[int, Field(le=23, strict=True, ge=0)]] = Field(default=None, description="Job hour (alternative to job_time)")
|
|
43
|
+
job_minutes: Optional[Annotated[int, Field(le=59, strict=True, ge=0)]] = Field(default=None, description="Job minutes (alternative to job_time)")
|
|
44
|
+
days: Optional[List[DayOfWeek]] = Field(default=None, description="Days of the week for weekly jobs")
|
|
45
|
+
__properties: ClassVar[List[str]] = ["service_id", "power_task_action", "start_date", "description", "start_time", "end_date", "end_time", "job_type", "job_time", "job_hour", "job_minutes", "days"]
|
|
46
|
+
|
|
47
|
+
@field_validator('start_date')
|
|
48
|
+
def start_date_validate_regular_expression(cls, value):
|
|
49
|
+
"""Validates the regular expression"""
|
|
50
|
+
if not re.match(r"^\d{4}-\d{2}-\d{2}$", value):
|
|
51
|
+
raise ValueError(r"must validate the regular expression /^\d{4}-\d{2}-\d{2}$/")
|
|
52
|
+
return value
|
|
53
|
+
|
|
54
|
+
@field_validator('start_time')
|
|
55
|
+
def start_time_validate_regular_expression(cls, value):
|
|
56
|
+
"""Validates the regular expression"""
|
|
57
|
+
if value is None:
|
|
58
|
+
return value
|
|
59
|
+
|
|
60
|
+
if not re.match(r"^([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$", value):
|
|
61
|
+
raise ValueError(r"must validate the regular expression /^([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$/")
|
|
62
|
+
return value
|
|
63
|
+
|
|
64
|
+
@field_validator('end_date')
|
|
65
|
+
def end_date_validate_regular_expression(cls, value):
|
|
66
|
+
"""Validates the regular expression"""
|
|
67
|
+
if value is None:
|
|
68
|
+
return value
|
|
69
|
+
|
|
70
|
+
if not re.match(r"^\d{4}-\d{2}-\d{2}$", value):
|
|
71
|
+
raise ValueError(r"must validate the regular expression /^\d{4}-\d{2}-\d{2}$/")
|
|
72
|
+
return value
|
|
73
|
+
|
|
74
|
+
@field_validator('end_time')
|
|
75
|
+
def end_time_validate_regular_expression(cls, value):
|
|
76
|
+
"""Validates the regular expression"""
|
|
77
|
+
if value is None:
|
|
78
|
+
return value
|
|
79
|
+
|
|
80
|
+
if not re.match(r"^([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$", value):
|
|
81
|
+
raise ValueError(r"must validate the regular expression /^([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$/")
|
|
82
|
+
return value
|
|
83
|
+
|
|
84
|
+
@field_validator('job_time')
|
|
85
|
+
def job_time_validate_regular_expression(cls, value):
|
|
86
|
+
"""Validates the regular expression"""
|
|
87
|
+
if value is None:
|
|
88
|
+
return value
|
|
89
|
+
|
|
90
|
+
if not re.match(r"^([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$", value):
|
|
91
|
+
raise ValueError(r"must validate the regular expression /^([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$/")
|
|
92
|
+
return value
|
|
93
|
+
|
|
94
|
+
model_config = ConfigDict(
|
|
95
|
+
populate_by_name=True,
|
|
96
|
+
validate_assignment=True,
|
|
97
|
+
protected_namespaces=(),
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def to_str(self) -> str:
|
|
102
|
+
"""Returns the string representation of the model using alias"""
|
|
103
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
104
|
+
|
|
105
|
+
def to_json(self) -> str:
|
|
106
|
+
"""Returns the JSON representation of the model using alias"""
|
|
107
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
108
|
+
return json.dumps(self.to_dict())
|
|
109
|
+
|
|
110
|
+
@classmethod
|
|
111
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
112
|
+
"""Create an instance of CreatePowerTaskRequestContent from a JSON string"""
|
|
113
|
+
return cls.from_dict(json.loads(json_str))
|
|
114
|
+
|
|
115
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
116
|
+
"""Return the dictionary representation of the model using alias.
|
|
117
|
+
|
|
118
|
+
This has the following differences from calling pydantic's
|
|
119
|
+
`self.model_dump(by_alias=True)`:
|
|
120
|
+
|
|
121
|
+
* `None` is only added to the output dict for nullable fields that
|
|
122
|
+
were set at model initialization. Other fields with value `None`
|
|
123
|
+
are ignored.
|
|
124
|
+
"""
|
|
125
|
+
excluded_fields: Set[str] = set([
|
|
126
|
+
])
|
|
127
|
+
|
|
128
|
+
_dict = self.model_dump(
|
|
129
|
+
by_alias=True,
|
|
130
|
+
exclude=excluded_fields,
|
|
131
|
+
exclude_none=True,
|
|
132
|
+
)
|
|
133
|
+
return _dict
|
|
134
|
+
|
|
135
|
+
@classmethod
|
|
136
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
137
|
+
"""Create an instance of CreatePowerTaskRequestContent from a dict"""
|
|
138
|
+
if obj is None:
|
|
139
|
+
return None
|
|
140
|
+
|
|
141
|
+
if not isinstance(obj, dict):
|
|
142
|
+
return cls.model_validate(obj)
|
|
143
|
+
|
|
144
|
+
_obj = cls.model_validate({
|
|
145
|
+
"service_id": obj.get("service_id"),
|
|
146
|
+
"power_task_action": obj.get("power_task_action"),
|
|
147
|
+
"start_date": obj.get("start_date"),
|
|
148
|
+
"description": obj.get("description"),
|
|
149
|
+
"start_time": obj.get("start_time"),
|
|
150
|
+
"end_date": obj.get("end_date"),
|
|
151
|
+
"end_time": obj.get("end_time"),
|
|
152
|
+
"job_type": obj.get("job_type"),
|
|
153
|
+
"job_time": obj.get("job_time"),
|
|
154
|
+
"job_hour": obj.get("job_hour"),
|
|
155
|
+
"job_minutes": obj.get("job_minutes"),
|
|
156
|
+
"days": obj.get("days")
|
|
157
|
+
})
|
|
158
|
+
return _obj
|
|
159
|
+
|
|
160
|
+
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
HostAfricaApi
|
|
5
|
+
|
|
6
|
+
HostAfrica API
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 2026-01-01
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from ha_sdk_python.models.operation_status import OperationStatus
|
|
23
|
+
from ha_sdk_python.models.power_task_create_response_data import PowerTaskCreateResponseData
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class CreatePowerTaskResponseContent(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
CreatePowerTaskResponseContent
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
status: OperationStatus
|
|
32
|
+
data: PowerTaskCreateResponseData
|
|
33
|
+
__properties: ClassVar[List[str]] = ["status", "data"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
populate_by_name=True,
|
|
37
|
+
validate_assignment=True,
|
|
38
|
+
protected_namespaces=(),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
49
|
+
return json.dumps(self.to_dict())
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of CreatePowerTaskResponseContent from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of data
|
|
75
|
+
if self.data:
|
|
76
|
+
_dict['data'] = self.data.to_dict()
|
|
77
|
+
return _dict
|
|
78
|
+
|
|
79
|
+
@classmethod
|
|
80
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
|
+
"""Create an instance of CreatePowerTaskResponseContent from a dict"""
|
|
82
|
+
if obj is None:
|
|
83
|
+
return None
|
|
84
|
+
|
|
85
|
+
if not isinstance(obj, dict):
|
|
86
|
+
return cls.model_validate(obj)
|
|
87
|
+
|
|
88
|
+
_obj = cls.model_validate({
|
|
89
|
+
"status": obj.get("status"),
|
|
90
|
+
"data": PowerTaskCreateResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None
|
|
91
|
+
})
|
|
92
|
+
return _obj
|
|
93
|
+
|
|
94
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
HostAfricaApi
|
|
5
|
+
|
|
6
|
+
HostAfrica API
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 2026-01-01
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class CreateRdnsRecordRequestContent(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
CreateRdnsRecordRequestContent
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
type: Annotated[int, Field(le=3, strict=True, ge=0)] = Field(description="Zone type: 0=OTHER, 1=DOMAIN, 2=HOSTING, 3=ADDON")
|
|
31
|
+
relid: Annotated[int, Field(strict=True, ge=1)] = Field(description="Related service id matching the zone type (tblhosting.id, tblhostingaddons.id or tbldomains.id)")
|
|
32
|
+
ip: StrictStr = Field(description="IPv4 or IPv6 address the PTR record should point from")
|
|
33
|
+
hostname: StrictStr = Field(description="PTR target hostname")
|
|
34
|
+
ttl: Optional[Annotated[int, Field(le=86400, strict=True, ge=30)]] = Field(default=None, description="Time-to-live in seconds. Defaults to 14400; clamped to [30, 86400]")
|
|
35
|
+
__properties: ClassVar[List[str]] = ["type", "relid", "ip", "hostname", "ttl"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
populate_by_name=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
+
return json.dumps(self.to_dict())
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of CreateRdnsRecordRequestContent from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
])
|
|
70
|
+
|
|
71
|
+
_dict = self.model_dump(
|
|
72
|
+
by_alias=True,
|
|
73
|
+
exclude=excluded_fields,
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
return _dict
|
|
77
|
+
|
|
78
|
+
@classmethod
|
|
79
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
80
|
+
"""Create an instance of CreateRdnsRecordRequestContent from a dict"""
|
|
81
|
+
if obj is None:
|
|
82
|
+
return None
|
|
83
|
+
|
|
84
|
+
if not isinstance(obj, dict):
|
|
85
|
+
return cls.model_validate(obj)
|
|
86
|
+
|
|
87
|
+
_obj = cls.model_validate({
|
|
88
|
+
"type": obj.get("type"),
|
|
89
|
+
"relid": obj.get("relid"),
|
|
90
|
+
"ip": obj.get("ip"),
|
|
91
|
+
"hostname": obj.get("hostname"),
|
|
92
|
+
"ttl": obj.get("ttl")
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|