Skip to content

Commit 2548733

Browse files
authored
feat(rdb): add generation property to NodeType (#53)
1 parent 440dbf6 commit 2548733

File tree

6 files changed

+38
-0
lines changed

6 files changed

+38
-0
lines changed

scaleway-async/scaleway_async/rdb/v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from .types import ListSnapshotsRequestOrderBy
1616
from .types import ListUsersRequestOrderBy
1717
from .types import MaintenanceStatus
18+
from .types import NodeTypeGeneration
1819
from .types import NodeTypeStock
1920
from .types import Permission
2021
from .types import ReadReplicaStatus
@@ -96,6 +97,7 @@
9697
"ListSnapshotsRequestOrderBy",
9798
"ListUsersRequestOrderBy",
9899
"MaintenanceStatus",
100+
"NodeTypeGeneration",
99101
"NodeTypeStock",
100102
"Permission",
101103
"ReadReplicaStatus",

scaleway-async/scaleway_async/rdb/v1/marshalling.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,9 @@ def unmarshal_NodeType(data: Any) -> NodeType:
730730
field = data.get("disabled")
731731
args["disabled"] = field
732732

733+
field = data.get("generation")
734+
args["generation"] = field
735+
733736
field = data.get("is_bssd_compatible")
734737
args["is_bssd_compatible"] = field
735738

scaleway-async/scaleway_async/rdb/v1/types.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,15 @@ def __str__(self) -> str:
177177
return str(self.value)
178178

179179

180+
class NodeTypeGeneration(str, Enum):
181+
UNKNOWN_GENERATION = "unknown_generation"
182+
GENERATION_V1 = "generation_v1"
183+
GENERATION_V2 = "generation_v2"
184+
185+
def __str__(self) -> str:
186+
return str(self.value)
187+
188+
180189
class NodeTypeStock(str, Enum):
181190
UNKNOWN = "unknown"
182191
LOW_STOCK = "low_stock"
@@ -1158,6 +1167,11 @@ class NodeType:
11581167
The Node Type can be used only with high availability option
11591168
"""
11601169

1170+
generation: NodeTypeGeneration
1171+
"""
1172+
Generation associated the NodeType offer
1173+
"""
1174+
11611175
region: Region
11621176
"""
11631177
Region the Node Type is in

scaleway/scaleway/rdb/v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from .types import ListSnapshotsRequestOrderBy
1616
from .types import ListUsersRequestOrderBy
1717
from .types import MaintenanceStatus
18+
from .types import NodeTypeGeneration
1819
from .types import NodeTypeStock
1920
from .types import Permission
2021
from .types import ReadReplicaStatus
@@ -96,6 +97,7 @@
9697
"ListSnapshotsRequestOrderBy",
9798
"ListUsersRequestOrderBy",
9899
"MaintenanceStatus",
100+
"NodeTypeGeneration",
99101
"NodeTypeStock",
100102
"Permission",
101103
"ReadReplicaStatus",

scaleway/scaleway/rdb/v1/marshalling.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,9 @@ def unmarshal_NodeType(data: Any) -> NodeType:
730730
field = data.get("disabled")
731731
args["disabled"] = field
732732

733+
field = data.get("generation")
734+
args["generation"] = field
735+
733736
field = data.get("is_bssd_compatible")
734737
args["is_bssd_compatible"] = field
735738

scaleway/scaleway/rdb/v1/types.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,15 @@ def __str__(self) -> str:
177177
return str(self.value)
178178

179179

180+
class NodeTypeGeneration(str, Enum):
181+
UNKNOWN_GENERATION = "unknown_generation"
182+
GENERATION_V1 = "generation_v1"
183+
GENERATION_V2 = "generation_v2"
184+
185+
def __str__(self) -> str:
186+
return str(self.value)
187+
188+
180189
class NodeTypeStock(str, Enum):
181190
UNKNOWN = "unknown"
182191
LOW_STOCK = "low_stock"
@@ -1158,6 +1167,11 @@ class NodeType:
11581167
The Node Type can be used only with high availability option
11591168
"""
11601169

1170+
generation: NodeTypeGeneration
1171+
"""
1172+
Generation associated the NodeType offer
1173+
"""
1174+
11611175
region: Region
11621176
"""
11631177
Region the Node Type is in

0 commit comments

Comments
 (0)