Skip to content

Commit 2e33dd2

Browse files
authored
Updated notetaker GET endpoint to support changes to the query params (#417)
1 parent d95f1da commit 2e33dd2

File tree

2 files changed

+211
-127
lines changed

2 files changed

+211
-127
lines changed

nylas/models/notetakers.py

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,34 @@ class NotetakerState(str, Enum):
3535
MEDIA_DELETED = "media_deleted"
3636

3737

38+
class NotetakerOrderBy(str, Enum):
39+
"""
40+
Enum representing the possible fields to order Notetaker bots by.
41+
42+
Values:
43+
NAME: Order by the Notetaker's name.
44+
JOIN_TIME: Order by the Notetaker's join time.
45+
CREATED_AT: Order by when the Notetaker was created.
46+
"""
47+
48+
NAME = "name"
49+
JOIN_TIME = "join_time"
50+
CREATED_AT = "created_at"
51+
52+
53+
class NotetakerOrderDirection(str, Enum):
54+
"""
55+
Enum representing the possible directions to order Notetaker bots by.
56+
57+
Values:
58+
ASC: Ascending order.
59+
DESC: Descending order.
60+
"""
61+
62+
ASC = "asc"
63+
DESC = "desc"
64+
65+
3866
class MeetingProvider(str, Enum):
3967
"""
4068
Enum representing the possible meeting providers for Notetaker.
@@ -57,7 +85,7 @@ class NotetakerMeetingSettingsRequest(TypedDict):
5785
Attributes:
5886
video_recording: When true, Notetaker records the meeting's video.
5987
audio_recording: When true, Notetaker records the meeting's audio.
60-
transcription: When true, Notetaker transcribes the meeting's audio.
88+
transcription: When true, Notetaker transcribes the meeting's audio.
6189
If transcription is true, audio_recording must also be true.
6290
"""
6391

@@ -75,7 +103,7 @@ class NotetakerMeetingSettings:
75103
Attributes:
76104
video_recording: When true, Notetaker records the meeting's video.
77105
audio_recording: When true, Notetaker records the meeting's audio.
78-
transcription: When true, Notetaker transcribes the meeting's audio.
106+
transcription: When true, Notetaker transcribes the meeting's audio.
79107
If transcription is true, audio_recording must also be true.
80108
"""
81109

@@ -182,7 +210,7 @@ class InviteNotetakerRequest(TypedDict):
182210
183211
Attributes:
184212
meeting_link: A meeting invitation link that Notetaker uses to join the meeting.
185-
join_time: When Notetaker should join the meeting, in Unix timestamp format.
213+
join_time: When Notetaker should join the meeting, in Unix timestamp format.
186214
If empty, Notetaker joins the meeting immediately.
187215
name: The display name for the Notetaker bot.
188216
meeting_settings: Notetaker Meeting Settings.
@@ -217,23 +245,41 @@ class ListNotetakerQueryParams(ListQueryParams):
217245
state: Filter for Notetaker bots with the specified meeting state.
218246
Use the NotetakerState enum.
219247
Example: state=NotetakerState.SCHEDULED
220-
join_time_from: Filter for Notetaker bots that are scheduled to join meetings after the specified time.
221-
join_time_until: Filter for Notetaker bots that are scheduled to join meetings until the specified time.
248+
join_time_start: Filter for Notetaker bots that have join times that start at or after a specific time,
249+
in Unix timestamp format.
250+
join_time_end: Filter for Notetaker bots that have join times that end at or are before a specific time,
251+
in Unix timestamp format.
222252
limit: The maximum number of objects to return. This field defaults to 50. The maximum allowed value is 200.
223253
page_token: An identifier that specifies which page of data to return.
224254
prev_page_token: An identifier that specifies which page of data to return.
255+
order_by: The field to order the Notetaker bots by. Defaults to created_at.
256+
Use the NotetakerOrderBy enum.
257+
Example: order_by=NotetakerOrderBy.NAME
258+
order_direction: The direction to order the Notetaker bots by. Defaults to asc.
259+
Use the NotetakerOrderDirection enum.
260+
Example: order_direction=NotetakerOrderDirection.DESC
225261
"""
226262

227263
state: NotRequired[NotetakerState]
228-
join_time_from: NotRequired[int]
229-
join_time_until: NotRequired[int]
264+
join_time_start: NotRequired[int]
265+
join_time_end: NotRequired[int]
266+
order_by: NotRequired[NotetakerOrderBy]
267+
order_direction: NotRequired[NotetakerOrderDirection]
230268

231269
def __post_init__(self):
232-
"""Convert NotetakerState enum to string value for API requests."""
270+
"""Convert enums to string values for API requests."""
233271
super().__post_init__()
234272
# Convert state enum to string if present
235273
if hasattr(self, "state") and isinstance(self.state, NotetakerState):
236274
self.state = self.state.value
275+
# Convert order_by enum to string if present
276+
if hasattr(self, "order_by") and isinstance(self.order_by, NotetakerOrderBy):
277+
self.order_by = self.order_by.value
278+
# Convert order_direction enum to string if present
279+
if hasattr(self, "order_direction") and isinstance(
280+
self.order_direction, NotetakerOrderDirection
281+
):
282+
self.order_direction = self.order_direction.value
237283

238284

239285
class FindNotetakerQueryParams(TypedDict):

0 commit comments

Comments
 (0)