linq-python 0.5.0__tar.gz → 0.6.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 (187) hide show
  1. linq_python-0.6.0/.release-please-manifest.json +3 -0
  2. {linq_python-0.5.0 → linq_python-0.6.0}/CHANGELOG.md +14 -0
  3. {linq_python-0.5.0 → linq_python-0.6.0}/PKG-INFO +1 -1
  4. {linq_python-0.5.0 → linq_python-0.6.0}/pyproject.toml +1 -1
  5. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_client.py +23 -1
  6. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_qs.py +2 -6
  7. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_types.py +3 -0
  8. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_utils/_utils.py +34 -8
  9. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_version.py +1 -1
  10. {linq_python-0.5.0 → linq_python-0.6.0}/tests/api_resources/test_chats.py +2 -2
  11. {linq_python-0.5.0 → linq_python-0.6.0}/tests/api_resources/test_messages.py +2 -2
  12. {linq_python-0.5.0 → linq_python-0.6.0}/tests/test_extract_files.py +23 -5
  13. {linq_python-0.5.0 → linq_python-0.6.0}/tests/test_files.py +1 -1
  14. linq_python-0.5.0/.release-please-manifest.json +0 -3
  15. {linq_python-0.5.0 → linq_python-0.6.0}/.gitignore +0 -0
  16. {linq_python-0.5.0 → linq_python-0.6.0}/CONTRIBUTING.md +0 -0
  17. {linq_python-0.5.0 → linq_python-0.6.0}/LICENSE +0 -0
  18. {linq_python-0.5.0 → linq_python-0.6.0}/README.md +0 -0
  19. {linq_python-0.5.0 → linq_python-0.6.0}/SECURITY.md +0 -0
  20. {linq_python-0.5.0 → linq_python-0.6.0}/api.md +0 -0
  21. {linq_python-0.5.0 → linq_python-0.6.0}/bin/check-release-environment +0 -0
  22. {linq_python-0.5.0 → linq_python-0.6.0}/bin/publish-pypi +0 -0
  23. {linq_python-0.5.0 → linq_python-0.6.0}/examples/.keep +0 -0
  24. {linq_python-0.5.0 → linq_python-0.6.0}/release-please-config.json +0 -0
  25. {linq_python-0.5.0 → linq_python-0.6.0}/requirements-dev.lock +0 -0
  26. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/__init__.py +0 -0
  27. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_base_client.py +0 -0
  28. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_compat.py +0 -0
  29. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_constants.py +0 -0
  30. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_exceptions.py +0 -0
  31. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_files.py +0 -0
  32. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_models.py +0 -0
  33. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_resource.py +0 -0
  34. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_response.py +0 -0
  35. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_streaming.py +0 -0
  36. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_utils/__init__.py +0 -0
  37. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_utils/_compat.py +0 -0
  38. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_utils/_datetime_parse.py +0 -0
  39. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_utils/_json.py +0 -0
  40. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_utils/_logs.py +0 -0
  41. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_utils/_path.py +0 -0
  42. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_utils/_proxy.py +0 -0
  43. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_utils/_reflection.py +0 -0
  44. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_utils/_resources_proxy.py +0 -0
  45. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_utils/_streams.py +0 -0
  46. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_utils/_sync.py +0 -0
  47. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_utils/_transform.py +0 -0
  48. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/_utils/_typing.py +0 -0
  49. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/lib/.keep +0 -0
  50. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/pagination.py +0 -0
  51. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/py.typed +0 -0
  52. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/resources/__init__.py +0 -0
  53. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/resources/attachments.py +0 -0
  54. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/resources/capability.py +0 -0
  55. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/resources/chats/__init__.py +0 -0
  56. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/resources/chats/chats.py +0 -0
  57. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/resources/chats/messages.py +0 -0
  58. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/resources/chats/participants.py +0 -0
  59. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/resources/chats/typing.py +0 -0
  60. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/resources/contact_card.py +0 -0
  61. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/resources/messages.py +0 -0
  62. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/resources/phone_numbers.py +0 -0
  63. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/resources/phonenumbers.py +0 -0
  64. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/resources/webhook_events.py +0 -0
  65. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/resources/webhook_subscriptions.py +0 -0
  66. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/resources/webhooks.py +0 -0
  67. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/__init__.py +0 -0
  68. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/attachment_create_params.py +0 -0
  69. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/attachment_create_response.py +0 -0
  70. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/attachment_retrieve_response.py +0 -0
  71. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/capability_check_RCS_params.py +0 -0
  72. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/capability_check_i_message_params.py +0 -0
  73. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chat.py +0 -0
  74. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chat_create_params.py +0 -0
  75. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chat_create_response.py +0 -0
  76. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chat_created_webhook_event.py +0 -0
  77. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chat_group_icon_update_failed_webhook_event.py +0 -0
  78. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chat_group_icon_updated_webhook_event.py +0 -0
  79. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chat_group_name_update_failed_webhook_event.py +0 -0
  80. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chat_group_name_updated_webhook_event.py +0 -0
  81. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chat_leave_chat_response.py +0 -0
  82. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chat_list_chats_params.py +0 -0
  83. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chat_send_voicememo_params.py +0 -0
  84. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chat_send_voicememo_response.py +0 -0
  85. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chat_typing_indicator_started_webhook_event.py +0 -0
  86. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chat_typing_indicator_stopped_webhook_event.py +0 -0
  87. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chat_update_params.py +0 -0
  88. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chat_update_response.py +0 -0
  89. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chats/__init__.py +0 -0
  90. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chats/message_list_params.py +0 -0
  91. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chats/message_send_params.py +0 -0
  92. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chats/message_send_response.py +0 -0
  93. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chats/participant_add_params.py +0 -0
  94. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chats/participant_add_response.py +0 -0
  95. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chats/participant_remove_params.py +0 -0
  96. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chats/participant_remove_response.py +0 -0
  97. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/chats/sent_message.py +0 -0
  98. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/contact_card_create_params.py +0 -0
  99. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/contact_card_retrieve_params.py +0 -0
  100. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/contact_card_retrieve_response.py +0 -0
  101. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/contact_card_update_params.py +0 -0
  102. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/events_webhook_event.py +0 -0
  103. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/handle_check_response.py +0 -0
  104. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/link_part_param.py +0 -0
  105. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/media_part_param.py +0 -0
  106. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/message.py +0 -0
  107. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/message_add_reaction_params.py +0 -0
  108. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/message_add_reaction_response.py +0 -0
  109. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/message_content_param.py +0 -0
  110. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/message_delivered_webhook_event.py +0 -0
  111. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/message_edited_webhook_event.py +0 -0
  112. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/message_effect.py +0 -0
  113. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/message_effect_param.py +0 -0
  114. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/message_event_v2.py +0 -0
  115. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/message_failed_webhook_event.py +0 -0
  116. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/message_list_messages_thread_params.py +0 -0
  117. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/message_read_webhook_event.py +0 -0
  118. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/message_received_webhook_event.py +0 -0
  119. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/message_sent_webhook_event.py +0 -0
  120. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/message_update_params.py +0 -0
  121. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/participant_added_webhook_event.py +0 -0
  122. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/participant_removed_webhook_event.py +0 -0
  123. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/phone_number_list_response.py +0 -0
  124. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/phone_number_status_updated_webhook_event.py +0 -0
  125. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/phonenumber_list_response.py +0 -0
  126. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/reaction_added_webhook_event.py +0 -0
  127. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/reaction_event_base.py +0 -0
  128. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/reaction_removed_webhook_event.py +0 -0
  129. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/reply_to.py +0 -0
  130. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/reply_to_param.py +0 -0
  131. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/schemas_media_part_response.py +0 -0
  132. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/schemas_message_effect.py +0 -0
  133. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/schemas_text_part_response.py +0 -0
  134. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/set_contact_card.py +0 -0
  135. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/shared/__init__.py +0 -0
  136. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/shared/chat_handle.py +0 -0
  137. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/shared/link_part_response.py +0 -0
  138. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/shared/media_part_response.py +0 -0
  139. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/shared/reaction.py +0 -0
  140. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/shared/reaction_type.py +0 -0
  141. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/shared/service_type.py +0 -0
  142. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/shared/text_decoration.py +0 -0
  143. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/shared/text_part_response.py +0 -0
  144. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/shared_params/__init__.py +0 -0
  145. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/shared_params/reaction_type.py +0 -0
  146. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/shared_params/service_type.py +0 -0
  147. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/shared_params/text_decoration.py +0 -0
  148. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/supported_content_type.py +0 -0
  149. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/text_part_param.py +0 -0
  150. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/webhook_event_list_response.py +0 -0
  151. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/webhook_event_type.py +0 -0
  152. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/webhook_subscription.py +0 -0
  153. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/webhook_subscription_create_params.py +0 -0
  154. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/webhook_subscription_create_response.py +0 -0
  155. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/webhook_subscription_list_response.py +0 -0
  156. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq/types/webhook_subscription_update_params.py +0 -0
  157. {linq_python-0.5.0 → linq_python-0.6.0}/src/linq_api_v3/lib/.keep +0 -0
  158. {linq_python-0.5.0 → linq_python-0.6.0}/tests/__init__.py +0 -0
  159. {linq_python-0.5.0 → linq_python-0.6.0}/tests/api_resources/__init__.py +0 -0
  160. {linq_python-0.5.0 → linq_python-0.6.0}/tests/api_resources/chats/__init__.py +0 -0
  161. {linq_python-0.5.0 → linq_python-0.6.0}/tests/api_resources/chats/test_messages.py +0 -0
  162. {linq_python-0.5.0 → linq_python-0.6.0}/tests/api_resources/chats/test_participants.py +0 -0
  163. {linq_python-0.5.0 → linq_python-0.6.0}/tests/api_resources/chats/test_typing.py +0 -0
  164. {linq_python-0.5.0 → linq_python-0.6.0}/tests/api_resources/test_attachments.py +0 -0
  165. {linq_python-0.5.0 → linq_python-0.6.0}/tests/api_resources/test_capability.py +0 -0
  166. {linq_python-0.5.0 → linq_python-0.6.0}/tests/api_resources/test_contact_card.py +0 -0
  167. {linq_python-0.5.0 → linq_python-0.6.0}/tests/api_resources/test_phone_numbers.py +0 -0
  168. {linq_python-0.5.0 → linq_python-0.6.0}/tests/api_resources/test_phonenumbers.py +0 -0
  169. {linq_python-0.5.0 → linq_python-0.6.0}/tests/api_resources/test_webhook_events.py +0 -0
  170. {linq_python-0.5.0 → linq_python-0.6.0}/tests/api_resources/test_webhook_subscriptions.py +0 -0
  171. {linq_python-0.5.0 → linq_python-0.6.0}/tests/api_resources/test_webhooks.py +0 -0
  172. {linq_python-0.5.0 → linq_python-0.6.0}/tests/conftest.py +0 -0
  173. {linq_python-0.5.0 → linq_python-0.6.0}/tests/sample_file.txt +0 -0
  174. {linq_python-0.5.0 → linq_python-0.6.0}/tests/test_client.py +0 -0
  175. {linq_python-0.5.0 → linq_python-0.6.0}/tests/test_models.py +0 -0
  176. {linq_python-0.5.0 → linq_python-0.6.0}/tests/test_qs.py +0 -0
  177. {linq_python-0.5.0 → linq_python-0.6.0}/tests/test_required_args.py +0 -0
  178. {linq_python-0.5.0 → linq_python-0.6.0}/tests/test_response.py +0 -0
  179. {linq_python-0.5.0 → linq_python-0.6.0}/tests/test_streaming.py +0 -0
  180. {linq_python-0.5.0 → linq_python-0.6.0}/tests/test_transform.py +0 -0
  181. {linq_python-0.5.0 → linq_python-0.6.0}/tests/test_utils/test_datetime_parse.py +0 -0
  182. {linq_python-0.5.0 → linq_python-0.6.0}/tests/test_utils/test_json.py +0 -0
  183. {linq_python-0.5.0 → linq_python-0.6.0}/tests/test_utils/test_path.py +0 -0
  184. {linq_python-0.5.0 → linq_python-0.6.0}/tests/test_utils/test_proxy.py +0 -0
  185. {linq_python-0.5.0 → linq_python-0.6.0}/tests/test_utils/test_typing.py +0 -0
  186. {linq_python-0.5.0 → linq_python-0.6.0}/tests/utils.py +0 -0
  187. {linq_python-0.5.0 → linq_python-0.6.0}/uv.lock +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.6.0"
