Skip to content
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: 4 additions & 0 deletions resend/broadcasts/_broadcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,7 @@ class Broadcast(_FromParam):
"""
The plain text content of the broadcast.
"""
topic_id: Union[str, None]
"""
The topic ID that the broadcast is scoped to.
"""
2 changes: 2 additions & 0 deletions tests/broadcasts_async_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ async def test_broadcasts_get_async(self) -> None:
"created_at": "2024-12-01 19:32:22.98+00",
"scheduled_at": None,
"sent_at": None,
"topic_id": None,
}
)

Expand All @@ -96,6 +97,7 @@ async def test_broadcasts_get_async(self) -> None:
assert broadcast["created_at"] == "2024-12-01 19:32:22.98+00"
assert broadcast["scheduled_at"] is None
assert broadcast["sent_at"] is None
assert broadcast["topic_id"] is None

async def test_should_get_broadcasts_async_raise_exception_when_no_content(
self,
Expand Down
2 changes: 2 additions & 0 deletions tests/broadcasts_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def test_broadcasts_get(self) -> None:
"sent_at": None,
"html": "<p>Hello World</p>",
"text": "Hello World",
"topic_id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e",
}
)

Expand All @@ -68,6 +69,7 @@ def test_broadcasts_get(self) -> None:
assert broadcast["sent_at"] is None
assert broadcast["html"] == "<p>Hello World</p>"
assert broadcast["text"] == "Hello World"
assert broadcast["topic_id"] == "b6d24b8e-af0b-4c3c-be0c-359bbd97381e"

def test_broadcasts_send(self) -> None:
self.set_mock_json({"id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e791"})
Expand Down
Loading