qubrics-mailbox 3.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. qubrics_mailbox-3.0.0/.gitignore +22 -0
  2. qubrics_mailbox-3.0.0/CHANGELOG.md +151 -0
  3. qubrics_mailbox-3.0.0/LICENSE +21 -0
  4. qubrics_mailbox-3.0.0/PKG-INFO +246 -0
  5. qubrics_mailbox-3.0.0/README.md +224 -0
  6. qubrics_mailbox-3.0.0/pyproject.toml +37 -0
  7. qubrics_mailbox-3.0.0/qubrics/mailbox/__init__.py +397 -0
  8. qubrics_mailbox-3.0.0/qubrics/mailbox/api/__init__.py +4 -0
  9. qubrics_mailbox-3.0.0/qubrics/mailbox/api/mailbox_api_api.py +18778 -0
  10. qubrics_mailbox-3.0.0/qubrics/mailbox/api_client.py +822 -0
  11. qubrics_mailbox-3.0.0/qubrics/mailbox/api_response.py +21 -0
  12. qubrics_mailbox-3.0.0/qubrics/mailbox/attachments.py +282 -0
  13. qubrics_mailbox-3.0.0/qubrics/mailbox/client.py +89 -0
  14. qubrics_mailbox-3.0.0/qubrics/mailbox/configuration.py +631 -0
  15. qubrics_mailbox-3.0.0/qubrics/mailbox/events.py +83 -0
  16. qubrics_mailbox-3.0.0/qubrics/mailbox/exceptions.py +218 -0
  17. qubrics_mailbox-3.0.0/qubrics/mailbox/models/__init__.py +194 -0
  18. qubrics_mailbox-3.0.0/qubrics/mailbox/models/api_error.py +98 -0
  19. qubrics_mailbox-3.0.0/qubrics/mailbox/models/api_error_detail.py +90 -0
  20. qubrics_mailbox-3.0.0/qubrics/mailbox/models/api_error_error.py +111 -0
  21. qubrics_mailbox-3.0.0/qubrics/mailbox/models/api_error_meta.py +86 -0
  22. qubrics_mailbox-3.0.0/qubrics/mailbox/models/batch_delete_mailbox_messages_body.py +91 -0
  23. qubrics_mailbox-3.0.0/qubrics/mailbox/models/batch_update_mailbox_messages_body.py +95 -0
  24. qubrics_mailbox-3.0.0/qubrics/mailbox/models/connection.py +110 -0
  25. qubrics_mailbox-3.0.0/qubrics/mailbox/models/connection_credential.py +102 -0
  26. qubrics_mailbox-3.0.0/qubrics/mailbox/models/connection_mailboxes_inner.py +88 -0
  27. qubrics_mailbox-3.0.0/qubrics/mailbox/models/connection_response.py +98 -0
  28. qubrics_mailbox-3.0.0/qubrics/mailbox/models/connection_team.py +88 -0
  29. qubrics_mailbox-3.0.0/qubrics/mailbox/models/control_mailbox_draft_schedule.py +97 -0
  30. qubrics_mailbox-3.0.0/qubrics/mailbox/models/create_mailbox_draft.py +154 -0
  31. qubrics_mailbox-3.0.0/qubrics/mailbox/models/create_mailbox_draft_attachments_inner.py +107 -0
  32. qubrics_mailbox-3.0.0/qubrics/mailbox/models/create_mailbox_draft_bcc_inner.py +94 -0
  33. qubrics_mailbox-3.0.0/qubrics/mailbox/models/create_mailbox_draft_from.py +94 -0
  34. qubrics_mailbox-3.0.0/qubrics/mailbox/models/create_mailbox_draft_source.py +96 -0
  35. qubrics_mailbox-3.0.0/qubrics/mailbox/models/create_mailbox_folder_body.py +95 -0
  36. qubrics_mailbox-3.0.0/qubrics/mailbox/models/cursor_pagination.py +88 -0
  37. qubrics_mailbox-3.0.0/qubrics/mailbox/models/granted_mailbox.py +88 -0
  38. qubrics_mailbox-3.0.0/qubrics/mailbox/models/granted_mailbox_list_response.py +108 -0
  39. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_address.py +93 -0
  40. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_attachment.py +118 -0
  41. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_attachment_text.py +133 -0
  42. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_attachment_text_response.py +98 -0
  43. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_attachment_upload_intent_body.py +91 -0
  44. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_attachment_upload_intent_result.py +108 -0
  45. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_attachment_upload_intent_result_headers.py +88 -0
  46. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_attachment_upload_intent_result_response.py +98 -0
  47. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_attachment_upload_result.py +92 -0
  48. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_attachment_upload_result_response.py +98 -0
  49. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_batch_delete_messages_result.py +104 -0
  50. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_batch_delete_messages_result_response.py +98 -0
  51. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_batch_get_body.py +145 -0
  52. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_batch_get_item.py +112 -0
  53. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_batch_get_result.py +102 -0
  54. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_batch_get_result_response.py +98 -0
  55. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_batch_get_result_states.py +91 -0
  56. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_batch_message_failure.py +90 -0
  57. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_batch_message_states.py +98 -0
  58. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_batch_update_messages_result.py +104 -0
  59. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_batch_update_messages_result_response.py +98 -0
  60. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_changes.py +105 -0
  61. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_changes_response.py +98 -0
  62. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_content_headers.py +119 -0
  63. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_content_headers_full_inner.py +88 -0
  64. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_content_headers_selected.py +105 -0
  65. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_draft.py +199 -0
  66. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_draft_delete_response.py +98 -0
  67. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_draft_delete_response_all_of_data.py +88 -0
  68. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_draft_list_response.py +108 -0
  69. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_draft_response.py +98 -0
  70. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_folder.py +115 -0
  71. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_folder_cursor_list_response.py +108 -0
  72. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_folder_deleted_response.py +98 -0
  73. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_folder_deleted_response_all_of_data.py +3 -0
  74. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_folder_query_changes.py +114 -0
  75. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_folder_query_changes_added_inner.py +88 -0
  76. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_folder_query_changes_response.py +98 -0
  77. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_folder_response.py +98 -0
  78. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_get_changes200_response.py +132 -0
  79. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_identity.py +115 -0
  80. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_identity_cursor_list_response.py +108 -0
  81. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_identity_list_meta.py +88 -0
  82. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_identity_response.py +98 -0
  83. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_me.py +119 -0
  84. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_me_item_response.py +98 -0
  85. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_message.py +217 -0
  86. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_message_content.py +140 -0
  87. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_message_content_body.py +148 -0
  88. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_message_content_body_html_cleaning.py +97 -0
  89. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_message_content_dates.py +98 -0
  90. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_message_content_participants.py +131 -0
  91. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_message_content_response.py +98 -0
  92. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_message_content_response_all_of_data.py +3 -0
  93. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_message_content_states.py +93 -0
  94. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_message_count.py +93 -0
  95. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_message_count_response.py +98 -0
  96. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_message_deleted_response.py +98 -0
  97. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_message_detail_response.py +98 -0
  98. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_message_flags.py +92 -0
  99. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_message_query_changes.py +114 -0
  100. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_message_query_changes_response.py +98 -0
  101. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_message_summary.py +188 -0
  102. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_message_summary_cursor_list_response.py +108 -0
  103. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_query_meta.py +88 -0
  104. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_quota.py +119 -0
  105. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_quota_cursor_list_response.py +108 -0
  106. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_raw_body.py +114 -0
  107. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_raw_body_body.py +107 -0
  108. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_raw_body_response.py +98 -0
  109. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_raw_body_response_all_of_data.py +3 -0
  110. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_realtime_event.py +150 -0
  111. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_realtime_message.py +201 -0
  112. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_realtime_message_all_of_body.py +3 -0
  113. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_realtime_message_body.py +102 -0
  114. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_search_snippet.py +100 -0
  115. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_search_snippets_result.py +103 -0
  116. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_search_snippets_result_response.py +98 -0
  117. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_send_result_response.py +98 -0
  118. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_send_scope.py +97 -0
  119. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_sender_choices.py +98 -0
  120. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_sender_choices_from.py +89 -0
  121. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_sender_choices_reply_to.py +89 -0
  122. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_sender_choices_response.py +98 -0
  123. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_session.py +120 -0
  124. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_session_capabilities.py +132 -0
  125. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_session_capabilities_attachments.py +96 -0
  126. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_session_capabilities_folders.py +98 -0
  127. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_session_capabilities_identities.py +94 -0
  128. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_session_capabilities_messages.py +120 -0
  129. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_session_capabilities_quotas.py +92 -0
  130. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_session_capabilities_submissions.py +92 -0
  131. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_session_capabilities_sync.py +106 -0
  132. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_session_capabilities_threads.py +94 -0
  133. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_session_endpoints.py +98 -0
  134. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_session_gated.py +108 -0
  135. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_session_limits.py +113 -0
  136. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_session_mailbox.py +95 -0
  137. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_session_response.py +98 -0
  138. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_session_states.py +96 -0
  139. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_submission.py +146 -0
  140. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_submission_cursor_list_response.py +108 -0
  141. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_submission_delivery_status.py +107 -0
  142. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_submission_envelope.py +104 -0
  143. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_submission_envelope_address.py +93 -0
  144. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_submission_envelope_rcpt_to_inner.py +3 -0
  145. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_submission_response.py +98 -0
  146. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_sync_meta.py +88 -0
  147. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_thread.py +130 -0
  148. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_thread_content_meta.py +104 -0
  149. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_thread_content_meta_states.py +100 -0
  150. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_thread_content_response.py +108 -0
  151. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_thread_content_response_all_of_data.py +3 -0
  152. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_thread_detail_response.py +98 -0
  153. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_thread_message_summary_cursor_list_response.py +108 -0
  154. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_thread_messages_meta.py +90 -0
  155. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_thread_summary.py +128 -0
  156. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_thread_summary_cursor_list_response.py +108 -0
  157. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_thread_summary_states.py +98 -0
  158. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_typed_changes.py +90 -0
  159. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_typed_changes_response.py +98 -0
  160. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_typed_changes_types.py +115 -0
  161. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_usage.py +100 -0
  162. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_usage_resource.py +128 -0
  163. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_usage_response.py +98 -0
  164. qubrics_mailbox-3.0.0/qubrics/mailbox/models/mailbox_usage_states.py +91 -0
  165. qubrics_mailbox-3.0.0/qubrics/mailbox/models/patch_mailbox_folder_body.py +95 -0
  166. qubrics_mailbox-3.0.0/qubrics/mailbox/models/patch_mailbox_message_body.py +90 -0
  167. qubrics_mailbox-3.0.0/qubrics/mailbox/models/response_meta.py +86 -0
  168. qubrics_mailbox-3.0.0/qubrics/mailbox/models/send_mailbox_draft.py +92 -0
  169. qubrics_mailbox-3.0.0/qubrics/mailbox/models/send_mailbox_message_body.py +145 -0
  170. qubrics_mailbox-3.0.0/qubrics/mailbox/models/send_mailbox_message_body_attachments_inner.py +132 -0
  171. qubrics_mailbox-3.0.0/qubrics/mailbox/models/send_mailbox_message_body_attachments_inner_any_of.py +90 -0
  172. qubrics_mailbox-3.0.0/qubrics/mailbox/models/send_mailbox_message_body_attachments_inner_any_of1.py +90 -0
  173. qubrics_mailbox-3.0.0/qubrics/mailbox/models/send_mailbox_message_result.py +95 -0
  174. qubrics_mailbox-3.0.0/qubrics/mailbox/models/success_envelope.py +88 -0
  175. qubrics_mailbox-3.0.0/qubrics/mailbox/models/update_mailbox_draft.py +148 -0
  176. qubrics_mailbox-3.0.0/qubrics/mailbox/models/update_mailbox_identity_body.py +106 -0
  177. qubrics_mailbox-3.0.0/qubrics/mailbox/py.typed +0 -0
  178. qubrics_mailbox-3.0.0/qubrics/mailbox/rest.py +263 -0
