Skip to content

Commit 16d36f3

Browse files
committed
feat: update generated APIs
1 parent ae4c257 commit 16d36f3

File tree

6 files changed

+24
-18
lines changed

6 files changed

+24
-18
lines changed

scaleway-async/scaleway_async/mongodb/v1alpha1/api.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,16 +1077,16 @@ async def create_user(
10771077
*,
10781078
instance_id: str,
10791079
name: str,
1080+
password: str,
10801081
region: Optional[Region] = None,
1081-
password: Optional[str] = None,
10821082
) -> User:
10831083
"""
10841084
Create an user on a Database Instance.
10851085
Create an user on a Database Instance. You must define the `name`, `password` of the user and `instance_id` parameters in the request.
10861086
:param instance_id: UUID of the Database Instance the user belongs to.
10871087
:param name: Name of the database user.
1088-
:param region: Region to target. If none is passed will use default region from the config.
10891088
:param password: Password of the database user.
1089+
:param region: Region to target. If none is passed will use default region from the config.
10901090
:return: :class:`User <User>`
10911091
10921092
Usage:
@@ -1095,24 +1095,24 @@ async def create_user(
10951095
result = await api.create_user(
10961096
instance_id="example",
10971097
name="example",
1098+
password="example",
10981099
)
10991100
"""
11001101

11011102
param_region = validate_path_param(
11021103
"region", region or self.client.default_region
11031104
)
11041105
param_instance_id = validate_path_param("instance_id", instance_id)
1105-
param_name = validate_path_param("name", name)
11061106

11071107
res = self._request(
11081108
"POST",
1109-
f"/mongodb/v1alpha1/regions/{param_region}/instances/{param_instance_id}/users/{param_name}",
1109+
f"/mongodb/v1alpha1/regions/{param_region}/instances/{param_instance_id}/users",
11101110
body=marshal_CreateUserRequest(
11111111
CreateUserRequest(
11121112
instance_id=instance_id,
11131113
name=name,
1114-
region=region,
11151114
password=password,
1115+
region=region,
11161116
),
11171117
self.client,
11181118
),

scaleway-async/scaleway_async/mongodb/v1alpha1/marshalling.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,9 @@ def marshal_CreateUserRequest(
715715
) -> Dict[str, Any]:
716716
output: Dict[str, Any] = {}
717717

718+
if request.name is not None:
719+
output["name"] = request.name
720+
718721
if request.password is not None:
719722
output["password"] = request.password
720723

scaleway-async/scaleway_async/mongodb/v1alpha1/types.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -604,14 +604,14 @@ class CreateUserRequest:
604604
Name of the database user.
605605
"""
606606

607-
region: Optional[Region]
607+
password: str
608608
"""
609-
Region to target. If none is passed will use default region from the config.
609+
Password of the database user.
610610
"""
611611

612-
password: Optional[str]
612+
region: Optional[Region]
613613
"""
614-
Password of the database user.
614+
Region to target. If none is passed will use default region from the config.
615615
"""
616616

617617

scaleway/scaleway/mongodb/v1alpha1/api.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,16 +1073,16 @@ def create_user(
10731073
*,
10741074
instance_id: str,
10751075
name: str,
1076+
password: str,
10761077
region: Optional[Region] = None,
1077-
password: Optional[str] = None,
10781078
) -> User:
10791079
"""
10801080
Create an user on a Database Instance.
10811081
Create an user on a Database Instance. You must define the `name`, `password` of the user and `instance_id` parameters in the request.
10821082
:param instance_id: UUID of the Database Instance the user belongs to.
10831083
:param name: Name of the database user.
1084-
:param region: Region to target. If none is passed will use default region from the config.
10851084
:param password: Password of the database user.
1085+
:param region: Region to target. If none is passed will use default region from the config.
10861086
:return: :class:`User <User>`
10871087
10881088
Usage:
@@ -1091,24 +1091,24 @@ def create_user(
10911091
result = api.create_user(
10921092
instance_id="example",
10931093
name="example",
1094+
password="example",
10941095
)
10951096
"""
10961097

10971098
param_region = validate_path_param(
10981099
"region", region or self.client.default_region
10991100
)
11001101
param_instance_id = validate_path_param("instance_id", instance_id)
1101-
param_name = validate_path_param("name", name)
11021102

11031103
res = self._request(
11041104
"POST",
1105-
f"/mongodb/v1alpha1/regions/{param_region}/instances/{param_instance_id}/users/{param_name}",
1105+
f"/mongodb/v1alpha1/regions/{param_region}/instances/{param_instance_id}/users",
11061106
body=marshal_CreateUserRequest(
11071107
CreateUserRequest(
11081108
instance_id=instance_id,
11091109
name=name,
1110-
region=region,
11111110
password=password,
1111+
region=region,
11121112
),
11131113
self.client,
11141114
),

scaleway/scaleway/mongodb/v1alpha1/marshalling.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,9 @@ def marshal_CreateUserRequest(
715715
) -> Dict[str, Any]:
716716
output: Dict[str, Any] = {}
717717

718+
if request.name is not None:
719+
output["name"] = request.name
720+
718721
if request.password is not None:
719722
output["password"] = request.password
720723

scaleway/scaleway/mongodb/v1alpha1/types.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -604,14 +604,14 @@ class CreateUserRequest:
604604
Name of the database user.
605605
"""
606606

607-
region: Optional[Region]
607+
password: str
608608
"""
609-
Region to target. If none is passed will use default region from the config.
609+
Password of the database user.
610610
"""
611611

612-
password: Optional[str]
612+
region: Optional[Region]
613613
"""
614-
Password of the database user.
614+
Region to target. If none is passed will use default region from the config.
615615
"""
616616

617617

0 commit comments

Comments
 (0)