diff --git a/scaleway-async/scaleway_async/baremetal/v1/__init__.py b/scaleway-async/scaleway_async/baremetal/v1/__init__.py index c09858609..96db8523c 100644 --- a/scaleway-async/scaleway_async/baremetal/v1/__init__.py +++ b/scaleway-async/scaleway_async/baremetal/v1/__init__.py @@ -37,6 +37,7 @@ from .types import OSOSField from .types import CPU from .types import Disk +from .types import GPU from .types import Memory from .types import OfferOptionOffer from .types import PersistentMemory @@ -135,6 +136,7 @@ "OSOSField", "CPU", "Disk", + "GPU", "Memory", "OfferOptionOffer", "PersistentMemory", diff --git a/scaleway-async/scaleway_async/baremetal/v1/marshalling.py b/scaleway-async/scaleway_async/baremetal/v1/marshalling.py index 47e466f58..f04179dda 100644 --- a/scaleway-async/scaleway_async/baremetal/v1/marshalling.py +++ b/scaleway-async/scaleway_async/baremetal/v1/marshalling.py @@ -31,6 +31,7 @@ RemoteAccessOption, CPU, Disk, + GPU, Memory, OfferOptionOffer, PersistentMemory, @@ -495,6 +496,25 @@ def unmarshal_Disk(data: Any) -> Disk: return Disk(**args) +def unmarshal_GPU(data: Any) -> GPU: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'GPU' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("name", None) + if field is not None: + args["name"] = field + + field = data.get("vram", None) + if field is not None: + args["vram"] = field + + return GPU(**args) + + def unmarshal_Memory(data: Any) -> Memory: if not isinstance(data, dict): raise TypeError( @@ -679,6 +699,16 @@ def unmarshal_Offer(data: Any) -> Offer: if field is not None: args["enable"] = field + field = data.get("cpus", None) + if field is not None: + args["cpus"] = [unmarshal_CPU(v) for v in field] if field is not None else None + + field = data.get("memories", None) + if field is not None: + args["memories"] = ( + [unmarshal_Memory(v) for v in field] if field is not None else None + ) + field = data.get("price_per_hour", None) if field is not None: args["price_per_hour"] = unmarshal_Money(field) @@ -691,16 +721,6 @@ def unmarshal_Offer(data: Any) -> Offer: else: args["price_per_month"] = None - field = data.get("cpus", None) - if field is not None: - args["cpus"] = [unmarshal_CPU(v) for v in field] if field is not None else None - - field = data.get("memories", None) - if field is not None: - args["memories"] = ( - [unmarshal_Memory(v) for v in field] if field is not None else None - ) - field = data.get("quota_name", None) if field is not None: args["quota_name"] = field @@ -751,6 +771,10 @@ def unmarshal_Offer(data: Any) -> Offer: if field is not None: args["tags"] = field + field = data.get("gpus", None) + if field is not None: + args["gpus"] = [unmarshal_GPU(v) for v in field] if field is not None else None + field = data.get("fee", None) if field is not None: args["fee"] = unmarshal_Money(field) diff --git a/scaleway-async/scaleway_async/baremetal/v1/types.py b/scaleway-async/scaleway_async/baremetal/v1/types.py index 88825e996..9219d12eb 100644 --- a/scaleway-async/scaleway_async/baremetal/v1/types.py +++ b/scaleway-async/scaleway_async/baremetal/v1/types.py @@ -354,6 +354,19 @@ class Disk: """ +@dataclass +class GPU: + name: str + """ + Name of the GPU. + """ + + vram: int + """ + Capacity of the vram in bytes. + """ + + @dataclass class Memory: capacity: int @@ -731,24 +744,24 @@ class Offer: Defines whether the offer is currently available. """ - price_per_hour: Optional[Money] + cpus: List[CPU] """ - Price of the offer for the next 60 minutes (a server order at 11h32 will be payed until 12h32). + CPU specifications of the offer. """ - price_per_month: Optional[Money] + memories: List[Memory] """ - Monthly price of the offer, if subscribing on a monthly basis. + Memory specifications of the offer. """ - cpus: List[CPU] + price_per_hour: Optional[Money] """ - CPU specifications of the offer. + Price of the offer for the next 60 minutes (a server order at 11h32 will be payed until 12h32). """ - memories: List[Memory] + price_per_month: Optional[Money] """ - Memory specifications of the offer. + Monthly price of the offer, if subscribing on a monthly basis. """ quota_name: str @@ -801,6 +814,11 @@ class Offer: Array of tags attached to the offer. """ + gpus: List[GPU] + """ + GPU specifications of the offer. + """ + fee: Optional[Money] """ One time fee invoiced by Scaleway for the setup and activation of the server. diff --git a/scaleway/scaleway/baremetal/v1/__init__.py b/scaleway/scaleway/baremetal/v1/__init__.py index c09858609..96db8523c 100644 --- a/scaleway/scaleway/baremetal/v1/__init__.py +++ b/scaleway/scaleway/baremetal/v1/__init__.py @@ -37,6 +37,7 @@ from .types import OSOSField from .types import CPU from .types import Disk +from .types import GPU from .types import Memory from .types import OfferOptionOffer from .types import PersistentMemory @@ -135,6 +136,7 @@ "OSOSField", "CPU", "Disk", + "GPU", "Memory", "OfferOptionOffer", "PersistentMemory", diff --git a/scaleway/scaleway/baremetal/v1/marshalling.py b/scaleway/scaleway/baremetal/v1/marshalling.py index 47e466f58..f04179dda 100644 --- a/scaleway/scaleway/baremetal/v1/marshalling.py +++ b/scaleway/scaleway/baremetal/v1/marshalling.py @@ -31,6 +31,7 @@ RemoteAccessOption, CPU, Disk, + GPU, Memory, OfferOptionOffer, PersistentMemory, @@ -495,6 +496,25 @@ def unmarshal_Disk(data: Any) -> Disk: return Disk(**args) +def unmarshal_GPU(data: Any) -> GPU: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'GPU' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("name", None) + if field is not None: + args["name"] = field + + field = data.get("vram", None) + if field is not None: + args["vram"] = field + + return GPU(**args) + + def unmarshal_Memory(data: Any) -> Memory: if not isinstance(data, dict): raise TypeError( @@ -679,6 +699,16 @@ def unmarshal_Offer(data: Any) -> Offer: if field is not None: args["enable"] = field + field = data.get("cpus", None) + if field is not None: + args["cpus"] = [unmarshal_CPU(v) for v in field] if field is not None else None + + field = data.get("memories", None) + if field is not None: + args["memories"] = ( + [unmarshal_Memory(v) for v in field] if field is not None else None + ) + field = data.get("price_per_hour", None) if field is not None: args["price_per_hour"] = unmarshal_Money(field) @@ -691,16 +721,6 @@ def unmarshal_Offer(data: Any) -> Offer: else: args["price_per_month"] = None - field = data.get("cpus", None) - if field is not None: - args["cpus"] = [unmarshal_CPU(v) for v in field] if field is not None else None - - field = data.get("memories", None) - if field is not None: - args["memories"] = ( - [unmarshal_Memory(v) for v in field] if field is not None else None - ) - field = data.get("quota_name", None) if field is not None: args["quota_name"] = field @@ -751,6 +771,10 @@ def unmarshal_Offer(data: Any) -> Offer: if field is not None: args["tags"] = field + field = data.get("gpus", None) + if field is not None: + args["gpus"] = [unmarshal_GPU(v) for v in field] if field is not None else None + field = data.get("fee", None) if field is not None: args["fee"] = unmarshal_Money(field) diff --git a/scaleway/scaleway/baremetal/v1/types.py b/scaleway/scaleway/baremetal/v1/types.py index 88825e996..9219d12eb 100644 --- a/scaleway/scaleway/baremetal/v1/types.py +++ b/scaleway/scaleway/baremetal/v1/types.py @@ -354,6 +354,19 @@ class Disk: """ +@dataclass +class GPU: + name: str + """ + Name of the GPU. + """ + + vram: int + """ + Capacity of the vram in bytes. + """ + + @dataclass class Memory: capacity: int @@ -731,24 +744,24 @@ class Offer: Defines whether the offer is currently available. """ - price_per_hour: Optional[Money] + cpus: List[CPU] """ - Price of the offer for the next 60 minutes (a server order at 11h32 will be payed until 12h32). + CPU specifications of the offer. """ - price_per_month: Optional[Money] + memories: List[Memory] """ - Monthly price of the offer, if subscribing on a monthly basis. + Memory specifications of the offer. """ - cpus: List[CPU] + price_per_hour: Optional[Money] """ - CPU specifications of the offer. + Price of the offer for the next 60 minutes (a server order at 11h32 will be payed until 12h32). """ - memories: List[Memory] + price_per_month: Optional[Money] """ - Memory specifications of the offer. + Monthly price of the offer, if subscribing on a monthly basis. """ quota_name: str @@ -801,6 +814,11 @@ class Offer: Array of tags attached to the offer. """ + gpus: List[GPU] + """ + GPU specifications of the offer. + """ + fee: Optional[Money] """ One time fee invoiced by Scaleway for the setup and activation of the server.