diff --git a/scaleway-async/scaleway_async/iam/v1alpha1/api.py b/scaleway-async/scaleway_async/iam/v1alpha1/api.py index 4f0679d7..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, @@ -3048,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/scaleway/iam/v1alpha1/api.py b/scaleway/scaleway/iam/v1alpha1/api.py index 61f37be9..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, @@ -3048,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,