Skip to content

Commit ff434e2

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

File tree

6 files changed

+172
-6
lines changed

6 files changed

+172
-6
lines changed

scaleway-async/scaleway_async/iam/v1alpha1/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,12 @@
7878
from .types import ListSSHKeysResponse
7979
from .types import ListUsersRequest
8080
from .types import ListUsersResponse
81+
from .types import LockUserRequest
8182
from .types import RemoveGroupMemberRequest
8283
from .types import SetGroupMembersRequest
8384
from .types import SetRulesRequest
8485
from .types import SetRulesResponse
86+
from .types import UnlockUserRequest
8587
from .types import UpdateAPIKeyRequest
8688
from .types import UpdateApplicationRequest
8789
from .types import UpdateGroupRequest
@@ -170,10 +172,12 @@
170172
"ListSSHKeysResponse",
171173
"ListUsersRequest",
172174
"ListUsersResponse",
175+
"LockUserRequest",
173176
"RemoveGroupMemberRequest",
174177
"SetGroupMembersRequest",
175178
"SetRulesRequest",
176179
"SetRulesResponse",
180+
"UnlockUserRequest",
177181
"UpdateAPIKeyRequest",
178182
"UpdateApplicationRequest",
179183
"UpdateGroupRequest",

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

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,9 +584,10 @@ async def update_user_password(
584584
send_email: bool,
585585
) -> User:
586586
"""
587-
:param user_id:
588-
:param password:
589-
:param send_email:
587+
Update an user's password.
588+
:param user_id: ID of the user to update.
589+
:param password: The new password.
590+
:param send_email: Whether or not to send an email alerting the user their password has changed.
590591
:return: :class:`User <User>`
591592
592593
Usage:
@@ -617,6 +618,65 @@ async def update_user_password(
617618
self._throw_on_error(res)
618619
return unmarshal_User(res.json())
619620

621+
async def lock_user(
622+
self,
623+
*,
624+
user_id: str,
625+
) -> User:
626+
"""
627+
Lock a user.
628+
Lock a user. Note that a locked user cannot log in or use API keys until the locked status is removed.
629+
:param user_id:
630+
:return: :class:`User <User>`
631+
632+
Usage:
633+
::
634+
635+
result = await api.lock_user(
636+
user_id="example",
637+
)
638+
"""
639+
640+
param_user_id = validate_path_param("user_id", user_id)
641+
642+
res = self._request(
643+
"POST",
644+
f"/iam/v1alpha1/users/{param_user_id}/lock",
645+
body={},
646+
)
647+
648+
self._throw_on_error(res)
649+
return unmarshal_User(res.json())
650+
651+
async def unlock_user(
652+
self,
653+
*,
654+
user_id: str,
655+
) -> User:
656+
"""
657+
Unlock a user.
658+
:param user_id:
659+
:return: :class:`User <User>`
660+
661+
Usage:
662+
::
663+
664+
result = await api.unlock_user(
665+
user_id="example",
666+
)
667+
"""
668+
669+
param_user_id = validate_path_param("user_id", user_id)
670+
671+
res = self._request(
672+
"POST",
673+
f"/iam/v1alpha1/users/{param_user_id}/unlock",
674+
body={},
675+
)
676+
677+
self._throw_on_error(res)
678+
return unmarshal_User(res.json())
679+
620680
async def list_applications(
621681
self,
622682
*,

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,6 +1691,11 @@ class ListUsersResponse:
16911691
"""
16921692

16931693

