Skip to content

Commit 525085b

Browse files
committed
feat: all messages are optional
Signed-off-by: Nathanael DEMACON <[email protected]>
1 parent 69d7476 commit 525085b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+493
-331
lines changed

packages/clients/src/api/applesilicon/v1alpha1/marshalling.gen.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ export const unmarshalServerType = (data: unknown): ServerType => {
8484
}
8585

8686
return {
87-
cpu: unmarshalServerTypeCPU(data.cpu),
88-
disk: unmarshalServerTypeDisk(data.disk),
89-
memory: unmarshalServerTypeMemory(data.memory),
87+
cpu: data.cpu ? unmarshalServerTypeCPU(data.cpu) : undefined,
88+
disk: data.disk ? unmarshalServerTypeDisk(data.disk) : undefined,
89+
memory: data.memory ? unmarshalServerTypeMemory(data.memory) : undefined,
9090
minimumLeaseDuration: data.minimum_lease_duration,
9191
name: data.name,
9292
stock: data.stock,

packages/clients/src/api/applesilicon/v1alpha1/types.gen.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ export interface OS {
5252

5353
export interface ServerType {
5454
/** CPU description. */
55-
cpu: ServerTypeCPU
55+
cpu?: ServerTypeCPU
5656
/** Size of the local disk of the server. */
57-
disk: ServerTypeDisk
57+
disk?: ServerTypeDisk
5858
/** Name of the type. */
5959
name: string
6060
/** Size of memory available. */
61-
memory: ServerTypeMemory
61+
memory?: ServerTypeMemory
6262
/** Current stock. */
6363
stock: ServerTypeStock
6464
/** Minimum duration of the lease in seconds (example. 3.4s). */

packages/clients/src/api/baremetal/v1/marshalling.gen.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,15 @@ export const unmarshalOS = (data: unknown): OS => {
9797
licenseRequired: data.license_required,
9898
logoUrl: data.logo_url,
9999
name: data.name,
100-
password: unmarshalOSOSField(data.password),
101-
servicePassword: unmarshalOSOSField(data.service_password),
102-
serviceUser: unmarshalOSOSField(data.service_user),
103-
ssh: unmarshalOSOSField(data.ssh),
104-
user: unmarshalOSOSField(data.user),
100+
password: data.password ? unmarshalOSOSField(data.password) : undefined,
101+
servicePassword: data.service_password
102+
? unmarshalOSOSField(data.service_password)
103+
: undefined,
104+
serviceUser: data.service_user
105+
? unmarshalOSOSField(data.service_user)
106+
: undefined,
107+
ssh: data.ssh ? unmarshalOSOSField(data.ssh) : undefined,
108+
user: data.user ? unmarshalOSOSField(data.user) : undefined,
105109
version: data.version,
106110
} as OS
107111
}
@@ -333,7 +337,7 @@ export const unmarshalServer = (data: unknown): Server => {
333337
description: data.description,
334338
domain: data.domain,
335339
id: data.id,
336-
install: unmarshalServerInstall(data.install),
340+
install: data.install ? unmarshalServerInstall(data.install) : undefined,
337341
ips: unmarshalArrayOfObject(data.ips, unmarshalIP),
338342
name: data.name,
339343
offerId: data.offer_id,
@@ -342,7 +346,9 @@ export const unmarshalServer = (data: unknown): Server => {
342346
organizationId: data.organization_id,
343347
pingStatus: data.ping_status,
344348
projectId: data.project_id,
345-
rescueServer: unmarshalServerRescueServer(data.rescue_server),
349+
rescueServer: data.rescue_server
350+
? unmarshalServerRescueServer(data.rescue_server)
351+
: undefined,
346352
status: data.status,
347353
tags: data.tags,
348354
updatedAt: unmarshalDate(data.updated_at),

packages/clients/src/api/baremetal/v1/types.gen.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,15 @@ export interface OS {
228228
/** URL of this OS's logo. */
229229
logoUrl: string
230230
/** Object defining the SSH requirements to install the OS. */
231-
ssh: OSOSField
231+
ssh?: OSOSField
232232
/** Object defining the username requirements to install the OS. */
233-
user: OSOSField
233+
user?: OSOSField
234234
/** Object defining the password requirements to install the OS. */
235-
password: OSOSField
235+
password?: OSOSField
236236
/** Object defining the username requirements to install the service. */
237-
serviceUser: OSOSField
237+
serviceUser?: OSOSField
238238
/** Object defining the password requirements to install the service. */
239-
servicePassword: OSOSField
239+
servicePassword?: OSOSField
240240
/** Defines if the operating system is enabled or not. */
241241
enabled: boolean
242242
/** License required (check server options for pricing details). */
@@ -369,13 +369,13 @@ export interface Server {
369369
/** Zone in which is the server located. */
370370
zone: Zone
371371
/** Configuration of the installation. */
372-
install: ServerInstall
372+
install?: ServerInstall
373373
/** Status of server ping. */
374374
pingStatus: ServerPingStatus
375375
/** Options enabled on the server. */
376376
options: ServerOption[]
377377
/** Configuration of rescue boot. */
378-
rescueServer: ServerRescueServer
378+
rescueServer?: ServerRescueServer
379379
}
380380

381381
export interface Setting {

packages/clients/src/api/block/v1alpha1/marshalling.gen.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const unmarshalVolume = (data: unknown): Volume => {
7373
projectId: data.project_id,
7474
references: unmarshalArrayOfObject(data.references, unmarshalReference),
7575
size: data.size,
76-
specs: unmarshalVolumeSpecifications(data.specs),
76+
specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : undefined,
7777
status: data.status,
7878
tags: data.tags,
7979
type: data.type,
@@ -109,7 +109,9 @@ const unmarshalSnapshotSummary = (data: unknown): SnapshotSummary => {
109109
createdAt: unmarshalDate(data.created_at),
110110
id: data.id,
111111
name: data.name,
112-
parentVolume: unmarshalSnapshotParentVolume(data.parent_volume),
112+
parentVolume: data.parent_volume
113+
? unmarshalSnapshotParentVolume(data.parent_volume)
114+
: undefined,
113115
projectId: data.project_id,
114116
size: data.size,
115117
status: data.status,
@@ -146,7 +148,7 @@ const unmarshalVolumeType = (data: unknown): VolumeType => {
146148
snapshotPricing: data.snapshot_pricing
147149
? unmarshalMoney(data.snapshot_pricing)
148150
: undefined,
149-
specs: unmarshalVolumeSpecifications(data.specs),
151+
specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : undefined,
150152
type: data.type,
151153
} as VolumeType
152154
}
@@ -193,7 +195,9 @@ export const unmarshalSnapshot = (data: unknown): Snapshot => {
193195
createdAt: unmarshalDate(data.created_at),
194196
id: data.id,
195197
name: data.name,
196-
parentVolume: unmarshalSnapshotParentVolume(data.parent_volume),
198+
parentVolume: data.parent_volume
199+
? unmarshalSnapshotParentVolume(data.parent_volume)
200+
: undefined,
197201
projectId: data.project_id,
198202
references: unmarshalArrayOfObject(data.references, unmarshalReference),
199203
size: data.size,

packages/clients/src/api/block/v1alpha1/types.gen.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export interface SnapshotSummary {
114114
/** Name of the snapshot. */
115115
name: string
116116
/** If the parent volume has been deleted, value is null. */
117-
parentVolume: SnapshotParentVolume
117+
parentVolume?: SnapshotParentVolume
118118
/** Size of the snapshot in bytes. */
119119
size: number
120120
/** UUID of the project the snapshot belongs to. */
@@ -141,7 +141,7 @@ export interface VolumeType {
141141
/** Price of the snapshot billed in GB/hour. */
142142
snapshotPricing?: Money
143143
/** Volume specifications of the volume type. */
144-
specs: VolumeSpecifications
144+
specs?: VolumeSpecifications
145145
}
146146

147147
export interface Volume {
@@ -173,7 +173,7 @@ export interface Volume {
173173
/** Volume zone. */
174174
zone: Zone
175175
/** Specifications of the volume. */
176-
specs: VolumeSpecifications
176+
specs?: VolumeSpecifications
177177
}
178178

179179
export type CreateSnapshotRequest = {
@@ -339,7 +339,7 @@ export interface Snapshot {
339339
/** Name of the snapshot. */
340340
name: string
341341
/** If the parent volume was deleted, value is null. */
342-
parentVolume: SnapshotParentVolume
342+
parentVolume?: SnapshotParentVolume
343343
/** Size in bytes of the snapshot. */
344344
size: number
345345
/** UUID of the project the snapshot belongs to. */

packages/clients/src/api/cockpit/v1beta1/marshalling.gen.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export const unmarshalToken = (data: unknown): Token => {
149149
id: data.id,
150150
name: data.name,
151151
projectId: data.project_id,
152-
scopes: unmarshalTokenScopes(data.scopes),
152+
scopes: data.scopes ? unmarshalTokenScopes(data.scopes) : undefined,
153153
secretKey: data.secret_key,
154154
updatedAt: unmarshalDate(data.updated_at),
155155
} as Token
@@ -198,9 +198,11 @@ export const unmarshalCockpit = (data: unknown): Cockpit => {
198198

199199
return {
200200
createdAt: unmarshalDate(data.created_at),
201-
endpoints: unmarshalCockpitEndpoints(data.endpoints),
201+
endpoints: data.endpoints
202+
? unmarshalCockpitEndpoints(data.endpoints)
203+
: undefined,
202204
managedAlertsEnabled: data.managed_alerts_enabled,
203-
plan: unmarshalPlan(data.plan),
205+
plan: data.plan ? unmarshalPlan(data.plan) : undefined,
204206
projectId: data.project_id,
205207
status: data.status,
206208
updatedAt: unmarshalDate(data.updated_at),

packages/clients/src/api/cockpit/v1beta1/types.gen.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export interface Token {
155155
/** Date and time of the token's last update. */
156156
updatedAt?: Date
157157
/** Token's permissions. */
158-
scopes: TokenScopes
158+
scopes?: TokenScopes
159159
/** Token's secret key. */
160160
secretKey?: string
161161
}
@@ -174,13 +174,13 @@ export interface Cockpit {
174174
/** Date and time of the Cockpit's last update. */
175175
updatedAt?: Date
176176
/** Endpoints of the Cockpit. */
177-
endpoints: CockpitEndpoints
177+
endpoints?: CockpitEndpoints
178178
/** Status of the Cockpit. */
179179
status: CockpitStatus
180180
/** Specifies whether managed alerts are enabled or disabled. */
181181
managedAlertsEnabled: boolean
182182
/** Pricing plan information. */
183-
plan: Plan
183+
plan?: Plan
184184
}
185185

186186
/** Metrics for a given Cockpit. */

packages/clients/src/api/document_db/v1beta1/marshalling.gen.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,9 @@ export const unmarshalInstance = (data: unknown): Instance => {
293293

294294
return {
295295
backupSameRegion: data.backup_same_region,
296-
backupSchedule: unmarshalBackupSchedule(data.backup_schedule),
296+
backupSchedule: data.backup_schedule
297+
? unmarshalBackupSchedule(data.backup_schedule)
298+
: undefined,
297299
createdAt: unmarshalDate(data.created_at),
298300
endpoint: data.endpoint ? unmarshalEndpoint(data.endpoint) : undefined,
299301
endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
@@ -304,7 +306,9 @@ export const unmarshalInstance = (data: unknown): Instance => {
304306
unmarshalInstanceSetting,
305307
),
306308
isHaCluster: data.is_ha_cluster,
307-
logsPolicy: unmarshalLogsPolicy(data.logs_policy),
309+
logsPolicy: data.logs_policy
310+
? unmarshalLogsPolicy(data.logs_policy)
311+
: undefined,
308312
maintenances: unmarshalArrayOfObject(
309313
data.maintenances,
310314
unmarshalMaintenance,
@@ -325,7 +329,7 @@ export const unmarshalInstance = (data: unknown): Instance => {
325329
data.upgradable_version,
326330
unmarshalUpgradableVersion,
327331
),
328-
volume: unmarshalVolume(data.volume),
332+
volume: data.volume ? unmarshalVolume(data.volume) : undefined,
329333
} as Instance
330334
}
331335

packages/clients/src/api/document_db/v1beta1/types.gen.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ export interface Instance {
442442
/** Creation date (must follow the ISO 8601 format). */
443443
createdAt?: Date
444444
/** Volumes of the Database Instance. */
445-
volume: Volume
445+
volume?: Volume
446446
/** Region the Database Instance is in. */
447447
region: Region
448448
/** UUID of the Database Instance. */
@@ -466,7 +466,7 @@ export interface Instance {
466466
/** Advanced settings of the Database Instance. */
467467
settings: InstanceSetting[]
468468
/** Backup schedule of the Database Instance. */
469-
backupSchedule: BackupSchedule
469+
backupSchedule?: BackupSchedule
470470
/** Defines whether or not High-Availability is enabled. */
471471
isHaCluster: boolean
472472
/** Read Replicas of the Database Instance. */
@@ -478,7 +478,7 @@ export interface Instance {
478478
/** List of Database Instance endpoints. */
479479
endpoints: Endpoint[]
480480
/** Logs policy of the Database Instance. */
481-
logsPolicy: LogsPolicy
481+
logsPolicy?: LogsPolicy
482482
/** Store logical backups in the same region as the Database Instance. */
483483
backupSameRegion: boolean
484484
/** List of Database Instance maintenance events. */

0 commit comments

Comments
 (0)