api-sdk-py 1.11.66__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 (294) hide show
  1. api_sdk_py/__init__.py +312 -0
  2. api_sdk_py/api/__init__.py +18 -0
  3. api_sdk_py/api/canvases_api.py +1605 -0
  4. api_sdk_py/api/compositions_api.py +11616 -0
  5. api_sdk_py/api/credits_api.py +628 -0
  6. api_sdk_py/api/entitlements_api.py +676 -0
  7. api_sdk_py/api/invoices_api.py +357 -0
  8. api_sdk_py/api/managed_users_api.py +5087 -0
  9. api_sdk_py/api/operations_api.py +305 -0
  10. api_sdk_py/api/partner_api.py +41365 -0
  11. api_sdk_py/api/partners_api.py +11156 -0
  12. api_sdk_py/api/public_embed_api.py +1938 -0
  13. api_sdk_py/api/tokens_api.py +283 -0
  14. api_sdk_py/api/uploads_api.py +1507 -0
  15. api_sdk_py/api/users_api.py +3649 -0
  16. api_sdk_py/api/widgets_api.py +1300 -0
  17. api_sdk_py/api_client.py +797 -0
  18. api_sdk_py/api_response.py +21 -0
  19. api_sdk_py/configuration.py +526 -0
  20. api_sdk_py/exceptions.py +199 -0
  21. api_sdk_py/models/__init__.py +282 -0
  22. api_sdk_py/models/account_credit_balance.py +96 -0
  23. api_sdk_py/models/account_credit_balance_response.py +99 -0
  24. api_sdk_py/models/account_credit_transaction.py +120 -0
  25. api_sdk_py/models/adapter_connection.py +112 -0
  26. api_sdk_py/models/adapter_connection_removal.py +87 -0
  27. api_sdk_py/models/add_ai_answers_knowledge_document201_response.py +99 -0
  28. api_sdk_py/models/add_ai_answers_knowledge_document_request.py +90 -0
  29. api_sdk_py/models/add_domain_request.py +87 -0
  30. api_sdk_py/models/ai_answers_knowledge.py +101 -0
  31. api_sdk_py/models/ai_answers_knowledge_document.py +113 -0
  32. api_sdk_py/models/ai_answers_knowledge_removal.py +87 -0
  33. api_sdk_py/models/ai_answers_knowledge_totals.py +93 -0
  34. api_sdk_py/models/api_key_scope.py +44 -0
  35. api_sdk_py/models/canvas.py +112 -0
  36. api_sdk_py/models/canvas_response.py +99 -0
  37. api_sdk_py/models/check_composition_access_response.py +99 -0
  38. api_sdk_py/models/check_composition_access_response_data.py +89 -0
  39. api_sdk_py/models/composition.py +133 -0
  40. api_sdk_py/models/composition_data_source.py +90 -0
  41. api_sdk_py/models/composition_data_source_response.py +99 -0
  42. api_sdk_py/models/composition_entries_description.py +99 -0
  43. api_sdk_py/models/composition_entries_description_response.py +99 -0
  44. api_sdk_py/models/composition_entries_reading.py +126 -0
  45. api_sdk_py/models/composition_entries_reading_response.py +99 -0
  46. api_sdk_py/models/composition_entry_aggregate_tally.py +122 -0
  47. api_sdk_py/models/composition_entry_aggregates_block.py +99 -0
  48. api_sdk_py/models/composition_entry_column.py +89 -0
  49. api_sdk_py/models/composition_entry_delete_success.py +93 -0
  50. api_sdk_py/models/composition_entry_delete_success_data.py +87 -0
  51. api_sdk_py/models/composition_entry_item.py +111 -0
  52. api_sdk_py/models/composition_entry_items_meta.py +106 -0
  53. api_sdk_py/models/composition_entry_items_page_success.py +103 -0
  54. api_sdk_py/models/composition_entry_table.py +105 -0
  55. api_sdk_py/models/composition_entry_tally.py +95 -0
  56. api_sdk_py/models/composition_response.py +99 -0
  57. api_sdk_py/models/composition_version.py +96 -0
  58. api_sdk_py/models/content_check_finding.py +93 -0
  59. api_sdk_py/models/content_item_write_result.py +101 -0
  60. api_sdk_py/models/content_item_write_result_validation_result.py +91 -0
  61. api_sdk_py/models/copy_partner_preset_request.py +88 -0
  62. api_sdk_py/models/create_canvas_request.py +118 -0
  63. api_sdk_py/models/create_composition_content_item201_response.py +99 -0
  64. api_sdk_py/models/create_composition_content_item_request.py +101 -0
  65. api_sdk_py/models/create_composition_database_record201_response.py +95 -0
  66. api_sdk_py/models/create_composition_from_preset_request.py +100 -0
  67. api_sdk_py/models/create_composition_from_widget201_response.py +99 -0
  68. api_sdk_py/models/create_composition_from_widget_request.py +102 -0
  69. api_sdk_py/models/create_user_api_key_request.py +106 -0
  70. api_sdk_py/models/create_widget201_response.py +99 -0
  71. api_sdk_py/models/create_widget201_response_data.py +207 -0
  72. api_sdk_py/models/created_user_api_key.py +117 -0
  73. api_sdk_py/models/created_user_api_key_response.py +99 -0
  74. api_sdk_py/models/delete_composition_content_item_response.py +99 -0
  75. api_sdk_py/models/delete_composition_content_item_response_data.py +89 -0
  76. api_sdk_py/models/delete_composition_data_source_response.py +99 -0
  77. api_sdk_py/models/delete_composition_data_source_response_data.py +87 -0
  78. api_sdk_py/models/delete_managed_user200_response.py +99 -0
  79. api_sdk_py/models/delete_personal_workspace_domain_response.py +99 -0
  80. api_sdk_py/models/delete_personal_workspace_domain_response_data.py +87 -0
  81. api_sdk_py/models/delete_user_api_key_response.py +99 -0
  82. api_sdk_py/models/delete_user_api_key_response_data.py +87 -0
  83. api_sdk_py/models/design_defaults.py +92 -0
  84. api_sdk_py/models/duplicate_composition202_response.py +99 -0
  85. api_sdk_py/models/duplicate_composition202_response_data.py +87 -0
  86. api_sdk_py/models/duplicate_composition_request.py +89 -0
  87. api_sdk_py/models/editor_session.py +122 -0
  88. api_sdk_py/models/editor_session_response.py +99 -0
  89. api_sdk_py/models/entitlement.py +118 -0
  90. api_sdk_py/models/error_detail.py +104 -0
  91. api_sdk_py/models/error_response.py +108 -0
  92. api_sdk_py/models/export_composition_entry_items200_response.py +103 -0
  93. api_sdk_py/models/export_composition_entry_items200_response_meta.py +89 -0
  94. api_sdk_py/models/get_ai_answers_knowledge200_response.py +99 -0
  95. api_sdk_py/models/get_all_canvases_response.py +99 -0
  96. api_sdk_py/models/get_all_canvases_response_data.py +101 -0
  97. api_sdk_py/models/get_all_compositions200_response.py +103 -0
  98. api_sdk_py/models/get_all_managed_users200_response.py +103 -0
  99. api_sdk_py/models/get_composition_content_response.py +95 -0
  100. api_sdk_py/models/get_composition_content_schema_response.py +99 -0
  101. api_sdk_py/models/get_composition_content_schema_response_data.py +97 -0
  102. api_sdk_py/models/get_composition_data_source_response.py +104 -0
  103. api_sdk_py/models/get_composition_database_records200_response.py +95 -0
  104. api_sdk_py/models/get_composition_design_response.py +95 -0
  105. api_sdk_py/models/get_composition_design_schema_response.py +99 -0
  106. api_sdk_py/models/get_composition_design_schema_response_data.py +97 -0
  107. api_sdk_py/models/get_composition_embed_schema_response.py +99 -0
  108. api_sdk_py/models/get_composition_embed_schema_response_data.py +107 -0
  109. api_sdk_py/models/get_composition_embed_settings_response.py +95 -0
  110. api_sdk_py/models/get_composition_preview_response.py +99 -0
  111. api_sdk_py/models/get_composition_preview_response_data.py +93 -0
  112. api_sdk_py/models/get_composition_versions200_response.py +103 -0
  113. api_sdk_py/models/get_compositions_batch_request.py +88 -0
  114. api_sdk_py/models/get_compositions_batch_response.py +99 -0
  115. api_sdk_py/models/get_compositions_batch_response_data.py +105 -0
  116. api_sdk_py/models/get_invoices_by_partner_id200_response.py +103 -0
  117. api_sdk_py/models/get_managed_user_entitlements_response.py +99 -0
  118. api_sdk_py/models/get_managed_user_entitlements_response_data.py +97 -0
  119. api_sdk_py/models/get_managed_user_limits200_response.py +99 -0
  120. api_sdk_py/models/get_managed_user_storage_usage200_response.py +99 -0
  121. api_sdk_py/models/get_managed_user_storage_usage200_response_data.py +95 -0
  122. api_sdk_py/models/get_managed_user_storage_usage200_response_data_by_purpose.py +106 -0
  123. api_sdk_py/models/get_managed_users_by_manager_id_response.py +99 -0
  124. api_sdk_py/models/get_managed_users_by_manager_id_response_data.py +101 -0
  125. api_sdk_py/models/get_partner_billing_overview200_response.py +99 -0
  126. api_sdk_py/models/get_partner_credit_transactions200_response.py +103 -0
  127. api_sdk_py/models/get_partner_design_defaults200_response.py +99 -0
  128. api_sdk_py/models/get_partner_entitlements_response.py +99 -0
  129. api_sdk_py/models/get_partner_entitlements_response_data.py +97 -0
  130. api_sdk_py/models/get_personal_workspace_domains200_response.py +103 -0
  131. api_sdk_py/models/get_public_composition_embed200_response.py +133 -0
  132. api_sdk_py/models/get_public_composition_embed200_response_data_source.py +89 -0
  133. api_sdk_py/models/get_public_composition_embed200_response_direct.py +96 -0
  134. api_sdk_py/models/get_user_adapter_connections200_response.py +103 -0
  135. api_sdk_py/models/get_user_api_key_usage_logs_response.py +99 -0
  136. api_sdk_py/models/get_user_api_key_usage_logs_response_data.py +95 -0
  137. api_sdk_py/models/get_user_api_keys200_response.py +103 -0
  138. api_sdk_py/models/get_widgets200_response.py +103 -0
  139. api_sdk_py/models/get_widgets_batch_request.py +87 -0
  140. api_sdk_py/models/get_widgets_batch_response.py +99 -0
  141. api_sdk_py/models/get_widgets_batch_response_data.py +105 -0
  142. api_sdk_py/models/get_widgets_batch_response_data_errors_inner.py +89 -0
  143. api_sdk_py/models/list_partner_presets200_response.py +103 -0
  144. api_sdk_py/models/managed_user.py +105 -0
  145. api_sdk_py/models/managed_user_entries_meta.py +100 -0
  146. api_sdk_py/models/managed_user_entries_page_success.py +103 -0
  147. api_sdk_py/models/managed_user_entry_item.py +115 -0
  148. api_sdk_py/models/managed_user_limits.py +104 -0
  149. api_sdk_py/models/managed_user_operation_usage.py +95 -0
  150. api_sdk_py/models/managed_user_removal.py +89 -0
  151. api_sdk_py/models/managed_user_response.py +99 -0
  152. api_sdk_py/models/managed_user_usage.py +110 -0
  153. api_sdk_py/models/managed_user_usage_response.py +99 -0
  154. api_sdk_py/models/managed_user_usage_totals.py +93 -0
  155. api_sdk_py/models/my_partner.py +136 -0
  156. api_sdk_py/models/my_partners.py +112 -0
  157. api_sdk_py/models/my_partners_response.py +99 -0
  158. api_sdk_py/models/new_composition.py +108 -0
  159. api_sdk_py/models/new_editor_session.py +107 -0
  160. api_sdk_py/models/new_managed_user.py +91 -0
  161. api_sdk_py/models/new_widget.py +118 -0
  162. api_sdk_py/models/operations_id_get_response.py +99 -0
  163. api_sdk_py/models/operations_id_get_response_data.py +113 -0
  164. api_sdk_py/models/partner_analytics_by_managed_user.py +109 -0
  165. api_sdk_py/models/partner_analytics_by_managed_user_response.py +99 -0
  166. api_sdk_py/models/partner_analytics_of_day.py +94 -0
  167. api_sdk_py/models/partner_analytics_of_managed_user.py +126 -0
  168. api_sdk_py/models/partner_analytics_of_widget.py +102 -0
  169. api_sdk_py/models/partner_analytics_summary.py +110 -0
  170. api_sdk_py/models/partner_analytics_summary_response.py +99 -0
  171. api_sdk_py/models/partner_analytics_timeline.py +110 -0
  172. api_sdk_py/models/partner_analytics_timeline_response.py +99 -0
  173. api_sdk_py/models/partner_analytics_top_widgets.py +110 -0
  174. api_sdk_py/models/partner_analytics_top_widgets_response.py +99 -0
  175. api_sdk_py/models/partner_billing_overview.py +114 -0
  176. api_sdk_py/models/partner_billing_overview_billing_integration.py +100 -0
  177. api_sdk_py/models/partner_billing_overview_operational_credits.py +101 -0
  178. api_sdk_py/models/partner_billing_overview_partner.py +100 -0
  179. api_sdk_py/models/partner_contract.py +158 -0
  180. api_sdk_py/models/partner_contract_response.py +99 -0
  181. api_sdk_py/models/partner_customization.py +140 -0
  182. api_sdk_py/models/partner_data_database.py +112 -0
  183. api_sdk_py/models/partner_data_database_removal.py +87 -0
  184. api_sdk_py/models/partner_data_database_removal_response.py +99 -0
  185. api_sdk_py/models/partner_data_database_response.py +99 -0
  186. api_sdk_py/models/partner_entry_context_secret.py +93 -0
  187. api_sdk_py/models/partner_entry_context_secret_response.py +99 -0
  188. api_sdk_py/models/partner_entry_context_signing.py +108 -0
  189. api_sdk_py/models/partner_entry_context_signing_response.py +99 -0
  190. api_sdk_py/models/partner_extra_credits_invoice.py +130 -0
  191. api_sdk_py/models/partner_extra_credits_invoice_response.py +99 -0
  192. api_sdk_py/models/partner_invoice.py +234 -0
  193. api_sdk_py/models/partner_notification.py +108 -0
  194. api_sdk_py/models/partner_notification_default_recipients.py +89 -0
  195. api_sdk_py/models/partner_notification_delivery.py +170 -0
  196. api_sdk_py/models/partner_notification_delivery_log.py +95 -0
  197. api_sdk_py/models/partner_notification_delivery_log_response.py +99 -0
  198. api_sdk_py/models/partner_notification_delivery_response.py +99 -0
  199. api_sdk_py/models/partner_notification_event.py +112 -0
  200. api_sdk_py/models/partner_notification_event_type.py +51 -0
  201. api_sdk_py/models/partner_notification_page.py +103 -0
  202. api_sdk_py/models/partner_notification_page_response.py +99 -0
  203. api_sdk_py/models/partner_notification_settings.py +139 -0
  204. api_sdk_py/models/partner_notification_settings_change.py +98 -0
  205. api_sdk_py/models/partner_notification_settings_change_response.py +99 -0
  206. api_sdk_py/models/partner_notification_settings_response.py +99 -0
  207. api_sdk_py/models/partner_notification_test_event_request.py +88 -0
  208. api_sdk_py/models/partner_notification_test_event_result.py +98 -0
  209. api_sdk_py/models/partner_notification_test_event_result_response.py +99 -0
  210. api_sdk_py/models/partner_preset.py +119 -0
  211. api_sdk_py/models/partner_preset_copy.py +97 -0
  212. api_sdk_py/models/partner_preset_copy_response.py +99 -0
  213. api_sdk_py/models/partner_preset_removal.py +87 -0
  214. api_sdk_py/models/partner_preset_removal_response.py +99 -0
  215. api_sdk_py/models/partner_preset_response.py +99 -0
  216. api_sdk_py/models/partner_report_page.py +91 -0
  217. api_sdk_py/models/partner_report_period.py +90 -0
  218. api_sdk_py/models/partner_storage_destination.py +120 -0
  219. api_sdk_py/models/partner_storage_destination_response.py +99 -0
  220. api_sdk_py/models/partner_storage_removal.py +87 -0
  221. api_sdk_py/models/partner_storage_removal_response.py +99 -0
  222. api_sdk_py/models/partner_storage_usage.py +109 -0
  223. api_sdk_py/models/partner_storage_usage_of_managed_user.py +129 -0
  224. api_sdk_py/models/partner_storage_usage_response.py +99 -0
  225. api_sdk_py/models/partner_storage_usage_totals.py +93 -0
  226. api_sdk_py/models/personal_workspace_domain.py +96 -0
  227. api_sdk_py/models/personal_workspace_domain_result.py +93 -0
  228. api_sdk_py/models/personal_workspace_domain_result_response.py +99 -0
  229. api_sdk_py/models/post_public_composition_embed_status200_response.py +99 -0
  230. api_sdk_py/models/post_public_composition_embed_status200_response_data.py +97 -0
  231. api_sdk_py/models/post_public_composition_embed_status_request.py +88 -0
  232. api_sdk_py/models/public_adapter_call_error.py +93 -0
  233. api_sdk_py/models/public_adapter_call_request.py +113 -0
  234. api_sdk_py/models/public_adapter_call_result.py +93 -0
  235. api_sdk_py/models/public_adapter_call_result_data.py +87 -0
  236. api_sdk_py/models/public_adapter_file_result.py +93 -0
  237. api_sdk_py/models/public_adapter_file_result_data.py +91 -0
  238. api_sdk_py/models/public_adapter_file_result_data_file.py +108 -0
  239. api_sdk_py/models/public_composition_entry_created.py +93 -0
  240. api_sdk_py/models/public_composition_entry_created_data.py +92 -0
  241. api_sdk_py/models/public_composition_entry_request.py +101 -0
  242. api_sdk_py/models/public_embed_failure.py +105 -0
  243. api_sdk_py/models/public_embed_failure_details.py +112 -0
  244. api_sdk_py/models/public_embed_failure_error.py +98 -0
  245. api_sdk_py/models/purpose_storage_bucket.py +89 -0
  246. api_sdk_py/models/remove_ai_answers_knowledge_document200_response.py +99 -0
  247. api_sdk_py/models/remove_user_adapter_connection200_response.py +99 -0
  248. api_sdk_py/models/request_extra_credits.py +88 -0
  249. api_sdk_py/models/response_meta.py +121 -0
  250. api_sdk_py/models/revoke_managed_user_editor_sessions_response.py +99 -0
  251. api_sdk_py/models/revoke_managed_user_editor_sessions_response_data.py +87 -0
  252. api_sdk_py/models/set_adapter_connection_request.py +88 -0
  253. api_sdk_py/models/set_composition_data_source_request.py +90 -0
  254. api_sdk_py/models/set_dynamic_content_request.py +95 -0
  255. api_sdk_py/models/set_dynamic_content_response.py +99 -0
  256. api_sdk_py/models/set_dynamic_content_response_data.py +99 -0
  257. api_sdk_py/models/set_dynamic_content_response_data_validation_result.py +91 -0
  258. api_sdk_py/models/set_managed_user_limits_request.py +93 -0
  259. api_sdk_py/models/set_partner_data_database_request.py +87 -0
  260. api_sdk_py/models/set_partner_design_defaults_request.py +92 -0
  261. api_sdk_py/models/set_partner_preset_request.py +104 -0
  262. api_sdk_py/models/set_partner_storage_destination_request.py +101 -0
  263. api_sdk_py/models/set_user_adapter_connection200_response.py +99 -0
  264. api_sdk_py/models/success_response.py +95 -0
  265. api_sdk_py/models/update_canvas_request.py +96 -0
  266. api_sdk_py/models/update_composition.py +101 -0
  267. api_sdk_py/models/update_composition_status_request.py +94 -0
  268. api_sdk_py/models/update_domain_request.py +87 -0
  269. api_sdk_py/models/update_managed_user.py +91 -0
  270. api_sdk_py/models/update_partner_entry_context_signing_request.py +87 -0
  271. api_sdk_py/models/update_partner_notification_settings_request.py +110 -0
  272. api_sdk_py/models/update_user_api_key_request.py +90 -0
  273. api_sdk_py/models/upload.py +167 -0
  274. api_sdk_py/models/upload_limits.py +97 -0
  275. api_sdk_py/models/upload_limits_response.py +99 -0
  276. api_sdk_py/models/upload_response.py +99 -0
  277. api_sdk_py/models/uploads_get200_response.py +103 -0
  278. api_sdk_py/models/uploads_id_delete200_response.py +99 -0
  279. api_sdk_py/models/uploads_id_delete200_response_data.py +87 -0
  280. api_sdk_py/models/user_api_key.py +122 -0
  281. api_sdk_py/models/user_api_key_response.py +99 -0
  282. api_sdk_py/models/user_api_key_usage_log.py +107 -0
  283. api_sdk_py/models/validate_composition_content_response.py +99 -0
  284. api_sdk_py/models/validate_composition_content_response_data.py +108 -0
  285. api_sdk_py/models/validate_token200_response.py +99 -0
  286. api_sdk_py/models/validate_token200_response_data.py +106 -0
  287. api_sdk_py/models/widget.py +205 -0
  288. api_sdk_py/py.typed +0 -0
  289. api_sdk_py/rest.py +257 -0
  290. api_sdk_py-1.11.66.dist-info/METADATA +28 -0
  291. api_sdk_py-1.11.66.dist-info/RECORD +294 -0
  292. api_sdk_py-1.11.66.dist-info/WHEEL +5 -0
  293. api_sdk_py-1.11.66.dist-info/licenses/LICENSE +122 -0
  294. api_sdk_py-1.11.66.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1507 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Widgetic API Gateway
