Repository navigation
fix(emails): add object, scheduled_at and tags to the Email type - #329
Open
Abhishek-B-R wants to merge 1 commit into
Open
Abhishek-B-R wants to merge 1 commit into
Abhishek-B-R wants to merge 1 commit into
Conversation
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.
The retrieve email response documents
object,scheduled_atandtags, but theEmailtype has none of them. Undermypy --strictthis fails even though the API returns the keys:I added the three keys to
EmailasNotRequired, since the list endpoint returns the same shape withoutobjectandtags.scheduled_atisOptional[str]because the docs example returnsnullfor unscheduled emails.Checked against https://resend.com/docs/api-reference/emails/retrieve-email and https://resend.com/docs/api-reference/emails/list-emails.
I extended
test_email_getto read the three keys. On main, mypy ontests/reports threeTypedDict "Email" has no keyerrors for it. With the change that is gone and the full suite passes (905 tests). flake8, black and isort are clean on the files I touched. mypy still reports 7 unusedtype: ignoreerrors in other test files, which are the same on main.Summary by cubic
Adds the
object,scheduled_at, andtagsfields to theEmailtype somypy --strictno longer rejects accessing them, matching the retrieve email API response. The fields areNotRequiredsince the list endpoint omitsobjectandtags, andscheduled_atisOptional[str]since unscheduled emails returnnull. Tests now read the three keys.Written for commit 401f997. Summary will update on new commits.