From 0f8abbdb780b6d8d66361a1aaf274751b4daed8d Mon Sep 17 00:00:00 2001 From: jo Date: Wed, 20 Sep 2023 17:59:08 +0200 Subject: [PATCH] feat: add domain attribute type hints to bound models --- hcloud/actions/client.py | 2 +- hcloud/certificates/client.py | 2 +- hcloud/datacenters/client.py | 2 +- hcloud/firewalls/client.py | 2 +- hcloud/floating_ips/client.py | 2 +- hcloud/images/client.py | 2 +- hcloud/isos/client.py | 2 +- hcloud/load_balancer_types/client.py | 2 +- hcloud/load_balancers/client.py | 2 +- hcloud/locations/client.py | 2 +- hcloud/networks/client.py | 2 +- hcloud/placement_groups/client.py | 2 +- hcloud/primary_ips/client.py | 2 +- hcloud/server_types/client.py | 2 +- hcloud/servers/client.py | 2 +- hcloud/ssh_keys/client.py | 2 +- hcloud/volumes/client.py | 2 +- tests/unit/core/test_client.py | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/hcloud/actions/client.py b/hcloud/actions/client.py index 6ac87cb..a188f62 100644 --- a/hcloud/actions/client.py +++ b/hcloud/actions/client.py @@ -11,7 +11,7 @@ from .._client import Client -class BoundAction(BoundModelBase): +class BoundAction(BoundModelBase, Action): _client: ActionsClient model = Action diff --git a/hcloud/certificates/client.py b/hcloud/certificates/client.py index e368a95..a5fe1d7 100644 --- a/hcloud/certificates/client.py +++ b/hcloud/certificates/client.py @@ -15,7 +15,7 @@ from .._client import Client -class BoundCertificate(BoundModelBase): +class BoundCertificate(BoundModelBase, Certificate): _client: CertificatesClient model = Certificate diff --git a/hcloud/datacenters/client.py b/hcloud/datacenters/client.py index ab5aa5e..1be1e12 100644 --- a/hcloud/datacenters/client.py +++ b/hcloud/datacenters/client.py @@ -11,7 +11,7 @@ from .._client import Client -class BoundDatacenter(BoundModelBase): +class BoundDatacenter(BoundModelBase, Datacenter): _client: DatacentersClient model = Datacenter diff --git a/hcloud/firewalls/client.py b/hcloud/firewalls/client.py index b77c066..7444a26 100644 --- a/hcloud/firewalls/client.py +++ b/hcloud/firewalls/client.py @@ -16,7 +16,7 @@ from .._client import Client -class BoundFirewall(BoundModelBase): +class BoundFirewall(BoundModelBase, Firewall): _client: FirewallsClient model = Firewall diff --git a/hcloud/floating_ips/client.py b/hcloud/floating_ips/client.py index 31e5477..00600e4 100644 --- a/hcloud/floating_ips/client.py +++ b/hcloud/floating_ips/client.py @@ -13,7 +13,7 @@ from ..servers import BoundServer, Server -class BoundFloatingIP(BoundModelBase): +class BoundFloatingIP(BoundModelBase, FloatingIP): _client: FloatingIPsClient model = FloatingIP diff --git a/hcloud/images/client.py b/hcloud/images/client.py index 4d8cd10..65b7546 100644 --- a/hcloud/images/client.py +++ b/hcloud/images/client.py @@ -10,7 +10,7 @@ from .._client import Client -class BoundImage(BoundModelBase): +class BoundImage(BoundModelBase, Image): _client: ImagesClient model = Image diff --git a/hcloud/isos/client.py b/hcloud/isos/client.py index 1ab5fc9..cc46af7 100644 --- a/hcloud/isos/client.py +++ b/hcloud/isos/client.py @@ -10,7 +10,7 @@ from .._client import Client -class BoundIso(BoundModelBase): +class BoundIso(BoundModelBase, Iso): _client: IsosClient model = Iso diff --git a/hcloud/load_balancer_types/client.py b/hcloud/load_balancer_types/client.py index fa91c01..9a83dc7 100644 --- a/hcloud/load_balancer_types/client.py +++ b/hcloud/load_balancer_types/client.py @@ -9,7 +9,7 @@ from .._client import Client -class BoundLoadBalancerType(BoundModelBase): +class BoundLoadBalancerType(BoundModelBase, LoadBalancerType): _client: LoadBalancerTypesClient model = LoadBalancerType diff --git a/hcloud/load_balancers/client.py b/hcloud/load_balancers/client.py index 301240b..56b93c8 100644 --- a/hcloud/load_balancers/client.py +++ b/hcloud/load_balancers/client.py @@ -34,7 +34,7 @@ from ..networks import Network -class BoundLoadBalancer(BoundModelBase): +class BoundLoadBalancer(BoundModelBase, LoadBalancer): _client: LoadBalancersClient model = LoadBalancer diff --git a/hcloud/locations/client.py b/hcloud/locations/client.py index 2e2b6b4..047ad9d 100644 --- a/hcloud/locations/client.py +++ b/hcloud/locations/client.py @@ -9,7 +9,7 @@ from .._client import Client -class BoundLocation(BoundModelBase): +class BoundLocation(BoundModelBase, Location): _client: LocationsClient model = Location diff --git a/hcloud/networks/client.py b/hcloud/networks/client.py index f5894e7..d819d58 100644 --- a/hcloud/networks/client.py +++ b/hcloud/networks/client.py @@ -10,7 +10,7 @@ from .._client import Client -class BoundNetwork(BoundModelBase): +class BoundNetwork(BoundModelBase, Network): _client: NetworksClient model = Network diff --git a/hcloud/placement_groups/client.py b/hcloud/placement_groups/client.py index b551904..fcfd86a 100644 --- a/hcloud/placement_groups/client.py +++ b/hcloud/placement_groups/client.py @@ -10,7 +10,7 @@ from .._client import Client -class BoundPlacementGroup(BoundModelBase): +class BoundPlacementGroup(BoundModelBase, PlacementGroup): _client: PlacementGroupsClient model = PlacementGroup diff --git a/hcloud/primary_ips/client.py b/hcloud/primary_ips/client.py index a55dfc7..ece8d88 100644 --- a/hcloud/primary_ips/client.py +++ b/hcloud/primary_ips/client.py @@ -11,7 +11,7 @@ from ..datacenters import BoundDatacenter, Datacenter -class BoundPrimaryIP(BoundModelBase): +class BoundPrimaryIP(BoundModelBase, PrimaryIP): _client: PrimaryIPsClient model = PrimaryIP diff --git a/hcloud/server_types/client.py b/hcloud/server_types/client.py index 12cf34a..31f56a2 100644 --- a/hcloud/server_types/client.py +++ b/hcloud/server_types/client.py @@ -9,7 +9,7 @@ from .._client import Client -class BoundServerType(BoundModelBase): +class BoundServerType(BoundModelBase, ServerType): _client: ServerTypesClient model = ServerType diff --git a/hcloud/servers/client.py b/hcloud/servers/client.py index 433c537..5cbd48a 100644 --- a/hcloud/servers/client.py +++ b/hcloud/servers/client.py @@ -42,7 +42,7 @@ from .domain import ServerCreatePublicNetwork -class BoundServer(BoundModelBase): +class BoundServer(BoundModelBase, Server): _client: ServersClient model = Server diff --git a/hcloud/ssh_keys/client.py b/hcloud/ssh_keys/client.py index 1c16f03..69c1683 100644 --- a/hcloud/ssh_keys/client.py +++ b/hcloud/ssh_keys/client.py @@ -9,7 +9,7 @@ from .._client import Client -class BoundSSHKey(BoundModelBase): +class BoundSSHKey(BoundModelBase, SSHKey): _client: SSHKeysClient model = SSHKey diff --git a/hcloud/volumes/client.py b/hcloud/volumes/client.py index cb9e883..a470974 100644 --- a/hcloud/volumes/client.py +++ b/hcloud/volumes/client.py @@ -13,7 +13,7 @@ from ..servers import BoundServer, Server -class BoundVolume(BoundModelBase): +class BoundVolume(BoundModelBase, Volume): _client: VolumesClient model = Volume diff --git a/tests/unit/core/test_client.py b/tests/unit/core/test_client.py index b8e424f..584af8c 100644 --- a/tests/unit/core/test_client.py +++ b/tests/unit/core/test_client.py @@ -20,7 +20,7 @@ def __init__(self, id, name="", description=""): self.name = name self.description = description - class BoundModel(BoundModelBase): + class BoundModel(BoundModelBase, Model): model = Model return BoundModel