Skip to content

Commit 84cc6aa

Browse files
scaleway-botyfodil
andauthored
feat(product_catalog): add Object Storage (#1448)
Co-authored-by: Yacine Fodil <[email protected]>
1 parent 80f03ec commit 84cc6aa

File tree

6 files changed

+448
-0
lines changed

6 files changed

+448
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
from .types import PublicCatalogProductProductBadge
66
from .types import PublicCatalogProductPropertiesGenerativeApisConsumptionMode
77
from .types import PublicCatalogProductPropertiesHardwareCPUArch
8+
from .types import PublicCatalogProductPropertiesObjectStorageClassTypeStorageClass
9+
from .types import (
10+
PublicCatalogProductPropertiesObjectStorageInternetTrafficTypeTrafficType,
11+
)
12+
from .types import PublicCatalogProductPropertiesObjectStorageRestoreTypeRestoreType
813
from .types import PublicCatalogProductStatus
914
from .types import PublicCatalogProductUnitOfMeasureCountableUnit
1015
from .types import PublicCatalogProductPropertiesHardwareCPUPhysical
@@ -14,6 +19,10 @@
1419
from .types import PublicCatalogProductPropertiesHardwareNetwork
1520
from .types import PublicCatalogProductPropertiesHardwareRAM
1621
from .types import PublicCatalogProductPropertiesHardwareStorage
22+
from .types import PublicCatalogProductPropertiesObjectStorageClassType
23+
from .types import PublicCatalogProductPropertiesObjectStorageInternetTrafficType
24+
from .types import PublicCatalogProductPropertiesObjectStorageRegionTrafficType
25+
from .types import PublicCatalogProductPropertiesObjectStorageRestoreType
1726
from .types import PublicCatalogProductPropertiesAppleSilicon
1827
from .types import PublicCatalogProductPropertiesBlockStorage
1928
from .types import PublicCatalogProductPropertiesDedibox
@@ -42,6 +51,9 @@
4251
"PublicCatalogProductProductBadge",
4352
"PublicCatalogProductPropertiesGenerativeApisConsumptionMode",
4453
"PublicCatalogProductPropertiesHardwareCPUArch",
54+
"PublicCatalogProductPropertiesObjectStorageClassTypeStorageClass",
55+
"PublicCatalogProductPropertiesObjectStorageInternetTrafficTypeTrafficType",
56+
"PublicCatalogProductPropertiesObjectStorageRestoreTypeRestoreType",
4557
"PublicCatalogProductStatus",
4658
"PublicCatalogProductUnitOfMeasureCountableUnit",
4759
"PublicCatalogProductPropertiesHardwareCPUPhysical",
@@ -51,6 +63,10 @@
5163
"PublicCatalogProductPropertiesHardwareNetwork",
5264
"PublicCatalogProductPropertiesHardwareRAM",
5365
"PublicCatalogProductPropertiesHardwareStorage",
66+
"PublicCatalogProductPropertiesObjectStorageClassType",
67+
"PublicCatalogProductPropertiesObjectStorageInternetTrafficType",
68+
"PublicCatalogProductPropertiesObjectStorageRegionTrafficType",
69+
"PublicCatalogProductPropertiesObjectStorageRestoreType",
5470
"PublicCatalogProductPropertiesAppleSilicon",
5571
"PublicCatalogProductPropertiesBlockStorage",
5672
"PublicCatalogProductPropertiesDedibox",

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

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
from .types import (
1111
PublicCatalogProductProductBadge,
1212
PublicCatalogProductPropertiesHardwareCPUArch,
13+
PublicCatalogProductPropertiesObjectStorageClassTypeStorageClass,
14+
PublicCatalogProductPropertiesObjectStorageInternetTrafficTypeTrafficType,
15+
PublicCatalogProductPropertiesObjectStorageRestoreTypeRestoreType,
1316
PublicCatalogProductStatus,
1417
PublicCatalogProductPropertiesHardwareCPUPhysical,
1518
PublicCatalogProductPropertiesHardwareCPUVirtual,
@@ -18,6 +21,10 @@
1821
PublicCatalogProductPropertiesHardwareNetwork,
1922
PublicCatalogProductPropertiesHardwareRAM,
2023
PublicCatalogProductPropertiesHardwareStorage,
24+
PublicCatalogProductPropertiesObjectStorageClassType,
25+
PublicCatalogProductPropertiesObjectStorageInternetTrafficType,
26+
PublicCatalogProductPropertiesObjectStorageRegionTrafficType,
27+
PublicCatalogProductPropertiesObjectStorageRestoreType,
2128
PublicCatalogProductPropertiesAppleSilicon,
2229
PublicCatalogProductPropertiesBlockStorage,
2330
PublicCatalogProductPropertiesDedibox,
@@ -279,6 +286,88 @@ def unmarshal_PublicCatalogProductPropertiesHardwareStorage(
279286
return PublicCatalogProductPropertiesHardwareStorage(**args)
280287

281288

289+
def unmarshal_PublicCatalogProductPropertiesObjectStorageClassType(
290+
data: Any,
291+
) -> PublicCatalogProductPropertiesObjectStorageClassType:
292+
if not isinstance(data, dict):
293+
raise TypeError(
294+
"Unmarshalling the type 'PublicCatalogProductPropertiesObjectStorageClassType' failed as data isn't a dictionary."
295+
)
296+
297+
args: dict[str, Any] = {}
298+
299+
field = data.get("storage_class", None)
300+
if field is not None:
301+
args["storage_class"] = field
302+
else:
303+
args["storage_class"] = (
304+
PublicCatalogProductPropertiesObjectStorageClassTypeStorageClass.UNKNOWN_STORAGE_CLASS
305+
)
306+
307+
return PublicCatalogProductPropertiesObjectStorageClassType(**args)
308+
309+
310+
def unmarshal_PublicCatalogProductPropertiesObjectStorageInternetTrafficType(
311+
data: Any,
312+
) -> PublicCatalogProductPropertiesObjectStorageInternetTrafficType:
313+
if not isinstance(data, dict):
314+
raise TypeError(
315+
"Unmarshalling the type 'PublicCatalogProductPropertiesObjectStorageInternetTrafficType' failed as data isn't a dictionary."
316+
)
317+
318+
args: dict[str, Any] = {}
319+
320+
field = data.get("traffic_type", None)
321+
if field is not None:
322+
args["traffic_type"] = field
323+
else:
324+
args["traffic_type"] = (
325+
PublicCatalogProductPropertiesObjectStorageInternetTrafficTypeTrafficType.UNKNOWN_TRAFFIC_TYPE
326+
)
327+
328+
return PublicCatalogProductPropertiesObjectStorageInternetTrafficType(**args)
329+
330+
331+
def unmarshal_PublicCatalogProductPropertiesObjectStorageRegionTrafficType(
332+
data: Any,
333+
) -> PublicCatalogProductPropertiesObjectStorageRegionTrafficType:
334+
if not isinstance(data, dict):
335+
raise TypeError(
336+
"Unmarshalling the type 'PublicCatalogProductPropertiesObjectStorageRegionTrafficType' failed as data isn't a dictionary."
337+
)
338+
339+
args: dict[str, Any] = {}
340+
341+
field = data.get("region_destination", None)
342+
if field is not None:
343+
args["region_destination"] = field
344+
else:
345+
args["region_destination"] = None
346+
347+
return PublicCatalogProductPropertiesObjectStorageRegionTrafficType(**args)
348+
349+
350+
def unmarshal_PublicCatalogProductPropertiesObjectStorageRestoreType(
351+
data: Any,
352+
) -> PublicCatalogProductPropertiesObjectStorageRestoreType:
353+
if not isinstance(data, dict):
354+
raise TypeError(
355+
"Unmarshalling the type 'PublicCatalogProductPropertiesObjectStorageRestoreType' failed as data isn't a dictionary."
356+
)
357+
358+
args: dict[str, Any] = {}
359+
360+
field = data.get("restore_type", None)
361+
if field is not None:
362+
args["restore_type"] = field
363+
else:
364+
args["restore_type"] = (
365+
PublicCatalogProductPropertiesObjectStorageRestoreTypeRestoreType.UNKNOWN_RESTORE_TYPE
366+
)
367+
368+
return PublicCatalogProductPropertiesObjectStorageRestoreType(**args)
369+
370+
282371
def unmarshal_PublicCatalogProductPropertiesAppleSilicon(
283372
data: Any,
284373
) -> PublicCatalogProductPropertiesAppleSilicon:
@@ -539,6 +628,42 @@ def unmarshal_PublicCatalogProductPropertiesObjectStorage(
539628

540629
args: dict[str, Any] = {}
541630

631+
field = data.get("class", None)
632+
if field is not None:
633+
args["class_"] = unmarshal_PublicCatalogProductPropertiesObjectStorageClassType(
634+
field
635+
)
636+
else:
637+
args["class_"] = None
638+
639+
field = data.get("restore", None)
640+
if field is not None:
641+
args["restore"] = (
642+
unmarshal_PublicCatalogProductPropertiesObjectStorageRestoreType(field)
643+
)
644+
else:
645+
args["restore"] = None
646+
647+
field = data.get("internet_traffic", None)
648+
if field is not None:
649+
args["internet_traffic"] = (
650+
unmarshal_PublicCatalogProductPropertiesObjectStorageInternetTrafficType(
651+
field
652+
)
653+
)
654+
else:
655+
args["internet_traffic"] = None
656+
657+
field = data.get("region_traffic", None)
658+
if field is not None:
659+
args["region_traffic"] = (
660+
unmarshal_PublicCatalogProductPropertiesObjectStorageRegionTrafficType(
661+
field
662+
)
663+
)
664+
else:
665+
args["region_traffic"] = None
666+
542667
return PublicCatalogProductPropertiesObjectStorage(**args)
543668

544669

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

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,40 @@ def __str__(self) -> str:
8585
return str(self.value)
8686

8787

88+
class PublicCatalogProductPropertiesObjectStorageClassTypeStorageClass(
89+
str, Enum, metaclass=StrEnumMeta
90+
):
91+
UNKNOWN_STORAGE_CLASS = "unknown_storage_class"
92+
STANDARD = "standard"
93+
GLACIER = "glacier"
94+
ONEZONE_IA = "onezone_ia"
95+
96+
def __str__(self) -> str:
97+
return str(self.value)
98+
99+
100+
class PublicCatalogProductPropertiesObjectStorageInternetTrafficTypeTrafficType(
101+
str, Enum, metaclass=StrEnumMeta
102+
):
103+
UNKNOWN_TRAFFIC_TYPE = "unknown_traffic_type"
104+
INGRESS = "ingress"
105+
EGRESS = "egress"
106+
ALLIANCE = "alliance"
107+
108+
def __str__(self) -> str:
109+
return str(self.value)
110+
111+
112+
class PublicCatalogProductPropertiesObjectStorageRestoreTypeRestoreType(
113+
str, Enum, metaclass=StrEnumMeta
114+
):
115+
UNKNOWN_RESTORE_TYPE = "unknown_restore_type"
116+
STANDARD = "standard"
117+
118+
def __str__(self) -> str:
119+
return str(self.value)
120+
121+
88122
class PublicCatalogProductStatus(str, Enum, metaclass=StrEnumMeta):
89123
UNKNOWN_STATUS = "unknown_status"
90124
PUBLIC_BETA = "public_beta"
@@ -273,6 +307,40 @@ class PublicCatalogProductPropertiesHardwareStorage:
273307
"""
274308

275309

310+
@dataclass
311+
class PublicCatalogProductPropertiesObjectStorageClassType:
312+
storage_class: PublicCatalogProductPropertiesObjectStorageClassTypeStorageClass
313+
"""
314+
The storage class.
315+
"""
316+
317+
318+
@dataclass
319+
class PublicCatalogProductPropertiesObjectStorageInternetTrafficType:
320+
traffic_type: (
321+
PublicCatalogProductPropertiesObjectStorageInternetTrafficTypeTrafficType
322+
)
323+
"""
324+
The type of internet traffic.
325+
"""
326+
327+
328+
@dataclass
329+
class PublicCatalogProductPropertiesObjectStorageRegionTrafficType:
330+
region_destination: str
331+
"""
332+
The destination region for the region traffic.
333+
"""
334+
335+
336+
@dataclass
337+
class PublicCatalogProductPropertiesObjectStorageRestoreType:
338+
restore_type: PublicCatalogProductPropertiesObjectStorageRestoreTypeRestoreType
339+
"""
340+
The type of restore.
341+
"""
342+
343+
276344
@dataclass
277345
class PublicCatalogProductPropertiesAppleSilicon:
278346
range: str
@@ -398,6 +466,21 @@ class PublicCatalogProductPropertiesManagedInference:
398466

399467
@dataclass
400468
class PublicCatalogProductPropertiesObjectStorage:
469+
class_: Optional[PublicCatalogProductPropertiesObjectStorageClassType] = None
470+
471+
restore: Optional[PublicCatalogProductPropertiesObjectStorageRestoreType] = None
472+
473+
internet_traffic: Optional[
474+
PublicCatalogProductPropertiesObjectStorageInternetTrafficType
475+
] = None
476+
477+
region_traffic: Optional[
478+
PublicCatalogProductPropertiesObjectStorageRegionTrafficType
479+
] = None
480+
481+
482+
@dataclass
483+
class PublicCatalogProductPropertiesSecretManager:
401484
pass
402485

403486

scaleway/scaleway/product_catalog/v2alpha1/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
from .types import PublicCatalogProductProductBadge
66
from .types import PublicCatalogProductPropertiesGenerativeApisConsumptionMode
77
from .types import PublicCatalogProductPropertiesHardwareCPUArch
8+
from .types import PublicCatalogProductPropertiesObjectStorageClassTypeStorageClass
9+
from .types import (
10+
PublicCatalogProductPropertiesObjectStorageInternetTrafficTypeTrafficType,
11+
)
12+
from .types import PublicCatalogProductPropertiesObjectStorageRestoreTypeRestoreType
813
from .types import PublicCatalogProductStatus
914
from .types import PublicCatalogProductUnitOfMeasureCountableUnit
1015
from .types import PublicCatalogProductPropertiesHardwareCPUPhysical
@@ -14,6 +19,10 @@
1419
from .types import PublicCatalogProductPropertiesHardwareNetwork
1520
from .types import PublicCatalogProductPropertiesHardwareRAM
1621
from .types import PublicCatalogProductPropertiesHardwareStorage
22+
from .types import PublicCatalogProductPropertiesObjectStorageClassType
23+
from .types import PublicCatalogProductPropertiesObjectStorageInternetTrafficType
24+
from .types import PublicCatalogProductPropertiesObjectStorageRegionTrafficType
25+
from .types import PublicCatalogProductPropertiesObjectStorageRestoreType
1726
from .types import PublicCatalogProductPropertiesAppleSilicon
1827
from .types import PublicCatalogProductPropertiesBlockStorage
1928
from .types import PublicCatalogProductPropertiesDedibox
@@ -42,6 +51,9 @@
4251
"PublicCatalogProductProductBadge",
4352
"PublicCatalogProductPropertiesGenerativeApisConsumptionMode",
4453
"PublicCatalogProductPropertiesHardwareCPUArch",
54+
"PublicCatalogProductPropertiesObjectStorageClassTypeStorageClass",
55+
"PublicCatalogProductPropertiesObjectStorageInternetTrafficTypeTrafficType",
56+
"PublicCatalogProductPropertiesObjectStorageRestoreTypeRestoreType",
4557
"PublicCatalogProductStatus",
4658
"PublicCatalogProductUnitOfMeasureCountableUnit",
4759
"PublicCatalogProductPropertiesHardwareCPUPhysical",
@@ -51,6 +63,10 @@
5163
"PublicCatalogProductPropertiesHardwareNetwork",
5264
"PublicCatalogProductPropertiesHardwareRAM",
5365
"PublicCatalogProductPropertiesHardwareStorage",
66+
"PublicCatalogProductPropertiesObjectStorageClassType",
67+
"PublicCatalogProductPropertiesObjectStorageInternetTrafficType",
68+
"PublicCatalogProductPropertiesObjectStorageRegionTrafficType",
69+
"PublicCatalogProductPropertiesObjectStorageRestoreType",
5470
"PublicCatalogProductPropertiesAppleSilicon",
5571
"PublicCatalogProductPropertiesBlockStorage",
5672
"PublicCatalogProductPropertiesDedibox",

0 commit comments

Comments
 (0)