From 9e625c327aa322d5d08a542ccdea5c5363404889 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Wed, 18 Jun 2025 14:21:39 +0000 Subject: [PATCH] feat: update generated APIs --- .../src/v1alpha1/marshalling.gen.ts | 94 ++++----- .../applesilicon/src/v1alpha1/types.gen.ts | 180 +++++++++--------- 2 files changed, 137 insertions(+), 137 deletions(-) diff --git a/packages_generated/applesilicon/src/v1alpha1/marshalling.gen.ts b/packages_generated/applesilicon/src/v1alpha1/marshalling.gen.ts index edae92513..e74060ebc 100644 --- a/packages_generated/applesilicon/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/applesilicon/src/v1alpha1/marshalling.gen.ts @@ -55,6 +55,53 @@ export const unmarshalOS = (data: unknown): OS => { } as OS } +const unmarshalCommitment = (data: unknown): Commitment => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Commitment' failed as data isn't a dictionary.`, + ) + } + + return { + cancelled: data.cancelled, + type: data.type, + } as Commitment +} + +export const unmarshalServer = (data: unknown): Server => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Server' failed as data isn't a dictionary.`, + ) + } + + return { + commitment: data.commitment + ? unmarshalCommitment(data.commitment) + : undefined, + createdAt: unmarshalDate(data.created_at), + deletableAt: unmarshalDate(data.deletable_at), + deletionScheduled: data.deletion_scheduled, + delivered: data.delivered, + id: data.id, + ip: data.ip, + name: data.name, + organizationId: data.organization_id, + os: data.os ? unmarshalOS(data.os) : undefined, + projectId: data.project_id, + publicBandwidthBps: data.public_bandwidth_bps, + sshUsername: data.ssh_username, + status: data.status, + sudoPassword: data.sudo_password, + type: data.type, + updatedAt: unmarshalDate(data.updated_at), + vncPort: data.vnc_port, + vncUrl: data.vnc_url, + vpcStatus: data.vpc_status, + zone: data.zone, + } as Server +} + export const unmarshalServerPrivateNetwork = ( data: unknown, ): ServerPrivateNetwork => { @@ -164,53 +211,6 @@ export const unmarshalServerType = (data: unknown): ServerType => { } as ServerType } -const unmarshalCommitment = (data: unknown): Commitment => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'Commitment' failed as data isn't a dictionary.`, - ) - } - - return { - cancelled: data.cancelled, - type: data.type, - } as Commitment -} - -export const unmarshalServer = (data: unknown): Server => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'Server' failed as data isn't a dictionary.`, - ) - } - - return { - commitment: data.commitment - ? unmarshalCommitment(data.commitment) - : undefined, - createdAt: unmarshalDate(data.created_at), - deletableAt: unmarshalDate(data.deletable_at), - deletionScheduled: data.deletion_scheduled, - delivered: data.delivered, - id: data.id, - ip: data.ip, - name: data.name, - organizationId: data.organization_id, - os: data.os ? unmarshalOS(data.os) : undefined, - projectId: data.project_id, - publicBandwidthBps: data.public_bandwidth_bps, - sshUsername: data.ssh_username, - status: data.status, - sudoPassword: data.sudo_password, - type: data.type, - updatedAt: unmarshalDate(data.updated_at), - vncPort: data.vnc_port, - vncUrl: data.vnc_url, - vpcStatus: data.vpc_status, - zone: data.zone, - } as Server -} - const unmarshalConnectivityDiagnosticServerHealth = ( data: unknown, ): ConnectivityDiagnosticServerHealth => { diff --git a/packages_generated/applesilicon/src/v1alpha1/types.gen.ts b/packages_generated/applesilicon/src/v1alpha1/types.gen.ts index 80f88bb34..2c2c5e08b 100644 --- a/packages_generated/applesilicon/src/v1alpha1/types.gen.ts +++ b/packages_generated/applesilicon/src/v1alpha1/types.gen.ts @@ -55,6 +55,11 @@ export type ServerTypeStock = | 'low_stock' | 'high_stock' +export interface Commitment { + type: CommitmentType + cancelled: boolean +} + export interface OS { /** * Unique ID of the OS. @@ -119,9 +124,91 @@ export interface ServerTypeNetwork { supportedBandwidth: number[] } -export interface Commitment { - type: CommitmentType - cancelled: boolean +export interface Server { + /** + * UUID of the server. + */ + id: string + /** + * Type of the server. + */ + type: string + /** + * Name of the server. + */ + name: string + /** + * Project this server is associated with. + */ + projectId: string + /** + * Organization this server is associated with. + */ + organizationId: string + /** + * IPv4 address of the server. + */ + ip: string + /** + * Vnc:// URL to access Apple Remote Desktop. + */ + vncUrl: string + /** + * SSH Username for remote shell. + */ + sshUsername: string + /** + * Admin password required to execute commands. + */ + sudoPassword: string + /** + * VNC port to use for remote desktop connection. + */ + vncPort: number + /** + * Initially installed OS, this does not necessarily reflect the current OS version. + */ + os?: OS + /** + * Current status of the server. + */ + status: ServerStatus + /** + * Date on which the server was created. + */ + createdAt?: Date + /** + * Date on which the server was last updated. + */ + updatedAt?: Date + /** + * Date from which the server can be deleted. + */ + deletableAt?: Date + /** + * Set to true to mark the server for automatic deletion depending on `deletable_at` date. Set to false to cancel an existing deletion schedule. Leave unset otherwise. + */ + deletionScheduled: boolean + /** + * Zone of the server. + */ + zone: ScwZone + /** + * Set to true once the server has completed its provisioning steps and is ready to use. Some OS configurations might require a reinstallation of the server before delivery depending on the available stock. A reinstallation after the initial delivery will not change this flag and can be tracked using the server status. + */ + delivered: boolean + /** + * Activation status of optional Private Network feature support for this server. + */ + vpcStatus: ServerPrivateNetworkStatus + /** + * Commitment scheme applied to this server. + */ + commitment?: Commitment + /** + * Public bandwidth configured for this server. Expressed in bits per second. + */ + publicBandwidthBps: number } export interface ConnectivityDiagnosticServerHealth { @@ -211,93 +298,6 @@ export interface ServerType { defaultOs?: OS } -export interface Server { - /** - * UUID of the server. - */ - id: string - /** - * Type of the server. - */ - type: string - /** - * Name of the server. - */ - name: string - /** - * Project this server is associated with. - */ - projectId: string - /** - * Organization this server is associated with. - */ - organizationId: string - /** - * IPv4 address of the server. - */ - ip: string - /** - * Vnc:// URL to access Apple Remote Desktop. - */ - vncUrl: string - /** - * SSH Username for remote shell. - */ - sshUsername: string - /** - * Admin password required to execute commands. - */ - sudoPassword: string - /** - * VNC port to use for remote desktop connection. - */ - vncPort: number - /** - * Initially installed OS, this does not necessarily reflect the current OS version. - */ - os?: OS - /** - * Current status of the server. - */ - status: ServerStatus - /** - * Date on which the server was created. - */ - createdAt?: Date - /** - * Date on which the server was last updated. - */ - updatedAt?: Date - /** - * Date from which the server can be deleted. - */ - deletableAt?: Date - /** - * Set to true to mark the server for automatic deletion depending on `deletable_at` date. Set to false to cancel an existing deletion schedule. Leave unset otherwise. - */ - deletionScheduled: boolean - /** - * Zone of the server. - */ - zone: ScwZone - /** - * Set to true once the server has completed its provisioning steps and is ready to use. Some OS configurations might require a reinstallation of the server before delivery depending on the available stock. A reinstallation after the initial delivery will not change this flag and can be tracked using the server status. - */ - delivered: boolean - /** - * Activation status of optional Private Network feature support for this server. - */ - vpcStatus: ServerPrivateNetworkStatus - /** - * Commitment scheme applied to this server. - */ - commitment?: Commitment - /** - * Public bandwidth configured for this server. Expressed in bits per second. - */ - publicBandwidthBps: number -} - export interface CommitmentTypeValue { commitmentType: CommitmentType }