Skip to content

Commit aa34b25

Browse files
feat(block): improve arguments configuration (#1576)
Co-authored-by: Jules Castéran <jcasteran@scaleway.com>
1 parent cbd4509 commit aa34b25

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export class API extends ParentAPI {
143143
* @param request - The request {@link CreateVolumeRequest}
144144
* @returns A Promise of Volume
145145
*/
146-
createVolume = (request: Readonly<CreateVolumeRequest>) =>
146+
createVolume = (request: Readonly<CreateVolumeRequest> = {}) =>
147147
this.client.fetch<Volume>(
148148
{
149149
body: JSON.stringify(

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// This file was automatically generated. DO NOT EDIT.
22
// If you have any remark or suggestion do not hesitate to open an issue.
3+
import randomName from '@scaleway/random-name'
34
import {
45
isJSONObject,
56
resolveOneOf,
@@ -190,7 +191,7 @@ export const marshalCreateSnapshotRequest = (
190191
request: CreateSnapshotRequest,
191192
defaults: DefaultValues,
192193
): Record<string, unknown> => ({
193-
name: request.name,
194+
name: request.name || randomName('snp'),
194195
project_id: request.projectId ?? defaults.defaultProjectId,
195196
tags: request.tags,
196197
volume_id: request.volumeId,
@@ -215,7 +216,7 @@ export const marshalCreateVolumeRequest = (
215216
request: CreateVolumeRequest,
216217
defaults: DefaultValues,
217218
): Record<string, unknown> => ({
218-
name: request.name,
219+
name: request.name || randomName('vol'),
219220
project_id: request.projectId ?? defaults.defaultProjectId,
220221
tags: request.tags,
221222
...resolveOneOf([

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export type CreateSnapshotRequest = {
191191
/** UUID of the volume to snapshot. */
192192
volumeId: string
193193
/** Name of the snapshot. */
194-
name: string
194+
name?: string
195195
/** UUID of the project to which the volume and the snapshot belong. */
196196
projectId?: string
197197
/** List of tags assigned to the snapshot. */
@@ -202,7 +202,7 @@ export type CreateVolumeRequest = {
202202
/** Zone to target. If none is passed will use default zone from the config. */
203203
zone?: Zone
204204
/** Name of the volume. */
205-
name: string
205+
name?: string
206206
/**
207207
* The maximum IO/s expected, according to the different options available in
208208
* stock (`5000 | 15000`).

0 commit comments

Comments
 (0)