Repository navigation
feat(inboxes): accept path attachments on drafts - #308
dielduarte wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
cubic analysis
All reported issues were addressed across 4 files
Linked issue analysis
Linked issue: DEV-2420: Python SDK (internal, squad-devtools)
| Status | Acceptance criteria | Notes |
|---|---|---|
| ✅ | Support path attachments on inbox drafts | Draft attachments now accept path-based parameters, and tests cover create and update requests with optional content_type. |
| ❌ | Update the Python API reference code tab | The diff updates SDK docstrings and an example, but contains no change to the API reference code tab. |
| Release the updated Python SDK | The version is bumped to 2.51.0, but the diff does not show that the package was released. |
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval blocked by 2 unresolved issues from previous reviews.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval blocked by 2 unresolved issues from previous reviews.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Adds path-attachment support to inbox draft create/update: a new union TypedDict, docstring updates, an example, tests, and a minor version bump. This expands the SDK's public request contract and client capability, so the feature decision needs human sign-off.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Adds path URL attachment support to inbox draft create/update params with docs, tests, example, and version bump. This expands the SDK's public request contract with a new client capability, so the feature decision needs human sign-off.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
resend.Inboxes.Drafts.create()and.update()now acceptpathattachments. This ports resend/resend-node#1172 (released in resend@6.36.0). Spec: resend/resend-openapi#141. The API change is live.Changes
The
attachmentsfield of create/update is now typed asInboxDrafts.DraftAttachmentParams, a union of two TypedDicts, so mypy rejects invalid shapes:AttachmentParams:content,filename,content_type(all required). This is the existing type, unchanged, soInboxDrafts.AttachmentParams(...)still works as a constructor.PathAttachmentParams(new):path,filename, plus an optionalcontent_typethat defaults to the downloaded file's type.The params are sent as-is, so no runtime change was needed. Fully backward compatible.
pathrules instead of "apathreturns a 422".examples/inboxes.pyadds apathattachment to the draft.Verification
flake8,pytest(852 passed) andmypy(strict) all pass. mypy shows only the 5unused-ignoreerrors that are also on main.pathattachments with and withoutcontent_type. mypy checks that an attachment with no source, with both sources, or withcontentand nocontent_typestays a type error.pathstoresinvoice.pdf(application/pdf, 80893 bytes)path+contentstores bothftp://path raises a 422ResendErrorpathattachment sendsLinear: DEV-2420
Summary by cubic
Adds support for
pathURL attachments to inbox drafts.InboxDrafts.AttachmentParamsstays aTypedDictfor inline content, and the newDraftAttachmentParamsunion accepts either inline base64 content or a URL downloaded when the request is made, so mypy rejects attachment dicts that mix or omit both sources. Params are sent as-is, so no runtime change was needed and existing code usingAttachmentParamskeeps working.pathrules instead of "apathreturns a 422".pathattachment to the draft example.Written for commit 678c40b. Summary will update on new commits.