Skip to content
Closed
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
4 changes: 4 additions & 0 deletions packages_generated/applesilicon/src/v1alpha1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,16 @@ export type {
ListServerTypesRequest,
ListServerTypesResponse,
OS,
OSSupportedServerType,
PrivateNetworkApiAddServerPrivateNetworkRequest,
PrivateNetworkApiDeleteServerPrivateNetworkRequest,
PrivateNetworkApiGetServerPrivateNetworkRequest,
PrivateNetworkApiListServerPrivateNetworksRequest,
PrivateNetworkApiSetServerPrivateNetworksRequest,
RebootServerRequest,
ReinstallServerRequest,
RunnerConfiguration,
RunnerConfigurationProvider,
Server,
ServerPrivateNetwork,
ServerPrivateNetworkServerStatus,
Expand All @@ -51,6 +54,7 @@ export type {
ServerTypeGPU,
ServerTypeMemory,
ServerTypeNetwork,
ServerTypeNPU,
ServerTypeStock,
SetServerPrivateNetworksResponse,
StartConnectivityDiagnosticRequest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ import type {
ListServersResponse,
ListServerTypesResponse,
OS,
OSSupportedServerType,
PrivateNetworkApiAddServerPrivateNetworkRequest,
PrivateNetworkApiSetServerPrivateNetworksRequest,
ReinstallServerRequest,
RunnerConfiguration,
Server,
ServerPrivateNetwork,
ServerType,
Expand All @@ -32,12 +34,28 @@ import type {
ServerTypeGPU,
ServerTypeMemory,
ServerTypeNetwork,
ServerTypeNPU,
SetServerPrivateNetworksResponse,
StartConnectivityDiagnosticRequest,
StartConnectivityDiagnosticResponse,
UpdateServerRequest,
} from './types.gen'

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

return {
fastDeliveryAvailable: data.fast_delivery_available,
serverType: data.server_type,
} as OSSupportedServerType
}

export const unmarshalOS = (data: unknown): OS => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand All @@ -46,13 +64,22 @@ export const unmarshalOS = (data: unknown): OS => {
}

return {
compatibleServerTypes: data.compatible_server_types,
compatibleServerTypes: data.compatible_server_types
? data.compatible_server_types
: undefined,
description: data.description,
family: data.family,
id: data.id,
imageUrl: data.image_url,
isBeta: data.is_beta,
label: data.label,
name: data.name,
releaseNotesUrl: data.release_notes_url,
supportedServerTypes: unmarshalArrayOfObject(
data.supported_server_types,
unmarshalOSSupportedServerType,
),
tags: data.tags,
version: data.version,
xcodeVersion: data.xcode_version,
} as OS
Expand All @@ -71,6 +98,21 @@ const unmarshalCommitment = (data: unknown): Commitment => {
} as Commitment
}

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

return {
name: data.name,
provider: data.provider,
token: data.token,
url: data.url,
} as RunnerConfiguration
}

export const unmarshalServer = (data: unknown): Server => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand All @@ -93,9 +135,13 @@ export const unmarshalServer = (data: unknown): Server => {
os: data.os ? unmarshalOS(data.os) : undefined,
projectId: data.project_id,
publicBandwidthBps: data.public_bandwidth_bps,
runnerConfiguration: data.runner_configuration
? unmarshalRunnerConfiguration(data.runner_configuration)
: undefined,
sshUsername: data.ssh_username,
status: data.status,
sudoPassword: data.sudo_password,
tags: data.tags,
type: data.type,
updatedAt: unmarshalDate(data.updated_at),
vncPort: data.vnc_port,
Expand Down Expand Up @@ -138,6 +184,8 @@ const unmarshalServerTypeCPU = (data: unknown): ServerTypeCPU => {
coreCount: data.core_count,
frequency: data.frequency,
name: data.name,
sockets: data.sockets,
threadsPerCore: data.threads_per_core,
} as ServerTypeCPU
}

Expand Down Expand Up @@ -179,6 +227,18 @@ const unmarshalServerTypeMemory = (data: unknown): ServerTypeMemory => {
} as ServerTypeMemory
}

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

return {
count: data.count,
} as ServerTypeNPU
}

const unmarshalServerTypeNetwork = (data: unknown): ServerTypeNetwork => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand All @@ -187,6 +247,7 @@ const unmarshalServerTypeNetwork = (data: unknown): ServerTypeNetwork => {
}

return {
defaultPublicBandwidth: data.default_public_bandwidth,
publicBandwidthBps: data.public_bandwidth_bps,
supportedBandwidth: data.supported_bandwidth,
} as ServerTypeNetwork
Expand All @@ -210,6 +271,7 @@ export const unmarshalServerType = (data: unknown): ServerType => {
network: data.network
? unmarshalServerTypeNetwork(data.network)
: undefined,
npu: data.npu ? unmarshalServerTypeNPU(data.npu) : undefined,
stock: data.stock,
} as ServerType
}
Expand Down Expand Up @@ -387,6 +449,16 @@ export const marshalBatchCreateServersRequest = (
type: request.type,
})

const marshalRunnerConfiguration = (
request: RunnerConfiguration,
defaults: DefaultValues,
): Record<string, unknown> => ({
name: request.name,
provider: request.provider,
token: request.token,
url: request.url,
})

