Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions lib/binarylane/models/create_load_balancer_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import attr

from binarylane.models.forwarding_rule import ForwardingRule
from binarylane.models.health_check import HealthCheck
from binarylane.models.forwarding_rule_request import ForwardingRuleRequest
from binarylane.models.health_check_request import HealthCheckRequest
from binarylane.types import UNSET, Unset

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

name: str
forwarding_rules: Union[Unset, None, List[ForwardingRule]] = UNSET
health_check: Union[Unset, None, HealthCheck] = UNSET
forwarding_rules: Union[Unset, None, List[ForwardingRuleRequest]] = UNSET
health_check: Union[Unset, None, HealthCheckRequest] = UNSET
server_ids: Union[Unset, None, List[int]] = UNSET
region: Union[Unset, None, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
Expand Down Expand Up @@ -84,18 +84,18 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
forwarding_rules = []
_forwarding_rules = d.pop("forwarding_rules", UNSET)
for forwarding_rules_item_data in _forwarding_rules or []:
forwarding_rules_item = ForwardingRule.from_dict(forwarding_rules_item_data)
forwarding_rules_item = ForwardingRuleRequest.from_dict(forwarding_rules_item_data)

forwarding_rules.append(forwarding_rules_item)

_health_check = d.pop("health_check", UNSET)
health_check: Union[Unset, None, HealthCheck]
health_check: Union[Unset, None, HealthCheckRequest]
if _health_check is None:
health_check = None
elif isinstance(_health_check, Unset):
health_check = UNSET
else:
health_check = HealthCheck.from_dict(_health_check)
health_check = HealthCheckRequest.from_dict(_health_check)

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

Expand Down
3 changes: 2 additions & 1 deletion lib/binarylane/models/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class Domain:
name (str): The name of the domain.
current_nameservers (List[str]): The current authoritative name servers for this domain.
zone_file (str): The zone file for the selected domain. If the DNS records for this domain are not managed
locally this is what the zone file would be if the authority was delegated to us.
locally this is what the zone file would be if the authority was delegated to us. The serial is will always be 0
rather than the correct value.
ttl (Union[Unset, None, int]): The time to live for records in this domain in seconds. If the DNS records for
this domain are not managed locally this will be what the TTL would be if the authority was delegated to us.
"""
Expand Down
68 changes: 68 additions & 0 deletions lib/binarylane/models/forwarding_rule_request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
from __future__ import annotations

from typing import Any, Dict, List, Type, TypeVar

import attr

from binarylane.models.load_balancer_rule_protocol import LoadBalancerRuleProtocol

T = TypeVar("T", bound="ForwardingRuleRequest")


@attr.s(auto_attribs=True)
class ForwardingRuleRequest:
"""
Attributes:
entry_protocol (LoadBalancerRuleProtocol): The protocol that traffic must match for this load balancer to
forward traffic according to this rule.

| Value | Description |
| ----- | ----------- |
| http | The load balancer will forward HTTP traffic that matches this rule. |
| https | The load balancer will forward HTTPS traffic that matches this rule. |

"""

entry_protocol: LoadBalancerRuleProtocol
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:
entry_protocol = self.entry_protocol.value

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
{
"entry_protocol": entry_protocol,
}
)

return field_dict

@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
entry_protocol = LoadBalancerRuleProtocol(d.pop("entry_protocol"))

forwarding_rule_request = cls(
entry_protocol=entry_protocol,
)

forwarding_rule_request.additional_properties = d
return forwarding_rule_request

@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())

def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]

def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value

def __delitem__(self, key: str) -> None:
del self.additional_properties[key]

def __contains__(self, key: str) -> bool:
return key in self.additional_properties
10 changes: 5 additions & 5 deletions lib/binarylane/models/forwarding_rules_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import attr

from binarylane.models.forwarding_rule import ForwardingRule
from binarylane.models.forwarding_rule_request import ForwardingRuleRequest

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

Expand All @@ -13,11 +13,11 @@
class ForwardingRulesRequest:
"""
Attributes:
forwarding_rules (List[ForwardingRule]): The rules that control which traffic the load balancer will forward to
servers in the pool.
forwarding_rules (List[ForwardingRuleRequest]): The rules that control which traffic the load balancer will
forward to servers in the pool.
"""

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

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

forwarding_rules.append(forwarding_rules_item)

Expand Down
39 changes: 15 additions & 24 deletions lib/binarylane/models/health_check.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from __future__ import annotations

from typing import Any, Dict, List, Type, TypeVar, Union
from typing import Any, Dict, List, Type, TypeVar

import attr

from binarylane.models.health_check_protocol import HealthCheckProtocol
from binarylane.types import UNSET, Unset

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

Expand All @@ -14,7 +13,7 @@
class HealthCheck:
"""
Attributes:
protocol (Union[Unset, None, HealthCheckProtocol]): Leave null to accept the default HTTP protocol.
protocol (HealthCheckProtocol): The protocol used for the health check.

| Value | Description |
| ----- | ----------- |
Expand All @@ -23,43 +22,35 @@ class HealthCheck:
| both | The health check will be performed via both HTTP and HTTPS. Failing a health check on one protocol will
remove the server from the pool of servers only for that protocol. |

path (Union[Unset, None, str]): Leave null to accept the default '/' path.
path (str): The path to the health check endpoint.
"""

protocol: Union[Unset, None, HealthCheckProtocol] = UNSET
path: Union[Unset, None, str] = UNSET
protocol: HealthCheckProtocol
path: str
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:
protocol: Union[Unset, None, str] = UNSET
if not isinstance(self.protocol, Unset):
protocol = self.protocol.value if self.protocol else None
protocol = self.protocol.value

path = self.path

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if protocol is not UNSET:
field_dict["protocol"] = protocol
if path is not UNSET:
field_dict["path"] = path
field_dict.update(
{
"protocol": protocol,
"path": path,
}
)

return field_dict

@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
_protocol = d.pop("protocol", UNSET)
protocol: Union[Unset, None, HealthCheckProtocol]
if _protocol is None:
protocol = None
elif isinstance(_protocol, Unset):
protocol = UNSET
else:
protocol = HealthCheckProtocol(_protocol)

path = d.pop("path", UNSET)
protocol = HealthCheckProtocol(d.pop("protocol"))

path = d.pop("path")

health_check = cls(
protocol=protocol,
Expand Down
86 changes: 86 additions & 0 deletions lib/binarylane/models/health_check_request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
from __future__ import annotations

from typing import Any, Dict, List, Type, TypeVar, Union

import attr

from binarylane.models.health_check_protocol import HealthCheckProtocol
from binarylane.types import UNSET, Unset

T = TypeVar("T", bound="HealthCheckRequest")


@attr.s(auto_attribs=True)
class HealthCheckRequest:
"""
Attributes:
protocol (Union[Unset, None, HealthCheckProtocol]): Leave null to accept the default HTTP protocol.

| Value | Description |
| ----- | ----------- |
| http | The health check will be performed via HTTP. |
| https | The health check will be performed via HTTPS. |
| both | The health check will be performed via both HTTP and HTTPS. Failing a health check on one protocol will
remove the server from the pool of servers only for that protocol. |

path (Union[Unset, None, str]): Leave null to accept the default '/' path.
"""

protocol: Union[Unset, None, HealthCheckProtocol] = UNSET
path: Union[Unset, None, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:
protocol: Union[Unset, None, str] = UNSET
if not isinstance(self.protocol, Unset):
protocol = self.protocol.value if self.protocol else None

path = self.path

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if protocol is not UNSET:
field_dict["protocol"] = protocol
if path is not UNSET:
field_dict["path"] = path

return field_dict

@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
_protocol = d.pop("protocol", UNSET)
protocol: Union[Unset, None, HealthCheckProtocol]
if _protocol is None:
protocol = None
elif isinstance(_protocol, Unset):
protocol = UNSET
else:
protocol = HealthCheckProtocol(_protocol)

path = d.pop("path", UNSET)

health_check_request = cls(
protocol=protocol,
path=path,
)

health_check_request.additional_properties = d
return health_check_request

@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())

def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]

def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value

def __delitem__(self, key: str) -> None:
del self.additional_properties[key]

def __contains__(self, key: str) -> bool:
return key in self.additional_properties
11 changes: 11 additions & 0 deletions lib/binarylane/models/licensed_software.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,31 @@ class LicensedSoftware:
Attributes:
software (Software): The currently licensed software.
licence_count (int): The current licence count for the software.
incompatible (bool): Software that is incompatible with the server will be automatically removed at the next
plan change.
Servers may have incompatible software due to changes made by support. Software is not incompatible merely
because it is disabled;
disabled software may be retained by servers that already have it, incompatible software will be removed.
"""

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

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

licence_count = self.licence_count
incompatible = self.incompatible

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
{
"software": software,
"licence_count": licence_count,
"incompatible": incompatible,
}
)

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

licence_count = d.pop("licence_count")

incompatible = d.pop("incompatible")

licensed_software = cls(
software=software,
licence_count=licence_count,
incompatible=incompatible,
)

licensed_software.additional_properties = d
Expand Down
3 changes: 2 additions & 1 deletion lib/binarylane/models/load_balancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class LoadBalancer:
id (int): The ID of the load balancer.
name (str): The hostname of the load balancer.
ip (str): The IPv4 address of the load balancer.
status (LoadBalancerStatus):
status (LoadBalancerStatus): The current status of the load balancer.

| Value | Description |
| ----- | ----------- |
| new | The load balancer is currently being built and is not ready to accept connections. |
Expand Down
Loading
Loading