pidginhost-sdk 0.2.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.
- pidginhost_sdk/__init__.py +467 -0
- pidginhost_sdk/api/__init__.py +14 -0
- pidginhost_sdk/api/account_api.py +10267 -0
- pidginhost_sdk/api/billing_api.py +9644 -0
- pidginhost_sdk/api/cloud_api.py +43062 -0
- pidginhost_sdk/api/dedicated_api.py +2838 -0
- pidginhost_sdk/api/domain_api.py +10505 -0
- pidginhost_sdk/api/freedns_api.py +3440 -0
- pidginhost_sdk/api/hosting_api.py +1674 -0
- pidginhost_sdk/api/kubernetes_api.py +31395 -0
- pidginhost_sdk/api/schema_api.py +605 -0
- pidginhost_sdk/api/support_api.py +4324 -0
- pidginhost_sdk/api_client.py +806 -0
- pidginhost_sdk/api_response.py +21 -0
- pidginhost_sdk/client.py +50 -0
- pidginhost_sdk/configuration.py +617 -0
- pidginhost_sdk/exceptions.py +219 -0
- pidginhost_sdk/models/__init__.py +217 -0
- pidginhost_sdk/models/activate_free_dns.py +93 -0
- pidginhost_sdk/models/activate_free_dns_response.py +92 -0
- pidginhost_sdk/models/activity_log_entry.py +90 -0
- pidginhost_sdk/models/activity_log_response.py +96 -0
- pidginhost_sdk/models/add_server_response.py +88 -0
- pidginhost_sdk/models/address.py +116 -0
- pidginhost_sdk/models/api_token_create.py +105 -0
- pidginhost_sdk/models/api_token_list.py +121 -0
- pidginhost_sdk/models/attach_ipv4.py +88 -0
- pidginhost_sdk/models/attach_ipv6.py +88 -0
- pidginhost_sdk/models/attach_volume.py +88 -0
- pidginhost_sdk/models/cancel_service_response.py +90 -0
- pidginhost_sdk/models/change_billing_cycle.py +88 -0
- pidginhost_sdk/models/change_billing_cycle_response.py +90 -0
- pidginhost_sdk/models/change_company.py +93 -0
- pidginhost_sdk/models/change_company_response.py +95 -0
- pidginhost_sdk/models/change_password.py +89 -0
- pidginhost_sdk/models/check_availability.py +89 -0
- pidginhost_sdk/models/cluster_add.py +104 -0
- pidginhost_sdk/models/cluster_add_response.py +88 -0
- pidginhost_sdk/models/cluster_detail.py +148 -0
- pidginhost_sdk/models/cluster_package.py +104 -0
- pidginhost_sdk/models/cluster_type.py +104 -0
- pidginhost_sdk/models/cluster_type_enum.py +38 -0
- pidginhost_sdk/models/company.py +111 -0
- pidginhost_sdk/models/connect_vm_request.py +88 -0
- pidginhost_sdk/models/connect_vm_response.py +90 -0
- pidginhost_sdk/models/connected_vm.py +92 -0
- pidginhost_sdk/models/connected_vms_response.py +96 -0
- pidginhost_sdk/models/console_token.py +90 -0
- pidginhost_sdk/models/contact_type_enum.py +40 -0
- pidginhost_sdk/models/contacts_update.py +91 -0
- pidginhost_sdk/models/contacts_update_response.py +88 -0
- pidginhost_sdk/models/country_enum.py +290 -0
- pidginhost_sdk/models/deactivate_free_dns.py +91 -0
- pidginhost_sdk/models/deactivate_free_dns_response.py +88 -0
- pidginhost_sdk/models/dedicated_rdns.py +91 -0
- pidginhost_sdk/models/dedicated_server.py +136 -0
- pidginhost_sdk/models/delete_record.py +88 -0
- pidginhost_sdk/models/delete_record_response.py +90 -0
- pidginhost_sdk/models/department.py +94 -0
- pidginhost_sdk/models/deposit.py +138 -0
- pidginhost_sdk/models/deposit_create.py +88 -0
- pidginhost_sdk/models/deposit_status_enum.py +40 -0
- pidginhost_sdk/models/destroy_protection.py +88 -0
- pidginhost_sdk/models/detach_ipv4.py +88 -0
- pidginhost_sdk/models/detach_ipv4_response.py +88 -0
- pidginhost_sdk/models/detach_ipv6.py +88 -0
- pidginhost_sdk/models/detach_ipv6_response.py +88 -0
- pidginhost_sdk/models/detach_volume.py +88 -0
- pidginhost_sdk/models/disconnect_vm_request.py +88 -0
- pidginhost_sdk/models/disconnect_vm_response.py +90 -0
- pidginhost_sdk/models/dns_record.py +154 -0
- pidginhost_sdk/models/dns_record_create.py +121 -0
- pidginhost_sdk/models/dns_record_create_type_enum.py +43 -0
- pidginhost_sdk/models/dns_record_mutate_response.py +94 -0
- pidginhost_sdk/models/domain.py +152 -0
- pidginhost_sdk/models/domain_cancel_response.py +90 -0
- pidginhost_sdk/models/domain_create.py +93 -0
- pidginhost_sdk/models/domain_registrant.py +131 -0
- pidginhost_sdk/models/email_history.py +107 -0
- pidginhost_sdk/models/feature_upgrade_request.py +90 -0
- pidginhost_sdk/models/feature_upgrade_response.py +90 -0
- pidginhost_sdk/models/features_enum.py +41 -0
- pidginhost_sdk/models/firewall_rule.py +119 -0
- pidginhost_sdk/models/firewall_rule_direction_enum.py +38 -0
- pidginhost_sdk/models/firewall_rules_set.py +114 -0
- pidginhost_sdk/models/firewall_rules_set_status_enum.py +39 -0
- pidginhost_sdk/models/free_dns_domain.py +98 -0
- pidginhost_sdk/models/funds_balance_response.py +122 -0
- pidginhost_sdk/models/funds_log.py +117 -0
- pidginhost_sdk/models/fw_policy_out_enum.py +39 -0
- pidginhost_sdk/models/hosting_change_password_response.py +88 -0
- pidginhost_sdk/models/hosting_service.py +136 -0
- pidginhost_sdk/models/http_route.py +129 -0
- pidginhost_sdk/models/invoice_detail.py +199 -0
- pidginhost_sdk/models/invoice_list.py +164 -0
- pidginhost_sdk/models/kube_upgrade_response.py +88 -0
- pidginhost_sdk/models/kube_version_enum.py +39 -0
- pidginhost_sdk/models/lb_firewall_rule.py +122 -0
- pidginhost_sdk/models/lb_firewall_rule_action_enum.py +39 -0
- pidginhost_sdk/models/lb_firewall_rule_direction_enum.py +38 -0
- pidginhost_sdk/models/low_balance_settings.py +114 -0
- pidginhost_sdk/models/nameservers_update.py +89 -0
- pidginhost_sdk/models/nameservers_update_response.py +88 -0
- pidginhost_sdk/models/node_metrics_response.py +100 -0
- pidginhost_sdk/models/node_rrd_response.py +90 -0
- pidginhost_sdk/models/notification_settings_response.py +115 -0
- pidginhost_sdk/models/operation_enum.py +46 -0
- pidginhost_sdk/models/os_image.py +108 -0
- pidginhost_sdk/models/paginated_api_token_list_list.py +112 -0
- pidginhost_sdk/models/paginated_cluster_detail_list.py +112 -0
- pidginhost_sdk/models/paginated_cluster_type_list.py +112 -0
- pidginhost_sdk/models/paginated_company_list.py +112 -0
- pidginhost_sdk/models/paginated_dedicated_server_list.py +112 -0
- pidginhost_sdk/models/paginated_deposit_list.py +112 -0
- pidginhost_sdk/models/paginated_domain_list.py +112 -0
- pidginhost_sdk/models/paginated_domain_registrant_list.py +112 -0
- pidginhost_sdk/models/paginated_email_history_list.py +112 -0
- pidginhost_sdk/models/paginated_funds_log_list.py +112 -0
- pidginhost_sdk/models/paginated_hosting_service_list.py +112 -0
- pidginhost_sdk/models/paginated_invoice_list_list.py +112 -0
- pidginhost_sdk/models/paginated_lb_firewall_rule_list.py +112 -0
- pidginhost_sdk/models/paginated_os_image_list.py +112 -0
- pidginhost_sdk/models/paginated_private_network_list.py +112 -0
- pidginhost_sdk/models/paginated_public_ipv4_list.py +112 -0
- pidginhost_sdk/models/paginated_public_ipv6_list.py +112 -0
- pidginhost_sdk/models/paginated_resource_pool_list.py +112 -0
- pidginhost_sdk/models/paginated_resource_pool_node_list.py +112 -0
- pidginhost_sdk/models/paginated_server_list.py +112 -0
- pidginhost_sdk/models/paginated_server_product_list.py +112 -0
- pidginhost_sdk/models/paginated_service_list_list.py +112 -0
- pidginhost_sdk/models/paginated_snapshot_list.py +112 -0
- pidginhost_sdk/models/paginated_ssh_key_list.py +112 -0
- pidginhost_sdk/models/paginated_storage_product_list.py +112 -0
- pidginhost_sdk/models/paginated_subscription_list.py +112 -0
- pidginhost_sdk/models/paginated_ticket_list_list.py +112 -0
- pidginhost_sdk/models/paginated_tld_list.py +112 -0
- pidginhost_sdk/models/patched_cluster_detail.py +151 -0
- pidginhost_sdk/models/patched_company.py +111 -0
- pidginhost_sdk/models/patched_domain.py +152 -0
- pidginhost_sdk/models/patched_domain_registrant.py +131 -0
- pidginhost_sdk/models/patched_firewall_rule.py +119 -0
- pidginhost_sdk/models/patched_firewall_rules_set.py +114 -0
- pidginhost_sdk/models/patched_http_route.py +129 -0
- pidginhost_sdk/models/patched_lb_firewall_rule.py +122 -0
- pidginhost_sdk/models/patched_private_network.py +112 -0
- pidginhost_sdk/models/patched_profile.py +107 -0
- pidginhost_sdk/models/patched_resource_pool.py +113 -0
- pidginhost_sdk/models/patched_ssh_key.py +101 -0
- pidginhost_sdk/models/patched_tcp_route.py +125 -0
- pidginhost_sdk/models/patched_udp_route.py +125 -0
- pidginhost_sdk/models/patched_volume.py +107 -0
- pidginhost_sdk/models/pay_with_funds_response.py +98 -0
- pidginhost_sdk/models/power_action.py +89 -0
- pidginhost_sdk/models/power_action_action_enum.py +40 -0
- pidginhost_sdk/models/power_action_response.py +88 -0
- pidginhost_sdk/models/power_management.py +88 -0
- pidginhost_sdk/models/power_management_request.py +89 -0
- pidginhost_sdk/models/power_management_request_action_enum.py +40 -0
- pidginhost_sdk/models/priority3cd_enum.py +39 -0
- pidginhost_sdk/models/private_network.py +112 -0
- pidginhost_sdk/models/private_network_add_host.py +90 -0
- pidginhost_sdk/models/private_network_remove_host.py +88 -0
- pidginhost_sdk/models/profile.py +104 -0
- pidginhost_sdk/models/public_interface.py +110 -0
- pidginhost_sdk/models/public_ipv4.py +114 -0
- pidginhost_sdk/models/public_ipv6.py +114 -0
- pidginhost_sdk/models/rdns_update_response.py +88 -0
- pidginhost_sdk/models/reinstall.py +88 -0
- pidginhost_sdk/models/reinstall_response.py +88 -0
- pidginhost_sdk/models/remove_server_response.py +88 -0
- pidginhost_sdk/models/renew_domain.py +89 -0
- pidginhost_sdk/models/resource_pool.py +113 -0
- pidginhost_sdk/models/resource_pool_add.py +91 -0
- pidginhost_sdk/models/resource_pool_add_response.py +88 -0
- pidginhost_sdk/models/resource_pool_node.py +96 -0
- pidginhost_sdk/models/retry_provision.py +88 -0
- pidginhost_sdk/models/reverse_dns.py +89 -0
- pidginhost_sdk/models/scope_enum.py +38 -0
- pidginhost_sdk/models/server.py +130 -0
- pidginhost_sdk/models/server_add.py +128 -0
- pidginhost_sdk/models/server_add_response.py +88 -0
- pidginhost_sdk/models/server_product.py +104 -0
- pidginhost_sdk/models/server_product_upgrade.py +88 -0
- pidginhost_sdk/models/server_upgrade_response.py +88 -0
- pidginhost_sdk/models/server_usage_response.py +96 -0
- pidginhost_sdk/models/service.py +153 -0
- pidginhost_sdk/models/service_list.py +132 -0
- pidginhost_sdk/models/snapshot.py +104 -0
- pidginhost_sdk/models/snapshot_create.py +100 -0
- pidginhost_sdk/models/snapshot_create_queued.py +88 -0
- pidginhost_sdk/models/snapshot_delete_queued.py +88 -0
- pidginhost_sdk/models/snapshot_rollback_queued.py +88 -0
- pidginhost_sdk/models/source_enum.py +38 -0
- pidginhost_sdk/models/ssh_key.py +101 -0
- pidginhost_sdk/models/status03c_enum.py +43 -0
- pidginhost_sdk/models/status63a_enum.py +44 -0
- pidginhost_sdk/models/status_a57_enum.py +48 -0
- pidginhost_sdk/models/status_ef2_enum.py +40 -0
- pidginhost_sdk/models/storage_product.py +129 -0
- pidginhost_sdk/models/subscription.py +142 -0
- pidginhost_sdk/models/subscription_status_enum.py +40 -0
- pidginhost_sdk/models/talos_upgrade_response.py +88 -0
- pidginhost_sdk/models/tcp_route.py +125 -0
- pidginhost_sdk/models/threshold_type_enum.py +39 -0
- pidginhost_sdk/models/ticket_close_response.py +90 -0
- pidginhost_sdk/models/ticket_create.py +110 -0
- pidginhost_sdk/models/ticket_create_priority_enum.py +39 -0
- pidginhost_sdk/models/ticket_detail.py +125 -0
- pidginhost_sdk/models/ticket_list.py +117 -0
- pidginhost_sdk/models/ticket_reopen_response.py +90 -0
- pidginhost_sdk/models/ticket_reply.py +95 -0
- pidginhost_sdk/models/ticket_reply_response.py +88 -0
- pidginhost_sdk/models/tld.py +146 -0
- pidginhost_sdk/models/toggle_auto_payment_response.py +90 -0
- pidginhost_sdk/models/transfer_ro_domain.py +91 -0
- pidginhost_sdk/models/type2fa_enum.py +38 -0
- pidginhost_sdk/models/udp_route.py +125 -0
- pidginhost_sdk/models/volume.py +107 -0
- pidginhost_sdk/py.typed +0 -0
- pidginhost_sdk/rest.py +264 -0
- pidginhost_sdk-0.2.0.dist-info/METADATA +805 -0
- pidginhost_sdk-0.2.0.dist-info/RECORD +224 -0
- pidginhost_sdk-0.2.0.dist-info/WHEEL +5 -0
- pidginhost_sdk-0.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Pidgin Host API
|
|
5
|
+
|
|
6
|
+
The Pidgin Host API allows you to manage Services and resources within the Pidgin Host cloud in a simple, programmatic way using conventional HTTP requests. All of the functionality that you are familiar with in the Pidgin Host control panel is also available through the API, allowing you to script the complex actions that your situation requires.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0 (v1)
|
|
9
|
+
Contact: support@pidginhost.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from pidginhost_sdk.models.deposit import Deposit
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class PaginatedDepositList(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
PaginatedDepositList
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
count: StrictInt
|
|
32
|
+
next: Optional[StrictStr] = None
|
|
33
|
+
previous: Optional[StrictStr] = None
|
|
34
|
+
results: List[Deposit]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["count", "next", "previous", "results"]
|
|
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 PaginatedDepositList 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
|
+
# override the default output from pydantic by calling `to_dict()` of each item in results (list)
|
|
77
|
+
_items = []
|
|
78
|
+
if self.results:
|
|
79
|
+
for _item_results in self.results:
|
|
80
|
+
if _item_results:
|
|
81
|
+
_items.append(_item_results.to_dict())
|
|
82
|
+
_dict['results'] = _items
|
|
83
|
+
# set to None if next (nullable) is None
|
|
84
|
+
# and model_fields_set contains the field
|
|
85
|
+
if self.next is None and "next" in self.model_fields_set:
|
|
86
|
+
_dict['next'] = None
|
|
87
|
+
|
|
88
|
+
# set to None if previous (nullable) is None
|
|
89
|
+
# and model_fields_set contains the field
|
|
90
|
+
if self.previous is None and "previous" in self.model_fields_set:
|
|
91
|
+
_dict['previous'] = None
|
|
92
|
+
|
|
93
|
+
return _dict
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
97
|
+
"""Create an instance of PaginatedDepositList from a dict"""
|
|
98
|
+
if obj is None:
|
|
99
|
+
return None
|
|
100
|
+
|
|
101
|
+
if not isinstance(obj, dict):
|
|
102
|
+
return cls.model_validate(obj)
|
|
103
|
+
|
|
104
|
+
_obj = cls.model_validate({
|
|
105
|
+
"count": obj.get("count"),
|
|
106
|
+
"next": obj.get("next"),
|
|
107
|
+
"previous": obj.get("previous"),
|
|
108
|
+
"results": [Deposit.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
|
|
109
|
+
})
|
|
110
|
+
return _obj
|
|
111
|
+
|
|
112
|
+
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Pidgin Host API
|
|
5
|
+
|
|
6
|
+
The Pidgin Host API allows you to manage Services and resources within the Pidgin Host cloud in a simple, programmatic way using conventional HTTP requests. All of the functionality that you are familiar with in the Pidgin Host control panel is also available through the API, allowing you to script the complex actions that your situation requires.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0 (v1)
|
|
9
|
+
Contact: support@pidginhost.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from pidginhost_sdk.models.domain import Domain
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class PaginatedDomainList(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
PaginatedDomainList
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
count: StrictInt
|
|
32
|
+
next: Optional[StrictStr] = None
|
|
33
|
+
previous: Optional[StrictStr] = None
|
|
34
|
+
results: List[Domain]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["count", "next", "previous", "results"]
|
|
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 PaginatedDomainList 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
|
+
# override the default output from pydantic by calling `to_dict()` of each item in results (list)
|
|
77
|
+
_items = []
|
|
78
|
+
if self.results:
|
|
79
|
+
for _item_results in self.results:
|
|
80
|
+
if _item_results:
|
|
81
|
+
_items.append(_item_results.to_dict())
|
|
82
|
+
_dict['results'] = _items
|
|
83
|
+
# set to None if next (nullable) is None
|
|
84
|
+
# and model_fields_set contains the field
|
|
85
|
+
if self.next is None and "next" in self.model_fields_set:
|
|
86
|
+
_dict['next'] = None
|
|
87
|
+
|
|
88
|
+
# set to None if previous (nullable) is None
|
|
89
|
+
# and model_fields_set contains the field
|
|
90
|
+
if self.previous is None and "previous" in self.model_fields_set:
|
|
91
|
+
_dict['previous'] = None
|
|
92
|
+
|
|
93
|
+
return _dict
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
97
|
+
"""Create an instance of PaginatedDomainList from a dict"""
|
|
98
|
+
if obj is None:
|
|
99
|
+
return None
|
|
100
|
+
|
|
101
|
+
if not isinstance(obj, dict):
|
|
102
|
+
return cls.model_validate(obj)
|
|
103
|
+
|
|
104
|
+
_obj = cls.model_validate({
|
|
105
|
+
"count": obj.get("count"),
|
|
106
|
+
"next": obj.get("next"),
|
|
107
|
+
"previous": obj.get("previous"),
|
|
108
|
+
"results": [Domain.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
|
|
109
|
+
})
|
|
110
|
+
return _obj
|
|
111
|
+
|
|
112
|
+
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Pidgin Host API
|
|
5
|
+
|
|
6
|
+
The Pidgin Host API allows you to manage Services and resources within the Pidgin Host cloud in a simple, programmatic way using conventional HTTP requests. All of the functionality that you are familiar with in the Pidgin Host control panel is also available through the API, allowing you to script the complex actions that your situation requires.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0 (v1)
|
|
9
|
+
Contact: support@pidginhost.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from pidginhost_sdk.models.domain_registrant import DomainRegistrant
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class PaginatedDomainRegistrantList(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
PaginatedDomainRegistrantList
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
count: StrictInt
|
|
32
|
+
next: Optional[StrictStr] = None
|
|
33
|
+
previous: Optional[StrictStr] = None
|
|
34
|
+
results: List[DomainRegistrant]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["count", "next", "previous", "results"]
|
|
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 PaginatedDomainRegistrantList 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
|
+
# override the default output from pydantic by calling `to_dict()` of each item in results (list)
|
|
77
|
+
_items = []
|
|
78
|
+
if self.results:
|
|
79
|
+
for _item_results in self.results:
|
|
80
|
+
if _item_results:
|
|
81
|
+
_items.append(_item_results.to_dict())
|
|
82
|
+
_dict['results'] = _items
|
|
83
|
+
# set to None if next (nullable) is None
|
|
84
|
+
# and model_fields_set contains the field
|
|
85
|
+
if self.next is None and "next" in self.model_fields_set:
|
|
86
|
+
_dict['next'] = None
|
|
87
|
+
|
|
88
|
+
# set to None if previous (nullable) is None
|
|
89
|
+
# and model_fields_set contains the field
|
|
90
|
+
if self.previous is None and "previous" in self.model_fields_set:
|
|
91
|
+
_dict['previous'] = None
|
|
92
|
+
|
|
93
|
+
return _dict
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
97
|
+
"""Create an instance of PaginatedDomainRegistrantList from a dict"""
|
|
98
|
+
if obj is None:
|
|
99
|
+
return None
|
|
100
|
+
|
|
101
|
+
if not isinstance(obj, dict):
|
|
102
|
+
return cls.model_validate(obj)
|
|
103
|
+
|
|
104
|
+
_obj = cls.model_validate({
|
|
105
|
+
"count": obj.get("count"),
|
|
106
|
+
"next": obj.get("next"),
|
|
107
|
+
"previous": obj.get("previous"),
|
|
108
|
+
"results": [DomainRegistrant.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
|
|
109
|
+
})
|
|
110
|
+
return _obj
|
|
111
|
+
|
|
112
|
+
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Pidgin Host API
|
|
5
|
+
|
|
6
|
+
The Pidgin Host API allows you to manage Services and resources within the Pidgin Host cloud in a simple, programmatic way using conventional HTTP requests. All of the functionality that you are familiar with in the Pidgin Host control panel is also available through the API, allowing you to script the complex actions that your situation requires.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0 (v1)
|
|
9
|
+
Contact: support@pidginhost.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from pidginhost_sdk.models.email_history import EmailHistory
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class PaginatedEmailHistoryList(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
PaginatedEmailHistoryList
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
count: StrictInt
|
|
32
|
+
next: Optional[StrictStr] = None
|
|
33
|
+
previous: Optional[StrictStr] = None
|
|
34
|
+
results: List[EmailHistory]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["count", "next", "previous", "results"]
|
|
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 PaginatedEmailHistoryList 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
|
+
# override the default output from pydantic by calling `to_dict()` of each item in results (list)
|
|
77
|
+
_items = []
|
|
78
|
+
if self.results:
|
|
79
|
+
for _item_results in self.results:
|
|
80
|
+
if _item_results:
|
|
81
|
+
_items.append(_item_results.to_dict())
|
|
82
|
+
_dict['results'] = _items
|
|
83
|
+
# set to None if next (nullable) is None
|
|
84
|
+
# and model_fields_set contains the field
|
|
85
|
+
if self.next is None and "next" in self.model_fields_set:
|
|
86
|
+
_dict['next'] = None
|
|
87
|
+
|
|
88
|
+
# set to None if previous (nullable) is None
|
|
89
|
+
# and model_fields_set contains the field
|
|
90
|
+
if self.previous is None and "previous" in self.model_fields_set:
|
|
91
|
+
_dict['previous'] = None
|
|
92
|
+
|
|
93
|
+
return _dict
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
97
|
+
"""Create an instance of PaginatedEmailHistoryList from a dict"""
|
|
98
|
+
if obj is None:
|
|
99
|
+
return None
|
|
100
|
+
|
|
101
|
+
if not isinstance(obj, dict):
|
|
102
|
+
return cls.model_validate(obj)
|
|
103
|
+
|
|
104
|
+
_obj = cls.model_validate({
|
|
105
|
+
"count": obj.get("count"),
|
|
106
|
+
"next": obj.get("next"),
|
|
107
|
+
"previous": obj.get("previous"),
|
|
108
|
+
"results": [EmailHistory.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
|
|
109
|
+
})
|
|
110
|
+
return _obj
|
|
111
|
+
|
|
112
|
+
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Pidgin Host API
|
|
5
|
+
|
|
6
|
+
The Pidgin Host API allows you to manage Services and resources within the Pidgin Host cloud in a simple, programmatic way using conventional HTTP requests. All of the functionality that you are familiar with in the Pidgin Host control panel is also available through the API, allowing you to script the complex actions that your situation requires.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0 (v1)
|
|
9
|
+
Contact: support@pidginhost.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from pidginhost_sdk.models.funds_log import FundsLog
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class PaginatedFundsLogList(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
PaginatedFundsLogList
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
count: StrictInt
|
|
32
|
+
next: Optional[StrictStr] = None
|
|
33
|
+
previous: Optional[StrictStr] = None
|
|
34
|
+
results: List[FundsLog]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["count", "next", "previous", "results"]
|
|
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 PaginatedFundsLogList 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
|
+
# override the default output from pydantic by calling `to_dict()` of each item in results (list)
|
|
77
|
+
_items = []
|
|
78
|
+
if self.results:
|
|
79
|
+
for _item_results in self.results:
|
|
80
|
+
if _item_results:
|
|
81
|
+
_items.append(_item_results.to_dict())
|
|
82
|
+
_dict['results'] = _items
|
|
83
|
+
# set to None if next (nullable) is None
|
|
84
|
+
# and model_fields_set contains the field
|
|
85
|
+
if self.next is None and "next" in self.model_fields_set:
|
|
86
|
+
_dict['next'] = None
|
|
87
|
+
|
|
88
|
+
# set to None if previous (nullable) is None
|
|
89
|
+
# and model_fields_set contains the field
|
|
90
|
+
if self.previous is None and "previous" in self.model_fields_set:
|
|
91
|
+
_dict['previous'] = None
|
|
92
|
+
|
|
93
|
+
return _dict
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
97
|
+
"""Create an instance of PaginatedFundsLogList from a dict"""
|
|
98
|
+
if obj is None:
|
|
99
|
+
return None
|
|
100
|
+
|
|
101
|
+
if not isinstance(obj, dict):
|
|
102
|
+
return cls.model_validate(obj)
|
|
103
|
+
|
|
104
|
+
_obj = cls.model_validate({
|
|
105
|
+
"count": obj.get("count"),
|
|
106
|
+
"next": obj.get("next"),
|
|
107
|
+
"previous": obj.get("previous"),
|
|
108
|
+
"results": [FundsLog.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
|
|
109
|
+
})
|
|
110
|
+
return _obj
|
|
111
|
+
|
|
112
|
+
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Pidgin Host API
|
|
5
|
+
|
|
6
|
+
The Pidgin Host API allows you to manage Services and resources within the Pidgin Host cloud in a simple, programmatic way using conventional HTTP requests. All of the functionality that you are familiar with in the Pidgin Host control panel is also available through the API, allowing you to script the complex actions that your situation requires.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0 (v1)
|
|
9
|
+
Contact: support@pidginhost.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from pidginhost_sdk.models.hosting_service import HostingService
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class PaginatedHostingServiceList(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
PaginatedHostingServiceList
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
count: StrictInt
|
|
32
|
+
next: Optional[StrictStr] = None
|
|
33
|
+
previous: Optional[StrictStr] = None
|
|
34
|
+
results: List[HostingService]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["count", "next", "previous", "results"]
|
|
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 PaginatedHostingServiceList 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
|
+
# override the default output from pydantic by calling `to_dict()` of each item in results (list)
|
|
77
|
+
_items = []
|
|
78
|
+
if self.results:
|
|
79
|
+
for _item_results in self.results:
|
|
80
|
+
if _item_results:
|
|
81
|
+
_items.append(_item_results.to_dict())
|
|
82
|
+
_dict['results'] = _items
|
|
83
|
+
# set to None if next (nullable) is None
|
|
84
|
+
# and model_fields_set contains the field
|
|
85
|
+
if self.next is None and "next" in self.model_fields_set:
|
|
86
|
+
_dict['next'] = None
|
|
87
|
+
|
|
88
|
+
# set to None if previous (nullable) is None
|
|
89
|
+
# and model_fields_set contains the field
|
|
90
|
+
if self.previous is None and "previous" in self.model_fields_set:
|
|
91
|
+
_dict['previous'] = None
|
|
92
|
+
|
|
93
|
+
return _dict
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
97
|
+
"""Create an instance of PaginatedHostingServiceList from a dict"""
|
|
98
|
+
if obj is None:
|
|
99
|
+
return None
|
|
100
|
+
|
|
101
|
+
if not isinstance(obj, dict):
|
|
102
|
+
return cls.model_validate(obj)
|
|
103
|
+
|
|
104
|
+
_obj = cls.model_validate({
|
|
105
|
+
"count": obj.get("count"),
|
|
106
|
+
"next": obj.get("next"),
|
|
107
|
+
"previous": obj.get("previous"),
|
|
108
|
+
"results": [HostingService.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
|
|
109
|
+
})
|
|
110
|
+
return _obj
|
|
111
|
+
|
|
112
|
+
|