blujay 1.0.0__py3-none-any.whl

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 (455) hide show
  1. blujay/__init__.py +1198 -0
  2. blujay/_default_clients.py +30 -0
  3. blujay/_errors.py +105 -0
  4. blujay/_version.py +2 -0
  5. blujay/attachments/__init__.py +40 -0
  6. blujay/attachments/client.py +374 -0
  7. blujay/attachments/raw_client.py +1058 -0
  8. blujay/attachments/types/__init__.py +38 -0
  9. blujay/attachments/types/attachment_create_response.py +30 -0
  10. blujay/attachments/types/attachment_get_response.py +30 -0
  11. blujay/calls/__init__.py +4 -0
  12. blujay/calls/client.py +113 -0
  13. blujay/calls/raw_client.py +263 -0
  14. blujay/capability/__init__.py +36 -0
  15. blujay/capability/client.py +152 -0
  16. blujay/capability/raw_client.py +302 -0
  17. blujay/capability/types/__init__.py +34 -0
  18. blujay/capability/types/capability_evaluate_service_response.py +30 -0
  19. blujay/chats/__init__.py +72 -0
  20. blujay/chats/client.py +848 -0
  21. blujay/chats/messages/__init__.py +40 -0
  22. blujay/chats/messages/client.py +336 -0
  23. blujay/chats/messages/raw_client.py +652 -0
  24. blujay/chats/messages/types/__init__.py +38 -0
  25. blujay/chats/messages/types/chat_message_list_response.py +30 -0
  26. blujay/chats/messages/types/chat_message_send_response.py +30 -0
  27. blujay/chats/participants/__init__.py +42 -0
  28. blujay/chats/participants/client.py +355 -0
  29. blujay/chats/participants/raw_client.py +817 -0
  30. blujay/chats/participants/types/__init__.py +40 -0
  31. blujay/chats/participants/types/chat_participant_add_response.py +30 -0
  32. blujay/chats/participants/types/chat_participant_list_response.py +30 -0
  33. blujay/chats/participants/types/chat_participant_remove_response.py +30 -0
  34. blujay/chats/raw_client.py +1913 -0
  35. blujay/chats/types/__init__.py +44 -0
  36. blujay/chats/types/chat_create_response.py +30 -0
  37. blujay/chats/types/chat_get_response.py +30 -0
  38. blujay/chats/types/chat_leave_response.py +30 -0
  39. blujay/chats/types/chat_list_response.py +30 -0
  40. blujay/chats/types/chat_update_response.py +30 -0
  41. blujay/chats/typing/__init__.py +4 -0
  42. blujay/chats/typing/client.py +186 -0
  43. blujay/chats/typing/raw_client.py +453 -0
  44. blujay/client.py +426 -0
  45. blujay/contacts/__init__.py +87 -0
  46. blujay/contacts/client.py +1336 -0
  47. blujay/contacts/notes/__init__.py +40 -0
  48. blujay/contacts/notes/client.py +248 -0
  49. blujay/contacts/notes/raw_client.py +549 -0
  50. blujay/contacts/notes/types/__init__.py +38 -0
  51. blujay/contacts/notes/types/contact_note_create_response.py +30 -0
  52. blujay/contacts/notes/types/contact_note_list_response.py +30 -0
  53. blujay/contacts/raw_client.py +3005 -0
  54. blujay/contacts/types/__init__.py +74 -0
  55. blujay/contacts/types/contact_add_tag_response.py +30 -0
  56. blujay/contacts/types/contact_assign_response.py +30 -0
  57. blujay/contacts/types/contact_create_response.py +30 -0
  58. blujay/contacts/types/contact_get_response.py +30 -0
  59. blujay/contacts/types/contact_list_response.py +30 -0
  60. blujay/contacts/types/contact_mark_completed_response.py +30 -0
  61. blujay/contacts/types/contact_opt_out_address_response.py +30 -0
  62. blujay/contacts/types/contact_opt_out_response.py +30 -0
  63. blujay/contacts/types/contact_remove_opt_out_response.py +30 -0
  64. blujay/contacts/types/contact_search_response.py +30 -0
  65. blujay/contacts/types/contact_stage.py +5 -0
  66. blujay/contacts/types/contact_update_response.py +30 -0
  67. blujay/contacts/types/contact_upsert_response.py +30 -0
  68. blujay/core/__init__.py +139 -0
  69. blujay/core/api_error.py +62 -0
  70. blujay/core/client_wrapper.py +146 -0
  71. blujay/core/datetime_utils.py +70 -0
  72. blujay/core/file.py +67 -0
  73. blujay/core/force_multipart.py +18 -0
  74. blujay/core/http_client.py +1021 -0
  75. blujay/core/http_response.py +63 -0
  76. blujay/core/http_sse/__init__.py +42 -0
  77. blujay/core/http_sse/_api.py +455 -0
  78. blujay/core/http_sse/_decoders.py +74 -0
  79. blujay/core/http_sse/_exceptions.py +7 -0
  80. blujay/core/http_sse/_models.py +17 -0
  81. blujay/core/jsonable_encoder.py +145 -0
  82. blujay/core/logging.py +107 -0
  83. blujay/core/pagination.py +167 -0
  84. blujay/core/parse_error.py +36 -0
  85. blujay/core/pydantic_utilities.py +540 -0
  86. blujay/core/query_encoder.py +58 -0
  87. blujay/core/remove_none_from_dict.py +11 -0
  88. blujay/core/request_options.py +41 -0
  89. blujay/core/serialization.py +349 -0
  90. blujay/core/unchecked_base_model.py +505 -0
  91. blujay/environment.py +7 -0
  92. blujay/errors/__init__.py +71 -0
  93. blujay/errors/bad_gateway_error.py +11 -0
  94. blujay/errors/bad_request_error.py +11 -0
  95. blujay/errors/conflict_error.py +11 -0
  96. blujay/errors/content_too_large_error.py +11 -0
  97. blujay/errors/forbidden_error.py +11 -0
  98. blujay/errors/internal_server_error.py +11 -0
  99. blujay/errors/not_found_error.py +11 -0
  100. blujay/errors/service_unavailable_error.py +11 -0
  101. blujay/errors/too_many_requests_error.py +11 -0
  102. blujay/errors/unauthorized_error.py +11 -0
  103. blujay/errors/unprocessable_entity_error.py +11 -0
  104. blujay/errors/unsupported_media_type_error.py +11 -0
  105. blujay/me/__init__.py +34 -0
  106. blujay/me/client.py +100 -0
  107. blujay/me/raw_client.py +192 -0
  108. blujay/me/types/__init__.py +34 -0
  109. blujay/me/types/me_get_response.py +30 -0
  110. blujay/messages/__init__.py +69 -0
  111. blujay/messages/client.py +647 -0
  112. blujay/messages/raw_client.py +1406 -0
  113. blujay/messages/reactions/__init__.py +40 -0
  114. blujay/messages/reactions/client.py +315 -0
  115. blujay/messages/reactions/raw_client.py +741 -0
  116. blujay/messages/reactions/types/__init__.py +38 -0
  117. blujay/messages/reactions/types/message_reaction_add_response.py +30 -0
  118. blujay/messages/reactions/types/message_reaction_remove_response.py +30 -0
  119. blujay/messages/types/__init__.py +56 -0
  120. blujay/messages/types/message_edit_response.py +30 -0
  121. blujay/messages/types/message_get_response.py +30 -0
  122. blujay/messages/types/message_include.py +5 -0
  123. blujay/messages/types/message_list_response.py +30 -0
  124. blujay/messages/types/message_list_thread_order.py +5 -0
  125. blujay/messages/types/message_list_thread_response.py +30 -0
  126. blujay/messages/types/message_unsend_response.py +30 -0
  127. blujay/phone_numbers/__init__.py +54 -0
  128. blujay/phone_numbers/client.py +203 -0
  129. blujay/phone_numbers/contact_card/__init__.py +46 -0
  130. blujay/phone_numbers/contact_card/client.py +402 -0
  131. blujay/phone_numbers/contact_card/raw_client.py +1065 -0
  132. blujay/phone_numbers/contact_card/types/__init__.py +44 -0
  133. blujay/phone_numbers/contact_card/types/phone_number_contact_card_delete_response.py +30 -0
  134. blujay/phone_numbers/contact_card/types/phone_number_contact_card_get_response.py +30 -0
  135. blujay/phone_numbers/contact_card/types/phone_number_contact_card_set_response.py +30 -0
  136. blujay/phone_numbers/raw_client.py +396 -0
  137. blujay/phone_numbers/types/__init__.py +38 -0
  138. blujay/phone_numbers/types/phone_number_get_response.py +30 -0
  139. blujay/phone_numbers/types/phone_number_list_response.py +30 -0
  140. blujay/py.typed +0 -0
  141. blujay/requests/__init__.py +97 -0
  142. blujay/requests/audio_part.py +18 -0
  143. blujay/requests/bubble_effect.py +10 -0
  144. blujay/requests/chat_icon_input.py +11 -0
  145. blujay/requests/link_part.py +13 -0
  146. blujay/requests/media_part.py +18 -0
  147. blujay/requests/message_effect.py +8 -0
  148. blujay/requests/message_input.py +33 -0
  149. blujay/requests/message_part.py +11 -0
  150. blujay/requests/message_reply_to.py +26 -0
  151. blujay/requests/screen_effect.py +10 -0
  152. blujay/requests/text_decoration.py +19 -0
  153. blujay/requests/text_part.py +16 -0
  154. blujay/requests/vcard_email_input.py +9 -0
  155. blujay/requests/vcard_part.py +14 -0
  156. blujay/requests/vcard_phone_input.py +13 -0
  157. blujay/requests/webhook_phone_number_filter.py +21 -0
  158. blujay/requests/workflow_metadata.py +10 -0
  159. blujay/requests/workflow_metadata_value.py +5 -0
  160. blujay/team_members/__init__.py +36 -0
  161. blujay/team_members/client.py +104 -0
  162. blujay/team_members/raw_client.py +196 -0
  163. blujay/team_members/types/__init__.py +34 -0
  164. blujay/team_members/types/team_member_list_assignable_response.py +30 -0
  165. blujay/types/__init__.py +896 -0
  166. blujay/types/accepted_chat_leave.py +27 -0
  167. blujay/types/accepted_chat_leave_operation.py +5 -0
  168. blujay/types/accepted_chat_leave_status.py +5 -0
  169. blujay/types/accepted_chat_metadata_mutation.py +39 -0
  170. blujay/types/accepted_chat_metadata_mutation_operation.py +7 -0
  171. blujay/types/accepted_chat_metadata_mutation_status.py +5 -0
  172. blujay/types/accepted_group_participant_mutation.py +33 -0
  173. blujay/types/accepted_group_participant_mutation_operation.py +7 -0
  174. blujay/types/accepted_group_participant_mutation_participant.py +24 -0
  175. blujay/types/accepted_group_participant_mutation_participant_status.py +5 -0
  176. blujay/types/accepted_group_participant_mutation_participant_type.py +5 -0
  177. blujay/types/accepted_group_participant_mutation_status.py +7 -0
  178. blujay/types/accepted_message.py +23 -0
  179. blujay/types/accepted_message_reaction.py +35 -0
  180. blujay/types/accepted_message_reaction_operation.py +5 -0
  181. blujay/types/accepted_message_reaction_reaction.py +27 -0
  182. blujay/types/accepted_message_reaction_status.py +5 -0
  183. blujay/types/api_key_credential.py +24 -0
  184. blujay/types/api_key_credential_status.py +5 -0
  185. blujay/types/api_key_credential_type.py +5 -0
  186. blujay/types/api_key_summary.py +22 -0
  187. blujay/types/api_key_summary_status.py +5 -0
  188. blujay/types/assignable_team_member_list.py +21 -0
  189. blujay/types/assigned_team_member.py +23 -0
  190. blujay/types/attachment.py +30 -0
  191. blujay/types/attachment_id.py +3 -0
  192. blujay/types/attachment_status.py +5 -0
  193. blujay/types/attachment_upload.py +35 -0
  194. blujay/types/attachment_upload_upload_headers.py +31 -0
  195. blujay/types/audio_output_part.py +34 -0
  196. blujay/types/audio_output_part_type.py +5 -0
  197. blujay/types/audio_part.py +31 -0
  198. blujay/types/audio_part_type.py +5 -0
  199. blujay/types/bubble_effect.py +23 -0
  200. blujay/types/bubble_effect_name.py +5 -0
  201. blujay/types/bubble_effect_type.py +5 -0
  202. blujay/types/call_ended_webhook_data.py +87 -0
  203. blujay/types/call_ended_webhook_data_direction.py +5 -0
  204. blujay/types/call_ended_webhook_data_outcome.py +7 -0
  205. blujay/types/call_ended_webhook_data_type.py +5 -0
  206. blujay/types/call_ended_webhook_event.py +47 -0
  207. blujay/types/call_ended_webhook_event_api_version.py +5 -0
  208. blujay/types/call_id.py +3 -0
  209. blujay/types/call_recording_ready_webhook_data.py +94 -0
  210. blujay/types/call_recording_ready_webhook_data_direction.py +5 -0
  211. blujay/types/call_recording_ready_webhook_data_outcome.py +7 -0
  212. blujay/types/call_recording_ready_webhook_data_recording.py +30 -0
  213. blujay/types/call_recording_ready_webhook_data_recording_kind.py +5 -0
  214. blujay/types/call_recording_ready_webhook_data_summary.py +26 -0
  215. blujay/types/call_recording_ready_webhook_data_summary_status.py +5 -0
  216. blujay/types/call_recording_ready_webhook_data_transcript.py +26 -0
  217. blujay/types/call_recording_ready_webhook_data_transcript_status.py +5 -0
  218. blujay/types/call_recording_ready_webhook_data_type.py +5 -0
  219. blujay/types/call_recording_ready_webhook_event.py +47 -0
  220. blujay/types/call_recording_ready_webhook_event_api_version.py +5 -0
  221. blujay/types/capability_service_result.py +42 -0
  222. blujay/types/capability_service_result_service.py +5 -0
  223. blujay/types/capability_service_result_source.py +5 -0
  224. blujay/types/chat.py +66 -0
  225. blujay/types/chat_icon.py +28 -0
  226. blujay/types/chat_icon_input.py +24 -0
  227. blujay/types/chat_id.py +3 -0
  228. blujay/types/chat_list.py +24 -0
  229. blujay/types/chat_participant.py +8 -0
  230. blujay/types/chat_service.py +5 -0
  231. blujay/types/chat_type.py +5 -0
  232. blujay/types/contact.py +66 -0
  233. blujay/types/contact_assignment_action_result.py +66 -0
  234. blujay/types/contact_card_profile.py +52 -0
  235. blujay/types/contact_card_profile_photo.py +26 -0
  236. blujay/types/contact_card_profile_photo_content_type.py +5 -0
  237. blujay/types/contact_card_profile_status.py +5 -0
  238. blujay/types/contact_id.py +3 -0
  239. blujay/types/contact_list.py +24 -0
  240. blujay/types/contact_note.py +39 -0
  241. blujay/types/contact_note_list.py +24 -0
  242. blujay/types/contact_note_source.py +5 -0
  243. blujay/types/contact_search_result.py +21 -0
  244. blujay/types/contact_stage_action_result.py +66 -0
  245. blujay/types/contact_suppression.py +27 -0
  246. blujay/types/contact_suppression_address_type.py +5 -0
  247. blujay/types/contact_tag_action_result.py +66 -0
  248. blujay/types/direct_chat_participant.py +37 -0
  249. blujay/types/direct_chat_participant_type.py +5 -0
  250. blujay/types/error_envelope.py +35 -0
  251. blujay/types/error_envelope_status.py +5 -0
  252. blujay/types/error_object.py +64 -0
  253. blujay/types/event_id.py +3 -0
  254. blujay/types/generic_webhook_event.py +46 -0
  255. blujay/types/generic_webhook_event_api_version.py +5 -0
  256. blujay/types/group_name_webhook_data.py +26 -0
  257. blujay/types/group_name_webhook_event.py +47 -0
  258. blujay/types/group_name_webhook_event_api_version.py +5 -0
  259. blujay/types/group_participant.py +39 -0
  260. blujay/types/group_participant_list.py +21 -0
  261. blujay/types/group_participant_status.py +5 -0
  262. blujay/types/group_participant_type.py +5 -0
  263. blujay/types/group_participant_webhook_data.py +27 -0
  264. blujay/types/group_participant_webhook_event.py +47 -0
  265. blujay/types/group_participant_webhook_event_api_version.py +5 -0
  266. blujay/types/group_phone_number.py +46 -0
  267. blujay/types/group_sendability_reason.py +7 -0
  268. blujay/types/group_webhook_participant.py +30 -0
  269. blujay/types/group_webhook_participant_status.py +5 -0
  270. blujay/types/group_webhook_participant_type.py +5 -0
  271. blujay/types/link_part.py +26 -0
  272. blujay/types/link_part_type.py +5 -0
  273. blujay/types/me.py +29 -0
  274. blujay/types/media_output_part.py +30 -0
  275. blujay/types/media_output_part_type.py +5 -0
  276. blujay/types/media_part.py +31 -0
  277. blujay/types/media_part_type.py +5 -0
  278. blujay/types/member_id.py +3 -0
  279. blujay/types/message.py +159 -0
  280. blujay/types/message_actionable_failure_code.py +14 -0
  281. blujay/types/message_degradation.py +25 -0
  282. blujay/types/message_degradation_code.py +7 -0
  283. blujay/types/message_direction.py +5 -0
  284. blujay/types/message_edit_history_entry.py +22 -0
  285. blujay/types/message_edited_webhook_data.py +64 -0
  286. blujay/types/message_edited_webhook_event.py +47 -0
  287. blujay/types/message_edited_webhook_event_api_version.py +5 -0
  288. blujay/types/message_effect.py +8 -0
  289. blujay/types/message_failure.py +26 -0
  290. blujay/types/message_failure_code.py +18 -0
  291. blujay/types/message_id.py +3 -0
  292. blujay/types/message_input.py +44 -0
  293. blujay/types/message_input_preferred_service.py +5 -0
  294. blujay/types/message_lifecycle_webhook_data.py +88 -0
  295. blujay/types/message_lifecycle_webhook_data_direction.py +5 -0
  296. blujay/types/message_lifecycle_webhook_data_requested_service.py +5 -0
  297. blujay/types/message_lifecycle_webhook_data_service.py +5 -0
  298. blujay/types/message_lifecycle_webhook_data_status.py +7 -0
  299. blujay/types/message_lifecycle_webhook_event.py +47 -0
  300. blujay/types/message_lifecycle_webhook_event_api_version.py +5 -0
  301. blujay/types/message_list.py +24 -0
  302. blujay/types/message_output_part.py +10 -0
  303. blujay/types/message_part.py +11 -0
  304. blujay/types/message_preferred_service.py +5 -0
  305. blujay/types/message_reaction.py +46 -0
  306. blujay/types/message_received_webhook_data.py +95 -0
  307. blujay/types/message_received_webhook_data_direction.py +5 -0
  308. blujay/types/message_received_webhook_data_requested_service.py +5 -0
  309. blujay/types/message_received_webhook_data_service.py +5 -0
  310. blujay/types/message_received_webhook_data_status.py +5 -0
  311. blujay/types/message_received_webhook_event.py +47 -0
  312. blujay/types/message_received_webhook_event_api_version.py +5 -0
  313. blujay/types/message_reply_to.py +39 -0
  314. blujay/types/message_reply_to_info.py +34 -0
  315. blujay/types/message_sender.py +36 -0
  316. blujay/types/message_sender_type.py +5 -0
  317. blujay/types/message_service.py +5 -0
  318. blujay/types/message_status.py +7 -0
  319. blujay/types/message_team_member_id.py +10 -0
  320. blujay/types/message_unsent_scope.py +5 -0
  321. blujay/types/message_unsent_webhook_data.py +64 -0
  322. blujay/types/message_unsent_webhook_data_unsent_scope.py +5 -0
  323. blujay/types/message_unsent_webhook_event.py +47 -0
  324. blujay/types/message_unsent_webhook_event_api_version.py +5 -0
  325. blujay/types/message_webhook_recipient.py +32 -0
  326. blujay/types/message_webhook_recipient_type.py +5 -0
  327. blujay/types/new_message.py +68 -0
  328. blujay/types/new_message_delivery_status.py +5 -0
  329. blujay/types/new_message_direction.py +5 -0
  330. blujay/types/new_message_preferred_service.py +5 -0
  331. blujay/types/new_message_service.py +5 -0
  332. blujay/types/phone_number.py +79 -0
  333. blujay/types/phone_number_access_type.py +5 -0
  334. blujay/types/phone_number_assigned_webhook_data.py +29 -0
  335. blujay/types/phone_number_assigned_webhook_event.py +47 -0
  336. blujay/types/phone_number_assigned_webhook_event_api_version.py +5 -0
  337. blujay/types/phone_number_capabilities.py +26 -0
  338. blujay/types/phone_number_capabilities_messaging.py +23 -0
  339. blujay/types/phone_number_capabilities_voice.py +25 -0
  340. blujay/types/phone_number_health.py +29 -0
  341. blujay/types/phone_number_health_status.py +5 -0
  342. blujay/types/phone_number_id.py +3 -0
  343. blujay/types/phone_number_limits.py +34 -0
  344. blujay/types/phone_number_limits_daily.py +27 -0
  345. blujay/types/phone_number_limits_new_contacts.py +28 -0
  346. blujay/types/phone_number_line_type.py +5 -0
  347. blujay/types/phone_number_list.py +21 -0
  348. blujay/types/phone_number_outbound_policy.py +31 -0
  349. blujay/types/phone_number_queue.py +26 -0
  350. blujay/types/phone_number_released_webhook_data.py +29 -0
  351. blujay/types/phone_number_released_webhook_event.py +47 -0
  352. blujay/types/phone_number_released_webhook_event_api_version.py +5 -0
  353. blujay/types/phone_number_send_status.py +33 -0
  354. blujay/types/phone_number_send_status_reason_code.py +7 -0
  355. blujay/types/phone_number_status.py +5 -0
  356. blujay/types/reaction_emoji.py +6 -0
  357. blujay/types/reaction_kind.py +7 -0
  358. blujay/types/reaction_reactor.py +8 -0
  359. blujay/types/reaction_reactor_address.py +22 -0
  360. blujay/types/reaction_reactor_address_type.py +5 -0
  361. blujay/types/reaction_reactor_phone_number_id.py +23 -0
  362. blujay/types/reaction_reactor_phone_number_id_type.py +5 -0
  363. blujay/types/reaction_sticker.py +32 -0
  364. blujay/types/reaction_type.py +7 -0
  365. blujay/types/reaction_webhook_data.py +36 -0
  366. blujay/types/reaction_webhook_data_reaction.py +37 -0
  367. blujay/types/reaction_webhook_event.py +47 -0
  368. blujay/types/reaction_webhook_event_api_version.py +5 -0
  369. blujay/types/screen_effect.py +23 -0
  370. blujay/types/screen_effect_name.py +20 -0
  371. blujay/types/screen_effect_type.py +5 -0
  372. blujay/types/success_envelope.py +34 -0
  373. blujay/types/team_member.py +23 -0
  374. blujay/types/text_decoration.py +30 -0
  375. blujay/types/text_decoration_style.py +5 -0
  376. blujay/types/text_part.py +27 -0
  377. blujay/types/text_part_type.py +5 -0
  378. blujay/types/trace_id.py +3 -0
  379. blujay/types/typing_webhook_data.py +39 -0
  380. blujay/types/typing_webhook_event.py +47 -0
  381. blujay/types/typing_webhook_event_api_version.py +5 -0
  382. blujay/types/typing_webhook_participant.py +28 -0
  383. blujay/types/typing_webhook_participant_type.py +5 -0
  384. blujay/types/vcard.py +38 -0
  385. blujay/types/vcard_email.py +22 -0
  386. blujay/types/vcard_email_input.py +22 -0
  387. blujay/types/vcard_email_input_type.py +5 -0
  388. blujay/types/vcard_email_type.py +5 -0
  389. blujay/types/vcard_fields.py +39 -0
  390. blujay/types/vcard_id.py +3 -0
  391. blujay/types/vcard_list.py +24 -0
  392. blujay/types/vcard_part.py +27 -0
  393. blujay/types/vcard_part_type.py +5 -0
  394. blujay/types/vcard_phone.py +26 -0
  395. blujay/types/vcard_phone_input.py +26 -0
  396. blujay/types/vcard_phone_input_type.py +5 -0
  397. blujay/types/vcard_phone_type.py +5 -0
  398. blujay/types/webhook_delivery_attempt.py +54 -0
  399. blujay/types/webhook_delivery_attempt_delivery_mode.py +5 -0
  400. blujay/types/webhook_delivery_attempt_error_code.py +26 -0
  401. blujay/types/webhook_delivery_attempt_list.py +24 -0
  402. blujay/types/webhook_delivery_attempt_status.py +5 -0
  403. blujay/types/webhook_envelope.py +51 -0
  404. blujay/types/webhook_envelope_api_version.py +5 -0
  405. blujay/types/webhook_event.py +620 -0
  406. blujay/types/webhook_event_type.py +31 -0
  407. blujay/types/webhook_payload_version.py +7 -0
  408. blujay/types/webhook_phone_number_filter.py +50 -0
  409. blujay/types/webhook_phone_number_filter_all.py +18 -0
  410. blujay/types/webhook_phone_number_filter_selected.py +20 -0
  411. blujay/types/webhook_replay_accepted.py +25 -0
  412. blujay/types/webhook_replay_accepted_status.py +5 -0
  413. blujay/types/webhook_subscribable_event_type.py +31 -0
  414. blujay/types/webhook_subscription.py +38 -0
  415. blujay/types/webhook_subscription_id.py +3 -0
  416. blujay/types/webhook_subscription_list.py +24 -0
  417. blujay/types/webhook_subscription_status.py +5 -0
  418. blujay/types/webhook_subscription_with_secret.py +43 -0
  419. blujay/types/workflow.py +22 -0
  420. blujay/types/workflow_id.py +3 -0
  421. blujay/types/workflow_list.py +21 -0
  422. blujay/types/workflow_metadata.py +10 -0
  423. blujay/types/workflow_metadata_value.py +5 -0
  424. blujay/types/workflow_run_summary.py +24 -0
  425. blujay/types/workflow_trigger.py +32 -0
  426. blujay/types/workspace_id.py +3 -0
  427. blujay/vcards/__init__.py +44 -0
  428. blujay/vcards/client.py +578 -0
  429. blujay/vcards/raw_client.py +1191 -0
  430. blujay/vcards/types/__init__.py +42 -0
  431. blujay/vcards/types/vcard_create_response.py +30 -0
  432. blujay/vcards/types/vcard_get_response.py +30 -0
  433. blujay/vcards/types/vcard_list_response.py +30 -0
  434. blujay/vcards/types/vcard_update_response.py +30 -0
  435. blujay/webhook_subscriptions/__init__.py +55 -0
  436. blujay/webhook_subscriptions/client.py +804 -0
  437. blujay/webhook_subscriptions/raw_client.py +1723 -0
  438. blujay/webhook_subscriptions/types/__init__.py +53 -0
  439. blujay/webhook_subscriptions/types/webhook_subscription_create_response.py +30 -0
  440. blujay/webhook_subscriptions/types/webhook_subscription_get_response.py +30 -0
  441. blujay/webhook_subscriptions/types/webhook_subscription_list_deliveries_response.py +30 -0
  442. blujay/webhook_subscriptions/types/webhook_subscription_list_response.py +30 -0
  443. blujay/webhook_subscriptions/types/webhook_subscription_replay_event_response.py +30 -0
  444. blujay/webhook_subscriptions/types/webhook_subscription_update_response.py +30 -0
  445. blujay/webhooks.py +124 -0
  446. blujay/workflows/__init__.py +40 -0
  447. blujay/workflows/client.py +235 -0
  448. blujay/workflows/raw_client.py +510 -0
  449. blujay/workflows/types/__init__.py +38 -0
  450. blujay/workflows/types/workflow_enroll_response.py +30 -0
  451. blujay/workflows/types/workflow_list_response.py +30 -0
  452. blujay-1.0.0.dist-info/METADATA +274 -0
  453. blujay-1.0.0.dist-info/RECORD +455 -0
  454. blujay-1.0.0.dist-info/WHEEL +4 -0
  455. blujay-1.0.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,40 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ import typing
