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,1503 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ class Mysql < Service
5
+ def initialize(client)
6
+ @client = client
7
+ end
8
+
9
+ # List all dedicated databases. Results support pagination.
10
+ #
11
+ # @param [Array] queries Array of query strings.
12
+ #
13
+ # @return [DedicatedDatabaseList]
14
+ def list(
15
+ queries: nil
16
+ )
17
+ api_path = '/mysql'
18
+
19
+ api_params = {
20
+ queries: queries,
21
+ }
22
+
23
+ api_headers = {
24
+ "X-Appwrite-Project": @client.get_config('project'),
25
+ "accept": 'application/json',
26
+ }
27
+
28
+ @client.call(
29
+ method: 'GET',
30
+ path: api_path,
31
+ headers: api_headers,
32
+ params: api_params,
33
+ response_type: Models::DedicatedDatabaseList
34
+ )
35
+ end
36
+
37
+ # Create a new dedicated database with the chosen engine and configuration.
38
+ # Status will be &#039;provisioning&#039; until the database is ready.
39
+ #
40
+ # @param [String] database_id Database 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.
41
+ # @param [String] name Database display name. Max length: 128 chars.
42
+ # @param [String] version Database engine version. Defaults to latest for selected engine.
43
+ # @param [String] specification Specification identifier. Drives the allocated CPU, memory, storage, storage class, and connection ceiling.
44
+ # @param [Integer] replicas Number of high availability replicas (0-5). High availability is enabled when greater than 0.
45
+ # @param [String] sync_mode Replication sync mode preference. Allowed values: async, sync, quorum.
46
+ # @param [Integer] network_idle_timeout_seconds Connection idle timeout in seconds.
47
+ # @param [Array] network_ip_allowlist IP addresses/CIDR ranges allowed to connect.
48
+ # @param [Integer] idle_timeout_minutes Minutes of inactivity before container scales to zero.
49
+ # @param [] pitr Enable point-in-time recovery (PITR). Continuously archives changes so the database can be restored to any moment within the retention window.
50
+ # @param [Integer] pitr_retention_days Number of days to retain PITR data.
51
+ # @param [] storage_autoscaling Enable automatic storage expansion when usage exceeds threshold.
52
+ # @param [Integer] storage_autoscaling_threshold_percent Storage usage percentage (50-95) that triggers automatic expansion.
53
+ # @param [Integer] storage_autoscaling_max_gb Maximum storage size in GB for autoscaling. 0 means no limit.
54
+ #
55
+ # @return [DedicatedDatabase]
56
+ def create(
57
+ database_id:,
58
+ name:,
59
+ version: nil,
60
+ specification: nil,
61
+ replicas: nil,
62
+ sync_mode: nil,
63
+ network_idle_timeout_seconds: nil,
64
+ network_ip_allowlist: nil,
65
+ idle_timeout_minutes: nil,
66
+ pitr: nil,
67
+ pitr_retention_days: nil,
68
+ storage_autoscaling: nil,
69
+ storage_autoscaling_threshold_percent: nil,
70
+ storage_autoscaling_max_gb: nil
71
+ )
72
+ api_path = '/mysql'
73
+
74
+ if database_id.nil?
75
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
76
+ end
77
+
78
+ if name.nil?
79
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
80
+ end
81
+
82
+ api_params = {
83
+ databaseId: database_id,
84
+ name: name,
85
+ version: version,
86
+ specification: specification,
87
+ replicas: replicas,
88
+ syncMode: sync_mode,
89
+ networkIdleTimeoutSeconds: network_idle_timeout_seconds,
90
+ networkIPAllowlist: network_ip_allowlist,
91
+ idleTimeoutMinutes: idle_timeout_minutes,
92
+ pitr: pitr,
93
+ pitrRetentionDays: pitr_retention_days,
94
+ storageAutoscaling: storage_autoscaling,
95
+ storageAutoscalingThresholdPercent: storage_autoscaling_threshold_percent,
96
+ storageAutoscalingMaxGb: storage_autoscaling_max_gb,
97
+ }
98
+
99
+ api_headers = {
100
+ "X-Appwrite-Project": @client.get_config('project'),
101
+ "content-type": 'application/json',
102
+ "accept": 'application/json',
103
+ }
104
+
105
+ @client.call(
106
+ method: 'POST',
107
+ path: api_path,
108
+ headers: api_headers,
109
+ params: api_params,
110
+ response_type: Models::DedicatedDatabase
111
+ )
112
+ end
113
+
114
+ # List the dedicated database specifications available on the current plan.
115
+ # Each specification reports its resource limits, pricing, and whether it is
116
+ # enabled for the organization.
117
+ #
118
+ #
119
+ # @return [DedicatedDatabaseSpecificationList]
120
+ def list_specifications()
121
+ api_path = '/mysql/specifications'
122
+
123
+ api_params = {}
124
+
125
+ api_headers = {
126
+ "X-Appwrite-Project": @client.get_config('project'),
127
+ "accept": 'application/json',
128
+ }
129
+
130
+ @client.call(
131
+ method: 'GET',
132
+ path: api_path,
133
+ headers: api_headers,
134
+ params: api_params,
135
+ response_type: Models::DedicatedDatabaseSpecificationList
136
+ )
137
+ end
138
+
139
+ # Get a dedicated database by its unique ID. Returns the database
140
+ # configuration and current status.
141
+ #
142
+ # @param [String] database_id Database ID.
143
+ #
144
+ # @return [DedicatedDatabase]
145
+ def get(
146
+ database_id:
147
+ )
148
+ api_path = '/mysql/{databaseId}'
149
+ .gsub('{databaseId}', database_id)
150
+
151
+ if database_id.nil?
152
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
153
+ end
154
+
155
+ api_params = {}
156
+
157
+ api_headers = {
158
+ "X-Appwrite-Project": @client.get_config('project'),
159
+ "accept": 'application/json',
160
+ }
161
+
162
+ @client.call(
163
+ method: 'GET',
164
+ path: api_path,
165
+ headers: api_headers,
166
+ params: api_params,
167
+ response_type: Models::DedicatedDatabase
168
+ )
169
+ end
170
+
171
+ # Update a dedicated database configuration. All changes are applied with
172
+ # zero downtime. Specification changes (cpu, memory, storage) are handled via
173
+ # rolling cutover. Storage expansion is done online. All other settings are
174
+ # applied in-place.
175
+ #
176
+ # @param [String] database_id Database ID.
177
+ # @param [String] name Database display name.
178
+ # @param [String] status Database status. Allowed values: ready, paused, inactive. Set to &quot;paused&quot; to pause, &quot;ready&quot; to resume (also recovers a failed database whose infrastructure is healthy), or &quot;inactive&quot; to spin down a shared-pool database.
179
+ # @param [String] specification Specification. Changes cpu, memory, storage, connection ceiling, and node pool based on specification config. Resource changes are applied via rolling cutover with zero downtime.
180
+ # @param [Integer] replicas Number of high availability replicas (0-5). High availability is enabled when greater than 0.
181
+ # @param [String] sync_mode Replication sync mode preference. Allowed values: async, sync, quorum.
182
+ # @param [Integer] network_idle_timeout_seconds Connection idle timeout in seconds (60-86400).
183
+ # @param [Array] network_ip_allowlist IP addresses/CIDR ranges allowed to connect.
184
+ # @param [Integer] idle_timeout_minutes Minutes before container scales to zero.
185
+ # @param [] pitr Enable or disable point-in-time recovery (PITR).
186
+ # @param [Integer] pitr_retention_days Days to retain PITR data.
187
+ # @param [] storage_autoscaling Enable automatic storage expansion when usage exceeds threshold.
188
+ # @param [Integer] storage_autoscaling_threshold_percent Storage usage percentage (50-95) that triggers automatic expansion.
189
+ # @param [Integer] storage_autoscaling_max_gb Maximum storage size in GB for autoscaling. 0 means no limit.
190
+ # @param [Float] metrics_trace_sample_rate Fraction of queries to trace (0.0–1.0). Forwarded to the sidecar.
191
+ # @param [Integer] metrics_slow_query_log_threshold_ms Threshold in ms above which queries are logged as slow. Forwarded to the sidecar.
192
+ # @param [] sql_api_enabled Enable the SQL API sidecar for this database.
193
+ # @param [Array] sql_api_allowed_statements Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE.
194
+ # @param [Integer] sql_api_max_rows Maximum rows returned per SQL API execution (1-1000000).
195
+ # @param [Integer] sql_api_max_bytes Maximum serialised SQL API result payload in bytes (1024-104857600).
196
+ # @param [Integer] sql_api_timeout_seconds Per-call SQL API execution timeout in seconds (1-300).
197
+ #
198
+ # @return [DedicatedDatabase]
199
+ def update(
200
+ database_id:,
201
+ name: nil,
202
+ status: nil,
203
+ specification: nil,
204
+ replicas: nil,
205
+ sync_mode: nil,
206
+ network_idle_timeout_seconds: nil,
207
+ network_ip_allowlist: nil,
208
+ idle_timeout_minutes: nil,
209
+ pitr: nil,
210
+ pitr_retention_days: nil,
211
+ storage_autoscaling: nil,
212
+ storage_autoscaling_threshold_percent: nil,
213
+ storage_autoscaling_max_gb: nil,
214
+ metrics_trace_sample_rate: nil,
215
+ metrics_slow_query_log_threshold_ms: nil,
216
+ sql_api_enabled: nil,
217
+ sql_api_allowed_statements: nil,
218
+ sql_api_max_rows: nil,
219
+ sql_api_max_bytes: nil,
220
+ sql_api_timeout_seconds: nil
221
+ )
222
+ api_path = '/mysql/{databaseId}'
223
+ .gsub('{databaseId}', database_id)
224
+
225
+ if database_id.nil?
226
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
227
+ end
228
+
229
+ api_params = {
230
+ name: name,
231
+ status: status,
232
+ specification: specification,
233
+ replicas: replicas,
234
+ syncMode: sync_mode,
235
+ networkIdleTimeoutSeconds: network_idle_timeout_seconds,
236
+ networkIPAllowlist: network_ip_allowlist,
237
+ idleTimeoutMinutes: idle_timeout_minutes,
238
+ pitr: pitr,
239
+ pitrRetentionDays: pitr_retention_days,
240
+ storageAutoscaling: storage_autoscaling,
241
+ storageAutoscalingThresholdPercent: storage_autoscaling_threshold_percent,
242
+ storageAutoscalingMaxGb: storage_autoscaling_max_gb,
243
+ metricsTraceSampleRate: metrics_trace_sample_rate,
244
+ metricsSlowQueryLogThresholdMs: metrics_slow_query_log_threshold_ms,
245
+ sqlApiEnabled: sql_api_enabled,
246
+ sqlApiAllowedStatements: sql_api_allowed_statements,
247
+ sqlApiMaxRows: sql_api_max_rows,
248
+ sqlApiMaxBytes: sql_api_max_bytes,
249
+ sqlApiTimeoutSeconds: sql_api_timeout_seconds,
250
+ }
251
+
252
+ api_headers = {
253
+ "X-Appwrite-Project": @client.get_config('project'),
254
+ "content-type": 'application/json',
255
+ "accept": 'application/json',
256
+ }
257
+
258
+ @client.call(
259
+ method: 'PATCH',
260
+ path: api_path,
261
+ headers: api_headers,
262
+ params: api_params,
263
+ response_type: Models::DedicatedDatabase
264
+ )
265
+ end
266
+
267
+ # Delete a dedicated database. This action is irreversible. The database
268
+ # status will be set to &#039;deleting&#039; and all resources will be cleaned up.
269
+ # Deletion is allowed from any state, and repeating the call re-dispatches
270
+ # the cleanup.
271
+ #
272
+ # @param [String] database_id Database ID.
273
+ #
274
+ # @return []
275
+ def delete(
276
+ database_id:
277
+ )
278
+ api_path = '/mysql/{databaseId}'
279
+ .gsub('{databaseId}', database_id)
280
+
281
+ if database_id.nil?
282
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
283
+ end
284
+
285
+ api_params = {}
286
+
287
+ api_headers = {
288
+ "X-Appwrite-Project": @client.get_config('project'),
289
+ "content-type": 'application/json',
290
+ "accept": 'application/json',
291
+ }
292
+
293
+ @client.call(
294
+ method: 'DELETE',
295
+ path: api_path,
296
+ headers: api_headers,
297
+ params: api_params,
298
+ )
299
+ end
300
+
301
+ # List all backups for a dedicated database. Results can be filtered by
302
+ # status and type.
303
+ #
304
+ # @param [String] database_id Database ID.
305
+ # @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: status, type, databaseId
306
+ #
307
+ # @return [DedicatedDatabaseBackupList]
308
+ def list_backups(
309
+ database_id:,
310
+ queries: nil
311
+ )
312
+ api_path = '/mysql/{databaseId}/backups'
313
+ .gsub('{databaseId}', database_id)
314
+
315
+ if database_id.nil?
316
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
317
+ end
318
+
319
+ api_params = {
320
+ queries: queries,
321
+ }
322
+
323
+ api_headers = {
324
+ "X-Appwrite-Project": @client.get_config('project'),
325
+ "accept": 'application/json',
326
+ }
327
+
328
+ @client.call(
329
+ method: 'GET',
330
+ path: api_path,
331
+ headers: api_headers,
332
+ params: api_params,
333
+ response_type: Models::DedicatedDatabaseBackupList
334
+ )
335
+ end
336
+
337
+ # Create a manual backup of a dedicated database. The backup will be created
338
+ # asynchronously and its status can be checked via the get backup endpoint.
339
+ #
340
+ # @param [String] database_id Database ID.
341
+ # @param [String] type Backup type: full or incremental.
342
+ #
343
+ # @return [DedicatedDatabaseBackup]
344
+ def create_backup(
345
+ database_id:,
346
+ type: nil
347
+ )
348
+ api_path = '/mysql/{databaseId}/backups'
349
+ .gsub('{databaseId}', database_id)
350
+
351
+ if database_id.nil?
352
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
353
+ end
354
+
355
+ api_params = {
356
+ type: type,
357
+ }
358
+
359
+ api_headers = {
360
+ "X-Appwrite-Project": @client.get_config('project'),
361
+ "content-type": 'application/json',
362
+ "accept": 'application/json',
363
+ }
364
+
365
+ @client.call(
366
+ method: 'POST',
367
+ path: api_path,
368
+ headers: api_headers,
369
+ params: api_params,
370
+ response_type: Models::DedicatedDatabaseBackup
371
+ )
372
+ end
373
+
374
+ # List scheduled backup policies for a dedicated database.
375
+ #
376
+ # @param [String] database_id Database ID.
377
+ # @param [Array] queries Array of query strings generated using the Query class provided by the SDK.
378
+ #
379
+ # @return [BackupPolicyList]
380
+ def list_backup_policies(
381
+ database_id:,
382
+ queries: nil
383
+ )
384
+ api_path = '/mysql/{databaseId}/backups/policies'
385
+ .gsub('{databaseId}', database_id)
386
+
387
+ if database_id.nil?
388
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
389
+ end
390
+
391
+ api_params = {
392
+ queries: queries,
393
+ }
394
+
395
+ api_headers = {
396
+ "X-Appwrite-Project": @client.get_config('project'),
397
+ "accept": 'application/json',
398
+ }
399
+
400
+ @client.call(
401
+ method: 'GET',
402
+ path: api_path,
403
+ headers: api_headers,
404
+ params: api_params,
405
+ response_type: Models::BackupPolicyList
406
+ )
407
+ end
408
+
409
+ # Create a scheduled backup policy for a dedicated database.
410
+ #
411
+ # @param [String] database_id Database ID.
412
+ # @param [String] policy_id Policy 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.
413
+ # @param [String] name Policy name. Max length: 128 chars.
414
+ # @param [String] schedule Schedule CRON syntax.
415
+ # @param [Integer] retention Days to keep backups before deletion.
416
+ # @param [String] type Backup type: full or incremental.
417
+ # @param [] enabled Is policy enabled? When disabled, no backups will be taken.
418
+ #
419
+ # @return [BackupPolicy]
420
+ def create_backup_policy(
421
+ database_id:,
422
+ policy_id:,
423
+ name:,
424
+ schedule:,
425
+ retention:,
426
+ type: nil,
427
+ enabled: nil
428
+ )
429
+ api_path = '/mysql/{databaseId}/backups/policies'
430
+ .gsub('{databaseId}', database_id)
431
+
432
+ if database_id.nil?
433
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
434
+ end
435
+
436
+ if policy_id.nil?
437
+ raise Appwrite::Exception.new('Missing required parameter: "policyId"')
438
+ end
439
+
440
+ if name.nil?
441
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
442
+ end
443
+
444
+ if schedule.nil?
445
+ raise Appwrite::Exception.new('Missing required parameter: "schedule"')
446
+ end
447
+
448
+ if retention.nil?
449
+ raise Appwrite::Exception.new('Missing required parameter: "retention"')
450
+ end
451
+
452
+ api_params = {
453
+ policyId: policy_id,
454
+ name: name,
455
+ schedule: schedule,
456
+ retention: retention,
457
+ type: type,
458
+ enabled: enabled,
459
+ }
460
+
461
+ api_headers = {
462
+ "X-Appwrite-Project": @client.get_config('project'),
463
+ "content-type": 'application/json',
464
+ "accept": 'application/json',
465
+ }
466
+
467
+ @client.call(
468
+ method: 'POST',
469
+ path: api_path,
470
+ headers: api_headers,
471
+ params: api_params,
472
+ response_type: Models::BackupPolicy
473
+ )
474
+ end
475
+
476
+ # Get a scheduled backup policy for a dedicated database.
477
+ #
478
+ # @param [String] database_id Database ID.
479
+ # @param [String] policy_id Policy ID.
480
+ #
481
+ # @return [BackupPolicy]
482
+ def get_backup_policy(
483
+ database_id:,
484
+ policy_id:
485
+ )
486
+ api_path = '/mysql/{databaseId}/backups/policies/{policyId}'
487
+ .gsub('{databaseId}', database_id)
488
+ .gsub('{policyId}', policy_id)
489
+
490
+ if database_id.nil?
491
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
492
+ end
493
+
494
+ if policy_id.nil?
495
+ raise Appwrite::Exception.new('Missing required parameter: "policyId"')
496
+ end
497
+
498
+ api_params = {}
499
+
500
+ api_headers = {
501
+ "X-Appwrite-Project": @client.get_config('project'),
502
+ "accept": 'application/json',
503
+ }
504
+
505
+ @client.call(
506
+ method: 'GET',
507
+ path: api_path,
508
+ headers: api_headers,
509
+ params: api_params,
510
+ response_type: Models::BackupPolicy
511
+ )
512
+ end
513
+
514
+ # Update a scheduled backup policy for a dedicated database.
515
+ #
516
+ # @param [String] database_id Database ID.
517
+ # @param [String] policy_id Policy ID.
518
+ # @param [String] name Policy name. Max length: 128 chars.
519
+ # @param [String] schedule Schedule CRON syntax.
520
+ # @param [Integer] retention Days to keep backups before deletion.
521
+ # @param [] enabled Is policy enabled? When disabled, no backups will be taken.
522
+ #
523
+ # @return [BackupPolicy]
524
+ def update_backup_policy(
525
+ database_id:,
526
+ policy_id:,
527
+ name: nil,
528
+ schedule: nil,
529
+ retention: nil,
530
+ enabled: nil
531
+ )
532
+ api_path = '/mysql/{databaseId}/backups/policies/{policyId}'
533
+ .gsub('{databaseId}', database_id)
534
+ .gsub('{policyId}', policy_id)
535
+
536
+ if database_id.nil?
537
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
538
+ end
539
+
540
+ if policy_id.nil?
541
+ raise Appwrite::Exception.new('Missing required parameter: "policyId"')
542
+ end
543
+
544
+ api_params = {
545
+ name: name,
546
+ schedule: schedule,
547
+ retention: retention,
548
+ enabled: enabled,
549
+ }
550
+
551
+ api_headers = {
552
+ "X-Appwrite-Project": @client.get_config('project'),
553
+ "content-type": 'application/json',
554
+ "accept": 'application/json',
555
+ }
556
+
557
+ @client.call(
558
+ method: 'PATCH',
559
+ path: api_path,
560
+ headers: api_headers,
561
+ params: api_params,
562
+ response_type: Models::BackupPolicy
563
+ )
564
+ end
565
+
566
+ # Delete a scheduled backup policy for a dedicated database. Backups already
567
+ # taken by the policy are kept until their retention expires.
568
+ #
569
+ # @param [String] database_id Database ID.
570
+ # @param [String] policy_id Policy ID.
571
+ #
572
+ # @return []
573
+ def delete_backup_policy(
574
+ database_id:,
575
+ policy_id:
576
+ )
577
+ api_path = '/mysql/{databaseId}/backups/policies/{policyId}'
578
+ .gsub('{databaseId}', database_id)
579
+ .gsub('{policyId}', policy_id)
580
+
581
+ if database_id.nil?
582
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
583
+ end
584
+
585
+ if policy_id.nil?
586
+ raise Appwrite::Exception.new('Missing required parameter: "policyId"')
587
+ end
588
+
589
+ api_params = {}
590
+
591
+ api_headers = {
592
+ "X-Appwrite-Project": @client.get_config('project'),
593
+ "content-type": 'application/json',
594
+ "accept": 'application/json',
595
+ }
596
+
597
+ @client.call(
598
+ method: 'DELETE',
599
+ path: api_path,
600
+ headers: api_headers,
601
+ params: api_params,
602
+ )
603
+ end
604
+
605
+ # Configure off-cluster backup storage for a dedicated database. Supports S3,
606
+ # GCS, and Azure Blob Storage destinations. Backups will be stored to the
607
+ # configured destination in addition to on-cluster storage.
608
+ #
609
+ # @param [String] database_id Database ID.
610
+ # @param [String] provider Storage provider for off-cluster backups. Allowed values: s3 (Amazon S3 or S3-compatible), gcs (Google Cloud Storage), azure (Azure Blob Storage).
611
+ # @param [String] bucket Storage bucket or container name.
612
+ # @param [String] access_key Access key or client ID for authentication.
613
+ # @param [String] secret_key Secret key or service account JSON for authentication.
614
+ # @param [String] region Storage region.
615
+ # @param [String] prefix Object key prefix for backups.
616
+ # @param [String] endpoint Custom endpoint for S3-compatible storage (e.g. MinIO).
617
+ #
618
+ # @return [DedicatedDatabaseBackupStorage]
619
+ def update_backup_storage(
620
+ database_id:,
621
+ provider:,
622
+ bucket:,
623
+ access_key:,
624
+ secret_key:,
625
+ region: nil,
626
+ prefix: nil,
627
+ endpoint: nil
628
+ )
629
+ api_path = '/mysql/{databaseId}/backups/storage'
630
+ .gsub('{databaseId}', database_id)
631
+
632
+ if database_id.nil?
633
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
634
+ end
635
+
636
+ if provider.nil?
637
+ raise Appwrite::Exception.new('Missing required parameter: "provider"')
638
+ end
639
+
640
+ if bucket.nil?
641
+ raise Appwrite::Exception.new('Missing required parameter: "bucket"')
642
+ end
643
+
644
+ if access_key.nil?
645
+ raise Appwrite::Exception.new('Missing required parameter: "accessKey"')
646
+ end
647
+
648
+ if secret_key.nil?
649
+ raise Appwrite::Exception.new('Missing required parameter: "secretKey"')
650
+ end
651
+
652
+ api_params = {
653
+ provider: provider,
654
+ bucket: bucket,
655
+ region: region,
656
+ prefix: prefix,
657
+ endpoint: endpoint,
658
+ accessKey: access_key,
659
+ secretKey: secret_key,
660
+ }
661
+
662
+ api_headers = {
663
+ "X-Appwrite-Project": @client.get_config('project'),
664
+ "content-type": 'application/json',
665
+ "accept": 'application/json',
666
+ }
667
+
668
+ @client.call(
669
+ method: 'PUT',
670
+ path: api_path,
671
+ headers: api_headers,
672
+ params: api_params,
673
+ response_type: Models::DedicatedDatabaseBackupStorage
674
+ )
675
+ end
676
+
677
+ # Get details of a specific database backup including its status, size, and
678
+ # timestamps.
679
+ #
680
+ # @param [String] database_id Database ID.
681
+ # @param [String] backup_id Backup ID.
682
+ #
683
+ # @return [DedicatedDatabaseBackup]
684
+ def get_backup(
685
+ database_id:,
686
+ backup_id:
687
+ )
688
+ api_path = '/mysql/{databaseId}/backups/{backupId}'
689
+ .gsub('{databaseId}', database_id)
690
+ .gsub('{backupId}', backup_id)
691
+
692
+ if database_id.nil?
693
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
694
+ end
695
+
696
+ if backup_id.nil?
697
+ raise Appwrite::Exception.new('Missing required parameter: "backupId"')
698
+ end
699
+
700
+ api_params = {}
701
+
702
+ api_headers = {
703
+ "X-Appwrite-Project": @client.get_config('project'),
704
+ "accept": 'application/json',
705
+ }
706
+
707
+ @client.call(
708
+ method: 'GET',
709
+ path: api_path,
710
+ headers: api_headers,
711
+ params: api_params,
712
+ response_type: Models::DedicatedDatabaseBackup
713
+ )
714
+ end
715
+
716
+ # Delete a database backup. This will permanently remove the backup from
717
+ # storage and cannot be undone.
718
+ #
719
+ # @param [String] database_id Database ID.
720
+ # @param [String] backup_id Backup ID.
721
+ #
722
+ # @return []
723
+ def delete_backup(
724
+ database_id:,
725
+ backup_id:
726
+ )
727
+ api_path = '/mysql/{databaseId}/backups/{backupId}'
728
+ .gsub('{databaseId}', database_id)
729
+ .gsub('{backupId}', backup_id)
730
+
731
+ if database_id.nil?
732
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
733
+ end
734
+
735
+ if backup_id.nil?
736
+ raise Appwrite::Exception.new('Missing required parameter: "backupId"')
737
+ end
738
+
739
+ api_params = {}
740
+
741
+ api_headers = {
742
+ "X-Appwrite-Project": @client.get_config('project'),
743
+ "content-type": 'application/json',
744
+ "accept": 'application/json',
745
+ }
746
+
747
+ @client.call(
748
+ method: 'DELETE',
749
+ path: api_path,
750
+ headers: api_headers,
751
+ params: api_params,
752
+ )
753
+ end
754
+
755
+ # List all ephemeral branches for a dedicated database. Returns branch
756
+ # metadata including ID, name, namespace, and expiration time.
757
+ #
758
+ # @param [String] database_id Database ID.
759
+ #
760
+ # @return [DedicatedDatabaseBranchList]
761
+ def list_branches(
762
+ database_id:
763
+ )
764
+ api_path = '/mysql/{databaseId}/branches'
765
+ .gsub('{databaseId}', database_id)
766
+
767
+ if database_id.nil?
768
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
769
+ end
770
+
771
+ api_params = {}
772
+
773
+ api_headers = {
774
+ "X-Appwrite-Project": @client.get_config('project'),
775
+ "accept": 'application/json',
776
+ }
777
+
778
+ @client.call(
779
+ method: 'GET',
780
+ path: api_path,
781
+ headers: api_headers,
782
+ params: api_params,
783
+ response_type: Models::DedicatedDatabaseBranchList
784
+ )
785
+ end
786
+
787
+ # Create an ephemeral database branch from the primary via PVC snapshot. The
788
+ # branch is a full copy of the database at the current point in time, useful
789
+ # for testing schema migrations or running experiments without affecting
790
+ # production data. Branches expire after the configured TTL (default 24
791
+ # hours). The branch is created asynchronously.
792
+ #
793
+ # @param [String] database_id Database ID.
794
+ # @param [String] branch_id Branch 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.
795
+ # @param [Integer] ttl Time-to-live in seconds before the branch expires. Min 300 (5 min), max 604800 (7 days). Default: 86400 (24h).
796
+ #
797
+ # @return [DedicatedDatabase]
798
+ def create_branch(
799
+ database_id:,
800
+ branch_id: nil,
801
+ ttl: nil
802
+ )
803
+ api_path = '/mysql/{databaseId}/branches'
804
+ .gsub('{databaseId}', database_id)
805
+
806
+ if database_id.nil?
807
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
808
+ end
809
+
810
+ api_params = {
811
+ branchId: branch_id,
812
+ ttl: ttl,
813
+ }
814
+
815
+ api_headers = {
816
+ "X-Appwrite-Project": @client.get_config('project'),
817
+ "content-type": 'application/json',
818
+ "accept": 'application/json',
819
+ }
820
+
821
+ @client.call(
822
+ method: 'POST',
823
+ path: api_path,
824
+ headers: api_headers,
825
+ params: api_params,
826
+ response_type: Models::DedicatedDatabase
827
+ )
828
+ end
829
+
830
+ # Delete an ephemeral database branch. This removes the branch namespace, its
831
+ # PVC, and the associated VolumeSnapshot. The deletion runs asynchronously
832
+ # and is irreversible.
833
+ #
834
+ # @param [String] database_id Database ID.
835
+ # @param [String] branch_id Branch ID.
836
+ #
837
+ # @return [DedicatedDatabase]
838
+ def delete_branch(
839
+ database_id:,
840
+ branch_id:
841
+ )
842
+ api_path = '/mysql/{databaseId}/branches/{branchId}'
843
+ .gsub('{databaseId}', database_id)
844
+ .gsub('{branchId}', branch_id)
845
+
846
+ if database_id.nil?
847
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
848
+ end
849
+
850
+ if branch_id.nil?
851
+ raise Appwrite::Exception.new('Missing required parameter: "branchId"')
852
+ end
853
+
854
+ api_params = {}
855
+
856
+ api_headers = {
857
+ "X-Appwrite-Project": @client.get_config('project'),
858
+ "content-type": 'application/json',
859
+ "accept": 'application/json',
860
+ }
861
+
862
+ @client.call(
863
+ method: 'DELETE',
864
+ path: api_path,
865
+ headers: api_headers,
866
+ params: api_params,
867
+ response_type: Models::DedicatedDatabase
868
+ )
869
+ end
870
+
871
+ # Rotate the primary connection credentials for a dedicated database.
872
+ # Generates a new password and updates the database atomically. Previous
873
+ # credentials stop working immediately. Returns the database with a refreshed
874
+ # connection string carrying the new password.
875
+ #
876
+ # @param [String] database_id Database ID.
877
+ #
878
+ # @return [DedicatedDatabase]
879
+ def update_credentials(
880
+ database_id:
881
+ )
882
+ api_path = '/mysql/{databaseId}/credentials'
883
+ .gsub('{databaseId}', database_id)
884
+
885
+ if database_id.nil?
886
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
887
+ end
888
+
889
+ api_params = {}
890
+
891
+ api_headers = {
892
+ "X-Appwrite-Project": @client.get_config('project'),
893
+ "content-type": 'application/json',
894
+ "accept": 'application/json',
895
+ }
896
+
897
+ @client.call(
898
+ method: 'PATCH',
899
+ path: api_path,
900
+ headers: api_headers,
901
+ params: api_params,
902
+ response_type: Models::DedicatedDatabase
903
+ )
904
+ end
905
+
906
+ # Execute SQL through the console-facing Cloud endpoint. Cloud proxies
907
+ # through the edge platform to the per-database SQL API sidecar. Application
908
+ # traffic should bypass cloud entirely and POST directly to the per-database
909
+ # hostname:
910
+ # `https://db-{project}-{db}.{region}.appwrite.center/v1/sql/executions` with
911
+ # an `X-Appwrite-Key` header — that path scales to the whole DB fleet
912
+ # without a per-query cloud round-trip. The statement type must be on the
913
+ # database&#039;s configured allow-list. Use bound parameters for any
914
+ # user-supplied values — the API does not interpolate raw strings.
915
+ #
916
+ # @param [String] database_id Database ID.
917
+ # @param [String] sql SQL statement to execute. Exactly one statement per request.
918
+ # @param [Hash] bindings Optional bound parameters. Pass either a positional list or a name =&gt; value map matching the placeholder style used in the SQL.
919
+ # @param [Integer] timeout_seconds Per-call execution timeout override. Must be less than or equal to the database&#039;s configured sqlApiTimeoutSeconds.
920
+ #
921
+ # @return [DedicatedDatabaseExecution]
922
+ def create_execution(
923
+ database_id:,
924
+ sql:,
925
+ bindings: nil,
926
+ timeout_seconds: nil
927
+ )
928
+ api_path = '/mysql/{databaseId}/executions'
929
+ .gsub('{databaseId}', database_id)
930
+
931
+ if database_id.nil?
932
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
933
+ end
934
+
935
+ if sql.nil?
936
+ raise Appwrite::Exception.new('Missing required parameter: "sql"')
937
+ end
938
+
939
+ api_params = {
940
+ sql: sql,
941
+ bindings: bindings,
942
+ timeoutSeconds: timeout_seconds,
943
+ }
944
+
945
+ api_headers = {
946
+ "X-Appwrite-Project": @client.get_config('project'),
947
+ "content-type": 'application/json',
948
+ "accept": 'application/json',
949
+ }
950
+
951
+ @client.call(
952
+ method: 'POST',
953
+ path: api_path,
954
+ headers: api_headers,
955
+ params: api_params,
956
+ response_type: Models::DedicatedDatabaseExecution
957
+ )
958
+ end
959
+
960
+ # Trigger a manual failover for a dedicated database with high availability
961
+ # enabled. Promotes a replica to primary. The failover runs asynchronously;
962
+ # poll the database document for status updates. A database left
963
+ # mid-operation also accepts this call as a repair once nothing is driving
964
+ # the operation it is stuck in. Repairing a failover that did not finish, a
965
+ # `failed` database, a stranded upgrade or migrate, or a stranded compute
966
+ # resize additionally requires `targetReplicaId` to name the member to
967
+ # promote, because the default target may be the member that operation
968
+ # already promoted.
969
+ #
970
+ # @param [String] database_id Database ID.
971
+ # @param [String] target_replica_id Target replica ID to promote. If not specified, the healthiest replica is selected.
972
+ #
973
+ # @return [DedicatedDatabase]
974
+ def create_failover(
975
+ database_id:,
976
+ target_replica_id: nil
977
+ )
978
+ api_path = '/mysql/{databaseId}/failovers'
979
+ .gsub('{databaseId}', database_id)
980
+
981
+ if database_id.nil?
982
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
983
+ end
984
+
985
+ api_params = {
986
+ targetReplicaId: target_replica_id,
987
+ }
988
+
989
+ api_headers = {
990
+ "X-Appwrite-Project": @client.get_config('project'),
991
+ "content-type": 'application/json',
992
+ "accept": 'application/json',
993
+ }
994
+
995
+ @client.call(
996
+ method: 'POST',
997
+ path: api_path,
998
+ headers: api_headers,
999
+ params: api_params,
1000
+ response_type: Models::DedicatedDatabase
1001
+ )
1002
+ end
1003
+
1004
+ # Update the maintenance window for a dedicated database. Maintenance
1005
+ # operations like minor version upgrades will be performed during this
1006
+ # window.
1007
+ #
1008
+ # @param [String] database_id Database ID.
1009
+ # @param [String] day Day of the week for the maintenance window. Allowed values: sun, mon, tue, wed, thu, fri, sat.
1010
+ # @param [Integer] hour_utc Hour in UTC (0-23) for maintenance window start.
1011
+ #
1012
+ # @return [DedicatedDatabase]
1013
+ def update_maintenance(
1014
+ database_id:,
1015
+ day:,
1016
+ hour_utc:
1017
+ )
1018
+ api_path = '/mysql/{databaseId}/maintenance'
1019
+ .gsub('{databaseId}', database_id)
1020
+
1021
+ if database_id.nil?
1022
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1023
+ end
1024
+
1025
+ if day.nil?
1026
+ raise Appwrite::Exception.new('Missing required parameter: "day"')
1027
+ end
1028
+
1029
+ if hour_utc.nil?
1030
+ raise Appwrite::Exception.new('Missing required parameter: "hourUtc"')
1031
+ end
1032
+
1033
+ api_params = {
1034
+ day: day,
1035
+ hourUtc: hour_utc,
1036
+ }
1037
+
1038
+ api_headers = {
1039
+ "X-Appwrite-Project": @client.get_config('project'),
1040
+ "content-type": 'application/json',
1041
+ "accept": 'application/json',
1042
+ }
1043
+
1044
+ @client.call(
1045
+ method: 'PATCH',
1046
+ path: api_path,
1047
+ headers: api_headers,
1048
+ params: api_params,
1049
+ response_type: Models::DedicatedDatabase
1050
+ )
1051
+ end
1052
+
1053
+ # Migrate a database between shared and dedicated types. Shared to dedicated
1054
+ # provisions an always-on dedicated instance; dedicated to shared converts to
1055
+ # a serverless instance that scales to zero when idle. Data is copied to the
1056
+ # target with a brief read-only window during cutover.
1057
+ #
1058
+ # @param [String] database_id Database ID.
1059
+ # @param [String] target_type Target database type to migrate to. Allowed values: shared (serverless, scales to zero when idle), dedicated (always-on with persistent resources).
1060
+ # @param [String] specification Target specification to provision when migrating to dedicated. Ignored for shared. Defaults to the database&#039;s current specification.
1061
+ #
1062
+ # @return [DedicatedDatabase]
1063
+ def create_migration(
1064
+ database_id:,
1065
+ target_type:,
1066
+ specification: nil
1067
+ )
1068
+ api_path = '/mysql/{databaseId}/migrations'
1069
+ .gsub('{databaseId}', database_id)
1070
+
1071
+ if database_id.nil?
1072
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1073
+ end
1074
+
1075
+ if target_type.nil?
1076
+ raise Appwrite::Exception.new('Missing required parameter: "targetType"')
1077
+ end
1078
+
1079
+ api_params = {
1080
+ targetType: target_type,
1081
+ specification: specification,
1082
+ }
1083
+
1084
+ api_headers = {
1085
+ "X-Appwrite-Project": @client.get_config('project'),
1086
+ "content-type": 'application/json',
1087
+ "accept": 'application/json',
1088
+ }
1089
+
1090
+ @client.call(
1091
+ method: 'POST',
1092
+ path: api_path,
1093
+ headers: api_headers,
1094
+ params: api_params,
1095
+ response_type: Models::DedicatedDatabase
1096
+ )
1097
+ end
1098
+
1099
+ # List the lifecycle operations recorded for a dedicated database, newest
1100
+ # first. Every provision, update, restore, backup and replication action is
1101
+ # recorded here with its outcome, including an attempt that was abandoned
1102
+ # because another worker took over the database.
1103
+ #
1104
+ # @param [String] database_id Database ID.
1105
+ # @param [String] status Filter by operation status.
1106
+ # @param [Integer] limit Maximum number of operations to return.
1107
+ # @param [Integer] offset Number of operations to skip.
1108
+ #
1109
+ # @return [DedicatedDatabaseOperationList]
1110
+ def list_operations(
1111
+ database_id:,
1112
+ status: nil,
1113
+ limit: nil,
1114
+ offset: nil
1115
+ )
1116
+ api_path = '/mysql/{databaseId}/operations'
1117
+ .gsub('{databaseId}', database_id)
1118
+
1119
+ if database_id.nil?
1120
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1121
+ end
1122
+
1123
+ api_params = {
1124
+ status: status,
1125
+ limit: limit,
1126
+ offset: offset,
1127
+ }
1128
+
1129
+ api_headers = {
1130
+ "X-Appwrite-Project": @client.get_config('project'),
1131
+ "accept": 'application/json',
1132
+ }
1133
+
1134
+ @client.call(
1135
+ method: 'GET',
1136
+ path: api_path,
1137
+ headers: api_headers,
1138
+ params: api_params,
1139
+ response_type: Models::DedicatedDatabaseOperationList
1140
+ )
1141
+ end
1142
+
1143
+ # Get available point-in-time recovery windows for a dedicated database.
1144
+ # Returns the earliest and latest recovery points.
1145
+ #
1146
+ # @param [String] database_id Database ID.
1147
+ #
1148
+ # @return [DedicatedDatabasePITRWindows]
1149
+ def get_pitr(
1150
+ database_id:
1151
+ )
1152
+ api_path = '/mysql/{databaseId}/pitr'
1153
+ .gsub('{databaseId}', database_id)
1154
+
1155
+ if database_id.nil?
1156
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1157
+ end
1158
+
1159
+ api_params = {}
1160
+
1161
+ api_headers = {
1162
+ "X-Appwrite-Project": @client.get_config('project'),
1163
+ "accept": 'application/json',
1164
+ }
1165
+
1166
+ @client.call(
1167
+ method: 'GET',
1168
+ path: api_path,
1169
+ headers: api_headers,
1170
+ params: api_params,
1171
+ response_type: Models::DedicatedDatabasePITRWindows
1172
+ )
1173
+ end
1174
+
1175
+ # Get the connection pooler configuration for a dedicated database. Returns
1176
+ # pooler mode, max connections, and pool size settings.
1177
+ #
1178
+ # @param [String] database_id Database ID.
1179
+ #
1180
+ # @return [DedicatedDatabasePooler]
1181
+ def get_pooler(
1182
+ database_id:
1183
+ )
1184
+ api_path = '/mysql/{databaseId}/pooler'
1185
+ .gsub('{databaseId}', database_id)
1186
+
1187
+ if database_id.nil?
1188
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1189
+ end
1190
+
1191
+ api_params = {}
1192
+
1193
+ api_headers = {
1194
+ "X-Appwrite-Project": @client.get_config('project'),
1195
+ "accept": 'application/json',
1196
+ }
1197
+
1198
+ @client.call(
1199
+ method: 'GET',
1200
+ path: api_path,
1201
+ headers: api_headers,
1202
+ params: api_params,
1203
+ response_type: Models::DedicatedDatabasePooler
1204
+ )
1205
+ end
1206
+
1207
+ # Update the connection pooler configuration for a dedicated database.
1208
+ # Configure pool mode, max connections, and pool sizes.
1209
+ #
1210
+ # @param [String] database_id Database ID.
1211
+ # @param [String] mode Connection pool mode. Allowed values: transaction, session. Transaction mode returns connections to the pool after each transaction; session mode holds connections for the entire session lifetime.
1212
+ # @param [Integer] max_connections Client-connection ceiling the pooler accepts. Supported on MySQL and MariaDB only; the PostgreSQL pooler has no client cap, so set networkMaxConnections on the database instead.
1213
+ # @param [Integer] default_pool_size Default pool size per user.
1214
+ # @param [] read_write_splitting Route SELECTs to HA replicas, writes and locked reads to the primary. Defaults to true when HA is enabled.
1215
+ # @param [String] pooler_cpu_request Pooler sidecar CPU request override (Kubernetes quantity, e.g. &quot;250m&quot; or &quot;1&quot;). Leave null for the proportional default (5% of DB CPU, floor 100m).
1216
+ # @param [String] pooler_cpu_limit Pooler sidecar CPU limit override (Kubernetes quantity, e.g. &quot;500m&quot; or &quot;1&quot;). Leave null for the proportional default (10% of DB CPU, floor 200m). Changing this field rolls the database pod.
1217
+ # @param [String] pooler_memory_request Pooler sidecar memory request override (Kubernetes quantity, e.g. &quot;128Mi&quot; or &quot;1Gi&quot;). Leave null for the proportional default (7.5% of DB memory, floor 64Mi).
1218
+ # @param [String] pooler_memory_limit Pooler sidecar memory limit override (Kubernetes quantity, e.g. &quot;256Mi&quot; or &quot;1Gi&quot;). Leave null for the proportional default (15% of DB memory, floor 128Mi). Changing this field rolls the database pod.
1219
+ #
1220
+ # @return [DedicatedDatabasePooler]
1221
+ def update_pooler(
1222
+ database_id:,
1223
+ mode: nil,
1224
+ max_connections: nil,
1225
+ default_pool_size: nil,
1226
+ read_write_splitting: nil,
1227
+ pooler_cpu_request: nil,
1228
+ pooler_cpu_limit: nil,
1229
+ pooler_memory_request: nil,
1230
+ pooler_memory_limit: nil
1231
+ )
1232
+ api_path = '/mysql/{databaseId}/pooler'
1233
+ .gsub('{databaseId}', database_id)
1234
+
1235
+ if database_id.nil?
1236
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1237
+ end
1238
+
1239
+ api_params = {
1240
+ mode: mode,
1241
+ maxConnections: max_connections,
1242
+ defaultPoolSize: default_pool_size,
1243
+ readWriteSplitting: read_write_splitting,
1244
+ poolerCpuRequest: pooler_cpu_request,
1245
+ poolerCpuLimit: pooler_cpu_limit,
1246
+ poolerMemoryRequest: pooler_memory_request,
1247
+ poolerMemoryLimit: pooler_memory_limit,
1248
+ }
1249
+
1250
+ api_headers = {
1251
+ "X-Appwrite-Project": @client.get_config('project'),
1252
+ "content-type": 'application/json',
1253
+ "accept": 'application/json',
1254
+ }
1255
+
1256
+ @client.call(
1257
+ method: 'PATCH',
1258
+ path: api_path,
1259
+ headers: api_headers,
1260
+ params: api_params,
1261
+ response_type: Models::DedicatedDatabasePooler
1262
+ )
1263
+ end
1264
+
1265
+ # Get high availability status for a dedicated database. Returns replica
1266
+ # statuses, replication lag, and sync mode.
1267
+ #
1268
+ # @param [String] database_id Database ID.
1269
+ #
1270
+ # @return [DedicatedDatabaseReplicas]
1271
+ def get_replicas(
1272
+ database_id:
1273
+ )
1274
+ api_path = '/mysql/{databaseId}/replicas'
1275
+ .gsub('{databaseId}', database_id)
1276
+
1277
+ if database_id.nil?
1278
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1279
+ end
1280
+
1281
+ api_params = {}
1282
+
1283
+ api_headers = {
1284
+ "X-Appwrite-Project": @client.get_config('project'),
1285
+ "accept": 'application/json',
1286
+ }
1287
+
1288
+ @client.call(
1289
+ method: 'GET',
1290
+ path: api_path,
1291
+ headers: api_headers,
1292
+ params: api_params,
1293
+ response_type: Models::DedicatedDatabaseReplicas
1294
+ )
1295
+ end
1296
+
1297
+ # List all restorations for a dedicated database. Results can be filtered by
1298
+ # status and type.
1299
+ #
1300
+ # @param [String] database_id Database ID.
1301
+ # @param [String] status Filter by restoration status.
1302
+ # @param [String] type Filter by restoration type.
1303
+ # @param [Integer] limit Maximum number of restorations to return.
1304
+ # @param [Integer] offset Number of restorations to skip.
1305
+ #
1306
+ # @return [DedicatedDatabaseRestorationList]
1307
+ def list_restorations(
1308
+ database_id:,
1309
+ status: nil,
1310
+ type: nil,
1311
+ limit: nil,
1312
+ offset: nil
1313
+ )
1314
+ api_path = '/mysql/{databaseId}/restorations'
1315
+ .gsub('{databaseId}', database_id)
1316
+
1317
+ if database_id.nil?
1318
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1319
+ end
1320
+
1321
+ api_params = {
1322
+ status: status,
1323
+ type: type,
1324
+ limit: limit,
1325
+ offset: offset,
1326
+ }
1327
+
1328
+ api_headers = {
1329
+ "X-Appwrite-Project": @client.get_config('project'),
1330
+ "accept": 'application/json',
1331
+ }
1332
+
1333
+ @client.call(
1334
+ method: 'GET',
1335
+ path: api_path,
1336
+ headers: api_headers,
1337
+ params: api_params,
1338
+ response_type: Models::DedicatedDatabaseRestorationList
1339
+ )
1340
+ end
1341
+
1342
+ # Restore a database from a backup or to a specific point in time (PITR). For
1343
+ # backup restoration, provide a backupId. For PITR, provide a targetTime as
1344
+ # an ISO 8601 datetime. PITR requires the database to have PITR enabled and
1345
+ # is only available for enterprise databases.
1346
+ #
1347
+ # @param [String] database_id Database ID.
1348
+ # @param [String] type Restoration type. Allowed values: backup, pitr. Use &quot;backup&quot; to restore from a specific backup, or &quot;pitr&quot; for point-in-time recovery.
1349
+ # @param [String] backup_id Backup ID to restore from (required for backup type).
1350
+ # @param [String] target_database_id Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version.
1351
+ # @param [String] target_time Target time for PITR (required for pitr type) as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) datetime.
1352
+ #
1353
+ # @return [DedicatedDatabaseRestoration]
1354
+ def create_restoration(
1355
+ database_id:,
1356
+ type: nil,
1357
+ backup_id: nil,
1358
+ target_database_id: nil,
1359
+ target_time: nil
1360
+ )
1361
+ api_path = '/mysql/{databaseId}/restorations'
1362
+ .gsub('{databaseId}', database_id)
1363
+
1364
+ if database_id.nil?
1365
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1366
+ end
1367
+
1368
+ api_params = {
1369
+ type: type,
1370
+ backupId: backup_id,
1371
+ targetDatabaseId: target_database_id,
1372
+ targetTime: target_time,
1373
+ }
1374
+
1375
+ api_headers = {
1376
+ "X-Appwrite-Project": @client.get_config('project'),
1377
+ "content-type": 'application/json',
1378
+ "accept": 'application/json',
1379
+ }
1380
+
1381
+ @client.call(
1382
+ method: 'POST',
1383
+ path: api_path,
1384
+ headers: api_headers,
1385
+ params: api_params,
1386
+ response_type: Models::DedicatedDatabaseRestoration
1387
+ )
1388
+ end
1389
+
1390
+ # Get details of a specific database restoration including its status, type,
1391
+ # and timestamps.
1392
+ #
1393
+ # @param [String] database_id Database ID.
1394
+ # @param [String] restoration_id Restoration ID.
1395
+ #
1396
+ # @return [DedicatedDatabaseRestoration]
1397
+ def get_restoration(
1398
+ database_id:,
1399
+ restoration_id:
1400
+ )
1401
+ api_path = '/mysql/{databaseId}/restorations/{restorationId}'
1402
+ .gsub('{databaseId}', database_id)
1403
+ .gsub('{restorationId}', restoration_id)
1404
+
1405
+ if database_id.nil?
1406
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1407
+ end
1408
+
1409
+ if restoration_id.nil?
1410
+ raise Appwrite::Exception.new('Missing required parameter: "restorationId"')
1411
+ end
1412
+
1413
+ api_params = {}
1414
+
1415
+ api_headers = {
1416
+ "X-Appwrite-Project": @client.get_config('project'),
1417
+ "accept": 'application/json',
1418
+ }
1419
+
1420
+ @client.call(
1421
+ method: 'GET',
1422
+ path: api_path,
1423
+ headers: api_headers,
1424
+ params: api_params,
1425
+ response_type: Models::DedicatedDatabaseRestoration
1426
+ )
1427
+ end
1428
+
1429
+ # Get real-time health and status information for a dedicated database.
1430
+ # Returns health status, readiness, uptime, connection info, replica status,
1431
+ # and volume information.
1432
+ #
1433
+ # @param [String] database_id Database ID.
1434
+ #
1435
+ # @return [DatabaseStatus]
1436
+ def get_status(
1437
+ database_id:
1438
+ )
1439
+ api_path = '/mysql/{databaseId}/status'
1440
+ .gsub('{databaseId}', database_id)
1441
+
1442
+ if database_id.nil?
1443
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1444
+ end
1445
+
1446
+ api_params = {}
1447
+
1448
+ api_headers = {
1449
+ "X-Appwrite-Project": @client.get_config('project'),
1450
+ "accept": 'application/json',
1451
+ }
1452
+
1453
+ @client.call(
1454
+ method: 'GET',
1455
+ path: api_path,
1456
+ headers: api_headers,
1457
+ params: api_params,
1458
+ response_type: Models::DatabaseStatus
1459
+ )
1460
+ end
1461
+
1462
+ # Upgrade a dedicated database to a new engine version. Uses blue-green
1463
+ # deployment for zero-downtime cutover.
1464
+ #
1465
+ # @param [String] database_id Database ID.
1466
+ # @param [String] target_version Target engine version to upgrade to.
1467
+ #
1468
+ # @return [DedicatedDatabase]
1469
+ def create_upgrade(
1470
+ database_id:,
1471
+ target_version:
1472
+ )
1473
+ api_path = '/mysql/{databaseId}/upgrades'
1474
+ .gsub('{databaseId}', database_id)
1475
+
1476
+ if database_id.nil?
1477
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1478
+ end
1479
+
1480
+ if target_version.nil?
1481
+ raise Appwrite::Exception.new('Missing required parameter: "targetVersion"')
1482
+ end
1483
+
1484
+ api_params = {
1485
+ targetVersion: target_version,
1486
+ }
1487
+
1488
+ api_headers = {
1489
+ "X-Appwrite-Project": @client.get_config('project'),
1490
+ "content-type": 'application/json',
1491
+ "accept": 'application/json',
1492
+ }
1493
+
1494
+ @client.call(
1495
+ method: 'POST',
1496
+ path: api_path,
1497
+ headers: api_headers,
1498
+ params: api_params,
1499
+ response_type: Models::DedicatedDatabase
1500
+ )
1501
+ end
1502
+ end
1503
+ end