@@ -0,0 +1,22 @@
1
+ node_modules/
2
+ .venv/
3
+ .pytest_cache/
4
+ dist/
5
+ .tmp/
6
+ coverage/
7
+ .DS_Store
8
+ *.log
9
+ *.snap
10
+ snapcraft-*.txt
11
+ *.codegen.json
12
+ .codegen/
13
+ .codegraph/
14
+ *.tsbuildinfo
15
+ packages/ts/cli/oclif.manifest.json
16
+ packages/ts/cli/tmp/
17
+ .phpunit.result.cache
18
+ __pycache__/
19
+ *.py[cod]
20
+ vendor/
21
+ .bundle/
22
+ target/
@@ -0,0 +1,151 @@
1
+ # Changelog
2
+
3
+ ## [3.0.0](https://github.com/qubrics/qubrics-sdk/compare/python-mailbox-v2.0.2...python-mailbox-v3.0.0) (2026-11-18)
4
+
5
+ ### ⚠ BREAKING CHANGES
6
+
7
+ * Import the client from `qubrics.mailbox`.
8
+
9
+ ### Features
10
+
11
+ * Version 3.0.0 excludes calendar and calendar-event clients and models. Mail, folders, drafts and mailbox event streams remain available.
12
+
13
+ ## [2.0.2](https://github.com/Sendmux/sendmux-sdk/compare/python-mailbox-v2.0.1...python-mailbox-v2.0.2) (2026-09-21)
14
+
15
+
16
+ ### Fixed
17
+
18
+ * **Mailbox models:** `MailboxMessage` now carries `message_id`, `in_reply_to` and `references` (`List[str]`, the header values with the surrounding angle brackets removed) and `reply_to` (`List[MailboxAddress]`), which the deployed app schema declares as required on every message; 2.0.1 did not know these fields, so `from_dict` dropped them and message lists, thread messages and `mailbox_get_message` results could not expose the threading headers. Response payloads are typed with the canonical models instead of generated copies: `MailboxMessageContentResponse.data` and each `MailboxThreadContentResponse.data` item are `MailboxMessageContent`, `MailboxRawBodyResponse.data` is `MailboxRawBody`, and `MailboxSubmissionEnvelope.rcpt_to` is `List[MailboxSubmissionEnvelopeAddress]`, so `isinstance` checks and type annotations written against those classes now hold. The former `MailboxMessageContentResponseAllOfData`, `MailboxThreadContentResponseAllOfData`, `MailboxRawBodyResponseAllOfData` and `MailboxSubmissionEnvelopeRcptToInner` names keep working as deprecated aliases of those classes (one `DeprecationWarning` naming the replacement; removed in sendmux-mailbox 3.0). The wire format is unchanged, and no operation was added, removed or renamed.
19
+
20
+ ### Bug Fixes
21
+
22
+ * **python-mailbox:** regenerate mailbox models from the deployed v1.8.250 schema ([88c40fa](https://github.com/Sendmux/sendmux-sdk/commit/88c40fa582602016f6e585d9102da26b29048ae0))
23
+
24
+ ## [2.0.1](https://github.com/Sendmux/sendmux-sdk/compare/python-mailbox-v2.0.0...python-mailbox-v2.0.1) (2026-09-20)
25
+
26
+
27
+ ### Deprecated
28
+
29
+ * `sendmux_mailbox.MailboxRealtimeMessageAllOfBody` and `sendmux_mailbox.models.MailboxRealtimeMessageAllOfBody` are now aliases of `MailboxRealtimeMessageBody`, the type of `MailboxRealtimeMessage.body`. Reading the old name still works and emits a `DeprecationWarning` naming the replacement; the alias is removed in the next major, 3.0 ([e0b3456](https://github.com/Sendmux/sendmux-sdk/commit/e0b3456a0a5a1e09d7a5bc98142605177e3c819b)).
30
+
31
+ ### Changed
32
+
33
+ * Models are regenerated from the deployed flattened response schemas (docs 86b0f45): `MailboxMe`, `MailboxMessage`, `MailboxRealtimeMessage` and `MailboxThread` are flat objects instead of `allOf` compositions and carry the same fields, so the wire format is unchanged and `MailboxRealtimeMessageBody` is the generated name of the realtime message body. The `sendmux_mailbox.Mailbox` model (`sendmux_mailbox.models.mailbox`), which no operation, README, guide or test referenced, is removed without a deprecation period; `mailbox_get_me` keeps returning `MailboxMe`, which carries the same fields plus `quota_used_bytes` ([1a57997](https://github.com/Sendmux/sendmux-sdk/commit/1a57997bef97d065f24aa0b6cfec2acceb191744)).
34
+
35
+ ### Bug Fixes
36
+
37
+ * **python-mailbox:** regenerate flattened mailbox response models ([1a57997](https://github.com/Sendmux/sendmux-sdk/commit/1a57997bef97d065f24aa0b6cfec2acceb191744))
38
+ * regenerate SDKs from the deployed flattened response schemas (docs 86b0f45) ([628b161](https://github.com/Sendmux/sendmux-sdk/commit/628b161d2692775ac1f4830c1d64c024ba04ed83))
39
+
40
+
41
+ ### Documentation
42
+
43
+ * **python-mailbox:** replace the pre-release migration note with the 1.x to 2.0 guide ([1ed2c23](https://github.com/Sendmux/sendmux-sdk/commit/1ed2c23aff0c79d7810f7230decf73e79c71e0df))
44
+
45
+ ## [2.0.0](https://github.com/Sendmux/sendmux-sdk/compare/python-mailbox-v1.5.1...python-mailbox-v2.0.0) (2026-09-15)
46
+
47
+
48
+ ### ⚠ BREAKING CHANGES
49
+
50
+ * Thread-message lists now return `MailboxThreadMessageSummaryCursorListResponse` instead of the ordinary message-list response type, with required `meta.thread_id` and typed optional `meta.sync_state`; ordinary message lists remain thread-independent.
51
+ * Identity, submission, quota, and thread list responses expose typed state metadata where applicable.
52
+ * Upgrade the distribution, lockfile, and affected annotations or fixtures together; restore all three together to roll back.
53
+
54
+
55
+ ### Bug Fixes
56
+
57
+ * prepare mailbox SDK major releases ([dc01472](https://github.com/Sendmux/sendmux-sdk/commit/dc014724f7f6eb6b93293e6acbcc1a36c5060ebb))
58
+ * **mailbox:** preserve core error propagation with a `sendmux-core` minimum of `1.3.1`
59
+
60
+ ## [1.5.1](https://github.com/Sendmux/sendmux-sdk/compare/python-mailbox-v1.5.0...python-mailbox-v1.5.1) (2026-09-11)
61
+
62
+
63
+ ### Bug Fixes
64
+
65
+ * **sdk:** preserve streaming arguments and prepare PHP OAuth release ([#207](https://github.com/Sendmux/sendmux-sdk/issues/207)) ([c534588](https://github.com/Sendmux/sendmux-sdk/commit/c53458875cef0bbd601c982308d84bc4e87c961c))
66
+
67
+ ## [1.5.0](https://github.com/Sendmux/sendmux-sdk/compare/python-mailbox-v1.4.0...python-mailbox-v1.5.0) (2026-09-10)
68
+
69
+
70
+ ### Features
71
+
72
+ * add REST OAuth clients and CLI token lifecycle ([cc4a3aa](https://github.com/Sendmux/sendmux-sdk/commit/cc4a3aa6110378641418a94455ed5b9a986e65ff))
73
+
74
+ ## [1.4.0](https://github.com/Sendmux/sendmux-sdk/compare/python-mailbox-v1.3.0...python-mailbox-v1.4.0) (2026-09-08)
75
+
76
+
77
+ ### Features
78
+
79
+ * add connection checks across SDKs, CLI and MCP ([77f449e](https://github.com/Sendmux/sendmux-sdk/commit/77f449e2c8cba49bc8bc84c49c35baa61120866a))
80
+ * **sdk:** add connection checks across clients, CLI and MCP ([3e02c67](https://github.com/Sendmux/sendmux-sdk/commit/3e02c67dcab45e37dad7abbdd4c4e1bd0b1fbbe6))
81
+
82
+ ### Bug Fixes
83
+
84
+ * Require `sendmux-core>=1.2.0` so installed clients configure Bearer authentication and accept scoped agent tokens.
85
+
86
+ ## [1.3.0](https://github.com/Sendmux/sendmux-sdk/compare/python-mailbox-v1.2.0...python-mailbox-v1.3.0) (2026-07-22)
87
+
88
+
89
+ ### Features
90
+
91
+ * add @sendmux/ai-sdk and langchain-sendmux framework wrapper packages ([1884e8d](https://github.com/Sendmux/sendmux-sdk/commit/1884e8dba80778fe71b90a49d4e4e4b9a77f5da1))
92
+
93
+ ## [1.2.0](https://github.com/Sendmux/sendmux-sdk/compare/python-mailbox-v1.1.0...python-mailbox-v1.2.0) (2026-07-08)
94
+
95
+
96
+ ### Features
97
+
98
+ * **sdk:** add sending attachment upload surfaces ([#96](https://github.com/Sendmux/sendmux-sdk/issues/96)) ([b8f9d5f](https://github.com/Sendmux/sendmux-sdk/commit/b8f9d5fe3c1ae510db82ce05c55cbcad92b43b44))
99
+
100
+ ## [1.1.0](https://github.com/Sendmux/sendmux-sdk/compare/python-mailbox-v1.0.4...python-mailbox-v1.1.0) (2026-07-03)
101
+
102
+
103
+ ### Features
104
+
105
+ * **sdk:** add zero-context attachment uploads ([a4352ec](https://github.com/Sendmux/sendmux-sdk/commit/a4352ecfd6f2da37c908387450fea141363d0b81))
106
+ * **sdk:** make mailbox attachments agent-ready ([6a145ab](https://github.com/Sendmux/sendmux-sdk/commit/6a145ab1f2735d77783fb36e84aeeeb9bc747827))
107
+ * **sdk:** make mailbox attachments agent-ready ([457ed62](https://github.com/Sendmux/sendmux-sdk/commit/457ed62cf32c91aeac1cfe230d50f4f0b922e7cb))
108
+
109
+
110
+ ### Bug Fixes
111
+
112
+ * **sdk:** harden attachment helper streaming ([f848991](https://github.com/Sendmux/sendmux-sdk/commit/f8489914c035b2ef032a0dead4b4bedcc30172ba))
113
+ * **sdk:** preserve attachment compatibility checks ([e92a1c2](https://github.com/Sendmux/sendmux-sdk/commit/e92a1c250a062f2f39a4f78c166c9e3a743e97ee))
114
+ * **sdk:** regenerate attachment download auth models ([6803890](https://github.com/Sendmux/sendmux-sdk/commit/6803890bad5aba610d5c6ad16ca98d7186ef9347))
115
+ * **sdk:** tolerate realtime events without attachments ([2d2b117](https://github.com/Sendmux/sendmux-sdk/commit/2d2b117945445b0478cf3f1d4f07b1038097f05f))
116
+
117
+ ## [1.0.4](https://github.com/Sendmux/sendmux-sdk/compare/python-mailbox-v1.0.3...python-mailbox-v1.0.4) (2026-06-19)
118
+
119
+
120
+ ### Bug Fixes
121
+
122
+ * **python:** add package metadata classifiers ([9a79f5d](https://github.com/Sendmux/sendmux-sdk/commit/9a79f5d118766c5a59fdc9e568f4cf08874f1486))
123
+
124
+ ## [1.0.3](https://github.com/Sendmux/sendmux-sdk/compare/python-mailbox-v1.0.2...python-mailbox-v1.0.3) (2026-06-18)
125
+
126
+
127
+ ### Documentation
128
+
129
+ * update Sendmux docs links ([24b89cb](https://github.com/Sendmux/sendmux-sdk/commit/24b89cb851dd8f37dd1304eb292681892bad077d))
130
+
131
+ ## [1.0.2](https://github.com/Sendmux/sendmux-sdk/compare/python-mailbox-v1.0.1...python-mailbox-v1.0.2) (2026-06-17)
132
+
133
+
134
+ ### Bug Fixes
135
+
136
+ * keep generated python package versions current ([#26](https://github.com/Sendmux/sendmux-sdk/issues/26)) ([3405116](https://github.com/Sendmux/sendmux-sdk/commit/3405116d0ee8ec538de2b09897ebae101a714b28))
137
+ * **python:** derive generated runtime version dynamically ([#30](https://github.com/Sendmux/sendmux-sdk/issues/30)) ([2c2100b](https://github.com/Sendmux/sendmux-sdk/commit/2c2100ba5e069229dc5bf4ea62056c3c479a5152))
138
+
139
+ ## [1.0.1](https://github.com/Sendmux/sendmux-sdk/compare/python-mailbox-v1.0.0...python-mailbox-v1.0.1) (2026-06-17)
140
+
141
+
142
+ ### Bug Fixes
143
+
144
+ * **python:** publish dists with supported metadata ([e5506e7](https://github.com/Sendmux/sendmux-sdk/commit/e5506e71410a61a7ddcf547f67f863ff2cfc60d6))
145
+
146
+ ## 1.0.0 (2026-06-01)
147
+
148
+
149
+ ### Features
150
+
151
+ * **python-sdk:** add generated Python packages ([82c4a84](https://github.com/Sendmux/sendmux-sdk/commit/82c4a84976b4d9802f993b07302430546a323543))
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sendmux
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,246 @@
1
+ Metadata-Version: 2.4
2
+ Name: qubrics-mailbox
3
+ Version: 3.0.0
4
+ Summary: Generated Python client for the Qubrics Mailbox API.
5
+ Project-URL: Repository, https://github.com/qubrics/qubrics-sdk
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3.10
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Requires-Python: >=3.10
15
+ Requires-Dist: certifi
16
+ Requires-Dist: pydantic<3,>=2
17
+ Requires-Dist: python-dateutil>=2.8.2
18
+ Requires-Dist: qubrics-core<3.0.0,>=2.0.0
19
+ Requires-Dist: typing-extensions>=4.7.1
20
+ Requires-Dist: urllib3<3,>=2.3.0
21
+ Description-Content-Type: text/markdown
22
+
23
+ # qubrics-mailbox
24
+
25
+ [![PyPI version](https://img.shields.io/pypi/v/qubrics-mailbox)](https://pypi.org/project/qubrics-mailbox/)
26
+ [![Python versions](https://img.shields.io/pypi/pyversions/qubrics-mailbox)](https://pypi.org/project/qubrics-mailbox/)
27
+ [![PyPI downloads](https://img.shields.io/pypi/dm/qubrics-mailbox)](https://pypi.org/project/qubrics-mailbox/)
28
+ [![Licence](https://img.shields.io/pypi/l/qubrics-mailbox)](https://github.com/qubrics/qubrics-sdk/blob/main/LICENSE)
29
+
30
+ Generated Python client for the Qubrics Mailbox API.
31
+
32
+ Version 3.0.0 excludes calendar and calendar-event clients and models. Mail,
33
+ folders, drafts and mailbox event streams remain available.
34
+
35
+ ## Documentation
36
+
37
+ - Mailbox API reference: [qubrics.com/docs/mailbox-api/introduction](https://qubrics.com/docs/mailbox-api/introduction)
38
+ - Source repository: [qubrics/qubrics-sdk](https://github.com/qubrics/qubrics-sdk)
39
+
40
+ ## Requirements
41
+
42
+ - Python 3.10 or newer.
43
+ - A mailbox-scoped `smx_mbx_*` key or scoped `smx_agent_*` token.
44
+
45
+ For OAuth, use a REST access token with the scopes and mailbox access required by the operation. See [OAuth for REST APIs](https://qubrics.com/docs/developer-tools/oauth).
46
+
47
+ ## Installation
48
+
49
+ These commands target the Qubrics release of `qubrics-mailbox`. Until it is published, install `sendmux-mailbox` with its existing import names.
50
+
51
+ ```sh
52
+ pip install qubrics-mailbox
53
+ ```
54
+
55
+ ## OAuth access tokens
56
+
57
+ Pass either `api_key` or `access_token`. `access_token` accepts a bare token string or a synchronous callable; the callable is evaluated for each authenticated request. Your application owns token storage, expiry checks and refresh coordination.
58
+
59
+ ```python
60
+ import os
61
+
62
+ from qubrics.mailbox import create_mailbox_client
63
+
64
+ client = create_mailbox_client(
65
+ access_token=lambda: os.environ["QUBRICS_ACCESS_TOKEN"]
66
+ )
67
+ ```
68
+
69
+ ## Usage
70
+
71
+ ```python
72
+ import os
73
+
74
+ from qubrics.mailbox import MailboxAPIApi, create_mailbox_client, iter_mailbox_events
75
+
76
+ client = create_mailbox_client(api_key=os.environ["QUBRICS_MAILBOX_API_KEY"])
77
+ api = MailboxAPIApi(client)
78
+
79
+ messages = api.mailbox_list_messages(limit=25)
80
+
81
+ for message in messages.data:
82
+ print(message.id, message.subject)
83
+ ```
84
+
85
+ The package exports every generated Mailbox model and API class plus:
86
+
87
+ - `create_mailbox_client`
88
+ - `configure_mailbox`
89
+ - `QubricsMailboxApiClient`
90
+ - `iter_mailbox_events`
91
+ - file helpers: `upload_mailbox_attachment_from_file`, `create_mailbox_attachment_upload_from_file`, `upload_mailbox_attachment_via_presigned_file`, and `send_mailbox_message_with_files`
92
+
93
+ ## Connection checks
94
+
95
+ Check the current credential before choosing a mailbox:
96
+
97
+ ```python
98
+ with create_mailbox_client(api_key=os.environ["QUBRICS_MAILBOX_API_KEY"]) as client:
99
+ connection = MailboxAPIApi(client).mailbox_get_connection()
100
+ print(connection.data.label)
101
+ ```
102
+
103
+ The result includes team and credential details, permissions and authorised mailboxes.
104
+
105
+ ## Attachments
106
+
107
+ Message and event attachment metadata includes `download_url`, a short-lived presigned URL for that single attachment. Prefer `download_mailbox_attachment()` or `read_mailbox_text_attachment()` when you already have an authenticated client. Plain HTTP clients can fetch `download_url` promptly with no `Authorization` header; if it expires, call `mailbox_get_message()` or list/search messages again to receive fresh metadata.
108
+
109
+ Mailbox direct uploads, presigned uploads, and file helpers share the mailbox attachment cap, currently `7,500,000` bytes per attachment. Presigned uploads also pin the exact declared byte length and content type.
110
+
111
+ ```python
112
+ import os
113
+ import urllib.request
114
+
115
+ from qubrics.mailbox import MailboxAPIApi, create_mailbox_client, read_mailbox_text_attachment
116
+
117
+ client = create_mailbox_client(api_key=os.environ["QUBRICS_MAILBOX_API_KEY"])
118
+ api = MailboxAPIApi(client)
119
+
120
+ message = api.mailbox_get_message("msg_123")
121
+ attachment = message.data.attachments[0]
122
+ content = urllib.request.urlopen(attachment.download_url, timeout=30).read()
123
+ text = read_mailbox_text_attachment(
124
+ client,
125
+ message_id="msg_123",
126
+ attachment_id=attachment.id,
127
+ )
128
+
129
+ upload = api.mailbox_upload_attachment(
130
+ body=b"hello\n",
131
+ filename="hello.txt",
132
+ _headers={"Content-Type": "text/plain"},
133
+ )
134
+
135
+ api.mailbox_send_message(
136
+ send_mailbox_message_body={
137
+ "to": [{"email": "recipient@example.com", "name": None}],
138
+ "subject": "Attachment",
139
+ "text_body": "See attached.",
140
+ "attachments": [{
141
+ "blob_id": upload.data.blob_id,
142
+ "filename": "hello.txt",
143
+ "content_type": "text/plain",
144
+ }],
145
+ },
146
+ )
147
+ ```
148
+
149
+ For local files, use helper functions so file bytes stay out of model context:
150
+
151
+ ```python
152
+ import os
153
+
154
+ from qubrics.mailbox import create_mailbox_client, send_mailbox_message_with_files
155
+
156
+ client = create_mailbox_client(api_key=os.environ["QUBRICS_MAILBOX_API_KEY"])
157
+
158
+ send_mailbox_message_with_files(
159
+ client,
160
+ files=["./report.pdf"],
161
+ idempotency_key="report-123",
162
+ body={
163
+ "to": [{"email": "recipient@example.com", "name": None}],
164
+ "subject": "Report",
165
+ "text_body": "Attached.",
166
+ },
167
+ )
168
+ ```
169
+
170
+ Use `upload_mailbox_attachment_via_presigned_file(...)` when you want the upload step to use the short-lived signed URL and no API key on the file `PUT`. Inline base64 attachments remain available for tiny generated sends through the generated `attachments[].content` body shape.
171
+
172
+ ## Events
173
+
174
+ Use `iter_mailbox_events` for typed server-sent mailbox events.
175
+
176
+ ```python
177
+ for event in iter_mailbox_events(
178
+ client,
179
+ close_after=300,
180
+ event_types="message.received",
181
+ ):
182
+ print(event.event_type, event.message_id)
183
+ ```
184
+
185
+ ## Pagination
186
+
187
+ Use `iter_cursor_pages` from `qubrics-core` with list operations that return cursor pagination.
188
+
189
+ ```python
190
+ import os
191
+
192
+ from qubrics.core import iter_cursor_pages
193
+ from qubrics.mailbox import MailboxAPIApi, create_mailbox_client
194
+
195
+ client = create_mailbox_client(api_key=os.environ["QUBRICS_MAILBOX_API_KEY"])
196
+ api = MailboxAPIApi(client)
197
+
198
+ for message in iter_cursor_pages(lambda cursor: api.mailbox_list_messages(cursor=cursor, limit=50)):
199
+ print(message.id)
200
+ ```
201
+
202
+ ## Thread message model migration
203
+
204
+ If you annotate or construct thread-message list results (fixtures, mocks, or wrappers typed with the operation's result model), add the thread identity. `mailbox_list_thread_messages` returns `MailboxThreadMessageSummaryCursorListResponse` instead of `MailboxMessageSummaryCursorListResponse`: its `meta` is `MailboxThreadMessagesMeta`, whose `thread_id` is required and whose `sync_state` is an optional string. Code that only reads thread-message results keeps working.
205
+
206
+ 1. Update thread-message annotations and type checks to the thread-specific result model:
207
+
208
+ ```python
209
+ from qubrics.mailbox import MailboxThreadMessageSummaryCursorListResponse
210
+
211
+ # Before: isinstance(response, MailboxMessageSummaryCursorListResponse)
212
+ def is_thread_message_list(response: object) -> bool:
213
+ return isinstance(response, MailboxThreadMessageSummaryCursorListResponse)
214
+ ```
215
+
216
+ 2. Add the thread identity to every thread-message result you construct:
217
+
218
+ ```python
219
+ from qubrics.mailbox import MailboxThreadMessageSummaryCursorListResponse
220
+
221
+ # Before: "meta": {"request_id": "req_fixture"}
222
+ fixture = MailboxThreadMessageSummaryCursorListResponse.model_validate(
223
+ {
224
+ "ok": True,
225
+ "meta": {"request_id": "req_fixture", "thread_id": "thr_1"},
226
+ "data": [],
227
+ "pagination": {"has_more": False},
228
+ }
229
+ )
230
+ ```
231
+
232
+ Ordinary `mailbox_list_messages` results remain `MailboxMessageSummaryCursorListResponse`: they have no thread identity and their `meta` is `MailboxSyncMeta` with an optional `sync_state`. Identity, submission, quota, and thread list responses likewise carry `MailboxIdentityListMeta` or `MailboxQueryMeta` with optional `identity_state` or `query_state`; no new field is required there.
233
+
234
+ 3. Run your tests and `mypy`. A constructed thread-message result without `thread_id` fails validation with `meta.thread_id Field required`.
235
+
236
+ `MailboxRealtimeMessage.body` is a `MailboxRealtimeMessageBody`. The earlier generated name, `MailboxRealtimeMessageAllOfBody`, remains importable from `qubrics.mailbox` and `qubrics.mailbox.models` as a deprecated alias of that class: reading it emits a `DeprecationWarning`. Switch imports to `MailboxRealtimeMessageBody`.
237
+
238
+ Update `qubrics-mailbox`, its lockfile, and affected annotations or fixtures together. To roll back, restore those package, lockfile, and call-site changes together.
239
+
240
+ ## Support
241
+
242
+ Open an issue in [qubrics/qubrics-sdk](https://github.com/qubrics/qubrics-sdk/issues) with the package name, version, and request ID from any API error.
243
+
244
+ ## Licence
245
+
246
+ MIT. See the [licence file](https://github.com/qubrics/qubrics-sdk/blob/main/LICENSE).
@@ -0,0 +1,224 @@
1
+ # qubrics-mailbox
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/qubrics-mailbox)](https://pypi.org/project/qubrics-mailbox/)
4
+ [![Python versions](https://img.shields.io/pypi/pyversions/qubrics-mailbox)](https://pypi.org/project/qubrics-mailbox/)
5
+ [![PyPI downloads](https://img.shields.io/pypi/dm/qubrics-mailbox)](https://pypi.org/project/qubrics-mailbox/)
6
+ [![Licence](https://img.shields.io/pypi/l/qubrics-mailbox)](https://github.com/qubrics/qubrics-sdk/blob/main/LICENSE)
7
+
8
+ Generated Python client for the Qubrics Mailbox API.
9
+
10
+ Version 3.0.0 excludes calendar and calendar-event clients and models. Mail,
11
+ folders, drafts and mailbox event streams remain available.
12
+
13
+ ## Documentation
14
+
15
+ - Mailbox API reference: [qubrics.com/docs/mailbox-api/introduction](https://qubrics.com/docs/mailbox-api/introduction)
16
+ - Source repository: [qubrics/qubrics-sdk](https://github.com/qubrics/qubrics-sdk)
17
+
18
+ ## Requirements
19
+
20
+ - Python 3.10 or newer.
21
+ - A mailbox-scoped `smx_mbx_*` key or scoped `smx_agent_*` token.
22
+
23
+ For OAuth, use a REST access token with the scopes and mailbox access required by the operation. See [OAuth for REST APIs](https://qubrics.com/docs/developer-tools/oauth).
24
+
25
+ ## Installation
26
+
27
+ These commands target the Qubrics release of `qubrics-mailbox`. Until it is published, install `sendmux-mailbox` with its existing import names.
28
+
29
+ ```sh
30
+ pip install qubrics-mailbox
31
+ ```
32
+
33
+ ## OAuth access tokens
34
+
35
+ Pass either `api_key` or `access_token`. `access_token` accepts a bare token string or a synchronous callable; the callable is evaluated for each authenticated request. Your application owns token storage, expiry checks and refresh coordination.
36
+
37
+ ```python
38
+ import os
39
+
40
+ from qubrics.mailbox import create_mailbox_client
41
+
42
+ client = create_mailbox_client(
43
+ access_token=lambda: os.environ["QUBRICS_ACCESS_TOKEN"]
44
+ )
45
+ ```
46
+
47
+ ## Usage
48
+
49
+ ```python
50
+ import os
51
+
52
+ from qubrics.mailbox import MailboxAPIApi, create_mailbox_client, iter_mailbox_events
53
+
54
+ client = create_mailbox_client(api_key=os.environ["QUBRICS_MAILBOX_API_KEY"])
55
+ api = MailboxAPIApi(client)
56
+
57
+ messages = api.mailbox_list_messages(limit=25)
58
+
59
+ for message in messages.data:
60
+ print(message.id, message.subject)
61
+ ```
62
+
63
+ The package exports every generated Mailbox model and API class plus:
64
+
65
+ - `create_mailbox_client`
66
+ - `configure_mailbox`
67
+ - `QubricsMailboxApiClient`
68
+ - `iter_mailbox_events`
69
+ - file helpers: `upload_mailbox_attachment_from_file`, `create_mailbox_attachment_upload_from_file`, `upload_mailbox_attachment_via_presigned_file`, and `send_mailbox_message_with_files`
70
+
71
+ ## Connection checks
72
+
73
+ Check the current credential before choosing a mailbox:
74
+
75
+ ```python
76
+ with create_mailbox_client(api_key=os.environ["QUBRICS_MAILBOX_API_KEY"]) as client:
77
+ connection = MailboxAPIApi(client).mailbox_get_connection()
78
+ print(connection.data.label)
79
+ ```
80
+
81
+ The result includes team and credential details, permissions and authorised mailboxes.
82
+
83
+ ## Attachments
84
+
85
+ Message and event attachment metadata includes `download_url`, a short-lived presigned URL for that single attachment. Prefer `download_mailbox_attachment()` or `read_mailbox_text_attachment()` when you already have an authenticated client. Plain HTTP clients can fetch `download_url` promptly with no `Authorization` header; if it expires, call `mailbox_get_message()` or list/search messages again to receive fresh metadata.
86
+
87
+ Mailbox direct uploads, presigned uploads, and file helpers share the mailbox attachment cap, currently `7,500,000` bytes per attachment. Presigned uploads also pin the exact declared byte length and content type.
88
+
89
+ ```python
90
+ import os
91
+ import urllib.request
92
+
93
+ from qubrics.mailbox import MailboxAPIApi, create_mailbox_client, read_mailbox_text_attachment
94
+
95
+ client = create_mailbox_client(api_key=os.environ["QUBRICS_MAILBOX_API_KEY"])
96
+ api = MailboxAPIApi(client)
97
+
98
+ message = api.mailbox_get_message("msg_123")
99
+ attachment = message.data.attachments[0]
100
+ content = urllib.request.urlopen(attachment.download_url, timeout=30).read()
101
+ text = read_mailbox_text_attachment(
102
+ client,
103
+ message_id="msg_123",
104
+ attachment_id=attachment.id,
105
+ )
106
+
107
+ upload = api.mailbox_upload_attachment(
108
+ body=b"hello\n",
109
+ filename="hello.txt",
110
+ _headers={"Content-Type": "text/plain"},
111
+ )
112
+
113
+ api.mailbox_send_message(
114
+ send_mailbox_message_body={
115
+ "to": [{"email": "recipient@example.com", "name": None}],
116
+ "subject": "Attachment",
117
+ "text_body": "See attached.",
118
+ "attachments": [{
119
+ "blob_id": upload.data.blob_id,
120
+ "filename": "hello.txt",
121
+ "content_type": "text/plain",
122
+ }],
123
+ },
124
+ )
125
+ ```
126
+
127
+ For local files, use helper functions so file bytes stay out of model context:
128
+
129
+ ```python
130
+ import os
131
+
132
+ from qubrics.mailbox import create_mailbox_client, send_mailbox_message_with_files
133
+
134
+ client = create_mailbox_client(api_key=os.environ["QUBRICS_MAILBOX_API_KEY"])
135
+
136
+ send_mailbox_message_with_files(
137
+ client,
138
+ files=["./report.pdf"],
139
+ idempotency_key="report-123",
140
+ body={
141
+ "to": [{"email": "recipient@example.com", "name": None}],
142
+ "subject": "Report",
143
+ "text_body": "Attached.",
144
+ },
145
+ )
146
+ ```
147
+
148
+ Use `upload_mailbox_attachment_via_presigned_file(...)` when you want the upload step to use the short-lived signed URL and no API key on the file `PUT`. Inline base64 attachments remain available for tiny generated sends through the generated `attachments[].content` body shape.
149
+
150
+ ## Events
151
+
152
+ Use `iter_mailbox_events` for typed server-sent mailbox events.
153
+
154
+ ```python
155
+ for event in iter_mailbox_events(
156
+ client,
157
+ close_after=300,
158
+ event_types="message.received",
159
+ ):
160
+ print(event.event_type, event.message_id)
161
+ ```
162
+
163
+ ## Pagination
164
+
165
+ Use `iter_cursor_pages` from `qubrics-core` with list operations that return cursor pagination.
166
+
167
+ ```python
168
+ import os
169
+
170
+ from qubrics.core import iter_cursor_pages
171
+ from qubrics.mailbox import MailboxAPIApi, create_mailbox_client
172
+
173
+ client = create_mailbox_client(api_key=os.environ["QUBRICS_MAILBOX_API_KEY"])
174
+ api = MailboxAPIApi(client)
175
+
176
+ for message in iter_cursor_pages(lambda cursor: api.mailbox_list_messages(cursor=cursor, limit=50)):
177
+ print(message.id)
178
+ ```
179
+
180
+ ## Thread message model migration
181
+
182
+ If you annotate or construct thread-message list results (fixtures, mocks, or wrappers typed with the operation's result model), add the thread identity. `mailbox_list_thread_messages` returns `MailboxThreadMessageSummaryCursorListResponse` instead of `MailboxMessageSummaryCursorListResponse`: its `meta` is `MailboxThreadMessagesMeta`, whose `thread_id` is required and whose `sync_state` is an optional string. Code that only reads thread-message results keeps working.
183
+
184
+ 1. Update thread-message annotations and type checks to the thread-specific result model:
185
+
186
+ ```python
187
+ from qubrics.mailbox import MailboxThreadMessageSummaryCursorListResponse
188
+
189
+ # Before: isinstance(response, MailboxMessageSummaryCursorListResponse)
190
+ def is_thread_message_list(response: object) -> bool:
191
+ return isinstance(response, MailboxThreadMessageSummaryCursorListResponse)
192
+ ```
193
+
194
+ 2. Add the thread identity to every thread-message result you construct:
195
+
196
+ ```python
197
+ from qubrics.mailbox import MailboxThreadMessageSummaryCursorListResponse
198
+
199
+ # Before: "meta": {"request_id": "req_fixture"}
200
+ fixture = MailboxThreadMessageSummaryCursorListResponse.model_validate(
201
+ {
202
+ "ok": True,
203
+ "meta": {"request_id": "req_fixture", "thread_id": "thr_1"},
204
+ "data": [],
205
+ "pagination": {"has_more": False},
206
+ }
207
+ )
208
+ ```
209
+
210
+ Ordinary `mailbox_list_messages` results remain `MailboxMessageSummaryCursorListResponse`: they have no thread identity and their `meta` is `MailboxSyncMeta` with an optional `sync_state`. Identity, submission, quota, and thread list responses likewise carry `MailboxIdentityListMeta` or `MailboxQueryMeta` with optional `identity_state` or `query_state`; no new field is required there.
211
+
212
+ 3. Run your tests and `mypy`. A constructed thread-message result without `thread_id` fails validation with `meta.thread_id Field required`.
213
+
214
+ `MailboxRealtimeMessage.body` is a `MailboxRealtimeMessageBody`. The earlier generated name, `MailboxRealtimeMessageAllOfBody`, remains importable from `qubrics.mailbox` and `qubrics.mailbox.models` as a deprecated alias of that class: reading it emits a `DeprecationWarning`. Switch imports to `MailboxRealtimeMessageBody`.
215
+
216
+ Update `qubrics-mailbox`, its lockfile, and affected annotations or fixtures together. To roll back, restore those package, lockfile, and call-site changes together.
217
+
218
+ ## Support
219
+
220
+ Open an issue in [qubrics/qubrics-sdk](https://github.com/qubrics/qubrics-sdk/issues) with the package name, version, and request ID from any API error.
221
+
222
+ ## Licence
223
+
224
+ MIT. See the [licence file](https://github.com/qubrics/qubrics-sdk/blob/main/LICENSE).