5
+
6
+ API documentation for the Widgetic API Gateway
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import Field, StrictBytes, StrictStr, field_validator
20
+ from typing import Optional, Tuple, Union
21
+ from typing_extensions import Annotated
22
+ from api_sdk_py.models.upload_limits_response import UploadLimitsResponse
23
+ from api_sdk_py.models.upload_response import UploadResponse
24
+ from api_sdk_py.models.uploads_get200_response import UploadsGet200Response
25
+ from api_sdk_py.models.uploads_id_delete200_response import UploadsIdDelete200Response
26
+
27
+ from api_sdk_py.api_client import ApiClient, RequestSerialized
28
+ from api_sdk_py.api_response import ApiResponse
29
+ from api_sdk_py.rest import RESTResponseType
30
+
31
+
32
+ class UploadsApi:
33
+ """NOTE: This class is auto generated by OpenAPI Generator
34
+ Ref: https://openapi-generator.tech
35
+
36
+ Do not edit the class manually.
37
+ """
38
+
39
+ def __init__(self, api_client=None) -> None:
40
+ if api_client is None:
41
+ api_client = ApiClient.get_default()
42
+ self.api_client = api_client
43
+
44
+
45
+ @validate_call
46
+ def uploads_get_0(
47
+ self,
48
+ limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum number of files to return")] = None,
49
+ managed_user_id: Annotated[Optional[StrictStr], Field(description="List only the files uploaded for this managed user (Widgetic's id for the user). Send this or `managedUserExternalId`, not both.")] = None,
50
+ managed_user_external_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="List only the files uploaded for the managed user you registered with this `externalId` (your own identifier for the user). Send this or `managedUserId`, not both.")] = None,
51
+ _request_timeout: Union[
52
+ None,
53
+ Annotated[StrictFloat, Field(gt=0)],
54
+ Tuple[
55
+ Annotated[StrictFloat, Field(gt=0)],
56
+ Annotated[StrictFloat, Field(gt=0)]
57
+ ]
58
+ ] = None,
59
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
60
+ _content_type: Optional[StrictStr] = None,
61
+ _headers: Optional[Dict[StrictStr, Any]] = None,
62
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
63
+ ) -> UploadsGet200Response:
64
+ """List the account's uploads
65
+
66
+ The files the account has uploaded, newest first. Deleted files are not listed. Returns at most `limit` files and has no further pages: a client that needs more narrows the list instead, for example to one managed user's files with `managedUserId` or `managedUserExternalId`. The files that visitors sent through a widget's upload adapter (`source` is `widget-visitor-upload`) are not part of this list, so that a popular widget does not push the account's own files out of it; naming one widget with `widgetId` lists what visitors sent to that widget as well.
67
+
68
+ :param limit: Maximum number of files to return
69
+ :type limit: int
70
+ :param managed_user_id: List only the files uploaded for this managed user (Widgetic's id for the user). Send this or `managedUserExternalId`, not both.
71
+ :type managed_user_id: str
72
+ :param managed_user_external_id: List only the files uploaded for the managed user you registered with this `externalId` (your own identifier for the user). Send this or `managedUserId`, not both.
73
+ :type managed_user_external_id: str
74
+ :param _request_timeout: timeout setting for this request. If one
75
+ number provided, it will be total request
76
+ timeout. It can also be a pair (tuple) of
77
+ (connection, read) timeouts.
78
+ :type _request_timeout: int, tuple(int, int), optional
79
+ :param _request_auth: set to override the auth_settings for an a single
80
+ request; this effectively ignores the
81
+ authentication in the spec for a single request.
82
+ :type _request_auth: dict, optional
83
+ :param _content_type: force content-type for the request.
84
+ :type _content_type: str, Optional
85
+ :param _headers: set to override the headers for a single
86
+ request; this effectively ignores the headers
87
+ in the spec for a single request.
88
+ :type _headers: dict, optional
89
+ :param _host_index: set to override the host_index for a single
90
+ request; this effectively ignores the host_index
91
+ in the spec for a single request.
92
+ :type _host_index: int, optional
93
+ :return: Returns the result object.
94
+ """ # noqa: E501
95
+
96
+ _param = self._uploads_get_0_serialize(
97
+ limit=limit,
98
+ managed_user_id=managed_user_id,
99
+ managed_user_external_id=managed_user_external_id,
100
+ _request_auth=_request_auth,
101
+ _content_type=_content_type,
102
+ _headers=_headers,
103
+ _host_index=_host_index
104
+ )
105
+
106
+ _response_types_map: Dict[str, Optional[str]] = {
107
+ '200': "UploadsGet200Response",
108
+ '400': "ErrorResponse",
109
+ '401': "ErrorResponse",
110
+ '404': "ErrorResponse",
111
+ }
112
+ response_data = self.api_client.call_api(
113
+ *_param,
114
+ _request_timeout=_request_timeout
115
+ )
116
+ response_data.read()
117
+ return self.api_client.response_deserialize(
118
+ response_data=response_data,
119
+ response_types_map=_response_types_map,
120
+ ).data
121
+
122
+
123
+ @validate_call
124
+ def uploads_get_0_with_http_info(
125
+ self,
126
+ limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum number of files to return")] = None,
127
+ managed_user_id: Annotated[Optional[StrictStr], Field(description="List only the files uploaded for this managed user (Widgetic's id for the user). Send this or `managedUserExternalId`, not both.")] = None,
128
+ managed_user_external_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="List only the files uploaded for the managed user you registered with this `externalId` (your own identifier for the user). Send this or `managedUserId`, not both.")] = None,
129
+ _request_timeout: Union[
130
+ None,
131
+ Annotated[StrictFloat, Field(gt=0)],
132
+ Tuple[
133
+ Annotated[StrictFloat, Field(gt=0)],
134
+ Annotated[StrictFloat, Field(gt=0)]
135
+ ]
136
+ ] = None,
137
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
138
+ _content_type: Optional[StrictStr] = None,
139
+ _headers: Optional[Dict[StrictStr, Any]] = None,
140
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
141
+ ) -> ApiResponse[UploadsGet200Response]:
142
+ """List the account's uploads
143
+
144
+ The files the account has uploaded, newest first. Deleted files are not listed. Returns at most `limit` files and has no further pages: a client that needs more narrows the list instead, for example to one managed user's files with `managedUserId` or `managedUserExternalId`. The files that visitors sent through a widget's upload adapter (`source` is `widget-visitor-upload`) are not part of this list, so that a popular widget does not push the account's own files out of it; naming one widget with `widgetId` lists what visitors sent to that widget as well.
145
+
146
+ :param limit: Maximum number of files to return
147
+ :type limit: int
148
+ :param managed_user_id: List only the files uploaded for this managed user (Widgetic's id for the user). Send this or `managedUserExternalId`, not both.
149
+ :type managed_user_id: str
150
+ :param managed_user_external_id: List only the files uploaded for the managed user you registered with this `externalId` (your own identifier for the user). Send this or `managedUserId`, not both.
151
+ :type managed_user_external_id: str
152
+ :param _request_timeout: timeout setting for this request. If one
153
+ number provided, it will be total request
154
+ timeout. It can also be a pair (tuple) of
155
+ (connection, read) timeouts.
156
+ :type _request_timeout: int, tuple(int, int), optional
157
+ :param _request_auth: set to override the auth_settings for an a single
158
+ request; this effectively ignores the
159
+ authentication in the spec for a single request.
160
+ :type _request_auth: dict, optional
161
+ :param _content_type: force content-type for the request.
162
+ :type _content_type: str, Optional
163
+ :param _headers: set to override the headers for a single
164
+ request; this effectively ignores the headers
165
+ in the spec for a single request.
166
+ :type _headers: dict, optional
167
+ :param _host_index: set to override the host_index for a single
168
+ request; this effectively ignores the host_index
169
+ in the spec for a single request.
170
+ :type _host_index: int, optional
171
+ :return: Returns the result object.
172
+ """ # noqa: E501
173
+
174
+ _param = self._uploads_get_0_serialize(
175
+ limit=limit,
176
+ managed_user_id=managed_user_id,
177
+ managed_user_external_id=managed_user_external_id,
178
+ _request_auth=_request_auth,
179
+ _content_type=_content_type,
180
+ _headers=_headers,
181
+ _host_index=_host_index
182
+ )
183
+
184
+ _response_types_map: Dict[str, Optional[str]] = {
185
+ '200': "UploadsGet200Response",
186
+ '400': "ErrorResponse",
187
+ '401': "ErrorResponse",
188
+ '404': "ErrorResponse",
189
+ }
190
+ response_data = self.api_client.call_api(
191
+ *_param,
192
+ _request_timeout=_request_timeout
193
+ )
194
+ response_data.read()
195
+ return self.api_client.response_deserialize(
196
+ response_data=response_data,
197
+ response_types_map=_response_types_map,
198
+ )
199
+
200
+
201
+ @validate_call
202
+ def uploads_get_0_without_preload_content(
203
+ self,
204
+ limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum number of files to return")] = None,
205
+ managed_user_id: Annotated[Optional[StrictStr], Field(description="List only the files uploaded for this managed user (Widgetic's id for the user). Send this or `managedUserExternalId`, not both.")] = None,
206
+ managed_user_external_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="List only the files uploaded for the managed user you registered with this `externalId` (your own identifier for the user). Send this or `managedUserId`, not both.")] = None,
207
+ _request_timeout: Union[
208
+ None,
209
+ Annotated[StrictFloat, Field(gt=0)],
210
+ Tuple[
211
+ Annotated[StrictFloat, Field(gt=0)],
212
+ Annotated[StrictFloat, Field(gt=0)]
213
+ ]
214
+ ] = None,
215
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
216
+ _content_type: Optional[StrictStr] = None,
217
+ _headers: Optional[Dict[StrictStr, Any]] = None,
218
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
219
+ ) -> RESTResponseType:
220
+ """List the account's uploads
221
+
222
+ The files the account has uploaded, newest first. Deleted files are not listed. Returns at most `limit` files and has no further pages: a client that needs more narrows the list instead, for example to one managed user's files with `managedUserId` or `managedUserExternalId`. The files that visitors sent through a widget's upload adapter (`source` is `widget-visitor-upload`) are not part of this list, so that a popular widget does not push the account's own files out of it; naming one widget with `widgetId` lists what visitors sent to that widget as well.
223
+
224
+ :param limit: Maximum number of files to return
225
+ :type limit: int
226
+ :param managed_user_id: List only the files uploaded for this managed user (Widgetic's id for the user). Send this or `managedUserExternalId`, not both.
227
+ :type managed_user_id: str
228
+ :param managed_user_external_id: List only the files uploaded for the managed user you registered with this `externalId` (your own identifier for the user). Send this or `managedUserId`, not both.
229
+ :type managed_user_external_id: str
230
+ :param _request_timeout: timeout setting for this request. If one
231
+ number provided, it will be total request
232
+ timeout. It can also be a pair (tuple) of
233
+ (connection, read) timeouts.
234
+ :type _request_timeout: int, tuple(int, int), optional
235
+ :param _request_auth: set to override the auth_settings for an a single
236
+ request; this effectively ignores the
237
+ authentication in the spec for a single request.
238
+ :type _request_auth: dict, optional
239
+ :param _content_type: force content-type for the request.
240
+ :type _content_type: str, Optional
241
+ :param _headers: set to override the headers for a single
242
+ request; this effectively ignores the headers
243
+ in the spec for a single request.
244
+ :type _headers: dict, optional
245
+ :param _host_index: set to override the host_index for a single
246
+ request; this effectively ignores the host_index
247
+ in the spec for a single request.
248
+ :type _host_index: int, optional
249
+ :return: Returns the result object.
250
+ """ # noqa: E501
251
+
252
+ _param = self._uploads_get_0_serialize(
253
+ limit=limit,
254
+ managed_user_id=managed_user_id,
255
+ managed_user_external_id=managed_user_external_id,
256
+ _request_auth=_request_auth,
257
+ _content_type=_content_type,
258
+ _headers=_headers,
259
+ _host_index=_host_index
260
+ )
261
+
262
+ _response_types_map: Dict[str, Optional[str]] = {
263
+ '200': "UploadsGet200Response",
264
+ '400': "ErrorResponse",
265
+ '401': "ErrorResponse",
266
+ '404': "ErrorResponse",
267
+ }
268
+ response_data = self.api_client.call_api(
269
+ *_param,
270
+ _request_timeout=_request_timeout
271
+ )
272
+ return response_data.response
273
+
274
+
275
+ def _uploads_get_0_serialize(
276
+ self,
277
+ limit,
278
+ managed_user_id,
279
+ managed_user_external_id,
280
+ _request_auth,
281
+ _content_type,
282
+ _headers,
283
+ _host_index,
284
+ ) -> RequestSerialized:
285
+
286
+ _host = None
287
+
288
+ _collection_formats: Dict[str, str] = {
289
+ }
290
+
291
+ _path_params: Dict[str, str] = {}
292
+ _query_params: List[Tuple[str, str]] = []
293
+ _header_params: Dict[str, Optional[str]] = _headers or {}
294
+ _form_params: List[Tuple[str, str]] = []
295
+ _files: Dict[
296
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
297
+ ] = {}
298
+ _body_params: Optional[bytes] = None
299
+
300
+ # process the path parameters
301
+ # process the query parameters
302
+ if limit is not None:
303
+
304
+ _query_params.append(('limit', limit))
305
+
306
+ if managed_user_id is not None:
307
+
308
+ _query_params.append(('managedUserId', managed_user_id))
309
+
310
+ if managed_user_external_id is not None:
311
+
312
+ _query_params.append(('managedUserExternalId', managed_user_external_id))
313
+
314
+ # process the header parameters
315
+ # process the form parameters
316
+ # process the body parameter
317
+
318
+
319
+ # set the HTTP header `Accept`
320
+ if 'Accept' not in _header_params:
321
+ _header_params['Accept'] = self.api_client.select_header_accept(
322
+ [
323
+ 'application/json'
324
+ ]
325
+ )
326
+
327
+
328
+ # authentication setting
329
+ _auth_settings: List[str] = [
330
+ 'apiKeyAuth'
331
+ ]
332
+
333
+ return self.api_client.param_serialize(
334
+ method='GET',
335
+ resource_path='/uploads',
336
+ path_params=_path_params,
337
+ query_params=_query_params,
338
+ header_params=_header_params,
339
+ body=_body_params,
340
+ post_params=_form_params,
341
+ files=_files,
342
+ auth_settings=_auth_settings,
343
+ collection_formats=_collection_formats,
344
+ _host=_host,
345
+ _request_auth=_request_auth
346
+ )
347
+
348
+
349
+
350
+
351
+ @validate_call
352
+ def uploads_id_delete_0(
353
+ self,
354
+ id: StrictStr,
355
+ _request_timeout: Union[
356
+ None,
357
+ Annotated[StrictFloat, Field(gt=0)],
358
+ Tuple[
359
+ Annotated[StrictFloat, Field(gt=0)],
360
+ Annotated[StrictFloat, Field(gt=0)]
361
+ ]
362
+ ] = None,
363
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
364
+ _content_type: Optional[StrictStr] = None,
365
+ _headers: Optional[Dict[StrictStr, Any]] = None,
366
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
367
+ ) -> UploadsIdDelete200Response:
368
+ """Delete an upload
369
+
370
+ Removes the stored file and the upload row. A file in Widgetic's own storage gives back the space it took from your storage allowance; a file in your own bucket is removed from your bucket. Deleting an upload that is already gone succeeds the same way as the first delete. An upload that belongs to another account is not found. If the storage cannot be reached the call fails and nothing is marked deleted, so it can be repeated.
371
+
372
+ :param id: (required)
373
+ :type id: str
374
+ :param _request_timeout: timeout setting for this request. If one
375
+ number provided, it will be total request
376
+ timeout. It can also be a pair (tuple) of
377
+ (connection, read) timeouts.
378
+ :type _request_timeout: int, tuple(int, int), optional
379
+ :param _request_auth: set to override the auth_settings for an a single
380
+ request; this effectively ignores the
381
+ authentication in the spec for a single request.
382
+ :type _request_auth: dict, optional
383
+ :param _content_type: force content-type for the request.
384
+ :type _content_type: str, Optional
385
+ :param _headers: set to override the headers for a single
386
+ request; this effectively ignores the headers
387
+ in the spec for a single request.
388
+ :type _headers: dict, optional
389
+ :param _host_index: set to override the host_index for a single
390
+ request; this effectively ignores the host_index
391
+ in the spec for a single request.
392
+ :type _host_index: int, optional
393
+ :return: Returns the result object.
394
+ """ # noqa: E501
395
+
396
+ _param = self._uploads_id_delete_0_serialize(
397
+ id=id,
398
+ _request_auth=_request_auth,
399
+ _content_type=_content_type,
400
+ _headers=_headers,
401
+ _host_index=_host_index
402
+ )
403
+
404
+ _response_types_map: Dict[str, Optional[str]] = {
405
+ '200': "UploadsIdDelete200Response",
406
+ '401': "ErrorResponse",
407
+ '404': "ErrorResponse",
408
+ }
409
+ response_data = self.api_client.call_api(
410
+ *_param,
411
+ _request_timeout=_request_timeout
412
+ )
413
+ response_data.read()
414
+ return self.api_client.response_deserialize(
415
+ response_data=response_data,
416
+ response_types_map=_response_types_map,
417
+ ).data
418
+
419
+
420
+ @validate_call
421
+ def uploads_id_delete_0_with_http_info(
422
+ self,
423
+ id: StrictStr,
424
+ _request_timeout: Union[
425
+ None,
426
+ Annotated[StrictFloat, Field(gt=0)],
427
+ Tuple[
428
+ Annotated[StrictFloat, Field(gt=0)],
429
+ Annotated[StrictFloat, Field(gt=0)]
430
+ ]
431
+ ] = None,
432
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
433
+ _content_type: Optional[StrictStr] = None,
434
+ _headers: Optional[Dict[StrictStr, Any]] = None,
435
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
436
+ ) -> ApiResponse[UploadsIdDelete200Response]:
437
+ """Delete an upload
438
+
439
+ Removes the stored file and the upload row. A file in Widgetic's own storage gives back the space it took from your storage allowance; a file in your own bucket is removed from your bucket. Deleting an upload that is already gone succeeds the same way as the first delete. An upload that belongs to another account is not found. If the storage cannot be reached the call fails and nothing is marked deleted, so it can be repeated.
440
+
441
+ :param id: (required)
442
+ :type id: str
443
+ :param _request_timeout: timeout setting for this request. If one
444
+ number provided, it will be total request
445
+ timeout. It can also be a pair (tuple) of
446
+ (connection, read) timeouts.
447
+ :type _request_timeout: int, tuple(int, int), optional
448
+ :param _request_auth: set to override the auth_settings for an a single
449
+ request; this effectively ignores the
450
+ authentication in the spec for a single request.
451
+ :type _request_auth: dict, optional
452
+ :param _content_type: force content-type for the request.
453
+ :type _content_type: str, Optional
454
+ :param _headers: set to override the headers for a single
455
+ request; this effectively ignores the headers
456
+ in the spec for a single request.
457
+ :type _headers: dict, optional
458
+ :param _host_index: set to override the host_index for a single
459
+ request; this effectively ignores the host_index
460
+ in the spec for a single request.
461
+ :type _host_index: int, optional
462
+ :return: Returns the result object.
463
+ """ # noqa: E501
464
+
465
+ _param = self._uploads_id_delete_0_serialize(
466
+ id=id,
467
+ _request_auth=_request_auth,
468
+ _content_type=_content_type,
469
+ _headers=_headers,
470
+ _host_index=_host_index
471
+ )
472
+
473
+ _response_types_map: Dict[str, Optional[str]] = {
474
+ '200': "UploadsIdDelete200Response",
475
+ '401': "ErrorResponse",
476
+ '404': "ErrorResponse",
477
+ }
478
+ response_data = self.api_client.call_api(
479
+ *_param,
480
+ _request_timeout=_request_timeout
481
+ )
482
+ response_data.read()
483
+ return self.api_client.response_deserialize(
484
+ response_data=response_data,
485
+ response_types_map=_response_types_map,
486
+ )
487
+
488
+
489
+ @validate_call
490
+ def uploads_id_delete_0_without_preload_content(
491
+ self,
492
+ id: StrictStr,
493
+ _request_timeout: Union[
494
+ None,
495
+ Annotated[StrictFloat, Field(gt=0)],
496
+ Tuple[
497
+ Annotated[StrictFloat, Field(gt=0)],
498
+ Annotated[StrictFloat, Field(gt=0)]
499
+ ]
500
+ ] = None,
501
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
502
+ _content_type: Optional[StrictStr] = None,
503
+ _headers: Optional[Dict[StrictStr, Any]] = None,
504
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
505
+ ) -> RESTResponseType:
506
+ """Delete an upload
507
+
508
+ Removes the stored file and the upload row. A file in Widgetic's own storage gives back the space it took from your storage allowance; a file in your own bucket is removed from your bucket. Deleting an upload that is already gone succeeds the same way as the first delete. An upload that belongs to another account is not found. If the storage cannot be reached the call fails and nothing is marked deleted, so it can be repeated.
509
+
510
+ :param id: (required)
511
+ :type id: str
512
+ :param _request_timeout: timeout setting for this request. If one
513
+ number provided, it will be total request
514
+ timeout. It can also be a pair (tuple) of
515
+ (connection, read) timeouts.
516
+ :type _request_timeout: int, tuple(int, int), optional
517
+ :param _request_auth: set to override the auth_settings for an a single
518
+ request; this effectively ignores the
519
+ authentication in the spec for a single request.
520
+ :type _request_auth: dict, optional
521
+ :param _content_type: force content-type for the request.
522
+ :type _content_type: str, Optional
523
+ :param _headers: set to override the headers for a single
524
+ request; this effectively ignores the headers
525
+ in the spec for a single request.
526
+ :type _headers: dict, optional
527
+ :param _host_index: set to override the host_index for a single
528
+ request; this effectively ignores the host_index
529
+ in the spec for a single request.
530
+ :type _host_index: int, optional
531
+ :return: Returns the result object.
532
+ """ # noqa: E501
533
+
534
+ _param = self._uploads_id_delete_0_serialize(
535
+ id=id,
536
+ _request_auth=_request_auth,
537
+ _content_type=_content_type,
538
+ _headers=_headers,
539
+ _host_index=_host_index
540
+ )
541
+
542
+ _response_types_map: Dict[str, Optional[str]] = {
543
+ '200': "UploadsIdDelete200Response",
544
+ '401': "ErrorResponse",
545
+ '404': "ErrorResponse",
546
+ }
547
+ response_data = self.api_client.call_api(
548
+ *_param,
549
+ _request_timeout=_request_timeout
550
+ )
551
+ return response_data.response
552
+
553
+
554
+ def _uploads_id_delete_0_serialize(
555
+ self,
556
+ id,
557
+ _request_auth,
558
+ _content_type,
559
+ _headers,
560
+ _host_index,
561
+ ) -> RequestSerialized:
562
+
563
+ _host = None
564
+
565
+ _collection_formats: Dict[str, str] = {
566
+ }
567
+
568
+ _path_params: Dict[str, str] = {}
569
+ _query_params: List[Tuple[str, str]] = []
570
+ _header_params: Dict[str, Optional[str]] = _headers or {}
571
+ _form_params: List[Tuple[str, str]] = []
572
+ _files: Dict[
573
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
574
+ ] = {}
575
+ _body_params: Optional[bytes] = None
576
+
577
+ # process the path parameters
578
+ if id is not None:
579
+ _path_params['id'] = id
580
+ # process the query parameters
581
+ # process the header parameters
582
+ # process the form parameters
583
+ # process the body parameter
584
+
585
+
586
+ # set the HTTP header `Accept`
587
+ if 'Accept' not in _header_params:
588
+ _header_params['Accept'] = self.api_client.select_header_accept(
589
+ [
590
+ 'application/json'
591
+ ]
592
+ )
593
+
594
+
595
+ # authentication setting
596
+ _auth_settings: List[str] = [
597
+ 'apiKeyAuth'
598
+ ]
599
+
600
+ return self.api_client.param_serialize(
601
+ method='DELETE',
602
+ resource_path='/uploads/{id}',
603
+ path_params=_path_params,
604
+ query_params=_query_params,
605
+ header_params=_header_params,
606
+ body=_body_params,
607
+ post_params=_form_params,
608
+ files=_files,
609
+ auth_settings=_auth_settings,
610
+ collection_formats=_collection_formats,
611
+ _host=_host,
612
+ _request_auth=_request_auth
613
+ )
614
+
615
+
616
+
617
+
618
+ @validate_call
619
+ def uploads_id_get_0(
620
+ self,
621
+ id: Annotated[StrictStr, Field(description="The upload to read")],
622
+ _request_timeout: Union[
623
+ None,
624
+ Annotated[StrictFloat, Field(gt=0)],
625
+ Tuple[
626
+ Annotated[StrictFloat, Field(gt=0)],
627
+ Annotated[StrictFloat, Field(gt=0)]
628
+ ]
629
+ ] = None,
630
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
631
+ _content_type: Optional[StrictStr] = None,
632
+ _headers: Optional[Dict[StrictStr, Any]] = None,
633
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
634
+ ) -> UploadResponse:
635
+ """Get an upload by id
636
+
637
+ The details of one of the account's uploads. An upload that belongs to another account is not found.
638
+
639
+ :param id: The upload to read (required)
640
+ :type id: str
641
+ :param _request_timeout: timeout setting for this request. If one
642
+ number provided, it will be total request
643
+ timeout. It can also be a pair (tuple) of
644
+ (connection, read) timeouts.
645
+ :type _request_timeout: int, tuple(int, int), optional
646
+ :param _request_auth: set to override the auth_settings for an a single
647
+ request; this effectively ignores the
648
+ authentication in the spec for a single request.
649
+ :type _request_auth: dict, optional
650
+ :param _content_type: force content-type for the request.
651
+ :type _content_type: str, Optional
652
+ :param _headers: set to override the headers for a single
653
+ request; this effectively ignores the headers
654
+ in the spec for a single request.
655
+ :type _headers: dict, optional
656
+ :param _host_index: set to override the host_index for a single
657
+ request; this effectively ignores the host_index
658
+ in the spec for a single request.
659
+ :type _host_index: int, optional
660
+ :return: Returns the result object.
661
+ """ # noqa: E501
662
+
663
+ _param = self._uploads_id_get_0_serialize(
664
+ id=id,
665
+ _request_auth=_request_auth,
666
+ _content_type=_content_type,
667
+ _headers=_headers,
668
+ _host_index=_host_index
669
+ )
670
+
671
+ _response_types_map: Dict[str, Optional[str]] = {
672
+ '200': "UploadResponse",
673
+ '401': "ErrorResponse",
674
+ '404': "ErrorResponse",
675
+ }
676
+ response_data = self.api_client.call_api(
677
+ *_param,
678
+ _request_timeout=_request_timeout
679
+ )
680
+ response_data.read()
681
+ return self.api_client.response_deserialize(
682
+ response_data=response_data,
683
+ response_types_map=_response_types_map,
684
+ ).data
685
+
686
+
687
+ @validate_call
688
+ def uploads_id_get_0_with_http_info(
689
+ self,
690
+ id: Annotated[StrictStr, Field(description="The upload to read")],
691
+ _request_timeout: Union[
692
+ None,
693
+ Annotated[StrictFloat, Field(gt=0)],
694
+ Tuple[
695
+ Annotated[StrictFloat, Field(gt=0)],
696
+ Annotated[StrictFloat, Field(gt=0)]
697
+ ]
698
+ ] = None,
699
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
700
+ _content_type: Optional[StrictStr] = None,
701
+ _headers: Optional[Dict[StrictStr, Any]] = None,
702
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
703
+ ) -> ApiResponse[UploadResponse]:
704
+ """Get an upload by id
705
+
706
+ The details of one of the account's uploads. An upload that belongs to another account is not found.
707
+
708
+ :param id: The upload to read (required)
709
+ :type id: str
710
+ :param _request_timeout: timeout setting for this request. If one
711
+ number provided, it will be total request
712
+ timeout. It can also be a pair (tuple) of
713
+ (connection, read) timeouts.
714
+ :type _request_timeout: int, tuple(int, int), optional
715
+ :param _request_auth: set to override the auth_settings for an a single
716
+ request; this effectively ignores the
717
+ authentication in the spec for a single request.
718
+ :type _request_auth: dict, optional
719
+ :param _content_type: force content-type for the request.
720
+ :type _content_type: str, Optional
721
+ :param _headers: set to override the headers for a single
722
+ request; this effectively ignores the headers
723
+ in the spec for a single request.
724
+ :type _headers: dict, optional
725
+ :param _host_index: set to override the host_index for a single
726
+ request; this effectively ignores the host_index
727
+ in the spec for a single request.
728
+ :type _host_index: int, optional
729
+ :return: Returns the result object.
730
+ """ # noqa: E501
731
+
732
+ _param = self._uploads_id_get_0_serialize(
733
+ id=id,
734
+ _request_auth=_request_auth,
735
+ _content_type=_content_type,
736
+ _headers=_headers,
737
+ _host_index=_host_index
738
+ )
739
+
740
+ _response_types_map: Dict[str, Optional[str]] = {
741
+ '200': "UploadResponse",
742
+ '401': "ErrorResponse",
743
+ '404': "ErrorResponse",
744
+ }
745
+ response_data = self.api_client.call_api(
746
+ *_param,
747
+ _request_timeout=_request_timeout
748
+ )
749
+ response_data.read()
750
+ return self.api_client.response_deserialize(
751
+ response_data=response_data,
752
+ response_types_map=_response_types_map,
753
+ )
754
+
755
+
756
+ @validate_call
757
+ def uploads_id_get_0_without_preload_content(
758
+ self,
759
+ id: Annotated[StrictStr, Field(description="The upload to read")],
760
+ _request_timeout: Union[
761
+ None,
762
+ Annotated[StrictFloat, Field(gt=0)],
763
+ Tuple[
764
+ Annotated[StrictFloat, Field(gt=0)],
765
+ Annotated[StrictFloat, Field(gt=0)]
766
+ ]
767
+ ] = None,
768
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
769
+ _content_type: Optional[StrictStr] = None,
770
+ _headers: Optional[Dict[StrictStr, Any]] = None,
771
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
772
+ ) -> RESTResponseType:
773
+ """Get an upload by id
774
+
775
+ The details of one of the account's uploads. An upload that belongs to another account is not found.
776
+
777
+ :param id: The upload to read (required)
778
+ :type id: str
779
+ :param _request_timeout: timeout setting for this request. If one
780
+ number provided, it will be total request
781
+ timeout. It can also be a pair (tuple) of
782
+ (connection, read) timeouts.
783
+ :type _request_timeout: int, tuple(int, int), optional
784
+ :param _request_auth: set to override the auth_settings for an a single
785
+ request; this effectively ignores the
786
+ authentication in the spec for a single request.
787
+ :type _request_auth: dict, optional
788
+ :param _content_type: force content-type for the request.
789
+ :type _content_type: str, Optional
790
+ :param _headers: set to override the headers for a single
791
+ request; this effectively ignores the headers
792
+ in the spec for a single request.
793
+ :type _headers: dict, optional
794
+ :param _host_index: set to override the host_index for a single
795
+ request; this effectively ignores the host_index
796
+ in the spec for a single request.
797
+ :type _host_index: int, optional
798
+ :return: Returns the result object.
799
+ """ # noqa: E501
800
+
801
+ _param = self._uploads_id_get_0_serialize(
802
+ id=id,
803
+ _request_auth=_request_auth,
804
+ _content_type=_content_type,
805
+ _headers=_headers,
806
+ _host_index=_host_index
807
+ )
808
+
809
+ _response_types_map: Dict[str, Optional[str]] = {
810
+ '200': "UploadResponse",
811
+ '401': "ErrorResponse",
812
+ '404': "ErrorResponse",
813
+ }
814
+ response_data = self.api_client.call_api(
815
+ *_param,
816
+ _request_timeout=_request_timeout
817
+ )
818
+ return response_data.response
819
+
820
+
821
+ def _uploads_id_get_0_serialize(
822
+ self,
823
+ id,
824
+ _request_auth,
825
+ _content_type,
826
+ _headers,
827
+ _host_index,
828
+ ) -> RequestSerialized:
829
+
830
+ _host = None
831
+
832
+ _collection_formats: Dict[str, str] = {
833
+ }
834
+
835
+ _path_params: Dict[str, str] = {}
836
+ _query_params: List[Tuple[str, str]] = []
837
+ _header_params: Dict[str, Optional[str]] = _headers or {}
838
+ _form_params: List[Tuple[str, str]] = []
839
+ _files: Dict[
840
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
841
+ ] = {}
842
+ _body_params: Optional[bytes] = None
843
+
844
+ # process the path parameters
845
+ if id is not None:
846
+ _path_params['id'] = id
847
+ # process the query parameters
848
+ # process the header parameters
849
+ # process the form parameters
850
+ # process the body parameter
851
+
852
+
853
+ # set the HTTP header `Accept`
854
+ if 'Accept' not in _header_params:
855
+ _header_params['Accept'] = self.api_client.select_header_accept(
856
+ [
857
+ 'application/json'
858
+ ]
859
+ )
860
+
861
+
862
+ # authentication setting
863
+ _auth_settings: List[str] = [
864
+ 'apiKeyAuth'
865
+ ]
866
+
867
+ return self.api_client.param_serialize(
868
+ method='GET',
869
+ resource_path='/uploads/{id}',
870
+ path_params=_path_params,
871
+ query_params=_query_params,
872
+ header_params=_header_params,
873
+ body=_body_params,
874
+ post_params=_form_params,
875
+ files=_files,
876
+ auth_settings=_auth_settings,
877
+ collection_formats=_collection_formats,
878
+ _host=_host,
879
+ _request_auth=_request_auth
880
+ )
881
+
882
+
883
+
884
+
885
+ @validate_call
886
+ def uploads_limits_get_0(
887
+ self,
888
+ _request_timeout: Union[
889
+ None,
890
+ Annotated[StrictFloat, Field(gt=0)],
891
+ Tuple[
892
+ Annotated[StrictFloat, Field(gt=0)],
893
+ Annotated[StrictFloat, Field(gt=0)]
894
+ ]
895
+ ] = None,
896
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
897
+ _content_type: Optional[StrictStr] = None,
898
+ _headers: Optional[Dict[StrictStr, Any]] = None,
899
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
900
+ ) -> UploadLimitsResponse:
901
+ """Upload size limits and accepted file types
902
+
903
+ The size limit and the accepted file types of the upload endpoints. Read them from here rather than hard-coding thresholds: they are configuration and can change. The limits are the same for every account, whatever its plan: `multipart_max_bytes` for a file sent in one request (10 MB) and `tus_max_bytes` for a resumable upload (250 MB).
904
+
905
+ :param _request_timeout: timeout setting for this request. If one
906
+ number provided, it will be total request
907
+ timeout. It can also be a pair (tuple) of
908
+ (connection, read) timeouts.
909
+ :type _request_timeout: int, tuple(int, int), optional
910
+ :param _request_auth: set to override the auth_settings for an a single
911
+ request; this effectively ignores the
912
+ authentication in the spec for a single request.
913
+ :type _request_auth: dict, optional
914
+ :param _content_type: force content-type for the request.
915
+ :type _content_type: str, Optional
916
+ :param _headers: set to override the headers for a single
917
+ request; this effectively ignores the headers
918
+ in the spec for a single request.
919
+ :type _headers: dict, optional
920
+ :param _host_index: set to override the host_index for a single
921
+ request; this effectively ignores the host_index
922
+ in the spec for a single request.
923
+ :type _host_index: int, optional
924
+ :return: Returns the result object.
925
+ """ # noqa: E501
926
+
927
+ _param = self._uploads_limits_get_0_serialize(
928
+ _request_auth=_request_auth,
929
+ _content_type=_content_type,
930
+ _headers=_headers,
931
+ _host_index=_host_index
932
+ )
933
+
934
+ _response_types_map: Dict[str, Optional[str]] = {
935
+ '200': "UploadLimitsResponse",
936
+ '401': "ErrorResponse",
937
+ }
938
+ response_data = self.api_client.call_api(
939
+ *_param,
940
+ _request_timeout=_request_timeout
941
+ )
942
+ response_data.read()
943
+ return self.api_client.response_deserialize(
944
+ response_data=response_data,
945
+ response_types_map=_response_types_map,
946
+ ).data
947
+
948
+
949
+ @validate_call
950
+ def uploads_limits_get_0_with_http_info(
951
+ self,
952
+ _request_timeout: Union[
953
+ None,
954
+ Annotated[StrictFloat, Field(gt=0)],
955
+ Tuple[
956
+ Annotated[StrictFloat, Field(gt=0)],
957
+ Annotated[StrictFloat, Field(gt=0)]
958
+ ]
959
+ ] = None,
960
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
961
+ _content_type: Optional[StrictStr] = None,
962
+ _headers: Optional[Dict[StrictStr, Any]] = None,
963
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
964
+ ) -> ApiResponse[UploadLimitsResponse]:
965
+ """Upload size limits and accepted file types
966
+
967
+ The size limit and the accepted file types of the upload endpoints. Read them from here rather than hard-coding thresholds: they are configuration and can change. The limits are the same for every account, whatever its plan: `multipart_max_bytes` for a file sent in one request (10 MB) and `tus_max_bytes` for a resumable upload (250 MB).
968
+
969
+ :param _request_timeout: timeout setting for this request. If one
970
+ number provided, it will be total request
971
+ timeout. It can also be a pair (tuple) of
972
+ (connection, read) timeouts.
973
+ :type _request_timeout: int, tuple(int, int), optional
974
+ :param _request_auth: set to override the auth_settings for an a single
975
+ request; this effectively ignores the
976
+ authentication in the spec for a single request.
977
+ :type _request_auth: dict, optional
978
+ :param _content_type: force content-type for the request.
979
+ :type _content_type: str, Optional
980
+ :param _headers: set to override the headers for a single
981
+ request; this effectively ignores the headers
982
+ in the spec for a single request.
983
+ :type _headers: dict, optional
984
+ :param _host_index: set to override the host_index for a single
985
+ request; this effectively ignores the host_index
986
+ in the spec for a single request.
987
+ :type _host_index: int, optional
988
+ :return: Returns the result object.
989
+ """ # noqa: E501
990
+
991
+ _param = self._uploads_limits_get_0_serialize(
992
+ _request_auth=_request_auth,
993
+ _content_type=_content_type,
994
+ _headers=_headers,
995
+ _host_index=_host_index
996
+ )
997
+
998
+ _response_types_map: Dict[str, Optional[str]] = {
999
+ '200': "UploadLimitsResponse",
1000
+ '401': "ErrorResponse",
1001
+ }
1002
+ response_data = self.api_client.call_api(
1003
+ *_param,
1004
+ _request_timeout=_request_timeout
1005
+ )
1006
+ response_data.read()
1007
+ return self.api_client.response_deserialize(
1008
+ response_data=response_data,
1009
+ response_types_map=_response_types_map,
1010
+ )
1011
+
1012
+
1013
+ @validate_call
1014
+ def uploads_limits_get_0_without_preload_content(
1015
+ self,
1016
+ _request_timeout: Union[
1017
+ None,
1018
+ Annotated[StrictFloat, Field(gt=0)],
1019
+ Tuple[
1020
+ Annotated[StrictFloat, Field(gt=0)],
1021
+ Annotated[StrictFloat, Field(gt=0)]
1022
+ ]
1023
+ ] = None,
1024
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1025
+ _content_type: Optional[StrictStr] = None,
1026
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1027
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1028
+ ) -> RESTResponseType:
1029
+ """Upload size limits and accepted file types
1030
+
1031
+ The size limit and the accepted file types of the upload endpoints. Read them from here rather than hard-coding thresholds: they are configuration and can change. The limits are the same for every account, whatever its plan: `multipart_max_bytes` for a file sent in one request (10 MB) and `tus_max_bytes` for a resumable upload (250 MB).
1032
+
1033
+ :param _request_timeout: timeout setting for this request. If one
1034
+ number provided, it will be total request
1035
+ timeout. It can also be a pair (tuple) of
1036
+ (connection, read) timeouts.
1037
+ :type _request_timeout: int, tuple(int, int), optional
1038
+ :param _request_auth: set to override the auth_settings for an a single
1039
+ request; this effectively ignores the
1040
+ authentication in the spec for a single request.
1041
+ :type _request_auth: dict, optional
1042
+ :param _content_type: force content-type for the request.
1043
+ :type _content_type: str, Optional
1044
+ :param _headers: set to override the headers for a single
1045
+ request; this effectively ignores the headers
1046
+ in the spec for a single request.
1047
+ :type _headers: dict, optional
1048
+ :param _host_index: set to override the host_index for a single
1049
+ request; this effectively ignores the host_index
1050
+ in the spec for a single request.
1051
+ :type _host_index: int, optional
1052
+ :return: Returns the result object.
1053
+ """ # noqa: E501
1054
+
1055
+ _param = self._uploads_limits_get_0_serialize(
1056
+ _request_auth=_request_auth,
1057
+ _content_type=_content_type,
1058
+ _headers=_headers,
1059
+ _host_index=_host_index
1060
+ )
1061
+
1062
+ _response_types_map: Dict[str, Optional[str]] = {
1063
+ '200': "UploadLimitsResponse",
1064
+ '401': "ErrorResponse",
1065
+ }
1066
+ response_data = self.api_client.call_api(
1067
+ *_param,
1068
+ _request_timeout=_request_timeout
1069
+ )
1070
+ return response_data.response
1071
+
1072
+
1073
+ def _uploads_limits_get_0_serialize(
1074
+ self,
1075
+ _request_auth,
1076
+ _content_type,
1077
+ _headers,
1078
+ _host_index,
1079
+ ) -> RequestSerialized:
1080
+
1081
+ _host = None
1082
+
1083
+ _collection_formats: Dict[str, str] = {
1084
+ }
1085
+
1086
+ _path_params: Dict[str, str] = {}
1087
+ _query_params: List[Tuple[str, str]] = []
1088
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1089
+ _form_params: List[Tuple[str, str]] = []
1090
+ _files: Dict[
1091
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1092
+ ] = {}
1093
+ _body_params: Optional[bytes] = None
1094
+
1095
+ # process the path parameters
1096
+ # process the query parameters
1097
+ # process the header parameters
1098
+ # process the form parameters
1099
+ # process the body parameter
1100
+
1101
+
1102
+ # set the HTTP header `Accept`
1103
+ if 'Accept' not in _header_params:
1104
+ _header_params['Accept'] = self.api_client.select_header_accept(
1105
+ [
1106
+ 'application/json'
1107
+ ]
1108
+ )
1109
+
1110
+
1111
+ # authentication setting
1112
+ _auth_settings: List[str] = [
1113
+ 'apiKeyAuth'
1114
+ ]
1115
+
1116
+ return self.api_client.param_serialize(
1117
+ method='GET',
1118
+ resource_path='/uploads/limits',
1119
+ path_params=_path_params,
1120
+ query_params=_query_params,
1121
+ header_params=_header_params,
1122
+ body=_body_params,
1123
+ post_params=_form_params,
1124
+ files=_files,
1125
+ auth_settings=_auth_settings,
1126
+ collection_formats=_collection_formats,
1127
+ _host=_host,
1128
+ _request_auth=_request_auth
1129
+ )
1130
+
1131
+
1132
+
1133
+
1134
+ @validate_call
1135
+ def uploads_post_0(
1136
+ self,
1137
+ file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="The file to store")],
1138
+ context_type: Annotated[Optional[StrictStr], Field(description="What the file is for. Send `content-property` for media that becomes widget content (images, video and PDF); the other values are used by Widgetic's own editor. ")] = None,
1139
+ source: Annotated[Optional[StrictStr], Field(description="Which part of the product, or which client, the file comes from")] = None,
1140
+ managed_user_id: Annotated[Optional[StrictStr], Field(description="Upload the file for one of your managed users, by Widgetic's id for the user. Send this or `managedUserExternalId`, not both.")] = None,
1141
+ managed_user_external_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The same, by your own identifier for the user, the `externalId` you gave when you created the managed user. Send this or `managedUserId`, not both.")] = None,
1142
+ purpose: Annotated[Optional[StrictStr], Field(description="Where in your product you use the file. It is kept with the file, so that a customer's storage can be counted by purpose (`getManagedUserStorageUsage`). Optional; any other value is refused with 400 and `UPLOAD_INVALID_PURPOSE`.")] = None,
1143
+ _request_timeout: Union[
1144
+ None,
1145
+ Annotated[StrictFloat, Field(gt=0)],
1146
+ Tuple[
1147
+ Annotated[StrictFloat, Field(gt=0)],
1148
+ Annotated[StrictFloat, Field(gt=0)]
1149
+ ]
1150
+ ] = None,
1151
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1152
+ _content_type: Optional[StrictStr] = None,
1153
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1154
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1155
+ ) -> UploadResponse:
1156
+ """Upload a file
1157
+
1158
+ Stores one file for the account and returns its public address. This is how a user's own images, video and PDFs reach a widget's content. Send a `multipart/form-data` request with the file in the field named `file`. The file counts against the storage of the workspace it is uploaded in, and a full workspace is refused with 413 and `QUOTA_STORAGE_EXCEEDED`. For a person signed in on widgetic.com that is the workspace they are currently working in: inside a team, the team's shared storage; inside their own workspace, their own allowance. An organization API key, and a Shopify store's session, always work in that team's shared storage. A personal API key or an SDK token always uses the account's own allowance. The two never add up and one never lends room to the other. A file over the size limit is refused with 413 and `UPLOAD_TOO_LARGE`, and a type that is not accepted with 415 and `UPLOAD_UNSUPPORTED_TYPE`; `uploadsLimitsGet` lists the size limit and the accepted types. A file is judged by what is in it, not by the type it is sent as. A file that is not the type it claims (a web page sent as `image/png`) is refused with 415 and `UPLOAD_UNSUPPORTED_TYPE`, and a picture sent under the wrong picture type is stored under the type it really is, which `mime_type` in the answer says. An SVG is rewritten as it is stored: script, `foreignObject`, animation and references to other addresses are taken out, it must be UTF-8 and at most 2 MB, and the stored file can be larger or smaller than the one sent. Anything that is not an image, audio or video (a PDF, for example) is served as a download rather than shown in a page. When the full storage is a Shopify store's team's, extra storage cannot be added through Shopify yet, so the message ends by saying so and what to do instead: delete files, or contact support. On a Solo plan it names the Teams plan (which holds more) and `error.details.planPageUrl` is the address of the plan page on Shopify. `error.suggestedAction` says the same in a few words, instead of the usual \"upgrade your storage plan\". Any other team, and a person's own workspace, get the shorter message. To upload the file for one of your managed users, send `managedUserId` (Widgetic's id for the user) or `managedUserExternalId` (your own identifier for the user), not both. The file stays in your account and counts against its allowance; the tag lets you list one user's files with `uploadsGet`. The managed user must be yours and active: one that is not yours, or does not exist, is refused with 404 and `MANAGED_USER_NOT_FOUND`, and one that is switched off with 409 and `MANAGED_USER_INACTIVE`, before the file is stored. The tag is set here and does not change afterwards. Called with an editor session (`createManagedUserEditorSession`), the file is always filed for the session's own managed user and is always media for widget content: naming another managed user is refused with 403 and `MANAGED_USER_SESSION_MISMATCH`, and `contextType`, `source`, `widgetId` and `conversationId` are ignored. A full storage allowance is refused with the same 413 and `QUOTA_STORAGE_EXCEEDED`, but the message only says that it is not available right now (not how much is stored: that is the partner's business) and `error.details.limit` is `storage`. An account that administers a partner with a storage destination (`setPartnerStorageDestination`) has its files stored in the partner's own bucket instead. Such a file takes none of the allowance, its `url` is served from the partner's public address, and its `storage_key` is the key in the partner's bucket. The file is never stored with Widgetic instead: when the destination cannot be used the upload is refused with 503 and `STORAGE_DESTINATION_UNAVAILABLE`, and when the partner's storage rejects the file with 502 and `STORAGE_DESTINATION_WRITE_FAILED`. Partner storage is not optional, and it does not depend on how the file arrives. A partner's own uploads (with its API key, an SDK token, or from the Widgetic website, the resumable route and the media library alike) and the uploads of its customers' editor sessions are kept in the partner's own storage or not at all, so a partner with no destination (or one that removed it after the session was made) has them refused with 409 and `PARTNER_STORAGE_REQUIRED`; they are never stored with Widgetic. An editor session's browser is only told that the feature is not available right now.
1159
+
1160
+ :param file: The file to store (required)
1161
+ :type file: bytearray
1162
+ :param context_type: What the file is for. Send `content-property` for media that becomes widget content (images, video and PDF); the other values are used by Widgetic's own editor.
1163
+ :type context_type: str
1164
+ :param source: Which part of the product, or which client, the file comes from
1165
+ :type source: str
1166
+ :param managed_user_id: Upload the file for one of your managed users, by Widgetic's id for the user. Send this or `managedUserExternalId`, not both.
1167
+ :type managed_user_id: str
1168
+ :param managed_user_external_id: The same, by your own identifier for the user, the `externalId` you gave when you created the managed user. Send this or `managedUserId`, not both.
1169
+ :type managed_user_external_id: str
1170
+ :param purpose: Where in your product you use the file. It is kept with the file, so that a customer's storage can be counted by purpose (`getManagedUserStorageUsage`). Optional; any other value is refused with 400 and `UPLOAD_INVALID_PURPOSE`.
1171
+ :type purpose: str
1172
+ :param _request_timeout: timeout setting for this request. If one
1173
+ number provided, it will be total request
1174
+ timeout. It can also be a pair (tuple) of
1175
+ (connection, read) timeouts.
1176
+ :type _request_timeout: int, tuple(int, int), optional
1177
+ :param _request_auth: set to override the auth_settings for an a single
1178
+ request; this effectively ignores the
1179
+ authentication in the spec for a single request.
1180
+ :type _request_auth: dict, optional
1181
+ :param _content_type: force content-type for the request.
1182
+ :type _content_type: str, Optional
1183
+ :param _headers: set to override the headers for a single
1184
+ request; this effectively ignores the headers
1185
+ in the spec for a single request.
1186
+ :type _headers: dict, optional
1187
+ :param _host_index: set to override the host_index for a single
1188
+ request; this effectively ignores the host_index
1189
+ in the spec for a single request.
1190
+ :type _host_index: int, optional
1191
+ :return: Returns the result object.
1192
+ """ # noqa: E501
1193
+
1194
+ _param = self._uploads_post_0_serialize(
1195
+ file=file,
1196
+ context_type=context_type,
1197
+ source=source,
1198
+ managed_user_id=managed_user_id,
1199
+ managed_user_external_id=managed_user_external_id,
1200
+ purpose=purpose,
1201
+ _request_auth=_request_auth,
1202
+ _content_type=_content_type,
1203
+ _headers=_headers,
1204
+ _host_index=_host_index
1205
+ )
1206
+
1207
+ _response_types_map: Dict[str, Optional[str]] = {
1208
+ '200': "UploadResponse",
1209
+ '400': "ErrorResponse",
1210
+ '401': "ErrorResponse",
1211
+ '403': "ErrorResponse",
1212
+ '404': "ErrorResponse",
1213
+ '409': "ErrorResponse",
1214
+ '413': "ErrorResponse",
1215
+ '415': "ErrorResponse",
1216
+ '502': "ErrorResponse",
1217
+ '503': "ErrorResponse",
1218
+ }
1219
+ response_data = self.api_client.call_api(
1220
+ *_param,
1221
+ _request_timeout=_request_timeout
1222
+ )
1223
+ response_data.read()
1224
+ return self.api_client.response_deserialize(
1225
+ response_data=response_data,
1226
+ response_types_map=_response_types_map,
1227
+ ).data
1228
+
1229
+
1230
+ @validate_call
1231
+ def uploads_post_0_with_http_info(
1232
+ self,
1233
+ file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="The file to store")],
1234
+ context_type: Annotated[Optional[StrictStr], Field(description="What the file is for. Send `content-property` for media that becomes widget content (images, video and PDF); the other values are used by Widgetic's own editor. ")] = None,
1235
+ source: Annotated[Optional[StrictStr], Field(description="Which part of the product, or which client, the file comes from")] = None,
1236
+ managed_user_id: Annotated[Optional[StrictStr], Field(description="Upload the file for one of your managed users, by Widgetic's id for the user. Send this or `managedUserExternalId`, not both.")] = None,
1237
+ managed_user_external_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The same, by your own identifier for the user, the `externalId` you gave when you created the managed user. Send this or `managedUserId`, not both.")] = None,
1238
+ purpose: Annotated[Optional[StrictStr], Field(description="Where in your product you use the file. It is kept with the file, so that a customer's storage can be counted by purpose (`getManagedUserStorageUsage`). Optional; any other value is refused with 400 and `UPLOAD_INVALID_PURPOSE`.")] = None,
1239
+ _request_timeout: Union[
1240
+ None,
1241
+ Annotated[StrictFloat, Field(gt=0)],
1242
+ Tuple[
1243
+ Annotated[StrictFloat, Field(gt=0)],
1244
+ Annotated[StrictFloat, Field(gt=0)]
1245
+ ]
1246
+ ] = None,
1247
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1248
+ _content_type: Optional[StrictStr] = None,
1249
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1250
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1251
+ ) -> ApiResponse[UploadResponse]:
1252
+ """Upload a file
1253
+
1254
+ Stores one file for the account and returns its public address. This is how a user's own images, video and PDFs reach a widget's content. Send a `multipart/form-data` request with the file in the field named `file`. The file counts against the storage of the workspace it is uploaded in, and a full workspace is refused with 413 and `QUOTA_STORAGE_EXCEEDED`. For a person signed in on widgetic.com that is the workspace they are currently working in: inside a team, the team's shared storage; inside their own workspace, their own allowance. An organization API key, and a Shopify store's session, always work in that team's shared storage. A personal API key or an SDK token always uses the account's own allowance. The two never add up and one never lends room to the other. A file over the size limit is refused with 413 and `UPLOAD_TOO_LARGE`, and a type that is not accepted with 415 and `UPLOAD_UNSUPPORTED_TYPE`; `uploadsLimitsGet` lists the size limit and the accepted types. A file is judged by what is in it, not by the type it is sent as. A file that is not the type it claims (a web page sent as `image/png`) is refused with 415 and `UPLOAD_UNSUPPORTED_TYPE`, and a picture sent under the wrong picture type is stored under the type it really is, which `mime_type` in the answer says. An SVG is rewritten as it is stored: script, `foreignObject`, animation and references to other addresses are taken out, it must be UTF-8 and at most 2 MB, and the stored file can be larger or smaller than the one sent. Anything that is not an image, audio or video (a PDF, for example) is served as a download rather than shown in a page. When the full storage is a Shopify store's team's, extra storage cannot be added through Shopify yet, so the message ends by saying so and what to do instead: delete files, or contact support. On a Solo plan it names the Teams plan (which holds more) and `error.details.planPageUrl` is the address of the plan page on Shopify. `error.suggestedAction` says the same in a few words, instead of the usual \"upgrade your storage plan\". Any other team, and a person's own workspace, get the shorter message. To upload the file for one of your managed users, send `managedUserId` (Widgetic's id for the user) or `managedUserExternalId` (your own identifier for the user), not both. The file stays in your account and counts against its allowance; the tag lets you list one user's files with `uploadsGet`. The managed user must be yours and active: one that is not yours, or does not exist, is refused with 404 and `MANAGED_USER_NOT_FOUND`, and one that is switched off with 409 and `MANAGED_USER_INACTIVE`, before the file is stored. The tag is set here and does not change afterwards. Called with an editor session (`createManagedUserEditorSession`), the file is always filed for the session's own managed user and is always media for widget content: naming another managed user is refused with 403 and `MANAGED_USER_SESSION_MISMATCH`, and `contextType`, `source`, `widgetId` and `conversationId` are ignored. A full storage allowance is refused with the same 413 and `QUOTA_STORAGE_EXCEEDED`, but the message only says that it is not available right now (not how much is stored: that is the partner's business) and `error.details.limit` is `storage`. An account that administers a partner with a storage destination (`setPartnerStorageDestination`) has its files stored in the partner's own bucket instead. Such a file takes none of the allowance, its `url` is served from the partner's public address, and its `storage_key` is the key in the partner's bucket. The file is never stored with Widgetic instead: when the destination cannot be used the upload is refused with 503 and `STORAGE_DESTINATION_UNAVAILABLE`, and when the partner's storage rejects the file with 502 and `STORAGE_DESTINATION_WRITE_FAILED`. Partner storage is not optional, and it does not depend on how the file arrives. A partner's own uploads (with its API key, an SDK token, or from the Widgetic website, the resumable route and the media library alike) and the uploads of its customers' editor sessions are kept in the partner's own storage or not at all, so a partner with no destination (or one that removed it after the session was made) has them refused with 409 and `PARTNER_STORAGE_REQUIRED`; they are never stored with Widgetic. An editor session's browser is only told that the feature is not available right now.
1255
+
1256
+ :param file: The file to store (required)
1257
+ :type file: bytearray
1258
+ :param context_type: What the file is for. Send `content-property` for media that becomes widget content (images, video and PDF); the other values are used by Widgetic's own editor.
1259
+ :type context_type: str
1260
+ :param source: Which part of the product, or which client, the file comes from
1261
+ :type source: str
1262
+ :param managed_user_id: Upload the file for one of your managed users, by Widgetic's id for the user. Send this or `managedUserExternalId`, not both.
1263
+ :type managed_user_id: str
1264
+ :param managed_user_external_id: The same, by your own identifier for the user, the `externalId` you gave when you created the managed user. Send this or `managedUserId`, not both.
1265
+ :type managed_user_external_id: str
1266
+ :param purpose: Where in your product you use the file. It is kept with the file, so that a customer's storage can be counted by purpose (`getManagedUserStorageUsage`). Optional; any other value is refused with 400 and `UPLOAD_INVALID_PURPOSE`.
1267
+ :type purpose: str
1268
+ :param _request_timeout: timeout setting for this request. If one
1269
+ number provided, it will be total request
1270
+ timeout. It can also be a pair (tuple) of
1271
+ (connection, read) timeouts.
1272
+ :type _request_timeout: int, tuple(int, int), optional
1273
+ :param _request_auth: set to override the auth_settings for an a single
1274
+ request; this effectively ignores the
1275
+ authentication in the spec for a single request.
1276
+ :type _request_auth: dict, optional
1277
+ :param _content_type: force content-type for the request.
1278
+ :type _content_type: str, Optional
1279
+ :param _headers: set to override the headers for a single
1280
+ request; this effectively ignores the headers
1281
+ in the spec for a single request.
1282
+ :type _headers: dict, optional
1283
+ :param _host_index: set to override the host_index for a single
1284
+ request; this effectively ignores the host_index
1285
+ in the spec for a single request.
1286
+ :type _host_index: int, optional
1287
+ :return: Returns the result object.
1288
+ """ # noqa: E501
1289
+
1290
+ _param = self._uploads_post_0_serialize(
1291
+ file=file,
1292
+ context_type=context_type,
1293
+ source=source,
1294
+ managed_user_id=managed_user_id,
1295
+ managed_user_external_id=managed_user_external_id,
1296
+ purpose=purpose,
1297
+ _request_auth=_request_auth,
1298
+ _content_type=_content_type,
1299
+ _headers=_headers,
1300
+ _host_index=_host_index
1301
+ )
1302
+
1303
+ _response_types_map: Dict[str, Optional[str]] = {
1304
+ '200': "UploadResponse",
1305
+ '400': "ErrorResponse",
1306
+ '401': "ErrorResponse",
1307
+ '403': "ErrorResponse",
1308
+ '404': "ErrorResponse",
1309
+ '409': "ErrorResponse",
1310
+ '413': "ErrorResponse",
1311
+ '415': "ErrorResponse",
1312
+ '502': "ErrorResponse",
1313
+ '503': "ErrorResponse",
1314
+ }
1315
+ response_data = self.api_client.call_api(
1316
+ *_param,
1317
+ _request_timeout=_request_timeout
1318
+ )
1319
+ response_data.read()
1320
+ return self.api_client.response_deserialize(
1321
+ response_data=response_data,
1322
+ response_types_map=_response_types_map,
1323
+ )
1324
+
1325
+
1326
+ @validate_call
1327
+ def uploads_post_0_without_preload_content(
1328
+ self,
1329
+ file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="The file to store")],
1330
+ context_type: Annotated[Optional[StrictStr], Field(description="What the file is for. Send `content-property` for media that becomes widget content (images, video and PDF); the other values are used by Widgetic's own editor. ")] = None,
1331
+ source: Annotated[Optional[StrictStr], Field(description="Which part of the product, or which client, the file comes from")] = None,
1332
+ managed_user_id: Annotated[Optional[StrictStr], Field(description="Upload the file for one of your managed users, by Widgetic's id for the user. Send this or `managedUserExternalId`, not both.")] = None,
1333
+ managed_user_external_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The same, by your own identifier for the user, the `externalId` you gave when you created the managed user. Send this or `managedUserId`, not both.")] = None,
1334
+ purpose: Annotated[Optional[StrictStr], Field(description="Where in your product you use the file. It is kept with the file, so that a customer's storage can be counted by purpose (`getManagedUserStorageUsage`). Optional; any other value is refused with 400 and `UPLOAD_INVALID_PURPOSE`.")] = None,
1335
+ _request_timeout: Union[
1336
+ None,
1337
+ Annotated[StrictFloat, Field(gt=0)],
1338
+ Tuple[
1339
+ Annotated[StrictFloat, Field(gt=0)],
1340
+ Annotated[StrictFloat, Field(gt=0)]
1341
+ ]
1342
+ ] = None,
1343
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1344
+ _content_type: Optional[StrictStr] = None,
1345
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1346
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1347
+ ) -> RESTResponseType:
1348
+ """Upload a file
1349
+
1350
+ Stores one file for the account and returns its public address. This is how a user's own images, video and PDFs reach a widget's content. Send a `multipart/form-data` request with the file in the field named `file`. The file counts against the storage of the workspace it is uploaded in, and a full workspace is refused with 413 and `QUOTA_STORAGE_EXCEEDED`. For a person signed in on widgetic.com that is the workspace they are currently working in: inside a team, the team's shared storage; inside their own workspace, their own allowance. An organization API key, and a Shopify store's session, always work in that team's shared storage. A personal API key or an SDK token always uses the account's own allowance. The two never add up and one never lends room to the other. A file over the size limit is refused with 413 and `UPLOAD_TOO_LARGE`, and a type that is not accepted with 415 and `UPLOAD_UNSUPPORTED_TYPE`; `uploadsLimitsGet` lists the size limit and the accepted types. A file is judged by what is in it, not by the type it is sent as. A file that is not the type it claims (a web page sent as `image/png`) is refused with 415 and `UPLOAD_UNSUPPORTED_TYPE`, and a picture sent under the wrong picture type is stored under the type it really is, which `mime_type` in the answer says. An SVG is rewritten as it is stored: script, `foreignObject`, animation and references to other addresses are taken out, it must be UTF-8 and at most 2 MB, and the stored file can be larger or smaller than the one sent. Anything that is not an image, audio or video (a PDF, for example) is served as a download rather than shown in a page. When the full storage is a Shopify store's team's, extra storage cannot be added through Shopify yet, so the message ends by saying so and what to do instead: delete files, or contact support. On a Solo plan it names the Teams plan (which holds more) and `error.details.planPageUrl` is the address of the plan page on Shopify. `error.suggestedAction` says the same in a few words, instead of the usual \"upgrade your storage plan\". Any other team, and a person's own workspace, get the shorter message. To upload the file for one of your managed users, send `managedUserId` (Widgetic's id for the user) or `managedUserExternalId` (your own identifier for the user), not both. The file stays in your account and counts against its allowance; the tag lets you list one user's files with `uploadsGet`. The managed user must be yours and active: one that is not yours, or does not exist, is refused with 404 and `MANAGED_USER_NOT_FOUND`, and one that is switched off with 409 and `MANAGED_USER_INACTIVE`, before the file is stored. The tag is set here and does not change afterwards. Called with an editor session (`createManagedUserEditorSession`), the file is always filed for the session's own managed user and is always media for widget content: naming another managed user is refused with 403 and `MANAGED_USER_SESSION_MISMATCH`, and `contextType`, `source`, `widgetId` and `conversationId` are ignored. A full storage allowance is refused with the same 413 and `QUOTA_STORAGE_EXCEEDED`, but the message only says that it is not available right now (not how much is stored: that is the partner's business) and `error.details.limit` is `storage`. An account that administers a partner with a storage destination (`setPartnerStorageDestination`) has its files stored in the partner's own bucket instead. Such a file takes none of the allowance, its `url` is served from the partner's public address, and its `storage_key` is the key in the partner's bucket. The file is never stored with Widgetic instead: when the destination cannot be used the upload is refused with 503 and `STORAGE_DESTINATION_UNAVAILABLE`, and when the partner's storage rejects the file with 502 and `STORAGE_DESTINATION_WRITE_FAILED`. Partner storage is not optional, and it does not depend on how the file arrives. A partner's own uploads (with its API key, an SDK token, or from the Widgetic website, the resumable route and the media library alike) and the uploads of its customers' editor sessions are kept in the partner's own storage or not at all, so a partner with no destination (or one that removed it after the session was made) has them refused with 409 and `PARTNER_STORAGE_REQUIRED`; they are never stored with Widgetic. An editor session's browser is only told that the feature is not available right now.
1351
+
1352
+ :param file: The file to store (required)
1353
+ :type file: bytearray
1354
+ :param context_type: What the file is for. Send `content-property` for media that becomes widget content (images, video and PDF); the other values are used by Widgetic's own editor.
1355
+ :type context_type: str
1356
+ :param source: Which part of the product, or which client, the file comes from
1357
+ :type source: str
1358
+ :param managed_user_id: Upload the file for one of your managed users, by Widgetic's id for the user. Send this or `managedUserExternalId`, not both.
1359
+ :type managed_user_id: str
1360
+ :param managed_user_external_id: The same, by your own identifier for the user, the `externalId` you gave when you created the managed user. Send this or `managedUserId`, not both.
1361
+ :type managed_user_external_id: str
1362
+ :param purpose: Where in your product you use the file. It is kept with the file, so that a customer's storage can be counted by purpose (`getManagedUserStorageUsage`). Optional; any other value is refused with 400 and `UPLOAD_INVALID_PURPOSE`.
1363
+ :type purpose: str
1364
+ :param _request_timeout: timeout setting for this request. If one
1365
+ number provided, it will be total request
1366
+ timeout. It can also be a pair (tuple) of
1367
+ (connection, read) timeouts.
1368
+ :type _request_timeout: int, tuple(int, int), optional
1369
+ :param _request_auth: set to override the auth_settings for an a single
1370
+ request; this effectively ignores the
1371
+ authentication in the spec for a single request.
1372
+ :type _request_auth: dict, optional
1373
+ :param _content_type: force content-type for the request.
1374
+ :type _content_type: str, Optional
1375
+ :param _headers: set to override the headers for a single
1376
+ request; this effectively ignores the headers
1377
+ in the spec for a single request.
1378
+ :type _headers: dict, optional
1379
+ :param _host_index: set to override the host_index for a single
1380
+ request; this effectively ignores the host_index
1381
+ in the spec for a single request.
1382
+ :type _host_index: int, optional
1383
+ :return: Returns the result object.
1384
+ """ # noqa: E501
1385
+
1386
+ _param = self._uploads_post_0_serialize(
1387
+ file=file,
1388
+ context_type=context_type,
1389
+ source=source,
1390
+ managed_user_id=managed_user_id,
1391
+ managed_user_external_id=managed_user_external_id,
1392
+ purpose=purpose,
1393
+ _request_auth=_request_auth,
1394
+ _content_type=_content_type,
1395
+ _headers=_headers,
1396
+ _host_index=_host_index
1397
+ )
1398
+
1399
+ _response_types_map: Dict[str, Optional[str]] = {
1400
+ '200': "UploadResponse",
1401
+ '400': "ErrorResponse",
1402
+ '401': "ErrorResponse",
1403
+ '403': "ErrorResponse",
1404
+ '404': "ErrorResponse",
1405
+ '409': "ErrorResponse",
1406
+ '413': "ErrorResponse",
1407
+ '415': "ErrorResponse",
1408
+ '502': "ErrorResponse",
1409
+ '503': "ErrorResponse",
1410
+ }
1411
+ response_data = self.api_client.call_api(
1412
+ *_param,
1413
+ _request_timeout=_request_timeout
1414
+ )
1415
+ return response_data.response
1416
+
1417
+
1418
+ def _uploads_post_0_serialize(
1419
+ self,
1420
+ file,
1421
+ context_type,
1422
+ source,
1423
+ managed_user_id,
1424
+ managed_user_external_id,
1425
+ purpose,
1426
+ _request_auth,
1427
+ _content_type,
1428
+ _headers,
1429
+ _host_index,
1430
+ ) -> RequestSerialized:
1431
+
1432
+ _host = None
1433
+
1434
+ _collection_formats: Dict[str, str] = {
1435
+ }
1436
+
1437
+ _path_params: Dict[str, str] = {}
1438
+ _query_params: List[Tuple[str, str]] = []
1439
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1440
+ _form_params: List[Tuple[str, str]] = []
1441
+ _files: Dict[
1442
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1443
+ ] = {}
1444
+ _body_params: Optional[bytes] = None
1445
+
1446
+ # process the path parameters
1447
+ # process the query parameters
1448
+ # process the header parameters
1449
+ # process the form parameters
1450
+ if file is not None:
1451
+ _files['file'] = file
1452
+ if context_type is not None:
1453
+ _form_params.append(('contextType', context_type))
1454
+ if source is not None:
1455
+ _form_params.append(('source', source))
1456
+ if managed_user_id is not None:
1457
+ _form_params.append(('managedUserId', managed_user_id))
1458
+ if managed_user_external_id is not None:
1459
+ _form_params.append(('managedUserExternalId', managed_user_external_id))
1460
+ if purpose is not None:
1461
+ _form_params.append(('purpose', purpose))
1462
+ # process the body parameter
1463
+
1464
+
1465
+ # set the HTTP header `Accept`
1466
+ if 'Accept' not in _header_params:
1467
+ _header_params['Accept'] = self.api_client.select_header_accept(
1468
+ [
1469
+ 'application/json'
1470
+ ]
1471
+ )
1472
+
1473
+ # set the HTTP header `Content-Type`
1474
+ if _content_type:
1475
+ _header_params['Content-Type'] = _content_type
1476
+ else:
1477
+ _default_content_type = (
1478
+ self.api_client.select_header_content_type(
1479
+ [
1480
+ 'multipart/form-data'
1481
+ ]
1482
+ )
1483
+ )
1484
+ if _default_content_type is not None:
1485
+ _header_params['Content-Type'] = _default_content_type
1486
+
1487
+ # authentication setting
1488
+ _auth_settings: List[str] = [
1489
+ 'apiKeyAuth'
1490
+ ]
1491
+
1492
+ return self.api_client.param_serialize(
1493
+ method='POST',
1494
+ resource_path='/uploads',
1495
+ path_params=_path_params,
1496
+ query_params=_query_params,
1497
+ header_params=_header_params,
1498
+ body=_body_params,
1499
+ post_params=_form_params,
1500
+ files=_files,
1501
+ auth_settings=_auth_settings,
1502
+ collection_formats=_collection_formats,
1503
+ _host=_host,
1504
+ _request_auth=_request_auth
1505
+ )
1506
+
1507
+