Skip to content

Commit

Permalink
feat(instance): set some fields of VolumeServer as optional (scaleway…
Browse files Browse the repository at this point in the history
…#1606)

Co-authored-by: Yacine FODIL <[email protected]>
  • Loading branch information
scaleway-bot and yfodil authored Nov 28, 2024
1 parent 3d6d00f commit 68dcd68
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/clients/src/api/instance/v1/api.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export class InstanceV1UtilsAPI extends API {
zone: request.zone,
}).then(res => validateNotUndefined(res.server?.volumes))

const newVolumes: Record<string, { id: string; name: string }> = {}
const newVolumes: Record<string, { id: string; name: string | undefined }> = {}
for (const [key, server] of Object.entries(volumes)) {
newVolumes[key] = { id: server.id, name: server.name }
}
Expand Down Expand Up @@ -322,7 +322,7 @@ export class InstanceV1UtilsAPI extends API {
.then(res => validateNotUndefined(res.server))

// Remove volume.
const newVolumes: Record<string, { id: string; name: string }> = {}
const newVolumes: Record<string, { id: string; name: string | undefined }> = {}
for (const [key, volume] of Object.entries(server.volumes)) {
if (volume.id !== request.volumeId) {
newVolumes[key] = { id: volume.id, name: volume.name }
Expand Down
2 changes: 1 addition & 1 deletion packages/clients/src/api/instance/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ const unmarshalVolumeServer = (data: unknown): VolumeServer => {
project: data.project,
server: data.server ? unmarshalServerSummary(data.server) : undefined,
size: data.size,
state: data.state,
state: data.state ? data.state : undefined,
volumeType: data.volume_type,
zone: data.zone,
} as VolumeServer
Expand Down
10 changes: 5 additions & 5 deletions packages/clients/src/api/instance/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,17 +316,17 @@ export interface ServerMaintenance {

export interface VolumeServer {
id: string
name: string
name?: string
/** @deprecated */
exportUri?: string
organization: string
organization?: string
server?: ServerSummary
size: number
size?: number
volumeType: VolumeServerVolumeType
creationDate?: Date
modificationDate?: Date
state: VolumeServerState
project: string
state?: VolumeServerState
project?: string
boot: boolean
/** Zone to target. If none is passed will use default zone from the config. */
zone: Zone
Expand Down

0 comments on commit 68dcd68

Please sign in to comment.