Skip to content

Commit 0aabcd5

Browse files
feat(product_catalog): add managed inference to public catalog api (#2579)
Co-authored-by: Jonathan R. <[email protected]>
1 parent 5af6be9 commit 0aabcd5

File tree

3 files changed

+41
-6
lines changed

3 files changed

+41
-6
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
@@ -26,6 +26,7 @@ export type {
2626
PublicCatalogProductPropertiesHardwareRAM,
2727
PublicCatalogProductPropertiesHardwareStorage,
2828
PublicCatalogProductPropertiesInstance,
29+
PublicCatalogProductPropertiesManagedInference,
2930
PublicCatalogProductPropertiesObjectStorage,
3031
PublicCatalogProductStatus,
3132
PublicCatalogProductUnitOfMeasure,

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import type {
2626
PublicCatalogProductPropertiesHardwareRAM,
2727
PublicCatalogProductPropertiesHardwareStorage,
2828
PublicCatalogProductPropertiesInstance,
29+
PublicCatalogProductPropertiesManagedInference,
2930
PublicCatalogProductPropertiesObjectStorage,
3031
PublicCatalogProductUnitOfMeasure,
3132
} from './types.gen.js'
@@ -255,6 +256,20 @@ const unmarshalPublicCatalogProductPropertiesInstance = (
255256
} as PublicCatalogProductPropertiesInstance
256257
}
257258

259+
const unmarshalPublicCatalogProductPropertiesManagedInference = (
260+
data: unknown,
261+
): PublicCatalogProductPropertiesManagedInference => {
262+
if (!isJSONObject(data)) {
263+
throw new TypeError(
264+
`Unmarshalling the type 'PublicCatalogProductPropertiesManagedInference' failed as data isn't a dictionary.`,
265+
)
266+
}
267+
268+
return {
269+
instanceGpuName: data.instance_gpu_name,
270+
} as PublicCatalogProductPropertiesManagedInference
271+
}
272+
258273
const unmarshalPublicCatalogProductPropertiesObjectStorage = (
259274
data: unknown,
260275
): PublicCatalogProductPropertiesObjectStorage => {
@@ -343,6 +358,11 @@ const unmarshalPublicCatalogProductProperties = (
343358
instance: data.instance
344359
? unmarshalPublicCatalogProductPropertiesInstance(data.instance)
345360
: undefined,
361+
managedInference: data.managed_inference
362+
? unmarshalPublicCatalogProductPropertiesManagedInference(
363+
data.managed_inference,
364+
)
365+
: undefined,
346366
objectStorage: data.object_storage
347367
? unmarshalPublicCatalogProductPropertiesObjectStorage(
348368
data.object_storage,

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

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export type ListPublicCatalogProductsRequestProductType =
1414
| 'dedibox'
1515
| 'block_storage'
1616
| 'object_storage'
17+
| 'managed_inference'
1718

1819
export type ListPublicCatalogProductsRequestStatus =
1920
| 'unknown_status'
@@ -279,6 +280,13 @@ export interface PublicCatalogProductPropertiesInstance {
279280
recommendedReplacementOfferIds: string[]
280281
}
281282

283+
export interface PublicCatalogProductPropertiesManagedInference {
284+
/**
285+
* The name of the associated instance GPU to this node type.
286+
*/
287+
instanceGpuName: string
288+
}
289+
282290
export interface PublicCatalogProductPropertiesObjectStorage {}
283291

284292
export interface PublicCatalogProductEnvironmentalImpactEstimation {
@@ -328,39 +336,45 @@ export interface PublicCatalogProductProperties {
328336
/**
329337
* The properties of Dedibox products.
330338
*
331-
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
339+
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
332340
*/
333341
dedibox?: PublicCatalogProductPropertiesDedibox
334342
/**
335343
* The properties of Elastic Metal products.
336344
*
337-
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
345+
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
338346
*/
339347
elasticMetal?: PublicCatalogProductPropertiesElasticMetal
340348
/**
341349
* The properties of Apple Silicon products.
342350
*
343-
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
351+
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
344352
*/
345353
appleSilicon?: PublicCatalogProductPropertiesAppleSilicon
346354
/**
347355
* The properties of Instance products.
348356
*
349-
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
357+
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
350358
*/
351359
instance?: PublicCatalogProductPropertiesInstance
352360
/**
353361
* The properties of Block Storage products.
354362
*
355-
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
363+
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
356364
*/
357365
blockStorage?: PublicCatalogProductPropertiesBlockStorage
358366
/**
359367
* The properties of Object Storage products.
360368
*
361-
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
369+
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
362370
*/
363371
objectStorage?: PublicCatalogProductPropertiesObjectStorage
372+
/**
373+
* The properties of Managed Inference products.
374+
*
375+
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
376+
*/
377+
managedInference?: PublicCatalogProductPropertiesManagedInference
364378
}
365379

366380
export interface PublicCatalogProductUnitOfMeasure {

0 commit comments

Comments
 (0)