fix(topics): add visibility to topic types

MA
1d ago
+208-4

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

  • TopicVisibility is a literal alias for "public" and "private".
  • visibility is NotRequired on Topic, so code that builds a Topic dict still type-checks.
  • No runtime change.

Testing

  • Before the change, mypy reported 16 errors on the new tests.
  • tox -e lint, tox -e mypy and tox -e py pass (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 visibility to Topics.CreateParams, Topics.UpdateParams, and Topic.
  • No runtime change.