appwrite 27.0.0 → 28.0.0.rc1

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 (404) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +27 -24
  3. data/lib/appwrite/enums/adapter.rb +1 -1
  4. data/lib/appwrite/enums/attribute_status.rb +1 -1
  5. data/lib/appwrite/enums/authentication_factor.rb +1 -1
  6. data/lib/appwrite/enums/authenticator_type.rb +1 -1
  7. data/lib/appwrite/enums/backup_services.rb +1 -1
  8. data/lib/appwrite/enums/billing_plan_group.rb +1 -1
  9. data/lib/appwrite/enums/browser.rb +1 -1
  10. data/lib/appwrite/enums/browser_permission.rb +1 -1
  11. data/lib/appwrite/enums/browser_theme.rb +1 -1
  12. data/lib/appwrite/enums/build_runtime.rb +2 -1
  13. data/lib/appwrite/enums/column_status.rb +1 -1
  14. data/lib/appwrite/enums/compression.rb +1 -1
  15. data/lib/appwrite/enums/credit_card.rb +1 -1
  16. data/lib/appwrite/enums/database_status.rb +1 -1
  17. data/lib/appwrite/enums/database_type.rb +1 -1
  18. data/lib/appwrite/enums/databases_index_type.rb +1 -1
  19. data/lib/appwrite/enums/deployment_download_type.rb +1 -1
  20. data/lib/appwrite/enums/deployment_status.rb +1 -1
  21. data/lib/appwrite/enums/documents_db_index_type.rb +9 -0
  22. data/lib/appwrite/enums/embedding_model.rb +1 -3
  23. data/lib/appwrite/enums/execution_method.rb +1 -1
  24. data/lib/appwrite/enums/execution_resource_type.rb +8 -0
  25. data/lib/appwrite/enums/execution_status.rb +1 -1
  26. data/lib/appwrite/enums/execution_trigger.rb +1 -1
  27. data/lib/appwrite/enums/flag.rb +1 -1
  28. data/lib/appwrite/enums/framework.rb +1 -1
  29. data/lib/appwrite/enums/image_format.rb +1 -1
  30. data/lib/appwrite/enums/image_gravity.rb +1 -1
  31. data/lib/appwrite/enums/index_status.rb +1 -1
  32. data/lib/appwrite/enums/invalidation_type.rb +1 -1
  33. data/lib/appwrite/enums/message_priority.rb +1 -1
  34. data/lib/appwrite/enums/message_status.rb +1 -1
  35. data/lib/appwrite/enums/messaging_provider_type.rb +1 -1
  36. data/lib/appwrite/enums/o_auth2_google_prompt.rb +1 -1
  37. data/lib/appwrite/enums/o_auth2_oidc_prompt.rb +1 -1
  38. data/lib/appwrite/enums/o_auth_provider.rb +2 -1
  39. data/lib/appwrite/enums/order_by.rb +1 -1
  40. data/lib/appwrite/enums/organization_key_scopes.rb +1 -1
  41. data/lib/appwrite/enums/password_hash.rb +1 -1
  42. data/lib/appwrite/enums/platform_type.rb +1 -1
  43. data/lib/appwrite/enums/project_auth_method_id.rb +1 -1
  44. data/lib/appwrite/enums/project_email_template_id.rb +1 -1
  45. data/lib/appwrite/enums/project_email_template_locale.rb +1 -1
  46. data/lib/appwrite/enums/project_key_scopes.rb +14 -3
  47. data/lib/appwrite/enums/project_o_auth2_google_prompt.rb +1 -1
  48. data/lib/appwrite/enums/project_o_auth2_oidc_prompt.rb +1 -1
  49. data/lib/appwrite/enums/project_o_auth_provider_id.rb +2 -1
  50. data/lib/appwrite/enums/project_policy_id.rb +1 -1
  51. data/lib/appwrite/enums/project_protocol_id.rb +1 -1
  52. data/lib/appwrite/enums/project_service_id.rb +1 -1
  53. data/lib/appwrite/enums/project_smtp_secure.rb +1 -1
  54. data/lib/appwrite/enums/proxy_resource_type.rb +1 -1
  55. data/lib/appwrite/enums/proxy_rule_deployment_resource_type.rb +1 -1
  56. data/lib/appwrite/enums/proxy_rule_status.rb +1 -1
  57. data/lib/appwrite/enums/region.rb +1 -1
  58. data/lib/appwrite/enums/relation_mutate.rb +1 -1
  59. data/lib/appwrite/enums/relationship_type.rb +1 -1
  60. data/lib/appwrite/enums/runtime.rb +2 -1
  61. data/lib/appwrite/enums/smtp_encryption.rb +1 -1
  62. data/lib/appwrite/enums/status_code.rb +1 -1
  63. data/lib/appwrite/enums/tables_db_index_type.rb +1 -1
  64. data/lib/appwrite/enums/template_reference_type.rb +1 -1
  65. data/lib/appwrite/enums/timezone.rb +1 -1
  66. data/lib/appwrite/enums/vcs_reference_type.rb +1 -1
  67. data/lib/appwrite/enums/vectors_db_index_type.rb +12 -0
  68. data/lib/appwrite/exception.rb +1 -1
  69. data/lib/appwrite/id.rb +3 -3
  70. data/lib/appwrite/input_file.rb +1 -1
  71. data/lib/appwrite/models/activity_event.rb +1 -1
  72. data/lib/appwrite/models/activity_event_list.rb +1 -1
  73. data/lib/appwrite/models/additional_resource.rb +1 -1
  74. data/lib/appwrite/models/algo_argon2.rb +1 -1
  75. data/lib/appwrite/models/algo_bcrypt.rb +1 -1
  76. data/lib/appwrite/models/algo_md5.rb +1 -1
  77. data/lib/appwrite/models/algo_phpass.rb +1 -1
  78. data/lib/appwrite/models/algo_scrypt.rb +1 -1
  79. data/lib/appwrite/models/algo_scrypt_modified.rb +1 -1
  80. data/lib/appwrite/models/algo_sha.rb +1 -1
  81. data/lib/appwrite/models/app.rb +1 -1
  82. data/lib/appwrite/models/app_installation.rb +2 -2
  83. data/lib/appwrite/models/app_installation_list.rb +1 -1
  84. data/lib/appwrite/models/app_key.rb +2 -2
  85. data/lib/appwrite/models/app_key_list.rb +1 -1
  86. data/lib/appwrite/models/app_scope.rb +1 -1
  87. data/lib/appwrite/models/app_scope_list.rb +1 -1
  88. data/lib/appwrite/models/app_secret.rb +2 -2
  89. data/lib/appwrite/models/app_secret_list.rb +1 -1
  90. data/lib/appwrite/models/app_secret_plaintext.rb +2 -2
  91. data/lib/appwrite/models/apps_list.rb +1 -1
  92. data/lib/appwrite/models/attribute_bigint.rb +5 -6
  93. data/lib/appwrite/models/attribute_boolean.rb +3 -4
  94. data/lib/appwrite/models/attribute_datetime.rb +3 -4
  95. data/lib/appwrite/models/attribute_email.rb +3 -4
  96. data/lib/appwrite/models/attribute_enum.rb +3 -4
  97. data/lib/appwrite/models/attribute_float.rb +5 -6
  98. data/lib/appwrite/models/attribute_integer.rb +5 -6
  99. data/lib/appwrite/models/attribute_ip.rb +3 -4
  100. data/lib/appwrite/models/attribute_line.rb +3 -4
  101. data/lib/appwrite/models/attribute_list.rb +1 -1
  102. data/lib/appwrite/models/attribute_longtext.rb +4 -5
  103. data/lib/appwrite/models/attribute_mediumtext.rb +4 -5
  104. data/lib/appwrite/models/attribute_object.rb +80 -0
  105. data/lib/appwrite/models/attribute_point.rb +3 -4
  106. data/lib/appwrite/models/attribute_polygon.rb +3 -4
  107. data/lib/appwrite/models/attribute_relationship.rb +2 -3
  108. data/lib/appwrite/models/attribute_string.rb +4 -5
  109. data/lib/appwrite/models/attribute_text.rb +4 -5
  110. data/lib/appwrite/models/attribute_url.rb +3 -4
  111. data/lib/appwrite/models/attribute_varchar.rb +4 -5
  112. data/lib/appwrite/models/attribute_vector.rb +85 -0
  113. data/lib/appwrite/models/backup_archive.rb +3 -3
  114. data/lib/appwrite/models/backup_archive_list.rb +1 -1
  115. data/lib/appwrite/models/backup_policy.rb +3 -3
  116. data/lib/appwrite/models/backup_policy_list.rb +1 -1
  117. data/lib/appwrite/models/backup_restoration.rb +1 -1
  118. data/lib/appwrite/models/backup_restoration_list.rb +1 -1
  119. data/lib/appwrite/models/billing_limits.rb +9 -9
  120. data/lib/appwrite/models/billing_plan.rb +19 -10
  121. data/lib/appwrite/models/billing_plan_addon.rb +3 -3
  122. data/lib/appwrite/models/billing_plan_addon_details.rb +2 -2
  123. data/lib/appwrite/models/billing_plan_dedicated_database_limits.rb +20 -20
  124. data/lib/appwrite/models/billing_plan_limits.rb +3 -3
  125. data/lib/appwrite/models/billing_plan_supported_addons.rb +1 -1
  126. data/lib/appwrite/models/block.rb +3 -3
  127. data/lib/appwrite/models/bucket.rb +1 -1
  128. data/lib/appwrite/models/bucket_list.rb +1 -1
  129. data/lib/appwrite/models/collection.rb +1 -1
  130. data/lib/appwrite/models/collection_list.rb +1 -1
  131. data/lib/appwrite/models/column_bigint.rb +5 -6
  132. data/lib/appwrite/models/column_boolean.rb +3 -4
  133. data/lib/appwrite/models/column_datetime.rb +3 -4
  134. data/lib/appwrite/models/column_email.rb +3 -4
  135. data/lib/appwrite/models/column_enum.rb +3 -4
  136. data/lib/appwrite/models/column_float.rb +5 -6
  137. data/lib/appwrite/models/column_index.rb +2 -2
  138. data/lib/appwrite/models/column_index_list.rb +1 -1
  139. data/lib/appwrite/models/column_integer.rb +5 -6
  140. data/lib/appwrite/models/column_ip.rb +3 -4
  141. data/lib/appwrite/models/column_line.rb +3 -4
  142. data/lib/appwrite/models/column_list.rb +1 -1
  143. data/lib/appwrite/models/column_longtext.rb +4 -5
  144. data/lib/appwrite/models/column_mediumtext.rb +4 -5
  145. data/lib/appwrite/models/column_point.rb +3 -4
  146. data/lib/appwrite/models/column_polygon.rb +3 -4
  147. data/lib/appwrite/models/column_relationship.rb +2 -3
  148. data/lib/appwrite/models/column_string.rb +4 -5
  149. data/lib/appwrite/models/column_text.rb +4 -5
  150. data/lib/appwrite/models/column_url.rb +3 -4
  151. data/lib/appwrite/models/column_varchar.rb +4 -5
  152. data/lib/appwrite/models/continent.rb +1 -1
  153. data/lib/appwrite/models/continent_list.rb +1 -1
  154. data/lib/appwrite/models/country.rb +1 -1
  155. data/lib/appwrite/models/country_list.rb +1 -1
  156. data/lib/appwrite/models/currency.rb +1 -1
  157. data/lib/appwrite/models/currency_list.rb +1 -1
  158. data/lib/appwrite/models/database.rb +22 -8
  159. data/lib/appwrite/models/database_list.rb +1 -1
  160. data/lib/appwrite/models/database_migration.rb +6 -1
  161. data/lib/appwrite/models/database_migration_list.rb +1 -1
  162. data/lib/appwrite/models/database_status.rb +3 -3
  163. data/lib/appwrite/models/database_status_connections.rb +1 -1
  164. data/lib/appwrite/models/database_status_replica.rb +7 -2
  165. data/lib/appwrite/models/database_status_volume.rb +1 -1
  166. data/lib/appwrite/models/dedicated_database.rb +3 -3
  167. data/lib/appwrite/models/dedicated_database_backup.rb +107 -0
  168. data/lib/appwrite/models/dedicated_database_backup_list.rb +32 -0
  169. data/lib/appwrite/models/dedicated_database_backup_storage.rb +47 -0
  170. data/lib/appwrite/models/dedicated_database_branch.rb +82 -0
  171. data/lib/appwrite/models/dedicated_database_branch_list.rb +32 -0
  172. data/lib/appwrite/models/dedicated_database_execution.rb +52 -0
  173. data/lib/appwrite/models/dedicated_database_execution_column.rb +32 -0
  174. data/lib/appwrite/models/dedicated_database_extensions.rb +37 -0
  175. data/lib/appwrite/models/dedicated_database_list.rb +32 -0
  176. data/lib/appwrite/models/dedicated_database_member.rb +7 -2
  177. data/lib/appwrite/models/dedicated_database_operation.rb +4 -4
  178. data/lib/appwrite/models/dedicated_database_operation_list.rb +1 -1
  179. data/lib/appwrite/models/dedicated_database_pitr_windows.rb +32 -0
  180. data/lib/appwrite/models/dedicated_database_pooler.rb +72 -0
  181. data/lib/appwrite/models/dedicated_database_replicas.rb +3 -3
  182. data/lib/appwrite/models/dedicated_database_restoration.rb +82 -0
  183. data/lib/appwrite/models/dedicated_database_restoration_list.rb +32 -0
  184. data/lib/appwrite/models/dedicated_database_specification.rb +1 -1
  185. data/lib/appwrite/models/dedicated_database_specification_list.rb +1 -1
  186. data/lib/appwrite/models/dedicated_database_specification_pricing.rb +1 -1
  187. data/lib/appwrite/models/deployment.rb +1 -2
  188. data/lib/appwrite/models/deployment_list.rb +1 -1
  189. data/lib/appwrite/models/dev_key.rb +1 -1
  190. data/lib/appwrite/models/document.rb +1 -1
  191. data/lib/appwrite/models/document_list.rb +1 -1
  192. data/lib/appwrite/models/email_template.rb +1 -1
  193. data/lib/appwrite/models/email_template_list.rb +1 -1
  194. data/lib/appwrite/models/embedding.rb +1 -1
  195. data/lib/appwrite/models/embedding_list.rb +1 -1
  196. data/lib/appwrite/models/ephemeral_key.rb +1 -1
  197. data/lib/appwrite/models/execution.rb +25 -8
  198. data/lib/appwrite/models/execution_list.rb +1 -1
  199. data/lib/appwrite/models/file.rb +1 -1
  200. data/lib/appwrite/models/file_list.rb +1 -1
  201. data/lib/appwrite/models/framework.rb +1 -1
  202. data/lib/appwrite/models/framework_adapter.rb +1 -1
  203. data/lib/appwrite/models/framework_list.rb +1 -1
  204. data/lib/appwrite/models/function.rb +1 -1
  205. data/lib/appwrite/models/function_list.rb +1 -1
  206. data/lib/appwrite/models/headers.rb +1 -1
  207. data/lib/appwrite/models/identity.rb +1 -1
  208. data/lib/appwrite/models/identity_list.rb +1 -1
  209. data/lib/appwrite/models/index.rb +2 -3
  210. data/lib/appwrite/models/index_list.rb +1 -1
  211. data/lib/appwrite/models/insight.rb +4 -4
  212. data/lib/appwrite/models/insight_cta.rb +1 -1
  213. data/lib/appwrite/models/insight_list.rb +1 -1
  214. data/lib/appwrite/models/jwt.rb +1 -1
  215. data/lib/appwrite/models/key.rb +1 -1
  216. data/lib/appwrite/models/key_list.rb +1 -1
  217. data/lib/appwrite/models/language.rb +1 -1
  218. data/lib/appwrite/models/language_list.rb +1 -1
  219. data/lib/appwrite/models/locale.rb +12 -12
  220. data/lib/appwrite/models/locale_code.rb +1 -1
  221. data/lib/appwrite/models/locale_code_list.rb +1 -1
  222. data/lib/appwrite/models/log.rb +1 -1
  223. data/lib/appwrite/models/log_list.rb +1 -1
  224. data/lib/appwrite/models/membership.rb +1 -1
  225. data/lib/appwrite/models/membership_list.rb +1 -1
  226. data/lib/appwrite/models/message.rb +4 -5
  227. data/lib/appwrite/models/message_list.rb +1 -1
  228. data/lib/appwrite/models/mfa_challenge.rb +1 -1
  229. data/lib/appwrite/models/mfa_challenge_secret.rb +1 -1
  230. data/lib/appwrite/models/mfa_factors.rb +1 -1
  231. data/lib/appwrite/models/mfa_recovery_codes.rb +1 -1
  232. data/lib/appwrite/models/mfa_type.rb +1 -1
  233. data/lib/appwrite/models/mock_number.rb +1 -1
  234. data/lib/appwrite/models/mock_number_list.rb +1 -1
  235. data/lib/appwrite/models/o_auth2_amazon.rb +1 -1
  236. data/lib/appwrite/models/o_auth2_apple.rb +1 -1
  237. data/lib/appwrite/models/o_auth2_appwrite.rb +1 -1
  238. data/lib/appwrite/models/o_auth2_auth0.rb +1 -1
  239. data/lib/appwrite/models/o_auth2_authentik.rb +1 -1
  240. data/lib/appwrite/models/o_auth2_autodesk.rb +1 -1
  241. data/lib/appwrite/models/o_auth2_bitbucket.rb +1 -1
  242. data/lib/appwrite/models/o_auth2_bitly.rb +1 -1
  243. data/lib/appwrite/models/o_auth2_box.rb +1 -1
  244. data/lib/appwrite/models/o_auth2_dailymotion.rb +1 -1
  245. data/lib/appwrite/models/o_auth2_discord.rb +1 -1
  246. data/lib/appwrite/models/o_auth2_disqus.rb +1 -1
  247. data/lib/appwrite/models/o_auth2_dropbox.rb +1 -1
  248. data/lib/appwrite/models/o_auth2_etsy.rb +1 -1
  249. data/lib/appwrite/models/o_auth2_facebook.rb +1 -1
  250. data/lib/appwrite/models/o_auth2_figma.rb +1 -1
  251. data/lib/appwrite/models/o_auth2_fusion_auth.rb +1 -1
  252. data/lib/appwrite/models/o_auth2_github.rb +1 -1
  253. data/lib/appwrite/models/o_auth2_gitlab.rb +1 -1
  254. data/lib/appwrite/models/o_auth2_google.rb +18 -2
  255. data/lib/appwrite/models/o_auth2_hugging_face.rb +42 -0
  256. data/lib/appwrite/models/o_auth2_keycloak.rb +1 -1
  257. data/lib/appwrite/models/o_auth2_kick.rb +1 -1
  258. data/lib/appwrite/models/o_auth2_linkedin.rb +1 -1
  259. data/lib/appwrite/models/o_auth2_microsoft.rb +1 -1
  260. data/lib/appwrite/models/o_auth2_notion.rb +1 -1
  261. data/lib/appwrite/models/o_auth2_oidc.rb +20 -3
  262. data/lib/appwrite/models/o_auth2_okta.rb +1 -1
  263. data/lib/appwrite/models/o_auth2_paypal.rb +1 -1
  264. data/lib/appwrite/models/o_auth2_podio.rb +1 -1
  265. data/lib/appwrite/models/o_auth2_provider_list.rb +1 -1
  266. data/lib/appwrite/models/o_auth2_salesforce.rb +1 -1
  267. data/lib/appwrite/models/o_auth2_slack.rb +1 -1
  268. data/lib/appwrite/models/o_auth2_spotify.rb +1 -1
  269. data/lib/appwrite/models/o_auth2_stripe.rb +1 -1
  270. data/lib/appwrite/models/o_auth2_tradeshift.rb +1 -1
  271. data/lib/appwrite/models/o_auth2_twitch.rb +1 -1
  272. data/lib/appwrite/models/o_auth2_word_press.rb +1 -1
  273. data/lib/appwrite/models/o_auth2_x.rb +1 -1
  274. data/lib/appwrite/models/o_auth2_yahoo.rb +1 -1
  275. data/lib/appwrite/models/o_auth2_yandex.rb +1 -1
  276. data/lib/appwrite/models/o_auth2_zoho.rb +1 -1
  277. data/lib/appwrite/models/o_auth2_zoom.rb +1 -1
  278. data/lib/appwrite/models/oauth2_approve.rb +1 -1
  279. data/lib/appwrite/models/oauth2_authorize.rb +1 -1
  280. data/lib/appwrite/models/oauth2_consent.rb +1 -1
  281. data/lib/appwrite/models/oauth2_consent_list.rb +1 -1
  282. data/lib/appwrite/models/oauth2_consent_token.rb +1 -1
  283. data/lib/appwrite/models/oauth2_consent_token_list.rb +1 -1
  284. data/lib/appwrite/models/oauth2_device_authorization.rb +1 -1
  285. data/lib/appwrite/models/oauth2_grant.rb +1 -1
  286. data/lib/appwrite/models/oauth2_organization.rb +1 -1
  287. data/lib/appwrite/models/oauth2_organization_list.rb +1 -1
  288. data/lib/appwrite/models/oauth2_par.rb +1 -1
  289. data/lib/appwrite/models/oauth2_project.rb +1 -1
  290. data/lib/appwrite/models/oauth2_project_list.rb +1 -1
  291. data/lib/appwrite/models/oauth2_reject.rb +1 -1
  292. data/lib/appwrite/models/oauth2_token.rb +3 -3
  293. data/lib/appwrite/models/organization.rb +14 -14
  294. data/lib/appwrite/models/phone.rb +1 -1
  295. data/lib/appwrite/models/phone_list.rb +1 -1
  296. data/lib/appwrite/models/platform_android.rb +1 -2
  297. data/lib/appwrite/models/platform_apple.rb +1 -2
  298. data/lib/appwrite/models/platform_linux.rb +1 -2
  299. data/lib/appwrite/models/platform_list.rb +1 -1
  300. data/lib/appwrite/models/platform_web.rb +1 -2
  301. data/lib/appwrite/models/platform_windows.rb +1 -2
  302. data/lib/appwrite/models/policy_deny_aliased_email.rb +1 -1
  303. data/lib/appwrite/models/policy_deny_corporate_email.rb +1 -1
  304. data/lib/appwrite/models/policy_deny_disposable_email.rb +1 -1
  305. data/lib/appwrite/models/policy_deny_free_email.rb +1 -1
  306. data/lib/appwrite/models/policy_list.rb +1 -1
  307. data/lib/appwrite/models/policy_membership_privacy.rb +1 -1
  308. data/lib/appwrite/models/policy_mfa_factors.rb +1 -1
  309. data/lib/appwrite/models/policy_password_dictionary.rb +1 -1
  310. data/lib/appwrite/models/policy_password_history.rb +1 -1
  311. data/lib/appwrite/models/policy_password_personal_data.rb +1 -1
  312. data/lib/appwrite/models/policy_password_strength.rb +1 -1
  313. data/lib/appwrite/models/policy_session_alert.rb +1 -1
  314. data/lib/appwrite/models/policy_session_duration.rb +1 -1
  315. data/lib/appwrite/models/policy_session_invalidation.rb +1 -1
  316. data/lib/appwrite/models/policy_session_limit.rb +1 -1
  317. data/lib/appwrite/models/policy_user_limit.rb +1 -1
  318. data/lib/appwrite/models/postgres_extension.rb +42 -0
  319. data/lib/appwrite/models/preferences.rb +1 -1
  320. data/lib/appwrite/models/presence.rb +4 -4
  321. data/lib/appwrite/models/presence_list.rb +1 -1
  322. data/lib/appwrite/models/program.rb +1 -1
  323. data/lib/appwrite/models/project.rb +19 -19
  324. data/lib/appwrite/models/project_auth_method.rb +1 -2
  325. data/lib/appwrite/models/project_list.rb +1 -1
  326. data/lib/appwrite/models/project_protocol.rb +1 -2
  327. data/lib/appwrite/models/project_service.rb +1 -2
  328. data/lib/appwrite/models/provider.rb +2 -2
  329. data/lib/appwrite/models/provider_list.rb +1 -1
  330. data/lib/appwrite/models/proxy_invalidation.rb +1 -1
  331. data/lib/appwrite/models/proxy_rule.rb +2 -3
  332. data/lib/appwrite/models/proxy_rule_list.rb +1 -1
  333. data/lib/appwrite/models/report.rb +2 -2
  334. data/lib/appwrite/models/report_list.rb +1 -1
  335. data/lib/appwrite/models/resource_token.rb +1 -1
  336. data/lib/appwrite/models/resource_token_list.rb +1 -1
  337. data/lib/appwrite/models/row.rb +1 -1
  338. data/lib/appwrite/models/row_list.rb +1 -1
  339. data/lib/appwrite/models/runtime.rb +1 -1
  340. data/lib/appwrite/models/runtime_list.rb +1 -1
  341. data/lib/appwrite/models/session.rb +1 -1
  342. data/lib/appwrite/models/session_list.rb +1 -1
  343. data/lib/appwrite/models/site.rb +6 -1
  344. data/lib/appwrite/models/site_list.rb +1 -1
  345. data/lib/appwrite/models/specification.rb +1 -1
  346. data/lib/appwrite/models/specification_list.rb +1 -1
  347. data/lib/appwrite/models/subscriber.rb +1 -1
  348. data/lib/appwrite/models/subscriber_list.rb +1 -1
  349. data/lib/appwrite/models/table.rb +1 -1
  350. data/lib/appwrite/models/table_list.rb +1 -1
  351. data/lib/appwrite/models/target.rb +2 -2
  352. data/lib/appwrite/models/target_list.rb +1 -1
  353. data/lib/appwrite/models/team.rb +1 -1
  354. data/lib/appwrite/models/team_list.rb +1 -1
  355. data/lib/appwrite/models/token.rb +1 -1
  356. data/lib/appwrite/models/topic.rb +1 -1
  357. data/lib/appwrite/models/topic_list.rb +1 -1
  358. data/lib/appwrite/models/transaction.rb +1 -1
  359. data/lib/appwrite/models/transaction_list.rb +1 -1
  360. data/lib/appwrite/models/usage_billing_plan.rb +4 -4
  361. data/lib/appwrite/models/user.rb +11 -11
  362. data/lib/appwrite/models/user_list.rb +1 -1
  363. data/lib/appwrite/models/variable.rb +1 -1
  364. data/lib/appwrite/models/variable_list.rb +1 -1
  365. data/lib/appwrite/models/vectorsdb_collection.rb +87 -0
  366. data/lib/appwrite/models/vectorsdb_collection_list.rb +32 -0
  367. data/lib/appwrite/models/webhook.rb +1 -1
  368. data/lib/appwrite/models/webhook_list.rb +1 -1
  369. data/lib/appwrite/operator.rb +6 -0
  370. data/lib/appwrite/permission.rb +4 -0
  371. data/lib/appwrite/query.rb +4 -4
  372. data/lib/appwrite/role.rb +12 -14
  373. data/lib/appwrite/service.rb +1 -1
  374. data/lib/appwrite/services/account.rb +328 -289
  375. data/lib/appwrite/services/activities.rb +13 -14
  376. data/lib/appwrite/services/advisor.rb +41 -37
  377. data/lib/appwrite/services/apps.rb +185 -130
  378. data/lib/appwrite/services/avatars.rb +156 -55
  379. data/lib/appwrite/services/backups.rb +102 -83
  380. data/lib/appwrite/services/databases.rb +871 -512
  381. data/lib/appwrite/services/documents_db.rb +1683 -0
  382. data/lib/appwrite/services/embeddings.rb +9 -9
  383. data/lib/appwrite/services/functions.rb +276 -172
  384. data/lib/appwrite/services/graphql.rb +12 -12
  385. data/lib/appwrite/services/locale.rb +19 -37
  386. data/lib/appwrite/services/messaging.rb +544 -259
  387. data/lib/appwrite/services/mongo.rb +1359 -0
  388. data/lib/appwrite/services/mysql.rb +1503 -0
  389. data/lib/appwrite/services/oauth2.rb +122 -53
  390. data/lib/appwrite/services/organization.rb +153 -123
  391. data/lib/appwrite/services/postgresql.rb +1615 -0
  392. data/lib/appwrite/services/presences.rb +49 -35
  393. data/lib/appwrite/services/project.rb +842 -528
  394. data/lib/appwrite/services/proxy.rb +73 -58
  395. data/lib/appwrite/services/sites.rb +269 -164
  396. data/lib/appwrite/services/storage.rb +151 -92
  397. data/lib/appwrite/services/tables_db.rb +947 -568
  398. data/lib/appwrite/services/teams.rb +161 -122
  399. data/lib/appwrite/services/tokens.rb +38 -31
  400. data/lib/appwrite/services/users.rb +376 -274
  401. data/lib/appwrite/services/vectors_db.rb +1614 -0
  402. data/lib/appwrite/services/webhooks.rb +59 -40
  403. data/lib/appwrite.rb +27 -0
  404. metadata +31 -4
