File tree Expand file tree Collapse file tree 4 files changed +10
-8
lines changed
scaleway-async/scaleway_async/account/v2
scaleway/scaleway/account/v2 Expand file tree Collapse file tree 4 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 6
6
from scaleway_core .api import API
7
7
from scaleway_core .utils import (
8
8
fetch_all_pages_async ,
9
+ random_name ,
9
10
validate_path_param ,
10
11
)
11
12
from .types import (
@@ -34,7 +35,7 @@ class AccountV2API(API):
34
35
async def create_project (
35
36
self ,
36
37
* ,
37
- name : str ,
38
+ name : Optional [ str ] = None ,
38
39
organization_id : Optional [str ] = None ,
39
40
description : Optional [str ] = None ,
40
41
) -> Project :
@@ -49,15 +50,15 @@ async def create_project(
49
50
Usage:
50
51
::
51
52
52
- result = await api.create_project(name="example" )
53
+ result = await api.create_project()
53
54
"""
54
55
55
56
res = self ._request (
56
57
"POST" ,
57
58
f"/account/v2/projects" ,
58
59
body = marshal_CreateProjectRequest (
59
60
CreateProjectRequest (
60
- name = name ,
61
+ name = name or random_name ( prefix = "proj" ) ,
61
62
organization_id = organization_id ,
62
63
description = description ,
63
64
),
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ class Project:
74
74
75
75
@dataclass
76
76
class CreateProjectRequest :
77
- name : str
77
+ name : Optional [ str ]
78
78
"""
79
79
Name of the Project.
80
80
"""
Original file line number Diff line number Diff line change 6
6
from scaleway_core .api import API
7
7
from scaleway_core .utils import (
8
8
fetch_all_pages ,
9
+ random_name ,
9
10
validate_path_param ,
10
11
)
11
12
from .types import (
@@ -34,7 +35,7 @@ class AccountV2API(API):
34
35
def create_project (
35
36
self ,
36
37
* ,
37
- name : str ,
38
+ name : Optional [ str ] = None ,
38
39
organization_id : Optional [str ] = None ,
39
40
description : Optional [str ] = None ,
40
41
) -> Project :
@@ -49,15 +50,15 @@ def create_project(
49
50
Usage:
50
51
::
51
52
52
- result = api.create_project(name="example" )
53
+ result = api.create_project()
53
54
"""
54
55
55
56
res = self ._request (
56
57
"POST" ,
57
58
f"/account/v2/projects" ,
58
59
body = marshal_CreateProjectRequest (
59
60
CreateProjectRequest (
60
- name = name ,
61
+ name = name or random_name ( prefix = "proj" ) ,
61
62
organization_id = organization_id ,
62
63
description = description ,
63
64
),
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ class Project:
74
74
75
75
@dataclass
76
76
class CreateProjectRequest :
77
- name : str
77
+ name : Optional [ str ]
78
78
"""
79
79
Name of the Project.
80
80
"""
You can’t perform that action at this time.
0 commit comments