def METHOD_NAME(
    cls,
    user: AbstractUser,
    auth_provider: SpecificAuthProviderModel,
    **values: Dict[str, Any],
) -> SpecificAuthProviderModel:
    """
    Updates the authentication provider with the provided id.
    :param user: The user that is updating the authentication provider.
    :param auth_provider: The authentication provider that should be updated.
    :param values: The values that should be set on the authentication provider.
    :return: The updated authentication provider.
    """
    auth_provider_type = auth_provider_type_registry.get_by_model(auth_provider)
    enabled_next = values.get("enabled", None)
    if enabled_next is False:
        another_enabled = (
            AuthProviderModel.objects.filter(enabled=True)
            .exclude(id=auth_provider.id)
            .exists()
        )
        if not another_enabled:
            raise CannotDisableLastAuthProvider()
    auth_provider_type.before_update(user, auth_provider, **values)
    return auth_provider_type.update(auth_provider, **values)