From aa34b256c86d21e27737ad460939a9c5462ea9e8 Mon Sep 17 00:00:00 2001 From: Scaleway Bot Date: Mon, 18 Nov 2024 10:38:25 +0100 Subject: [PATCH] feat(block): improve arguments configuration (#1576) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jules Castéran --- packages/clients/src/api/block/v1alpha1/api.gen.ts | 2 +- packages/clients/src/api/block/v1alpha1/marshalling.gen.ts | 5 +++-- packages/clients/src/api/block/v1alpha1/types.gen.ts | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/clients/src/api/block/v1alpha1/api.gen.ts b/packages/clients/src/api/block/v1alpha1/api.gen.ts index 8483f75da..f9091162f 100644 --- a/packages/clients/src/api/block/v1alpha1/api.gen.ts +++ b/packages/clients/src/api/block/v1alpha1/api.gen.ts @@ -143,7 +143,7 @@ export class API extends ParentAPI { * @param request - The request {@link CreateVolumeRequest} * @returns A Promise of Volume */ - createVolume = (request: Readonly) => + createVolume = (request: Readonly = {}) => this.client.fetch( { body: JSON.stringify( diff --git a/packages/clients/src/api/block/v1alpha1/marshalling.gen.ts b/packages/clients/src/api/block/v1alpha1/marshalling.gen.ts index 6f2108dee..3aff55dec 100644 --- a/packages/clients/src/api/block/v1alpha1/marshalling.gen.ts +++ b/packages/clients/src/api/block/v1alpha1/marshalling.gen.ts @@ -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, @@ -190,7 +191,7 @@ export const marshalCreateSnapshotRequest = ( request: CreateSnapshotRequest, defaults: DefaultValues, ): Record => ({ - name: request.name, + name: request.name || randomName('snp'), project_id: request.projectId ?? defaults.defaultProjectId, tags: request.tags, volume_id: request.volumeId, @@ -215,7 +216,7 @@ export const marshalCreateVolumeRequest = ( request: CreateVolumeRequest, defaults: DefaultValues, ): Record => ({ - name: request.name, + name: request.name || randomName('vol'), project_id: request.projectId ?? defaults.defaultProjectId, tags: request.tags, ...resolveOneOf([ diff --git a/packages/clients/src/api/block/v1alpha1/types.gen.ts b/packages/clients/src/api/block/v1alpha1/types.gen.ts index 04752066e..2ca7ac020 100644 --- a/packages/clients/src/api/block/v1alpha1/types.gen.ts +++ b/packages/clients/src/api/block/v1alpha1/types.gen.ts @@ -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. */ @@ -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`).