Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ export type {
PublicCatalogProductEnvironmentalImpactEstimation,
PublicCatalogProductLocality,
PublicCatalogProductPrice,
PublicCatalogProductProductBadge,
PublicCatalogProductProperties,
PublicCatalogProductPropertiesAppleSilicon,
PublicCatalogProductPropertiesBlockStorage,
PublicCatalogProductPropertiesDedibox,
PublicCatalogProductPropertiesElasticMetal,
PublicCatalogProductPropertiesGenerativeApis,
PublicCatalogProductPropertiesHardware,
PublicCatalogProductPropertiesHardwareCPU,
PublicCatalogProductPropertiesHardwareCPUArch,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import type {
PublicCatalogProductPropertiesBlockStorage,
PublicCatalogProductPropertiesDedibox,
PublicCatalogProductPropertiesElasticMetal,
PublicCatalogProductPropertiesGenerativeApis,
PublicCatalogProductPropertiesHardware,
PublicCatalogProductPropertiesInstance,
PublicCatalogProductPropertiesManagedInference,
Expand Down Expand Up @@ -178,6 +179,19 @@ const unmarshalPublicCatalogProductPropertiesElasticMetal = (data: unknown): Pub
} as PublicCatalogProductPropertiesElasticMetal
}

const unmarshalPublicCatalogProductPropertiesGenerativeApis = (data: unknown): PublicCatalogProductPropertiesGenerativeApis => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'PublicCatalogProductPropertiesGenerativeApis' failed as data isn't a dictionary.`,
)
}

return {
reasoning: data.reasoning,
supportedApis: data.supported_apis,
} as PublicCatalogProductPropertiesGenerativeApis
}

const unmarshalPublicCatalogProductPropertiesHardware = (data: unknown): PublicCatalogProductPropertiesHardware => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand Down Expand Up @@ -283,6 +297,7 @@ const unmarshalPublicCatalogProductProperties = (data: unknown): PublicCatalogPr
blockStorage: data.block_storage ? unmarshalPublicCatalogProductPropertiesBlockStorage(data.block_storage) : undefined,
dedibox: data.dedibox ? unmarshalPublicCatalogProductPropertiesDedibox(data.dedibox) : undefined,
elasticMetal: data.elastic_metal ? unmarshalPublicCatalogProductPropertiesElasticMetal(data.elastic_metal) : undefined,
generativeApis: data.generative_apis ? unmarshalPublicCatalogProductPropertiesGenerativeApis(data.generative_apis) : undefined,
hardware: data.hardware ? unmarshalPublicCatalogProductPropertiesHardware(data.hardware) : undefined,
instance: data.instance ? unmarshalPublicCatalogProductPropertiesInstance(data.instance) : undefined,
managedInference: data.managed_inference ? unmarshalPublicCatalogProductPropertiesManagedInference(data.managed_inference) : undefined,
Expand Down Expand Up @@ -311,6 +326,7 @@ const unmarshalPublicCatalogProduct = (data: unknown): PublicCatalogProduct => {
}

return {
badges: data.badges,
description: data.description,
endOfLifeAt: unmarshalDate(data.end_of_life_at),
environmentalImpactEstimation: data.environmental_impact_estimation ? unmarshalPublicCatalogProductEnvironmentalImpactEstimation(data.environmental_impact_estimation) : undefined,
Expand Down
38 changes: 31 additions & 7 deletions packages_generated/product_catalog/src/v2alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export type ListPublicCatalogProductsRequestProductType =
| 'block_storage'
| 'object_storage'
| 'managed_inference'
| 'generative_apis'

export type ListPublicCatalogProductsRequestStatus =
| 'unknown_status'
Expand All @@ -24,6 +25,13 @@ export type ListPublicCatalogProductsRequestStatus =
| 'end_of_life'
| 'retired'

export type PublicCatalogProductProductBadge =
| 'unknown_product_badge'
| 'new_product'
| 'best_seller'
| 'best_value'
| 'popular'

export type PublicCatalogProductPropertiesHardwareCPUArch =
| 'unknown_arch'
| 'x64'
Expand Down Expand Up @@ -250,6 +258,12 @@ export interface PublicCatalogProductPropertiesElasticMetal {
}


export interface PublicCatalogProductPropertiesGenerativeApis {
reasoning: boolean
supportedApis: string[]
}


export interface PublicCatalogProductPropertiesHardware {
/**
* The CPU hardware properties.
Expand Down Expand Up @@ -352,45 +366,51 @@ export interface PublicCatalogProductProperties {
/**
* The properties of Dedibox products.
*
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis' could be set.
*/
dedibox?: PublicCatalogProductPropertiesDedibox
/**
* The properties of Elastic Metal products.
*
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis' could be set.
*/
elasticMetal?: PublicCatalogProductPropertiesElasticMetal
/**
* The properties of Apple Silicon products.
*
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis' could be set.
*/
appleSilicon?: PublicCatalogProductPropertiesAppleSilicon
/**
* The properties of Instance products.
*
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis' could be set.
*/
instance?: PublicCatalogProductPropertiesInstance
/**
* The properties of Block Storage products.
*
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis' could be set.
*/
blockStorage?: PublicCatalogProductPropertiesBlockStorage
/**
* The properties of Object Storage products.
*
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis' could be set.
*/
objectStorage?: PublicCatalogProductPropertiesObjectStorage
/**
* The properties of Managed Inference products.
*
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis' could be set.
*/
managedInference?: PublicCatalogProductPropertiesManagedInference
/**
* The properties of Generative APIs products.
*
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis' could be set.
*/
generativeApis?: PublicCatalogProductPropertiesGenerativeApis
}


Expand Down Expand Up @@ -453,6 +473,10 @@ export interface PublicCatalogProduct {
* The end of life date of the product.
*/
endOfLifeAt?: Date
/**
* Different badges that can be associated with the product.
*/
badges: PublicCatalogProductProductBadge[]
}


Expand Down