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,3137 @@
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.message_list import MessageList
7
+ from ..models.message import Message
8
+ from ..enums.message_priority import MessagePriority
9
+ from ..models.target_list import TargetList
10
+ from ..models.provider_list import ProviderList
11
+ from ..models.provider import Provider
12
+ from ..enums.smtp_encryption import SmtpEncryption
13
+ from ..models.topic_list import TopicList
14
+ from ..models.topic import Topic
15
+ from ..models.subscriber_list import SubscriberList
16
+ from ..models.subscriber import Subscriber
17
+
18
+ class Messaging(Service):
19
+
20
+ def __init__(self, client) -> None:
21
+ super(Messaging, self).__init__(client)
22
+
23
+ def list_messages(
24
+ self,
25
+ queries: Optional[List[str]] = None,
26
+ search: Optional[str] = None,
27
+ total: Optional[bool] = None
28
+ ) -> MessageList:
29
+ """
30
+ Get a list of all messages from the current Appwrite project.
31
+
32
+ Parameters
33
+ ----------
34
+ queries : Optional[List[str]]
35
+ 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: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType
36
+ search : Optional[str]
37
+ Search term to filter your list results. Max length: 256 chars.
38
+ total : Optional[bool]
39
+ When set to false, the total count returned will be 0 and will not be calculated.
40
+
41
+ Returns
42
+ -------
43
+ MessageList
44
+ API response as a typed Pydantic model
45
+
46
+ Raises
47
+ ------
48
+ AppwriteException
49
+ If API request fails
50
+ """
51
+
52
+ api_path = '/messaging/messages'
53
+ api_params = {}
54
+
55
+ if queries is not None:
56
+ api_params['queries'] = self._normalize_value(queries)
57
+ if search is not None:
58
+ api_params['search'] = self._normalize_value(search)
59
+ if total is not None:
60
+ api_params['total'] = self._normalize_value(total)
61
+
62
+ response = self.client.call('get', api_path, {
63
+ 'X-Appwrite-Project': self.client.get_config('project'),
64
+ 'accept': 'application/json',
65
+ }, api_params)
66
+
67
+ return self._parse_response(response, model=MessageList)
68
+
69
+
70
+ def create_email(
71
+ self,
72
+ message_id: str,
73
+ subject: str,
74
+ content: str,
75
+ topics: Optional[List[str]] = None,
76
+ users: Optional[List[str]] = None,
77
+ targets: Optional[List[str]] = None,
78
+ cc: Optional[List[str]] = None,
79
+ bcc: Optional[List[str]] = None,
80
+ attachments: Optional[List[str]] = None,
81
+ draft: Optional[bool] = None,
82
+ html: Optional[bool] = None,
83
+ scheduled_at: Optional[str] = None
84
+ ) -> Message:
85
+ """
86
+ Create a new email message.
87
+
88
+ Parameters
89
+ ----------
90
+ message_id : str
91
+ Message 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.
92
+ subject : str
93
+ Email Subject.
94
+ content : str
95
+ Email Content.
96
+ topics : Optional[List[str]]
97
+ List of Topic IDs.
98
+ users : Optional[List[str]]
99
+ List of User IDs.
100
+ targets : Optional[List[str]]
101
+ List of Targets IDs.
102
+ cc : Optional[List[str]]
103
+ Array of target IDs to be added as CC.
104
+ bcc : Optional[List[str]]
105
+ Array of target IDs to be added as BCC.
106
+ attachments : Optional[List[str]]
107
+ Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.
108
+ draft : Optional[bool]
109
+ Is message a draft
110
+ html : Optional[bool]
111
+ Is content of type HTML
112
+ scheduled_at : Optional[str]
113
+ Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
114
+
115
+ Returns
116
+ -------
117
+ Message
118
+ API response as a typed Pydantic model
119
+
120
+ Raises
121
+ ------
122
+ AppwriteException
123
+ If API request fails
124
+ """
125
+
126
+ api_path = '/messaging/messages/email'
127
+ api_params = {}
128
+ if message_id is None:
129
+ raise AppwriteException('Missing required parameter: "message_id"')
130
+
131
+ if subject is None:
132
+ raise AppwriteException('Missing required parameter: "subject"')
133
+
134
+ if content is None:
135
+ raise AppwriteException('Missing required parameter: "content"')
136
+
137
+
138
+ api_params['messageId'] = self._normalize_value(message_id)
139
+ api_params['subject'] = self._normalize_value(subject)
140
+ api_params['content'] = self._normalize_value(content)
141
+ if topics is not None:
142
+ api_params['topics'] = self._normalize_value(topics)
143
+ if users is not None:
144
+ api_params['users'] = self._normalize_value(users)
145
+ if targets is not None:
146
+ api_params['targets'] = self._normalize_value(targets)
147
+ if cc is not None:
148
+ api_params['cc'] = self._normalize_value(cc)
149
+ if bcc is not None:
150
+ api_params['bcc'] = self._normalize_value(bcc)
151
+ if attachments is not None:
152
+ api_params['attachments'] = self._normalize_value(attachments)
153
+ if draft is not None:
154
+ api_params['draft'] = self._normalize_value(draft)
155
+ if html is not None:
156
+ api_params['html'] = self._normalize_value(html)
157
+ if scheduled_at is not None:
158
+ api_params['scheduledAt'] = self._normalize_value(scheduled_at)
159
+
160
+ response = self.client.call('post', api_path, {
161
+ 'X-Appwrite-Project': self.client.get_config('project'),
162
+ 'content-type': 'application/json',
163
+ 'accept': 'application/json',
164
+ }, api_params)
165
+
166
+ return self._parse_response(response, model=Message)
167
+
168
+
169
+ def update_email(
170
+ self,
171
+ message_id: str,
172
+ topics: Optional[List[str]] = None,
173
+ users: Optional[List[str]] = None,
174
+ targets: Optional[List[str]] = None,
175
+ subject: Optional[str] = None,
176
+ content: Optional[str] = None,
177
+ draft: Optional[bool] = None,
178
+ html: Optional[bool] = None,
179
+ cc: Optional[List[str]] = None,
180
+ bcc: Optional[List[str]] = None,
181
+ scheduled_at: Optional[str] = None,
182
+ attachments: Optional[List[str]] = None
183
+ ) -> Message:
184
+ """
185
+ Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
186
+
187
+
188
+ Parameters
189
+ ----------
190
+ message_id : str
191
+ Message ID.
192
+ topics : Optional[List[str]]
193
+ List of Topic IDs.
194
+ users : Optional[List[str]]
195
+ List of User IDs.
196
+ targets : Optional[List[str]]
197
+ List of Targets IDs.
198
+ subject : Optional[str]
199
+ Email Subject.
200
+ content : Optional[str]
201
+ Email Content.
202
+ draft : Optional[bool]
203
+ Is message a draft
204
+ html : Optional[bool]
205
+ Is content of type HTML
206
+ cc : Optional[List[str]]
207
+ Array of target IDs to be added as CC.
208
+ bcc : Optional[List[str]]
209
+ Array of target IDs to be added as BCC.
210
+ scheduled_at : Optional[str]
211
+ Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
212
+ attachments : Optional[List[str]]
213
+ Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.
214
+
215
+ Returns
216
+ -------
217
+ Message
218
+ API response as a typed Pydantic model
219
+
220
+ Raises
221
+ ------
222
+ AppwriteException
223
+ If API request fails
224
+ """
225
+
226
+ api_path = '/messaging/messages/email/{messageId}'
227
+ api_params = {}
228
+ if message_id is None:
229
+ raise AppwriteException('Missing required parameter: "message_id"')
230
+
231
+ api_path = api_path.replace('{messageId}', str(self._normalize_value(message_id)))
232
+
233
+ if topics is not None:
234
+ api_params['topics'] = self._normalize_value(topics)
235
+ if users is not None:
236
+ api_params['users'] = self._normalize_value(users)
237
+ if targets is not None:
238
+ api_params['targets'] = self._normalize_value(targets)
239
+ if subject is not None:
240
+ api_params['subject'] = self._normalize_value(subject)
241
+ if content is not None:
242
+ api_params['content'] = self._normalize_value(content)
243
+ if draft is not None:
244
+ api_params['draft'] = self._normalize_value(draft)
245
+ if html is not None:
246
+ api_params['html'] = self._normalize_value(html)
247
+ if cc is not None:
248
+ api_params['cc'] = self._normalize_value(cc)
249
+ if bcc is not None:
250
+ api_params['bcc'] = self._normalize_value(bcc)
251
+ if scheduled_at is not None:
252
+ api_params['scheduledAt'] = self._normalize_value(scheduled_at)
253
+ if attachments is not None:
254
+ api_params['attachments'] = self._normalize_value(attachments)
255
+
256
+ response = self.client.call('patch', api_path, {
257
+ 'X-Appwrite-Project': self.client.get_config('project'),
258
+ 'content-type': 'application/json',
259
+ 'accept': 'application/json',
260
+ }, api_params)
261
+
262
+ return self._parse_response(response, model=Message)
263
+
264
+
265
+ def create_push(
266
+ self,
267
+ message_id: str,
268
+ title: Optional[str] = None,
269
+ body: Optional[str] = None,
270
+ topics: Optional[List[str]] = None,
271
+ users: Optional[List[str]] = None,
272
+ targets: Optional[List[str]] = None,
273
+ data: Optional[Dict[str, Any]] = None,
274
+ action: Optional[str] = None,
275
+ image: Optional[str] = None,
276
+ icon: Optional[str] = None,
277
+ sound: Optional[str] = None,
278
+ color: Optional[str] = None,
279
+ tag: Optional[str] = None,
280
+ badge: Optional[float] = None,
281
+ draft: Optional[bool] = None,
282
+ scheduled_at: Optional[str] = None,
283
+ content_available: Optional[bool] = None,
284
+ critical: Optional[bool] = None,
285
+ priority: Optional[MessagePriority] = None
286
+ ) -> Message:
287
+ """
288
+ Create a new push notification.
289
+
290
+ Parameters
291
+ ----------
292
+ message_id : str
293
+ Message 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.
294
+ title : Optional[str]
295
+ Title for push notification.
296
+ body : Optional[str]
297
+ Body for push notification.
298
+ topics : Optional[List[str]]
299
+ List of Topic IDs.
300
+ users : Optional[List[str]]
301
+ List of User IDs.
302
+ targets : Optional[List[str]]
303
+ List of Targets IDs.
304
+ data : Optional[Dict[str, Any]]
305
+ Additional key-value pair data for push notification.
306
+ action : Optional[str]
307
+ Action for push notification.
308
+ image : Optional[str]
309
+ Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.
310
+ icon : Optional[str]
311
+ Icon for push notification. Available only for Android and Web Platform.
312
+ sound : Optional[str]
313
+ Sound for push notification. Available only for Android and iOS Platform.
314
+ color : Optional[str]
315
+ Color for push notification. Available only for Android Platform.
316
+ tag : Optional[str]
317
+ Tag for push notification. Available only for Android Platform.
318
+ badge : Optional[float]
319
+ Badge for push notification. Available only for iOS Platform.
320
+ draft : Optional[bool]
321
+ Is message a draft
322
+ scheduled_at : Optional[str]
323
+ Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
324
+ content_available : Optional[bool]
325
+ If set to true, the notification will be delivered in the background. Available only for iOS Platform.
326
+ critical : Optional[bool]
327
+ If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.
328
+ priority : Optional[MessagePriority]
329
+ Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification.
330
+
331
+ Returns
332
+ -------
333
+ Message
334
+ API response as a typed Pydantic model
335
+
336
+ Raises
337
+ ------
338
+ AppwriteException
339
+ If API request fails
340
+ """
341
+
342
+ api_path = '/messaging/messages/push'
343
+ api_params = {}
344
+ if message_id is None:
345
+ raise AppwriteException('Missing required parameter: "message_id"')
346
+
347
+
348
+ api_params['messageId'] = self._normalize_value(message_id)
349
+ if title is not None:
350
+ api_params['title'] = self._normalize_value(title)
351
+ if body is not None:
352
+ api_params['body'] = self._normalize_value(body)
353
+ if topics is not None:
354
+ api_params['topics'] = self._normalize_value(topics)
355
+ if users is not None:
356
+ api_params['users'] = self._normalize_value(users)
357
+ if targets is not None:
358
+ api_params['targets'] = self._normalize_value(targets)
359
+ if data is not None:
360
+ api_params['data'] = self._normalize_value(data)
361
+ if action is not None:
362
+ api_params['action'] = self._normalize_value(action)
363
+ if image is not None:
364
+ api_params['image'] = self._normalize_value(image)
365
+ if icon is not None:
366
+ api_params['icon'] = self._normalize_value(icon)
367
+ if sound is not None:
368
+ api_params['sound'] = self._normalize_value(sound)
369
+ if color is not None:
370
+ api_params['color'] = self._normalize_value(color)
371
+ if tag is not None:
372
+ api_params['tag'] = self._normalize_value(tag)
373
+ if badge is not None:
374
+ api_params['badge'] = self._normalize_value(badge)
375
+ if draft is not None:
376
+ api_params['draft'] = self._normalize_value(draft)
377
+ if scheduled_at is not None:
378
+ api_params['scheduledAt'] = self._normalize_value(scheduled_at)
379
+ if content_available is not None:
380
+ api_params['contentAvailable'] = self._normalize_value(content_available)
381
+ if critical is not None:
382
+ api_params['critical'] = self._normalize_value(critical)
383
+ if priority is not None:
384
+ api_params['priority'] = self._normalize_value(priority)
385
+
386
+ response = self.client.call('post', api_path, {
387
+ 'X-Appwrite-Project': self.client.get_config('project'),
388
+ 'content-type': 'application/json',
389
+ 'accept': 'application/json',
390
+ }, api_params)
391
+
392
+ return self._parse_response(response, model=Message)
393
+
394
+
395
+ def update_push(
396
+ self,
397
+ message_id: str,
398
+ topics: Optional[List[str]] = None,
399
+ users: Optional[List[str]] = None,
400
+ targets: Optional[List[str]] = None,
401
+ title: Optional[str] = None,
402
+ body: Optional[str] = None,
403
+ data: Optional[Dict[str, Any]] = None,
404
+ action: Optional[str] = None,
405
+ image: Optional[str] = None,
406
+ icon: Optional[str] = None,
407
+ sound: Optional[str] = None,
408
+ color: Optional[str] = None,
409
+ tag: Optional[str] = None,
410
+ badge: Optional[float] = None,
411
+ draft: Optional[bool] = None,
412
+ scheduled_at: Optional[str] = None,
413
+ content_available: Optional[bool] = None,
414
+ critical: Optional[bool] = None,
415
+ priority: Optional[MessagePriority] = None
416
+ ) -> Message:
417
+ """
418
+ Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
419
+
420
+
421
+ Parameters
422
+ ----------
423
+ message_id : str
424
+ Message ID.
425
+ topics : Optional[List[str]]
426
+ List of Topic IDs.
427
+ users : Optional[List[str]]
428
+ List of User IDs.
429
+ targets : Optional[List[str]]
430
+ List of Targets IDs.
431
+ title : Optional[str]
432
+ Title for push notification.
433
+ body : Optional[str]
434
+ Body for push notification.
435
+ data : Optional[Dict[str, Any]]
436
+ Additional Data for push notification.
437
+ action : Optional[str]
438
+ Action for push notification.
439
+ image : Optional[str]
440
+ Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.
441
+ icon : Optional[str]
442
+ Icon for push notification. Available only for Android and Web platforms.
443
+ sound : Optional[str]
444
+ Sound for push notification. Available only for Android and iOS platforms.
445
+ color : Optional[str]
446
+ Color for push notification. Available only for Android platforms.
447
+ tag : Optional[str]
448
+ Tag for push notification. Available only for Android platforms.
449
+ badge : Optional[float]
450
+ Badge for push notification. Available only for iOS platforms.
451
+ draft : Optional[bool]
452
+ Is message a draft
453
+ scheduled_at : Optional[str]
454
+ Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
455
+ content_available : Optional[bool]
456
+ If set to true, the notification will be delivered in the background. Available only for iOS Platform.
457
+ critical : Optional[bool]
458
+ If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.
459
+ priority : Optional[MessagePriority]
460
+ Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification.
461
+
462
+ Returns
463
+ -------
464
+ Message
465
+ API response as a typed Pydantic model
466
+
467
+ Raises
468
+ ------
469
+ AppwriteException
470
+ If API request fails
471
+ """
472
+
473
+ api_path = '/messaging/messages/push/{messageId}'
474
+ api_params = {}
475
+ if message_id is None:
476
+ raise AppwriteException('Missing required parameter: "message_id"')
477
+
478
+ api_path = api_path.replace('{messageId}', str(self._normalize_value(message_id)))
479
+
480
+ if topics is not None:
481
+ api_params['topics'] = self._normalize_value(topics)
482
+ if users is not None:
483
+ api_params['users'] = self._normalize_value(users)
484
+ if targets is not None:
485
+ api_params['targets'] = self._normalize_value(targets)
486
+ if title is not None:
487
+ api_params['title'] = self._normalize_value(title)
488
+ if body is not None:
489
+ api_params['body'] = self._normalize_value(body)
490
+ if data is not None:
491
+ api_params['data'] = self._normalize_value(data)
492
+ if action is not None:
493
+ api_params['action'] = self._normalize_value(action)
494
+ if image is not None:
495
+ api_params['image'] = self._normalize_value(image)
496
+ if icon is not None:
497
+ api_params['icon'] = self._normalize_value(icon)
498
+ if sound is not None:
499
+ api_params['sound'] = self._normalize_value(sound)
500
+ if color is not None:
501
+ api_params['color'] = self._normalize_value(color)
502
+ if tag is not None:
503
+ api_params['tag'] = self._normalize_value(tag)
504
+ if badge is not None:
505
+ api_params['badge'] = self._normalize_value(badge)
506
+ if draft is not None:
507
+ api_params['draft'] = self._normalize_value(draft)
508
+ if scheduled_at is not None:
509
+ api_params['scheduledAt'] = self._normalize_value(scheduled_at)
510
+ if content_available is not None:
511
+ api_params['contentAvailable'] = self._normalize_value(content_available)
512
+ if critical is not None:
513
+ api_params['critical'] = self._normalize_value(critical)
514
+ if priority is not None:
515
+ api_params['priority'] = self._normalize_value(priority)
516
+
517
+ response = self.client.call('patch', api_path, {
518
+ 'X-Appwrite-Project': self.client.get_config('project'),
519
+ 'content-type': 'application/json',
520
+ 'accept': 'application/json',
521
+ }, api_params)
522
+
523
+ return self._parse_response(response, model=Message)
524
+
525
+
526
+ def create_sms(
527
+ self,
528
+ message_id: str,
529
+ content: str,
530
+ topics: Optional[List[str]] = None,
531
+ users: Optional[List[str]] = None,
532
+ targets: Optional[List[str]] = None,
533
+ draft: Optional[bool] = None,
534
+ scheduled_at: Optional[str] = None
535
+ ) -> Message:
536
+ """
537
+ Create a new SMS message.
538
+
539
+ Parameters
540
+ ----------
541
+ message_id : str
542
+ Message 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.
543
+ content : str
544
+ SMS Content.
545
+ topics : Optional[List[str]]
546
+ List of Topic IDs.
547
+ users : Optional[List[str]]
548
+ List of User IDs.
549
+ targets : Optional[List[str]]
550
+ List of Targets IDs.
551
+ draft : Optional[bool]
552
+ Is message a draft
553
+ scheduled_at : Optional[str]
554
+ Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
555
+
556
+ Returns
557
+ -------
558
+ Message
559
+ API response as a typed Pydantic model
560
+
561
+ Raises
562
+ ------
563
+ AppwriteException
564
+ If API request fails
565
+ """
566
+
567
+ api_path = '/messaging/messages/sms'
568
+ api_params = {}
569
+ if message_id is None:
570
+ raise AppwriteException('Missing required parameter: "message_id"')
571
+
572
+ if content is None:
573
+ raise AppwriteException('Missing required parameter: "content"')
574
+
575
+
576
+ api_params['messageId'] = self._normalize_value(message_id)
577
+ api_params['content'] = self._normalize_value(content)
578
+ if topics is not None:
579
+ api_params['topics'] = self._normalize_value(topics)
580
+ if users is not None:
581
+ api_params['users'] = self._normalize_value(users)
582
+ if targets is not None:
583
+ api_params['targets'] = self._normalize_value(targets)
584
+ if draft is not None:
585
+ api_params['draft'] = self._normalize_value(draft)
586
+ if scheduled_at is not None:
587
+ api_params['scheduledAt'] = self._normalize_value(scheduled_at)
588
+
589
+ response = self.client.call('post', api_path, {
590
+ 'X-Appwrite-Project': self.client.get_config('project'),
591
+ 'content-type': 'application/json',
592
+ 'accept': 'application/json',
593
+ }, api_params)
594
+
595
+ return self._parse_response(response, model=Message)
596
+
597
+
598
+ def update_sms(
599
+ self,
600
+ message_id: str,
601
+ topics: Optional[List[str]] = None,
602
+ users: Optional[List[str]] = None,
603
+ targets: Optional[List[str]] = None,
604
+ content: Optional[str] = None,
605
+ draft: Optional[bool] = None,
606
+ scheduled_at: Optional[str] = None
607
+ ) -> Message:
608
+ """
609
+ Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
610
+
611
+
612
+ Parameters
613
+ ----------
614
+ message_id : str
615
+ Message ID.
616
+ topics : Optional[List[str]]
617
+ List of Topic IDs.
618
+ users : Optional[List[str]]
619
+ List of User IDs.
620
+ targets : Optional[List[str]]
621
+ List of Targets IDs.
622
+ content : Optional[str]
623
+ Email Content.
624
+ draft : Optional[bool]
625
+ Is message a draft
626
+ scheduled_at : Optional[str]
627
+ Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
628
+
629
+ Returns
630
+ -------
631
+ Message
632
+ API response as a typed Pydantic model
633
+
634
+ Raises
635
+ ------
636
+ AppwriteException
637
+ If API request fails
638
+ """
639
+
640
+ api_path = '/messaging/messages/sms/{messageId}'
641
+ api_params = {}
642
+ if message_id is None:
643
+ raise AppwriteException('Missing required parameter: "message_id"')
644
+
645
+ api_path = api_path.replace('{messageId}', str(self._normalize_value(message_id)))
646
+
647
+ if topics is not None:
648
+ api_params['topics'] = self._normalize_value(topics)
649
+ if users is not None:
650
+ api_params['users'] = self._normalize_value(users)
651
+ if targets is not None:
652
+ api_params['targets'] = self._normalize_value(targets)
653
+ if content is not None:
654
+ api_params['content'] = self._normalize_value(content)
655
+ if draft is not None:
656
+ api_params['draft'] = self._normalize_value(draft)
657
+ if scheduled_at is not None:
658
+ api_params['scheduledAt'] = self._normalize_value(scheduled_at)
659
+
660
+ response = self.client.call('patch', api_path, {
661
+ 'X-Appwrite-Project': self.client.get_config('project'),
662
+ 'content-type': 'application/json',
663
+ 'accept': 'application/json',
664
+ }, api_params)
665
+
666
+ return self._parse_response(response, model=Message)
667
+
668
+
669
+ def get_message(
670
+ self,
671
+ message_id: str
672
+ ) -> Message:
673
+ """
674
+ Get a message by its unique ID.
675
+
676
+
677
+ Parameters
678
+ ----------
679
+ message_id : str
680
+ Message ID.
681
+
682
+ Returns
683
+ -------
684
+ Message
685
+ API response as a typed Pydantic model
686
+
687
+ Raises
688
+ ------
689
+ AppwriteException
690
+ If API request fails
691
+ """
692
+
693
+ api_path = '/messaging/messages/{messageId}'
694
+ api_params = {}
695
+ if message_id is None:
696
+ raise AppwriteException('Missing required parameter: "message_id"')
697
+
698
+ api_path = api_path.replace('{messageId}', str(self._normalize_value(message_id)))
699
+
700
+
701
+ response = self.client.call('get', api_path, {
702
+ 'X-Appwrite-Project': self.client.get_config('project'),
703
+ 'accept': 'application/json',
704
+ }, api_params)
705
+
706
+ return self._parse_response(response, model=Message)
707
+
708
+
709
+ def delete(
710
+ self,
711
+ message_id: str
712
+ ) -> Dict[str, Any]:
713
+ """
714
+ Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.
715
+
716
+ Parameters
717
+ ----------
718
+ message_id : str
719
+ Message ID.
720
+
721
+ Returns
722
+ -------
723
+ Dict[str, Any]
724
+ API response as a dictionary
725
+
726
+ Raises
727
+ ------
728
+ AppwriteException
729
+ If API request fails
730
+ """
731
+
732
+ api_path = '/messaging/messages/{messageId}'
733
+ api_params = {}
734
+ if message_id is None:
735
+ raise AppwriteException('Missing required parameter: "message_id"')
736
+
737
+ api_path = api_path.replace('{messageId}', str(self._normalize_value(message_id)))
738
+
739
+
740
+ response = self.client.call('delete', api_path, {
741
+ 'X-Appwrite-Project': self.client.get_config('project'),
742
+ 'content-type': 'application/json',
743
+ }, api_params)
744
+
745
+ return response
746
+
747
+
748
+ def list_targets(
749
+ self,
750
+ message_id: str,
751
+ queries: Optional[List[str]] = None,
752
+ total: Optional[bool] = None
753
+ ) -> TargetList:
754
+ """
755
+ Get a list of the targets associated with a message.
756
+
757
+ Parameters
758
+ ----------
759
+ message_id : str
760
+ Message ID.
761
+ queries : Optional[List[str]]
762
+ 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: userId, providerId, identifier, providerType
763
+ total : Optional[bool]
764
+ When set to false, the total count returned will be 0 and will not be calculated.
765
+
766
+ Returns
767
+ -------
768
+ TargetList
769
+ API response as a typed Pydantic model
770
+
771
+ Raises
772
+ ------
773
+ AppwriteException
774
+ If API request fails
775
+ """
776
+
777
+ api_path = '/messaging/messages/{messageId}/targets'
778
+ api_params = {}
779
+ if message_id is None:
780
+ raise AppwriteException('Missing required parameter: "message_id"')
781
+
782
+ api_path = api_path.replace('{messageId}', str(self._normalize_value(message_id)))
783
+
784
+ if queries is not None:
785
+ api_params['queries'] = self._normalize_value(queries)
786
+ if total is not None:
787
+ api_params['total'] = self._normalize_value(total)
788
+
789
+ response = self.client.call('get', api_path, {
790
+ 'X-Appwrite-Project': self.client.get_config('project'),
791
+ 'accept': 'application/json',
792
+ }, api_params)
793
+
794
+ return self._parse_response(response, model=TargetList)
795
+
796
+
797
+ def list_providers(
798
+ self,
799
+ queries: Optional[List[str]] = None,
800
+ search: Optional[str] = None,
801
+ total: Optional[bool] = None
802
+ ) -> ProviderList:
803
+ """
804
+ Get a list of all providers from the current Appwrite project.
805
+
806
+ Parameters
807
+ ----------
808
+ queries : Optional[List[str]]
809
+ 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, provider, type, enabled
810
+ search : Optional[str]
811
+ Search term to filter your list results. Max length: 256 chars.
812
+ total : Optional[bool]
813
+ When set to false, the total count returned will be 0 and will not be calculated.
814
+
815
+ Returns
816
+ -------
817
+ ProviderList
818
+ API response as a typed Pydantic model
819
+
820
+ Raises
821
+ ------
822
+ AppwriteException
823
+ If API request fails
824
+ """
825
+
826
+ api_path = '/messaging/providers'
827
+ api_params = {}
828
+
829
+ if queries is not None:
830
+ api_params['queries'] = self._normalize_value(queries)
831
+ if search is not None:
832
+ api_params['search'] = self._normalize_value(search)
833
+ if total is not None:
834
+ api_params['total'] = self._normalize_value(total)
835
+
836
+ response = self.client.call('get', api_path, {
837
+ 'X-Appwrite-Project': self.client.get_config('project'),
838
+ 'accept': 'application/json',
839
+ }, api_params)
840
+
841
+ return self._parse_response(response, model=ProviderList)
842
+
843
+
844
+ def create_apns_provider(
845
+ self,
846
+ provider_id: str,
847
+ name: str,
848
+ auth_key: Optional[str] = None,
849
+ auth_key_id: Optional[str] = None,
850
+ team_id: Optional[str] = None,
851
+ bundle_id: Optional[str] = None,
852
+ sandbox: Optional[bool] = None,
853
+ enabled: Optional[bool] = None
854
+ ) -> Provider:
855
+ """
856
+ Create a new Apple Push Notification service provider.
857
+
858
+ Parameters
859
+ ----------
860
+ provider_id : str
861
+ Provider 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.
862
+ name : str
863
+ Provider name.
864
+ auth_key : Optional[str]
865
+ APNS authentication key.
866
+ auth_key_id : Optional[str]
867
+ APNS authentication key ID.
868
+ team_id : Optional[str]
869
+ APNS team ID.
870
+ bundle_id : Optional[str]
871
+ APNS bundle ID.
872
+ sandbox : Optional[bool]
873
+ Use APNS sandbox environment.
874
+ enabled : Optional[bool]
875
+ Set as enabled.
876
+
877
+ Returns
878
+ -------
879
+ Provider
880
+ API response as a typed Pydantic model
881
+
882
+ Raises
883
+ ------
884
+ AppwriteException
885
+ If API request fails
886
+ """
887
+
888
+ api_path = '/messaging/providers/apns'
889
+ api_params = {}
890
+ if provider_id is None:
891
+ raise AppwriteException('Missing required parameter: "provider_id"')
892
+
893
+ if name is None:
894
+ raise AppwriteException('Missing required parameter: "name"')
895
+
896
+
897
+ api_params['providerId'] = self._normalize_value(provider_id)
898
+ api_params['name'] = self._normalize_value(name)
899
+ if auth_key is not None:
900
+ api_params['authKey'] = self._normalize_value(auth_key)
901
+ if auth_key_id is not None:
902
+ api_params['authKeyId'] = self._normalize_value(auth_key_id)
903
+ if team_id is not None:
904
+ api_params['teamId'] = self._normalize_value(team_id)
905
+ if bundle_id is not None:
906
+ api_params['bundleId'] = self._normalize_value(bundle_id)
907
+ if sandbox is not None:
908
+ api_params['sandbox'] = self._normalize_value(sandbox)
909
+ if enabled is not None:
910
+ api_params['enabled'] = self._normalize_value(enabled)
911
+
912
+ response = self.client.call('post', api_path, {
913
+ 'X-Appwrite-Project': self.client.get_config('project'),
914
+ 'content-type': 'application/json',
915
+ 'accept': 'application/json',
916
+ }, api_params)
917
+
918
+ return self._parse_response(response, model=Provider)
919
+
920
+
921
+ def update_apns_provider(
922
+ self,
923
+ provider_id: str,
924
+ name: Optional[str] = None,
925
+ enabled: Optional[bool] = None,
926
+ auth_key: Optional[str] = None,
927
+ auth_key_id: Optional[str] = None,
928
+ team_id: Optional[str] = None,
929
+ bundle_id: Optional[str] = None,
930
+ sandbox: Optional[bool] = None
931
+ ) -> Provider:
932
+ """
933
+ Update a Apple Push Notification service provider by its unique ID.
934
+
935
+ Parameters
936
+ ----------
937
+ provider_id : str
938
+ Provider ID.
939
+ name : Optional[str]
940
+ Provider name.
941
+ enabled : Optional[bool]
942
+ Set as enabled.
943
+ auth_key : Optional[str]
944
+ APNS authentication key.
945
+ auth_key_id : Optional[str]
946
+ APNS authentication key ID.
947
+ team_id : Optional[str]
948
+ APNS team ID.
949
+ bundle_id : Optional[str]
950
+ APNS bundle ID.
951
+ sandbox : Optional[bool]
952
+ Use APNS sandbox environment.
953
+
954
+ Returns
955
+ -------
956
+ Provider
957
+ API response as a typed Pydantic model
958
+
959
+ Raises
960
+ ------
961
+ AppwriteException
962
+ If API request fails
963
+ """
964
+
965
+ api_path = '/messaging/providers/apns/{providerId}'
966
+ api_params = {}
967
+ if provider_id is None:
968
+ raise AppwriteException('Missing required parameter: "provider_id"')
969
+
970
+ api_path = api_path.replace('{providerId}', str(self._normalize_value(provider_id)))
971
+
972
+ if name is not None:
973
+ api_params['name'] = self._normalize_value(name)
974
+ if enabled is not None:
975
+ api_params['enabled'] = self._normalize_value(enabled)
976
+ if auth_key is not None:
977
+ api_params['authKey'] = self._normalize_value(auth_key)
978
+ if auth_key_id is not None:
979
+ api_params['authKeyId'] = self._normalize_value(auth_key_id)
980
+ if team_id is not None:
981
+ api_params['teamId'] = self._normalize_value(team_id)
982
+ if bundle_id is not None:
983
+ api_params['bundleId'] = self._normalize_value(bundle_id)
984
+ if sandbox is not None:
985
+ api_params['sandbox'] = self._normalize_value(sandbox)
986
+
987
+ response = self.client.call('patch', api_path, {
988
+ 'X-Appwrite-Project': self.client.get_config('project'),
989
+ 'content-type': 'application/json',
990
+ 'accept': 'application/json',
991
+ }, api_params)
992
+
993
+ return self._parse_response(response, model=Provider)
994
+
995
+
996
+ def create_fcm_provider(
997
+ self,
998
+ provider_id: str,
999
+ name: str,
1000
+ service_account_json: Optional[Dict[str, Any]] = None,
1001
+ enabled: Optional[bool] = None
1002
+ ) -> Provider:
1003
+ """
1004
+ Create a new Firebase Cloud Messaging provider.
1005
+
1006
+ Parameters
1007
+ ----------
1008
+ provider_id : str
1009
+ Provider 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.
1010
+ name : str
1011
+ Provider name.
1012
+ service_account_json : Optional[Dict[str, Any]]
1013
+ FCM service account JSON.
1014
+ enabled : Optional[bool]
1015
+ Set as enabled.
1016
+
1017
+ Returns
1018
+ -------
1019
+ Provider
1020
+ API response as a typed Pydantic model
1021
+
1022
+ Raises
1023
+ ------
1024
+ AppwriteException
1025
+ If API request fails
1026
+ """
1027
+
1028
+ api_path = '/messaging/providers/fcm'
1029
+ api_params = {}
1030
+ if provider_id is None:
1031
+ raise AppwriteException('Missing required parameter: "provider_id"')
1032
+
1033
+ if name is None:
1034
+ raise AppwriteException('Missing required parameter: "name"')
1035
+
1036
+
1037
+ api_params['providerId'] = self._normalize_value(provider_id)
1038
+ api_params['name'] = self._normalize_value(name)
1039
+ if service_account_json is not None:
1040
+ api_params['serviceAccountJSON'] = self._normalize_value(service_account_json)
1041
+ if enabled is not None:
1042
+ api_params['enabled'] = self._normalize_value(enabled)
1043
+
1044
+ response = self.client.call('post', api_path, {
1045
+ 'X-Appwrite-Project': self.client.get_config('project'),
1046
+ 'content-type': 'application/json',
1047
+ 'accept': 'application/json',
1048
+ }, api_params)
1049
+
1050
+ return self._parse_response(response, model=Provider)
1051
+
1052
+
1053
+ def update_fcm_provider(
1054
+ self,
1055
+ provider_id: str,
1056
+ name: Optional[str] = None,
1057
+ enabled: Optional[bool] = None,
1058
+ service_account_json: Optional[Dict[str, Any]] = None
1059
+ ) -> Provider:
1060
+ """
1061
+ Update a Firebase Cloud Messaging provider by its unique ID.
1062
+
1063
+ Parameters
1064
+ ----------
1065
+ provider_id : str
1066
+ Provider ID.
1067
+ name : Optional[str]
1068
+ Provider name.
1069
+ enabled : Optional[bool]
1070
+ Set as enabled.
1071
+ service_account_json : Optional[Dict[str, Any]]
1072
+ FCM service account JSON.
1073
+
1074
+ Returns
1075
+ -------
1076
+ Provider
1077
+ API response as a typed Pydantic model
1078
+
1079
+ Raises
1080
+ ------
1081
+ AppwriteException
1082
+ If API request fails
1083
+ """
1084
+
1085
+ api_path = '/messaging/providers/fcm/{providerId}'
1086
+ api_params = {}
1087
+ if provider_id is None:
1088
+ raise AppwriteException('Missing required parameter: "provider_id"')
1089
+
1090
+ api_path = api_path.replace('{providerId}', str(self._normalize_value(provider_id)))
1091
+
1092
+ if name is not None:
1093
+ api_params['name'] = self._normalize_value(name)
1094
+ if enabled is not None:
1095
+ api_params['enabled'] = self._normalize_value(enabled)
1096
+ if service_account_json is not None:
1097
+ api_params['serviceAccountJSON'] = self._normalize_value(service_account_json)
1098
+
1099
+ response = self.client.call('patch', api_path, {
1100
+ 'X-Appwrite-Project': self.client.get_config('project'),
1101
+ 'content-type': 'application/json',
1102
+ 'accept': 'application/json',
1103
+ }, api_params)
1104
+
1105
+ return self._parse_response(response, model=Provider)
1106
+
1107
+
1108
+ def create_mailgun_provider(
1109
+ self,
1110
+ provider_id: str,
1111
+ name: str,
1112
+ api_key: Optional[str] = None,
1113
+ domain: Optional[str] = None,
1114
+ is_eu_region: Optional[bool] = None,
1115
+ from_name: Optional[str] = None,
1116
+ from_email: Optional[str] = None,
1117
+ reply_to_name: Optional[str] = None,
1118
+ reply_to_email: Optional[str] = None,
1119
+ enabled: Optional[bool] = None
1120
+ ) -> Provider:
1121
+ """
1122
+ Create a new Mailgun provider.
1123
+
1124
+ Parameters
1125
+ ----------
1126
+ provider_id : str
1127
+ Provider 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.
1128
+ name : str
1129
+ Provider name.
1130
+ api_key : Optional[str]
1131
+ Mailgun API Key.
1132
+ domain : Optional[str]
1133
+ Mailgun Domain.
1134
+ is_eu_region : Optional[bool]
1135
+ Set as EU region.
1136
+ from_name : Optional[str]
1137
+ Sender Name.
1138
+ from_email : Optional[str]
1139
+ Sender email address.
1140
+ reply_to_name : Optional[str]
1141
+ Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well.
1142
+ reply_to_email : Optional[str]
1143
+ Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.
1144
+ enabled : Optional[bool]
1145
+ Set as enabled.
1146
+
1147
+ Returns
1148
+ -------
1149
+ Provider
1150
+ API response as a typed Pydantic model
1151
+
1152
+ Raises
1153
+ ------
1154
+ AppwriteException
1155
+ If API request fails
1156
+ """
1157
+
1158
+ api_path = '/messaging/providers/mailgun'
1159
+ api_params = {}
1160
+ if provider_id is None:
1161
+ raise AppwriteException('Missing required parameter: "provider_id"')
1162
+
1163
+ if name is None:
1164
+ raise AppwriteException('Missing required parameter: "name"')
1165
+
1166
+
1167
+ api_params['providerId'] = self._normalize_value(provider_id)
1168
+ api_params['name'] = self._normalize_value(name)
1169
+ if api_key is not None:
1170
+ api_params['apiKey'] = self._normalize_value(api_key)
1171
+ if domain is not None:
1172
+ api_params['domain'] = self._normalize_value(domain)
1173
+ if is_eu_region is not None:
1174
+ api_params['isEuRegion'] = self._normalize_value(is_eu_region)
1175
+ if from_name is not None:
1176
+ api_params['fromName'] = self._normalize_value(from_name)
1177
+ if from_email is not None:
1178
+ api_params['fromEmail'] = self._normalize_value(from_email)
1179
+ if reply_to_name is not None:
1180
+ api_params['replyToName'] = self._normalize_value(reply_to_name)
1181
+ if reply_to_email is not None:
1182
+ api_params['replyToEmail'] = self._normalize_value(reply_to_email)
1183
+ if enabled is not None:
1184
+ api_params['enabled'] = self._normalize_value(enabled)
1185
+
1186
+ response = self.client.call('post', api_path, {
1187
+ 'X-Appwrite-Project': self.client.get_config('project'),
1188
+ 'content-type': 'application/json',
1189
+ 'accept': 'application/json',
1190
+ }, api_params)
1191
+
1192
+ return self._parse_response(response, model=Provider)
1193
+
1194
+
1195
+ def update_mailgun_provider(
1196
+ self,
1197
+ provider_id: str,
1198
+ name: Optional[str] = None,
1199
+ api_key: Optional[str] = None,
1200
+ domain: Optional[str] = None,
1201
+ is_eu_region: Optional[bool] = None,
1202
+ enabled: Optional[bool] = None,
1203
+ from_name: Optional[str] = None,
1204
+ from_email: Optional[str] = None,
1205
+ reply_to_name: Optional[str] = None,
1206
+ reply_to_email: Optional[str] = None
1207
+ ) -> Provider:
1208
+ """
1209
+ Update a Mailgun provider by its unique ID.
1210
+
1211
+ Parameters
1212
+ ----------
1213
+ provider_id : str
1214
+ Provider ID.
1215
+ name : Optional[str]
1216
+ Provider name.
1217
+ api_key : Optional[str]
1218
+ Mailgun API Key.
1219
+ domain : Optional[str]
1220
+ Mailgun Domain.
1221
+ is_eu_region : Optional[bool]
1222
+ Set as EU region.
1223
+ enabled : Optional[bool]
1224
+ Set as enabled.
1225
+ from_name : Optional[str]
1226
+ Sender Name.
1227
+ from_email : Optional[str]
1228
+ Sender email address.
1229
+ reply_to_name : Optional[str]
1230
+ Name set in the reply to field for the mail. Default value is sender name.
1231
+ reply_to_email : Optional[str]
1232
+ Email set in the reply to field for the mail. Default value is sender email.
1233
+
1234
+ Returns
1235
+ -------
1236
+ Provider
1237
+ API response as a typed Pydantic model
1238
+
1239
+ Raises
1240
+ ------
1241
+ AppwriteException
1242
+ If API request fails
1243
+ """
1244
+
1245
+ api_path = '/messaging/providers/mailgun/{providerId}'
1246
+ api_params = {}
1247
+ if provider_id is None:
1248
+ raise AppwriteException('Missing required parameter: "provider_id"')
1249
+
1250
+ api_path = api_path.replace('{providerId}', str(self._normalize_value(provider_id)))
1251
+
1252
+ if name is not None:
1253
+ api_params['name'] = self._normalize_value(name)
1254
+ if api_key is not None:
1255
+ api_params['apiKey'] = self._normalize_value(api_key)
1256
+ if domain is not None:
1257
+ api_params['domain'] = self._normalize_value(domain)
1258
+ if is_eu_region is not None:
1259
+ api_params['isEuRegion'] = self._normalize_value(is_eu_region)
1260
+ if enabled is not None:
1261
+ api_params['enabled'] = self._normalize_value(enabled)
1262
+ if from_name is not None:
1263
+ api_params['fromName'] = self._normalize_value(from_name)
1264
+ if from_email is not None:
1265
+ api_params['fromEmail'] = self._normalize_value(from_email)
1266
+ if reply_to_name is not None:
1267
+ api_params['replyToName'] = self._normalize_value(reply_to_name)
1268
+ if reply_to_email is not None:
1269
+ api_params['replyToEmail'] = self._normalize_value(reply_to_email)
1270
+
1271
+ response = self.client.call('patch', api_path, {
1272
+ 'X-Appwrite-Project': self.client.get_config('project'),
1273
+ 'content-type': 'application/json',
1274
+ 'accept': 'application/json',
1275
+ }, api_params)
1276
+
1277
+ return self._parse_response(response, model=Provider)
1278
+
1279
+
1280
+ def create_msg91_provider(
1281
+ self,
1282
+ provider_id: str,
1283
+ name: str,
1284
+ template_id: Optional[str] = None,
1285
+ sender_id: Optional[str] = None,
1286
+ auth_key: Optional[str] = None,
1287
+ enabled: Optional[bool] = None
1288
+ ) -> Provider:
1289
+ """
1290
+ Create a new MSG91 provider.
1291
+
1292
+ Parameters
1293
+ ----------
1294
+ provider_id : str
1295
+ Provider 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.
1296
+ name : str
1297
+ Provider name.
1298
+ template_id : Optional[str]
1299
+ Msg91 template ID
1300
+ sender_id : Optional[str]
1301
+ Msg91 sender ID.
1302
+ auth_key : Optional[str]
1303
+ Msg91 auth key.
1304
+ enabled : Optional[bool]
1305
+ Set as enabled.
1306
+
1307
+ Returns
1308
+ -------
1309
+ Provider
1310
+ API response as a typed Pydantic model
1311
+
1312
+ Raises
1313
+ ------
1314
+ AppwriteException
1315
+ If API request fails
1316
+ """
1317
+
1318
+ api_path = '/messaging/providers/msg91'
1319
+ api_params = {}
1320
+ if provider_id is None:
1321
+ raise AppwriteException('Missing required parameter: "provider_id"')
1322
+
1323
+ if name is None:
1324
+ raise AppwriteException('Missing required parameter: "name"')
1325
+
1326
+
1327
+ api_params['providerId'] = self._normalize_value(provider_id)
1328
+ api_params['name'] = self._normalize_value(name)
1329
+ if template_id is not None:
1330
+ api_params['templateId'] = self._normalize_value(template_id)
1331
+ if sender_id is not None:
1332
+ api_params['senderId'] = self._normalize_value(sender_id)
1333
+ if auth_key is not None:
1334
+ api_params['authKey'] = self._normalize_value(auth_key)
1335
+ if enabled is not None:
1336
+ api_params['enabled'] = self._normalize_value(enabled)
1337
+
1338
+ response = self.client.call('post', api_path, {
1339
+ 'X-Appwrite-Project': self.client.get_config('project'),
1340
+ 'content-type': 'application/json',
1341
+ 'accept': 'application/json',
1342
+ }, api_params)
1343
+
1344
+ return self._parse_response(response, model=Provider)
1345
+
1346
+
1347
+ def update_msg91_provider(
1348
+ self,
1349
+ provider_id: str,
1350
+ name: Optional[str] = None,
1351
+ enabled: Optional[bool] = None,
1352
+ template_id: Optional[str] = None,
1353
+ sender_id: Optional[str] = None,
1354
+ auth_key: Optional[str] = None
1355
+ ) -> Provider:
1356
+ """
1357
+ Update a MSG91 provider by its unique ID.
1358
+
1359
+ Parameters
1360
+ ----------
1361
+ provider_id : str
1362
+ Provider ID.
1363
+ name : Optional[str]
1364
+ Provider name.
1365
+ enabled : Optional[bool]
1366
+ Set as enabled.
1367
+ template_id : Optional[str]
1368
+ Msg91 template ID.
1369
+ sender_id : Optional[str]
1370
+ Msg91 sender ID.
1371
+ auth_key : Optional[str]
1372
+ Msg91 auth key.
1373
+
1374
+ Returns
1375
+ -------
1376
+ Provider
1377
+ API response as a typed Pydantic model
1378
+
1379
+ Raises
1380
+ ------
1381
+ AppwriteException
1382
+ If API request fails
1383
+ """
1384
+
1385
+ api_path = '/messaging/providers/msg91/{providerId}'
1386
+ api_params = {}
1387
+ if provider_id is None:
1388
+ raise AppwriteException('Missing required parameter: "provider_id"')
1389
+
1390
+ api_path = api_path.replace('{providerId}', str(self._normalize_value(provider_id)))
1391
+
1392
+ if name is not None:
1393
+ api_params['name'] = self._normalize_value(name)
1394
+ if enabled is not None:
1395
+ api_params['enabled'] = self._normalize_value(enabled)
1396
+ if template_id is not None:
1397
+ api_params['templateId'] = self._normalize_value(template_id)
1398
+ if sender_id is not None:
1399
+ api_params['senderId'] = self._normalize_value(sender_id)
1400
+ if auth_key is not None:
1401
+ api_params['authKey'] = self._normalize_value(auth_key)
1402
+
1403
+ response = self.client.call('patch', api_path, {
1404
+ 'X-Appwrite-Project': self.client.get_config('project'),
1405
+ 'content-type': 'application/json',
1406
+ 'accept': 'application/json',
1407
+ }, api_params)
1408
+
1409
+ return self._parse_response(response, model=Provider)
1410
+
1411
+
1412
+ def create_resend_provider(
1413
+ self,
1414
+ provider_id: str,
1415
+ name: str,
1416
+ api_key: Optional[str] = None,
1417
+ from_name: Optional[str] = None,
1418
+ from_email: Optional[str] = None,
1419
+ reply_to_name: Optional[str] = None,
1420
+ reply_to_email: Optional[str] = None,
1421
+ enabled: Optional[bool] = None
1422
+ ) -> Provider:
1423
+ """
1424
+ Create a new Resend provider.
1425
+
1426
+ Parameters
1427
+ ----------
1428
+ provider_id : str
1429
+ Provider 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.
1430
+ name : str
1431
+ Provider name.
1432
+ api_key : Optional[str]
1433
+ Resend API key.
1434
+ from_name : Optional[str]
1435
+ Sender Name.
1436
+ from_email : Optional[str]
1437
+ Sender email address.
1438
+ reply_to_name : Optional[str]
1439
+ Name set in the reply to field for the mail. Default value is sender name.
1440
+ reply_to_email : Optional[str]
1441
+ Email set in the reply to field for the mail. Default value is sender email.
1442
+ enabled : Optional[bool]
1443
+ Set as enabled.
1444
+
1445
+ Returns
1446
+ -------
1447
+ Provider
1448
+ API response as a typed Pydantic model
1449
+
1450
+ Raises
1451
+ ------
1452
+ AppwriteException
1453
+ If API request fails
1454
+ """
1455
+
1456
+ api_path = '/messaging/providers/resend'
1457
+ api_params = {}
1458
+ if provider_id is None:
1459
+ raise AppwriteException('Missing required parameter: "provider_id"')
1460
+
1461
+ if name is None:
1462
+ raise AppwriteException('Missing required parameter: "name"')
1463
+
1464
+
1465
+ api_params['providerId'] = self._normalize_value(provider_id)
1466
+ api_params['name'] = self._normalize_value(name)
1467
+ if api_key is not None:
1468
+ api_params['apiKey'] = self._normalize_value(api_key)
1469
+ if from_name is not None:
1470
+ api_params['fromName'] = self._normalize_value(from_name)
1471
+ if from_email is not None:
1472
+ api_params['fromEmail'] = self._normalize_value(from_email)
1473
+ if reply_to_name is not None:
1474
+ api_params['replyToName'] = self._normalize_value(reply_to_name)
1475
+ if reply_to_email is not None:
1476
+ api_params['replyToEmail'] = self._normalize_value(reply_to_email)
1477
+ if enabled is not None:
1478
+ api_params['enabled'] = self._normalize_value(enabled)
1479
+
1480
+ response = self.client.call('post', api_path, {
1481
+ 'X-Appwrite-Project': self.client.get_config('project'),
1482
+ 'content-type': 'application/json',
1483
+ 'accept': 'application/json',
1484
+ }, api_params)
1485
+
1486
+ return self._parse_response(response, model=Provider)
1487
+
1488
+
1489
+ def update_resend_provider(
1490
+ self,
1491
+ provider_id: str,
1492
+ name: Optional[str] = None,
1493
+ enabled: Optional[bool] = None,
1494
+ api_key: Optional[str] = None,
1495
+ from_name: Optional[str] = None,
1496
+ from_email: Optional[str] = None,
1497
+ reply_to_name: Optional[str] = None,
1498
+ reply_to_email: Optional[str] = None
1499
+ ) -> Provider:
1500
+ """
1501
+ Update a Resend provider by its unique ID.
1502
+
1503
+ Parameters
1504
+ ----------
1505
+ provider_id : str
1506
+ Provider ID.
1507
+ name : Optional[str]
1508
+ Provider name.
1509
+ enabled : Optional[bool]
1510
+ Set as enabled.
1511
+ api_key : Optional[str]
1512
+ Resend API key.
1513
+ from_name : Optional[str]
1514
+ Sender Name.
1515
+ from_email : Optional[str]
1516
+ Sender email address.
1517
+ reply_to_name : Optional[str]
1518
+ Name set in the Reply To field for the mail. Default value is Sender Name.
1519
+ reply_to_email : Optional[str]
1520
+ Email set in the Reply To field for the mail. Default value is Sender Email.
1521
+
1522
+ Returns
1523
+ -------
1524
+ Provider
1525
+ API response as a typed Pydantic model
1526
+
1527
+ Raises
1528
+ ------
1529
+ AppwriteException
1530
+ If API request fails
1531
+ """
1532
+
1533
+ api_path = '/messaging/providers/resend/{providerId}'
1534
+ api_params = {}
1535
+ if provider_id is None:
1536
+ raise AppwriteException('Missing required parameter: "provider_id"')
1537
+
1538
+ api_path = api_path.replace('{providerId}', str(self._normalize_value(provider_id)))
1539
+
1540
+ if name is not None:
1541
+ api_params['name'] = self._normalize_value(name)
1542
+ if enabled is not None:
1543
+ api_params['enabled'] = self._normalize_value(enabled)
1544
+ if api_key is not None:
1545
+ api_params['apiKey'] = self._normalize_value(api_key)
1546
+ if from_name is not None:
1547
+ api_params['fromName'] = self._normalize_value(from_name)
1548
+ if from_email is not None:
1549
+ api_params['fromEmail'] = self._normalize_value(from_email)
1550
+ if reply_to_name is not None:
1551
+ api_params['replyToName'] = self._normalize_value(reply_to_name)
1552
+ if reply_to_email is not None:
1553
+ api_params['replyToEmail'] = self._normalize_value(reply_to_email)
1554
+
1555
+ response = self.client.call('patch', api_path, {
1556
+ 'X-Appwrite-Project': self.client.get_config('project'),
1557
+ 'content-type': 'application/json',
1558
+ 'accept': 'application/json',
1559
+ }, api_params)
1560
+
1561
+ return self._parse_response(response, model=Provider)
1562
+
1563
+
1564
+ def create_sendgrid_provider(
1565
+ self,
1566
+ provider_id: str,
1567
+ name: str,
1568
+ api_key: Optional[str] = None,
1569
+ from_name: Optional[str] = None,
1570
+ from_email: Optional[str] = None,
1571
+ reply_to_name: Optional[str] = None,
1572
+ reply_to_email: Optional[str] = None,
1573
+ enabled: Optional[bool] = None
1574
+ ) -> Provider:
1575
+ """
1576
+ Create a new Sendgrid provider.
1577
+
1578
+ Parameters
1579
+ ----------
1580
+ provider_id : str
1581
+ Provider 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.
1582
+ name : str
1583
+ Provider name.
1584
+ api_key : Optional[str]
1585
+ Sendgrid API key.
1586
+ from_name : Optional[str]
1587
+ Sender Name.
1588
+ from_email : Optional[str]
1589
+ Sender email address.
1590
+ reply_to_name : Optional[str]
1591
+ Name set in the reply to field for the mail. Default value is sender name.
1592
+ reply_to_email : Optional[str]
1593
+ Email set in the reply to field for the mail. Default value is sender email.
1594
+ enabled : Optional[bool]
1595
+ Set as enabled.
1596
+
1597
+ Returns
1598
+ -------
1599
+ Provider
1600
+ API response as a typed Pydantic model
1601
+
1602
+ Raises
1603
+ ------
1604
+ AppwriteException
1605
+ If API request fails
1606
+ """
1607
+
1608
+ api_path = '/messaging/providers/sendgrid'
1609
+ api_params = {}
1610
+ if provider_id is None:
1611
+ raise AppwriteException('Missing required parameter: "provider_id"')
1612
+
1613
+ if name is None:
1614
+ raise AppwriteException('Missing required parameter: "name"')
1615
+
1616
+
1617
+ api_params['providerId'] = self._normalize_value(provider_id)
1618
+ api_params['name'] = self._normalize_value(name)
1619
+ if api_key is not None:
1620
+ api_params['apiKey'] = self._normalize_value(api_key)
1621
+ if from_name is not None:
1622
+ api_params['fromName'] = self._normalize_value(from_name)
1623
+ if from_email is not None:
1624
+ api_params['fromEmail'] = self._normalize_value(from_email)
1625
+ if reply_to_name is not None:
1626
+ api_params['replyToName'] = self._normalize_value(reply_to_name)
1627
+ if reply_to_email is not None:
1628
+ api_params['replyToEmail'] = self._normalize_value(reply_to_email)
1629
+ if enabled is not None:
1630
+ api_params['enabled'] = self._normalize_value(enabled)
1631
+
1632
+ response = self.client.call('post', api_path, {
1633
+ 'X-Appwrite-Project': self.client.get_config('project'),
1634
+ 'content-type': 'application/json',
1635
+ 'accept': 'application/json',
1636
+ }, api_params)
1637
+
1638
+ return self._parse_response(response, model=Provider)
1639
+
1640
+
1641
+ def update_sendgrid_provider(
1642
+ self,
1643
+ provider_id: str,
1644
+ name: Optional[str] = None,
1645
+ enabled: Optional[bool] = None,
1646
+ api_key: Optional[str] = None,
1647
+ from_name: Optional[str] = None,
1648
+ from_email: Optional[str] = None,
1649
+ reply_to_name: Optional[str] = None,
1650
+ reply_to_email: Optional[str] = None
1651
+ ) -> Provider:
1652
+ """
1653
+ Update a Sendgrid provider by its unique ID.
1654
+
1655
+ Parameters
1656
+ ----------
1657
+ provider_id : str
1658
+ Provider ID.
1659
+ name : Optional[str]
1660
+ Provider name.
1661
+ enabled : Optional[bool]
1662
+ Set as enabled.
1663
+ api_key : Optional[str]
1664
+ Sendgrid API key.
1665
+ from_name : Optional[str]
1666
+ Sender Name.
1667
+ from_email : Optional[str]
1668
+ Sender email address.
1669
+ reply_to_name : Optional[str]
1670
+ Name set in the Reply To field for the mail. Default value is Sender Name.
1671
+ reply_to_email : Optional[str]
1672
+ Email set in the Reply To field for the mail. Default value is Sender Email.
1673
+
1674
+ Returns
1675
+ -------
1676
+ Provider
1677
+ API response as a typed Pydantic model
1678
+
1679
+ Raises
1680
+ ------
1681
+ AppwriteException
1682
+ If API request fails
1683
+ """
1684
+
1685
+ api_path = '/messaging/providers/sendgrid/{providerId}'
1686
+ api_params = {}
1687
+ if provider_id is None:
1688
+ raise AppwriteException('Missing required parameter: "provider_id"')
1689
+
1690
+ api_path = api_path.replace('{providerId}', str(self._normalize_value(provider_id)))
1691
+
1692
+ if name is not None:
1693
+ api_params['name'] = self._normalize_value(name)
1694
+ if enabled is not None:
1695
+ api_params['enabled'] = self._normalize_value(enabled)
1696
+ if api_key is not None:
1697
+ api_params['apiKey'] = self._normalize_value(api_key)
1698
+ if from_name is not None:
1699
+ api_params['fromName'] = self._normalize_value(from_name)
1700
+ if from_email is not None:
1701
+ api_params['fromEmail'] = self._normalize_value(from_email)
1702
+ if reply_to_name is not None:
1703
+ api_params['replyToName'] = self._normalize_value(reply_to_name)
1704
+ if reply_to_email is not None:
1705
+ api_params['replyToEmail'] = self._normalize_value(reply_to_email)
1706
+
1707
+ response = self.client.call('patch', api_path, {
1708
+ 'X-Appwrite-Project': self.client.get_config('project'),
1709
+ 'content-type': 'application/json',
1710
+ 'accept': 'application/json',
1711
+ }, api_params)
1712
+
1713
+ return self._parse_response(response, model=Provider)
1714
+
1715
+
1716
+ def create_ses_provider(
1717
+ self,
1718
+ provider_id: str,
1719
+ name: str,
1720
+ access_key: Optional[str] = None,
1721
+ secret_key: Optional[str] = None,
1722
+ region: Optional[str] = None,
1723
+ from_name: Optional[str] = None,
1724
+ from_email: Optional[str] = None,
1725
+ reply_to_name: Optional[str] = None,
1726
+ reply_to_email: Optional[str] = None,
1727
+ enabled: Optional[bool] = None
1728
+ ) -> Provider:
1729
+ """
1730
+ Create a new Amazon SES provider.
1731
+
1732
+ Parameters
1733
+ ----------
1734
+ provider_id : str
1735
+ Provider 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.
1736
+ name : str
1737
+ Provider name.
1738
+ access_key : Optional[str]
1739
+ AWS access key ID.
1740
+ secret_key : Optional[str]
1741
+ AWS secret access key.
1742
+ region : Optional[str]
1743
+ AWS region, for example us-east-1.
1744
+ from_name : Optional[str]
1745
+ Sender Name.
1746
+ from_email : Optional[str]
1747
+ Sender email address.
1748
+ reply_to_name : Optional[str]
1749
+ Name set in the reply to field for the mail. Default value is sender name.
1750
+ reply_to_email : Optional[str]
1751
+ Email set in the reply to field for the mail. Default value is sender email.
1752
+ enabled : Optional[bool]
1753
+ Set as enabled.
1754
+
1755
+ Returns
1756
+ -------
1757
+ Provider
1758
+ API response as a typed Pydantic model
1759
+
1760
+ Raises
1761
+ ------
1762
+ AppwriteException
1763
+ If API request fails
1764
+ """
1765
+
1766
+ api_path = '/messaging/providers/ses'
1767
+ api_params = {}
1768
+ if provider_id is None:
1769
+ raise AppwriteException('Missing required parameter: "provider_id"')
1770
+
1771
+ if name is None:
1772
+ raise AppwriteException('Missing required parameter: "name"')
1773
+
1774
+
1775
+ api_params['providerId'] = self._normalize_value(provider_id)
1776
+ api_params['name'] = self._normalize_value(name)
1777
+ if access_key is not None:
1778
+ api_params['accessKey'] = self._normalize_value(access_key)
1779
+ if secret_key is not None:
1780
+ api_params['secretKey'] = self._normalize_value(secret_key)
1781
+ if region is not None:
1782
+ api_params['region'] = self._normalize_value(region)
1783
+ if from_name is not None:
1784
+ api_params['fromName'] = self._normalize_value(from_name)
1785
+ if from_email is not None:
1786
+ api_params['fromEmail'] = self._normalize_value(from_email)
1787
+ if reply_to_name is not None:
1788
+ api_params['replyToName'] = self._normalize_value(reply_to_name)
1789
+ if reply_to_email is not None:
1790
+ api_params['replyToEmail'] = self._normalize_value(reply_to_email)
1791
+ if enabled is not None:
1792
+ api_params['enabled'] = self._normalize_value(enabled)
1793
+
1794
+ response = self.client.call('post', api_path, {
1795
+ 'X-Appwrite-Project': self.client.get_config('project'),
1796
+ 'content-type': 'application/json',
1797
+ 'accept': 'application/json',
1798
+ }, api_params)
1799
+
1800
+ return self._parse_response(response, model=Provider)
1801
+
1802
+
1803
+ def update_ses_provider(
1804
+ self,
1805
+ provider_id: str,
1806
+ name: Optional[str] = None,
1807
+ enabled: Optional[bool] = None,
1808
+ access_key: Optional[str] = None,
1809
+ secret_key: Optional[str] = None,
1810
+ region: Optional[str] = None,
1811
+ from_name: Optional[str] = None,
1812
+ from_email: Optional[str] = None,
1813
+ reply_to_name: Optional[str] = None,
1814
+ reply_to_email: Optional[str] = None
1815
+ ) -> Provider:
1816
+ """
1817
+ Update an Amazon SES provider by its unique ID.
1818
+
1819
+ Parameters
1820
+ ----------
1821
+ provider_id : str
1822
+ Provider ID.
1823
+ name : Optional[str]
1824
+ Provider name.
1825
+ enabled : Optional[bool]
1826
+ Set as enabled.
1827
+ access_key : Optional[str]
1828
+ AWS access key ID.
1829
+ secret_key : Optional[str]
1830
+ AWS secret access key.
1831
+ region : Optional[str]
1832
+ AWS region, for example us-east-1.
1833
+ from_name : Optional[str]
1834
+ Sender Name.
1835
+ from_email : Optional[str]
1836
+ Sender email address.
1837
+ reply_to_name : Optional[str]
1838
+ Name set in the Reply To field for the mail. Default value is Sender Name.
1839
+ reply_to_email : Optional[str]
1840
+ Email set in the Reply To field for the mail. Default value is Sender Email.
1841
+
1842
+ Returns
1843
+ -------
1844
+ Provider
1845
+ API response as a typed Pydantic model
1846
+
1847
+ Raises
1848
+ ------
1849
+ AppwriteException
1850
+ If API request fails
1851
+ """
1852
+
1853
+ api_path = '/messaging/providers/ses/{providerId}'
1854
+ api_params = {}
1855
+ if provider_id is None:
1856
+ raise AppwriteException('Missing required parameter: "provider_id"')
1857
+
1858
+ api_path = api_path.replace('{providerId}', str(self._normalize_value(provider_id)))
1859
+
1860
+ if name is not None:
1861
+ api_params['name'] = self._normalize_value(name)
1862
+ if enabled is not None:
1863
+ api_params['enabled'] = self._normalize_value(enabled)
1864
+ if access_key is not None:
1865
+ api_params['accessKey'] = self._normalize_value(access_key)
1866
+ if secret_key is not None:
1867
+ api_params['secretKey'] = self._normalize_value(secret_key)
1868
+ if region is not None:
1869
+ api_params['region'] = self._normalize_value(region)
1870
+ if from_name is not None:
1871
+ api_params['fromName'] = self._normalize_value(from_name)
1872
+ if from_email is not None:
1873
+ api_params['fromEmail'] = self._normalize_value(from_email)
1874
+ if reply_to_name is not None:
1875
+ api_params['replyToName'] = self._normalize_value(reply_to_name)
1876
+ if reply_to_email is not None:
1877
+ api_params['replyToEmail'] = self._normalize_value(reply_to_email)
1878
+
1879
+ response = self.client.call('patch', api_path, {
1880
+ 'X-Appwrite-Project': self.client.get_config('project'),
1881
+ 'content-type': 'application/json',
1882
+ 'accept': 'application/json',
1883
+ }, api_params)
1884
+
1885
+ return self._parse_response(response, model=Provider)
1886
+
1887
+
1888
+ def create_smtp_provider(
1889
+ self,
1890
+ provider_id: str,
1891
+ name: str,
1892
+ host: str,
1893
+ port: Optional[float] = None,
1894
+ username: Optional[str] = None,
1895
+ password: Optional[str] = None,
1896
+ encryption: Optional[SmtpEncryption] = None,
1897
+ auto_tls: Optional[bool] = None,
1898
+ mailer: Optional[str] = None,
1899
+ from_name: Optional[str] = None,
1900
+ from_email: Optional[str] = None,
1901
+ reply_to_name: Optional[str] = None,
1902
+ reply_to_email: Optional[str] = None,
1903
+ enabled: Optional[bool] = None
1904
+ ) -> Provider:
1905
+ """
1906
+ Create a new SMTP provider.
1907
+
1908
+ Parameters
1909
+ ----------
1910
+ provider_id : str
1911
+ Provider 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.
1912
+ name : str
1913
+ Provider name.
1914
+ host : str
1915
+ SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order.
1916
+ port : Optional[float]
1917
+ The default SMTP server port.
1918
+ username : Optional[str]
1919
+ Authentication username.
1920
+ password : Optional[str]
1921
+ Authentication password.
1922
+ encryption : Optional[SmtpEncryption]
1923
+ Encryption type. Can be omitted, 'ssl', or 'tls'
1924
+ auto_tls : Optional[bool]
1925
+ Enable SMTP AutoTLS feature.
1926
+ mailer : Optional[str]
1927
+ The value to use for the X-Mailer header.
1928
+ from_name : Optional[str]
1929
+ Sender Name.
1930
+ from_email : Optional[str]
1931
+ Sender email address.
1932
+ reply_to_name : Optional[str]
1933
+ Name set in the reply to field for the mail. Default value is sender name.
1934
+ reply_to_email : Optional[str]
1935
+ Email set in the reply to field for the mail. Default value is sender email.
1936
+ enabled : Optional[bool]
1937
+ Set as enabled.
1938
+
1939
+ Returns
1940
+ -------
1941
+ Provider
1942
+ API response as a typed Pydantic model
1943
+
1944
+ Raises
1945
+ ------
1946
+ AppwriteException
1947
+ If API request fails
1948
+ """
1949
+
1950
+ api_path = '/messaging/providers/smtp'
1951
+ api_params = {}
1952
+ if provider_id is None:
1953
+ raise AppwriteException('Missing required parameter: "provider_id"')
1954
+
1955
+ if name is None:
1956
+ raise AppwriteException('Missing required parameter: "name"')
1957
+
1958
+ if host is None:
1959
+ raise AppwriteException('Missing required parameter: "host"')
1960
+
1961
+
1962
+ api_params['providerId'] = self._normalize_value(provider_id)
1963
+ api_params['name'] = self._normalize_value(name)
1964
+ api_params['host'] = self._normalize_value(host)
1965
+ if port is not None:
1966
+ api_params['port'] = self._normalize_value(port)
1967
+ if username is not None:
1968
+ api_params['username'] = self._normalize_value(username)
1969
+ if password is not None:
1970
+ api_params['password'] = self._normalize_value(password)
1971
+ if encryption is not None:
1972
+ api_params['encryption'] = self._normalize_value(encryption)
1973
+ if auto_tls is not None:
1974
+ api_params['autoTLS'] = self._normalize_value(auto_tls)
1975
+ if mailer is not None:
1976
+ api_params['mailer'] = self._normalize_value(mailer)
1977
+ if from_name is not None:
1978
+ api_params['fromName'] = self._normalize_value(from_name)
1979
+ if from_email is not None:
1980
+ api_params['fromEmail'] = self._normalize_value(from_email)
1981
+ if reply_to_name is not None:
1982
+ api_params['replyToName'] = self._normalize_value(reply_to_name)
1983
+ if reply_to_email is not None:
1984
+ api_params['replyToEmail'] = self._normalize_value(reply_to_email)
1985
+ if enabled is not None:
1986
+ api_params['enabled'] = self._normalize_value(enabled)
1987
+
1988
+ response = self.client.call('post', api_path, {
1989
+ 'X-Appwrite-Project': self.client.get_config('project'),
1990
+ 'content-type': 'application/json',
1991
+ 'accept': 'application/json',
1992
+ }, api_params)
1993
+
1994
+ return self._parse_response(response, model=Provider)
1995
+
1996
+
1997
+ def update_smtp_provider(
1998
+ self,
1999
+ provider_id: str,
2000
+ name: Optional[str] = None,
2001
+ host: Optional[str] = None,
2002
+ port: Optional[float] = None,
2003
+ username: Optional[str] = None,
2004
+ password: Optional[str] = None,
2005
+ encryption: Optional[SmtpEncryption] = None,
2006
+ auto_tls: Optional[bool] = None,
2007
+ mailer: Optional[str] = None,
2008
+ from_name: Optional[str] = None,
2009
+ from_email: Optional[str] = None,
2010
+ reply_to_name: Optional[str] = None,
2011
+ reply_to_email: Optional[str] = None,
2012
+ enabled: Optional[bool] = None
2013
+ ) -> Provider:
2014
+ """
2015
+ Update a SMTP provider by its unique ID.
2016
+
2017
+ Parameters
2018
+ ----------
2019
+ provider_id : str
2020
+ Provider ID.
2021
+ name : Optional[str]
2022
+ Provider name.
2023
+ host : Optional[str]
2024
+ SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order.
2025
+ port : Optional[float]
2026
+ SMTP port.
2027
+ username : Optional[str]
2028
+ Authentication username.
2029
+ password : Optional[str]
2030
+ Authentication password.
2031
+ encryption : Optional[SmtpEncryption]
2032
+ Encryption type. Can be 'ssl' or 'tls'
2033
+ auto_tls : Optional[bool]
2034
+ Enable SMTP AutoTLS feature.
2035
+ mailer : Optional[str]
2036
+ The value to use for the X-Mailer header.
2037
+ from_name : Optional[str]
2038
+ Sender Name.
2039
+ from_email : Optional[str]
2040
+ Sender email address.
2041
+ reply_to_name : Optional[str]
2042
+ Name set in the Reply To field for the mail. Default value is Sender Name.
2043
+ reply_to_email : Optional[str]
2044
+ Email set in the Reply To field for the mail. Default value is Sender Email.
2045
+ enabled : Optional[bool]
2046
+ Set as enabled.
2047
+
2048
+ Returns
2049
+ -------
2050
+ Provider
2051
+ API response as a typed Pydantic model
2052
+
2053
+ Raises
2054
+ ------
2055
+ AppwriteException
2056
+ If API request fails
2057
+ """
2058
+
2059
+ api_path = '/messaging/providers/smtp/{providerId}'
2060
+ api_params = {}
2061
+ if provider_id is None:
2062
+ raise AppwriteException('Missing required parameter: "provider_id"')
2063
+
2064
+ api_path = api_path.replace('{providerId}', str(self._normalize_value(provider_id)))
2065
+
2066
+ if name is not None:
2067
+ api_params['name'] = self._normalize_value(name)
2068
+ if host is not None:
2069
+ api_params['host'] = self._normalize_value(host)
2070
+ if port is not None:
2071
+ api_params['port'] = self._normalize_value(port)
2072
+ if username is not None:
2073
+ api_params['username'] = self._normalize_value(username)
2074
+ if password is not None:
2075
+ api_params['password'] = self._normalize_value(password)
2076
+ if encryption is not None:
2077
+ api_params['encryption'] = self._normalize_value(encryption)
2078
+ if auto_tls is not None:
2079
+ api_params['autoTLS'] = self._normalize_value(auto_tls)
2080
+ if mailer is not None:
2081
+ api_params['mailer'] = self._normalize_value(mailer)
2082
+ if from_name is not None:
2083
+ api_params['fromName'] = self._normalize_value(from_name)
2084
+ if from_email is not None:
2085
+ api_params['fromEmail'] = self._normalize_value(from_email)
2086
+ if reply_to_name is not None:
2087
+ api_params['replyToName'] = self._normalize_value(reply_to_name)
2088
+ if reply_to_email is not None:
2089
+ api_params['replyToEmail'] = self._normalize_value(reply_to_email)
2090
+ if enabled is not None:
2091
+ api_params['enabled'] = self._normalize_value(enabled)
2092
+
2093
+ response = self.client.call('patch', api_path, {
2094
+ 'X-Appwrite-Project': self.client.get_config('project'),
2095
+ 'content-type': 'application/json',
2096
+ 'accept': 'application/json',
2097
+ }, api_params)
2098
+
2099
+ return self._parse_response(response, model=Provider)
2100
+
2101
+
2102
+ def create_telesign_provider(
2103
+ self,
2104
+ provider_id: str,
2105
+ name: str,
2106
+ xfrom: Optional[str] = None,
2107
+ customer_id: Optional[str] = None,
2108
+ api_key: Optional[str] = None,
2109
+ enabled: Optional[bool] = None
2110
+ ) -> Provider:
2111
+ """
2112
+ Create a new Telesign provider.
2113
+
2114
+ Parameters
2115
+ ----------
2116
+ provider_id : str
2117
+ Provider 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.
2118
+ name : str
2119
+ Provider name.
2120
+ xfrom : Optional[str]
2121
+ Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
2122
+ customer_id : Optional[str]
2123
+ Telesign customer ID.
2124
+ api_key : Optional[str]
2125
+ Telesign API key.
2126
+ enabled : Optional[bool]
2127
+ Set as enabled.
2128
+
2129
+ Returns
2130
+ -------
2131
+ Provider
2132
+ API response as a typed Pydantic model
2133
+
2134
+ Raises
2135
+ ------
2136
+ AppwriteException
2137
+ If API request fails
2138
+ """
2139
+
2140
+ api_path = '/messaging/providers/telesign'
2141
+ api_params = {}
2142
+ if provider_id is None:
2143
+ raise AppwriteException('Missing required parameter: "provider_id"')
2144
+
2145
+ if name is None:
2146
+ raise AppwriteException('Missing required parameter: "name"')
2147
+
2148
+
2149
+ api_params['providerId'] = self._normalize_value(provider_id)
2150
+ api_params['name'] = self._normalize_value(name)
2151
+ if xfrom is not None:
2152
+ api_params['from'] = self._normalize_value(xfrom)
2153
+ if customer_id is not None:
2154
+ api_params['customerId'] = self._normalize_value(customer_id)
2155
+ if api_key is not None:
2156
+ api_params['apiKey'] = self._normalize_value(api_key)
2157
+ if enabled is not None:
2158
+ api_params['enabled'] = self._normalize_value(enabled)
2159
+
2160
+ response = self.client.call('post', api_path, {
2161
+ 'X-Appwrite-Project': self.client.get_config('project'),
2162
+ 'content-type': 'application/json',
2163
+ 'accept': 'application/json',
2164
+ }, api_params)
2165
+
2166
+ return self._parse_response(response, model=Provider)
2167
+
2168
+
2169
+ def update_telesign_provider(
2170
+ self,
2171
+ provider_id: str,
2172
+ name: Optional[str] = None,
2173
+ enabled: Optional[bool] = None,
2174
+ customer_id: Optional[str] = None,
2175
+ api_key: Optional[str] = None,
2176
+ xfrom: Optional[str] = None
2177
+ ) -> Provider:
2178
+ """
2179
+ Update a Telesign provider by its unique ID.
2180
+
2181
+ Parameters
2182
+ ----------
2183
+ provider_id : str
2184
+ Provider ID.
2185
+ name : Optional[str]
2186
+ Provider name.
2187
+ enabled : Optional[bool]
2188
+ Set as enabled.
2189
+ customer_id : Optional[str]
2190
+ Telesign customer ID.
2191
+ api_key : Optional[str]
2192
+ Telesign API key.
2193
+ xfrom : Optional[str]
2194
+ Sender number.
2195
+
2196
+ Returns
2197
+ -------
2198
+ Provider
2199
+ API response as a typed Pydantic model
2200
+
2201
+ Raises
2202
+ ------
2203
+ AppwriteException
2204
+ If API request fails
2205
+ """
2206
+
2207
+ api_path = '/messaging/providers/telesign/{providerId}'
2208
+ api_params = {}
2209
+ if provider_id is None:
2210
+ raise AppwriteException('Missing required parameter: "provider_id"')
2211
+
2212
+ api_path = api_path.replace('{providerId}', str(self._normalize_value(provider_id)))
2213
+
2214
+ if name is not None:
2215
+ api_params['name'] = self._normalize_value(name)
2216
+ if enabled is not None:
2217
+ api_params['enabled'] = self._normalize_value(enabled)
2218
+ if customer_id is not None:
2219
+ api_params['customerId'] = self._normalize_value(customer_id)
2220
+ if api_key is not None:
2221
+ api_params['apiKey'] = self._normalize_value(api_key)
2222
+ if xfrom is not None:
2223
+ api_params['from'] = self._normalize_value(xfrom)
2224
+
2225
+ response = self.client.call('patch', api_path, {
2226
+ 'X-Appwrite-Project': self.client.get_config('project'),
2227
+ 'content-type': 'application/json',
2228
+ 'accept': 'application/json',
2229
+ }, api_params)
2230
+
2231
+ return self._parse_response(response, model=Provider)
2232
+
2233
+
2234
+ def create_textmagic_provider(
2235
+ self,
2236
+ provider_id: str,
2237
+ name: str,
2238
+ xfrom: Optional[str] = None,
2239
+ username: Optional[str] = None,
2240
+ api_key: Optional[str] = None,
2241
+ enabled: Optional[bool] = None
2242
+ ) -> Provider:
2243
+ """
2244
+ Create a new Textmagic provider.
2245
+
2246
+ Parameters
2247
+ ----------
2248
+ provider_id : str
2249
+ Provider 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.
2250
+ name : str
2251
+ Provider name.
2252
+ xfrom : Optional[str]
2253
+ Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
2254
+ username : Optional[str]
2255
+ Textmagic username.
2256
+ api_key : Optional[str]
2257
+ Textmagic apiKey.
2258
+ enabled : Optional[bool]
2259
+ Set as enabled.
2260
+
2261
+ Returns
2262
+ -------
2263
+ Provider
2264
+ API response as a typed Pydantic model
2265
+
2266
+ Raises
2267
+ ------
2268
+ AppwriteException
2269
+ If API request fails
2270
+ """
2271
+
2272
+ api_path = '/messaging/providers/textmagic'
2273
+ api_params = {}
2274
+ if provider_id is None:
2275
+ raise AppwriteException('Missing required parameter: "provider_id"')
2276
+
2277
+ if name is None:
2278
+ raise AppwriteException('Missing required parameter: "name"')
2279
+
2280
+
2281
+ api_params['providerId'] = self._normalize_value(provider_id)
2282
+ api_params['name'] = self._normalize_value(name)
2283
+ if xfrom is not None:
2284
+ api_params['from'] = self._normalize_value(xfrom)
2285
+ if username is not None:
2286
+ api_params['username'] = self._normalize_value(username)
2287
+ if api_key is not None:
2288
+ api_params['apiKey'] = self._normalize_value(api_key)
2289
+ if enabled is not None:
2290
+ api_params['enabled'] = self._normalize_value(enabled)
2291
+
2292
+ response = self.client.call('post', api_path, {
2293
+ 'X-Appwrite-Project': self.client.get_config('project'),
2294
+ 'content-type': 'application/json',
2295
+ 'accept': 'application/json',
2296
+ }, api_params)
2297
+
2298
+ return self._parse_response(response, model=Provider)
2299
+
2300
+
2301
+ def update_textmagic_provider(
2302
+ self,
2303
+ provider_id: str,
2304
+ name: Optional[str] = None,
2305
+ enabled: Optional[bool] = None,
2306
+ username: Optional[str] = None,
2307
+ api_key: Optional[str] = None,
2308
+ xfrom: Optional[str] = None
2309
+ ) -> Provider:
2310
+ """
2311
+ Update a Textmagic provider by its unique ID.
2312
+
2313
+ Parameters
2314
+ ----------
2315
+ provider_id : str
2316
+ Provider ID.
2317
+ name : Optional[str]
2318
+ Provider name.
2319
+ enabled : Optional[bool]
2320
+ Set as enabled.
2321
+ username : Optional[str]
2322
+ Textmagic username.
2323
+ api_key : Optional[str]
2324
+ Textmagic apiKey.
2325
+ xfrom : Optional[str]
2326
+ Sender number.
2327
+
2328
+ Returns
2329
+ -------
2330
+ Provider
2331
+ API response as a typed Pydantic model
2332
+
2333
+ Raises
2334
+ ------
2335
+ AppwriteException
2336
+ If API request fails
2337
+ """
2338
+
2339
+ api_path = '/messaging/providers/textmagic/{providerId}'
2340
+ api_params = {}
2341
+ if provider_id is None:
2342
+ raise AppwriteException('Missing required parameter: "provider_id"')
2343
+
2344
+ api_path = api_path.replace('{providerId}', str(self._normalize_value(provider_id)))
2345
+
2346
+ if name is not None:
2347
+ api_params['name'] = self._normalize_value(name)
2348
+ if enabled is not None:
2349
+ api_params['enabled'] = self._normalize_value(enabled)
2350
+ if username is not None:
2351
+ api_params['username'] = self._normalize_value(username)
2352
+ if api_key is not None:
2353
+ api_params['apiKey'] = self._normalize_value(api_key)
2354
+ if xfrom is not None:
2355
+ api_params['from'] = self._normalize_value(xfrom)
2356
+
2357
+ response = self.client.call('patch', api_path, {
2358
+ 'X-Appwrite-Project': self.client.get_config('project'),
2359
+ 'content-type': 'application/json',
2360
+ 'accept': 'application/json',
2361
+ }, api_params)
2362
+
2363
+ return self._parse_response(response, model=Provider)
2364
+
2365
+
2366
+ def create_twilio_provider(
2367
+ self,
2368
+ provider_id: str,
2369
+ name: str,
2370
+ xfrom: Optional[str] = None,
2371
+ account_sid: Optional[str] = None,
2372
+ auth_token: Optional[str] = None,
2373
+ enabled: Optional[bool] = None
2374
+ ) -> Provider:
2375
+ """
2376
+ Create a new Twilio provider.
2377
+
2378
+ Parameters
2379
+ ----------
2380
+ provider_id : str
2381
+ Provider 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.
2382
+ name : str
2383
+ Provider name.
2384
+ xfrom : Optional[str]
2385
+ Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
2386
+ account_sid : Optional[str]
2387
+ Twilio account secret ID.
2388
+ auth_token : Optional[str]
2389
+ Twilio authentication token.
2390
+ enabled : Optional[bool]
2391
+ Set as enabled.
2392
+
2393
+ Returns
2394
+ -------
2395
+ Provider
2396
+ API response as a typed Pydantic model
2397
+
2398
+ Raises
2399
+ ------
2400
+ AppwriteException
2401
+ If API request fails
2402
+ """
2403
+
2404
+ api_path = '/messaging/providers/twilio'
2405
+ api_params = {}
2406
+ if provider_id is None:
2407
+ raise AppwriteException('Missing required parameter: "provider_id"')
2408
+
2409
+ if name is None:
2410
+ raise AppwriteException('Missing required parameter: "name"')
2411
+
2412
+
2413
+ api_params['providerId'] = self._normalize_value(provider_id)
2414
+ api_params['name'] = self._normalize_value(name)
2415
+ if xfrom is not None:
2416
+ api_params['from'] = self._normalize_value(xfrom)
2417
+ if account_sid is not None:
2418
+ api_params['accountSid'] = self._normalize_value(account_sid)
2419
+ if auth_token is not None:
2420
+ api_params['authToken'] = self._normalize_value(auth_token)
2421
+ if enabled is not None:
2422
+ api_params['enabled'] = self._normalize_value(enabled)
2423
+
2424
+ response = self.client.call('post', api_path, {
2425
+ 'X-Appwrite-Project': self.client.get_config('project'),
2426
+ 'content-type': 'application/json',
2427
+ 'accept': 'application/json',
2428
+ }, api_params)
2429
+
2430
+ return self._parse_response(response, model=Provider)
2431
+
2432
+
2433
+ def update_twilio_provider(
2434
+ self,
2435
+ provider_id: str,
2436
+ name: Optional[str] = None,
2437
+ enabled: Optional[bool] = None,
2438
+ account_sid: Optional[str] = None,
2439
+ auth_token: Optional[str] = None,
2440
+ xfrom: Optional[str] = None
2441
+ ) -> Provider:
2442
+ """
2443
+ Update a Twilio provider by its unique ID.
2444
+
2445
+ Parameters
2446
+ ----------
2447
+ provider_id : str
2448
+ Provider ID.
2449
+ name : Optional[str]
2450
+ Provider name.
2451
+ enabled : Optional[bool]
2452
+ Set as enabled.
2453
+ account_sid : Optional[str]
2454
+ Twilio account secret ID.
2455
+ auth_token : Optional[str]
2456
+ Twilio authentication token.
2457
+ xfrom : Optional[str]
2458
+ Sender number.
2459
+
2460
+ Returns
2461
+ -------
2462
+ Provider
2463
+ API response as a typed Pydantic model
2464
+
2465
+ Raises
2466
+ ------
2467
+ AppwriteException
2468
+ If API request fails
2469
+ """
2470
+
2471
+ api_path = '/messaging/providers/twilio/{providerId}'
2472
+ api_params = {}
2473
+ if provider_id is None:
2474
+ raise AppwriteException('Missing required parameter: "provider_id"')
2475
+
2476
+ api_path = api_path.replace('{providerId}', str(self._normalize_value(provider_id)))
2477
+
2478
+ if name is not None:
2479
+ api_params['name'] = self._normalize_value(name)
2480
+ if enabled is not None:
2481
+ api_params['enabled'] = self._normalize_value(enabled)
2482
+ if account_sid is not None:
2483
+ api_params['accountSid'] = self._normalize_value(account_sid)
2484
+ if auth_token is not None:
2485
+ api_params['authToken'] = self._normalize_value(auth_token)
2486
+ if xfrom is not None:
2487
+ api_params['from'] = self._normalize_value(xfrom)
2488
+
2489
+ response = self.client.call('patch', api_path, {
2490
+ 'X-Appwrite-Project': self.client.get_config('project'),
2491
+ 'content-type': 'application/json',
2492
+ 'accept': 'application/json',
2493
+ }, api_params)
2494
+
2495
+ return self._parse_response(response, model=Provider)
2496
+
2497
+
2498
+ def create_vonage_provider(
2499
+ self,
2500
+ provider_id: str,
2501
+ name: str,
2502
+ xfrom: Optional[str] = None,
2503
+ api_key: Optional[str] = None,
2504
+ api_secret: Optional[str] = None,
2505
+ enabled: Optional[bool] = None
2506
+ ) -> Provider:
2507
+ """
2508
+ Create a new Vonage provider.
2509
+
2510
+ Parameters
2511
+ ----------
2512
+ provider_id : str
2513
+ Provider 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.
2514
+ name : str
2515
+ Provider name.
2516
+ xfrom : Optional[str]
2517
+ Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
2518
+ api_key : Optional[str]
2519
+ Vonage API key.
2520
+ api_secret : Optional[str]
2521
+ Vonage API secret.
2522
+ enabled : Optional[bool]
2523
+ Set as enabled.
2524
+
2525
+ Returns
2526
+ -------
2527
+ Provider
2528
+ API response as a typed Pydantic model
2529
+
2530
+ Raises
2531
+ ------
2532
+ AppwriteException
2533
+ If API request fails
2534
+ """
2535
+
2536
+ api_path = '/messaging/providers/vonage'
2537
+ api_params = {}
2538
+ if provider_id is None:
2539
+ raise AppwriteException('Missing required parameter: "provider_id"')
2540
+
2541
+ if name is None:
2542
+ raise AppwriteException('Missing required parameter: "name"')
2543
+
2544
+
2545
+ api_params['providerId'] = self._normalize_value(provider_id)
2546
+ api_params['name'] = self._normalize_value(name)
2547
+ if xfrom is not None:
2548
+ api_params['from'] = self._normalize_value(xfrom)
2549
+ if api_key is not None:
2550
+ api_params['apiKey'] = self._normalize_value(api_key)
2551
+ if api_secret is not None:
2552
+ api_params['apiSecret'] = self._normalize_value(api_secret)
2553
+ if enabled is not None:
2554
+ api_params['enabled'] = self._normalize_value(enabled)
2555
+
2556
+ response = self.client.call('post', api_path, {
2557
+ 'X-Appwrite-Project': self.client.get_config('project'),
2558
+ 'content-type': 'application/json',
2559
+ 'accept': 'application/json',
2560
+ }, api_params)
2561
+
2562
+ return self._parse_response(response, model=Provider)
2563
+
2564
+
2565
+ def update_vonage_provider(
2566
+ self,
2567
+ provider_id: str,
2568
+ name: Optional[str] = None,
2569
+ enabled: Optional[bool] = None,
2570
+ api_key: Optional[str] = None,
2571
+ api_secret: Optional[str] = None,
2572
+ xfrom: Optional[str] = None
2573
+ ) -> Provider:
2574
+ """
2575
+ Update a Vonage provider by its unique ID.
2576
+
2577
+ Parameters
2578
+ ----------
2579
+ provider_id : str
2580
+ Provider ID.
2581
+ name : Optional[str]
2582
+ Provider name.
2583
+ enabled : Optional[bool]
2584
+ Set as enabled.
2585
+ api_key : Optional[str]
2586
+ Vonage API key.
2587
+ api_secret : Optional[str]
2588
+ Vonage API secret.
2589
+ xfrom : Optional[str]
2590
+ Sender number.
2591
+
2592
+ Returns
2593
+ -------
2594
+ Provider
2595
+ API response as a typed Pydantic model
2596
+
2597
+ Raises
2598
+ ------
2599
+ AppwriteException
2600
+ If API request fails
2601
+ """
2602
+
2603
+ api_path = '/messaging/providers/vonage/{providerId}'
2604
+ api_params = {}
2605
+ if provider_id is None:
2606
+ raise AppwriteException('Missing required parameter: "provider_id"')
2607
+
2608
+ api_path = api_path.replace('{providerId}', str(self._normalize_value(provider_id)))
2609
+
2610
+ if name is not None:
2611
+ api_params['name'] = self._normalize_value(name)
2612
+ if enabled is not None:
2613
+ api_params['enabled'] = self._normalize_value(enabled)
2614
+ if api_key is not None:
2615
+ api_params['apiKey'] = self._normalize_value(api_key)
2616
+ if api_secret is not None:
2617
+ api_params['apiSecret'] = self._normalize_value(api_secret)
2618
+ if xfrom is not None:
2619
+ api_params['from'] = self._normalize_value(xfrom)
2620
+
2621
+ response = self.client.call('patch', api_path, {
2622
+ 'X-Appwrite-Project': self.client.get_config('project'),
2623
+ 'content-type': 'application/json',
2624
+ 'accept': 'application/json',
2625
+ }, api_params)
2626
+
2627
+ return self._parse_response(response, model=Provider)
2628
+
2629
+
2630
+ def get_provider(
2631
+ self,
2632
+ provider_id: str
2633
+ ) -> Provider:
2634
+ """
2635
+ Get a provider by its unique ID.
2636
+
2637
+
2638
+ Parameters
2639
+ ----------
2640
+ provider_id : str
2641
+ Provider ID.
2642
+
2643
+ Returns
2644
+ -------
2645
+ Provider
2646
+ API response as a typed Pydantic model
2647
+
2648
+ Raises
2649
+ ------
2650
+ AppwriteException
2651
+ If API request fails
2652
+ """
2653
+
2654
+ api_path = '/messaging/providers/{providerId}'
2655
+ api_params = {}
2656
+ if provider_id is None:
2657
+ raise AppwriteException('Missing required parameter: "provider_id"')
2658
+
2659
+ api_path = api_path.replace('{providerId}', str(self._normalize_value(provider_id)))
2660
+
2661
+
2662
+ response = self.client.call('get', api_path, {
2663
+ 'X-Appwrite-Project': self.client.get_config('project'),
2664
+ 'accept': 'application/json',
2665
+ }, api_params)
2666
+
2667
+ return self._parse_response(response, model=Provider)
2668
+
2669
+
2670
+ def delete_provider(
2671
+ self,
2672
+ provider_id: str
2673
+ ) -> Dict[str, Any]:
2674
+ """
2675
+ Delete a provider by its unique ID.
2676
+
2677
+ Parameters
2678
+ ----------
2679
+ provider_id : str
2680
+ Provider ID.
2681
+
2682
+ Returns
2683
+ -------
2684
+ Dict[str, Any]
2685
+ API response as a dictionary
2686
+
2687
+ Raises
2688
+ ------
2689
+ AppwriteException
2690
+ If API request fails
2691
+ """
2692
+
2693
+ api_path = '/messaging/providers/{providerId}'
2694
+ api_params = {}
2695
+ if provider_id is None:
2696
+ raise AppwriteException('Missing required parameter: "provider_id"')
2697
+
2698
+ api_path = api_path.replace('{providerId}', str(self._normalize_value(provider_id)))
2699
+
2700
+
2701
+ response = self.client.call('delete', api_path, {
2702
+ 'X-Appwrite-Project': self.client.get_config('project'),
2703
+ 'content-type': 'application/json',
2704
+ }, api_params)
2705
+
2706
+ return response
2707
+
2708
+
2709
+ def list_topics(
2710
+ self,
2711
+ queries: Optional[List[str]] = None,
2712
+ search: Optional[str] = None,
2713
+ total: Optional[bool] = None
2714
+ ) -> TopicList:
2715
+ """
2716
+ Get a list of all topics from the current Appwrite project.
2717
+
2718
+ Parameters
2719
+ ----------
2720
+ queries : Optional[List[str]]
2721
+ 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, description, emailTotal, smsTotal, pushTotal
2722
+ search : Optional[str]
2723
+ Search term to filter your list results. Max length: 256 chars.
2724
+ total : Optional[bool]
2725
+ When set to false, the total count returned will be 0 and will not be calculated.
2726
+
2727
+ Returns
2728
+ -------
2729
+ TopicList
2730
+ API response as a typed Pydantic model
2731
+
2732
+ Raises
2733
+ ------
2734
+ AppwriteException
2735
+ If API request fails
2736
+ """
2737
+
2738
+ api_path = '/messaging/topics'
2739
+ api_params = {}
2740
+
2741
+ if queries is not None:
2742
+ api_params['queries'] = self._normalize_value(queries)
2743
+ if search is not None:
2744
+ api_params['search'] = self._normalize_value(search)
2745
+ if total is not None:
2746
+ api_params['total'] = self._normalize_value(total)
2747
+
2748
+ response = self.client.call('get', api_path, {
2749
+ 'X-Appwrite-Project': self.client.get_config('project'),
2750
+ 'accept': 'application/json',
2751
+ }, api_params)
2752
+
2753
+ return self._parse_response(response, model=TopicList)
2754
+
2755
+
2756
+ def create_topic(
2757
+ self,
2758
+ topic_id: str,
2759
+ name: str,
2760
+ subscribe: Optional[List[str]] = None
2761
+ ) -> Topic:
2762
+ """
2763
+ Create a new topic.
2764
+
2765
+ Parameters
2766
+ ----------
2767
+ topic_id : str
2768
+ Topic ID. Choose a custom Topic ID or a new Topic ID.
2769
+ name : str
2770
+ Topic Name.
2771
+ subscribe : Optional[List[str]]
2772
+ An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
2773
+
2774
+ Returns
2775
+ -------
2776
+ Topic
2777
+ API response as a typed Pydantic model
2778
+
2779
+ Raises
2780
+ ------
2781
+ AppwriteException
2782
+ If API request fails
2783
+ """
2784
+
2785
+ api_path = '/messaging/topics'
2786
+ api_params = {}
2787
+ if topic_id is None:
2788
+ raise AppwriteException('Missing required parameter: "topic_id"')
2789
+
2790
+ if name is None:
2791
+ raise AppwriteException('Missing required parameter: "name"')
2792
+
2793
+
2794
+ api_params['topicId'] = self._normalize_value(topic_id)
2795
+ api_params['name'] = self._normalize_value(name)
2796
+ if subscribe is not None:
2797
+ api_params['subscribe'] = self._normalize_value(subscribe)
2798
+
2799
+ response = self.client.call('post', api_path, {
2800
+ 'X-Appwrite-Project': self.client.get_config('project'),
2801
+ 'content-type': 'application/json',
2802
+ 'accept': 'application/json',
2803
+ }, api_params)
2804
+
2805
+ return self._parse_response(response, model=Topic)
2806
+
2807
+
2808
+ def get_topic(
2809
+ self,
2810
+ topic_id: str
2811
+ ) -> Topic:
2812
+ """
2813
+ Get a topic by its unique ID.
2814
+
2815
+
2816
+ Parameters
2817
+ ----------
2818
+ topic_id : str
2819
+ Topic ID.
2820
+
2821
+ Returns
2822
+ -------
2823
+ Topic
2824
+ API response as a typed Pydantic model
2825
+
2826
+ Raises
2827
+ ------
2828
+ AppwriteException
2829
+ If API request fails
2830
+ """
2831
+
2832
+ api_path = '/messaging/topics/{topicId}'
2833
+ api_params = {}
2834
+ if topic_id is None:
2835
+ raise AppwriteException('Missing required parameter: "topic_id"')
2836
+
2837
+ api_path = api_path.replace('{topicId}', str(self._normalize_value(topic_id)))
2838
+
2839
+
2840
+ response = self.client.call('get', api_path, {
2841
+ 'X-Appwrite-Project': self.client.get_config('project'),
2842
+ 'accept': 'application/json',
2843
+ }, api_params)
2844
+
2845
+ return self._parse_response(response, model=Topic)
2846
+
2847
+
2848
+ def update_topic(
2849
+ self,
2850
+ topic_id: str,
2851
+ name: Optional[str] = None,
2852
+ subscribe: Optional[List[str]] = None
2853
+ ) -> Topic:
2854
+ """
2855
+ Update a topic by its unique ID.
2856
+
2857
+
2858
+ Parameters
2859
+ ----------
2860
+ topic_id : str
2861
+ Topic ID.
2862
+ name : Optional[str]
2863
+ Topic Name.
2864
+ subscribe : Optional[List[str]]
2865
+ An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
2866
+
2867
+ Returns
2868
+ -------
2869
+ Topic
2870
+ API response as a typed Pydantic model
2871
+
2872
+ Raises
2873
+ ------
2874
+ AppwriteException
2875
+ If API request fails
2876
+ """
2877
+
2878
+ api_path = '/messaging/topics/{topicId}'
2879
+ api_params = {}
2880
+ if topic_id is None:
2881
+ raise AppwriteException('Missing required parameter: "topic_id"')
2882
+
2883
+ api_path = api_path.replace('{topicId}', str(self._normalize_value(topic_id)))
2884
+
2885
+ if name is not None:
2886
+ api_params['name'] = self._normalize_value(name)
2887
+ if subscribe is not None:
2888
+ api_params['subscribe'] = self._normalize_value(subscribe)
2889
+
2890
+ response = self.client.call('patch', api_path, {
2891
+ 'X-Appwrite-Project': self.client.get_config('project'),
2892
+ 'content-type': 'application/json',
2893
+ 'accept': 'application/json',
2894
+ }, api_params)
2895
+
2896
+ return self._parse_response(response, model=Topic)
2897
+
2898
+
2899
+ def delete_topic(
2900
+ self,
2901
+ topic_id: str
2902
+ ) -> Dict[str, Any]:
2903
+ """
2904
+ Delete a topic by its unique ID.
2905
+
2906
+ Parameters
2907
+ ----------
2908
+ topic_id : str
2909
+ Topic ID.
2910
+
2911
+ Returns
2912
+ -------
2913
+ Dict[str, Any]
2914
+ API response as a dictionary
2915
+
2916
+ Raises
2917
+ ------
2918
+ AppwriteException
2919
+ If API request fails
2920
+ """
2921
+
2922
+ api_path = '/messaging/topics/{topicId}'
2923
+ api_params = {}
2924
+ if topic_id is None:
2925
+ raise AppwriteException('Missing required parameter: "topic_id"')
2926
+
2927
+ api_path = api_path.replace('{topicId}', str(self._normalize_value(topic_id)))
2928
+
2929
+
2930
+ response = self.client.call('delete', api_path, {
2931
+ 'X-Appwrite-Project': self.client.get_config('project'),
2932
+ 'content-type': 'application/json',
2933
+ }, api_params)
2934
+
2935
+ return response
2936
+
2937
+
2938
+ def list_subscribers(
2939
+ self,
2940
+ topic_id: str,
2941
+ queries: Optional[List[str]] = None,
2942
+ search: Optional[str] = None,
2943
+ total: Optional[bool] = None
2944
+ ) -> SubscriberList:
2945
+ """
2946
+ Get a list of all subscribers from the current Appwrite project.
2947
+
2948
+ Parameters
2949
+ ----------
2950
+ topic_id : str
2951
+ Topic ID. The topic ID subscribed to.
2952
+ queries : Optional[List[str]]
2953
+ 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: targetId, topicId, userId, providerType
2954
+ search : Optional[str]
2955
+ Search term to filter your list results. Max length: 256 chars.
2956
+ total : Optional[bool]
2957
+ When set to false, the total count returned will be 0 and will not be calculated.
2958
+
2959
+ Returns
2960
+ -------
2961
+ SubscriberList
2962
+ API response as a typed Pydantic model
2963
+
2964
+ Raises
2965
+ ------
2966
+ AppwriteException
2967
+ If API request fails
2968
+ """
2969
+
2970
+ api_path = '/messaging/topics/{topicId}/subscribers'
2971
+ api_params = {}
2972
+ if topic_id is None:
2973
+ raise AppwriteException('Missing required parameter: "topic_id"')
2974
+
2975
+ api_path = api_path.replace('{topicId}', str(self._normalize_value(topic_id)))
2976
+
2977
+ if queries is not None:
2978
+ api_params['queries'] = self._normalize_value(queries)
2979
+ if search is not None:
2980
+ api_params['search'] = self._normalize_value(search)
2981
+ if total is not None:
2982
+ api_params['total'] = self._normalize_value(total)
2983
+
2984
+ response = self.client.call('get', api_path, {
2985
+ 'X-Appwrite-Project': self.client.get_config('project'),
2986
+ 'accept': 'application/json',
2987
+ }, api_params)
2988
+
2989
+ return self._parse_response(response, model=SubscriberList)
2990
+
2991
+
2992
+ def create_subscriber(
2993
+ self,
2994
+ topic_id: str,
2995
+ subscriber_id: str,
2996
+ target_id: str
2997
+ ) -> Subscriber:
2998
+ """
2999
+ Create a new subscriber.
3000
+
3001
+ Parameters
3002
+ ----------
3003
+ topic_id : str
3004
+ Topic ID. The topic ID to subscribe to.
3005
+ subscriber_id : str
3006
+ Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.
3007
+ target_id : str
3008
+ Target ID. The target ID to link to the specified Topic ID.
3009
+
3010
+ Returns
3011
+ -------
3012
+ Subscriber
3013
+ API response as a typed Pydantic model
3014
+
3015
+ Raises
3016
+ ------
3017
+ AppwriteException
3018
+ If API request fails
3019
+ """
3020
+
3021
+ api_path = '/messaging/topics/{topicId}/subscribers'
3022
+ api_params = {}
3023
+ if topic_id is None:
3024
+ raise AppwriteException('Missing required parameter: "topic_id"')
3025
+
3026
+ if subscriber_id is None:
3027
+ raise AppwriteException('Missing required parameter: "subscriber_id"')
3028
+
3029
+ if target_id is None:
3030
+ raise AppwriteException('Missing required parameter: "target_id"')
3031
+
3032
+ api_path = api_path.replace('{topicId}', str(self._normalize_value(topic_id)))
3033
+
3034
+ api_params['subscriberId'] = self._normalize_value(subscriber_id)
3035
+ api_params['targetId'] = self._normalize_value(target_id)
3036
+
3037
+ response = self.client.call('post', api_path, {
3038
+ 'X-Appwrite-Project': self.client.get_config('project'),
3039
+ 'content-type': 'application/json',
3040
+ 'accept': 'application/json',
3041
+ }, api_params)
3042
+
3043
+ return self._parse_response(response, model=Subscriber)
3044
+
3045
+
3046
+ def get_subscriber(
3047
+ self,
3048
+ topic_id: str,
3049
+ subscriber_id: str
3050
+ ) -> Subscriber:
3051
+ """
3052
+ Get a subscriber by its unique ID.
3053
+
3054
+
3055
+ Parameters
3056
+ ----------
3057
+ topic_id : str
3058
+ Topic ID. The topic ID subscribed to.
3059
+ subscriber_id : str
3060
+ Subscriber ID.
3061
+
3062
+ Returns
3063
+ -------
3064
+ Subscriber
3065
+ API response as a typed Pydantic model
3066
+
3067
+ Raises
3068
+ ------
3069
+ AppwriteException
3070
+ If API request fails
3071
+ """
3072
+
3073
+ api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}'
3074
+ api_params = {}
3075
+ if topic_id is None:
3076
+ raise AppwriteException('Missing required parameter: "topic_id"')
3077
+
3078
+ if subscriber_id is None:
3079
+ raise AppwriteException('Missing required parameter: "subscriber_id"')
3080
+
3081
+ api_path = api_path.replace('{topicId}', str(self._normalize_value(topic_id)))
3082
+ api_path = api_path.replace('{subscriberId}', str(self._normalize_value(subscriber_id)))
3083
+
3084
+
3085
+ response = self.client.call('get', api_path, {
3086
+ 'X-Appwrite-Project': self.client.get_config('project'),
3087
+ 'accept': 'application/json',
3088
+ }, api_params)
3089
+
3090
+ return self._parse_response(response, model=Subscriber)
3091
+
3092
+
3093
+ def delete_subscriber(
3094
+ self,
3095
+ topic_id: str,
3096
+ subscriber_id: str
3097
+ ) -> Dict[str, Any]:
3098
+ """
3099
+ Delete a subscriber by its unique ID.
3100
+
3101
+ Parameters
3102
+ ----------
3103
+ topic_id : str
3104
+ Topic ID. The topic ID subscribed to.
3105
+ subscriber_id : str
3106
+ Subscriber ID.
3107
+
3108
+ Returns
3109
+ -------
3110
+ Dict[str, Any]
3111
+ API response as a dictionary
3112
+
3113
+ Raises
3114
+ ------
3115
+ AppwriteException
3116
+ If API request fails
3117
+ """
3118
+
3119
+ api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}'
3120
+ api_params = {}
3121
+ if topic_id is None:
3122
+ raise AppwriteException('Missing required parameter: "topic_id"')
3123
+
3124
+ if subscriber_id is None:
3125
+ raise AppwriteException('Missing required parameter: "subscriber_id"')
3126
+
3127
+ api_path = api_path.replace('{topicId}', str(self._normalize_value(topic_id)))
3128
+ api_path = api_path.replace('{subscriberId}', str(self._normalize_value(subscriber_id)))
3129
+
3130
+
3131
+ response = self.client.call('delete', api_path, {
3132
+ 'X-Appwrite-Project': self.client.get_config('project'),
3133
+ 'content-type': 'application/json',
3134
+ }, api_params)
3135
+
3136
+ return response
3137
+