Skip to content

Commit be9dfe0

Browse files
authored
feat(qaas): add tz for booking (#1321)
1 parent 14612be commit be9dfe0

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

scaleway-async/scaleway_async/qaas/v1alpha1/marshalling.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@ def unmarshal_Booking(data: Any) -> Booking:
179179
else:
180180
args["finished_at"] = None
181181

182+
field = data.get("time_zone", None)
183+
if field is not None:
184+
args["time_zone"] = field
185+
else:
186+
args["time_zone"] = None
187+
182188
return Booking(**args)
183189

184190

@@ -1205,6 +1211,9 @@ def marshal_CreateSessionRequestBookingDemand(
12051211
if request.description is not None:
12061212
output["description"] = request.description
12071213

1214+
if request.time_zone is not None:
1215+
output["time_zone"] = request.time_zone
1216+
12081217
return output
12091218

12101219

scaleway-async/scaleway_async/qaas/v1alpha1/types.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ class CreateSessionRequestBookingDemand:
323323
started_at: Optional[datetime] = None
324324
finished_at: Optional[datetime] = None
325325
description: Optional[str] = None
326+
time_zone: Optional[str] = None
326327

327328

328329
@dataclass
@@ -395,6 +396,11 @@ class Booking:
395396
Time at which the booking finishes.
396397
"""
397398

399+
time_zone: Optional[str] = None
400+
"""
401+
Time zone for the booking schedule, in tz database format (e.g. 'Europe/Paris').
402+
"""
403+
398404

399405
@dataclass
400406
class JobResult:

scaleway/scaleway/qaas/v1alpha1/marshalling.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@ def unmarshal_Booking(data: Any) -> Booking:
179179
else:
180180
args["finished_at"] = None
181181

182+
field = data.get("time_zone", None)
183+
if field is not None:
184+
args["time_zone"] = field
185+
else:
186+
args["time_zone"] = None
187+
182188
return Booking(**args)
183189

184190

@@ -1205,6 +1211,9 @@ def marshal_CreateSessionRequestBookingDemand(
12051211
if request.description is not None:
12061212
output["description"] = request.description
12071213

1214+
if request.time_zone is not None:
1215+
output["time_zone"] = request.time_zone
1216+
12081217
return output
12091218

12101219

scaleway/scaleway/qaas/v1alpha1/types.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ class CreateSessionRequestBookingDemand:
323323
started_at: Optional[datetime] = None
324324
finished_at: Optional[datetime] = None
325325
description: Optional[str] = None
326+
time_zone: Optional[str] = None
326327

327328

328329
@dataclass
@@ -395,6 +396,11 @@ class Booking:
395396
Time at which the booking finishes.
396397
"""
397398

399+
time_zone: Optional[str] = None
400+
"""
401+
Time zone for the booking schedule, in tz database format (e.g. 'Europe/Paris').
402+
"""
403+
398404

399405
@dataclass
400406
class JobResult:

0 commit comments

Comments
 (0)