pachca-sdk 1.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 (241) hide show
  1. pachca_sdk-1.0.0/PKG-INFO +141 -0
  2. pachca_sdk-1.0.0/README.md +124 -0
  3. pachca_sdk-1.0.0/pachca/__init__.py +8 -0
  4. pachca_sdk-1.0.0/pachca/api/__init__.py +1 -0
  5. pachca_sdk-1.0.0/pachca/api/bots/__init__.py +1 -0
  6. pachca_sdk-1.0.0/pachca/api/bots/bot_operations_delete_webhook_event.py +222 -0
  7. pachca_sdk-1.0.0/pachca/api/bots/bot_operations_get_webhook_events.py +273 -0
  8. pachca_sdk-1.0.0/pachca/api/bots/bot_operations_update_bot.py +265 -0
  9. pachca_sdk-1.0.0/pachca/api/chats/__init__.py +1 -0
  10. pachca_sdk-1.0.0/pachca/api/chats/chat_operations_archive_chat.py +210 -0
  11. pachca_sdk-1.0.0/pachca/api/chats/chat_operations_create_chat.py +237 -0
  12. pachca_sdk-1.0.0/pachca/api/chats/chat_operations_get_chat.py +210 -0
  13. pachca_sdk-1.0.0/pachca/api/chats/chat_operations_list_chats.py +322 -0
  14. pachca_sdk-1.0.0/pachca/api/chats/chat_operations_unarchive_chat.py +210 -0
  15. pachca_sdk-1.0.0/pachca/api/chats/chat_operations_update_chat.py +249 -0
  16. pachca_sdk-1.0.0/pachca/api/common/__init__.py +1 -0
  17. pachca_sdk-1.0.0/pachca/api/common/common_operations_list_properties.py +251 -0
  18. pachca_sdk-1.0.0/pachca/api/common/direct_upload_operations_upload_file.py +165 -0
  19. pachca_sdk-1.0.0/pachca/api/common/export_operations_download_export.py +243 -0
  20. pachca_sdk-1.0.0/pachca/api/common/export_operations_request_export.py +242 -0
  21. pachca_sdk-1.0.0/pachca/api/common/upload_operations_get_upload_params.py +181 -0
  22. pachca_sdk-1.0.0/pachca/api/group_tags/__init__.py +1 -0
  23. pachca_sdk-1.0.0/pachca/api/group_tags/group_tag_operations_create_tag.py +225 -0
  24. pachca_sdk-1.0.0/pachca/api/group_tags/group_tag_operations_delete_tag.py +218 -0
  25. pachca_sdk-1.0.0/pachca/api/group_tags/group_tag_operations_get_tag.py +210 -0
  26. pachca_sdk-1.0.0/pachca/api/group_tags/group_tag_operations_get_tag_users.py +253 -0
  27. pachca_sdk-1.0.0/pachca/api/group_tags/group_tag_operations_list_tags.py +257 -0
  28. pachca_sdk-1.0.0/pachca/api/group_tags/group_tag_operations_update_tag.py +257 -0
  29. pachca_sdk-1.0.0/pachca/api/link_previews/__init__.py +1 -0
  30. pachca_sdk-1.0.0/pachca/api/link_previews/link_preview_operations_create_link_previews.py +305 -0
  31. pachca_sdk-1.0.0/pachca/api/members/__init__.py +1 -0
  32. pachca_sdk-1.0.0/pachca/api/members/chat_member_operations_add_members.py +237 -0
  33. pachca_sdk-1.0.0/pachca/api/members/chat_member_operations_add_tags.py +237 -0
  34. pachca_sdk-1.0.0/pachca/api/members/chat_member_operations_leave_chat.py +216 -0
  35. pachca_sdk-1.0.0/pachca/api/members/chat_member_operations_list_members.py +293 -0
  36. pachca_sdk-1.0.0/pachca/api/members/chat_member_operations_remove_member.py +227 -0
  37. pachca_sdk-1.0.0/pachca/api/members/chat_member_operations_remove_tag.py +223 -0
  38. pachca_sdk-1.0.0/pachca/api/members/chat_member_operations_update_member_role.py +270 -0
  39. pachca_sdk-1.0.0/pachca/api/messages/__init__.py +1 -0
  40. pachca_sdk-1.0.0/pachca/api/messages/chat_message_operations_list_chat_messages.py +295 -0
  41. pachca_sdk-1.0.0/pachca/api/messages/message_operations_create_message.py +257 -0
  42. pachca_sdk-1.0.0/pachca/api/messages/message_operations_delete_message.py +230 -0
  43. pachca_sdk-1.0.0/pachca/api/messages/message_operations_get_message.py +210 -0
  44. pachca_sdk-1.0.0/pachca/api/messages/message_operations_pin_message.py +217 -0
  45. pachca_sdk-1.0.0/pachca/api/messages/message_operations_unpin_message.py +210 -0
  46. pachca_sdk-1.0.0/pachca/api/messages/message_operations_update_message.py +249 -0
  47. pachca_sdk-1.0.0/pachca/api/profile/__init__.py +1 -0
  48. pachca_sdk-1.0.0/pachca/api/profile/profile_operations_delete_status.py +173 -0
  49. pachca_sdk-1.0.0/pachca/api/profile/profile_operations_get_profile.py +173 -0
  50. pachca_sdk-1.0.0/pachca/api/profile/profile_operations_get_status.py +173 -0
  51. pachca_sdk-1.0.0/pachca/api/profile/profile_operations_update_status.py +217 -0
  52. pachca_sdk-1.0.0/pachca/api/reactions/__init__.py +1 -0
  53. pachca_sdk-1.0.0/pachca/api/reactions/reaction_operations_add_reaction.py +281 -0
  54. pachca_sdk-1.0.0/pachca/api/reactions/reaction_operations_list_reactions.py +253 -0
  55. pachca_sdk-1.0.0/pachca/api/reactions/reaction_operations_remove_reaction.py +273 -0
  56. pachca_sdk-1.0.0/pachca/api/read_member/__init__.py +1 -0
  57. pachca_sdk-1.0.0/pachca/api/read_member/read_member_operations_list_read_members.py +253 -0
  58. pachca_sdk-1.0.0/pachca/api/security/__init__.py +1 -0
  59. pachca_sdk-1.0.0/pachca/api/security/security_operations_get_audit_events.py +350 -0
  60. pachca_sdk-1.0.0/pachca/api/tasks/__init__.py +1 -0
  61. pachca_sdk-1.0.0/pachca/api/tasks/task_operations_create_task.py +273 -0
  62. pachca_sdk-1.0.0/pachca/api/tasks/task_operations_delete_task.py +210 -0
  63. pachca_sdk-1.0.0/pachca/api/tasks/task_operations_get_task.py +210 -0
  64. pachca_sdk-1.0.0/pachca/api/tasks/task_operations_list_tasks.py +226 -0
  65. pachca_sdk-1.0.0/pachca/api/tasks/task_operations_update_task.py +249 -0
  66. pachca_sdk-1.0.0/pachca/api/thread/__init__.py +1 -0
  67. pachca_sdk-1.0.0/pachca/api/thread/thread_operations_create_thread.py +214 -0
  68. pachca_sdk-1.0.0/pachca/api/thread/thread_operations_get_thread.py +210 -0
  69. pachca_sdk-1.0.0/pachca/api/users/__init__.py +1 -0
  70. pachca_sdk-1.0.0/pachca/api/users/user_operations_create_user.py +241 -0
  71. pachca_sdk-1.0.0/pachca/api/users/user_operations_delete_user.py +218 -0
  72. pachca_sdk-1.0.0/pachca/api/users/user_operations_get_user.py +210 -0
  73. pachca_sdk-1.0.0/pachca/api/users/user_operations_list_users.py +248 -0
  74. pachca_sdk-1.0.0/pachca/api/users/user_operations_update_user.py +265 -0
  75. pachca_sdk-1.0.0/pachca/api/views/__init__.py +1 -0
  76. pachca_sdk-1.0.0/pachca/api/views/form_operations_open_view.py +236 -0
  77. pachca_sdk-1.0.0/pachca/client.py +271 -0
  78. pachca_sdk-1.0.0/pachca/errors.py +14 -0
  79. pachca_sdk-1.0.0/pachca/models/__init__.py +323 -0
  80. pachca_sdk-1.0.0/pachca/models/add_members_request.py +91 -0
  81. pachca_sdk-1.0.0/pachca/models/add_tags_request.py +81 -0
  82. pachca_sdk-1.0.0/pachca/models/api_error.py +95 -0
  83. pachca_sdk-1.0.0/pachca/models/api_error_item.py +128 -0
  84. pachca_sdk-1.0.0/pachca/models/audit_event.py +164 -0
  85. pachca_sdk-1.0.0/pachca/models/audit_event_details.py +69 -0
  86. pachca_sdk-1.0.0/pachca/models/bearer_auth.py +92 -0
  87. pachca_sdk-1.0.0/pachca/models/bearer_auth_scheme.py +7 -0
  88. pachca_sdk-1.0.0/pachca/models/bearer_auth_type.py +7 -0
  89. pachca_sdk-1.0.0/pachca/models/bot_operations_get_webhook_events_response_200.py +118 -0
  90. pachca_sdk-1.0.0/pachca/models/bot_operations_update_bot_response_200.py +85 -0
  91. pachca_sdk-1.0.0/pachca/models/bot_response.py +93 -0
  92. pachca_sdk-1.0.0/pachca/models/bot_response_webhook.py +77 -0
  93. pachca_sdk-1.0.0/pachca/models/bot_update_request.py +85 -0
  94. pachca_sdk-1.0.0/pachca/models/bot_update_request_bot.py +85 -0
  95. pachca_sdk-1.0.0/pachca/models/bot_update_request_bot_webhook.py +77 -0
  96. pachca_sdk-1.0.0/pachca/models/button.py +96 -0
  97. pachca_sdk-1.0.0/pachca/models/button_webhook_payload.py +142 -0
  98. pachca_sdk-1.0.0/pachca/models/button_webhook_payload_event.py +7 -0
  99. pachca_sdk-1.0.0/pachca/models/button_webhook_payload_type.py +7 -0
  100. pachca_sdk-1.0.0/pachca/models/chat.py +174 -0
  101. pachca_sdk-1.0.0/pachca/models/chat_availability.py +8 -0
  102. pachca_sdk-1.0.0/pachca/models/chat_create_request.py +85 -0
  103. pachca_sdk-1.0.0/pachca/models/chat_create_request_chat.py +125 -0
  104. pachca_sdk-1.0.0/pachca/models/chat_member_operations_list_members_response_200.py +118 -0
  105. pachca_sdk-1.0.0/pachca/models/chat_member_role.py +9 -0
  106. pachca_sdk-1.0.0/pachca/models/chat_member_role_filter.py +11 -0
  107. pachca_sdk-1.0.0/pachca/models/chat_member_webhook_payload.py +157 -0
  108. pachca_sdk-1.0.0/pachca/models/chat_member_webhook_payload_type.py +7 -0
  109. pachca_sdk-1.0.0/pachca/models/chat_message_operations_list_chat_messages_response_200.py +118 -0
  110. pachca_sdk-1.0.0/pachca/models/chat_operations_create_chat_response_201.py +85 -0
  111. pachca_sdk-1.0.0/pachca/models/chat_operations_get_chat_response_200.py +85 -0
  112. pachca_sdk-1.0.0/pachca/models/chat_operations_list_chats_response_200.py +118 -0
  113. pachca_sdk-1.0.0/pachca/models/chat_operations_update_chat_response_200.py +85 -0
  114. pachca_sdk-1.0.0/pachca/models/chat_update_request.py +85 -0
  115. pachca_sdk-1.0.0/pachca/models/chat_update_request_chat.py +88 -0
  116. pachca_sdk-1.0.0/pachca/models/common_operations_list_properties_response_200.py +95 -0
  117. pachca_sdk-1.0.0/pachca/models/company_member_webhook_payload.py +127 -0
  118. pachca_sdk-1.0.0/pachca/models/company_member_webhook_payload_type.py +7 -0
  119. pachca_sdk-1.0.0/pachca/models/custom_property.py +105 -0
  120. pachca_sdk-1.0.0/pachca/models/custom_property_data_type.py +10 -0
  121. pachca_sdk-1.0.0/pachca/models/custom_property_definition.py +97 -0
  122. pachca_sdk-1.0.0/pachca/models/empty_response.py +66 -0
  123. pachca_sdk-1.0.0/pachca/models/export_request.py +129 -0
  124. pachca_sdk-1.0.0/pachca/models/file.py +161 -0
  125. pachca_sdk-1.0.0/pachca/models/file_type.py +8 -0
  126. pachca_sdk-1.0.0/pachca/models/file_upload_request.py +205 -0
  127. pachca_sdk-1.0.0/pachca/models/forwarding.py +155 -0
  128. pachca_sdk-1.0.0/pachca/models/group_tag.py +93 -0
  129. pachca_sdk-1.0.0/pachca/models/group_tag_operations_create_tag_response_201.py +85 -0
  130. pachca_sdk-1.0.0/pachca/models/group_tag_operations_get_tag_response_200.py +85 -0
  131. pachca_sdk-1.0.0/pachca/models/group_tag_operations_get_tag_users_response_200.py +118 -0
  132. pachca_sdk-1.0.0/pachca/models/group_tag_operations_list_tags_response_200.py +118 -0
  133. pachca_sdk-1.0.0/pachca/models/group_tag_operations_update_tag_response_200.py +85 -0
  134. pachca_sdk-1.0.0/pachca/models/group_tag_request.py +85 -0
  135. pachca_sdk-1.0.0/pachca/models/group_tag_request_group_tag.py +76 -0
  136. pachca_sdk-1.0.0/pachca/models/invite_status.py +8 -0
  137. pachca_sdk-1.0.0/pachca/models/link_preview.py +120 -0
  138. pachca_sdk-1.0.0/pachca/models/link_preview_image.py +94 -0
  139. pachca_sdk-1.0.0/pachca/models/link_previews_request.py +86 -0
  140. pachca_sdk-1.0.0/pachca/models/link_previews_request_link_previews.py +83 -0
  141. pachca_sdk-1.0.0/pachca/models/member_event_type.py +8 -0
  142. pachca_sdk-1.0.0/pachca/models/message.py +278 -0
  143. pachca_sdk-1.0.0/pachca/models/message_create_request.py +85 -0
  144. pachca_sdk-1.0.0/pachca/models/message_create_request_message.py +229 -0
  145. pachca_sdk-1.0.0/pachca/models/message_create_request_message_files_item.py +127 -0
  146. pachca_sdk-1.0.0/pachca/models/message_create_request_message_files_item_file_type.py +8 -0
  147. pachca_sdk-1.0.0/pachca/models/message_entity_type.py +9 -0
  148. pachca_sdk-1.0.0/pachca/models/message_operations_create_message_response_201.py +85 -0
  149. pachca_sdk-1.0.0/pachca/models/message_operations_get_message_response_200.py +85 -0
  150. pachca_sdk-1.0.0/pachca/models/message_operations_update_message_response_200.py +85 -0
  151. pachca_sdk-1.0.0/pachca/models/message_update_request.py +85 -0
  152. pachca_sdk-1.0.0/pachca/models/message_update_request_message.py +171 -0
  153. pachca_sdk-1.0.0/pachca/models/message_update_request_message_files_item.py +125 -0
  154. pachca_sdk-1.0.0/pachca/models/message_webhook_payload.py +221 -0
  155. pachca_sdk-1.0.0/pachca/models/message_webhook_payload_type.py +7 -0
  156. pachca_sdk-1.0.0/pachca/models/o_auth_error.py +85 -0
  157. pachca_sdk-1.0.0/pachca/models/open_view_request.py +128 -0
  158. pachca_sdk-1.0.0/pachca/models/open_view_request_type.py +7 -0
  159. pachca_sdk-1.0.0/pachca/models/open_view_request_view.py +284 -0
  160. pachca_sdk-1.0.0/pachca/models/pagination_meta.py +94 -0
  161. pachca_sdk-1.0.0/pachca/models/pagination_meta_paginate.py +79 -0
  162. pachca_sdk-1.0.0/pachca/models/profile_operations_get_profile_response_200.py +85 -0
  163. pachca_sdk-1.0.0/pachca/models/profile_operations_get_status_response_200.py +85 -0
  164. pachca_sdk-1.0.0/pachca/models/profile_operations_update_status_response_200.py +85 -0
  165. pachca_sdk-1.0.0/pachca/models/reaction.py +110 -0
  166. pachca_sdk-1.0.0/pachca/models/reaction_event_type.py +8 -0
  167. pachca_sdk-1.0.0/pachca/models/reaction_operations_list_reactions_response_200.py +118 -0
  168. pachca_sdk-1.0.0/pachca/models/reaction_request.py +87 -0
  169. pachca_sdk-1.0.0/pachca/models/reaction_webhook_payload.py +148 -0
  170. pachca_sdk-1.0.0/pachca/models/reaction_webhook_payload_type.py +7 -0
  171. pachca_sdk-1.0.0/pachca/models/read_member_operations_list_read_members_response_200.py +105 -0
  172. pachca_sdk-1.0.0/pachca/models/search_entity_type.py +8 -0
  173. pachca_sdk-1.0.0/pachca/models/security_operations_get_audit_events_response_200.py +118 -0
  174. pachca_sdk-1.0.0/pachca/models/sort_order.py +8 -0
  175. pachca_sdk-1.0.0/pachca/models/status_update_request.py +85 -0
  176. pachca_sdk-1.0.0/pachca/models/status_update_request_status.py +107 -0
  177. pachca_sdk-1.0.0/pachca/models/task.py +214 -0
  178. pachca_sdk-1.0.0/pachca/models/task_create_request.py +85 -0
  179. pachca_sdk-1.0.0/pachca/models/task_create_request_task.py +178 -0
  180. pachca_sdk-1.0.0/pachca/models/task_create_request_task_custom_properties_item.py +84 -0
  181. pachca_sdk-1.0.0/pachca/models/task_kind.py +11 -0
  182. pachca_sdk-1.0.0/pachca/models/task_operations_create_task_response_201.py +85 -0
  183. pachca_sdk-1.0.0/pachca/models/task_operations_get_task_response_200.py +85 -0
  184. pachca_sdk-1.0.0/pachca/models/task_operations_list_tasks_response_200.py +118 -0
  185. pachca_sdk-1.0.0/pachca/models/task_operations_update_task_response_200.py +85 -0
  186. pachca_sdk-1.0.0/pachca/models/task_status.py +8 -0
  187. pachca_sdk-1.0.0/pachca/models/task_update_request.py +85 -0
  188. pachca_sdk-1.0.0/pachca/models/task_update_request_task.py +228 -0
  189. pachca_sdk-1.0.0/pachca/models/task_update_request_task_custom_properties_item.py +84 -0
  190. pachca_sdk-1.0.0/pachca/models/task_update_request_task_status.py +8 -0
  191. pachca_sdk-1.0.0/pachca/models/thread.py +118 -0
  192. pachca_sdk-1.0.0/pachca/models/thread_operations_create_thread_response_201.py +85 -0
  193. pachca_sdk-1.0.0/pachca/models/thread_operations_get_thread_response_200.py +85 -0
  194. pachca_sdk-1.0.0/pachca/models/update_member_role_request.py +81 -0
  195. pachca_sdk-1.0.0/pachca/models/upload_params.py +148 -0
  196. pachca_sdk-1.0.0/pachca/models/user.py +281 -0
  197. pachca_sdk-1.0.0/pachca/models/user_create_request.py +97 -0
  198. pachca_sdk-1.0.0/pachca/models/user_create_request_user.py +206 -0
  199. pachca_sdk-1.0.0/pachca/models/user_create_request_user_custom_properties_item.py +84 -0
  200. pachca_sdk-1.0.0/pachca/models/user_event_type.py +12 -0
  201. pachca_sdk-1.0.0/pachca/models/user_operations_create_user_response_201.py +85 -0
  202. pachca_sdk-1.0.0/pachca/models/user_operations_get_user_response_200.py +85 -0
  203. pachca_sdk-1.0.0/pachca/models/user_operations_list_users_response_200.py +118 -0
  204. pachca_sdk-1.0.0/pachca/models/user_operations_update_user_response_200.py +85 -0
  205. pachca_sdk-1.0.0/pachca/models/user_role.py +9 -0
  206. pachca_sdk-1.0.0/pachca/models/user_status.py +117 -0
  207. pachca_sdk-1.0.0/pachca/models/user_update_request.py +85 -0
  208. pachca_sdk-1.0.0/pachca/models/user_update_request_user.py +208 -0
  209. pachca_sdk-1.0.0/pachca/models/user_update_request_user_custom_properties_item.py +84 -0
  210. pachca_sdk-1.0.0/pachca/models/user_update_request_user_role.py +9 -0
  211. pachca_sdk-1.0.0/pachca/models/validation_error_code.py +41 -0
  212. pachca_sdk-1.0.0/pachca/models/view_block.py +127 -0
  213. pachca_sdk-1.0.0/pachca/models/view_block_checkbox.py +148 -0
  214. pachca_sdk-1.0.0/pachca/models/view_block_checkbox_type.py +7 -0
  215. pachca_sdk-1.0.0/pachca/models/view_block_date.py +126 -0
  216. pachca_sdk-1.0.0/pachca/models/view_block_date_type.py +7 -0
  217. pachca_sdk-1.0.0/pachca/models/view_block_divider.py +81 -0
  218. pachca_sdk-1.0.0/pachca/models/view_block_divider_type.py +7 -0
  219. pachca_sdk-1.0.0/pachca/models/view_block_file_input.py +145 -0
  220. pachca_sdk-1.0.0/pachca/models/view_block_file_input_type.py +7 -0
  221. pachca_sdk-1.0.0/pachca/models/view_block_header.py +89 -0
  222. pachca_sdk-1.0.0/pachca/models/view_block_header_type.py +7 -0
  223. pachca_sdk-1.0.0/pachca/models/view_block_input.py +166 -0
  224. pachca_sdk-1.0.0/pachca/models/view_block_input_type.py +7 -0
  225. pachca_sdk-1.0.0/pachca/models/view_block_markdown.py +90 -0
  226. pachca_sdk-1.0.0/pachca/models/view_block_markdown_type.py +7 -0
  227. pachca_sdk-1.0.0/pachca/models/view_block_option.py +115 -0
  228. pachca_sdk-1.0.0/pachca/models/view_block_plain_text.py +90 -0
  229. pachca_sdk-1.0.0/pachca/models/view_block_plain_text_type.py +7 -0
  230. pachca_sdk-1.0.0/pachca/models/view_block_radio.py +149 -0
  231. pachca_sdk-1.0.0/pachca/models/view_block_radio_type.py +7 -0
  232. pachca_sdk-1.0.0/pachca/models/view_block_select.py +148 -0
  233. pachca_sdk-1.0.0/pachca/models/view_block_select_type.py +7 -0
  234. pachca_sdk-1.0.0/pachca/models/view_block_time.py +127 -0
  235. pachca_sdk-1.0.0/pachca/models/view_block_time_type.py +7 -0
  236. pachca_sdk-1.0.0/pachca/models/webhook_event.py +186 -0
  237. pachca_sdk-1.0.0/pachca/models/webhook_event_type.py +9 -0
  238. pachca_sdk-1.0.0/pachca/models/webhook_message_thread.py +85 -0
  239. pachca_sdk-1.0.0/pachca/py.typed +1 -0
  240. pachca_sdk-1.0.0/pachca/types.py +53 -0
  241. pachca_sdk-1.0.0/pyproject.toml +26 -0
