44
55from ..core import BaseDomain , DomainIdentityMixin
66from ..deprecation import DeprecationInfo
7+ from ..locations import BoundLocation
78
89
910class ServerType (BaseDomain , DomainIdentityMixin ):
@@ -38,6 +39,7 @@ class ServerType(BaseDomain, DomainIdentityMixin):
3839 deprecated. If it has a value, it is considered deprecated.
3940 :param included_traffic: int
4041 Free traffic per month in bytes
42+ :param locations: Supported Location of the Server Type.
4143 """
4244
4345 __properties__ = (
@@ -52,18 +54,22 @@ class ServerType(BaseDomain, DomainIdentityMixin):
5254 "storage_type" ,
5355 "cpu_type" ,
5456 "architecture" ,
55- "deprecated" ,
56- "deprecation" ,
57+ "locations" ,
5758 )
5859 __api_properties__ = (
5960 * __properties__ ,
61+ "deprecated" ,
62+ "deprecation" ,
6063 "included_traffic" ,
6164 )
6265 __slots__ = (
6366 * __properties__ ,
67+ "_deprecated" ,
68+ "_deprecation" ,
6469 "_included_traffic" ,
6570 )
6671
72+ # pylint: disable=too-many-locals
6773 def __init__ (
6874 self ,
6975 id : int | None = None ,
@@ -80,6 +86,7 @@ def __init__(
8086 deprecated : bool | None = None ,
8187 deprecation : dict | None = None ,
8288 included_traffic : int | None = None ,
89+ locations : list [ServerTypeLocation ] | None = None ,
8390 ):
8491 self .id = id
8592 self .name = name
@@ -92,12 +99,58 @@ def __init__(
9299 self .storage_type = storage_type
93100 self .cpu_type = cpu_type
94101 self .architecture = architecture
102+ self .locations = locations
103+
95104 self .deprecated = deprecated
96105 self .deprecation = (
97106 DeprecationInfo .from_dict (deprecation ) if deprecation is not None else None
98107 )
99108 self .included_traffic = included_traffic
100109
110+ @property
111+ def deprecated (self ) -> bool | None :
112+ """
113+ .. deprecated:: 2.6.0
114+ The 'deprecated' property is deprecated and will gradually be phased starting 24 September 2025.
115+ Please refer to the '.locations[].deprecation' property instead.
116+
117+ See https://docs.hetzner.cloud/changelog#2025-09-24-per-location-server-types.
118+ """
119+ warnings .warn (
120+ "The 'deprecated' property is deprecated and will gradually be phased starting 24 September 2025. "
121+ "Please refer to the '.locations[].deprecation' property instead. "
122+ "See https://docs.hetzner.cloud/changelog#2025-09-24-per-location-server-types" ,
123+ DeprecationWarning ,
124+ stacklevel = 2 ,
125+ )
126+ return self ._deprecated
127+
128+ @deprecated .setter
129+ def deprecated (self , value : bool | None ) -> None :
130+ self ._deprecated = value
131+
132+ @property
133+ def deprecation (self ) -> DeprecationInfo | None :
134+ """
135+ .. deprecated:: 2.6.0
136+ The 'deprecation' property is deprecated and will gradually be phased starting 24 September 2025.
137+ Please refer to the '.locations[].deprecation' property instead.
138+
139+ See https://docs.hetzner.cloud/changelog#2025-09-24-per-location-server-types.
140+ """
141+ warnings .warn (
142+ "The 'deprecation' property is deprecated and will gradually be phased starting 24 September 2025. "
143+ "Please refer to the '.locations[].deprecation' property instead. "
144+ "See https://docs.hetzner.cloud/changelog#2025-09-24-per-location-server-types" ,
145+ DeprecationWarning ,
146+ stacklevel = 2 ,
147+ )
148+ return self ._deprecation
149+
150+ @deprecation .setter
151+ def deprecation (self , value : DeprecationInfo | None ) -> None :
152+ self ._deprecation = value
153+
101154 @property
102155 def included_traffic (self ) -> int | None :
103156 """
@@ -119,3 +172,28 @@ def included_traffic(self) -> int | None:
119172 @included_traffic .setter
120173 def included_traffic (self , value : int | None ) -> None :
121174 self ._included_traffic = value
175+
176+
177+ class ServerTypeLocation (BaseDomain ):
178+ """Server Type Location Domain
179+
180+ :param location: Location of the Server Type.
181+ :param deprecation: Wether the Server Type is deprecated in this Location.
182+ """
183+
184+ __api_properties__ = (
185+ "location" ,
186+ "deprecation" ,
187+ )
188+ __slots__ = __api_properties__
189+
190+ def __init__ (
191+ self ,
192+ * ,
193+ location : BoundLocation ,
194+ deprecation : dict | None ,
195+ ):
196+ self .location = location
197+ self .deprecation = (
198+ DeprecationInfo .from_dict (deprecation ) if deprecation is not None else None
199+ )
0 commit comments