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
94 changes: 47 additions & 47 deletions packages_generated/applesilicon/src/v1alpha1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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 => {
Expand Down
180 changes: 90 additions & 90 deletions packages_generated/applesilicon/src/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
Expand Down
Loading