@@ -0,0 +1,141 @@
1
+ Metadata-Version: 2.4
2
+ Name: pachca-sdk
3
+ Version: 1.0.0
4
+ Summary: A client library for accessing Pachca API
5
+ Requires-Python: >=3.10,<4.0
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Programming Language :: Python :: 3.10
8
+ Classifier: Programming Language :: Python :: 3.11
9
+ Classifier: Programming Language :: Python :: 3.12
10
+ Classifier: Programming Language :: Python :: 3.13
11
+ Classifier: Programming Language :: Python :: 3.14
12
+ Requires-Dist: attrs (>=22.2.0)
13
+ Requires-Dist: httpx (>=0.23.0,<0.29.0)
14
+ Requires-Dist: python-dateutil (>=2.8.0,<3.0.0)
15
+ Description-Content-Type: text/markdown
16
+
17
+ # pachca
18
+ A client library for accessing Pachca API
19
+
20
+ ## Usage
21
+ First, create a client:
22
+
23
+ ```python
24
+ from pachca import Client
25
+
26
+ client = Client(base_url="https://api.example.com")
27
+ ```
28
+
29
+ If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead:
30
+
31
+ ```python
32
+ from pachca import AuthenticatedClient
33
+
34
+ client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken")
35
+ ```
36
+
37
+ Now call your endpoint and use your models:
38
+
39
+ ```python
40
+ from pachca.models import MyDataModel
41
+ from pachca.api.my_tag import get_my_data_model
42
+ from pachca.types import Response
43
+
44
+ with client as client:
45
+ my_data: MyDataModel = get_my_data_model.sync(client=client)
46
+ # or if you need more info (e.g. status_code)
47
+ response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client)
48
+ ```
49
+
50
+ Or do the same thing with an async version:
51
+
52
+ ```python
53
+ from pachca.models import MyDataModel
54
+ from pachca.api.my_tag import get_my_data_model
55
+ from pachca.types import Response
56
+
57
+ async with client as client:
58
+ my_data: MyDataModel = await get_my_data_model.asyncio(client=client)
59
+ response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client)
60
+ ```
61
+
62
+ By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle.
63
+
64
+ ```python
65
+ client = AuthenticatedClient(
66
+ base_url="https://internal_api.example.com",
67
+ token="SuperSecretToken",
68
+ verify_ssl="/path/to/certificate_bundle.pem",
69
+ )
70
+ ```
71
+
72
+ You can also disable certificate validation altogether, but beware that **this is a security risk**.
73
+
74
+ ```python
75
+ client = AuthenticatedClient(
76
+ base_url="https://internal_api.example.com",
77
+ token="SuperSecretToken",
78
+ verify_ssl=False
79
+ )
80
+ ```
81
+
82
+ Things to know:
83
+ 1. Every path/method combo becomes a Python module with four functions:
84
+ 1. `sync`: Blocking request that returns parsed data (if successful) or `None`
85
+ 1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful.
86
+ 1. `asyncio`: Like `sync` but async instead of blocking
87
+ 1. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking
88
+
89
+ 1. All path/query params, and bodies become method arguments.
90
+ 1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
91
+ 1. Any endpoint which did not have a tag will be in `pachca.api.default`
92
+
93
+ ## Advanced customizations
94
+
95
+ There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying `httpx.Client` or `httpx.AsyncClient` (depending on your use-case):
96
+
97
+ ```python
98
+ from pachca import Client
99
+
100
+ def log_request(request):
101
+ print(f"Request event hook: {request.method} {request.url} - Waiting for response")
102
+
103
+ def log_response(response):
104
+ request = response.request
105
+ print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}")
106
+
107
+ client = Client(
108
+ base_url="https://api.example.com",
109
+ httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}},
110
+ )
111
+
112
+ # Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client()
113
+ ```
114
+
115
+ You can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url):
116
+
117
+ ```python
118
+ import httpx
119
+ from pachca import Client
120
+
121
+ client = Client(
122
+ base_url="https://api.example.com",
123
+ )
124
+ # Note that base_url needs to be re-set, as would any shared cookies, headers, etc.
125
+ client.set_httpx_client(httpx.Client(base_url="https://api.example.com", proxies="http://localhost:8030"))
126
+ ```
127
+
128
+ ## Building / publishing this package
129
+ This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics:
130
+ 1. Update the metadata in pyproject.toml (e.g. authors, version)
131
+ 1. If you're using a private repository, configure it with Poetry
132
+ 1. `poetry config repositories.<your-repository-name> <url-to-your-repository>`
133
+ 1. `poetry config http-basic.<your-repository-name> <username> <password>`
134
+ 1. Publish the client with `poetry publish --build -r <your-repository-name>` or, if for public PyPI, just `poetry publish --build`
135
+
136
+ If you want to install this client into another project without publishing it (e.g. for development) then:
137
+ 1. If that project **is using Poetry**, you can simply do `poetry add <path-to-this-client>` from that project
138
+ 1. If that project is not using Poetry:
139
+ 1. Build a wheel with `poetry build -f wheel`
140
+ 1. Install that wheel from the other project `pip install <path-to-wheel>`
141
+
@@ -0,0 +1,124 @@
1
+ # pachca
2
+ A client library for accessing Pachca API
3
+
4
+ ## Usage
5
+ First, create a client:
6
+
7
+ ```python
8
+ from pachca import Client
9
+
10
+ client = Client(base_url="https://api.example.com")
11
+ ```
12
+
13
+ If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead:
14
+
15
+ ```python
16
+ from pachca import AuthenticatedClient
17
+
18
+ client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken")
19
+ ```
20
+
21
+ Now call your endpoint and use your models:
22
+
23
+ ```python
24
+ from pachca.models import MyDataModel
25
+ from pachca.api.my_tag import get_my_data_model
26
+ from pachca.types import Response
27
+
28
+ with client as client:
29
+ my_data: MyDataModel = get_my_data_model.sync(client=client)
30
+ # or if you need more info (e.g. status_code)
31
+ response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client)
32
+ ```
33
+
34
+ Or do the same thing with an async version:
35
+
36
+ ```python
37
+ from pachca.models import MyDataModel
38
+ from pachca.api.my_tag import get_my_data_model
39
+ from pachca.types import Response
40
+
41
+ async with client as client:
42
+ my_data: MyDataModel = await get_my_data_model.asyncio(client=client)
43
+ response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client)
44
+ ```
45
+
46
+ By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle.
47
+
48
+ ```python
49
+ client = AuthenticatedClient(
50
+ base_url="https://internal_api.example.com",
51
+ token="SuperSecretToken",
52
+ verify_ssl="/path/to/certificate_bundle.pem",
53
+ )
54
+ ```
55
+
56
+ You can also disable certificate validation altogether, but beware that **this is a security risk**.
57
+
58
+ ```python
59
+ client = AuthenticatedClient(
60
+ base_url="https://internal_api.example.com",
61
+ token="SuperSecretToken",
62
+ verify_ssl=False
63
+ )
64
+ ```
65
+
66
+ Things to know:
67
+ 1. Every path/method combo becomes a Python module with four functions:
68
+ 1. `sync`: Blocking request that returns parsed data (if successful) or `None`
69
+ 1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful.
70
+ 1. `asyncio`: Like `sync` but async instead of blocking
71
+ 1. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking
72
+
73
+ 1. All path/query params, and bodies become method arguments.
74
+ 1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
75
+ 1. Any endpoint which did not have a tag will be in `pachca.api.default`
76
+
77
+ ## Advanced customizations
78
+
79
+ There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying `httpx.Client` or `httpx.AsyncClient` (depending on your use-case):
80
+
81
+ ```python
82
+ from pachca import Client
83
+
84
+ def log_request(request):
85
+ print(f"Request event hook: {request.method} {request.url} - Waiting for response")
86
+
87
+ def log_response(response):
88
+ request = response.request
89
+ print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}")
90
+
91
+ client = Client(
92
+ base_url="https://api.example.com",
93
+ httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}},
94
+ )
95
+
96
+ # Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client()
97
+ ```
98
+
99
+ You can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url):
100
+
101
+ ```python
102
+ import httpx
103
+ from pachca import Client
104
+
105
+ client = Client(
106
+ base_url="https://api.example.com",
107
+ )
108
+ # Note that base_url needs to be re-set, as would any shared cookies, headers, etc.
109
+ client.set_httpx_client(httpx.Client(base_url="https://api.example.com", proxies="http://localhost:8030"))
110
+ ```
111
+
112
+ ## Building / publishing this package
113
+ This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics:
114
+ 1. Update the metadata in pyproject.toml (e.g. authors, version)
115
+ 1. If you're using a private repository, configure it with Poetry
116
+ 1. `poetry config repositories.<your-repository-name> <url-to-your-repository>`
117
+ 1. `poetry config http-basic.<your-repository-name> <username> <password>`
118
+ 1. Publish the client with `poetry publish --build -r <your-repository-name>` or, if for public PyPI, just `poetry publish --build`
119
+
120
+ If you want to install this client into another project without publishing it (e.g. for development) then:
121
+ 1. If that project **is using Poetry**, you can simply do `poetry add <path-to-this-client>` from that project
122
+ 1. If that project is not using Poetry:
123
+ 1. Build a wheel with `poetry build -f wheel`
124
+ 1. Install that wheel from the other project `pip install <path-to-wheel>`
@@ -0,0 +1,8 @@
1
+
2
+ """ A client library for accessing Pachca API """
3
+ from .client import AuthenticatedClient, Client
4
+
5
+ __all__ = (
6
+ "AuthenticatedClient",
7
+ "Client",
8
+ )
@@ -0,0 +1 @@
1
+ """ Contains methods for accessing the API """
@@ -0,0 +1 @@
1
+ """ Contains endpoint functions for accessing the API """
@@ -0,0 +1,222 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, cast
3
+ from urllib.parse import quote
4
+
5
+ import httpx
6
+
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...types import Response, UNSET
9
+ from ... import errors
10
+
11
+ from ...models.api_error import ApiError
12
+ from ...models.empty_response import EmptyResponse
13
+ from ...models.o_auth_error import OAuthError
14
+ from typing import cast
15
+
16
+
17
+
18
+ def _get_kwargs(
19
+ id: str,
20
+
21
+ ) -> dict[str, Any]:
22
+
23
+
24
+
25
+
26
+
27
+
28
+ _kwargs: dict[str, Any] = {
29
+ "method": "delete",
30
+ "url": "/webhooks/events/{id}".format(id=quote(str(id), safe=""),),
31
+ }
32
+
33
+
34
+ return _kwargs
35
+
36
+
37
+
38
+ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ApiError | EmptyResponse | OAuthError | None:
39
+ if response.status_code == 204:
40
+ response_204 = EmptyResponse.from_dict(response.json())
41
+
42
+
43
+
44
+ return response_204
45
+
46
+ if response.status_code == 401:
47
+ response_401 = OAuthError.from_dict(response.json())
48
+
49
+
50
+
51
+ return response_401
52
+
53
+ if response.status_code == 403:
54
+ response_403 = OAuthError.from_dict(response.json())
55
+
56
+
57
+
58
+ return response_403
59
+
60
+ if response.status_code == 404:
61
+ response_404 = ApiError.from_dict(response.json())
62
+
63
+
64
+
65
+ return response_404
66
+
67
+ if client.raise_on_unexpected_status:
68
+ raise errors.UnexpectedStatus(response.status_code, response.content)
69
+ else:
70
+ return None
71
+
72
+
73
+ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[ApiError | EmptyResponse | OAuthError]:
74
+ return Response(
75
+ status_code=HTTPStatus(response.status_code),
76
+ content=response.content,
77
+ headers=response.headers,
78
+ parsed=_parse_response(client=client, response=response),
79
+ )
80
+
81
+
82
+ def sync_detailed(
83
+ id: str,
84
+ *,
85
+ client: AuthenticatedClient | Client,
86
+
87
+ ) -> Response[ApiError | EmptyResponse | OAuthError]:
88
+ """ Удаление события
89
+
90
+ Данный метод доступен для работы только с `access_token` бота
91
+
92
+ Метод для удаления события из истории событий бота.
93
+
94
+ Для удаления события вам необходимо знать `access_token` бота, которому принадлежит событие, и `id`
95
+ события.
96
+
97
+ Args:
98
+ id (str):
99
+
100
+ Raises:
101
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
102
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
103
+
104
+ Returns:
105
+ Response[ApiError | EmptyResponse | OAuthError]
106
+ """
107
+
108
+
109
+ kwargs = _get_kwargs(
110
+ id=id,
111
+
112
+ )
113
+
114
+ response = client.get_httpx_client().request(
115
+ **kwargs,
116
+ )
117
+
118
+ return _build_response(client=client, response=response)
119
+
120
+ def sync(
121
+ id: str,
122
+ *,
123
+ client: AuthenticatedClient | Client,
124
+
125
+ ) -> ApiError | EmptyResponse | OAuthError | None:
126
+ """ Удаление события
127
+
128
+ Данный метод доступен для работы только с `access_token` бота
129
+
130
+ Метод для удаления события из истории событий бота.
131
+
132
+ Для удаления события вам необходимо знать `access_token` бота, которому принадлежит событие, и `id`
133
+ события.
134
+
135
+ Args:
136
+ id (str):
137
+
138
+ Raises:
139
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
140
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
141
+
142
+ Returns:
143
+ ApiError | EmptyResponse | OAuthError
144
+ """
145
+
146
+
147
+ return sync_detailed(
148
+ id=id,
149
+ client=client,
150
+
151
+ ).parsed
152
+
153
+ async def asyncio_detailed(
154
+ id: str,
155
+ *,
156
+ client: AuthenticatedClient | Client,
157
+
158
+ ) -> Response[ApiError | EmptyResponse | OAuthError]:
159
+ """ Удаление события
160
+
161
+ Данный метод доступен для работы только с `access_token` бота
162
+
163
+ Метод для удаления события из истории событий бота.
164
+
165
+ Для удаления события вам необходимо знать `access_token` бота, которому принадлежит событие, и `id`
166
+ события.
167
+
168
+ Args:
169
+ id (str):
170
+
171
+ Raises:
172
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
173
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
174
+
175
+ Returns:
176
+ Response[ApiError | EmptyResponse | OAuthError]
177
+ """
178
+
179
+
180
+ kwargs = _get_kwargs(
181
+ id=id,
182
+
183
+ )
184
+
185
+ response = await client.get_async_httpx_client().request(
186
+ **kwargs
187
+ )
188
+
189
+ return _build_response(client=client, response=response)
190
+
191
+ async def asyncio(
192
+ id: str,
193
+ *,
194
+ client: AuthenticatedClient | Client,
195
+
196
+ ) -> ApiError | EmptyResponse | OAuthError | None:
197
+ """ Удаление события
198
+
199
+ Данный метод доступен для работы только с `access_token` бота
200
+
201
+ Метод для удаления события из истории событий бота.
202
+
203
+ Для удаления события вам необходимо знать `access_token` бота, которому принадлежит событие, и `id`
204
+ события.
205
+
206
+ Args:
207
+ id (str):
208
+
209
+ Raises:
210
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
211
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
212
+
213
+ Returns:
214
+ ApiError | EmptyResponse | OAuthError
215
+ """
216
+
217
+
218
+ return (await asyncio_detailed(
219
+ id=id,
220
+ client=client,
221
+
222
+ )).parsed