Skip to content

Commit a8b6ea0

Browse files
authored
feat(product_catalog): add managed inference to public catalog api (#1387)
1 parent 1ca3372 commit a8b6ea0

File tree

6 files changed

+82
-0
lines changed

6 files changed

+82
-0
lines changed

scaleway-async/scaleway_async/product_catalog/v2alpha1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from .types import PublicCatalogProductPropertiesElasticMetal
1919
from .types import PublicCatalogProductPropertiesHardware
2020
from .types import PublicCatalogProductPropertiesInstance
21+
from .types import PublicCatalogProductPropertiesManagedInference
2122
from .types import PublicCatalogProductPropertiesObjectStorage
2223
from .types import PublicCatalogProductEnvironmentalImpactEstimation
2324
from .types import PublicCatalogProductLocality
@@ -48,6 +49,7 @@
4849
"PublicCatalogProductPropertiesElasticMetal",
4950
"PublicCatalogProductPropertiesHardware",
5051
"PublicCatalogProductPropertiesInstance",
52+
"PublicCatalogProductPropertiesManagedInference",
5153
"PublicCatalogProductPropertiesObjectStorage",
5254
"PublicCatalogProductEnvironmentalImpactEstimation",
5355
"PublicCatalogProductLocality",

scaleway-async/scaleway_async/product_catalog/v2alpha1/marshalling.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
PublicCatalogProductPropertiesElasticMetal,
2424
PublicCatalogProductPropertiesHardware,
2525
PublicCatalogProductPropertiesInstance,
26+
PublicCatalogProductPropertiesManagedInference,
2627
PublicCatalogProductPropertiesObjectStorage,
2728
PublicCatalogProductEnvironmentalImpactEstimation,
2829
PublicCatalogProductLocality,
@@ -447,6 +448,25 @@ def unmarshal_PublicCatalogProductPropertiesInstance(
447448
return PublicCatalogProductPropertiesInstance(**args)
448449

449450

451+
def unmarshal_PublicCatalogProductPropertiesManagedInference(
452+
data: Any,
453+
) -> PublicCatalogProductPropertiesManagedInference:
454+
if not isinstance(data, dict):
455+
raise TypeError(
456+
"Unmarshalling the type 'PublicCatalogProductPropertiesManagedInference' failed as data isn't a dictionary."
457+
)
458+
459+
args: dict[str, Any] = {}
460+
461+
field = data.get("instance_gpu_name", None)
462+
if field is not None:
463+
args["instance_gpu_name"] = field
464+
else:
465+
args["instance_gpu_name"] = None
466+
467+
return PublicCatalogProductPropertiesManagedInference(**args)
468+
469+
450470
def unmarshal_PublicCatalogProductPropertiesObjectStorage(
451471
data: Any,
452472
) -> PublicCatalogProductPropertiesObjectStorage:
@@ -597,6 +617,14 @@ def unmarshal_PublicCatalogProductProperties(
597617
else:
598618
args["object_storage"] = None
599619

620+
field = data.get("managed_inference", None)
621+
if field is not None:
622+
args["managed_inference"] = (
623+
unmarshal_PublicCatalogProductPropertiesManagedInference(field)
624+
)
625+
else:
626+
args["managed_inference"] = None
627+
600628
return PublicCatalogProductProperties(**args)
601629

602630

scaleway-async/scaleway_async/product_catalog/v2alpha1/types.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class ListPublicCatalogProductsRequestProductType(str, Enum, metaclass=StrEnumMe
2525
DEDIBOX = "dedibox"
2626
BLOCK_STORAGE = "block_storage"
2727
OBJECT_STORAGE = "object_storage"
28+
MANAGED_INFERENCE = "managed_inference"
2829

2930
def __str__(self) -> str:
3031
return str(self.value)
@@ -340,6 +341,14 @@ class PublicCatalogProductPropertiesInstance:
340341
"""
341342

342343

344+
@dataclass
345+
class PublicCatalogProductPropertiesManagedInference:
346+
instance_gpu_name: str
347+
"""
348+
The name of the associated instance GPU to this node type.
349+
"""
350+
351+
343352
@dataclass
344353
class PublicCatalogProductPropertiesObjectStorage:
345354
pass
@@ -389,6 +398,8 @@ class PublicCatalogProductProperties:
389398

390399
object_storage: Optional[PublicCatalogProductPropertiesObjectStorage] = None
391400

401+
managed_inference: Optional[PublicCatalogProductPropertiesManagedInference] = None
402+
392403

393404
@dataclass
394405
class PublicCatalogProductUnitOfMeasure:

scaleway/scaleway/product_catalog/v2alpha1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from .types import PublicCatalogProductPropertiesElasticMetal
1919
from .types import PublicCatalogProductPropertiesHardware
2020
from .types import PublicCatalogProductPropertiesInstance
21+
from .types import PublicCatalogProductPropertiesManagedInference
2122
from .types import PublicCatalogProductPropertiesObjectStorage
2223
from .types import PublicCatalogProductEnvironmentalImpactEstimation
2324
from .types import PublicCatalogProductLocality
@@ -48,6 +49,7 @@
4849
"PublicCatalogProductPropertiesElasticMetal",
4950
"PublicCatalogProductPropertiesHardware",
5051
"PublicCatalogProductPropertiesInstance",
52+
"PublicCatalogProductPropertiesManagedInference",
5153
"PublicCatalogProductPropertiesObjectStorage",
5254
"PublicCatalogProductEnvironmentalImpactEstimation",
5355
"PublicCatalogProductLocality",

scaleway/scaleway/product_catalog/v2alpha1/marshalling.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
PublicCatalogProductPropertiesElasticMetal,
2424
PublicCatalogProductPropertiesHardware,
2525
PublicCatalogProductPropertiesInstance,
26+
PublicCatalogProductPropertiesManagedInference,
2627
PublicCatalogProductPropertiesObjectStorage,
2728
PublicCatalogProductEnvironmentalImpactEstimation,
2829
PublicCatalogProductLocality,
@@ -447,6 +448,25 @@ def unmarshal_PublicCatalogProductPropertiesInstance(
447448
return PublicCatalogProductPropertiesInstance(**args)
448449

449450

451+
def unmarshal_PublicCatalogProductPropertiesManagedInference(
452+
data: Any,
453+
) -> PublicCatalogProductPropertiesManagedInference:
454+
if not isinstance(data, dict):
455+
raise TypeError(
456+
"Unmarshalling the type 'PublicCatalogProductPropertiesManagedInference' failed as data isn't a dictionary."
457+
)
458+
459+
args: dict[str, Any] = {}
460+
461+
field = data.get("instance_gpu_name", None)
462+
if field is not None:
463+
args["instance_gpu_name"] = field
464+
else:
465+
args["instance_gpu_name"] = None
466+
467+
return PublicCatalogProductPropertiesManagedInference(**args)
468+
469+
450470
def unmarshal_PublicCatalogProductPropertiesObjectStorage(
451471
data: Any,
452472
) -> PublicCatalogProductPropertiesObjectStorage:
@@ -597,6 +617,14 @@ def unmarshal_PublicCatalogProductProperties(
597617
else:
598618
args["object_storage"] = None
599619

620+
field = data.get("managed_inference", None)
621+
if field is not None:
622+
args["managed_inference"] = (
623+
unmarshal_PublicCatalogProductPropertiesManagedInference(field)
624+
)
625+
else:
626+
args["managed_inference"] = None
627+
600628
return PublicCatalogProductProperties(**args)
601629

602630

scaleway/scaleway/product_catalog/v2alpha1/types.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class ListPublicCatalogProductsRequestProductType(str, Enum, metaclass=StrEnumMe
2525
DEDIBOX = "dedibox"
2626
BLOCK_STORAGE = "block_storage"
2727
OBJECT_STORAGE = "object_storage"
28+
MANAGED_INFERENCE = "managed_inference"
2829

2930
def __str__(self) -> str:
3031
return str(self.value)
@@ -340,6 +341,14 @@ class PublicCatalogProductPropertiesInstance:
340341
"""
341342

342343

344+
@dataclass
345+
class PublicCatalogProductPropertiesManagedInference:
346+
instance_gpu_name: str
347+
"""
348+
The name of the associated instance GPU to this node type.
349+
"""
350+
351+
343352
@dataclass
344353
class PublicCatalogProductPropertiesObjectStorage:
345354
pass
@@ -389,6 +398,8 @@ class PublicCatalogProductProperties:
389398

390399
object_storage: Optional[PublicCatalogProductPropertiesObjectStorage] = None
391400

401+
managed_inference: Optional[PublicCatalogProductPropertiesManagedInference] = None
402+
392403

393404
@dataclass
394405
class PublicCatalogProductUnitOfMeasure:

0 commit comments

Comments
 (0)