appwrite 28.3.2 → 29.0.0

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 (397) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +36 -20
  3. data/lib/appwrite/enums/billing_plan_group.rb +2 -1
  4. data/lib/appwrite/enums/build_runtime.rb +2 -0
  5. data/lib/appwrite/enums/databases_index_type.rb +1 -0
  6. data/lib/appwrite/enums/domain_registration_type.rb +10 -0
  7. data/lib/appwrite/enums/domain_transfer_status_enum.rb +14 -0
  8. data/lib/appwrite/enums/execution_trigger.rb +1 -0
  9. data/lib/appwrite/enums/framework.rb +1 -0
  10. data/lib/appwrite/enums/id_token_provider.rb +8 -0
  11. data/lib/appwrite/enums/image_gravity.rb +1 -0
  12. data/lib/appwrite/enums/o_auth2_auth0_prompt.rb +9 -0
  13. data/lib/appwrite/enums/o_auth2_discord_prompt.rb +8 -0
  14. data/lib/appwrite/enums/o_auth2_github_prompt.rb +7 -0
  15. data/lib/appwrite/enums/o_auth2_kakao_prompt.rb +10 -0
  16. data/lib/appwrite/enums/o_auth2_microsoft_prompt.rb +10 -0
  17. data/lib/appwrite/enums/o_auth2_okta_prompt.rb +9 -0
  18. data/lib/appwrite/enums/o_auth2_salesforce_prompt.rb +8 -0
  19. data/lib/appwrite/enums/o_auth2_zoho_prompt.rb +7 -0
  20. data/lib/appwrite/enums/o_auth_provider.rb +3 -0
  21. data/lib/appwrite/enums/project_email_template_id.rb +2 -0
  22. data/lib/appwrite/enums/project_key_scopes.rb +4 -0
  23. data/lib/appwrite/enums/project_o_auth2_auth0_prompt.rb +9 -0
  24. data/lib/appwrite/enums/project_o_auth2_discord_prompt.rb +8 -0
  25. data/lib/appwrite/enums/project_o_auth2_git_hub_prompt.rb +7 -0
  26. data/lib/appwrite/enums/project_o_auth2_kakao_prompt.rb +10 -0
  27. data/lib/appwrite/enums/project_o_auth2_microsoft_prompt.rb +10 -0
  28. data/lib/appwrite/enums/project_o_auth2_okta_prompt.rb +9 -0
  29. data/lib/appwrite/enums/project_o_auth2_salesforce_prompt.rb +8 -0
  30. data/lib/appwrite/enums/project_o_auth2_zoho_prompt.rb +7 -0
  31. data/lib/appwrite/enums/project_o_auth_provider_id.rb +3 -0
  32. data/lib/appwrite/enums/project_policy_id.rb +2 -0
  33. data/lib/appwrite/enums/proxy_rule_deployment_resource_type.rb +1 -0
  34. data/lib/appwrite/enums/proxy_rule_protocol.rb +8 -0
  35. data/lib/appwrite/enums/runtime.rb +2 -0
  36. data/lib/appwrite/enums/tables_db_index_type.rb +1 -0
  37. data/lib/appwrite/enums/waf_rule_action.rb +11 -0
  38. data/lib/appwrite/models/account.rb +143 -0
  39. data/lib/appwrite/models/activity_event.rb +1 -0
  40. data/lib/appwrite/models/activity_event_list.rb +1 -0
  41. data/lib/appwrite/models/additional_resource.rb +1 -0
  42. data/lib/appwrite/models/algo_argon2.rb +1 -0
  43. data/lib/appwrite/models/algo_bcrypt.rb +1 -0
  44. data/lib/appwrite/models/algo_md5.rb +1 -0
  45. data/lib/appwrite/models/algo_phpass.rb +1 -0
  46. data/lib/appwrite/models/algo_scrypt.rb +1 -0
  47. data/lib/appwrite/models/algo_scrypt_modified.rb +1 -0
  48. data/lib/appwrite/models/algo_sha.rb +1 -0
  49. data/lib/appwrite/models/app.rb +1 -0
  50. data/lib/appwrite/models/app_installation.rb +2 -1
  51. data/lib/appwrite/models/app_installation_list.rb +1 -0
  52. data/lib/appwrite/models/app_key.rb +2 -1
  53. data/lib/appwrite/models/app_key_list.rb +1 -0
  54. data/lib/appwrite/models/app_scope.rb +1 -0
  55. data/lib/appwrite/models/app_scope_list.rb +1 -0
  56. data/lib/appwrite/models/app_secret.rb +2 -1
  57. data/lib/appwrite/models/app_secret_list.rb +1 -0
  58. data/lib/appwrite/models/app_secret_plaintext.rb +2 -1
  59. data/lib/appwrite/models/apps_list.rb +1 -0
  60. data/lib/appwrite/models/attribute_bigint.rb +5 -4
  61. data/lib/appwrite/models/attribute_boolean.rb +3 -2
  62. data/lib/appwrite/models/attribute_datetime.rb +3 -2
  63. data/lib/appwrite/models/attribute_email.rb +3 -2
  64. data/lib/appwrite/models/attribute_enum.rb +3 -2
  65. data/lib/appwrite/models/attribute_float.rb +5 -4
  66. data/lib/appwrite/models/attribute_integer.rb +5 -4
  67. data/lib/appwrite/models/attribute_ip.rb +3 -2
  68. data/lib/appwrite/models/attribute_line.rb +3 -2
  69. data/lib/appwrite/models/attribute_list.rb +1 -0
  70. data/lib/appwrite/models/attribute_longtext.rb +4 -3
  71. data/lib/appwrite/models/attribute_mediumtext.rb +4 -3
  72. data/lib/appwrite/models/attribute_object.rb +2 -1
  73. data/lib/appwrite/models/attribute_point.rb +3 -2
  74. data/lib/appwrite/models/attribute_polygon.rb +3 -2
  75. data/lib/appwrite/models/attribute_relationship.rb +2 -1
  76. data/lib/appwrite/models/attribute_string.rb +4 -3
  77. data/lib/appwrite/models/attribute_text.rb +4 -3
  78. data/lib/appwrite/models/attribute_url.rb +3 -2
  79. data/lib/appwrite/models/attribute_varchar.rb +4 -3
  80. data/lib/appwrite/models/attribute_vector.rb +2 -1
  81. data/lib/appwrite/models/backup_archive.rb +5 -4
  82. data/lib/appwrite/models/backup_archive_list.rb +1 -0
  83. data/lib/appwrite/models/backup_policy.rb +3 -2
  84. data/lib/appwrite/models/backup_policy_list.rb +1 -0
  85. data/lib/appwrite/models/backup_restoration.rb +2 -1
  86. data/lib/appwrite/models/backup_restoration_list.rb +1 -0
  87. data/lib/appwrite/models/billing_limits.rb +8 -8
  88. data/lib/appwrite/models/billing_plan.rb +25 -13
  89. data/lib/appwrite/models/billing_plan_addon.rb +2 -2
  90. data/lib/appwrite/models/billing_plan_addon_details.rb +2 -1
  91. data/lib/appwrite/models/billing_plan_dedicated_database_limits.rb +19 -19
  92. data/lib/appwrite/models/billing_plan_limits.rb +2 -2
  93. data/lib/appwrite/models/billing_plan_supported_addons.rb +1 -0
  94. data/lib/appwrite/models/block.rb +4 -33
  95. data/lib/appwrite/models/bucket.rb +1 -0
  96. data/lib/appwrite/models/bucket_list.rb +1 -0
  97. data/lib/appwrite/models/collection.rb +1 -0
  98. data/lib/appwrite/models/collection_list.rb +1 -0
  99. data/lib/appwrite/models/column_bigint.rb +5 -4
  100. data/lib/appwrite/models/column_boolean.rb +3 -2
  101. data/lib/appwrite/models/column_datetime.rb +3 -2
  102. data/lib/appwrite/models/column_email.rb +3 -2
  103. data/lib/appwrite/models/column_enum.rb +3 -2
  104. data/lib/appwrite/models/column_float.rb +5 -4
  105. data/lib/appwrite/models/column_index.rb +2 -1
  106. data/lib/appwrite/models/column_index_list.rb +1 -0
  107. data/lib/appwrite/models/column_integer.rb +5 -4
  108. data/lib/appwrite/models/column_ip.rb +3 -2
  109. data/lib/appwrite/models/column_line.rb +3 -2
  110. data/lib/appwrite/models/column_list.rb +1 -0
  111. data/lib/appwrite/models/column_longtext.rb +4 -3
  112. data/lib/appwrite/models/column_mediumtext.rb +4 -3
  113. data/lib/appwrite/models/column_point.rb +3 -2
  114. data/lib/appwrite/models/column_polygon.rb +3 -2
  115. data/lib/appwrite/models/column_relationship.rb +2 -1
  116. data/lib/appwrite/models/column_string.rb +4 -3
  117. data/lib/appwrite/models/column_text.rb +4 -3
  118. data/lib/appwrite/models/column_url.rb +3 -2
  119. data/lib/appwrite/models/column_varchar.rb +4 -3
  120. data/lib/appwrite/models/continent.rb +1 -0
  121. data/lib/appwrite/models/continent_list.rb +1 -0
  122. data/lib/appwrite/models/country.rb +1 -0
  123. data/lib/appwrite/models/country_list.rb +1 -0
  124. data/lib/appwrite/models/currency.rb +1 -0
  125. data/lib/appwrite/models/currency_list.rb +1 -0
  126. data/lib/appwrite/models/database.rb +10 -9
  127. data/lib/appwrite/models/database_list.rb +1 -0
  128. data/lib/appwrite/models/database_migration.rb +1 -0
  129. data/lib/appwrite/models/database_migration_list.rb +1 -0
  130. data/lib/appwrite/models/database_status.rb +6 -5
  131. data/lib/appwrite/models/database_status_connections.rb +1 -0
  132. data/lib/appwrite/models/database_status_replica.rb +3 -2
  133. data/lib/appwrite/models/database_status_volume.rb +1 -0
  134. data/lib/appwrite/models/dedicated_database.rb +22 -6
  135. data/lib/appwrite/models/dedicated_database_backup.rb +6 -5
  136. data/lib/appwrite/models/dedicated_database_backup_list.rb +1 -0
  137. data/lib/appwrite/models/dedicated_database_backup_storage.rb +1 -0
  138. data/lib/appwrite/models/dedicated_database_branch.rb +2 -1
  139. data/lib/appwrite/models/dedicated_database_branch_list.rb +1 -0
  140. data/lib/appwrite/models/dedicated_database_execution.rb +1 -0
  141. data/lib/appwrite/models/dedicated_database_execution_column.rb +1 -0
  142. data/lib/appwrite/models/dedicated_database_extensions.rb +1 -0
  143. data/lib/appwrite/models/dedicated_database_list.rb +1 -0
  144. data/lib/appwrite/models/dedicated_database_member.rb +3 -2
  145. data/lib/appwrite/models/dedicated_database_operation.rb +4 -3
  146. data/lib/appwrite/models/dedicated_database_operation_list.rb +1 -0
  147. data/lib/appwrite/models/dedicated_database_pitr_windows.rb +1 -0
  148. data/lib/appwrite/models/dedicated_database_pooler.rb +1 -0
  149. data/lib/appwrite/models/dedicated_database_replicas.rb +3 -2
  150. data/lib/appwrite/models/dedicated_database_restoration.rb +11 -5
  151. data/lib/appwrite/models/dedicated_database_restoration_list.rb +1 -0
  152. data/lib/appwrite/models/dedicated_database_specification.rb +21 -0
  153. data/lib/appwrite/models/dedicated_database_specification_list.rb +4 -8
  154. data/lib/appwrite/models/deployment.rb +1 -0
  155. data/lib/appwrite/models/deployment_list.rb +1 -0
  156. data/lib/appwrite/models/dns_record.rb +83 -0
  157. data/lib/appwrite/models/dns_records_list.rb +33 -0
  158. data/lib/appwrite/models/document.rb +1 -0
  159. data/lib/appwrite/models/document_list.rb +1 -0
  160. data/lib/appwrite/models/domain.rb +109 -0
  161. data/lib/appwrite/models/domain_price.rb +63 -0
  162. data/lib/appwrite/models/domain_prices_list.rb +33 -0
  163. data/lib/appwrite/models/domain_transfer_status.rb +59 -0
  164. data/lib/appwrite/models/domains_list.rb +33 -0
  165. data/lib/appwrite/models/email_template.rb +1 -0
  166. data/lib/appwrite/models/email_template_list.rb +1 -0
  167. data/lib/appwrite/models/embedding.rb +1 -0
  168. data/lib/appwrite/models/embedding_list.rb +1 -0
  169. data/lib/appwrite/models/ephemeral_key.rb +1 -0
  170. data/lib/appwrite/models/execution.rb +3 -1
  171. data/lib/appwrite/models/execution_list.rb +1 -0
  172. data/lib/appwrite/models/file.rb +1 -0
  173. data/lib/appwrite/models/file_list.rb +1 -0
  174. data/lib/appwrite/models/framework.rb +1 -0
  175. data/lib/appwrite/models/framework_adapter.rb +2 -1
  176. data/lib/appwrite/models/framework_list.rb +1 -0
  177. data/lib/appwrite/models/function.rb +10 -4
  178. data/lib/appwrite/models/function_list.rb +1 -0
  179. data/lib/appwrite/models/headers.rb +1 -0
  180. data/lib/appwrite/models/identity.rb +9 -3
  181. data/lib/appwrite/models/identity_list.rb +1 -0
  182. data/lib/appwrite/models/index.rb +2 -1
  183. data/lib/appwrite/models/index_list.rb +1 -0
  184. data/lib/appwrite/models/insight.rb +4 -3
  185. data/lib/appwrite/models/insight_cta.rb +1 -0
  186. data/lib/appwrite/models/insight_list.rb +1 -0
  187. data/lib/appwrite/models/jwt.rb +1 -0
  188. data/lib/appwrite/models/key.rb +1 -0
  189. data/lib/appwrite/models/key_list.rb +1 -0
  190. data/lib/appwrite/models/language.rb +1 -0
  191. data/lib/appwrite/models/language_list.rb +1 -0
  192. data/lib/appwrite/models/locale.rb +12 -11
  193. data/lib/appwrite/models/locale_code.rb +1 -0
  194. data/lib/appwrite/models/locale_code_list.rb +1 -0
  195. data/lib/appwrite/models/membership.rb +1 -0
  196. data/lib/appwrite/models/membership_list.rb +1 -0
  197. data/lib/appwrite/models/message.rb +4 -3
  198. data/lib/appwrite/models/message_list.rb +1 -0
  199. data/lib/appwrite/models/mfa_challenge.rb +1 -0
  200. data/lib/appwrite/models/mfa_challenge_secret.rb +1 -0
  201. data/lib/appwrite/models/mfa_factors.rb +1 -0
  202. data/lib/appwrite/models/mfa_recovery_codes.rb +1 -0
  203. data/lib/appwrite/models/mfa_type.rb +1 -0
  204. data/lib/appwrite/models/mock_number.rb +1 -0
  205. data/lib/appwrite/models/mock_number_list.rb +1 -0
  206. data/lib/appwrite/models/o_auth2_amazon.rb +1 -0
  207. data/lib/appwrite/models/o_auth2_apple.rb +14 -3
  208. data/lib/appwrite/models/o_auth2_appwrite.rb +1 -0
  209. data/lib/appwrite/models/o_auth2_auth0.rb +24 -0
  210. data/lib/appwrite/models/o_auth2_authentik.rb +1 -0
  211. data/lib/appwrite/models/o_auth2_autodesk.rb +1 -0
  212. data/lib/appwrite/models/o_auth2_bitbucket.rb +1 -0
  213. data/lib/appwrite/models/o_auth2_bitly.rb +1 -0
  214. data/lib/appwrite/models/o_auth2_box.rb +1 -0
  215. data/lib/appwrite/models/o_auth2_cloudflare.rb +1 -0
  216. data/lib/appwrite/models/o_auth2_dailymotion.rb +1 -0
  217. data/lib/appwrite/models/o_auth2_discord.rb +26 -3
  218. data/lib/appwrite/models/o_auth2_disqus.rb +1 -0
  219. data/lib/appwrite/models/o_auth2_dropbox.rb +1 -0
  220. data/lib/appwrite/models/o_auth2_etsy.rb +1 -0
  221. data/lib/appwrite/models/o_auth2_facebook.rb +1 -0
  222. data/lib/appwrite/models/o_auth2_figma.rb +1 -0
  223. data/lib/appwrite/models/o_auth2_fusion_auth.rb +1 -0
  224. data/lib/appwrite/models/o_auth2_github.rb +25 -3
  225. data/lib/appwrite/models/o_auth2_gitlab.rb +1 -0
  226. data/lib/appwrite/models/o_auth2_google.rb +18 -5
  227. data/lib/appwrite/models/o_auth2_hugging_face.rb +1 -0
  228. data/lib/appwrite/models/o_auth2_kakao.rb +67 -0
  229. data/lib/appwrite/models/o_auth2_keycloak.rb +1 -0
  230. data/lib/appwrite/models/o_auth2_kick.rb +1 -0
  231. data/lib/appwrite/models/o_auth2_linkedin.rb +1 -0
  232. data/lib/appwrite/models/o_auth2_microsoft.rb +25 -0
  233. data/lib/appwrite/models/o_auth2_notion.rb +1 -0
  234. data/lib/appwrite/models/o_auth2_oidc.rb +11 -8
  235. data/lib/appwrite/models/o_auth2_okta.rb +24 -0
  236. data/lib/appwrite/models/o_auth2_paypal.rb +1 -0
  237. data/lib/appwrite/models/o_auth2_podio.rb +1 -0
  238. data/lib/appwrite/models/o_auth2_provider_list.rb +1 -0
  239. data/lib/appwrite/models/o_auth2_resend.rb +1 -0
  240. data/lib/appwrite/models/o_auth2_salesforce.rb +26 -3
  241. data/lib/appwrite/models/o_auth2_slack.rb +1 -0
  242. data/lib/appwrite/models/o_auth2_spotify.rb +1 -0
  243. data/lib/appwrite/models/o_auth2_stripe.rb +1 -0
  244. data/lib/appwrite/models/o_auth2_tik_tok.rb +43 -0
  245. data/lib/appwrite/models/o_auth2_tradeshift.rb +1 -0
  246. data/lib/appwrite/models/o_auth2_twitch.rb +1 -0
  247. data/lib/appwrite/models/o_auth2_webflow.rb +43 -0
  248. data/lib/appwrite/models/o_auth2_word_press.rb +1 -0
  249. data/lib/appwrite/models/o_auth2_x.rb +1 -0
  250. data/lib/appwrite/models/o_auth2_yahoo.rb +1 -0
  251. data/lib/appwrite/models/o_auth2_yandex.rb +1 -0
  252. data/lib/appwrite/models/o_auth2_zoho.rb +25 -3
  253. data/lib/appwrite/models/o_auth2_zoom.rb +1 -0
  254. data/lib/appwrite/models/oauth2_approve.rb +1 -0
  255. data/lib/appwrite/models/oauth2_authorize.rb +1 -0
  256. data/lib/appwrite/models/oauth2_consent.rb +1 -0
  257. data/lib/appwrite/models/oauth2_consent_list.rb +1 -0
  258. data/lib/appwrite/models/oauth2_consent_token.rb +1 -0
  259. data/lib/appwrite/models/oauth2_consent_token_list.rb +1 -0
  260. data/lib/appwrite/models/oauth2_device_authorization.rb +1 -0
  261. data/lib/appwrite/models/oauth2_grant.rb +1 -0
  262. data/lib/appwrite/models/oauth2_introspection.rb +83 -0
  263. data/lib/appwrite/models/oauth2_organization.rb +1 -0
  264. data/lib/appwrite/models/oauth2_organization_list.rb +1 -0
  265. data/lib/appwrite/models/oauth2_par.rb +1 -0
  266. data/lib/appwrite/models/oauth2_project.rb +1 -0
  267. data/lib/appwrite/models/oauth2_project_list.rb +1 -0
  268. data/lib/appwrite/models/oauth2_reject.rb +1 -0
  269. data/lib/appwrite/models/oauth2_token.rb +3 -2
  270. data/lib/appwrite/models/organization.rb +21 -20
  271. data/lib/appwrite/models/passkey.rb +1 -0
  272. data/lib/appwrite/models/passkey_challenge.rb +1 -0
  273. data/lib/appwrite/models/passkey_list.rb +1 -0
  274. data/lib/appwrite/models/phone.rb +1 -0
  275. data/lib/appwrite/models/phone_list.rb +1 -0
  276. data/lib/appwrite/models/platform_android.rb +9 -3
  277. data/lib/appwrite/models/platform_apple.rb +1 -0
  278. data/lib/appwrite/models/platform_linux.rb +1 -0
  279. data/lib/appwrite/models/platform_list.rb +1 -0
  280. data/lib/appwrite/models/platform_web.rb +1 -0
  281. data/lib/appwrite/models/platform_windows.rb +1 -0
  282. data/lib/appwrite/models/policy_deny_aliased_email.rb +1 -0
  283. data/lib/appwrite/models/policy_deny_corporate_email.rb +1 -0
  284. data/lib/appwrite/models/policy_deny_disposable_email.rb +1 -0
  285. data/lib/appwrite/models/policy_deny_free_email.rb +1 -0
  286. data/lib/appwrite/models/policy_list.rb +1 -0
  287. data/lib/appwrite/models/policy_membership_privacy.rb +1 -0
  288. data/lib/appwrite/models/policy_mfa_factors.rb +1 -0
  289. data/lib/appwrite/models/policy_passkey.rb +1 -0
  290. data/lib/appwrite/models/policy_password_dictionary.rb +1 -0
  291. data/lib/appwrite/models/policy_password_history.rb +1 -0
  292. data/lib/appwrite/models/policy_password_personal_data.rb +1 -0
  293. data/lib/appwrite/models/policy_password_pwned.rb +43 -0
  294. data/lib/appwrite/models/policy_password_rotation.rb +38 -0
  295. data/lib/appwrite/models/policy_password_strength.rb +1 -0
  296. data/lib/appwrite/models/policy_session_alert.rb +1 -0
  297. data/lib/appwrite/models/policy_session_duration.rb +1 -0
  298. data/lib/appwrite/models/policy_session_invalidation.rb +1 -0
  299. data/lib/appwrite/models/policy_session_limit.rb +1 -0
  300. data/lib/appwrite/models/policy_user_limit.rb +1 -0
  301. data/lib/appwrite/models/postgres_extension.rb +1 -0
  302. data/lib/appwrite/models/presence.rb +4 -3
  303. data/lib/appwrite/models/presence_list.rb +1 -0
  304. data/lib/appwrite/models/program.rb +1 -0
  305. data/lib/appwrite/models/project.rb +35 -24
  306. data/lib/appwrite/models/project_auth_method.rb +1 -0
  307. data/lib/appwrite/models/project_list.rb +1 -0
  308. data/lib/appwrite/models/project_protocol.rb +1 -0
  309. data/lib/appwrite/models/project_service.rb +1 -0
  310. data/lib/appwrite/models/provider.rb +2 -1
  311. data/lib/appwrite/models/provider_list.rb +1 -0
  312. data/lib/appwrite/models/proxy_invalidation.rb +1 -0
  313. data/lib/appwrite/models/proxy_rule.rb +24 -4
  314. data/lib/appwrite/models/proxy_rule_list.rb +1 -0
  315. data/lib/appwrite/models/report.rb +2 -1
  316. data/lib/appwrite/models/report_list.rb +1 -0
  317. data/lib/appwrite/models/resource_token.rb +1 -0
  318. data/lib/appwrite/models/resource_token_list.rb +1 -0
  319. data/lib/appwrite/models/row.rb +1 -0
  320. data/lib/appwrite/models/row_list.rb +1 -0
  321. data/lib/appwrite/models/runtime.rb +1 -0
  322. data/lib/appwrite/models/runtime_list.rb +1 -0
  323. data/lib/appwrite/models/session.rb +1 -0
  324. data/lib/appwrite/models/session_list.rb +1 -0
  325. data/lib/appwrite/models/site.rb +1 -0
  326. data/lib/appwrite/models/site_list.rb +1 -0
  327. data/lib/appwrite/models/specification.rb +1 -0
  328. data/lib/appwrite/models/specification_list.rb +1 -0
  329. data/lib/appwrite/models/subscriber.rb +1 -0
  330. data/lib/appwrite/models/subscriber_list.rb +1 -0
  331. data/lib/appwrite/models/table.rb +1 -0
  332. data/lib/appwrite/models/table_list.rb +1 -0
  333. data/lib/appwrite/models/target.rb +2 -1
  334. data/lib/appwrite/models/target_list.rb +1 -0
  335. data/lib/appwrite/models/team.rb +1 -0
  336. data/lib/appwrite/models/team_list.rb +1 -0
  337. data/lib/appwrite/models/token.rb +1 -0
  338. data/lib/appwrite/models/token_secret.rb +1 -0
  339. data/lib/appwrite/models/topic.rb +14 -3
  340. data/lib/appwrite/models/topic_list.rb +1 -0
  341. data/lib/appwrite/models/transaction.rb +1 -0
  342. data/lib/appwrite/models/transaction_list.rb +1 -0
  343. data/lib/appwrite/models/usage_billing_plan.rb +27 -27
  344. data/lib/appwrite/models/user.rb +16 -10
  345. data/lib/appwrite/models/user_list.rb +1 -0
  346. data/lib/appwrite/models/variable.rb +1 -0
  347. data/lib/appwrite/models/variable_list.rb +1 -0
  348. data/lib/appwrite/models/vectorsdb_collection.rb +1 -0
  349. data/lib/appwrite/models/vectorsdb_collection_list.rb +1 -0
  350. data/lib/appwrite/models/waf_rule_bypass.rb +111 -0
  351. data/lib/appwrite/models/waf_rule_challenge.rb +126 -0
  352. data/lib/appwrite/models/waf_rule_deny.rb +111 -0
  353. data/lib/appwrite/models/{log_list.rb → waf_rule_list.rb} +8 -7
  354. data/lib/appwrite/models/waf_rule_rate_limit.rb +136 -0
  355. data/lib/appwrite/models/waf_rule_redirect.rb +121 -0
  356. data/lib/appwrite/models/webhook.rb +1 -0
  357. data/lib/appwrite/models/webhook_list.rb +1 -0
  358. data/lib/appwrite/query/builder.rb +361 -0
  359. data/lib/appwrite/query.rb +190 -0
  360. data/lib/appwrite/services/account.rb +409 -133
  361. data/lib/appwrite/services/activities.rb +4 -4
  362. data/lib/appwrite/services/advisor.rb +19 -18
  363. data/lib/appwrite/services/apps.rb +89 -89
  364. data/lib/appwrite/services/avatars.rb +92 -21
  365. data/lib/appwrite/services/backups.rb +30 -30
  366. data/lib/appwrite/services/databases.rb +504 -453
  367. data/lib/appwrite/services/documents_db.rb +199 -191
  368. data/lib/appwrite/services/domains.rb +2318 -0
  369. data/lib/appwrite/services/embeddings.rb +2 -2
  370. data/lib/appwrite/services/functions.rb +128 -112
  371. data/lib/appwrite/services/graphql.rb +4 -4
  372. data/lib/appwrite/services/locale.rb +49 -14
  373. data/lib/appwrite/services/messaging.rb +281 -153
  374. data/lib/appwrite/services/mongo.rb +194 -130
  375. data/lib/appwrite/services/mysql.rb +212 -144
  376. data/lib/appwrite/services/oauth2.rb +72 -27
  377. data/lib/appwrite/services/organization.rb +255 -221
  378. data/lib/appwrite/services/postgresql.rb +226 -158
  379. data/lib/appwrite/services/presences.rb +17 -16
  380. data/lib/appwrite/services/project.rb +588 -157
  381. data/lib/appwrite/services/proxy.rb +70 -23
  382. data/lib/appwrite/services/sites.rb +119 -107
  383. data/lib/appwrite/services/storage.rb +62 -59
  384. data/lib/appwrite/services/tables_db.rb +617 -558
  385. data/lib/appwrite/services/teams.rb +87 -82
  386. data/lib/appwrite/services/tokens.rb +25 -24
  387. data/lib/appwrite/services/users.rb +170 -199
  388. data/lib/appwrite/services/vectors_db.rb +185 -177
  389. data/lib/appwrite/services/waf.rb +859 -0
  390. data/lib/appwrite/services/webhooks.rb +23 -22
  391. data/lib/appwrite/topic.rb +53 -0
  392. data/lib/appwrite.rb +48 -9
  393. metadata +47 -7
  394. data/lib/appwrite/enums/organization_key_scopes.rb +0 -22
  395. data/lib/appwrite/models/dedicated_database_specification_pricing.rb +0 -42
  396. data/lib/appwrite/models/dev_key.rb +0 -62
  397. data/lib/appwrite/models/log.rb +0 -132
