Skip to content

Commit 0b0b9a2

Browse files
authored
feat(qaas): add booking req param (#1256)
1 parent c8bfa99 commit 0b0b9a2

File tree

4 files changed

+66
-0
lines changed

4 files changed

+66
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,18 @@ def unmarshal_PlatformBookingRequirement(data: Any) -> PlatformBookingRequiremen
314314

315315
args: dict[str, Any] = {}
316316

317+
field = data.get("max_booking_per_week", None)
318+
if field is not None:
319+
args["max_booking_per_week"] = field
320+
else:
321+
args["max_booking_per_week"] = 0
322+
323+
field = data.get("max_booking_per_day", None)
324+
if field is not None:
325+
args["max_booking_per_day"] = field
326+
else:
327+
args["max_booking_per_day"] = 0
328+
317329
field = data.get("min_duration", None)
318330
if field is not None:
319331
args["min_duration"] = field
@@ -338,6 +350,12 @@ def unmarshal_PlatformBookingRequirement(data: Any) -> PlatformBookingRequiremen
338350
else:
339351
args["max_planification_duration"] = None
340352

353+
field = data.get("min_planification_duration", None)
354+
if field is not None:
355+
args["min_planification_duration"] = field
356+
else:
357+
args["min_planification_duration"] = None
358+
341359
return PlatformBookingRequirement(**args)
342360

343361

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,16 @@ def __str__(self) -> str:
242242

243243
@dataclass
244244
class PlatformBookingRequirement:
245+
max_booking_per_week: int
246+
"""
247+
Maximum amount of booking allowed for one organization per week.
248+
"""
249+
250+
max_booking_per_day: int
251+
"""
252+
Maximum amount of booking allowed for one organization per day.
253+
"""
254+
245255
min_duration: Optional[str] = None
246256
"""
247257
Minimal duration of any booking based on this platform.
@@ -262,6 +272,11 @@ class PlatformBookingRequirement:
262272
Allowed planification time from now where the platform can be booked in the future.
263273
"""
264274

275+
min_planification_duration: Optional[str] = None
276+
"""
277+
Minimum planification time before a platform can be booked.
278+
"""
279+
265280

266281
@dataclass
267282
class PlatformHardware:

scaleway/scaleway/qaas/v1alpha1/marshalling.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,18 @@ def unmarshal_PlatformBookingRequirement(data: Any) -> PlatformBookingRequiremen
314314

315315
args: dict[str, Any] = {}
316316

317+
field = data.get("max_booking_per_week", None)
318+
if field is not None:
319+
args["max_booking_per_week"] = field
320+
else:
321+
args["max_booking_per_week"] = 0
322+
323+
field = data.get("max_booking_per_day", None)
324+
if field is not None:
325+
args["max_booking_per_day"] = field
326+
else:
327+
args["max_booking_per_day"] = 0
328+
317329
field = data.get("min_duration", None)
318330
if field is not None:
319331
args["min_duration"] = field
@@ -338,6 +350,12 @@ def unmarshal_PlatformBookingRequirement(data: Any) -> PlatformBookingRequiremen
338350
else:
339351
args["max_planification_duration"] = None
340352

353+
field = data.get("min_planification_duration", None)
354+
if field is not None:
355+
args["min_planification_duration"] = field
356+
else:
357+
args["min_planification_duration"] = None
358+
341359
return PlatformBookingRequirement(**args)
342360

343361

scaleway/scaleway/qaas/v1alpha1/types.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,16 @@ def __str__(self) -> str:
242242

243243
@dataclass
244244
class PlatformBookingRequirement:
245+
max_booking_per_week: int
246+
"""
247+
Maximum amount of booking allowed for one organization per week.
248+
"""
249+
250+
max_booking_per_day: int
251+
"""
252+
Maximum amount of booking allowed for one organization per day.
253+
"""
254+
245255
min_duration: Optional[str] = None
246256
"""
247257
Minimal duration of any booking based on this platform.
@@ -262,6 +272,11 @@ class PlatformBookingRequirement:
262272
Allowed planification time from now where the platform can be booked in the future.
263273
"""
264274

275+
min_planification_duration: Optional[str] = None
276+
"""
277+
Minimum planification time before a platform can be booked.
278+
"""
279+
265280

266281
@dataclass
267282
class PlatformHardware:

0 commit comments

Comments
 (0)