Repository navigation
fix(topics): add visibility to topic types - #322
Open
mayankbohradev wants to merge 1 commit into
Open
mayankbohradev wants to merge 1 commit into
mayankbohradev wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the documented
visibilityfield to the topic create params, update params and theTopictype.Why
The API accepts
visibilityon 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.Testing
tox -e lint,tox -e mypyandtox -e pypass (874 tests).Notes for reviewers
New public name:
resend.TopicVisibility. #321 also changesresend/version.py; I can rebase whichever merges second.Summary by cubic
Fixes the topic types so
visibilityis 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.resend.TopicVisibility, a literal for"public"or"private".visibilitytoTopics.CreateParams,Topics.UpdateParams, andTopic.Written for commit 39455b6. Summary will update on new commits.