@@ -0,0 +1,1614 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ class VectorsDB < Service
5
+ def initialize(client)
6
+ @client = client
7
+ end
8
+
9
+ # Get a list of all databases from the current Appwrite project. You can use
10
+ # the search parameter to filter your results.
11
+ #
12
+ # @param [Array] queries 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
13
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
14
+ #
15
+ # @return [DatabaseList]
16
+ def list(
17
+ queries: nil,
18
+ total: nil
19
+ )
20
+ api_path = '/vectorsdb'
21
+
22
+ api_params = {
23
+ queries: queries,
24
+ total: total,
25
+ }
26
+
27
+ api_headers = {
28
+ "X-Appwrite-Project": @client.get_config('project'),
29
+ "accept": 'application/json',
30
+ }
31
+
32
+ @client.call(
33
+ method: 'GET',
34
+ path: api_path,
35
+ headers: api_headers,
36
+ params: api_params,
37
+ response_type: Models::DatabaseList
38
+ )
39
+ end
40
+
41
+ # Create a new Database.
42
+ #
43
+ #
44
+ # @param [String] database_id 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&#039;t start with a special char. Max length is 36 chars.
45
+ # @param [String] name Database name. Max length: 128 chars.
46
+ # @param [] enabled Is the database enabled? When set to &#039;disabled&#039;, 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.
47
+ # @param [String] specification Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification.
48
+ # @param [Integer] replicas 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.
49
+ # @param [String] sync_mode 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.
50
+ #
51
+ # @return [Database]
52
+ def create(
53
+ database_id:,
54
+ name:,
55
+ enabled: nil,
56
+ specification: nil,
57
+ replicas: nil,
58
+ sync_mode: nil
59
+ )
60
+ api_path = '/vectorsdb'
61
+
62
+ if database_id.nil?
63
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
64
+ end
65
+
66
+ if name.nil?
67
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
68
+ end
69
+
70
+ api_params = {
71
+ databaseId: database_id,
72
+ name: name,
73
+ enabled: enabled,
74
+ specification: specification,
75
+ replicas: replicas,
76
+ syncMode: sync_mode,
77
+ }
78
+
79
+ api_headers = {
80
+ "X-Appwrite-Project": @client.get_config('project'),
81
+ "content-type": 'application/json',
82
+ "accept": 'application/json',
83
+ }
84
+
85
+ @client.call(
86
+ method: 'POST',
87
+ path: api_path,
88
+ headers: api_headers,
89
+ params: api_params,
90
+ response_type: Models::Database
91
+ )
92
+ end
93
+
94
+ # List the dedicated database specifications available on the current plan.
95
+ # Each specification reports its resource limits, pricing, and whether it is
96
+ # enabled for the organization.
97
+ #
98
+ #
99
+ # @return [DedicatedDatabaseSpecificationList]
100
+ def list_specifications()
101
+ api_path = '/vectorsdb/specifications'
102
+
103
+ api_params = {}
104
+
105
+ api_headers = {
106
+ "X-Appwrite-Project": @client.get_config('project'),
107
+ "accept": 'application/json',
108
+ }
109
+
110
+ @client.call(
111
+ method: 'GET',
112
+ path: api_path,
113
+ headers: api_headers,
114
+ params: api_params,
115
+ response_type: Models::DedicatedDatabaseSpecificationList
116
+ )
117
+ end
118
+
119
+ # List transactions across all databases.
120
+ #
121
+ # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries).
122
+ #
123
+ # @return [TransactionList]
124
+ def list_transactions(
125
+ queries: nil
126
+ )
127
+ api_path = '/vectorsdb/transactions'
128
+
129
+ api_params = {
130
+ queries: queries,
131
+ }
132
+
133
+ api_headers = {
134
+ "X-Appwrite-Project": @client.get_config('project'),
135
+ "accept": 'application/json',
136
+ }
137
+
138
+ @client.call(
139
+ method: 'GET',
140
+ path: api_path,
141
+ headers: api_headers,
142
+ params: api_params,
143
+ response_type: Models::TransactionList
144
+ )
145
+ end
146
+
147
+ # Create a new transaction.
148
+ #
149
+ # @param [Integer] ttl Seconds before the transaction expires.
150
+ #
151
+ # @return [Transaction]
152
+ def create_transaction(
153
+ ttl: nil
154
+ )
155
+ api_path = '/vectorsdb/transactions'
156
+
157
+ api_params = {
158
+ ttl: ttl,
159
+ }
160
+
161
+ api_headers = {
162
+ "X-Appwrite-Project": @client.get_config('project'),
163
+ "content-type": 'application/json',
164
+ "accept": 'application/json',
165
+ }
166
+
167
+ @client.call(
168
+ method: 'POST',
169
+ path: api_path,
170
+ headers: api_headers,
171
+ params: api_params,
172
+ response_type: Models::Transaction
173
+ )
174
+ end
175
+
176
+ # Get a transaction by its unique ID.
177
+ #
178
+ # @param [String] transaction_id Transaction ID.
179
+ #
180
+ # @return [Transaction]
181
+ def get_transaction(
182
+ transaction_id:
183
+ )
184
+ api_path = '/vectorsdb/transactions/{transactionId}'
185
+ .gsub('{transactionId}', transaction_id)
186
+
187
+ if transaction_id.nil?
188
+ raise Appwrite::Exception.new('Missing required parameter: "transactionId"')
189
+ end
190
+
191
+ api_params = {}
192
+
193
+ api_headers = {
194
+ "X-Appwrite-Project": @client.get_config('project'),
195
+ "accept": 'application/json',
196
+ }
197
+
198
+ @client.call(
199
+ method: 'GET',
200
+ path: api_path,
201
+ headers: api_headers,
202
+ params: api_params,
203
+ response_type: Models::Transaction
204
+ )
205
+ end
206
+
207
+ # Update a transaction, to either commit or roll back its operations.
208
+ #
209
+ # @param [String] transaction_id Transaction ID.
210
+ # @param [] commit Commit transaction?
211
+ # @param [] rollback Rollback transaction?
212
+ #
213
+ # @return [Transaction]
214
+ def update_transaction(
215
+ transaction_id:,
216
+ commit: nil,
217
+ rollback: nil
218
+ )
219
+ api_path = '/vectorsdb/transactions/{transactionId}'
220
+ .gsub('{transactionId}', transaction_id)
221
+
222
+ if transaction_id.nil?
223
+ raise Appwrite::Exception.new('Missing required parameter: "transactionId"')
224
+ end
225
+
226
+ api_params = {
227
+ commit: commit,
228
+ rollback: rollback,
229
+ }
230
+
231
+ api_headers = {
232
+ "X-Appwrite-Project": @client.get_config('project'),
233
+ "content-type": 'application/json',
234
+ "accept": 'application/json',
235
+ }
236
+
237
+ @client.call(
238
+ method: 'PATCH',
239
+ path: api_path,
240
+ headers: api_headers,
241
+ params: api_params,
242
+ response_type: Models::Transaction
243
+ )
244
+ end
245
+
246
+ # Delete a transaction by its unique ID.
247
+ #
248
+ # @param [String] transaction_id Transaction ID.
249
+ #
250
+ # @return []
251
+ def delete_transaction(
252
+ transaction_id:
253
+ )
254
+ api_path = '/vectorsdb/transactions/{transactionId}'
255
+ .gsub('{transactionId}', transaction_id)
256
+
257
+ if transaction_id.nil?
258
+ raise Appwrite::Exception.new('Missing required parameter: "transactionId"')
259
+ end
260
+
261
+ api_params = {}
262
+
263
+ api_headers = {
264
+ "X-Appwrite-Project": @client.get_config('project'),
265
+ "content-type": 'application/json',
266
+ }
267
+
268
+ @client.call(
269
+ method: 'DELETE',
270
+ path: api_path,
271
+ headers: api_headers,
272
+ params: api_params,
273
+ )
274
+ end
275
+
276
+ # Create multiple operations in a single transaction.
277
+ #
278
+ # @param [String] transaction_id Transaction ID.
279
+ # @param [Array] operations Array of staged operations.
280
+ #
281
+ # @return [Transaction]
282
+ def create_operations(
283
+ transaction_id:,
284
+ operations: nil
285
+ )
286
+ api_path = '/vectorsdb/transactions/{transactionId}/operations'
287
+ .gsub('{transactionId}', transaction_id)
288
+
289
+ if transaction_id.nil?
290
+ raise Appwrite::Exception.new('Missing required parameter: "transactionId"')
291
+ end
292
+
293
+ api_params = {
294
+ operations: operations,
295
+ }
296
+
297
+ api_headers = {
298
+ "X-Appwrite-Project": @client.get_config('project'),
299
+ "content-type": 'application/json',
300
+ "accept": 'application/json',
301
+ }
302
+
303
+ @client.call(
304
+ method: 'POST',
305
+ path: api_path,
306
+ headers: api_headers,
307
+ params: api_params,
308
+ response_type: Models::Transaction
309
+ )
310
+ end
311
+
312
+ # Get a database by its unique ID. This endpoint response returns a JSON
313
+ # object with the database metadata.
314
+ #
315
+ # @param [String] database_id Database ID.
316
+ #
317
+ # @return [Database]
318
+ def get(
319
+ database_id:
320
+ )
321
+ api_path = '/vectorsdb/{databaseId}'
322
+ .gsub('{databaseId}', database_id)
323
+
324
+ if database_id.nil?
325
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
326
+ end
327
+
328
+ api_params = {}
329
+
330
+ api_headers = {
331
+ "X-Appwrite-Project": @client.get_config('project'),
332
+ "accept": 'application/json',
333
+ }
334
+
335
+ @client.call(
336
+ method: 'GET',
337
+ path: api_path,
338
+ headers: api_headers,
339
+ params: api_params,
340
+ response_type: Models::Database
341
+ )
342
+ end
343
+
344
+ # Update a database by its unique ID.
345
+ #
346
+ # @param [String] database_id Database ID.
347
+ # @param [String] name Database name. Max length: 128 chars.
348
+ # @param [] enabled Is database enabled? When set to &#039;disabled&#039;, 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.
349
+ # @param [String] specification 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.
350
+ # @param [Integer] replicas 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.
351
+ # @param [String] sync_mode 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.
352
+ #
353
+ # @return [Database]
354
+ def update(
355
+ database_id:,
356
+ name:,
357
+ enabled: nil,
358
+ specification: nil,
359
+ replicas: nil,
360
+ sync_mode: nil
361
+ )
362
+ api_path = '/vectorsdb/{databaseId}'
363
+ .gsub('{databaseId}', database_id)
364
+
365
+ if database_id.nil?
366
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
367
+ end
368
+
369
+ if name.nil?
370
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
371
+ end
372
+
373
+ api_params = {
374
+ name: name,
375
+ enabled: enabled,
376
+ specification: specification,
377
+ replicas: replicas,
378
+ syncMode: sync_mode,
379
+ }
380
+
381
+ api_headers = {
382
+ "X-Appwrite-Project": @client.get_config('project'),
383
+ "content-type": 'application/json',
384
+ "accept": 'application/json',
385
+ }
386
+
387
+ @client.call(
388
+ method: 'PUT',
389
+ path: api_path,
390
+ headers: api_headers,
391
+ params: api_params,
392
+ response_type: Models::Database
393
+ )
394
+ end
395
+
396
+ # Delete a database by its unique ID. Only API keys with with databases.write
397
+ # scope can delete a database.
398
+ #
399
+ # @param [String] database_id Database ID.
400
+ #
401
+ # @return []
402
+ def delete(
403
+ database_id:
404
+ )
405
+ api_path = '/vectorsdb/{databaseId}'
406
+ .gsub('{databaseId}', database_id)
407
+
408
+ if database_id.nil?
409
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
410
+ end
411
+
412
+ api_params = {}
413
+
414
+ api_headers = {
415
+ "X-Appwrite-Project": @client.get_config('project'),
416
+ "content-type": 'application/json',
417
+ }
418
+
419
+ @client.call(
420
+ method: 'DELETE',
421
+ path: api_path,
422
+ headers: api_headers,
423
+ params: api_params,
424
+ )
425
+ end
426
+
427
+ # Get a list of all collections that belong to the provided databaseId. You
428
+ # can use the search parameter to filter your results.
429
+ #
430
+ # @param [String] database_id Database ID.
431
+ # @param [Array] queries 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
432
+ # @param [String] search Search term to filter your list results. Max length: 256 chars.
433
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
434
+ #
435
+ # @return [VectorsdbCollectionList]
436
+ def list_collections(
437
+ database_id:,
438
+ queries: nil,
439
+ search: nil,
440
+ total: nil
441
+ )
442
+ api_path = '/vectorsdb/{databaseId}/collections'
443
+ .gsub('{databaseId}', database_id)
444
+
445
+ if database_id.nil?
446
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
447
+ end
448
+
449
+ api_params = {
450
+ queries: queries,
451
+ search: search,
452
+ total: total,
453
+ }
454
+
455
+ api_headers = {
456
+ "X-Appwrite-Project": @client.get_config('project'),
457
+ "accept": 'application/json',
458
+ }
459
+
460
+ @client.call(
461
+ method: 'GET',
462
+ path: api_path,
463
+ headers: api_headers,
464
+ params: api_params,
465
+ response_type: Models::VectorsdbCollectionList
466
+ )
467
+ end
468
+
469
+ # Create a new Collection. Before using this route, you should create a new
470
+ # database resource using either a [server
471
+ # integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection)
472
+ # API or directly from your database console.
473
+ #
474
+ # @param [String] database_id Database ID.
475
+ # @param [String] collection_id 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&#039;t start with a special char. Max length is 36 chars.
476
+ # @param [String] name Collection name. Max length: 128 chars.
477
+ # @param [Integer] dimension Embedding dimension.
478
+ # @param [Array] permissions An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
479
+ # @param [] document_security 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).
480
+ # @param [] enabled Is collection enabled? When set to &#039;disabled&#039;, 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.
481
+ #
482
+ # @return [VectorsdbCollection]
483
+ def create_collection(
484
+ database_id:,
485
+ collection_id:,
486
+ name:,
487
+ dimension:,
488
+ permissions: nil,
489
+ document_security: nil,
490
+ enabled: nil
491
+ )
492
+ api_path = '/vectorsdb/{databaseId}/collections'
493
+ .gsub('{databaseId}', database_id)
494
+
495
+ if database_id.nil?
496
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
497
+ end
498
+
499
+ if collection_id.nil?
500
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
501
+ end
502
+
503
+ if name.nil?
504
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
505
+ end
506
+
507
+ if dimension.nil?
508
+ raise Appwrite::Exception.new('Missing required parameter: "dimension"')
509
+ end
510
+
511
+ api_params = {
512
+ collectionId: collection_id,
513
+ name: name,
514
+ dimension: dimension,
515
+ permissions: permissions,
516
+ documentSecurity: document_security,
517
+ enabled: enabled,
518
+ }
519
+
520
+ api_headers = {
521
+ "X-Appwrite-Project": @client.get_config('project'),
522
+ "content-type": 'application/json',
523
+ "accept": 'application/json',
524
+ }
525
+
526
+ @client.call(
527
+ method: 'POST',
528
+ path: api_path,
529
+ headers: api_headers,
530
+ params: api_params,
531
+ response_type: Models::VectorsdbCollection
532
+ )
533
+ end
534
+
535
+ # Get a collection by its unique ID. This endpoint response returns a JSON
536
+ # object with the collection metadata.
537
+ #
538
+ # @param [String] database_id Database ID.
539
+ # @param [String] collection_id Collection ID.
540
+ #
541
+ # @return [VectorsdbCollection]
542
+ def get_collection(
543
+ database_id:,
544
+ collection_id:
545
+ )
546
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}'
547
+ .gsub('{databaseId}', database_id)
548
+ .gsub('{collectionId}', collection_id)
549
+
550
+ if database_id.nil?
551
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
552
+ end
553
+
554
+ if collection_id.nil?
555
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
556
+ end
557
+
558
+ api_params = {}
559
+
560
+ api_headers = {
561
+ "X-Appwrite-Project": @client.get_config('project'),
562
+ "accept": 'application/json',
563
+ }
564
+
565
+ @client.call(
566
+ method: 'GET',
567
+ path: api_path,
568
+ headers: api_headers,
569
+ params: api_params,
570
+ response_type: Models::VectorsdbCollection
571
+ )
572
+ end
573
+
574
+ # Update a collection by its unique ID.
575
+ #
576
+ # @param [String] database_id Database ID.
577
+ # @param [String] collection_id Collection ID.
578
+ # @param [String] name Collection name. Max length: 128 chars.
579
+ # @param [Integer] dimension Embedding dimensions.
580
+ # @param [Array] permissions An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
581
+ # @param [] document_security 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).
582
+ # @param [] enabled Is collection enabled? When set to &#039;disabled&#039;, 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.
583
+ #
584
+ # @return [VectorsdbCollection]
585
+ def update_collection(
586
+ database_id:,
587
+ collection_id:,
588
+ name:,
589
+ dimension: nil,
590
+ permissions: nil,
591
+ document_security: nil,
592
+ enabled: nil
593
+ )
594
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}'
595
+ .gsub('{databaseId}', database_id)
596
+ .gsub('{collectionId}', collection_id)
597
+
598
+ if database_id.nil?
599
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
600
+ end
601
+
602
+ if collection_id.nil?
603
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
604
+ end
605
+
606
+ if name.nil?
607
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
608
+ end
609
+
610
+ api_params = {
611
+ name: name,
612
+ dimension: dimension,
613
+ permissions: permissions,
614
+ documentSecurity: document_security,
615
+ enabled: enabled,
616
+ }
617
+
618
+ api_headers = {
619
+ "X-Appwrite-Project": @client.get_config('project'),
620
+ "content-type": 'application/json',
621
+ "accept": 'application/json',
622
+ }
623
+
624
+ @client.call(
625
+ method: 'PUT',
626
+ path: api_path,
627
+ headers: api_headers,
628
+ params: api_params,
629
+ response_type: Models::VectorsdbCollection
630
+ )
631
+ end
632
+
633
+ # Delete a collection by its unique ID. Only users with write permissions
634
+ # have access to delete this resource.
635
+ #
636
+ # @param [String] database_id Database ID.
637
+ # @param [String] collection_id Collection ID.
638
+ #
639
+ # @return []
640
+ def delete_collection(
641
+ database_id:,
642
+ collection_id:
643
+ )
644
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}'
645
+ .gsub('{databaseId}', database_id)
646
+ .gsub('{collectionId}', collection_id)
647
+
648
+ if database_id.nil?
649
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
650
+ end
651
+
652
+ if collection_id.nil?
653
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
654
+ end
655
+
656
+ api_params = {}
657
+
658
+ api_headers = {
659
+ "X-Appwrite-Project": @client.get_config('project'),
660
+ "content-type": 'application/json',
661
+ }
662
+
663
+ @client.call(
664
+ method: 'DELETE',
665
+ path: api_path,
666
+ headers: api_headers,
667
+ params: api_params,
668
+ )
669
+ end
670
+
671
+ # Get a list of all the user&#039;s documents in a given collection. You can use
672
+ # the query params to filter your results.
673
+ #
674
+ # @param [String] database_id Database ID.
675
+ # @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
676
+ # @param [Array] queries 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 524288 characters long.
677
+ # @param [String] transaction_id Transaction ID to read uncommitted changes within the transaction.
678
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
679
+ # @param [Integer] ttl TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
680
+ #
681
+ # @return [DocumentList]
682
+ def list_documents(
683
+ database_id:,
684
+ collection_id:,
685
+ queries: nil,
686
+ transaction_id: nil,
687
+ total: nil,
688
+ ttl: nil
689
+ )
690
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'
691
+ .gsub('{databaseId}', database_id)
692
+ .gsub('{collectionId}', collection_id)
693
+
694
+ if database_id.nil?
695
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
696
+ end
697
+
698
+ if collection_id.nil?
699
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
700
+ end
701
+
702
+ api_params = {
703
+ queries: queries,
704
+ transactionId: transaction_id,
705
+ total: total,
706
+ ttl: ttl,
707
+ }
708
+
709
+ api_headers = {
710
+ "X-Appwrite-Project": @client.get_config('project'),
711
+ "accept": 'application/json',
712
+ }
713
+
714
+ @client.call(
715
+ method: 'GET',
716
+ path: api_path,
717
+ headers: api_headers,
718
+ params: api_params,
719
+ response_type: Models::DocumentList
720
+ )
721
+ end
722
+
723
+ # Create a new Document. Before using this route, you should create a new
724
+ # collection resource using either a [server
725
+ # integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection)
726
+ # API or directly from your database console.
727
+ #
728
+ # @param [String] database_id Database ID.
729
+ # @param [String] collection_id 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.
730
+ # @param [String] document_id 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&#039;t start with a special char. Max length is 36 chars.
731
+ # @param [Hash] data Document data as JSON object.
732
+ # @param [Array] permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
733
+ #
734
+ # @return [Document]
735
+ def create_document(
736
+ database_id:,
737
+ collection_id:,
738
+ document_id:,
739
+ data:,
740
+ permissions: nil
741
+ )
742
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'
743
+ .gsub('{databaseId}', database_id)
744
+ .gsub('{collectionId}', collection_id)
745
+
746
+ if database_id.nil?
747
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
748
+ end
749
+
750
+ if collection_id.nil?
751
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
752
+ end
753
+
754
+ if document_id.nil?
755
+ raise Appwrite::Exception.new('Missing required parameter: "documentId"')
756
+ end
757
+
758
+ if data.nil?
759
+ raise Appwrite::Exception.new('Missing required parameter: "data"')
760
+ end
761
+
762
+ api_params = {
763
+ documentId: document_id,
764
+ data: data,
765
+ permissions: permissions,
766
+ }
767
+
768
+ api_headers = {
769
+ "X-Appwrite-Project": @client.get_config('project'),
770
+ "content-type": 'application/json',
771
+ "accept": 'application/json',
772
+ }
773
+
774
+ @client.call(
775
+ method: 'POST',
776
+ path: api_path,
777
+ headers: api_headers,
778
+ params: api_params,
779
+ response_type: Models::Document
780
+ )
781
+ end
782
+
783
+ # Create new Documents. Before using this route, you should create a new
784
+ # collection resource using either a [server
785
+ # integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection)
786
+ # API or directly from your database console.
787
+ #
788
+ # @param [String] database_id Database ID.
789
+ # @param [String] collection_id 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.
790
+ # @param [Array] documents Array of documents data as JSON objects.
791
+ #
792
+ # @return [DocumentList]
793
+ def create_documents(
794
+ database_id:,
795
+ collection_id:,
796
+ documents:
797
+ )
798
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'
799
+ .gsub('{databaseId}', database_id)
800
+ .gsub('{collectionId}', collection_id)
801
+
802
+ if database_id.nil?
803
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
804
+ end
805
+
806
+ if collection_id.nil?
807
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
808
+ end
809
+
810
+ if documents.nil?
811
+ raise Appwrite::Exception.new('Missing required parameter: "documents"')
812
+ end
813
+
814
+ api_params = {
815
+ documents: documents,
816
+ }
817
+
818
+ api_headers = {
819
+ "X-Appwrite-Project": @client.get_config('project'),
820
+ "content-type": 'application/json',
821
+ "accept": 'application/json',
822
+ }
823
+
824
+ @client.call(
825
+ method: 'POST',
826
+ path: api_path,
827
+ headers: api_headers,
828
+ params: api_params,
829
+ response_type: Models::DocumentList
830
+ )
831
+ end
832
+
833
+ # Create or update Documents. Before using this route, you should create a
834
+ # new collection resource using either a [server
835
+ # integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection)
836
+ # API or directly from your database console.
837
+ #
838
+ #
839
+ # @param [String] database_id Database ID.
840
+ # @param [String] collection_id Collection ID.
841
+ # @param [Array] documents Array of document data as JSON objects. May contain partial documents.
842
+ # @param [String] transaction_id Transaction ID for staging the operation.
843
+ #
844
+ # @return [DocumentList]
845
+ def upsert_documents(
846
+ database_id:,
847
+ collection_id:,
848
+ documents:,
849
+ transaction_id: nil
850
+ )
851
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'
852
+ .gsub('{databaseId}', database_id)
853
+ .gsub('{collectionId}', collection_id)
854
+
855
+ if database_id.nil?
856
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
857
+ end
858
+
859
+ if collection_id.nil?
860
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
861
+ end
862
+
863
+ if documents.nil?
864
+ raise Appwrite::Exception.new('Missing required parameter: "documents"')
865
+ end
866
+
867
+ api_params = {
868
+ documents: documents,
869
+ transactionId: transaction_id,
870
+ }
871
+
872
+ api_headers = {
873
+ "X-Appwrite-Project": @client.get_config('project'),
874
+ "content-type": 'application/json',
875
+ "accept": 'application/json',
876
+ }
877
+
878
+ @client.call(
879
+ method: 'PUT',
880
+ path: api_path,
881
+ headers: api_headers,
882
+ params: api_params,
883
+ response_type: Models::DocumentList
884
+ )
885
+ end
886
+
887
+ # Update all documents that match your queries, if no queries are submitted
888
+ # then all documents are updated. You can pass only specific fields to be
889
+ # updated.
890
+ #
891
+ # @param [String] database_id Database ID.
892
+ # @param [String] collection_id Collection ID.
893
+ # @param [Hash] data Document data as JSON object. Include only attribute and value pairs to be updated.
894
+ # @param [Array] queries 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.
895
+ # @param [String] transaction_id Transaction ID for staging the operation.
896
+ #
897
+ # @return [DocumentList]
898
+ def update_documents(
899
+ database_id:,
900
+ collection_id:,
901
+ data: nil,
902
+ queries: nil,
903
+ transaction_id: nil
904
+ )
905
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'
906
+ .gsub('{databaseId}', database_id)
907
+ .gsub('{collectionId}', collection_id)
908
+
909
+ if database_id.nil?
910
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
911
+ end
912
+
913
+ if collection_id.nil?
914
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
915
+ end
916
+
917
+ api_params = {
918
+ data: data,
919
+ queries: queries,
920
+ transactionId: transaction_id,
921
+ }
922
+
923
+ api_headers = {
924
+ "X-Appwrite-Project": @client.get_config('project'),
925
+ "content-type": 'application/json',
926
+ "accept": 'application/json',
927
+ }
928
+
929
+ @client.call(
930
+ method: 'PATCH',
931
+ path: api_path,
932
+ headers: api_headers,
933
+ params: api_params,
934
+ response_type: Models::DocumentList
935
+ )
936
+ end
937
+
938
+ # Bulk delete documents using queries, if no queries are passed then all
939
+ # documents are deleted.
940
+ #
941
+ # @param [String] database_id Database ID.
942
+ # @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
943
+ # @param [Array] queries 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.
944
+ # @param [String] transaction_id Transaction ID for staging the operation.
945
+ #
946
+ # @return [DocumentList]
947
+ def delete_documents(
948
+ database_id:,
949
+ collection_id:,
950
+ queries: nil,
951
+ transaction_id: nil
952
+ )
953
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'
954
+ .gsub('{databaseId}', database_id)
955
+ .gsub('{collectionId}', collection_id)
956
+
957
+ if database_id.nil?
958
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
959
+ end
960
+
961
+ if collection_id.nil?
962
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
963
+ end
964
+
965
+ api_params = {
966
+ queries: queries,
967
+ transactionId: transaction_id,
968
+ }
969
+
970
+ api_headers = {
971
+ "X-Appwrite-Project": @client.get_config('project'),
972
+ "content-type": 'application/json',
973
+ "accept": 'application/json',
974
+ }
975
+
976
+ @client.call(
977
+ method: 'DELETE',
978
+ path: api_path,
979
+ headers: api_headers,
980
+ params: api_params,
981
+ response_type: Models::DocumentList
982
+ )
983
+ end
984
+
985
+ # Get a list of all the user&#039;s documents in a given collection using a POST
986
+ # request. This behaves identically to the list documents endpoint but
987
+ # accepts the queries in the request body, allowing much larger `queries`
988
+ # arrays than can fit in a URL query string.
989
+ #
990
+ #
991
+ # @param [String] database_id Database ID.
992
+ # @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
993
+ # @param [Array] queries 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 524288 characters long.
994
+ # @param [String] transaction_id Transaction ID to read uncommitted changes within the transaction.
995
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
996
+ # @param [Integer] ttl TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
997
+ #
998
+ # @return [DocumentList]
999
+ def create_query(
1000
+ database_id:,
1001
+ collection_id:,
1002
+ queries: nil,
1003
+ transaction_id: nil,
1004
+ total: nil,
1005
+ ttl: nil
1006
+ )
1007
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/query'
1008
+ .gsub('{databaseId}', database_id)
1009
+ .gsub('{collectionId}', collection_id)
1010
+
1011
+ if database_id.nil?
1012
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1013
+ end
1014
+
1015
+ if collection_id.nil?
1016
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
1017
+ end
1018
+
1019
+ api_params = {
1020
+ queries: queries,
1021
+ transactionId: transaction_id,
1022
+ total: total,
1023
+ ttl: ttl,
1024
+ }
1025
+
1026
+ api_headers = {
1027
+ "X-Appwrite-Project": @client.get_config('project'),
1028
+ "content-type": 'application/json',
1029
+ "accept": 'application/json',
1030
+ }
1031
+
1032
+ @client.call(
1033
+ method: 'POST',
1034
+ path: api_path,
1035
+ headers: api_headers,
1036
+ params: api_params,
1037
+ response_type: Models::DocumentList
1038
+ )
1039
+ end
1040
+
1041
+ # Get a document by its unique ID. This endpoint response returns a JSON
1042
+ # object with the document data.
1043
+ #
1044
+ # @param [String] database_id Database ID.
1045
+ # @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1046
+ # @param [String] document_id Document ID.
1047
+ # @param [Array] queries 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.
1048
+ # @param [String] transaction_id Transaction ID to read uncommitted changes within the transaction.
1049
+ #
1050
+ # @return [Document]
1051
+ def get_document(
1052
+ database_id:,
1053
+ collection_id:,
1054
+ document_id:,
1055
+ queries: nil,
1056
+ transaction_id: nil
1057
+ )
1058
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'
1059
+ .gsub('{databaseId}', database_id)
1060
+ .gsub('{collectionId}', collection_id)
1061
+ .gsub('{documentId}', document_id)
1062
+
1063
+ if database_id.nil?
1064
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1065
+ end
1066
+
1067
+ if collection_id.nil?
1068
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
1069
+ end
1070
+
1071
+ if document_id.nil?
1072
+ raise Appwrite::Exception.new('Missing required parameter: "documentId"')
1073
+ end
1074
+
1075
+ api_params = {
1076
+ queries: queries,
1077
+ transactionId: transaction_id,
1078
+ }
1079
+
1080
+ api_headers = {
1081
+ "X-Appwrite-Project": @client.get_config('project'),
1082
+ "accept": 'application/json',
1083
+ }
1084
+
1085
+ @client.call(
1086
+ method: 'GET',
1087
+ path: api_path,
1088
+ headers: api_headers,
1089
+ params: api_params,
1090
+ response_type: Models::Document
1091
+ )
1092
+ end
1093
+
1094
+ # Create or update a Document. Before using this route, you should create a
1095
+ # new collection resource using either a [server
1096
+ # integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection)
1097
+ # API or directly from your database console.
1098
+ #
1099
+ # @param [String] database_id Database ID.
1100
+ # @param [String] collection_id Collection ID.
1101
+ # @param [String] document_id Document ID.
1102
+ # @param [Hash] data Document data as JSON object. Include all required fields of the document to be created or updated.
1103
+ # @param [Array] permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
1104
+ # @param [String] transaction_id Transaction ID for staging the operation.
1105
+ #
1106
+ # @return [Document]
1107
+ def upsert_document(
1108
+ database_id:,
1109
+ collection_id:,
1110
+ document_id:,
1111
+ data: nil,
1112
+ permissions: nil,
1113
+ transaction_id: nil
1114
+ )
1115
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'
1116
+ .gsub('{databaseId}', database_id)
1117
+ .gsub('{collectionId}', collection_id)
1118
+ .gsub('{documentId}', document_id)
1119
+
1120
+ if database_id.nil?
1121
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1122
+ end
1123
+
1124
+ if collection_id.nil?
1125
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
1126
+ end
1127
+
1128
+ if document_id.nil?
1129
+ raise Appwrite::Exception.new('Missing required parameter: "documentId"')
1130
+ end
1131
+
1132
+ api_params = {
1133
+ data: data,
1134
+ permissions: permissions,
1135
+ transactionId: transaction_id,
1136
+ }
1137
+
1138
+ api_headers = {
1139
+ "X-Appwrite-Project": @client.get_config('project'),
1140
+ "content-type": 'application/json',
1141
+ "accept": 'application/json',
1142
+ }
1143
+
1144
+ @client.call(
1145
+ method: 'PUT',
1146
+ path: api_path,
1147
+ headers: api_headers,
1148
+ params: api_params,
1149
+ response_type: Models::Document
1150
+ )
1151
+ end
1152
+
1153
+ # Update a document by its unique ID. Using the patch method you can pass
1154
+ # only specific fields that will get updated.
1155
+ #
1156
+ # @param [String] database_id Database ID.
1157
+ # @param [String] collection_id Collection ID.
1158
+ # @param [String] document_id Document ID.
1159
+ # @param [Hash] data Document data as JSON object. Include only fields and value pairs to be updated.
1160
+ # @param [Array] permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
1161
+ # @param [String] transaction_id Transaction ID for staging the operation.
1162
+ #
1163
+ # @return [Document]
1164
+ def update_document(
1165
+ database_id:,
1166
+ collection_id:,
1167
+ document_id:,
1168
+ data: nil,
1169
+ permissions: nil,
1170
+ transaction_id: nil
1171
+ )
1172
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'
1173
+ .gsub('{databaseId}', database_id)
1174
+ .gsub('{collectionId}', collection_id)
1175
+ .gsub('{documentId}', document_id)
1176
+
1177
+ if database_id.nil?
1178
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1179
+ end
1180
+
1181
+ if collection_id.nil?
1182
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
1183
+ end
1184
+
1185
+ if document_id.nil?
1186
+ raise Appwrite::Exception.new('Missing required parameter: "documentId"')
1187
+ end
1188
+
1189
+ api_params = {
1190
+ data: data,
1191
+ permissions: permissions,
1192
+ transactionId: transaction_id,
1193
+ }
1194
+
1195
+ api_headers = {
1196
+ "X-Appwrite-Project": @client.get_config('project'),
1197
+ "content-type": 'application/json',
1198
+ "accept": 'application/json',
1199
+ }
1200
+
1201
+ @client.call(
1202
+ method: 'PATCH',
1203
+ path: api_path,
1204
+ headers: api_headers,
1205
+ params: api_params,
1206
+ response_type: Models::Document
1207
+ )
1208
+ end
1209
+
1210
+ # Delete a document by its unique ID.
1211
+ #
1212
+ # @param [String] database_id Database ID.
1213
+ # @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1214
+ # @param [String] document_id Document ID.
1215
+ # @param [String] transaction_id Transaction ID for staging the operation.
1216
+ #
1217
+ # @return []
1218
+ def delete_document(
1219
+ database_id:,
1220
+ collection_id:,
1221
+ document_id:,
1222
+ transaction_id: nil
1223
+ )
1224
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'
1225
+ .gsub('{databaseId}', database_id)
1226
+ .gsub('{collectionId}', collection_id)
1227
+ .gsub('{documentId}', document_id)
1228
+
1229
+ if database_id.nil?
1230
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1231
+ end
1232
+
1233
+ if collection_id.nil?
1234
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
1235
+ end
1236
+
1237
+ if document_id.nil?
1238
+ raise Appwrite::Exception.new('Missing required parameter: "documentId"')
1239
+ end
1240
+
1241
+ api_params = {
1242
+ transactionId: transaction_id,
1243
+ }
1244
+
1245
+ api_headers = {
1246
+ "X-Appwrite-Project": @client.get_config('project'),
1247
+ "content-type": 'application/json',
1248
+ }
1249
+
1250
+ @client.call(
1251
+ method: 'DELETE',
1252
+ path: api_path,
1253
+ headers: api_headers,
1254
+ params: api_params,
1255
+ )
1256
+ end
1257
+
1258
+ # List indexes in the collection.
1259
+ #
1260
+ # @param [String] database_id Database ID.
1261
+ # @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1262
+ # @param [Array] queries 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
1263
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
1264
+ #
1265
+ # @return [IndexList]
1266
+ def list_indexes(
1267
+ database_id:,
1268
+ collection_id:,
1269
+ queries: nil,
1270
+ total: nil
1271
+ )
1272
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/indexes'
1273
+ .gsub('{databaseId}', database_id)
1274
+ .gsub('{collectionId}', collection_id)
1275
+
1276
+ if database_id.nil?
1277
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1278
+ end
1279
+
1280
+ if collection_id.nil?
1281
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
1282
+ end
1283
+
1284
+ api_params = {
1285
+ queries: queries,
1286
+ total: total,
1287
+ }
1288
+
1289
+ api_headers = {
1290
+ "X-Appwrite-Project": @client.get_config('project'),
1291
+ "accept": 'application/json',
1292
+ }
1293
+
1294
+ @client.call(
1295
+ method: 'GET',
1296
+ path: api_path,
1297
+ headers: api_headers,
1298
+ params: api_params,
1299
+ response_type: Models::IndexList
1300
+ )
1301
+ end
1302
+
1303
+ # Creates an index on the attributes listed. Your index should include all
1304
+ # the attributes you will query in a single request.
1305
+ # Attributes can be `key`, `fulltext`, and `unique`.
1306
+ #
1307
+ # @param [String] database_id Database ID.
1308
+ # @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1309
+ # @param [String] key Index Key.
1310
+ # @param [VectorsDBIndexType] type Index type.
1311
+ # @param [Array] attributes Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
1312
+ # @param [Array] orders Array of index orders. Maximum of 100 orders are allowed.
1313
+ # @param [Array] lengths Length of index. Maximum of 100
1314
+ #
1315
+ # @return [Index]
1316
+ def create_index(
1317
+ database_id:,
1318
+ collection_id:,
1319
+ key:,
1320
+ type:,
1321
+ attributes:,
1322
+ orders: nil,
1323
+ lengths: nil
1324
+ )
1325
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/indexes'
1326
+ .gsub('{databaseId}', database_id)
1327
+ .gsub('{collectionId}', collection_id)
1328
+
1329
+ if database_id.nil?
1330
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1331
+ end
1332
+
1333
+ if collection_id.nil?
1334
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
1335
+ end
1336
+
1337
+ if key.nil?
1338
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
1339
+ end
1340
+
1341
+ if type.nil?
1342
+ raise Appwrite::Exception.new('Missing required parameter: "type"')
1343
+ end
1344
+
1345
+ if attributes.nil?
1346
+ raise Appwrite::Exception.new('Missing required parameter: "attributes"')
1347
+ end
1348
+
1349
+ api_params = {
1350
+ key: key,
1351
+ type: type,
1352
+ attributes: attributes,
1353
+ orders: orders,
1354
+ lengths: lengths,
1355
+ }
1356
+
1357
+ api_headers = {
1358
+ "X-Appwrite-Project": @client.get_config('project'),
1359
+ "content-type": 'application/json',
1360
+ "accept": 'application/json',
1361
+ }
1362
+
1363
+ @client.call(
1364
+ method: 'POST',
1365
+ path: api_path,
1366
+ headers: api_headers,
1367
+ params: api_params,
1368
+ response_type: Models::Index
1369
+ )
1370
+ end
1371
+
1372
+ # Get index by ID.
1373
+ #
1374
+ # @param [String] database_id Database ID.
1375
+ # @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1376
+ # @param [String] key Index Key.
1377
+ #
1378
+ # @return [Index]
1379
+ def get_index(
1380
+ database_id:,
1381
+ collection_id:,
1382
+ key:
1383
+ )
1384
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}'
1385
+ .gsub('{databaseId}', database_id)
1386
+ .gsub('{collectionId}', collection_id)
1387
+ .gsub('{key}', key)
1388
+
1389
+ if database_id.nil?
1390
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1391
+ end
1392
+
1393
+ if collection_id.nil?
1394
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
1395
+ end
1396
+
1397
+ if key.nil?
1398
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
1399
+ end
1400
+
1401
+ api_params = {}
1402
+
1403
+ api_headers = {
1404
+ "X-Appwrite-Project": @client.get_config('project'),
1405
+ "accept": 'application/json',
1406
+ }
1407
+
1408
+ @client.call(
1409
+ method: 'GET',
1410
+ path: api_path,
1411
+ headers: api_headers,
1412
+ params: api_params,
1413
+ response_type: Models::Index
1414
+ )
1415
+ end
1416
+
1417
+ # Delete an index.
1418
+ #
1419
+ # @param [String] database_id Database ID.
1420
+ # @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1421
+ # @param [String] key Index Key.
1422
+ #
1423
+ # @return []
1424
+ def delete_index(
1425
+ database_id:,
1426
+ collection_id:,
1427
+ key:
1428
+ )
1429
+ api_path = '/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}'
1430
+ .gsub('{databaseId}', database_id)
1431
+ .gsub('{collectionId}', collection_id)
1432
+ .gsub('{key}', key)
1433
+
1434
+ if database_id.nil?
1435
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1436
+ end
1437
+
1438
+ if collection_id.nil?
1439
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
1440
+ end
1441
+
1442
+ if key.nil?
1443
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
1444
+ end
1445
+
1446
+ api_params = {}
1447
+
1448
+ api_headers = {
1449
+ "X-Appwrite-Project": @client.get_config('project'),
1450
+ "content-type": 'application/json',
1451
+ }
1452
+
1453
+ @client.call(
1454
+ method: 'DELETE',
1455
+ path: api_path,
1456
+ headers: api_headers,
1457
+ params: api_params,
1458
+ )
1459
+ end
1460
+
1461
+ # Trigger a manual failover for a dedicated database with high availability
1462
+ # enabled. Promotes a replica to primary. The failover runs asynchronously;
1463
+ # poll the database document for status updates. A database left
1464
+ # mid-operation also accepts this call as a repair once nothing is driving
1465
+ # the operation it is stuck in. Repairing a failover that did not finish, a
1466
+ # `failed` database, a stranded upgrade or migrate, or a stranded compute
1467
+ # resize additionally requires `targetReplicaId` to name the member to
1468
+ # promote, because the default target may be the member that operation
1469
+ # already promoted.
1470
+ #
1471
+ # @param [String] database_id Database ID.
1472
+ # @param [String] target_replica_id Target replica ID to promote. If not specified, the healthiest replica is selected.
1473
+ #
1474
+ # @return [DedicatedDatabase]
1475
+ def create_failover(
1476
+ database_id:,
1477
+ target_replica_id: nil
1478
+ )
1479
+ api_path = '/vectorsdb/{databaseId}/failovers'
1480
+ .gsub('{databaseId}', database_id)
1481
+
1482
+ if database_id.nil?
1483
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1484
+ end
1485
+
1486
+ api_params = {
1487
+ targetReplicaId: target_replica_id,
1488
+ }
1489
+
1490
+ api_headers = {
1491
+ "X-Appwrite-Project": @client.get_config('project'),
1492
+ "content-type": 'application/json',
1493
+ "accept": 'application/json',
1494
+ }
1495
+
1496
+ @client.call(
1497
+ method: 'POST',
1498
+ path: api_path,
1499
+ headers: api_headers,
1500
+ params: api_params,
1501
+ response_type: Models::DedicatedDatabase
1502
+ )
1503
+ end
1504
+
1505
+ # List the lifecycle operations recorded for a dedicated database, newest
1506
+ # first. Every provision, update, restore, backup and replication action is
1507
+ # recorded here with its outcome, including an attempt that was abandoned
1508
+ # because another worker took over the database.
1509
+ #
1510
+ # @param [String] database_id Database ID.
1511
+ # @param [String] status Filter by operation status.
1512
+ # @param [Integer] limit Maximum number of operations to return.
1513
+ # @param [Integer] offset Number of operations to skip.
1514
+ #
1515
+ # @return [DedicatedDatabaseOperationList]
1516
+ def list_operations(
1517
+ database_id:,
1518
+ status: nil,
1519
+ limit: nil,
1520
+ offset: nil
1521
+ )
1522
+ api_path = '/vectorsdb/{databaseId}/operations'
1523
+ .gsub('{databaseId}', database_id)
1524
+
1525
+ if database_id.nil?
1526
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1527
+ end
1528
+
1529
+ api_params = {
1530
+ status: status,
1531
+ limit: limit,
1532
+ offset: offset,
1533
+ }
1534
+
1535
+ api_headers = {
1536
+ "X-Appwrite-Project": @client.get_config('project'),
1537
+ "accept": 'application/json',
1538
+ }
1539
+
1540
+ @client.call(
1541
+ method: 'GET',
1542
+ path: api_path,
1543
+ headers: api_headers,
1544
+ params: api_params,
1545
+ response_type: Models::DedicatedDatabaseOperationList
1546
+ )
1547
+ end
1548
+
1549
+ # Get high availability status for a dedicated database. Returns replica
1550
+ # statuses, replication lag, and sync mode.
1551
+ #
1552
+ # @param [String] database_id Database ID.
1553
+ #
1554
+ # @return [DedicatedDatabaseReplicas]
1555
+ def get_replicas(
1556
+ database_id:
1557
+ )
1558
+ api_path = '/vectorsdb/{databaseId}/replicas'
1559
+ .gsub('{databaseId}', database_id)
1560
+
1561
+ if database_id.nil?
1562
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1563
+ end
1564
+
1565
+ api_params = {}
1566
+
1567
+ api_headers = {
1568
+ "X-Appwrite-Project": @client.get_config('project'),
1569
+ "accept": 'application/json',
1570
+ }
1571
+
1572
+ @client.call(
1573
+ method: 'GET',
1574
+ path: api_path,
1575
+ headers: api_headers,
1576
+ params: api_params,
1577
+ response_type: Models::DedicatedDatabaseReplicas
1578
+ )
1579
+ end
1580
+
1581
+ # Get real-time health and status information for a dedicated database.
1582
+ # Returns health status, readiness, uptime, connection info, replica status,
1583
+ # and volume information.
1584
+ #
1585
+ # @param [String] database_id Database ID.
1586
+ #
1587
+ # @return [DatabaseStatus]
1588
+ def get_status(
1589
+ database_id:
1590
+ )
1591
+ api_path = '/vectorsdb/{databaseId}/status'
1592
+ .gsub('{databaseId}', database_id)
1593
+
1594
+ if database_id.nil?
1595
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1596
+ end
1597
+
1598
+ api_params = {}
1599
+
1600
+ api_headers = {
1601
+ "X-Appwrite-Project": @client.get_config('project'),
1602
+ "accept": 'application/json',
1603
+ }
1604
+
1605
+ @client.call(
1606
+ method: 'GET',
1607
+ path: api_path,
1608
+ headers: api_headers,
1609
+ params: api_params,
1610
+ response_type: Models::DatabaseStatus
1611
+ )
1612
+ end
1613
+ end
1614
+ end