async def generate_entities(self) -> AsyncGenerator[Any, None]:
        """Generate all ClickUp entities (Workspaces, Spaces, Folders, Lists, Tasks, Comments)."""
        print("Generating ClickUp entities")
        async with httpx.AsyncClient() as client:
            # Generate Workspace entities
            async for workspace in self._fetch_workspaces(client):
                print(f"Generating Workspace entity: {workspace}")
                workspace_entity = ClickUpWorkspaceEntity(
                    entity_id=workspace.get("id"),
                    workspace_id=workspace.get("id"),
                    name=workspace.get("name"),
                    color=workspace.get("color"),
                    avatar=workspace.get("avatar"),
                    members=workspace.get("members", []),
                )
                yield workspace_entity

                async for space in self._generate_space_entities(client, workspace["id"]):
                    space_entity = ClickUpSpaceEntity(
                        entity_id=space["id"],
                        space_id=space["id"],
                        name=space["name"],
                        private=space.get("private", False),
                        status=space.get("status", {}),
                        multiple_assignees=space.get("multiple_assignees", False),
                        features=space.get("features", {}),
                    )
                    yield space_entity

                    async for folder in self._generate_folder_entities(client, space["id"]):
                        folder_entity = ClickUpFolderEntity(
                            entity_id=folder["id"],
                            folder_id=folder["id"],
                            name=folder["name"],
                            hidden=folder.get("hidden", False),
                            space_id=space["id"],
                            task_count=folder.get("task_count"),
                        )
                        yield folder_entity

                        async for list_ in self._generate_list_entities(client, folder["id"]):
                            print(f"Generating List entity: {list_}")
                            list_entity = ClickUpListEntity(
                                entity_id=list_["id"],
                                list_id=list_["id"],
                                name=list_["name"],
                                folder_id=folder["id"],
                                space_id=space["id"],
                                content=list_.get("content", ""),
                                status=list_.get("status", {}),
                                priority=list_.get("priority", {}),
                                assignee=list_.get("assignee", None),
                                task_count=list_.get("task_count", 0),
                                due_date=list_.get("due_date", None),
                                start_date=list_.get("start_date", None),
                                folder_name=list_.get("folder").get("name"),
                                space_name=list_.get("space").get("name"),
                            )
                            yield list_entity

                            async for task in self._generate_task_entities(client, list_["id"]):
                                task_entity = ClickUpTaskEntity(
                                    entity_id=task["id"],
                                    task_id=task["id"],
                                    name=task["name"],
                                    status=task.get("status", {}),
                                    priority=task.get("priority"),
                                    assignees=task.get("assignees", []),
                                    tags=task.get("tags", []),
                                    due_date=task.get("due_date"),
                                    start_date=task.get("start_date"),
                                    time_estimate=task.get("time_estimate"),
                                    time_spent=task.get("time_spent"),
                                    custom_fields=task.get("custom_fields", []),
                                    list_id=list_["id"],
                                    folder_id=folder["id"],
                                    space_id=space["id"],
                                    url=task.get("url"),
                                    description=task.get("description", ""),
                                    parent=task.get("parent"),
                                )
                                yield task_entity

                                async for comment in self._generate_comment_entities(
                                    client, task["id"]
                                ):
                                    comment_entity = ClickUpCommentEntity(
                                        entity_id=comment["id"],
                                        comment_id=comment["id"],
                                        task_id=task["id"],
                                        user=comment.get("user", {}),
                                        text_content=comment.get("text_content", ""),
                                        resolved=comment.get("resolved", False),
                                        assignee=comment.get("assignee"),
                                        assigned_by=comment.get("assigned_by"),
                                        reactions=comment.get("reactions", []),
                                        date=comment["date"],
                                    )
                                    yield comment_entity
Generate all ClickUp entities (Workspaces, Spaces, Folders, Lists, Tasks, Comments).
backend/airweave/platform/sources/clickup.py