Skip to content

Commit 38f409d

Browse files
authored
feat(instance): add start_date to server maintenance (#420)
1 parent ad2691e commit 38f409d

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,9 @@ def unmarshal_ServerMaintenance(data: Any) -> ServerMaintenance:
582582
field = data.get("reason", None)
583583
args["reason"] = field
584584

585+
field = data.get("start_date", None)
586+
args["start_date"] = parser.isoparse(field) if type(field) is str else field
587+
585588
return ServerMaintenance(**args)
586589

587590

@@ -2603,6 +2606,9 @@ def marshal_ServerMaintenance(
26032606
if request.reason is not None:
26042607
output["reason"] = request.reason
26052608

2609+
if request.start_date is not None:
2610+
output["start_date"] = request.start_date.astimezone().isoformat()
2611+
26062612
return output
26072613

26082614

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,8 @@ class ServerLocation:
13571357
class ServerMaintenance:
13581358
reason: str
13591359

1360+
start_date: Optional[datetime]
1361+
13601362

13611363
@dataclass
13621364
class ServerSummary:

scaleway/scaleway/instance/v1/marshalling.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,9 @@ def unmarshal_ServerMaintenance(data: Any) -> ServerMaintenance:
582582
field = data.get("reason", None)
583583
args["reason"] = field
584584

585+
field = data.get("start_date", None)
586+
args["start_date"] = parser.isoparse(field) if type(field) is str else field
587+
585588
return ServerMaintenance(**args)
586589

587590

@@ -2603,6 +2606,9 @@ def marshal_ServerMaintenance(
26032606
if request.reason is not None:
26042607
output["reason"] = request.reason
26052608

2609+
if request.start_date is not None:
2610+
output["start_date"] = request.start_date.astimezone().isoformat()
2611+
26062612
return output
26072613

26082614

scaleway/scaleway/instance/v1/types.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,13 +1310,13 @@ class ServerIp:
13101310
Tags associated with the IP.
13111311
"""
13121312

1313+
state: ServerIpState
1314+
13131315
ipam_id: str
13141316
"""
13151317
The ip_id of an IPAM ip if the ip is created from IPAM, null if not.
13161318
"""
13171319

1318-
state: ServerIpState
1319-
13201320

13211321
@dataclass
13221322
class ServerIpv6:
@@ -1357,6 +1357,8 @@ class ServerLocation:
13571357
class ServerMaintenance:
13581358
reason: str
13591359

1360+
start_date: Optional[datetime]
1361+
13601362

13611363
@dataclass
13621364
class ServerSummary:

0 commit comments

Comments
 (0)