appwrite-console 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (552) hide show
  1. appwrite_console/__init__.py +1 -0
  2. appwrite_console/client.py +371 -0
  3. appwrite_console/encoders/__init__.py +1 -0
  4. appwrite_console/encoders/value_class_encoder.py +373 -0
  5. appwrite_console/enums/__init__.py +1 -0
  6. appwrite_console/enums/account_key_scopes.py +6 -0
  7. appwrite_console/enums/adapter.py +5 -0
  8. appwrite_console/enums/addon.py +7 -0
  9. appwrite_console/enums/appwrite_migration_resource.py +42 -0
  10. appwrite_console/enums/attribute_status.py +8 -0
  11. appwrite_console/enums/authentication_factor.py +7 -0
  12. appwrite_console/enums/authenticator_type.py +4 -0
  13. appwrite_console/enums/backup_services.py +10 -0
  14. appwrite_console/enums/billing_plan_group.py +6 -0
  15. appwrite_console/enums/block_mode.py +5 -0
  16. appwrite_console/enums/block_resource_type.py +12 -0
  17. appwrite_console/enums/browser.py +17 -0
  18. appwrite_console/enums/browser_permission.py +23 -0
  19. appwrite_console/enums/browser_theme.py +5 -0
  20. appwrite_console/enums/build_runtime.py +95 -0
  21. appwrite_console/enums/cache_database.py +6 -0
  22. appwrite_console/enums/cache_target.py +9 -0
  23. appwrite_console/enums/column_status.py +8 -0
  24. appwrite_console/enums/compression.py +6 -0
  25. appwrite_console/enums/console_resource_type.py +4 -0
  26. appwrite_console/enums/credit_card.py +20 -0
  27. appwrite_console/enums/database_status.py +17 -0
  28. appwrite_console/enums/database_type.py +10 -0
  29. appwrite_console/enums/databases_index_type.py +7 -0
  30. appwrite_console/enums/deployment_download_type.py +5 -0
  31. appwrite_console/enums/deployment_status.py +9 -0
  32. appwrite_console/enums/detection_framework_type.py +4 -0
  33. appwrite_console/enums/detection_runtime_type.py +4 -0
  34. appwrite_console/enums/documents_db_index_type.py +6 -0
  35. appwrite_console/enums/domain_purchase_status.py +7 -0
  36. appwrite_console/enums/domain_registration_type.py +7 -0
  37. appwrite_console/enums/domain_suggestion_type.py +5 -0
  38. appwrite_console/enums/domain_transfer_status_enum.py +11 -0
  39. appwrite_console/enums/embedding_model.py +7 -0
  40. appwrite_console/enums/execution_method.py +10 -0
  41. appwrite_console/enums/execution_status.py +8 -0
  42. appwrite_console/enums/execution_trigger.py +6 -0
  43. appwrite_console/enums/firebase_migration_resource.py +13 -0
  44. appwrite_console/enums/flag.py +198 -0
  45. appwrite_console/enums/framework.py +18 -0
  46. appwrite_console/enums/function_template_use_case.py +10 -0
  47. appwrite_console/enums/image_format.py +10 -0
  48. appwrite_console/enums/image_gravity.py +12 -0
  49. appwrite_console/enums/index_status.py +8 -0
  50. appwrite_console/enums/message_priority.py +5 -0
  51. appwrite_console/enums/message_status.py +8 -0
  52. appwrite_console/enums/messaging_provider_type.py +6 -0
  53. appwrite_console/enums/n_host_migration_resource.py +14 -0
  54. appwrite_console/enums/o_auth2_google_prompt.py +6 -0
  55. appwrite_console/enums/o_auth2_oidc_prompt.py +7 -0
  56. appwrite_console/enums/o_auth_provider.py +47 -0
  57. appwrite_console/enums/on_duplicate.py +6 -0
  58. appwrite_console/enums/order_by.py +5 -0
  59. appwrite_console/enums/organization_key_scopes.py +19 -0
  60. appwrite_console/enums/password_hash.py +14 -0
  61. appwrite_console/enums/platform.py +5 -0
  62. appwrite_console/enums/platform_type.py +8 -0
  63. appwrite_console/enums/project_auth_method_id.py +10 -0
  64. appwrite_console/enums/project_email_template_id.py +10 -0
  65. appwrite_console/enums/project_email_template_locale.py +134 -0
  66. appwrite_console/enums/project_key_scopes.py +107 -0
  67. appwrite_console/enums/project_o_auth2_google_prompt.py +6 -0
  68. appwrite_console/enums/project_o_auth2_oidc_prompt.py +7 -0
  69. appwrite_console/enums/project_o_auth_provider_id.py +47 -0
  70. appwrite_console/enums/project_policy_id.py +17 -0
  71. appwrite_console/enums/project_protocol_id.py +6 -0
  72. appwrite_console/enums/project_service_id.py +22 -0
  73. appwrite_console/enums/project_smtp_secure.py +5 -0
  74. appwrite_console/enums/project_usage_range.py +5 -0
  75. appwrite_console/enums/proxy_resource_type.py +5 -0
  76. appwrite_console/enums/proxy_rule_deployment_resource_type.py +5 -0
  77. appwrite_console/enums/proxy_rule_status.py +6 -0
  78. appwrite_console/enums/query_suggestion_resource.py +97 -0
  79. appwrite_console/enums/region.py +9 -0
  80. appwrite_console/enums/relation_mutate.py +6 -0
  81. appwrite_console/enums/relationship_type.py +7 -0
  82. appwrite_console/enums/runtime.py +95 -0
  83. appwrite_console/enums/schedule_resource_type.py +7 -0
  84. appwrite_console/enums/site_template_use_case.py +12 -0
  85. appwrite_console/enums/smtp_encryption.py +6 -0
  86. appwrite_console/enums/status.py +4 -0
  87. appwrite_console/enums/status_code.py +7 -0
  88. appwrite_console/enums/supabase_migration_resource.py +14 -0
  89. appwrite_console/enums/tables_db_index_type.py +7 -0
  90. appwrite_console/enums/template_reference_type.py +6 -0
  91. appwrite_console/enums/timezone.py +422 -0
  92. appwrite_console/enums/usage_range.py +6 -0
  93. appwrite_console/enums/vcs_detection_type.py +5 -0
  94. appwrite_console/enums/vcs_reference_type.py +6 -0
  95. appwrite_console/enums/vectors_db_index_type.py +9 -0
  96. appwrite_console/enums/waf_rule_action.py +8 -0
  97. appwrite_console/exception.py +7 -0
  98. appwrite_console/id.py +26 -0
  99. appwrite_console/input_file.py +21 -0
  100. appwrite_console/models/__init__.py +803 -0
  101. appwrite_console/models/activity_event.py +99 -0
  102. appwrite_console/models/activity_event_list.py +19 -0
  103. appwrite_console/models/additional_resource.py +30 -0
  104. appwrite_console/models/addon.py +42 -0
  105. appwrite_console/models/addon_list.py +19 -0
  106. appwrite_console/models/addon_price.py +36 -0
  107. appwrite_console/models/aggregation_breakdown.py +28 -0
  108. appwrite_console/models/aggregation_team.py +101 -0
  109. appwrite_console/models/aggregation_team_list.py +19 -0
  110. appwrite_console/models/algo_argon2.py +24 -0
  111. appwrite_console/models/algo_bcrypt.py +15 -0
  112. appwrite_console/models/algo_md5.py +15 -0
  113. appwrite_console/models/algo_phpass.py +15 -0
  114. appwrite_console/models/algo_scrypt.py +27 -0
  115. appwrite_console/models/algo_scrypt_modified.py +24 -0
  116. appwrite_console/models/algo_sha.py +15 -0
  117. appwrite_console/models/app.py +91 -0
  118. appwrite_console/models/app_installation.py +42 -0
  119. appwrite_console/models/app_installation_list.py +19 -0
  120. appwrite_console/models/app_key.py +39 -0
  121. appwrite_console/models/app_key_list.py +19 -0
  122. appwrite_console/models/app_scope.py +27 -0
  123. appwrite_console/models/app_scope_list.py +19 -0
  124. appwrite_console/models/app_secret.py +39 -0
  125. appwrite_console/models/app_secret_list.py +19 -0
  126. appwrite_console/models/app_secret_plaintext.py +39 -0
  127. appwrite_console/models/apps_list.py +19 -0
  128. appwrite_console/models/attribute_bigint.py +46 -0
  129. appwrite_console/models/attribute_boolean.py +40 -0
  130. appwrite_console/models/attribute_datetime.py +43 -0
  131. appwrite_console/models/attribute_email.py +43 -0
  132. appwrite_console/models/attribute_enum.py +46 -0
  133. appwrite_console/models/attribute_float.py +46 -0
  134. appwrite_console/models/attribute_integer.py +46 -0
  135. appwrite_console/models/attribute_ip.py +43 -0
  136. appwrite_console/models/attribute_line.py +40 -0
  137. appwrite_console/models/attribute_list.py +36 -0
  138. appwrite_console/models/attribute_longtext.py +43 -0
  139. appwrite_console/models/attribute_mediumtext.py +43 -0
  140. appwrite_console/models/attribute_object.py +37 -0
  141. appwrite_console/models/attribute_point.py +40 -0
  142. appwrite_console/models/attribute_polygon.py +40 -0
  143. appwrite_console/models/attribute_relationship.py +55 -0
  144. appwrite_console/models/attribute_string.py +46 -0
  145. appwrite_console/models/attribute_text.py +43 -0
  146. appwrite_console/models/attribute_url.py +43 -0
  147. appwrite_console/models/attribute_varchar.py +46 -0
  148. appwrite_console/models/attribute_vector.py +40 -0
  149. appwrite_console/models/backup_archive.py +48 -0
  150. appwrite_console/models/backup_archive_list.py +19 -0
  151. appwrite_console/models/backup_policy.py +48 -0
  152. appwrite_console/models/backup_policy_list.py +19 -0
  153. appwrite_console/models/backup_restoration.py +45 -0
  154. appwrite_console/models/backup_restoration_list.py +19 -0
  155. appwrite_console/models/base_model.py +27 -0
  156. appwrite_console/models/billing_address.py +36 -0
  157. appwrite_console/models/billing_address_list.py +19 -0
  158. appwrite_console/models/billing_limits.py +36 -0
  159. appwrite_console/models/billing_plan.py +226 -0
  160. appwrite_console/models/billing_plan_addon.py +19 -0
  161. appwrite_console/models/billing_plan_addon_details.py +36 -0
  162. appwrite_console/models/billing_plan_dedicated_database_limits.py +69 -0
  163. appwrite_console/models/billing_plan_limits.py +18 -0
  164. appwrite_console/models/billing_plan_list.py +19 -0
  165. appwrite_console/models/billing_plan_supported_addons.py +21 -0
  166. appwrite_console/models/block.py +45 -0
  167. appwrite_console/models/block_delete.py +19 -0
  168. appwrite_console/models/block_list.py +19 -0
  169. appwrite_console/models/branch.py +15 -0
  170. appwrite_console/models/branch_list.py +19 -0
  171. appwrite_console/models/bucket.py +54 -0
  172. appwrite_console/models/bucket_list.py +19 -0
  173. appwrite_console/models/campaign.py +49 -0
  174. appwrite_console/models/collection.py +67 -0
  175. appwrite_console/models/collection_list.py +19 -0
  176. appwrite_console/models/column_bigint.py +46 -0
  177. appwrite_console/models/column_boolean.py +40 -0
  178. appwrite_console/models/column_datetime.py +43 -0
  179. appwrite_console/models/column_email.py +43 -0
  180. appwrite_console/models/column_enum.py +46 -0
  181. appwrite_console/models/column_float.py +46 -0
  182. appwrite_console/models/column_index.py +42 -0
  183. appwrite_console/models/column_index_list.py +19 -0
  184. appwrite_console/models/column_integer.py +46 -0
  185. appwrite_console/models/column_ip.py +43 -0
  186. appwrite_console/models/column_line.py +40 -0
  187. appwrite_console/models/column_list.py +36 -0
  188. appwrite_console/models/column_longtext.py +43 -0
  189. appwrite_console/models/column_mediumtext.py +43 -0
  190. appwrite_console/models/column_point.py +40 -0
  191. appwrite_console/models/column_polygon.py +40 -0
  192. appwrite_console/models/column_relationship.py +55 -0
  193. appwrite_console/models/column_string.py +46 -0
  194. appwrite_console/models/column_text.py +43 -0
  195. appwrite_console/models/column_url.py +43 -0
  196. appwrite_console/models/column_varchar.py +46 -0
  197. appwrite_console/models/console_key_scope.py +24 -0
  198. appwrite_console/models/console_key_scope_list.py +19 -0
  199. appwrite_console/models/console_o_auth2_provider.py +19 -0
  200. appwrite_console/models/console_o_auth2_provider_list.py +19 -0
  201. appwrite_console/models/console_o_auth2_provider_parameter.py +24 -0
  202. appwrite_console/models/console_region.py +30 -0
  203. appwrite_console/models/console_region_list.py +19 -0
  204. appwrite_console/models/console_variables.py +96 -0
  205. appwrite_console/models/continent.py +18 -0
  206. appwrite_console/models/continent_list.py +19 -0
  207. appwrite_console/models/country.py +18 -0
  208. appwrite_console/models/country_list.py +19 -0
  209. appwrite_console/models/coupon.py +36 -0
  210. appwrite_console/models/credit.py +45 -0
  211. appwrite_console/models/credit_available.py +15 -0
  212. appwrite_console/models/credit_list.py +22 -0
  213. appwrite_console/models/currency.py +33 -0
  214. appwrite_console/models/currency_list.py +19 -0
  215. appwrite_console/models/database.py +52 -0
  216. appwrite_console/models/database_list.py +19 -0
  217. appwrite_console/models/database_migration.py +57 -0
  218. appwrite_console/models/database_migration_list.py +19 -0
  219. appwrite_console/models/database_status.py +57 -0
  220. appwrite_console/models/database_status_connections.py +18 -0
  221. appwrite_console/models/database_status_replica.py +24 -0
  222. appwrite_console/models/database_status_volume.py +24 -0
  223. appwrite_console/models/dedicated_database.py +159 -0
  224. appwrite_console/models/dedicated_database_backup.py +63 -0
  225. appwrite_console/models/dedicated_database_backup_list.py +19 -0
  226. appwrite_console/models/dedicated_database_backup_storage.py +27 -0
  227. appwrite_console/models/dedicated_database_branch.py +48 -0
  228. appwrite_console/models/dedicated_database_branch_list.py +16 -0
  229. appwrite_console/models/dedicated_database_execution.py +31 -0
  230. appwrite_console/models/dedicated_database_execution_column.py +18 -0
  231. appwrite_console/models/dedicated_database_extensions.py +22 -0
  232. appwrite_console/models/dedicated_database_list.py +19 -0
  233. appwrite_console/models/dedicated_database_member.py +24 -0
  234. appwrite_console/models/dedicated_database_operation.py +45 -0
  235. appwrite_console/models/dedicated_database_operation_list.py +19 -0
  236. appwrite_console/models/dedicated_database_pitr_windows.py +18 -0
  237. appwrite_console/models/dedicated_database_pooler.py +42 -0
  238. appwrite_console/models/dedicated_database_replicas.py +37 -0
  239. appwrite_console/models/dedicated_database_restoration.py +45 -0
  240. appwrite_console/models/dedicated_database_restoration_list.py +19 -0
  241. appwrite_console/models/dedicated_database_specification.py +39 -0
  242. appwrite_console/models/dedicated_database_specification_list.py +23 -0
  243. appwrite_console/models/dedicated_database_specification_pricing.py +27 -0
  244. appwrite_console/models/deployment.py +94 -0
  245. appwrite_console/models/deployment_list.py +19 -0
  246. appwrite_console/models/detection_framework.py +32 -0
  247. appwrite_console/models/detection_runtime.py +29 -0
  248. appwrite_console/models/detection_variable.py +18 -0
  249. appwrite_console/models/dev_key.py +36 -0
  250. appwrite_console/models/dev_key_list.py +19 -0
  251. appwrite_console/models/dns_record.py +48 -0
  252. appwrite_console/models/dns_records_list.py +19 -0
  253. appwrite_console/models/document.py +80 -0
  254. appwrite_console/models/document_list.py +32 -0
  255. appwrite_console/models/domain.py +53 -0
  256. appwrite_console/models/domain_price.py +30 -0
  257. appwrite_console/models/domain_purchase.py +43 -0
  258. appwrite_console/models/domain_suggestion.py +24 -0
  259. appwrite_console/models/domain_suggestions_list.py +19 -0
  260. appwrite_console/models/domain_transfer_out.py +15 -0
  261. appwrite_console/models/domain_transfer_status.py +22 -0
  262. appwrite_console/models/domains_list.py +19 -0
  263. appwrite_console/models/downgrade_feedback.py +42 -0
  264. appwrite_console/models/email_template.py +36 -0
  265. appwrite_console/models/email_template_list.py +19 -0
  266. appwrite_console/models/embedding.py +24 -0
  267. appwrite_console/models/embedding_list.py +19 -0
  268. appwrite_console/models/ephemeral_key.py +39 -0
  269. appwrite_console/models/estimation.py +37 -0
  270. appwrite_console/models/estimation_delete_organization.py +16 -0
  271. appwrite_console/models/estimation_item.py +18 -0
  272. appwrite_console/models/estimation_plan_change.py +29 -0
  273. appwrite_console/models/estimation_update_plan.py +40 -0
  274. appwrite_console/models/execution.py +69 -0
  275. appwrite_console/models/execution_list.py +19 -0
  276. appwrite_console/models/file.py +60 -0
  277. appwrite_console/models/file_list.py +19 -0
  278. appwrite_console/models/framework.py +28 -0
  279. appwrite_console/models/framework_adapter.py +27 -0
  280. appwrite_console/models/framework_list.py +19 -0
  281. appwrite_console/models/function.py +109 -0
  282. appwrite_console/models/function_list.py +19 -0
  283. appwrite_console/models/headers.py +18 -0
  284. appwrite_console/models/identity.py +42 -0
  285. appwrite_console/models/identity_list.py +19 -0
  286. appwrite_console/models/index.py +43 -0
  287. appwrite_console/models/index_list.py +19 -0
  288. appwrite_console/models/insight.py +64 -0
  289. appwrite_console/models/insight_cta.py +24 -0
  290. appwrite_console/models/insight_list.py +19 -0
  291. appwrite_console/models/installation.py +30 -0
  292. appwrite_console/models/installation_list.py +19 -0
  293. appwrite_console/models/invoice.py +82 -0
  294. appwrite_console/models/invoice_list.py +19 -0
  295. appwrite_console/models/jwt.py +15 -0
  296. appwrite_console/models/key.py +39 -0
  297. appwrite_console/models/key_list.py +19 -0
  298. appwrite_console/models/language.py +21 -0
  299. appwrite_console/models/language_list.py +19 -0
  300. appwrite_console/models/locale.py +66 -0
  301. appwrite_console/models/locale_code.py +18 -0
  302. appwrite_console/models/locale_code_list.py +19 -0
  303. appwrite_console/models/log.py +78 -0
  304. appwrite_console/models/log_list.py +19 -0
  305. appwrite_console/models/membership.py +57 -0
  306. appwrite_console/models/membership_list.py +19 -0
  307. appwrite_console/models/message.py +52 -0
  308. appwrite_console/models/message_list.py +19 -0
  309. appwrite_console/models/metric.py +18 -0
  310. appwrite_console/models/metric_breakdown.py +24 -0
  311. appwrite_console/models/mfa_challenge.py +24 -0
  312. appwrite_console/models/mfa_factors.py +24 -0
  313. appwrite_console/models/mfa_recovery_codes.py +15 -0
  314. appwrite_console/models/mfa_type.py +18 -0
  315. appwrite_console/models/migration.py +75 -0
  316. appwrite_console/models/migration_list.py +19 -0
  317. appwrite_console/models/migration_report.py +96 -0
  318. appwrite_console/models/mock_number.py +24 -0
  319. appwrite_console/models/mock_number_list.py +19 -0
  320. appwrite_console/models/notification.py +60 -0
  321. appwrite_console/models/notification_list.py +19 -0
  322. appwrite_console/models/o_auth2_amazon.py +24 -0
  323. appwrite_console/models/o_auth2_apple.py +30 -0
  324. appwrite_console/models/o_auth2_appwrite.py +24 -0
  325. appwrite_console/models/o_auth2_auth0.py +27 -0
  326. appwrite_console/models/o_auth2_authentik.py +27 -0
  327. appwrite_console/models/o_auth2_autodesk.py +24 -0
  328. appwrite_console/models/o_auth2_bitbucket.py +24 -0
  329. appwrite_console/models/o_auth2_bitly.py +24 -0
  330. appwrite_console/models/o_auth2_box.py +24 -0
  331. appwrite_console/models/o_auth2_dailymotion.py +24 -0
  332. appwrite_console/models/o_auth2_discord.py +24 -0
  333. appwrite_console/models/o_auth2_disqus.py +24 -0
  334. appwrite_console/models/o_auth2_dropbox.py +24 -0
  335. appwrite_console/models/o_auth2_etsy.py +24 -0
  336. appwrite_console/models/o_auth2_facebook.py +24 -0
  337. appwrite_console/models/o_auth2_figma.py +24 -0
  338. appwrite_console/models/o_auth2_fusion_auth.py +27 -0
  339. appwrite_console/models/o_auth2_github.py +24 -0
  340. appwrite_console/models/o_auth2_gitlab.py +27 -0
  341. appwrite_console/models/o_auth2_google.py +28 -0
  342. appwrite_console/models/o_auth2_keycloak.py +30 -0
  343. appwrite_console/models/o_auth2_kick.py +24 -0
  344. appwrite_console/models/o_auth2_linkedin.py +24 -0
  345. appwrite_console/models/o_auth2_microsoft.py +27 -0
  346. appwrite_console/models/o_auth2_notion.py +24 -0
  347. appwrite_console/models/o_auth2_oidc.py +43 -0
  348. appwrite_console/models/o_auth2_okta.py +30 -0
  349. appwrite_console/models/o_auth2_paypal.py +24 -0
  350. appwrite_console/models/o_auth2_podio.py +24 -0
  351. appwrite_console/models/o_auth2_provider_list.py +59 -0
  352. appwrite_console/models/o_auth2_salesforce.py +24 -0
  353. appwrite_console/models/o_auth2_slack.py +24 -0
  354. appwrite_console/models/o_auth2_spotify.py +24 -0
  355. appwrite_console/models/o_auth2_stripe.py +24 -0
  356. appwrite_console/models/o_auth2_tradeshift.py +24 -0
  357. appwrite_console/models/o_auth2_twitch.py +24 -0
  358. appwrite_console/models/o_auth2_word_press.py +24 -0
  359. appwrite_console/models/o_auth2_x.py +24 -0
  360. appwrite_console/models/o_auth2_yahoo.py +24 -0
  361. appwrite_console/models/o_auth2_yandex.py +24 -0
  362. appwrite_console/models/o_auth2_zoho.py +24 -0
  363. appwrite_console/models/o_auth2_zoom.py +24 -0
  364. appwrite_console/models/oauth2_approve.py +15 -0
  365. appwrite_console/models/oauth2_authorize.py +18 -0
  366. appwrite_console/models/oauth2_consent.py +42 -0
  367. appwrite_console/models/oauth2_consent_list.py +19 -0
  368. appwrite_console/models/oauth2_consent_token.py +45 -0
  369. appwrite_console/models/oauth2_consent_token_list.py +19 -0
  370. appwrite_console/models/oauth2_device_authorization.py +30 -0
  371. appwrite_console/models/oauth2_grant.py +48 -0
  372. appwrite_console/models/oauth2_organization.py +15 -0
  373. appwrite_console/models/oauth2_organization_list.py +19 -0
  374. appwrite_console/models/oauth2_par.py +18 -0
  375. appwrite_console/models/oauth2_project.py +21 -0
  376. appwrite_console/models/oauth2_project_list.py +19 -0
  377. appwrite_console/models/oauth2_reject.py +15 -0
  378. appwrite_console/models/oauth2_token.py +33 -0
  379. appwrite_console/models/organization.py +132 -0
  380. appwrite_console/models/organization_list.py +32 -0
  381. appwrite_console/models/payment_authentication.py +30 -0
  382. appwrite_console/models/payment_method.py +72 -0
  383. appwrite_console/models/payment_method_list.py +19 -0
  384. appwrite_console/models/phone.py +21 -0
  385. appwrite_console/models/phone_list.py +19 -0
  386. appwrite_console/models/plan_change_estimation_details.py +39 -0
  387. appwrite_console/models/plan_change_limits.py +28 -0
  388. appwrite_console/models/plan_change_project_compliance.py +28 -0
  389. appwrite_console/models/plan_change_resource_compliance.py +30 -0
  390. appwrite_console/models/platform_android.py +31 -0
  391. appwrite_console/models/platform_apple.py +31 -0
  392. appwrite_console/models/platform_linux.py +31 -0
  393. appwrite_console/models/platform_list.py +23 -0
  394. appwrite_console/models/platform_web.py +31 -0
  395. appwrite_console/models/platform_windows.py +31 -0
  396. appwrite_console/models/policy_deny_aliased_email.py +18 -0
  397. appwrite_console/models/policy_deny_corporate_email.py +18 -0
  398. appwrite_console/models/policy_deny_disposable_email.py +18 -0
  399. appwrite_console/models/policy_deny_free_email.py +18 -0
  400. appwrite_console/models/policy_list.py +32 -0
  401. appwrite_console/models/policy_membership_privacy.py +33 -0
  402. appwrite_console/models/policy_password_dictionary.py +18 -0
  403. appwrite_console/models/policy_password_history.py +18 -0
  404. appwrite_console/models/policy_password_personal_data.py +18 -0
  405. appwrite_console/models/policy_password_strength.py +30 -0
  406. appwrite_console/models/policy_session_alert.py +18 -0
  407. appwrite_console/models/policy_session_duration.py +18 -0
  408. appwrite_console/models/policy_session_invalidation.py +18 -0
  409. appwrite_console/models/policy_session_limit.py +18 -0
  410. appwrite_console/models/policy_user_limit.py +18 -0
  411. appwrite_console/models/postgres_extension.py +24 -0
  412. appwrite_console/models/postgres_extension_list.py +19 -0
  413. appwrite_console/models/preferences.py +52 -0
  414. appwrite_console/models/presence.py +39 -0
  415. appwrite_console/models/presence_list.py +19 -0
  416. appwrite_console/models/program.py +39 -0
  417. appwrite_console/models/project.py +153 -0
  418. appwrite_console/models/project_auth_method.py +19 -0
  419. appwrite_console/models/project_list.py +19 -0
  420. appwrite_console/models/project_protocol.py +19 -0
  421. appwrite_console/models/project_service.py +19 -0
  422. appwrite_console/models/provider.py +39 -0
  423. appwrite_console/models/provider_list.py +19 -0
  424. appwrite_console/models/provider_repository.py +42 -0
  425. appwrite_console/models/provider_repository_framework.py +45 -0
  426. appwrite_console/models/provider_repository_framework_list.py +22 -0
  427. appwrite_console/models/provider_repository_runtime.py +45 -0
  428. appwrite_console/models/provider_repository_runtime_list.py +22 -0
  429. appwrite_console/models/proxy_rule.py +59 -0
  430. appwrite_console/models/proxy_rule_list.py +19 -0
  431. appwrite_console/models/report.py +49 -0
  432. appwrite_console/models/report_list.py +19 -0
  433. appwrite_console/models/resource_token.py +33 -0
  434. appwrite_console/models/resource_token_list.py +19 -0
  435. appwrite_console/models/review.py +24 -0
  436. appwrite_console/models/roles.py +18 -0
  437. appwrite_console/models/row.py +80 -0
  438. appwrite_console/models/row_list.py +32 -0
  439. appwrite_console/models/runtime.py +36 -0
  440. appwrite_console/models/runtime_list.py +19 -0
  441. appwrite_console/models/schedule.py +45 -0
  442. appwrite_console/models/schedule_list.py +19 -0
  443. appwrite_console/models/session.py +99 -0
  444. appwrite_console/models/session_list.py +19 -0
  445. appwrite_console/models/site.py +115 -0
  446. appwrite_console/models/site_list.py +19 -0
  447. appwrite_console/models/specification.py +24 -0
  448. appwrite_console/models/specification_list.py +19 -0
  449. appwrite_console/models/stage.py +27 -0
  450. appwrite_console/models/stage_list.py +16 -0
  451. appwrite_console/models/subscriber.py +40 -0
  452. appwrite_console/models/subscriber_list.py +19 -0
  453. appwrite_console/models/table.py +67 -0
  454. appwrite_console/models/table_list.py +19 -0
  455. appwrite_console/models/target.py +39 -0
  456. appwrite_console/models/target_list.py +19 -0
  457. appwrite_console/models/team.py +43 -0
  458. appwrite_console/models/team_list.py +32 -0
  459. appwrite_console/models/template_framework.py +39 -0
  460. appwrite_console/models/template_function.py +65 -0
  461. appwrite_console/models/template_function_list.py +19 -0
  462. appwrite_console/models/template_runtime.py +24 -0
  463. appwrite_console/models/template_site.py +53 -0
  464. appwrite_console/models/template_site_list.py +19 -0
  465. appwrite_console/models/template_variable.py +33 -0
  466. appwrite_console/models/token.py +30 -0
  467. appwrite_console/models/topic.py +36 -0
  468. appwrite_console/models/topic_list.py +19 -0
  469. appwrite_console/models/transaction.py +30 -0
  470. appwrite_console/models/transaction_list.py +19 -0
  471. appwrite_console/models/usage_billing_plan.py +46 -0
  472. appwrite_console/models/usage_data_point.py +99 -0
  473. appwrite_console/models/usage_event_list.py +19 -0
  474. appwrite_console/models/usage_gauge_list.py +19 -0
  475. appwrite_console/models/usage_metric.py +19 -0
  476. appwrite_console/models/usage_organization.py +104 -0
  477. appwrite_console/models/usage_organization_project.py +73 -0
  478. appwrite_console/models/usage_presence.py +22 -0
  479. appwrite_console/models/usage_project.py +218 -0
  480. appwrite_console/models/usage_resources.py +36 -0
  481. appwrite_console/models/usage_users.py +28 -0
  482. appwrite_console/models/user.py +111 -0
  483. appwrite_console/models/user_list.py +32 -0
  484. appwrite_console/models/variable.py +36 -0
  485. appwrite_console/models/variable_list.py +19 -0
  486. appwrite_console/models/vcs_content.py +21 -0
  487. appwrite_console/models/vcs_content_list.py +19 -0
  488. appwrite_console/models/vcs_namespace.py +27 -0
  489. appwrite_console/models/vcs_namespace_list.py +19 -0
  490. appwrite_console/models/vectorsdb_collection.py +54 -0
  491. appwrite_console/models/vectorsdb_collection_list.py +19 -0
  492. appwrite_console/models/waf_rule.py +55 -0
  493. appwrite_console/models/waf_rule_bypass.py +55 -0
  494. appwrite_console/models/waf_rule_challenge.py +64 -0
  495. appwrite_console/models/waf_rule_deny.py +55 -0
  496. appwrite_console/models/waf_rule_list.py +19 -0
  497. appwrite_console/models/waf_rule_rate_limit.py +64 -0
  498. appwrite_console/models/waf_rule_redirect.py +61 -0
  499. appwrite_console/models/webhook.py +51 -0
  500. appwrite_console/models/webhook_list.py +19 -0
  501. appwrite_console/operator.py +150 -0
  502. appwrite_console/permission.py +21 -0
  503. appwrite_console/query.py +293 -0
  504. appwrite_console/role.py +111 -0
  505. appwrite_console/service.py +50 -0
  506. appwrite_console/services/__init__.py +1 -0
  507. appwrite_console/services/account.py +3328 -0
  508. appwrite_console/services/activities.py +89 -0
  509. appwrite_console/services/advisor.py +234 -0
  510. appwrite_console/services/apps.py +1156 -0
  511. appwrite_console/services/assistant.py +50 -0
  512. appwrite_console/services/avatars.py +531 -0
  513. appwrite_console/services/backups.py +572 -0
  514. appwrite_console/services/console.py +807 -0
  515. appwrite_console/services/databases.py +4976 -0
  516. appwrite_console/services/documents_db.py +2052 -0
  517. appwrite_console/services/domains.py +3047 -0
  518. appwrite_console/services/functions.py +1659 -0
  519. appwrite_console/services/graphql.py +92 -0
  520. appwrite_console/services/locale.py +243 -0
  521. appwrite_console/services/manager.py +301 -0
  522. appwrite_console/services/messaging.py +3137 -0
  523. appwrite_console/services/migrations.py +1036 -0
  524. appwrite_console/services/mongo.py +1683 -0
  525. appwrite_console/services/mysql.py +1861 -0
  526. appwrite_console/services/notifications.py +98 -0
  527. appwrite_console/services/oauth2.py +914 -0
  528. appwrite_console/services/organization.py +1039 -0
  529. appwrite_console/services/organizations.py +2245 -0
  530. appwrite_console/services/postgresql.py +1995 -0
  531. appwrite_console/services/presences.py +309 -0
  532. appwrite_console/services/project.py +5271 -0
  533. appwrite_console/services/projects.py +885 -0
  534. appwrite_console/services/proxy.py +394 -0
  535. appwrite_console/services/sites.py +1593 -0
  536. appwrite_console/services/storage.py +818 -0
  537. appwrite_console/services/tables_db.py +5189 -0
  538. appwrite_console/services/teams.py +993 -0
  539. appwrite_console/services/tokens.py +243 -0
  540. appwrite_console/services/usage.py +194 -0
  541. appwrite_console/services/users.py +2314 -0
  542. appwrite_console/services/vcs.py +599 -0
  543. appwrite_console/services/vectors_db.py +2054 -0
  544. appwrite_console/services/waf.py +1014 -0
  545. appwrite_console/services/webhooks.py +344 -0
  546. appwrite_console/utils/__init__.py +1 -0
  547. appwrite_console/utils/deprecated.py +51 -0
  548. appwrite_console-0.1.0.dist-info/METADATA +189 -0
  549. appwrite_console-0.1.0.dist-info/RECORD +552 -0
  550. appwrite_console-0.1.0.dist-info/WHEEL +5 -0
  551. appwrite_console-0.1.0.dist-info/licenses/LICENSE +12 -0
  552. appwrite_console-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1683 @@
