Skip to content

fix(topics): add visibility to topic types - #322

Open
mayankbohradev wants to merge 1 commit into
resend:mainfrom
mayankbohradev:fix/topic-visibility-types
Open

mayankbohradev wants to merge 1 commit into
resend:mainfrom
mayankbohradev:fix/topic-visibility-types

Conversation

@mayankbohradev

@mayankbohradev mayankbohradev commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

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.

Written for commit 39455b6. Summary will update on new commits.

View guided diff

The API accepts `visibility` on create and update, and returns it on
get and list. The SDK already sends and returns the value, but the
types rejected it, so mypy reported documented usage as an error.

- Add `TopicVisibility` ("public" or "private").
- Add `visibility` to `Topics.CreateParams` and `Topics.UpdateParams`.
- Add `visibility` to `Topic`.

Tested with tox lint, mypy and py (874 passed).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linear-synced PR has been synced to Linear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant