Skip to content

Commit 7431191

Browse files
authored
feat(product_catalog): object storage to estimation api (#2316)
1 parent 9205729 commit 7431191

File tree

3 files changed

+37
-9
lines changed

3 files changed

+37
-9
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export type {
2525
PublicCatalogProductPropertiesHardwareRAM,
2626
PublicCatalogProductPropertiesHardwareStorage,
2727
PublicCatalogProductPropertiesInstance,
28+
PublicCatalogProductPropertiesObjectStorage,
2829
PublicCatalogProductStatus,
2930
PublicCatalogProductUnitOfMeasure,
3031
PublicCatalogProductUnitOfMeasureCountableUnit,

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import type {
2626
PublicCatalogProductPropertiesHardwareRAM,
2727
PublicCatalogProductPropertiesHardwareStorage,
2828
PublicCatalogProductPropertiesInstance,
29+
PublicCatalogProductPropertiesObjectStorage,
2930
PublicCatalogProductUnitOfMeasure,
3031
} from './types.gen'
3132

@@ -251,6 +252,18 @@ const unmarshalPublicCatalogProductPropertiesInstance = (
251252
} as PublicCatalogProductPropertiesInstance
252253
}
253254

255+
const unmarshalPublicCatalogProductPropertiesObjectStorage = (
256+
data: unknown,
257+
): PublicCatalogProductPropertiesObjectStorage => {
258+
if (!isJSONObject(data)) {
259+
throw new TypeError(
260+
`Unmarshalling the type 'PublicCatalogProductPropertiesObjectStorage' failed as data isn't a dictionary.`,
261+
)
262+
}
263+
264+
return {} as PublicCatalogProductPropertiesObjectStorage
265+
}
266+
254267
const unmarshalPublicCatalogProductEnvironmentalImpactEstimation = (
255268
data: unknown,
256269
): PublicCatalogProductEnvironmentalImpactEstimation => {
@@ -327,6 +340,11 @@ const unmarshalPublicCatalogProductProperties = (
327340
instance: data.instance
328341
? unmarshalPublicCatalogProductPropertiesInstance(data.instance)
329342
: undefined,
343+
objectStorage: data.object_storage
344+
? unmarshalPublicCatalogProductPropertiesObjectStorage(
345+
data.object_storage,
346+
)
347+
: undefined,
330348
} as PublicCatalogProductProperties
331349
}
332350

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

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export type ListPublicCatalogProductsRequestProductType =
1313
| 'elastic_metal'
1414
| 'dedibox'
1515
| 'block_storage'
16+
| 'object_storage'
1617

1718
export type PublicCatalogProductPropertiesHardwareCPUArch =
1819
| 'unknown_arch'
@@ -188,13 +189,13 @@ export interface PublicCatalogProductPropertiesAppleSilicon {
188189

189190
export interface PublicCatalogProductPropertiesBlockStorage {
190191
/**
191-
* The minimum size of storage volume for this product in bytes.
192+
* @deprecated The minimum size of storage volume for this product in bytes. Deprecated.
192193
*/
193-
minVolumeSize: number
194+
minVolumeSize?: number
194195
/**
195-
* The maximum size of storage volume for this product in bytes.
196+
* @deprecated The maximum size of storage volume for this product in bytes. Deprecated.
196197
*/
197-
maxVolumeSize: number
198+
maxVolumeSize?: number
198199
}
199200

200201
export interface PublicCatalogProductPropertiesDedibox {
@@ -249,6 +250,8 @@ export interface PublicCatalogProductPropertiesInstance {
249250
recommendedReplacementOfferIds: string[]
250251
}
251252

253+
export interface PublicCatalogProductPropertiesObjectStorage {}
254+
252255
export interface PublicCatalogProductEnvironmentalImpactEstimation {
253256
kgCo2Equivalent?: number
254257
m3WaterUsage?: number
@@ -296,33 +299,39 @@ export interface PublicCatalogProductProperties {
296299
/**
297300
* The properties of Dedibox products.
298301
*
299-
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage' could be set.
302+
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
300303
*/
301304
dedibox?: PublicCatalogProductPropertiesDedibox
302305
/**
303306
* The properties of Elastic Metal products.
304307
*
305-
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage' could be set.
308+
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
306309
*/
307310
elasticMetal?: PublicCatalogProductPropertiesElasticMetal
308311
/**
309312
* The properties of Apple Silicon products.
310313
*
311-
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage' could be set.
314+
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
312315
*/
313316
appleSilicon?: PublicCatalogProductPropertiesAppleSilicon
314317
/**
315318
* The properties of Instance products.
316319
*
317-
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage' could be set.
320+
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
318321
*/
319322
instance?: PublicCatalogProductPropertiesInstance
320323
/**
321324
* The properties of Block Storage products.
322325
*
323-
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage' could be set.
326+
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
324327
*/
325328
blockStorage?: PublicCatalogProductPropertiesBlockStorage
329+
/**
330+
* The properties of Object Storage products.
331+
*
332+
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
333+
*/
334+
objectStorage?: PublicCatalogProductPropertiesObjectStorage
326335
}
327336

328337
export interface PublicCatalogProductUnitOfMeasure {

0 commit comments

Comments
 (0)