From 16d36f33a540c2a3beea740e43b1bff679392eae Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Thu, 31 Oct 2024 15:18:51 +0000 Subject: [PATCH] feat: update generated APIs --- scaleway-async/scaleway_async/mongodb/v1alpha1/api.py | 10 +++++----- .../scaleway_async/mongodb/v1alpha1/marshalling.py | 3 +++ .../scaleway_async/mongodb/v1alpha1/types.py | 8 ++++---- scaleway/scaleway/mongodb/v1alpha1/api.py | 10 +++++----- scaleway/scaleway/mongodb/v1alpha1/marshalling.py | 3 +++ scaleway/scaleway/mongodb/v1alpha1/types.py | 8 ++++---- 6 files changed, 24 insertions(+), 18 deletions(-) diff --git a/scaleway-async/scaleway_async/mongodb/v1alpha1/api.py b/scaleway-async/scaleway_async/mongodb/v1alpha1/api.py index 78883abbf..980843a92 100644 --- a/scaleway-async/scaleway_async/mongodb/v1alpha1/api.py +++ b/scaleway-async/scaleway_async/mongodb/v1alpha1/api.py @@ -1077,16 +1077,16 @@ async def create_user( *, instance_id: str, name: str, + password: str, region: Optional[Region] = None, - password: Optional[str] = None, ) -> User: """ Create an user on a Database Instance. Create an user on a Database Instance. You must define the `name`, `password` of the user and `instance_id` parameters in the request. :param instance_id: UUID of the Database Instance the user belongs to. :param name: Name of the database user. - :param region: Region to target. If none is passed will use default region from the config. :param password: Password of the database user. + :param region: Region to target. If none is passed will use default region from the config. :return: :class:`User ` Usage: @@ -1095,6 +1095,7 @@ async def create_user( result = await api.create_user( instance_id="example", name="example", + password="example", ) """ @@ -1102,17 +1103,16 @@ async def create_user( "region", region or self.client.default_region ) param_instance_id = validate_path_param("instance_id", instance_id) - param_name = validate_path_param("name", name) res = self._request( "POST", - f"/mongodb/v1alpha1/regions/{param_region}/instances/{param_instance_id}/users/{param_name}", + f"/mongodb/v1alpha1/regions/{param_region}/instances/{param_instance_id}/users", body=marshal_CreateUserRequest( CreateUserRequest( instance_id=instance_id, name=name, - region=region, password=password, + region=region, ), self.client, ), diff --git a/scaleway-async/scaleway_async/mongodb/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/mongodb/v1alpha1/marshalling.py index a59cdf460..01055557c 100644 --- a/scaleway-async/scaleway_async/mongodb/v1alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/mongodb/v1alpha1/marshalling.py @@ -715,6 +715,9 @@ def marshal_CreateUserRequest( ) -> Dict[str, Any]: output: Dict[str, Any] = {} + if request.name is not None: + output["name"] = request.name + if request.password is not None: output["password"] = request.password diff --git a/scaleway-async/scaleway_async/mongodb/v1alpha1/types.py b/scaleway-async/scaleway_async/mongodb/v1alpha1/types.py index fec93e393..9fd17e352 100644 --- a/scaleway-async/scaleway_async/mongodb/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/mongodb/v1alpha1/types.py @@ -604,14 +604,14 @@ class CreateUserRequest: Name of the database user. """ - region: Optional[Region] + password: str """ - Region to target. If none is passed will use default region from the config. + Password of the database user. """ - password: Optional[str] + region: Optional[Region] """ - Password of the database user. + Region to target. If none is passed will use default region from the config. """ diff --git a/scaleway/scaleway/mongodb/v1alpha1/api.py b/scaleway/scaleway/mongodb/v1alpha1/api.py index 15577d853..dfb7c6236 100644 --- a/scaleway/scaleway/mongodb/v1alpha1/api.py +++ b/scaleway/scaleway/mongodb/v1alpha1/api.py @@ -1073,16 +1073,16 @@ def create_user( *, instance_id: str, name: str, + password: str, region: Optional[Region] = None, - password: Optional[str] = None, ) -> User: """ Create an user on a Database Instance. Create an user on a Database Instance. You must define the `name`, `password` of the user and `instance_id` parameters in the request. :param instance_id: UUID of the Database Instance the user belongs to. :param name: Name of the database user. - :param region: Region to target. If none is passed will use default region from the config. :param password: Password of the database user. + :param region: Region to target. If none is passed will use default region from the config. :return: :class:`User ` Usage: @@ -1091,6 +1091,7 @@ def create_user( result = api.create_user( instance_id="example", name="example", + password="example", ) """ @@ -1098,17 +1099,16 @@ def create_user( "region", region or self.client.default_region ) param_instance_id = validate_path_param("instance_id", instance_id) - param_name = validate_path_param("name", name) res = self._request( "POST", - f"/mongodb/v1alpha1/regions/{param_region}/instances/{param_instance_id}/users/{param_name}", + f"/mongodb/v1alpha1/regions/{param_region}/instances/{param_instance_id}/users", body=marshal_CreateUserRequest( CreateUserRequest( instance_id=instance_id, name=name, - region=region, password=password, + region=region, ), self.client, ), diff --git a/scaleway/scaleway/mongodb/v1alpha1/marshalling.py b/scaleway/scaleway/mongodb/v1alpha1/marshalling.py index a59cdf460..01055557c 100644 --- a/scaleway/scaleway/mongodb/v1alpha1/marshalling.py +++ b/scaleway/scaleway/mongodb/v1alpha1/marshalling.py @@ -715,6 +715,9 @@ def marshal_CreateUserRequest( ) -> Dict[str, Any]: output: Dict[str, Any] = {} + if request.name is not None: + output["name"] = request.name + if request.password is not None: output["password"] = request.password diff --git a/scaleway/scaleway/mongodb/v1alpha1/types.py b/scaleway/scaleway/mongodb/v1alpha1/types.py index fec93e393..9fd17e352 100644 --- a/scaleway/scaleway/mongodb/v1alpha1/types.py +++ b/scaleway/scaleway/mongodb/v1alpha1/types.py @@ -604,14 +604,14 @@ class CreateUserRequest: Name of the database user. """ - region: Optional[Region] + password: str """ - Region to target. If none is passed will use default region from the config. + Password of the database user. """ - password: Optional[str] + region: Optional[Region] """ - Password of the database user. + Region to target. If none is passed will use default region from the config. """