Skip to content

Commit 49aeba7

Browse files
authored
Merge pull request #37 from GearPlug/fix/create-event
feat: add new params to create_event
2 parents 585f774 + e692bb9 commit 49aeba7

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎microsoftgraph/calendar.py‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ def create_event(
6060
location: str,
6161
calendar_id: str = None,
6262
content_type: str = "HTML",
63+
attendees: list = None,
64+
is_online_meeting: bool = False,
65+
online_meeting_provider: str = 'teamsForBusiness',
6366
**kwargs,
6467
) -> Response:
6568
"""Create an event in the user's default calendar or specified calendar.
@@ -102,7 +105,15 @@ def create_event(
102105
"timeZone": end_timezone,
103106
},
104107
"location": {"displayName": location},
108+
"isOnlineMeeting": is_online_meeting,
105109
}
110+
111+
if is_online_meeting:
112+
body["onlineMeetingProvider"] = online_meeting_provider
113+
114+
if attendees:
115+
body["attendees"] = attendees
116+
106117
body.update(kwargs)
107118
url = "me/calendars/{}/events".format(calendar_id) if calendar_id is not None else "me/events"
108119
return self._client._post(self._client.base_url + url, json=body)

0 commit comments

Comments
 (0)