11from __future__ import annotations
22
3- import warnings
43from typing import TYPE_CHECKING , Literal , TypedDict
54
65from ..core import BaseDomain , DomainIdentityMixin
76
87if TYPE_CHECKING :
98 from ..actions import BoundAction
10- from ..datacenters import BoundDatacenter
119 from ..firewalls import BoundFirewall
1210 from ..floating_ips import BoundFloatingIP
1311 from ..images import BoundImage
@@ -56,12 +54,6 @@ class Server(BaseDomain, DomainIdentityMixin):
5654 :param public_net: :class:`PublicNetwork <hcloud.servers.domain.PublicNetwork>`
5755 Public network information.
5856 :param server_type: :class:`BoundServerType <hcloud.server_types.client.BoundServerType>`
59- :param datacenter: :class:`BoundDatacenter <hcloud.datacenters.client.BoundDatacenter>`
60-
61- This property is deprecated and will be removed after 1 July 2026.
62- Please use the ``location`` property instead.
63-
64- See https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters.
6557 :param location: :class:`BoundLocation <hcloud.locations.client.BoundLocation>`
6658 :param image: :class:`BoundImage <hcloud.images.client.BoundImage>`, None
6759 :param iso: :class:`BoundIso <hcloud.isos.client.BoundIso>`, None
@@ -108,7 +100,7 @@ class Server(BaseDomain, DomainIdentityMixin):
108100 STATUS_UNKNOWN = "unknown"
109101 """Server Status unknown"""
110102
111- __properties__ = (
103+ __api_properties__ = (
112104 "id" ,
113105 "name" ,
114106 "status" ,
@@ -131,14 +123,7 @@ class Server(BaseDomain, DomainIdentityMixin):
131123 "primary_disk_size" ,
132124 "placement_group" ,
133125 )
134- __api_properties__ = (
135- * __properties__ ,
136- "datacenter" ,
137- )
138- __slots__ = (
139- * __properties__ ,
140- "_datacenter" ,
141- )
126+ __slots__ = __api_properties__
142127
143128 # pylint: disable=too-many-locals
144129 def __init__ (
@@ -149,7 +134,6 @@ def __init__(
149134 created : str | None = None ,
150135 public_net : PublicNetwork | None = None ,
151136 server_type : BoundServerType | None = None ,
152- datacenter : BoundDatacenter | None = None ,
153137 location : BoundLocation | None = None ,
154138 image : BoundImage | None = None ,
155139 iso : BoundIso | None = None ,
@@ -172,7 +156,6 @@ def __init__(
172156 self .created = self ._parse_datetime (created )
173157 self .public_net = public_net
174158 self .server_type = server_type
175- self .datacenter = datacenter
176159 self .location = location
177160 self .image = image
178161 self .iso = iso
@@ -199,24 +182,6 @@ def private_net_for(self, network: BoundNetwork | Network) -> PrivateNet | None:
199182 return o
200183 return None
201184
202- @property
203- def datacenter (self ) -> BoundDatacenter | None :
204- """
205- :meta private:
206- """
207- warnings .warn (
208- "The 'datacenter' property is deprecated and will be removed after 1 July 2026. "
209- "Please use the 'location' property instead. "
210- "See https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters." ,
211- DeprecationWarning ,
212- stacklevel = 2 ,
213- )
214- return self ._datacenter
215-
216- @datacenter .setter
217- def datacenter (self , value : BoundDatacenter | None ) -> None :
218- self ._datacenter = value
219-
220185
221186class ServerProtection (TypedDict ):
222187 rebuild : bool
0 commit comments