export const marshalCreateServerRequest = (
request: CreateServerRequest,
defaults: DefaultValues,
Expand All @@ -397,6 +469,10 @@ export const marshalCreateServerRequest = (
os_id: request.osId,
project_id: request.projectId ?? defaults.defaultProjectId,
public_bandwidth_bps: request.publicBandwidthBps,
runner_configuration:
request.runnerConfiguration !== undefined
? marshalRunnerConfiguration(request.runnerConfiguration, defaults)
: undefined,
type: request.type,
})

Expand All @@ -420,6 +496,10 @@ export const marshalReinstallServerRequest = (
defaults: DefaultValues,
): Record<string, unknown> => ({
os_id: request.osId,
runner_configuration:
request.runnerConfiguration !== undefined
? marshalRunnerConfiguration(request.runnerConfiguration, defaults)
: undefined,
})

export const marshalStartConnectivityDiagnosticRequest = (
Expand Down
64 changes: 62 additions & 2 deletions packages_generated/applesilicon/src/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ export type ListServerPrivateNetworksRequestOrderBy =

export type ListServersRequestOrderBy = 'created_at_asc' | 'created_at_desc'

export type RunnerConfigurationProvider =
| 'unknown_provider'
| 'github'
| 'gitlab'

export type ServerPrivateNetworkServerStatus =
| 'unknown_status'
| 'attaching'
Expand Down Expand Up @@ -55,6 +60,11 @@ export type ServerTypeStock =
| 'low_stock'
| 'high_stock'

export interface OSSupportedServerType {
serverType: string
fastDeliveryAvailable: boolean
}

export interface Commitment {
type: CommitmentType
cancelled: boolean
Expand Down Expand Up @@ -94,15 +104,40 @@ export interface OS {
*/
xcodeVersion: string
/**
* List of compatible server types.
* @deprecated List of compatible server types. Deprecated.
*/
compatibleServerTypes?: string[]
/**
* Url of the release notes for the OS image or softwares pre-installed.
*/
compatibleServerTypes: string[]
releaseNotesUrl: string
/**
* A summary of the OS image content and configuration.
*/
description: string
/**
* List of tags for the OS configuration.
*/
tags: string[]
/**
* List of server types which supports the OS configuration. Also gives information about immediate stock availability.
*/
supportedServerTypes: OSSupportedServerType[]
}

export interface RunnerConfiguration {
name: string
url: string
token: string
provider: RunnerConfigurationProvider
}

export interface ServerTypeCPU {
name: string
coreCount: number
frequency: number
sockets: number
threadsPerCore: number
}

export interface ServerTypeDisk {
Expand All @@ -119,9 +154,14 @@ export interface ServerTypeMemory {
type: string
}

export interface ServerTypeNPU {
count: number
}

export interface ServerTypeNetwork {
publicBandwidthBps: number
supportedBandwidth: number[]
defaultPublicBandwidth: number
}

export interface BatchCreateServersRequestBatchInnerCreateServerRequest {
Expand Down Expand Up @@ -213,6 +253,14 @@ export interface Server {
* Public bandwidth configured for this server. Expressed in bits per second.
*/
publicBandwidthBps: number
/**
* Current runner configuration, empty if none is installed.
*/
runnerConfiguration?: RunnerConfiguration
/**
* A list of tags attached to the server.
*/
tags: string[]
}

export interface ConnectivityDiagnosticServerHealth {
Expand Down Expand Up @@ -300,6 +348,10 @@ export interface ServerType {
* The default OS for this server type.
*/
defaultOs?: OS
/**
* NPU description.
*/
npu?: ServerTypeNPU
}

export interface CommitmentTypeValue {
Expand Down Expand Up @@ -390,6 +442,10 @@ export type CreateServerRequest = {
* Public bandwidth to configure for this server. This defaults to the minimum bandwidth for this server type. For compatible server types, the bandwidth can be increased which incurs additional costs.
*/
publicBandwidthBps: number
/**
* Specify the configuration to install an optional CICD runner on the server during installation.
*/
runnerConfiguration?: RunnerConfiguration
}

export type DeleteServerRequest = {
Expand Down Expand Up @@ -656,6 +712,10 @@ export type ReinstallServerRequest = {
* Reinstall the server with the target OS, when no os_id provided the default OS for the server type is used.
*/
osId?: string
/**
* Specify the configuration to install an optional CICD runner on the server during installation.
*/
runnerConfiguration?: RunnerConfiguration
}

export interface SetServerPrivateNetworksResponse {
Expand Down
6 changes: 6 additions & 0 deletions packages_generated/environmental_footprint/src/index.gen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* This file is automatically generated
* PLEASE DO NOT EDIT HERE
*/

export * as EnvironmentalFootprintv1alpha1 from './v1alpha1/index.gen'
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// This file was automatically generated. DO NOT EDIT.
// If you have any remark or suggestion do not hesitate to open an issue.
export { UserAPI } from './api.gen'
export * from './marshalling.gen'
export type {
Impact,
ImpactDataResponse,
ImpactReportAvailability,
ProductCategory,
ProjectImpact,
RegionImpact,
ReportType,
ServiceCategory,
SkuImpact,
UserApiDownloadImpactReportRequest,
UserApiGetImpactDataRequest,
UserApiGetImpactReportAvailabilityRequest,
ZoneImpact,
} from './types.gen'
Loading