11from dataclasses import dataclass
2- from typing import Dict , Any , Optional
2+ from typing import Dict , Any , Optional , List
3+ from enum import Enum
34
45from dataclasses_json import dataclass_json
56from typing_extensions import TypedDict , NotRequired
67
78from 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
1291class 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
50131class 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+
79212class 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
98233class 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 ]
0 commit comments