from typing import Any def upgrade_payload(payload: dict[str, Any]) -> dict[str, Any]: result = dict(payload) if "userId" in result: result["user_id"] = result.pop("userId") return result