Skip to content

Commit 39e871d

Browse files
committed
feat: Added support for Notetaker via the calendar and event APIs
1 parent 0aa7a84 commit 39e871d

File tree

5 files changed

+486
-58
lines changed

5 files changed

+486
-58
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ nylas-python Changelog
44
Unreleased
55
----------------
66
* Added support for Notetaker APIs
7+
* Added support for Notetaker via the calendar and event APIs
78

89
v6.8.0
910
----------------

nylas/models/calendars.py

Lines changed: 138 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,91 @@
11
from dataclasses import dataclass
2-
from typing import Dict, Any, Optional
2+
from typing import Dict, Any, Optional, List
3+
from enum import Enum
34

45
from dataclasses_json import dataclass_json
56
from typing_extensions import TypedDict, NotRequired
67

78
from nylas.models.list_query_params import ListQueryParams
89

910

11+
class EventSelection(str, Enum):
12+
"""
13+
Enum representing the different types of events to include for notetaking.
14+
15+
Values:
16+
INTERNAL: Events where the host domain matches all participants' domain names
17+
EXTERNAL: Events where the host domain differs from any participant's domain name
18+
OWN_EVENTS: Events where the host is the same as the user's grant
19+
PARTICIPANT_ONLY: Events where the user's grant is a participant but not the host
20+
ALL: When all options are included, all events with meeting links will have Notetakers
21+
"""
22+
INTERNAL = "internal"
23+
EXTERNAL = "external"
24+
OWN_EVENTS = "own_events"
25+
PARTICIPANT_ONLY = "participant_only"
26+
ALL = "all"
27+
28+
29+
@dataclass_json
30+
@dataclass
31+
class NotetakerParticipantFilter:
32+
"""
33+
Class representation of Notetaker participant filter settings.
34+
35+
Attributes:
36+
participants_gte: Only have meeting bot join meetings with greater than or equal to this number of participants.
37+
participants_lte: Only have meeting bot join meetings with less than or equal to this number of participants.
38+
"""
39+
participants_gte: Optional[int] = None
40+
participants_lte: Optional[int] = None
41+
42+
43+
@dataclass_json
44+
@dataclass
45+
class NotetakerRules:
46+
"""
47+
Class representation of Notetaker rules for joining meetings.
48+
49+
Attributes:
50+
event_selection: Types of events to include for notetaking.
51+
participant_filter: Filters to apply based on the number of participants.
52+
"""
53+
event_selection: Optional[List[EventSelection]] = None
54+
participant_filter: Optional[NotetakerParticipantFilter] = None
55+
56+
57+
@dataclass_json
58+
@dataclass
59+
class NotetakerMeetingSettings:
60+
"""
61+
Class representation of Notetaker meeting settings.
62+
63+
Attributes:
64+
video_recording: When true, Notetaker records the meeting's video.
65+
audio_recording: When true, Notetaker records the meeting's audio.
66+
transcription: When true, Notetaker transcribes the meeting's audio.
67+
"""
68+
video_recording: Optional[bool] = True
69+
audio_recording: Optional[bool] = True
70+
transcription: Optional[bool] = True
71+
72+
73+
@dataclass_json
74+
@dataclass
75+
class CalendarNotetaker:
76+
"""
77+
Class representation of Notetaker settings for a calendar.
78+
79+
Attributes:
80+
name: The display name for the Notetaker bot.
81+
meeting_settings: Notetaker Meeting Settings.
82+
rules: Rules for when the Notetaker should join a meeting.
83+
"""
84+
name: Optional[str] = "Nylas Notetaker"
85+
meeting_settings: Optional[NotetakerMeetingSettings] = None
86+
rules: Optional[NotetakerRules] = None
87+
88+
1089
@dataclass_json
1190
@dataclass
1291
class Calendar:
@@ -30,6 +109,7 @@ class Calendar:
30109
If not defined, the default color is used (Google only).
31110
is_primary: If the Calendar is the account's primary calendar.
32111
metadata: A list of key-value pairs storing additional data.
112+
notetaker: Notetaker meeting bot settings for the calendar.
33113
"""
34114

35115
id: str
@@ -45,6 +125,7 @@ class Calendar:
45125
hex_foreground_color: Optional[str] = None
46126
is_primary: Optional[bool] = None
47127
metadata: Optional[Dict[str, Any]] = None
128+
notetaker: Optional[CalendarNotetaker] = None
48129

49130

50131
class ListCalendarsQueryParams(ListQueryParams):
@@ -76,6 +157,58 @@ class FindCalendarQueryParams(TypedDict):
76157
select: NotRequired[str]
77158

78159

160+
class NotetakerCalendarSettings(TypedDict):
161+
"""
162+
Interface for Notetaker meeting settings for a calendar.
163+
164+
Attributes:
165+
video_recording: When true, Notetaker records the meeting's video.
166+
audio_recording: When true, Notetaker records the meeting's audio.
167+
transcription: When true, Notetaker transcribes the meeting's audio.
168+
"""
169+
video_recording: NotRequired[bool]
170+
audio_recording: NotRequired[bool]
171+
transcription: NotRequired[bool]
172+
173+
174+
class NotetakerCalendarParticipantFilter(TypedDict):
175+
"""
176+
Interface for Notetaker participant filter settings.
177+
178+
Attributes:
179+
participants_gte: Only have meeting bot join meetings with greater than or equal to this number of participants.
180+
participants_lte: Only have meeting bot join meetings with less than or equal to this number of participants.
181+
"""
182+
participants_gte: NotRequired[int]
183+
participants_lte: NotRequired[int]
184+
185+
186+
class NotetakerCalendarRules(TypedDict):
187+
"""
188+
Interface for Notetaker rules for joining meetings.
189+
190+
Attributes:
191+
event_selection: Types of events to include for notetaking.
192+
participant_filter: Filters to apply based on the number of participants.
193+
"""
194+
event_selection: NotRequired[List[EventSelection]]
195+
participant_filter: NotRequired[NotetakerCalendarParticipantFilter]
196+
197+
198+
class NotetakerCalendarRequest(TypedDict):
199+
"""
200+
Interface for Notetaker settings in a calendar request.
201+
202+
Attributes:
203+
name: The display name for the Notetaker bot.
204+
meeting_settings: Notetaker Meeting Settings.
205+
rules: Rules for when the Notetaker should join a meeting.
206+
"""
207+
name: NotRequired[str]
208+
meeting_settings: NotRequired[NotetakerCalendarSettings]
209+
rules: NotRequired[NotetakerCalendarRules]
210+
211+
79212
class CreateCalendarRequest(TypedDict):
80213
"""
81214
Interface of a Nylas create calendar request
@@ -86,13 +219,15 @@ class CreateCalendarRequest(TypedDict):
86219
location: Geographic location of the calendar as free-form text.
87220
timezone: IANA time zone database formatted string (e.g. America/New_York).
88221
metadata: A list of key-value pairs storing additional data.
222+
notetaker: Notetaker meeting bot settings.
89223
"""
90224

91225
name: str
92226
description: NotRequired[str]
93227
location: NotRequired[str]
94228
timezone: NotRequired[str]
95229
metadata: NotRequired[Dict[str, str]]
230+
notetaker: NotRequired[NotetakerCalendarRequest]
96231

97232

98233
class UpdateCalendarRequest(CreateCalendarRequest):
@@ -104,7 +239,9 @@ class UpdateCalendarRequest(CreateCalendarRequest):
104239
Empty indicates default color.
105240
hexForegroundColor: The background color of the calendar in the hexadecimal format (e.g. #0099EE).
106241
Empty indicates default color. (Google only)
242+
notetaker: Notetaker meeting bot settings.
107243
"""
108244

