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,1659 @@
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.function_list import FunctionList
7
+ from ..enums.runtime import Runtime
8
+ from ..enums.project_key_scopes import ProjectKeyScopes
9
+ from ..models.function import Function
10
+ from ..models.runtime_list import RuntimeList
11
+ from ..models.specification_list import SpecificationList
12
+ from ..enums.function_template_use_case import FunctionTemplateUseCase
13
+ from ..models.template_function_list import TemplateFunctionList
14
+ from ..models.template_function import TemplateFunction
15
+ from ..models.deployment_list import DeploymentList
16
+ from ..input_file import InputFile
17
+ from ..models.deployment import Deployment
18
+ from ..enums.template_reference_type import TemplateReferenceType
19
+ from ..enums.vcs_reference_type import VCSReferenceType
20
+ from ..enums.deployment_download_type import DeploymentDownloadType
21
+ from ..models.execution_list import ExecutionList
22
+ from ..enums.execution_method import ExecutionMethod
23
+ from ..models.execution import Execution
24
+ from ..models.variable_list import VariableList
25
+ from ..models.variable import Variable
26
+
27
+ class Functions(Service):
28
+
29
+ def __init__(self, client) -> None:
30
+ super(Functions, self).__init__(client)
31
+
32
+ def list(
33
+ self,
34
+ queries: Optional[List[str]] = None,
35
+ search: Optional[str] = None,
36
+ total: Optional[bool] = None
37
+ ) -> FunctionList:
38
+ """
39
+ Get a list of all the project's functions. You can use the query params to filter your results.
40
+
41
+ Parameters
42
+ ----------
43
+ queries : Optional[List[str]]
44
+ Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId
45
+ search : Optional[str]
46
+ Search term to filter your list results. Max length: 256 chars.
47
+ total : Optional[bool]
48
+ When set to false, the total count returned will be 0 and will not be calculated.
49
+
50
+ Returns
51
+ -------
52
+ FunctionList
53
+ API response as a typed Pydantic model
54
+
55
+ Raises
56
+ ------
57
+ AppwriteException
58
+ If API request fails
59
+ """
60
+
61
+ api_path = '/functions'
62
+ api_params = {}
63
+
64
+ if queries is not None:
65
+ api_params['queries'] = self._normalize_value(queries)
66
+ if search is not None:
67
+ api_params['search'] = self._normalize_value(search)
68
+ if total is not None:
69
+ api_params['total'] = self._normalize_value(total)
70
+
71
+ response = self.client.call('get', api_path, {
72
+ 'X-Appwrite-Project': self.client.get_config('project'),
73
+ 'accept': 'application/json',
74
+ }, api_params)
75
+
76
+ return self._parse_response(response, model=FunctionList)
77
+
78
+
79
+ def create(
80
+ self,
81
+ function_id: str,
82
+ name: str,
83
+ runtime: Runtime,
84
+ execute: Optional[List[str]] = None,
85
+ events: Optional[List[str]] = None,
86
+ schedule: Optional[str] = None,
87
+ timeout: Optional[float] = None,
88
+ enabled: Optional[bool] = None,
89
+ logging: Optional[bool] = None,
90
+ entrypoint: Optional[str] = None,
91
+ commands: Optional[str] = None,
92
+ scopes: Optional[List[ProjectKeyScopes]] = None,
93
+ installation_id: Optional[str] = None,
94
+ provider_repository_id: Optional[str] = None,
95
+ provider_branch: Optional[str] = None,
96
+ provider_silent_mode: Optional[bool] = None,
97
+ provider_root_directory: Optional[str] = None,
98
+ provider_branches: Optional[List[str]] = None,
99
+ provider_paths: Optional[List[str]] = None,
100
+ build_specification: Optional[str] = None,
101
+ runtime_specification: Optional[str] = None,
102
+ deployment_retention: Optional[float] = None
103
+ ) -> Function:
104
+ """
105
+ Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API.
106
+
107
+ Parameters
108
+ ----------
109
+ function_id : str
110
+ Function 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.
111
+ name : str
112
+ Function name. Max length: 128 chars.
113
+ runtime : Runtime
114
+ Execution runtime.
115
+ execute : Optional[List[str]]
116
+ An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
117
+ events : Optional[List[str]]
118
+ Events list. Maximum of 100 events are allowed.
119
+ schedule : Optional[str]
120
+ Schedule CRON syntax.
121
+ timeout : Optional[float]
122
+ Function maximum execution time in seconds.
123
+ enabled : Optional[bool]
124
+ Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
125
+ logging : Optional[bool]
126
+ When disabled, executions will exclude logs and errors, and will be slightly faster.
127
+ entrypoint : Optional[str]
128
+ Entrypoint File. This path is relative to the "providerRootDirectory".
129
+ commands : Optional[str]
130
+ Build Commands.
131
+ scopes : Optional[List[ProjectKeyScopes]]
132
+ List of scopes allowed for API key auto-generated for every execution. Maximum of 200 scopes are allowed.
133
+ installation_id : Optional[str]
134
+ Appwrite Installation ID for VCS (Version Control System) deployment.
135
+ provider_repository_id : Optional[str]
136
+ Repository ID of the repo linked to the function.
137
+ provider_branch : Optional[str]
138
+ Production branch for the repo linked to the function.
139
+ provider_silent_mode : Optional[bool]
140
+ Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
141
+ provider_root_directory : Optional[str]
142
+ Path to function code in the linked repo.
143
+ provider_branches : Optional[List[str]]
144
+ List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches.
145
+ provider_paths : Optional[List[str]]
146
+ List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes.
147
+ build_specification : Optional[str]
148
+ Build specification for the function deployments.
149
+ runtime_specification : Optional[str]
150
+ Runtime specification for the function executions.
151
+ deployment_retention : Optional[float]
152
+ Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
153
+
154
+ Returns
155
+ -------
156
+ Function
157
+ API response as a typed Pydantic model
158
+
159
+ Raises
160
+ ------
161
+ AppwriteException
162
+ If API request fails
163
+ """
164
+
165
+ api_path = '/functions'
166
+ api_params = {}
167
+ if function_id is None:
168
+ raise AppwriteException('Missing required parameter: "function_id"')
169
+
170
+ if name is None:
171
+ raise AppwriteException('Missing required parameter: "name"')
172
+
173
+ if runtime is None:
174
+ raise AppwriteException('Missing required parameter: "runtime"')
175
+
176
+
177
+ api_params['functionId'] = self._normalize_value(function_id)
178
+ api_params['name'] = self._normalize_value(name)
179
+ api_params['runtime'] = self._normalize_value(runtime)
180
+ if execute is not None:
181
+ api_params['execute'] = self._normalize_value(execute)
182
+ if events is not None:
183
+ api_params['events'] = self._normalize_value(events)
184
+ if schedule is not None:
185
+ api_params['schedule'] = self._normalize_value(schedule)
186
+ if timeout is not None:
187
+ api_params['timeout'] = self._normalize_value(timeout)
188
+ if enabled is not None:
189
+ api_params['enabled'] = self._normalize_value(enabled)
190
+ if logging is not None:
191
+ api_params['logging'] = self._normalize_value(logging)
192
+ if entrypoint is not None:
193
+ api_params['entrypoint'] = self._normalize_value(entrypoint)
194
+ if commands is not None:
195
+ api_params['commands'] = self._normalize_value(commands)
196
+ if scopes is not None:
197
+ api_params['scopes'] = self._normalize_value(scopes)
198
+ if installation_id is not None:
199
+ api_params['installationId'] = self._normalize_value(installation_id)
200
+ if provider_repository_id is not None:
201
+ api_params['providerRepositoryId'] = self._normalize_value(provider_repository_id)
202
+ if provider_branch is not None:
203
+ api_params['providerBranch'] = self._normalize_value(provider_branch)
204
+ if provider_silent_mode is not None:
205
+ api_params['providerSilentMode'] = self._normalize_value(provider_silent_mode)
206
+ if provider_root_directory is not None:
207
+ api_params['providerRootDirectory'] = self._normalize_value(provider_root_directory)
208
+ if provider_branches is not None:
209
+ api_params['providerBranches'] = self._normalize_value(provider_branches)
210
+ if provider_paths is not None:
211
+ api_params['providerPaths'] = self._normalize_value(provider_paths)
212
+ if build_specification is not None:
213
+ api_params['buildSpecification'] = self._normalize_value(build_specification)
214
+ if runtime_specification is not None:
215
+ api_params['runtimeSpecification'] = self._normalize_value(runtime_specification)
216
+ if deployment_retention is not None:
217
+ api_params['deploymentRetention'] = self._normalize_value(deployment_retention)
218
+
219
+ response = self.client.call('post', api_path, {
220
+ 'X-Appwrite-Project': self.client.get_config('project'),
221
+ 'content-type': 'application/json',
222
+ 'accept': 'application/json',
223
+ }, api_params)
224
+
225
+ return self._parse_response(response, model=Function)
226
+
227
+
228
+ def list_runtimes(
229
+ self
230
+ ) -> RuntimeList:
231
+ """
232
+ Get a list of all runtimes that are currently active on your instance.
233
+
234
+ Returns
235
+ -------
236
+ RuntimeList
237
+ API response as a typed Pydantic model
238
+
239
+ Raises
240
+ ------
241
+ AppwriteException
242
+ If API request fails
243
+ """
244
+
245
+ api_path = '/functions/runtimes'
246
+ api_params = {}
247
+
248
+ response = self.client.call('get', api_path, {
249
+ 'X-Appwrite-Project': self.client.get_config('project'),
250
+ 'accept': 'application/json',
251
+ }, api_params)
252
+
253
+ return self._parse_response(response, model=RuntimeList)
254
+
255
+
256
+ def list_specifications(
257
+ self,
258
+ type: Optional[str] = None
259
+ ) -> SpecificationList:
260
+ """
261
+ List allowed function specifications for this instance.
262
+
263
+ Parameters
264
+ ----------
265
+ type : Optional[str]
266
+ Specification type to list. Can be one of: runtimes, builds.
267
+
268
+ Returns
269
+ -------
270
+ SpecificationList
271
+ API response as a typed Pydantic model
272
+
273
+ Raises
274
+ ------
275
+ AppwriteException
276
+ If API request fails
277
+ """
278
+
279
+ api_path = '/functions/specifications'
280
+ api_params = {}
281
+
282
+ if type is not None:
283
+ api_params['type'] = self._normalize_value(type)
284
+
285
+ response = self.client.call('get', api_path, {
286
+ 'X-Appwrite-Project': self.client.get_config('project'),
287
+ 'accept': 'application/json',
288
+ }, api_params)
289
+
290
+ return self._parse_response(response, model=SpecificationList)
291
+
292
+
293
+ def list_templates(
294
+ self,
295
+ runtimes: Optional[List[Runtime]] = None,
296
+ use_cases: Optional[List[FunctionTemplateUseCase]] = None,
297
+ limit: Optional[float] = None,
298
+ offset: Optional[float] = None,
299
+ total: Optional[bool] = None
300
+ ) -> TemplateFunctionList:
301
+ """
302
+ List available function templates. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method.
303
+
304
+ Parameters
305
+ ----------
306
+ runtimes : Optional[List[Runtime]]
307
+ List of runtimes allowed for filtering function templates. Maximum of 100 runtimes are allowed.
308
+ use_cases : Optional[List[FunctionTemplateUseCase]]
309
+ List of use cases allowed for filtering function templates. Maximum of 100 use cases are allowed.
310
+ limit : Optional[float]
311
+ Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.
312
+ offset : Optional[float]
313
+ Offset the list of returned templates. Maximum offset is 5000.
314
+ total : Optional[bool]
315
+ When set to false, the total count returned will be 0 and will not be calculated.
316
+
317
+ Returns
318
+ -------
319
+ TemplateFunctionList
320
+ API response as a typed Pydantic model
321
+
322
+ Raises
323
+ ------
324
+ AppwriteException
325
+ If API request fails
326
+ """
327
+
328
+ api_path = '/functions/templates'
329
+ api_params = {}
330
+
331
+ if runtimes is not None:
332
+ api_params['runtimes'] = self._normalize_value(runtimes)
333
+ if use_cases is not None:
334
+ api_params['useCases'] = self._normalize_value(use_cases)
335
+ if limit is not None:
336
+ api_params['limit'] = self._normalize_value(limit)
337
+ if offset is not None:
338
+ api_params['offset'] = self._normalize_value(offset)
339
+ if total is not None:
340
+ api_params['total'] = self._normalize_value(total)
341
+
342
+ response = self.client.call('get', api_path, {
343
+ 'X-Appwrite-Project': self.client.get_config('project'),
344
+ 'accept': 'application/json',
345
+ }, api_params)
346
+
347
+ return self._parse_response(response, model=TemplateFunctionList)
348
+
349
+
350
+ def get_template(
351
+ self,
352
+ template_id: str
353
+ ) -> TemplateFunction:
354
+ """
355
+ Get a function template using ID. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method.
356
+
357
+ Parameters
358
+ ----------
359
+ template_id : str
360
+ Template ID.
361
+
362
+ Returns
363
+ -------
364
+ TemplateFunction
365
+ API response as a typed Pydantic model
366
+
367
+ Raises
368
+ ------
369
+ AppwriteException
370
+ If API request fails
371
+ """
372
+
373
+ api_path = '/functions/templates/{templateId}'
374
+ api_params = {}
375
+ if template_id is None:
376
+ raise AppwriteException('Missing required parameter: "template_id"')
377
+
378
+ api_path = api_path.replace('{templateId}', str(self._normalize_value(template_id)))
379
+
380
+
381
+ response = self.client.call('get', api_path, {
382
+ 'X-Appwrite-Project': self.client.get_config('project'),
383
+ 'accept': 'application/json',
384
+ }, api_params)
385
+
386
+ return self._parse_response(response, model=TemplateFunction)
387
+
388
+
389
+ def get(
390
+ self,
391
+ function_id: str
392
+ ) -> Function:
393
+ """
394
+ Get a function by its unique ID.
395
+
396
+ Parameters
397
+ ----------
398
+ function_id : str
399
+ Function ID.
400
+
401
+ Returns
402
+ -------
403
+ Function
404
+ API response as a typed Pydantic model
405
+
406
+ Raises
407
+ ------
408
+ AppwriteException
409
+ If API request fails
410
+ """
411
+
412
+ api_path = '/functions/{functionId}'
413
+ api_params = {}
414
+ if function_id is None:
415
+ raise AppwriteException('Missing required parameter: "function_id"')
416
+
417
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
418
+
419
+
420
+ response = self.client.call('get', api_path, {
421
+ 'X-Appwrite-Project': self.client.get_config('project'),
422
+ 'accept': 'application/json',
423
+ }, api_params)
424
+
425
+ return self._parse_response(response, model=Function)
426
+
427
+
428
+ def update(
429
+ self,
430
+ function_id: str,
431
+ name: str,
432
+ runtime: Optional[Runtime] = None,
433
+ execute: Optional[List[str]] = None,
434
+ events: Optional[List[str]] = None,
435
+ schedule: Optional[str] = None,
436
+ timeout: Optional[float] = None,
437
+ enabled: Optional[bool] = None,
438
+ logging: Optional[bool] = None,
439
+ entrypoint: Optional[str] = None,
440
+ commands: Optional[str] = None,
441
+ scopes: Optional[List[ProjectKeyScopes]] = None,
442
+ installation_id: Optional[str] = None,
443
+ provider_repository_id: Optional[str] = None,
444
+ provider_branch: Optional[str] = None,
445
+ provider_silent_mode: Optional[bool] = None,
446
+ provider_root_directory: Optional[str] = None,
447
+ provider_branches: Optional[List[str]] = None,
448
+ provider_paths: Optional[List[str]] = None,
449
+ build_specification: Optional[str] = None,
450
+ runtime_specification: Optional[str] = None,
451
+ deployment_retention: Optional[float] = None
452
+ ) -> Function:
453
+ """
454
+ Update function by its unique ID.
455
+
456
+ Parameters
457
+ ----------
458
+ function_id : str
459
+ Function ID.
460
+ name : str
461
+ Function name. Max length: 128 chars.
462
+ runtime : Optional[Runtime]
463
+ Execution runtime.
464
+ execute : Optional[List[str]]
465
+ An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
466
+ events : Optional[List[str]]
467
+ Events list. Maximum of 100 events are allowed.
468
+ schedule : Optional[str]
469
+ Schedule CRON syntax.
470
+ timeout : Optional[float]
471
+ Maximum execution time in seconds.
472
+ enabled : Optional[bool]
473
+ Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
474
+ logging : Optional[bool]
475
+ When disabled, executions will exclude logs and errors, and will be slightly faster.
476
+ entrypoint : Optional[str]
477
+ Entrypoint File. This path is relative to the "providerRootDirectory".
478
+ commands : Optional[str]
479
+ Build Commands.
480
+ scopes : Optional[List[ProjectKeyScopes]]
481
+ List of scopes allowed for API Key auto-generated for every execution. Maximum of 200 scopes are allowed.
482
+ installation_id : Optional[str]
483
+ Appwrite Installation ID for VCS (Version Controle System) deployment.
484
+ provider_repository_id : Optional[str]
485
+ Repository ID of the repo linked to the function
486
+ provider_branch : Optional[str]
487
+ Production branch for the repo linked to the function
488
+ provider_silent_mode : Optional[bool]
489
+ Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
490
+ provider_root_directory : Optional[str]
491
+ Path to function code in the linked repo.
492
+ provider_branches : Optional[List[str]]
493
+ List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches.
494
+ provider_paths : Optional[List[str]]
495
+ List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes.
496
+ build_specification : Optional[str]
497
+ Build specification for the function deployments.
498
+ runtime_specification : Optional[str]
499
+ Runtime specification for the function executions.
500
+ deployment_retention : Optional[float]
501
+ Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
502
+
503
+ Returns
504
+ -------
505
+ Function
506
+ API response as a typed Pydantic model
507
+
508
+ Raises
509
+ ------
510
+ AppwriteException
511
+ If API request fails
512
+ """
513
+
514
+ api_path = '/functions/{functionId}'
515
+ api_params = {}
516
+ if function_id is None:
517
+ raise AppwriteException('Missing required parameter: "function_id"')
518
+
519
+ if name is None:
520
+ raise AppwriteException('Missing required parameter: "name"')
521
+
522
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
523
+
524
+ api_params['name'] = self._normalize_value(name)
525
+ if runtime is not None:
526
+ api_params['runtime'] = self._normalize_value(runtime)
527
+ if execute is not None:
528
+ api_params['execute'] = self._normalize_value(execute)
529
+ if events is not None:
530
+ api_params['events'] = self._normalize_value(events)
531
+ if schedule is not None:
532
+ api_params['schedule'] = self._normalize_value(schedule)
533
+ if timeout is not None:
534
+ api_params['timeout'] = self._normalize_value(timeout)
535
+ if enabled is not None:
536
+ api_params['enabled'] = self._normalize_value(enabled)
537
+ if logging is not None:
538
+ api_params['logging'] = self._normalize_value(logging)
539
+ if entrypoint is not None:
540
+ api_params['entrypoint'] = self._normalize_value(entrypoint)
541
+ if commands is not None:
542
+ api_params['commands'] = self._normalize_value(commands)
543
+ if scopes is not None:
544
+ api_params['scopes'] = self._normalize_value(scopes)
545
+ if installation_id is not None:
546
+ api_params['installationId'] = self._normalize_value(installation_id)
547
+ if provider_repository_id is not None:
548
+ api_params['providerRepositoryId'] = self._normalize_value(provider_repository_id)
549
+ if provider_branch is not None:
550
+ api_params['providerBranch'] = self._normalize_value(provider_branch)
551
+ if provider_silent_mode is not None:
552
+ api_params['providerSilentMode'] = self._normalize_value(provider_silent_mode)
553
+ if provider_root_directory is not None:
554
+ api_params['providerRootDirectory'] = self._normalize_value(provider_root_directory)
555
+ if provider_branches is not None:
556
+ api_params['providerBranches'] = self._normalize_value(provider_branches)
557
+ if provider_paths is not None:
558
+ api_params['providerPaths'] = self._normalize_value(provider_paths)
559
+ if build_specification is not None:
560
+ api_params['buildSpecification'] = self._normalize_value(build_specification)
561
+ if runtime_specification is not None:
562
+ api_params['runtimeSpecification'] = self._normalize_value(runtime_specification)
563
+ if deployment_retention is not None:
564
+ api_params['deploymentRetention'] = self._normalize_value(deployment_retention)
565
+
566
+ response = self.client.call('put', api_path, {
567
+ 'X-Appwrite-Project': self.client.get_config('project'),
568
+ 'content-type': 'application/json',
569
+ 'accept': 'application/json',
570
+ }, api_params)
571
+
572
+ return self._parse_response(response, model=Function)
573
+
574
+
575
+ def delete(
576
+ self,
577
+ function_id: str
578
+ ) -> Dict[str, Any]:
579
+ """
580
+ Delete a function by its unique ID.
581
+
582
+ Parameters
583
+ ----------
584
+ function_id : str
585
+ Function ID.
586
+
587
+ Returns
588
+ -------
589
+ Dict[str, Any]
590
+ API response as a dictionary
591
+
592
+ Raises
593
+ ------
594
+ AppwriteException
595
+ If API request fails
596
+ """
597
+
598
+ api_path = '/functions/{functionId}'
599
+ api_params = {}
600
+ if function_id is None:
601
+ raise AppwriteException('Missing required parameter: "function_id"')
602
+
603
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
604
+
605
+
606
+ response = self.client.call('delete', api_path, {
607
+ 'X-Appwrite-Project': self.client.get_config('project'),
608
+ 'content-type': 'application/json',
609
+ }, api_params)
610
+
611
+ return response
612
+
613
+
614
+ def update_function_deployment(
615
+ self,
616
+ function_id: str,
617
+ deployment_id: str
618
+ ) -> Function:
619
+ """
620
+ Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.
621
+
622
+ Parameters
623
+ ----------
624
+ function_id : str
625
+ Function ID.
626
+ deployment_id : str
627
+ Deployment ID.
628
+
629
+ Returns
630
+ -------
631
+ Function
632
+ API response as a typed Pydantic model
633
+
634
+ Raises
635
+ ------
636
+ AppwriteException
637
+ If API request fails
638
+ """
639
+
640
+ api_path = '/functions/{functionId}/deployment'
641
+ api_params = {}
642
+ if function_id is None:
643
+ raise AppwriteException('Missing required parameter: "function_id"')
644
+
645
+ if deployment_id is None:
646
+ raise AppwriteException('Missing required parameter: "deployment_id"')
647
+
648
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
649
+
650
+ api_params['deploymentId'] = self._normalize_value(deployment_id)
651
+
652
+ response = self.client.call('patch', api_path, {
653
+ 'X-Appwrite-Project': self.client.get_config('project'),
654
+ 'content-type': 'application/json',
655
+ 'accept': 'application/json',
656
+ }, api_params)
657
+
658
+ return self._parse_response(response, model=Function)
659
+
660
+
661
+ def list_deployments(
662
+ self,
663
+ function_id: str,
664
+ queries: Optional[List[str]] = None,
665
+ search: Optional[str] = None,
666
+ total: Optional[bool] = None
667
+ ) -> DeploymentList:
668
+ """
669
+ Get a list of all the function's code deployments. You can use the query params to filter your results.
670
+
671
+ Parameters
672
+ ----------
673
+ function_id : str
674
+ Function ID.
675
+ queries : Optional[List[str]]
676
+ 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: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
677
+ search : Optional[str]
678
+ Search term to filter your list results. Max length: 256 chars.
679
+ total : Optional[bool]
680
+ When set to false, the total count returned will be 0 and will not be calculated.
681
+
682
+ Returns
683
+ -------
684
+ DeploymentList
685
+ API response as a typed Pydantic model
686
+
687
+ Raises
688
+ ------
689
+ AppwriteException
690
+ If API request fails
691
+ """
692
+
693
+ api_path = '/functions/{functionId}/deployments'
694
+ api_params = {}
695
+ if function_id is None:
696
+ raise AppwriteException('Missing required parameter: "function_id"')
697
+
698
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
699
+
700
+ if queries is not None:
701
+ api_params['queries'] = self._normalize_value(queries)
702
+ if search is not None:
703
+ api_params['search'] = self._normalize_value(search)
704
+ if total is not None:
705
+ api_params['total'] = self._normalize_value(total)
706
+
707
+ response = self.client.call('get', api_path, {
708
+ 'X-Appwrite-Project': self.client.get_config('project'),
709
+ 'accept': 'application/json',
710
+ }, api_params)
711
+
712
+ return self._parse_response(response, model=DeploymentList)
713
+
714
+
715
+ def create_deployment(
716
+ self,
717
+ function_id: str,
718
+ code: InputFile,
719
+ activate: bool,
720
+ entrypoint: Optional[str] = None,
721
+ commands: Optional[str] = None,
722
+ on_progress = None
723
+ ) -> Deployment:
724
+ """
725
+ Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.
726
+
727
+ This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https://appwrite.io/docs/functions).
728
+
729
+ Use the "command" param to set the entrypoint used to execute your code.
730
+
731
+ Parameters
732
+ ----------
733
+ function_id : str
734
+ Function ID.
735
+ code : InputFile
736
+ Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
737
+ activate : bool
738
+ Automatically activate the deployment when it is finished building.
739
+ entrypoint : Optional[str]
740
+ Entrypoint File.
741
+ commands : Optional[str]
742
+ Build Commands.
743
+ on_progress : callable, optional
744
+ Optional callback for upload progress
745
+
746
+ Returns
747
+ -------
748
+ Deployment
749
+ API response as a typed Pydantic model
750
+
751
+ Raises
752
+ ------
753
+ AppwriteException
754
+ If API request fails
755
+ """
756
+
757
+ api_path = '/functions/{functionId}/deployments'
758
+ api_params = {}
759
+ if function_id is None:
760
+ raise AppwriteException('Missing required parameter: "function_id"')
761
+
762
+ if code is None:
763
+ raise AppwriteException('Missing required parameter: "code"')
764
+
765
+ if activate is None:
766
+ raise AppwriteException('Missing required parameter: "activate"')
767
+
768
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
769
+
770
+ if entrypoint is not None:
771
+ api_params['entrypoint'] = self._normalize_value(entrypoint)
772
+ if commands is not None:
773
+ api_params['commands'] = self._normalize_value(commands)
774
+ api_params['code'] = self._normalize_value(code)
775
+ api_params['activate'] = self._normalize_value(str(activate).lower() if type(activate) is bool else activate)
776
+
777
+ param_name = 'code'
778
+
779
+
780
+ upload_id = ''
781
+
782
+ response = self.client.chunked_upload(api_path, {
783
+ 'X-Appwrite-Project': self.client.get_config('project'),
784
+ 'content-type': 'multipart/form-data',
785
+ 'accept': 'application/json',
786
+ }, api_params, param_name, on_progress, upload_id)
787
+
788
+ return self._parse_response(response, model=Deployment)
789
+
790
+
791
+ def create_duplicate_deployment(
792
+ self,
793
+ function_id: str,
794
+ deployment_id: str,
795
+ build_id: Optional[str] = None
796
+ ) -> Deployment:
797
+ """
798
+ Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.
799
+
800
+ Parameters
801
+ ----------
802
+ function_id : str
803
+ Function ID.
804
+ deployment_id : str
805
+ Deployment ID.
806
+ build_id : Optional[str]
807
+ Build unique ID.
808
+
809
+ Returns
810
+ -------
811
+ Deployment
812
+ API response as a typed Pydantic model
813
+
814
+ Raises
815
+ ------
816
+ AppwriteException
817
+ If API request fails
818
+ """
819
+
820
+ api_path = '/functions/{functionId}/deployments/duplicate'
821
+ api_params = {}
822
+ if function_id is None:
823
+ raise AppwriteException('Missing required parameter: "function_id"')
824
+
825
+ if deployment_id is None:
826
+ raise AppwriteException('Missing required parameter: "deployment_id"')
827
+
828
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
829
+
830
+ api_params['deploymentId'] = self._normalize_value(deployment_id)
831
+ if build_id is not None:
832
+ api_params['buildId'] = self._normalize_value(build_id)
833
+
834
+ response = self.client.call('post', api_path, {
835
+ 'X-Appwrite-Project': self.client.get_config('project'),
836
+ 'content-type': 'application/json',
837
+ 'accept': 'application/json',
838
+ }, api_params)
839
+
840
+ return self._parse_response(response, model=Deployment)
841
+
842
+
843
+ def create_template_deployment(
844
+ self,
845
+ function_id: str,
846
+ repository: str,
847
+ owner: str,
848
+ root_directory: str,
849
+ type: TemplateReferenceType,
850
+ reference: str,
851
+ activate: Optional[bool] = None
852
+ ) -> Deployment:
853
+ """
854
+ Create a deployment based on a template.
855
+
856
+ Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/functions/templates) to find the template details.
857
+
858
+ Parameters
859
+ ----------
860
+ function_id : str
861
+ Function ID.
862
+ repository : str
863
+ Repository name of the template.
864
+ owner : str
865
+ The name of the owner of the template.
866
+ root_directory : str
867
+ Path to function code in the template repo.
868
+ type : TemplateReferenceType
869
+ Type for the reference provided. Can be commit, branch, or tag
870
+ reference : str
871
+ Reference value, can be a commit hash, branch name, or release tag
872
+ activate : Optional[bool]
873
+ Automatically activate the deployment when it is finished building.
874
+
875
+ Returns
876
+ -------
877
+ Deployment
878
+ API response as a typed Pydantic model
879
+
880
+ Raises
881
+ ------
882
+ AppwriteException
883
+ If API request fails
884
+ """
885
+
886
+ api_path = '/functions/{functionId}/deployments/template'
887
+ api_params = {}
888
+ if function_id is None:
889
+ raise AppwriteException('Missing required parameter: "function_id"')
890
+
891
+ if repository is None:
892
+ raise AppwriteException('Missing required parameter: "repository"')
893
+
894
+ if owner is None:
895
+ raise AppwriteException('Missing required parameter: "owner"')
896
+
897
+ if root_directory is None:
898
+ raise AppwriteException('Missing required parameter: "root_directory"')
899
+
900
+ if type is None:
901
+ raise AppwriteException('Missing required parameter: "type"')
902
+
903
+ if reference is None:
904
+ raise AppwriteException('Missing required parameter: "reference"')
905
+
906
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
907
+
908
+ api_params['repository'] = self._normalize_value(repository)
909
+ api_params['owner'] = self._normalize_value(owner)
910
+ api_params['rootDirectory'] = self._normalize_value(root_directory)
911
+ api_params['type'] = self._normalize_value(type)
912
+ api_params['reference'] = self._normalize_value(reference)
913
+ if activate is not None:
914
+ api_params['activate'] = self._normalize_value(activate)
915
+
916
+ response = self.client.call('post', api_path, {
917
+ 'X-Appwrite-Project': self.client.get_config('project'),
918
+ 'content-type': 'application/json',
919
+ 'accept': 'application/json',
920
+ }, api_params)
921
+
922
+ return self._parse_response(response, model=Deployment)
923
+
924
+
925
+ def create_vcs_deployment(
926
+ self,
927
+ function_id: str,
928
+ type: VCSReferenceType,
929
+ reference: str,
930
+ activate: Optional[bool] = None
931
+ ) -> Deployment:
932
+ """
933
+ Create a deployment when a function is connected to VCS.
934
+
935
+ This endpoint lets you create deployment from a branch, commit, or a tag.
936
+
937
+ Parameters
938
+ ----------
939
+ function_id : str
940
+ Function ID.
941
+ type : VCSReferenceType
942
+ Type of reference passed. Allowed values are: branch, commit
943
+ reference : str
944
+ VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
945
+ activate : Optional[bool]
946
+ Automatically activate the deployment when it is finished building.
947
+
948
+ Returns
949
+ -------
950
+ Deployment
951
+ API response as a typed Pydantic model
952
+
953
+ Raises
954
+ ------
955
+ AppwriteException
956
+ If API request fails
957
+ """
958
+
959
+ api_path = '/functions/{functionId}/deployments/vcs'
960
+ api_params = {}
961
+ if function_id is None:
962
+ raise AppwriteException('Missing required parameter: "function_id"')
963
+
964
+ if type is None:
965
+ raise AppwriteException('Missing required parameter: "type"')
966
+
967
+ if reference is None:
968
+ raise AppwriteException('Missing required parameter: "reference"')
969
+
970
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
971
+
972
+ api_params['type'] = self._normalize_value(type)
973
+ api_params['reference'] = self._normalize_value(reference)
974
+ if activate is not None:
975
+ api_params['activate'] = self._normalize_value(activate)
976
+
977
+ response = self.client.call('post', api_path, {
978
+ 'X-Appwrite-Project': self.client.get_config('project'),
979
+ 'content-type': 'application/json',
980
+ 'accept': 'application/json',
981
+ }, api_params)
982
+
983
+ return self._parse_response(response, model=Deployment)
984
+
985
+
986
+ def get_deployment(
987
+ self,
988
+ function_id: str,
989
+ deployment_id: str
990
+ ) -> Deployment:
991
+ """
992
+ Get a function deployment by its unique ID.
993
+
994
+ Parameters
995
+ ----------
996
+ function_id : str
997
+ Function ID.
998
+ deployment_id : str
999
+ Deployment ID.
1000
+
1001
+ Returns
1002
+ -------
1003
+ Deployment
1004
+ API response as a typed Pydantic model
1005
+
1006
+ Raises
1007
+ ------
1008
+ AppwriteException
1009
+ If API request fails
1010
+ """
1011
+
1012
+ api_path = '/functions/{functionId}/deployments/{deploymentId}'
1013
+ api_params = {}
1014
+ if function_id is None:
1015
+ raise AppwriteException('Missing required parameter: "function_id"')
1016
+
1017
+ if deployment_id is None:
1018
+ raise AppwriteException('Missing required parameter: "deployment_id"')
1019
+
1020
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
1021
+ api_path = api_path.replace('{deploymentId}', str(self._normalize_value(deployment_id)))
1022
+
1023
+
1024
+ response = self.client.call('get', api_path, {
1025
+ 'X-Appwrite-Project': self.client.get_config('project'),
1026
+ 'accept': 'application/json',
1027
+ }, api_params)
1028
+
1029
+ return self._parse_response(response, model=Deployment)
1030
+
1031
+
1032
+ def delete_deployment(
1033
+ self,
1034
+ function_id: str,
1035
+ deployment_id: str
1036
+ ) -> Dict[str, Any]:
1037
+ """
1038
+ Delete a code deployment by its unique ID.
1039
+
1040
+ Parameters
1041
+ ----------
1042
+ function_id : str
1043
+ Function ID.
1044
+ deployment_id : str
1045
+ Deployment ID.
1046
+
1047
+ Returns
1048
+ -------
1049
+ Dict[str, Any]
1050
+ API response as a dictionary
1051
+
1052
+ Raises
1053
+ ------
1054
+ AppwriteException
1055
+ If API request fails
1056
+ """
1057
+
1058
+ api_path = '/functions/{functionId}/deployments/{deploymentId}'
1059
+ api_params = {}
1060
+ if function_id is None:
1061
+ raise AppwriteException('Missing required parameter: "function_id"')
1062
+
1063
+ if deployment_id is None:
1064
+ raise AppwriteException('Missing required parameter: "deployment_id"')
1065
+
1066
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
1067
+ api_path = api_path.replace('{deploymentId}', str(self._normalize_value(deployment_id)))
1068
+
1069
+
1070
+ response = self.client.call('delete', api_path, {
1071
+ 'X-Appwrite-Project': self.client.get_config('project'),
1072
+ 'content-type': 'application/json',
1073
+ }, api_params)
1074
+
1075
+ return response
1076
+
1077
+
1078
+ def get_deployment_download(
1079
+ self,
1080
+ function_id: str,
1081
+ deployment_id: str,
1082
+ type: Optional[DeploymentDownloadType] = None,
1083
+ token: Optional[str] = None
1084
+ ) -> bytes:
1085
+ """
1086
+ Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
1087
+
1088
+ Parameters
1089
+ ----------
1090
+ function_id : str
1091
+ Function ID.
1092
+ deployment_id : str
1093
+ Deployment ID.
1094
+ type : Optional[DeploymentDownloadType]
1095
+ Deployment file to download. Can be: "source", "output".
1096
+ token : Optional[str]
1097
+ Presigned source-download token for accessing this deployment without a session (jobs-service).
1098
+
1099
+ Returns
1100
+ -------
1101
+ bytes
1102
+ Response as bytes
1103
+
1104
+ Raises
1105
+ ------
1106
+ AppwriteException
1107
+ If API request fails
1108
+ """
1109
+
1110
+ api_path = '/functions/{functionId}/deployments/{deploymentId}/download'
1111
+ api_params = {}
1112
+ if function_id is None:
1113
+ raise AppwriteException('Missing required parameter: "function_id"')
1114
+
1115
+ if deployment_id is None:
1116
+ raise AppwriteException('Missing required parameter: "deployment_id"')
1117
+
1118
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
1119
+ api_path = api_path.replace('{deploymentId}', str(self._normalize_value(deployment_id)))
1120
+
1121
+ if type is not None:
1122
+ api_params['type'] = self._normalize_value(type)
1123
+ if token is not None:
1124
+ api_params['token'] = self._normalize_value(token)
1125
+
1126
+ response = self.client.call('get', api_path, {
1127
+ 'X-Appwrite-Project': self.client.get_config('project'),
1128
+ 'accept': '*/*',
1129
+ }, api_params)
1130
+
1131
+ return response
1132
+
1133
+
1134
+ def update_deployment_status(
1135
+ self,
1136
+ function_id: str,
1137
+ deployment_id: str
1138
+ ) -> Deployment:
1139
+ """
1140
+ Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.
1141
+
1142
+ Parameters
1143
+ ----------
1144
+ function_id : str
1145
+ Function ID.
1146
+ deployment_id : str
1147
+ Deployment ID.
1148
+
1149
+ Returns
1150
+ -------
1151
+ Deployment
1152
+ API response as a typed Pydantic model
1153
+
1154
+ Raises
1155
+ ------
1156
+ AppwriteException
1157
+ If API request fails
1158
+ """
1159
+
1160
+ api_path = '/functions/{functionId}/deployments/{deploymentId}/status'
1161
+ api_params = {}
1162
+ if function_id is None:
1163
+ raise AppwriteException('Missing required parameter: "function_id"')
1164
+
1165
+ if deployment_id is None:
1166
+ raise AppwriteException('Missing required parameter: "deployment_id"')
1167
+
1168
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
1169
+ api_path = api_path.replace('{deploymentId}', str(self._normalize_value(deployment_id)))
1170
+
1171
+
1172
+ response = self.client.call('patch', api_path, {
1173
+ 'X-Appwrite-Project': self.client.get_config('project'),
1174
+ 'content-type': 'application/json',
1175
+ 'accept': 'application/json',
1176
+ }, api_params)
1177
+
1178
+ return self._parse_response(response, model=Deployment)
1179
+
1180
+
1181
+ def list_executions(
1182
+ self,
1183
+ function_id: str,
1184
+ queries: Optional[List[str]] = None,
1185
+ total: Optional[bool] = None
1186
+ ) -> ExecutionList:
1187
+ """
1188
+ Get a list of all the current user function execution logs. You can use the query params to filter your results.
1189
+
1190
+ Parameters
1191
+ ----------
1192
+ function_id : str
1193
+ Function ID.
1194
+ queries : Optional[List[str]]
1195
+ 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: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
1196
+ total : Optional[bool]
1197
+ When set to false, the total count returned will be 0 and will not be calculated.
1198
+
1199
+ Returns
1200
+ -------
1201
+ ExecutionList
1202
+ API response as a typed Pydantic model
1203
+
1204
+ Raises
1205
+ ------
1206
+ AppwriteException
1207
+ If API request fails
1208
+ """
1209
+
1210
+ api_path = '/functions/{functionId}/executions'
1211
+ api_params = {}
1212
+ if function_id is None:
1213
+ raise AppwriteException('Missing required parameter: "function_id"')
1214
+
1215
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
1216
+
1217
+ if queries is not None:
1218
+ api_params['queries'] = self._normalize_value(queries)
1219
+ if total is not None:
1220
+ api_params['total'] = self._normalize_value(total)
1221
+
1222
+ response = self.client.call('get', api_path, {
1223
+ 'X-Appwrite-Project': self.client.get_config('project'),
1224
+ 'accept': 'application/json',
1225
+ }, api_params)
1226
+
1227
+ return self._parse_response(response, model=ExecutionList)
1228
+
1229
+
1230
+ def create_execution(
1231
+ self,
1232
+ function_id: str,
1233
+ body: Optional[str] = None,
1234
+ xasync: Optional[bool] = None,
1235
+ path: Optional[str] = None,
1236
+ method: Optional[ExecutionMethod] = None,
1237
+ headers: Optional[Dict[str, Any]] = None,
1238
+ scheduled_at: Optional[str] = None
1239
+ ) -> Execution:
1240
+ """
1241
+ Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
1242
+
1243
+ Parameters
1244
+ ----------
1245
+ function_id : str
1246
+ Function ID.
1247
+ body : Optional[str]
1248
+ HTTP body of execution. Default value is empty string.
1249
+ xasync : Optional[bool]
1250
+ Execute code in the background. Default value is false.
1251
+ path : Optional[str]
1252
+ HTTP path of execution. Path can include query params. Default value is /
1253
+ method : Optional[ExecutionMethod]
1254
+ HTTP method of execution. Default value is POST.
1255
+ headers : Optional[Dict[str, Any]]
1256
+ HTTP headers of execution. Defaults to empty.
1257
+ scheduled_at : Optional[str]
1258
+ Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.
1259
+
1260
+ Returns
1261
+ -------
1262
+ Execution
1263
+ API response as a typed Pydantic model
1264
+
1265
+ Raises
1266
+ ------
1267
+ AppwriteException
1268
+ If API request fails
1269
+ """
1270
+
1271
+ api_path = '/functions/{functionId}/executions'
1272
+ api_params = {}
1273
+ if function_id is None:
1274
+ raise AppwriteException('Missing required parameter: "function_id"')
1275
+
1276
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
1277
+
1278
+ if body is not None:
1279
+ api_params['body'] = self._normalize_value(body)
1280
+ if xasync is not None:
1281
+ api_params['async'] = self._normalize_value(xasync)
1282
+ if path is not None:
1283
+ api_params['path'] = self._normalize_value(path)
1284
+ if method is not None:
1285
+ api_params['method'] = self._normalize_value(method)
1286
+ if headers is not None:
1287
+ api_params['headers'] = self._normalize_value(headers)
1288
+ if scheduled_at is not None:
1289
+ api_params['scheduledAt'] = self._normalize_value(scheduled_at)
1290
+
1291
+ response = self.client.call('post', api_path, {
1292
+ 'X-Appwrite-Project': self.client.get_config('project'),
1293
+ 'content-type': 'application/json',
1294
+ 'accept': 'application/json',
1295
+ }, api_params)
1296
+
1297
+ return self._parse_response(response, model=Execution)
1298
+
1299
+
1300
+ def get_execution(
1301
+ self,
1302
+ function_id: str,
1303
+ execution_id: str
1304
+ ) -> Execution:
1305
+ """
1306
+ Get a function execution log by its unique ID.
1307
+
1308
+ Parameters
1309
+ ----------
1310
+ function_id : str
1311
+ Function ID.
1312
+ execution_id : str
1313
+ Execution ID.
1314
+
1315
+ Returns
1316
+ -------
1317
+ Execution
1318
+ API response as a typed Pydantic model
1319
+
1320
+ Raises
1321
+ ------
1322
+ AppwriteException
1323
+ If API request fails
1324
+ """
1325
+
1326
+ api_path = '/functions/{functionId}/executions/{executionId}'
1327
+ api_params = {}
1328
+ if function_id is None:
1329
+ raise AppwriteException('Missing required parameter: "function_id"')
1330
+
1331
+ if execution_id is None:
1332
+ raise AppwriteException('Missing required parameter: "execution_id"')
1333
+
1334
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
1335
+ api_path = api_path.replace('{executionId}', str(self._normalize_value(execution_id)))
1336
+
1337
+
1338
+ response = self.client.call('get', api_path, {
1339
+ 'X-Appwrite-Project': self.client.get_config('project'),
1340
+ 'accept': 'application/json',
1341
+ }, api_params)
1342
+
1343
+ return self._parse_response(response, model=Execution)
1344
+
1345
+
1346
+ def delete_execution(
1347
+ self,
1348
+ function_id: str,
1349
+ execution_id: str
1350
+ ) -> Dict[str, Any]:
1351
+ """
1352
+ Delete a function execution by its unique ID.
1353
+
1354
+ Parameters
1355
+ ----------
1356
+ function_id : str
1357
+ Function ID.
1358
+ execution_id : str
1359
+ Execution ID.
1360
+
1361
+ Returns
1362
+ -------
1363
+ Dict[str, Any]
1364
+ API response as a dictionary
1365
+
1366
+ Raises
1367
+ ------
1368
+ AppwriteException
1369
+ If API request fails
1370
+ """
1371
+
1372
+ api_path = '/functions/{functionId}/executions/{executionId}'
1373
+ api_params = {}
1374
+ if function_id is None:
1375
+ raise AppwriteException('Missing required parameter: "function_id"')
1376
+
1377
+ if execution_id is None:
1378
+ raise AppwriteException('Missing required parameter: "execution_id"')
1379
+
1380
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
1381
+ api_path = api_path.replace('{executionId}', str(self._normalize_value(execution_id)))
1382
+
1383
+
1384
+ response = self.client.call('delete', api_path, {
1385
+ 'X-Appwrite-Project': self.client.get_config('project'),
1386
+ 'content-type': 'application/json',
1387
+ }, api_params)
1388
+
1389
+ return response
1390
+
1391
+
1392
+ def list_variables(
1393
+ self,
1394
+ function_id: str,
1395
+ queries: Optional[List[str]] = None,
1396
+ total: Optional[bool] = None
1397
+ ) -> VariableList:
1398
+ """
1399
+ Get a list of all variables of a specific function.
1400
+
1401
+ Parameters
1402
+ ----------
1403
+ function_id : str
1404
+ Function unique ID.
1405
+ queries : Optional[List[str]]
1406
+ Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret
1407
+ total : Optional[bool]
1408
+ When set to false, the total count returned will be 0 and will not be calculated.
1409
+
1410
+ Returns
1411
+ -------
1412
+ VariableList
1413
+ API response as a typed Pydantic model
1414
+
1415
+ Raises
1416
+ ------
1417
+ AppwriteException
1418
+ If API request fails
1419
+ """
1420
+
1421
+ api_path = '/functions/{functionId}/variables'
1422
+ api_params = {}
1423
+ if function_id is None:
1424
+ raise AppwriteException('Missing required parameter: "function_id"')
1425
+
1426
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
1427
+
1428
+ if queries is not None:
1429
+ api_params['queries'] = self._normalize_value(queries)
1430
+ if total is not None:
1431
+ api_params['total'] = self._normalize_value(total)
1432
+
1433
+ response = self.client.call('get', api_path, {
1434
+ 'X-Appwrite-Project': self.client.get_config('project'),
1435
+ 'accept': 'application/json',
1436
+ }, api_params)
1437
+
1438
+ return self._parse_response(response, model=VariableList)
1439
+
1440
+
1441
+ def create_variable(
1442
+ self,
1443
+ function_id: str,
1444
+ variable_id: str,
1445
+ key: str,
1446
+ value: str,
1447
+ secret: Optional[bool] = None
1448
+ ) -> Variable:
1449
+ """
1450
+ Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.
1451
+
1452
+ Parameters
1453
+ ----------
1454
+ function_id : str
1455
+ Function unique ID.
1456
+ variable_id : str
1457
+ Variable 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.
1458
+ key : str
1459
+ Variable key. Max length: 255 chars.
1460
+ value : str
1461
+ Variable value. Max length: 8192 chars.
1462
+ secret : Optional[bool]
1463
+ Secret variables can be updated or deleted, but only functions can read them during build and runtime.
1464
+
1465
+ Returns
1466
+ -------
1467
+ Variable
1468
+ API response as a typed Pydantic model
1469
+
1470
+ Raises
1471
+ ------
1472
+ AppwriteException
1473
+ If API request fails
1474
+ """
1475
+
1476
+ api_path = '/functions/{functionId}/variables'
1477
+ api_params = {}
1478
+ if function_id is None:
1479
+ raise AppwriteException('Missing required parameter: "function_id"')
1480
+
1481
+ if variable_id is None:
1482
+ raise AppwriteException('Missing required parameter: "variable_id"')
1483
+
1484
+ if key is None:
1485
+ raise AppwriteException('Missing required parameter: "key"')
1486
+
1487
+ if value is None:
1488
+ raise AppwriteException('Missing required parameter: "value"')
1489
+
1490
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
1491
+
1492
+ api_params['variableId'] = self._normalize_value(variable_id)
1493
+ api_params['key'] = self._normalize_value(key)
1494
+ api_params['value'] = self._normalize_value(value)
1495
+ if secret is not None:
1496
+ api_params['secret'] = self._normalize_value(secret)
1497
+
1498
+ response = self.client.call('post', api_path, {
1499
+ 'X-Appwrite-Project': self.client.get_config('project'),
1500
+ 'content-type': 'application/json',
1501
+ 'accept': 'application/json',
1502
+ }, api_params)
1503
+
1504
+ return self._parse_response(response, model=Variable)
1505
+
1506
+
1507
+ def get_variable(
1508
+ self,
1509
+ function_id: str,
1510
+ variable_id: str
1511
+ ) -> Variable:
1512
+ """
1513
+ Get a variable by its unique ID.
1514
+
1515
+ Parameters
1516
+ ----------
1517
+ function_id : str
1518
+ Function unique ID.
1519
+ variable_id : str
1520
+ Variable unique ID.
1521
+
1522
+ Returns
1523
+ -------
1524
+ Variable
1525
+ API response as a typed Pydantic model
1526
+
1527
+ Raises
1528
+ ------
1529
+ AppwriteException
1530
+ If API request fails
1531
+ """
1532
+
1533
+ api_path = '/functions/{functionId}/variables/{variableId}'
1534
+ api_params = {}
1535
+ if function_id is None:
1536
+ raise AppwriteException('Missing required parameter: "function_id"')
1537
+
1538
+ if variable_id is None:
1539
+ raise AppwriteException('Missing required parameter: "variable_id"')
1540
+
1541
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
1542
+ api_path = api_path.replace('{variableId}', str(self._normalize_value(variable_id)))
1543
+
1544
+
1545
+ response = self.client.call('get', api_path, {
1546
+ 'X-Appwrite-Project': self.client.get_config('project'),
1547
+ 'accept': 'application/json',
1548
+ }, api_params)
1549
+
1550
+ return self._parse_response(response, model=Variable)
1551
+
1552
+
1553
+ def update_variable(
1554
+ self,
1555
+ function_id: str,
1556
+ variable_id: str,
1557
+ key: Optional[str] = None,
1558
+ value: Optional[str] = None,
1559
+ secret: Optional[bool] = None
1560
+ ) -> Variable:
1561
+ """
1562
+ Update variable by its unique ID.
1563
+
1564
+ Parameters
1565
+ ----------
1566
+ function_id : str
1567
+ Function unique ID.
1568
+ variable_id : str
1569
+ Variable unique ID.
1570
+ key : Optional[str]
1571
+ Variable key. Max length: 255 chars.
1572
+ value : Optional[str]
1573
+ Variable value. Max length: 8192 chars.
1574
+ secret : Optional[bool]
1575
+ Secret variables can be updated or deleted, but only functions can read them during build and runtime.
1576
+
1577
+ Returns
1578
+ -------
1579
+ Variable
1580
+ API response as a typed Pydantic model
1581
+
1582
+ Raises
1583
+ ------
1584
+ AppwriteException
1585
+ If API request fails
1586
+ """
1587
+
1588
+ api_path = '/functions/{functionId}/variables/{variableId}'
1589
+ api_params = {}
1590
+ if function_id is None:
1591
+ raise AppwriteException('Missing required parameter: "function_id"')
1592
+
1593
+ if variable_id is None:
1594
+ raise AppwriteException('Missing required parameter: "variable_id"')
1595
+
1596
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
1597
+ api_path = api_path.replace('{variableId}', str(self._normalize_value(variable_id)))
1598
+
1599
+ if key is not None:
1600
+ api_params['key'] = self._normalize_value(key)
1601
+ if value is not None:
1602
+ api_params['value'] = self._normalize_value(value)
1603
+ if secret is not None:
1604
+ api_params['secret'] = self._normalize_value(secret)
1605
+
1606
+ response = self.client.call('put', api_path, {
1607
+ 'X-Appwrite-Project': self.client.get_config('project'),
1608
+ 'content-type': 'application/json',
1609
+ 'accept': 'application/json',
1610
+ }, api_params)
1611
+
1612
+ return self._parse_response(response, model=Variable)
1613
+
1614
+
1615
+ def delete_variable(
1616
+ self,
1617
+ function_id: str,
1618
+ variable_id: str
1619
+ ) -> Dict[str, Any]:
1620
+ """
1621
+ Delete a variable by its unique ID.
1622
+
1623
+ Parameters
1624
+ ----------
1625
+ function_id : str
1626
+ Function unique ID.
1627
+ variable_id : str
1628
+ Variable unique ID.
1629
+
1630
+ Returns
1631
+ -------
1632
+ Dict[str, Any]
1633
+ API response as a dictionary
1634
+
1635
+ Raises
1636
+ ------
1637
+ AppwriteException
1638
+ If API request fails
1639
+ """
1640
+
1641
+ api_path = '/functions/{functionId}/variables/{variableId}'
1642
+ api_params = {}
1643
+ if function_id is None:
1644
+ raise AppwriteException('Missing required parameter: "function_id"')
1645
+
1646
+ if variable_id is None:
1647
+ raise AppwriteException('Missing required parameter: "variable_id"')
1648
+
1649
+ api_path = api_path.replace('{functionId}', str(self._normalize_value(function_id)))
1650
+ api_path = api_path.replace('{variableId}', str(self._normalize_value(variable_id)))
1651
+
1652
+
1653
+ response = self.client.call('delete', api_path, {
1654
+ 'X-Appwrite-Project': self.client.get_config('project'),
1655
+ 'content-type': 'application/json',
1656
+ }, api_params)
1657
+
1658
+ return response
1659
+