Skip to content

fix: update notetaker media endpoint #416

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 2 commits into from
Apr 10, 2025
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
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ nylas-python Changelog

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

Expand Down
14 changes: 12 additions & 2 deletions examples/notetaker_api_demo/notetaker_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,20 @@ def get_notetaker_media(notetaker_id):

if media.recording:
print(f"Recording URL: {media.data.recording.url}")
print(f"Recording Size: {media.data.recording.size} MB")
print(f"Recording Name: {media.data.recording.name}")
print(f"Recording Type: {media.data.recording.type}")
print(f"Recording Size: {media.data.recording.size} bytes")
print(f"Recording Created At: {media.data.recording.created_at}")
print(f"Recording Expires At: {media.data.recording.expires_at}")
print(f"Recording TTL: {media.data.recording.ttl} seconds")
if media.transcript:
print(f"Transcript URL: {media.data.transcript.url}")
print(f"Transcript Size: {media.data.transcript.size} MB")
print(f"Transcript Name: {media.data.transcript.name}")
print(f"Transcript Type: {media.data.transcript.type}")
print(f"Transcript Size: {media.data.transcript.size} bytes")
print(f"Transcript Created At: {media.data.transcript.created_at}")
print(f"Transcript Expires At: {media.data.transcript.expires_at}")
print(f"Transcript TTL: {media.data.transcript.ttl} seconds")

return media
except NylasApiError as e:
Expand Down
20 changes: 15 additions & 5 deletions nylas/models/notetakers.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,22 @@ class NotetakerMediaRecording:
Class representing a Notetaker media recording.

Attributes:
url: A link to the meeting recording.
size: The size of the file, in MB.
size: The size of the file in bytes.
name: The name of the file.
type: The MIME type of the file.
created_at: Unix timestamp when the file was uploaded to the storage server.
expires_at: Unix timestamp when the file will be deleted.
url: A link to download the file.
ttl: Time-to-live in seconds until the file will be deleted off Nylas' storage server.
"""

url: str
size: int
name: str
type: str
created_at: int
expires_at: int
url: str
ttl: int


@dataclass_json
Expand All @@ -106,8 +116,8 @@ class NotetakerMedia:
Class representing Notetaker media.

Attributes:
recording: The meeting recording.
transcript: The meeting transcript.
recording: The meeting recording (video/mp4).
transcript: The meeting transcript (application/json).
"""

recording: Optional[NotetakerMediaRecording] = None
Expand Down
37 changes: 29 additions & 8 deletions tests/resources/test_notetakers.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,21 +364,42 @@ def test_cancel_notetaker_without_identifier(self, http_client_delete_response):
def test_media_deserialization(self):
media_json = {
"recording": {
"url": "https://example.com/recording.mp4",
"size": 25
"size": 21550491,
"name": "meeting_recording.mp4",
"type": "video/mp4",
"created_at": 1744222418,
"expires_at": 1744481618,
"url": "url_for_recording",
"ttl": 259106
},
"transcript": {
"url": "https://example.com/transcript.txt",
"size": 2
"size": 862,
"name": "raw_transcript.json",
"type": "application/json",
"created_at": 1744222418,
"expires_at": 1744481618,
"url": "url_for_transcript",
"ttl": 259106
}
}

media = NotetakerMedia.from_dict(media_json)

assert media.recording.url == "https://example.com/recording.mp4"
assert media.recording.size == 25
assert media.transcript.url == "https://example.com/transcript.txt"
assert media.transcript.size == 2
assert media.recording.url == "url_for_recording"
assert media.recording.size == 21550491
assert media.recording.name == "meeting_recording.mp4"
assert media.recording.type == "video/mp4"
assert media.recording.created_at == 1744222418
assert media.recording.expires_at == 1744481618
assert media.recording.ttl == 259106

assert media.transcript.url == "url_for_transcript"
assert media.transcript.size == 862
assert media.transcript.name == "raw_transcript.json"
assert media.transcript.type == "application/json"
assert media.transcript.created_at == 1744222418
assert media.transcript.expires_at == 1744481618
assert media.transcript.ttl == 259106

def test_meeting_provider_enum(self):
"""Test that the MeetingProvider enum works correctly."""
Expand Down