Skip to content

Commit e475af7

Browse files
authored
feat: add category property to server type (#549)
Related to https://docs.hetzner.cloud/changelog#2025-08-25-category-for-server-types
1 parent 30b50d1 commit e475af7

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

hcloud/server_types/domain.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class ServerType(BaseDomain, DomainIdentityMixin):
1515
Unique identifier of the server type
1616
:param description: str
1717
Description of the server type
18+
:param category: str
19+
Category of the Server Type.
1820
:param cores: int
1921
Number of cpu cores a server of this type will have
2022
:param memory: int
@@ -42,6 +44,7 @@ class ServerType(BaseDomain, DomainIdentityMixin):
4244
"id",
4345
"name",
4446
"description",
47+
"category",
4548
"cores",
4649
"memory",
4750
"disk",
@@ -66,6 +69,7 @@ def __init__(
6669
id: int | None = None,
6770
name: str | None = None,
6871
description: str | None = None,
72+
category: str | None = None,
6973
cores: int | None = None,
7074
memory: int | None = None,
7175
disk: int | None = None,
@@ -80,6 +84,7 @@ def __init__(
8084
self.id = id
8185
self.name = name
8286
self.description = description
87+
self.category = category
8388
self.cores = cores
8489
self.memory = memory
8590
self.disk = disk

tests/unit/server_types/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def server_type_response():
1010
"id": 1,
1111
"name": "cx11",
1212
"description": "CX11",
13+
"category": "Shared vCPU",
1314
"cores": 1,
1415
"memory": 1,
1516
"disk": 25,

tests/unit/server_types/test_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def test_bound_server_type_init(self, server_type_response):
2222
assert bound_server_type.id == 1
2323
assert bound_server_type.name == "cx11"
2424
assert bound_server_type.description == "CX11"
25+
assert bound_server_type.category == "Shared vCPU"
2526
assert bound_server_type.cores == 1
2627
assert bound_server_type.memory == 1
2728
assert bound_server_type.disk == 25

0 commit comments

Comments
 (0)