Skip to content

Commit 7bbb632

Browse files
committed
feat: update generated APIs
1 parent de42af9 commit 7bbb632

File tree

5 files changed

+172
-3
lines changed

5 files changed

+172
-3
lines changed

packages_generated/applesilicon/src/v1alpha1/index.gen.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,16 @@ export type {
3333
ListServerTypesRequest,
3434
ListServerTypesResponse,
3535
OS,
36+
OSSupportedServerType,
3637
PrivateNetworkApiAddServerPrivateNetworkRequest,
3738
PrivateNetworkApiDeleteServerPrivateNetworkRequest,
3839
PrivateNetworkApiGetServerPrivateNetworkRequest,
3940
PrivateNetworkApiListServerPrivateNetworksRequest,
4041
PrivateNetworkApiSetServerPrivateNetworksRequest,
4142
RebootServerRequest,
4243
ReinstallServerRequest,
44+
RunnerConfiguration,
45+
RunnerConfigurationProvider,
4346
Server,
4447
ServerPrivateNetwork,
4548
ServerPrivateNetworkServerStatus,
@@ -51,6 +54,7 @@ export type {
5154
ServerTypeGPU,
5255
ServerTypeMemory,
5356
ServerTypeNetwork,
57+
ServerTypeNPU,
5458
ServerTypeStock,
5559
SetServerPrivateNetworksResponse,
5660
StartConnectivityDiagnosticRequest,

packages_generated/applesilicon/src/v1alpha1/marshalling.gen.ts

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ import type {
2121
ListServersResponse,
2222
ListServerTypesResponse,
2323
OS,
24+
OSSupportedServerType,
2425
PrivateNetworkApiAddServerPrivateNetworkRequest,
2526
PrivateNetworkApiSetServerPrivateNetworksRequest,
2627
ReinstallServerRequest,
28+
RunnerConfiguration,
2729
Server,
2830
ServerPrivateNetwork,
2931
ServerType,
@@ -32,12 +34,28 @@ import type {
3234
ServerTypeGPU,
3335
ServerTypeMemory,
3436
ServerTypeNetwork,
37+
ServerTypeNPU,
3538
SetServerPrivateNetworksResponse,
3639
StartConnectivityDiagnosticRequest,
3740
StartConnectivityDiagnosticResponse,
3841
UpdateServerRequest,
3942
} from './types.gen'
4043

44+
const unmarshalOSSupportedServerType = (
45+
data: unknown,
46+
): OSSupportedServerType => {
47+
if (!isJSONObject(data)) {
48+
throw new TypeError(
49+
`Unmarshalling the type 'OSSupportedServerType' failed as data isn't a dictionary.`,
50+
)
51+
}
52+
53+
return {
54+
fastDeliveryAvailable: data.fast_delivery_available,
55+
serverType: data.server_type,
56+
} as OSSupportedServerType
57+
}
58+
4159
export const unmarshalOS = (data: unknown): OS => {
4260
if (!isJSONObject(data)) {
4361
throw new TypeError(
@@ -46,13 +64,22 @@ export const unmarshalOS = (data: unknown): OS => {
4664
}
4765

4866
return {
49-
compatibleServerTypes: data.compatible_server_types,
67+
compatibleServerTypes: data.compatible_server_types
68+
? data.compatible_server_types
69+
: undefined,
70+
description: data.description,
5071
family: data.family,
5172
id: data.id,
5273
imageUrl: data.image_url,
5374
isBeta: data.is_beta,
5475
label: data.label,
5576
name: data.name,
77+
releaseNotesUrl: data.release_notes_url,
78+
supportedServerTypes: unmarshalArrayOfObject(
79+
data.supported_server_types,
80+
unmarshalOSSupportedServerType,
81+
),
82+
tags: data.tags,
5683
version: data.version,
5784
xcodeVersion: data.xcode_version,
5885
} as OS
@@ -71,6 +98,21 @@ const unmarshalCommitment = (data: unknown): Commitment => {
7198
} as Commitment
7299
}
73100

101+
const unmarshalRunnerConfiguration = (data: unknown): RunnerConfiguration => {
102+
if (!isJSONObject(data)) {
103+
throw new TypeError(
104+
`Unmarshalling the type 'RunnerConfiguration' failed as data isn't a dictionary.`,
105+
)
106+
}
107+
108+
return {
109+
name: data.name,
110+
provider: data.provider,
111+
token: data.token,
112+
url: data.url,
113+
} as RunnerConfiguration
114+
}
115+
74116
export const unmarshalServer = (data: unknown): Server => {
75117
if (!isJSONObject(data)) {
76118
throw new TypeError(
@@ -93,9 +135,13 @@ export const unmarshalServer = (data: unknown): Server => {
93135
os: data.os ? unmarshalOS(data.os) : undefined,
94136
projectId: data.project_id,
95137
publicBandwidthBps: data.public_bandwidth_bps,
138+
runnerConfiguration: data.runner_configuration
139+
? unmarshalRunnerConfiguration(data.runner_configuration)
140+
: undefined,
96141
sshUsername: data.ssh_username,
97142
status: data.status,
98143
sudoPassword: data.sudo_password,
144+
tags: data.tags,
99145
type: data.type,
100146
updatedAt: unmarshalDate(data.updated_at),
101147
vncPort: data.vnc_port,
@@ -138,6 +184,8 @@ const unmarshalServerTypeCPU = (data: unknown): ServerTypeCPU => {
138184
coreCount: data.core_count,
139185
frequency: data.frequency,
140186
name: data.name,
187+
sockets: data.sockets,
188+
threadsPerCore: data.threads_per_core,
141189
} as ServerTypeCPU
142190
}
143191

@@ -179,6 +227,18 @@ const unmarshalServerTypeMemory = (data: unknown): ServerTypeMemory => {
179227
} as ServerTypeMemory
180228
}
181229

230+
const unmarshalServerTypeNPU = (data: unknown): ServerTypeNPU => {
231+
if (!isJSONObject(data)) {
232+
throw new TypeError(
233+
`Unmarshalling the type 'ServerTypeNPU' failed as data isn't a dictionary.`,
234+
)
235+
}
236+
237+
return {
238+
count: data.count,
239+
} as ServerTypeNPU
240+
}
241+
182242
const unmarshalServerTypeNetwork = (data: unknown): ServerTypeNetwork => {
183243
if (!isJSONObject(data)) {
184244
throw new TypeError(
@@ -187,6 +247,7 @@ const unmarshalServerTypeNetwork = (data: unknown): ServerTypeNetwork => {
187247
}
188248

189249
return {
250+
defaultPublicBandwidth: data.default_public_bandwidth,
190251
publicBandwidthBps: data.public_bandwidth_bps,
191252
supportedBandwidth: data.supported_bandwidth,
192253
} as ServerTypeNetwork
@@ -210,6 +271,7 @@ export const unmarshalServerType = (data: unknown): ServerType => {
210271
network: data.network
211272
? unmarshalServerTypeNetwork(data.network)
212273
: undefined,
274+
npu: data.npu ? unmarshalServerTypeNPU(data.npu) : undefined,
213275
stock: data.stock,
214276
} as ServerType
215277
}
@@ -387,6 +449,16 @@ export const marshalBatchCreateServersRequest = (
387449
type: request.type,
388450
})
389451

452+
const marshalRunnerConfiguration = (
453+
request: RunnerConfiguration,
454+
defaults: DefaultValues,
455+
): Record<string, unknown> => ({
456+
name: request.name,
457+
provider: request.provider,
458+
token: request.token,
459+
url: request.url,
460+
})
461+
390462
export const marshalCreateServerRequest = (
391463
request: CreateServerRequest,
392464
defaults: DefaultValues,
@@ -397,6 +469,10 @@ export const marshalCreateServerRequest = (
397469
os_id: request.osId,
398470
project_id: request.projectId ?? defaults.defaultProjectId,
399471
public_bandwidth_bps: request.publicBandwidthBps,
472+
runner_configuration:
473+
request.runnerConfiguration !== undefined
474+
? marshalRunnerConfiguration(request.runnerConfiguration, defaults)
475+
: undefined,
400476
type: request.type,
401477
})
402478

@@ -420,6 +496,10 @@ export const marshalReinstallServerRequest = (
420496
defaults: DefaultValues,
421497
): Record<string, unknown> => ({
422498
os_id: request.osId,
499+
runner_configuration:
500+
request.runnerConfiguration !== undefined
501+
? marshalRunnerConfiguration(request.runnerConfiguration, defaults)
502+
: undefined,
423503
})
424504

425505
export const marshalStartConnectivityDiagnosticRequest = (

packages_generated/applesilicon/src/v1alpha1/types.gen.ts

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ export type ListServerPrivateNetworksRequestOrderBy =
2222

2323
export type ListServersRequestOrderBy = 'created_at_asc' | 'created_at_desc'
2424

25+
export type RunnerConfigurationProvider =
26+
| 'unknown_provider'
27+
| 'github'
28+
| 'gitlab'
29+
2530
export type ServerPrivateNetworkServerStatus =
2631
| 'unknown_status'
2732
| 'attaching'
@@ -55,6 +60,11 @@ export type ServerTypeStock =
5560
| 'low_stock'
5661
| 'high_stock'
5762

63+
export interface OSSupportedServerType {
64+
serverType: string
65+
fastDeliveryAvailable: boolean
66+
}
67+
5868
export interface Commitment {
5969
type: CommitmentType
6070
cancelled: boolean
@@ -94,15 +104,40 @@ export interface OS {
94104
*/
95105
xcodeVersion: string
96106
/**
97-
* List of compatible server types.
107+
* @deprecated List of compatible server types. Deprecated.
108+
*/
109+
compatibleServerTypes?: string[]
110+
/**
111+
* Url of the release notes for the OS image or softwares pre-installed.
98112
*/
99-
compatibleServerTypes: string[]
113+
releaseNotesUrl: string
114+
/**
115+
* A summary of the OS image content and configuration.
116+
*/
117+
description: string
118+
/**
119+
* List of tags for the OS configuration.
120+
*/
121+
tags: string[]
122+
/**
123+
* List of server types which supports the OS configuration. Also gives information about immediate stock availability.
124+
*/
125+
supportedServerTypes: OSSupportedServerType[]
126+
}
127+
128+
export interface RunnerConfiguration {
129+
name: string
130+
url: string
131+
token: string
132+
provider: RunnerConfigurationProvider
100133
}
101134

102135
export interface ServerTypeCPU {
103136
name: string
104137
coreCount: number
105138
frequency: number
139+
sockets: number
140+
threadsPerCore: number
106141
}
107142

108143
export interface ServerTypeDisk {
@@ -119,9 +154,14 @@ export interface ServerTypeMemory {
119154
type: string
120155
}
121156

157+
export interface ServerTypeNPU {
158+
count: number
159+
}
160+
122161
export interface ServerTypeNetwork {
123162
publicBandwidthBps: number
124163
supportedBandwidth: number[]
164+
defaultPublicBandwidth: number
125165
}
126166

127167
export interface BatchCreateServersRequestBatchInnerCreateServerRequest {
@@ -213,6 +253,14 @@ export interface Server {
213253
* Public bandwidth configured for this server. Expressed in bits per second.
214254
*/
215255
publicBandwidthBps: number
256+
/**
257+
* Current runner configuration, empty if none is installed.
258+
*/
259+
runnerConfiguration?: RunnerConfiguration
260+
/**
261+
* A list of tags attached to the server.
262+
*/
263+
tags: string[]
216264
}
217265

218266
export interface ConnectivityDiagnosticServerHealth {
@@ -300,6 +348,10 @@ export interface ServerType {
300348
* The default OS for this server type.
301349
*/
302350
defaultOs?: OS
351+
/**
352+
* NPU description.
353+
*/
354+
npu?: ServerTypeNPU
303355
}
304356

305357
export interface CommitmentTypeValue {
@@ -390,6 +442,10 @@ export type CreateServerRequest = {
390442
* 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.
391443
*/
392444
publicBandwidthBps: number
445+
/**
446+
* Specify the configuration to install an optional CICD runner on the server during installation.
447+
*/
448+
runnerConfiguration?: RunnerConfiguration
393449
}
394450

395451
export type DeleteServerRequest = {
@@ -656,6 +712,10 @@ export type ReinstallServerRequest = {
656712
* Reinstall the server with the target OS, when no os_id provided the default OS for the server type is used.
657713
*/
658714
osId?: string
715+
/**
716+
* Specify the configuration to install an optional CICD runner on the server during installation.
717+
*/
718+
runnerConfiguration?: RunnerConfiguration
659719
}
660720

661721
export interface SetServerPrivateNetworksResponse {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* This file is automatically generated
3+
* PLEASE DO NOT EDIT HERE
4+
*/
5+
6+
export * as EnvironmentalFootprintv1alpha1 from './v1alpha1/index.gen'
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// This file was automatically generated. DO NOT EDIT.
2+
// If you have any remark or suggestion do not hesitate to open an issue.
3+
export { UserAPI } from './api.gen'
4+
export * from './marshalling.gen'
5+
export type {
6+
Impact,
7+
ImpactDataResponse,
8+
ImpactReportAvailability,
9+
ProductCategory,
10+
ProjectImpact,
11+
RegionImpact,
12+
ReportType,
13+
ServiceCategory,
14+
SkuImpact,
15+
UserApiDownloadImpactReportRequest,
16+
UserApiGetImpactDataRequest,
17+
UserApiGetImpactReportAvailabilityRequest,
18+
ZoneImpact,
19+
} from './types.gen'

0 commit comments

Comments
 (0)