Skip to content

Commit c75d638

Browse files
authored
feat(account/v2): default generated project name (#636)
1 parent 9e5e444 commit c75d638

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

packages/clients/src/api/account/v2/api.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class API extends ParentAPI {
3939
* @param request - The request {@link CreateProjectRequest}
4040
* @returns A Promise of Project
4141
*/
42-
createProject = (request: Readonly<CreateProjectRequest>) =>
42+
createProject = (request: Readonly<CreateProjectRequest> = {}) =>
4343
this.client.fetch<Project>(
4444
{
4545
body: JSON.stringify(

packages/clients/src/api/account/v2/marshalling.gen.ts

Lines changed: 2 additions & 1 deletion
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
unmarshalArrayOfObject,
@@ -48,7 +49,7 @@ export const marshalCreateProjectRequest = (
4849
defaults: DefaultValues,
4950
): Record<string, unknown> => ({
5051
description: request.description,
51-
name: request.name,
52+
name: request.name || randomName('proj'),
5253
organization_id: request.organizationId ?? defaults.defaultOrganizationId,
5354
})
5455

packages/clients/src/api/account/v2/types.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export interface Project {
3333

3434
export type CreateProjectRequest = {
3535
/** Name of the Project. */
36-
name: string
36+
name?: string
3737
/** Organization ID of the Project. */
3838
organizationId?: string
3939
/** Description of the Project. */

0 commit comments

Comments
 (0)