Skip to content

Commit d95f1da

Browse files
authored
fix: update notetaker media endpoint (#416)
* fix: update notetaker media endpoint * updated changelog
1 parent 8445bf8 commit d95f1da

File tree

4 files changed

+58
-17
lines changed

4 files changed

+58
-17
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ nylas-python Changelog
33

44
Unreleased
55
----------------
6-
* Support for tentative_as_busy parameter that controls whether tentative events are treated as busy time.
7-
* Available as a query parameter for Events requests and as a property in Availability request bodies
6+
* Added support for for tentative_as_busy parameter to the availability request
7+
* Added missing webhook triggers
88
* Added support for Notetaker APIs
99
* Added support for Notetaker via the calendar and event APIs
1010

examples/notetaker_api_demo/notetaker_demo.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,20 @@ def get_notetaker_media(notetaker_id):
7979

8080
if media.recording:
8181
print(f"Recording URL: {media.data.recording.url}")
82-
print(f"Recording Size: {media.data.recording.size} MB")
82+
print(f"Recording Name: {media.data.recording.name}")
83+
print(f"Recording Type: {media.data.recording.type}")
84+
print(f"Recording Size: {media.data.recording.size} bytes")
85+
print(f"Recording Created At: {media.data.recording.created_at}")
86+
print(f"Recording Expires At: {media.data.recording.expires_at}")
87+
print(f"Recording TTL: {media.data.recording.ttl} seconds")
8388
if media.transcript:
8489
print(f"Transcript URL: {media.data.transcript.url}")
85-
print(f"Transcript Size: {media.data.transcript.size} MB")
90+
print(f"Transcript Name: {media.data.transcript.name}")
91+
print(f"Transcript Type: {media.data.transcript.type}")
92+
print(f"Transcript Size: {media.data.transcript.size} bytes")
93+
print(f"Transcript Created At: {media.data.transcript.created_at}")
94+
print(f"Transcript Expires At: {media.data.transcript.expires_at}")
95+
print(f"Transcript TTL: {media.data.transcript.ttl} seconds")
8696

8797
return media
8898
except NylasApiError as e:

nylas/models/notetakers.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,22 @@ class NotetakerMediaRecording:
9191
Class representing a Notetaker media recording.
9292
9393
Attributes:
94-
url: A link to the meeting recording.
95-
size: The size of the file, in MB.
94+
size: The size of the file in bytes.
95+
name: The name of the file.
96+
type: The MIME type of the file.
97+
created_at: Unix timestamp when the file was uploaded to the storage server.
98+
expires_at: Unix timestamp when the file will be deleted.
99+
url: A link to download the file.
100+
ttl: Time-to-live in seconds until the file will be deleted off Nylas' storage server.
96101
"""
97102

98-
url: str
99103
size: int
104+
name: str
105+
type: str
106+
created_at: int
107+
expires_at: int
108+
url: str
109+
ttl: int
100110

101111

102112
@dataclass_json
@@ -106,8 +116,8 @@ class NotetakerMedia:
106116
Class representing Notetaker media.
107117
108118
Attributes:
109-
recording: The meeting recording.
110-
transcript: The meeting transcript.
119+
recording: The meeting recording (video/mp4).
120+
transcript: The meeting transcript (application/json).
111121
"""
112122

113123
recording: Optional[NotetakerMediaRecording] = None

tests/resources/test_notetakers.py

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -364,21 +364,42 @@ def test_cancel_notetaker_without_identifier(self, http_client_delete_response):
364364
def test_media_deserialization(self):
365365
media_json = {
366366
"recording": {
367-
"url": "https://example.com/recording.mp4",
368-
"size": 25
367+
"size": 21550491,
368+
"name": "meeting_recording.mp4",
369+
"type": "video/mp4",
370+
"created_at": 1744222418,
371+
"expires_at": 1744481618,
372+
"url": "url_for_recording",
373+
"ttl": 259106
369374
},
370375
"transcript": {
371-
"url": "https://example.com/transcript.txt",
372-
"size": 2
376+
"size": 862,
377+
"name": "raw_transcript.json",
378+
"type": "application/json",
379+
"created_at": 1744222418,
380+
"expires_at": 1744481618,
381+
"url": "url_for_transcript",
382+
"ttl": 259106
373383
}
374384
}
375385

376386
media = NotetakerMedia.from_dict(media_json)
377387

378-
assert media.recording.url == "https://example.com/recording.mp4"
379-
assert media.recording.size == 25
380-
assert media.transcript.url == "https://example.com/transcript.txt"
381-
assert media.transcript.size == 2
388+
assert media.recording.url == "url_for_recording"
389+
assert media.recording.size == 21550491
390+
assert media.recording.name == "meeting_recording.mp4"
391+
assert media.recording.type == "video/mp4"
392+
assert media.recording.created_at == 1744222418
393+
assert media.recording.expires_at == 1744481618
394+
assert media.recording.ttl == 259106
395+
396+
assert media.transcript.url == "url_for_transcript"
397+
assert media.transcript.size == 862
398+
assert media.transcript.name == "raw_transcript.json"
399+
assert media.transcript.type == "application/json"
400+
assert media.transcript.created_at == 1744222418
401+
assert media.transcript.expires_at == 1744481618
402+
assert media.transcript.ttl == 259106
382403

383404
def test_meeting_provider_enum(self):
384405
"""Test that the MeetingProvider enum works correctly."""

0 commit comments

Comments
 (0)