def format_user_calendars()

in connectors/sources/microsoft_teams.py [0:0]


    def format_user_calendars(self, item):
        document = {"type": UserEndpointName.MEETING.value}
        attendee_list = (
            [
                f"{attendee.get('emailAddress', {}).get('name')}({attendee.get('emailAddress', {}).get('address')})"
                for attendee in item["attendees"]
            ]
            if item.get("attendees")
            else []
        )
        document.update(
            {  # pyright: ignore
                "attendees": attendee_list,
                "online_meeting_url": item["onlineMeeting"].get("joinUrl")
                if item.get("onlineMeeting")
                else "",
                "description": item.get("bodyPreview"),
                "meeting_detail": self.get_calendar_detail(calendar=item),
                "location": [
                    f"{location['displayName']}" for location in item["locations"]
                ]
                if item.get("locations")
                else [],
            }
        )
        self.map_document_with_schema(
            document=document, item=item, document_type=self.schema.meeting
        )
        return document