@@ -49,8 +49,6 @@ module Appwrite
49
49
  password:,
50
50
  name: nil
51
51
  )
52
- api_path = '/account'
53
-
54
52
  if user_id.nil?
55
53
  raise Appwrite::Exception.new('Missing required parameter: "userId"')
56
54
  end
@@ -63,6 +61,8 @@ module Appwrite
63
61
  raise Appwrite::Exception.new('Missing required parameter: "password"')
64
62
  end
65
63
 
64
+ api_path = '/account'
65
+
66
66
  api_params = {
67
67
  userId: user_id,
68
68
  email: email,
@@ -126,13 +126,13 @@ module Appwrite
126
126
  def get_consent(
127
127
  consent_id:
128
128
  )
129
- api_path = '/account/consents/{consentId}'
130
- .gsub('{consentId}', consent_id)
131
-
132
- if consent_id.nil?
129
+ if consent_id.nil? || consent_id == ''
133
130
  raise Appwrite::Exception.new('Missing required parameter: "consentId"')
134
131
  end
135
132
 
133
+ api_path = '/account/consents/{consentId}'
134
+ .gsub('{consentId}', consent_id)
135
+
136
136
  api_params = {}
137
137
 
138
138
  api_headers = {
@@ -159,13 +159,13 @@ module Appwrite
159
159
  def delete_consent(
160
160
  consent_id:
161
161
  )
162
- api_path = '/account/consents/{consentId}'
163
- .gsub('{consentId}', consent_id)
164
-
165
- if consent_id.nil?
162
+ if consent_id.nil? || consent_id == ''
166
163
  raise Appwrite::Exception.new('Missing required parameter: "consentId"')
167
164
  end
168
165
 
166
+ api_path = '/account/consents/{consentId}'
167
+ .gsub('{consentId}', consent_id)
168
+
169
169
  api_params = {}
170
170
 
171
171
  api_headers = {
@@ -196,13 +196,13 @@ module Appwrite
196
196
  queries: nil,
197
197
  total: nil
198
198
  )
199
- api_path = '/account/consents/{consentId}/tokens'
200
- .gsub('{consentId}', consent_id)
201
-
202
- if consent_id.nil?
199
+ if consent_id.nil? || consent_id == ''
203
200
  raise Appwrite::Exception.new('Missing required parameter: "consentId"')
204
201
  end
205
202
 
203
+ api_path = '/account/consents/{consentId}/tokens'
204
+ .gsub('{consentId}', consent_id)
205
+
206
206
  api_params = {
207
207
  queries: queries,
208
208
  total: total,
@@ -233,18 +233,18 @@ module Appwrite
233
233
  consent_id:,
234
234
  token_id:
235
235
  )
236
- api_path = '/account/consents/{consentId}/tokens/{tokenId}'
237
- .gsub('{consentId}', consent_id)
238
- .gsub('{tokenId}', token_id)
239
-
240
- if consent_id.nil?
236
+ if consent_id.nil? || consent_id == ''
241
237
  raise Appwrite::Exception.new('Missing required parameter: "consentId"')
242
238
  end
243
239
 
244
- if token_id.nil?
240
+ if token_id.nil? || token_id == ''
245
241
  raise Appwrite::Exception.new('Missing required parameter: "tokenId"')
246
242
  end
247
243
 
244
+ api_path = '/account/consents/{consentId}/tokens/{tokenId}'
245
+ .gsub('{consentId}', consent_id)
246
+ .gsub('{tokenId}', token_id)
247
+
248
248
  api_params = {}
249
249
 
250
250
  api_headers = {
@@ -273,18 +273,18 @@ module Appwrite
273
273
  consent_id:,
274
274
  token_id:
275
275
  )
276
- api_path = '/account/consents/{consentId}/tokens/{tokenId}'
277
- .gsub('{consentId}', consent_id)
278
- .gsub('{tokenId}', token_id)
279
-
280
- if consent_id.nil?
276
+ if consent_id.nil? || consent_id == ''
281
277
  raise Appwrite::Exception.new('Missing required parameter: "consentId"')
282
278
  end
283
279
 
284
- if token_id.nil?
280
+ if token_id.nil? || token_id == ''
285
281
  raise Appwrite::Exception.new('Missing required parameter: "tokenId"')
286
282
  end
287
283
 
284
+ api_path = '/account/consents/{consentId}/tokens/{tokenId}'
285
+ .gsub('{consentId}', consent_id)
286
+ .gsub('{tokenId}', token_id)
287
+
288
288
  api_params = {}
289
289
 
290
290
  api_headers = {
@@ -318,8 +318,6 @@ module Appwrite
318
318
  email:,
319
319
  password:
320
320
  )
321
- api_path = '/account/email'
322
-
323
321
  if email.nil?
324
322
  raise Appwrite::Exception.new('Missing required parameter: "email"')
325
323
  end
@@ -328,6 +326,8 @@ module Appwrite
328
326
  raise Appwrite::Exception.new('Missing required parameter: "password"')
329
327
  end
330
328
 
329
+ api_path = '/account/email'
330
+
331
331
  api_params = {
332
332
  email: email,
333
333
  password: password,
@@ -387,57 +387,26 @@ module Appwrite
387
387
  def delete_identity(
388
388
  identity_id:
389
389
  )
390
- api_path = '/account/identities/{identityId}'
391
- .gsub('{identityId}', identity_id)
392
-
393
- if identity_id.nil?
390
+ if identity_id.nil? || identity_id == ''
394
391
  raise Appwrite::Exception.new('Missing required parameter: "identityId"')
395
392
  end
396
393
 
394
+ api_path = '/account/identities/{identityId}'
395
+ .gsub('{identityId}', identity_id)
396
+
397
397
  api_params = {}
398
398
 
399
399
  api_headers = {
400
400
  "X-Appwrite-Project": @client.get_config('project'),
401
401
  "content-type": 'application/json',
402
- }
403
-
404
- @client.call(
405
- method: 'DELETE',
406
- path: api_path,
407
- headers: api_headers,
408
- params: api_params,
409
- )
410
- end
411
-
412
- # Get the list of latest security activity logs for the currently logged in
413
- # user. Each log returns user IP address, location and date and time of log.
414
- #
415
- # @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). Only supported methods are limit and offset
416
- # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
417
- #
418
- # @return [LogList]
419
- def list_logs(
420
- queries: nil,
421
- total: nil
422
- )
423
- api_path = '/account/logs'
424
-
425
- api_params = {
426
- queries: queries,
427
- total: total,
428
- }
429
-
430
- api_headers = {
431
- "X-Appwrite-Project": @client.get_config('project'),
432
402
  "accept": 'application/json',
433
403
  }
434
404
 
435
405
  @client.call(
436
- method: 'GET',
406
+ method: 'DELETE',
437
407
  path: api_path,
438
408
  headers: api_headers,
439
409
  params: api_params,
440
- response_type: Models::LogList
441
410
  )
442
411
  end
443
412
 
@@ -449,12 +418,12 @@ module Appwrite
449
418
  def update_mfa(
450
419
  mfa:
451
420
  )
452
- api_path = '/account/mfa'
453
-
454
421
  if mfa.nil?
455
422
  raise Appwrite::Exception.new('Missing required parameter: "mfa"')
456
423
  end
457
424
 
425
+ api_path = '/account/mfa'
426
+
458
427
  api_params = {
459
428
  mfa: mfa,
460
429
  }
@@ -485,13 +454,13 @@ module Appwrite
485
454
  def create_mfa_authenticator(
486
455
  type:
487
456
  )
488
- api_path = '/account/mfa/authenticators/{type}'
489
- .gsub('{type}', type)
490
-
491
457
  if type.nil?
492
458
  raise Appwrite::Exception.new('Missing required parameter: "type"')
493
459
  end
494
460
 
461
+ api_path = '/account/mfa/authenticators/{type}'
462
+ .gsub('{type}', type)
463
+
495
464
  api_params = {}
496
465
 
497
466
  api_headers = {
@@ -521,9 +490,6 @@ module Appwrite
521
490
  type:,
522
491
  otp:
523
492
  )
524
- api_path = '/account/mfa/authenticators/{type}'
525
- .gsub('{type}', type)
526
-
527
493
  if type.nil?
528
494
  raise Appwrite::Exception.new('Missing required parameter: "type"')
529
495
  end
@@ -532,6 +498,9 @@ module Appwrite
532
498
  raise Appwrite::Exception.new('Missing required parameter: "otp"')
533
499
  end
534
500
 
501
+ api_path = '/account/mfa/authenticators/{type}'
502
+ .gsub('{type}', type)
503
+
535
504
  api_params = {
536
505
  otp: otp,
537
506
  }
@@ -559,18 +528,19 @@ module Appwrite
559
528
  def delete_mfa_authenticator(
560
529
  type:
561
530
  )
562
- api_path = '/account/mfa/authenticators/{type}'
563
- .gsub('{type}', type)
564
-
565
531
  if type.nil?
566
532
  raise Appwrite::Exception.new('Missing required parameter: "type"')
567
533
  end
568
534
 
535
+ api_path = '/account/mfa/authenticators/{type}'
536
+ .gsub('{type}', type)
537
+
569
538
  api_params = {}
570
539
 
571
540
  api_headers = {
572
541
  "X-Appwrite-Project": @client.get_config('project'),
573
542
  "content-type": 'application/json',
543
+ "accept": 'application/json',
574
544
  }
575
545
 
576
546
  @client.call(
@@ -591,12 +561,12 @@ module Appwrite
591
561
  def create_mfa_challenge(
592
562
  factor:
593
563
  )
594
- api_path = '/account/mfa/challenges'
595
-
596
564
  if factor.nil?
597
565
  raise Appwrite::Exception.new('Missing required parameter: "factor"')
598
566
  end
599
567
 
568
+ api_path = '/account/mfa/challenges'
569
+
600
570
  api_params = {
601
571
  factor: factor,
602
572
  }
@@ -630,8 +600,6 @@ module Appwrite
630
600
  challenge_id:,
631
601
  otp:
632
602
  )
633
- api_path = '/account/mfa/challenges'
634
-
635
603
  if challenge_id.nil?
636
604
  raise Appwrite::Exception.new('Missing required parameter: "challengeId"')
637
605
  end
@@ -640,6 +608,8 @@ module Appwrite
640
608
  raise Appwrite::Exception.new('Missing required parameter: "otp"')
641
609
  end
642
610
 
611
+ api_path = '/account/mfa/challenges'
612
+
643
613
  api_params = {
644
614
  challengeId: challenge_id,
645
615
  otp: otp,
@@ -772,12 +742,12 @@ module Appwrite
772
742
  def update_name(
773
743
  name:
774
744
  )
775
- api_path = '/account/name'
776
-
777
745
  if name.nil?
778
746
  raise Appwrite::Exception.new('Missing required parameter: "name"')
779
747
  end
780
748
 
749
+ api_path = '/account/name'
750
+
781
751
  api_params = {
782
752
  name: name,
783
753
  }
@@ -1029,12 +999,12 @@ module Appwrite
1029
999
  password:,
1030
1000
  old_password: nil
1031
1001
  )
1032
- api_path = '/account/password'
1033
-
1034
1002
  if password.nil?
1035
1003
  raise Appwrite::Exception.new('Missing required parameter: "password"')
1036
1004
  end
1037
1005
 
1006
+ api_path = '/account/password'
1007
+
1038
1008
  api_params = {
1039
1009
  password: password,
1040
1010
  oldPassword: old_password,
@@ -1069,8 +1039,6 @@ module Appwrite
1069
1039
  phone:,
1070
1040
  password:
1071
1041
  )
1072
- api_path = '/account/phone'
1073
-
1074
1042
  if phone.nil?
1075
1043
  raise Appwrite::Exception.new('Missing required parameter: "phone"')
1076
1044
  end
@@ -1079,6 +1047,8 @@ module Appwrite
1079
1047
  raise Appwrite::Exception.new('Missing required parameter: "password"')
1080
1048
  end
1081
1049
 
1050
+ api_path = '/account/phone'
1051
+
1082
1052
  api_params = {
1083
1053
  phone: phone,
1084
1054
  password: password,
@@ -1132,12 +1102,12 @@ module Appwrite
1132
1102
  def update_prefs(
1133
1103
  prefs:
1134
1104
  )
1135
- api_path = '/account/prefs'
1136
-
1137
1105
  if prefs.nil?
1138
1106
  raise Appwrite::Exception.new('Missing required parameter: "prefs"')
1139
1107
  end
1140
1108
 
1109
+ api_path = '/account/prefs'
1110
+
1141
1111
  api_params = {
1142
1112
  prefs: prefs,
1143
1113
  }
@@ -1174,8 +1144,6 @@ module Appwrite
1174
1144
  email:,
1175
1145
  url:
1176
1146
  )
1177
- api_path = '/account/recovery'
1178
-
1179
1147
  if email.nil?
1180
1148
  raise Appwrite::Exception.new('Missing required parameter: "email"')
1181
1149
  end
@@ -1184,6 +1152,8 @@ module Appwrite
1184
1152
  raise Appwrite::Exception.new('Missing required parameter: "url"')
1185
1153
  end
1186
1154
 
1155
+ api_path = '/account/recovery'
1156
+
1187
1157
  api_params = {
1188
1158
  email: email,
1189
1159
  url: url,
@@ -1225,8 +1195,108 @@ module Appwrite
1225
1195
  secret:,
1226
1196
  password:
1227
1197
  )
1198
+ if user_id.nil?
1199
+ raise Appwrite::Exception.new('Missing required parameter: "userId"')
1200
+ end
1201
+
1202
+ if secret.nil?
1203
+ raise Appwrite::Exception.new('Missing required parameter: "secret"')
1204
+ end
1205
+
1206
+ if password.nil?
1207
+ raise Appwrite::Exception.new('Missing required parameter: "password"')
1208
+ end
1209
+
1228
1210
  api_path = '/account/recovery'
1229
1211
 
1212
+ api_params = {
1213
+ userId: user_id,
1214
+ secret: secret,
1215
+ password: password,
1216
+ }
1217
+
1218
+ api_headers = {
1219
+ "X-Appwrite-Project": @client.get_config('project'),
1220
+ "content-type": 'application/json',
1221
+ "accept": 'application/json',
1222
+ }
1223
+
1224
+ @client.call(
1225
+ method: 'PUT',
1226
+ path: api_path,
1227
+ headers: api_headers,
1228
+ params: api_params,
1229
+ response_type: Models::Token
1230
+ )
1231
+ end
1232
+
1233
+ # Use this endpoint to send a 6-digit password recovery code to the user's
1234
+ # email address. Unlike
1235
+ # [createRecovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery),
1236
+ # this method requires no redirect URL, which makes it suitable for mobile
1237
+ # and desktop apps that cannot host a recovery page. Learn more about how to
1238
+ # [complete the recovery
1239
+ # process](https://appwrite.io/docs/references/cloud/client-web/account#updateRecoveryOTP).
1240
+ # The code sent to the user's email address is valid for 15 minutes.
1241
+ #
1242
+ # Enable the **phrase** parameter to include a randomly generated security
1243
+ # phrase in both the email and the response. Showing that phrase in your app
1244
+ # lets the user confirm the email genuinely came from your request, which
1245
+ # helps protect against phishing.
1246
+ #
1247
+ #
1248
+ # @param [String] email User email.
1249
+ # @param [] phrase Toggle for security phrase. If enabled, email will be sent with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.
1250
+ #
1251
+ # @return [Token]
1252
+ def create_recovery_otp(
1253
+ email:,
1254
+ phrase: nil
1255
+ )
1256
+ if email.nil?
1257
+ raise Appwrite::Exception.new('Missing required parameter: "email"')
1258
+ end
1259
+
1260
+ api_path = '/account/recovery/otp'
1261
+
1262
+ api_params = {
1263
+ email: email,
1264
+ phrase: phrase,
1265
+ }
1266
+
1267
+ api_headers = {
1268
+ "X-Appwrite-Project": @client.get_config('project'),
1269
+ "content-type": 'application/json',
1270
+ "accept": 'application/json',
1271
+ }
1272
+
1273
+ @client.call(
1274
+ method: 'POST',
1275
+ path: api_path,
1276
+ headers: api_headers,
1277
+ params: api_params,
1278
+ response_type: Models::Token
1279
+ )
1280
+ end
1281
+
1282
+ # Use this endpoint to complete the user password recovery process using the
1283
+ # 6-digit code that was emailed by
1284
+ # [createRecoveryOTP](https://appwrite.io/docs/references/cloud/client-web/account#createRecoveryOTP).
1285
+ # Pass the **userId** of the user along with the **secret** code from the
1286
+ # email and the new **password** to set. If confirmed, this route will return
1287
+ # a 200 status code, the code is consumed and the user's password is updated.
1288
+ #
1289
+ #
1290
+ # @param [String] user_id User ID.
1291
+ # @param [String] secret Valid recovery OTP code.
1292
+ # @param [String] password New user password. Must be between 8 and 256 chars.
1293
+ #
1294
+ # @return [Token]
1295
+ def update_recovery_otp(
1296
+ user_id:,
1297
+ secret:,
1298
+ password:
1299
+ )
1230
1300
  if user_id.nil?
1231
1301
  raise Appwrite::Exception.new('Missing required parameter: "userId"')
1232
1302
  end
@@ -1239,6 +1309,8 @@ module Appwrite
1239
1309
  raise Appwrite::Exception.new('Missing required parameter: "password"')
1240
1310
  end
1241
1311
 
1312
+ api_path = '/account/recovery/otp'
1313
+
1242
1314
  api_params = {
1243
1315
  userId: user_id,
1244
1316
  secret: secret,
@@ -1263,12 +1335,17 @@ module Appwrite
1263
1335
  # Get the list of active sessions across different devices for the currently
1264
1336
  # logged in user.
1265
1337
  #
1338
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
1266
1339
  #
1267
1340
  # @return [SessionList]
1268
- def list_sessions()
1341
+ def list_sessions(
1342
+ total: nil
1343
+ )
1269
1344
  api_path = '/account/sessions'
1270
1345
 
1271
- api_params = {}
1346
+ api_params = {
1347
+ total: total,
1348
+ }
1272
1349
 
1273
1350
  api_headers = {
1274
1351
  "X-Appwrite-Project": @client.get_config('project'),
@@ -1285,18 +1362,25 @@ module Appwrite
1285
1362
  end
1286
1363
 
1287
1364
  # Delete all sessions from the user account and remove any sessions cookies
1288
- # from the end client.
1365
+ # from the end client. Pass `current` as false to keep the session making the
1366
+ # request and sign out of every other session.
1289
1367
  #
1368
+ # @param [] current Delete the current session too. Use false to sign out of every other session while staying signed in on this one.
1290
1369
  #
1291
1370
  # @return []
1292
- def delete_sessions()
1371
+ def delete_sessions(
1372
+ current: nil
1373
+ )
1293
1374
  api_path = '/account/sessions'
1294
1375
 
1295
- api_params = {}
1376
+ api_params = {
1377
+ current: current,
1378
+ }
1296
1379
 
1297
1380
  api_headers = {
1298
1381
  "X-Appwrite-Project": @client.get_config('project'),
1299
1382
  "content-type": 'application/json',
1383
+ "accept": 'application/json',
1300
1384
  }
1301
1385
 
1302
1386
  @client.call(
@@ -1339,6 +1423,9 @@ module Appwrite
1339
1423
 
1340
1424
  # Allow the user to login into their account by providing a valid email and
1341
1425
  # password combination. This route will create a new session for the user.
1426
+ # Use the optional `duration` parameter to create a shorter session, for
1427
+ # example when the user doesn't choose "remember me". It must be at least 60
1428
+ # seconds and cannot exceed the project maximum session length.
1342
1429
  #
1343
1430
  # A user is limited to 10 active sessions at a time by default. [Learn more
1344
1431
  # about session
@@ -1346,14 +1433,14 @@ module Appwrite
1346
1433
  #
1347
1434
  # @param [String] email User email.
1348
1435
  # @param [String] password User password. Must be at least 8 chars.
1436
+ # @param [Integer] duration Session length in seconds. Minimum is 60 seconds, and it cannot exceed the project maximum session length. Defaults to the project maximum session length.
1349
1437
  #
1350
1438
  # @return [Session]
1351
1439
  def create_email_password_session(
1352
1440
  email:,
1353
- password:
1441
+ password:,
1442
+ duration: nil
1354
1443
  )
1355
- api_path = '/account/sessions/email'
1356
-
1357
1444
  if email.nil?
1358
1445
  raise Appwrite::Exception.new('Missing required parameter: "email"')
1359
1446
  end
@@ -1362,9 +1449,105 @@ module Appwrite
1362
1449
  raise Appwrite::Exception.new('Missing required parameter: "password"')
1363
1450
  end
1364
1451
 
1452
+ api_path = '/account/sessions/email'
1453
+
1365
1454
  api_params = {
1366
1455
  email: email,
1367
1456
  password: password,
1457
+ duration: duration,
1458
+ }
1459
+
1460
+ api_headers = {
1461
+ "X-Appwrite-Project": @client.get_config('project'),
1462
+ "content-type": 'application/json',
1463
+ "accept": 'application/json',
1464
+ }
1465
+
1466
+ @client.call(
1467
+ method: 'POST',
1468
+ path: api_path,
1469
+ headers: api_headers,
1470
+ params: api_params,
1471
+ response_type: Models::Session
1472
+ )
1473
+ end
1474
+
1475
+ # Allow the user to login to their account using an OpenID Connect ID token
1476
+ # obtained natively from the OAuth2 provider, for example via Google
1477
+ # Credential Manager on Android or Sign in with Apple on iOS. No browser or
1478
+ # redirect is involved: the ID token is verified against the provider's
1479
+ # published signing keys and a session is created in a single request.
1480
+ #
1481
+ # Native sign-in is switched on per provider with its nativeEnabled setting.
1482
+ # It is independent of the browser-based flow's enabled setting, which has no
1483
+ # effect on this endpoint. The token's audience must match the provider's
1484
+ # configured client ID or one of its native client IDs; tokens issued for any
1485
+ # other client ID are rejected. For Sign in with Apple, register your app's
1486
+ # bundle ID as a native client ID. For Google, the web client ID used by
1487
+ # Credential Manager is usually the configured client ID; add your Android
1488
+ # and iOS client IDs as native client IDs if your app requests tokens for
1489
+ # them.
1490
+ #
1491
+ # Pass the raw nonce used when requesting the ID token so it can be validated
1492
+ # against the token's nonce claim. When signing in with Apple, the nonce is
1493
+ # required: hash it with SHA-256 before passing it to the Apple SDK, and send
1494
+ # the raw value here - Apple tokens requested without a nonce are rejected.
1495
+ # For Google the nonce is optional: it is validated whenever the token
1496
+ # carries one, and ignored when the provider issued the token without one.
1497
+ # Apple only returns the user's name on the first authorization, and never
1498
+ # inside the ID token - capture it on the client and pass it via the name
1499
+ # parameter.
1500
+ #
1501
+ # If there is already an active session, the new session will be attached to
1502
+ # the logged-in account. If there are no active sessions, the server will
1503
+ # attempt to look for a user with the same email address as the verified
1504
+ # email received from the provider and attach the new session to the existing
1505
+ # user. If no matching user is found - the server will create a new user.
1506
+ #
1507
+ # This flow does not return provider refresh tokens. You may pass an access
1508
+ # token the provider handed your client, along with its lifetime, to store it
1509
+ # on the session - but Appwrite cannot renew it once it expires. If your app
1510
+ # needs long-lived access to provider APIs, use the browser-based OAuth2 flow
1511
+ # instead.
1512
+ #
1513
+ # A user is limited to 10 active sessions at a time by default. [Learn more
1514
+ # about session
1515
+ # limits](https://appwrite.io/docs/authentication-security#limits).
1516
+ #
1517
+ #
1518
+ # @param [IdTokenProvider] provider OAuth2 provider that issued the ID token. Currently, supported providers are: apple, google.
1519
+ # @param [String] id_token OpenID Connect ID token (JWT) obtained natively from the provider, for example via Google Credential Manager or Sign in with Apple.
1520
+ # @param [String] nonce Raw nonce used when requesting the ID token. Required for Apple, and whenever the token carries a nonce claim, which must match it. Ignored when the provider issued the token without a nonce.
1521
+ # @param [String] access_token Provider access token to store alongside the session for calling provider APIs. Never used for authentication.
1522
+ # @param [Integer] access_token_expiry Seconds until the provider access token expires, as reported by the provider. Stored so clients can tell when the stored token goes stale.
1523
+ # @param [String] name User name. Only used when creating a new user and the ID token has no name claim, such as on the first Sign in with Apple authorization.
1524
+ #
1525
+ # @return [Session]
1526
+ def create_id_token_session(
1527
+ provider:,
1528
+ id_token:,
1529
+ nonce: nil,
1530
+ access_token: nil,
1531
+ access_token_expiry: nil,
1532
+ name: nil
1533
+ )
1534
+ if provider.nil?
1535
+ raise Appwrite::Exception.new('Missing required parameter: "provider"')
1536
+ end
1537
+
1538
+ if id_token.nil?
1539
+ raise Appwrite::Exception.new('Missing required parameter: "idToken"')
1540
+ end
1541
+
1542
+ api_path = '/account/sessions/id-token'
1543
+
1544
+ api_params = {
1545
+ provider: provider,
1546
+ idToken: id_token,
1547
+ nonce: nonce,
1548
+ accessToken: access_token,
1549
+ accessTokenExpiry: access_token_expiry,
1550
+ name: name,
1368
1551
  }
1369
1552
 
1370
1553
  api_headers = {
@@ -1397,8 +1580,6 @@ module Appwrite
1397
1580
  user_id:,
1398
1581
  secret:
1399
1582
  )
1400
- api_path = '/account/sessions/magic-url'
1401
-
1402
1583
  if user_id.nil?
1403
1584
  raise Appwrite::Exception.new('Missing required parameter: "userId"')
1404
1585
  end
@@ -1407,6 +1588,8 @@ module Appwrite
1407
1588
  raise Appwrite::Exception.new('Missing required parameter: "secret"')
1408
1589
  end
1409
1590
 
1591
+ api_path = '/account/sessions/magic-url'
1592
+
1410
1593
  api_params = {
1411
1594
  userId: user_id,
1412
1595
  secret: secret,
@@ -1442,8 +1625,6 @@ module Appwrite
1442
1625
  user_id:,
1443
1626
  secret:
1444
1627
  )
1445
- api_path = '/account/sessions/phone'
1446
-
1447
1628
  if user_id.nil?
1448
1629
  raise Appwrite::Exception.new('Missing required parameter: "userId"')
1449
1630
  end
@@ -1452,6 +1633,8 @@ module Appwrite
1452
1633
  raise Appwrite::Exception.new('Missing required parameter: "secret"')
1453
1634
  end
1454
1635
 
1636
+ api_path = '/account/sessions/phone'
1637
+
1455
1638
  api_params = {
1456
1639
  userId: user_id,
1457
1640
  secret: secret,
@@ -1484,8 +1667,6 @@ module Appwrite
1484
1667
  user_id:,
1485
1668
  secret:
1486
1669
  )
1487
- api_path = '/account/sessions/token'
1488
-
1489
1670
  if user_id.nil?
1490
1671
  raise Appwrite::Exception.new('Missing required parameter: "userId"')
1491
1672
  end
@@ -1494,6 +1675,8 @@ module Appwrite
1494
1675
  raise Appwrite::Exception.new('Missing required parameter: "secret"')
1495
1676
  end
1496
1677
 
1678
+ api_path = '/account/sessions/token'
1679
+
1497
1680
  api_params = {
1498
1681
  userId: user_id,
1499
1682
  secret: secret,
@@ -1523,13 +1706,13 @@ module Appwrite
1523
1706
  def get_session(
1524
1707
  session_id:
1525
1708
  )
1526
- api_path = '/account/sessions/{sessionId}'
1527
- .gsub('{sessionId}', session_id)
1528
-
1529
- if session_id.nil?
1709
+ if session_id.nil? || session_id == ''
1530
1710
  raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
1531
1711
  end
1532
1712
 
1713
+ api_path = '/account/sessions/{sessionId}'
1714
+ .gsub('{sessionId}', session_id)
1715
+
1533
1716
  api_params = {}
1534
1717
 
1535
1718
  api_headers = {
@@ -1556,13 +1739,13 @@ module Appwrite
1556
1739
  def update_session(
1557
1740
  session_id:
1558
1741
  )
1559
- api_path = '/account/sessions/{sessionId}'
1560
- .gsub('{sessionId}', session_id)
1561
-
1562
- if session_id.nil?
1742
+ if session_id.nil? || session_id == ''
1563
1743
  raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
1564
1744
  end
1565
1745
 
1746
+ api_path = '/account/sessions/{sessionId}'
1747
+ .gsub('{sessionId}', session_id)
1748
+
1566
1749
  api_params = {}
1567
1750
 
1568
1751
  api_headers = {
@@ -1592,18 +1775,19 @@ module Appwrite
1592
1775
  def delete_session(
1593
1776
  session_id:
1594
1777
  )
1595
- api_path = '/account/sessions/{sessionId}'
1596
- .gsub('{sessionId}', session_id)
1597
-
1598
- if session_id.nil?
1778
+ if session_id.nil? || session_id == ''
1599
1779
  raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
1600
1780
  end
1601
1781
 
1782
+ api_path = '/account/sessions/{sessionId}'
1783
+ .gsub('{sessionId}', session_id)
1784
+
1602
1785
  api_params = {}
1603
1786
 
1604
1787
  api_headers = {
1605
1788
  "X-Appwrite-Project": @client.get_config('project'),
1606
1789
  "content-type": 'application/json',
1790
+ "accept": 'application/json',
1607
1791
  }
1608
1792
 
1609
1793
  @client.call(
@@ -1665,8 +1849,6 @@ module Appwrite
1665
1849
  email:,
1666
1850
  phrase: nil
1667
1851
  )
1668
- api_path = '/account/tokens/email'
1669
-
1670
1852
  if user_id.nil?
1671
1853
  raise Appwrite::Exception.new('Missing required parameter: "userId"')
1672
1854
  end
@@ -1675,6 +1857,8 @@ module Appwrite
1675
1857
  raise Appwrite::Exception.new('Missing required parameter: "email"')
1676
1858
  end
1677
1859
 
1860
+ api_path = '/account/tokens/email'
1861
+
1678
1862
  api_params = {
1679
1863
  userId: user_id,
1680
1864
  email: email,
@@ -1723,8 +1907,6 @@ module Appwrite
1723
1907
  url: nil,
1724
1908
  phrase: nil
1725
1909
  )
1726
- api_path = '/account/tokens/magic-url'
1727
-
1728
1910
  if user_id.nil?
1729
1911
  raise Appwrite::Exception.new('Missing required parameter: "userId"')
1730
1912
  end
@@ -1733,6 +1915,8 @@ module Appwrite
1733
1915
  raise Appwrite::Exception.new('Missing required parameter: "email"')
1734
1916
  end
1735
1917
 
1918
+ api_path = '/account/tokens/magic-url'
1919
+
1736
1920
  api_params = {
1737
1921
  userId: user_id,
1738
1922
  email: email,
@@ -1766,11 +1950,15 @@ module Appwrite
1766
1950
  # session](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
1767
1951
  # endpoint.
1768
1952
  #
1953
+ # If there is already an active session, the OAuth2 identity is attached to
1954
+ # the logged-in account and that session stays active until the token is
1955
+ # exchanged for a new one.
1956
+ #
1769
1957
  # A user is limited to 10 active sessions at a time by default. [Learn more
1770
1958
  # about session
1771
1959
  # limits](https://appwrite.io/docs/authentication-security#limits).
1772
1960
  #
1773
- # @param [OAuthProvider] provider OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
1961
+ # @param [OAuthProvider] provider OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, kakao, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tiktok, tradeshift, tradeshiftBox, twitch, webflow, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
1774
1962
  # @param [String] success URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
1775
1963
  # @param [String] failure URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
1776
1964
  # @param [Array] scopes A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
@@ -1784,13 +1972,13 @@ module Appwrite
1784
1972
  scopes: nil,
1785
1973
  state: nil
1786
1974
  )
1787
- api_path = '/account/tokens/oauth2/{provider}'
1788
- .gsub('{provider}', provider)
1789
-
1790
1975
  if provider.nil?
1791
1976
  raise Appwrite::Exception.new('Missing required parameter: "provider"')
1792
1977
  end
1793
1978
 
1979
+ api_path = '/account/tokens/oauth2/{provider}'
1980
+ .gsub('{provider}', provider)
1981
+
1794
1982
  api_params = {
1795
1983
  success: success,
1796
1984
  failure: failure,
@@ -1909,8 +2097,6 @@ module Appwrite
1909
2097
  user_id:,
1910
2098
  phone:
1911
2099
  )
1912
- api_path = '/account/tokens/phone'
1913
-
1914
2100
  if user_id.nil?
1915
2101
  raise Appwrite::Exception.new('Missing required parameter: "userId"')
1916
2102
  end
@@ -1919,6 +2105,8 @@ module Appwrite
1919
2105
  raise Appwrite::Exception.new('Missing required parameter: "phone"')
1920
2106
  end
1921
2107
 
2108
+ api_path = '/account/tokens/phone'
2109
+
1922
2110
  api_params = {
1923
2111
  userId: user_id,
1924
2112
  phone: phone,
@@ -1961,12 +2149,12 @@ module Appwrite
1961
2149
  def create_email_verification(
1962
2150
  url:
1963
2151
  )
1964
- api_path = '/account/verifications/email'
1965
-
1966
2152
  if url.nil?
1967
2153
  raise Appwrite::Exception.new('Missing required parameter: "url"')
1968
2154
  end
1969
2155
 
2156
+ api_path = '/account/verifications/email'
2157
+
1970
2158
  api_params = {
1971
2159
  url: url,
1972
2160
  }
@@ -2011,12 +2199,12 @@ module Appwrite
2011
2199
  def create_verification(
2012
2200
  url:
2013
2201
  )
2014
- api_path = '/account/verifications/email'
2015
-
2016
2202
  if url.nil?
2017
2203
  raise Appwrite::Exception.new('Missing required parameter: "url"')
2018
2204
  end
2019
2205
 
2206
+ api_path = '/account/verifications/email'
2207
+
2020
2208
  api_params = {
2021
2209
  url: url,
2022
2210
  }
@@ -2049,8 +2237,6 @@ module Appwrite
2049
2237
  user_id:,
2050
2238
  secret:
2051
2239
  )
2052
- api_path = '/account/verifications/email'
2053
-
2054
2240
  if user_id.nil?
2055
2241
  raise Appwrite::Exception.new('Missing required parameter: "userId"')
2056
2242
  end
@@ -2059,6 +2245,8 @@ module Appwrite
2059
2245
  raise Appwrite::Exception.new('Missing required parameter: "secret"')
2060
2246
  end
2061
2247
 
2248
+ api_path = '/account/verifications/email'
2249
+
2062
2250
  api_params = {
2063
2251
  userId: user_id,
2064
2252
  secret: secret,
@@ -2095,8 +2283,94 @@ module Appwrite
2095
2283
  user_id:,
2096
2284
  secret:
2097
2285
  )
2286
+ if user_id.nil?
2287
+ raise Appwrite::Exception.new('Missing required parameter: "userId"')
2288
+ end
2289
+
2290
+ if secret.nil?
2291
+ raise Appwrite::Exception.new('Missing required parameter: "secret"')
2292
+ end
2293
+
2098
2294
  api_path = '/account/verifications/email'
2099
2295
 
2296
+ api_params = {
2297
+ userId: user_id,
2298
+ secret: secret,
2299
+ }
2300
+
2301
+ api_headers = {
2302
+ "X-Appwrite-Project": @client.get_config('project'),
2303
+ "content-type": 'application/json',
2304
+ "accept": 'application/json',
2305
+ }
2306
+
2307
+ @client.call(
2308
+ method: 'PUT',
2309
+ path: api_path,
2310
+ headers: api_headers,
2311
+ params: api_params,
2312
+ response_type: Models::Token
2313
+ )
2314
+ end
2315
+
2316
+ # Use this endpoint to send a 6-digit verification code to the currently
2317
+ # logged in user's email address. Unlike
2318
+ # [createEmailVerification](https://appwrite.io/docs/references/cloud/client-web/account#createEmailVerification),
2319
+ # this method requires no redirect URL, which makes it suitable for mobile
2320
+ # and desktop apps that cannot host a verification page. Learn more about how
2321
+ # to [complete the verification
2322
+ # process](https://appwrite.io/docs/references/cloud/client-web/account#updateEmailVerificationOTP).
2323
+ # The code sent to the user's email address is valid for 15 minutes.
2324
+ #
2325
+ # Enable the **phrase** parameter to include a randomly generated security
2326
+ # phrase in both the email and the response. Showing that phrase in your app
2327
+ # lets the user confirm the email genuinely came from your request, which
2328
+ # helps protect against phishing.
2329
+ #
2330
+ #
2331
+ # @param [] phrase Toggle for security phrase. If enabled, email will be sent with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.
2332
+ #
2333
+ # @return [Token]
2334
+ def create_email_verification_otp(
2335
+ phrase: nil
2336
+ )
2337
+ api_path = '/account/verifications/email/otp'
2338
+
2339
+ api_params = {
2340
+ phrase: phrase,
2341
+ }
2342
+
2343
+ api_headers = {
2344
+ "X-Appwrite-Project": @client.get_config('project'),
2345
+ "content-type": 'application/json',
2346
+ "accept": 'application/json',
2347
+ }
2348
+
2349
+ @client.call(
2350
+ method: 'POST',
2351
+ path: api_path,
2352
+ headers: api_headers,
2353
+ params: api_params,
2354
+ response_type: Models::Token
2355
+ )
2356
+ end
2357
+
2358
+ # Use this endpoint to complete the user email verification process using the
2359
+ # 6-digit code that was emailed by
2360
+ # [createEmailVerificationOTP](https://appwrite.io/docs/references/cloud/client-web/account#createEmailVerificationOTP).
2361
+ # Pass the **userId** of the user being verified along with the **secret**
2362
+ # code from the email. If confirmed, this route will return a 200 status code
2363
+ # and the code is consumed.
2364
+ #
2365
+ #
2366
+ # @param [String] user_id User ID.
2367
+ # @param [String] secret Valid verification OTP code.
2368
+ #
2369
+ # @return [Token]
2370
+ def update_email_verification_otp(
2371
+ user_id:,
2372
+ secret:
2373
+ )
2100
2374
  if user_id.nil?
2101
2375
  raise Appwrite::Exception.new('Missing required parameter: "userId"')
2102
2376
  end
@@ -2105,6 +2379,8 @@ module Appwrite
2105
2379
  raise Appwrite::Exception.new('Missing required parameter: "secret"')
2106
2380
  end
2107
2381
 
2382
+ api_path = '/account/verifications/email/otp'
2383
+
2108
2384
  api_params = {
2109
2385
  userId: user_id,
2110
2386
  secret: secret,
@@ -2169,8 +2445,6 @@ module Appwrite
2169
2445
  user_id:,
2170
2446
  secret:
2171
2447
  )
2172
- api_path = '/account/verifications/phone'
2173
-
2174
2448
  if user_id.nil?
2175
2449
  raise Appwrite::Exception.new('Missing required parameter: "userId"')
2176
2450
  end
@@ -2179,6 +2453,8 @@ module Appwrite
2179
2453
  raise Appwrite::Exception.new('Missing required parameter: "secret"')
2180
2454
  end
2181
2455
 
2456
+ api_path = '/account/verifications/phone'
2457
+
2182
2458
  api_params = {
2183
2459
  userId: user_id,
2184
2460
  secret: secret,