1694+
@dataclass
1695+
class LockUserRequest:
1696+
user_id: str
1697+
1698+
16941699
@dataclass
16951700
class RemoveGroupMemberRequest:
16961701
group_id: str
@@ -1733,6 +1738,11 @@ class SetRulesResponse:
17331738
"""
17341739

17351740

1741+
@dataclass
1742+
class UnlockUserRequest:
1743+
user_id: str
1744+
1745+
17361746
@dataclass
17371747
class UpdateAPIKeyRequest:
17381748
access_key: str
@@ -1846,10 +1856,19 @@ class UpdateSSHKeyRequest:
18461856
@dataclass
18471857
class UpdateUserPasswordRequest:
18481858
user_id: str
1859+
"""
1860+
ID of the user to update.
1861+
"""
18491862

18501863
password: str
1864+
"""
1865+
The new password.
1866+
"""
18511867

18521868
send_email: bool
1869+
"""
1870+
Whether or not to send an email alerting the user their password has changed.
1871+
"""
18531872

18541873

18551874
@dataclass

scaleway/scaleway/iam/v1alpha1/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,12 @@
7878
from .types import ListSSHKeysResponse
7979
from .types import ListUsersRequest
8080
from .types import ListUsersResponse
81+
from .types import LockUserRequest
8182
from .types import RemoveGroupMemberRequest
8283
from .types import SetGroupMembersRequest
8384
from .types import SetRulesRequest
8485
from .types import SetRulesResponse
86+
from .types import UnlockUserRequest
8587
from .types import UpdateAPIKeyRequest
8688
from .types import UpdateApplicationRequest
8789
from .types import UpdateGroupRequest
@@ -170,10 +172,12 @@
170172
"ListSSHKeysResponse",
171173
"ListUsersRequest",
172174
"ListUsersResponse",
175+
"LockUserRequest",
173176
"RemoveGroupMemberRequest",
174177
"SetGroupMembersRequest",
175178
"SetRulesRequest",
176179
"SetRulesResponse",
180+
"UnlockUserRequest",
177181
"UpdateAPIKeyRequest",
178182
"UpdateApplicationRequest",
179183
"UpdateGroupRequest",

scaleway/scaleway/iam/v1alpha1/api.py

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,9 +584,10 @@ def update_user_password(
584584
send_email: bool,
585585
) -> User:
586586
"""
587-
:param user_id:
588-
:param password:
589-
:param send_email:
587+
Update an user's password.
588+
:param user_id: ID of the user to update.
589+
:param password: The new password.
590+
:param send_email: Whether or not to send an email alerting the user their password has changed.
590591
:return: :class:`User <User>`
591592
592593
Usage:
@@ -617,6 +618,65 @@ def update_user_password(
617618
self._throw_on_error(res)
618619
return unmarshal_User(res.json())
619620

621+
def lock_user(
622+
self,
623+
*,
624+
user_id: str,
625+
) -> User:
626+
"""
627+
Lock a user.
628+
Lock a user. Note that a locked user cannot log in or use API keys until the locked status is removed.
629+
:param user_id:
630+
:return: :class:`User <User>`
631+
632+
Usage:
633+
::
634+
635+
result = api.lock_user(
636+
user_id="example",
637+
)
638+
"""
639+
640+
param_user_id = validate_path_param("user_id", user_id)
641+
642+
res = self._request(
643+
"POST",
644+
f"/iam/v1alpha1/users/{param_user_id}/lock",
645+
body={},
646+
)
647+
648+
self._throw_on_error(res)
649+
return unmarshal_User(res.json())
650+
651+
def unlock_user(
652+
self,
653+
*,
654+
user_id: str,
655+
) -> User:
656+
"""
657+
Unlock a user.
658+
:param user_id:
659+
:return: :class:`User <User>`
660+
661+
Usage:
662+
::
663+
664+
result = api.unlock_user(
665+
user_id="example",
666+
)
667+
"""
668+
669+
param_user_id = validate_path_param("user_id", user_id)
670+
671+
res = self._request(
672+
"POST",
673+
f"/iam/v1alpha1/users/{param_user_id}/unlock",
674+
body={},
675+
)
676+
677+
self._throw_on_error(res)
678+
return unmarshal_User(res.json())
679+
620680
def list_applications(
621681
self,
622682
*,

scaleway/scaleway/iam/v1alpha1/types.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,6 +1691,11 @@ class ListUsersResponse:
16911691
"""
16921692

16931693

1694+
@dataclass
1695+
class LockUserRequest:
1696+
user_id: str
1697+
1698+
16941699
@dataclass
16951700
class RemoveGroupMemberRequest:
16961701
group_id: str
@@ -1733,6 +1738,11 @@ class SetRulesResponse:
17331738
"""
17341739

17351740

1741+
@dataclass
1742+
class UnlockUserRequest:
1743+
user_id: str
1744+
1745+
17361746
@dataclass
17371747
class UpdateAPIKeyRequest:
17381748
access_key: str
@@ -1846,10 +1856,19 @@ class UpdateSSHKeyRequest:
18461856
@dataclass
18471857
class UpdateUserPasswordRequest:
18481858
user_id: str
1859+
"""
1860+
ID of the user to update.
1861+
"""
18491862

18501863
password: str
1864+
"""
1865+
The new password.
1866+
"""
18511867

18521868
send_email: bool
1869+
"""
1870+
Whether or not to send an email alerting the user their password has changed.
1871+
"""
18531872

18541873

18551874
@dataclass

0 commit comments

Comments
 (0)