6
+ from importlib import import_module
7
+
8
+ if typing.TYPE_CHECKING:
9
+ from .types import ChatMessageListResponse, ChatMessageSendResponse
10
+ _dynamic_imports: typing.Dict[str, str] = {
11
+ "ChatMessageListResponse": ".types",
12
+ "ChatMessageSendResponse": ".types",
13
+ }
14
+
15
+
16
+ def __getattr__(attr_name: str) -> typing.Any:
17
+ module_name = _dynamic_imports.get(attr_name)
18
+ if module_name is None:
19
+ raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
20
+ try:
21
+ module = import_module(module_name, __package__)
22
+ if module_name == f".{attr_name}":
23
+ return module
24
+ else:
25
+ return getattr(module, attr_name)
26
+ except ImportError as e:
27
+ raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
28
+ except AttributeError as e:
29
+ raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
30
+
31
+
32
+ def __dir__():
33
+ lazy_attrs = list(_dynamic_imports.keys())
34
+ return sorted(lazy_attrs)
35
+
36
+
37
+ __all__ = [
38
+ "ChatMessageListResponse",
39
+ "ChatMessageSendResponse",
40
+ ]
@@ -0,0 +1,336 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
+ from ...core.pagination import AsyncPager, SyncPager
7
+ from ...core.request_options import RequestOptions
8
+ from ...requests.message_input import MessageInputParams
9
+ from ...types.chat_id import ChatId
10
+ from ...types.member_id import MemberId
11
+ from ...types.message import Message
12
+ from .raw_client import AsyncRawMessagesClient, RawMessagesClient
13
+ from .types.chat_message_list_response import ChatMessageListResponse
14
+ from .types.chat_message_send_response import ChatMessageSendResponse
15
+
16
+ # this is used as the default value for optional parameters
17
+ OMIT = typing.cast(typing.Any, ...)
18
+
19
+
20
+ class MessagesClient:
21
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
22
+ self._raw_client = RawMessagesClient(client_wrapper=client_wrapper)
23
+
24
+ @property
25
+ def with_raw_response(self) -> RawMessagesClient:
26
+ """
27
+ Retrieves a raw implementation of this client that returns raw responses.
28
+
29
+ Returns
30
+ -------
31
+ RawMessagesClient
32
+ """
33
+ return self._raw_client
34
+
35
+ def list(
36
+ self,
37
+ chat_id: ChatId,
38
+ *,
39
+ limit: typing.Optional[int] = None,
40
+ cursor: typing.Optional[str] = None,
41
+ request_options: typing.Optional[RequestOptions] = None,
42
+ ) -> SyncPager[Message, ChatMessageListResponse]:
43
+ """
44
+ Returns the messages in one chat, one page at a time, most recently updated first (a read receipt or an edit moves an older message up). Sort a page by `created_at` to display a conversation in order.
45
+
46
+ Parameters
47
+ ----------
48
+ chat_id : ChatId
49
+
50
+ limit : typing.Optional[int]
51
+ Maximum number of items to return.
52
+
53
+ cursor : typing.Optional[str]
54
+ The `next_cursor` value from the previous page. Leave it out to get the first page.
55
+
56
+ request_options : typing.Optional[RequestOptions]
57
+ Request-specific configuration.
58
+
59
+ Returns
60
+ -------
61
+ SyncPager[Message, ChatMessageListResponse]
62
+ A page of messages.
63
+
64
+ Examples
65
+ --------
66
+ from blujay import Blujay
67
+
68
+ client = Blujay(
69
+ api_key="YOUR_API_KEY",
70
+ )
71
+ response = client.chats.messages.list(
72
+ chat_id="chat_abc123",
73
+ )
74
+ for item in response:
75
+ yield item
76
+ # alternatively, you can paginate page-by-page
77
+ for page in response.iter_pages():
78
+ yield page
79
+ """
80
+ return self._raw_client.list(chat_id, limit=limit, cursor=cursor, request_options=request_options)
81
+
82
+ def send(
83
+ self,
84
+ chat_id: ChatId,
85
+ *,
86
+ message: MessageInputParams,
87
+ team_member_id: typing.Optional[MemberId] = OMIT,
88
+ pre_reply_override: typing.Optional[bool] = OMIT,
89
+ idempotency_key: typing.Optional[str] = None,
90
+ request_options: typing.Optional[RequestOptions] = None,
91
+ ) -> ChatMessageSendResponse:
92
+ """
93
+ Sends a message in an existing chat. Blujay returns `202` as soon as the message is accepted and sends it in the background. Follow its progress with message webhooks or `GET /v1/messages/{message_id}`.
94
+
95
+ A message can have `text`, `link`, `media`, `vcard` and `audio` parts. A `link` part must be the only part. An `audio` part (a voice memo, sent as a native iMessage audio message) must also be the only part, and goes out over iMessage or RCS only.
96
+
97
+ Optional features:
98
+ - `reply_to` sends an iMessage threaded reply. It isn't available for SMS or RCS chats.
99
+ - `effect` adds an iMessage screen or bubble effect to a text message.
100
+ - `text_decorations` styles text in direct iMessage chats and established iMessage group chats.
101
+ - `preferred_service` picks iMessage, RCS or SMS for a direct chat. Omit it to let Blujay choose. Group chats don't accept it.
102
+
103
+ If an effect or text style can't be delivered because the message goes out as SMS or RCS, the text is still sent and the message lists what was dropped in `degradations`.
104
+
105
+ These limits protect your number's reputation. Until the contact replies to this number with a text or a tapback:
106
+ - Links, media and contact cards return `400 PRE_REPLY_CONTENT_BLOCKED`.
107
+ - Text longer than 300 characters returns `400 PRE_REPLY_LENGTH_EXCEEDED`.
108
+ At any time, before or after a first reply, at most 6 texts go to a contact in a row without a response (a text or tapback from them, or a message from them in a group) on any of your numbers. Calls don't count as a response. The next returns `400 PRE_REPLY_LIMIT_REACHED`. With an API key, `pre_reply_override: true` sends a 7th once. The count starts again when the contact responds.
109
+ In a group, the content limits apply until someone in the group replies, and the 6-text limit counts the group's texts since anyone in it last wrote. These errors are never retryable and never `429`.
110
+
111
+ Send an `Idempotency-Key` header (or `message.idempotency_key`) so you can safely retry. Repeating a request with the same key returns `200` with the original response instead of sending again.
112
+
113
+ Errors worth handling:
114
+ - `400 PRE_REPLY_*`: the contact hasn't replied yet, or hasn't responded to your last 6 texts (see the limits above).
115
+ - `403 RECIPIENT_SUPPRESSED`: the recipient opted out.
116
+ - `403 CONTACT_NOT_VERIFIED`: on the Free Plan, the contact hasn't texted your Free Plan number to verify yet.
117
+ - `403 CONTACT_MUST_TEXT_FIRST`: the number is on the AI Agent plan: it only replies to people who text it first, and can't send to group chats.
118
+ - `429 RATE_LIMIT_EXCEEDED` or `429 QUEUE_FULL`: the sending number hit a limit. Wait `Retry-After` seconds. Each number's current limits are in `GET /v1/phone-numbers` under `limits`.
119
+ - `409 SENDER_RETIRED`: the chat's number was retired. Start a new chat from an active number.
120
+ - `503 QUEUE_UNAVAILABLE`: Blujay couldn't accept the message right now. Retry with the same `Idempotency-Key`.
121
+
122
+ Parameters
123
+ ----------
124
+ chat_id : ChatId
125
+
126
+ message : MessageInputParams
127
+
128
+ team_member_id : typing.Optional[MemberId]
129
+ The teammate sending this message, from `GET /v1/team-members`. The message shows as sent by them in Blujay and reports this `team_member_id` in reads and webhooks; it does not assign the chat to them. Must be an active teammate in your workspace; anything else (unknown, deactivated, or another workspace's teammate) returns `404 NOT_FOUND` before anything is sent. It is part of the idempotent request, so reusing an idempotency key with a different or missing `team_member_id` returns `409 IDEMPOTENCY_REQUEST_MISMATCH`.
130
+
131
+ pre_reply_override : typing.Optional[bool]
132
+ API keys only. Sends a 7th text in a row to a contact who hasn't responded, once. A later text before they respond still returns `PRE_REPLY_LIMIT_REACHED`. It never lifts `PRE_REPLY_CONTENT_BLOCKED` or `PRE_REPLY_LENGTH_EXCEEDED`, and connected apps such as Zapier can't use it.
133
+
134
+ idempotency_key : typing.Optional[str]
135
+
136
+ request_options : typing.Optional[RequestOptions]
137
+ Request-specific configuration.
138
+
139
+ Returns
140
+ -------
141
+ ChatMessageSendResponse
142
+ This `Idempotency-Key` was already used for the same request. The response is the original one, and nothing was sent again.
143
+
144
+ Examples
145
+ --------
146
+ from blujay import Blujay
147
+
148
+ client = Blujay(
149
+ api_key="YOUR_API_KEY",
150
+ )
151
+ client.chats.messages.send(
152
+ chat_id="chat_abc123",
153
+ message={
154
+ "parts": [
155
+ {"type": "text", "text": "Here is the follow-up we discussed."}
156
+ ]
157
+ },
158
+ )
159
+ """
160
+ _response = self._raw_client.send(
161
+ chat_id,
162
+ message=message,
163
+ team_member_id=team_member_id,
164
+ pre_reply_override=pre_reply_override,
165
+ idempotency_key=idempotency_key,
166
+ request_options=request_options,
167
+ )
168
+ return _response.data
169
+
170
+
171
+ class AsyncMessagesClient:
172
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
173
+ self._raw_client = AsyncRawMessagesClient(client_wrapper=client_wrapper)
174
+
175
+ @property
176
+ def with_raw_response(self) -> AsyncRawMessagesClient:
177
+ """
178
+ Retrieves a raw implementation of this client that returns raw responses.
179
+
180
+ Returns
181
+ -------
182
+ AsyncRawMessagesClient
183
+ """
184
+ return self._raw_client
185
+
186
+ async def list(
187
+ self,
188
+ chat_id: ChatId,
189
+ *,
190
+ limit: typing.Optional[int] = None,
191
+ cursor: typing.Optional[str] = None,
192
+ request_options: typing.Optional[RequestOptions] = None,
193
+ ) -> AsyncPager[Message, ChatMessageListResponse]:
194
+ """
195
+ Returns the messages in one chat, one page at a time, most recently updated first (a read receipt or an edit moves an older message up). Sort a page by `created_at` to display a conversation in order.
196
+
197
+ Parameters
198
+ ----------
199
+ chat_id : ChatId
200
+
201
+ limit : typing.Optional[int]
202
+ Maximum number of items to return.
203
+
204
+ cursor : typing.Optional[str]
205
+ The `next_cursor` value from the previous page. Leave it out to get the first page.
206
+
207
+ request_options : typing.Optional[RequestOptions]
208
+ Request-specific configuration.
209
+
210
+ Returns
211
+ -------
212
+ AsyncPager[Message, ChatMessageListResponse]
213
+ A page of messages.
214
+
215
+ Examples
216
+ --------
217
+ import asyncio
218
+
219
+ from blujay import AsyncBlujay
220
+
221
+ client = AsyncBlujay(
222
+ api_key="YOUR_API_KEY",
223
+ )
224
+
225
+
226
+ async def main() -> None:
227
+ response = await client.chats.messages.list(
228
+ chat_id="chat_abc123",
229
+ )
230
+ async for item in response:
231
+ yield item
232
+
233
+ # alternatively, you can paginate page-by-page
234
+ async for page in response.iter_pages():
235
+ yield page
236
+
237
+
238
+ asyncio.run(main())
239
+ """
240
+ return await self._raw_client.list(chat_id, limit=limit, cursor=cursor, request_options=request_options)
241
+
242
+ async def send(
243
+ self,
244
+ chat_id: ChatId,
245
+ *,
246
+ message: MessageInputParams,
247
+ team_member_id: typing.Optional[MemberId] = OMIT,
248
+ pre_reply_override: typing.Optional[bool] = OMIT,
249
+ idempotency_key: typing.Optional[str] = None,
250
+ request_options: typing.Optional[RequestOptions] = None,
251
+ ) -> ChatMessageSendResponse:
252
+ """
253
+ Sends a message in an existing chat. Blujay returns `202` as soon as the message is accepted and sends it in the background. Follow its progress with message webhooks or `GET /v1/messages/{message_id}`.
254
+
255
+ A message can have `text`, `link`, `media`, `vcard` and `audio` parts. A `link` part must be the only part. An `audio` part (a voice memo, sent as a native iMessage audio message) must also be the only part, and goes out over iMessage or RCS only.
256
+
257
+ Optional features:
258
+ - `reply_to` sends an iMessage threaded reply. It isn't available for SMS or RCS chats.
259
+ - `effect` adds an iMessage screen or bubble effect to a text message.
260
+ - `text_decorations` styles text in direct iMessage chats and established iMessage group chats.
261
+ - `preferred_service` picks iMessage, RCS or SMS for a direct chat. Omit it to let Blujay choose. Group chats don't accept it.
262
+
263
+ If an effect or text style can't be delivered because the message goes out as SMS or RCS, the text is still sent and the message lists what was dropped in `degradations`.
264
+
265
+ These limits protect your number's reputation. Until the contact replies to this number with a text or a tapback:
266
+ - Links, media and contact cards return `400 PRE_REPLY_CONTENT_BLOCKED`.
267
+ - Text longer than 300 characters returns `400 PRE_REPLY_LENGTH_EXCEEDED`.
268
+ At any time, before or after a first reply, at most 6 texts go to a contact in a row without a response (a text or tapback from them, or a message from them in a group) on any of your numbers. Calls don't count as a response. The next returns `400 PRE_REPLY_LIMIT_REACHED`. With an API key, `pre_reply_override: true` sends a 7th once. The count starts again when the contact responds.
269
+ In a group, the content limits apply until someone in the group replies, and the 6-text limit counts the group's texts since anyone in it last wrote. These errors are never retryable and never `429`.
270
+
271
+ Send an `Idempotency-Key` header (or `message.idempotency_key`) so you can safely retry. Repeating a request with the same key returns `200` with the original response instead of sending again.
272
+
273
+ Errors worth handling:
274
+ - `400 PRE_REPLY_*`: the contact hasn't replied yet, or hasn't responded to your last 6 texts (see the limits above).
275
+ - `403 RECIPIENT_SUPPRESSED`: the recipient opted out.
276
+ - `403 CONTACT_NOT_VERIFIED`: on the Free Plan, the contact hasn't texted your Free Plan number to verify yet.
277
+ - `403 CONTACT_MUST_TEXT_FIRST`: the number is on the AI Agent plan: it only replies to people who text it first, and can't send to group chats.
278
+ - `429 RATE_LIMIT_EXCEEDED` or `429 QUEUE_FULL`: the sending number hit a limit. Wait `Retry-After` seconds. Each number's current limits are in `GET /v1/phone-numbers` under `limits`.
279
+ - `409 SENDER_RETIRED`: the chat's number was retired. Start a new chat from an active number.
280
+ - `503 QUEUE_UNAVAILABLE`: Blujay couldn't accept the message right now. Retry with the same `Idempotency-Key`.
281
+
282
+ Parameters
283
+ ----------
284
+ chat_id : ChatId
285
+
286
+ message : MessageInputParams
287
+
288
+ team_member_id : typing.Optional[MemberId]
289
+ The teammate sending this message, from `GET /v1/team-members`. The message shows as sent by them in Blujay and reports this `team_member_id` in reads and webhooks; it does not assign the chat to them. Must be an active teammate in your workspace; anything else (unknown, deactivated, or another workspace's teammate) returns `404 NOT_FOUND` before anything is sent. It is part of the idempotent request, so reusing an idempotency key with a different or missing `team_member_id` returns `409 IDEMPOTENCY_REQUEST_MISMATCH`.
290
+
291
+ pre_reply_override : typing.Optional[bool]
292
+ API keys only. Sends a 7th text in a row to a contact who hasn't responded, once. A later text before they respond still returns `PRE_REPLY_LIMIT_REACHED`. It never lifts `PRE_REPLY_CONTENT_BLOCKED` or `PRE_REPLY_LENGTH_EXCEEDED`, and connected apps such as Zapier can't use it.
293
+
294
+ idempotency_key : typing.Optional[str]
295
+
296
+ request_options : typing.Optional[RequestOptions]
297
+ Request-specific configuration.
298
+
299
+ Returns
300
+ -------
301
+ ChatMessageSendResponse
302
+ This `Idempotency-Key` was already used for the same request. The response is the original one, and nothing was sent again.
303
+
304
+ Examples
305
+ --------
306
+ import asyncio
307
+
308
+ from blujay import AsyncBlujay
309
+
310
+ client = AsyncBlujay(
311
+ api_key="YOUR_API_KEY",
312
+ )
313
+
314
+
315
+ async def main() -> None:
316
+ await client.chats.messages.send(
317
+ chat_id="chat_abc123",
318
+ message={
319
+ "parts": [
320
+ {"type": "text", "text": "Here is the follow-up we discussed."}
321
+ ]
322
+ },
323
+ )
324
+
325
+
326
+ asyncio.run(main())
327
+ """
328
+ _response = await self._raw_client.send(
329
+ chat_id,
330
+ message=message,
331
+ team_member_id=team_member_id,
332
+ pre_reply_override=pre_reply_override,
333
+ idempotency_key=idempotency_key,
334
+ request_options=request_options,
335
+ )
336
+ return _response.data