Skip to content

Add master_event_id to events #372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions nylas/models/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ class Event:
status: The Event's status.
visibility: The Event's visibility (private or public).
capacity: Sets the maximum number of participants that may attend the event.
master_event_id: For recurring events, this field contains the main (master) event's ID.
"""

id: str
Expand Down Expand Up @@ -341,6 +342,7 @@ class Event:
capacity: Optional[int] = None
created_at: Optional[int] = None
updated_at: Optional[int] = None
master_event_id: Optional[str] = None


class CreateParticipant(TypedDict):
Expand Down Expand Up @@ -727,6 +729,8 @@ class ListEventQueryParams(ListQueryParams):
This value should be taken from a ListResponse object's next_cursor parameter.
event_type (NotRequired[List[EventType]]): (Google only) Filter events by event type.
You can pass the query parameter multiple times to select or exclude multiple event types.
master_event_id (NotRequired[str]): Filter for instances of recurring events with the
specified master_event_id. Not respected by metadata filtering.
"""

calendar_id: str
Expand All @@ -741,6 +745,7 @@ class ListEventQueryParams(ListQueryParams):
busy: NotRequired[bool]
order_by: NotRequired[str]
event_type: NotRequired[List[EventType]]
master_event_id: NotRequired[str]


class CreateEventQueryParams(TypedDict):
Expand Down
6 changes: 4 additions & 2 deletions tests/resources/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def test_event_deserialization(self):
"hide_participants": False,
"grant_id": "41009df5-bf11-4c97-aa18-b285b5f2e386",
"html_link": "https://www.google.com/calendar/event?eid=bTMzcGJrNW4yYjk4bjk3OWE4Ef3feD2VuM29fMjAyMjA2MjdUMjIwMDAwWiBoYWxsYUBueWxhcy5jb20",
"id": "5d3qmne77v32r8l4phyuksl2x",
"id": "5d3qmne77v32r8l4phyuksl2x_20240603T180000Z",
"master_event_id": "5d3qmne77v32r8l4phyuksl2x",
"location": "Roller Rink",
"metadata": {"your_key": "your_value"},
"object": "event",
Expand Down Expand Up @@ -73,7 +74,8 @@ def test_event_deserialization(self):
event.html_link
== "https://www.google.com/calendar/event?eid=bTMzcGJrNW4yYjk4bjk3OWE4Ef3feD2VuM29fMjAyMjA2MjdUMjIwMDAwWiBoYWxsYUBueWxhcy5jb20"
)
assert event.id == "5d3qmne77v32r8l4phyuksl2x"
assert event.id == "5d3qmne77v32r8l4phyuksl2x_20240603T180000Z"
assert event.master_event_id == "5d3qmne77v32r8l4phyuksl2x"
assert event.location == "Roller Rink"
assert event.metadata == {"your_key": "your_value"}
assert event.object == "event"
Expand Down
Loading