From af349f9ba3ca66dec84cbe9a17a4d2255357b0f2 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Thu, 23 May 2024 14:24:10 +0000 Subject: [PATCH] feat: update generated APIs --- .../api/applesilicon/v1alpha1/index.gen.ts | 2 ++ .../applesilicon/v1alpha1/marshalling.gen.ts | 31 +++++++++++++++++++ .../api/applesilicon/v1alpha1/types.gen.ts | 13 ++++++++ 3 files changed, 46 insertions(+) diff --git a/packages/clients/src/api/applesilicon/v1alpha1/index.gen.ts b/packages/clients/src/api/applesilicon/v1alpha1/index.gen.ts index 8bdf6bf6a..f92d990dd 100644 --- a/packages/clients/src/api/applesilicon/v1alpha1/index.gen.ts +++ b/packages/clients/src/api/applesilicon/v1alpha1/index.gen.ts @@ -23,7 +23,9 @@ export type { ServerType, ServerTypeCPU, ServerTypeDisk, + ServerTypeGPU, ServerTypeMemory, + ServerTypeNetwork, ServerTypeStock, UpdateServerRequest, } from './types.gen' diff --git a/packages/clients/src/api/applesilicon/v1alpha1/marshalling.gen.ts b/packages/clients/src/api/applesilicon/v1alpha1/marshalling.gen.ts index 270cc4835..3b3d907aa 100644 --- a/packages/clients/src/api/applesilicon/v1alpha1/marshalling.gen.ts +++ b/packages/clients/src/api/applesilicon/v1alpha1/marshalling.gen.ts @@ -18,7 +18,9 @@ import type { ServerType, ServerTypeCPU, ServerTypeDisk, + ServerTypeGPU, ServerTypeMemory, + ServerTypeNetwork, UpdateServerRequest, } from './types.gen' @@ -51,6 +53,7 @@ const unmarshalServerTypeCPU = (data: unknown): ServerTypeCPU => { return { coreCount: data.core_count, + frequency: data.frequency, name: data.name, } as ServerTypeCPU } @@ -68,6 +71,18 @@ const unmarshalServerTypeDisk = (data: unknown): ServerTypeDisk => { } as ServerTypeDisk } +const unmarshalServerTypeGPU = (data: unknown): ServerTypeGPU => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerTypeGPU' failed as data isn't a dictionary.`, + ) + } + + return { + count: data.count, + } as ServerTypeGPU +} + const unmarshalServerTypeMemory = (data: unknown): ServerTypeMemory => { if (!isJSONObject(data)) { throw new TypeError( @@ -81,6 +96,18 @@ const unmarshalServerTypeMemory = (data: unknown): ServerTypeMemory => { } as ServerTypeMemory } +const unmarshalServerTypeNetwork = (data: unknown): ServerTypeNetwork => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerTypeNetwork' failed as data isn't a dictionary.`, + ) + } + + return { + publicBandwidthBps: data.public_bandwidth_bps, + } as ServerTypeNetwork +} + export const unmarshalServerType = (data: unknown): ServerType => { if (!isJSONObject(data)) { throw new TypeError( @@ -92,9 +119,13 @@ export const unmarshalServerType = (data: unknown): ServerType => { cpu: data.cpu ? unmarshalServerTypeCPU(data.cpu) : undefined, defaultOs: data.default_os ? unmarshalOS(data.default_os) : undefined, disk: data.disk ? unmarshalServerTypeDisk(data.disk) : undefined, + gpu: data.gpu ? unmarshalServerTypeGPU(data.gpu) : undefined, memory: data.memory ? unmarshalServerTypeMemory(data.memory) : undefined, minimumLeaseDuration: data.minimum_lease_duration, name: data.name, + network: data.network + ? unmarshalServerTypeNetwork(data.network) + : undefined, stock: data.stock, } as ServerType } diff --git a/packages/clients/src/api/applesilicon/v1alpha1/types.gen.ts b/packages/clients/src/api/applesilicon/v1alpha1/types.gen.ts index 5c64e566a..7a37aee54 100644 --- a/packages/clients/src/api/applesilicon/v1alpha1/types.gen.ts +++ b/packages/clients/src/api/applesilicon/v1alpha1/types.gen.ts @@ -46,6 +46,7 @@ export interface OS { export interface ServerTypeCPU { name: string coreCount: number + frequency: number } export interface ServerTypeDisk { @@ -53,11 +54,19 @@ export interface ServerTypeDisk { type: string } +export interface ServerTypeGPU { + count: number +} + export interface ServerTypeMemory { capacity: number type: string } +export interface ServerTypeNetwork { + publicBandwidthBps: number +} + export interface ServerType { /** CPU description. */ cpu?: ServerTypeCPU @@ -71,6 +80,10 @@ export interface ServerType { stock: ServerTypeStock /** Minimum duration of the lease in seconds (example. 3.4s). */ minimumLeaseDuration?: string + /** GPU description. */ + gpu?: ServerTypeGPU + /** Network description. */ + network?: ServerTypeNetwork /** The default OS for this server type. */ defaultOs?: OS }