Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8e9285e

Browse files
committedNov 27, 2023
feat: v2
1 parent a358d46 commit 8e9285e

File tree

346 files changed

+84182
-69173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

346 files changed

+84182
-69173
lines changed
 
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
# This file was automatically generated. DO NOT EDIT.
22
# If you have any remark or suggestion do not hesitate to open an issue.
33
from .types import ListProjectsRequestOrderBy
4-
from .types import ListProjectsResponse
54
from .types import Project
5+
from .types import CreateProjectRequest
6+
from .types import DeleteProjectRequest
7+
from .types import GetProjectRequest
8+
from .types import ListProjectsRequest
9+
from .types import ListProjectsResponse
10+
from .types import UpdateProjectRequest
611
from .api import AccountV2API
712

813
__all__ = [
914
"ListProjectsRequestOrderBy",
10-
"ListProjectsResponse",
1115
"Project",
16+
"CreateProjectRequest",
17+
"DeleteProjectRequest",
18+
"GetProjectRequest",
19+
"ListProjectsRequest",
20+
"ListProjectsResponse",
21+
"UpdateProjectRequest",
1222
"AccountV2API",
1323
]

‎scaleway-async/scaleway_async/account/v2/api.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,27 @@
55

66
from scaleway_core.api import API
77
from scaleway_core.utils import (
8-
fetch_all_pages_async,
98
random_name,
109
validate_path_param,
10+
fetch_all_pages_async,
1111
)
1212
from .types import (
1313
ListProjectsRequestOrderBy,
14+
CreateProjectRequest,
1415
ListProjectsResponse,
1516
Project,
16-
CreateProjectRequest,
1717
UpdateProjectRequest,
1818
)
1919
from .marshalling import (
20-
marshal_CreateProjectRequest,
21-
marshal_UpdateProjectRequest,
2220
unmarshal_Project,
2321
unmarshal_ListProjectsResponse,
22+
marshal_CreateProjectRequest,
23+
marshal_UpdateProjectRequest,
2424
)
2525

2626

2727
class AccountV2API(API):
2828
"""
29-
Account API.
30-
31-
User related data.
3229
This API allows you to manage projects.
3330
"""
3431

@@ -57,7 +54,7 @@ async def create_project(
5754

5855
res = self._request(
5956
"POST",
60-
f"/account/v2/projects",
57+
"/account/v2/projects",
6158
body=marshal_CreateProjectRequest(
6259
CreateProjectRequest(
6360
name=name or random_name(prefix="proj"),
@@ -78,7 +75,7 @@ async def list_projects(
7875
name: Optional[str] = None,
7976
page: Optional[int] = None,
8077
page_size: Optional[int] = None,
81-
order_by: ListProjectsRequestOrderBy = ListProjectsRequestOrderBy.CREATED_AT_ASC,
78+
order_by: Optional[ListProjectsRequestOrderBy] = None,
8279
project_ids: Optional[List[str]] = None,
8380
) -> ListProjectsResponse:
8481
"""
@@ -102,7 +99,7 @@ async def list_projects(
10299

103100
res = self._request(
104101
"GET",
105-
f"/account/v2/projects",
102+
"/account/v2/projects",
106103
params={
107104
"name": name,
108105
"order_by": order_by,
@@ -137,7 +134,7 @@ async def list_projects_all(
137134
:param page_size: Maximum number of Project per page.
138135
:param order_by: Sort order of the returned Projects.
139136
:param project_ids: Project IDs to filter for. The results will be limited to any Projects with an ID in this array.
140-
:return: :class:`List[ListProjectsResponse] <List[ListProjectsResponse]>`
137+
:return: :class:`List[Project] <List[Project]>`
141138
:deprecated
142139
143140
Usage:
@@ -195,7 +192,7 @@ async def delete_project(
195192
self,
196193
*,
197194
project_id: Optional[str] = None,
198-
) -> Optional[None]:
195+
) -> None:
199196
"""
200197
Delete an existing Project.
201198
Deprecated in favor of Account API v3.
@@ -219,7 +216,6 @@ async def delete_project(
219216
)
220217

221218
self._throw_on_error(res)
222-
return None
223219

224220
async def update_project(
225221
self,

0 commit comments

Comments
 (0)
Please sign in to comment.