Skip to content

Commit 3f8e99a

Browse files
scaleway-botyfodil
andauthored
feat(product_catalog): add Object Storage (#2655)
Co-authored-by: Yacine Fodil <[email protected]>
1 parent 2c113bc commit 3f8e99a

File tree

3 files changed

+139
-0
lines changed

3 files changed

+139
-0
lines changed

packages_generated/product_catalog/src/v2alpha1/index.gen.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ export type {
3535
PublicCatalogProductPropertiesLoadBalancer,
3636
PublicCatalogProductPropertiesManagedInference,
3737
PublicCatalogProductPropertiesObjectStorage,
38+
PublicCatalogProductPropertiesObjectStorageClassType,
39+
PublicCatalogProductPropertiesObjectStorageClassTypeStorageClass,
40+
PublicCatalogProductPropertiesObjectStorageInternetTrafficType,
41+
PublicCatalogProductPropertiesObjectStorageInternetTrafficTypeTrafficType,
42+
PublicCatalogProductPropertiesObjectStorageRegionTrafficType,
43+
PublicCatalogProductPropertiesObjectStorageRestoreType,
44+
PublicCatalogProductPropertiesObjectStorageRestoreTypeRestoreType,
3845
PublicCatalogProductPropertiesSecretManager,
3946
PublicCatalogProductStatus,
4047
PublicCatalogProductUnitOfMeasure,

packages_generated/product_catalog/src/v2alpha1/marshalling.gen.ts

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import type {
88
PublicCatalogProductPropertiesHardwareNetwork,
99
PublicCatalogProductPropertiesHardwareRAM,
1010
PublicCatalogProductPropertiesHardwareStorage,
11+
PublicCatalogProductPropertiesObjectStorageClassType,
12+
PublicCatalogProductPropertiesObjectStorageInternetTrafficType,
13+
PublicCatalogProductPropertiesObjectStorageRegionTrafficType,
14+
PublicCatalogProductPropertiesObjectStorageRestoreType,
1115
PublicCatalogProductPropertiesAppleSilicon,
1216
PublicCatalogProductPropertiesBlockStorage,
1317
PublicCatalogProductPropertiesDedibox,
@@ -130,6 +134,54 @@ const unmarshalPublicCatalogProductPropertiesHardwareStorage = (data: unknown):
130134
} as PublicCatalogProductPropertiesHardwareStorage
131135
}
132136

137+
const unmarshalPublicCatalogProductPropertiesObjectStorageClassType = (data: unknown): PublicCatalogProductPropertiesObjectStorageClassType => {
138+
if (!isJSONObject(data)) {
139+
throw new TypeError(
140+
`Unmarshalling the type 'PublicCatalogProductPropertiesObjectStorageClassType' failed as data isn't a dictionary.`,
141+
)
142+
}
143+
144+
return {
145+
storageClass: data.storage_class,
146+
} as PublicCatalogProductPropertiesObjectStorageClassType
147+
}
148+
149+
const unmarshalPublicCatalogProductPropertiesObjectStorageInternetTrafficType = (data: unknown): PublicCatalogProductPropertiesObjectStorageInternetTrafficType => {
150+
if (!isJSONObject(data)) {
151+
throw new TypeError(
152+
`Unmarshalling the type 'PublicCatalogProductPropertiesObjectStorageInternetTrafficType' failed as data isn't a dictionary.`,
153+
)
154+
}
155+
156+
return {
157+
trafficType: data.traffic_type,
158+
} as PublicCatalogProductPropertiesObjectStorageInternetTrafficType
159+
}
160+
161+
const unmarshalPublicCatalogProductPropertiesObjectStorageRegionTrafficType = (data: unknown): PublicCatalogProductPropertiesObjectStorageRegionTrafficType => {
162+
if (!isJSONObject(data)) {
163+
throw new TypeError(
164+
`Unmarshalling the type 'PublicCatalogProductPropertiesObjectStorageRegionTrafficType' failed as data isn't a dictionary.`,
165+
)
166+
}
167+
168+
return {
169+
regionDestination: data.region_destination,
170+
} as PublicCatalogProductPropertiesObjectStorageRegionTrafficType
171+
}
172+
173+
const unmarshalPublicCatalogProductPropertiesObjectStorageRestoreType = (data: unknown): PublicCatalogProductPropertiesObjectStorageRestoreType => {
174+
if (!isJSONObject(data)) {
175+
throw new TypeError(
176+
`Unmarshalling the type 'PublicCatalogProductPropertiesObjectStorageRestoreType' failed as data isn't a dictionary.`,
177+
)
178+
}
179+
180+
return {
181+
restoreType: data.restore_type,
182+
} as PublicCatalogProductPropertiesObjectStorageRestoreType
183+
}
184+
133185
const unmarshalPublicCatalogProductPropertiesAppleSilicon = (data: unknown): PublicCatalogProductPropertiesAppleSilicon => {
134186
if (!isJSONObject(data)) {
135187
throw new TypeError(
@@ -268,6 +320,10 @@ const unmarshalPublicCatalogProductPropertiesObjectStorage = (data: unknown): Pu
268320
}
269321

270322
return {
323+
class: data.class ? unmarshalPublicCatalogProductPropertiesObjectStorageClassType(data.class) : undefined,
324+
internetTraffic: data.internet_traffic ? unmarshalPublicCatalogProductPropertiesObjectStorageInternetTrafficType(data.internet_traffic) : undefined,
325+
regionTraffic: data.region_traffic ? unmarshalPublicCatalogProductPropertiesObjectStorageRegionTrafficType(data.region_traffic) : undefined,
326+
restore: data.restore ? unmarshalPublicCatalogProductPropertiesObjectStorageRestoreType(data.restore) : undefined,
271327
} as PublicCatalogProductPropertiesObjectStorage
272328
}
273329

packages_generated/product_catalog/src/v2alpha1/types.gen.ts

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,22 @@ export type PublicCatalogProductPropertiesHardwareCPUArch =
4949
| 'riscv'
5050
| 'apple_silicon'
5151

52+
export type PublicCatalogProductPropertiesObjectStorageClassTypeStorageClass =
53+
| 'unknown_storage_class'
54+
| 'standard'
55+
| 'glacier'
56+
| 'onezone_ia'
57+
58+
export type PublicCatalogProductPropertiesObjectStorageInternetTrafficTypeTrafficType =
59+
| 'unknown_traffic_type'
60+
| 'ingress'
61+
| 'egress'
62+
| 'alliance'
63+
64+
export type PublicCatalogProductPropertiesObjectStorageRestoreTypeRestoreType =
65+
| 'unknown_restore_type'
66+
| 'standard'
67+
5268
export type PublicCatalogProductStatus =
5369
| 'unknown_status'
5470
| 'public_beta'
@@ -222,6 +238,38 @@ export interface PublicCatalogProductPropertiesHardwareStorage {
222238
}
223239

224240

241+
export interface PublicCatalogProductPropertiesObjectStorageClassType {
242+
/**
243+
* The storage class.
244+
*/
245+
storageClass: PublicCatalogProductPropertiesObjectStorageClassTypeStorageClass
246+
}
247+
248+
249+
export interface PublicCatalogProductPropertiesObjectStorageInternetTrafficType {
250+
/**
251+
* The type of internet traffic.
252+
*/
253+
trafficType: PublicCatalogProductPropertiesObjectStorageInternetTrafficTypeTrafficType
254+
}
255+
256+
257+
export interface PublicCatalogProductPropertiesObjectStorageRegionTrafficType {
258+
/**
259+
* The destination region for the region traffic.
260+
*/
261+
regionDestination: string
262+
}
263+
264+
265+
export interface PublicCatalogProductPropertiesObjectStorageRestoreType {
266+
/**
267+
* The type of restore.
268+
*/
269+
restoreType: PublicCatalogProductPropertiesObjectStorageRestoreTypeRestoreType
270+
}
271+
272+
225273
export interface PublicCatalogProductPropertiesAppleSilicon {
226274
/**
227275
* The range of the Apple Silicon server.
@@ -334,6 +382,34 @@ export interface PublicCatalogProductPropertiesManagedInference {
334382

335383

336384
export interface PublicCatalogProductPropertiesObjectStorage {
385+
/**
386+
* The properties related to Object Storage class.
387+
*
388+
* One-of ('type'): at most one of 'class', 'restore', 'internetTraffic', 'regionTraffic' could be set.
389+
*/
390+
class?: PublicCatalogProductPropertiesObjectStorageClassType
391+
/**
392+
* The properties related to Object Storage restore operations.
393+
*
394+
* One-of ('type'): at most one of 'class', 'restore', 'internetTraffic', 'regionTraffic' could be set.
395+
*/
396+
restore?: PublicCatalogProductPropertiesObjectStorageRestoreType
397+
/**
398+
* The properties related to Object Storage internet traffic.
399+
*
400+
* One-of ('type'): at most one of 'class', 'restore', 'internetTraffic', 'regionTraffic' could be set.
401+
*/
402+
internetTraffic?: PublicCatalogProductPropertiesObjectStorageInternetTrafficType
403+
/**
404+
* The properties related to Object Storage region traffic.
405+
*
406+
* One-of ('type'): at most one of 'class', 'restore', 'internetTraffic', 'regionTraffic' could be set.
407+
*/
408+
regionTraffic?: PublicCatalogProductPropertiesObjectStorageRegionTrafficType
409+
}
410+
411+
412+
export interface PublicCatalogProductPropertiesSecretManager {
337413
}
338414

339415

0 commit comments

Comments
 (0)