From 35863a669e62715f42dca39dcf8f75c56893cba7 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Fri, 17 Oct 2025 10:29:12 +0000 Subject: [PATCH] feat: update generated APIs --- .../scaleway_async/iam/v1alpha1/__init__.py | 2 - .../scaleway_async/iam/v1alpha1/api.py | 44 +++++-------------- .../iam/v1alpha1/marshalling.py | 22 ++++++++++ .../scaleway_async/iam/v1alpha1/types.py | 8 ---- scaleway/scaleway/iam/v1alpha1/__init__.py | 2 - scaleway/scaleway/iam/v1alpha1/api.py | 44 +++++-------------- scaleway/scaleway/iam/v1alpha1/marshalling.py | 22 ++++++++++ scaleway/scaleway/iam/v1alpha1/types.py | 8 ---- 8 files changed, 68 insertions(+), 84 deletions(-) diff --git a/scaleway-async/scaleway_async/iam/v1alpha1/__init__.py b/scaleway-async/scaleway_async/iam/v1alpha1/__init__.py index dd3bc03a..fcb4941f 100644 --- a/scaleway-async/scaleway_async/iam/v1alpha1/__init__.py +++ b/scaleway-async/scaleway_async/iam/v1alpha1/__init__.py @@ -110,7 +110,6 @@ from .types import ListUsersResponse from .types import LockUserRequest from .types import MFAOTP -from .types import MigrateOrganizationGuestsRequest from .types import Organization from .types import OrganizationSecuritySettings from .types import RemoveGroupMemberRequest @@ -247,7 +246,6 @@ "ListUsersResponse", "LockUserRequest", "MFAOTP", - "MigrateOrganizationGuestsRequest", "Organization", "OrganizationSecuritySettings", "RemoveGroupMemberRequest", diff --git a/scaleway-async/scaleway_async/iam/v1alpha1/api.py b/scaleway-async/scaleway_async/iam/v1alpha1/api.py index f8d53347..13b9b9f9 100644 --- a/scaleway-async/scaleway_async/iam/v1alpha1/api.py +++ b/scaleway-async/scaleway_async/iam/v1alpha1/api.py @@ -81,6 +81,7 @@ UpdateAPIKeyRequest, UpdateApplicationRequest, UpdateGroupRequest, + UpdateOrganizationLoginMethodsRequest, UpdateOrganizationSecuritySettingsRequest, UpdatePolicyRequest, UpdateSSHKeyRequest, @@ -144,6 +145,7 @@ marshal_UpdateAPIKeyRequest, marshal_UpdateApplicationRequest, marshal_UpdateGroupRequest, + marshal_UpdateOrganizationLoginMethodsRequest, marshal_UpdateOrganizationSecuritySettingsRequest, marshal_UpdatePolicyRequest, marshal_UpdateSSHKeyRequest, @@ -3017,32 +3019,6 @@ async def get_organization( self._throw_on_error(res) return unmarshal_Organization(res.json()) - async def migrate_organization_guests( - self, - *, - organization_id: Optional[str] = None, - ) -> None: - """ - Migrate the organization's guests to IAM members. - :param organization_id: ID of the Organization. - - Usage: - :: - - result = await api.migrate_organization_guests() - """ - - param_organization_id = validate_path_param( - "organization_id", organization_id or self.client.default_organization_id - ) - - res = self._request( - "POST", - f"/iam/v1alpha1/organizations/{param_organization_id}/migrate-guests", - ) - - self._throw_on_error(res) - async def update_organization_login_methods( self, *, @@ -3074,12 +3050,16 @@ async def update_organization_login_methods( res = self._request( "PATCH", f"/iam/v1alpha1/organizations/{param_organization_id}/login-methods", - params={ - "login_magic_code_enabled": login_magic_code_enabled, - "login_oauth2_enabled": login_oauth2_enabled, - "login_password_enabled": login_password_enabled, - "login_saml_enabled": login_saml_enabled, - }, + body=marshal_UpdateOrganizationLoginMethodsRequest( + UpdateOrganizationLoginMethodsRequest( + organization_id=organization_id, + login_password_enabled=login_password_enabled, + login_oauth2_enabled=login_oauth2_enabled, + login_magic_code_enabled=login_magic_code_enabled, + login_saml_enabled=login_saml_enabled, + ), + self.client, + ), ) self._throw_on_error(res) diff --git a/scaleway-async/scaleway_async/iam/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/iam/v1alpha1/marshalling.py index 8223a20f..0bc990e1 100644 --- a/scaleway-async/scaleway_async/iam/v1alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/iam/v1alpha1/marshalling.py @@ -81,6 +81,7 @@ UpdateAPIKeyRequest, UpdateApplicationRequest, UpdateGroupRequest, + UpdateOrganizationLoginMethodsRequest, UpdateOrganizationSecuritySettingsRequest, UpdatePolicyRequest, UpdateSSHKeyRequest, @@ -2147,6 +2148,27 @@ def marshal_UpdateGroupRequest( return output +def marshal_UpdateOrganizationLoginMethodsRequest( + request: UpdateOrganizationLoginMethodsRequest, + defaults: ProfileDefaults, +) -> dict[str, Any]: + output: dict[str, Any] = {} + + if request.login_password_enabled is not None: + output["login_password_enabled"] = request.login_password_enabled + + if request.login_oauth2_enabled is not None: + output["login_oauth2_enabled"] = request.login_oauth2_enabled + + if request.login_magic_code_enabled is not None: + output["login_magic_code_enabled"] = request.login_magic_code_enabled + + if request.login_saml_enabled is not None: + output["login_saml_enabled"] = request.login_saml_enabled + + return output + + def marshal_UpdateOrganizationSecuritySettingsRequest( request: UpdateOrganizationSecuritySettingsRequest, defaults: ProfileDefaults, diff --git a/scaleway-async/scaleway_async/iam/v1alpha1/types.py b/scaleway-async/scaleway_async/iam/v1alpha1/types.py index 89544a7e..60984d5b 100644 --- a/scaleway-async/scaleway_async/iam/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/iam/v1alpha1/types.py @@ -2078,14 +2078,6 @@ class MFAOTP: secret: str -@dataclass -class MigrateOrganizationGuestsRequest: - organization_id: Optional[str] = None - """ - ID of the Organization. - """ - - @dataclass class Organization: id: str diff --git a/scaleway/scaleway/iam/v1alpha1/__init__.py b/scaleway/scaleway/iam/v1alpha1/__init__.py index dd3bc03a..fcb4941f 100644 --- a/scaleway/scaleway/iam/v1alpha1/__init__.py +++ b/scaleway/scaleway/iam/v1alpha1/__init__.py @@ -110,7 +110,6 @@ from .types import ListUsersResponse from .types import LockUserRequest from .types import MFAOTP -from .types import MigrateOrganizationGuestsRequest from .types import Organization from .types import OrganizationSecuritySettings from .types import RemoveGroupMemberRequest @@ -247,7 +246,6 @@ "ListUsersResponse", "LockUserRequest", "MFAOTP", - "MigrateOrganizationGuestsRequest", "Organization", "OrganizationSecuritySettings", "RemoveGroupMemberRequest", diff --git a/scaleway/scaleway/iam/v1alpha1/api.py b/scaleway/scaleway/iam/v1alpha1/api.py index 9bca8dc6..d4856b3a 100644 --- a/scaleway/scaleway/iam/v1alpha1/api.py +++ b/scaleway/scaleway/iam/v1alpha1/api.py @@ -81,6 +81,7 @@ UpdateAPIKeyRequest, UpdateApplicationRequest, UpdateGroupRequest, + UpdateOrganizationLoginMethodsRequest, UpdateOrganizationSecuritySettingsRequest, UpdatePolicyRequest, UpdateSSHKeyRequest, @@ -144,6 +145,7 @@ marshal_UpdateAPIKeyRequest, marshal_UpdateApplicationRequest, marshal_UpdateGroupRequest, + marshal_UpdateOrganizationLoginMethodsRequest, marshal_UpdateOrganizationSecuritySettingsRequest, marshal_UpdatePolicyRequest, marshal_UpdateSSHKeyRequest, @@ -3017,32 +3019,6 @@ def get_organization( self._throw_on_error(res) return unmarshal_Organization(res.json()) - def migrate_organization_guests( - self, - *, - organization_id: Optional[str] = None, - ) -> None: - """ - Migrate the organization's guests to IAM members. - :param organization_id: ID of the Organization. - - Usage: - :: - - result = api.migrate_organization_guests() - """ - - param_organization_id = validate_path_param( - "organization_id", organization_id or self.client.default_organization_id - ) - - res = self._request( - "POST", - f"/iam/v1alpha1/organizations/{param_organization_id}/migrate-guests", - ) - - self._throw_on_error(res) - def update_organization_login_methods( self, *, @@ -3074,12 +3050,16 @@ def update_organization_login_methods( res = self._request( "PATCH", f"/iam/v1alpha1/organizations/{param_organization_id}/login-methods", - params={ - "login_magic_code_enabled": login_magic_code_enabled, - "login_oauth2_enabled": login_oauth2_enabled, - "login_password_enabled": login_password_enabled, - "login_saml_enabled": login_saml_enabled, - }, + body=marshal_UpdateOrganizationLoginMethodsRequest( + UpdateOrganizationLoginMethodsRequest( + organization_id=organization_id, + login_password_enabled=login_password_enabled, + login_oauth2_enabled=login_oauth2_enabled, + login_magic_code_enabled=login_magic_code_enabled, + login_saml_enabled=login_saml_enabled, + ), + self.client, + ), ) self._throw_on_error(res) diff --git a/scaleway/scaleway/iam/v1alpha1/marshalling.py b/scaleway/scaleway/iam/v1alpha1/marshalling.py index 8223a20f..0bc990e1 100644 --- a/scaleway/scaleway/iam/v1alpha1/marshalling.py +++ b/scaleway/scaleway/iam/v1alpha1/marshalling.py @@ -81,6 +81,7 @@ UpdateAPIKeyRequest, UpdateApplicationRequest, UpdateGroupRequest, + UpdateOrganizationLoginMethodsRequest, UpdateOrganizationSecuritySettingsRequest, UpdatePolicyRequest, UpdateSSHKeyRequest, @@ -2147,6 +2148,27 @@ def marshal_UpdateGroupRequest( return output +def marshal_UpdateOrganizationLoginMethodsRequest( + request: UpdateOrganizationLoginMethodsRequest, + defaults: ProfileDefaults, +) -> dict[str, Any]: + output: dict[str, Any] = {} + + if request.login_password_enabled is not None: + output["login_password_enabled"] = request.login_password_enabled + + if request.login_oauth2_enabled is not None: + output["login_oauth2_enabled"] = request.login_oauth2_enabled + + if request.login_magic_code_enabled is not None: + output["login_magic_code_enabled"] = request.login_magic_code_enabled + + if request.login_saml_enabled is not None: + output["login_saml_enabled"] = request.login_saml_enabled + + return output + + def marshal_UpdateOrganizationSecuritySettingsRequest( request: UpdateOrganizationSecuritySettingsRequest, defaults: ProfileDefaults, diff --git a/scaleway/scaleway/iam/v1alpha1/types.py b/scaleway/scaleway/iam/v1alpha1/types.py index 89544a7e..60984d5b 100644 --- a/scaleway/scaleway/iam/v1alpha1/types.py +++ b/scaleway/scaleway/iam/v1alpha1/types.py @@ -2078,14 +2078,6 @@ class MFAOTP: secret: str -@dataclass -class MigrateOrganizationGuestsRequest: - organization_id: Optional[str] = None - """ - ID of the Organization. - """ - - @dataclass class Organization: id: str