1
+ from ..service import Service
2
+ from urllib.parse import quote
3
+ from typing import Any, Dict, List, Optional, Union
4
+ from ..exception import AppwriteException
5
+ from appwrite_console.utils.deprecated import deprecated
6
+ from ..models.dedicated_database_list import DedicatedDatabaseList
7
+ from ..models.dedicated_database import DedicatedDatabase
8
+ from ..models.dedicated_database_specification_list import DedicatedDatabaseSpecificationList
9
+ from ..models.dedicated_database_backup_list import DedicatedDatabaseBackupList
10
+ from ..models.dedicated_database_backup import DedicatedDatabaseBackup
11
+ from ..models.backup_policy_list import BackupPolicyList
12
+ from ..models.backup_policy import BackupPolicy
13
+ from ..models.dedicated_database_backup_storage import DedicatedDatabaseBackupStorage
14
+ from ..models.dedicated_database_branch_list import DedicatedDatabaseBranchList
15
+ from ..models.dedicated_database_operation_list import DedicatedDatabaseOperationList
16
+ from ..models.dedicated_database_pitr_windows import DedicatedDatabasePITRWindows
17
+ from ..models.dedicated_database_replicas import DedicatedDatabaseReplicas
18
+ from ..models.dedicated_database_restoration_list import DedicatedDatabaseRestorationList
19
+ from ..models.dedicated_database_restoration import DedicatedDatabaseRestoration
20
+ from ..models.database_status import DatabaseStatus
21
+
22
+ class Mongo(Service):
23
+
24
+ def __init__(self, client) -> None:
25
+ super(Mongo, self).__init__(client)
26
+
27
+ def list(
28
+ self,
29
+ queries: Optional[List[str]] = None
30
+ ) -> DedicatedDatabaseList:
31
+ """
32
+ List all dedicated databases. Results support pagination.
33
+
34
+ Parameters
35
+ ----------
36
+ queries : Optional[List[str]]
37
+ Array of query strings.
38
+
39
+ Returns
40
+ -------
41
+ DedicatedDatabaseList
42
+ API response as a typed Pydantic model
43
+
44
+ Raises
45
+ ------
46
+ AppwriteException
47
+ If API request fails
48
+ """
49
+
50
+ api_path = '/mongo'
51
+ api_params = {}
52
+
53
+ if queries is not None:
54
+ api_params['queries'] = self._normalize_value(queries)
55
+
56
+ response = self.client.call('get', api_path, {
57
+ 'X-Appwrite-Project': self.client.get_config('project'),
58
+ 'accept': 'application/json',
59
+ }, api_params)
60
+
61
+ return self._parse_response(response, model=DedicatedDatabaseList)
62
+
63
+
64
+ def create(
65
+ self,
66
+ database_id: str,
67
+ name: str,
68
+ version: Optional[str] = None,
69
+ specification: Optional[str] = None,
70
+ replicas: Optional[float] = None,
71
+ sync_mode: Optional[str] = None,
72
+ standby_region: Optional[str] = None,
73
+ network_idle_timeout_seconds: Optional[float] = None,
74
+ network_ip_allowlist: Optional[List[str]] = None,
75
+ idle_timeout_minutes: Optional[float] = None,
76
+ pitr: Optional[bool] = None,
77
+ pitr_retention_days: Optional[float] = None,
78
+ storage_autoscaling: Optional[bool] = None,
79
+ storage_autoscaling_threshold_percent: Optional[float] = None,
80
+ storage_autoscaling_max_gb: Optional[float] = None
81
+ ) -> DedicatedDatabase:
82
+ """
83
+ Create a new dedicated database with the chosen engine and configuration. Status will be 'provisioning' until the database is ready.
84
+
85
+ Parameters
86
+ ----------
87
+ database_id : str
88
+ 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't start with a special char. Max length is 36 chars.
89
+ name : str
90
+ Database display name. Max length: 128 chars.
91
+ version : Optional[str]
92
+ Database engine version. Defaults to latest for selected engine.
93
+ specification : Optional[str]
94
+ Specification identifier. Drives the allocated CPU, memory, storage, storage class, and connection ceiling.
95
+ replicas : Optional[float]
96
+ Number of high availability replicas (0-5). High availability is enabled when greater than 0.
97
+ sync_mode : Optional[str]
98
+ Replication sync mode preference. Allowed values: async, sync, quorum.
99
+ standby_region : Optional[str]
100
+ Standby region for a cross-region replica. When set, a replica is provisioned in this region for cross-region high availability. Must differ from the database region.
101
+ network_idle_timeout_seconds : Optional[float]
102
+ Connection idle timeout in seconds.
103
+ network_ip_allowlist : Optional[List[str]]
104
+ IP addresses/CIDR ranges allowed to connect.
105
+ idle_timeout_minutes : Optional[float]
106
+ Minutes of inactivity before container scales to zero.
107
+ pitr : Optional[bool]
108
+ Enable point-in-time recovery (PITR). Continuously archives changes so the database can be restored to any moment within the retention window.
109
+ pitr_retention_days : Optional[float]
110
+ Number of days to retain PITR data.
111
+ storage_autoscaling : Optional[bool]
112
+ Enable automatic storage expansion when usage exceeds threshold.
113
+ storage_autoscaling_threshold_percent : Optional[float]
114
+ Storage usage percentage (50-95) that triggers automatic expansion.
115
+ storage_autoscaling_max_gb : Optional[float]
116
+ Maximum storage size in GB for autoscaling. 0 means no limit.
117
+
118
+ Returns
119
+ -------
120
+ DedicatedDatabase
121
+ API response as a typed Pydantic model
122
+
123
+ Raises
124
+ ------
125
+ AppwriteException
126
+ If API request fails
127
+ """
128
+
129
+ api_path = '/mongo'
130
+ api_params = {}
131
+ if database_id is None:
132
+ raise AppwriteException('Missing required parameter: "database_id"')
133
+
134
+ if name is None:
135
+ raise AppwriteException('Missing required parameter: "name"')
136
+
137
+
138
+ api_params['databaseId'] = self._normalize_value(database_id)
139
+ api_params['name'] = self._normalize_value(name)
140
+ if version is not None:
141
+ api_params['version'] = self._normalize_value(version)
142
+ if specification is not None:
143
+ api_params['specification'] = self._normalize_value(specification)
144
+ if replicas is not None:
145
+ api_params['replicas'] = self._normalize_value(replicas)
146
+ if sync_mode is not None:
147
+ api_params['syncMode'] = self._normalize_value(sync_mode)
148
+ if standby_region is not None:
149
+ api_params['standbyRegion'] = self._normalize_value(standby_region)
150
+ if network_idle_timeout_seconds is not None:
151
+ api_params['networkIdleTimeoutSeconds'] = self._normalize_value(network_idle_timeout_seconds)
152
+ if network_ip_allowlist is not None:
153
+ api_params['networkIPAllowlist'] = self._normalize_value(network_ip_allowlist)
154
+ if idle_timeout_minutes is not None:
155
+ api_params['idleTimeoutMinutes'] = self._normalize_value(idle_timeout_minutes)
156
+ if pitr is not None:
157
+ api_params['pitr'] = self._normalize_value(pitr)
158
+ if pitr_retention_days is not None:
159
+ api_params['pitrRetentionDays'] = self._normalize_value(pitr_retention_days)
160
+ if storage_autoscaling is not None:
161
+ api_params['storageAutoscaling'] = self._normalize_value(storage_autoscaling)
162
+ if storage_autoscaling_threshold_percent is not None:
163
+ api_params['storageAutoscalingThresholdPercent'] = self._normalize_value(storage_autoscaling_threshold_percent)
164
+ if storage_autoscaling_max_gb is not None:
165
+ api_params['storageAutoscalingMaxGb'] = self._normalize_value(storage_autoscaling_max_gb)
166
+
167
+ response = self.client.call('post', api_path, {
168
+ 'X-Appwrite-Project': self.client.get_config('project'),
169
+ 'content-type': 'application/json',
170
+ 'accept': 'application/json',
171
+ }, api_params)
172
+
173
+ return self._parse_response(response, model=DedicatedDatabase)
174
+
175
+
176
+ def list_specifications(
177
+ self
178
+ ) -> DedicatedDatabaseSpecificationList:
179
+ """
180
+ List the dedicated database specifications available on the current plan. Each specification reports its resource limits, pricing, and whether it is enabled for the organization.
181
+
182
+ Returns
183
+ -------
184
+ DedicatedDatabaseSpecificationList
185
+ API response as a typed Pydantic model
186
+
187
+ Raises
188
+ ------
189
+ AppwriteException
190
+ If API request fails
191
+ """
192
+
193
+ api_path = '/mongo/specifications'
194
+ api_params = {}
195
+
196
+ response = self.client.call('get', api_path, {
197
+ 'X-Appwrite-Project': self.client.get_config('project'),
198
+ 'accept': 'application/json',
199
+ }, api_params)
200
+
201
+ return self._parse_response(response, model=DedicatedDatabaseSpecificationList)
202
+
203
+
204
+ def get(
205
+ self,
206
+ database_id: str
207
+ ) -> DedicatedDatabase:
208
+ """
209
+ Get a dedicated database by its unique ID. Returns the database configuration and current status.
210
+
211
+ Parameters
212
+ ----------
213
+ database_id : str
214
+ Database ID.
215
+
216
+ Returns
217
+ -------
218
+ DedicatedDatabase
219
+ API response as a typed Pydantic model
220
+
221
+ Raises
222
+ ------
223
+ AppwriteException
224
+ If API request fails
225
+ """
226
+
227
+ api_path = '/mongo/{databaseId}'
228
+ api_params = {}
229
+ if database_id is None:
230
+ raise AppwriteException('Missing required parameter: "database_id"')
231
+
232
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
233
+
234
+
235
+ response = self.client.call('get', api_path, {
236
+ 'X-Appwrite-Project': self.client.get_config('project'),
237
+ 'accept': 'application/json',
238
+ }, api_params)
239
+
240
+ return self._parse_response(response, model=DedicatedDatabase)
241
+
242
+
243
+ def update(
244
+ self,
245
+ database_id: str,
246
+ name: Optional[str] = None,
247
+ status: Optional[str] = None,
248
+ specification: Optional[str] = None,
249
+ replicas: Optional[float] = None,
250
+ sync_mode: Optional[str] = None,
251
+ cross_region_replicas: Optional[float] = None,
252
+ standby_region: Optional[str] = None,
253
+ network_idle_timeout_seconds: Optional[float] = None,
254
+ network_ip_allowlist: Optional[List[str]] = None,
255
+ idle_timeout_minutes: Optional[float] = None,
256
+ pitr: Optional[bool] = None,
257
+ pitr_retention_days: Optional[float] = None,
258
+ storage_autoscaling: Optional[bool] = None,
259
+ storage_autoscaling_threshold_percent: Optional[float] = None,
260
+ storage_autoscaling_max_gb: Optional[float] = None,
261
+ metrics_trace_sample_rate: Optional[float] = None,
262
+ metrics_slow_query_log_threshold_ms: Optional[float] = None,
263
+ sql_api_enabled: Optional[bool] = None,
264
+ sql_api_allowed_statements: Optional[List[str]] = None,
265
+ sql_api_max_rows: Optional[float] = None,
266
+ sql_api_max_bytes: Optional[float] = None,
267
+ sql_api_timeout_seconds: Optional[float] = None
268
+ ) -> DedicatedDatabase:
269
+ """
270
+ Update a dedicated database configuration. All changes are applied with zero downtime. Specification changes (cpu, memory, storage) are handled via rolling cutover. Storage expansion is done online. All other settings are applied in-place.
271
+
272
+ Parameters
273
+ ----------
274
+ database_id : str
275
+ Database ID.
276
+ name : Optional[str]
277
+ Database display name.
278
+ status : Optional[str]
279
+ Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume (also recovers a failed database whose infrastructure is healthy), or "inactive" to spin down a shared-pool database.
280
+ specification : Optional[str]
281
+ Specification. Changes cpu, memory, storage, connection ceiling, and node pool based on specification config. Resource changes are applied via rolling cutover with zero downtime.
282
+ replicas : Optional[float]
283
+ Number of high availability replicas (0-5). High availability is enabled when greater than 0.
284
+ sync_mode : Optional[str]
285
+ Replication sync mode preference. Allowed values: async, sync, quorum.
286
+ cross_region_replicas : Optional[float]
287
+ Number of cross-region standby replicas (0-1). Cross-region replication is enabled when greater than 0.
288
+ standby_region : Optional[str]
289
+ Standby region for the cross-region replica. Required when enabling cross-region replication and no standby region is already configured. Must differ from the database region.
290
+ network_idle_timeout_seconds : Optional[float]
291
+ Connection idle timeout in seconds (60-86400).
292
+ network_ip_allowlist : Optional[List[str]]
293
+ IP addresses/CIDR ranges allowed to connect.
294
+ idle_timeout_minutes : Optional[float]
295
+ Minutes before container scales to zero.
296
+ pitr : Optional[bool]
297
+ Enable or disable point-in-time recovery (PITR).
298
+ pitr_retention_days : Optional[float]
299
+ Days to retain PITR data.
300
+ storage_autoscaling : Optional[bool]
301
+ Enable automatic storage expansion when usage exceeds threshold.
302
+ storage_autoscaling_threshold_percent : Optional[float]
303
+ Storage usage percentage (50-95) that triggers automatic expansion.
304
+ storage_autoscaling_max_gb : Optional[float]
305
+ Maximum storage size in GB for autoscaling. 0 means no limit.
306
+ metrics_trace_sample_rate : Optional[float]
307
+ Fraction of queries to trace (0.0–1.0). Forwarded to the sidecar.
308
+ metrics_slow_query_log_threshold_ms : Optional[float]
309
+ Threshold in ms above which queries are logged as slow. Forwarded to the sidecar.
310
+ sql_api_enabled : Optional[bool]
311
+ Enable the SQL API sidecar for this database.
312
+ sql_api_allowed_statements : Optional[List[str]]
313
+ Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE.
314
+ sql_api_max_rows : Optional[float]
315
+ Maximum rows returned per SQL API execution (1-1000000).
316
+ sql_api_max_bytes : Optional[float]
317
+ Maximum serialised SQL API result payload in bytes (1024-104857600).
318
+ sql_api_timeout_seconds : Optional[float]
319
+ Per-call SQL API execution timeout in seconds (1-300).
320
+
321
+ Returns
322
+ -------
323
+ DedicatedDatabase
324
+ API response as a typed Pydantic model
325
+
326
+ Raises
327
+ ------
328
+ AppwriteException
329
+ If API request fails
330
+ """
331
+
332
+ api_path = '/mongo/{databaseId}'
333
+ api_params = {}
334
+ if database_id is None:
335
+ raise AppwriteException('Missing required parameter: "database_id"')
336
+
337
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
338
+
339
+ if name is not None:
340
+ api_params['name'] = self._normalize_value(name)
341
+ if status is not None:
342
+ api_params['status'] = self._normalize_value(status)
343
+ if specification is not None:
344
+ api_params['specification'] = self._normalize_value(specification)
345
+ if replicas is not None:
346
+ api_params['replicas'] = self._normalize_value(replicas)
347
+ if sync_mode is not None:
348
+ api_params['syncMode'] = self._normalize_value(sync_mode)
349
+ if cross_region_replicas is not None:
350
+ api_params['crossRegionReplicas'] = self._normalize_value(cross_region_replicas)
351
+ if standby_region is not None:
352
+ api_params['standbyRegion'] = self._normalize_value(standby_region)
353
+ if network_idle_timeout_seconds is not None:
354
+ api_params['networkIdleTimeoutSeconds'] = self._normalize_value(network_idle_timeout_seconds)
355
+ if network_ip_allowlist is not None:
356
+ api_params['networkIPAllowlist'] = self._normalize_value(network_ip_allowlist)
357
+ if idle_timeout_minutes is not None:
358
+ api_params['idleTimeoutMinutes'] = self._normalize_value(idle_timeout_minutes)
359
+ if pitr is not None:
360
+ api_params['pitr'] = self._normalize_value(pitr)
361
+ if pitr_retention_days is not None:
362
+ api_params['pitrRetentionDays'] = self._normalize_value(pitr_retention_days)
363
+ if storage_autoscaling is not None:
364
+ api_params['storageAutoscaling'] = self._normalize_value(storage_autoscaling)
365
+ if storage_autoscaling_threshold_percent is not None:
366
+ api_params['storageAutoscalingThresholdPercent'] = self._normalize_value(storage_autoscaling_threshold_percent)
367
+ if storage_autoscaling_max_gb is not None:
368
+ api_params['storageAutoscalingMaxGb'] = self._normalize_value(storage_autoscaling_max_gb)
369
+ if metrics_trace_sample_rate is not None:
370
+ api_params['metricsTraceSampleRate'] = self._normalize_value(metrics_trace_sample_rate)
371
+ if metrics_slow_query_log_threshold_ms is not None:
372
+ api_params['metricsSlowQueryLogThresholdMs'] = self._normalize_value(metrics_slow_query_log_threshold_ms)
373
+ if sql_api_enabled is not None:
374
+ api_params['sqlApiEnabled'] = self._normalize_value(sql_api_enabled)
375
+ if sql_api_allowed_statements is not None:
376
+ api_params['sqlApiAllowedStatements'] = self._normalize_value(sql_api_allowed_statements)
377
+ if sql_api_max_rows is not None:
378
+ api_params['sqlApiMaxRows'] = self._normalize_value(sql_api_max_rows)
379
+ if sql_api_max_bytes is not None:
380
+ api_params['sqlApiMaxBytes'] = self._normalize_value(sql_api_max_bytes)
381
+ if sql_api_timeout_seconds is not None:
382
+ api_params['sqlApiTimeoutSeconds'] = self._normalize_value(sql_api_timeout_seconds)
383
+
384
+ response = self.client.call('patch', api_path, {
385
+ 'X-Appwrite-Project': self.client.get_config('project'),
386
+ 'content-type': 'application/json',
387
+ 'accept': 'application/json',
388
+ }, api_params)
389
+
390
+ return self._parse_response(response, model=DedicatedDatabase)
391
+
392
+
393
+ def delete(
394
+ self,
395
+ database_id: str
396
+ ) -> Dict[str, Any]:
397
+ """
398
+ Delete a dedicated database. This action is irreversible. The database status will be set to 'deleting' and all resources will be cleaned up. Deletion is allowed from any state, and repeating the call re-dispatches the cleanup.
399
+
400
+ Parameters
401
+ ----------
402
+ database_id : str
403
+ Database ID.
404
+
405
+ Returns
406
+ -------
407
+ Dict[str, Any]
408
+ API response as a dictionary
409
+
410
+ Raises
411
+ ------
412
+ AppwriteException
413
+ If API request fails
414
+ """
415
+
416
+ api_path = '/mongo/{databaseId}'
417
+ api_params = {}
418
+ if database_id is None:
419
+ raise AppwriteException('Missing required parameter: "database_id"')
420
+
421
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
422
+
423
+
424
+ response = self.client.call('delete', api_path, {
425
+ 'X-Appwrite-Project': self.client.get_config('project'),
426
+ 'content-type': 'application/json',
427
+ 'accept': 'application/json',
428
+ }, api_params)
429
+
430
+ return response
431
+
432
+
433
+ def list_backups(
434
+ self,
435
+ database_id: str,
436
+ queries: Optional[List[str]] = None
437
+ ) -> DedicatedDatabaseBackupList:
438
+ """
439
+ List all backups for a dedicated database. Results can be filtered by status and type.
440
+
441
+ Parameters
442
+ ----------
443
+ database_id : str
444
+ Database ID.
445
+ queries : Optional[List[str]]
446
+ 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
447
+
448
+ Returns
449
+ -------
450
+ DedicatedDatabaseBackupList
451
+ API response as a typed Pydantic model
452
+
453
+ Raises
454
+ ------
455
+ AppwriteException
456
+ If API request fails
457
+ """
458
+
459
+ api_path = '/mongo/{databaseId}/backups'
460
+ api_params = {}
461
+ if database_id is None:
462
+ raise AppwriteException('Missing required parameter: "database_id"')
463
+
464
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
465
+
466
+ if queries is not None:
467
+ api_params['queries'] = self._normalize_value(queries)
468
+
469
+ response = self.client.call('get', api_path, {
470
+ 'X-Appwrite-Project': self.client.get_config('project'),
471
+ 'accept': 'application/json',
472
+ }, api_params)
473
+
474
+ return self._parse_response(response, model=DedicatedDatabaseBackupList)
475
+
476
+
477
+ def create_backup(
478
+ self,
479
+ database_id: str,
480
+ type: Optional[str] = None
481
+ ) -> DedicatedDatabaseBackup:
482
+ """
483
+ Create a manual backup of a dedicated database. The backup will be created asynchronously and its status can be checked via the get backup endpoint.
484
+
485
+ Parameters
486
+ ----------
487
+ database_id : str
488
+ Database ID.
489
+ type : Optional[str]
490
+ Backup type: full or incremental.
491
+
492
+ Returns
493
+ -------
494
+ DedicatedDatabaseBackup
495
+ API response as a typed Pydantic model
496
+
497
+ Raises
498
+ ------
499
+ AppwriteException
500
+ If API request fails
501
+ """
502
+
503
+ api_path = '/mongo/{databaseId}/backups'
504
+ api_params = {}
505
+ if database_id is None:
506
+ raise AppwriteException('Missing required parameter: "database_id"')
507
+
508
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
509
+
510
+ if type is not None:
511
+ api_params['type'] = self._normalize_value(type)
512
+
513
+ response = self.client.call('post', api_path, {
514
+ 'X-Appwrite-Project': self.client.get_config('project'),
515
+ 'content-type': 'application/json',
516
+ 'accept': 'application/json',
517
+ }, api_params)
518
+
519
+ return self._parse_response(response, model=DedicatedDatabaseBackup)
520
+
521
+
522
+ def list_backup_policies(
523
+ self,
524
+ database_id: str,
525
+ queries: Optional[List[str]] = None
526
+ ) -> BackupPolicyList:
527
+ """
528
+ List scheduled backup policies for a dedicated database.
529
+
530
+ Parameters
531
+ ----------
532
+ database_id : str
533
+ Database ID.
534
+ queries : Optional[List[str]]
535
+ Array of query strings generated using the Query class provided by the SDK.
536
+
537
+ Returns
538
+ -------
539
+ BackupPolicyList
540
+ API response as a typed Pydantic model
541
+
542
+ Raises
543
+ ------
544
+ AppwriteException
545
+ If API request fails
546
+ """
547
+
548
+ api_path = '/mongo/{databaseId}/backups/policies'
549
+ api_params = {}
550
+ if database_id is None:
551
+ raise AppwriteException('Missing required parameter: "database_id"')
552
+
553
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
554
+
555
+ if queries is not None:
556
+ api_params['queries'] = self._normalize_value(queries)
557
+
558
+ response = self.client.call('get', api_path, {
559
+ 'X-Appwrite-Project': self.client.get_config('project'),
560
+ 'accept': 'application/json',
561
+ }, api_params)
562
+
563
+ return self._parse_response(response, model=BackupPolicyList)
564
+
565
+
566
+ def create_backup_policy(
567
+ self,
568
+ database_id: str,
569
+ policy_id: str,
570
+ name: str,
571
+ schedule: str,
572
+ retention: float,
573
+ type: Optional[str] = None,
574
+ enabled: Optional[bool] = None
575
+ ) -> BackupPolicy:
576
+ """
577
+ Create a scheduled backup policy for a dedicated database.
578
+
579
+ Parameters
580
+ ----------
581
+ database_id : str
582
+ Database ID.
583
+ policy_id : str
584
+ 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't start with a special char. Max length is 36 chars.
585
+ name : str
586
+ Policy name. Max length: 128 chars.
587
+ schedule : str
588
+ Schedule CRON syntax.
589
+ retention : float
590
+ Days to keep backups before deletion.
591
+ type : Optional[str]
592
+ Backup type: full or incremental.
593
+ enabled : Optional[bool]
594
+ Is policy enabled? When disabled, no backups will be taken.
595
+
596
+ Returns
597
+ -------
598
+ BackupPolicy
599
+ API response as a typed Pydantic model
600
+
601
+ Raises
602
+ ------
603
+ AppwriteException
604
+ If API request fails
605
+ """
606
+
607
+ api_path = '/mongo/{databaseId}/backups/policies'
608
+ api_params = {}
609
+ if database_id is None:
610
+ raise AppwriteException('Missing required parameter: "database_id"')
611
+
612
+ if policy_id is None:
613
+ raise AppwriteException('Missing required parameter: "policy_id"')
614
+
615
+ if name is None:
616
+ raise AppwriteException('Missing required parameter: "name"')
617
+
618
+ if schedule is None:
619
+ raise AppwriteException('Missing required parameter: "schedule"')
620
+
621
+ if retention is None:
622
+ raise AppwriteException('Missing required parameter: "retention"')
623
+
624
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
625
+
626
+ api_params['policyId'] = self._normalize_value(policy_id)
627
+ api_params['name'] = self._normalize_value(name)
628
+ api_params['schedule'] = self._normalize_value(schedule)
629
+ api_params['retention'] = self._normalize_value(retention)
630
+ if type is not None:
631
+ api_params['type'] = self._normalize_value(type)
632
+ if enabled is not None:
633
+ api_params['enabled'] = self._normalize_value(enabled)
634
+
635
+ response = self.client.call('post', api_path, {
636
+ 'X-Appwrite-Project': self.client.get_config('project'),
637
+ 'content-type': 'application/json',
638
+ 'accept': 'application/json',
639
+ }, api_params)
640
+
641
+ return self._parse_response(response, model=BackupPolicy)
642
+
643
+
644
+ def get_backup_policy(
645
+ self,
646
+ database_id: str,
647
+ policy_id: str
648
+ ) -> BackupPolicy:
649
+ """
650
+ Get a scheduled backup policy for a dedicated database.
651
+
652
+ Parameters
653
+ ----------
654
+ database_id : str
655
+ Database ID.
656
+ policy_id : str
657
+ Policy ID.
658
+
659
+ Returns
660
+ -------
661
+ BackupPolicy
662
+ API response as a typed Pydantic model
663
+
664
+ Raises
665
+ ------
666
+ AppwriteException
667
+ If API request fails
668
+ """
669
+
670
+ api_path = '/mongo/{databaseId}/backups/policies/{policyId}'
671
+ api_params = {}
672
+ if database_id is None:
673
+ raise AppwriteException('Missing required parameter: "database_id"')
674
+
675
+ if policy_id is None:
676
+ raise AppwriteException('Missing required parameter: "policy_id"')
677
+
678
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
679
+ api_path = api_path.replace('{policyId}', str(self._normalize_value(policy_id)))
680
+
681
+
682
+ response = self.client.call('get', api_path, {
683
+ 'X-Appwrite-Project': self.client.get_config('project'),
684
+ 'accept': 'application/json',
685
+ }, api_params)
686
+
687
+ return self._parse_response(response, model=BackupPolicy)
688
+
689
+
690
+ def update_backup_policy(
691
+ self,
692
+ database_id: str,
693
+ policy_id: str,
694
+ name: Optional[str] = None,
695
+ schedule: Optional[str] = None,
696
+ retention: Optional[float] = None,
697
+ enabled: Optional[bool] = None
698
+ ) -> BackupPolicy:
699
+ """
700
+ Update a scheduled backup policy for a dedicated database.
701
+
702
+ Parameters
703
+ ----------
704
+ database_id : str
705
+ Database ID.
706
+ policy_id : str
707
+ Policy ID.
708
+ name : Optional[str]
709
+ Policy name. Max length: 128 chars.
710
+ schedule : Optional[str]
711
+ Schedule CRON syntax.
712
+ retention : Optional[float]
713
+ Days to keep backups before deletion.
714
+ enabled : Optional[bool]
715
+ Is policy enabled? When disabled, no backups will be taken.
716
+
717
+ Returns
718
+ -------
719
+ BackupPolicy
720
+ API response as a typed Pydantic model
721
+
722
+ Raises
723
+ ------
724
+ AppwriteException
725
+ If API request fails
726
+ """
727
+
728
+ api_path = '/mongo/{databaseId}/backups/policies/{policyId}'
729
+ api_params = {}
730
+ if database_id is None:
731
+ raise AppwriteException('Missing required parameter: "database_id"')
732
+
733
+ if policy_id is None:
734
+ raise AppwriteException('Missing required parameter: "policy_id"')
735
+
736
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
737
+ api_path = api_path.replace('{policyId}', str(self._normalize_value(policy_id)))
738
+
739
+ if name is not None:
740
+ api_params['name'] = self._normalize_value(name)
741
+ if schedule is not None:
742
+ api_params['schedule'] = self._normalize_value(schedule)
743
+ if retention is not None:
744
+ api_params['retention'] = self._normalize_value(retention)
745
+ if enabled is not None:
746
+ api_params['enabled'] = self._normalize_value(enabled)
747
+
748
+ response = self.client.call('patch', api_path, {
749
+ 'X-Appwrite-Project': self.client.get_config('project'),
750
+ 'content-type': 'application/json',
751
+ 'accept': 'application/json',
752
+ }, api_params)
753
+
754
+ return self._parse_response(response, model=BackupPolicy)
755
+
756
+
757
+ def delete_backup_policy(
758
+ self,
759
+ database_id: str,
760
+ policy_id: str
761
+ ) -> Dict[str, Any]:
762
+ """
763
+ Delete a scheduled backup policy for a dedicated database. Backups already taken by the policy are kept until their retention expires.
764
+
765
+ Parameters
766
+ ----------
767
+ database_id : str
768
+ Database ID.
769
+ policy_id : str
770
+ Policy ID.
771
+
772
+ Returns
773
+ -------
774
+ Dict[str, Any]
775
+ API response as a dictionary
776
+
777
+ Raises
778
+ ------
779
+ AppwriteException
780
+ If API request fails
781
+ """
782
+
783
+ api_path = '/mongo/{databaseId}/backups/policies/{policyId}'
784
+ api_params = {}
785
+ if database_id is None:
786
+ raise AppwriteException('Missing required parameter: "database_id"')
787
+
788
+ if policy_id is None:
789
+ raise AppwriteException('Missing required parameter: "policy_id"')
790
+
791
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
792
+ api_path = api_path.replace('{policyId}', str(self._normalize_value(policy_id)))
793
+
794
+
795
+ response = self.client.call('delete', api_path, {
796
+ 'X-Appwrite-Project': self.client.get_config('project'),
797
+ 'content-type': 'application/json',
798
+ 'accept': 'application/json',
799
+ }, api_params)
800
+
801
+ return response
802
+
803
+
804
+ def update_backup_storage(
805
+ self,
806
+ database_id: str,
807
+ provider: str,
808
+ bucket: str,
809
+ access_key: str,
810
+ secret_key: str,
811
+ region: Optional[str] = None,
812
+ prefix: Optional[str] = None,
813
+ endpoint: Optional[str] = None
814
+ ) -> DedicatedDatabaseBackupStorage:
815
+ """
816
+ Configure off-cluster backup storage for a dedicated database. Supports S3, GCS, and Azure Blob Storage destinations. Backups will be stored to the configured destination in addition to on-cluster storage.
817
+
818
+ Parameters
819
+ ----------
820
+ database_id : str
821
+ Database ID.
822
+ provider : str
823
+ Storage provider for off-cluster backups. Allowed values: s3 (Amazon S3 or S3-compatible), gcs (Google Cloud Storage), azure (Azure Blob Storage).
824
+ bucket : str
825
+ Storage bucket or container name.
826
+ access_key : str
827
+ Access key or client ID for authentication.
828
+ secret_key : str
829
+ Secret key or service account JSON for authentication.
830
+ region : Optional[str]
831
+ Storage region.
832
+ prefix : Optional[str]
833
+ Object key prefix for backups.
834
+ endpoint : Optional[str]
835
+ Custom endpoint for S3-compatible storage (e.g. MinIO).
836
+
837
+ Returns
838
+ -------
839
+ DedicatedDatabaseBackupStorage
840
+ API response as a typed Pydantic model
841
+
842
+ Raises
843
+ ------
844
+ AppwriteException
845
+ If API request fails
846
+ """
847
+
848
+ api_path = '/mongo/{databaseId}/backups/storage'
849
+ api_params = {}
850
+ if database_id is None:
851
+ raise AppwriteException('Missing required parameter: "database_id"')
852
+
853
+ if provider is None:
854
+ raise AppwriteException('Missing required parameter: "provider"')
855
+
856
+ if bucket is None:
857
+ raise AppwriteException('Missing required parameter: "bucket"')
858
+
859
+ if access_key is None:
860
+ raise AppwriteException('Missing required parameter: "access_key"')
861
+
862
+ if secret_key is None:
863
+ raise AppwriteException('Missing required parameter: "secret_key"')
864
+
865
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
866
+
867
+ api_params['provider'] = self._normalize_value(provider)
868
+ api_params['bucket'] = self._normalize_value(bucket)
869
+ if region is not None:
870
+ api_params['region'] = self._normalize_value(region)
871
+ if prefix is not None:
872
+ api_params['prefix'] = self._normalize_value(prefix)
873
+ if endpoint is not None:
874
+ api_params['endpoint'] = self._normalize_value(endpoint)
875
+ api_params['accessKey'] = self._normalize_value(access_key)
876
+ api_params['secretKey'] = self._normalize_value(secret_key)
877
+
878
+ response = self.client.call('put', api_path, {
879
+ 'X-Appwrite-Project': self.client.get_config('project'),
880
+ 'content-type': 'application/json',
881
+ 'accept': 'application/json',
882
+ }, api_params)
883
+
884
+ return self._parse_response(response, model=DedicatedDatabaseBackupStorage)
885
+
886
+
887
+ def get_backup(
888
+ self,
889
+ database_id: str,
890
+ backup_id: str
891
+ ) -> DedicatedDatabaseBackup:
892
+ """
893
+ Get details of a specific database backup including its status, size, and timestamps.
894
+
895
+ Parameters
896
+ ----------
897
+ database_id : str
898
+ Database ID.
899
+ backup_id : str
900
+ Backup ID.
901
+
902
+ Returns
903
+ -------
904
+ DedicatedDatabaseBackup
905
+ API response as a typed Pydantic model
906
+
907
+ Raises
908
+ ------
909
+ AppwriteException
910
+ If API request fails
911
+ """
912
+
913
+ api_path = '/mongo/{databaseId}/backups/{backupId}'
914
+ api_params = {}
915
+ if database_id is None:
916
+ raise AppwriteException('Missing required parameter: "database_id"')
917
+
918
+ if backup_id is None:
919
+ raise AppwriteException('Missing required parameter: "backup_id"')
920
+
921
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
922
+ api_path = api_path.replace('{backupId}', str(self._normalize_value(backup_id)))
923
+
924
+
925
+ response = self.client.call('get', api_path, {
926
+ 'X-Appwrite-Project': self.client.get_config('project'),
927
+ 'accept': 'application/json',
928
+ }, api_params)
929
+
930
+ return self._parse_response(response, model=DedicatedDatabaseBackup)
931
+
932
+
933
+ def delete_backup(
934
+ self,
935
+ database_id: str,
936
+ backup_id: str
937
+ ) -> Dict[str, Any]:
938
+ """
939
+ Delete a database backup. This will permanently remove the backup from storage and cannot be undone.
940
+
941
+ Parameters
942
+ ----------
943
+ database_id : str
944
+ Database ID.
945
+ backup_id : str
946
+ Backup ID.
947
+
948
+ Returns
949
+ -------
950
+ Dict[str, Any]
951
+ API response as a dictionary
952
+
953
+ Raises
954
+ ------
955
+ AppwriteException
956
+ If API request fails
957
+ """
958
+
959
+ api_path = '/mongo/{databaseId}/backups/{backupId}'
960
+ api_params = {}
961
+ if database_id is None:
962
+ raise AppwriteException('Missing required parameter: "database_id"')
963
+
964
+ if backup_id is None:
965
+ raise AppwriteException('Missing required parameter: "backup_id"')
966
+
967
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
968
+ api_path = api_path.replace('{backupId}', str(self._normalize_value(backup_id)))
969
+
970
+
971
+ response = self.client.call('delete', api_path, {
972
+ 'X-Appwrite-Project': self.client.get_config('project'),
973
+ 'content-type': 'application/json',
974
+ 'accept': 'application/json',
975
+ }, api_params)
976
+
977
+ return response
978
+
979
+
980
+ def list_branches(
981
+ self,
982
+ database_id: str
983
+ ) -> DedicatedDatabaseBranchList:
984
+ """
985
+ List all ephemeral branches for a dedicated database. Returns branch metadata including ID, name, namespace, and expiration time.
986
+
987
+ Parameters
988
+ ----------
989
+ database_id : str
990
+ Database ID.
991
+
992
+ Returns
993
+ -------
994
+ DedicatedDatabaseBranchList
995
+ API response as a typed Pydantic model
996
+
997
+ Raises
998
+ ------
999
+ AppwriteException
1000
+ If API request fails
1001
+ """
1002
+
1003
+ api_path = '/mongo/{databaseId}/branches'
1004
+ api_params = {}
1005
+ if database_id is None:
1006
+ raise AppwriteException('Missing required parameter: "database_id"')
1007
+
1008
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1009
+
1010
+
1011
+ response = self.client.call('get', api_path, {
1012
+ 'X-Appwrite-Project': self.client.get_config('project'),
1013
+ 'accept': 'application/json',
1014
+ }, api_params)
1015
+
1016
+ return self._parse_response(response, model=DedicatedDatabaseBranchList)
1017
+
1018
+
1019
+ def create_branch(
1020
+ self,
1021
+ database_id: str,
1022
+ branch_id: Optional[str] = None,
1023
+ ttl: Optional[float] = None
1024
+ ) -> DedicatedDatabase:
1025
+ """
1026
+ Create an ephemeral database branch from the primary via PVC snapshot. The branch is a full copy of the database at the current point in time, useful for testing schema migrations or running experiments without affecting production data. Branches expire after the configured TTL (default 24 hours). The branch is created asynchronously.
1027
+
1028
+ Parameters
1029
+ ----------
1030
+ database_id : str
1031
+ Database ID.
1032
+ branch_id : Optional[str]
1033
+ 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't start with a special char. Max length is 36 chars.
1034
+ ttl : Optional[float]
1035
+ Time-to-live in seconds before the branch expires. Min 300 (5 min), max 604800 (7 days). Default: 86400 (24h).
1036
+
1037
+ Returns
1038
+ -------
1039
+ DedicatedDatabase
1040
+ API response as a typed Pydantic model
1041
+
1042
+ Raises
1043
+ ------
1044
+ AppwriteException
1045
+ If API request fails
1046
+ """
1047
+
1048
+ api_path = '/mongo/{databaseId}/branches'
1049
+ api_params = {}
1050
+ if database_id is None:
1051
+ raise AppwriteException('Missing required parameter: "database_id"')
1052
+
1053
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1054
+
1055
+ if branch_id is not None:
1056
+ api_params['branchId'] = self._normalize_value(branch_id)
1057
+ if ttl is not None:
1058
+ api_params['ttl'] = self._normalize_value(ttl)
1059
+
1060
+ response = self.client.call('post', api_path, {
1061
+ 'X-Appwrite-Project': self.client.get_config('project'),
1062
+ 'content-type': 'application/json',
1063
+ 'accept': 'application/json',
1064
+ }, api_params)
1065
+
1066
+ return self._parse_response(response, model=DedicatedDatabase)
1067
+
1068
+
1069
+ def delete_branch(
1070
+ self,
1071
+ database_id: str,
1072
+ branch_id: str
1073
+ ) -> DedicatedDatabase:
1074
+ """
1075
+ Delete an ephemeral database branch. This removes the branch namespace, its PVC, and the associated VolumeSnapshot. The deletion runs asynchronously and is irreversible.
1076
+
1077
+ Parameters
1078
+ ----------
1079
+ database_id : str
1080
+ Database ID.
1081
+ branch_id : str
1082
+ Branch ID.
1083
+
1084
+ Returns
1085
+ -------
1086
+ DedicatedDatabase
1087
+ API response as a typed Pydantic model
1088
+
1089
+ Raises
1090
+ ------
1091
+ AppwriteException
1092
+ If API request fails
1093
+ """
1094
+
1095
+ api_path = '/mongo/{databaseId}/branches/{branchId}'
1096
+ api_params = {}
1097
+ if database_id is None:
1098
+ raise AppwriteException('Missing required parameter: "database_id"')
1099
+
1100
+ if branch_id is None:
1101
+ raise AppwriteException('Missing required parameter: "branch_id"')
1102
+
1103
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1104
+ api_path = api_path.replace('{branchId}', str(self._normalize_value(branch_id)))
1105
+
1106
+
1107
+ response = self.client.call('delete', api_path, {
1108
+ 'X-Appwrite-Project': self.client.get_config('project'),
1109
+ 'content-type': 'application/json',
1110
+ 'accept': 'application/json',
1111
+ }, api_params)
1112
+
1113
+ return self._parse_response(response, model=DedicatedDatabase)
1114
+
1115
+
1116
+ def update_credentials(
1117
+ self,
1118
+ database_id: str
1119
+ ) -> DedicatedDatabase:
1120
+ """
1121
+ Rotate the primary connection credentials for a dedicated database. Generates a new password and updates the database atomically. Previous credentials stop working immediately. Returns the database with a refreshed connection string carrying the new password.
1122
+
1123
+ Parameters
1124
+ ----------
1125
+ database_id : str
1126
+ Database ID.
1127
+
1128
+ Returns
1129
+ -------
1130
+ DedicatedDatabase
1131
+ API response as a typed Pydantic model
1132
+
1133
+ Raises
1134
+ ------
1135
+ AppwriteException
1136
+ If API request fails
1137
+ """
1138
+
1139
+ api_path = '/mongo/{databaseId}/credentials'
1140
+ api_params = {}
1141
+ if database_id is None:
1142
+ raise AppwriteException('Missing required parameter: "database_id"')
1143
+
1144
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1145
+
1146
+
1147
+ response = self.client.call('patch', api_path, {
1148
+ 'X-Appwrite-Project': self.client.get_config('project'),
1149
+ 'content-type': 'application/json',
1150
+ 'accept': 'application/json',
1151
+ }, api_params)
1152
+
1153
+ return self._parse_response(response, model=DedicatedDatabase)
1154
+
1155
+
1156
+ def create_failover(
1157
+ self,
1158
+ database_id: str,
1159
+ target_replica_id: Optional[str] = None
1160
+ ) -> DedicatedDatabase:
1161
+ """
1162
+ Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation by a failover that did not finish also accepts this call as a repair, provided `targetReplicaId` names the member to promote.
1163
+
1164
+ Parameters
1165
+ ----------
1166
+ database_id : str
1167
+ Database ID.
1168
+ target_replica_id : Optional[str]
1169
+ Target replica ID to promote. If not specified, the healthiest replica is selected.
1170
+
1171
+ Returns
1172
+ -------
1173
+ DedicatedDatabase
1174
+ API response as a typed Pydantic model
1175
+
1176
+ Raises
1177
+ ------
1178
+ AppwriteException
1179
+ If API request fails
1180
+ """
1181
+
1182
+ api_path = '/mongo/{databaseId}/failovers'
1183
+ api_params = {}
1184
+ if database_id is None:
1185
+ raise AppwriteException('Missing required parameter: "database_id"')
1186
+
1187
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1188
+
1189
+ if target_replica_id is not None:
1190
+ api_params['targetReplicaId'] = self._normalize_value(target_replica_id)
1191
+
1192
+ response = self.client.call('post', api_path, {
1193
+ 'X-Appwrite-Project': self.client.get_config('project'),
1194
+ 'content-type': 'application/json',
1195
+ 'accept': 'application/json',
1196
+ }, api_params)
1197
+
1198
+ return self._parse_response(response, model=DedicatedDatabase)
1199
+
1200
+
1201
+ def update_maintenance(
1202
+ self,
1203
+ database_id: str,
1204
+ day: str,
1205
+ hour_utc: float
1206
+ ) -> DedicatedDatabase:
1207
+ """
1208
+ Update the maintenance window for a dedicated database. Maintenance operations like minor version upgrades will be performed during this window.
1209
+
1210
+ Parameters
1211
+ ----------
1212
+ database_id : str
1213
+ Database ID.
1214
+ day : str
1215
+ Day of the week for the maintenance window. Allowed values: sun, mon, tue, wed, thu, fri, sat.
1216
+ hour_utc : float
1217
+ Hour in UTC (0-23) for maintenance window start.
1218
+
1219
+ Returns
1220
+ -------
1221
+ DedicatedDatabase
1222
+ API response as a typed Pydantic model
1223
+
1224
+ Raises
1225
+ ------
1226
+ AppwriteException
1227
+ If API request fails
1228
+ """
1229
+
1230
+ api_path = '/mongo/{databaseId}/maintenance'
1231
+ api_params = {}
1232
+ if database_id is None:
1233
+ raise AppwriteException('Missing required parameter: "database_id"')
1234
+
1235
+ if day is None:
1236
+ raise AppwriteException('Missing required parameter: "day"')
1237
+
1238
+ if hour_utc is None:
1239
+ raise AppwriteException('Missing required parameter: "hour_utc"')
1240
+
1241
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1242
+
1243
+ api_params['day'] = self._normalize_value(day)
1244
+ api_params['hourUtc'] = self._normalize_value(hour_utc)
1245
+
1246
+ response = self.client.call('patch', api_path, {
1247
+ 'X-Appwrite-Project': self.client.get_config('project'),
1248
+ 'content-type': 'application/json',
1249
+ 'accept': 'application/json',
1250
+ }, api_params)
1251
+
1252
+ return self._parse_response(response, model=DedicatedDatabase)
1253
+
1254
+
1255
+ def create_migration(
1256
+ self,
1257
+ database_id: str,
1258
+ target_type: str,
1259
+ specification: Optional[str] = None
1260
+ ) -> DedicatedDatabase:
1261
+ """
1262
+ Migrate a database between shared and dedicated types. Shared to dedicated provisions an always-on dedicated instance; dedicated to shared converts to a serverless instance that scales to zero when idle. Data is copied to the target with a brief read-only window during cutover.
1263
+
1264
+ Parameters
1265
+ ----------
1266
+ database_id : str
1267
+ Database ID.
1268
+ target_type : str
1269
+ Target database type to migrate to. Allowed values: shared (serverless, scales to zero when idle), dedicated (always-on with persistent resources).
1270
+ specification : Optional[str]
1271
+ Target specification to provision when migrating to dedicated. Ignored for shared. Defaults to the database's current specification.
1272
+
1273
+ Returns
1274
+ -------
1275
+ DedicatedDatabase
1276
+ API response as a typed Pydantic model
1277
+
1278
+ Raises
1279
+ ------
1280
+ AppwriteException
1281
+ If API request fails
1282
+ """
1283
+
1284
+ api_path = '/mongo/{databaseId}/migrations'
1285
+ api_params = {}
1286
+ if database_id is None:
1287
+ raise AppwriteException('Missing required parameter: "database_id"')
1288
+
1289
+ if target_type is None:
1290
+ raise AppwriteException('Missing required parameter: "target_type"')
1291
+
1292
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1293
+
1294
+ api_params['targetType'] = self._normalize_value(target_type)
1295
+ if specification is not None:
1296
+ api_params['specification'] = self._normalize_value(specification)
1297
+
1298
+ response = self.client.call('post', api_path, {
1299
+ 'X-Appwrite-Project': self.client.get_config('project'),
1300
+ 'content-type': 'application/json',
1301
+ 'accept': 'application/json',
1302
+ }, api_params)
1303
+
1304
+ return self._parse_response(response, model=DedicatedDatabase)
1305
+
1306
+
1307
+ def list_operations(
1308
+ self,
1309
+ database_id: str,
1310
+ status: Optional[str] = None,
1311
+ limit: Optional[float] = None,
1312
+ offset: Optional[float] = None
1313
+ ) -> DedicatedDatabaseOperationList:
1314
+ """
1315
+ List the lifecycle operations recorded for a dedicated database, newest first. Every provision, update, restore, backup and replication action is recorded here with its outcome, including an attempt that was abandoned because another worker took over the database.
1316
+
1317
+ Parameters
1318
+ ----------
1319
+ database_id : str
1320
+ Database ID.
1321
+ status : Optional[str]
1322
+ Filter by operation status.
1323
+ limit : Optional[float]
1324
+ Maximum number of operations to return.
1325
+ offset : Optional[float]
1326
+ Number of operations to skip.
1327
+
1328
+ Returns
1329
+ -------
1330
+ DedicatedDatabaseOperationList
1331
+ API response as a typed Pydantic model
1332
+
1333
+ Raises
1334
+ ------
1335
+ AppwriteException
1336
+ If API request fails
1337
+ """
1338
+
1339
+ api_path = '/mongo/{databaseId}/operations'
1340
+ api_params = {}
1341
+ if database_id is None:
1342
+ raise AppwriteException('Missing required parameter: "database_id"')
1343
+
1344
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1345
+
1346
+ if status is not None:
1347
+ api_params['status'] = self._normalize_value(status)
1348
+ if limit is not None:
1349
+ api_params['limit'] = self._normalize_value(limit)
1350
+ if offset is not None:
1351
+ api_params['offset'] = self._normalize_value(offset)
1352
+
1353
+ response = self.client.call('get', api_path, {
1354
+ 'X-Appwrite-Project': self.client.get_config('project'),
1355
+ 'accept': 'application/json',
1356
+ }, api_params)
1357
+
1358
+ return self._parse_response(response, model=DedicatedDatabaseOperationList)
1359
+
1360
+
1361
+ def get_pitr(
1362
+ self,
1363
+ database_id: str
1364
+ ) -> DedicatedDatabasePITRWindows:
1365
+ """
1366
+ Get available point-in-time recovery windows for a dedicated database. Returns the earliest and latest recovery points.
1367
+
1368
+ Parameters
1369
+ ----------
1370
+ database_id : str
1371
+ Database ID.
1372
+
1373
+ Returns
1374
+ -------
1375
+ DedicatedDatabasePITRWindows
1376
+ API response as a typed Pydantic model
1377
+
1378
+ Raises
1379
+ ------
1380
+ AppwriteException
1381
+ If API request fails
1382
+ """
1383
+
1384
+ api_path = '/mongo/{databaseId}/pitr'
1385
+ api_params = {}
1386
+ if database_id is None:
1387
+ raise AppwriteException('Missing required parameter: "database_id"')
1388
+
1389
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1390
+
1391
+
1392
+ response = self.client.call('get', api_path, {
1393
+ 'X-Appwrite-Project': self.client.get_config('project'),
1394
+ 'accept': 'application/json',
1395
+ }, api_params)
1396
+
1397
+ return self._parse_response(response, model=DedicatedDatabasePITRWindows)
1398
+
1399
+
1400
+ def get_replicas(
1401
+ self,
1402
+ database_id: str
1403
+ ) -> DedicatedDatabaseReplicas:
1404
+ """
1405
+ Get high availability status for a dedicated database. Returns replica statuses, replication lag, and sync mode.
1406
+
1407
+ Parameters
1408
+ ----------
1409
+ database_id : str
1410
+ Database ID.
1411
+
1412
+ Returns
1413
+ -------
1414
+ DedicatedDatabaseReplicas
1415
+ API response as a typed Pydantic model
1416
+
1417
+ Raises
1418
+ ------
1419
+ AppwriteException
1420
+ If API request fails
1421
+ """
1422
+
1423
+ api_path = '/mongo/{databaseId}/replicas'
1424
+ api_params = {}
1425
+ if database_id is None:
1426
+ raise AppwriteException('Missing required parameter: "database_id"')
1427
+
1428
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1429
+
1430
+
1431
+ response = self.client.call('get', api_path, {
1432
+ 'X-Appwrite-Project': self.client.get_config('project'),
1433
+ 'accept': 'application/json',
1434
+ }, api_params)
1435
+
1436
+ return self._parse_response(response, model=DedicatedDatabaseReplicas)
1437
+
1438
+
1439
+ def list_restorations(
1440
+ self,
1441
+ database_id: str,
1442
+ status: Optional[str] = None,
1443
+ type: Optional[str] = None,
1444
+ limit: Optional[float] = None,
1445
+ offset: Optional[float] = None
1446
+ ) -> DedicatedDatabaseRestorationList:
1447
+ """
1448
+ List all restorations for a dedicated database. Results can be filtered by status and type.
1449
+
1450
+ Parameters
1451
+ ----------
1452
+ database_id : str
1453
+ Database ID.
1454
+ status : Optional[str]
1455
+ Filter by restoration status.
1456
+ type : Optional[str]
1457
+ Filter by restoration type.
1458
+ limit : Optional[float]
1459
+ Maximum number of restorations to return.
1460
+ offset : Optional[float]
1461
+ Number of restorations to skip.
1462
+
1463
+ Returns
1464
+ -------
1465
+ DedicatedDatabaseRestorationList
1466
+ API response as a typed Pydantic model
1467
+
1468
+ Raises
1469
+ ------
1470
+ AppwriteException
1471
+ If API request fails
1472
+ """
1473
+
1474
+ api_path = '/mongo/{databaseId}/restorations'
1475
+ api_params = {}
1476
+ if database_id is None:
1477
+ raise AppwriteException('Missing required parameter: "database_id"')
1478
+
1479
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1480
+
1481
+ if status is not None:
1482
+ api_params['status'] = self._normalize_value(status)
1483
+ if type is not None:
1484
+ api_params['type'] = self._normalize_value(type)
1485
+ if limit is not None:
1486
+ api_params['limit'] = self._normalize_value(limit)
1487
+ if offset is not None:
1488
+ api_params['offset'] = self._normalize_value(offset)
1489
+
1490
+ response = self.client.call('get', api_path, {
1491
+ 'X-Appwrite-Project': self.client.get_config('project'),
1492
+ 'accept': 'application/json',
1493
+ }, api_params)
1494
+
1495
+ return self._parse_response(response, model=DedicatedDatabaseRestorationList)
1496
+
1497
+
1498
+ def create_restoration(
1499
+ self,
1500
+ database_id: str,
1501
+ type: Optional[str] = None,
1502
+ backup_id: Optional[str] = None,
1503
+ target_time: Optional[str] = None
1504
+ ) -> DedicatedDatabaseRestoration:
1505
+ """
1506
+ Restore a database from a backup or to a specific point in time (PITR). For backup restoration, provide a backupId. For PITR, provide a targetTime as an ISO 8601 datetime. PITR requires the database to have PITR enabled and is only available for enterprise databases.
1507
+
1508
+ Parameters
1509
+ ----------
1510
+ database_id : str
1511
+ Database ID.
1512
+ type : Optional[str]
1513
+ Restoration type. Allowed values: backup, pitr. Use "backup" to restore from a specific backup, or "pitr" for point-in-time recovery.
1514
+ backup_id : Optional[str]
1515
+ Backup ID to restore from (required for backup type).
1516
+ target_time : Optional[str]
1517
+ Target time for PITR (required for pitr type) as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) datetime.
1518
+
1519
+ Returns
1520
+ -------
1521
+ DedicatedDatabaseRestoration
1522
+ API response as a typed Pydantic model
1523
+
1524
+ Raises
1525
+ ------
1526
+ AppwriteException
1527
+ If API request fails
1528
+ """
1529
+
1530
+ api_path = '/mongo/{databaseId}/restorations'
1531
+ api_params = {}
1532
+ if database_id is None:
1533
+ raise AppwriteException('Missing required parameter: "database_id"')
1534
+
1535
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1536
+
1537
+ if type is not None:
1538
+ api_params['type'] = self._normalize_value(type)
1539
+ if backup_id is not None:
1540
+ api_params['backupId'] = self._normalize_value(backup_id)
1541
+ if target_time is not None:
1542
+ api_params['targetTime'] = self._normalize_value(target_time)
1543
+
1544
+ response = self.client.call('post', api_path, {
1545
+ 'X-Appwrite-Project': self.client.get_config('project'),
1546
+ 'content-type': 'application/json',
1547
+ 'accept': 'application/json',
1548
+ }, api_params)
1549
+
1550
+ return self._parse_response(response, model=DedicatedDatabaseRestoration)
1551
+
1552
+
1553
+ def get_restoration(
1554
+ self,
1555
+ database_id: str,
1556
+ restoration_id: str
1557
+ ) -> DedicatedDatabaseRestoration:
1558
+ """
1559
+ Get details of a specific database restoration including its status, type, and timestamps.
1560
+
1561
+ Parameters
1562
+ ----------
1563
+ database_id : str
1564
+ Database ID.
1565
+ restoration_id : str
1566
+ Restoration ID.
1567
+
1568
+ Returns
1569
+ -------
1570
+ DedicatedDatabaseRestoration
1571
+ API response as a typed Pydantic model
1572
+
1573
+ Raises
1574
+ ------
1575
+ AppwriteException
1576
+ If API request fails
1577
+ """
1578
+
1579
+ api_path = '/mongo/{databaseId}/restorations/{restorationId}'
1580
+ api_params = {}
1581
+ if database_id is None:
1582
+ raise AppwriteException('Missing required parameter: "database_id"')
1583
+
1584
+ if restoration_id is None:
1585
+ raise AppwriteException('Missing required parameter: "restoration_id"')
1586
+
1587
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1588
+ api_path = api_path.replace('{restorationId}', str(self._normalize_value(restoration_id)))
1589
+
1590
+
1591
+ response = self.client.call('get', api_path, {
1592
+ 'X-Appwrite-Project': self.client.get_config('project'),
1593
+ 'accept': 'application/json',
1594
+ }, api_params)
1595
+
1596
+ return self._parse_response(response, model=DedicatedDatabaseRestoration)
1597
+
1598
+
1599
+ def get_status(
1600
+ self,
1601
+ database_id: str
1602
+ ) -> DatabaseStatus:
1603
+ """
1604
+ Get real-time health and status information for a dedicated database. Returns health status, readiness, uptime, connection info, replica status, and volume information.
1605
+
1606
+ Parameters
1607
+ ----------
1608
+ database_id : str
1609
+ Database ID.
1610
+
1611
+ Returns
1612
+ -------
1613
+ DatabaseStatus
1614
+ API response as a typed Pydantic model
1615
+
1616
+ Raises
1617
+ ------
1618
+ AppwriteException
1619
+ If API request fails
1620
+ """
1621
+
1622
+ api_path = '/mongo/{databaseId}/status'
1623
+ api_params = {}
1624
+ if database_id is None:
1625
+ raise AppwriteException('Missing required parameter: "database_id"')
1626
+
1627
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1628
+
1629
+
1630
+ response = self.client.call('get', api_path, {
1631
+ 'X-Appwrite-Project': self.client.get_config('project'),
1632
+ 'accept': 'application/json',
1633
+ }, api_params)
1634
+
1635
+ return self._parse_response(response, model=DatabaseStatus)
1636
+
1637
+
1638
+ def create_upgrade(
1639
+ self,
1640
+ database_id: str,
1641
+ target_version: str
1642
+ ) -> DedicatedDatabase:
1643
+ """
1644
+ Upgrade a dedicated database to a new engine version. Uses blue-green deployment for zero-downtime cutover.
1645
+
1646
+ Parameters
1647
+ ----------
1648
+ database_id : str
1649
+ Database ID.
1650
+ target_version : str
1651
+ Target engine version to upgrade to.
1652
+
1653
+ Returns
1654
+ -------
1655
+ DedicatedDatabase
1656
+ API response as a typed Pydantic model
1657
+
1658
+ Raises
1659
+ ------
1660
+ AppwriteException
1661
+ If API request fails
1662
+ """
1663
+
1664
+ api_path = '/mongo/{databaseId}/upgrades'
1665
+ api_params = {}
1666
+ if database_id is None:
1667
+ raise AppwriteException('Missing required parameter: "database_id"')
1668
+
1669
+ if target_version is None:
1670
+ raise AppwriteException('Missing required parameter: "target_version"')
1671
+
1672
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1673
+
1674
+ api_params['targetVersion'] = self._normalize_value(target_version)
1675
+
1676
+ response = self.client.call('post', api_path, {
1677
+ 'X-Appwrite-Project': self.client.get_config('project'),
1678
+ 'content-type': 'application/json',
1679
+ 'accept': 'application/json',
1680
+ }, api_params)
1681
+
1682
+ return self._parse_response(response, model=DedicatedDatabase)
1683
+