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 @@ -23,6 +23,7 @@ export type {
PublicCatalogProductPropertiesHardwareRAM,
PublicCatalogProductPropertiesHardwareStorage,
PublicCatalogProductPropertiesInstance,
PublicCatalogProductStatus,
PublicCatalogProductUnitOfMeasure,
PublicCatalogProductUnitOfMeasureCountableUnit,
} from './types.gen'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import {
isJSONObject,
unmarshalArrayOfObject,
unmarshalDate,
unmarshalMoney,
} from '@scaleway/sdk-client'
import type {
Expand Down Expand Up @@ -228,7 +229,9 @@ const unmarshalPublicCatalogProductPropertiesInstance = (
}

return {
offerId: data.offer_id,
range: data.range,
recommendedReplacementOfferIds: data.recommended_replacement_offer_ids,
} as PublicCatalogProductPropertiesInstance
}

Expand Down Expand Up @@ -332,6 +335,7 @@ const unmarshalPublicCatalogProduct = (data: unknown): PublicCatalogProduct => {

return {
description: data.description,
endOfLifeAt: unmarshalDate(data.end_of_life_at),
environmentalImpactEstimation: data.environmental_impact_estimation
? unmarshalPublicCatalogProductEnvironmentalImpactEstimation(
data.environmental_impact_estimation,
Expand All @@ -349,6 +353,7 @@ const unmarshalPublicCatalogProduct = (data: unknown): PublicCatalogProduct => {
: undefined,
serviceCategory: data.service_category,
sku: data.sku,
status: data.status,
unitOfMeasure: data.unit_of_measure
? unmarshalPublicCatalogProductUnitOfMeasure(data.unit_of_measure)
: undefined,
Expand Down
24 changes: 24 additions & 0 deletions packages_generated/product_catalog/src/v2alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ export type PublicCatalogProductPropertiesHardwareCPUArch =
| 'riscv'
| 'apple_silicon'

export type PublicCatalogProductStatus =
| 'unknown_status'
| 'public_beta'
| 'preview'
| 'general_availability'
| 'end_of_deployment'
| 'end_of_support'

export type PublicCatalogProductUnitOfMeasureCountableUnit =
| 'unknown_countable_unit'
| 'chunk'
Expand Down Expand Up @@ -211,6 +219,14 @@ export interface PublicCatalogProductPropertiesInstance {
* The range of the Instance server.
*/
range: string
/**
* The offer ID of the Instance server.
*/
offerId: string
/**
* The recommended replacement offer IDs of the Instance server.
*/
recommendedReplacementOfferIds: string[]
}

export interface PublicCatalogProductEnvironmentalImpactEstimation {
Expand Down Expand Up @@ -329,6 +345,14 @@ export interface PublicCatalogProduct {
* The unit of measure of the product.
*/
unitOfMeasure?: PublicCatalogProductUnitOfMeasure
/**
* The status of the product.
*/
status: PublicCatalogProductStatus
/**
* The end of life date of the product.
*/
endOfLifeAt?: Date
}

export interface ListPublicCatalogProductsResponse {
Expand Down
Loading