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
17 changes: 17 additions & 0 deletions packages/clients/src/api/instance/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ import type {
ServerMaintenance,
ServerSummary,
ServerType,
ServerTypeCapabilities,
ServerTypeNetwork,
ServerTypeNetworkInterface,
ServerTypeVolumeConstraintSizes,
Expand Down Expand Up @@ -354,6 +355,19 @@ const unmarshalServerMaintenance = (data: unknown) => {
return {} as ServerMaintenance
}

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

return {
blockStorage: data.block_storage,
bootTypes: data.boot_types,
} as ServerTypeCapabilities
}

const unmarshalServerTypeNetwork = (data: unknown) => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand Down Expand Up @@ -624,6 +638,9 @@ const unmarshalServerType = (data: unknown) => {
altNames: data.alt_names,
arch: data.arch,
baremetal: data.baremetal,
capabilities: data.capabilities
? unmarshalServerTypeCapabilities(data.capabilities)
: undefined,
gpu: data.gpu,
hourlyPrice: data.hourly_price,
monthlyPrice: data.monthly_price,
Expand Down
10 changes: 10 additions & 0 deletions packages/clients/src/api/instance/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,16 @@ export interface ServerType {
baremetal: boolean
/** Network available for the instance */
network?: ServerTypeNetwork
/** Capabilities */
capabilities?: ServerTypeCapabilities
}

/** Server type. capabilities */
export interface ServerTypeCapabilities {
/** True if server supports block storage */
blockStorage?: boolean
/** List of supported boot types */
bootTypes: Array<BootType>
}

/** Server type. network */
Expand Down