Skip to content

Commit

Permalink
feat(block): improve arguments configuration (scaleway#1576)
Browse files Browse the repository at this point in the history
Co-authored-by: Jules Castéran <[email protected]>
  • Loading branch information
scaleway-bot and Codelax authored Nov 18, 2024
1 parent cbd4509 commit aa34b25
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/clients/src/api/block/v1alpha1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class API extends ParentAPI {
* @param request - The request {@link CreateVolumeRequest}
* @returns A Promise of Volume
*/
createVolume = (request: Readonly<CreateVolumeRequest>) =>
createVolume = (request: Readonly<CreateVolumeRequest> = {}) =>
this.client.fetch<Volume>(
{
body: JSON.stringify(
Expand Down
5 changes: 3 additions & 2 deletions packages/clients/src/api/block/v1alpha1/marshalling.gen.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// This file was automatically generated. DO NOT EDIT.
// If you have any remark or suggestion do not hesitate to open an issue.
import randomName from '@scaleway/random-name'
import {
isJSONObject,
resolveOneOf,
Expand Down Expand Up @@ -190,7 +191,7 @@ export const marshalCreateSnapshotRequest = (
request: CreateSnapshotRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
name: request.name,
name: request.name || randomName('snp'),
project_id: request.projectId ?? defaults.defaultProjectId,
tags: request.tags,
volume_id: request.volumeId,
Expand All @@ -215,7 +216,7 @@ export const marshalCreateVolumeRequest = (
request: CreateVolumeRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
name: request.name,
name: request.name || randomName('vol'),
project_id: request.projectId ?? defaults.defaultProjectId,
tags: request.tags,
...resolveOneOf([
Expand Down
4 changes: 2 additions & 2 deletions packages/clients/src/api/block/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export type CreateSnapshotRequest = {
/** UUID of the volume to snapshot. */
volumeId: string
/** Name of the snapshot. */
name: string
name?: string
/** UUID of the project to which the volume and the snapshot belong. */
projectId?: string
/** List of tags assigned to the snapshot. */
Expand All @@ -202,7 +202,7 @@ export type CreateVolumeRequest = {
/** Zone to target. If none is passed will use default zone from the config. */
zone?: Zone
/** Name of the volume. */
name: string
name?: string
/**
* The maximum IO/s expected, according to the different options available in
* stock (`5000 | 15000`).
Expand Down

0 comments on commit aa34b25

Please sign in to comment.