109245
hexColor: NotRequired[str]
110246
hexForegroundColor: NotRequired[str]
247+
notetaker: NotRequired[NotetakerCalendarRequest]

nylas/models/events.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,38 @@ class Reminders:
279279
overrides: Optional[List[ReminderOverride]] = None
280280

281281

282+
@dataclass_json
283+
@dataclass
284+
class NotetakerMeetingSettings:
285+
"""
286+
Class representing Notetaker meeting settings.
287+
288+
Attributes:
289+
video_recording: When true, Notetaker records the meeting's video.
290+
audio_recording: When true, Notetaker records the meeting's audio.
291+
transcription: When true, Notetaker transcribes the meeting's audio.
292+
"""
293+
video_recording: Optional[bool] = True
294+
audio_recording: Optional[bool] = True
295+
transcription: Optional[bool] = True
296+
297+
298+
@dataclass_json
299+
@dataclass
300+
class EventNotetaker:
301+
"""
302+
Class representing Notetaker settings for an event.
303+
304+
Attributes:
305+
id: The Notetaker bot ID.
306+
name: The display name for the Notetaker bot.
307+
meeting_settings: Notetaker Meeting Settings.
308+
"""
309+
id: Optional[str] = None
310+
name: Optional[str] = "Nylas Notetaker"
311+
meeting_settings: Optional[NotetakerMeetingSettings] = None
312+
313+
282314
@dataclass_json
283315
@dataclass
284316
class Event:
@@ -313,6 +345,7 @@ class Event:
313345
visibility: The Event's visibility (private or public).
314346
capacity: Sets the maximum number of participants that may attend the event.
315347
master_event_id: For recurring events, this field contains the main (master) event's ID.
348+
notetaker: Notetaker meeting bot settings.
316349
"""
317350

318351
id: str
@@ -343,6 +376,7 @@ class Event:
343376
created_at: Optional[int] = None
344377
updated_at: Optional[int] = None
345378
master_event_id: Optional[str] = None
379+
notetaker: Optional[EventNotetaker] = None
346380

347381

348382
class CreateParticipant(TypedDict):
@@ -627,6 +661,34 @@ class UpdateDatespan(TypedDict):
627661
""" Union type representing the different types of event time configurations for updating an Event."""
628662

629663

664+
class EventNotetakerSettings(TypedDict):
665+
"""
666+
Interface representing Notetaker meeting settings for an event.
667+
668+
Attributes:
669+
video_recording: When true, Notetaker records the meeting's video.
670+
audio_recording: When true, Notetaker records the meeting's audio.
671+
transcription: When true, Notetaker transcribes the meeting's audio.
672+
"""
673+
video_recording: NotRequired[bool]
674+
audio_recording: NotRequired[bool]
675+
transcription: NotRequired[bool]
676+
677+
678+
class EventNotetakerRequest(TypedDict):
679+
"""
680+
Interface representing Notetaker settings for an event.
681+
682+
Attributes:
683+
id: The Notetaker bot ID.
684+
name: The display name for the Notetaker bot.
685+
meeting_settings: Notetaker Meeting Settings.
686+
"""
687+
id: NotRequired[str]
688+
name: NotRequired[str]
689+
meeting_settings: NotRequired[EventNotetakerSettings]
690+
691+
630692
class CreateEventRequest(TypedDict):
631693
"""
632694
Interface representing a request to create an event.
@@ -646,6 +708,7 @@ class CreateEventRequest(TypedDict):
646708
visibility: The visibility of the event.
647709
capacity: The capacity of the event.
648710
hide_participants: Whether to hide participants of the event.
711+
notetaker: Notetaker meeting bot settings.
649712
"""
650713

651714
when: CreateWhen
@@ -661,6 +724,7 @@ class CreateEventRequest(TypedDict):
661724
visibility: NotRequired[Visibility]
662725
capacity: NotRequired[int]
663726
hide_participants: NotRequired[bool]
727+
notetaker: NotRequired[EventNotetakerRequest]
664728

665729

666730
class UpdateEventRequest(TypedDict):
@@ -681,6 +745,7 @@ class UpdateEventRequest(TypedDict):
681745
visibility: The visibility of the event.
682746
capacity: The capacity of the event.
683747
hide_participants: Whether to hide participants of the event.
748+
notetaker: Notetaker meeting bot settings.
684749
"""
685750

686751
when: NotRequired[UpdateWhen]
@@ -696,6 +761,7 @@ class UpdateEventRequest(TypedDict):
696761
visibility: NotRequired[Visibility]
697762
capacity: NotRequired[int]
698763
hide_participants: NotRequired[bool]
764+
notetaker: NotRequired[EventNotetakerRequest]
699765

700766

701767
class ListEventQueryParams(ListQueryParams):

0 commit comments

Comments
 (0)