File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
packages/clients/src/api/block/v1alpha1 Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff 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 (
Original file line number Diff line number Diff line change 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'
34import {
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 ( [
Original file line number Diff line number Diff 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`).
You can’t perform that action at this time.
0 commit comments