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 66from scaleway_core .api import API
77from scaleway_core .utils import (
88 fetch_all_pages_async ,
9+ random_name ,
910 validate_path_param ,
1011)
1112from .types import (
@@ -34,7 +35,7 @@ class AccountV2API(API):
3435 async def create_project (
3536 self ,
3637 * ,
37- name : str ,
38+ name : Optional [ str ] = None ,
3839 organization_id : Optional [str ] = None ,
3940 description : Optional [str ] = None ,
4041 ) -> Project :
@@ -49,15 +50,15 @@ async def create_project(
4950 Usage:
5051 ::
5152
52- result = await api.create_project(name="example" )
53+ result = await api.create_project()
5354 """
5455
5556 res = self ._request (
5657 "POST" ,
5758 f"/account/v2/projects" ,
5859 body = marshal_CreateProjectRequest (
5960 CreateProjectRequest (
60- name = name ,
61+ name = name or random_name ( prefix = "proj" ) ,
6162 organization_id = organization_id ,
6263 description = description ,
6364 ),
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ class Project:
7474
7575@dataclass
7676class CreateProjectRequest :
77- name : str
77+ name : Optional [ str ]
7878 """
7979 Name of the Project.
8080 """
Original file line number Diff line number Diff line change 66from scaleway_core .api import API
77from scaleway_core .utils import (
88 fetch_all_pages ,
9+ random_name ,
910 validate_path_param ,
1011)
1112from .types import (
@@ -34,7 +35,7 @@ class AccountV2API(API):
3435 def create_project (
3536 self ,
3637 * ,
37- name : str ,
38+ name : Optional [ str ] = None ,
3839 organization_id : Optional [str ] = None ,
3940 description : Optional [str ] = None ,
4041 ) -> Project :
@@ -49,15 +50,15 @@ def create_project(
4950 Usage:
5051 ::
5152
52- result = api.create_project(name="example" )
53+ result = api.create_project()
5354 """
5455
5556 res = self ._request (
5657 "POST" ,
5758 f"/account/v2/projects" ,
5859 body = marshal_CreateProjectRequest (
5960 CreateProjectRequest (
60- name = name ,
61+ name = name or random_name ( prefix = "proj" ) ,
6162 organization_id = organization_id ,
6263 description = description ,
6364 ),
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ class Project:
7474
7575@dataclass
7676class CreateProjectRequest :
77- name : str
77+ name : Optional [ str ]
7878 """
7979 Name of the Project.
8080 """
You can’t perform that action at this time.
0 commit comments