appwrite-console 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (552) hide show
  1. appwrite_console/__init__.py +1 -0
  2. appwrite_console/client.py +371 -0
  3. appwrite_console/encoders/__init__.py +1 -0
  4. appwrite_console/encoders/value_class_encoder.py +373 -0
  5. appwrite_console/enums/__init__.py +1 -0
  6. appwrite_console/enums/account_key_scopes.py +6 -0
  7. appwrite_console/enums/adapter.py +5 -0
  8. appwrite_console/enums/addon.py +7 -0
  9. appwrite_console/enums/appwrite_migration_resource.py +42 -0
  10. appwrite_console/enums/attribute_status.py +8 -0
  11. appwrite_console/enums/authentication_factor.py +7 -0
  12. appwrite_console/enums/authenticator_type.py +4 -0
  13. appwrite_console/enums/backup_services.py +10 -0
  14. appwrite_console/enums/billing_plan_group.py +6 -0
  15. appwrite_console/enums/block_mode.py +5 -0
  16. appwrite_console/enums/block_resource_type.py +12 -0
  17. appwrite_console/enums/browser.py +17 -0
  18. appwrite_console/enums/browser_permission.py +23 -0
  19. appwrite_console/enums/browser_theme.py +5 -0
  20. appwrite_console/enums/build_runtime.py +95 -0
  21. appwrite_console/enums/cache_database.py +6 -0
  22. appwrite_console/enums/cache_target.py +9 -0
  23. appwrite_console/enums/column_status.py +8 -0
  24. appwrite_console/enums/compression.py +6 -0
  25. appwrite_console/enums/console_resource_type.py +4 -0
  26. appwrite_console/enums/credit_card.py +20 -0
  27. appwrite_console/enums/database_status.py +17 -0
  28. appwrite_console/enums/database_type.py +10 -0
  29. appwrite_console/enums/databases_index_type.py +7 -0
  30. appwrite_console/enums/deployment_download_type.py +5 -0
  31. appwrite_console/enums/deployment_status.py +9 -0
  32. appwrite_console/enums/detection_framework_type.py +4 -0
  33. appwrite_console/enums/detection_runtime_type.py +4 -0
  34. appwrite_console/enums/documents_db_index_type.py +6 -0
  35. appwrite_console/enums/domain_purchase_status.py +7 -0
  36. appwrite_console/enums/domain_registration_type.py +7 -0
  37. appwrite_console/enums/domain_suggestion_type.py +5 -0
  38. appwrite_console/enums/domain_transfer_status_enum.py +11 -0
  39. appwrite_console/enums/embedding_model.py +7 -0
  40. appwrite_console/enums/execution_method.py +10 -0
  41. appwrite_console/enums/execution_status.py +8 -0
  42. appwrite_console/enums/execution_trigger.py +6 -0
  43. appwrite_console/enums/firebase_migration_resource.py +13 -0
  44. appwrite_console/enums/flag.py +198 -0
  45. appwrite_console/enums/framework.py +18 -0
  46. appwrite_console/enums/function_template_use_case.py +10 -0
  47. appwrite_console/enums/image_format.py +10 -0
  48. appwrite_console/enums/image_gravity.py +12 -0
  49. appwrite_console/enums/index_status.py +8 -0
  50. appwrite_console/enums/message_priority.py +5 -0
  51. appwrite_console/enums/message_status.py +8 -0
  52. appwrite_console/enums/messaging_provider_type.py +6 -0
  53. appwrite_console/enums/n_host_migration_resource.py +14 -0
  54. appwrite_console/enums/o_auth2_google_prompt.py +6 -0
  55. appwrite_console/enums/o_auth2_oidc_prompt.py +7 -0
  56. appwrite_console/enums/o_auth_provider.py +47 -0
  57. appwrite_console/enums/on_duplicate.py +6 -0
  58. appwrite_console/enums/order_by.py +5 -0
  59. appwrite_console/enums/organization_key_scopes.py +19 -0
  60. appwrite_console/enums/password_hash.py +14 -0
  61. appwrite_console/enums/platform.py +5 -0
  62. appwrite_console/enums/platform_type.py +8 -0
  63. appwrite_console/enums/project_auth_method_id.py +10 -0
  64. appwrite_console/enums/project_email_template_id.py +10 -0
  65. appwrite_console/enums/project_email_template_locale.py +134 -0
  66. appwrite_console/enums/project_key_scopes.py +107 -0
  67. appwrite_console/enums/project_o_auth2_google_prompt.py +6 -0
  68. appwrite_console/enums/project_o_auth2_oidc_prompt.py +7 -0
  69. appwrite_console/enums/project_o_auth_provider_id.py +47 -0
  70. appwrite_console/enums/project_policy_id.py +17 -0
  71. appwrite_console/enums/project_protocol_id.py +6 -0
  72. appwrite_console/enums/project_service_id.py +22 -0
  73. appwrite_console/enums/project_smtp_secure.py +5 -0
  74. appwrite_console/enums/project_usage_range.py +5 -0
  75. appwrite_console/enums/proxy_resource_type.py +5 -0
  76. appwrite_console/enums/proxy_rule_deployment_resource_type.py +5 -0
  77. appwrite_console/enums/proxy_rule_status.py +6 -0
  78. appwrite_console/enums/query_suggestion_resource.py +97 -0
  79. appwrite_console/enums/region.py +9 -0
  80. appwrite_console/enums/relation_mutate.py +6 -0
  81. appwrite_console/enums/relationship_type.py +7 -0
  82. appwrite_console/enums/runtime.py +95 -0
  83. appwrite_console/enums/schedule_resource_type.py +7 -0
  84. appwrite_console/enums/site_template_use_case.py +12 -0
  85. appwrite_console/enums/smtp_encryption.py +6 -0
  86. appwrite_console/enums/status.py +4 -0
  87. appwrite_console/enums/status_code.py +7 -0
  88. appwrite_console/enums/supabase_migration_resource.py +14 -0
  89. appwrite_console/enums/tables_db_index_type.py +7 -0
  90. appwrite_console/enums/template_reference_type.py +6 -0
  91. appwrite_console/enums/timezone.py +422 -0
  92. appwrite_console/enums/usage_range.py +6 -0
  93. appwrite_console/enums/vcs_detection_type.py +5 -0
  94. appwrite_console/enums/vcs_reference_type.py +6 -0
  95. appwrite_console/enums/vectors_db_index_type.py +9 -0
  96. appwrite_console/enums/waf_rule_action.py +8 -0
  97. appwrite_console/exception.py +7 -0
  98. appwrite_console/id.py +26 -0
  99. appwrite_console/input_file.py +21 -0
  100. appwrite_console/models/__init__.py +803 -0
  101. appwrite_console/models/activity_event.py +99 -0
  102. appwrite_console/models/activity_event_list.py +19 -0
  103. appwrite_console/models/additional_resource.py +30 -0
  104. appwrite_console/models/addon.py +42 -0
  105. appwrite_console/models/addon_list.py +19 -0
  106. appwrite_console/models/addon_price.py +36 -0
  107. appwrite_console/models/aggregation_breakdown.py +28 -0
  108. appwrite_console/models/aggregation_team.py +101 -0
  109. appwrite_console/models/aggregation_team_list.py +19 -0
  110. appwrite_console/models/algo_argon2.py +24 -0
  111. appwrite_console/models/algo_bcrypt.py +15 -0
  112. appwrite_console/models/algo_md5.py +15 -0
  113. appwrite_console/models/algo_phpass.py +15 -0
  114. appwrite_console/models/algo_scrypt.py +27 -0
  115. appwrite_console/models/algo_scrypt_modified.py +24 -0
  116. appwrite_console/models/algo_sha.py +15 -0
  117. appwrite_console/models/app.py +91 -0
  118. appwrite_console/models/app_installation.py +42 -0
  119. appwrite_console/models/app_installation_list.py +19 -0
  120. appwrite_console/models/app_key.py +39 -0
  121. appwrite_console/models/app_key_list.py +19 -0
  122. appwrite_console/models/app_scope.py +27 -0
  123. appwrite_console/models/app_scope_list.py +19 -0
  124. appwrite_console/models/app_secret.py +39 -0
  125. appwrite_console/models/app_secret_list.py +19 -0
  126. appwrite_console/models/app_secret_plaintext.py +39 -0
  127. appwrite_console/models/apps_list.py +19 -0
  128. appwrite_console/models/attribute_bigint.py +46 -0
  129. appwrite_console/models/attribute_boolean.py +40 -0
  130. appwrite_console/models/attribute_datetime.py +43 -0
  131. appwrite_console/models/attribute_email.py +43 -0
  132. appwrite_console/models/attribute_enum.py +46 -0
  133. appwrite_console/models/attribute_float.py +46 -0
  134. appwrite_console/models/attribute_integer.py +46 -0
  135. appwrite_console/models/attribute_ip.py +43 -0
  136. appwrite_console/models/attribute_line.py +40 -0
  137. appwrite_console/models/attribute_list.py +36 -0
  138. appwrite_console/models/attribute_longtext.py +43 -0
  139. appwrite_console/models/attribute_mediumtext.py +43 -0
  140. appwrite_console/models/attribute_object.py +37 -0
  141. appwrite_console/models/attribute_point.py +40 -0
  142. appwrite_console/models/attribute_polygon.py +40 -0
  143. appwrite_console/models/attribute_relationship.py +55 -0
  144. appwrite_console/models/attribute_string.py +46 -0
  145. appwrite_console/models/attribute_text.py +43 -0
  146. appwrite_console/models/attribute_url.py +43 -0
  147. appwrite_console/models/attribute_varchar.py +46 -0
  148. appwrite_console/models/attribute_vector.py +40 -0
  149. appwrite_console/models/backup_archive.py +48 -0
  150. appwrite_console/models/backup_archive_list.py +19 -0
  151. appwrite_console/models/backup_policy.py +48 -0
  152. appwrite_console/models/backup_policy_list.py +19 -0
  153. appwrite_console/models/backup_restoration.py +45 -0
  154. appwrite_console/models/backup_restoration_list.py +19 -0
  155. appwrite_console/models/base_model.py +27 -0
  156. appwrite_console/models/billing_address.py +36 -0
  157. appwrite_console/models/billing_address_list.py +19 -0
  158. appwrite_console/models/billing_limits.py +36 -0
  159. appwrite_console/models/billing_plan.py +226 -0
  160. appwrite_console/models/billing_plan_addon.py +19 -0
  161. appwrite_console/models/billing_plan_addon_details.py +36 -0
  162. appwrite_console/models/billing_plan_dedicated_database_limits.py +69 -0
  163. appwrite_console/models/billing_plan_limits.py +18 -0
  164. appwrite_console/models/billing_plan_list.py +19 -0
  165. appwrite_console/models/billing_plan_supported_addons.py +21 -0
  166. appwrite_console/models/block.py +45 -0
  167. appwrite_console/models/block_delete.py +19 -0
  168. appwrite_console/models/block_list.py +19 -0
  169. appwrite_console/models/branch.py +15 -0
  170. appwrite_console/models/branch_list.py +19 -0
  171. appwrite_console/models/bucket.py +54 -0
  172. appwrite_console/models/bucket_list.py +19 -0
  173. appwrite_console/models/campaign.py +49 -0
  174. appwrite_console/models/collection.py +67 -0
  175. appwrite_console/models/collection_list.py +19 -0
  176. appwrite_console/models/column_bigint.py +46 -0
  177. appwrite_console/models/column_boolean.py +40 -0
  178. appwrite_console/models/column_datetime.py +43 -0
  179. appwrite_console/models/column_email.py +43 -0
  180. appwrite_console/models/column_enum.py +46 -0
  181. appwrite_console/models/column_float.py +46 -0
  182. appwrite_console/models/column_index.py +42 -0
  183. appwrite_console/models/column_index_list.py +19 -0
  184. appwrite_console/models/column_integer.py +46 -0
  185. appwrite_console/models/column_ip.py +43 -0
  186. appwrite_console/models/column_line.py +40 -0
  187. appwrite_console/models/column_list.py +36 -0
  188. appwrite_console/models/column_longtext.py +43 -0
  189. appwrite_console/models/column_mediumtext.py +43 -0
  190. appwrite_console/models/column_point.py +40 -0
  191. appwrite_console/models/column_polygon.py +40 -0
  192. appwrite_console/models/column_relationship.py +55 -0
  193. appwrite_console/models/column_string.py +46 -0
  194. appwrite_console/models/column_text.py +43 -0
  195. appwrite_console/models/column_url.py +43 -0
  196. appwrite_console/models/column_varchar.py +46 -0
  197. appwrite_console/models/console_key_scope.py +24 -0
  198. appwrite_console/models/console_key_scope_list.py +19 -0
  199. appwrite_console/models/console_o_auth2_provider.py +19 -0
  200. appwrite_console/models/console_o_auth2_provider_list.py +19 -0
  201. appwrite_console/models/console_o_auth2_provider_parameter.py +24 -0
  202. appwrite_console/models/console_region.py +30 -0
  203. appwrite_console/models/console_region_list.py +19 -0
  204. appwrite_console/models/console_variables.py +96 -0
  205. appwrite_console/models/continent.py +18 -0
  206. appwrite_console/models/continent_list.py +19 -0
  207. appwrite_console/models/country.py +18 -0
  208. appwrite_console/models/country_list.py +19 -0
  209. appwrite_console/models/coupon.py +36 -0
  210. appwrite_console/models/credit.py +45 -0
  211. appwrite_console/models/credit_available.py +15 -0
  212. appwrite_console/models/credit_list.py +22 -0
  213. appwrite_console/models/currency.py +33 -0
  214. appwrite_console/models/currency_list.py +19 -0
  215. appwrite_console/models/database.py +52 -0
  216. appwrite_console/models/database_list.py +19 -0
  217. appwrite_console/models/database_migration.py +57 -0
  218. appwrite_console/models/database_migration_list.py +19 -0
  219. appwrite_console/models/database_status.py +57 -0
  220. appwrite_console/models/database_status_connections.py +18 -0
  221. appwrite_console/models/database_status_replica.py +24 -0
  222. appwrite_console/models/database_status_volume.py +24 -0
  223. appwrite_console/models/dedicated_database.py +159 -0
  224. appwrite_console/models/dedicated_database_backup.py +63 -0
  225. appwrite_console/models/dedicated_database_backup_list.py +19 -0
  226. appwrite_console/models/dedicated_database_backup_storage.py +27 -0
  227. appwrite_console/models/dedicated_database_branch.py +48 -0
  228. appwrite_console/models/dedicated_database_branch_list.py +16 -0
  229. appwrite_console/models/dedicated_database_execution.py +31 -0
  230. appwrite_console/models/dedicated_database_execution_column.py +18 -0
  231. appwrite_console/models/dedicated_database_extensions.py +22 -0
  232. appwrite_console/models/dedicated_database_list.py +19 -0
  233. appwrite_console/models/dedicated_database_member.py +24 -0
  234. appwrite_console/models/dedicated_database_operation.py +45 -0
  235. appwrite_console/models/dedicated_database_operation_list.py +19 -0
  236. appwrite_console/models/dedicated_database_pitr_windows.py +18 -0
  237. appwrite_console/models/dedicated_database_pooler.py +42 -0
  238. appwrite_console/models/dedicated_database_replicas.py +37 -0
  239. appwrite_console/models/dedicated_database_restoration.py +45 -0
  240. appwrite_console/models/dedicated_database_restoration_list.py +19 -0
  241. appwrite_console/models/dedicated_database_specification.py +39 -0
  242. appwrite_console/models/dedicated_database_specification_list.py +23 -0
  243. appwrite_console/models/dedicated_database_specification_pricing.py +27 -0
  244. appwrite_console/models/deployment.py +94 -0
  245. appwrite_console/models/deployment_list.py +19 -0
  246. appwrite_console/models/detection_framework.py +32 -0
  247. appwrite_console/models/detection_runtime.py +29 -0
  248. appwrite_console/models/detection_variable.py +18 -0
  249. appwrite_console/models/dev_key.py +36 -0
  250. appwrite_console/models/dev_key_list.py +19 -0
  251. appwrite_console/models/dns_record.py +48 -0
  252. appwrite_console/models/dns_records_list.py +19 -0
  253. appwrite_console/models/document.py +80 -0
  254. appwrite_console/models/document_list.py +32 -0
  255. appwrite_console/models/domain.py +53 -0
  256. appwrite_console/models/domain_price.py +30 -0
  257. appwrite_console/models/domain_purchase.py +43 -0
  258. appwrite_console/models/domain_suggestion.py +24 -0
  259. appwrite_console/models/domain_suggestions_list.py +19 -0
  260. appwrite_console/models/domain_transfer_out.py +15 -0
  261. appwrite_console/models/domain_transfer_status.py +22 -0
  262. appwrite_console/models/domains_list.py +19 -0
  263. appwrite_console/models/downgrade_feedback.py +42 -0
  264. appwrite_console/models/email_template.py +36 -0
  265. appwrite_console/models/email_template_list.py +19 -0
  266. appwrite_console/models/embedding.py +24 -0
  267. appwrite_console/models/embedding_list.py +19 -0
  268. appwrite_console/models/ephemeral_key.py +39 -0
  269. appwrite_console/models/estimation.py +37 -0
  270. appwrite_console/models/estimation_delete_organization.py +16 -0
  271. appwrite_console/models/estimation_item.py +18 -0
  272. appwrite_console/models/estimation_plan_change.py +29 -0
  273. appwrite_console/models/estimation_update_plan.py +40 -0
  274. appwrite_console/models/execution.py +69 -0
  275. appwrite_console/models/execution_list.py +19 -0
  276. appwrite_console/models/file.py +60 -0
  277. appwrite_console/models/file_list.py +19 -0
  278. appwrite_console/models/framework.py +28 -0
  279. appwrite_console/models/framework_adapter.py +27 -0
  280. appwrite_console/models/framework_list.py +19 -0
  281. appwrite_console/models/function.py +109 -0
  282. appwrite_console/models/function_list.py +19 -0
  283. appwrite_console/models/headers.py +18 -0
  284. appwrite_console/models/identity.py +42 -0
  285. appwrite_console/models/identity_list.py +19 -0
  286. appwrite_console/models/index.py +43 -0
  287. appwrite_console/models/index_list.py +19 -0
  288. appwrite_console/models/insight.py +64 -0
  289. appwrite_console/models/insight_cta.py +24 -0
  290. appwrite_console/models/insight_list.py +19 -0
  291. appwrite_console/models/installation.py +30 -0
  292. appwrite_console/models/installation_list.py +19 -0
  293. appwrite_console/models/invoice.py +82 -0
  294. appwrite_console/models/invoice_list.py +19 -0
  295. appwrite_console/models/jwt.py +15 -0
  296. appwrite_console/models/key.py +39 -0
  297. appwrite_console/models/key_list.py +19 -0
  298. appwrite_console/models/language.py +21 -0
  299. appwrite_console/models/language_list.py +19 -0
  300. appwrite_console/models/locale.py +66 -0
  301. appwrite_console/models/locale_code.py +18 -0
  302. appwrite_console/models/locale_code_list.py +19 -0
  303. appwrite_console/models/log.py +78 -0
  304. appwrite_console/models/log_list.py +19 -0
  305. appwrite_console/models/membership.py +57 -0
  306. appwrite_console/models/membership_list.py +19 -0
  307. appwrite_console/models/message.py +52 -0
  308. appwrite_console/models/message_list.py +19 -0
  309. appwrite_console/models/metric.py +18 -0
  310. appwrite_console/models/metric_breakdown.py +24 -0
  311. appwrite_console/models/mfa_challenge.py +24 -0
  312. appwrite_console/models/mfa_factors.py +24 -0
  313. appwrite_console/models/mfa_recovery_codes.py +15 -0
  314. appwrite_console/models/mfa_type.py +18 -0
  315. appwrite_console/models/migration.py +75 -0
  316. appwrite_console/models/migration_list.py +19 -0
  317. appwrite_console/models/migration_report.py +96 -0
  318. appwrite_console/models/mock_number.py +24 -0
  319. appwrite_console/models/mock_number_list.py +19 -0
  320. appwrite_console/models/notification.py +60 -0
  321. appwrite_console/models/notification_list.py +19 -0
  322. appwrite_console/models/o_auth2_amazon.py +24 -0
  323. appwrite_console/models/o_auth2_apple.py +30 -0
  324. appwrite_console/models/o_auth2_appwrite.py +24 -0
  325. appwrite_console/models/o_auth2_auth0.py +27 -0
  326. appwrite_console/models/o_auth2_authentik.py +27 -0
  327. appwrite_console/models/o_auth2_autodesk.py +24 -0
  328. appwrite_console/models/o_auth2_bitbucket.py +24 -0
  329. appwrite_console/models/o_auth2_bitly.py +24 -0
  330. appwrite_console/models/o_auth2_box.py +24 -0
  331. appwrite_console/models/o_auth2_dailymotion.py +24 -0
  332. appwrite_console/models/o_auth2_discord.py +24 -0
  333. appwrite_console/models/o_auth2_disqus.py +24 -0
  334. appwrite_console/models/o_auth2_dropbox.py +24 -0
  335. appwrite_console/models/o_auth2_etsy.py +24 -0
  336. appwrite_console/models/o_auth2_facebook.py +24 -0
  337. appwrite_console/models/o_auth2_figma.py +24 -0
  338. appwrite_console/models/o_auth2_fusion_auth.py +27 -0
  339. appwrite_console/models/o_auth2_github.py +24 -0
  340. appwrite_console/models/o_auth2_gitlab.py +27 -0
  341. appwrite_console/models/o_auth2_google.py +28 -0
  342. appwrite_console/models/o_auth2_keycloak.py +30 -0
  343. appwrite_console/models/o_auth2_kick.py +24 -0
  344. appwrite_console/models/o_auth2_linkedin.py +24 -0
  345. appwrite_console/models/o_auth2_microsoft.py +27 -0
  346. appwrite_console/models/o_auth2_notion.py +24 -0
  347. appwrite_console/models/o_auth2_oidc.py +43 -0
  348. appwrite_console/models/o_auth2_okta.py +30 -0
  349. appwrite_console/models/o_auth2_paypal.py +24 -0
  350. appwrite_console/models/o_auth2_podio.py +24 -0
  351. appwrite_console/models/o_auth2_provider_list.py +59 -0
  352. appwrite_console/models/o_auth2_salesforce.py +24 -0
  353. appwrite_console/models/o_auth2_slack.py +24 -0
  354. appwrite_console/models/o_auth2_spotify.py +24 -0
  355. appwrite_console/models/o_auth2_stripe.py +24 -0
  356. appwrite_console/models/o_auth2_tradeshift.py +24 -0
  357. appwrite_console/models/o_auth2_twitch.py +24 -0
  358. appwrite_console/models/o_auth2_word_press.py +24 -0
  359. appwrite_console/models/o_auth2_x.py +24 -0
  360. appwrite_console/models/o_auth2_yahoo.py +24 -0
  361. appwrite_console/models/o_auth2_yandex.py +24 -0
  362. appwrite_console/models/o_auth2_zoho.py +24 -0
  363. appwrite_console/models/o_auth2_zoom.py +24 -0
  364. appwrite_console/models/oauth2_approve.py +15 -0
  365. appwrite_console/models/oauth2_authorize.py +18 -0
  366. appwrite_console/models/oauth2_consent.py +42 -0
  367. appwrite_console/models/oauth2_consent_list.py +19 -0
  368. appwrite_console/models/oauth2_consent_token.py +45 -0
  369. appwrite_console/models/oauth2_consent_token_list.py +19 -0
  370. appwrite_console/models/oauth2_device_authorization.py +30 -0
  371. appwrite_console/models/oauth2_grant.py +48 -0
  372. appwrite_console/models/oauth2_organization.py +15 -0
  373. appwrite_console/models/oauth2_organization_list.py +19 -0
  374. appwrite_console/models/oauth2_par.py +18 -0
  375. appwrite_console/models/oauth2_project.py +21 -0
  376. appwrite_console/models/oauth2_project_list.py +19 -0
  377. appwrite_console/models/oauth2_reject.py +15 -0
  378. appwrite_console/models/oauth2_token.py +33 -0
  379. appwrite_console/models/organization.py +132 -0
  380. appwrite_console/models/organization_list.py +32 -0
  381. appwrite_console/models/payment_authentication.py +30 -0
  382. appwrite_console/models/payment_method.py +72 -0
  383. appwrite_console/models/payment_method_list.py +19 -0
  384. appwrite_console/models/phone.py +21 -0
  385. appwrite_console/models/phone_list.py +19 -0
  386. appwrite_console/models/plan_change_estimation_details.py +39 -0
  387. appwrite_console/models/plan_change_limits.py +28 -0
  388. appwrite_console/models/plan_change_project_compliance.py +28 -0
  389. appwrite_console/models/plan_change_resource_compliance.py +30 -0
  390. appwrite_console/models/platform_android.py +31 -0
  391. appwrite_console/models/platform_apple.py +31 -0
  392. appwrite_console/models/platform_linux.py +31 -0
  393. appwrite_console/models/platform_list.py +23 -0
  394. appwrite_console/models/platform_web.py +31 -0
  395. appwrite_console/models/platform_windows.py +31 -0
  396. appwrite_console/models/policy_deny_aliased_email.py +18 -0
  397. appwrite_console/models/policy_deny_corporate_email.py +18 -0
  398. appwrite_console/models/policy_deny_disposable_email.py +18 -0
  399. appwrite_console/models/policy_deny_free_email.py +18 -0
  400. appwrite_console/models/policy_list.py +32 -0
  401. appwrite_console/models/policy_membership_privacy.py +33 -0
  402. appwrite_console/models/policy_password_dictionary.py +18 -0
  403. appwrite_console/models/policy_password_history.py +18 -0
  404. appwrite_console/models/policy_password_personal_data.py +18 -0
  405. appwrite_console/models/policy_password_strength.py +30 -0
  406. appwrite_console/models/policy_session_alert.py +18 -0
  407. appwrite_console/models/policy_session_duration.py +18 -0
  408. appwrite_console/models/policy_session_invalidation.py +18 -0
  409. appwrite_console/models/policy_session_limit.py +18 -0
  410. appwrite_console/models/policy_user_limit.py +18 -0
  411. appwrite_console/models/postgres_extension.py +24 -0
  412. appwrite_console/models/postgres_extension_list.py +19 -0
  413. appwrite_console/models/preferences.py +52 -0
  414. appwrite_console/models/presence.py +39 -0
  415. appwrite_console/models/presence_list.py +19 -0
  416. appwrite_console/models/program.py +39 -0
  417. appwrite_console/models/project.py +153 -0
  418. appwrite_console/models/project_auth_method.py +19 -0
  419. appwrite_console/models/project_list.py +19 -0
  420. appwrite_console/models/project_protocol.py +19 -0
  421. appwrite_console/models/project_service.py +19 -0
  422. appwrite_console/models/provider.py +39 -0
  423. appwrite_console/models/provider_list.py +19 -0
  424. appwrite_console/models/provider_repository.py +42 -0
  425. appwrite_console/models/provider_repository_framework.py +45 -0
  426. appwrite_console/models/provider_repository_framework_list.py +22 -0
  427. appwrite_console/models/provider_repository_runtime.py +45 -0
  428. appwrite_console/models/provider_repository_runtime_list.py +22 -0
  429. appwrite_console/models/proxy_rule.py +59 -0
  430. appwrite_console/models/proxy_rule_list.py +19 -0
  431. appwrite_console/models/report.py +49 -0
  432. appwrite_console/models/report_list.py +19 -0
  433. appwrite_console/models/resource_token.py +33 -0
  434. appwrite_console/models/resource_token_list.py +19 -0
  435. appwrite_console/models/review.py +24 -0
  436. appwrite_console/models/roles.py +18 -0
  437. appwrite_console/models/row.py +80 -0
  438. appwrite_console/models/row_list.py +32 -0
  439. appwrite_console/models/runtime.py +36 -0
  440. appwrite_console/models/runtime_list.py +19 -0
  441. appwrite_console/models/schedule.py +45 -0
  442. appwrite_console/models/schedule_list.py +19 -0
  443. appwrite_console/models/session.py +99 -0
  444. appwrite_console/models/session_list.py +19 -0
  445. appwrite_console/models/site.py +115 -0
  446. appwrite_console/models/site_list.py +19 -0
  447. appwrite_console/models/specification.py +24 -0
  448. appwrite_console/models/specification_list.py +19 -0
  449. appwrite_console/models/stage.py +27 -0
  450. appwrite_console/models/stage_list.py +16 -0
  451. appwrite_console/models/subscriber.py +40 -0
  452. appwrite_console/models/subscriber_list.py +19 -0
  453. appwrite_console/models/table.py +67 -0
  454. appwrite_console/models/table_list.py +19 -0
  455. appwrite_console/models/target.py +39 -0
  456. appwrite_console/models/target_list.py +19 -0
  457. appwrite_console/models/team.py +43 -0
  458. appwrite_console/models/team_list.py +32 -0
  459. appwrite_console/models/template_framework.py +39 -0
  460. appwrite_console/models/template_function.py +65 -0
  461. appwrite_console/models/template_function_list.py +19 -0
  462. appwrite_console/models/template_runtime.py +24 -0
  463. appwrite_console/models/template_site.py +53 -0
  464. appwrite_console/models/template_site_list.py +19 -0
  465. appwrite_console/models/template_variable.py +33 -0
  466. appwrite_console/models/token.py +30 -0
  467. appwrite_console/models/topic.py +36 -0
  468. appwrite_console/models/topic_list.py +19 -0
  469. appwrite_console/models/transaction.py +30 -0
  470. appwrite_console/models/transaction_list.py +19 -0
  471. appwrite_console/models/usage_billing_plan.py +46 -0
  472. appwrite_console/models/usage_data_point.py +99 -0
  473. appwrite_console/models/usage_event_list.py +19 -0
  474. appwrite_console/models/usage_gauge_list.py +19 -0
  475. appwrite_console/models/usage_metric.py +19 -0
  476. appwrite_console/models/usage_organization.py +104 -0
  477. appwrite_console/models/usage_organization_project.py +73 -0
  478. appwrite_console/models/usage_presence.py +22 -0
  479. appwrite_console/models/usage_project.py +218 -0
  480. appwrite_console/models/usage_resources.py +36 -0
  481. appwrite_console/models/usage_users.py +28 -0
  482. appwrite_console/models/user.py +111 -0
  483. appwrite_console/models/user_list.py +32 -0
  484. appwrite_console/models/variable.py +36 -0
  485. appwrite_console/models/variable_list.py +19 -0
  486. appwrite_console/models/vcs_content.py +21 -0
  487. appwrite_console/models/vcs_content_list.py +19 -0
  488. appwrite_console/models/vcs_namespace.py +27 -0
  489. appwrite_console/models/vcs_namespace_list.py +19 -0
  490. appwrite_console/models/vectorsdb_collection.py +54 -0
  491. appwrite_console/models/vectorsdb_collection_list.py +19 -0
  492. appwrite_console/models/waf_rule.py +55 -0
  493. appwrite_console/models/waf_rule_bypass.py +55 -0
  494. appwrite_console/models/waf_rule_challenge.py +64 -0
  495. appwrite_console/models/waf_rule_deny.py +55 -0
  496. appwrite_console/models/waf_rule_list.py +19 -0
  497. appwrite_console/models/waf_rule_rate_limit.py +64 -0
  498. appwrite_console/models/waf_rule_redirect.py +61 -0
  499. appwrite_console/models/webhook.py +51 -0
  500. appwrite_console/models/webhook_list.py +19 -0
  501. appwrite_console/operator.py +150 -0
  502. appwrite_console/permission.py +21 -0
  503. appwrite_console/query.py +293 -0
  504. appwrite_console/role.py +111 -0
  505. appwrite_console/service.py +50 -0
  506. appwrite_console/services/__init__.py +1 -0
  507. appwrite_console/services/account.py +3328 -0
  508. appwrite_console/services/activities.py +89 -0
  509. appwrite_console/services/advisor.py +234 -0
  510. appwrite_console/services/apps.py +1156 -0
  511. appwrite_console/services/assistant.py +50 -0
  512. appwrite_console/services/avatars.py +531 -0
  513. appwrite_console/services/backups.py +572 -0
  514. appwrite_console/services/console.py +807 -0
  515. appwrite_console/services/databases.py +4976 -0
  516. appwrite_console/services/documents_db.py +2052 -0
  517. appwrite_console/services/domains.py +3047 -0
  518. appwrite_console/services/functions.py +1659 -0
  519. appwrite_console/services/graphql.py +92 -0
  520. appwrite_console/services/locale.py +243 -0
  521. appwrite_console/services/manager.py +301 -0
  522. appwrite_console/services/messaging.py +3137 -0
  523. appwrite_console/services/migrations.py +1036 -0
  524. appwrite_console/services/mongo.py +1683 -0
  525. appwrite_console/services/mysql.py +1861 -0
  526. appwrite_console/services/notifications.py +98 -0
  527. appwrite_console/services/oauth2.py +914 -0
  528. appwrite_console/services/organization.py +1039 -0
  529. appwrite_console/services/organizations.py +2245 -0
  530. appwrite_console/services/postgresql.py +1995 -0
  531. appwrite_console/services/presences.py +309 -0
  532. appwrite_console/services/project.py +5271 -0
  533. appwrite_console/services/projects.py +885 -0
  534. appwrite_console/services/proxy.py +394 -0
  535. appwrite_console/services/sites.py +1593 -0
  536. appwrite_console/services/storage.py +818 -0
  537. appwrite_console/services/tables_db.py +5189 -0
  538. appwrite_console/services/teams.py +993 -0
  539. appwrite_console/services/tokens.py +243 -0
  540. appwrite_console/services/usage.py +194 -0
  541. appwrite_console/services/users.py +2314 -0
  542. appwrite_console/services/vcs.py +599 -0
  543. appwrite_console/services/vectors_db.py +2054 -0
  544. appwrite_console/services/waf.py +1014 -0
  545. appwrite_console/services/webhooks.py +344 -0
  546. appwrite_console/utils/__init__.py +1 -0
  547. appwrite_console/utils/deprecated.py +51 -0
  548. appwrite_console-0.1.0.dist-info/METADATA +189 -0
  549. appwrite_console-0.1.0.dist-info/RECORD +552 -0
  550. appwrite_console-0.1.0.dist-info/WHEEL +5 -0
  551. appwrite_console-0.1.0.dist-info/licenses/LICENSE +12 -0
  552. appwrite_console-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2054 @@