3
+ }
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.0 (2026-04-28)
4
+
5
+ Full Changelog: [v0.5.0...v0.6.0](https://github.com/linq-team/linq-python/compare/v0.5.0...v0.6.0)
6
+
7
+ ### Features
8
+
9
+ * support setting headers via env ([d4398f4](https://github.com/linq-team/linq-python/commit/d4398f434cc4a920f59625eee7be9f1cdef8725b))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **openapi:** enforce mutual exclusivity constraints on reaction and voice memo schemas ([e057279](https://github.com/linq-team/linq-python/commit/e05727975ba84c6a022bd8e8d7a9d212cd864082))
15
+ * use correct field name format for multipart file arrays ([0e992dc](https://github.com/linq-team/linq-python/commit/0e992dc83b80f05698e9cc3d2e656f6ca890576a))
16
+
3
17
  ## 0.5.0 (2026-04-26)
4
18
 
5
19
  Full Changelog: [v0.4.1...v0.5.0](https://github.com/linq-team/linq-python/compare/v0.4.1...v0.5.0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: linq-python
3
- Version: 0.5.0
3
+ Version: 0.6.0
4
4
  Summary: The official Python library for the linq-api-v3 API
5
5
  Project-URL: Homepage, https://github.com/linq-team/linq-python
6
6
  Project-URL: Repository, https://github.com/linq-team/linq-python
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "linq-python"
3
- version = "0.5.0"
3
+ version = "0.6.0"
4
4
  description = "The official Python library for the linq-api-v3 API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -19,7 +19,11 @@ from ._types import (
19
19
  RequestOptions,
20
20
  not_given,
21
21
  )
22
- from ._utils import is_given, get_async_library
22
+ from ._utils import (
23
+ is_given,
24
+ is_mapping_t,
25
+ get_async_library,
26
+ )
23
27
  from ._compat import cached_property
24
28
  from ._models import SecurityOptions
25
29
  from ._version import __version__
@@ -110,6 +114,15 @@ class LinqAPIV3(SyncAPIClient):
110
114
  if base_url is None:
111
115
  base_url = f"https://api.linqapp.com/api/partner"
112
116
 
117
+ custom_headers_env = os.environ.get("LINQ_API_V3_CUSTOM_HEADERS")
118
+ if custom_headers_env is not None:
119
+ parsed: dict[str, str] = {}
120
+ for line in custom_headers_env.split("\n"):
121
+ colon = line.find(":")
122
+ if colon >= 0:
123
+ parsed[line[:colon].strip()] = line[colon + 1 :].strip()
124
+ default_headers = {**parsed, **(default_headers if is_mapping_t(default_headers) else {})}
125
+
113
126
  super().__init__(
114
127
  version=__version__,
115
128
  base_url=base_url,
@@ -626,6 +639,15 @@ class AsyncLinqAPIV3(AsyncAPIClient):
626
639
  if base_url is None:
627
640
  base_url = f"https://api.linqapp.com/api/partner"
628
641
 
642
+ custom_headers_env = os.environ.get("LINQ_API_V3_CUSTOM_HEADERS")
643
+ if custom_headers_env is not None:
644
+ parsed: dict[str, str] = {}
645
+ for line in custom_headers_env.split("\n"):
646
+ colon = line.find(":")
647
+ if colon >= 0:
648
+ parsed[line[:colon].strip()] = line[colon + 1 :].strip()
649
+ default_headers = {**parsed, **(default_headers if is_mapping_t(default_headers) else {})}
650
+
629
651
  super().__init__(
630
652
  version=__version__,
631
653
  base_url=base_url,
@@ -2,17 +2,13 @@ from __future__ import annotations
2
2
 
3
3
  from typing import Any, List, Tuple, Union, Mapping, TypeVar
4
4
  from urllib.parse import parse_qs, urlencode
5
- from typing_extensions import Literal, get_args
5
+ from typing_extensions import get_args
6
6
 
7
- from ._types import NotGiven, not_given
7
+ from ._types import NotGiven, ArrayFormat, NestedFormat, not_given
8
8
  from ._utils import flatten
9
9
 
10
10
  _T = TypeVar("_T")
11
11
 
12
-
13
- ArrayFormat = Literal["comma", "repeat", "indices", "brackets"]
14
- NestedFormat = Literal["dots", "brackets"]
15
-
16
12
  PrimitiveData = Union[str, int, float, bool, None]
17
13
  # this should be Data = Union[PrimitiveData, "List[Data]", "Tuple[Data]", "Mapping[str, Data]"]
18
14
  # https://github.com/microsoft/pyright/issues/3555
@@ -47,6 +47,9 @@ AnyMapping = Mapping[str, object]
47
47
  ModelT = TypeVar("ModelT", bound=pydantic.BaseModel)
48
48
  _T = TypeVar("_T")
49
49
 
50
+ ArrayFormat = Literal["comma", "repeat", "indices", "brackets"]
51
+ NestedFormat = Literal["dots", "brackets"]
52
+
50
53
 
51
54
  # Approximates httpx internal ProxiesTypes and RequestFiles types
52
55
  # while adding support for `PathLike` instances
@@ -17,11 +17,11 @@ from typing import (
17
17
  )
18
18
  from pathlib import Path
19
19
  from datetime import date, datetime
20
- from typing_extensions import TypeGuard
20
+ from typing_extensions import TypeGuard, get_args
21
21
 
22
22
  import sniffio
23
23
 
24
- from .._types import Omit, NotGiven, FileTypes, HeadersLike
24
+ from .._types import Omit, NotGiven, FileTypes, ArrayFormat, HeadersLike
25
25
 
26
26
  _T = TypeVar("_T")
27
27
  _TupleT = TypeVar("_TupleT", bound=Tuple[object, ...])
@@ -40,25 +40,45 @@ def extract_files(
40
40
  query: Mapping[str, object],
41
41
  *,
42
42
  paths: Sequence[Sequence[str]],
43
+ array_format: ArrayFormat = "brackets",
43
44
  ) -> list[tuple[str, FileTypes]]:
44
45
  """Recursively extract files from the given dictionary based on specified paths.
45
46
 
46
47
  A path may look like this ['foo', 'files', '<array>', 'data'].
47
48
 
49
+ ``array_format`` controls how ``<array>`` segments contribute to the emitted
50
+ field name. Supported values: ``"brackets"`` (``foo[]``), ``"repeat"`` and
51
+ ``"comma"`` (``foo``), ``"indices"`` (``foo[0]``, ``foo[1]``).
52
+
48
53
  Note: this mutates the given dictionary.
49
54
  """
50
55
  files: list[tuple[str, FileTypes]] = []
51
56
  for path in paths:
52
- files.extend(_extract_items(query, path, index=0, flattened_key=None))
57
+ files.extend(_extract_items(query, path, index=0, flattened_key=None, array_format=array_format))
53
58
  return files
54
59
 
55
60
 
61
+ def _array_suffix(array_format: ArrayFormat, array_index: int) -> str:
62
+ if array_format == "brackets":
63
+ return "[]"
64
+ if array_format == "indices":
65
+ return f"[{array_index}]"
66
+ if array_format == "repeat" or array_format == "comma":
67
+ # Both repeat the bare field name for each file part; there is no
68
+ # meaningful way to comma-join binary parts.
69
+ return ""
70
+ raise NotImplementedError(
71
+ f"Unknown array_format value: {array_format}, choose from {', '.join(get_args(ArrayFormat))}"
72
+ )
73
+
74
+
56
75
  def _extract_items(
57
76
  obj: object,
58
77
  path: Sequence[str],
59
78
  *,
60
79
  index: int,
61
80
  flattened_key: str | None,
81
+ array_format: ArrayFormat,
62
82
  ) -> list[tuple[str, FileTypes]]:
63
83
  try:
64
84
  key = path[index]
@@ -75,9 +95,11 @@ def _extract_items(
75
95
 
76
96
  if is_list(obj):
77
97
  files: list[tuple[str, FileTypes]] = []
78
- for entry in obj:
79
- assert_is_file_content(entry, key=flattened_key + "[]" if flattened_key else "")
80
- files.append((flattened_key + "[]", cast(FileTypes, entry)))
98
+ for array_index, entry in enumerate(obj):
99
+ suffix = _array_suffix(array_format, array_index)
100
+ emitted_key = (flattened_key + suffix) if flattened_key else suffix
101
+ assert_is_file_content(entry, key=emitted_key)
102
+ files.append((emitted_key, cast(FileTypes, entry)))
81
103
  return files
82
104
 
83
105
  assert_is_file_content(obj, key=flattened_key)
@@ -106,6 +128,7 @@ def _extract_items(
106
128
  path,
107
129
  index=index,
108
130
  flattened_key=flattened_key,
131
+ array_format=array_format,
109
132
  )
110
133
  elif is_list(obj):
111
134
  if key != "<array>":
@@ -117,9 +140,12 @@ def _extract_items(
117
140
  item,
118
141
  path,
119
142
  index=index,
120
- flattened_key=flattened_key + "[]" if flattened_key is not None else "[]",
143
+ flattened_key=(
144
+ (flattened_key if flattened_key is not None else "") + _array_suffix(array_format, array_index)
145
+ ),
146
+ array_format=array_format,
121
147
  )
122
- for item in obj
148
+ for array_index, item in enumerate(obj)
123
149
  ]
124
150
  )
125
151
 
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "linq"
4
- __version__ = "0.5.0" # x-release-please-version
4
+ __version__ = "0.6.0" # x-release-please-version
@@ -354,7 +354,7 @@ class TestChats:
354
354
  def test_method_send_voicememo_with_all_params(self, client: LinqAPIV3) -> None:
355
355
  chat = client.chats.send_voicememo(
356
356
  chat_id="f19ee7b8-8533-4c5c-83ec-4ef8d6d1ddbd",
357
- attachment_id="550e8400-e29b-41d4-a716-446655440000",
357
+ attachment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
358
358
  voice_memo_url="https://example.com/voice-memo.m4a",
359
359
  )
360
360
  assert_matches_type(ChatSendVoicememoResponse, chat, path=["response"])
@@ -771,7 +771,7 @@ class TestAsyncChats:
771
771
  async def test_method_send_voicememo_with_all_params(self, async_client: AsyncLinqAPIV3) -> None:
772
772
  chat = await async_client.chats.send_voicememo(
773
773
  chat_id="f19ee7b8-8533-4c5c-83ec-4ef8d6d1ddbd",
774
- attachment_id="550e8400-e29b-41d4-a716-446655440000",
774
+ attachment_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
775
775
  voice_memo_url="https://example.com/voice-memo.m4a",
776
776
  )
777
777
  assert_matches_type(ChatSendVoicememoResponse, chat, path=["response"])
@@ -178,7 +178,7 @@ class TestMessages:
178
178
  message_id="69a37c7d-af4f-4b5e-af42-e28e98ce873a",
179
179
  operation="add",
180
180
  type="love",
181
- custom_emoji="😍",
181
+ custom_emoji="custom_emoji",
182
182
  part_index=1,
183
183
  )
184
184
  assert_matches_type(MessageAddReactionResponse, message, path=["response"])
@@ -439,7 +439,7 @@ class TestAsyncMessages:
439
439
  message_id="69a37c7d-af4f-4b5e-af42-e28e98ce873a",
440
440
  operation="add",
441
441
  type="love",
442
- custom_emoji="😍",
442
+ custom_emoji="custom_emoji",
443
443
  part_index=1,
444
444
  )
445
445
  assert_matches_type(MessageAddReactionResponse, message, path=["response"])
@@ -4,7 +4,7 @@ from typing import Sequence
4
4
 
5
5
  import pytest
6
6
 
7
- from linq._types import FileTypes
7
+ from linq._types import FileTypes, ArrayFormat
8
8
  from linq._utils import extract_files
9
9
 
10
10
 
@@ -37,10 +37,7 @@ def test_multiple_files() -> None:
37
37
 
38
38
  def test_top_level_file_array() -> None:
39
39
  query = {"files": [b"file one", b"file two"], "title": "hello"}
40
- assert extract_files(query, paths=[["files", "<array>"]]) == [
41
- ("files[]", b"file one"),
42
- ("files[]", b"file two"),
43
- ]
40
+ assert extract_files(query, paths=[["files", "<array>"]]) == [("files[]", b"file one"), ("files[]", b"file two")]
44
41
  assert query == {"title": "hello"}
45
42
 
46
43
 
@@ -71,3 +68,24 @@ def test_ignores_incorrect_paths(
71
68
  expected: list[tuple[str, FileTypes]],
72
69
  ) -> None:
73
70
  assert extract_files(query, paths=paths) == expected
71
+
72
+
73
+ @pytest.mark.parametrize(
74
+ "array_format,expected_top_level,expected_nested",
75
+ [
76
+ ("brackets", [("files[]", b"a"), ("files[]", b"b")], [("items[][file]", b"a"), ("items[][file]", b"b")]),
77
+ ("repeat", [("files", b"a"), ("files", b"b")], [("items[file]", b"a"), ("items[file]", b"b")]),
78
+ ("comma", [("files", b"a"), ("files", b"b")], [("items[file]", b"a"), ("items[file]", b"b")]),
79
+ ("indices", [("files[0]", b"a"), ("files[1]", b"b")], [("items[0][file]", b"a"), ("items[1][file]", b"b")]),
80
+ ],
81
+ )
82
+ def test_array_format_controls_file_field_names(
83
+ array_format: ArrayFormat,
84
+ expected_top_level: list[tuple[str, FileTypes]],
85
+ expected_nested: list[tuple[str, FileTypes]],
86
+ ) -> None:
87
+ top_level = {"files": [b"a", b"b"]}
88
+ assert extract_files(top_level, paths=[["files", "<array>"]], array_format=array_format) == expected_top_level
89
+
90
+ nested = {"items": [{"file": b"a"}, {"file": b"b"}]}
91
+ assert extract_files(nested, paths=[["items", "<array>", "file"]], array_format=array_format) == expected_nested
@@ -131,7 +131,7 @@ class TestDeepcopyWithPaths:
131
131
  copied = deepcopy_with_paths(original, [["items", "<array>", "file"]])
132
132
  extracted = extract_files(copied, paths=[["items", "<array>", "file"]])
133
133
 
134
- assert extracted == [("items[][file]", file1), ("items[][file]", file2)]
134
+ assert [entry for _, entry in extracted] == [file1, file2]
135
135
  assert original == {
136
136
  "items": [
137
137
  {"file": file1, "extra": 1},
@@ -1,3 +0,0 @@
1
- {
2
- ".": "0.5.0"
3
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes