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,151 @@
|
|
|
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, Field, StrictBool, StrictInt, StrictStr, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing_extensions import Annotated
|
|
24
|
+
from pidginhost_sdk.models.features_enum import FeaturesEnum
|
|
25
|
+
from pidginhost_sdk.models.status_a57_enum import StatusA57Enum
|
|
26
|
+
from typing import Optional, Set
|
|
27
|
+
from typing_extensions import Self
|
|
28
|
+
|
|
29
|
+
class PatchedClusterDetail(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
PatchedClusterDetail
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
id: Optional[StrictInt] = None
|
|
34
|
+
status: Optional[StatusA57Enum] = None
|
|
35
|
+
name: Optional[Annotated[str, Field(strict=True, max_length=200)]] = None
|
|
36
|
+
cluster_type: Optional[StrictStr] = None
|
|
37
|
+
kube_version: Optional[StrictStr] = None
|
|
38
|
+
price_per_month: Optional[Annotated[str, Field(strict=True)]] = None
|
|
39
|
+
price_per_hour: Optional[StrictStr] = None
|
|
40
|
+
features: Optional[List[FeaturesEnum]] = None
|
|
41
|
+
features_ready: Optional[StrictBool] = None
|
|
42
|
+
kubeconfig_valid_until: Optional[StrictStr] = None
|
|
43
|
+
ipv4_address: Optional[StrictStr] = None
|
|
44
|
+
protected: Optional[StrictBool] = None
|
|
45
|
+
talos_version: Optional[StrictStr] = None
|
|
46
|
+
talos_upgrade_available: Optional[StrictStr] = None
|
|
47
|
+
talos_next_version: Optional[StrictStr] = None
|
|
48
|
+
__properties: ClassVar[List[str]] = ["id", "status", "name", "cluster_type", "kube_version", "price_per_month", "price_per_hour", "features", "features_ready", "kubeconfig_valid_until", "ipv4_address", "protected", "talos_version", "talos_upgrade_available", "talos_next_version"]
|
|
49
|
+
|
|
50
|
+
@field_validator('price_per_month')
|
|
51
|
+
def price_per_month_validate_regular_expression(cls, value):
|
|
52
|
+
"""Validates the regular expression"""
|
|
53
|
+
if value is None:
|
|
54
|
+
return value
|
|
55
|
+
|
|
56
|
+
if not re.match(r"^-?\d{0,16}(?:\.\d{0,4})?$", value):
|
|
57
|
+
raise ValueError(r"must validate the regular expression /^-?\d{0,16}(?:\.\d{0,4})?$/")
|
|
58
|
+
return value
|
|
59
|
+
|
|
60
|
+
model_config = ConfigDict(
|
|
61
|
+
populate_by_name=True,
|
|
62
|
+
validate_assignment=True,
|
|
63
|
+
protected_namespaces=(),
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def to_str(self) -> str:
|
|
68
|
+
"""Returns the string representation of the model using alias"""
|
|
69
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
70
|
+
|
|
71
|
+
def to_json(self) -> str:
|
|
72
|
+
"""Returns the JSON representation of the model using alias"""
|
|
73
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
74
|
+
return json.dumps(self.to_dict())
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
78
|
+
"""Create an instance of PatchedClusterDetail from a JSON string"""
|
|
79
|
+
return cls.from_dict(json.loads(json_str))
|
|
80
|
+
|
|
81
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
82
|
+
"""Return the dictionary representation of the model using alias.
|
|
83
|
+
|
|
84
|
+
This has the following differences from calling pydantic's
|
|
85
|
+
`self.model_dump(by_alias=True)`:
|
|
86
|
+
|
|
87
|
+
* `None` is only added to the output dict for nullable fields that
|
|
88
|
+
were set at model initialization. Other fields with value `None`
|
|
89
|
+
are ignored.
|
|
90
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
91
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
92
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
93
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
94
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
95
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
96
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
97
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
98
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
99
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
100
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
101
|
+
"""
|
|
102
|
+
excluded_fields: Set[str] = set([
|
|
103
|
+
"id",
|
|
104
|
+
"status",
|
|
105
|
+
"cluster_type",
|
|
106
|
+
"kube_version",
|
|
107
|
+
"price_per_hour",
|
|
108
|
+
"features_ready",
|
|
109
|
+
"kubeconfig_valid_until",
|
|
110
|
+
"ipv4_address",
|
|
111
|
+
"talos_version",
|
|
112
|
+
"talos_upgrade_available",
|
|
113
|
+
"talos_next_version",
|
|
114
|
+
])
|
|
115
|
+
|
|
116
|
+
_dict = self.model_dump(
|
|
117
|
+
by_alias=True,
|
|
118
|
+
exclude=excluded_fields,
|
|
119
|
+
exclude_none=True,
|
|
120
|
+
)
|
|
121
|
+
return _dict
|
|
122
|
+
|
|
123
|
+
@classmethod
|
|
124
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
125
|
+
"""Create an instance of PatchedClusterDetail from a dict"""
|
|
126
|
+
if obj is None:
|
|
127
|
+
return None
|
|
128
|
+
|
|
129
|
+
if not isinstance(obj, dict):
|
|
130
|
+
return cls.model_validate(obj)
|
|
131
|
+
|
|
132
|
+
_obj = cls.model_validate({
|
|
133
|
+
"id": obj.get("id"),
|
|
134
|
+
"status": obj.get("status"),
|
|
135
|
+
"name": obj.get("name"),
|
|
136
|
+
"cluster_type": obj.get("cluster_type"),
|
|
137
|
+
"kube_version": obj.get("kube_version"),
|
|
138
|
+
"price_per_month": obj.get("price_per_month"),
|
|
139
|
+
"price_per_hour": obj.get("price_per_hour"),
|
|
140
|
+
"features": obj.get("features"),
|
|
141
|
+
"features_ready": obj.get("features_ready"),
|
|
142
|
+
"kubeconfig_valid_until": obj.get("kubeconfig_valid_until"),
|
|
143
|
+
"ipv4_address": obj.get("ipv4_address"),
|
|
144
|
+
"protected": obj.get("protected"),
|
|
145
|
+
"talos_version": obj.get("talos_version"),
|
|
146
|
+
"talos_upgrade_available": obj.get("talos_upgrade_available"),
|
|
147
|
+
"talos_next_version": obj.get("talos_next_version")
|
|
148
|
+
})
|
|
149
|
+
return _obj
|
|
150
|
+
|
|
151
|
+
|
|
@@ -0,0 +1,111 @@
|
|
|
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, Field, StrictInt
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing_extensions import Annotated
|
|
24
|
+
from pidginhost_sdk.models.address import Address
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class PatchedCompany(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
PatchedCompany
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
id: Optional[StrictInt] = None
|
|
33
|
+
name: Optional[Annotated[str, Field(strict=True, max_length=200)]] = None
|
|
34
|
+
cif_vat: Optional[Annotated[str, Field(strict=True, max_length=50)]] = None
|
|
35
|
+
reg: Optional[Annotated[str, Field(strict=True, max_length=100)]] = None
|
|
36
|
+
iban: Optional[Annotated[str, Field(strict=True, max_length=100)]] = None
|
|
37
|
+
bank: Optional[Annotated[str, Field(strict=True, max_length=100)]] = None
|
|
38
|
+
contact_name: Optional[Annotated[str, Field(strict=True, max_length=100)]] = None
|
|
39
|
+
contact_email: Optional[Annotated[str, Field(strict=True, max_length=100)]] = None
|
|
40
|
+
address: Optional[Address] = None
|
|
41
|
+
__properties: ClassVar[List[str]] = ["id", "name", "cif_vat", "reg", "iban", "bank", "contact_name", "contact_email", "address"]
|
|
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 PatchedCompany 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
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
74
|
+
"""
|
|
75
|
+
excluded_fields: Set[str] = set([
|
|
76
|
+
"id",
|
|
77
|
+
])
|
|
78
|
+
|
|
79
|
+
_dict = self.model_dump(
|
|
80
|
+
by_alias=True,
|
|
81
|
+
exclude=excluded_fields,
|
|
82
|
+
exclude_none=True,
|
|
83
|
+
)
|
|
84
|
+
# override the default output from pydantic by calling `to_dict()` of address
|
|
85
|
+
if self.address:
|
|
86
|
+
_dict['address'] = self.address.to_dict()
|
|
87
|
+
return _dict
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
91
|
+
"""Create an instance of PatchedCompany 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
|
+
"id": obj.get("id"),
|
|
100
|
+
"name": obj.get("name"),
|
|
101
|
+
"cif_vat": obj.get("cif_vat"),
|
|
102
|
+
"reg": obj.get("reg"),
|
|
103
|
+
"iban": obj.get("iban"),
|
|
104
|
+
"bank": obj.get("bank"),
|
|
105
|
+
"contact_name": obj.get("contact_name"),
|
|
106
|
+
"contact_email": obj.get("contact_email"),
|
|
107
|
+
"address": Address.from_dict(obj["address"]) if obj.get("address") is not None else None
|
|
108
|
+
})
|
|
109
|
+
return _obj
|
|
110
|
+
|
|
111
|
+
|
|
@@ -0,0 +1,152 @@
|
|
|
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 datetime import date
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
|
23
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
24
|
+
from typing_extensions import Annotated
|
|
25
|
+
from pidginhost_sdk.models.service import Service
|
|
26
|
+
from pidginhost_sdk.models.tld import TLD
|
|
27
|
+
from typing import Optional, Set
|
|
28
|
+
from typing_extensions import Self
|
|
29
|
+
|
|
30
|
+
class PatchedDomain(BaseModel):
|
|
31
|
+
"""
|
|
32
|
+
PatchedDomain
|
|
33
|
+
""" # noqa: E501
|
|
34
|
+
id: Optional[StrictInt] = None
|
|
35
|
+
domain: Optional[StrictStr] = None
|
|
36
|
+
tld: Optional[TLD] = None
|
|
37
|
+
idna: Optional[StrictBool] = Field(default=None, description="Domain name is encoded with IDN")
|
|
38
|
+
nameservers: Optional[Annotated[str, Field(strict=True, max_length=1200)]] = Field(default=None, description="List of 2-5 name-servers separated by comma.")
|
|
39
|
+
expiration_date: Optional[date] = None
|
|
40
|
+
registration_date: Optional[date] = None
|
|
41
|
+
service: Optional[Service] = None
|
|
42
|
+
idna_name: Optional[StrictStr] = None
|
|
43
|
+
max_renew_years: Optional[StrictInt] = None
|
|
44
|
+
service_status: Optional[StrictStr] = Field(default=None, description="Service status")
|
|
45
|
+
contacts: Optional[Any] = None
|
|
46
|
+
__properties: ClassVar[List[str]] = ["id", "domain", "tld", "idna", "nameservers", "expiration_date", "registration_date", "service", "idna_name", "max_renew_years", "service_status", "contacts"]
|
|
47
|
+
|
|
48
|
+
model_config = ConfigDict(
|
|
49
|
+
populate_by_name=True,
|
|
50
|
+
validate_assignment=True,
|
|
51
|
+
protected_namespaces=(),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def to_str(self) -> str:
|
|
56
|
+
"""Returns the string representation of the model using alias"""
|
|
57
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
58
|
+
|
|
59
|
+
def to_json(self) -> str:
|
|
60
|
+
"""Returns the JSON representation of the model using alias"""
|
|
61
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
62
|
+
return json.dumps(self.to_dict())
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
66
|
+
"""Create an instance of PatchedDomain from a JSON string"""
|
|
67
|
+
return cls.from_dict(json.loads(json_str))
|
|
68
|
+
|
|
69
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
70
|
+
"""Return the dictionary representation of the model using alias.
|
|
71
|
+
|
|
72
|
+
This has the following differences from calling pydantic's
|
|
73
|
+
`self.model_dump(by_alias=True)`:
|
|
74
|
+
|
|
75
|
+
* `None` is only added to the output dict for nullable fields that
|
|
76
|
+
were set at model initialization. Other fields with value `None`
|
|
77
|
+
are ignored.
|
|
78
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
79
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
80
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
81
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
82
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
83
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
84
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
85
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
86
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
87
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
88
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
89
|
+
"""
|
|
90
|
+
excluded_fields: Set[str] = set([
|
|
91
|
+
"id",
|
|
92
|
+
"domain",
|
|
93
|
+
"tld",
|
|
94
|
+
"idna",
|
|
95
|
+
"expiration_date",
|
|
96
|
+
"registration_date",
|
|
97
|
+
"service",
|
|
98
|
+
"idna_name",
|
|
99
|
+
"max_renew_years",
|
|
100
|
+
"service_status",
|
|
101
|
+
"contacts",
|
|
102
|
+
])
|
|
103
|
+
|
|
104
|
+
_dict = self.model_dump(
|
|
105
|
+
by_alias=True,
|
|
106
|
+
exclude=excluded_fields,
|
|
107
|
+
exclude_none=True,
|
|
108
|
+
)
|
|
109
|
+
# override the default output from pydantic by calling `to_dict()` of tld
|
|
110
|
+
if self.tld:
|
|
111
|
+
_dict['tld'] = self.tld.to_dict()
|
|
112
|
+
# override the default output from pydantic by calling `to_dict()` of service
|
|
113
|
+
if self.service:
|
|
114
|
+
_dict['service'] = self.service.to_dict()
|
|
115
|
+
# set to None if registration_date (nullable) is None
|
|
116
|
+
# and model_fields_set contains the field
|
|
117
|
+
if self.registration_date is None and "registration_date" in self.model_fields_set:
|
|
118
|
+
_dict['registration_date'] = None
|
|
119
|
+
|
|
120
|
+
# set to None if contacts (nullable) is None
|
|
121
|
+
# and model_fields_set contains the field
|
|
122
|
+
if self.contacts is None and "contacts" in self.model_fields_set:
|
|
123
|
+
_dict['contacts'] = None
|
|
124
|
+
|
|
125
|
+
return _dict
|
|
126
|
+
|
|
127
|
+
@classmethod
|
|
128
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
129
|
+
"""Create an instance of PatchedDomain from a dict"""
|
|
130
|
+
if obj is None:
|
|
131
|
+
return None
|
|
132
|
+
|
|
133
|
+
if not isinstance(obj, dict):
|
|
134
|
+
return cls.model_validate(obj)
|
|
135
|
+
|
|
136
|
+
_obj = cls.model_validate({
|
|
137
|
+
"id": obj.get("id"),
|
|
138
|
+
"domain": obj.get("domain"),
|
|
139
|
+
"tld": TLD.from_dict(obj["tld"]) if obj.get("tld") is not None else None,
|
|
140
|
+
"idna": obj.get("idna"),
|
|
141
|
+
"nameservers": obj.get("nameservers"),
|
|
142
|
+
"expiration_date": obj.get("expiration_date"),
|
|
143
|
+
"registration_date": obj.get("registration_date"),
|
|
144
|
+
"service": Service.from_dict(obj["service"]) if obj.get("service") is not None else None,
|
|
145
|
+
"idna_name": obj.get("idna_name"),
|
|
146
|
+
"max_renew_years": obj.get("max_renew_years"),
|
|
147
|
+
"service_status": obj.get("service_status"),
|
|
148
|
+
"contacts": obj.get("contacts")
|
|
149
|
+
})
|
|
150
|
+
return _obj
|
|
151
|
+
|
|
152
|
+
|
|
@@ -0,0 +1,131 @@
|
|
|
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, Field, StrictInt
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing_extensions import Annotated
|
|
24
|
+
from pidginhost_sdk.models.country_enum import CountryEnum
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class PatchedDomainRegistrant(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
PatchedDomainRegistrant
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
id: Optional[StrictInt] = None
|
|
33
|
+
first_name: Optional[Annotated[str, Field(strict=True, max_length=100)]] = None
|
|
34
|
+
last_name: Optional[Annotated[str, Field(strict=True, max_length=100)]] = None
|
|
35
|
+
company: Optional[Annotated[str, Field(strict=True, max_length=40)]] = None
|
|
36
|
+
address: Optional[Annotated[str, Field(strict=True, max_length=128)]] = None
|
|
37
|
+
city: Optional[Annotated[str, Field(strict=True, max_length=100)]] = None
|
|
38
|
+
region: Optional[Annotated[str, Field(strict=True, max_length=100)]] = None
|
|
39
|
+
postal_code: Optional[Annotated[str, Field(strict=True, max_length=100)]] = None
|
|
40
|
+
country: Optional[CountryEnum] = None
|
|
41
|
+
email: Optional[Annotated[str, Field(strict=True, max_length=128)]] = None
|
|
42
|
+
phone: Optional[Annotated[str, Field(strict=True, max_length=100)]] = None
|
|
43
|
+
cif_cnp: Optional[Annotated[str, Field(strict=True, max_length=40)]] = None
|
|
44
|
+
reg_com: Optional[Annotated[str, Field(strict=True, max_length=40)]] = None
|
|
45
|
+
__properties: ClassVar[List[str]] = ["id", "first_name", "last_name", "company", "address", "city", "region", "postal_code", "country", "email", "phone", "cif_cnp", "reg_com"]
|
|
46
|
+
|
|
47
|
+
model_config = ConfigDict(
|
|
48
|
+
populate_by_name=True,
|
|
49
|
+
validate_assignment=True,
|
|
50
|
+
protected_namespaces=(),
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def to_str(self) -> str:
|
|
55
|
+
"""Returns the string representation of the model using alias"""
|
|
56
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
57
|
+
|
|
58
|
+
def to_json(self) -> str:
|
|
59
|
+
"""Returns the JSON representation of the model using alias"""
|
|
60
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
61
|
+
return json.dumps(self.to_dict())
|
|
62
|
+
|
|
63
|
+
@classmethod
|
|
64
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
65
|
+
"""Create an instance of PatchedDomainRegistrant from a JSON string"""
|
|
66
|
+
return cls.from_dict(json.loads(json_str))
|
|
67
|
+
|
|
68
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
69
|
+
"""Return the dictionary representation of the model using alias.
|
|
70
|
+
|
|
71
|
+
This has the following differences from calling pydantic's
|
|
72
|
+
`self.model_dump(by_alias=True)`:
|
|
73
|
+
|
|
74
|
+
* `None` is only added to the output dict for nullable fields that
|
|
75
|
+
were set at model initialization. Other fields with value `None`
|
|
76
|
+
are ignored.
|
|
77
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
78
|
+
"""
|
|
79
|
+
excluded_fields: Set[str] = set([
|
|
80
|
+
"id",
|
|
81
|
+
])
|
|
82
|
+
|
|
83
|
+
_dict = self.model_dump(
|
|
84
|
+
by_alias=True,
|
|
85
|
+
exclude=excluded_fields,
|
|
86
|
+
exclude_none=True,
|
|
87
|
+
)
|
|
88
|
+
# set to None if company (nullable) is None
|
|
89
|
+
# and model_fields_set contains the field
|
|
90
|
+
if self.company is None and "company" in self.model_fields_set:
|
|
91
|
+
_dict['company'] = None
|
|
92
|
+
|
|
93
|
+
# set to None if cif_cnp (nullable) is None
|
|
94
|
+
# and model_fields_set contains the field
|
|
95
|
+
if self.cif_cnp is None and "cif_cnp" in self.model_fields_set:
|
|
96
|
+
_dict['cif_cnp'] = None
|
|
97
|
+
|
|
98
|
+
# set to None if reg_com (nullable) is None
|
|
99
|
+
# and model_fields_set contains the field
|
|
100
|
+
if self.reg_com is None and "reg_com" in self.model_fields_set:
|
|
101
|
+
_dict['reg_com'] = None
|
|
102
|
+
|
|
103
|
+
return _dict
|
|
104
|
+
|
|
105
|
+
@classmethod
|
|
106
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
107
|
+
"""Create an instance of PatchedDomainRegistrant from a dict"""
|
|
108
|
+
if obj is None:
|
|
109
|
+
return None
|
|
110
|
+
|
|
111
|
+
if not isinstance(obj, dict):
|
|
112
|
+
return cls.model_validate(obj)
|
|
113
|
+
|
|
114
|
+
_obj = cls.model_validate({
|
|
115
|
+
"id": obj.get("id"),
|
|
116
|
+
"first_name": obj.get("first_name"),
|
|
117
|
+
"last_name": obj.get("last_name"),
|
|
118
|
+
"company": obj.get("company"),
|
|
119
|
+
"address": obj.get("address"),
|
|
120
|
+
"city": obj.get("city"),
|
|
121
|
+
"region": obj.get("region"),
|
|
122
|
+
"postal_code": obj.get("postal_code"),
|
|
123
|
+
"country": obj.get("country"),
|
|
124
|
+
"email": obj.get("email"),
|
|
125
|
+
"phone": obj.get("phone"),
|
|
126
|
+
"cif_cnp": obj.get("cif_cnp"),
|
|
127
|
+
"reg_com": obj.get("reg_com")
|
|
128
|
+
})
|
|
129
|
+
return _obj
|
|
130
|
+
|
|
131
|
+
|
|
@@ -0,0 +1,119 @@
|
|
|
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, Field, StrictBool, StrictInt, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing_extensions import Annotated
|
|
24
|
+
from pidginhost_sdk.models.firewall_rule_direction_enum import FirewallRuleDirectionEnum
|
|
25
|
+
from pidginhost_sdk.models.fw_policy_out_enum import FwPolicyOutEnum
|
|
26
|
+
from typing import Optional, Set
|
|
27
|
+
from typing_extensions import Self
|
|
28
|
+
|
|
29
|
+
class PatchedFirewallRule(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
PatchedFirewallRule
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
id: Optional[StrictInt] = None
|
|
34
|
+
direction: Optional[FirewallRuleDirectionEnum] = None
|
|
35
|
+
action: Optional[FwPolicyOutEnum] = None
|
|
36
|
+
protocol: Optional[Annotated[str, Field(strict=True, max_length=100)]] = None
|
|
37
|
+
source: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, description="single IP, range (20.34.101.207-201.3.9.99) or comma separated list")
|
|
38
|
+
sport: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, description="numbers (0-65535), range (\"\\d+:\\d+\", like \"80:85\"), comma separated list")
|
|
39
|
+
destination: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, description="single IP, range (20.34.101.207-201.3.9.99) or comma separated list")
|
|
40
|
+
dport: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, description="numbers (0-65535), range (\"\\d+:\\d+\", like \"80:85\"), comma separated list")
|
|
41
|
+
enabled: Optional[StrictBool] = None
|
|
42
|
+
position: Optional[Annotated[int, Field(le=32767, strict=True, ge=0)]] = None
|
|
43
|
+
has_error: Optional[StrictBool] = None
|
|
44
|
+
error_message: Optional[StrictStr] = None
|
|
45
|
+
__properties: ClassVar[List[str]] = ["id", "direction", "action", "protocol", "source", "sport", "destination", "dport", "enabled", "position", "has_error", "error_message"]
|
|
46
|
+
|
|
47
|
+
model_config = ConfigDict(
|
|
48
|
+
populate_by_name=True,
|
|
49
|
+
validate_assignment=True,
|
|
50
|
+
protected_namespaces=(),
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def to_str(self) -> str:
|
|
55
|
+
"""Returns the string representation of the model using alias"""
|
|
56
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
57
|
+
|
|
58
|
+
def to_json(self) -> str:
|
|
59
|
+
"""Returns the JSON representation of the model using alias"""
|
|
60
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
61
|
+
return json.dumps(self.to_dict())
|
|
62
|
+
|
|
63
|
+
@classmethod
|
|
64
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
65
|
+
"""Create an instance of PatchedFirewallRule from a JSON string"""
|
|
66
|
+
return cls.from_dict(json.loads(json_str))
|
|
67
|
+
|
|
68
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
69
|
+
"""Return the dictionary representation of the model using alias.
|
|
70
|
+
|
|
71
|
+
This has the following differences from calling pydantic's
|
|
72
|
+
`self.model_dump(by_alias=True)`:
|
|
73
|
+
|
|
74
|
+
* `None` is only added to the output dict for nullable fields that
|
|
75
|
+
were set at model initialization. Other fields with value `None`
|
|
76
|
+
are ignored.
|
|
77
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
78
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
79
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
80
|
+
"""
|
|
81
|
+
excluded_fields: Set[str] = set([
|
|
82
|
+
"id",
|
|
83
|
+
"has_error",
|
|
84
|
+
"error_message",
|
|
85
|
+
])
|
|
86
|
+
|
|
87
|
+
_dict = self.model_dump(
|
|
88
|
+
by_alias=True,
|
|
89
|
+
exclude=excluded_fields,
|
|
90
|
+
exclude_none=True,
|
|
91
|
+
)
|
|
92
|
+
return _dict
|
|
93
|
+
|
|
94
|
+
@classmethod
|
|
95
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
96
|
+
"""Create an instance of PatchedFirewallRule from a dict"""
|
|
97
|
+
if obj is None:
|
|
98
|
+
return None
|
|
99
|
+
|
|
100
|
+
if not isinstance(obj, dict):
|
|
101
|
+
return cls.model_validate(obj)
|
|
102
|
+
|
|
103
|
+
_obj = cls.model_validate({
|
|
104
|
+
"id": obj.get("id"),
|
|
105
|
+
"direction": obj.get("direction"),
|
|
106
|
+
"action": obj.get("action"),
|
|
107
|
+
"protocol": obj.get("protocol"),
|
|
108
|
+
"source": obj.get("source"),
|
|
109
|
+
"sport": obj.get("sport"),
|
|
110
|
+
"destination": obj.get("destination"),
|
|
111
|
+
"dport": obj.get("dport"),
|
|
112
|
+
"enabled": obj.get("enabled"),
|
|
113
|
+
"position": obj.get("position"),
|
|
114
|
+
"has_error": obj.get("has_error"),
|
|
115
|
+
"error_message": obj.get("error_message")
|
|
116
|
+
})
|
|
117
|
+
return _obj
|
|
118
|
+
|
|
119
|
+
|