Skip to content

Commit 4cb1d19

Browse files
authored
chore: update API to v0.33.0 (#74)
1 parent 2f93602 commit 4cb1d19

19 files changed

Lines changed: 250 additions & 86 deletions

lib/binarylane/models/create_load_balancer_request.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
import attr
66

7-
from binarylane.models.forwarding_rule import ForwardingRule
8-
from binarylane.models.health_check import HealthCheck
7+
from binarylane.models.forwarding_rule_request import ForwardingRuleRequest
8+
from binarylane.models.health_check_request import HealthCheckRequest
99
from binarylane.types import UNSET, Unset
1010

1111
T = TypeVar("T", bound="CreateLoadBalancerRequest")
@@ -16,18 +16,18 @@ class CreateLoadBalancerRequest:
1616
"""
1717
Attributes:
1818
name (str): The hostname of the load balancer.
19-
forwarding_rules (Union[Unset, None, List[ForwardingRule]]): The rules that control which traffic the load
20-
balancer will forward to servers in the pool. Leave null to accept a default "HTTP" only forwarding rule.
21-
health_check (Union[Unset, None, HealthCheck]): The rules that determine which servers are considered 'healthy'
22-
and in the server pool for the load balancer. Leave this null to accept appropriate defaults based on the
23-
forwarding_rules.
19+
forwarding_rules (Union[Unset, None, List[ForwardingRuleRequest]]): The rules that control which traffic the
20+
load balancer will forward to servers in the pool. Leave null to accept a default "HTTP" only forwarding rule.
21+
health_check (Union[Unset, None, HealthCheckRequest]): The rules that determine which servers are considered
22+
'healthy' and in the server pool for the load balancer. Leave this null to accept appropriate defaults based on
23+
the forwarding_rules.
2424
server_ids (Union[Unset, None, List[int]]): A list of server IDs to assign to this load balancer.
2525
region (Union[Unset, None, str]): Leave null to create an anycast load balancer.
2626
"""
2727

2828
name: str
29-
forwarding_rules: Union[Unset, None, List[ForwardingRule]] = UNSET
30-
health_check: Union[Unset, None, HealthCheck] = UNSET
29+
forwarding_rules: Union[Unset, None, List[ForwardingRuleRequest]] = UNSET
30+
health_check: Union[Unset, None, HealthCheckRequest] = UNSET
3131
server_ids: Union[Unset, None, List[int]] = UNSET
3232
region: Union[Unset, None, str] = UNSET
3333
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
@@ -84,18 +84,18 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
8484
forwarding_rules = []
8585
_forwarding_rules = d.pop("forwarding_rules", UNSET)
8686
for forwarding_rules_item_data in _forwarding_rules or []:
87-
forwarding_rules_item = ForwardingRule.from_dict(forwarding_rules_item_data)
87+
forwarding_rules_item = ForwardingRuleRequest.from_dict(forwarding_rules_item_data)
8888

8989
forwarding_rules.append(forwarding_rules_item)
9090

9191
_health_check = d.pop("health_check", UNSET)
92-
health_check: Union[Unset, None, HealthCheck]
92+
health_check: Union[Unset, None, HealthCheckRequest]
9393
if _health_check is None:
9494
health_check = None
9595
elif isinstance(_health_check, Unset):
9696
health_check = UNSET
9797
else:
98-
health_check = HealthCheck.from_dict(_health_check)
98+
health_check = HealthCheckRequest.from_dict(_health_check)
9999

100100
server_ids = cast(List[int], d.pop("server_ids", UNSET))
101101

lib/binarylane/models/domain.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ class Domain:
1717
name (str): The name of the domain.
1818
current_nameservers (List[str]): The current authoritative name servers for this domain.
1919
zone_file (str): The zone file for the selected domain. If the DNS records for this domain are not managed
20-
locally this is what the zone file would be if the authority was delegated to us.
20+
locally this is what the zone file would be if the authority was delegated to us. The serial is will always be 0
21+
rather than the correct value.
2122
ttl (Union[Unset, None, int]): The time to live for records in this domain in seconds. If the DNS records for
2223
this domain are not managed locally this will be what the TTL would be if the authority was delegated to us.
2324
"""
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
from __future__ import annotations
2+
3+
from typing import Any, Dict, List, Type, TypeVar
4+
5+
import attr
6+
7+
from binarylane.models.load_balancer_rule_protocol import LoadBalancerRuleProtocol
8+
9+
T = TypeVar("T", bound="ForwardingRuleRequest")
10+
11+
12+
@attr.s(auto_attribs=True)
13+
class ForwardingRuleRequest:
14+
"""
15+
Attributes:
16+
entry_protocol (LoadBalancerRuleProtocol): The protocol that traffic must match for this load balancer to
17+
forward traffic according to this rule.
18+
19+
| Value | Description |
20+
| ----- | ----------- |
21+
| http | The load balancer will forward HTTP traffic that matches this rule. |
22+
| https | The load balancer will forward HTTPS traffic that matches this rule. |
23+
24+
"""
25+
26+
entry_protocol: LoadBalancerRuleProtocol
27+
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
28+
29+
def to_dict(self) -> Dict[str, Any]:
30+
entry_protocol = self.entry_protocol.value
31+
32+
field_dict: Dict[str, Any] = {}
33+
field_dict.update(self.additional_properties)
34+
field_dict.update(
35+
{
36+
"entry_protocol": entry_protocol,
37+
}
38+
)
39+
40+
return field_dict
41+
42+
@classmethod
43+
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
44+
d = src_dict.copy()
45+
entry_protocol = LoadBalancerRuleProtocol(d.pop("entry_protocol"))
46+
47+
forwarding_rule_request = cls(
48+
entry_protocol=entry_protocol,
49+
)
50+
51+
forwarding_rule_request.additional_properties = d
52+
return forwarding_rule_request
53+
54+
@property
55+
def additional_keys(self) -> List[str]:
56+
return list(self.additional_properties.keys())
57+
58+
def __getitem__(self, key: str) -> Any:
59+
return self.additional_properties[key]
60+
61+
def __setitem__(self, key: str, value: Any) -> None:
62+
self.additional_properties[key] = value
63+
64+
def __delitem__(self, key: str) -> None:
65+
del self.additional_properties[key]
66+
67+
def __contains__(self, key: str) -> bool:
68+
return key in self.additional_properties

lib/binarylane/models/forwarding_rules_request.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import attr
66

7-
from binarylane.models.forwarding_rule import ForwardingRule
7+
from binarylane.models.forwarding_rule_request import ForwardingRuleRequest
88

99
T = TypeVar("T", bound="ForwardingRulesRequest")
1010

@@ -13,11 +13,11 @@
1313
class ForwardingRulesRequest:
1414
"""
1515
Attributes:
16-
forwarding_rules (List[ForwardingRule]): The rules that control which traffic the load balancer will forward to
17-
servers in the pool.
16+
forwarding_rules (List[ForwardingRuleRequest]): The rules that control which traffic the load balancer will
17+
forward to servers in the pool.
1818
"""
1919

20-
forwarding_rules: List[ForwardingRule]
20+
forwarding_rules: List[ForwardingRuleRequest]
2121
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
2222

2323
def to_dict(self) -> Dict[str, Any]:
@@ -43,7 +43,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
4343
forwarding_rules = []
4444
_forwarding_rules = d.pop("forwarding_rules")
4545
for forwarding_rules_item_data in _forwarding_rules:
46-
forwarding_rules_item = ForwardingRule.from_dict(forwarding_rules_item_data)
46+
forwarding_rules_item = ForwardingRuleRequest.from_dict(forwarding_rules_item_data)
4747

4848
forwarding_rules.append(forwarding_rules_item)
4949

lib/binarylane/models/health_check.py

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
from __future__ import annotations
22

3-
from typing import Any, Dict, List, Type, TypeVar, Union
3+
from typing import Any, Dict, List, Type, TypeVar
44

55
import attr
66

77
from binarylane.models.health_check_protocol import HealthCheckProtocol
8-
from binarylane.types import UNSET, Unset
98

109
T = TypeVar("T", bound="HealthCheck")
1110

@@ -14,7 +13,7 @@
1413
class HealthCheck:
1514
"""
1615
Attributes:
17-
protocol (Union[Unset, None, HealthCheckProtocol]): Leave null to accept the default HTTP protocol.
16+
protocol (HealthCheckProtocol): The protocol used for the health check.
1817
1918
| Value | Description |
2019
| ----- | ----------- |
@@ -23,43 +22,35 @@ class HealthCheck:
2322
| both | The health check will be performed via both HTTP and HTTPS. Failing a health check on one protocol will
2423
remove the server from the pool of servers only for that protocol. |
2524
26-
path (Union[Unset, None, str]): Leave null to accept the default '/' path.
25+
path (str): The path to the health check endpoint.
2726
"""
2827

29-
protocol: Union[Unset, None, HealthCheckProtocol] = UNSET
30-
path: Union[Unset, None, str] = UNSET
28+
protocol: HealthCheckProtocol
29+
path: str
3130
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
3231

3332
def to_dict(self) -> Dict[str, Any]:
34-
protocol: Union[Unset, None, str] = UNSET
35-
if not isinstance(self.protocol, Unset):
36-
protocol = self.protocol.value if self.protocol else None
33+
protocol = self.protocol.value
3734

3835
path = self.path
3936

4037
field_dict: Dict[str, Any] = {}
4138
field_dict.update(self.additional_properties)
42-
field_dict.update({})
43-
if protocol is not UNSET:
44-
field_dict["protocol"] = protocol
45-
if path is not UNSET:
46-
field_dict["path"] = path
39+
field_dict.update(
40+
{
41+
"protocol": protocol,
42+
"path": path,
43+
}
44+
)
4745

4846
return field_dict
4947

5048
@classmethod
5149
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
5250
d = src_dict.copy()
53-
_protocol = d.pop("protocol", UNSET)
54-
protocol: Union[Unset, None, HealthCheckProtocol]
55-
if _protocol is None:
56-
protocol = None
57-
elif isinstance(_protocol, Unset):
58-
protocol = UNSET
59-
else:
60-
protocol = HealthCheckProtocol(_protocol)
61-
62-
path = d.pop("path", UNSET)
51+
protocol = HealthCheckProtocol(d.pop("protocol"))
52+
53+
path = d.pop("path")
6354

6455
health_check = cls(
6556
protocol=protocol,
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
from __future__ import annotations
2+
3+
from typing import Any, Dict, List, Type, TypeVar, Union
4+
5+
import attr
6+
7+
from binarylane.models.health_check_protocol import HealthCheckProtocol
8+
from binarylane.types import UNSET, Unset
9+
10+
T = TypeVar("T", bound="HealthCheckRequest")
11+
12+
13+
@attr.s(auto_attribs=True)
14+
class HealthCheckRequest:
15+
"""
16+
Attributes:
17+
protocol (Union[Unset, None, HealthCheckProtocol]): Leave null to accept the default HTTP protocol.
18+
19+
| Value | Description |
20+
| ----- | ----------- |
21+
| http | The health check will be performed via HTTP. |
22+
| https | The health check will be performed via HTTPS. |
23+
| both | The health check will be performed via both HTTP and HTTPS. Failing a health check on one protocol will
24+
remove the server from the pool of servers only for that protocol. |
25+
26+
path (Union[Unset, None, str]): Leave null to accept the default '/' path.
27+
"""
28+
29+
protocol: Union[Unset, None, HealthCheckProtocol] = UNSET
30+
path: Union[Unset, None, str] = UNSET
31+
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
32+
33+
def to_dict(self) -> Dict[str, Any]:
34+
protocol: Union[Unset, None, str] = UNSET
35+
if not isinstance(self.protocol, Unset):
36+
protocol = self.protocol.value if self.protocol else None
37+
38+
path = self.path
39+
40+
field_dict: Dict[str, Any] = {}
41+
field_dict.update(self.additional_properties)
42+
field_dict.update({})
43+
if protocol is not UNSET:
44+
field_dict["protocol"] = protocol
45+
if path is not UNSET:
46+
field_dict["path"] = path
47+
48+
return field_dict
49+
50+
@classmethod
51+
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
52+
d = src_dict.copy()
53+
_protocol = d.pop("protocol", UNSET)
54+
protocol: Union[Unset, None, HealthCheckProtocol]
55+
if _protocol is None:
56+
protocol = None
57+
elif isinstance(_protocol, Unset):
58+
protocol = UNSET
59+
else:
60+
protocol = HealthCheckProtocol(_protocol)
61+
62+
path = d.pop("path", UNSET)
63+
64+
health_check_request = cls(
65+
protocol=protocol,
66+
path=path,
67+
)
68+
69+
health_check_request.additional_properties = d
70+
return health_check_request
71+
72+
@property
73+
def additional_keys(self) -> List[str]:
74+
return list(self.additional_properties.keys())
75+
76+
def __getitem__(self, key: str) -> Any:
77+
return self.additional_properties[key]
78+
79+
def __setitem__(self, key: str, value: Any) -> None:
80+
self.additional_properties[key] = value
81+
82+
def __delitem__(self, key: str) -> None:
83+
del self.additional_properties[key]
84+
85+
def __contains__(self, key: str) -> bool:
86+
return key in self.additional_properties

lib/binarylane/models/licensed_software.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,31 @@ class LicensedSoftware:
1515
Attributes:
1616
software (Software): The currently licensed software.
1717
licence_count (int): The current licence count for the software.
18+
incompatible (bool): Software that is incompatible with the server will be automatically removed at the next
19+
plan change.
20+
Servers may have incompatible software due to changes made by support. Software is not incompatible merely
21+
because it is disabled;
22+
disabled software may be retained by servers that already have it, incompatible software will be removed.
1823
"""
1924

2025
software: Software
2126
licence_count: int
27+
incompatible: bool
2228
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
2329

2430
def to_dict(self) -> Dict[str, Any]:
2531
software = self.software.to_dict()
2632

2733
licence_count = self.licence_count
34+
incompatible = self.incompatible
2835

2936
field_dict: Dict[str, Any] = {}
3037
field_dict.update(self.additional_properties)
3138
field_dict.update(
3239
{
3340
"software": software,
3441
"licence_count": licence_count,
42+
"incompatible": incompatible,
3543
}
3644
)
3745

@@ -44,9 +52,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
4452

4553
licence_count = d.pop("licence_count")
4654

55+
incompatible = d.pop("incompatible")
56+
4757
licensed_software = cls(
4858
software=software,
4959
licence_count=licence_count,
60+
incompatible=incompatible,
5061
)
5162

5263
licensed_software.additional_properties = d

lib/binarylane/models/load_balancer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ class LoadBalancer:
2222
id (int): The ID of the load balancer.
2323
name (str): The hostname of the load balancer.
2424
ip (str): The IPv4 address of the load balancer.
25-
status (LoadBalancerStatus):
25+
status (LoadBalancerStatus): The current status of the load balancer.
26+
2627
| Value | Description |
2728
| ----- | ----------- |
2829
| new | The load balancer is currently being built and is not ready to accept connections. |

0 commit comments

Comments
 (0)