Skip to content

Commit 134972c

Browse files
committed
feat: renamed ClientEntityBase to BaseResourceClient
1 parent eda666f commit 134972c

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

hcloud/core/__init__.py

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

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

66
__all__ = [
77
"BoundModelBase",
8+
"BaseResourceClient",
89
"ClientEntityBase",
910
"BaseDomain",
1011
"DomainIdentityMixin",

hcloud/core/client.py

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

3+
import warnings
34
from typing import TYPE_CHECKING, Any, Callable
45

56
if TYPE_CHECKING:
67
from .._client import Client
78

89

9-
class ClientEntityBase:
10+
class BaseResourceClient:
1011
_client: Client
1112

1213
max_per_page: int = 50
@@ -50,6 +51,24 @@ def _get_first_by(self, **kwargs): # type: ignore[no-untyped-def]
5051
return entities[0] if entities else None
5152

5253

54+
class ClientEntityBase(BaseResourceClient):
55+
"""
56+
Kept for backward compatibility.
57+
58+
.. deprecated:: 2.6.0
59+
Use :class:``hcloud.core.client.BaseResourceClient`` instead.
60+
"""
61+
62+
def __init__(self, client: Client):
63+
warnings.warn(
64+
"The 'hcloud.core.client.BaseResourceClient' class is deprecated, please use the "
65+
"'hcloud.core.client.BaseResourceClient' class instead.",
66+
DeprecationWarning,
67+
stacklevel=2,
68+
)
69+
super().__init__(client)
70+
71+
5372
class BoundModelBase:
5473
"""Bound Model Base"""
5574

0 commit comments

Comments
 (0)