fix(topics): add visibility to topic types
MA
1d ago+208+208+012345678901234567890123456789-4-4-0123456789
What
Adds the documented visibility field to the topic create params, update params and the Topic type.
Why
The API accepts visibility on create and update, and returns it on get and list. The SDK already forwards the value. The types rejected it, so mypy reported documented usage as an error.
How
TopicVisibilityis a literal alias for"public"and"private".visibilityisNotRequiredonTopic, so code that builds aTopicdict still type-checks.- No runtime change.
Testing
- Before the change, mypy reported 16 errors on the new tests.
tox -e lint,tox -e mypyandtox -e pypass (874 tests).- New sync and async tests cover request bodies and typed response access.
Notes for reviewers
New public name: resend.TopicVisibility. #321 also changes resend/version.py; I can rebase whichever merges second.
Summary by cubic
Fixes the topic types so visibility is accepted on create and update and returned on get and list, matching the API. The SDK already forwards and returns the value; the types rejected it, so mypy flagged documented usage as errors.
- Adds
resend.TopicVisibility, a literal for"public"or"private". - Adds optional
visibilitytoTopics.CreateParams,Topics.UpdateParams, andTopic. - No runtime change.