1
+ from ..service import Service
2
+ from urllib.parse import quote
3
+ from typing import Any, Dict, List, Optional, Union, Type, TypeVar
4
+ from ..exception import AppwriteException
5
+ from appwrite_console.utils.deprecated import deprecated
6
+ from ..models.database_list import DatabaseList
7
+ from ..models.database import Database
8
+ from ..enums.embedding_model import EmbeddingModel
9
+ from ..models.embedding_list import EmbeddingList
10
+ from ..models.dedicated_database_specification_list import DedicatedDatabaseSpecificationList
11
+ from ..models.transaction_list import TransactionList
12
+ from ..models.transaction import Transaction
13
+ from ..models.vectorsdb_collection_list import VectorsdbCollectionList
14
+ from ..models.vectorsdb_collection import VectorsdbCollection
15
+ from ..models.document_list import DocumentList
16
+ from ..models.document import Document
17
+ from ..models.index_list import IndexList
18
+ from ..enums.vectors_db_index_type import VectorsDBIndexType
19
+ from ..enums.order_by import OrderBy
20
+ from ..models.index import Index
21
+ from ..models.dedicated_database import DedicatedDatabase
22
+ from ..models.dedicated_database_operation_list import DedicatedDatabaseOperationList
23
+ from ..models.dedicated_database_replicas import DedicatedDatabaseReplicas
24
+ from ..models.database_status import DatabaseStatus
25
+
26
+ T = TypeVar('T')
27
+
28
+ class VectorsDB(Service):
29
+
30
+ def __init__(self, client) -> None:
31
+ super(VectorsDB, self).__init__(client)
32
+
33
+ def list(
34
+ self,
35
+ queries: Optional[List[str]] = None,
36
+ total: Optional[bool] = None
37
+ ) -> DatabaseList:
38
+ """
39
+ Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.
40
+
41
+ Parameters
42
+ ----------
43
+ queries : Optional[List[str]]
44
+ Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name
45
+ total : Optional[bool]
46
+ When set to false, the total count returned will be 0 and will not be calculated.
47
+
48
+ Returns
49
+ -------
50
+ DatabaseList
51
+ API response as a typed Pydantic model
52
+
53
+ Raises
54
+ ------
55
+ AppwriteException
56
+ If API request fails
57
+ """
58
+
59
+ api_path = '/vectorsdb'
60
+ api_params = {}
61
+
62
+ if queries is not None:
63
+ api_params['queries'] = self._normalize_value(queries)
64
+ if total is not None:
65
+ api_params['total'] = self._normalize_value(total)
66
+
67
+ response = self.client.call('get', api_path, {
68
+ 'X-Appwrite-Project': self.client.get_config('project'),
69
+ 'accept': 'application/json',
70
+ }, api_params)
71
+
72
+ return self._parse_response(response, model=DatabaseList)
73
+
74
+
75
+ def create(
76
+ self,
77
+ database_id: str,
78
+ name: str,
79
+ enabled: Optional[bool] = None,
80
+ specification: Optional[str] = None,
81
+ replicas: Optional[float] = None,
82
+ sync_mode: Optional[str] = None
83
+ ) -> Database:
84
+ """
85
+ Create a new Database.
86
+
87
+
88
+ Parameters
89
+ ----------
90
+ database_id : str
91
+ Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
92
+ name : str
93
+ Database name. Max length: 128 chars.
94
+ enabled : Optional[bool]
95
+ Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
96
+ specification : Optional[str]
97
+ Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification.
98
+ replicas : Optional[float]
99
+ Number of high availability replicas (0-5) for the dedicated database backing this database. Requires a dedicated `specification`; must be 0 for a serverless database. High availability is enabled when greater than 0.
100
+ sync_mode : Optional[str]
101
+ Replication sync mode for the dedicated database backing this database. Requires a dedicated `specification`; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum.
102
+
103
+ Returns
104
+ -------
105
+ Database
106
+ API response as a typed Pydantic model
107
+
108
+ Raises
109
+ ------
110
+ AppwriteException
111
+ If API request fails
112
+ """
113
+
114
+ api_path = '/vectorsdb'
115
+ api_params = {}
116
+ if database_id is None:
117
+ raise AppwriteException('Missing required parameter: "database_id"')
118
+
119
+ if name is None:
120
+ raise AppwriteException('Missing required parameter: "name"')
121
+
122
+
123
+ api_params['databaseId'] = self._normalize_value(database_id)
124
+ api_params['name'] = self._normalize_value(name)
125
+ if enabled is not None:
126
+ api_params['enabled'] = self._normalize_value(enabled)
127
+ if specification is not None:
128
+ api_params['specification'] = self._normalize_value(specification)
129
+ if replicas is not None:
130
+ api_params['replicas'] = self._normalize_value(replicas)
131
+ if sync_mode is not None:
132
+ api_params['syncMode'] = self._normalize_value(sync_mode)
133
+
134
+ response = self.client.call('post', api_path, {
135
+ 'X-Appwrite-Project': self.client.get_config('project'),
136
+ 'content-type': 'application/json',
137
+ 'accept': 'application/json',
138
+ }, api_params)
139
+
140
+ return self._parse_response(response, model=Database)
141
+
142
+
143
+ def create_text_embeddings(
144
+ self,
145
+ texts: List[str],
146
+ model: Optional[EmbeddingModel] = None
147
+ ) -> EmbeddingList:
148
+ """
149
+ Generate vector embeddings for an array of text using the selected embedding model. Use the returned vectors to power semantic search and similarity queries against your vector collections.
150
+
151
+
152
+ Parameters
153
+ ----------
154
+ texts : List[str]
155
+ Array of text to generate embeddings.
156
+ model : Optional[EmbeddingModel]
157
+ The embedding model to use for generating vector embeddings.
158
+
159
+ Returns
160
+ -------
161
+ EmbeddingList
162
+ API response as a typed Pydantic model
163
+
164
+ Raises
165
+ ------
166
+ AppwriteException
167
+ If API request fails
168
+ """
169
+
170
+ api_path = '/vectorsdb/embeddings/text'
171
+ api_params = {}
172
+ if texts is None:
173
+ raise AppwriteException('Missing required parameter: "texts"')
174
+
175
+
176
+ api_params['texts'] = self._normalize_value(texts)
177
+ if model is not None:
178
+ api_params['model'] = self._normalize_value(model)
179
+
180
+ response = self.client.call('post', api_path, {
181
+ 'X-Appwrite-Project': self.client.get_config('project'),
182
+ 'content-type': 'application/json',
183
+ 'accept': 'application/json',
184
+ }, api_params)
185
+
186
+ return self._parse_response(response, model=EmbeddingList)
187
+
188
+
189
+ def list_specifications(
190
+ self
191
+ ) -> DedicatedDatabaseSpecificationList:
192
+ """
193
+ List the dedicated database specifications available on the current plan. Each specification reports its resource limits, pricing, and whether it is enabled for the organization.
194
+
195
+ Returns
196
+ -------
197
+ DedicatedDatabaseSpecificationList
198
+ API response as a typed Pydantic model
199
+
200
+ Raises
201
+ ------
202
+ AppwriteException
203
+ If API request fails
204
+ """
205
+
206
+ api_path = '/vectorsdb/specifications'
207
+ api_params = {}
208
+
209
+ response = self.client.call('get', api_path, {
210
+ 'X-Appwrite-Project': self.client.get_config('project'),
211
+ 'accept': 'application/json',
212
+ }, api_params)
213
+
214
+ return self._parse_response(response, model=DedicatedDatabaseSpecificationList)
215
+
216
+
217
+ def list_transactions(
218
+ self,
219
+ queries: Optional[List[str]] = None
220
+ ) -> TransactionList:
221
+ """
222
+ List transactions across all databases.
223
+
224
+ Parameters
225
+ ----------
226
+ queries : Optional[List[str]]
227
+ Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries).
228
+
229
+ Returns
230
+ -------
231
+ TransactionList
232
+ API response as a typed Pydantic model
233
+
234
+ Raises
235
+ ------
236
+ AppwriteException
237
+ If API request fails
238
+ """
239
+
240
+ api_path = '/vectorsdb/transactions'
241
+ api_params = {}
242
+
243
+ if queries is not None:
244
+ api_params['queries'] = self._normalize_value(queries)
245
+
246
+ response = self.client.call('get', api_path, {
247
+ 'X-Appwrite-Project': self.client.get_config('project'),
248
+ 'accept': 'application/json',
249
+ }, api_params)
250
+
251
+ return self._parse_response(response, model=TransactionList)
252
+
253
+
254
+ def create_transaction(
255
+ self,
256
+ ttl: Optional[float] = None
257
+ ) -> Transaction:
258
+ """
259
+ Create a new transaction.
260
+
261
+ Parameters
262
+ ----------
263
+ ttl : Optional[float]
264
+ Seconds before the transaction expires.
265
+
266
+ Returns
267
+ -------
268
+ Transaction
269
+ API response as a typed Pydantic model
270
+
271
+ Raises
272
+ ------
273
+ AppwriteException
274
+ If API request fails
275
+ """
276
+
277
+ api_path = '/vectorsdb/transactions'
278
+ api_params = {}
279
+
280
+ if ttl is not None:
281
+ api_params['ttl'] = self._normalize_value(ttl)
282
+
283
+ response = self.client.call('post', api_path, {
284
+ 'X-Appwrite-Project': self.client.get_config('project'),
285
+ 'content-type': 'application/json',
286
+ 'accept': 'application/json',
287
+ }, api_params)
288
+
289
+ return self._parse_response(response, model=Transaction)
290
+
291
+
292
+ def get_transaction(
293
+ self,
294
+ transaction_id: str
295
+ ) -> Transaction:
296
+ """
297
+ Get a transaction by its unique ID.
298
+
299
+ Parameters
300
+ ----------
301
+ transaction_id : str
302
+ Transaction ID.
303
+
304
+ Returns
305
+ -------
306
+ Transaction
307
+ API response as a typed Pydantic model
308
+
309
+ Raises
310
+ ------
311
+ AppwriteException
312
+ If API request fails
313
+ """
314
+
315
+ api_path = '/vectorsdb/transactions/{transactionId}'
316
+ api_params = {}
317
+ if transaction_id is None:
318
+ raise AppwriteException('Missing required parameter: "transaction_id"')
319
+
320
+ api_path = api_path.replace('{transactionId}', str(self._normalize_value(transaction_id)))
321
+
322
+
323
+ response = self.client.call('get', api_path, {
324
+ 'X-Appwrite-Project': self.client.get_config('project'),
325
+ 'accept': 'application/json',
326
+ }, api_params)
327
+
328
+ return self._parse_response(response, model=Transaction)
329
+
330
+
331
+ def update_transaction(
332
+ self,
333
+ transaction_id: str,
334
+ commit: Optional[bool] = None,
335
+ rollback: Optional[bool] = None
336
+ ) -> Transaction:
337
+ """
338
+ Update a transaction, to either commit or roll back its operations.
339
+
340
+ Parameters
341
+ ----------
342
+ transaction_id : str
343
+ Transaction ID.
344
+ commit : Optional[bool]
345
+ Commit transaction?
346
+ rollback : Optional[bool]
347
+ Rollback transaction?
348
+
349
+ Returns
350
+ -------
351
+ Transaction
352
+ API response as a typed Pydantic model
353
+
354
+ Raises
355
+ ------
356
+ AppwriteException
357
+ If API request fails
358
+ """
359
+
360
+ api_path = '/vectorsdb/transactions/{transactionId}'
361
+ api_params = {}
362
+ if transaction_id is None:
363
+ raise AppwriteException('Missing required parameter: "transaction_id"')
364
+
365
+ api_path = api_path.replace('{transactionId}', str(self._normalize_value(transaction_id)))
366
+
367
+ if commit is not None:
368
+ api_params['commit'] = self._normalize_value(commit)
369
+ if rollback is not None:
370
+ api_params['rollback'] = self._normalize_value(rollback)
371
+
372
+ response = self.client.call('patch', api_path, {
373
+ 'X-Appwrite-Project': self.client.get_config('project'),
374
+ 'content-type': 'application/json',
375
+ 'accept': 'application/json',
376
+ }, api_params)
377
+
378
+ return self._parse_response(response, model=Transaction)
379
+
380
+
381
+ def delete_transaction(
382
+ self,
383
+ transaction_id: str
384
+ ) -> Dict[str, Any]:
385
+ """
386
+ Delete a transaction by its unique ID.
387
+
388
+ Parameters
389
+ ----------
390
+ transaction_id : str
391
+ Transaction ID.
392
+
393
+ Returns
394
+ -------
395
+ Dict[str, Any]
396
+ API response as a dictionary
397
+
398
+ Raises
399
+ ------
400
+ AppwriteException
401
+ If API request fails
402
+ """
403
+
404
+ api_path = '/vectorsdb/transactions/{transactionId}'
405
+ api_params = {}
406
+ if transaction_id is None:
407
+ raise AppwriteException('Missing required parameter: "transaction_id"')
408
+
409
+ api_path = api_path.replace('{transactionId}', str(self._normalize_value(transaction_id)))
410
+
411
+
412
+ response = self.client.call('delete', api_path, {
413
+ 'X-Appwrite-Project': self.client.get_config('project'),
414
+ 'content-type': 'application/json',
415
+ }, api_params)
416
+
417
+ return response
418
+
419
+
420
+ def create_operations(
421
+ self,
422
+ transaction_id: str,
423
+ operations: Optional[List[Dict[str, Any]]] = None
424
+ ) -> Transaction:
425
+ """
426
+ Create multiple operations in a single transaction.
427
+
428
+ Parameters
429
+ ----------
430
+ transaction_id : str
431
+ Transaction ID.
432
+ operations : Optional[List[Dict[str, Any]]]
433
+ Array of staged operations.
434
+
435
+ Returns
436
+ -------
437
+ Transaction
438
+ API response as a typed Pydantic model
439
+
440
+ Raises
441
+ ------
442
+ AppwriteException
443
+ If API request fails
444
+ """
445
+
446
+ api_path = '/vectorsdb/transactions/{transactionId}/operations'
447
+ api_params = {}
448
+ if transaction_id is None:
449
+ raise AppwriteException('Missing required parameter: "transaction_id"')
450
+
451
+ api_path = api_path.replace('{transactionId}', str(self._normalize_value(transaction_id)))
452
+
453
+ if operations is not None:
454
+ api_params['operations'] = self._normalize_value(operations)
455
+
456
+ response = self.client.call('post', api_path, {
457
+ 'X-Appwrite-Project': self.client.get_config('project'),
458
+ 'content-type': 'application/json',
459
+ 'accept': 'application/json',
460
+ }, api_params)
461
+
462
+ return self._parse_response(response, model=Transaction)
463
+
464
+
465
+ def get(
466
+ self,
467
+ database_id: str
468
+ ) -> Database:
469
+ """
470
+ Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.
471
+
472
+ Parameters
473
+ ----------
474
+ database_id : str
475
+ Database ID.
476
+
477
+ Returns
478
+ -------
479
+ Database
480
+ API response as a typed Pydantic model
481
+
482
+ Raises
483
+ ------
484
+ AppwriteException
485
+ If API request fails
486
+ """
487
+
488
+ api_path = '/vectorsdb/{databaseId}'
489
+ api_params = {}
490
+ if database_id is None:
491
+ raise AppwriteException('Missing required parameter: "database_id"')
492
+
493
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
494
+
495
+
496
+ response = self.client.call('get', api_path, {
497
+ 'X-Appwrite-Project': self.client.get_config('project'),
498
+ 'accept': 'application/json',
499
+ }, api_params)
500
+
501
+ return self._parse_response(response, model=Database)
502
+
503
+
504
+ def update(
505
+ self,
506
+ database_id: str,
507
+ name: str,
508
+ enabled: Optional[bool] = None,
509
+ specification: Optional[str] = None,
510
+ replicas: Optional[float] = None,
511
+ sync_mode: Optional[str] = None
512
+ ) -> Database:
513
+ """
514
+ Update a database by its unique ID.
515
+
516
+ Parameters
517
+ ----------
518
+ database_id : str
519
+ Database ID.
520
+ name : str
521
+ Database name. Max length: 128 chars.
522
+ enabled : Optional[bool]
523
+ Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
524
+ specification : Optional[str]
525
+ Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize.
526
+ replicas : Optional[float]
527
+ Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0.
528
+ sync_mode : Optional[str]
529
+ Replication sync mode for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum.
530
+
531
+ Returns
532
+ -------
533
+ Database
534
+ API response as a typed Pydantic model
535
+
536
+ Raises
537
+ ------
538
+ AppwriteException
539
+ If API request fails
540
+ """
541
+
542
+ api_path = '/vectorsdb/{databaseId}'
543
+ api_params = {}
544
+ if database_id is None:
545
+ raise AppwriteException('Missing required parameter: "database_id"')
546
+
547
+ if name is None:
548
+ raise AppwriteException('Missing required parameter: "name"')
549
+
550
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
551
+
552
+ api_params['name'] = self._normalize_value(name)
553
+ if enabled is not None:
554
+ api_params['enabled'] = self._normalize_value(enabled)
555
+ if specification is not None:
556
+ api_params['specification'] = self._normalize_value(specification)
557
+ if replicas is not None:
558
+ api_params['replicas'] = self._normalize_value(replicas)
559
+ if sync_mode is not None:
560
+ api_params['syncMode'] = self._normalize_value(sync_mode)
561
+
562
+ response = self.client.call('put', api_path, {
563
+ 'X-Appwrite-Project': self.client.get_config('project'),
564
+ 'content-type': 'application/json',
565
+ 'accept': 'application/json',
566
+ }, api_params)
567
+
568
+ return self._parse_response(response, model=Database)
569
+
570
+
571
+ def delete(
572
+ self,
573
+ database_id: str
574
+ ) -> Dict[str, Any]:
575
+ """
576
+ Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.
577
+
578
+ Parameters
579
+ ----------
580
+ database_id : str
581
+ Database ID.
582
+
583
+ Returns
584
+ -------
585
+ Dict[str, Any]
586
+ API response as a dictionary
587
+
588
+ Raises
589
+ ------
590
+ AppwriteException
591
+ If API request fails
592
+ """
593
+
594
+ api_path = '/vectorsdb/{databaseId}'
595
+ api_params = {}
596
+ if database_id is None:
597
+ raise AppwriteException('Missing required parameter: "database_id"')
598
+
599
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
600
+
601
+
602
+ response = self.client.call('delete', api_path, {
603
+ 'X-Appwrite-Project': self.client.get_config('project'),
604
+ 'content-type': 'application/json',
605
+ }, api_params)
606
+
607
+ return response
608
+
609
+
610
+ def list_collections(
611
+ self,
612
+ database_id: str,
613
+ queries: Optional[List[str]] = None,
614
+ search: Optional[str] = None,
615
+ total: Optional[bool] = None
616
+ ) -> VectorsdbCollectionList:
617
+ """
618
+ Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.
619
+
620
+ Parameters
621
+ ----------
622
+ database_id : str
623
+ Database ID.
624
+ queries : Optional[List[str]]
625
+ Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity
626
+ search : Optional[str]
627
+ Search term to filter your list results. Max length: 256 chars.
628
+ total : Optional[bool]
629
+ When set to false, the total count returned will be 0 and will not be calculated.
630
+
631
+ Returns
632
+ -------
633
+ VectorsdbCollectionList
634
+ API response as a typed Pydantic model
635
+
636
+ Raises
637
+ ------
638
+ AppwriteException
639
+ If API request fails
640
+ """
641
+
642
+ api_path = '/vectorsdb/{databaseId}/collections'
643
+ api_params = {}
644
+ if database_id is None:
645
+ raise AppwriteException('Missing required parameter: "database_id"')
646
+
647
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
648
+
649
+ if queries is not None:
650
+ api_params['queries'] = self._normalize_value(queries)
651
+ if search is not None:
652
+ api_params['search'] = self._normalize_value(search)
653
+ if total is not None:
654
+ api_params['total'] = self._normalize_value(total)
655
+
656
+ response = self.client.call('get', api_path, {
657
+ 'X-Appwrite-Project': self.client.get_config('project'),
658
+ 'accept': 'application/json',
659
+ }, api_params)
660
+
661
+ return self._parse_response(response, model=VectorsdbCollectionList)
662
+
663
+
664
+ def create_collection(
665
+ self,
666
+ database_id: str,
667
+ collection_id: str,
668
+ name: str,
669
+ dimension: float,
670
+ permissions: Optional[List[str]] = None,
671
+ document_security: Optional[bool] = None,
672
+ enabled: Optional[bool] = None
673
+ ) -> VectorsdbCollection:
674
+ """
675
+ Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
676
+
677
+ Parameters
678
+ ----------
679
+ database_id : str
680
+ Database ID.
681
+ collection_id : str
682
+ Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
683
+ name : str
684
+ Collection name. Max length: 128 chars.
685
+ dimension : float
686
+ Embedding dimension.
687
+ permissions : Optional[List[str]]
688
+ An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
689
+ document_security : Optional[bool]
690
+ Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).
691
+ enabled : Optional[bool]
692
+ Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.
693
+
694
+ Returns
695
+ -------
696
+ VectorsdbCollection
697
+ API response as a typed Pydantic model
698
+
699
+ Raises
700
+ ------
701
+ AppwriteException
702
+ If API request fails
703
+ """
704
+
705
+ api_path = '/vectorsdb/{databaseId}/collections'
706
+ api_params = {}
707
+ if database_id is None:
708
+ raise AppwriteException('Missing required parameter: "database_id"')
709
+
710
+ if collection_id is None:
711
+ raise AppwriteException('Missing required parameter: "collection_id"')
712
+
713
+ if name is None:
714
+ raise AppwriteException('Missing required parameter: "name"')
715
+
716
+ if dimension is None:
717
+ raise AppwriteException('Missing required parameter: "dimension"')
718
+
719
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
720
+
721
+ api_params['collectionId'] = self._normalize_value(collection_id)
722
+ api_params['name'] = self._normalize_value(name)
723
+ api_params['dimension'] = self._normalize_value(dimension)
724
+ if permissions is not None:
725
+ api_params['permissions'] = self._normalize_value(permissions)
726
+ if document_security is not None:
727
+ api_params['documentSecurity'] = self._normalize_value(document_security)
728
+ if enabled is not None:
729
+ api_params['enabled'] = self._normalize_value(enabled)
730
+
731
+ response = self.client.call('post', api_path, {
732
+ 'X-Appwrite-Project': self.client.get_config('project'),
733
+ 'content-type': 'application/json',
734
+ 'accept': 'application/json',
735
+ }, api_params)
736
+
737
+ return self._parse_response(response, model=VectorsdbCollection)
738
+
739
+
740
+ def get_collection(
741
+ self,
742
+ database_id: str,
743
+ collection_id: str
744
+ ) -> VectorsdbCollection:
745
+ """
746
+ Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.
747
+
748
+ Parameters
749
+ ----------
750
+ database_id : str
751
+ Database ID.
752
+ collection_id : str
753
+ Collection ID.
754
+
755
+ Returns
756
+ -------
757
+ VectorsdbCollection
758
+ API response as a typed Pydantic model
759
+
760
+ Raises
761
+ ------
762
+ AppwriteException
763
+ If API request fails
764
+ """
765
+
766
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}'
767
+ api_params = {}
768
+ if database_id is None:
769
+ raise AppwriteException('Missing required parameter: "database_id"')
770
+
771
+ if collection_id is None:
772
+ raise AppwriteException('Missing required parameter: "collection_id"')
773
+
774
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
775
+ api_path = api_path.replace('{collectionId}', str(self._normalize_value(collection_id)))
776
+
777
+
778
+ response = self.client.call('get', api_path, {
779
+ 'X-Appwrite-Project': self.client.get_config('project'),
780
+ 'accept': 'application/json',
781
+ }, api_params)
782
+
783
+ return self._parse_response(response, model=VectorsdbCollection)
784
+
785
+
786
+ def update_collection(
787
+ self,
788
+ database_id: str,
789
+ collection_id: str,
790
+ name: str,
791
+ dimension: Optional[float] = None,
792
+ permissions: Optional[List[str]] = None,
793
+ document_security: Optional[bool] = None,
794
+ enabled: Optional[bool] = None
795
+ ) -> VectorsdbCollection:
796
+ """
797
+ Update a collection by its unique ID.
798
+
799
+ Parameters
800
+ ----------
801
+ database_id : str
802
+ Database ID.
803
+ collection_id : str
804
+ Collection ID.
805
+ name : str
806
+ Collection name. Max length: 128 chars.
807
+ dimension : Optional[float]
808
+ Embedding dimensions.
809
+ permissions : Optional[List[str]]
810
+ An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
811
+ document_security : Optional[bool]
812
+ Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).
813
+ enabled : Optional[bool]
814
+ Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.
815
+
816
+ Returns
817
+ -------
818
+ VectorsdbCollection
819
+ API response as a typed Pydantic model
820
+
821
+ Raises
822
+ ------
823
+ AppwriteException
824
+ If API request fails
825
+ """
826
+
827
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}'
828
+ api_params = {}
829
+ if database_id is None:
830
+ raise AppwriteException('Missing required parameter: "database_id"')
831
+
832
+ if collection_id is None:
833
+ raise AppwriteException('Missing required parameter: "collection_id"')
834
+
835
+ if name is None:
836
+ raise AppwriteException('Missing required parameter: "name"')
837
+
838
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
839
+ api_path = api_path.replace('{collectionId}', str(self._normalize_value(collection_id)))
840
+
841
+ api_params['name'] = self._normalize_value(name)
842
+ if dimension is not None:
843
+ api_params['dimension'] = self._normalize_value(dimension)
844
+ if permissions is not None:
845
+ api_params['permissions'] = self._normalize_value(permissions)
846
+ if document_security is not None:
847
+ api_params['documentSecurity'] = self._normalize_value(document_security)
848
+ if enabled is not None:
849
+ api_params['enabled'] = self._normalize_value(enabled)
850
+
851
+ response = self.client.call('put', api_path, {
852
+ 'X-Appwrite-Project': self.client.get_config('project'),
853
+ 'content-type': 'application/json',
854
+ 'accept': 'application/json',
855
+ }, api_params)
856
+
857
+ return self._parse_response(response, model=VectorsdbCollection)
858
+
859
+
860
+ def delete_collection(
861
+ self,
862
+ database_id: str,
863
+ collection_id: str
864
+ ) -> Dict[str, Any]:
865
+ """
866
+ Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.
867
+
868
+ Parameters
869
+ ----------
870
+ database_id : str
871
+ Database ID.
872
+ collection_id : str
873
+ Collection ID.
874
+
875
+ Returns
876
+ -------
877
+ Dict[str, Any]
878
+ API response as a dictionary
879
+
880
+ Raises
881
+ ------
882
+ AppwriteException
883
+ If API request fails
884
+ """
885
+
886
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}'
887
+ api_params = {}
888
+ if database_id is None:
889
+ raise AppwriteException('Missing required parameter: "database_id"')
890
+
891
+ if collection_id is None:
892
+ raise AppwriteException('Missing required parameter: "collection_id"')
893
+
894
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
895
+ api_path = api_path.replace('{collectionId}', str(self._normalize_value(collection_id)))
896
+
897
+
898
+ response = self.client.call('delete', api_path, {
899
+ 'X-Appwrite-Project': self.client.get_config('project'),
900
+ 'content-type': 'application/json',
901
+ }, api_params)
902
+
903
+ return response
904
+
905
+
906
+ def list_documents(
907
+ self,
908
+ database_id: str,
909
+ collection_id: str,
910
+ queries: Optional[List[str]] = None,
911
+ transaction_id: Optional[str] = None,
912
+ total: Optional[bool] = None,
913
+ ttl: Optional[float] = None,
914
+ model_type: Type[T] = dict
915
+ ) -> DocumentList[T]:
916
+ """
917
+ Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
918
+
919
+ Parameters
920
+ ----------
921
+ database_id : str
922
+ Database ID.
923
+ collection_id : str
924
+ Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
925
+ queries : Optional[List[str]]
926
+ Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
927
+ transaction_id : Optional[str]
928
+ Transaction ID to read uncommitted changes within the transaction.
929
+ total : Optional[bool]
930
+ When set to false, the total count returned will be 0 and will not be calculated.
931
+ ttl : Optional[float]
932
+ TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
933
+
934
+ model_type : Type[T], optional
935
+ Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
936
+
937
+ Returns
938
+ -------
939
+ DocumentList[T]
940
+ API response as a typed Pydantic model
941
+
942
+ Raises
943
+ ------
944
+ AppwriteException
945
+ If API request fails
946
+ """
947
+
948
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'
949
+ api_params = {}
950
+ if database_id is None:
951
+ raise AppwriteException('Missing required parameter: "database_id"')
952
+
953
+ if collection_id is None:
954
+ raise AppwriteException('Missing required parameter: "collection_id"')
955
+
956
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
957
+ api_path = api_path.replace('{collectionId}', str(self._normalize_value(collection_id)))
958
+
959
+ if queries is not None:
960
+ api_params['queries'] = self._normalize_value(queries)
961
+ if transaction_id is not None:
962
+ api_params['transactionId'] = self._normalize_value(transaction_id)
963
+ if total is not None:
964
+ api_params['total'] = self._normalize_value(total)
965
+ if ttl is not None:
966
+ api_params['ttl'] = self._normalize_value(ttl)
967
+
968
+ response = self.client.call('get', api_path, {
969
+ 'X-Appwrite-Project': self.client.get_config('project'),
970
+ 'accept': 'application/json',
971
+ }, api_params)
972
+
973
+ return DocumentList.with_data(response, model_type)
974
+
975
+
976
+ def create_document(
977
+ self,
978
+ database_id: str,
979
+ collection_id: str,
980
+ document_id: str,
981
+ data: Dict[str, Any],
982
+ permissions: Optional[List[str]] = None,
983
+ model_type: Type[T] = dict
984
+ ) -> Document[T]:
985
+ """
986
+ Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
987
+
988
+ Parameters
989
+ ----------
990
+ database_id : str
991
+ Database ID.
992
+ collection_id : str
993
+ Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
994
+ document_id : str
995
+ Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
996
+ data : Dict[str, Any]
997
+ Document data as JSON object.
998
+ permissions : Optional[List[str]]
999
+ An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
1000
+
1001
+ model_type : Type[T], optional
1002
+ Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
1003
+
1004
+ Returns
1005
+ -------
1006
+ Document[T]
1007
+ API response as a typed Pydantic model
1008
+
1009
+ Raises
1010
+ ------
1011
+ AppwriteException
1012
+ If API request fails
1013
+ """
1014
+
1015
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'
1016
+ api_params = {}
1017
+ if database_id is None:
1018
+ raise AppwriteException('Missing required parameter: "database_id"')
1019
+
1020
+ if collection_id is None:
1021
+ raise AppwriteException('Missing required parameter: "collection_id"')
1022
+
1023
+ if document_id is None:
1024
+ raise AppwriteException('Missing required parameter: "document_id"')
1025
+
1026
+ if data is None:
1027
+ raise AppwriteException('Missing required parameter: "data"')
1028
+
1029
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1030
+ api_path = api_path.replace('{collectionId}', str(self._normalize_value(collection_id)))
1031
+
1032
+ api_params['documentId'] = self._normalize_value(document_id)
1033
+ api_params['data'] = self._normalize_value(data)
1034
+ if permissions is not None:
1035
+ api_params['permissions'] = self._normalize_value(permissions)
1036
+
1037
+ response = self.client.call('post', api_path, {
1038
+ 'X-Appwrite-Project': self.client.get_config('project'),
1039
+ 'content-type': 'application/json',
1040
+ 'accept': 'application/json',
1041
+ }, api_params)
1042
+
1043
+ return Document.with_data(response, model_type)
1044
+
1045
+
1046
+ def create_documents(
1047
+ self,
1048
+ database_id: str,
1049
+ collection_id: str,
1050
+ documents: List[Dict[str, Any]],
1051
+ model_type: Type[T] = dict
1052
+ ) -> DocumentList[T]:
1053
+ """
1054
+ Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
1055
+
1056
+ Parameters
1057
+ ----------
1058
+ database_id : str
1059
+ Database ID.
1060
+ collection_id : str
1061
+ Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
1062
+ documents : List[Dict[str, Any]]
1063
+ Array of documents data as JSON objects.
1064
+
1065
+ model_type : Type[T], optional
1066
+ Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
1067
+
1068
+ Returns
1069
+ -------
1070
+ DocumentList[T]
1071
+ API response as a typed Pydantic model
1072
+
1073
+ Raises
1074
+ ------
1075
+ AppwriteException
1076
+ If API request fails
1077
+ """
1078
+
1079
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'
1080
+ api_params = {}
1081
+ if database_id is None:
1082
+ raise AppwriteException('Missing required parameter: "database_id"')
1083
+
1084
+ if collection_id is None:
1085
+ raise AppwriteException('Missing required parameter: "collection_id"')
1086
+
1087
+ if documents is None:
1088
+ raise AppwriteException('Missing required parameter: "documents"')
1089
+
1090
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1091
+ api_path = api_path.replace('{collectionId}', str(self._normalize_value(collection_id)))
1092
+
1093
+ api_params['documents'] = self._normalize_value(documents)
1094
+
1095
+ response = self.client.call('post', api_path, {
1096
+ 'X-Appwrite-Project': self.client.get_config('project'),
1097
+ 'content-type': 'application/json',
1098
+ 'accept': 'application/json',
1099
+ }, api_params)
1100
+
1101
+ return DocumentList.with_data(response, model_type)
1102
+
1103
+
1104
+ def upsert_documents(
1105
+ self,
1106
+ database_id: str,
1107
+ collection_id: str,
1108
+ documents: List[Dict[str, Any]],
1109
+ transaction_id: Optional[str] = None,
1110
+ model_type: Type[T] = dict
1111
+ ) -> DocumentList[T]:
1112
+ """
1113
+ Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
1114
+
1115
+
1116
+ Parameters
1117
+ ----------
1118
+ database_id : str
1119
+ Database ID.
1120
+ collection_id : str
1121
+ Collection ID.
1122
+ documents : List[Dict[str, Any]]
1123
+ Array of document data as JSON objects. May contain partial documents.
1124
+ transaction_id : Optional[str]
1125
+ Transaction ID for staging the operation.
1126
+
1127
+ model_type : Type[T], optional
1128
+ Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
1129
+
1130
+ Returns
1131
+ -------
1132
+ DocumentList[T]
1133
+ API response as a typed Pydantic model
1134
+
1135
+ Raises
1136
+ ------
1137
+ AppwriteException
1138
+ If API request fails
1139
+ """
1140
+
1141
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'
1142
+ api_params = {}
1143
+ if database_id is None:
1144
+ raise AppwriteException('Missing required parameter: "database_id"')
1145
+
1146
+ if collection_id is None:
1147
+ raise AppwriteException('Missing required parameter: "collection_id"')
1148
+
1149
+ if documents is None:
1150
+ raise AppwriteException('Missing required parameter: "documents"')
1151
+
1152
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1153
+ api_path = api_path.replace('{collectionId}', str(self._normalize_value(collection_id)))
1154
+
1155
+ api_params['documents'] = self._normalize_value(documents)
1156
+ if transaction_id is not None:
1157
+ api_params['transactionId'] = self._normalize_value(transaction_id)
1158
+
1159
+ response = self.client.call('put', api_path, {
1160
+ 'X-Appwrite-Project': self.client.get_config('project'),
1161
+ 'content-type': 'application/json',
1162
+ 'accept': 'application/json',
1163
+ }, api_params)
1164
+
1165
+ return DocumentList.with_data(response, model_type)
1166
+
1167
+
1168
+ def update_documents(
1169
+ self,
1170
+ database_id: str,
1171
+ collection_id: str,
1172
+ data: Optional[Dict[str, Any]] = None,
1173
+ queries: Optional[List[str]] = None,
1174
+ transaction_id: Optional[str] = None,
1175
+ model_type: Type[T] = dict
1176
+ ) -> DocumentList[T]:
1177
+ """
1178
+ Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.
1179
+
1180
+ Parameters
1181
+ ----------
1182
+ database_id : str
1183
+ Database ID.
1184
+ collection_id : str
1185
+ Collection ID.
1186
+ data : Optional[Dict[str, Any]]
1187
+ Document data as JSON object. Include only attribute and value pairs to be updated.
1188
+ queries : Optional[List[str]]
1189
+ Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
1190
+ transaction_id : Optional[str]
1191
+ Transaction ID for staging the operation.
1192
+
1193
+ model_type : Type[T], optional
1194
+ Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
1195
+
1196
+ Returns
1197
+ -------
1198
+ DocumentList[T]
1199
+ API response as a typed Pydantic model
1200
+
1201
+ Raises
1202
+ ------
1203
+ AppwriteException
1204
+ If API request fails
1205
+ """
1206
+
1207
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'
1208
+ api_params = {}
1209
+ if database_id is None:
1210
+ raise AppwriteException('Missing required parameter: "database_id"')
1211
+
1212
+ if collection_id is None:
1213
+ raise AppwriteException('Missing required parameter: "collection_id"')
1214
+
1215
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1216
+ api_path = api_path.replace('{collectionId}', str(self._normalize_value(collection_id)))
1217
+
1218
+ if data is not None:
1219
+ api_params['data'] = self._normalize_value(data)
1220
+ if queries is not None:
1221
+ api_params['queries'] = self._normalize_value(queries)
1222
+ if transaction_id is not None:
1223
+ api_params['transactionId'] = self._normalize_value(transaction_id)
1224
+
1225
+ response = self.client.call('patch', api_path, {
1226
+ 'X-Appwrite-Project': self.client.get_config('project'),
1227
+ 'content-type': 'application/json',
1228
+ 'accept': 'application/json',
1229
+ }, api_params)
1230
+
1231
+ return DocumentList.with_data(response, model_type)
1232
+
1233
+
1234
+ def delete_documents(
1235
+ self,
1236
+ database_id: str,
1237
+ collection_id: str,
1238
+ queries: Optional[List[str]] = None,
1239
+ transaction_id: Optional[str] = None,
1240
+ model_type: Type[T] = dict
1241
+ ) -> DocumentList[T]:
1242
+ """
1243
+ Bulk delete documents using queries, if no queries are passed then all documents are deleted.
1244
+
1245
+ Parameters
1246
+ ----------
1247
+ database_id : str
1248
+ Database ID.
1249
+ collection_id : str
1250
+ Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1251
+ queries : Optional[List[str]]
1252
+ Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
1253
+ transaction_id : Optional[str]
1254
+ Transaction ID for staging the operation.
1255
+
1256
+ model_type : Type[T], optional
1257
+ Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
1258
+
1259
+ Returns
1260
+ -------
1261
+ DocumentList[T]
1262
+ API response as a typed Pydantic model
1263
+
1264
+ Raises
1265
+ ------
1266
+ AppwriteException
1267
+ If API request fails
1268
+ """
1269
+
1270
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'
1271
+ api_params = {}
1272
+ if database_id is None:
1273
+ raise AppwriteException('Missing required parameter: "database_id"')
1274
+
1275
+ if collection_id is None:
1276
+ raise AppwriteException('Missing required parameter: "collection_id"')
1277
+
1278
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1279
+ api_path = api_path.replace('{collectionId}', str(self._normalize_value(collection_id)))
1280
+
1281
+ if queries is not None:
1282
+ api_params['queries'] = self._normalize_value(queries)
1283
+ if transaction_id is not None:
1284
+ api_params['transactionId'] = self._normalize_value(transaction_id)
1285
+
1286
+ response = self.client.call('delete', api_path, {
1287
+ 'X-Appwrite-Project': self.client.get_config('project'),
1288
+ 'content-type': 'application/json',
1289
+ 'accept': 'application/json',
1290
+ }, api_params)
1291
+
1292
+ return DocumentList.with_data(response, model_type)
1293
+
1294
+
1295
+ def create_query(
1296
+ self,
1297
+ database_id: str,
1298
+ collection_id: str,
1299
+ queries: Optional[List[str]] = None,
1300
+ transaction_id: Optional[str] = None,
1301
+ total: Optional[bool] = None,
1302
+ ttl: Optional[float] = None,
1303
+ model_type: Type[T] = dict
1304
+ ) -> DocumentList[T]:
1305
+ """
1306
+ Get a list of all the user's documents in a given collection using a POST request. This behaves identically to the list documents endpoint but accepts the queries in the request body, allowing much larger `queries` arrays than can fit in a URL query string.
1307
+
1308
+
1309
+ Parameters
1310
+ ----------
1311
+ database_id : str
1312
+ Database ID.
1313
+ collection_id : str
1314
+ Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1315
+ queries : Optional[List[str]]
1316
+ Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
1317
+ transaction_id : Optional[str]
1318
+ Transaction ID to read uncommitted changes within the transaction.
1319
+ total : Optional[bool]
1320
+ When set to false, the total count returned will be 0 and will not be calculated.
1321
+ ttl : Optional[float]
1322
+ TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
1323
+
1324
+ model_type : Type[T], optional
1325
+ Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
1326
+
1327
+ Returns
1328
+ -------
1329
+ DocumentList[T]
1330
+ API response as a typed Pydantic model
1331
+
1332
+ Raises
1333
+ ------
1334
+ AppwriteException
1335
+ If API request fails
1336
+ """
1337
+
1338
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/query'
1339
+ api_params = {}
1340
+ if database_id is None:
1341
+ raise AppwriteException('Missing required parameter: "database_id"')
1342
+
1343
+ if collection_id is None:
1344
+ raise AppwriteException('Missing required parameter: "collection_id"')
1345
+
1346
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1347
+ api_path = api_path.replace('{collectionId}', str(self._normalize_value(collection_id)))
1348
+
1349
+ if queries is not None:
1350
+ api_params['queries'] = self._normalize_value(queries)
1351
+ if transaction_id is not None:
1352
+ api_params['transactionId'] = self._normalize_value(transaction_id)
1353
+ if total is not None:
1354
+ api_params['total'] = self._normalize_value(total)
1355
+ if ttl is not None:
1356
+ api_params['ttl'] = self._normalize_value(ttl)
1357
+
1358
+ response = self.client.call('post', api_path, {
1359
+ 'X-Appwrite-Project': self.client.get_config('project'),
1360
+ 'content-type': 'application/json',
1361
+ 'accept': 'application/json',
1362
+ }, api_params)
1363
+
1364
+ return DocumentList.with_data(response, model_type)
1365
+
1366
+
1367
+ def get_document(
1368
+ self,
1369
+ database_id: str,
1370
+ collection_id: str,
1371
+ document_id: str,
1372
+ queries: Optional[List[str]] = None,
1373
+ transaction_id: Optional[str] = None,
1374
+ model_type: Type[T] = dict
1375
+ ) -> Document[T]:
1376
+ """
1377
+ Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
1378
+
1379
+ Parameters
1380
+ ----------
1381
+ database_id : str
1382
+ Database ID.
1383
+ collection_id : str
1384
+ Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1385
+ document_id : str
1386
+ Document ID.
1387
+ queries : Optional[List[str]]
1388
+ Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
1389
+ transaction_id : Optional[str]
1390
+ Transaction ID to read uncommitted changes within the transaction.
1391
+
1392
+ model_type : Type[T], optional
1393
+ Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
1394
+
1395
+ Returns
1396
+ -------
1397
+ Document[T]
1398
+ API response as a typed Pydantic model
1399
+
1400
+ Raises
1401
+ ------
1402
+ AppwriteException
1403
+ If API request fails
1404
+ """
1405
+
1406
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'
1407
+ api_params = {}
1408
+ if database_id is None:
1409
+ raise AppwriteException('Missing required parameter: "database_id"')
1410
+
1411
+ if collection_id is None:
1412
+ raise AppwriteException('Missing required parameter: "collection_id"')
1413
+
1414
+ if document_id is None:
1415
+ raise AppwriteException('Missing required parameter: "document_id"')
1416
+
1417
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1418
+ api_path = api_path.replace('{collectionId}', str(self._normalize_value(collection_id)))
1419
+ api_path = api_path.replace('{documentId}', str(self._normalize_value(document_id)))
1420
+
1421
+ if queries is not None:
1422
+ api_params['queries'] = self._normalize_value(queries)
1423
+ if transaction_id is not None:
1424
+ api_params['transactionId'] = self._normalize_value(transaction_id)
1425
+
1426
+ response = self.client.call('get', api_path, {
1427
+ 'X-Appwrite-Project': self.client.get_config('project'),
1428
+ 'accept': 'application/json',
1429
+ }, api_params)
1430
+
1431
+ return Document.with_data(response, model_type)
1432
+
1433
+
1434
+ def upsert_document(
1435
+ self,
1436
+ database_id: str,
1437
+ collection_id: str,
1438
+ document_id: str,
1439
+ data: Optional[Dict[str, Any]] = None,
1440
+ permissions: Optional[List[str]] = None,
1441
+ transaction_id: Optional[str] = None,
1442
+ model_type: Type[T] = dict
1443
+ ) -> Document[T]:
1444
+ """
1445
+ Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
1446
+
1447
+ Parameters
1448
+ ----------
1449
+ database_id : str
1450
+ Database ID.
1451
+ collection_id : str
1452
+ Collection ID.
1453
+ document_id : str
1454
+ Document ID.
1455
+ data : Optional[Dict[str, Any]]
1456
+ Document data as JSON object. Include all required fields of the document to be created or updated.
1457
+ permissions : Optional[List[str]]
1458
+ An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
1459
+ transaction_id : Optional[str]
1460
+ Transaction ID for staging the operation.
1461
+
1462
+ model_type : Type[T], optional
1463
+ Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
1464
+
1465
+ Returns
1466
+ -------
1467
+ Document[T]
1468
+ API response as a typed Pydantic model
1469
+
1470
+ Raises
1471
+ ------
1472
+ AppwriteException
1473
+ If API request fails
1474
+ """
1475
+
1476
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'
1477
+ api_params = {}
1478
+ if database_id is None:
1479
+ raise AppwriteException('Missing required parameter: "database_id"')
1480
+
1481
+ if collection_id is None:
1482
+ raise AppwriteException('Missing required parameter: "collection_id"')
1483
+
1484
+ if document_id is None:
1485
+ raise AppwriteException('Missing required parameter: "document_id"')
1486
+
1487
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1488
+ api_path = api_path.replace('{collectionId}', str(self._normalize_value(collection_id)))
1489
+ api_path = api_path.replace('{documentId}', str(self._normalize_value(document_id)))
1490
+
1491
+ if data is not None:
1492
+ api_params['data'] = self._normalize_value(data)
1493
+ if permissions is not None:
1494
+ api_params['permissions'] = self._normalize_value(permissions)
1495
+ if transaction_id is not None:
1496
+ api_params['transactionId'] = self._normalize_value(transaction_id)
1497
+
1498
+ response = self.client.call('put', api_path, {
1499
+ 'X-Appwrite-Project': self.client.get_config('project'),
1500
+ 'content-type': 'application/json',
1501
+ 'accept': 'application/json',
1502
+ }, api_params)
1503
+
1504
+ return Document.with_data(response, model_type)
1505
+
1506
+
1507
+ def update_document(
1508
+ self,
1509
+ database_id: str,
1510
+ collection_id: str,
1511
+ document_id: str,
1512
+ data: Optional[Dict[str, Any]] = None,
1513
+ permissions: Optional[List[str]] = None,
1514
+ transaction_id: Optional[str] = None,
1515
+ model_type: Type[T] = dict
1516
+ ) -> Document[T]:
1517
+ """
1518
+ Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
1519
+
1520
+ Parameters
1521
+ ----------
1522
+ database_id : str
1523
+ Database ID.
1524
+ collection_id : str
1525
+ Collection ID.
1526
+ document_id : str
1527
+ Document ID.
1528
+ data : Optional[Dict[str, Any]]
1529
+ Document data as JSON object. Include only fields and value pairs to be updated.
1530
+ permissions : Optional[List[str]]
1531
+ An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
1532
+ transaction_id : Optional[str]
1533
+ Transaction ID for staging the operation.
1534
+
1535
+ model_type : Type[T], optional
1536
+ Pydantic model class for the user-defined data. Defaults to dict for backward compatibility.
1537
+
1538
+ Returns
1539
+ -------
1540
+ Document[T]
1541
+ API response as a typed Pydantic model
1542
+
1543
+ Raises
1544
+ ------
1545
+ AppwriteException
1546
+ If API request fails
1547
+ """
1548
+
1549
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'
1550
+ api_params = {}
1551
+ if database_id is None:
1552
+ raise AppwriteException('Missing required parameter: "database_id"')
1553
+
1554
+ if collection_id is None:
1555
+ raise AppwriteException('Missing required parameter: "collection_id"')
1556
+
1557
+ if document_id is None:
1558
+ raise AppwriteException('Missing required parameter: "document_id"')
1559
+
1560
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1561
+ api_path = api_path.replace('{collectionId}', str(self._normalize_value(collection_id)))
1562
+ api_path = api_path.replace('{documentId}', str(self._normalize_value(document_id)))
1563
+
1564
+ if data is not None:
1565
+ api_params['data'] = self._normalize_value(data)
1566
+ if permissions is not None:
1567
+ api_params['permissions'] = self._normalize_value(permissions)
1568
+ if transaction_id is not None:
1569
+ api_params['transactionId'] = self._normalize_value(transaction_id)
1570
+
1571
+ response = self.client.call('patch', api_path, {
1572
+ 'X-Appwrite-Project': self.client.get_config('project'),
1573
+ 'content-type': 'application/json',
1574
+ 'accept': 'application/json',
1575
+ }, api_params)
1576
+
1577
+ return Document.with_data(response, model_type)
1578
+
1579
+
1580
+ def delete_document(
1581
+ self,
1582
+ database_id: str,
1583
+ collection_id: str,
1584
+ document_id: str,
1585
+ transaction_id: Optional[str] = None
1586
+ ) -> Dict[str, Any]:
1587
+ """
1588
+ Delete a document by its unique ID.
1589
+
1590
+ Parameters
1591
+ ----------
1592
+ database_id : str
1593
+ Database ID.
1594
+ collection_id : str
1595
+ Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1596
+ document_id : str
1597
+ Document ID.
1598
+ transaction_id : Optional[str]
1599
+ Transaction ID for staging the operation.
1600
+
1601
+ Returns
1602
+ -------
1603
+ Dict[str, Any]
1604
+ API response as a dictionary
1605
+
1606
+ Raises
1607
+ ------
1608
+ AppwriteException
1609
+ If API request fails
1610
+ """
1611
+
1612
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'
1613
+ api_params = {}
1614
+ if database_id is None:
1615
+ raise AppwriteException('Missing required parameter: "database_id"')
1616
+
1617
+ if collection_id is None:
1618
+ raise AppwriteException('Missing required parameter: "collection_id"')
1619
+
1620
+ if document_id is None:
1621
+ raise AppwriteException('Missing required parameter: "document_id"')
1622
+
1623
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1624
+ api_path = api_path.replace('{collectionId}', str(self._normalize_value(collection_id)))
1625
+ api_path = api_path.replace('{documentId}', str(self._normalize_value(document_id)))
1626
+
1627
+ if transaction_id is not None:
1628
+ api_params['transactionId'] = self._normalize_value(transaction_id)
1629
+
1630
+ response = self.client.call('delete', api_path, {
1631
+ 'X-Appwrite-Project': self.client.get_config('project'),
1632
+ 'content-type': 'application/json',
1633
+ }, api_params)
1634
+
1635
+ return response
1636
+
1637
+
1638
+ def list_indexes(
1639
+ self,
1640
+ database_id: str,
1641
+ collection_id: str,
1642
+ queries: Optional[List[str]] = None,
1643
+ total: Optional[bool] = None
1644
+ ) -> IndexList:
1645
+ """
1646
+ List indexes in the collection.
1647
+
1648
+ Parameters
1649
+ ----------
1650
+ database_id : str
1651
+ Database ID.
1652
+ collection_id : str
1653
+ Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1654
+ queries : Optional[List[str]]
1655
+ Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error
1656
+ total : Optional[bool]
1657
+ When set to false, the total count returned will be 0 and will not be calculated.
1658
+
1659
+ Returns
1660
+ -------
1661
+ IndexList
1662
+ API response as a typed Pydantic model
1663
+
1664
+ Raises
1665
+ ------
1666
+ AppwriteException
1667
+ If API request fails
1668
+ """
1669
+
1670
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/indexes'
1671
+ api_params = {}
1672
+ if database_id is None:
1673
+ raise AppwriteException('Missing required parameter: "database_id"')
1674
+
1675
+ if collection_id is None:
1676
+ raise AppwriteException('Missing required parameter: "collection_id"')
1677
+
1678
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1679
+ api_path = api_path.replace('{collectionId}', str(self._normalize_value(collection_id)))
1680
+
1681
+ if queries is not None:
1682
+ api_params['queries'] = self._normalize_value(queries)
1683
+ if total is not None:
1684
+ api_params['total'] = self._normalize_value(total)
1685
+
1686
+ response = self.client.call('get', api_path, {
1687
+ 'X-Appwrite-Project': self.client.get_config('project'),
1688
+ 'accept': 'application/json',
1689
+ }, api_params)
1690
+
1691
+ return self._parse_response(response, model=IndexList)
1692
+
1693
+
1694
+ def create_index(
1695
+ self,
1696
+ database_id: str,
1697
+ collection_id: str,
1698
+ key: str,
1699
+ type: VectorsDBIndexType,
1700
+ attributes: List[str],
1701
+ orders: Optional[List[OrderBy]] = None,
1702
+ lengths: Optional[List[float]] = None
1703
+ ) -> Index:
1704
+ """
1705
+ Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.
1706
+ Attributes can be `key`, `fulltext`, and `unique`.
1707
+
1708
+ Parameters
1709
+ ----------
1710
+ database_id : str
1711
+ Database ID.
1712
+ collection_id : str
1713
+ Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1714
+ key : str
1715
+ Index Key.
1716
+ type : VectorsDBIndexType
1717
+ Index type.
1718
+ attributes : List[str]
1719
+ Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
1720
+ orders : Optional[List[OrderBy]]
1721
+ Array of index orders. Maximum of 100 orders are allowed.
1722
+ lengths : Optional[List[float]]
1723
+ Length of index. Maximum of 100
1724
+
1725
+ Returns
1726
+ -------
1727
+ Index
1728
+ API response as a typed Pydantic model
1729
+
1730
+ Raises
1731
+ ------
1732
+ AppwriteException
1733
+ If API request fails
1734
+ """
1735
+
1736
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/indexes'
1737
+ api_params = {}
1738
+ if database_id is None:
1739
+ raise AppwriteException('Missing required parameter: "database_id"')
1740
+
1741
+ if collection_id is None:
1742
+ raise AppwriteException('Missing required parameter: "collection_id"')
1743
+
1744
+ if key is None:
1745
+ raise AppwriteException('Missing required parameter: "key"')
1746
+
1747
+ if type is None:
1748
+ raise AppwriteException('Missing required parameter: "type"')
1749
+
1750
+ if attributes is None:
1751
+ raise AppwriteException('Missing required parameter: "attributes"')
1752
+
1753
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1754
+ api_path = api_path.replace('{collectionId}', str(self._normalize_value(collection_id)))
1755
+
1756
+ api_params['key'] = self._normalize_value(key)
1757
+ api_params['type'] = self._normalize_value(type)
1758
+ api_params['attributes'] = self._normalize_value(attributes)
1759
+ if orders is not None:
1760
+ api_params['orders'] = self._normalize_value(orders)
1761
+ if lengths is not None:
1762
+ api_params['lengths'] = self._normalize_value(lengths)
1763
+
1764
+ response = self.client.call('post', api_path, {
1765
+ 'X-Appwrite-Project': self.client.get_config('project'),
1766
+ 'content-type': 'application/json',
1767
+ 'accept': 'application/json',
1768
+ }, api_params)
1769
+
1770
+ return self._parse_response(response, model=Index)
1771
+
1772
+
1773
+ def get_index(
1774
+ self,
1775
+ database_id: str,
1776
+ collection_id: str,
1777
+ key: str
1778
+ ) -> Index:
1779
+ """
1780
+ Get index by ID.
1781
+
1782
+ Parameters
1783
+ ----------
1784
+ database_id : str
1785
+ Database ID.
1786
+ collection_id : str
1787
+ Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1788
+ key : str
1789
+ Index Key.
1790
+
1791
+ Returns
1792
+ -------
1793
+ Index
1794
+ API response as a typed Pydantic model
1795
+
1796
+ Raises
1797
+ ------
1798
+ AppwriteException
1799
+ If API request fails
1800
+ """
1801
+
1802
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}'
1803
+ api_params = {}
1804
+ if database_id is None:
1805
+ raise AppwriteException('Missing required parameter: "database_id"')
1806
+
1807
+ if collection_id is None:
1808
+ raise AppwriteException('Missing required parameter: "collection_id"')
1809
+
1810
+ if key is None:
1811
+ raise AppwriteException('Missing required parameter: "key"')
1812
+
1813
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1814
+ api_path = api_path.replace('{collectionId}', str(self._normalize_value(collection_id)))
1815
+ api_path = api_path.replace('{key}', str(self._normalize_value(key)))
1816
+
1817
+
1818
+ response = self.client.call('get', api_path, {
1819
+ 'X-Appwrite-Project': self.client.get_config('project'),
1820
+ 'accept': 'application/json',
1821
+ }, api_params)
1822
+
1823
+ return self._parse_response(response, model=Index)
1824
+
1825
+
1826
+ def delete_index(
1827
+ self,
1828
+ database_id: str,
1829
+ collection_id: str,
1830
+ key: str
1831
+ ) -> Dict[str, Any]:
1832
+ """
1833
+ Delete an index.
1834
+
1835
+ Parameters
1836
+ ----------
1837
+ database_id : str
1838
+ Database ID.
1839
+ collection_id : str
1840
+ Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1841
+ key : str
1842
+ Index Key.
1843
+
1844
+ Returns
1845
+ -------
1846
+ Dict[str, Any]
1847
+ API response as a dictionary
1848
+
1849
+ Raises
1850
+ ------
1851
+ AppwriteException
1852
+ If API request fails
1853
+ """
1854
+
1855
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}'
1856
+ api_params = {}
1857
+ if database_id is None:
1858
+ raise AppwriteException('Missing required parameter: "database_id"')
1859
+
1860
+ if collection_id is None:
1861
+ raise AppwriteException('Missing required parameter: "collection_id"')
1862
+
1863
+ if key is None:
1864
+ raise AppwriteException('Missing required parameter: "key"')
1865
+
1866
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1867
+ api_path = api_path.replace('{collectionId}', str(self._normalize_value(collection_id)))
1868
+ api_path = api_path.replace('{key}', str(self._normalize_value(key)))
1869
+
1870
+
1871
+ response = self.client.call('delete', api_path, {
1872
+ 'X-Appwrite-Project': self.client.get_config('project'),
1873
+ 'content-type': 'application/json',
1874
+ }, api_params)
1875
+
1876
+ return response
1877
+
1878
+
1879
+ def create_failover(
1880
+ self,
1881
+ database_id: str,
1882
+ target_replica_id: Optional[str] = None
1883
+ ) -> DedicatedDatabase:
1884
+ """
1885
+ Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation by a failover that did not finish also accepts this call as a repair, provided `targetReplicaId` names the member to promote.
1886
+
1887
+ Parameters
1888
+ ----------
1889
+ database_id : str
1890
+ Database ID.
1891
+ target_replica_id : Optional[str]
1892
+ Target replica ID to promote. If not specified, the healthiest replica is selected.
1893
+
1894
+ Returns
1895
+ -------
1896
+ DedicatedDatabase
1897
+ API response as a typed Pydantic model
1898
+
1899
+ Raises
1900
+ ------
1901
+ AppwriteException
1902
+ If API request fails
1903
+ """
1904
+
1905
+ api_path = '/vectorsdb/{databaseId}/failovers'
1906
+ api_params = {}
1907
+ if database_id is None:
1908
+ raise AppwriteException('Missing required parameter: "database_id"')
1909
+
1910
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1911
+
1912
+ if target_replica_id is not None:
1913
+ api_params['targetReplicaId'] = self._normalize_value(target_replica_id)
1914
+
1915
+ response = self.client.call('post', api_path, {
1916
+ 'X-Appwrite-Project': self.client.get_config('project'),
1917
+ 'content-type': 'application/json',
1918
+ 'accept': 'application/json',
1919
+ }, api_params)
1920
+
1921
+ return self._parse_response(response, model=DedicatedDatabase)
1922
+
1923
+
1924
+ def list_operations(
1925
+ self,
1926
+ database_id: str,
1927
+ status: Optional[str] = None,
1928
+ limit: Optional[float] = None,
1929
+ offset: Optional[float] = None
1930
+ ) -> DedicatedDatabaseOperationList:
1931
+ """
1932
+ List the lifecycle operations recorded for a dedicated database, newest first. Every provision, update, restore, backup and replication action is recorded here with its outcome, including an attempt that was abandoned because another worker took over the database.
1933
+
1934
+ Parameters
1935
+ ----------
1936
+ database_id : str
1937
+ Database ID.
1938
+ status : Optional[str]
1939
+ Filter by operation status.
1940
+ limit : Optional[float]
1941
+ Maximum number of operations to return.
1942
+ offset : Optional[float]
1943
+ Number of operations to skip.
1944
+
1945
+ Returns
1946
+ -------
1947
+ DedicatedDatabaseOperationList
1948
+ API response as a typed Pydantic model
1949
+
1950
+ Raises
1951
+ ------
1952
+ AppwriteException
1953
+ If API request fails
1954
+ """
1955
+
1956
+ api_path = '/vectorsdb/{databaseId}/operations'
1957
+ api_params = {}
1958
+ if database_id is None:
1959
+ raise AppwriteException('Missing required parameter: "database_id"')
1960
+
1961
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1962
+
1963
+ if status is not None:
1964
+ api_params['status'] = self._normalize_value(status)
1965
+ if limit is not None:
1966
+ api_params['limit'] = self._normalize_value(limit)
1967
+ if offset is not None:
1968
+ api_params['offset'] = self._normalize_value(offset)
1969
+
1970
+ response = self.client.call('get', api_path, {
1971
+ 'X-Appwrite-Project': self.client.get_config('project'),
1972
+ 'accept': 'application/json',
1973
+ }, api_params)
1974
+
1975
+ return self._parse_response(response, model=DedicatedDatabaseOperationList)
1976
+
1977
+
1978
+ def get_replicas(
1979
+ self,
1980
+ database_id: str
1981
+ ) -> DedicatedDatabaseReplicas:
1982
+ """
1983
+ Get high availability status for a dedicated database. Returns replica statuses, replication lag, and sync mode.
1984
+
1985
+ Parameters
1986
+ ----------
1987
+ database_id : str
1988
+ Database ID.
1989
+
1990
+ Returns
1991
+ -------
1992
+ DedicatedDatabaseReplicas
1993
+ API response as a typed Pydantic model
1994
+
1995
+ Raises
1996
+ ------
1997
+ AppwriteException
1998
+ If API request fails
1999
+ """
2000
+
2001
+ api_path = '/vectorsdb/{databaseId}/replicas'
2002
+ api_params = {}
2003
+ if database_id is None:
2004
+ raise AppwriteException('Missing required parameter: "database_id"')
2005
+
2006
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
2007
+
2008
+
2009
+ response = self.client.call('get', api_path, {
2010
+ 'X-Appwrite-Project': self.client.get_config('project'),
2011
+ 'accept': 'application/json',
2012
+ }, api_params)
2013
+
2014
+ return self._parse_response(response, model=DedicatedDatabaseReplicas)
2015
+
2016
+
2017
+ def get_status(
2018
+ self,
2019
+ database_id: str
2020
+ ) -> DatabaseStatus:
2021
+ """
2022
+ Get real-time health and status information for a dedicated database. Returns health status, readiness, uptime, connection info, replica status, and volume information.
2023
+
2024
+ Parameters
2025
+ ----------
2026
+ database_id : str
2027
+ Database ID.
2028
+
2029
+ Returns
2030
+ -------
2031
+ DatabaseStatus
2032
+ API response as a typed Pydantic model
2033
+
2034
+ Raises
2035
+ ------
2036
+ AppwriteException
2037
+ If API request fails
2038
+ """
2039
+
2040
+ api_path = '/vectorsdb/{databaseId}/status'
2041
+ api_params = {}
2042
+ if database_id is None:
2043
+ raise AppwriteException('Missing required parameter: "database_id"')
2044
+
2045
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
2046
+
2047
+
2048
+ response = self.client.call('get', api_path, {
2049
+ 'X-Appwrite-Project': self.client.get_config('project'),
2050
+ 'accept': 'application/json',
2051
+ }, api_params)
2052
+
2053
+ return self._parse_response(response, model=DatabaseStatus)
2054
+