frameio 0.0.28__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 (385) hide show
  1. frameio/__init__.py +1158 -0
  2. frameio/account_permissions/__init__.py +4 -0
  3. frameio/account_permissions/client.py +193 -0
  4. frameio/account_permissions/raw_client.py +333 -0
  5. frameio/accounts/__init__.py +4 -0
  6. frameio/accounts/client.py +162 -0
  7. frameio/accounts/raw_client.py +309 -0
  8. frameio/client.py +439 -0
  9. frameio/comments/__init__.py +38 -0
  10. frameio/comments/client.py +654 -0
  11. frameio/comments/raw_client.py +1316 -0
  12. frameio/comments/types/__init__.py +40 -0
  13. frameio/comments/types/comments_show_request_include.py +5 -0
  14. frameio/comments/types/create_comment_params_data.py +33 -0
  15. frameio/comments/types/update_comment_params_data.py +33 -0
  16. frameio/core/__init__.py +122 -0
  17. frameio/core/api_error.py +23 -0
  18. frameio/core/client_wrapper.py +95 -0
  19. frameio/core/custom_pagination.py +152 -0
  20. frameio/core/datetime_utils.py +28 -0
  21. frameio/core/file.py +67 -0
  22. frameio/core/force_multipart.py +18 -0
  23. frameio/core/http_client.py +663 -0
  24. frameio/core/http_response.py +55 -0
  25. frameio/core/http_sse/__init__.py +42 -0
  26. frameio/core/http_sse/_api.py +112 -0
  27. frameio/core/http_sse/_decoders.py +61 -0
  28. frameio/core/http_sse/_exceptions.py +7 -0
  29. frameio/core/http_sse/_models.py +17 -0
  30. frameio/core/jsonable_encoder.py +100 -0
  31. frameio/core/pagination.py +82 -0
  32. frameio/core/pydantic_utilities.py +361 -0
  33. frameio/core/query_encoder.py +58 -0
  34. frameio/core/remove_none_from_dict.py +11 -0
  35. frameio/core/request_options.py +35 -0
  36. frameio/core/serialization.py +276 -0
  37. frameio/core/unchecked_base_model.py +376 -0
  38. frameio/environment.py +7 -0
  39. frameio/errors/__init__.py +53 -0
  40. frameio/errors/bad_request_error.py +11 -0
  41. frameio/errors/forbidden_error.py +11 -0
  42. frameio/errors/not_found_error.py +11 -0
  43. frameio/errors/too_many_requests_error.py +11 -0
  44. frameio/errors/unauthorized_error.py +11 -0
  45. frameio/errors/unprocessable_entity_error.py +10 -0
  46. frameio/files/__init__.py +58 -0
  47. frameio/files/client.py +1171 -0
  48. frameio/files/raw_client.py +2517 -0
  49. frameio/files/types/__init__.py +56 -0
  50. frameio/files/types/file_copy_params_data.py +15 -0
  51. frameio/files/types/file_create_local_upload_params_data.py +20 -0
  52. frameio/files/types/file_create_params_data.py +31 -0
  53. frameio/files/types/file_create_remote_upload_params_data.py +20 -0
  54. frameio/files/types/file_move_params_data.py +15 -0
  55. frameio/files/types/file_update_params_data.py +15 -0
  56. frameio/files/types/files_copy_request_copy_comments.py +5 -0
  57. frameio/folders/__init__.py +39 -0
  58. frameio/folders/client.py +1004 -0
  59. frameio/folders/raw_client.py +2074 -0
  60. frameio/folders/types/__init__.py +42 -0
  61. frameio/folders/types/folder_copy_params_data.py +15 -0
  62. frameio/folders/types/folder_create_params_data.py +15 -0
  63. frameio/folders/types/folder_move_params_data.py +15 -0
  64. frameio/folders/types/folder_update_params_data.py +15 -0
  65. frameio/metadata/__init__.py +37 -0
  66. frameio/metadata/client.py +293 -0
  67. frameio/metadata/raw_client.py +509 -0
  68. frameio/metadata/types/__init__.py +38 -0
  69. frameio/metadata/types/bulk_update_metadata_params_data.py +23 -0
  70. frameio/metadata/types/bulk_update_metadata_params_data_values_item.py +13 -0
  71. frameio/metadata_fields/__init__.py +103 -0
  72. frameio/metadata_fields/client.py +536 -0
  73. frameio/metadata_fields/raw_client.py +996 -0
  74. frameio/metadata_fields/types/__init__.py +105 -0
  75. frameio/metadata_fields/types/create_field_definition_params_data.py +112 -0
  76. frameio/metadata_fields/types/update_field_definition_params_data.py +118 -0
  77. frameio/project_permissions/__init__.py +4 -0
  78. frameio/project_permissions/client.py +426 -0
  79. frameio/project_permissions/raw_client.py +824 -0
  80. frameio/projects/__init__.py +38 -0
  81. frameio/projects/client.py +604 -0
  82. frameio/projects/raw_client.py +1286 -0
  83. frameio/projects/types/__init__.py +40 -0
  84. frameio/projects/types/project_params_data.py +20 -0
  85. frameio/projects/types/project_update_params_data.py +26 -0
  86. frameio/projects/types/project_update_params_data_status.py +5 -0
  87. frameio/py.typed +0 -0
  88. frameio/shares/__init__.py +64 -0
  89. frameio/shares/client.py +1217 -0
  90. frameio/shares/raw_client.py +2511 -0
  91. frameio/shares/types/__init__.py +61 -0
  92. frameio/shares/types/add_asset_params_data.py +15 -0
  93. frameio/shares/types/add_reviewers_to_share_params_data.py +18 -0
  94. frameio/shares/types/add_reviewers_to_share_params_data_reviewers.py +27 -0
  95. frameio/shares/types/create_share_params_data.py +26 -0
  96. frameio/shares/types/remove_reviewer_params_data.py +13 -0
  97. frameio/shares/types/remove_reviewer_params_data_reviewers.py +27 -0
  98. frameio/shares/types/update_share_params_data.py +34 -0
  99. frameio/shares/types/update_share_params_data_access.py +5 -0
  100. frameio/types/__init__.py +983 -0
  101. frameio/types/account.py +70 -0
  102. frameio/types/account_roles_item.py +5 -0
  103. frameio/types/account_user_role.py +23 -0
  104. frameio/types/account_user_role_role.py +5 -0
  105. frameio/types/account_user_roles_response.py +27 -0
  106. frameio/types/accounts_response.py +23 -0
  107. frameio/types/add_asset_response.py +13 -0
  108. frameio/types/add_asset_response_data.py +15 -0
  109. frameio/types/asset_common.py +48 -0
  110. frameio/types/asset_common_type.py +5 -0
  111. frameio/types/asset_common_with_includes.py +58 -0
  112. frameio/types/asset_common_with_includes_type.py +5 -0
  113. frameio/types/asset_include.py +5 -0
  114. frameio/types/asset_share_params.py +39 -0
  115. frameio/types/asset_share_params_access.py +5 -0
  116. frameio/types/asset_with_includes.py +76 -0
  117. frameio/types/assets_with_includes_response.py +23 -0
  118. frameio/types/bad_request.py +13 -0
  119. frameio/types/bad_request_errors_item.py +15 -0
  120. frameio/types/bad_request_errors_item_source.py +12 -0
  121. frameio/types/boolean_value.py +12 -0
  122. frameio/types/children_type.py +3 -0
  123. frameio/types/comment.py +59 -0
  124. frameio/types/comment_include.py +5 -0
  125. frameio/types/comment_response.py +13 -0
  126. frameio/types/comment_with_includes.py +17 -0
  127. frameio/types/comment_with_includes_response.py +13 -0
  128. frameio/types/comments_with_includes_response.py +23 -0
  129. frameio/types/date_definition.py +49 -0
  130. frameio/types/date_definition_field_configuration.py +21 -0
  131. frameio/types/date_definition_field_configuration_display_format.py +7 -0
  132. frameio/types/date_definition_field_configuration_time_format.py +5 -0
  133. frameio/types/date_definition_field_type.py +10 -0
  134. frameio/types/date_definition_params.py +17 -0
  135. frameio/types/date_definition_params_field_configuration.py +23 -0
  136. frameio/types/date_definition_params_field_configuration_display_format.py +7 -0
  137. frameio/types/date_definition_params_field_configuration_time_format.py +7 -0
  138. frameio/types/date_definition_with_includes.py +13 -0
  139. frameio/types/date_value.py +12 -0
  140. frameio/types/email.py +3 -0
  141. frameio/types/empty_json.py +5 -0
  142. frameio/types/field_definition.py +167 -0
  143. frameio/types/field_definition_include.py +5 -0
  144. frameio/types/field_definition_response.py +13 -0
  145. frameio/types/field_definition_with_includes.py +178 -0
  146. frameio/types/field_definitions_with_includes_response.py +27 -0
  147. frameio/types/field_value_common.py +29 -0
  148. frameio/types/file.py +60 -0
  149. frameio/types/file_copy_response.py +13 -0
  150. frameio/types/file_remote_upload_response.py +17 -0
  151. frameio/types/file_response.py +13 -0
  152. frameio/types/file_status.py +5 -0
  153. frameio/types/file_upload_status.py +41 -0
  154. frameio/types/file_upload_status_response.py +13 -0
  155. frameio/types/file_with_includes.py +25 -0
  156. frameio/types/file_with_includes_response.py +13 -0
  157. frameio/types/file_with_includes_status.py +5 -0
  158. frameio/types/file_with_media_links_include.py +19 -0
  159. frameio/types/file_with_upload_urls.py +16 -0
  160. frameio/types/file_with_upload_urls_response.py +13 -0
  161. frameio/types/folder.py +15 -0
  162. frameio/types/folder_copy_response.py +13 -0
  163. frameio/types/folder_response.py +13 -0
  164. frameio/types/folder_with_includes.py +63 -0
  165. frameio/types/folder_with_includes_response.py +13 -0
  166. frameio/types/folders_with_includes_response.py +23 -0
  167. frameio/types/forbidden.py +13 -0
  168. frameio/types/forbidden_errors_item.py +15 -0
  169. frameio/types/forbidden_errors_item_source.py +12 -0
  170. frameio/types/include.py +5 -0
  171. frameio/types/include_total_count.py +3 -0
  172. frameio/types/integer_value.py +12 -0
  173. frameio/types/json_error_response.py +13 -0
  174. frameio/types/json_error_response_errors_item.py +15 -0
  175. frameio/types/json_error_response_errors_item_source.py +12 -0
  176. frameio/types/links.py +22 -0
  177. frameio/types/long_text_definition.py +49 -0
  178. frameio/types/long_text_definition_field_configuration.py +10 -0
  179. frameio/types/long_text_definition_field_type.py +10 -0
  180. frameio/types/long_text_definition_params.py +15 -0
  181. frameio/types/long_text_definition_with_includes.py +13 -0
  182. frameio/types/media_link_common.py +17 -0
  183. frameio/types/media_links_collection.py +24 -0
  184. frameio/types/metadata_field.py +149 -0
  185. frameio/types/metadata_response.py +13 -0
  186. frameio/types/metadata_with_definition.py +21 -0
  187. frameio/types/multi_select_value.py +14 -0
  188. frameio/types/multi_user_value.py +20 -0
  189. frameio/types/multi_user_value_member_options_type.py +5 -0
  190. frameio/types/no_content.py +3 -0
  191. frameio/types/not_found.py +13 -0
  192. frameio/types/not_found_errors_item.py +15 -0
  193. frameio/types/not_found_errors_item_source.py +12 -0
  194. frameio/types/number_definition.py +43 -0
  195. frameio/types/number_definition_field_configuration.py +21 -0
  196. frameio/types/number_definition_field_configuration_number_format.py +7 -0
  197. frameio/types/number_definition_params.py +17 -0
  198. frameio/types/number_definition_params_field_configuration.py +23 -0
  199. frameio/types/number_definition_params_field_configuration_number_format.py +7 -0
  200. frameio/types/number_definition_with_includes.py +13 -0
  201. frameio/types/number_value.py +12 -0
  202. frameio/types/original_media_link.py +16 -0
  203. frameio/types/profile.py +34 -0
  204. frameio/types/profile_response.py +17 -0
  205. frameio/types/project.py +66 -0
  206. frameio/types/project_include.py +5 -0
  207. frameio/types/project_response.py +17 -0
  208. frameio/types/project_status.py +5 -0
  209. frameio/types/project_with_includes.py +18 -0
  210. frameio/types/project_with_includes_response.py +17 -0
  211. frameio/types/projects_with_includes_response.py +27 -0
  212. frameio/types/rating_definition.py +43 -0
  213. frameio/types/rating_definition_field_configuration.py +22 -0
  214. frameio/types/rating_definition_field_configuration_style.py +5 -0
  215. frameio/types/rating_definition_params.py +17 -0
  216. frameio/types/rating_definition_params_field_configuration.py +22 -0
  217. frameio/types/rating_definition_params_field_configuration_style.py +5 -0
  218. frameio/types/rating_definition_with_includes.py +13 -0
  219. frameio/types/remove_asset_response.py +13 -0
  220. frameio/types/remove_asset_response_data.py +15 -0
  221. frameio/types/rendition_media_link.py +19 -0
  222. frameio/types/request_after_opaque_cursor.py +5 -0
  223. frameio/types/request_page_size.py +3 -0
  224. frameio/types/select_definition.py +43 -0
  225. frameio/types/select_definition_field_configuration.py +18 -0
  226. frameio/types/select_definition_field_configuration_options_item.py +22 -0
  227. frameio/types/select_definition_params.py +17 -0
  228. frameio/types/select_definition_params_field_configuration.py +20 -0
  229. frameio/types/select_definition_params_field_configuration_options_item.py +20 -0
  230. frameio/types/select_definition_with_includes.py +13 -0
  231. frameio/types/select_multi_definition.py +49 -0
  232. frameio/types/select_multi_definition_field_configuration.py +18 -0
  233. frameio/types/select_multi_definition_field_configuration_options_item.py +22 -0
  234. frameio/types/select_multi_definition_field_type.py +10 -0
  235. frameio/types/select_multi_definition_params.py +17 -0
  236. frameio/types/select_multi_definition_params_field_configuration.py +20 -0
  237. frameio/types/select_multi_definition_params_field_configuration_options_item.py +20 -0
  238. frameio/types/select_multi_definition_with_includes.py +13 -0
  239. frameio/types/select_option.py +20 -0
  240. frameio/types/select_value.py +14 -0
  241. frameio/types/share.py +66 -0
  242. frameio/types/share_access.py +5 -0
  243. frameio/types/share_response.py +13 -0
  244. frameio/types/share_reviewers_response.py +27 -0
  245. frameio/types/shares_response.py +27 -0
  246. frameio/types/single_user_value.py +20 -0
  247. frameio/types/single_user_value_member_options_type.py +5 -0
  248. frameio/types/text_definition.py +49 -0
  249. frameio/types/text_definition_field_configuration.py +10 -0
  250. frameio/types/text_definition_field_type.py +10 -0
  251. frameio/types/text_definition_params.py +15 -0
  252. frameio/types/text_definition_with_includes.py +13 -0
  253. frameio/types/text_value.py +12 -0
  254. frameio/types/time_stamp.py +5 -0
  255. frameio/types/toggle_definition.py +43 -0
  256. frameio/types/toggle_definition_field_configuration.py +15 -0
  257. frameio/types/toggle_definition_params.py +17 -0
  258. frameio/types/toggle_definition_params_field_configuration.py +15 -0
  259. frameio/types/toggle_definition_with_includes.py +13 -0
  260. frameio/types/too_many_requests.py +13 -0
  261. frameio/types/too_many_requests_errors_item.py +15 -0
  262. frameio/types/too_many_requests_errors_item_source.py +12 -0
  263. frameio/types/unauthorized.py +13 -0
  264. frameio/types/unauthorized_errors_item.py +15 -0
  265. frameio/types/unauthorized_errors_item_source.py +12 -0
  266. frameio/types/unprocessable_entity.py +13 -0
  267. frameio/types/unprocessable_entity_errors_item.py +15 -0
  268. frameio/types/unprocessable_entity_errors_item_source.py +12 -0
  269. frameio/types/update_date_definition_params.py +17 -0
  270. frameio/types/update_date_definition_params_field_configuration.py +25 -0
  271. frameio/types/update_date_definition_params_field_configuration_display_format.py +7 -0
  272. frameio/types/update_date_definition_params_field_configuration_time_format.py +7 -0
  273. frameio/types/update_long_text_definition_params.py +15 -0
  274. frameio/types/update_number_definition_params.py +17 -0
  275. frameio/types/update_number_definition_params_field_configuration.py +25 -0
  276. frameio/types/update_number_definition_params_field_configuration_number_format.py +7 -0
  277. frameio/types/update_rating_definition_params.py +17 -0
  278. frameio/types/update_rating_definition_params_field_configuration.py +24 -0
  279. frameio/types/update_rating_definition_params_field_configuration_style.py +7 -0
  280. frameio/types/update_select_definition_params.py +17 -0
  281. frameio/types/update_select_definition_params_field_configuration.py +20 -0
  282. frameio/types/update_select_definition_params_field_configuration_options_item.py +20 -0
  283. frameio/types/update_select_multi_definition_params.py +19 -0
  284. frameio/types/update_select_multi_definition_params_field_configuration.py +20 -0
  285. frameio/types/update_select_multi_definition_params_field_configuration_options_item.py +20 -0
  286. frameio/types/update_text_definition_params.py +15 -0
  287. frameio/types/update_toggle_definition_params.py +17 -0
  288. frameio/types/update_toggle_definition_params_field_configuration.py +15 -0
  289. frameio/types/update_user_multi_definition_params.py +17 -0
  290. frameio/types/update_user_multi_definition_params_field_configuration.py +25 -0
  291. frameio/types/update_user_multi_definition_params_field_configuration_custom_members_item.py +20 -0
  292. frameio/types/update_user_multi_definition_params_field_configuration_custom_members_item_type.py +7 -0
  293. frameio/types/update_user_multi_definition_params_field_configuration_member_options_type.py +7 -0
  294. frameio/types/update_user_roles_params.py +17 -0
  295. frameio/types/update_user_roles_params_data.py +13 -0
  296. frameio/types/update_user_roles_params_data_role.py +7 -0
  297. frameio/types/update_user_roles_response.py +13 -0
  298. frameio/types/update_user_roles_response_data.py +13 -0
  299. frameio/types/update_user_roles_response_data_role.py +7 -0
  300. frameio/types/update_user_single_definition_params.py +17 -0
  301. frameio/types/update_user_single_definition_params_field_configuration.py +25 -0
  302. frameio/types/update_user_single_definition_params_field_configuration_custom_members_item.py +20 -0
  303. frameio/types/update_user_single_definition_params_field_configuration_custom_members_item_type.py +7 -0
  304. frameio/types/update_user_single_definition_params_field_configuration_member_options_type.py +7 -0
  305. frameio/types/upload_url.py +20 -0
  306. frameio/types/user.py +44 -0
  307. frameio/types/user_multi_definition.py +49 -0
  308. frameio/types/user_multi_definition_field_configuration.py +23 -0
  309. frameio/types/user_multi_definition_field_configuration_custom_members_item.py +20 -0
  310. frameio/types/user_multi_definition_field_configuration_custom_members_item_type.py +7 -0
  311. frameio/types/user_multi_definition_field_configuration_member_options_type.py +7 -0
  312. frameio/types/user_multi_definition_field_type.py +10 -0
  313. frameio/types/user_multi_definition_params.py +17 -0
  314. frameio/types/user_multi_definition_params_field_configuration.py +23 -0
  315. frameio/types/user_multi_definition_params_field_configuration_custom_members_item.py +20 -0
  316. frameio/types/user_multi_definition_params_field_configuration_custom_members_item_type.py +7 -0
  317. frameio/types/user_multi_definition_params_field_configuration_member_options_type.py +7 -0
  318. frameio/types/user_multi_definition_with_includes.py +13 -0
  319. frameio/types/user_role.py +19 -0
  320. frameio/types/user_role_role.py +7 -0
  321. frameio/types/user_roles_response.py +27 -0
  322. frameio/types/user_single_definition.py +49 -0
  323. frameio/types/user_single_definition_field_configuration.py +23 -0
  324. frameio/types/user_single_definition_field_configuration_custom_members_item.py +20 -0
  325. frameio/types/user_single_definition_field_configuration_custom_members_item_type.py +7 -0
  326. frameio/types/user_single_definition_field_configuration_member_options_type.py +7 -0
  327. frameio/types/user_single_definition_field_type.py +10 -0
  328. frameio/types/user_single_definition_params.py +17 -0
  329. frameio/types/user_single_definition_params_field_configuration.py +23 -0
  330. frameio/types/user_single_definition_params_field_configuration_custom_members_item.py +20 -0
  331. frameio/types/user_single_definition_params_field_configuration_custom_members_item_type.py +7 -0
  332. frameio/types/user_single_definition_params_field_configuration_member_options_type.py +7 -0
  333. frameio/types/user_single_definition_with_includes.py +13 -0
  334. frameio/types/user_value.py +18 -0
  335. frameio/types/user_value_type.py +5 -0
  336. frameio/types/uuid_.py +3 -0
  337. frameio/types/version_stack.py +50 -0
  338. frameio/types/version_stack_copy_response.py +13 -0
  339. frameio/types/version_stack_response.py +13 -0
  340. frameio/types/version_stack_with_includes.py +60 -0
  341. frameio/types/version_stack_with_includes_response.py +13 -0
  342. frameio/types/version_stacks_with_includes_response.py +19 -0
  343. frameio/types/webhook.py +36 -0
  344. frameio/types/webhook_create_response.py +17 -0
  345. frameio/types/webhook_create_response_data.py +15 -0
  346. frameio/types/webhook_events.py +5 -0
  347. frameio/types/webhook_response.py +13 -0
  348. frameio/types/webhook_with_includes.py +13 -0
  349. frameio/types/webhook_with_includes_response.py +13 -0
  350. frameio/types/webhooks_with_includes_response.py +23 -0
  351. frameio/types/workspace.py +40 -0
  352. frameio/types/workspace_include.py +5 -0
  353. frameio/types/workspace_params.py +17 -0
  354. frameio/types/workspace_params_data.py +15 -0
  355. frameio/types/workspace_response.py +17 -0
  356. frameio/types/workspace_with_includes.py +13 -0
  357. frameio/types/workspace_with_includes_response.py +17 -0
  358. frameio/types/workspaces_with_includes_response.py +27 -0
  359. frameio/users/__init__.py +4 -0
  360. frameio/users/client.py +100 -0
  361. frameio/users/raw_client.py +234 -0
  362. frameio/version.py +3 -0
  363. frameio/version_stacks/__init__.py +49 -0
  364. frameio/version_stacks/client.py +818 -0
  365. frameio/version_stacks/raw_client.py +1614 -0
  366. frameio/version_stacks/types/__init__.py +47 -0
  367. frameio/version_stacks/types/version_stack_copy_params_data.py +15 -0
  368. frameio/version_stacks/types/version_stack_create_params_data.py +19 -0
  369. frameio/version_stacks/types/version_stack_move_params_data.py +15 -0
  370. frameio/version_stacks/types/version_stacks_show_request_include.py +19 -0
  371. frameio/webhooks/__init__.py +34 -0
  372. frameio/webhooks/client.py +793 -0
  373. frameio/webhooks/raw_client.py +1347 -0
  374. frameio/webhooks/types/__init__.py +38 -0
  375. frameio/webhooks/types/webhook_create_params_data.py +18 -0
  376. frameio/webhooks/types/webhook_update_params_data.py +23 -0
  377. frameio/workspace_permissions/__init__.py +4 -0
  378. frameio/workspace_permissions/client.py +430 -0
  379. frameio/workspace_permissions/raw_client.py +824 -0
  380. frameio/workspaces/__init__.py +4 -0
  381. frameio/workspaces/client.py +563 -0
  382. frameio/workspaces/raw_client.py +1259 -0
  383. frameio-0.0.28.dist-info/METADATA +259 -0
  384. frameio-0.0.28.dist-info/RECORD +385 -0
  385. frameio-0.0.28.dist-info/WHEEL +4 -0
