Skip to content

Commit

Permalink
feat: update generated APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot committed Dec 27, 2024
1 parent dff7dc2 commit d93e748
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scaleway-async/scaleway_async/mongodb/v1alpha1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from .types import DeleteEndpointRequest
from .types import DeleteInstanceRequest
from .types import DeleteSnapshotRequest
from .types import DeleteUserRequest
from .types import GetInstanceCertificateRequest
from .types import GetInstanceRequest
from .types import GetSnapshotRequest
Expand Down Expand Up @@ -91,6 +92,7 @@
"DeleteEndpointRequest",
"DeleteInstanceRequest",
"DeleteSnapshotRequest",
"DeleteUserRequest",
"GetInstanceCertificateRequest",
"GetInstanceRequest",
"GetSnapshotRequest",
Expand Down
37 changes: 37 additions & 0 deletions scaleway-async/scaleway_async/mongodb/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,43 @@ async def update_user(
self._throw_on_error(res)
return unmarshal_User(res.json())

async def delete_user(
self,
*,
instance_id: str,
name: str,
region: Optional[Region] = None,
) -> None:
"""
Delete a user on a Database Instance.
Delete an existing user on a Database Instance.
: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.
Usage:
::
result = await api.delete_user(
instance_id="example",
name="example",
)
"""

param_region = validate_path_param(
"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(
"DELETE",
f"/mongodb/v1alpha1/regions/{param_region}/instances/{param_instance_id}/users/{param_name}",
body={},
)

self._throw_on_error(res)

async def delete_endpoint(
self,
*,
Expand Down
18 changes: 18 additions & 0 deletions scaleway-async/scaleway_async/mongodb/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,24 @@ class DeleteSnapshotRequest:
"""


@dataclass
class DeleteUserRequest:
instance_id: str
"""
UUID of the Database Instance the user belongs to.
"""

name: str
"""
Name of the database user.
"""

region: Optional[Region]
"""
Region to target. If none is passed will use default region from the config.
"""


@dataclass
class GetInstanceCertificateRequest:
instance_id: str
Expand Down
2 changes: 2 additions & 0 deletions scaleway/scaleway/mongodb/v1alpha1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from .types import DeleteEndpointRequest
from .types import DeleteInstanceRequest
from .types import DeleteSnapshotRequest
from .types import DeleteUserRequest
from .types import GetInstanceCertificateRequest
from .types import GetInstanceRequest
from .types import GetSnapshotRequest
Expand Down Expand Up @@ -91,6 +92,7 @@
"DeleteEndpointRequest",
"DeleteInstanceRequest",
"DeleteSnapshotRequest",
"DeleteUserRequest",
"GetInstanceCertificateRequest",
"GetInstanceRequest",
"GetSnapshotRequest",
Expand Down
37 changes: 37 additions & 0 deletions scaleway/scaleway/mongodb/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,43 @@ def update_user(
self._throw_on_error(res)
return unmarshal_User(res.json())

def delete_user(
self,
*,
instance_id: str,
name: str,
region: Optional[Region] = None,
) -> None:
"""
Delete a user on a Database Instance.
Delete an existing user on a Database Instance.
: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.
Usage:
::
result = api.delete_user(
instance_id="example",
name="example",
)
"""

param_region = validate_path_param(
"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(
"DELETE",
f"/mongodb/v1alpha1/regions/{param_region}/instances/{param_instance_id}/users/{param_name}",
body={},
)

self._throw_on_error(res)

def delete_endpoint(
self,
*,
Expand Down
18 changes: 18 additions & 0 deletions scaleway/scaleway/mongodb/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,24 @@ class DeleteSnapshotRequest:
"""


@dataclass
class DeleteUserRequest:
instance_id: str
"""
UUID of the Database Instance the user belongs to.
"""

name: str
"""
Name of the database user.
"""

region: Optional[Region]
"""
Region to target. If none is passed will use default region from the config.
"""


@dataclass
class GetInstanceCertificateRequest:
instance_id: str
Expand Down

0 comments on commit d93e748

Please sign in to comment.