Skip to content

Commit aca3dfb

Browse files
feat(iam): add guest migration endpoint (scaleway#986)
Co-authored-by: Laure-di <[email protected]>
1 parent 643b00f commit aca3dfb

File tree

6 files changed

+72
-0
lines changed

6 files changed

+72
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
from .types import ListUsersResponse
9595
from .types import LockUserRequest
9696
from .types import MFAOTP
97+
from .types import MigrateOrganizationGuestsRequest
9798
from .types import OrganizationSecuritySettings
9899
from .types import RemoveGroupMemberRequest
99100
from .types import SetGroupMembersRequest
@@ -208,6 +209,7 @@
208209
"ListUsersResponse",
209210
"LockUserRequest",
210211
"MFAOTP",
212+
"MigrateOrganizationGuestsRequest",
211213
"OrganizationSecuritySettings",
212214
"RemoveGroupMemberRequest",
213215
"SetGroupMembersRequest",

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2826,3 +2826,29 @@ async def update_organization_security_settings(
28262826

28272827
self._throw_on_error(res)
28282828
return unmarshal_OrganizationSecuritySettings(res.json())
2829+
2830+
async def migrate_organization_guests(
2831+
self,
2832+
*,
2833+
organization_id: Optional[str] = None,
2834+
) -> None:
2835+
"""
2836+
Migrate the organization's guests to IAM members.
2837+
:param organization_id: ID of the Organization.
2838+
2839+
Usage:
2840+
::
2841+
2842+
result = await api.migrate_organization_guests()
2843+
"""
2844+
2845+
param_organization_id = validate_path_param(
2846+
"organization_id", organization_id or self.client.default_organization_id
2847+
)
2848+
2849+
res = self._request(
2850+
"POST",
2851+
f"/iam/v1alpha1/organizations/{param_organization_id}/migrate-guests",
2852+
)
2853+
2854+
self._throw_on_error(res)

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,6 +1906,14 @@ class MFAOTP:
19061906
secret: str
19071907

19081908

1909+
@dataclass
1910+
class MigrateOrganizationGuestsRequest:
1911+
organization_id: Optional[str]
1912+
"""
1913+
ID of the Organization.
1914+
"""
1915+
1916+
19091917
@dataclass
19101918
class OrganizationSecuritySettings:
19111919
enforce_password_renewal: bool

scaleway/scaleway/iam/v1alpha1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
from .types import ListUsersResponse
9595
from .types import LockUserRequest
9696
from .types import MFAOTP
97+
from .types import MigrateOrganizationGuestsRequest
9798
from .types import OrganizationSecuritySettings
9899
from .types import RemoveGroupMemberRequest
99100
from .types import SetGroupMembersRequest
@@ -208,6 +209,7 @@
208209
"ListUsersResponse",
209210
"LockUserRequest",
210211
"MFAOTP",
212+
"MigrateOrganizationGuestsRequest",
211213
"OrganizationSecuritySettings",
212214
"RemoveGroupMemberRequest",
213215
"SetGroupMembersRequest",

scaleway/scaleway/iam/v1alpha1/api.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2826,3 +2826,29 @@ def update_organization_security_settings(
28262826

28272827
self._throw_on_error(res)
28282828
return unmarshal_OrganizationSecuritySettings(res.json())
2829+
2830+
def migrate_organization_guests(
2831+
self,
2832+
*,
2833+
organization_id: Optional[str] = None,
2834+
) -> None:
2835+
"""
2836+
Migrate the organization's guests to IAM members.
2837+
:param organization_id: ID of the Organization.
2838+
2839+
Usage:
2840+
::
2841+
2842+
result = api.migrate_organization_guests()
2843+
"""
2844+
2845+
param_organization_id = validate_path_param(
2846+
"organization_id", organization_id or self.client.default_organization_id
2847+
)
2848+
2849+
res = self._request(
2850+
"POST",
2851+
f"/iam/v1alpha1/organizations/{param_organization_id}/migrate-guests",
2852+
)
2853+
2854+
self._throw_on_error(res)

scaleway/scaleway/iam/v1alpha1/types.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,6 +1906,14 @@ class MFAOTP:
19061906
secret: str
19071907

19081908

1909+
@dataclass
1910+
class MigrateOrganizationGuestsRequest:
1911+
organization_id: Optional[str]
1912+
"""
1913+
ID of the Organization.
1914+
"""
1915+
1916+
19091917
@dataclass
19101918
class OrganizationSecuritySettings:
19111919
enforce_password_renewal: bool

0 commit comments

Comments
 (0)