@@ -0,0 +1,1316 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from ..core.api_error import ApiError
7
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
+ from ..core.http_response import AsyncHttpResponse, HttpResponse
9
+ from ..core.jsonable_encoder import jsonable_encoder
10
+ from ..core.pagination import AsyncPager, SyncPager
11
+ from ..core.request_options import RequestOptions
12
+ from ..core.serialization import convert_and_respect_annotation_metadata
13
+ from ..core.unchecked_base_model import construct_type
14
+ from ..errors.bad_request_error import BadRequestError
15
+ from ..errors.forbidden_error import ForbiddenError
16
+ from ..errors.not_found_error import NotFoundError
17
+ from ..errors.too_many_requests_error import TooManyRequestsError
18
+ from ..errors.unauthorized_error import UnauthorizedError
19
+ from ..errors.unprocessable_entity_error import UnprocessableEntityError
20
+ from ..types.bad_request import BadRequest
21
+ from ..types.comment_include import CommentInclude
22
+ from ..types.comment_response import CommentResponse
23
+ from ..types.comment_with_includes import CommentWithIncludes
24
+ from ..types.comment_with_includes_response import CommentWithIncludesResponse
25
+ from ..types.comments_with_includes_response import CommentsWithIncludesResponse
26
+ from ..types.forbidden import Forbidden
27
+ from ..types.include_total_count import IncludeTotalCount
28
+ from ..types.not_found import NotFound
29
+ from ..types.request_after_opaque_cursor import RequestAfterOpaqueCursor
30
+ from ..types.request_page_size import RequestPageSize
31
+ from ..types.too_many_requests import TooManyRequests
32
+ from ..types.unauthorized import Unauthorized
33
+ from ..types.uuid_ import Uuid
34
+ from .types.comments_show_request_include import CommentsShowRequestInclude
35
+ from .types.create_comment_params_data import CreateCommentParamsData
36
+ from .types.update_comment_params_data import UpdateCommentParamsData
37
+
38
+ # this is used as the default value for optional parameters
39
+ OMIT = typing.cast(typing.Any, ...)
40
+
41
+
42
+ class RawCommentsClient:
43
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
44
+ self._client_wrapper = client_wrapper
45
+
46
+ def show(
47
+ self,
48
+ account_id: Uuid,
49
+ comment_id: Uuid,
50
+ *,
51
+ include: typing.Optional[CommentsShowRequestInclude] = None,
52
+ request_options: typing.Optional[RequestOptions] = None,
53
+ ) -> HttpResponse[CommentWithIncludesResponse]:
54
+ """
55
+ Show a single comment on a file. <br>Rate Limits: 100 calls per 1.00 minute(s) per account_user
56
+
57
+ Parameters
58
+ ----------
59
+ account_id : Uuid
60
+
61
+
62
+ comment_id : Uuid
63
+
64
+
65
+ include : typing.Optional[CommentsShowRequestInclude]
66
+
67
+
68
+ request_options : typing.Optional[RequestOptions]
69
+ Request-specific configuration.
70
+
71
+ Returns
72
+ -------
73
+ HttpResponse[CommentWithIncludesResponse]
74
+ OK
75
+ """
76
+ _response = self._client_wrapper.httpx_client.request(
77
+ f"v4/accounts/{jsonable_encoder(account_id)}/comments/{jsonable_encoder(comment_id)}",
78
+ method="GET",
79
+ params={
80
+ "include": include,
81
+ },
82
+ request_options=request_options,
83
+ )
84
+ try:
85
+ if 200 <= _response.status_code < 300:
86
+ _data = typing.cast(
87
+ CommentWithIncludesResponse,
88
+ construct_type(
89
+ type_=CommentWithIncludesResponse, # type: ignore
90
+ object_=_response.json(),
91
+ ),
92
+ )
93
+ return HttpResponse(response=_response, data=_data)
94
+ if _response.status_code == 400:
95
+ raise BadRequestError(
96
+ headers=dict(_response.headers),
97
+ body=typing.cast(
98
+ BadRequest,
99
+ construct_type(
100
+ type_=BadRequest, # type: ignore
101
+ object_=_response.json(),
102
+ ),
103
+ ),
104
+ )
105
+ if _response.status_code == 401:
106
+ raise UnauthorizedError(
107
+ headers=dict(_response.headers),
108
+ body=typing.cast(
109
+ Unauthorized,
110
+ construct_type(
111
+ type_=Unauthorized, # type: ignore
112
+ object_=_response.json(),
113
+ ),
114
+ ),
115
+ )
116
+ if _response.status_code == 403:
117
+ raise ForbiddenError(
118
+ headers=dict(_response.headers),
119
+ body=typing.cast(
120
+ Forbidden,
121
+ construct_type(
122
+ type_=Forbidden, # type: ignore
123
+ object_=_response.json(),
124
+ ),
125
+ ),
126
+ )
127
+ if _response.status_code == 404:
128
+ raise NotFoundError(
129
+ headers=dict(_response.headers),
130
+ body=typing.cast(
131
+ NotFound,
132
+ construct_type(
133
+ type_=NotFound, # type: ignore
134
+ object_=_response.json(),
135
+ ),
136
+ ),
137
+ )
138
+ if _response.status_code == 422:
139
+ raise UnprocessableEntityError(
140
+ headers=dict(_response.headers),
141
+ body=typing.cast(
142
+ typing.Any,
143
+ construct_type(
144
+ type_=typing.Any, # type: ignore
145
+ object_=_response.json(),
146
+ ),
147
+ ),
148
+ )
149
+ if _response.status_code == 429:
150
+ raise TooManyRequestsError(
151
+ headers=dict(_response.headers),
152
+ body=typing.cast(
153
+ TooManyRequests,
154
+ construct_type(
155
+ type_=TooManyRequests, # type: ignore
156
+ object_=_response.json(),
157
+ ),
158
+ ),
159
+ )
160
+ _response_json = _response.json()
161
+ except JSONDecodeError:
162
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
163
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
164
+
165
+ def delete(
166
+ self, account_id: Uuid, comment_id: Uuid, *, request_options: typing.Optional[RequestOptions] = None
167
+ ) -> HttpResponse[None]:
168
+ """
169
+ Delete comment from an asset. <br>Rate Limits: 60 calls per 1.00 minute(s) per account_user
170
+
171
+ Parameters
172
+ ----------
173
+ account_id : Uuid
174
+
175
+
176
+ comment_id : Uuid
177
+
178
+
179
+ request_options : typing.Optional[RequestOptions]
180
+ Request-specific configuration.
181
+
182
+ Returns
183
+ -------
184
+ HttpResponse[None]
185
+ """
186
+ _response = self._client_wrapper.httpx_client.request(
187
+ f"v4/accounts/{jsonable_encoder(account_id)}/comments/{jsonable_encoder(comment_id)}",
188
+ method="DELETE",
189
+ request_options=request_options,
190
+ )
191
+ try:
192
+ if 200 <= _response.status_code < 300:
193
+ return HttpResponse(response=_response, data=None)
194
+ if _response.status_code == 400:
195
+ raise BadRequestError(
196
+ headers=dict(_response.headers),
197
+ body=typing.cast(
198
+ BadRequest,
199
+ construct_type(
200
+ type_=BadRequest, # type: ignore
201
+ object_=_response.json(),
202
+ ),
203
+ ),
204
+ )
205
+ if _response.status_code == 401:
206
+ raise UnauthorizedError(
207
+ headers=dict(_response.headers),
208
+ body=typing.cast(
209
+ Unauthorized,
210
+ construct_type(
211
+ type_=Unauthorized, # type: ignore
212
+ object_=_response.json(),
213
+ ),
214
+ ),
215
+ )
216
+ if _response.status_code == 403:
217
+ raise ForbiddenError(
218
+ headers=dict(_response.headers),
219
+ body=typing.cast(
220
+ Forbidden,
221
+ construct_type(
222
+ type_=Forbidden, # type: ignore
223
+ object_=_response.json(),
224
+ ),
225
+ ),
226
+ )
227
+ if _response.status_code == 404:
228
+ raise NotFoundError(
229
+ headers=dict(_response.headers),
230
+ body=typing.cast(
231
+ NotFound,
232
+ construct_type(
233
+ type_=NotFound, # type: ignore
234
+ object_=_response.json(),
235
+ ),
236
+ ),
237
+ )
238
+ if _response.status_code == 422:
239
+ raise UnprocessableEntityError(
240
+ headers=dict(_response.headers),
241
+ body=typing.cast(
242
+ typing.Any,
243
+ construct_type(
244
+ type_=typing.Any, # type: ignore
245
+ object_=_response.json(),
246
+ ),
247
+ ),
248
+ )
249
+ if _response.status_code == 429:
250
+ raise TooManyRequestsError(
251
+ headers=dict(_response.headers),
252
+ body=typing.cast(
253
+ TooManyRequests,
254
+ construct_type(
255
+ type_=TooManyRequests, # type: ignore
256
+ object_=_response.json(),
257
+ ),
258
+ ),
259
+ )
260
+ _response_json = _response.json()
261
+ except JSONDecodeError:
262
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
263
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
264
+
265
+ def update(
266
+ self,
267
+ account_id: Uuid,
268
+ comment_id: Uuid,
269
+ *,
270
+ data: UpdateCommentParamsData,
271
+ timestamp_as_timecode: typing.Optional[bool] = None,
272
+ request_options: typing.Optional[RequestOptions] = None,
273
+ ) -> HttpResponse[CommentResponse]:
274
+ """
275
+ Update comment on given asset. <br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
276
+
277
+ Parameters
278
+ ----------
279
+ account_id : Uuid
280
+
281
+
282
+ comment_id : Uuid
283
+
284
+
285
+ data : UpdateCommentParamsData
286
+
287
+ timestamp_as_timecode : typing.Optional[bool]
288
+
289
+
290
+ request_options : typing.Optional[RequestOptions]
291
+ Request-specific configuration.
292
+
293
+ Returns
294
+ -------
295
+ HttpResponse[CommentResponse]
296
+ OK
297
+ """
298
+ _response = self._client_wrapper.httpx_client.request(
299
+ f"v4/accounts/{jsonable_encoder(account_id)}/comments/{jsonable_encoder(comment_id)}",
300
+ method="PATCH",
301
+ params={
302
+ "timestamp_as_timecode": timestamp_as_timecode,
303
+ },
304
+ json={
305
+ "data": convert_and_respect_annotation_metadata(
306
+ object_=data, annotation=UpdateCommentParamsData, direction="write"
307
+ ),
308
+ },
309
+ headers={
310
+ "content-type": "application/json",
311
+ },
312
+ request_options=request_options,
313
+ omit=OMIT,
314
+ )
315
+ try:
316
+ if 200 <= _response.status_code < 300:
317
+ _data = typing.cast(
318
+ CommentResponse,
319
+ construct_type(
320
+ type_=CommentResponse, # type: ignore
321
+ object_=_response.json(),
322
+ ),
323
+ )
324
+ return HttpResponse(response=_response, data=_data)
325
+ if _response.status_code == 400:
326
+ raise BadRequestError(
327
+ headers=dict(_response.headers),
328
+ body=typing.cast(
329
+ BadRequest,
330
+ construct_type(
331
+ type_=BadRequest, # type: ignore
332
+ object_=_response.json(),
333
+ ),
334
+ ),
335
+ )
336
+ if _response.status_code == 401:
337
+ raise UnauthorizedError(
338
+ headers=dict(_response.headers),
339
+ body=typing.cast(
340
+ Unauthorized,
341
+ construct_type(
342
+ type_=Unauthorized, # type: ignore
343
+ object_=_response.json(),
344
+ ),
345
+ ),
346
+ )
347
+ if _response.status_code == 403:
348
+ raise ForbiddenError(
349
+ headers=dict(_response.headers),
350
+ body=typing.cast(
351
+ Forbidden,
352
+ construct_type(
353
+ type_=Forbidden, # type: ignore
354
+ object_=_response.json(),
355
+ ),
356
+ ),
357
+ )
358
+ if _response.status_code == 404:
359
+ raise NotFoundError(
360
+ headers=dict(_response.headers),
361
+ body=typing.cast(
362
+ NotFound,
363
+ construct_type(
364
+ type_=NotFound, # type: ignore
365
+ object_=_response.json(),
366
+ ),
367
+ ),
368
+ )
369
+ if _response.status_code == 422:
370
+ raise UnprocessableEntityError(
371
+ headers=dict(_response.headers),
372
+ body=typing.cast(
373
+ typing.Any,
374
+ construct_type(
375
+ type_=typing.Any, # type: ignore
376
+ object_=_response.json(),
377
+ ),
378
+ ),
379
+ )
380
+ if _response.status_code == 429:
381
+ raise TooManyRequestsError(
382
+ headers=dict(_response.headers),
383
+ body=typing.cast(
384
+ TooManyRequests,
385
+ construct_type(
386
+ type_=TooManyRequests, # type: ignore
387
+ object_=_response.json(),
388
+ ),
389
+ ),
390
+ )
391
+ _response_json = _response.json()
392
+ except JSONDecodeError:
393
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
394
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
395
+
396
+ def index(
397
+ self,
398
+ account_id: Uuid,
399
+ file_id: Uuid,
400
+ *,
401
+ include: typing.Optional[CommentInclude] = None,
402
+ after: typing.Optional[RequestAfterOpaqueCursor] = None,
403
+ page_size: typing.Optional[RequestPageSize] = None,
404
+ include_total_count: typing.Optional[IncludeTotalCount] = None,
405
+ request_options: typing.Optional[RequestOptions] = None,
406
+ ) -> SyncPager[CommentWithIncludes, CommentsWithIncludesResponse]:
407
+ """
408
+ List comments on a given asset. <br>Rate Limits: 100 calls per 1.00 minute(s) per account_user
409
+
410
+ Parameters
411
+ ----------
412
+ account_id : Uuid
413
+
414
+
415
+ file_id : Uuid
416
+
417
+
418
+ include : typing.Optional[CommentInclude]
419
+
420
+
421
+ after : typing.Optional[RequestAfterOpaqueCursor]
422
+ Opaque Cursor query param for requests returning paginated results.
423
+ <br/>
424
+ NOTE: this value is auto-generated and included as part of links from a previous response. It is not intended to be human readable.
425
+
426
+ page_size : typing.Optional[RequestPageSize]
427
+
428
+
429
+ include_total_count : typing.Optional[IncludeTotalCount]
430
+
431
+
432
+ request_options : typing.Optional[RequestOptions]
433
+ Request-specific configuration.
434
+
435
+ Returns
436
+ -------
437
+ SyncPager[CommentWithIncludes, CommentsWithIncludesResponse]
438
+ OK
439
+ """
440
+ _response = self._client_wrapper.httpx_client.request(
441
+ f"v4/accounts/{jsonable_encoder(account_id)}/files/{jsonable_encoder(file_id)}/comments",
442
+ method="GET",
443
+ params={
444
+ "include": include,
445
+ "after": after,
446
+ "page_size": page_size,
447
+ "include_total_count": include_total_count,
448
+ },
449
+ request_options=request_options,
450
+ )
451
+ try:
452
+ if 200 <= _response.status_code < 300:
453
+ _parsed_response = typing.cast(
454
+ CommentsWithIncludesResponse,
455
+ construct_type(
456
+ type_=CommentsWithIncludesResponse, # type: ignore
457
+ object_=_response.json(),
458
+ ),
459
+ )
460
+ _items = _parsed_response.data
461
+ _has_next = False
462
+ _get_next = None
463
+ if _parsed_response.links is not None:
464
+ _parsed_next = _parsed_response.links.next
465
+ _has_next = _parsed_next is not None and _parsed_next != ""
466
+ _get_next = lambda: self.index(
467
+ account_id,
468
+ file_id,
469
+ include=include,
470
+ after=_parsed_next,
471
+ page_size=page_size,
472
+ include_total_count=include_total_count,
473
+ request_options=request_options,
474
+ )
475
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
476
+ if _response.status_code == 400:
477
+ raise BadRequestError(
478
+ headers=dict(_response.headers),
479
+ body=typing.cast(
480
+ BadRequest,
481
+ construct_type(
482
+ type_=BadRequest, # type: ignore
483
+ object_=_response.json(),
484
+ ),
485
+ ),
486
+ )
487
+ if _response.status_code == 401:
488
+ raise UnauthorizedError(
489
+ headers=dict(_response.headers),
490
+ body=typing.cast(
491
+ Unauthorized,
492
+ construct_type(
493
+ type_=Unauthorized, # type: ignore
494
+ object_=_response.json(),
495
+ ),
496
+ ),
497
+ )
498
+ if _response.status_code == 403:
499
+ raise ForbiddenError(
500
+ headers=dict(_response.headers),
501
+ body=typing.cast(
502
+ Forbidden,
503
+ construct_type(
504
+ type_=Forbidden, # type: ignore
505
+ object_=_response.json(),
506
+ ),
507
+ ),
508
+ )
509
+ if _response.status_code == 404:
510
+ raise NotFoundError(
511
+ headers=dict(_response.headers),
512
+ body=typing.cast(
513
+ NotFound,
514
+ construct_type(
515
+ type_=NotFound, # type: ignore
516
+ object_=_response.json(),
517
+ ),
518
+ ),
519
+ )
520
+ if _response.status_code == 422:
521
+ raise UnprocessableEntityError(
522
+ headers=dict(_response.headers),
523
+ body=typing.cast(
524
+ typing.Any,
525
+ construct_type(
526
+ type_=typing.Any, # type: ignore
527
+ object_=_response.json(),
528
+ ),
529
+ ),
530
+ )
531
+ if _response.status_code == 429:
532
+ raise TooManyRequestsError(
533
+ headers=dict(_response.headers),
534
+ body=typing.cast(
535
+ TooManyRequests,
536
+ construct_type(
537
+ type_=TooManyRequests, # type: ignore
538
+ object_=_response.json(),
539
+ ),
540
+ ),
541
+ )
542
+ _response_json = _response.json()
543
+ except JSONDecodeError:
544
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
545
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
546
+
547
+ def create(
548
+ self,
549
+ account_id: Uuid,
550
+ file_id: Uuid,
551
+ *,
552
+ data: CreateCommentParamsData,
553
+ timestamp_as_timecode: typing.Optional[bool] = None,
554
+ request_options: typing.Optional[RequestOptions] = None,
555
+ ) -> HttpResponse[CommentResponse]:
556
+ """
557
+ Create a comment on a file. <br>Rate Limits: 100 calls per 1.00 minute(s) per account_user
558
+
559
+ Parameters
560
+ ----------
561
+ account_id : Uuid
562
+
563
+
564
+ file_id : Uuid
565
+
566
+
567
+ data : CreateCommentParamsData
568
+
569
+ timestamp_as_timecode : typing.Optional[bool]
570
+
571
+
572
+ request_options : typing.Optional[RequestOptions]
573
+ Request-specific configuration.
574
+
575
+ Returns
576
+ -------
577
+ HttpResponse[CommentResponse]
578
+ Created
579
+ """
580
+ _response = self._client_wrapper.httpx_client.request(
581
+ f"v4/accounts/{jsonable_encoder(account_id)}/files/{jsonable_encoder(file_id)}/comments",
582
+ method="POST",
583
+ params={
584
+ "timestamp_as_timecode": timestamp_as_timecode,
585
+ },
586
+ json={
587
+ "data": convert_and_respect_annotation_metadata(
588
+ object_=data, annotation=CreateCommentParamsData, direction="write"
589
+ ),
590
+ },
591
+ headers={
592
+ "content-type": "application/json",
593
+ },
594
+ request_options=request_options,
595
+ omit=OMIT,
596
+ )
597
+ try:
598
+ if 200 <= _response.status_code < 300:
599
+ _data = typing.cast(
600
+ CommentResponse,
601
+ construct_type(
602
+ type_=CommentResponse, # type: ignore
603
+ object_=_response.json(),
604
+ ),
605
+ )
606
+ return HttpResponse(response=_response, data=_data)
607
+ if _response.status_code == 400:
608
+ raise BadRequestError(
609
+ headers=dict(_response.headers),
610
+ body=typing.cast(
611
+ BadRequest,
612
+ construct_type(
613
+ type_=BadRequest, # type: ignore
614
+ object_=_response.json(),
615
+ ),
616
+ ),
617
+ )
618
+ if _response.status_code == 401:
619
+ raise UnauthorizedError(
620
+ headers=dict(_response.headers),
621
+ body=typing.cast(
622
+ Unauthorized,
623
+ construct_type(
624
+ type_=Unauthorized, # type: ignore
625
+ object_=_response.json(),
626
+ ),
627
+ ),
628
+ )
629
+ if _response.status_code == 403:
630
+ raise ForbiddenError(
631
+ headers=dict(_response.headers),
632
+ body=typing.cast(
633
+ Forbidden,
634
+ construct_type(
635
+ type_=Forbidden, # type: ignore
636
+ object_=_response.json(),
637
+ ),
638
+ ),
639
+ )
640
+ if _response.status_code == 404:
641
+ raise NotFoundError(
642
+ headers=dict(_response.headers),
643
+ body=typing.cast(
644
+ NotFound,
645
+ construct_type(
646
+ type_=NotFound, # type: ignore
647
+ object_=_response.json(),
648
+ ),
649
+ ),
650
+ )
651
+ if _response.status_code == 422:
652
+ raise UnprocessableEntityError(
653
+ headers=dict(_response.headers),
654
+ body=typing.cast(
655
+ typing.Any,
656
+ construct_type(
657
+ type_=typing.Any, # type: ignore
658
+ object_=_response.json(),
659
+ ),
660
+ ),
661
+ )
662
+ if _response.status_code == 429:
663
+ raise TooManyRequestsError(
664
+ headers=dict(_response.headers),
665
+ body=typing.cast(
666
+ TooManyRequests,
667
+ construct_type(
668
+ type_=TooManyRequests, # type: ignore
669
+ object_=_response.json(),
670
+ ),
671
+ ),
672
+ )
673
+ _response_json = _response.json()
674
+ except JSONDecodeError:
675
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
676
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
677
+
678
+
679
+ class AsyncRawCommentsClient:
680
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
681
+ self._client_wrapper = client_wrapper
682
+
683
+ async def show(
684
+ self,
685
+ account_id: Uuid,
686
+ comment_id: Uuid,
687
+ *,
688
+ include: typing.Optional[CommentsShowRequestInclude] = None,
689
+ request_options: typing.Optional[RequestOptions] = None,
690
+ ) -> AsyncHttpResponse[CommentWithIncludesResponse]:
691
+ """
692
+ Show a single comment on a file. <br>Rate Limits: 100 calls per 1.00 minute(s) per account_user
693
+
694
+ Parameters
695
+ ----------
696
+ account_id : Uuid
697
+
698
+
699
+ comment_id : Uuid
700
+
701
+
702
+ include : typing.Optional[CommentsShowRequestInclude]
703
+
704
+
705
+ request_options : typing.Optional[RequestOptions]
706
+ Request-specific configuration.
707
+
708
+ Returns
709
+ -------
710
+ AsyncHttpResponse[CommentWithIncludesResponse]
711
+ OK
712
+ """
713
+ _response = await self._client_wrapper.httpx_client.request(
714
+ f"v4/accounts/{jsonable_encoder(account_id)}/comments/{jsonable_encoder(comment_id)}",
715
+ method="GET",
716
+ params={
717
+ "include": include,
718
+ },
719
+ request_options=request_options,
720
+ )
721
+ try:
722
+ if 200 <= _response.status_code < 300:
723
+ _data = typing.cast(
724
+ CommentWithIncludesResponse,
725
+ construct_type(
726
+ type_=CommentWithIncludesResponse, # type: ignore
727
+ object_=_response.json(),
728
+ ),
729
+ )
730
+ return AsyncHttpResponse(response=_response, data=_data)
731
+ if _response.status_code == 400:
732
+ raise BadRequestError(
733
+ headers=dict(_response.headers),
734
+ body=typing.cast(
735
+ BadRequest,
736
+ construct_type(
737
+ type_=BadRequest, # type: ignore
738
+ object_=_response.json(),
739
+ ),
740
+ ),
741
+ )
742
+ if _response.status_code == 401:
743
+ raise UnauthorizedError(
744
+ headers=dict(_response.headers),
745
+ body=typing.cast(
746
+ Unauthorized,
747
+ construct_type(
748
+ type_=Unauthorized, # type: ignore
749
+ object_=_response.json(),
750
+ ),
751
+ ),
752
+ )
753
+ if _response.status_code == 403:
754
+ raise ForbiddenError(
755
+ headers=dict(_response.headers),
756
+ body=typing.cast(
757
+ Forbidden,
758
+ construct_type(
759
+ type_=Forbidden, # type: ignore
760
+ object_=_response.json(),
761
+ ),
762
+ ),
763
+ )
764
+ if _response.status_code == 404:
765
+ raise NotFoundError(
766
+ headers=dict(_response.headers),
767
+ body=typing.cast(
768
+ NotFound,
769
+ construct_type(
770
+ type_=NotFound, # type: ignore
771
+ object_=_response.json(),
772
+ ),
773
+ ),
774
+ )
775
+ if _response.status_code == 422:
776
+ raise UnprocessableEntityError(
777
+ headers=dict(_response.headers),
778
+ body=typing.cast(
779
+ typing.Any,
780
+ construct_type(
781
+ type_=typing.Any, # type: ignore
782
+ object_=_response.json(),
783
+ ),
784
+ ),
785
+ )
786
+ if _response.status_code == 429:
787
+ raise TooManyRequestsError(
788
+ headers=dict(_response.headers),
789
+ body=typing.cast(
790
+ TooManyRequests,
791
+ construct_type(
792
+ type_=TooManyRequests, # type: ignore
793
+ object_=_response.json(),
794
+ ),
795
+ ),
796
+ )
797
+ _response_json = _response.json()
798
+ except JSONDecodeError:
799
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
800
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
801
+
802
+ async def delete(
803
+ self, account_id: Uuid, comment_id: Uuid, *, request_options: typing.Optional[RequestOptions] = None
804
+ ) -> AsyncHttpResponse[None]:
805
+ """
806
+ Delete comment from an asset. <br>Rate Limits: 60 calls per 1.00 minute(s) per account_user
807
+
808
+ Parameters
809
+ ----------
810
+ account_id : Uuid
811
+
812
+
813
+ comment_id : Uuid
814
+
815
+
816
+ request_options : typing.Optional[RequestOptions]
817
+ Request-specific configuration.
818
+
819
+ Returns
820
+ -------
821
+ AsyncHttpResponse[None]
822
+ """
823
+ _response = await self._client_wrapper.httpx_client.request(
824
+ f"v4/accounts/{jsonable_encoder(account_id)}/comments/{jsonable_encoder(comment_id)}",
825
+ method="DELETE",
826
+ request_options=request_options,
827
+ )
828
+ try:
829
+ if 200 <= _response.status_code < 300:
830
+ return AsyncHttpResponse(response=_response, data=None)
831
+ if _response.status_code == 400:
832
+ raise BadRequestError(
833
+ headers=dict(_response.headers),
834
+ body=typing.cast(
835
+ BadRequest,
836
+ construct_type(
837
+ type_=BadRequest, # type: ignore
838
+ object_=_response.json(),
839
+ ),
840
+ ),
841
+ )
842
+ if _response.status_code == 401:
843
+ raise UnauthorizedError(
844
+ headers=dict(_response.headers),
845
+ body=typing.cast(
846
+ Unauthorized,
847
+ construct_type(
848
+ type_=Unauthorized, # type: ignore
849
+ object_=_response.json(),
850
+ ),
851
+ ),
852
+ )
853
+ if _response.status_code == 403:
854
+ raise ForbiddenError(
855
+ headers=dict(_response.headers),
856
+ body=typing.cast(
857
+ Forbidden,
858
+ construct_type(
859
+ type_=Forbidden, # type: ignore
860
+ object_=_response.json(),
861
+ ),
862
+ ),
863
+ )
864
+ if _response.status_code == 404:
865
+ raise NotFoundError(
866
+ headers=dict(_response.headers),
867
+ body=typing.cast(
868
+ NotFound,
869
+ construct_type(
870
+ type_=NotFound, # type: ignore
871
+ object_=_response.json(),
872
+ ),
873
+ ),
874
+ )
875
+ if _response.status_code == 422:
876
+ raise UnprocessableEntityError(
877
+ headers=dict(_response.headers),
878
+ body=typing.cast(
879
+ typing.Any,
880
+ construct_type(
881
+ type_=typing.Any, # type: ignore
882
+ object_=_response.json(),
883
+ ),
884
+ ),
885
+ )
886
+ if _response.status_code == 429:
887
+ raise TooManyRequestsError(
888
+ headers=dict(_response.headers),
889
+ body=typing.cast(
890
+ TooManyRequests,
891
+ construct_type(
892
+ type_=TooManyRequests, # type: ignore
893
+ object_=_response.json(),
894
+ ),
895
+ ),
896
+ )
897
+ _response_json = _response.json()
898
+ except JSONDecodeError:
899
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
900
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
901
+
902
+ async def update(
903
+ self,
904
+ account_id: Uuid,
905
+ comment_id: Uuid,
906
+ *,
907
+ data: UpdateCommentParamsData,
908
+ timestamp_as_timecode: typing.Optional[bool] = None,
909
+ request_options: typing.Optional[RequestOptions] = None,
910
+ ) -> AsyncHttpResponse[CommentResponse]:
911
+ """
912
+ Update comment on given asset. <br>Rate Limits: 10 calls per 1.00 minute(s) per account_user
913
+
914
+ Parameters
915
+ ----------
916
+ account_id : Uuid
917
+
918
+
919
+ comment_id : Uuid
920
+
921
+
922
+ data : UpdateCommentParamsData
923
+
924
+ timestamp_as_timecode : typing.Optional[bool]
925
+
926
+
927
+ request_options : typing.Optional[RequestOptions]
928
+ Request-specific configuration.
929
+
930
+ Returns
931
+ -------
932
+ AsyncHttpResponse[CommentResponse]
933
+ OK
934
+ """
935
+ _response = await self._client_wrapper.httpx_client.request(
936
+ f"v4/accounts/{jsonable_encoder(account_id)}/comments/{jsonable_encoder(comment_id)}",
937
+ method="PATCH",
938
+ params={
939
+ "timestamp_as_timecode": timestamp_as_timecode,
940
+ },
941
+ json={
942
+ "data": convert_and_respect_annotation_metadata(
943
+ object_=data, annotation=UpdateCommentParamsData, direction="write"
944
+ ),
945
+ },
946
+ headers={
947
+ "content-type": "application/json",
948
+ },
949
+ request_options=request_options,
950
+ omit=OMIT,
951
+ )
952
+ try:
953
+ if 200 <= _response.status_code < 300:
954
+ _data = typing.cast(
955
+ CommentResponse,
956
+ construct_type(
957
+ type_=CommentResponse, # type: ignore
958
+ object_=_response.json(),
959
+ ),
960
+ )
961
+ return AsyncHttpResponse(response=_response, data=_data)
962
+ if _response.status_code == 400:
963
+ raise BadRequestError(
964
+ headers=dict(_response.headers),
965
+ body=typing.cast(
966
+ BadRequest,
967
+ construct_type(
968
+ type_=BadRequest, # type: ignore
969
+ object_=_response.json(),
970
+ ),
971
+ ),
972
+ )
973
+ if _response.status_code == 401:
974
+ raise UnauthorizedError(
975
+ headers=dict(_response.headers),
976
+ body=typing.cast(
977
+ Unauthorized,
978
+ construct_type(
979
+ type_=Unauthorized, # type: ignore
980
+ object_=_response.json(),
981
+ ),
982
+ ),
983
+ )
984
+ if _response.status_code == 403:
985
+ raise ForbiddenError(
986
+ headers=dict(_response.headers),
987
+ body=typing.cast(
988
+ Forbidden,
989
+ construct_type(
990
+ type_=Forbidden, # type: ignore
991
+ object_=_response.json(),
992
+ ),
993
+ ),
994
+ )
995
+ if _response.status_code == 404:
996
+ raise NotFoundError(
997
+ headers=dict(_response.headers),
998
+ body=typing.cast(
999
+ NotFound,
1000
+ construct_type(
1001
+ type_=NotFound, # type: ignore
1002
+ object_=_response.json(),
1003
+ ),
1004
+ ),
1005
+ )
1006
+ if _response.status_code == 422:
1007
+ raise UnprocessableEntityError(
1008
+ headers=dict(_response.headers),
1009
+ body=typing.cast(
1010
+ typing.Any,
1011
+ construct_type(
1012
+ type_=typing.Any, # type: ignore
1013
+ object_=_response.json(),
1014
+ ),
1015
+ ),
1016
+ )
1017
+ if _response.status_code == 429:
1018
+ raise TooManyRequestsError(
1019
+ headers=dict(_response.headers),
1020
+ body=typing.cast(
1021
+ TooManyRequests,
1022
+ construct_type(
1023
+ type_=TooManyRequests, # type: ignore
1024
+ object_=_response.json(),
1025
+ ),
1026
+ ),
1027
+ )
1028
+ _response_json = _response.json()
1029
+ except JSONDecodeError:
1030
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1031
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1032
+
1033
+ async def index(
1034
+ self,
1035
+ account_id: Uuid,
1036
+ file_id: Uuid,
1037
+ *,
1038
+ include: typing.Optional[CommentInclude] = None,
1039
+ after: typing.Optional[RequestAfterOpaqueCursor] = None,
1040
+ page_size: typing.Optional[RequestPageSize] = None,
1041
+ include_total_count: typing.Optional[IncludeTotalCount] = None,
1042
+ request_options: typing.Optional[RequestOptions] = None,
1043
+ ) -> AsyncPager[CommentWithIncludes, CommentsWithIncludesResponse]:
1044
+ """
1045
+ List comments on a given asset. <br>Rate Limits: 100 calls per 1.00 minute(s) per account_user
1046
+
1047
+ Parameters
1048
+ ----------
1049
+ account_id : Uuid
1050
+
1051
+
1052
+ file_id : Uuid
1053
+
1054
+
1055
+ include : typing.Optional[CommentInclude]
1056
+
1057
+
1058
+ after : typing.Optional[RequestAfterOpaqueCursor]
1059
+ Opaque Cursor query param for requests returning paginated results.
1060
+ <br/>
1061
+ NOTE: this value is auto-generated and included as part of links from a previous response. It is not intended to be human readable.
1062
+
1063
+ page_size : typing.Optional[RequestPageSize]
1064
+
1065
+
1066
+ include_total_count : typing.Optional[IncludeTotalCount]
1067
+
1068
+
1069
+ request_options : typing.Optional[RequestOptions]
1070
+ Request-specific configuration.
1071
+
1072
+ Returns
1073
+ -------
1074
+ AsyncPager[CommentWithIncludes, CommentsWithIncludesResponse]
1075
+ OK
1076
+ """
1077
+ _response = await self._client_wrapper.httpx_client.request(
1078
+ f"v4/accounts/{jsonable_encoder(account_id)}/files/{jsonable_encoder(file_id)}/comments",
1079
+ method="GET",
1080
+ params={
1081
+ "include": include,
1082
+ "after": after,
1083
+ "page_size": page_size,
1084
+ "include_total_count": include_total_count,
1085
+ },
1086
+ request_options=request_options,
1087
+ )
1088
+ try:
1089
+ if 200 <= _response.status_code < 300:
1090
+ _parsed_response = typing.cast(
1091
+ CommentsWithIncludesResponse,
1092
+ construct_type(
1093
+ type_=CommentsWithIncludesResponse, # type: ignore
1094
+ object_=_response.json(),
1095
+ ),
1096
+ )
1097
+ _items = _parsed_response.data
1098
+ _has_next = False
1099
+ _get_next = None
1100
+ if _parsed_response.links is not None:
1101
+ _parsed_next = _parsed_response.links.next
1102
+ _has_next = _parsed_next is not None and _parsed_next != ""
1103
+
1104
+ async def _get_next():
1105
+ return await self.index(
1106
+ account_id,
1107
+ file_id,
1108
+ include=include,
1109
+ after=_parsed_next,
1110
+ page_size=page_size,
1111
+ include_total_count=include_total_count,
1112
+ request_options=request_options,
1113
+ )
1114
+
1115
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
1116
+ if _response.status_code == 400:
1117
+ raise BadRequestError(
1118
+ headers=dict(_response.headers),
1119
+ body=typing.cast(
1120
+ BadRequest,
1121
+ construct_type(
1122
+ type_=BadRequest, # type: ignore
1123
+ object_=_response.json(),
1124
+ ),
1125
+ ),
1126
+ )
1127
+ if _response.status_code == 401:
1128
+ raise UnauthorizedError(
1129
+ headers=dict(_response.headers),
1130
+ body=typing.cast(
1131
+ Unauthorized,
1132
+ construct_type(
1133
+ type_=Unauthorized, # type: ignore
1134
+ object_=_response.json(),
1135
+ ),
1136
+ ),
1137
+ )
1138
+ if _response.status_code == 403:
1139
+ raise ForbiddenError(
1140
+ headers=dict(_response.headers),
1141
+ body=typing.cast(
1142
+ Forbidden,
1143
+ construct_type(
1144
+ type_=Forbidden, # type: ignore
1145
+ object_=_response.json(),
1146
+ ),
1147
+ ),
1148
+ )
1149
+ if _response.status_code == 404:
1150
+ raise NotFoundError(
1151
+ headers=dict(_response.headers),
1152
+ body=typing.cast(
1153
+ NotFound,
1154
+ construct_type(
1155
+ type_=NotFound, # type: ignore
1156
+ object_=_response.json(),
1157
+ ),
1158
+ ),
1159
+ )
1160
+ if _response.status_code == 422:
1161
+ raise UnprocessableEntityError(
1162
+ headers=dict(_response.headers),
1163
+ body=typing.cast(
1164
+ typing.Any,
1165
+ construct_type(
1166
+ type_=typing.Any, # type: ignore
1167
+ object_=_response.json(),
1168
+ ),
1169
+ ),
1170
+ )
1171
+ if _response.status_code == 429:
1172
+ raise TooManyRequestsError(
1173
+ headers=dict(_response.headers),
1174
+ body=typing.cast(
1175
+ TooManyRequests,
1176
+ construct_type(
1177
+ type_=TooManyRequests, # type: ignore
1178
+ object_=_response.json(),
1179
+ ),
1180
+ ),
1181
+ )
1182
+ _response_json = _response.json()
1183
+ except JSONDecodeError:
1184
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1185
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1186
+
1187
+ async def create(
1188
+ self,
1189
+ account_id: Uuid,
1190
+ file_id: Uuid,
1191
+ *,
1192
+ data: CreateCommentParamsData,
1193
+ timestamp_as_timecode: typing.Optional[bool] = None,
1194
+ request_options: typing.Optional[RequestOptions] = None,
1195
+ ) -> AsyncHttpResponse[CommentResponse]:
1196
+ """
1197
+ Create a comment on a file. <br>Rate Limits: 100 calls per 1.00 minute(s) per account_user
1198
+
1199
+ Parameters
1200
+ ----------
1201
+ account_id : Uuid
1202
+
1203
+
1204
+ file_id : Uuid
1205
+
1206
+
1207
+ data : CreateCommentParamsData
1208
+
1209
+ timestamp_as_timecode : typing.Optional[bool]
1210
+
1211
+
1212
+ request_options : typing.Optional[RequestOptions]
1213
+ Request-specific configuration.
1214
+
1215
+ Returns
1216
+ -------
1217
+ AsyncHttpResponse[CommentResponse]
1218
+ Created
1219
+ """
1220
+ _response = await self._client_wrapper.httpx_client.request(
1221
+ f"v4/accounts/{jsonable_encoder(account_id)}/files/{jsonable_encoder(file_id)}/comments",
1222
+ method="POST",
1223
+ params={
1224
+ "timestamp_as_timecode": timestamp_as_timecode,
1225
+ },
1226
+ json={
1227
+ "data": convert_and_respect_annotation_metadata(
1228
+ object_=data, annotation=CreateCommentParamsData, direction="write"
1229
+ ),
1230
+ },
1231
+ headers={
1232
+ "content-type": "application/json",
1233
+ },
1234
+ request_options=request_options,
1235
+ omit=OMIT,
1236
+ )
1237
+ try:
1238
+ if 200 <= _response.status_code < 300:
1239
+ _data = typing.cast(
1240
+ CommentResponse,
1241
+ construct_type(
1242
+ type_=CommentResponse, # type: ignore
1243
+ object_=_response.json(),
1244
+ ),
1245
+ )
1246
+ return AsyncHttpResponse(response=_response, data=_data)
1247
+ if _response.status_code == 400:
1248
+ raise BadRequestError(
1249
+ headers=dict(_response.headers),
1250
+ body=typing.cast(
1251
+ BadRequest,
1252
+ construct_type(
1253
+ type_=BadRequest, # type: ignore
1254
+ object_=_response.json(),
1255
+ ),
1256
+ ),
1257
+ )
1258
+ if _response.status_code == 401:
1259
+ raise UnauthorizedError(
1260
+ headers=dict(_response.headers),
1261
+ body=typing.cast(
1262
+ Unauthorized,
1263
+ construct_type(
1264
+ type_=Unauthorized, # type: ignore
1265
+ object_=_response.json(),
1266
+ ),
1267
+ ),
1268
+ )
1269
+ if _response.status_code == 403:
1270
+ raise ForbiddenError(
1271
+ headers=dict(_response.headers),
1272
+ body=typing.cast(
1273
+ Forbidden,
1274
+ construct_type(
1275
+ type_=Forbidden, # type: ignore
1276
+ object_=_response.json(),
1277
+ ),
1278
+ ),
1279
+ )
1280
+ if _response.status_code == 404:
1281
+ raise NotFoundError(
1282
+ headers=dict(_response.headers),
1283
+ body=typing.cast(
1284
+ NotFound,
1285
+ construct_type(
1286
+ type_=NotFound, # type: ignore
1287
+ object_=_response.json(),
1288
+ ),
1289
+ ),
1290
+ )
1291
+ if _response.status_code == 422:
1292
+ raise UnprocessableEntityError(
1293
+ headers=dict(_response.headers),
1294
+ body=typing.cast(
1295
+ typing.Any,
1296
+ construct_type(
1297
+ type_=typing.Any, # type: ignore
1298
+ object_=_response.json(),
1299
+ ),
1300
+ ),
1301
+ )
1302
+ if _response.status_code == 429:
1303
+ raise TooManyRequestsError(
1304
+ headers=dict(_response.headers),
1305
+ body=typing.cast(
1306
+ TooManyRequests,
1307
+ construct_type(
1308
+ type_=TooManyRequests, # type: ignore
1309
+ object_=_response.json(),
1310
+ ),
1311
+ ),
1312
+ )
1313
+ _response_json = _response.json()
1314
+ except JSONDecodeError:
1315
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1316
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)