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,93 @@
|
|
|
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 ha_sdk_python.models.ssh_key_details import SshKeyDetails
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class PublicSshKeyResponseData(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
Response data for public SSH key retrieval
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
message: StrictStr = Field(description="Status message indicating the result")
|
|
31
|
+
data: SshKeyDetails
|
|
32
|
+
__properties: ClassVar[List[str]] = ["message", "data"]
|
|
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 PublicSshKeyResponseData 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
|
+
# override the default output from pydantic by calling `to_dict()` of data
|
|
74
|
+
if self.data:
|
|
75
|
+
_dict['data'] = self.data.to_dict()
|
|
76
|
+
return _dict
|
|
77
|
+
|
|
78
|
+
@classmethod
|
|
79
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
80
|
+
"""Create an instance of PublicSshKeyResponseData 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
|
+
"message": obj.get("message"),
|
|
89
|
+
"data": SshKeyDetails.from_dict(obj["data"]) if obj.get("data") is not None else None
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
92
|
+
|
|
93
|
+
|
|
@@ -0,0 +1,111 @@
|
|
|
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, StrictBool, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from ha_sdk_python.models.rdns_pool import RdnsPool
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class RdnsAvailableItem(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
One service the client can manage PTRs for
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
type: StrictInt = Field(description="Zone type matching RdnsRecord.type")
|
|
31
|
+
relid: StrictInt = Field(description="Related service identifier")
|
|
32
|
+
name: StrictStr = Field(description="Display label for the service")
|
|
33
|
+
ips: List[StrictStr] = Field(description="Concrete IP addresses available for this service")
|
|
34
|
+
pools: List[RdnsPool] = Field(description="Subnet pools available when subnet_custom_ip_mode is on")
|
|
35
|
+
ptr_limit: StrictInt = Field(description="Per-package PTR limit (-1 = unlimited)")
|
|
36
|
+
server_id: StrictInt
|
|
37
|
+
allow_rdns: StrictBool = Field(description="Server has ALLOW_RDNS=on")
|
|
38
|
+
rdns_supported: StrictBool = Field(description="Server module supports rDNS")
|
|
39
|
+
__properties: ClassVar[List[str]] = ["type", "relid", "name", "ips", "pools", "ptr_limit", "server_id", "allow_rdns", "rdns_supported"]
|
|
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 RdnsAvailableItem 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 each item in pools (list)
|
|
81
|
+
_items = []
|
|
82
|
+
if self.pools:
|
|
83
|
+
for _item_pools in self.pools:
|
|
84
|
+
if _item_pools:
|
|
85
|
+
_items.append(_item_pools.to_dict())
|
|
86
|
+
_dict['pools'] = _items
|
|
87
|
+
return _dict
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
91
|
+
"""Create an instance of RdnsAvailableItem from a dict"""
|
|
92
|
+
if obj is None:
|
|
93
|
+
return None
|
|
94
|
+
|
|
95
|
+
if not isinstance(obj, dict):
|
|
96
|
+
return cls.model_validate(obj)
|
|
97
|
+
|
|
98
|
+
_obj = cls.model_validate({
|
|
99
|
+
"type": obj.get("type"),
|
|
100
|
+
"relid": obj.get("relid"),
|
|
101
|
+
"name": obj.get("name"),
|
|
102
|
+
"ips": obj.get("ips"),
|
|
103
|
+
"pools": [RdnsPool.from_dict(_item) for _item in obj["pools"]] if obj.get("pools") is not None else None,
|
|
104
|
+
"ptr_limit": obj.get("ptr_limit"),
|
|
105
|
+
"server_id": obj.get("server_id"),
|
|
106
|
+
"allow_rdns": obj.get("allow_rdns"),
|
|
107
|
+
"rdns_supported": obj.get("rdns_supported")
|
|
108
|
+
})
|
|
109
|
+
return _obj
|
|
110
|
+
|
|
111
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class RdnsPool(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
A subnet pool entry within an available rDNS item
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
pool: StrictStr = Field(description="Network address of the pool")
|
|
30
|
+
mask: StrictInt = Field(description="CIDR prefix length")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["pool", "mask"]
|
|
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 RdnsPool 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 RdnsPool 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
|
+
"pool": obj.get("pool"),
|
|
85
|
+
"mask": obj.get("mask")
|
|
86
|
+
})
|
|
87
|
+
return _obj
|
|
88
|
+
|
|
89
|
+
|
|
@@ -0,0 +1,109 @@
|
|
|
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 typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class RdnsRecord(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
A PTR record owned by the client
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
id: StrictInt = Field(description="Record identifier — use as record_id in PUT/DELETE")
|
|
30
|
+
ip: StrictStr = Field(description="The IPv4/IPv6 address the PTR points from")
|
|
31
|
+
hostname: StrictStr = Field(description="Final concatenated PTR target (sub.from)")
|
|
32
|
+
ttl: Optional[StrictInt] = Field(default=None, description="Time-to-live in seconds")
|
|
33
|
+
type: Optional[StrictInt] = Field(default=None, description="Zone type: 0=OTHER, 1=DOMAIN, 2=HOSTING, 3=ADDON")
|
|
34
|
+
relid: Optional[StrictInt] = Field(default=None, description="Related service id (tblhosting.id / tblhostingaddons.id / tbldomains.id)")
|
|
35
|
+
serverid: StrictInt
|
|
36
|
+
clientid: StrictInt
|
|
37
|
+
packageid: StrictInt
|
|
38
|
+
var_from: Optional[StrictStr] = Field(default=None, description="Reverse-DNS zone name (e.g. 10.113.0.203.in-addr.arpa)", alias="from")
|
|
39
|
+
sub: Optional[StrictStr] = Field(default=None, description="Sub-label component of the PTR")
|
|
40
|
+
name: Optional[StrictStr] = Field(default=None, description="Full PTR name (e.g. 10.113.0.203.in-addr.arpa)")
|
|
41
|
+
__properties: ClassVar[List[str]] = ["id", "ip", "hostname", "ttl", "type", "relid", "serverid", "clientid", "packageid", "from", "sub", "name"]
|
|
42
|
+
|
|
43
|
+
model_config = ConfigDict(
|
|
44
|
+
populate_by_name=True,
|
|
45
|
+
validate_assignment=True,
|
|
46
|
+
protected_namespaces=(),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def to_str(self) -> str:
|
|
51
|
+
"""Returns the string representation of the model using alias"""
|
|
52
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
53
|
+
|
|
54
|
+
def to_json(self) -> str:
|
|
55
|
+
"""Returns the JSON representation of the model using alias"""
|
|
56
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
57
|
+
return json.dumps(self.to_dict())
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
61
|
+
"""Create an instance of RdnsRecord from a JSON string"""
|
|
62
|
+
return cls.from_dict(json.loads(json_str))
|
|
63
|
+
|
|
64
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
65
|
+
"""Return the dictionary representation of the model using alias.
|
|
66
|
+
|
|
67
|
+
This has the following differences from calling pydantic's
|
|
68
|
+
`self.model_dump(by_alias=True)`:
|
|
69
|
+
|
|
70
|
+
* `None` is only added to the output dict for nullable fields that
|
|
71
|
+
were set at model initialization. Other fields with value `None`
|
|
72
|
+
are ignored.
|
|
73
|
+
"""
|
|
74
|
+
excluded_fields: Set[str] = set([
|
|
75
|
+
])
|
|
76
|
+
|
|
77
|
+
_dict = self.model_dump(
|
|
78
|
+
by_alias=True,
|
|
79
|
+
exclude=excluded_fields,
|
|
80
|
+
exclude_none=True,
|
|
81
|
+
)
|
|
82
|
+
return _dict
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
86
|
+
"""Create an instance of RdnsRecord from a dict"""
|
|
87
|
+
if obj is None:
|
|
88
|
+
return None
|
|
89
|
+
|
|
90
|
+
if not isinstance(obj, dict):
|
|
91
|
+
return cls.model_validate(obj)
|
|
92
|
+
|
|
93
|
+
_obj = cls.model_validate({
|
|
94
|
+
"id": obj.get("id"),
|
|
95
|
+
"ip": obj.get("ip"),
|
|
96
|
+
"hostname": obj.get("hostname"),
|
|
97
|
+
"ttl": obj.get("ttl"),
|
|
98
|
+
"type": obj.get("type"),
|
|
99
|
+
"relid": obj.get("relid"),
|
|
100
|
+
"serverid": obj.get("serverid"),
|
|
101
|
+
"clientid": obj.get("clientid"),
|
|
102
|
+
"packageid": obj.get("packageid"),
|
|
103
|
+
"from": obj.get("from"),
|
|
104
|
+
"sub": obj.get("sub"),
|
|
105
|
+
"name": obj.get("name")
|
|
106
|
+
})
|
|
107
|
+
return _obj
|
|
108
|
+
|
|
109
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
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 RebootVpsRequestContent(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
RebootVpsRequestContent
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
service_id: StrictStr = Field(description="Service ID - must be sent as a string")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["service_id"]
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(
|
|
33
|
+
populate_by_name=True,
|
|
34
|
+
validate_assignment=True,
|
|
35
|
+
protected_namespaces=(),
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of RebootVpsRequestContent from a JSON string"""
|
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
|
55
|
+
|
|
56
|
+
This has the following differences from calling pydantic's
|
|
57
|
+
`self.model_dump(by_alias=True)`:
|
|
58
|
+
|
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
|
60
|
+
were set at model initialization. Other fields with value `None`
|
|
61
|
+
are ignored.
|
|
62
|
+
"""
|
|
63
|
+
excluded_fields: Set[str] = set([
|
|
64
|
+
])
|
|
65
|
+
|
|
66
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
return _dict
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of RebootVpsRequestContent from a dict"""
|
|
76
|
+
if obj is None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if not isinstance(obj, dict):
|
|
80
|
+
return cls.model_validate(obj)
|
|
81
|
+
|
|
82
|
+
_obj = cls.model_validate({
|
|
83
|
+
"service_id": obj.get("service_id")
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|
|
@@ -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.vps_simple_action_response_data import VpsSimpleActionResponseData
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class RebootVpsResponseContent(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
RebootVpsResponseContent
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
status: OperationStatus
|
|
32
|
+
data: VpsSimpleActionResponseData
|
|
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 RebootVpsResponseContent 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 RebootVpsResponseContent 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": VpsSimpleActionResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None
|
|
91
|
+
})
|
|
92
|
+
return _obj
|
|
93
|
+
|
|
94
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
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 ResourceNotFoundErrorResponseContent(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
ResourceNotFoundErrorResponseContent
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
message: StrictStr
|
|
30
|
+
data: Dict[str, Any] = Field(description="Empty object for operations that don't return data")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["message", "data"]
|
|
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 ResourceNotFoundErrorResponseContent 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 ResourceNotFoundErrorResponseContent 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
|
+
"message": obj.get("message"),
|
|
85
|
+
"data": obj.get("data")
|
|
86
|
+
})
|
|
87
|
+
return _obj
|
|
88
|
+
|
|
89
|
+
|