Skip to content

Commit 69f2911

Browse files
committed
fix: rename BoundModelBase to BaseBoundModel
1 parent 2367a11 commit 69f2911

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
lines changed

hcloud/core/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
from __future__ import annotations
22

3-
from .client import BaseResourceClient, BoundModelBase, ClientEntityBase
3+
from .client import BaseBoundModel, BaseResourceClient, BoundModelBase, ClientEntityBase
44
from .domain import BaseDomain, DomainIdentityMixin, Meta, Pagination
55

66
__all__ = [
7-
"BoundModelBase",
7+
"BaseBoundModel",
88
"BaseResourceClient",
99
"ClientEntityBase",
10+
"BoundModelBase",
1011
"BaseDomain",
1112
"DomainIdentityMixin",
1213
"Meta",

hcloud/core/client.py

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
if TYPE_CHECKING:
77
from .._client import Client
8+
from .domain import BaseDomain
89

910

1011
class BaseResourceClient:
@@ -69,10 +70,10 @@ def __init__(self, client: Client):
6970
super().__init__(client)
7071

7172

72-
class BoundModelBase:
73-
"""Bound Model Base"""
73+
class BaseBoundModel:
74+
"""Base Bound Model"""
7475

75-
model: Any
76+
model: type[BaseDomain]
7677

7778
def __init__(
7879
self,
@@ -121,3 +122,26 @@ def __eq__(self, other: Any) -> bool:
121122
if not isinstance(other, self.__class__):
122123
return NotImplemented
123124
return self.data_model == other.data_model
125+
126+
127+
class BoundModelBase(BaseBoundModel):
128+
"""
129+
Kept for backward compatibility.
130+
131+
.. deprecated:: 2.6.0
132+
Use :class:``hcloud.core.client.BaseBoundModel`` instead.
133+
"""
134+
135+
def __init__(
136+
self,
137+
client: BaseResourceClient,
138+
data: dict,
139+
complete: bool = True,
140+
):
141+
warnings.warn(
142+
"The 'hcloud.core.client.BoundModelBase' class is deprecated, please use the "
143+
"'hcloud.core.client.BaseBoundModel' class instead.",
144+
DeprecationWarning,
145+
stacklevel=2,
146+
)
147+
super().__init__(client, data, complete)

0 commit comments

Comments
 (0)