From 95469ea940cd72a47ba61c1ced681c9ef9037225 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 May 2026 11:07:06 +0000 Subject: [PATCH] feat: Ruby SDK update for version 23.1.0 --- CHANGELOG.md | 6 + README.md | 4 +- appwrite.gemspec | 2 +- .../databases/create-big-int-attribute.md | 23 + .../databases/update-big-int-attribute.md | 23 + docs/examples/functions/create-variable.md | 1 + docs/examples/functions/create.md | 2 +- docs/examples/functions/list-variables.md | 4 +- docs/examples/functions/update-variable.md | 2 +- docs/examples/functions/update.md | 2 +- docs/examples/presences/delete.md | 16 + docs/examples/presences/get.md | 16 + docs/examples/presences/list.md | 18 + docs/examples/presences/update-presence.md | 24 + docs/examples/presences/upsert.md | 23 + docs/examples/project/create-ephemeral-key.md | 18 + docs/examples/project/create-key.md | 2 +- docs/examples/project/create-mock-phone.md | 17 + docs/examples/project/create-smtp-test.md | 16 + docs/examples/project/delete-mock-phone.md | 16 + docs/examples/project/delete.md | 14 + docs/examples/project/get-email-template.md | 18 + docs/examples/project/get-mock-phone.md | 16 + .../examples/project/get-o-auth-2-provider.md | 17 + docs/examples/project/get-policy.md | 17 + docs/examples/project/list-email-templates.md | 17 + docs/examples/project/list-mock-phones.md | 17 + .../project/list-o-auth-2-providers.md | 17 + docs/examples/project/list-policies.md | 17 + docs/examples/project/update-auth-method.md | 18 + .../examples/project/update-email-template.md | 24 + docs/examples/project/update-key.md | 2 +- .../update-membership-privacy-policy.md | 20 + docs/examples/project/update-mock-phone.md | 17 + .../project/update-o-auth-2-amazon.md | 18 + .../examples/project/update-o-auth-2-apple.md | 20 + .../project/update-o-auth-2-auth-0.md | 19 + .../project/update-o-auth-2-authentik.md | 19 + .../project/update-o-auth-2-autodesk.md | 18 + .../project/update-o-auth-2-bitbucket.md | 18 + .../examples/project/update-o-auth-2-bitly.md | 18 + docs/examples/project/update-o-auth-2-box.md | 18 + .../project/update-o-auth-2-dailymotion.md | 18 + .../project/update-o-auth-2-discord.md | 18 + .../project/update-o-auth-2-disqus.md | 18 + .../project/update-o-auth-2-dropbox.md | 18 + docs/examples/project/update-o-auth-2-etsy.md | 18 + .../project/update-o-auth-2-facebook.md | 18 + .../examples/project/update-o-auth-2-figma.md | 18 + .../project/update-o-auth-2-fusion-auth.md | 19 + .../project/update-o-auth-2-git-hub.md | 18 + .../project/update-o-auth-2-gitlab.md | 19 + .../project/update-o-auth-2-google.md | 18 + .../project/update-o-auth-2-keycloak.md | 20 + docs/examples/project/update-o-auth-2-kick.md | 18 + .../project/update-o-auth-2-linkedin.md | 18 + .../project/update-o-auth-2-microsoft.md | 19 + .../project/update-o-auth-2-notion.md | 18 + docs/examples/project/update-o-auth-2-oidc.md | 22 + docs/examples/project/update-o-auth-2-okta.md | 20 + .../project/update-o-auth-2-paypal-sandbox.md | 18 + .../project/update-o-auth-2-paypal.md | 18 + .../examples/project/update-o-auth-2-podio.md | 18 + .../project/update-o-auth-2-salesforce.md | 18 + .../examples/project/update-o-auth-2-slack.md | 18 + .../project/update-o-auth-2-spotify.md | 18 + .../project/update-o-auth-2-stripe.md | 18 + .../update-o-auth-2-tradeshift-sandbox.md | 18 + .../project/update-o-auth-2-tradeshift.md | 18 + .../project/update-o-auth-2-twitch.md | 18 + .../project/update-o-auth-2-word-press.md | 18 + .../examples/project/update-o-auth-2-yahoo.md | 18 + .../project/update-o-auth-2-yandex.md | 18 + docs/examples/project/update-o-auth-2-zoho.md | 18 + docs/examples/project/update-o-auth-2-zoom.md | 18 + docs/examples/project/update-o-auth-2x.md | 18 + .../update-password-dictionary-policy.md | 16 + .../project/update-password-history-policy.md | 16 + .../update-password-personal-data-policy.md | 16 + ...-protocol-status.md => update-protocol.md} | 2 +- ...te-service-status.md => update-service.md} | 2 +- .../project/update-session-alert-policy.md | 16 + .../project/update-session-duration-policy.md | 16 + .../update-session-invalidation-policy.md | 16 + .../project/update-session-limit-policy.md | 16 + docs/examples/project/update-smtp.md | 26 + .../project/update-user-limit-policy.md | 16 + docs/examples/proxy/create-api-rule.md | 16 + docs/examples/proxy/create-function-rule.md | 18 + docs/examples/proxy/create-redirect-rule.md | 21 + docs/examples/proxy/create-site-rule.md | 18 + docs/examples/proxy/delete-rule.md | 16 + docs/examples/proxy/get-rule.md | 16 + docs/examples/proxy/list-rules.md | 17 + docs/examples/proxy/update-rule-status.md | 16 + docs/examples/sites/create-variable.md | 1 + docs/examples/sites/list-variables.md | 4 +- docs/examples/sites/update-variable.md | 2 +- .../tablesdb/create-big-int-column.md | 23 + .../tablesdb/update-big-int-column.md | 23 + lib/appwrite.rb | 73 + lib/appwrite/client.rb | 30 +- lib/appwrite/enums/build_runtime.rb | 1 + lib/appwrite/enums/email_template_locale.rb | 137 + lib/appwrite/enums/email_template_type.rb | 13 + lib/appwrite/enums/method_id.rb | 13 + lib/appwrite/enums/o_auth_provider.rb | 3 + lib/appwrite/enums/policy_id.rb | 15 + lib/appwrite/enums/provider_id.rb | 53 + lib/appwrite/enums/proxy_resource_type.rb | 8 + .../proxy_rule_deployment_resource_type.rb | 8 + lib/appwrite/enums/proxy_rule_status.rb | 9 + lib/appwrite/enums/runtime.rb | 1 + lib/appwrite/enums/scopes.rb | 77 +- lib/appwrite/enums/secure.rb | 8 + lib/appwrite/enums/status_code.rb | 10 + lib/appwrite/models/attribute_bigint.rb | 96 + lib/appwrite/models/block.rb | 31 +- lib/appwrite/models/column_bigint.rb | 96 + lib/appwrite/models/email_template.rb | 62 + lib/appwrite/models/email_template_list.rb | 32 + lib/appwrite/models/ephemeral_key.rb | 67 + lib/appwrite/models/membership.rb | 5 + lib/appwrite/models/mock_number.rb | 26 +- lib/appwrite/models/mock_number_list.rb | 32 + lib/appwrite/models/o_auth2_amazon.rb | 42 + lib/appwrite/models/o_auth2_apple.rb | 52 + lib/appwrite/models/o_auth2_auth0.rb | 47 + lib/appwrite/models/o_auth2_authentik.rb | 47 + lib/appwrite/models/o_auth2_autodesk.rb | 42 + lib/appwrite/models/o_auth2_bitbucket.rb | 42 + lib/appwrite/models/o_auth2_bitly.rb | 42 + lib/appwrite/models/o_auth2_box.rb | 42 + lib/appwrite/models/o_auth2_dailymotion.rb | 42 + lib/appwrite/models/o_auth2_discord.rb | 42 + lib/appwrite/models/o_auth2_disqus.rb | 42 + lib/appwrite/models/o_auth2_dropbox.rb | 42 + lib/appwrite/models/o_auth2_etsy.rb | 42 + lib/appwrite/models/o_auth2_facebook.rb | 42 + lib/appwrite/models/o_auth2_figma.rb | 42 + lib/appwrite/models/o_auth2_fusion_auth.rb | 47 + lib/appwrite/models/o_auth2_github.rb | 42 + lib/appwrite/models/o_auth2_gitlab.rb | 47 + lib/appwrite/models/o_auth2_google.rb | 42 + lib/appwrite/models/o_auth2_keycloak.rb | 52 + lib/appwrite/models/o_auth2_kick.rb | 42 + lib/appwrite/models/o_auth2_linkedin.rb | 42 + lib/appwrite/models/o_auth2_microsoft.rb | 47 + lib/appwrite/models/o_auth2_notion.rb | 42 + lib/appwrite/models/o_auth2_oidc.rb | 62 + lib/appwrite/models/o_auth2_okta.rb | 52 + lib/appwrite/models/o_auth2_paypal.rb | 42 + lib/appwrite/models/o_auth2_podio.rb | 42 + lib/appwrite/models/o_auth2_provider_list.rb | 32 + lib/appwrite/models/o_auth2_salesforce.rb | 42 + lib/appwrite/models/o_auth2_slack.rb | 42 + lib/appwrite/models/o_auth2_spotify.rb | 42 + lib/appwrite/models/o_auth2_stripe.rb | 42 + lib/appwrite/models/o_auth2_tradeshift.rb | 42 + lib/appwrite/models/o_auth2_twitch.rb | 42 + lib/appwrite/models/o_auth2_word_press.rb | 42 + lib/appwrite/models/o_auth2_x.rb | 42 + lib/appwrite/models/o_auth2_yahoo.rb | 42 + lib/appwrite/models/o_auth2_yandex.rb | 42 + lib/appwrite/models/o_auth2_zoho.rb | 42 + lib/appwrite/models/o_auth2_zoom.rb | 42 + lib/appwrite/models/policy_list.rb | 32 + .../models/policy_membership_privacy.rb | 52 + .../models/policy_password_dictionary.rb | 32 + .../models/policy_password_history.rb | 32 + .../models/policy_password_personal_data.rb | 32 + lib/appwrite/models/policy_session_alert.rb | 32 + .../models/policy_session_duration.rb | 32 + .../models/policy_session_invalidation.rb | 32 + lib/appwrite/models/policy_session_limit.rb | 32 + lib/appwrite/models/policy_user_limit.rb | 32 + lib/appwrite/models/presence.rb | 81 + lib/appwrite/models/presence_list.rb | 36 + lib/appwrite/models/project.rb | 25 +- lib/appwrite/models/proxy_rule.rb | 127 + lib/appwrite/models/proxy_rule_list.rb | 32 + lib/appwrite/services/account.rb | 2 +- lib/appwrite/services/databases.rb | 126 + lib/appwrite/services/functions.rb | 20 +- lib/appwrite/services/presences.rb | 192 ++ lib/appwrite/services/project.rb | 3001 +++++++++++++++-- lib/appwrite/services/proxy.rb | 303 ++ lib/appwrite/services/sites.rb | 20 +- lib/appwrite/services/tables_db.rb | 120 + 189 files changed, 8330 insertions(+), 374 deletions(-) create mode 100644 docs/examples/databases/create-big-int-attribute.md create mode 100644 docs/examples/databases/update-big-int-attribute.md create mode 100644 docs/examples/presences/delete.md create mode 100644 docs/examples/presences/get.md create mode 100644 docs/examples/presences/list.md create mode 100644 docs/examples/presences/update-presence.md create mode 100644 docs/examples/presences/upsert.md create mode 100644 docs/examples/project/create-ephemeral-key.md create mode 100644 docs/examples/project/create-mock-phone.md create mode 100644 docs/examples/project/create-smtp-test.md create mode 100644 docs/examples/project/delete-mock-phone.md create mode 100644 docs/examples/project/delete.md create mode 100644 docs/examples/project/get-email-template.md create mode 100644 docs/examples/project/get-mock-phone.md create mode 100644 docs/examples/project/get-o-auth-2-provider.md create mode 100644 docs/examples/project/get-policy.md create mode 100644 docs/examples/project/list-email-templates.md create mode 100644 docs/examples/project/list-mock-phones.md create mode 100644 docs/examples/project/list-o-auth-2-providers.md create mode 100644 docs/examples/project/list-policies.md create mode 100644 docs/examples/project/update-auth-method.md create mode 100644 docs/examples/project/update-email-template.md create mode 100644 docs/examples/project/update-membership-privacy-policy.md create mode 100644 docs/examples/project/update-mock-phone.md create mode 100644 docs/examples/project/update-o-auth-2-amazon.md create mode 100644 docs/examples/project/update-o-auth-2-apple.md create mode 100644 docs/examples/project/update-o-auth-2-auth-0.md create mode 100644 docs/examples/project/update-o-auth-2-authentik.md create mode 100644 docs/examples/project/update-o-auth-2-autodesk.md create mode 100644 docs/examples/project/update-o-auth-2-bitbucket.md create mode 100644 docs/examples/project/update-o-auth-2-bitly.md create mode 100644 docs/examples/project/update-o-auth-2-box.md create mode 100644 docs/examples/project/update-o-auth-2-dailymotion.md create mode 100644 docs/examples/project/update-o-auth-2-discord.md create mode 100644 docs/examples/project/update-o-auth-2-disqus.md create mode 100644 docs/examples/project/update-o-auth-2-dropbox.md create mode 100644 docs/examples/project/update-o-auth-2-etsy.md create mode 100644 docs/examples/project/update-o-auth-2-facebook.md create mode 100644 docs/examples/project/update-o-auth-2-figma.md create mode 100644 docs/examples/project/update-o-auth-2-fusion-auth.md create mode 100644 docs/examples/project/update-o-auth-2-git-hub.md create mode 100644 docs/examples/project/update-o-auth-2-gitlab.md create mode 100644 docs/examples/project/update-o-auth-2-google.md create mode 100644 docs/examples/project/update-o-auth-2-keycloak.md create mode 100644 docs/examples/project/update-o-auth-2-kick.md create mode 100644 docs/examples/project/update-o-auth-2-linkedin.md create mode 100644 docs/examples/project/update-o-auth-2-microsoft.md create mode 100644 docs/examples/project/update-o-auth-2-notion.md create mode 100644 docs/examples/project/update-o-auth-2-oidc.md create mode 100644 docs/examples/project/update-o-auth-2-okta.md create mode 100644 docs/examples/project/update-o-auth-2-paypal-sandbox.md create mode 100644 docs/examples/project/update-o-auth-2-paypal.md create mode 100644 docs/examples/project/update-o-auth-2-podio.md create mode 100644 docs/examples/project/update-o-auth-2-salesforce.md create mode 100644 docs/examples/project/update-o-auth-2-slack.md create mode 100644 docs/examples/project/update-o-auth-2-spotify.md create mode 100644 docs/examples/project/update-o-auth-2-stripe.md create mode 100644 docs/examples/project/update-o-auth-2-tradeshift-sandbox.md create mode 100644 docs/examples/project/update-o-auth-2-tradeshift.md create mode 100644 docs/examples/project/update-o-auth-2-twitch.md create mode 100644 docs/examples/project/update-o-auth-2-word-press.md create mode 100644 docs/examples/project/update-o-auth-2-yahoo.md create mode 100644 docs/examples/project/update-o-auth-2-yandex.md create mode 100644 docs/examples/project/update-o-auth-2-zoho.md create mode 100644 docs/examples/project/update-o-auth-2-zoom.md create mode 100644 docs/examples/project/update-o-auth-2x.md create mode 100644 docs/examples/project/update-password-dictionary-policy.md create mode 100644 docs/examples/project/update-password-history-policy.md create mode 100644 docs/examples/project/update-password-personal-data-policy.md rename docs/examples/project/{update-protocol-status.md => update-protocol.md} (90%) rename docs/examples/project/{update-service-status.md => update-service.md} (90%) create mode 100644 docs/examples/project/update-session-alert-policy.md create mode 100644 docs/examples/project/update-session-duration-policy.md create mode 100644 docs/examples/project/update-session-invalidation-policy.md create mode 100644 docs/examples/project/update-session-limit-policy.md create mode 100644 docs/examples/project/update-smtp.md create mode 100644 docs/examples/project/update-user-limit-policy.md create mode 100644 docs/examples/proxy/create-api-rule.md create mode 100644 docs/examples/proxy/create-function-rule.md create mode 100644 docs/examples/proxy/create-redirect-rule.md create mode 100644 docs/examples/proxy/create-site-rule.md create mode 100644 docs/examples/proxy/delete-rule.md create mode 100644 docs/examples/proxy/get-rule.md create mode 100644 docs/examples/proxy/list-rules.md create mode 100644 docs/examples/proxy/update-rule-status.md create mode 100644 docs/examples/tablesdb/create-big-int-column.md create mode 100644 docs/examples/tablesdb/update-big-int-column.md create mode 100644 lib/appwrite/enums/email_template_locale.rb create mode 100644 lib/appwrite/enums/email_template_type.rb create mode 100644 lib/appwrite/enums/method_id.rb create mode 100644 lib/appwrite/enums/policy_id.rb create mode 100644 lib/appwrite/enums/provider_id.rb create mode 100644 lib/appwrite/enums/proxy_resource_type.rb create mode 100644 lib/appwrite/enums/proxy_rule_deployment_resource_type.rb create mode 100644 lib/appwrite/enums/proxy_rule_status.rb create mode 100644 lib/appwrite/enums/secure.rb create mode 100644 lib/appwrite/enums/status_code.rb create mode 100644 lib/appwrite/models/attribute_bigint.rb create mode 100644 lib/appwrite/models/column_bigint.rb create mode 100644 lib/appwrite/models/email_template.rb create mode 100644 lib/appwrite/models/email_template_list.rb create mode 100644 lib/appwrite/models/ephemeral_key.rb create mode 100644 lib/appwrite/models/mock_number_list.rb create mode 100644 lib/appwrite/models/o_auth2_amazon.rb create mode 100644 lib/appwrite/models/o_auth2_apple.rb create mode 100644 lib/appwrite/models/o_auth2_auth0.rb create mode 100644 lib/appwrite/models/o_auth2_authentik.rb create mode 100644 lib/appwrite/models/o_auth2_autodesk.rb create mode 100644 lib/appwrite/models/o_auth2_bitbucket.rb create mode 100644 lib/appwrite/models/o_auth2_bitly.rb create mode 100644 lib/appwrite/models/o_auth2_box.rb create mode 100644 lib/appwrite/models/o_auth2_dailymotion.rb create mode 100644 lib/appwrite/models/o_auth2_discord.rb create mode 100644 lib/appwrite/models/o_auth2_disqus.rb create mode 100644 lib/appwrite/models/o_auth2_dropbox.rb create mode 100644 lib/appwrite/models/o_auth2_etsy.rb create mode 100644 lib/appwrite/models/o_auth2_facebook.rb create mode 100644 lib/appwrite/models/o_auth2_figma.rb create mode 100644 lib/appwrite/models/o_auth2_fusion_auth.rb create mode 100644 lib/appwrite/models/o_auth2_github.rb create mode 100644 lib/appwrite/models/o_auth2_gitlab.rb create mode 100644 lib/appwrite/models/o_auth2_google.rb create mode 100644 lib/appwrite/models/o_auth2_keycloak.rb create mode 100644 lib/appwrite/models/o_auth2_kick.rb create mode 100644 lib/appwrite/models/o_auth2_linkedin.rb create mode 100644 lib/appwrite/models/o_auth2_microsoft.rb create mode 100644 lib/appwrite/models/o_auth2_notion.rb create mode 100644 lib/appwrite/models/o_auth2_oidc.rb create mode 100644 lib/appwrite/models/o_auth2_okta.rb create mode 100644 lib/appwrite/models/o_auth2_paypal.rb create mode 100644 lib/appwrite/models/o_auth2_podio.rb create mode 100644 lib/appwrite/models/o_auth2_provider_list.rb create mode 100644 lib/appwrite/models/o_auth2_salesforce.rb create mode 100644 lib/appwrite/models/o_auth2_slack.rb create mode 100644 lib/appwrite/models/o_auth2_spotify.rb create mode 100644 lib/appwrite/models/o_auth2_stripe.rb create mode 100644 lib/appwrite/models/o_auth2_tradeshift.rb create mode 100644 lib/appwrite/models/o_auth2_twitch.rb create mode 100644 lib/appwrite/models/o_auth2_word_press.rb create mode 100644 lib/appwrite/models/o_auth2_x.rb create mode 100644 lib/appwrite/models/o_auth2_yahoo.rb create mode 100644 lib/appwrite/models/o_auth2_yandex.rb create mode 100644 lib/appwrite/models/o_auth2_zoho.rb create mode 100644 lib/appwrite/models/o_auth2_zoom.rb create mode 100644 lib/appwrite/models/policy_list.rb create mode 100644 lib/appwrite/models/policy_membership_privacy.rb create mode 100644 lib/appwrite/models/policy_password_dictionary.rb create mode 100644 lib/appwrite/models/policy_password_history.rb create mode 100644 lib/appwrite/models/policy_password_personal_data.rb create mode 100644 lib/appwrite/models/policy_session_alert.rb create mode 100644 lib/appwrite/models/policy_session_duration.rb create mode 100644 lib/appwrite/models/policy_session_invalidation.rb create mode 100644 lib/appwrite/models/policy_session_limit.rb create mode 100644 lib/appwrite/models/policy_user_limit.rb create mode 100644 lib/appwrite/models/presence.rb create mode 100644 lib/appwrite/models/presence_list.rb create mode 100644 lib/appwrite/models/proxy_rule.rb create mode 100644 lib/appwrite/models/proxy_rule_list.rb create mode 100644 lib/appwrite/services/presences.rb create mode 100644 lib/appwrite/services/proxy.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index fc2429f..22db296 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 23.1.0 + +* Added: Introduced `bigint` create/update APIs for legacy Databases attributes +* Added: Introduced `bigint` create/update APIs for `TablesDB` columns +* Updated: Extended key-list query filters with `key`, `resourceType`, `resourceId`, and `secret` + ## 23.0.0 * [BREAKING] Renamed Webhook model fields: `security` → `tls`, `httpUser` → `authUsername`, `httpPass` → `authPassword`, `signatureKey` → `secret` diff --git a/README.md b/README.md index 096a012..7da7669 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Appwrite Ruby SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.9.1-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.9.4-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-ruby/releases).** +**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-ruby/releases).** Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Ruby SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/appwrite.gemspec b/appwrite.gemspec index ee3eab3..9293ca0 100644 --- a/appwrite.gemspec +++ b/appwrite.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |spec| spec.name = 'appwrite' - spec.version = '23.0.0' + spec.version = '23.1.0' spec.license = 'BSD-3-Clause' spec.summary = 'Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API' spec.author = 'Appwrite Team' diff --git a/docs/examples/databases/create-big-int-attribute.md b/docs/examples/databases/create-big-int-attribute.md new file mode 100644 index 0000000..38013d1 --- /dev/null +++ b/docs/examples/databases/create-big-int-attribute.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +databases = Databases.new(client) + +result = databases.create_big_int_attribute( + database_id: '', + collection_id: '', + key: '', + required: false, + min: null, # optional + max: null, # optional + default: null, # optional + array: false # optional +) +``` diff --git a/docs/examples/databases/update-big-int-attribute.md b/docs/examples/databases/update-big-int-attribute.md new file mode 100644 index 0000000..ed0194b --- /dev/null +++ b/docs/examples/databases/update-big-int-attribute.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_big_int_attribute( + database_id: '', + collection_id: '', + key: '', + required: false, + default: null, + min: null, # optional + max: null, # optional + new_key: '' # optional +) +``` diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index fbd057a..de8f763 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -12,6 +12,7 @@ functions = Functions.new(client) result = functions.create_variable( function_id: '', + variable_id: '', key: '', value: '', secret: false # optional diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index ee2b479..6ca65e3 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -23,7 +23,7 @@ result = functions.create( logging: false, # optional entrypoint: '', # optional commands: '', # optional - scopes: [Scopes::SESSIONS_WRITE], # optional + scopes: [Scopes::PROJECT_READ], # optional installation_id: '', # optional provider_repository_id: '', # optional provider_branch: '', # optional diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index a670b6c..3e4b1ca 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -11,6 +11,8 @@ client = Client.new functions = Functions.new(client) result = functions.list_variables( - function_id: '' + function_id: '', + queries: [], # optional + total: false # optional ) ``` diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index 9ef8c05..d3a2a8d 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -13,7 +13,7 @@ functions = Functions.new(client) result = functions.update_variable( function_id: '', variable_id: '', - key: '', + key: '', # optional value: '', # optional secret: false # optional ) diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 8e883a5..78c70df 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -23,7 +23,7 @@ result = functions.update( logging: false, # optional entrypoint: '', # optional commands: '', # optional - scopes: [Scopes::SESSIONS_WRITE], # optional + scopes: [Scopes::PROJECT_READ], # optional installation_id: '', # optional provider_repository_id: '', # optional provider_branch: '', # optional diff --git a/docs/examples/presences/delete.md b/docs/examples/presences/delete.md new file mode 100644 index 0000000..b9b0152 --- /dev/null +++ b/docs/examples/presences/delete.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +presences = Presences.new(client) + +result = presences.delete( + presence_id: '' +) +``` diff --git a/docs/examples/presences/get.md b/docs/examples/presences/get.md new file mode 100644 index 0000000..18307cf --- /dev/null +++ b/docs/examples/presences/get.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +presences = Presences.new(client) + +result = presences.get( + presence_id: '' +) +``` diff --git a/docs/examples/presences/list.md b/docs/examples/presences/list.md new file mode 100644 index 0000000..ff2ad46 --- /dev/null +++ b/docs/examples/presences/list.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +presences = Presences.new(client) + +result = presences.list( + queries: [], # optional + total: false, # optional + ttl: 0 # optional +) +``` diff --git a/docs/examples/presences/update-presence.md b/docs/examples/presences/update-presence.md new file mode 100644 index 0000000..c54e6ac --- /dev/null +++ b/docs/examples/presences/update-presence.md @@ -0,0 +1,24 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +presences = Presences.new(client) + +result = presences.update_presence( + presence_id: '', + user_id: '', + status: '', # optional + expires_at: '2020-10-15T06:38:00.000+00:00', # optional + metadata: {}, # optional + permissions: [Permission.read(Role.any())], # optional + purge: false # optional +) +``` diff --git a/docs/examples/presences/upsert.md b/docs/examples/presences/upsert.md new file mode 100644 index 0000000..cc0801a --- /dev/null +++ b/docs/examples/presences/upsert.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Permission +include Appwrite::Role + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +presences = Presences.new(client) + +result = presences.upsert( + presence_id: '', + user_id: '', + status: '', + permissions: [Permission.read(Role.any())], # optional + expires_at: '2020-10-15T06:38:00.000+00:00', # optional + metadata: {} # optional +) +``` diff --git a/docs/examples/project/create-ephemeral-key.md b/docs/examples/project/create-ephemeral-key.md new file mode 100644 index 0000000..15d925d --- /dev/null +++ b/docs/examples/project/create-ephemeral-key.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.create_ephemeral_key( + scopes: [Scopes::PROJECT_READ], + duration: 600 +) +``` diff --git a/docs/examples/project/create-key.md b/docs/examples/project/create-key.md index 90c1502..f5f74b7 100644 --- a/docs/examples/project/create-key.md +++ b/docs/examples/project/create-key.md @@ -14,7 +14,7 @@ project = Project.new(client) result = project.create_key( key_id: '', name: '', - scopes: [Scopes::SESSIONS_WRITE], + scopes: [Scopes::PROJECT_READ], expire: '2020-10-15T06:38:00.000+00:00' # optional ) ``` diff --git a/docs/examples/project/create-mock-phone.md b/docs/examples/project/create-mock-phone.md new file mode 100644 index 0000000..73cb15a --- /dev/null +++ b/docs/examples/project/create-mock-phone.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.create_mock_phone( + number: '+12065550100', + otp: '' +) +``` diff --git a/docs/examples/project/create-smtp-test.md b/docs/examples/project/create-smtp-test.md new file mode 100644 index 0000000..1e1d1ea --- /dev/null +++ b/docs/examples/project/create-smtp-test.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.create_smtp_test( + emails: [] +) +``` diff --git a/docs/examples/project/delete-mock-phone.md b/docs/examples/project/delete-mock-phone.md new file mode 100644 index 0000000..1800c0e --- /dev/null +++ b/docs/examples/project/delete-mock-phone.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.delete_mock_phone( + number: '+12065550100' +) +``` diff --git a/docs/examples/project/delete.md b/docs/examples/project/delete.md new file mode 100644 index 0000000..bc8b3a1 --- /dev/null +++ b/docs/examples/project/delete.md @@ -0,0 +1,14 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.delete() +``` diff --git a/docs/examples/project/get-email-template.md b/docs/examples/project/get-email-template.md new file mode 100644 index 0000000..983f051 --- /dev/null +++ b/docs/examples/project/get-email-template.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.get_email_template( + template_id: EmailTemplateType::VERIFICATION, + locale: EmailTemplateLocale::AF # optional +) +``` diff --git a/docs/examples/project/get-mock-phone.md b/docs/examples/project/get-mock-phone.md new file mode 100644 index 0000000..03ef044 --- /dev/null +++ b/docs/examples/project/get-mock-phone.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.get_mock_phone( + number: '+12065550100' +) +``` diff --git a/docs/examples/project/get-o-auth-2-provider.md b/docs/examples/project/get-o-auth-2-provider.md new file mode 100644 index 0000000..18f0369 --- /dev/null +++ b/docs/examples/project/get-o-auth-2-provider.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.get_o_auth2_provider( + provider_id: ProviderId::AMAZON +) +``` diff --git a/docs/examples/project/get-policy.md b/docs/examples/project/get-policy.md new file mode 100644 index 0000000..3c42248 --- /dev/null +++ b/docs/examples/project/get-policy.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.get_policy( + policy_id: PolicyId::PASSWORD_DICTIONARY +) +``` diff --git a/docs/examples/project/list-email-templates.md b/docs/examples/project/list-email-templates.md new file mode 100644 index 0000000..3286a5d --- /dev/null +++ b/docs/examples/project/list-email-templates.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.list_email_templates( + queries: [], # optional + total: false # optional +) +``` diff --git a/docs/examples/project/list-mock-phones.md b/docs/examples/project/list-mock-phones.md new file mode 100644 index 0000000..e0f0b35 --- /dev/null +++ b/docs/examples/project/list-mock-phones.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.list_mock_phones( + queries: [], # optional + total: false # optional +) +``` diff --git a/docs/examples/project/list-o-auth-2-providers.md b/docs/examples/project/list-o-auth-2-providers.md new file mode 100644 index 0000000..b910880 --- /dev/null +++ b/docs/examples/project/list-o-auth-2-providers.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.list_o_auth2_providers( + queries: [], # optional + total: false # optional +) +``` diff --git a/docs/examples/project/list-policies.md b/docs/examples/project/list-policies.md new file mode 100644 index 0000000..b5ac0bd --- /dev/null +++ b/docs/examples/project/list-policies.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.list_policies( + queries: [], # optional + total: false # optional +) +``` diff --git a/docs/examples/project/update-auth-method.md b/docs/examples/project/update-auth-method.md new file mode 100644 index 0000000..5384dfe --- /dev/null +++ b/docs/examples/project/update-auth-method.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_auth_method( + method_id: MethodId::EMAIL_PASSWORD, + enabled: false +) +``` diff --git a/docs/examples/project/update-email-template.md b/docs/examples/project/update-email-template.md new file mode 100644 index 0000000..a20bdee --- /dev/null +++ b/docs/examples/project/update-email-template.md @@ -0,0 +1,24 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_email_template( + template_id: EmailTemplateType::VERIFICATION, + locale: EmailTemplateLocale::AF, # optional + subject: '', # optional + message: '', # optional + sender_name: '', # optional + sender_email: 'email@example.com', # optional + reply_to_email: 'email@example.com', # optional + reply_to_name: '' # optional +) +``` diff --git a/docs/examples/project/update-key.md b/docs/examples/project/update-key.md index 2655910..9c86320 100644 --- a/docs/examples/project/update-key.md +++ b/docs/examples/project/update-key.md @@ -14,7 +14,7 @@ project = Project.new(client) result = project.update_key( key_id: '', name: '', - scopes: [Scopes::SESSIONS_WRITE], + scopes: [Scopes::PROJECT_READ], expire: '2020-10-15T06:38:00.000+00:00' # optional ) ``` diff --git a/docs/examples/project/update-membership-privacy-policy.md b/docs/examples/project/update-membership-privacy-policy.md new file mode 100644 index 0000000..e29b6b9 --- /dev/null +++ b/docs/examples/project/update-membership-privacy-policy.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_membership_privacy_policy( + user_id: false, # optional + user_email: false, # optional + user_phone: false, # optional + user_name: false, # optional + user_mfa: false # optional +) +``` diff --git a/docs/examples/project/update-mock-phone.md b/docs/examples/project/update-mock-phone.md new file mode 100644 index 0000000..028cb48 --- /dev/null +++ b/docs/examples/project/update-mock-phone.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_mock_phone( + number: '+12065550100', + otp: '' +) +``` diff --git a/docs/examples/project/update-o-auth-2-amazon.md b/docs/examples/project/update-o-auth-2-amazon.md new file mode 100644 index 0000000..29861e6 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-amazon.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_amazon( + client_id: '', # optional + client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-apple.md b/docs/examples/project/update-o-auth-2-apple.md new file mode 100644 index 0000000..adb2c8d --- /dev/null +++ b/docs/examples/project/update-o-auth-2-apple.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_apple( + service_id: '', # optional + key_id: '', # optional + team_id: '', # optional + p8_file: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-auth-0.md b/docs/examples/project/update-o-auth-2-auth-0.md new file mode 100644 index 0000000..e8d11db --- /dev/null +++ b/docs/examples/project/update-o-auth-2-auth-0.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_auth0( + client_id: '', # optional + client_secret: '', # optional + endpoint: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-authentik.md b/docs/examples/project/update-o-auth-2-authentik.md new file mode 100644 index 0000000..d0ec239 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-authentik.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_authentik( + client_id: '', # optional + client_secret: '', # optional + endpoint: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-autodesk.md b/docs/examples/project/update-o-auth-2-autodesk.md new file mode 100644 index 0000000..41e2e47 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-autodesk.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_autodesk( + client_id: '', # optional + client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-bitbucket.md b/docs/examples/project/update-o-auth-2-bitbucket.md new file mode 100644 index 0000000..46c7e20 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-bitbucket.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_bitbucket( + key: '', # optional + secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-bitly.md b/docs/examples/project/update-o-auth-2-bitly.md new file mode 100644 index 0000000..12a8ab6 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-bitly.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_bitly( + client_id: '', # optional + client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-box.md b/docs/examples/project/update-o-auth-2-box.md new file mode 100644 index 0000000..5d390fe --- /dev/null +++ b/docs/examples/project/update-o-auth-2-box.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_box( + client_id: '', # optional + client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-dailymotion.md b/docs/examples/project/update-o-auth-2-dailymotion.md new file mode 100644 index 0000000..7ae5ac7 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-dailymotion.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_dailymotion( + api_key: '', # optional + api_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-discord.md b/docs/examples/project/update-o-auth-2-discord.md new file mode 100644 index 0000000..01bacd7 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-discord.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_discord( + client_id: '', # optional + client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-disqus.md b/docs/examples/project/update-o-auth-2-disqus.md new file mode 100644 index 0000000..38784b1 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-disqus.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_disqus( + public_key: '', # optional + secret_key: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-dropbox.md b/docs/examples/project/update-o-auth-2-dropbox.md new file mode 100644 index 0000000..29247c5 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-dropbox.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_dropbox( + app_key: '', # optional + app_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-etsy.md b/docs/examples/project/update-o-auth-2-etsy.md new file mode 100644 index 0000000..e3fdb38 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-etsy.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_etsy( + key_string: '', # optional + shared_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-facebook.md b/docs/examples/project/update-o-auth-2-facebook.md new file mode 100644 index 0000000..474e4b5 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-facebook.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_facebook( + app_id: '', # optional + app_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-figma.md b/docs/examples/project/update-o-auth-2-figma.md new file mode 100644 index 0000000..78ce110 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-figma.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_figma( + client_id: '', # optional + client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-fusion-auth.md b/docs/examples/project/update-o-auth-2-fusion-auth.md new file mode 100644 index 0000000..5350351 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-fusion-auth.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_fusion_auth( + client_id: '', # optional + client_secret: '', # optional + endpoint: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-git-hub.md b/docs/examples/project/update-o-auth-2-git-hub.md new file mode 100644 index 0000000..e63370f --- /dev/null +++ b/docs/examples/project/update-o-auth-2-git-hub.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_git_hub( + client_id: '', # optional + client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-gitlab.md b/docs/examples/project/update-o-auth-2-gitlab.md new file mode 100644 index 0000000..6073bc8 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-gitlab.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_gitlab( + application_id: '', # optional + secret: '', # optional + endpoint: 'https://example.com', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-google.md b/docs/examples/project/update-o-auth-2-google.md new file mode 100644 index 0000000..9cb8007 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-google.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_google( + client_id: '', # optional + client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-keycloak.md b/docs/examples/project/update-o-auth-2-keycloak.md new file mode 100644 index 0000000..63d60d1 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-keycloak.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_keycloak( + client_id: '', # optional + client_secret: '', # optional + endpoint: '', # optional + realm_name: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-kick.md b/docs/examples/project/update-o-auth-2-kick.md new file mode 100644 index 0000000..4a36804 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-kick.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_kick( + client_id: '', # optional + client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-linkedin.md b/docs/examples/project/update-o-auth-2-linkedin.md new file mode 100644 index 0000000..7a9109c --- /dev/null +++ b/docs/examples/project/update-o-auth-2-linkedin.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_linkedin( + client_id: '', # optional + primary_client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-microsoft.md b/docs/examples/project/update-o-auth-2-microsoft.md new file mode 100644 index 0000000..0a5563f --- /dev/null +++ b/docs/examples/project/update-o-auth-2-microsoft.md @@ -0,0 +1,19 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_microsoft( + application_id: '', # optional + application_secret: '', # optional + tenant: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-notion.md b/docs/examples/project/update-o-auth-2-notion.md new file mode 100644 index 0000000..f679d28 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-notion.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_notion( + oauth_client_id: '', # optional + oauth_client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-oidc.md b/docs/examples/project/update-o-auth-2-oidc.md new file mode 100644 index 0000000..44e48c7 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-oidc.md @@ -0,0 +1,22 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_oidc( + client_id: '', # optional + client_secret: '', # optional + well_known_url: 'https://example.com', # optional + authorization_url: 'https://example.com', # optional + token_url: 'https://example.com', # optional + user_info_url: 'https://example.com', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-okta.md b/docs/examples/project/update-o-auth-2-okta.md new file mode 100644 index 0000000..a020227 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-okta.md @@ -0,0 +1,20 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_okta( + client_id: '', # optional + client_secret: '', # optional + domain: '', # optional + authorization_server_id: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-paypal-sandbox.md b/docs/examples/project/update-o-auth-2-paypal-sandbox.md new file mode 100644 index 0000000..34a5cbf --- /dev/null +++ b/docs/examples/project/update-o-auth-2-paypal-sandbox.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_paypal_sandbox( + client_id: '', # optional + secret_key: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-paypal.md b/docs/examples/project/update-o-auth-2-paypal.md new file mode 100644 index 0000000..054a5c9 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-paypal.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_paypal( + client_id: '', # optional + secret_key: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-podio.md b/docs/examples/project/update-o-auth-2-podio.md new file mode 100644 index 0000000..5f58dbe --- /dev/null +++ b/docs/examples/project/update-o-auth-2-podio.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_podio( + client_id: '', # optional + client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-salesforce.md b/docs/examples/project/update-o-auth-2-salesforce.md new file mode 100644 index 0000000..f573693 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-salesforce.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_salesforce( + customer_key: '', # optional + customer_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-slack.md b/docs/examples/project/update-o-auth-2-slack.md new file mode 100644 index 0000000..fb5055d --- /dev/null +++ b/docs/examples/project/update-o-auth-2-slack.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_slack( + client_id: '', # optional + client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-spotify.md b/docs/examples/project/update-o-auth-2-spotify.md new file mode 100644 index 0000000..fc95bff --- /dev/null +++ b/docs/examples/project/update-o-auth-2-spotify.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_spotify( + client_id: '', # optional + client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-stripe.md b/docs/examples/project/update-o-auth-2-stripe.md new file mode 100644 index 0000000..21db796 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-stripe.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_stripe( + client_id: '', # optional + api_secret_key: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md b/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md new file mode 100644 index 0000000..a79d0a9 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_tradeshift_sandbox( + oauth2_client_id: '', # optional + oauth2_client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-tradeshift.md b/docs/examples/project/update-o-auth-2-tradeshift.md new file mode 100644 index 0000000..eb4536c --- /dev/null +++ b/docs/examples/project/update-o-auth-2-tradeshift.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_tradeshift( + oauth2_client_id: '', # optional + oauth2_client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-twitch.md b/docs/examples/project/update-o-auth-2-twitch.md new file mode 100644 index 0000000..c110aba --- /dev/null +++ b/docs/examples/project/update-o-auth-2-twitch.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_twitch( + client_id: '', # optional + client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-word-press.md b/docs/examples/project/update-o-auth-2-word-press.md new file mode 100644 index 0000000..90da17a --- /dev/null +++ b/docs/examples/project/update-o-auth-2-word-press.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_word_press( + client_id: '', # optional + client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-yahoo.md b/docs/examples/project/update-o-auth-2-yahoo.md new file mode 100644 index 0000000..8e2498a --- /dev/null +++ b/docs/examples/project/update-o-auth-2-yahoo.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_yahoo( + client_id: '', # optional + client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-yandex.md b/docs/examples/project/update-o-auth-2-yandex.md new file mode 100644 index 0000000..73461da --- /dev/null +++ b/docs/examples/project/update-o-auth-2-yandex.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_yandex( + client_id: '', # optional + client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-zoho.md b/docs/examples/project/update-o-auth-2-zoho.md new file mode 100644 index 0000000..2fbd5fe --- /dev/null +++ b/docs/examples/project/update-o-auth-2-zoho.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_zoho( + client_id: '', # optional + client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2-zoom.md b/docs/examples/project/update-o-auth-2-zoom.md new file mode 100644 index 0000000..c61ddd9 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-zoom.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_zoom( + client_id: '', # optional + client_secret: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-o-auth-2x.md b/docs/examples/project/update-o-auth-2x.md new file mode 100644 index 0000000..3d06d84 --- /dev/null +++ b/docs/examples/project/update-o-auth-2x.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_o_auth2_x( + customer_key: '', # optional + secret_key: '', # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-password-dictionary-policy.md b/docs/examples/project/update-password-dictionary-policy.md new file mode 100644 index 0000000..e3f152e --- /dev/null +++ b/docs/examples/project/update-password-dictionary-policy.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_password_dictionary_policy( + enabled: false +) +``` diff --git a/docs/examples/project/update-password-history-policy.md b/docs/examples/project/update-password-history-policy.md new file mode 100644 index 0000000..462ab8a --- /dev/null +++ b/docs/examples/project/update-password-history-policy.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_password_history_policy( + total: 1 +) +``` diff --git a/docs/examples/project/update-password-personal-data-policy.md b/docs/examples/project/update-password-personal-data-policy.md new file mode 100644 index 0000000..226ecc8 --- /dev/null +++ b/docs/examples/project/update-password-personal-data-policy.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_password_personal_data_policy( + enabled: false +) +``` diff --git a/docs/examples/project/update-protocol-status.md b/docs/examples/project/update-protocol.md similarity index 90% rename from docs/examples/project/update-protocol-status.md rename to docs/examples/project/update-protocol.md index 4b71bf8..f0a7a15 100644 --- a/docs/examples/project/update-protocol-status.md +++ b/docs/examples/project/update-protocol.md @@ -11,7 +11,7 @@ client = Client.new project = Project.new(client) -result = project.update_protocol_status( +result = project.update_protocol( protocol_id: ProtocolId::REST, enabled: false ) diff --git a/docs/examples/project/update-service-status.md b/docs/examples/project/update-service.md similarity index 90% rename from docs/examples/project/update-service-status.md rename to docs/examples/project/update-service.md index c44606e..889d9be 100644 --- a/docs/examples/project/update-service-status.md +++ b/docs/examples/project/update-service.md @@ -11,7 +11,7 @@ client = Client.new project = Project.new(client) -result = project.update_service_status( +result = project.update_service( service_id: ServiceId::ACCOUNT, enabled: false ) diff --git a/docs/examples/project/update-session-alert-policy.md b/docs/examples/project/update-session-alert-policy.md new file mode 100644 index 0000000..2fd2fe1 --- /dev/null +++ b/docs/examples/project/update-session-alert-policy.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_session_alert_policy( + enabled: false +) +``` diff --git a/docs/examples/project/update-session-duration-policy.md b/docs/examples/project/update-session-duration-policy.md new file mode 100644 index 0000000..5a27a77 --- /dev/null +++ b/docs/examples/project/update-session-duration-policy.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_session_duration_policy( + duration: 5 +) +``` diff --git a/docs/examples/project/update-session-invalidation-policy.md b/docs/examples/project/update-session-invalidation-policy.md new file mode 100644 index 0000000..e48d0e3 --- /dev/null +++ b/docs/examples/project/update-session-invalidation-policy.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_session_invalidation_policy( + enabled: false +) +``` diff --git a/docs/examples/project/update-session-limit-policy.md b/docs/examples/project/update-session-limit-policy.md new file mode 100644 index 0000000..38a4dfd --- /dev/null +++ b/docs/examples/project/update-session-limit-policy.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_session_limit_policy( + total: 1 +) +``` diff --git a/docs/examples/project/update-smtp.md b/docs/examples/project/update-smtp.md new file mode 100644 index 0000000..e2ad561 --- /dev/null +++ b/docs/examples/project/update-smtp.md @@ -0,0 +1,26 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_smtp( + host: '', # optional + port: null, # optional + username: '', # optional + password: '', # optional + sender_email: 'email@example.com', # optional + sender_name: '', # optional + reply_to_email: 'email@example.com', # optional + reply_to_name: '', # optional + secure: Secure::TLS, # optional + enabled: false # optional +) +``` diff --git a/docs/examples/project/update-user-limit-policy.md b/docs/examples/project/update-user-limit-policy.md new file mode 100644 index 0000000..1116435 --- /dev/null +++ b/docs/examples/project/update-user-limit-policy.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +project = Project.new(client) + +result = project.update_user_limit_policy( + total: 1 +) +``` diff --git a/docs/examples/proxy/create-api-rule.md b/docs/examples/proxy/create-api-rule.md new file mode 100644 index 0000000..8fe085a --- /dev/null +++ b/docs/examples/proxy/create-api-rule.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +proxy = Proxy.new(client) + +result = proxy.create_api_rule( + domain: '' +) +``` diff --git a/docs/examples/proxy/create-function-rule.md b/docs/examples/proxy/create-function-rule.md new file mode 100644 index 0000000..b8202a0 --- /dev/null +++ b/docs/examples/proxy/create-function-rule.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +proxy = Proxy.new(client) + +result = proxy.create_function_rule( + domain: '', + function_id: '', + branch: '' # optional +) +``` diff --git a/docs/examples/proxy/create-redirect-rule.md b/docs/examples/proxy/create-redirect-rule.md new file mode 100644 index 0000000..5f1425e --- /dev/null +++ b/docs/examples/proxy/create-redirect-rule.md @@ -0,0 +1,21 @@ +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +proxy = Proxy.new(client) + +result = proxy.create_redirect_rule( + domain: '', + url: 'https://example.com', + status_code: StatusCode::MOVED_PERMANENTLY_301, + resource_id: '', + resource_type: ProxyResourceType::SITE +) +``` diff --git a/docs/examples/proxy/create-site-rule.md b/docs/examples/proxy/create-site-rule.md new file mode 100644 index 0000000..098ca4e --- /dev/null +++ b/docs/examples/proxy/create-site-rule.md @@ -0,0 +1,18 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +proxy = Proxy.new(client) + +result = proxy.create_site_rule( + domain: '', + site_id: '', + branch: '' # optional +) +``` diff --git a/docs/examples/proxy/delete-rule.md b/docs/examples/proxy/delete-rule.md new file mode 100644 index 0000000..960cd39 --- /dev/null +++ b/docs/examples/proxy/delete-rule.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +proxy = Proxy.new(client) + +result = proxy.delete_rule( + rule_id: '' +) +``` diff --git a/docs/examples/proxy/get-rule.md b/docs/examples/proxy/get-rule.md new file mode 100644 index 0000000..47c03f1 --- /dev/null +++ b/docs/examples/proxy/get-rule.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +proxy = Proxy.new(client) + +result = proxy.get_rule( + rule_id: '' +) +``` diff --git a/docs/examples/proxy/list-rules.md b/docs/examples/proxy/list-rules.md new file mode 100644 index 0000000..858fc6c --- /dev/null +++ b/docs/examples/proxy/list-rules.md @@ -0,0 +1,17 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +proxy = Proxy.new(client) + +result = proxy.list_rules( + queries: [], # optional + total: false # optional +) +``` diff --git a/docs/examples/proxy/update-rule-status.md b/docs/examples/proxy/update-rule-status.md new file mode 100644 index 0000000..13192b4 --- /dev/null +++ b/docs/examples/proxy/update-rule-status.md @@ -0,0 +1,16 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +proxy = Proxy.new(client) + +result = proxy.update_rule_status( + rule_id: '' +) +``` diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md index 36182dd..8c87843 100644 --- a/docs/examples/sites/create-variable.md +++ b/docs/examples/sites/create-variable.md @@ -12,6 +12,7 @@ sites = Sites.new(client) result = sites.create_variable( site_id: '', + variable_id: '', key: '', value: '', secret: false # optional diff --git a/docs/examples/sites/list-variables.md b/docs/examples/sites/list-variables.md index 68ffe6f..ad4daf1 100644 --- a/docs/examples/sites/list-variables.md +++ b/docs/examples/sites/list-variables.md @@ -11,6 +11,8 @@ client = Client.new sites = Sites.new(client) result = sites.list_variables( - site_id: '' + site_id: '', + queries: [], # optional + total: false # optional ) ``` diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md index 3471973..f273613 100644 --- a/docs/examples/sites/update-variable.md +++ b/docs/examples/sites/update-variable.md @@ -13,7 +13,7 @@ sites = Sites.new(client) result = sites.update_variable( site_id: '', variable_id: '', - key: '', + key: '', # optional value: '', # optional secret: false # optional ) diff --git a/docs/examples/tablesdb/create-big-int-column.md b/docs/examples/tablesdb/create-big-int-column.md new file mode 100644 index 0000000..76c9529 --- /dev/null +++ b/docs/examples/tablesdb/create-big-int-column.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.create_big_int_column( + database_id: '', + table_id: '', + key: '', + required: false, + min: null, # optional + max: null, # optional + default: null, # optional + array: false # optional +) +``` diff --git a/docs/examples/tablesdb/update-big-int-column.md b/docs/examples/tablesdb/update-big-int-column.md new file mode 100644 index 0000000..2ce0077 --- /dev/null +++ b/docs/examples/tablesdb/update-big-int-column.md @@ -0,0 +1,23 @@ +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +tables_db = TablesDB.new(client) + +result = tables_db.update_big_int_column( + database_id: '', + table_id: '', + key: '', + required: false, + default: null, + min: null, # optional + max: null, # optional + new_key: '' # optional +) +``` diff --git a/lib/appwrite.rb b/lib/appwrite.rb index 7d8921b..860e8e7 100644 --- a/lib/appwrite.rb +++ b/lib/appwrite.rb @@ -15,6 +15,7 @@ require_relative 'appwrite/models/row_list' require_relative 'appwrite/models/document_list' +require_relative 'appwrite/models/presence_list' require_relative 'appwrite/models/table_list' require_relative 'appwrite/models/collection_list' require_relative 'appwrite/models/database_list' @@ -43,7 +44,11 @@ require_relative 'appwrite/models/currency_list' require_relative 'appwrite/models/phone_list' require_relative 'appwrite/models/variable_list' +require_relative 'appwrite/models/mock_number_list' +require_relative 'appwrite/models/policy_list' +require_relative 'appwrite/models/email_template_list' require_relative 'appwrite/models/health_status_list' +require_relative 'appwrite/models/proxy_rule_list' require_relative 'appwrite/models/locale_code_list' require_relative 'appwrite/models/provider_list' require_relative 'appwrite/models/message_list' @@ -57,6 +62,7 @@ require_relative 'appwrite/models/attribute_list' require_relative 'appwrite/models/attribute_string' require_relative 'appwrite/models/attribute_integer' +require_relative 'appwrite/models/attribute_bigint' require_relative 'appwrite/models/attribute_float' require_relative 'appwrite/models/attribute_boolean' require_relative 'appwrite/models/attribute_email' @@ -76,6 +82,7 @@ require_relative 'appwrite/models/column_list' require_relative 'appwrite/models/column_string' require_relative 'appwrite/models/column_integer' +require_relative 'appwrite/models/column_bigint' require_relative 'appwrite/models/column_float' require_relative 'appwrite/models/column_boolean' require_relative 'appwrite/models/column_email' @@ -95,6 +102,7 @@ require_relative 'appwrite/models/column_index' require_relative 'appwrite/models/row' require_relative 'appwrite/models/document' +require_relative 'appwrite/models/presence' require_relative 'appwrite/models/log' require_relative 'appwrite/models/user' require_relative 'appwrite/models/algo_md5' @@ -126,8 +134,59 @@ require_relative 'appwrite/models/project' require_relative 'appwrite/models/webhook' require_relative 'appwrite/models/key' +require_relative 'appwrite/models/ephemeral_key' require_relative 'appwrite/models/dev_key' require_relative 'appwrite/models/mock_number' +require_relative 'appwrite/models/o_auth2_github' +require_relative 'appwrite/models/o_auth2_discord' +require_relative 'appwrite/models/o_auth2_figma' +require_relative 'appwrite/models/o_auth2_dropbox' +require_relative 'appwrite/models/o_auth2_dailymotion' +require_relative 'appwrite/models/o_auth2_bitbucket' +require_relative 'appwrite/models/o_auth2_bitly' +require_relative 'appwrite/models/o_auth2_box' +require_relative 'appwrite/models/o_auth2_autodesk' +require_relative 'appwrite/models/o_auth2_google' +require_relative 'appwrite/models/o_auth2_zoom' +require_relative 'appwrite/models/o_auth2_zoho' +require_relative 'appwrite/models/o_auth2_yandex' +require_relative 'appwrite/models/o_auth2_x' +require_relative 'appwrite/models/o_auth2_word_press' +require_relative 'appwrite/models/o_auth2_twitch' +require_relative 'appwrite/models/o_auth2_stripe' +require_relative 'appwrite/models/o_auth2_spotify' +require_relative 'appwrite/models/o_auth2_slack' +require_relative 'appwrite/models/o_auth2_podio' +require_relative 'appwrite/models/o_auth2_notion' +require_relative 'appwrite/models/o_auth2_salesforce' +require_relative 'appwrite/models/o_auth2_yahoo' +require_relative 'appwrite/models/o_auth2_linkedin' +require_relative 'appwrite/models/o_auth2_disqus' +require_relative 'appwrite/models/o_auth2_amazon' +require_relative 'appwrite/models/o_auth2_etsy' +require_relative 'appwrite/models/o_auth2_facebook' +require_relative 'appwrite/models/o_auth2_tradeshift' +require_relative 'appwrite/models/o_auth2_paypal' +require_relative 'appwrite/models/o_auth2_gitlab' +require_relative 'appwrite/models/o_auth2_authentik' +require_relative 'appwrite/models/o_auth2_auth0' +require_relative 'appwrite/models/o_auth2_fusion_auth' +require_relative 'appwrite/models/o_auth2_keycloak' +require_relative 'appwrite/models/o_auth2_oidc' +require_relative 'appwrite/models/o_auth2_okta' +require_relative 'appwrite/models/o_auth2_kick' +require_relative 'appwrite/models/o_auth2_apple' +require_relative 'appwrite/models/o_auth2_microsoft' +require_relative 'appwrite/models/o_auth2_provider_list' +require_relative 'appwrite/models/policy_password_dictionary' +require_relative 'appwrite/models/policy_password_history' +require_relative 'appwrite/models/policy_password_personal_data' +require_relative 'appwrite/models/policy_session_alert' +require_relative 'appwrite/models/policy_session_duration' +require_relative 'appwrite/models/policy_session_invalidation' +require_relative 'appwrite/models/policy_session_limit' +require_relative 'appwrite/models/policy_user_limit' +require_relative 'appwrite/models/policy_membership_privacy' require_relative 'appwrite/models/auth_provider' require_relative 'appwrite/models/platform_web' require_relative 'appwrite/models/platform_apple' @@ -148,6 +207,8 @@ require_relative 'appwrite/models/health_time' require_relative 'appwrite/models/headers' require_relative 'appwrite/models/specification' +require_relative 'appwrite/models/proxy_rule' +require_relative 'appwrite/models/email_template' require_relative 'appwrite/models/mfa_challenge' require_relative 'appwrite/models/mfa_recovery_codes' require_relative 'appwrite/models/mfa_type' @@ -193,8 +254,16 @@ require_relative 'appwrite/enums/name' require_relative 'appwrite/enums/message_priority' require_relative 'appwrite/enums/smtp_encryption' +require_relative 'appwrite/enums/method_id' +require_relative 'appwrite/enums/provider_id' +require_relative 'appwrite/enums/policy_id' require_relative 'appwrite/enums/protocol_id' require_relative 'appwrite/enums/service_id' +require_relative 'appwrite/enums/secure' +require_relative 'appwrite/enums/email_template_type' +require_relative 'appwrite/enums/email_template_locale' +require_relative 'appwrite/enums/status_code' +require_relative 'appwrite/enums/proxy_resource_type' require_relative 'appwrite/enums/framework' require_relative 'appwrite/enums/build_runtime' require_relative 'appwrite/enums/adapter' @@ -213,6 +282,8 @@ require_relative 'appwrite/enums/platform_type' require_relative 'appwrite/enums/health_antivirus_status' require_relative 'appwrite/enums/health_check_status' +require_relative 'appwrite/enums/proxy_rule_deployment_resource_type' +require_relative 'appwrite/enums/proxy_rule_status' require_relative 'appwrite/enums/message_status' require_relative 'appwrite/services/account' @@ -225,7 +296,9 @@ require_relative 'appwrite/services/health' require_relative 'appwrite/services/locale' require_relative 'appwrite/services/messaging' +require_relative 'appwrite/services/presences' require_relative 'appwrite/services/project' +require_relative 'appwrite/services/proxy' require_relative 'appwrite/services/sites' require_relative 'appwrite/services/storage' require_relative 'appwrite/services/tables_db' diff --git a/lib/appwrite/client.rb b/lib/appwrite/client.rb index b484676..6b25218 100644 --- a/lib/appwrite/client.rb +++ b/lib/appwrite/client.rb @@ -15,8 +15,8 @@ def initialize 'x-sdk-name'=> 'Ruby', 'x-sdk-platform'=> 'server', 'x-sdk-language'=> 'ruby', - 'x-sdk-version'=> '23.0.0', - 'X-Appwrite-Response-Format' => '1.9.1' + 'x-sdk-version'=> '23.1.0', + 'X-Appwrite-Response-Format' => '1.9.4' } @endpoint = 'https://cloud.appwrite.io/v1' end @@ -97,6 +97,32 @@ def set_forwarded_user_agent(value) self end + # Set DevKey + # + # Your secret dev API key + # + # @param [String] value The value to set for the DevKey header + # + # @return [self] + def set_dev_key(value) + add_header('x-appwrite-dev-key', value) + + self + end + + # Set Cookie + # + # The user cookie to authenticate with. Used by SDKs that forward an incoming Cookie header in server-side runtimes. + # + # @param [String] value The value to set for the Cookie header + # + # @return [self] + def set_cookie(value) + add_header('cookie', value) + + self + end + # Set ImpersonateUserId # # Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. diff --git a/lib/appwrite/enums/build_runtime.rb b/lib/appwrite/enums/build_runtime.rb index 26109d4..3555194 100644 --- a/lib/appwrite/enums/build_runtime.rb +++ b/lib/appwrite/enums/build_runtime.rb @@ -81,6 +81,7 @@ module BuildRuntime GO_1_24 = 'go-1.24' GO_1_25 = 'go-1.25' GO_1_26 = 'go-1.26' + RUST_1_83 = 'rust-1.83' STATIC_1 = 'static-1' FLUTTER_3_24 = 'flutter-3.24' FLUTTER_3_27 = 'flutter-3.27' diff --git a/lib/appwrite/enums/email_template_locale.rb b/lib/appwrite/enums/email_template_locale.rb new file mode 100644 index 0000000..26f345d --- /dev/null +++ b/lib/appwrite/enums/email_template_locale.rb @@ -0,0 +1,137 @@ +module Appwrite + module Enums + module EmailTemplateLocale + AF = 'af' + AR_AE = 'ar-ae' + AR_BH = 'ar-bh' + AR_DZ = 'ar-dz' + AR_EG = 'ar-eg' + AR_IQ = 'ar-iq' + AR_JO = 'ar-jo' + AR_KW = 'ar-kw' + AR_LB = 'ar-lb' + AR_LY = 'ar-ly' + AR_MA = 'ar-ma' + AR_OM = 'ar-om' + AR_QA = 'ar-qa' + AR_SA = 'ar-sa' + AR_SY = 'ar-sy' + AR_TN = 'ar-tn' + AR_YE = 'ar-ye' + AS = 'as' + AZ = 'az' + BE = 'be' + BG = 'bg' + BH = 'bh' + BN = 'bn' + BS = 'bs' + CA = 'ca' + CS = 'cs' + CY = 'cy' + DA = 'da' + DE = 'de' + DE_AT = 'de-at' + DE_CH = 'de-ch' + DE_LI = 'de-li' + DE_LU = 'de-lu' + EL = 'el' + EN = 'en' + EN_AU = 'en-au' + EN_BZ = 'en-bz' + EN_CA = 'en-ca' + EN_GB = 'en-gb' + EN_IE = 'en-ie' + EN_JM = 'en-jm' + EN_NZ = 'en-nz' + EN_TT = 'en-tt' + EN_US = 'en-us' + EN_ZA = 'en-za' + EO = 'eo' + ES = 'es' + ES_AR = 'es-ar' + ES_BO = 'es-bo' + ES_CL = 'es-cl' + ES_CO = 'es-co' + ES_CR = 'es-cr' + ES_DO = 'es-do' + ES_EC = 'es-ec' + ES_GT = 'es-gt' + ES_HN = 'es-hn' + ES_MX = 'es-mx' + ES_NI = 'es-ni' + ES_PA = 'es-pa' + ES_PE = 'es-pe' + ES_PR = 'es-pr' + ES_PY = 'es-py' + ES_SV = 'es-sv' + ES_UY = 'es-uy' + ES_VE = 'es-ve' + ET = 'et' + EU = 'eu' + FA = 'fa' + FI = 'fi' + FO = 'fo' + FR = 'fr' + FR_BE = 'fr-be' + FR_CA = 'fr-ca' + FR_CH = 'fr-ch' + FR_LU = 'fr-lu' + GA = 'ga' + GD = 'gd' + HE = 'he' + HI = 'hi' + HR = 'hr' + HU = 'hu' + ID = 'id' + IS = 'is' + IT = 'it' + IT_CH = 'it-ch' + JA = 'ja' + JI = 'ji' + KO = 'ko' + KU = 'ku' + LT = 'lt' + LV = 'lv' + MK = 'mk' + ML = 'ml' + MS = 'ms' + MT = 'mt' + NB = 'nb' + NE = 'ne' + NL = 'nl' + NL_BE = 'nl-be' + NN = 'nn' + NO = 'no' + PA = 'pa' + PL = 'pl' + PT = 'pt' + PT_BR = 'pt-br' + RM = 'rm' + RO = 'ro' + RO_MD = 'ro-md' + RU = 'ru' + RU_MD = 'ru-md' + SB = 'sb' + SK = 'sk' + SL = 'sl' + SQ = 'sq' + SR = 'sr' + SV = 'sv' + SV_FI = 'sv-fi' + TH = 'th' + TN = 'tn' + TR = 'tr' + TS = 'ts' + UA = 'ua' + UR = 'ur' + VE = 've' + VI = 'vi' + XH = 'xh' + ZH_CN = 'zh-cn' + ZH_HK = 'zh-hk' + ZH_SG = 'zh-sg' + ZH_TW = 'zh-tw' + ZU = 'zu' + end + end +end \ No newline at end of file diff --git a/lib/appwrite/enums/email_template_type.rb b/lib/appwrite/enums/email_template_type.rb new file mode 100644 index 0000000..f5a2888 --- /dev/null +++ b/lib/appwrite/enums/email_template_type.rb @@ -0,0 +1,13 @@ +module Appwrite + module Enums + module EmailTemplateType + VERIFICATION = 'verification' + MAGICSESSION = 'magicSession' + RECOVERY = 'recovery' + INVITATION = 'invitation' + MFACHALLENGE = 'mfaChallenge' + SESSIONALERT = 'sessionAlert' + OTPSESSION = 'otpSession' + end + end +end \ No newline at end of file diff --git a/lib/appwrite/enums/method_id.rb b/lib/appwrite/enums/method_id.rb new file mode 100644 index 0000000..724bc21 --- /dev/null +++ b/lib/appwrite/enums/method_id.rb @@ -0,0 +1,13 @@ +module Appwrite + module Enums + module MethodId + EMAIL_PASSWORD = 'email-password' + MAGIC_URL = 'magic-url' + EMAIL_OTP = 'email-otp' + ANONYMOUS = 'anonymous' + INVITES = 'invites' + JWT = 'jwt' + PHONE = 'phone' + end + end +end \ No newline at end of file diff --git a/lib/appwrite/enums/o_auth_provider.rb b/lib/appwrite/enums/o_auth_provider.rb index daa11b5..5962eb4 100644 --- a/lib/appwrite/enums/o_auth_provider.rb +++ b/lib/appwrite/enums/o_auth_provider.rb @@ -16,9 +16,12 @@ module OAuthProvider ETSY = 'etsy' FACEBOOK = 'facebook' FIGMA = 'figma' + FUSIONAUTH = 'fusionauth' GITHUB = 'github' GITLAB = 'gitlab' GOOGLE = 'google' + KEYCLOAK = 'keycloak' + KICK = 'kick' LINKEDIN = 'linkedin' MICROSOFT = 'microsoft' NOTION = 'notion' diff --git a/lib/appwrite/enums/policy_id.rb b/lib/appwrite/enums/policy_id.rb new file mode 100644 index 0000000..a7bbb33 --- /dev/null +++ b/lib/appwrite/enums/policy_id.rb @@ -0,0 +1,15 @@ +module Appwrite + module Enums + module PolicyId + PASSWORD_DICTIONARY = 'password-dictionary' + PASSWORD_HISTORY = 'password-history' + PASSWORD_PERSONAL_DATA = 'password-personal-data' + SESSION_ALERT = 'session-alert' + SESSION_DURATION = 'session-duration' + SESSION_INVALIDATION = 'session-invalidation' + SESSION_LIMIT = 'session-limit' + USER_LIMIT = 'user-limit' + MEMBERSHIP_PRIVACY = 'membership-privacy' + end + end +end \ No newline at end of file diff --git a/lib/appwrite/enums/provider_id.rb b/lib/appwrite/enums/provider_id.rb new file mode 100644 index 0000000..8dcb1e9 --- /dev/null +++ b/lib/appwrite/enums/provider_id.rb @@ -0,0 +1,53 @@ +module Appwrite + module Enums + module ProviderId + AMAZON = 'amazon' + APPLE = 'apple' + AUTH0 = 'auth0' + AUTHENTIK = 'authentik' + AUTODESK = 'autodesk' + BITBUCKET = 'bitbucket' + BITLY = 'bitly' + BOX = 'box' + DAILYMOTION = 'dailymotion' + DISCORD = 'discord' + DISQUS = 'disqus' + DROPBOX = 'dropbox' + ETSY = 'etsy' + FACEBOOK = 'facebook' + FIGMA = 'figma' + FUSIONAUTH = 'fusionauth' + GITHUB = 'github' + GITLAB = 'gitlab' + GOOGLE = 'google' + KEYCLOAK = 'keycloak' + KICK = 'kick' + LINKEDIN = 'linkedin' + MICROSOFT = 'microsoft' + NOTION = 'notion' + OIDC = 'oidc' + OKTA = 'okta' + PAYPAL = 'paypal' + PAYPALSANDBOX = 'paypalSandbox' + PODIO = 'podio' + SALESFORCE = 'salesforce' + SLACK = 'slack' + SPOTIFY = 'spotify' + STRIPE = 'stripe' + TRADESHIFT = 'tradeshift' + TRADESHIFTBOX = 'tradeshiftBox' + TWITCH = 'twitch' + WORDPRESS = 'wordpress' + X = 'x' + YAHOO = 'yahoo' + YAMMER = 'yammer' + YANDEX = 'yandex' + ZOHO = 'zoho' + ZOOM = 'zoom' + MOCK = 'mock' + MOCK_UNVERIFIED = 'mock-unverified' + GITHUBIMAGINE = 'githubImagine' + GOOGLEIMAGINE = 'googleImagine' + end + end +end \ No newline at end of file diff --git a/lib/appwrite/enums/proxy_resource_type.rb b/lib/appwrite/enums/proxy_resource_type.rb new file mode 100644 index 0000000..9518515 --- /dev/null +++ b/lib/appwrite/enums/proxy_resource_type.rb @@ -0,0 +1,8 @@ +module Appwrite + module Enums + module ProxyResourceType + SITE = 'site' + FUNCTION = 'function' + end + end +end \ No newline at end of file diff --git a/lib/appwrite/enums/proxy_rule_deployment_resource_type.rb b/lib/appwrite/enums/proxy_rule_deployment_resource_type.rb new file mode 100644 index 0000000..a532af8 --- /dev/null +++ b/lib/appwrite/enums/proxy_rule_deployment_resource_type.rb @@ -0,0 +1,8 @@ +module Appwrite + module Enums + module ProxyRuleDeploymentResourceType + FUNCTION = 'function' + SITE = 'site' + end + end +end \ No newline at end of file diff --git a/lib/appwrite/enums/proxy_rule_status.rb b/lib/appwrite/enums/proxy_rule_status.rb new file mode 100644 index 0000000..50ee0fa --- /dev/null +++ b/lib/appwrite/enums/proxy_rule_status.rb @@ -0,0 +1,9 @@ +module Appwrite + module Enums + module ProxyRuleStatus + UNVERIFIED = 'unverified' + VERIFYING = 'verifying' + VERIFIED = 'verified' + end + end +end \ No newline at end of file diff --git a/lib/appwrite/enums/runtime.rb b/lib/appwrite/enums/runtime.rb index 9931d93..29d254c 100644 --- a/lib/appwrite/enums/runtime.rb +++ b/lib/appwrite/enums/runtime.rb @@ -81,6 +81,7 @@ module Runtime GO_1_24 = 'go-1.24' GO_1_25 = 'go-1.25' GO_1_26 = 'go-1.26' + RUST_1_83 = 'rust-1.83' STATIC_1 = 'static-1' FLUTTER_3_24 = 'flutter-3.24' FLUTTER_3_27 = 'flutter-3.27' diff --git a/lib/appwrite/enums/scopes.rb b/lib/appwrite/enums/scopes.rb index ed699cd..3c18dfc 100644 --- a/lib/appwrite/enums/scopes.rb +++ b/lib/appwrite/enums/scopes.rb @@ -1,73 +1,88 @@ module Appwrite module Enums module Scopes - SESSIONS_WRITE = 'sessions.write' + PROJECT_READ = 'project.read' + PROJECT_WRITE = 'project.write' + KEYS_READ = 'keys.read' + KEYS_WRITE = 'keys.write' + PLATFORMS_READ = 'platforms.read' + PLATFORMS_WRITE = 'platforms.write' + MOCKS_READ = 'mocks.read' + MOCKS_WRITE = 'mocks.write' + POLICIES_READ = 'policies.read' + POLICIES_WRITE = 'policies.write' + PROJECT_POLICIES_READ = 'project.policies.read' + PROJECT_POLICIES_WRITE = 'project.policies.write' + TEMPLATES_READ = 'templates.read' + TEMPLATES_WRITE = 'templates.write' + OAUTH2_READ = 'oauth2.read' + OAUTH2_WRITE = 'oauth2.write' USERS_READ = 'users.read' USERS_WRITE = 'users.write' + SESSIONS_READ = 'sessions.read' + SESSIONS_WRITE = 'sessions.write' TEAMS_READ = 'teams.read' TEAMS_WRITE = 'teams.write' DATABASES_READ = 'databases.read' DATABASES_WRITE = 'databases.write' - COLLECTIONS_READ = 'collections.read' - COLLECTIONS_WRITE = 'collections.write' TABLES_READ = 'tables.read' TABLES_WRITE = 'tables.write' - ATTRIBUTES_READ = 'attributes.read' - ATTRIBUTES_WRITE = 'attributes.write' COLUMNS_READ = 'columns.read' COLUMNS_WRITE = 'columns.write' INDEXES_READ = 'indexes.read' INDEXES_WRITE = 'indexes.write' - DOCUMENTS_READ = 'documents.read' - DOCUMENTS_WRITE = 'documents.write' ROWS_READ = 'rows.read' ROWS_WRITE = 'rows.write' - FILES_READ = 'files.read' - FILES_WRITE = 'files.write' + COLLECTIONS_READ = 'collections.read' + COLLECTIONS_WRITE = 'collections.write' + ATTRIBUTES_READ = 'attributes.read' + ATTRIBUTES_WRITE = 'attributes.write' + DOCUMENTS_READ = 'documents.read' + DOCUMENTS_WRITE = 'documents.write' BUCKETS_READ = 'buckets.read' BUCKETS_WRITE = 'buckets.write' + FILES_READ = 'files.read' + FILES_WRITE = 'files.write' + TOKENS_READ = 'tokens.read' + TOKENS_WRITE = 'tokens.write' FUNCTIONS_READ = 'functions.read' FUNCTIONS_WRITE = 'functions.write' + EXECUTIONS_READ = 'executions.read' + EXECUTIONS_WRITE = 'executions.write' + EXECUTION_READ = 'execution.read' + EXECUTION_WRITE = 'execution.write' SITES_READ = 'sites.read' SITES_WRITE = 'sites.write' LOG_READ = 'log.read' LOG_WRITE = 'log.write' - EXECUTION_READ = 'execution.read' - EXECUTION_WRITE = 'execution.write' - LOCALE_READ = 'locale.read' - AVATARS_READ = 'avatars.read' - HEALTH_READ = 'health.read' PROVIDERS_READ = 'providers.read' PROVIDERS_WRITE = 'providers.write' - MESSAGES_READ = 'messages.read' - MESSAGES_WRITE = 'messages.write' TOPICS_READ = 'topics.read' TOPICS_WRITE = 'topics.write' SUBSCRIBERS_READ = 'subscribers.read' SUBSCRIBERS_WRITE = 'subscribers.write' TARGETS_READ = 'targets.read' TARGETS_WRITE = 'targets.write' + MESSAGES_READ = 'messages.read' + MESSAGES_WRITE = 'messages.write' RULES_READ = 'rules.read' RULES_WRITE = 'rules.write' - SCHEDULES_READ = 'schedules.read' - SCHEDULES_WRITE = 'schedules.write' + WEBHOOKS_READ = 'webhooks.read' + WEBHOOKS_WRITE = 'webhooks.write' + LOCALE_READ = 'locale.read' + AVATARS_READ = 'avatars.read' + HEALTH_READ = 'health.read' + ASSISTANT_READ = 'assistant.read' MIGRATIONS_READ = 'migrations.read' MIGRATIONS_WRITE = 'migrations.write' + SCHEDULES_READ = 'schedules.read' + SCHEDULES_WRITE = 'schedules.write' VCS_READ = 'vcs.read' VCS_WRITE = 'vcs.write' - ASSISTANT_READ = 'assistant.read' - TOKENS_READ = 'tokens.read' - TOKENS_WRITE = 'tokens.write' - WEBHOOKS_READ = 'webhooks.read' - WEBHOOKS_WRITE = 'webhooks.write' - PROJECT_READ = 'project.read' - PROJECT_WRITE = 'project.write' - KEYS_READ = 'keys.read' - KEYS_WRITE = 'keys.write' - PLATFORMS_READ = 'platforms.read' - PLATFORMS_WRITE = 'platforms.write' - POLICIES_WRITE = 'policies.write' - POLICIES_READ = 'policies.read' + PRESENCES_READ = 'presences.read' + PRESENCES_WRITE = 'presences.write' + BACKUPS_POLICIES_READ = 'backups.policies.read' + BACKUPS_POLICIES_WRITE = 'backups.policies.write' ARCHIVES_READ = 'archives.read' ARCHIVES_WRITE = 'archives.write' RESTORATIONS_READ = 'restorations.read' diff --git a/lib/appwrite/enums/secure.rb b/lib/appwrite/enums/secure.rb new file mode 100644 index 0000000..b3bf869 --- /dev/null +++ b/lib/appwrite/enums/secure.rb @@ -0,0 +1,8 @@ +module Appwrite + module Enums + module Secure + TLS = 'tls' + SSL = 'ssl' + end + end +end \ No newline at end of file diff --git a/lib/appwrite/enums/status_code.rb b/lib/appwrite/enums/status_code.rb new file mode 100644 index 0000000..1e11476 --- /dev/null +++ b/lib/appwrite/enums/status_code.rb @@ -0,0 +1,10 @@ +module Appwrite + module Enums + module StatusCode + MOVED_PERMANENTLY_301 = '301' + FOUND_302 = '302' + TEMPORARY_REDIRECT_307 = '307' + PERMANENT_REDIRECT_308 = '308' + end + end +end \ No newline at end of file diff --git a/lib/appwrite/models/attribute_bigint.rb b/lib/appwrite/models/attribute_bigint.rb new file mode 100644 index 0000000..b564ca6 --- /dev/null +++ b/lib/appwrite/models/attribute_bigint.rb @@ -0,0 +1,96 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class AttributeBigint + attr_reader :key + attr_reader :type + attr_reader :status + attr_reader :error + attr_reader :required + attr_reader :array + attr_reader :created_at + attr_reader :updated_at + attr_reader :min + attr_reader :max + attr_reader :default + + def initialize( + key:, + type:, + status:, + error:, + required:, + array: , + created_at:, + updated_at:, + min: , + max: , + default: + ) + @key = key + @type = type + @status = validate_status(status) + @error = error + @required = required + @array = array + @created_at = created_at + @updated_at = updated_at + @min = min + @max = max + @default = default + end + + def self.from(map:) + AttributeBigint.new( + key: map["key"], + type: map["type"], + status: map["status"], + error: map["error"], + required: map["required"], + array: map["array"], + created_at: map["$createdAt"], + updated_at: map["$updatedAt"], + min: map["min"], + max: map["max"], + default: map["default"] + ) + end + + def to_map + { + "key": @key, + "type": @type, + "status": @status, + "error": @error, + "required": @required, + "array": @array, + "$createdAt": @created_at, + "$updatedAt": @updated_at, + "min": @min, + "max": @max, + "default": @default + } + end + + private + + def validate_status(status) + valid_status = [ + Appwrite::Enums::AttributeStatus::AVAILABLE, + Appwrite::Enums::AttributeStatus::PROCESSING, + Appwrite::Enums::AttributeStatus::DELETING, + Appwrite::Enums::AttributeStatus::STUCK, + Appwrite::Enums::AttributeStatus::FAILED, + ] + + unless valid_status.include?(status) + raise ArgumentError, "Invalid " + status + ". Must be one of: " + valid_status.join(', ') + end + + status + end + + end + end +end diff --git a/lib/appwrite/models/block.rb b/lib/appwrite/models/block.rb index 578ff10..0a95a3f 100644 --- a/lib/appwrite/models/block.rb +++ b/lib/appwrite/models/block.rb @@ -8,19 +8,34 @@ class Block attr_reader :resource_id attr_reader :reason attr_reader :expired_at + attr_reader :project_name + attr_reader :region + attr_reader :organization_name + attr_reader :organization_id + attr_reader :billing_plan def initialize( created_at:, resource_type:, resource_id:, reason: , - expired_at: + expired_at: , + project_name:, + region:, + organization_name:, + organization_id:, + billing_plan: ) @created_at = created_at @resource_type = resource_type @resource_id = resource_id @reason = reason @expired_at = expired_at + @project_name = project_name + @region = region + @organization_name = organization_name + @organization_id = organization_id + @billing_plan = billing_plan end def self.from(map:) @@ -29,7 +44,12 @@ def self.from(map:) resource_type: map["resourceType"], resource_id: map["resourceId"], reason: map["reason"], - expired_at: map["expiredAt"] + expired_at: map["expiredAt"], + project_name: map["projectName"], + region: map["region"], + organization_name: map["organizationName"], + organization_id: map["organizationId"], + billing_plan: map["billingPlan"] ) end @@ -39,7 +59,12 @@ def to_map "resourceType": @resource_type, "resourceId": @resource_id, "reason": @reason, - "expiredAt": @expired_at + "expiredAt": @expired_at, + "projectName": @project_name, + "region": @region, + "organizationName": @organization_name, + "organizationId": @organization_id, + "billingPlan": @billing_plan } end end diff --git a/lib/appwrite/models/column_bigint.rb b/lib/appwrite/models/column_bigint.rb new file mode 100644 index 0000000..ee45efd --- /dev/null +++ b/lib/appwrite/models/column_bigint.rb @@ -0,0 +1,96 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class ColumnBigint + attr_reader :key + attr_reader :type + attr_reader :status + attr_reader :error + attr_reader :required + attr_reader :array + attr_reader :created_at + attr_reader :updated_at + attr_reader :min + attr_reader :max + attr_reader :default + + def initialize( + key:, + type:, + status:, + error:, + required:, + array: , + created_at:, + updated_at:, + min: , + max: , + default: + ) + @key = key + @type = type + @status = validate_status(status) + @error = error + @required = required + @array = array + @created_at = created_at + @updated_at = updated_at + @min = min + @max = max + @default = default + end + + def self.from(map:) + ColumnBigint.new( + key: map["key"], + type: map["type"], + status: map["status"], + error: map["error"], + required: map["required"], + array: map["array"], + created_at: map["$createdAt"], + updated_at: map["$updatedAt"], + min: map["min"], + max: map["max"], + default: map["default"] + ) + end + + def to_map + { + "key": @key, + "type": @type, + "status": @status, + "error": @error, + "required": @required, + "array": @array, + "$createdAt": @created_at, + "$updatedAt": @updated_at, + "min": @min, + "max": @max, + "default": @default + } + end + + private + + def validate_status(status) + valid_status = [ + Appwrite::Enums::ColumnStatus::AVAILABLE, + Appwrite::Enums::ColumnStatus::PROCESSING, + Appwrite::Enums::ColumnStatus::DELETING, + Appwrite::Enums::ColumnStatus::STUCK, + Appwrite::Enums::ColumnStatus::FAILED, + ] + + unless valid_status.include?(status) + raise ArgumentError, "Invalid " + status + ". Must be one of: " + valid_status.join(', ') + end + + status + end + + end + end +end diff --git a/lib/appwrite/models/email_template.rb b/lib/appwrite/models/email_template.rb new file mode 100644 index 0000000..0e3d0a7 --- /dev/null +++ b/lib/appwrite/models/email_template.rb @@ -0,0 +1,62 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class EmailTemplate + attr_reader :template_id + attr_reader :locale + attr_reader :message + attr_reader :sender_name + attr_reader :sender_email + attr_reader :reply_to_email + attr_reader :reply_to_name + attr_reader :subject + + def initialize( + template_id:, + locale:, + message:, + sender_name:, + sender_email:, + reply_to_email:, + reply_to_name:, + subject: + ) + @template_id = template_id + @locale = locale + @message = message + @sender_name = sender_name + @sender_email = sender_email + @reply_to_email = reply_to_email + @reply_to_name = reply_to_name + @subject = subject + end + + def self.from(map:) + EmailTemplate.new( + template_id: map["templateId"], + locale: map["locale"], + message: map["message"], + sender_name: map["senderName"], + sender_email: map["senderEmail"], + reply_to_email: map["replyToEmail"], + reply_to_name: map["replyToName"], + subject: map["subject"] + ) + end + + def to_map + { + "templateId": @template_id, + "locale": @locale, + "message": @message, + "senderName": @sender_name, + "senderEmail": @sender_email, + "replyToEmail": @reply_to_email, + "replyToName": @reply_to_name, + "subject": @subject + } + end + end + end +end diff --git a/lib/appwrite/models/email_template_list.rb b/lib/appwrite/models/email_template_list.rb new file mode 100644 index 0000000..a881b3e --- /dev/null +++ b/lib/appwrite/models/email_template_list.rb @@ -0,0 +1,32 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class EmailTemplateList + attr_reader :total + attr_reader :templates + + def initialize( + total:, + templates: + ) + @total = total + @templates = templates + end + + def self.from(map:) + EmailTemplateList.new( + total: map["total"], + templates: map["templates"].map { |it| EmailTemplate.from(map: it) } + ) + end + + def to_map + { + "total": @total, + "templates": @templates.map { |it| it.to_map } + } + end + end + end +end diff --git a/lib/appwrite/models/ephemeral_key.rb b/lib/appwrite/models/ephemeral_key.rb new file mode 100644 index 0000000..e974df0 --- /dev/null +++ b/lib/appwrite/models/ephemeral_key.rb @@ -0,0 +1,67 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class EphemeralKey + attr_reader :id + attr_reader :created_at + attr_reader :updated_at + attr_reader :name + attr_reader :expire + attr_reader :scopes + attr_reader :secret + attr_reader :accessed_at + attr_reader :sdks + + def initialize( + id:, + created_at:, + updated_at:, + name:, + expire:, + scopes:, + secret:, + accessed_at:, + sdks: + ) + @id = id + @created_at = created_at + @updated_at = updated_at + @name = name + @expire = expire + @scopes = scopes + @secret = secret + @accessed_at = accessed_at + @sdks = sdks + end + + def self.from(map:) + EphemeralKey.new( + id: map["$id"], + created_at: map["$createdAt"], + updated_at: map["$updatedAt"], + name: map["name"], + expire: map["expire"], + scopes: map["scopes"], + secret: map["secret"], + accessed_at: map["accessedAt"], + sdks: map["sdks"] + ) + end + + def to_map + { + "$id": @id, + "$createdAt": @created_at, + "$updatedAt": @updated_at, + "name": @name, + "expire": @expire, + "scopes": @scopes, + "secret": @secret, + "accessedAt": @accessed_at, + "sdks": @sdks + } + end + end + end +end diff --git a/lib/appwrite/models/membership.rb b/lib/appwrite/models/membership.rb index a8cf1b0..0de5658 100644 --- a/lib/appwrite/models/membership.rb +++ b/lib/appwrite/models/membership.rb @@ -9,6 +9,7 @@ class Membership attr_reader :user_id attr_reader :user_name attr_reader :user_email + attr_reader :user_phone attr_reader :team_id attr_reader :team_name attr_reader :invited @@ -24,6 +25,7 @@ def initialize( user_id:, user_name:, user_email:, + user_phone:, team_id:, team_name:, invited:, @@ -38,6 +40,7 @@ def initialize( @user_id = user_id @user_name = user_name @user_email = user_email + @user_phone = user_phone @team_id = team_id @team_name = team_name @invited = invited @@ -55,6 +58,7 @@ def self.from(map:) user_id: map["userId"], user_name: map["userName"], user_email: map["userEmail"], + user_phone: map["userPhone"], team_id: map["teamId"], team_name: map["teamName"], invited: map["invited"], @@ -73,6 +77,7 @@ def to_map "userId": @user_id, "userName": @user_name, "userEmail": @user_email, + "userPhone": @user_phone, "teamId": @team_id, "teamName": @team_name, "invited": @invited, diff --git a/lib/appwrite/models/mock_number.rb b/lib/appwrite/models/mock_number.rb index 3a353bc..8ef41d4 100644 --- a/lib/appwrite/models/mock_number.rb +++ b/lib/appwrite/models/mock_number.rb @@ -3,28 +3,38 @@ module Appwrite module Models class MockNumber - attr_reader :phone + attr_reader :number attr_reader :otp + attr_reader :created_at + attr_reader :updated_at def initialize( - phone:, - otp: + number:, + otp:, + created_at:, + updated_at: ) - @phone = phone + @number = number @otp = otp + @created_at = created_at + @updated_at = updated_at end def self.from(map:) MockNumber.new( - phone: map["phone"], - otp: map["otp"] + number: map["number"], + otp: map["otp"], + created_at: map["$createdAt"], + updated_at: map["$updatedAt"] ) end def to_map { - "phone": @phone, - "otp": @otp + "number": @number, + "otp": @otp, + "$createdAt": @created_at, + "$updatedAt": @updated_at } end end diff --git a/lib/appwrite/models/mock_number_list.rb b/lib/appwrite/models/mock_number_list.rb new file mode 100644 index 0000000..6971dcf --- /dev/null +++ b/lib/appwrite/models/mock_number_list.rb @@ -0,0 +1,32 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class MockNumberList + attr_reader :total + attr_reader :mock_numbers + + def initialize( + total:, + mock_numbers: + ) + @total = total + @mock_numbers = mock_numbers + end + + def self.from(map:) + MockNumberList.new( + total: map["total"], + mock_numbers: map["mockNumbers"].map { |it| MockNumber.from(map: it) } + ) + end + + def to_map + { + "total": @total, + "mockNumbers": @mock_numbers.map { |it| it.to_map } + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_amazon.rb b/lib/appwrite/models/o_auth2_amazon.rb new file mode 100644 index 0000000..23a99cd --- /dev/null +++ b/lib/appwrite/models/o_auth2_amazon.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Amazon + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + + def initialize( + id:, + enabled:, + client_id:, + client_secret: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + end + + def self.from(map:) + OAuth2Amazon.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_apple.rb b/lib/appwrite/models/o_auth2_apple.rb new file mode 100644 index 0000000..94d0715 --- /dev/null +++ b/lib/appwrite/models/o_auth2_apple.rb @@ -0,0 +1,52 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Apple + attr_reader :id + attr_reader :enabled + attr_reader :service_id + attr_reader :key_id + attr_reader :team_id + attr_reader :p8_file + + def initialize( + id:, + enabled:, + service_id:, + key_id:, + team_id:, + p8_file: + ) + @id = id + @enabled = enabled + @service_id = service_id + @key_id = key_id + @team_id = team_id + @p8_file = p8_file + end + + def self.from(map:) + OAuth2Apple.new( + id: map["$id"], + enabled: map["enabled"], + service_id: map["serviceId"], + key_id: map["keyId"], + team_id: map["teamId"], + p8_file: map["p8File"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "serviceId": @service_id, + "keyId": @key_id, + "teamId": @team_id, + "p8File": @p8_file + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_auth0.rb b/lib/appwrite/models/o_auth2_auth0.rb new file mode 100644 index 0000000..9771a9b --- /dev/null +++ b/lib/appwrite/models/o_auth2_auth0.rb @@ -0,0 +1,47 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Auth0 + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + attr_reader :endpoint + + def initialize( + id:, + enabled:, + client_id:, + client_secret:, + endpoint: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + @endpoint = endpoint + end + + def self.from(map:) + OAuth2Auth0.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"], + endpoint: map["endpoint"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret, + "endpoint": @endpoint + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_authentik.rb b/lib/appwrite/models/o_auth2_authentik.rb new file mode 100644 index 0000000..67d497e --- /dev/null +++ b/lib/appwrite/models/o_auth2_authentik.rb @@ -0,0 +1,47 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Authentik + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + attr_reader :endpoint + + def initialize( + id:, + enabled:, + client_id:, + client_secret:, + endpoint: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + @endpoint = endpoint + end + + def self.from(map:) + OAuth2Authentik.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"], + endpoint: map["endpoint"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret, + "endpoint": @endpoint + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_autodesk.rb b/lib/appwrite/models/o_auth2_autodesk.rb new file mode 100644 index 0000000..a91f74f --- /dev/null +++ b/lib/appwrite/models/o_auth2_autodesk.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Autodesk + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + + def initialize( + id:, + enabled:, + client_id:, + client_secret: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + end + + def self.from(map:) + OAuth2Autodesk.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_bitbucket.rb b/lib/appwrite/models/o_auth2_bitbucket.rb new file mode 100644 index 0000000..d5dd4a2 --- /dev/null +++ b/lib/appwrite/models/o_auth2_bitbucket.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Bitbucket + attr_reader :id + attr_reader :enabled + attr_reader :key + attr_reader :secret + + def initialize( + id:, + enabled:, + key:, + secret: + ) + @id = id + @enabled = enabled + @key = key + @secret = secret + end + + def self.from(map:) + OAuth2Bitbucket.new( + id: map["$id"], + enabled: map["enabled"], + key: map["key"], + secret: map["secret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "key": @key, + "secret": @secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_bitly.rb b/lib/appwrite/models/o_auth2_bitly.rb new file mode 100644 index 0000000..9a49b91 --- /dev/null +++ b/lib/appwrite/models/o_auth2_bitly.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Bitly + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + + def initialize( + id:, + enabled:, + client_id:, + client_secret: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + end + + def self.from(map:) + OAuth2Bitly.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_box.rb b/lib/appwrite/models/o_auth2_box.rb new file mode 100644 index 0000000..7334f39 --- /dev/null +++ b/lib/appwrite/models/o_auth2_box.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Box + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + + def initialize( + id:, + enabled:, + client_id:, + client_secret: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + end + + def self.from(map:) + OAuth2Box.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_dailymotion.rb b/lib/appwrite/models/o_auth2_dailymotion.rb new file mode 100644 index 0000000..97c2d13 --- /dev/null +++ b/lib/appwrite/models/o_auth2_dailymotion.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Dailymotion + attr_reader :id + attr_reader :enabled + attr_reader :api_key + attr_reader :api_secret + + def initialize( + id:, + enabled:, + api_key:, + api_secret: + ) + @id = id + @enabled = enabled + @api_key = api_key + @api_secret = api_secret + end + + def self.from(map:) + OAuth2Dailymotion.new( + id: map["$id"], + enabled: map["enabled"], + api_key: map["apiKey"], + api_secret: map["apiSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "apiKey": @api_key, + "apiSecret": @api_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_discord.rb b/lib/appwrite/models/o_auth2_discord.rb new file mode 100644 index 0000000..9e87ca1 --- /dev/null +++ b/lib/appwrite/models/o_auth2_discord.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Discord + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + + def initialize( + id:, + enabled:, + client_id:, + client_secret: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + end + + def self.from(map:) + OAuth2Discord.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_disqus.rb b/lib/appwrite/models/o_auth2_disqus.rb new file mode 100644 index 0000000..eab489b --- /dev/null +++ b/lib/appwrite/models/o_auth2_disqus.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Disqus + attr_reader :id + attr_reader :enabled + attr_reader :public_key + attr_reader :secret_key + + def initialize( + id:, + enabled:, + public_key:, + secret_key: + ) + @id = id + @enabled = enabled + @public_key = public_key + @secret_key = secret_key + end + + def self.from(map:) + OAuth2Disqus.new( + id: map["$id"], + enabled: map["enabled"], + public_key: map["publicKey"], + secret_key: map["secretKey"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "publicKey": @public_key, + "secretKey": @secret_key + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_dropbox.rb b/lib/appwrite/models/o_auth2_dropbox.rb new file mode 100644 index 0000000..1a4df15 --- /dev/null +++ b/lib/appwrite/models/o_auth2_dropbox.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Dropbox + attr_reader :id + attr_reader :enabled + attr_reader :app_key + attr_reader :app_secret + + def initialize( + id:, + enabled:, + app_key:, + app_secret: + ) + @id = id + @enabled = enabled + @app_key = app_key + @app_secret = app_secret + end + + def self.from(map:) + OAuth2Dropbox.new( + id: map["$id"], + enabled: map["enabled"], + app_key: map["appKey"], + app_secret: map["appSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "appKey": @app_key, + "appSecret": @app_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_etsy.rb b/lib/appwrite/models/o_auth2_etsy.rb new file mode 100644 index 0000000..340209c --- /dev/null +++ b/lib/appwrite/models/o_auth2_etsy.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Etsy + attr_reader :id + attr_reader :enabled + attr_reader :key_string + attr_reader :shared_secret + + def initialize( + id:, + enabled:, + key_string:, + shared_secret: + ) + @id = id + @enabled = enabled + @key_string = key_string + @shared_secret = shared_secret + end + + def self.from(map:) + OAuth2Etsy.new( + id: map["$id"], + enabled: map["enabled"], + key_string: map["keyString"], + shared_secret: map["sharedSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "keyString": @key_string, + "sharedSecret": @shared_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_facebook.rb b/lib/appwrite/models/o_auth2_facebook.rb new file mode 100644 index 0000000..e734110 --- /dev/null +++ b/lib/appwrite/models/o_auth2_facebook.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Facebook + attr_reader :id + attr_reader :enabled + attr_reader :app_id + attr_reader :app_secret + + def initialize( + id:, + enabled:, + app_id:, + app_secret: + ) + @id = id + @enabled = enabled + @app_id = app_id + @app_secret = app_secret + end + + def self.from(map:) + OAuth2Facebook.new( + id: map["$id"], + enabled: map["enabled"], + app_id: map["appId"], + app_secret: map["appSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "appId": @app_id, + "appSecret": @app_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_figma.rb b/lib/appwrite/models/o_auth2_figma.rb new file mode 100644 index 0000000..15b6ea4 --- /dev/null +++ b/lib/appwrite/models/o_auth2_figma.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Figma + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + + def initialize( + id:, + enabled:, + client_id:, + client_secret: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + end + + def self.from(map:) + OAuth2Figma.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_fusion_auth.rb b/lib/appwrite/models/o_auth2_fusion_auth.rb new file mode 100644 index 0000000..6cd6951 --- /dev/null +++ b/lib/appwrite/models/o_auth2_fusion_auth.rb @@ -0,0 +1,47 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2FusionAuth + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + attr_reader :endpoint + + def initialize( + id:, + enabled:, + client_id:, + client_secret:, + endpoint: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + @endpoint = endpoint + end + + def self.from(map:) + OAuth2FusionAuth.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"], + endpoint: map["endpoint"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret, + "endpoint": @endpoint + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_github.rb b/lib/appwrite/models/o_auth2_github.rb new file mode 100644 index 0000000..afc1190 --- /dev/null +++ b/lib/appwrite/models/o_auth2_github.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Github + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + + def initialize( + id:, + enabled:, + client_id:, + client_secret: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + end + + def self.from(map:) + OAuth2Github.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_gitlab.rb b/lib/appwrite/models/o_auth2_gitlab.rb new file mode 100644 index 0000000..9786ddd --- /dev/null +++ b/lib/appwrite/models/o_auth2_gitlab.rb @@ -0,0 +1,47 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Gitlab + attr_reader :id + attr_reader :enabled + attr_reader :application_id + attr_reader :secret + attr_reader :endpoint + + def initialize( + id:, + enabled:, + application_id:, + secret:, + endpoint: + ) + @id = id + @enabled = enabled + @application_id = application_id + @secret = secret + @endpoint = endpoint + end + + def self.from(map:) + OAuth2Gitlab.new( + id: map["$id"], + enabled: map["enabled"], + application_id: map["applicationId"], + secret: map["secret"], + endpoint: map["endpoint"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "applicationId": @application_id, + "secret": @secret, + "endpoint": @endpoint + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_google.rb b/lib/appwrite/models/o_auth2_google.rb new file mode 100644 index 0000000..1796909 --- /dev/null +++ b/lib/appwrite/models/o_auth2_google.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Google + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + + def initialize( + id:, + enabled:, + client_id:, + client_secret: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + end + + def self.from(map:) + OAuth2Google.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_keycloak.rb b/lib/appwrite/models/o_auth2_keycloak.rb new file mode 100644 index 0000000..a6ab0bf --- /dev/null +++ b/lib/appwrite/models/o_auth2_keycloak.rb @@ -0,0 +1,52 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Keycloak + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + attr_reader :endpoint + attr_reader :realm_name + + def initialize( + id:, + enabled:, + client_id:, + client_secret:, + endpoint:, + realm_name: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + @endpoint = endpoint + @realm_name = realm_name + end + + def self.from(map:) + OAuth2Keycloak.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"], + endpoint: map["endpoint"], + realm_name: map["realmName"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret, + "endpoint": @endpoint, + "realmName": @realm_name + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_kick.rb b/lib/appwrite/models/o_auth2_kick.rb new file mode 100644 index 0000000..59d3e2a --- /dev/null +++ b/lib/appwrite/models/o_auth2_kick.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Kick + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + + def initialize( + id:, + enabled:, + client_id:, + client_secret: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + end + + def self.from(map:) + OAuth2Kick.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_linkedin.rb b/lib/appwrite/models/o_auth2_linkedin.rb new file mode 100644 index 0000000..b807439 --- /dev/null +++ b/lib/appwrite/models/o_auth2_linkedin.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Linkedin + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :primary_client_secret + + def initialize( + id:, + enabled:, + client_id:, + primary_client_secret: + ) + @id = id + @enabled = enabled + @client_id = client_id + @primary_client_secret = primary_client_secret + end + + def self.from(map:) + OAuth2Linkedin.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + primary_client_secret: map["primaryClientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "primaryClientSecret": @primary_client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_microsoft.rb b/lib/appwrite/models/o_auth2_microsoft.rb new file mode 100644 index 0000000..563e62d --- /dev/null +++ b/lib/appwrite/models/o_auth2_microsoft.rb @@ -0,0 +1,47 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Microsoft + attr_reader :id + attr_reader :enabled + attr_reader :application_id + attr_reader :application_secret + attr_reader :tenant + + def initialize( + id:, + enabled:, + application_id:, + application_secret:, + tenant: + ) + @id = id + @enabled = enabled + @application_id = application_id + @application_secret = application_secret + @tenant = tenant + end + + def self.from(map:) + OAuth2Microsoft.new( + id: map["$id"], + enabled: map["enabled"], + application_id: map["applicationId"], + application_secret: map["applicationSecret"], + tenant: map["tenant"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "applicationId": @application_id, + "applicationSecret": @application_secret, + "tenant": @tenant + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_notion.rb b/lib/appwrite/models/o_auth2_notion.rb new file mode 100644 index 0000000..4b0c001 --- /dev/null +++ b/lib/appwrite/models/o_auth2_notion.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Notion + attr_reader :id + attr_reader :enabled + attr_reader :oauth_client_id + attr_reader :oauth_client_secret + + def initialize( + id:, + enabled:, + oauth_client_id:, + oauth_client_secret: + ) + @id = id + @enabled = enabled + @oauth_client_id = oauth_client_id + @oauth_client_secret = oauth_client_secret + end + + def self.from(map:) + OAuth2Notion.new( + id: map["$id"], + enabled: map["enabled"], + oauth_client_id: map["oauthClientId"], + oauth_client_secret: map["oauthClientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "oauthClientId": @oauth_client_id, + "oauthClientSecret": @oauth_client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_oidc.rb b/lib/appwrite/models/o_auth2_oidc.rb new file mode 100644 index 0000000..52d78f8 --- /dev/null +++ b/lib/appwrite/models/o_auth2_oidc.rb @@ -0,0 +1,62 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Oidc + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + attr_reader :well_known_url + attr_reader :authorization_url + attr_reader :token_url + attr_reader :user_info_url + + def initialize( + id:, + enabled:, + client_id:, + client_secret:, + well_known_url:, + authorization_url:, + token_url:, + user_info_url: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + @well_known_url = well_known_url + @authorization_url = authorization_url + @token_url = token_url + @user_info_url = user_info_url + end + + def self.from(map:) + OAuth2Oidc.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"], + well_known_url: map["wellKnownURL"], + authorization_url: map["authorizationURL"], + token_url: map["tokenURL"], + user_info_url: map["userInfoURL"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret, + "wellKnownURL": @well_known_url, + "authorizationURL": @authorization_url, + "tokenURL": @token_url, + "userInfoURL": @user_info_url + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_okta.rb b/lib/appwrite/models/o_auth2_okta.rb new file mode 100644 index 0000000..df3c6b6 --- /dev/null +++ b/lib/appwrite/models/o_auth2_okta.rb @@ -0,0 +1,52 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Okta + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + attr_reader :domain + attr_reader :authorization_server_id + + def initialize( + id:, + enabled:, + client_id:, + client_secret:, + domain:, + authorization_server_id: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + @domain = domain + @authorization_server_id = authorization_server_id + end + + def self.from(map:) + OAuth2Okta.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"], + domain: map["domain"], + authorization_server_id: map["authorizationServerId"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret, + "domain": @domain, + "authorizationServerId": @authorization_server_id + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_paypal.rb b/lib/appwrite/models/o_auth2_paypal.rb new file mode 100644 index 0000000..fd1bbcd --- /dev/null +++ b/lib/appwrite/models/o_auth2_paypal.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Paypal + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :secret_key + + def initialize( + id:, + enabled:, + client_id:, + secret_key: + ) + @id = id + @enabled = enabled + @client_id = client_id + @secret_key = secret_key + end + + def self.from(map:) + OAuth2Paypal.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + secret_key: map["secretKey"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "secretKey": @secret_key + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_podio.rb b/lib/appwrite/models/o_auth2_podio.rb new file mode 100644 index 0000000..9e02118 --- /dev/null +++ b/lib/appwrite/models/o_auth2_podio.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Podio + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + + def initialize( + id:, + enabled:, + client_id:, + client_secret: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + end + + def self.from(map:) + OAuth2Podio.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_provider_list.rb b/lib/appwrite/models/o_auth2_provider_list.rb new file mode 100644 index 0000000..9dce4cc --- /dev/null +++ b/lib/appwrite/models/o_auth2_provider_list.rb @@ -0,0 +1,32 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2ProviderList + attr_reader :total + attr_reader :providers + + def initialize( + total:, + providers: + ) + @total = total + @providers = providers + end + + def self.from(map:) + OAuth2ProviderList.new( + total: map["total"], + providers: map["providers"] + ) + end + + def to_map + { + "total": @total, + "providers": @providers + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_salesforce.rb b/lib/appwrite/models/o_auth2_salesforce.rb new file mode 100644 index 0000000..db8956f --- /dev/null +++ b/lib/appwrite/models/o_auth2_salesforce.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Salesforce + attr_reader :id + attr_reader :enabled + attr_reader :customer_key + attr_reader :customer_secret + + def initialize( + id:, + enabled:, + customer_key:, + customer_secret: + ) + @id = id + @enabled = enabled + @customer_key = customer_key + @customer_secret = customer_secret + end + + def self.from(map:) + OAuth2Salesforce.new( + id: map["$id"], + enabled: map["enabled"], + customer_key: map["customerKey"], + customer_secret: map["customerSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "customerKey": @customer_key, + "customerSecret": @customer_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_slack.rb b/lib/appwrite/models/o_auth2_slack.rb new file mode 100644 index 0000000..a65252d --- /dev/null +++ b/lib/appwrite/models/o_auth2_slack.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Slack + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + + def initialize( + id:, + enabled:, + client_id:, + client_secret: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + end + + def self.from(map:) + OAuth2Slack.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_spotify.rb b/lib/appwrite/models/o_auth2_spotify.rb new file mode 100644 index 0000000..63f402c --- /dev/null +++ b/lib/appwrite/models/o_auth2_spotify.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Spotify + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + + def initialize( + id:, + enabled:, + client_id:, + client_secret: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + end + + def self.from(map:) + OAuth2Spotify.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_stripe.rb b/lib/appwrite/models/o_auth2_stripe.rb new file mode 100644 index 0000000..0caceb2 --- /dev/null +++ b/lib/appwrite/models/o_auth2_stripe.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Stripe + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :api_secret_key + + def initialize( + id:, + enabled:, + client_id:, + api_secret_key: + ) + @id = id + @enabled = enabled + @client_id = client_id + @api_secret_key = api_secret_key + end + + def self.from(map:) + OAuth2Stripe.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + api_secret_key: map["apiSecretKey"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "apiSecretKey": @api_secret_key + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_tradeshift.rb b/lib/appwrite/models/o_auth2_tradeshift.rb new file mode 100644 index 0000000..7ae5202 --- /dev/null +++ b/lib/appwrite/models/o_auth2_tradeshift.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Tradeshift + attr_reader :id + attr_reader :enabled + attr_reader :oauth2_client_id + attr_reader :oauth2_client_secret + + def initialize( + id:, + enabled:, + oauth2_client_id:, + oauth2_client_secret: + ) + @id = id + @enabled = enabled + @oauth2_client_id = oauth2_client_id + @oauth2_client_secret = oauth2_client_secret + end + + def self.from(map:) + OAuth2Tradeshift.new( + id: map["$id"], + enabled: map["enabled"], + oauth2_client_id: map["oauth2ClientId"], + oauth2_client_secret: map["oauth2ClientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "oauth2ClientId": @oauth2_client_id, + "oauth2ClientSecret": @oauth2_client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_twitch.rb b/lib/appwrite/models/o_auth2_twitch.rb new file mode 100644 index 0000000..9801c8e --- /dev/null +++ b/lib/appwrite/models/o_auth2_twitch.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Twitch + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + + def initialize( + id:, + enabled:, + client_id:, + client_secret: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + end + + def self.from(map:) + OAuth2Twitch.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_word_press.rb b/lib/appwrite/models/o_auth2_word_press.rb new file mode 100644 index 0000000..689f4cc --- /dev/null +++ b/lib/appwrite/models/o_auth2_word_press.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2WordPress + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + + def initialize( + id:, + enabled:, + client_id:, + client_secret: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + end + + def self.from(map:) + OAuth2WordPress.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_x.rb b/lib/appwrite/models/o_auth2_x.rb new file mode 100644 index 0000000..0819e3a --- /dev/null +++ b/lib/appwrite/models/o_auth2_x.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2X + attr_reader :id + attr_reader :enabled + attr_reader :customer_key + attr_reader :secret_key + + def initialize( + id:, + enabled:, + customer_key:, + secret_key: + ) + @id = id + @enabled = enabled + @customer_key = customer_key + @secret_key = secret_key + end + + def self.from(map:) + OAuth2X.new( + id: map["$id"], + enabled: map["enabled"], + customer_key: map["customerKey"], + secret_key: map["secretKey"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "customerKey": @customer_key, + "secretKey": @secret_key + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_yahoo.rb b/lib/appwrite/models/o_auth2_yahoo.rb new file mode 100644 index 0000000..afe6f7f --- /dev/null +++ b/lib/appwrite/models/o_auth2_yahoo.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Yahoo + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + + def initialize( + id:, + enabled:, + client_id:, + client_secret: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + end + + def self.from(map:) + OAuth2Yahoo.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_yandex.rb b/lib/appwrite/models/o_auth2_yandex.rb new file mode 100644 index 0000000..2f8438e --- /dev/null +++ b/lib/appwrite/models/o_auth2_yandex.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Yandex + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + + def initialize( + id:, + enabled:, + client_id:, + client_secret: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + end + + def self.from(map:) + OAuth2Yandex.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_zoho.rb b/lib/appwrite/models/o_auth2_zoho.rb new file mode 100644 index 0000000..629879a --- /dev/null +++ b/lib/appwrite/models/o_auth2_zoho.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Zoho + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + + def initialize( + id:, + enabled:, + client_id:, + client_secret: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + end + + def self.from(map:) + OAuth2Zoho.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/o_auth2_zoom.rb b/lib/appwrite/models/o_auth2_zoom.rb new file mode 100644 index 0000000..74f8f26 --- /dev/null +++ b/lib/appwrite/models/o_auth2_zoom.rb @@ -0,0 +1,42 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class OAuth2Zoom + attr_reader :id + attr_reader :enabled + attr_reader :client_id + attr_reader :client_secret + + def initialize( + id:, + enabled:, + client_id:, + client_secret: + ) + @id = id + @enabled = enabled + @client_id = client_id + @client_secret = client_secret + end + + def self.from(map:) + OAuth2Zoom.new( + id: map["$id"], + enabled: map["enabled"], + client_id: map["clientId"], + client_secret: map["clientSecret"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled, + "clientId": @client_id, + "clientSecret": @client_secret + } + end + end + end +end diff --git a/lib/appwrite/models/policy_list.rb b/lib/appwrite/models/policy_list.rb new file mode 100644 index 0000000..afcebe5 --- /dev/null +++ b/lib/appwrite/models/policy_list.rb @@ -0,0 +1,32 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class PolicyList + attr_reader :total + attr_reader :policies + + def initialize( + total:, + policies: + ) + @total = total + @policies = policies + end + + def self.from(map:) + PolicyList.new( + total: map["total"], + policies: map["policies"] + ) + end + + def to_map + { + "total": @total, + "policies": @policies + } + end + end + end +end diff --git a/lib/appwrite/models/policy_membership_privacy.rb b/lib/appwrite/models/policy_membership_privacy.rb new file mode 100644 index 0000000..d18f76f --- /dev/null +++ b/lib/appwrite/models/policy_membership_privacy.rb @@ -0,0 +1,52 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class PolicyMembershipPrivacy + attr_reader :id + attr_reader :user_id + attr_reader :user_email + attr_reader :user_phone + attr_reader :user_name + attr_reader :user_mfa + + def initialize( + id:, + user_id:, + user_email:, + user_phone:, + user_name:, + user_mfa: + ) + @id = id + @user_id = user_id + @user_email = user_email + @user_phone = user_phone + @user_name = user_name + @user_mfa = user_mfa + end + + def self.from(map:) + PolicyMembershipPrivacy.new( + id: map["$id"], + user_id: map["userId"], + user_email: map["userEmail"], + user_phone: map["userPhone"], + user_name: map["userName"], + user_mfa: map["userMFA"] + ) + end + + def to_map + { + "$id": @id, + "userId": @user_id, + "userEmail": @user_email, + "userPhone": @user_phone, + "userName": @user_name, + "userMFA": @user_mfa + } + end + end + end +end diff --git a/lib/appwrite/models/policy_password_dictionary.rb b/lib/appwrite/models/policy_password_dictionary.rb new file mode 100644 index 0000000..a668c5a --- /dev/null +++ b/lib/appwrite/models/policy_password_dictionary.rb @@ -0,0 +1,32 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class PolicyPasswordDictionary + attr_reader :id + attr_reader :enabled + + def initialize( + id:, + enabled: + ) + @id = id + @enabled = enabled + end + + def self.from(map:) + PolicyPasswordDictionary.new( + id: map["$id"], + enabled: map["enabled"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled + } + end + end + end +end diff --git a/lib/appwrite/models/policy_password_history.rb b/lib/appwrite/models/policy_password_history.rb new file mode 100644 index 0000000..1eca50a --- /dev/null +++ b/lib/appwrite/models/policy_password_history.rb @@ -0,0 +1,32 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class PolicyPasswordHistory + attr_reader :id + attr_reader :total + + def initialize( + id:, + total: + ) + @id = id + @total = total + end + + def self.from(map:) + PolicyPasswordHistory.new( + id: map["$id"], + total: map["total"] + ) + end + + def to_map + { + "$id": @id, + "total": @total + } + end + end + end +end diff --git a/lib/appwrite/models/policy_password_personal_data.rb b/lib/appwrite/models/policy_password_personal_data.rb new file mode 100644 index 0000000..cd05e9d --- /dev/null +++ b/lib/appwrite/models/policy_password_personal_data.rb @@ -0,0 +1,32 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class PolicyPasswordPersonalData + attr_reader :id + attr_reader :enabled + + def initialize( + id:, + enabled: + ) + @id = id + @enabled = enabled + end + + def self.from(map:) + PolicyPasswordPersonalData.new( + id: map["$id"], + enabled: map["enabled"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled + } + end + end + end +end diff --git a/lib/appwrite/models/policy_session_alert.rb b/lib/appwrite/models/policy_session_alert.rb new file mode 100644 index 0000000..b97135f --- /dev/null +++ b/lib/appwrite/models/policy_session_alert.rb @@ -0,0 +1,32 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class PolicySessionAlert + attr_reader :id + attr_reader :enabled + + def initialize( + id:, + enabled: + ) + @id = id + @enabled = enabled + end + + def self.from(map:) + PolicySessionAlert.new( + id: map["$id"], + enabled: map["enabled"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled + } + end + end + end +end diff --git a/lib/appwrite/models/policy_session_duration.rb b/lib/appwrite/models/policy_session_duration.rb new file mode 100644 index 0000000..a20b886 --- /dev/null +++ b/lib/appwrite/models/policy_session_duration.rb @@ -0,0 +1,32 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class PolicySessionDuration + attr_reader :id + attr_reader :duration + + def initialize( + id:, + duration: + ) + @id = id + @duration = duration + end + + def self.from(map:) + PolicySessionDuration.new( + id: map["$id"], + duration: map["duration"] + ) + end + + def to_map + { + "$id": @id, + "duration": @duration + } + end + end + end +end diff --git a/lib/appwrite/models/policy_session_invalidation.rb b/lib/appwrite/models/policy_session_invalidation.rb new file mode 100644 index 0000000..a2c1831 --- /dev/null +++ b/lib/appwrite/models/policy_session_invalidation.rb @@ -0,0 +1,32 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class PolicySessionInvalidation + attr_reader :id + attr_reader :enabled + + def initialize( + id:, + enabled: + ) + @id = id + @enabled = enabled + end + + def self.from(map:) + PolicySessionInvalidation.new( + id: map["$id"], + enabled: map["enabled"] + ) + end + + def to_map + { + "$id": @id, + "enabled": @enabled + } + end + end + end +end diff --git a/lib/appwrite/models/policy_session_limit.rb b/lib/appwrite/models/policy_session_limit.rb new file mode 100644 index 0000000..8c06cde --- /dev/null +++ b/lib/appwrite/models/policy_session_limit.rb @@ -0,0 +1,32 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class PolicySessionLimit + attr_reader :id + attr_reader :total + + def initialize( + id:, + total: + ) + @id = id + @total = total + end + + def self.from(map:) + PolicySessionLimit.new( + id: map["$id"], + total: map["total"] + ) + end + + def to_map + { + "$id": @id, + "total": @total + } + end + end + end +end diff --git a/lib/appwrite/models/policy_user_limit.rb b/lib/appwrite/models/policy_user_limit.rb new file mode 100644 index 0000000..976fc68 --- /dev/null +++ b/lib/appwrite/models/policy_user_limit.rb @@ -0,0 +1,32 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class PolicyUserLimit + attr_reader :id + attr_reader :total + + def initialize( + id:, + total: + ) + @id = id + @total = total + end + + def self.from(map:) + PolicyUserLimit.new( + id: map["$id"], + total: map["total"] + ) + end + + def to_map + { + "$id": @id, + "total": @total + } + end + end + end +end diff --git a/lib/appwrite/models/presence.rb b/lib/appwrite/models/presence.rb new file mode 100644 index 0000000..063197a --- /dev/null +++ b/lib/appwrite/models/presence.rb @@ -0,0 +1,81 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class Presence + attr_reader :id + attr_reader :sequence + attr_reader :created_at + attr_reader :updated_at + attr_reader :permissions + attr_reader :user_internal_id + attr_reader :user_id + attr_reader :status + attr_reader :source + attr_reader :expires_at + attr_reader :data + + def initialize( + id:, + sequence:, + created_at:, + updated_at:, + permissions:, + user_internal_id:, + user_id:, + status: , + source:, + expires_at: , + data: + ) + @id = id + @sequence = sequence + @created_at = created_at + @updated_at = updated_at + @permissions = permissions + @user_internal_id = user_internal_id + @user_id = user_id + @status = status + @source = source + @expires_at = expires_at + @data = data + end + + def self.from(map:) + Presence.new( + id: map["$id"], + sequence: map["$sequence"], + created_at: map["$createdAt"], + updated_at: map["$updatedAt"], + permissions: map["$permissions"], + user_internal_id: map["userInternalId"], + user_id: map["userId"], + status: map["status"], + source: map["source"], + expires_at: map["expiresAt"], + data: map["data"] || map + ) + end + + def to_map + { + "$id": @id, + "$sequence": @sequence, + "$createdAt": @created_at, + "$updatedAt": @updated_at, + "$permissions": @permissions, + "userInternalId": @user_internal_id, + "userId": @user_id, + "status": @status, + "source": @source, + "expiresAt": @expires_at, + "data": @data + } + end + + def convert_to(from_json) + from_json.call(data) + end + end + end +end diff --git a/lib/appwrite/models/presence_list.rb b/lib/appwrite/models/presence_list.rb new file mode 100644 index 0000000..5e977fe --- /dev/null +++ b/lib/appwrite/models/presence_list.rb @@ -0,0 +1,36 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class PresenceList + attr_reader :total + attr_reader :presences + + def initialize( + total:, + presences: + ) + @total = total + @presences = presences + end + + def self.from(map:) + PresenceList.new( + total: map["total"], + presences: map["presences"].map { |it| Presence.from(map: it) } + ) + end + + def to_map + { + "total": @total, + "presences": @presences.map { |it| it.to_map } + } + end + + def convert_to(from_json) + presences.map { |it| it.convert_to(from_json) } + end + end + end +end diff --git a/lib/appwrite/models/project.rb b/lib/appwrite/models/project.rb index 60c16f2..e0d5d1e 100644 --- a/lib/appwrite/models/project.rb +++ b/lib/appwrite/models/project.rb @@ -31,6 +31,8 @@ class Project attr_reader :auth_memberships_user_name attr_reader :auth_memberships_user_email attr_reader :auth_memberships_mfa + attr_reader :auth_memberships_user_id + attr_reader :auth_memberships_user_phone attr_reader :auth_invalidate_sessions attr_reader :o_auth_providers attr_reader :platforms @@ -40,7 +42,8 @@ class Project attr_reader :smtp_enabled attr_reader :smtp_sender_name attr_reader :smtp_sender_email - attr_reader :smtp_reply_to + attr_reader :smtp_reply_to_name + attr_reader :smtp_reply_to_email attr_reader :smtp_host attr_reader :smtp_port attr_reader :smtp_username @@ -111,6 +114,8 @@ def initialize( auth_memberships_user_name:, auth_memberships_user_email:, auth_memberships_mfa:, + auth_memberships_user_id:, + auth_memberships_user_phone:, auth_invalidate_sessions:, o_auth_providers:, platforms:, @@ -120,7 +125,8 @@ def initialize( smtp_enabled:, smtp_sender_name:, smtp_sender_email:, - smtp_reply_to:, + smtp_reply_to_name:, + smtp_reply_to_email:, smtp_host:, smtp_port:, smtp_username:, @@ -190,6 +196,8 @@ def initialize( @auth_memberships_user_name = auth_memberships_user_name @auth_memberships_user_email = auth_memberships_user_email @auth_memberships_mfa = auth_memberships_mfa + @auth_memberships_user_id = auth_memberships_user_id + @auth_memberships_user_phone = auth_memberships_user_phone @auth_invalidate_sessions = auth_invalidate_sessions @o_auth_providers = o_auth_providers @platforms = platforms @@ -199,7 +207,8 @@ def initialize( @smtp_enabled = smtp_enabled @smtp_sender_name = smtp_sender_name @smtp_sender_email = smtp_sender_email - @smtp_reply_to = smtp_reply_to + @smtp_reply_to_name = smtp_reply_to_name + @smtp_reply_to_email = smtp_reply_to_email @smtp_host = smtp_host @smtp_port = smtp_port @smtp_username = smtp_username @@ -272,6 +281,8 @@ def self.from(map:) auth_memberships_user_name: map["authMembershipsUserName"], auth_memberships_user_email: map["authMembershipsUserEmail"], auth_memberships_mfa: map["authMembershipsMfa"], + auth_memberships_user_id: map["authMembershipsUserId"], + auth_memberships_user_phone: map["authMembershipsUserPhone"], auth_invalidate_sessions: map["authInvalidateSessions"], o_auth_providers: map["oAuthProviders"].map { |it| AuthProvider.from(map: it) }, platforms: map["platforms"], @@ -281,7 +292,8 @@ def self.from(map:) smtp_enabled: map["smtpEnabled"], smtp_sender_name: map["smtpSenderName"], smtp_sender_email: map["smtpSenderEmail"], - smtp_reply_to: map["smtpReplyTo"], + smtp_reply_to_name: map["smtpReplyToName"], + smtp_reply_to_email: map["smtpReplyToEmail"], smtp_host: map["smtpHost"], smtp_port: map["smtpPort"], smtp_username: map["smtpUsername"], @@ -355,6 +367,8 @@ def to_map "authMembershipsUserName": @auth_memberships_user_name, "authMembershipsUserEmail": @auth_memberships_user_email, "authMembershipsMfa": @auth_memberships_mfa, + "authMembershipsUserId": @auth_memberships_user_id, + "authMembershipsUserPhone": @auth_memberships_user_phone, "authInvalidateSessions": @auth_invalidate_sessions, "oAuthProviders": @o_auth_providers.map { |it| it.to_map }, "platforms": @platforms, @@ -364,7 +378,8 @@ def to_map "smtpEnabled": @smtp_enabled, "smtpSenderName": @smtp_sender_name, "smtpSenderEmail": @smtp_sender_email, - "smtpReplyTo": @smtp_reply_to, + "smtpReplyToName": @smtp_reply_to_name, + "smtpReplyToEmail": @smtp_reply_to_email, "smtpHost": @smtp_host, "smtpPort": @smtp_port, "smtpUsername": @smtp_username, diff --git a/lib/appwrite/models/proxy_rule.rb b/lib/appwrite/models/proxy_rule.rb new file mode 100644 index 0000000..70990c4 --- /dev/null +++ b/lib/appwrite/models/proxy_rule.rb @@ -0,0 +1,127 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class ProxyRule + attr_reader :id + attr_reader :created_at + attr_reader :updated_at + attr_reader :domain + attr_reader :type + attr_reader :trigger + attr_reader :redirect_url + attr_reader :redirect_status_code + attr_reader :deployment_id + attr_reader :deployment_resource_type + attr_reader :deployment_resource_id + attr_reader :deployment_vcs_provider_branch + attr_reader :status + attr_reader :logs + attr_reader :renew_at + + def initialize( + id:, + created_at:, + updated_at:, + domain:, + type:, + trigger:, + redirect_url:, + redirect_status_code:, + deployment_id:, + deployment_resource_type: , + deployment_resource_id:, + deployment_vcs_provider_branch:, + status:, + logs:, + renew_at: + ) + @id = id + @created_at = created_at + @updated_at = updated_at + @domain = domain + @type = type + @trigger = trigger + @redirect_url = redirect_url + @redirect_status_code = redirect_status_code + @deployment_id = deployment_id + @deployment_resource_type = deployment_resource_type.nil? ? deployment_resource_type : validate_deployment_resource_type(deployment_resource_type) + @deployment_resource_id = deployment_resource_id + @deployment_vcs_provider_branch = deployment_vcs_provider_branch + @status = validate_status(status) + @logs = logs + @renew_at = renew_at + end + + def self.from(map:) + ProxyRule.new( + id: map["$id"], + created_at: map["$createdAt"], + updated_at: map["$updatedAt"], + domain: map["domain"], + type: map["type"], + trigger: map["trigger"], + redirect_url: map["redirectUrl"], + redirect_status_code: map["redirectStatusCode"], + deployment_id: map["deploymentId"], + deployment_resource_type: map["deploymentResourceType"], + deployment_resource_id: map["deploymentResourceId"], + deployment_vcs_provider_branch: map["deploymentVcsProviderBranch"], + status: map["status"], + logs: map["logs"], + renew_at: map["renewAt"] + ) + end + + def to_map + { + "$id": @id, + "$createdAt": @created_at, + "$updatedAt": @updated_at, + "domain": @domain, + "type": @type, + "trigger": @trigger, + "redirectUrl": @redirect_url, + "redirectStatusCode": @redirect_status_code, + "deploymentId": @deployment_id, + "deploymentResourceType": @deployment_resource_type, + "deploymentResourceId": @deployment_resource_id, + "deploymentVcsProviderBranch": @deployment_vcs_provider_branch, + "status": @status, + "logs": @logs, + "renewAt": @renew_at + } + end + + private + + def validate_deployment_resource_type(deployment_resource_type) + valid_deployment_resource_type = [ + Appwrite::Enums::ProxyRuleDeploymentResourceType::FUNCTION, + Appwrite::Enums::ProxyRuleDeploymentResourceType::SITE, + ] + + unless valid_deployment_resource_type.include?(deployment_resource_type) + raise ArgumentError, "Invalid " + deployment_resource_type + ". Must be one of: " + valid_deployment_resource_type.join(', ') + end + + deployment_resource_type + end + + def validate_status(status) + valid_status = [ + Appwrite::Enums::ProxyRuleStatus::UNVERIFIED, + Appwrite::Enums::ProxyRuleStatus::VERIFYING, + Appwrite::Enums::ProxyRuleStatus::VERIFIED, + ] + + unless valid_status.include?(status) + raise ArgumentError, "Invalid " + status + ". Must be one of: " + valid_status.join(', ') + end + + status + end + + end + end +end diff --git a/lib/appwrite/models/proxy_rule_list.rb b/lib/appwrite/models/proxy_rule_list.rb new file mode 100644 index 0000000..a167e51 --- /dev/null +++ b/lib/appwrite/models/proxy_rule_list.rb @@ -0,0 +1,32 @@ +#frozen_string_literal: true + +module Appwrite + module Models + class ProxyRuleList + attr_reader :total + attr_reader :rules + + def initialize( + total:, + rules: + ) + @total = total + @rules = rules + end + + def self.from(map:) + ProxyRuleList.new( + total: map["total"], + rules: map["rules"].map { |it| ProxyRule.from(map: it) } + ) + end + + def to_map + { + "total": @total, + "rules": @rules.map { |it| it.to_map } + } + end + end + end +end diff --git a/lib/appwrite/services/account.rb b/lib/appwrite/services/account.rb index 5880c7b..d84c55a 100644 --- a/lib/appwrite/services/account.rb +++ b/lib/appwrite/services/account.rb @@ -1275,7 +1275,7 @@ def create_magic_url_token(user_id:, email:, url: nil, phrase: nil) # about session # limits](https://appwrite.io/docs/authentication-security#limits). # - # @param [OAuthProvider] provider OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. + # @param [OAuthProvider] provider OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. # @param [String] success URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. # @param [String] failure URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. # @param [Array] scopes A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. diff --git a/lib/appwrite/services/databases.rb b/lib/appwrite/services/databases.rb index ca0600e..e5f4c2e 100644 --- a/lib/appwrite/services/databases.rb +++ b/lib/appwrite/services/databases.rb @@ -626,6 +626,132 @@ def list_attributes(database_id:, collection_id:, queries: nil, total: nil) end + # + # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createBigIntColumn` instead. + # + # Create a bigint attribute. Optionally, minimum and maximum values can be + # provided. + # + # + # @param [String] database_id Database ID. + # @param [String] collection_id Collection ID. + # @param [String] key Attribute Key. + # @param [] required Is attribute required? + # @param [Integer] min Minimum value + # @param [Integer] max Maximum value + # @param [Integer] default Default value. Cannot be set when attribute is required. + # @param [] array Is attribute an array? + # + # @return [AttributeBigint] + def create_big_int_attribute(database_id:, collection_id:, key:, required:, min: nil, max: nil, default: nil, array: nil) + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/bigint' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) + + if database_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + end + + if collection_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + end + + if key.nil? + raise Appwrite::Exception.new('Missing required parameter: "key"') + end + + if required.nil? + raise Appwrite::Exception.new('Missing required parameter: "required"') + end + + api_params = { + key: key, + required: required, + min: min, + max: max, + default: default, + array: array, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'POST', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::AttributeBigint + ) + + end + + # + # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateBigIntColumn` instead. + # + # Update a bigint attribute. Changing the `default` value will not update + # already existing documents. + # + # + # @param [String] database_id Database ID. + # @param [String] collection_id Collection ID. + # @param [String] key Attribute Key. + # @param [] required Is attribute required? + # @param [Integer] default Default value. Cannot be set when attribute is required. + # @param [Integer] min Minimum value + # @param [Integer] max Maximum value + # @param [String] new_key New Attribute Key. + # + # @return [AttributeBigint] + def update_big_int_attribute(database_id:, collection_id:, key:, required:, default:, min: nil, max: nil, new_key: nil) + api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/bigint/{key}' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) + .gsub('{key}', key) + + if database_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + end + + if collection_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + end + + if key.nil? + raise Appwrite::Exception.new('Missing required parameter: "key"') + end + + if required.nil? + raise Appwrite::Exception.new('Missing required parameter: "required"') + end + + if default.nil? + raise Appwrite::Exception.new('Missing required parameter: "default"') + end + + api_params = { + required: required, + min: min, + max: max, + default: default, + newKey: new_key, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::AttributeBigint + ) + + end + # # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createBooleanColumn` instead. # diff --git a/lib/appwrite/services/functions.rb b/lib/appwrite/services/functions.rb index 377e9be..f8ecea1 100644 --- a/lib/appwrite/services/functions.rb +++ b/lib/appwrite/services/functions.rb @@ -879,9 +879,11 @@ def delete_execution(function_id:, execution_id:) # Get a list of all variables of a specific function. # # @param [String] function_id Function unique ID. + # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [VariableList] - def list_variables(function_id:) + def list_variables(function_id:, queries: nil, total: nil) api_path = '/functions/{functionId}/variables' .gsub('{functionId}', function_id) @@ -890,6 +892,8 @@ def list_variables(function_id:) end api_params = { + queries: queries, + total: total, } api_headers = { @@ -909,12 +913,13 @@ def list_variables(function_id:) # in the function at runtime as environment variables. # # @param [String] function_id Function unique ID. + # @param [String] variable_id Variable ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. # @param [String] key Variable key. Max length: 255 chars. # @param [String] value Variable value. Max length: 8192 chars. # @param [] secret Secret variables can be updated or deleted, but only functions can read them during build and runtime. # # @return [Variable] - def create_variable(function_id:, key:, value:, secret: nil) + def create_variable(function_id:, variable_id:, key:, value:, secret: nil) api_path = '/functions/{functionId}/variables' .gsub('{functionId}', function_id) @@ -922,6 +927,10 @@ def create_variable(function_id:, key:, value:, secret: nil) raise Appwrite::Exception.new('Missing required parameter: "functionId"') end + if variable_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "variableId"') + end + if key.nil? raise Appwrite::Exception.new('Missing required parameter: "key"') end @@ -931,6 +940,7 @@ def create_variable(function_id:, key:, value:, secret: nil) end api_params = { + variableId: variable_id, key: key, value: value, secret: secret, @@ -994,7 +1004,7 @@ def get_variable(function_id:, variable_id:) # @param [] secret Secret variables can be updated or deleted, but only functions can read them during build and runtime. # # @return [Variable] - def update_variable(function_id:, variable_id:, key:, value: nil, secret: nil) + def update_variable(function_id:, variable_id:, key: nil, value: nil, secret: nil) api_path = '/functions/{functionId}/variables/{variableId}' .gsub('{functionId}', function_id) .gsub('{variableId}', variable_id) @@ -1007,10 +1017,6 @@ def update_variable(function_id:, variable_id:, key:, value: nil, secret: nil) raise Appwrite::Exception.new('Missing required parameter: "variableId"') end - if key.nil? - raise Appwrite::Exception.new('Missing required parameter: "key"') - end - api_params = { key: key, value: value, diff --git a/lib/appwrite/services/presences.rb b/lib/appwrite/services/presences.rb new file mode 100644 index 0000000..30b452e --- /dev/null +++ b/lib/appwrite/services/presences.rb @@ -0,0 +1,192 @@ +#frozen_string_literal: true + +module Appwrite + class Presences < Service + + def initialize(client) + @client = client + end + + # List presence logs. + # + # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. + # @param [Integer] ttl TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). + # + # @return [PresenceList] + def list(queries: nil, total: nil, ttl: nil) + api_path = '/presences' + + api_params = { + queries: queries, + total: total, + ttl: ttl, + } + + api_headers = { + } + + @client.call( + method: 'GET', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::PresenceList + ) + + end + + # Get a presence log by its unique ID. + # + # @param [String] presence_id Presence unique ID. + # + # @return [Presence] + def get(presence_id:) + api_path = '/presences/{presenceId}' + .gsub('{presenceId}', presence_id) + + if presence_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "presenceId"') + end + + api_params = { + } + + api_headers = { + } + + @client.call( + method: 'GET', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::Presence + ) + + end + + # Create or update a presence log by its unique ID. + # + # @param [String] presence_id Presence unique ID. + # @param [String] user_id User ID. + # @param [String] status Presence status. + # @param [Array] permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + # @param [String] expires_at Presence expiry datetime. + # @param [Hash] metadata Presence metadata object. + # + # @return [Presence] + def upsert(presence_id:, user_id:, status:, permissions: nil, expires_at: nil, metadata: nil) + api_path = '/presences/{presenceId}' + .gsub('{presenceId}', presence_id) + + if presence_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "presenceId"') + end + + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end + + if status.nil? + raise Appwrite::Exception.new('Missing required parameter: "status"') + end + + api_params = { + userId: user_id, + status: status, + permissions: permissions, + expiresAt: expires_at, + metadata: metadata, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PUT', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::Presence + ) + + end + + # Update a presence log by its unique ID. + # + # @param [String] presence_id Presence unique ID. + # @param [String] user_id User ID. + # @param [String] status Presence status. + # @param [String] expires_at Presence expiry datetime. + # @param [Hash] metadata Presence metadata object. + # @param [Array] permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + # @param [] purge When true, purge cached responses used by list presences endpoint. + # + # @return [Presence] + def update_presence(presence_id:, user_id:, status: nil, expires_at: nil, metadata: nil, permissions: nil, purge: nil) + api_path = '/presences/{presenceId}' + .gsub('{presenceId}', presence_id) + + if presence_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "presenceId"') + end + + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end + + api_params = { + userId: user_id, + status: status, + expiresAt: expires_at, + metadata: metadata, + permissions: permissions, + purge: purge, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::Presence + ) + + end + + # Delete a presence log by its unique ID. + # + # @param [String] presence_id Presence unique ID. + # + # @return [] + def delete(presence_id:) + api_path = '/presences/{presenceId}' + .gsub('{presenceId}', presence_id) + + if presence_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "presenceId"') + end + + api_params = { + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'DELETE', + path: api_path, + headers: api_headers, + params: api_params, + ) + + end + + end +end diff --git a/lib/appwrite/services/project.rb b/lib/appwrite/services/project.rb index a48be0f..c7bec31 100644 --- a/lib/appwrite/services/project.rb +++ b/lib/appwrite/services/project.rb @@ -7,6 +7,66 @@ def initialize(client) @client = client end + # Delete a project. + # + # + # @return [] + def delete() + api_path = '/project' + + api_params = { + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'DELETE', + path: api_path, + headers: api_headers, + params: api_params, + ) + + end + + # Update properties of a specific auth method. Use this endpoint to enable or + # disable a method in your project. + # + # @param [MethodId] method_id Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone + # @param [] enabled Auth method status. + # + # @return [Project] + def update_auth_method(method_id:, enabled:) + api_path = '/project/auth-methods/{methodId}' + .gsub('{methodId}', method_id) + + if method_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "methodId"') + end + + if enabled.nil? + raise Appwrite::Exception.new('Missing required parameter: "enabled"') + end + + api_params = { + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::Project + ) + + end + # Get a list of all API keys from the current project. # # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire, accessedAt, name, scopes @@ -36,6 +96,9 @@ def list_keys(queries: nil, total: nil) # Create a new API key. It's recommended to have multiple API keys with # strict scopes for separate functions within your project. + # + # You can also create an ephemeral API key if you need a short-lived key + # instead. # # @param [String] key_id Key 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. # @param [String] name Key name. Max length: 128 chars. @@ -79,6 +142,46 @@ def create_key(key_id:, name:, scopes:, expire: nil) end + # Create a new ephemeral API key. It's recommended to have multiple API keys + # with strict scopes for separate functions within your project. + # + # You can also create a standard API key if you need a longer-lived key + # instead. + # + # @param [Array] scopes Key scopes list. Maximum of 100 scopes are allowed. + # @param [Integer] duration Time in seconds before ephemeral key expires. Maximum duration is 3600 seconds. + # + # @return [EphemeralKey] + def create_ephemeral_key(scopes:, duration:) + api_path = '/project/keys/ephemeral' + + if scopes.nil? + raise Appwrite::Exception.new('Missing required parameter: "scopes"') + end + + if duration.nil? + raise Appwrite::Exception.new('Missing required parameter: "duration"') + end + + api_params = { + scopes: scopes, + duration: duration, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'POST', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::EphemeralKey + ) + + end + # Get a key by its unique ID. # # @param [String] key_id Key ID. @@ -214,15 +317,15 @@ def update_labels(labels:) end - # Get a list of all platforms in the project. This endpoint returns an array - # of all platforms and their configurations. + # Get a list of all mock phones in the project. This endpoint returns an + # array of all mock phones and their OTPs. # - # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: type, name, hostname, bundleIdentifier, applicationId, packageIdentifierName, packageName + # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # - # @return [PlatformList] - def list_platforms(queries: nil, total: nil) - api_path = '/project/platforms' + # @return [MockNumberList] + def list_mock_phones(queries: nil, total: nil) + api_path = '/project/mock-phones' api_params = { queries: queries, @@ -237,39 +340,32 @@ def list_platforms(queries: nil, total: nil) path: api_path, headers: api_headers, params: api_params, - response_type: Models::PlatformList + response_type: Models::MockNumberList ) end - # Create a new Android platform for your project. Use this endpoint to - # register a new Android platform where your users will run your application - # which will interact with the Appwrite API. + # Create a new mock phone for your project. Use this endpoint to register a + # mock phone number and its sign-in OTP for your testers. # - # @param [String] platform_id Platform 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. - # @param [String] name Platform name. Max length: 128 chars. - # @param [String] application_id Android application ID. Max length: 256 chars. + # @param [String] number Phone number to associate with the mock phone. Must be a valid E.164 formatted phone number. + # @param [String] otp One-time password (OTP) to associate with the mock phone. Must be a 6-digit numeric code. # - # @return [PlatformAndroid] - def create_android_platform(platform_id:, name:, application_id:) - api_path = '/project/platforms/android' - - if platform_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "platformId"') - end + # @return [MockNumber] + def create_mock_phone(number:, otp:) + api_path = '/project/mock-phones' - if name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') + if number.nil? + raise Appwrite::Exception.new('Missing required parameter: "number"') end - if application_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "applicationId"') + if otp.nil? + raise Appwrite::Exception.new('Missing required parameter: "otp"') end api_params = { - platformId: platform_id, - name: name, - applicationId: application_id, + number: number, + otp: otp, } api_headers = { @@ -281,82 +377,62 @@ def create_android_platform(platform_id:, name:, application_id:) path: api_path, headers: api_headers, params: api_params, - response_type: Models::PlatformAndroid + response_type: Models::MockNumber ) end - # Update an Android platform by its unique ID. Use this endpoint to update - # the platform's name or application ID. + # Get a mock phone by its unique number. This endpoint returns the mock + # phone's OTP. # - # @param [String] platform_id Platform ID. - # @param [String] name Platform name. Max length: 128 chars. - # @param [String] application_id Android application ID. Max length: 256 chars. + # @param [String] number Phone number associated with the mock phone. Must be a valid E.164 formatted phone number. # - # @return [PlatformAndroid] - def update_android_platform(platform_id:, name:, application_id:) - api_path = '/project/platforms/android/{platformId}' - .gsub('{platformId}', platform_id) + # @return [MockNumber] + def get_mock_phone(number:) + api_path = '/project/mock-phones/{number}' + .gsub('{number}', number) - if platform_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "platformId"') - end - - if name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') - end - - if application_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "applicationId"') + if number.nil? + raise Appwrite::Exception.new('Missing required parameter: "number"') end api_params = { - name: name, - applicationId: application_id, } api_headers = { - "content-type": 'application/json', } @client.call( - method: 'PUT', + method: 'GET', path: api_path, headers: api_headers, params: api_params, - response_type: Models::PlatformAndroid + response_type: Models::MockNumber ) end - # Create a new Apple platform for your project. Use this endpoint to register - # a new Apple platform where your users will run your application which will - # interact with the Appwrite API. + # Update a mock phone by its unique number. Use this endpoint to update the + # mock phone's OTP. # - # @param [String] platform_id Platform 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. - # @param [String] name Platform name. Max length: 128 chars. - # @param [String] bundle_identifier Apple bundle identifier. Max length: 256 chars. + # @param [String] number Phone number associated with the mock phone. Must be a valid E.164 formatted phone number. + # @param [String] otp One-time password (OTP) to associate with the mock phone. Must be a 6-digit numeric code. # - # @return [PlatformApple] - def create_apple_platform(platform_id:, name:, bundle_identifier:) - api_path = '/project/platforms/apple' - - if platform_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "platformId"') - end + # @return [MockNumber] + def update_mock_phone(number:, otp:) + api_path = '/project/mock-phones/{number}' + .gsub('{number}', number) - if name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') + if number.nil? + raise Appwrite::Exception.new('Missing required parameter: "number"') end - if bundle_identifier.nil? - raise Appwrite::Exception.new('Missing required parameter: "bundleIdentifier"') + if otp.nil? + raise Appwrite::Exception.new('Missing required parameter: "otp"') end api_params = { - platformId: platform_id, - name: name, - bundleIdentifier: bundle_identifier, + otp: otp, } api_headers = { @@ -364,42 +440,30 @@ def create_apple_platform(platform_id:, name:, bundle_identifier:) } @client.call( - method: 'POST', + method: 'PUT', path: api_path, headers: api_headers, params: api_params, - response_type: Models::PlatformApple + response_type: Models::MockNumber ) end - # Update an Apple platform by its unique ID. Use this endpoint to update the - # platform's name or bundle identifier. + # Delete a mock phone by its unique number. This endpoint removes the mock + # phone and its OTP configuration from the project. # - # @param [String] platform_id Platform ID. - # @param [String] name Platform name. Max length: 128 chars. - # @param [String] bundle_identifier Apple bundle identifier. Max length: 256 chars. + # @param [String] number Phone number associated with the mock phone. Must be a valid E.164 formatted phone number. # - # @return [PlatformApple] - def update_apple_platform(platform_id:, name:, bundle_identifier:) - api_path = '/project/platforms/apple/{platformId}' - .gsub('{platformId}', platform_id) - - if platform_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "platformId"') - end - - if name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') - end + # @return [] + def delete_mock_phone(number:) + api_path = '/project/mock-phones/{number}' + .gsub('{number}', number) - if bundle_identifier.nil? - raise Appwrite::Exception.new('Missing required parameter: "bundleIdentifier"') + if number.nil? + raise Appwrite::Exception.new('Missing required parameter: "number"') end api_params = { - name: name, - bundleIdentifier: bundle_identifier, } api_headers = { @@ -407,130 +471,2336 @@ def update_apple_platform(platform_id:, name:, bundle_identifier:) } @client.call( - method: 'PUT', + method: 'DELETE', path: api_path, headers: api_headers, params: api_params, - response_type: Models::PlatformApple ) end - # Create a new Linux platform for your project. Use this endpoint to register - # a new Linux platform where your users will run your application which will - # interact with the Appwrite API. + # Get a list of all OAuth2 providers supported by the server, along with the + # project's configuration for each. Credential fields are write-only and + # always returned empty. # - # @param [String] platform_id Platform 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. - # @param [String] name Platform name. Max length: 128 chars. - # @param [String] package_name Linux package name. Max length: 256 chars. + # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # - # @return [PlatformLinux] - def create_linux_platform(platform_id:, name:, package_name:) - api_path = '/project/platforms/linux' - - if platform_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "platformId"') - end - - if name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') - end - - if package_name.nil? - raise Appwrite::Exception.new('Missing required parameter: "packageName"') - end + # @return [OAuth2ProviderList] + def list_o_auth2_providers(queries: nil, total: nil) + api_path = '/project/oauth2' api_params = { - platformId: platform_id, - name: name, - packageName: package_name, + queries: queries, + total: total, } api_headers = { - "content-type": 'application/json', } @client.call( - method: 'POST', + method: 'GET', path: api_path, headers: api_headers, params: api_params, - response_type: Models::PlatformLinux + response_type: Models::OAuth2ProviderList ) end - # Update a Linux platform by its unique ID. Use this endpoint to update the - # platform's name or package name. + # Get a single OAuth2 provider configuration. Credential fields (client + # secret, p8 file, key/team IDs) are write-only and always returned empty. # - # @param [String] platform_id Platform ID. - # @param [String] name Platform name. Max length: 128 chars. - # @param [String] package_name Linux package name. Max length: 256 chars. + # @param [ProviderId] provider_id OAuth2 provider key. For example: github, google, apple. # - # @return [PlatformLinux] - def update_linux_platform(platform_id:, name:, package_name:) - api_path = '/project/platforms/linux/{platformId}' - .gsub('{platformId}', platform_id) - - if platform_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "platformId"') - end - - if name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') - end + # @return [OAuth2Github, OAuth2Discord, OAuth2Figma, OAuth2Dropbox, OAuth2Dailymotion, OAuth2Bitbucket, OAuth2Bitly, OAuth2Box, OAuth2Autodesk, OAuth2Google, OAuth2Zoom, OAuth2Zoho, OAuth2Yandex, OAuth2X, OAuth2WordPress, OAuth2Twitch, OAuth2Stripe, OAuth2Spotify, OAuth2Slack, OAuth2Podio, OAuth2Notion, OAuth2Salesforce, OAuth2Yahoo, OAuth2Linkedin, OAuth2Disqus, OAuth2Amazon, OAuth2Etsy, OAuth2Facebook, OAuth2Tradeshift, OAuth2Paypal, OAuth2Gitlab, OAuth2Authentik, OAuth2Auth0, OAuth2FusionAuth, OAuth2Keycloak, OAuth2Oidc, OAuth2Apple, OAuth2Okta, OAuth2Kick, OAuth2Microsoft] + def get_o_auth2_provider(provider_id:) + api_path = '/project/oauth2/:provider' - if package_name.nil? - raise Appwrite::Exception.new('Missing required parameter: "packageName"') + if provider_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "providerId"') end api_params = { - name: name, - packageName: package_name, + providerId: provider_id, } api_headers = { - "content-type": 'application/json', } - @client.call( - method: 'PUT', + response = @client.call( + method: 'GET', path: api_path, headers: api_headers, params: api_params, - response_type: Models::PlatformLinux ) - end + unless response.is_a?(Hash) + raise Exception, "Expected object response when hydrating a response model" + end - # Create a new web platform for your project. Use this endpoint to register a - # new platform where your users will run your application which will interact - # with the Appwrite API. - # - # @param [String] platform_id Platform 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. - # @param [String] name Platform name. Max length: 128 chars. - # @param [String] hostname Platform web hostname. Max length: 256 chars. - # - # @return [PlatformWeb] - def create_web_platform(platform_id:, name:, hostname:) - api_path = '/project/platforms/web' + if response['$id'] == 'github' - if platform_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "platformId"') + return Models::OAuth2Github.from(map: response) end - if name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') - end + if response['$id'] == 'discord' - if hostname.nil? - raise Appwrite::Exception.new('Missing required parameter: "hostname"') + return Models::OAuth2Discord.from(map: response) + end + + if response['$id'] == 'figma' + + return Models::OAuth2Figma.from(map: response) + end + + if response['$id'] == 'dropbox' + + return Models::OAuth2Dropbox.from(map: response) + end + + if response['$id'] == 'dailymotion' + + return Models::OAuth2Dailymotion.from(map: response) + end + + if response['$id'] == 'bitbucket' + + return Models::OAuth2Bitbucket.from(map: response) + end + + if response['$id'] == 'bitly' + + return Models::OAuth2Bitly.from(map: response) + end + + if response['$id'] == 'box' + + return Models::OAuth2Box.from(map: response) + end + + if response['$id'] == 'autodesk' + + return Models::OAuth2Autodesk.from(map: response) + end + + if response['$id'] == 'google' + + return Models::OAuth2Google.from(map: response) + end + + if response['$id'] == 'zoom' + + return Models::OAuth2Zoom.from(map: response) + end + + if response['$id'] == 'zoho' + + return Models::OAuth2Zoho.from(map: response) + end + + if response['$id'] == 'yandex' + + return Models::OAuth2Yandex.from(map: response) + end + + if response['$id'] == 'x' + + return Models::OAuth2X.from(map: response) + end + + if response['$id'] == 'wordpress' + + return Models::OAuth2WordPress.from(map: response) + end + + if response['$id'] == 'twitch' + + return Models::OAuth2Twitch.from(map: response) + end + + if response['$id'] == 'stripe' + + return Models::OAuth2Stripe.from(map: response) + end + + if response['$id'] == 'spotify' + + return Models::OAuth2Spotify.from(map: response) + end + + if response['$id'] == 'slack' + + return Models::OAuth2Slack.from(map: response) + end + + if response['$id'] == 'podio' + + return Models::OAuth2Podio.from(map: response) + end + + if response['$id'] == 'notion' + + return Models::OAuth2Notion.from(map: response) + end + + if response['$id'] == 'salesforce' + + return Models::OAuth2Salesforce.from(map: response) + end + + if response['$id'] == 'yahoo' + + return Models::OAuth2Yahoo.from(map: response) + end + + if response['$id'] == 'linkedin' + + return Models::OAuth2Linkedin.from(map: response) + end + + if response['$id'] == 'disqus' + + return Models::OAuth2Disqus.from(map: response) + end + + if response['$id'] == 'amazon' + + return Models::OAuth2Amazon.from(map: response) + end + + if response['$id'] == 'etsy' + + return Models::OAuth2Etsy.from(map: response) + end + + if response['$id'] == 'facebook' + + return Models::OAuth2Facebook.from(map: response) + end + + if response['$id'] == 'tradeshiftBox' + + return Models::OAuth2Tradeshift.from(map: response) + end + + if response['$id'] == 'paypalSandbox' + + return Models::OAuth2Paypal.from(map: response) + end + + if response['$id'] == 'gitlab' + + return Models::OAuth2Gitlab.from(map: response) + end + + if response['$id'] == 'authentik' + + return Models::OAuth2Authentik.from(map: response) + end + + if response['$id'] == 'auth0' + + return Models::OAuth2Auth0.from(map: response) + end + + if response['$id'] == 'fusionauth' + + return Models::OAuth2FusionAuth.from(map: response) + end + + if response['$id'] == 'keycloak' + + return Models::OAuth2Keycloak.from(map: response) + end + + if response['$id'] == 'oidc' + + return Models::OAuth2Oidc.from(map: response) + end + + if response['$id'] == 'apple' + + return Models::OAuth2Apple.from(map: response) + end + + if response['$id'] == 'okta' + + return Models::OAuth2Okta.from(map: response) + end + + if response['$id'] == 'kick' + + return Models::OAuth2Kick.from(map: response) + end + + if response['$id'] == 'microsoft' + + return Models::OAuth2Microsoft.from(map: response) + end + + raise Exception, "Unable to match response to any expected response model" + + end + + # Update the project OAuth2 Amazon configuration. + # + # @param [String] client_id 'Client ID' of Amazon OAuth2 app. For example: amzn1.application-oa2-client.87400c00000000000000000000063d5b2 + # @param [String] client_secret 'Client Secret' of Amazon OAuth2 app. For example: 79ffe4000000000000000000000000000000000000000000000000000002de55 + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Amazon] + def update_o_auth2_amazon(client_id: nil, client_secret: nil, enabled: nil) + api_path = '/project/oauth2/amazon' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Amazon + ) + + end + + # Update the project OAuth2 Apple configuration. + # + # @param [String] service_id 'Service ID' of Apple OAuth2 app. For example: ip.appwrite.app.web + # @param [String] key_id 'Key ID' of Apple OAuth2 app. For example: P4000000N8 + # @param [String] team_id 'Team ID' of Apple OAuth2 app. For example: D4000000R6 + # @param [String] p8_file Contents of the Apple OAuth2 app .p8 private key file. The secret key wrapped by the PEM markers is 200 characters long. For example: -----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY----- + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Apple] + def update_o_auth2_apple(service_id: nil, key_id: nil, team_id: nil, p8_file: nil, enabled: nil) + api_path = '/project/oauth2/apple' + + api_params = { + serviceId: service_id, + keyId: key_id, + teamId: team_id, + p8File: p8_file, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Apple + ) + + end + + # Update the project OAuth2 Auth0 configuration. + # + # @param [String] client_id 'Client ID' of Auth0 OAuth2 app. For example: OaOkIA000000000000000000005KLSYq + # @param [String] client_secret 'Client Secret' of Auth0 OAuth2 app. For example: zXz0000-00000000000000000000000000000-00000000000000000000PJafnF + # @param [String] endpoint Domain of Auth0 instance. For example: example.us.auth0.com + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Auth0] + def update_o_auth2_auth0(client_id: nil, client_secret: nil, endpoint: nil, enabled: nil) + api_path = '/project/oauth2/auth0' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + endpoint: endpoint, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Auth0 + ) + + end + + # Update the project OAuth2 Authentik configuration. + # + # @param [String] client_id 'Client ID' of Authentik OAuth2 app. For example: dTKOPa0000000000000000000000000000e7G8hv + # @param [String] client_secret 'Client Secret' of Authentik OAuth2 app. For example: ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK + # @param [String] endpoint Domain of Authentik instance. For example: example.authentik.com + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Authentik] + def update_o_auth2_authentik(client_id: nil, client_secret: nil, endpoint: nil, enabled: nil) + api_path = '/project/oauth2/authentik' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + endpoint: endpoint, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Authentik + ) + + end + + # Update the project OAuth2 Autodesk configuration. + # + # @param [String] client_id 'Client ID' of Autodesk OAuth2 app. For example: 5zw90v00000000000000000000kVYXN7 + # @param [String] client_secret 'Client Secret' of Autodesk OAuth2 app. For example: 7I000000000000MW + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Autodesk] + def update_o_auth2_autodesk(client_id: nil, client_secret: nil, enabled: nil) + api_path = '/project/oauth2/autodesk' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Autodesk + ) + + end + + # Update the project OAuth2 Bitbucket configuration. + # + # @param [String] key 'Key' of Bitbucket OAuth2 app. For example: Knt70000000000ByRc + # @param [String] secret 'Secret' of Bitbucket OAuth2 app. For example: NMfLZJ00000000000000000000TLQdDx + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Bitbucket] + def update_o_auth2_bitbucket(key: nil, secret: nil, enabled: nil) + api_path = '/project/oauth2/bitbucket' + + api_params = { + key: key, + secret: secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Bitbucket + ) + + end + + # Update the project OAuth2 Bitly configuration. + # + # @param [String] client_id 'Client ID' of Bitly OAuth2 app. For example: d95151000000000000000000000000000067af9b + # @param [String] client_secret 'Client Secret' of Bitly OAuth2 app. For example: a13e250000000000000000000000000000d73095 + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Bitly] + def update_o_auth2_bitly(client_id: nil, client_secret: nil, enabled: nil) + api_path = '/project/oauth2/bitly' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Bitly + ) + + end + + # Update the project OAuth2 Box configuration. + # + # @param [String] client_id 'Client ID' of Box OAuth2 app. For example: deglcs00000000000000000000x2og6y + # @param [String] client_secret 'Client Secret' of Box OAuth2 app. For example: OKM1f100000000000000000000eshEif + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Box] + def update_o_auth2_box(client_id: nil, client_secret: nil, enabled: nil) + api_path = '/project/oauth2/box' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Box + ) + + end + + # Update the project OAuth2 Dailymotion configuration. + # + # @param [String] api_key 'API Key' of Dailymotion OAuth2 app. For example: 07a9000000000000067f + # @param [String] api_secret 'API Secret' of Dailymotion OAuth2 app. For example: a399a90000000000000000000000000000d90639 + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Dailymotion] + def update_o_auth2_dailymotion(api_key: nil, api_secret: nil, enabled: nil) + api_path = '/project/oauth2/dailymotion' + + api_params = { + apiKey: api_key, + apiSecret: api_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Dailymotion + ) + + end + + # Update the project OAuth2 Discord configuration. + # + # @param [String] client_id 'Client ID' of Discord OAuth2 app. For example: 950722000000343754 + # @param [String] client_secret 'Client Secret' of Discord OAuth2 app. For example: YmPXnM000000000000000000002zFg5D + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Discord] + def update_o_auth2_discord(client_id: nil, client_secret: nil, enabled: nil) + api_path = '/project/oauth2/discord' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Discord + ) + + end + + # Update the project OAuth2 Disqus configuration. + # + # @param [String] public_key 'Public Key, also known as API Key' of Disqus OAuth2 app. For example: cgegH70000000000000000000000000000000000000000000000000000Hr1nYX + # @param [String] secret_key 'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: W7Bykj00000000000000000000000000000000000000000000000000003o43w9 + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Disqus] + def update_o_auth2_disqus(public_key: nil, secret_key: nil, enabled: nil) + api_path = '/project/oauth2/disqus' + + api_params = { + publicKey: public_key, + secretKey: secret_key, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Disqus + ) + + end + + # Update the project OAuth2 Dropbox configuration. + # + # @param [String] app_key 'App Key' of Dropbox OAuth2 app. For example: jl000000000009t + # @param [String] app_secret 'App Secret' of Dropbox OAuth2 app. For example: g200000000000vw + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Dropbox] + def update_o_auth2_dropbox(app_key: nil, app_secret: nil, enabled: nil) + api_path = '/project/oauth2/dropbox' + + api_params = { + appKey: app_key, + appSecret: app_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Dropbox + ) + + end + + # Update the project OAuth2 Etsy configuration. + # + # @param [String] key_string 'Keystring' of Etsy OAuth2 app. For example: nsgzxh0000000000008j85a2 + # @param [String] shared_secret 'Shared Secret' of Etsy OAuth2 app. For example: tp000000ru + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Etsy] + def update_o_auth2_etsy(key_string: nil, shared_secret: nil, enabled: nil) + api_path = '/project/oauth2/etsy' + + api_params = { + keyString: key_string, + sharedSecret: shared_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Etsy + ) + + end + + # Update the project OAuth2 Facebook configuration. + # + # @param [String] app_id 'App ID' of Facebook OAuth2 app. For example: 260600000007694 + # @param [String] app_secret 'App Secret' of Facebook OAuth2 app. For example: 2d0b2800000000000000000000d38af4 + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Facebook] + def update_o_auth2_facebook(app_id: nil, app_secret: nil, enabled: nil) + api_path = '/project/oauth2/facebook' + + api_params = { + appId: app_id, + appSecret: app_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Facebook + ) + + end + + # Update the project OAuth2 Figma configuration. + # + # @param [String] client_id 'Client ID' of Figma OAuth2 app. For example: byay5H0000000000VtiI40 + # @param [String] client_secret 'Client Secret' of Figma OAuth2 app. For example: yEpOYn0000000000000000004iIsU5 + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Figma] + def update_o_auth2_figma(client_id: nil, client_secret: nil, enabled: nil) + api_path = '/project/oauth2/figma' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Figma + ) + + end + + # Update the project OAuth2 FusionAuth configuration. + # + # @param [String] client_id 'Client ID' of FusionAuth OAuth2 app. For example: b2222c00-0000-0000-0000-000000862097 + # @param [String] client_secret 'Client Secret' of FusionAuth OAuth2 app. For example: Jx4s0C0000000000000000000000000000000wGqLsc + # @param [String] endpoint Domain of FusionAuth instance. For example: example.fusionauth.io + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2FusionAuth] + def update_o_auth2_fusion_auth(client_id: nil, client_secret: nil, endpoint: nil, enabled: nil) + api_path = '/project/oauth2/fusionauth' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + endpoint: endpoint, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2FusionAuth + ) + + end + + # Update the project OAuth2 GitHub configuration. + # + # @param [String] client_id 'OAuth2 app Client ID, or App ID' of GitHub OAuth2 app. For example: e4d87900000000540733. Example of wrong value: 370006 + # @param [String] client_secret 'Client Secret' of GitHub OAuth2 app. For example: 5e07c00000000000000000000000000000198bcc + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Github] + def update_o_auth2_git_hub(client_id: nil, client_secret: nil, enabled: nil) + api_path = '/project/oauth2/github' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Github + ) + + end + + # Update the project OAuth2 Gitlab configuration. + # + # @param [String] application_id 'Application ID' of Gitlab OAuth2 app. For example: d41ffe0000000000000000000000000000000000000000000000000000d5e252 + # @param [String] secret 'Secret' of Gitlab OAuth2 app. For example: gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38 + # @param [String] endpoint Endpoint URL of self-hosted GitLab instance. For example: https://gitlab.com + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Gitlab] + def update_o_auth2_gitlab(application_id: nil, secret: nil, endpoint: nil, enabled: nil) + api_path = '/project/oauth2/gitlab' + + api_params = { + applicationId: application_id, + secret: secret, + endpoint: endpoint, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Gitlab + ) + + end + + # Update the project OAuth2 Google configuration. + # + # @param [String] client_id 'Client ID' of Google OAuth2 app. For example: your-google-client-id.apps.googleusercontent.com + # @param [String] client_secret 'Client Secret' of Google OAuth2 app. For example: your-google-client-secret + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Google] + def update_o_auth2_google(client_id: nil, client_secret: nil, enabled: nil) + api_path = '/project/oauth2/google' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Google + ) + + end + + # Update the project OAuth2 Keycloak configuration. + # + # @param [String] client_id 'Client ID' of Keycloak OAuth2 app. For example: appwrite-o0000000st-app + # @param [String] client_secret 'Client Secret' of Keycloak OAuth2 app. For example: jdjrJd00000000000000000000HUsaZO + # @param [String] endpoint Domain of Keycloak instance. For example: keycloak.example.com + # @param [String] realm_name Keycloak realm name. For example: appwrite-realm + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Keycloak] + def update_o_auth2_keycloak(client_id: nil, client_secret: nil, endpoint: nil, realm_name: nil, enabled: nil) + api_path = '/project/oauth2/keycloak' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + endpoint: endpoint, + realmName: realm_name, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Keycloak + ) + + end + + # Update the project OAuth2 Kick configuration. + # + # @param [String] client_id 'Client ID' of Kick OAuth2 app. For example: 01KQ7C00000000000001MFHS32 + # @param [String] client_secret 'Client Secret' of Kick OAuth2 app. For example: 34ac5600000000000000000000000000000000000000000000000000e830c8b + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Kick] + def update_o_auth2_kick(client_id: nil, client_secret: nil, enabled: nil) + api_path = '/project/oauth2/kick' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Kick + ) + + end + + # Update the project OAuth2 Linkedin configuration. + # + # @param [String] client_id 'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv + # @param [String] primary_client_secret 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: your-linkedin-client-secret + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Linkedin] + def update_o_auth2_linkedin(client_id: nil, primary_client_secret: nil, enabled: nil) + api_path = '/project/oauth2/linkedin' + + api_params = { + clientId: client_id, + primaryClientSecret: primary_client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Linkedin + ) + + end + + # Update the project OAuth2 Microsoft configuration. + # + # @param [String] application_id 'Entra ID Application ID, also known as Client ID' of Microsoft OAuth2 app. For example: 00001111-aaaa-2222-bbbb-3333cccc4444 + # @param [String] application_secret 'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u + # @param [String] tenant Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID. For example: common + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Microsoft] + def update_o_auth2_microsoft(application_id: nil, application_secret: nil, tenant: nil, enabled: nil) + api_path = '/project/oauth2/microsoft' + + api_params = { + applicationId: application_id, + applicationSecret: application_secret, + tenant: tenant, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Microsoft + ) + + end + + # Update the project OAuth2 Notion configuration. + # + # @param [String] oauth_client_id 'OAuth Client ID' of Notion OAuth2 app. For example: 341d8700-0000-0000-0000-000000446ee3 + # @param [String] oauth_client_secret 'OAuth Client Secret' of Notion OAuth2 app. For example: secret_dLUr4b000000000000000000000000000000lFHAa9 + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Notion] + def update_o_auth2_notion(oauth_client_id: nil, oauth_client_secret: nil, enabled: nil) + api_path = '/project/oauth2/notion' + + api_params = { + oauthClientId: oauth_client_id, + oauthClientSecret: oauth_client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Notion + ) + + end + + # Update the project OAuth2 Oidc configuration. + # + # @param [String] client_id 'Client ID' of Oidc OAuth2 app. For example: qibI2x0000000000000000000000000006L2YFoG + # @param [String] client_secret 'Client Secret' of Oidc OAuth2 app. For example: Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV + # @param [String] well_known_url OpenID Connect well-known configuration URL. When provided, authorization, token, and user info endpoints can be discovered automatically. For example: https://myoauth.com/.well-known/openid-configuration + # @param [String] authorization_url OpenID Connect authorization endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/authorize + # @param [String] token_url OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/token + # @param [String] user_info_url OpenID Connect user info endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/userinfo + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Oidc] + def update_o_auth2_oidc(client_id: nil, client_secret: nil, well_known_url: nil, authorization_url: nil, token_url: nil, user_info_url: nil, enabled: nil) + api_path = '/project/oauth2/oidc' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + wellKnownURL: well_known_url, + authorizationURL: authorization_url, + tokenURL: token_url, + userInfoURL: user_info_url, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Oidc + ) + + end + + # Update the project OAuth2 Okta configuration. + # + # @param [String] client_id 'Client ID' of Okta OAuth2 app. For example: 0oa00000000000000698 + # @param [String] client_secret 'Client Secret' of Okta OAuth2 app. For example: Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV + # @param [String] domain Okta company domain. Required when enabling the provider. For example: trial-6400025.okta.com. Example of wrong value: trial-6400025-admin.okta.com, or https://trial-6400025.okta.com/ + # @param [String] authorization_server_id Custom Authorization Servers. Optional, can be left empty or unconfigured. For example: aus000000000000000h7z + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Okta] + def update_o_auth2_okta(client_id: nil, client_secret: nil, domain: nil, authorization_server_id: nil, enabled: nil) + api_path = '/project/oauth2/okta' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + domain: domain, + authorizationServerId: authorization_server_id, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Okta + ) + + end + + # Update the project OAuth2 Paypal configuration. + # + # @param [String] client_id 'Client ID' of Paypal OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB + # @param [String] secret_key 'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Paypal] + def update_o_auth2_paypal(client_id: nil, secret_key: nil, enabled: nil) + api_path = '/project/oauth2/paypal' + + api_params = { + clientId: client_id, + secretKey: secret_key, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Paypal + ) + + end + + # Update the project OAuth2 PaypalSandbox configuration. + # + # @param [String] client_id 'Client ID' of PaypalSandbox OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB + # @param [String] secret_key 'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Paypal] + def update_o_auth2_paypal_sandbox(client_id: nil, secret_key: nil, enabled: nil) + api_path = '/project/oauth2/paypalSandbox' + + api_params = { + clientId: client_id, + secretKey: secret_key, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Paypal + ) + + end + + # Update the project OAuth2 Podio configuration. + # + # @param [String] client_id 'Client ID' of Podio OAuth2 app. For example: appwrite-o0000000st-app + # @param [String] client_secret 'Client Secret' of Podio OAuth2 app. For example: Rn247T0000000000000000000000000000000000000000000000000000W2zWTN + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Podio] + def update_o_auth2_podio(client_id: nil, client_secret: nil, enabled: nil) + api_path = '/project/oauth2/podio' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Podio + ) + + end + + # Update the project OAuth2 Salesforce configuration. + # + # @param [String] customer_key 'Consumer Key' of Salesforce OAuth2 app. For example: 3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq + # @param [String] customer_secret 'Consumer Secret' of Salesforce OAuth2 app. For example: 3w000000000000e2 + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Salesforce] + def update_o_auth2_salesforce(customer_key: nil, customer_secret: nil, enabled: nil) + api_path = '/project/oauth2/salesforce' + + api_params = { + customerKey: customer_key, + customerSecret: customer_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Salesforce + ) + + end + + # Update the project OAuth2 Slack configuration. + # + # @param [String] client_id 'Client ID' of Slack OAuth2 app. For example: 23000000089.15000000000023 + # @param [String] client_secret 'Client Secret' of Slack OAuth2 app. For example: 81656000000000000000000000f3d2fd + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Slack] + def update_o_auth2_slack(client_id: nil, client_secret: nil, enabled: nil) + api_path = '/project/oauth2/slack' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Slack + ) + + end + + # Update the project OAuth2 Spotify configuration. + # + # @param [String] client_id 'Client ID' of Spotify OAuth2 app. For example: 6ec271000000000000000000009beace + # @param [String] client_secret 'Client Secret' of Spotify OAuth2 app. For example: db068a000000000000000000008b5b9f + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Spotify] + def update_o_auth2_spotify(client_id: nil, client_secret: nil, enabled: nil) + api_path = '/project/oauth2/spotify' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Spotify + ) + + end + + # Update the project OAuth2 Stripe configuration. + # + # @param [String] client_id 'Client ID' of Stripe OAuth2 app. For example: ca_UKibXX0000000000000000000006byvR + # @param [String] api_secret_key 'API Secret Key' of Stripe OAuth2 app. For example: sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Stripe] + def update_o_auth2_stripe(client_id: nil, api_secret_key: nil, enabled: nil) + api_path = '/project/oauth2/stripe' + + api_params = { + clientId: client_id, + apiSecretKey: api_secret_key, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Stripe + ) + + end + + # Update the project OAuth2 Tradeshift configuration. + # + # @param [String] oauth2_client_id 'OAuth2 Client ID' of Tradeshift OAuth2 app. For example: appwrite-tes00000.0000000000est-app + # @param [String] oauth2_client_secret 'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Tradeshift] + def update_o_auth2_tradeshift(oauth2_client_id: nil, oauth2_client_secret: nil, enabled: nil) + api_path = '/project/oauth2/tradeshift' + + api_params = { + oauth2ClientId: oauth2_client_id, + oauth2ClientSecret: oauth2_client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Tradeshift + ) + + end + + # Update the project OAuth2 Tradeshift Sandbox configuration. + # + # @param [String] oauth2_client_id 'OAuth2 Client ID' of Tradeshift Sandbox OAuth2 app. For example: appwrite-tes00000.0000000000est-app + # @param [String] oauth2_client_secret 'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Tradeshift] + def update_o_auth2_tradeshift_sandbox(oauth2_client_id: nil, oauth2_client_secret: nil, enabled: nil) + api_path = '/project/oauth2/tradeshiftBox' + + api_params = { + oauth2ClientId: oauth2_client_id, + oauth2ClientSecret: oauth2_client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Tradeshift + ) + + end + + # Update the project OAuth2 Twitch configuration. + # + # @param [String] client_id 'Client ID' of Twitch OAuth2 app. For example: vvi0in000000000000000000ikmt9p + # @param [String] client_secret 'Client Secret' of Twitch OAuth2 app. For example: pmapue000000000000000000zylw3v + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Twitch] + def update_o_auth2_twitch(client_id: nil, client_secret: nil, enabled: nil) + api_path = '/project/oauth2/twitch' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Twitch + ) + + end + + # Update the project OAuth2 WordPress configuration. + # + # @param [String] client_id 'Client ID' of WordPress OAuth2 app. For example: 130005 + # @param [String] client_secret 'Client Secret' of WordPress OAuth2 app. For example: PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2WordPress] + def update_o_auth2_word_press(client_id: nil, client_secret: nil, enabled: nil) + api_path = '/project/oauth2/wordpress' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2WordPress + ) + + end + + # Update the project OAuth2 X configuration. + # + # @param [String] customer_key 'Customer Key' of X OAuth2 app. For example: slzZV0000000000000NFLaWT + # @param [String] secret_key 'Secret Key' of X OAuth2 app. For example: tkEPkp00000000000000000000000000000000000000FTxbI9 + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2X] + def update_o_auth2_x(customer_key: nil, secret_key: nil, enabled: nil) + api_path = '/project/oauth2/x' + + api_params = { + customerKey: customer_key, + secretKey: secret_key, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2X + ) + + end + + # Update the project OAuth2 Yahoo configuration. + # + # @param [String] client_id 'Client ID, also known as Customer Key' of Yahoo OAuth2 app. For example: dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm + # @param [String] client_secret 'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: cf978f0000000000000000000000000000c5e2e9 + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Yahoo] + def update_o_auth2_yahoo(client_id: nil, client_secret: nil, enabled: nil) + api_path = '/project/oauth2/yahoo' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Yahoo + ) + + end + + # Update the project OAuth2 Yandex configuration. + # + # @param [String] client_id 'Client ID' of Yandex OAuth2 app. For example: 6a8a6a0000000000000000000091483c + # @param [String] client_secret 'Client Secret' of Yandex OAuth2 app. For example: bbf98500000000000000000000c75a63 + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Yandex] + def update_o_auth2_yandex(client_id: nil, client_secret: nil, enabled: nil) + api_path = '/project/oauth2/yandex' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Yandex + ) + + end + + # Update the project OAuth2 Zoho configuration. + # + # @param [String] client_id 'Client ID' of Zoho OAuth2 app. For example: 1000.83C178000000000000000000RPNX0B + # @param [String] client_secret 'Client Secret' of Zoho OAuth2 app. For example: fb5cac000000000000000000000000000000a68f6e + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Zoho] + def update_o_auth2_zoho(client_id: nil, client_secret: nil, enabled: nil) + api_path = '/project/oauth2/zoho' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Zoho + ) + + end + + # Update the project OAuth2 Zoom configuration. + # + # @param [String] client_id 'Client ID' of Zoom OAuth2 app. For example: QMAC00000000000000w0AQ + # @param [String] client_secret 'Client Secret' of Zoom OAuth2 app. For example: GAWsG4000000000000000000007U01ON + # @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + # + # @return [OAuth2Zoom] + def update_o_auth2_zoom(client_id: nil, client_secret: nil, enabled: nil) + api_path = '/project/oauth2/zoom' + + api_params = { + clientId: client_id, + clientSecret: client_secret, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::OAuth2Zoom + ) + + end + + # Get a list of all platforms in the project. This endpoint returns an array + # of all platforms and their configurations. + # + # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: type, name, hostname, bundleIdentifier, applicationId, packageIdentifierName, packageName + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. + # + # @return [PlatformList] + def list_platforms(queries: nil, total: nil) + api_path = '/project/platforms' + + api_params = { + queries: queries, + total: total, + } + + api_headers = { + } + + @client.call( + method: 'GET', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::PlatformList + ) + + end + + # Create a new Android platform for your project. Use this endpoint to + # register a new Android platform where your users will run your application + # which will interact with the Appwrite API. + # + # @param [String] platform_id Platform 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. + # @param [String] name Platform name. Max length: 128 chars. + # @param [String] application_id Android application ID. Max length: 256 chars. + # + # @return [PlatformAndroid] + def create_android_platform(platform_id:, name:, application_id:) + api_path = '/project/platforms/android' + + if platform_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "platformId"') + end + + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end + + if application_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "applicationId"') + end + + api_params = { + platformId: platform_id, + name: name, + applicationId: application_id, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'POST', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::PlatformAndroid + ) + + end + + # Update an Android platform by its unique ID. Use this endpoint to update + # the platform's name or application ID. + # + # @param [String] platform_id Platform ID. + # @param [String] name Platform name. Max length: 128 chars. + # @param [String] application_id Android application ID. Max length: 256 chars. + # + # @return [PlatformAndroid] + def update_android_platform(platform_id:, name:, application_id:) + api_path = '/project/platforms/android/{platformId}' + .gsub('{platformId}', platform_id) + + if platform_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "platformId"') + end + + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end + + if application_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "applicationId"') + end + + api_params = { + name: name, + applicationId: application_id, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PUT', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::PlatformAndroid + ) + + end + + # Create a new Apple platform for your project. Use this endpoint to register + # a new Apple platform where your users will run your application which will + # interact with the Appwrite API. + # + # @param [String] platform_id Platform 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. + # @param [String] name Platform name. Max length: 128 chars. + # @param [String] bundle_identifier Apple bundle identifier. Max length: 256 chars. + # + # @return [PlatformApple] + def create_apple_platform(platform_id:, name:, bundle_identifier:) + api_path = '/project/platforms/apple' + + if platform_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "platformId"') + end + + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end + + if bundle_identifier.nil? + raise Appwrite::Exception.new('Missing required parameter: "bundleIdentifier"') + end + + api_params = { + platformId: platform_id, + name: name, + bundleIdentifier: bundle_identifier, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'POST', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::PlatformApple + ) + + end + + # Update an Apple platform by its unique ID. Use this endpoint to update the + # platform's name or bundle identifier. + # + # @param [String] platform_id Platform ID. + # @param [String] name Platform name. Max length: 128 chars. + # @param [String] bundle_identifier Apple bundle identifier. Max length: 256 chars. + # + # @return [PlatformApple] + def update_apple_platform(platform_id:, name:, bundle_identifier:) + api_path = '/project/platforms/apple/{platformId}' + .gsub('{platformId}', platform_id) + + if platform_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "platformId"') + end + + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end + + if bundle_identifier.nil? + raise Appwrite::Exception.new('Missing required parameter: "bundleIdentifier"') + end + + api_params = { + name: name, + bundleIdentifier: bundle_identifier, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PUT', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::PlatformApple + ) + + end + + # Create a new Linux platform for your project. Use this endpoint to register + # a new Linux platform where your users will run your application which will + # interact with the Appwrite API. + # + # @param [String] platform_id Platform 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. + # @param [String] name Platform name. Max length: 128 chars. + # @param [String] package_name Linux package name. Max length: 256 chars. + # + # @return [PlatformLinux] + def create_linux_platform(platform_id:, name:, package_name:) + api_path = '/project/platforms/linux' + + if platform_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "platformId"') + end + + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end + + if package_name.nil? + raise Appwrite::Exception.new('Missing required parameter: "packageName"') + end + + api_params = { + platformId: platform_id, + name: name, + packageName: package_name, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'POST', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::PlatformLinux + ) + + end + + # Update a Linux platform by its unique ID. Use this endpoint to update the + # platform's name or package name. + # + # @param [String] platform_id Platform ID. + # @param [String] name Platform name. Max length: 128 chars. + # @param [String] package_name Linux package name. Max length: 256 chars. + # + # @return [PlatformLinux] + def update_linux_platform(platform_id:, name:, package_name:) + api_path = '/project/platforms/linux/{platformId}' + .gsub('{platformId}', platform_id) + + if platform_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "platformId"') + end + + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end + + if package_name.nil? + raise Appwrite::Exception.new('Missing required parameter: "packageName"') + end + + api_params = { + name: name, + packageName: package_name, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PUT', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::PlatformLinux + ) + + end + + # Create a new web platform for your project. Use this endpoint to register a + # new platform where your users will run your application which will interact + # with the Appwrite API. + # + # @param [String] platform_id Platform 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. + # @param [String] name Platform name. Max length: 128 chars. + # @param [String] hostname Platform web hostname. Max length: 256 chars. + # + # @return [PlatformWeb] + def create_web_platform(platform_id:, name:, hostname:) + api_path = '/project/platforms/web' + + if platform_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "platformId"') + end + + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end + + if hostname.nil? + raise Appwrite::Exception.new('Missing required parameter: "hostname"') + end + + api_params = { + platformId: platform_id, + name: name, + hostname: hostname, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'POST', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::PlatformWeb + ) + + end + + # Update a web platform by its unique ID. Use this endpoint to update the + # platform's name or hostname. + # + # @param [String] platform_id Platform ID. + # @param [String] name Platform name. Max length: 128 chars. + # @param [String] hostname Platform web hostname. Max length: 256 chars. + # + # @return [PlatformWeb] + def update_web_platform(platform_id:, name:, hostname:) + api_path = '/project/platforms/web/{platformId}' + .gsub('{platformId}', platform_id) + + if platform_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "platformId"') + end + + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end + + if hostname.nil? + raise Appwrite::Exception.new('Missing required parameter: "hostname"') + end + + api_params = { + name: name, + hostname: hostname, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PUT', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::PlatformWeb + ) + + end + + # Create a new Windows platform for your project. Use this endpoint to + # register a new Windows platform where your users will run your application + # which will interact with the Appwrite API. + # + # @param [String] platform_id Platform 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. + # @param [String] name Platform name. Max length: 128 chars. + # @param [String] package_identifier_name Windows package identifier name. Max length: 256 chars. + # + # @return [PlatformWindows] + def create_windows_platform(platform_id:, name:, package_identifier_name:) + api_path = '/project/platforms/windows' + + if platform_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "platformId"') + end + + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end + + if package_identifier_name.nil? + raise Appwrite::Exception.new('Missing required parameter: "packageIdentifierName"') + end + + api_params = { + platformId: platform_id, + name: name, + packageIdentifierName: package_identifier_name, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'POST', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::PlatformWindows + ) + + end + + # Update a Windows platform by its unique ID. Use this endpoint to update the + # platform's name or package identifier name. + # + # @param [String] platform_id Platform ID. + # @param [String] name Platform name. Max length: 128 chars. + # @param [String] package_identifier_name Windows package identifier name. Max length: 256 chars. + # + # @return [PlatformWindows] + def update_windows_platform(platform_id:, name:, package_identifier_name:) + api_path = '/project/platforms/windows/{platformId}' + .gsub('{platformId}', platform_id) + + if platform_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "platformId"') + end + + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end + + if package_identifier_name.nil? + raise Appwrite::Exception.new('Missing required parameter: "packageIdentifierName"') + end + + api_params = { + name: name, + packageIdentifierName: package_identifier_name, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PUT', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::PlatformWindows + ) + + end + + # Get a platform by its unique ID. This endpoint returns the platform's + # details, including its name, type, and key configurations. + # + # @param [String] platform_id Platform ID. + # + # @return [PlatformWeb, PlatformApple, PlatformAndroid, PlatformWindows, PlatformLinux] + def get_platform(platform_id:) + api_path = '/project/platforms/{platformId}' + .gsub('{platformId}', platform_id) + + if platform_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "platformId"') + end + + api_params = { + } + + api_headers = { + } + + response = @client.call( + method: 'GET', + path: api_path, + headers: api_headers, + params: api_params, + ) + + unless response.is_a?(Hash) + raise Exception, "Expected object response when hydrating a response model" + end + + if response['type'] == 'web' + + return Models::PlatformWeb.from(map: response) + end + + if response['type'] == 'apple' + + return Models::PlatformApple.from(map: response) + end + + if response['type'] == 'android' + + return Models::PlatformAndroid.from(map: response) + end + + if response['type'] == 'windows' + + return Models::PlatformWindows.from(map: response) + end + + if response['type'] == 'linux' + + return Models::PlatformLinux.from(map: response) + end + + raise Exception, "Unable to match response to any expected response model" + + end + + # Delete a platform by its unique ID. This endpoint removes the platform and + # all its configurations from the project. + # + # @param [String] platform_id Platform ID. + # + # @return [] + def delete_platform(platform_id:) + api_path = '/project/platforms/{platformId}' + .gsub('{platformId}', platform_id) + + if platform_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "platformId"') + end + + api_params = { + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'DELETE', + path: api_path, + headers: api_headers, + params: api_params, + ) + + end + + # Get a list of all project policies and their current configuration. + # + # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. + # + # @return [PolicyList] + def list_policies(queries: nil, total: nil) + api_path = '/project/policies' + + api_params = { + queries: queries, + total: total, + } + + api_headers = { + } + + @client.call( + method: 'GET', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::PolicyList + ) + + end + + # Updating this policy allows you to control if team members can see other + # members information. When enabled, all team members can see ID, name, + # email, phone number, and MFA status of other members.. + # + # @param [] user_id Set to true if you want make user ID visible to all team members, or false to hide it. + # @param [] user_email Set to true if you want make user email visible to all team members, or false to hide it. + # @param [] user_phone Set to true if you want make user phone number visible to all team members, or false to hide it. + # @param [] user_name Set to true if you want make user name visible to all team members, or false to hide it. + # @param [] user_mfa Set to true if you want make user MFA status visible to all team members, or false to hide it. + # + # @return [Project] + def update_membership_privacy_policy(user_id: nil, user_email: nil, user_phone: nil, user_name: nil, user_mfa: nil) + api_path = '/project/policies/membership-privacy' + + api_params = { + userId: user_id, + userEmail: user_email, + userPhone: user_phone, + userName: user_name, + userMFA: user_mfa, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::Project + ) + + end + + # Updating this policy allows you to control if new passwords are checked + # against most common passwords dictionary. When enabled, and user changes + # their password, password must not be contained in the dictionary. + # + # @param [] enabled Toggle password dictionary policy. Set to true if you want password change to block passwords in the dictionary, or false to allow them. When changing this policy, existing passwords remain valid. + # + # @return [Project] + def update_password_dictionary_policy(enabled:) + api_path = '/project/policies/password-dictionary' + + if enabled.nil? + raise Appwrite::Exception.new('Missing required parameter: "enabled"') + end + + api_params = { + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::Project + ) + + end + + # Updates one of password strength policies. Based on total length + # configured, previous password hashes are stored, and users cannot choose a + # new password that is already stored in the passwird history list, when + # updating an user password, or setting new one through password recovery. + # + # Keep in mind, while password history policy is disabled, the history is not + # being stored. Enabling the policy will not have any history on existing + # users, and it will only start to collect and enforce the policy on password + # changes since the policy is enabled. + # + # @param [Integer] total Set the password history length per user. Value can be between 1 and 5000, or null to disable the limit. + # + # @return [Project] + def update_password_history_policy(total:) + api_path = '/project/policies/password-history' + + if total.nil? + raise Appwrite::Exception.new('Missing required parameter: "total"') + end + + api_params = { + total: total, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::Project + ) + + end + + # Updating this policy allows you to control if password strength is checked + # against personal data. When enabled, and user sets or changes their + # password, the password must not contain user ID, name, email or phone + # number. + # + # @param [] enabled Toggle password personal data policy. Set to true if you want to block passwords including user's personal data, or false to allow it. When changing this policy, existing passwords remain valid. + # + # @return [Project] + def update_password_personal_data_policy(enabled:) + api_path = '/project/policies/password-personal-data' + + if enabled.nil? + raise Appwrite::Exception.new('Missing required parameter: "enabled"') + end + + api_params = { + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::Project + ) + + end + + # Updating this policy allows you to control if email alert is sent upon + # session creation. When enabled, and user signs into their account, they + # will be sent an email notification. There is an exception, the first + # session after a new sign up does not trigger an alert, even if the policy + # is enabled. + # + # @param [] enabled Toggle session alert policy. Set to true if you want users to receive email notifications when a sessions are created for their users, or false to not send email alerts. + # + # @return [Project] + def update_session_alert_policy(enabled:) + api_path = '/project/policies/session-alert' + + if enabled.nil? + raise Appwrite::Exception.new('Missing required parameter: "enabled"') + end + + api_params = { + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::Project + ) + + end + + # Update maximum duration how long sessions created within a project should + # stay active for. + # + # @param [Integer] duration Maximum session length in seconds. Minium allowed value is 5 second, and maximum is 1 year, which is 31536000 seconds. + # + # @return [Project] + def update_session_duration_policy(duration:) + api_path = '/project/policies/session-duration' + + if duration.nil? + raise Appwrite::Exception.new('Missing required parameter: "duration"') end api_params = { - platformId: platform_id, - name: name, - hostname: hostname, + duration: duration, } api_headers = { @@ -538,42 +2808,31 @@ def create_web_platform(platform_id:, name:, hostname:) } @client.call( - method: 'POST', + method: 'PATCH', path: api_path, headers: api_headers, params: api_params, - response_type: Models::PlatformWeb + response_type: Models::Project ) end - # Update a web platform by its unique ID. Use this endpoint to update the - # platform's name or hostname. + # Updating this policy allows you to control if existing sessions should be + # invalidated when a password of a user is changed. When enabled, and user + # changes their password, they will be logged out of all their devices. # - # @param [String] platform_id Platform ID. - # @param [String] name Platform name. Max length: 128 chars. - # @param [String] hostname Platform web hostname. Max length: 256 chars. + # @param [] enabled Toggle session invalidation policy. Set to true if you want password change to invalidate all sessions of an user, or false to keep sessions active. # - # @return [PlatformWeb] - def update_web_platform(platform_id:, name:, hostname:) - api_path = '/project/platforms/web/{platformId}' - .gsub('{platformId}', platform_id) - - if platform_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "platformId"') - end - - if name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') - end + # @return [Project] + def update_session_invalidation_policy(enabled:) + api_path = '/project/policies/session-invalidation' - if hostname.nil? - raise Appwrite::Exception.new('Missing required parameter: "hostname"') + if enabled.nil? + raise Appwrite::Exception.new('Missing required parameter: "enabled"') end api_params = { - name: name, - hostname: hostname, + enabled: enabled, } api_headers = { @@ -581,43 +2840,30 @@ def update_web_platform(platform_id:, name:, hostname:) } @client.call( - method: 'PUT', + method: 'PATCH', path: api_path, headers: api_headers, params: api_params, - response_type: Models::PlatformWeb + response_type: Models::Project ) end - # Create a new Windows platform for your project. Use this endpoint to - # register a new Windows platform where your users will run your application - # which will interact with the Appwrite API. + # Update the maximum number of sessions allowed per user. When the limit is + # hit, the oldest session will be deleted to make room for new one. # - # @param [String] platform_id Platform 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. - # @param [String] name Platform name. Max length: 128 chars. - # @param [String] package_identifier_name Windows package identifier name. Max length: 256 chars. + # @param [Integer] total Set the maximum number of sessions allowed per user. Value can be between 1 and 5000, or null to disable the limit. # - # @return [PlatformWindows] - def create_windows_platform(platform_id:, name:, package_identifier_name:) - api_path = '/project/platforms/windows' - - if platform_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "platformId"') - end - - if name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') - end + # @return [Project] + def update_session_limit_policy(total:) + api_path = '/project/policies/session-limit' - if package_identifier_name.nil? - raise Appwrite::Exception.new('Missing required parameter: "packageIdentifierName"') + if total.nil? + raise Appwrite::Exception.new('Missing required parameter: "total"') end api_params = { - platformId: platform_id, - name: name, - packageIdentifierName: package_identifier_name, + total: total, } api_headers = { @@ -625,42 +2871,31 @@ def create_windows_platform(platform_id:, name:, package_identifier_name:) } @client.call( - method: 'POST', + method: 'PATCH', path: api_path, headers: api_headers, params: api_params, - response_type: Models::PlatformWindows + response_type: Models::Project ) end - # Update a Windows platform by its unique ID. Use this endpoint to update the - # platform's name or package identifier name. + # Update the maximum number of users in the project. When the limit is hit or + # amount of existing users already exceeded the limit, all users remain + # active, but new user sign up will be prohibited. # - # @param [String] platform_id Platform ID. - # @param [String] name Platform name. Max length: 128 chars. - # @param [String] package_identifier_name Windows package identifier name. Max length: 256 chars. + # @param [Integer] total Set the maximum number of users allowed in the project. Value can be between 1 and 5000, or null to disable the limit. # - # @return [PlatformWindows] - def update_windows_platform(platform_id:, name:, package_identifier_name:) - api_path = '/project/platforms/windows/{platformId}' - .gsub('{platformId}', platform_id) - - if platform_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "platformId"') - end - - if name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') - end + # @return [Project] + def update_user_limit_policy(total:) + api_path = '/project/policies/user-limit' - if package_identifier_name.nil? - raise Appwrite::Exception.new('Missing required parameter: "packageIdentifierName"') + if total.nil? + raise Appwrite::Exception.new('Missing required parameter: "total"') end api_params = { - name: name, - packageIdentifierName: package_identifier_name, + total: total, } api_headers = { @@ -668,27 +2903,27 @@ def update_windows_platform(platform_id:, name:, package_identifier_name:) } @client.call( - method: 'PUT', + method: 'PATCH', path: api_path, headers: api_headers, params: api_params, - response_type: Models::PlatformWindows + response_type: Models::Project ) end - # Get a platform by its unique ID. This endpoint returns the platform's - # details, including its name, type, and key configurations. + # Get a policy by its unique ID. This endpoint returns the current + # configuration for the requested project policy. # - # @param [String] platform_id Platform ID. + # @param [PolicyId] policy_id Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy. # - # @return [PlatformWeb, PlatformApple, PlatformAndroid, PlatformWindows, PlatformLinux] - def get_platform(platform_id:) - api_path = '/project/platforms/{platformId}' - .gsub('{platformId}', platform_id) + # @return [PolicyPasswordDictionary, PolicyPasswordHistory, PolicyPasswordPersonalData, PolicySessionAlert, PolicySessionDuration, PolicySessionInvalidation, PolicySessionLimit, PolicyUserLimit, PolicyMembershipPrivacy] + def get_policy(policy_id:) + api_path = '/project/policies/{policyId}' + .gsub('{policyId}', policy_id) - if platform_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "platformId"') + if policy_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "policyId"') end api_params = { @@ -708,74 +2943,64 @@ def get_platform(platform_id:) raise Exception, "Expected object response when hydrating a response model" end - if response['type'] == 'web' + if response['$id'] == 'password-dictionary' - return Models::PlatformWeb.from(map: response) + return Models::PolicyPasswordDictionary.from(map: response) end - if response['type'] == 'apple' + if response['$id'] == 'password-history' - return Models::PlatformApple.from(map: response) + return Models::PolicyPasswordHistory.from(map: response) end - if response['type'] == 'android' + if response['$id'] == 'password-personal-data' - return Models::PlatformAndroid.from(map: response) + return Models::PolicyPasswordPersonalData.from(map: response) end - if response['type'] == 'windows' + if response['$id'] == 'session-alert' - return Models::PlatformWindows.from(map: response) + return Models::PolicySessionAlert.from(map: response) end - if response['type'] == 'linux' + if response['$id'] == 'session-duration' - return Models::PlatformLinux.from(map: response) + return Models::PolicySessionDuration.from(map: response) end - raise Exception, "Unable to match response to any expected response model" + if response['$id'] == 'session-invalidation' - end + return Models::PolicySessionInvalidation.from(map: response) + end - # Delete a platform by its unique ID. This endpoint removes the platform and - # all its configurations from the project. - # - # @param [String] platform_id Platform ID. - # - # @return [] - def delete_platform(platform_id:) - api_path = '/project/platforms/{platformId}' - .gsub('{platformId}', platform_id) + if response['$id'] == 'session-limit' - if platform_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "platformId"') + return Models::PolicySessionLimit.from(map: response) end - api_params = { - } - - api_headers = { - "content-type": 'application/json', - } + if response['$id'] == 'user-limit' - @client.call( - method: 'DELETE', - path: api_path, - headers: api_headers, - params: api_params, - ) + return Models::PolicyUserLimit.from(map: response) + end + + if response['$id'] == 'membership-privacy' + + return Models::PolicyMembershipPrivacy.from(map: response) + end + + raise Exception, "Unable to match response to any expected response model" end - # Update the status of a specific protocol. Use this endpoint to enable or + # Update properties of a specific protocol. Use this endpoint to enable or # disable a protocol in your project. # # @param [ProtocolId] protocol_id Protocol name. Can be one of: rest, graphql, websocket # @param [] enabled Protocol status. # # @return [Project] - def update_protocol_status(protocol_id:, enabled:) - api_path = '/project/protocols/{protocolId}/status' + def update_protocol(protocol_id:, enabled:) + api_path = '/project/protocols/{protocolId}' .gsub('{protocolId}', protocol_id) if protocol_id.nil? @@ -804,15 +3029,15 @@ def update_protocol_status(protocol_id:, enabled:) end - # Update the status of a specific service. Use this endpoint to enable or + # Update properties of a specific service. Use this endpoint to enable or # disable a service in your project. # # @param [ServiceId] service_id Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging # @param [] enabled Service status. # # @return [Project] - def update_service_status(service_id:, enabled:) - api_path = '/project/services/{serviceId}/status' + def update_service(service_id:, enabled:) + api_path = '/project/services/{serviceId}' .gsub('{serviceId}', service_id) if service_id.nil? @@ -841,6 +3066,188 @@ def update_service_status(service_id:, enabled:) end + # Update the SMTP configuration for your project. Use this endpoint to + # configure your project's SMTP provider with your custom settings for + # sending transactional emails. + # + # @param [String] host SMTP server hostname (domain) + # @param [Integer] port SMTP server port + # @param [String] username SMTP server username. Leave empty for no authorization. + # @param [String] password SMTP server password. Leave empty for no authorization. This property is stored securely and cannot be read in future (write-only). + # @param [String] sender_email Email address shown in inbox as the sender of the email. + # @param [String] sender_name Name shown in inbox as the sender of the email. + # @param [String] reply_to_email Email used when user replies to the email. + # @param [String] reply_to_name Name used when user replies to the email. + # @param [Secure] secure Configures if communication with SMTP server is encrypted. Allowed values are: tls, ssl. Leave empty for no encryption. + # @param [] enabled Enable or disable custom SMTP. Custom SMTP is useful for branding purposes, but also allows use of custom email templates. + # + # @return [Project] + def update_smtp(host: nil, port: nil, username: nil, password: nil, sender_email: nil, sender_name: nil, reply_to_email: nil, reply_to_name: nil, secure: nil, enabled: nil) + api_path = '/project/smtp' + + api_params = { + host: host, + port: port, + username: username, + password: password, + senderEmail: sender_email, + senderName: sender_name, + replyToEmail: reply_to_email, + replyToName: reply_to_name, + secure: secure, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::Project + ) + + end + + # Send a test email to verify SMTP configuration. + # + # @param [Array] emails Array of emails to send test email to. Maximum of 10 emails are allowed. + # + # @return [] + def create_smtp_test(emails:) + api_path = '/project/smtp/tests' + + if emails.nil? + raise Appwrite::Exception.new('Missing required parameter: "emails"') + end + + api_params = { + emails: emails, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'POST', + path: api_path, + headers: api_headers, + params: api_params, + ) + + end + + # Get a list of all custom email templates configured for the project. This + # endpoint returns an array of all configured email templates and their + # locales. + # + # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. + # + # @return [EmailTemplateList] + def list_email_templates(queries: nil, total: nil) + api_path = '/project/templates/email' + + api_params = { + queries: queries, + total: total, + } + + api_headers = { + } + + @client.call( + method: 'GET', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::EmailTemplateList + ) + + end + + # Update a custom email template for the specified locale and type. Use this + # endpoint to modify the content of your email templates. + # + # @param [EmailTemplateType] template_id Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession + # @param [EmailTemplateLocale] locale Custom email template locale. If left empty, the fallback locale (en) will be used. + # @param [String] subject Subject of the email template. Can be up to 255 characters. + # @param [String] message Plain or HTML body of the email template message. Can be up to 10MB of content. + # @param [String] sender_name Name of the email sender. + # @param [String] sender_email Email of the sender. + # @param [String] reply_to_email Reply to email. + # @param [String] reply_to_name Reply to name. + # + # @return [EmailTemplate] + def update_email_template(template_id:, locale: nil, subject: nil, message: nil, sender_name: nil, sender_email: nil, reply_to_email: nil, reply_to_name: nil) + api_path = '/project/templates/email' + + if template_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "templateId"') + end + + api_params = { + templateId: template_id, + locale: locale, + subject: subject, + message: message, + senderName: sender_name, + senderEmail: sender_email, + replyToEmail: reply_to_email, + replyToName: reply_to_name, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::EmailTemplate + ) + + end + + # Get a custom email template for the specified locale and type. This + # endpoint returns the template content, subject, and other configuration + # details. + # + # @param [EmailTemplateType] template_id Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession + # @param [EmailTemplateLocale] locale Custom email template locale. If left empty, the fallback locale (en) will be used. + # + # @return [EmailTemplate] + def get_email_template(template_id:, locale: nil) + api_path = '/project/templates/email/{templateId}' + .gsub('{templateId}', template_id) + + if template_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "templateId"') + end + + api_params = { + locale: locale, + } + + api_headers = { + } + + @client.call( + method: 'GET', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::EmailTemplate + ) + + end + # Get a list of all project environment variables. # # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret @@ -871,7 +3278,7 @@ def list_variables(queries: nil, total: nil) # Create a new project environment variable. These variables can be accessed # by all functions and sites in the project. # - # @param [String] variable_id Variable ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + # @param [String] variable_id Variable unique 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. # @param [String] key Variable key. Max length: 255 chars. # @param [String] value Variable value. Max length: 8192 chars. # @param [] secret Secret variables can be updated or deleted, but only projects can read them during build and runtime. @@ -915,7 +3322,7 @@ def create_variable(variable_id:, key:, value:, secret: nil) # Get a variable by its unique ID. # - # @param [String] variable_id Variable ID. + # @param [String] variable_id Variable unique ID. # # @return [Variable] def get_variable(variable_id:) @@ -944,7 +3351,7 @@ def get_variable(variable_id:) # Update variable by its unique ID. # - # @param [String] variable_id Variable ID. + # @param [String] variable_id Variable unique ID. # @param [String] key Variable key. Max length: 255 chars. # @param [String] value Variable value. Max length: 8192 chars. # @param [] secret Secret variables can be updated or deleted, but only projects can read them during build and runtime. @@ -980,7 +3387,7 @@ def update_variable(variable_id:, key: nil, value: nil, secret: nil) # Delete a variable by its unique ID. # - # @param [String] variable_id Variable ID. + # @param [String] variable_id Variable unique ID. # # @return [] def delete_variable(variable_id:) diff --git a/lib/appwrite/services/proxy.rb b/lib/appwrite/services/proxy.rb new file mode 100644 index 0000000..d30a6cc --- /dev/null +++ b/lib/appwrite/services/proxy.rb @@ -0,0 +1,303 @@ +#frozen_string_literal: true + +module Appwrite + class Proxy < Service + + def initialize(client) + @client = client + end + + # Get a list of all the proxy rules. You can use the query params to filter + # your results. + # + # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. + # + # @return [ProxyRuleList] + def list_rules(queries: nil, total: nil) + api_path = '/proxy/rules' + + api_params = { + queries: queries, + total: total, + } + + api_headers = { + } + + @client.call( + method: 'GET', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::ProxyRuleList + ) + + end + + # Create a new proxy rule for serving Appwrite's API on custom domain. + # + # Rule ID is automatically generated as MD5 hash of a rule domain for + # performance purposes. + # + # @param [String] domain Domain name. + # + # @return [ProxyRule] + def create_api_rule(domain:) + api_path = '/proxy/rules/api' + + if domain.nil? + raise Appwrite::Exception.new('Missing required parameter: "domain"') + end + + api_params = { + domain: domain, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'POST', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::ProxyRule + ) + + end + + # Create a new proxy rule for executing Appwrite Function on custom domain. + # + # Rule ID is automatically generated as MD5 hash of a rule domain for + # performance purposes. + # + # @param [String] domain Domain name. + # @param [String] function_id ID of function to be executed. + # @param [String] branch Name of VCS branch to deploy changes automatically + # + # @return [ProxyRule] + def create_function_rule(domain:, function_id:, branch: nil) + api_path = '/proxy/rules/function' + + if domain.nil? + raise Appwrite::Exception.new('Missing required parameter: "domain"') + end + + if function_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "functionId"') + end + + api_params = { + domain: domain, + functionId: function_id, + branch: branch, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'POST', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::ProxyRule + ) + + end + + # Create a new proxy rule for to redirect from custom domain to another + # domain. + # + # Rule ID is automatically generated as MD5 hash of a rule domain for + # performance purposes. + # + # @param [String] domain Domain name. + # @param [String] url Target URL of redirection + # @param [StatusCode] status_code Status code of redirection + # @param [String] resource_id ID of parent resource. + # @param [ProxyResourceType] resource_type Type of parent resource. + # + # @return [ProxyRule] + def create_redirect_rule(domain:, url:, status_code:, resource_id:, resource_type:) + api_path = '/proxy/rules/redirect' + + if domain.nil? + raise Appwrite::Exception.new('Missing required parameter: "domain"') + end + + if url.nil? + raise Appwrite::Exception.new('Missing required parameter: "url"') + end + + if status_code.nil? + raise Appwrite::Exception.new('Missing required parameter: "statusCode"') + end + + if resource_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "resourceId"') + end + + if resource_type.nil? + raise Appwrite::Exception.new('Missing required parameter: "resourceType"') + end + + api_params = { + domain: domain, + url: url, + statusCode: status_code, + resourceId: resource_id, + resourceType: resource_type, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'POST', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::ProxyRule + ) + + end + + # Create a new proxy rule for serving Appwrite Site on custom domain. + # + # Rule ID is automatically generated as MD5 hash of a rule domain for + # performance purposes. + # + # @param [String] domain Domain name. + # @param [String] site_id ID of site to be executed. + # @param [String] branch Name of VCS branch to deploy changes automatically + # + # @return [ProxyRule] + def create_site_rule(domain:, site_id:, branch: nil) + api_path = '/proxy/rules/site' + + if domain.nil? + raise Appwrite::Exception.new('Missing required parameter: "domain"') + end + + if site_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "siteId"') + end + + api_params = { + domain: domain, + siteId: site_id, + branch: branch, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'POST', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::ProxyRule + ) + + end + + # Get a proxy rule by its unique ID. + # + # @param [String] rule_id Rule ID. + # + # @return [ProxyRule] + def get_rule(rule_id:) + api_path = '/proxy/rules/{ruleId}' + .gsub('{ruleId}', rule_id) + + if rule_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "ruleId"') + end + + api_params = { + } + + api_headers = { + } + + @client.call( + method: 'GET', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::ProxyRule + ) + + end + + # Delete a proxy rule by its unique ID. + # + # @param [String] rule_id Rule ID. + # + # @return [] + def delete_rule(rule_id:) + api_path = '/proxy/rules/{ruleId}' + .gsub('{ruleId}', rule_id) + + if rule_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "ruleId"') + end + + api_params = { + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'DELETE', + path: api_path, + headers: api_headers, + params: api_params, + ) + + end + + # If not succeeded yet, retry verification process of a proxy rule domain. + # This endpoint triggers domain verification by checking DNS records. If + # verification is successful, a TLS certificate will be automatically + # provisioned for the domain asynchronously in the background. + # + # @param [String] rule_id Rule ID. + # + # @return [ProxyRule] + def update_rule_status(rule_id:) + api_path = '/proxy/rules/{ruleId}/status' + .gsub('{ruleId}', rule_id) + + if rule_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "ruleId"') + end + + api_params = { + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::ProxyRule + ) + + end + + end +end diff --git a/lib/appwrite/services/sites.rb b/lib/appwrite/services/sites.rb index be98543..5e7612f 100644 --- a/lib/appwrite/services/sites.rb +++ b/lib/appwrite/services/sites.rb @@ -833,9 +833,11 @@ def delete_log(site_id:, log_id:) # Get a list of all variables of a specific site. # # @param [String] site_id Site unique ID. + # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [VariableList] - def list_variables(site_id:) + def list_variables(site_id:, queries: nil, total: nil) api_path = '/sites/{siteId}/variables' .gsub('{siteId}', site_id) @@ -844,6 +846,8 @@ def list_variables(site_id:) end api_params = { + queries: queries, + total: total, } api_headers = { @@ -863,12 +867,13 @@ def list_variables(site_id:) # and runtime (server-side rendering) as environment variables. # # @param [String] site_id Site unique ID. + # @param [String] variable_id Variable ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. # @param [String] key Variable key. Max length: 255 chars. # @param [String] value Variable value. Max length: 8192 chars. # @param [] secret Secret variables can be updated or deleted, but only sites can read them during build and runtime. # # @return [Variable] - def create_variable(site_id:, key:, value:, secret: nil) + def create_variable(site_id:, variable_id:, key:, value:, secret: nil) api_path = '/sites/{siteId}/variables' .gsub('{siteId}', site_id) @@ -876,6 +881,10 @@ def create_variable(site_id:, key:, value:, secret: nil) raise Appwrite::Exception.new('Missing required parameter: "siteId"') end + if variable_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "variableId"') + end + if key.nil? raise Appwrite::Exception.new('Missing required parameter: "key"') end @@ -885,6 +894,7 @@ def create_variable(site_id:, key:, value:, secret: nil) end api_params = { + variableId: variable_id, key: key, value: value, secret: secret, @@ -948,7 +958,7 @@ def get_variable(site_id:, variable_id:) # @param [] secret Secret variables can be updated or deleted, but only sites can read them during build and runtime. # # @return [Variable] - def update_variable(site_id:, variable_id:, key:, value: nil, secret: nil) + def update_variable(site_id:, variable_id:, key: nil, value: nil, secret: nil) api_path = '/sites/{siteId}/variables/{variableId}' .gsub('{siteId}', site_id) .gsub('{variableId}', variable_id) @@ -961,10 +971,6 @@ def update_variable(site_id:, variable_id:, key:, value: nil, secret: nil) raise Appwrite::Exception.new('Missing required parameter: "variableId"') end - if key.nil? - raise Appwrite::Exception.new('Missing required parameter: "key"') - end - api_params = { key: key, value: value, diff --git a/lib/appwrite/services/tables_db.rb b/lib/appwrite/services/tables_db.rb index 31ef6cc..8b65405 100644 --- a/lib/appwrite/services/tables_db.rb +++ b/lib/appwrite/services/tables_db.rb @@ -593,6 +593,126 @@ def list_columns(database_id:, table_id:, queries: nil, total: nil) end + # Create a bigint column. Optionally, minimum and maximum values can be + # provided. + # + # + # @param [String] database_id Database ID. + # @param [String] table_id Table ID. + # @param [String] key Column Key. + # @param [] required Is column required? + # @param [Integer] min Minimum value + # @param [Integer] max Maximum value + # @param [Integer] default Default value. Cannot be set when column is required. + # @param [] array Is column an array? + # + # @return [ColumnBigint] + def create_big_int_column(database_id:, table_id:, key:, required:, min: nil, max: nil, default: nil, array: nil) + api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/bigint' + .gsub('{databaseId}', database_id) + .gsub('{tableId}', table_id) + + if database_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + end + + if table_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "tableId"') + end + + if key.nil? + raise Appwrite::Exception.new('Missing required parameter: "key"') + end + + if required.nil? + raise Appwrite::Exception.new('Missing required parameter: "required"') + end + + api_params = { + key: key, + required: required, + min: min, + max: max, + default: default, + array: array, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'POST', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::ColumnBigint + ) + + end + + # Update a bigint column. Changing the `default` value will not update + # already existing rows. + # + # + # @param [String] database_id Database ID. + # @param [String] table_id Table ID. + # @param [String] key Column Key. + # @param [] required Is column required? + # @param [Integer] default Default value. Cannot be set when column is required. + # @param [Integer] min Minimum value + # @param [Integer] max Maximum value + # @param [String] new_key New Column Key. + # + # @return [ColumnBigint] + def update_big_int_column(database_id:, table_id:, key:, required:, default:, min: nil, max: nil, new_key: nil) + api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/bigint/{key}' + .gsub('{databaseId}', database_id) + .gsub('{tableId}', table_id) + .gsub('{key}', key) + + if database_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + end + + if table_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "tableId"') + end + + if key.nil? + raise Appwrite::Exception.new('Missing required parameter: "key"') + end + + if required.nil? + raise Appwrite::Exception.new('Missing required parameter: "required"') + end + + if default.nil? + raise Appwrite::Exception.new('Missing required parameter: "default"') + end + + api_params = { + required: required, + min: min, + max: max, + default: default, + newKey: new_key, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::ColumnBigint + ) + + end + # Create a boolean column. # #