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 @@ -12,6 +12,7 @@ export type {
PublicCatalogProductPrice,
PublicCatalogProductProperties,
PublicCatalogProductPropertiesAppleSilicon,
PublicCatalogProductPropertiesBlockStorage,
PublicCatalogProductPropertiesDedibox,
PublicCatalogProductPropertiesElasticMetal,
PublicCatalogProductPropertiesHardware,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import type {
PublicCatalogProductPrice,
PublicCatalogProductProperties,
PublicCatalogProductPropertiesAppleSilicon,
PublicCatalogProductPropertiesBlockStorage,
PublicCatalogProductPropertiesDedibox,
PublicCatalogProductPropertiesElasticMetal,
PublicCatalogProductPropertiesHardware,
Expand Down Expand Up @@ -163,6 +164,21 @@ const unmarshalPublicCatalogProductPropertiesAppleSilicon = (
} as PublicCatalogProductPropertiesAppleSilicon
}

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

return {
maxVolumeSize: data.max_volume_size,
minVolumeSize: data.min_volume_size,
} as PublicCatalogProductPropertiesBlockStorage
}

const unmarshalPublicCatalogProductPropertiesDedibox = (
data: unknown,
): PublicCatalogProductPropertiesDedibox => {
Expand Down Expand Up @@ -296,6 +312,9 @@ const unmarshalPublicCatalogProductProperties = (
appleSilicon: data.apple_silicon
? unmarshalPublicCatalogProductPropertiesAppleSilicon(data.apple_silicon)
: undefined,
blockStorage: data.block_storage
? unmarshalPublicCatalogProductPropertiesBlockStorage(data.block_storage)
: undefined,
dedibox: data.dedibox
? unmarshalPublicCatalogProductPropertiesDedibox(data.dedibox)
: undefined,
Expand Down
25 changes: 21 additions & 4 deletions packages_generated/product_catalog/src/v2alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,17 @@ export interface PublicCatalogProductPropertiesAppleSilicon {
range: string
}

export interface PublicCatalogProductPropertiesBlockStorage {
/**
* The minimum size of storage volume for this product in bytes.
*/
minVolumeSize: number
/**
* The maximum size of storage volume for this product in bytes.
*/
maxVolumeSize: number
}

export interface PublicCatalogProductPropertiesDedibox {
/**
* The range of the Dedibox server.
Expand Down Expand Up @@ -284,27 +295,33 @@ export interface PublicCatalogProductProperties {
/**
* The properties of Dedibox products.
*
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance' could be set.
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage' could be set.
*/
dedibox?: PublicCatalogProductPropertiesDedibox
/**
* The properties of Elastic Metal products.
*
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance' could be set.
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage' could be set.
*/
elasticMetal?: PublicCatalogProductPropertiesElasticMetal
/**
* The properties of Apple Silicon products.
*
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance' could be set.
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage' could be set.
*/
appleSilicon?: PublicCatalogProductPropertiesAppleSilicon
/**
* The properties of Instance products.
*
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance' could be set.
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage' could be set.
*/
instance?: PublicCatalogProductPropertiesInstance
/**
* The properties of Block Storage products.
*
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage' could be set.
*/
blockStorage?: PublicCatalogProductPropertiesBlockStorage
}

export interface PublicCatalogProductUnitOfMeasure {
Expand Down
Loading