async def _generate_event_entities(
        self, client: httpx.AsyncClient, calendar_list_entry: GoogleCalendarListEntity
    ) -> AsyncGenerator[GoogleCalendarEventEntity, None]:
        """Yield GoogleCalendarEventEntities for all events in the given calendar."""
        # URL encode the calendar_id
        encoded_calendar_id = urllib.parse.quote(calendar_list_entry.calendar_id)
        base_url = f"https://www.googleapis.com/calendar/v3/calendars/{encoded_calendar_id}/events"
        params = {"maxResults": 100}
        # Create a breadcrumb for this calendar to attach to events
        cal_breadcrumb = Breadcrumb(
            entity_id=calendar_list_entry.calendar_id,
            name=(calendar_list_entry.summary_override or calendar_list_entry.summary or "")[:50],
            type="calendar",
        )
        while True:
            data = await self._get_with_auth(client, base_url, params=params)
            for event in data.get("items", []):
                event_id = event["id"]
                # Extract date/time fields
                start_info = event.get("start", {})
                end_info = event.get("end", {})
                start_datetime = start_info.get("dateTime")
                start_date = start_info.get("date")
                end_datetime = end_info.get("dateTime")
                end_date = end_info.get("date")
                created_at_str = event.get("created")
                updated_at_str = event.get("updated")

                # Convert created/updated to datetime if present
                created_at = (
                    datetime.fromisoformat(created_at_str.replace("Z", "+00:00"))
                    if created_at_str
                    else None
                )
                updated_at = (
                    datetime.fromisoformat(updated_at_str.replace("Z", "+00:00"))
                    if updated_at_str
                    else None
                )

                yield GoogleCalendarEventEntity(
                    entity_id=event_id,
                    breadcrumbs=[cal_breadcrumb],
                    event_id=event_id,
                    status=event.get("status"),
                    html_link=event.get("htmlLink"),
                    created_at=created_at,
                    updated_at=updated_at,
                    summary=event.get("summary"),
                    description=event.get("description"),
                    location=event.get("location"),
                    color_id=event.get("colorId"),
                    start_datetime=start_datetime,
                    start_date=start_date,
                    end_datetime=end_datetime,
                    end_date=end_date,
                    recurrence=event.get("recurrence"),
                    recurring_event_id=event.get("recurringEventId"),
                    organizer=event.get("organizer"),
                    creator=event.get("creator"),
                    attendees=event.get("attendees"),
                    transparency=event.get("transparency"),
                    visibility=event.get("visibility"),
                    conference_data=event.get("conferenceData"),
                    event_type=event.get("eventType"),
                )

            next_page_token = data.get("nextPageToken")
            if not next_page_token:
                break
            params["pageToken"] = next_page_token
Yield GoogleCalendarEventEntities for all events in the given calendar.
backend/airweave/platform/sources/google_calendar.py