From 0bd7e07a891c4989e540556015d219b4683770ec Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 14 Sep 2022 22:47:04 +1200 Subject: [PATCH] Update for 1.0.0 --- README.md | 10 +- appwrite.gemspec | 2 +- .../account/create-phone-verification.md | 8 +- docs/examples/account/create-recovery.md | 8 +- docs/examples/account/create-verification.md | 8 +- docs/examples/account/delete-session.md | 8 +- docs/examples/account/delete-sessions.md | 8 +- docs/examples/account/get-logs.md | 6 +- docs/examples/account/get-prefs.md | 8 +- docs/examples/account/get-session.md | 8 +- docs/examples/account/get-sessions.md | 6 +- docs/examples/account/get.md | 8 +- docs/examples/account/list-logs.md | 14 + docs/examples/account/list-sessions.md | 14 + docs/examples/account/update-email.md | 8 +- docs/examples/account/update-name.md | 8 +- docs/examples/account/update-password.md | 8 +- .../account/update-phone-verification.md | 8 +- docs/examples/account/update-phone.md | 8 +- docs/examples/account/update-prefs.md | 8 +- docs/examples/account/update-recovery.md | 8 +- docs/examples/account/update-session.md | 8 +- docs/examples/account/update-status.md | 8 +- docs/examples/account/update-verification.md | 8 +- docs/examples/avatars/get-browser.md | 8 +- docs/examples/avatars/get-credit-card.md | 8 +- docs/examples/avatars/get-favicon.md | 8 +- docs/examples/avatars/get-flag.md | 8 +- docs/examples/avatars/get-image.md | 8 +- docs/examples/avatars/get-initials.md | 8 +- docs/examples/avatars/get-q-r.md | 8 +- .../databases/create-boolean-attribute.md | 8 +- docs/examples/databases/create-collection.md | 8 +- .../databases/create-datetime-attribute.md | 8 +- docs/examples/databases/create-document.md | 8 +- .../databases/create-email-attribute.md | 8 +- .../databases/create-enum-attribute.md | 8 +- .../databases/create-float-attribute.md | 8 +- docs/examples/databases/create-index.md | 8 +- .../databases/create-integer-attribute.md | 8 +- .../examples/databases/create-ip-attribute.md | 8 +- .../databases/create-string-attribute.md | 8 +- .../databases/create-url-attribute.md | 8 +- docs/examples/databases/create.md | 8 +- docs/examples/databases/delete-attribute.md | 8 +- docs/examples/databases/delete-collection.md | 8 +- docs/examples/databases/delete-document.md | 8 +- docs/examples/databases/delete-index.md | 8 +- docs/examples/databases/delete.md | 8 +- docs/examples/databases/get-attribute.md | 8 +- docs/examples/databases/get-collection.md | 8 +- docs/examples/databases/get-document.md | 8 +- docs/examples/databases/get-index.md | 8 +- docs/examples/databases/get.md | 8 +- docs/examples/databases/list-attributes.md | 8 +- docs/examples/databases/list-collections.md | 8 +- docs/examples/databases/list-documents.md | 8 +- docs/examples/databases/list-indexes.md | 8 +- docs/examples/databases/list.md | 8 +- docs/examples/databases/update-collection.md | 8 +- docs/examples/databases/update-document.md | 8 +- docs/examples/databases/update.md | 8 +- docs/examples/functions/create-deployment.md | 10 +- docs/examples/functions/create-execution.md | 8 +- docs/examples/functions/create-variable.md | 8 +- docs/examples/functions/create.md | 8 +- docs/examples/functions/delete-deployment.md | 8 +- docs/examples/functions/delete-variable.md | 8 +- docs/examples/functions/delete.md | 8 +- docs/examples/functions/get-deployment.md | 8 +- docs/examples/functions/get-execution.md | 8 +- docs/examples/functions/get-variable.md | 8 +- docs/examples/functions/get.md | 8 +- docs/examples/functions/list-deployments.md | 8 +- docs/examples/functions/list-executions.md | 8 +- docs/examples/functions/list-runtimes.md | 8 +- docs/examples/functions/list-variables.md | 8 +- docs/examples/functions/list.md | 8 +- docs/examples/functions/retry-build.md | 8 +- docs/examples/functions/update-deployment.md | 8 +- docs/examples/functions/update-variable.md | 8 +- docs/examples/functions/update.md | 8 +- docs/examples/health/get-antivirus.md | 8 +- docs/examples/health/get-cache.md | 8 +- docs/examples/health/get-d-b.md | 8 +- .../examples/health/get-queue-certificates.md | 8 +- docs/examples/health/get-queue-functions.md | 8 +- docs/examples/health/get-queue-logs.md | 8 +- docs/examples/health/get-queue-webhooks.md | 8 +- docs/examples/health/get-storage-local.md | 8 +- docs/examples/health/get-time.md | 8 +- docs/examples/health/get.md | 8 +- docs/examples/locale/get-continents.md | 6 +- docs/examples/locale/get-countries-e-u.md | 6 +- docs/examples/locale/get-countries-phones.md | 6 +- docs/examples/locale/get-countries.md | 6 +- docs/examples/locale/get-currencies.md | 6 +- docs/examples/locale/get-languages.md | 6 +- docs/examples/locale/get.md | 8 +- docs/examples/locale/list-continents.md | 14 + docs/examples/locale/list-countries-e-u.md | 14 + docs/examples/locale/list-countries-phones.md | 14 + docs/examples/locale/list-countries.md | 14 + docs/examples/locale/list-currencies.md | 14 + docs/examples/locale/list-languages.md | 14 + docs/examples/storage/create-bucket.md | 8 +- docs/examples/storage/create-file.md | 11 +- docs/examples/storage/delete-bucket.md | 8 +- docs/examples/storage/delete-file.md | 8 +- docs/examples/storage/get-bucket.md | 8 +- docs/examples/storage/get-file-download.md | 8 +- docs/examples/storage/get-file-preview.md | 8 +- docs/examples/storage/get-file-view.md | 8 +- docs/examples/storage/get-file.md | 8 +- docs/examples/storage/list-buckets.md | 8 +- docs/examples/storage/list-files.md | 8 +- docs/examples/storage/update-bucket.md | 8 +- docs/examples/storage/update-file.md | 8 +- docs/examples/teams/create-membership.md | 8 +- docs/examples/teams/create.md | 8 +- docs/examples/teams/delete-membership.md | 8 +- docs/examples/teams/delete.md | 8 +- docs/examples/teams/get-membership.md | 8 +- docs/examples/teams/get-memberships.md | 6 +- docs/examples/teams/get.md | 8 +- docs/examples/teams/list-memberships.md | 14 + docs/examples/teams/list.md | 8 +- .../examples/teams/update-membership-roles.md | 8 +- .../teams/update-membership-status.md | 8 +- docs/examples/teams/update.md | 8 +- docs/examples/users/create-argon2user.md | 8 +- docs/examples/users/create-bcrypt-user.md | 8 +- docs/examples/users/create-m-d5user.md | 8 +- docs/examples/users/create-p-h-pass-user.md | 8 +- docs/examples/users/create-s-h-a-user.md | 8 +- .../users/create-scrypt-modified-user.md | 8 +- docs/examples/users/create-scrypt-user.md | 8 +- docs/examples/users/create.md | 8 +- docs/examples/users/delete-session.md | 8 +- docs/examples/users/delete-sessions.md | 8 +- docs/examples/users/delete.md | 8 +- docs/examples/users/get-logs.md | 6 +- docs/examples/users/get-memberships.md | 6 +- docs/examples/users/get-prefs.md | 8 +- docs/examples/users/get-sessions.md | 6 +- docs/examples/users/get.md | 8 +- docs/examples/users/list-logs.md | 14 + docs/examples/users/list-memberships.md | 14 + docs/examples/users/list-sessions.md | 14 + docs/examples/users/list.md | 8 +- .../users/update-email-verification.md | 8 +- docs/examples/users/update-email.md | 8 +- docs/examples/users/update-name.md | 8 +- docs/examples/users/update-password.md | 8 +- .../users/update-phone-verification.md | 8 +- docs/examples/users/update-phone.md | 8 +- docs/examples/users/update-prefs.md | 8 +- docs/examples/users/update-status.md | 8 +- lib/appwrite/client.rb | 4 +- lib/appwrite/models/document.rb | 15 +- lib/appwrite/models/execution.rb | 10 +- lib/appwrite/models/function.rb | 10 +- lib/appwrite/role.rb | 20 +- lib/appwrite/services/account.rb | 194 ++--- lib/appwrite/services/avatars.rb | 61 +- lib/appwrite/services/databases.rb | 789 +++++++++--------- lib/appwrite/services/functions.rb | 380 ++++----- lib/appwrite/services/health.rb | 10 - lib/appwrite/services/locale.rb | 19 +- lib/appwrite/services/storage.rb | 223 +++-- lib/appwrite/services/teams.rb | 199 +++-- lib/appwrite/services/users.rb | 477 +++++------ 172 files changed, 1882 insertions(+), 1842 deletions(-) create mode 100644 docs/examples/account/list-logs.md create mode 100644 docs/examples/account/list-sessions.md create mode 100644 docs/examples/locale/list-continents.md create mode 100644 docs/examples/locale/list-countries-e-u.md create mode 100644 docs/examples/locale/list-countries-phones.md create mode 100644 docs/examples/locale/list-countries.md create mode 100644 docs/examples/locale/list-currencies.md create mode 100644 docs/examples/locale/list-languages.md create mode 100644 docs/examples/teams/list-memberships.md create mode 100644 docs/examples/users/list-logs.md create mode 100644 docs/examples/users/list-memberships.md create mode 100644 docs/examples/users/list-sessions.md diff --git a/README.md b/README.md index 6b47380..606d3cd 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.0.0-RC1-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.0.0-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.0.0-RC1. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-ruby/releases).** +**This SDK is compatible with Appwrite server version 1.0.0. 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 abstract and simplify 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) @@ -45,7 +45,7 @@ Once your SDK object is set, create any of the Appwrite service objects and choo ```ruby users = Appwrite::Users.new(client); -result = users.create(userId: '[USER_ID]', email: 'email@example.com', password: 'password'); +user = users.create(userId: Appwrite::ID::unique(), email: 'email@example.com', password: 'password'); ``` ### Full Example @@ -63,7 +63,7 @@ client users = Appwrite::Users.new(client); -result = users.create(userId: '[USER_ID]', email: 'email@example.com', password: 'password'); +user = users.create(userId: Appwrite::ID::unique(), email: 'email@example.com', password: 'password'); ``` ### Error Handling @@ -73,7 +73,7 @@ The Appwrite Ruby SDK raises `Appwrite::Exception` object with `message`, `code` users = Appwrite::Users.new(client); begin - result = users.create(userId: '[USER_ID]', email: 'email@example.com', password: 'password'); + user = users.create(userId: Appwrite::ID::unique(), email: 'email@example.com', password: 'password'); rescue Appwrite::Exception => error puts error.message end diff --git a/appwrite.gemspec b/appwrite.gemspec index f8ca46c..63000a5 100644 --- a/appwrite.gemspec +++ b/appwrite.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |spec| spec.name = 'appwrite' - spec.version = '7.0.0-RC2' + spec.version = '7.0.0' spec.license = 'BSD-3-Clause' spec.summary = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API' spec.author = 'Appwrite Team' diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index 10b9b86..5e50ef2 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -account = Appwrite::Account.new(client) +account = Account.new(client) response = account.create_phone_verification() diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index e8d2e55..e1f36e4 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -account = Appwrite::Account.new(client) +account = Account.new(client) response = account.create_recovery(email: 'email@example.com', url: 'https://example.com') diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index e2793d1..a509232 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -account = Appwrite::Account.new(client) +account = Account.new(client) response = account.create_verification(url: 'https://example.com') diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index 31eb776..4d859ba 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -account = Appwrite::Account.new(client) +account = Account.new(client) response = account.delete_session(session_id: '[SESSION_ID]') diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index b2cd871..09c499c 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -account = Appwrite::Account.new(client) +account = Account.new(client) response = account.delete_sessions() diff --git a/docs/examples/account/get-logs.md b/docs/examples/account/get-logs.md index 31d1aeb..8c56bb3 100644 --- a/docs/examples/account/get-logs.md +++ b/docs/examples/account/get-logs.md @@ -1,13 +1,13 @@ require 'appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -account = Appwrite::Account.new(client) +account = Account.new(client) response = account.get_logs() diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index 399b02f..7598c09 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -account = Appwrite::Account.new(client) +account = Account.new(client) response = account.get_prefs() diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index c5da759..1bc3657 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -account = Appwrite::Account.new(client) +account = Account.new(client) response = account.get_session(session_id: '[SESSION_ID]') diff --git a/docs/examples/account/get-sessions.md b/docs/examples/account/get-sessions.md index 67302aa..b7cb5a8 100644 --- a/docs/examples/account/get-sessions.md +++ b/docs/examples/account/get-sessions.md @@ -1,13 +1,13 @@ require 'appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -account = Appwrite::Account.new(client) +account = Account.new(client) response = account.get_sessions() diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index 15feca1..e19a708 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -account = Appwrite::Account.new(client) +account = Account.new(client) response = account.get() diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md new file mode 100644 index 0000000..7eaa08e --- /dev/null +++ b/docs/examples/account/list-logs.md @@ -0,0 +1,14 @@ +require 'Appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + +account = Account.new(client) + +response = account.list_logs() + +puts response.inspect \ No newline at end of file diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md new file mode 100644 index 0000000..d2764ff --- /dev/null +++ b/docs/examples/account/list-sessions.md @@ -0,0 +1,14 @@ +require 'Appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + +account = Account.new(client) + +response = account.list_sessions() + +puts response.inspect \ No newline at end of file diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index a036b30..da0d3ff 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -account = Appwrite::Account.new(client) +account = Account.new(client) response = account.update_email(email: 'email@example.com', password: 'password') diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index 217be57..7402945 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -account = Appwrite::Account.new(client) +account = Account.new(client) response = account.update_name(name: '[NAME]') diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 0e6914d..4881f3e 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -account = Appwrite::Account.new(client) +account = Account.new(client) response = account.update_password(password: 'password') diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index 06a6121..a23ffad 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -account = Appwrite::Account.new(client) +account = Account.new(client) response = account.update_phone_verification(user_id: '[USER_ID]', secret: '[SECRET]') diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index e94e4fa..8e6130d 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -account = Appwrite::Account.new(client) +account = Account.new(client) response = account.update_phone(phone: '', password: 'password') diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index 6a78546..b46d254 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -account = Appwrite::Account.new(client) +account = Account.new(client) response = account.update_prefs(prefs: {}) diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index d6d0050..6016728 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -account = Appwrite::Account.new(client) +account = Account.new(client) response = account.update_recovery(user_id: '[USER_ID]', secret: '[SECRET]', password: 'password', password_again: 'password') diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index 281efc7..bc6935e 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -account = Appwrite::Account.new(client) +account = Account.new(client) response = account.update_session(session_id: '[SESSION_ID]') diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index c609271..bf17db5 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -account = Appwrite::Account.new(client) +account = Account.new(client) response = account.update_status() diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index c2079c0..4a5379e 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -account = Appwrite::Account.new(client) +account = Account.new(client) response = account.update_verification(user_id: '[USER_ID]', secret: '[SECRET]') diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index e339445..4ed59ea 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -avatars = Appwrite::Avatars.new(client) +avatars = Avatars.new(client) response = avatars.get_browser(code: 'aa') diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index bf2d103..ba0dc4a 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -avatars = Appwrite::Avatars.new(client) +avatars = Avatars.new(client) response = avatars.get_credit_card(code: 'amex') diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 3b3d14a..660e92e 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -avatars = Appwrite::Avatars.new(client) +avatars = Avatars.new(client) response = avatars.get_favicon(url: 'https://example.com') diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 37a0bc8..7e31b83 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -avatars = Appwrite::Avatars.new(client) +avatars = Avatars.new(client) response = avatars.get_flag(code: 'af') diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 251573e..052116e 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -avatars = Appwrite::Avatars.new(client) +avatars = Avatars.new(client) response = avatars.get_image(url: 'https://example.com') diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 6e30f17..73fd108 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -avatars = Appwrite::Avatars.new(client) +avatars = Avatars.new(client) response = avatars.get_initials() diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md index 3714d54..b8dbdf5 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -avatars = Appwrite::Avatars.new(client) +avatars = Avatars.new(client) response = avatars.get_qr(text: '[TEXT]') diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index 31f0c4c..be16c66 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.create_boolean_attribute(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]', key: '', required: false) diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index dc330a0..1af359a 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.create_collection(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]', name: '[NAME]') diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 7c3e72c..98c71de 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.create_datetime_attribute(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]', key: '', required: false) diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index bab29bf..b0d78bb 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.create_document(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]', document_id: '[DOCUMENT_ID]', data: {}) diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index 04bdc46..69cd432 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.create_email_attribute(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]', key: '', required: false) diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index 2d755d5..ea7b682 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.create_enum_attribute(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]', key: '', elements: [], required: false) diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 69e7e67..21e0863 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.create_float_attribute(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]', key: '', required: false) diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 7a8026d..8837318 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.create_index(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]', key: '', type: 'key', attributes: []) diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index 1bae8b5..8be1591 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.create_integer_attribute(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]', key: '', required: false) diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index 4cfebde..4d46dda 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.create_ip_attribute(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]', key: '', required: false) diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index c1457a3..1fefd17 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.create_string_attribute(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]', key: '', size: 1, required: false) diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index 0a368b4..219be8c 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.create_url_attribute(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]', key: '', required: false) diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 2f9b7c1..b796569 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.create(database_id: '[DATABASE_ID]', name: '[NAME]') diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index b19bc6a..bdce06e 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.delete_attribute(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]', key: '') diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index 9e8e8ab..c8c715e 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.delete_collection(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]') diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index d982179..f554602 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.delete_document(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]', document_id: '[DOCUMENT_ID]') diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index bc21116..5667a9a 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.delete_index(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]', key: '') diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index ee44dec..b8a0196 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.delete(database_id: '[DATABASE_ID]') diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index 06af19a..eec1ecb 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.get_attribute(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]', key: '') diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index b66facb..febac08 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.get_collection(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]') diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index d3c7727..00e99e7 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.get_document(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]', document_id: '[DOCUMENT_ID]') diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index 143182b..6e84826 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.get_index(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]', key: '') diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index 093e450..d931a4e 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.get(database_id: '[DATABASE_ID]') diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index c83ce00..b2c5a29 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.list_attributes(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]') diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index fb27f1d..f0cebcf 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.list_collections(database_id: '[DATABASE_ID]') diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 4f4b1d9..be85c8c 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.list_documents(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]') diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index 3edf1a0..b5f6fdb 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.list_indexes(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]') diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index ae0112d..e7c31b2 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.list() diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index 01d8724..a000de6 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.update_collection(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]', name: '[NAME]') diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index e6de79e..49efd38 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.update_document(database_id: '[DATABASE_ID]', collection_id: '[COLLECTION_ID]', document_id: '[DOCUMENT_ID]') diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index 9100787..8c4f6fc 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -databases = Appwrite::Databases.new(client) +databases = Databases.new(client) response = databases.update(database_id: '[DATABASE_ID]', name: '[NAME]') diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index 42f3e46..c6badb9 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -1,14 +1,14 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -functions = Appwrite::Functions.new(client) +functions = Functions.new(client) -response = functions.create_deployment(function_id: '[FUNCTION_ID]', entrypoint: '[ENTRYPOINT]', code: Appwrite::InputFile.from_path('dir/file.png'), activate: false) +response = functions.create_deployment(function_id: '[FUNCTION_ID]', entrypoint: '[ENTRYPOINT]', code: InputFile.from_path('dir/file.png'), activate: false) puts response.inspect \ No newline at end of file diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 25d48dd..13975d5 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -functions = Appwrite::Functions.new(client) +functions = Functions.new(client) response = functions.create_execution(function_id: '[FUNCTION_ID]') diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 7380a5b..fe5255e 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -functions = Appwrite::Functions.new(client) +functions = Functions.new(client) response = functions.create_variable(function_id: '[FUNCTION_ID]', key: '[KEY]', value: '[VALUE]') diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 3d00ad6..9f05082 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -functions = Appwrite::Functions.new(client) +functions = Functions.new(client) response = functions.create(function_id: '[FUNCTION_ID]', name: '[NAME]', execute: ["any"], runtime: 'node-14.5') diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index 6ae40f7..bdfb993 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -functions = Appwrite::Functions.new(client) +functions = Functions.new(client) response = functions.delete_deployment(function_id: '[FUNCTION_ID]', deployment_id: '[DEPLOYMENT_ID]') diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index f8c1917..d4fe9b8 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -functions = Appwrite::Functions.new(client) +functions = Functions.new(client) response = functions.delete_variable(function_id: '[FUNCTION_ID]', variable_id: '[VARIABLE_ID]') diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index 33d2154..b35ee44 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -functions = Appwrite::Functions.new(client) +functions = Functions.new(client) response = functions.delete(function_id: '[FUNCTION_ID]') diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index f9cbff3..fb4dfc9 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -functions = Appwrite::Functions.new(client) +functions = Functions.new(client) response = functions.get_deployment(function_id: '[FUNCTION_ID]', deployment_id: '[DEPLOYMENT_ID]') diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index dd43307..ca00a80 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -functions = Appwrite::Functions.new(client) +functions = Functions.new(client) response = functions.get_execution(function_id: '[FUNCTION_ID]', execution_id: '[EXECUTION_ID]') diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index f3046ca..2a170c4 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -functions = Appwrite::Functions.new(client) +functions = Functions.new(client) response = functions.get_variable(function_id: '[FUNCTION_ID]', variable_id: '[VARIABLE_ID]') diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index 463f6a4..903bc3b 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -functions = Appwrite::Functions.new(client) +functions = Functions.new(client) response = functions.get(function_id: '[FUNCTION_ID]') diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index 36df28c..2e25acd 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -functions = Appwrite::Functions.new(client) +functions = Functions.new(client) response = functions.list_deployments(function_id: '[FUNCTION_ID]') diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index da66723..2f2e6c6 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -functions = Appwrite::Functions.new(client) +functions = Functions.new(client) response = functions.list_executions(function_id: '[FUNCTION_ID]') diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index b8f0a75..7105bb3 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -functions = Appwrite::Functions.new(client) +functions = Functions.new(client) response = functions.list_runtimes() diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 8bfa688..531a8d1 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -functions = Appwrite::Functions.new(client) +functions = Functions.new(client) response = functions.list_variables(function_id: '[FUNCTION_ID]') diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index ce82a16..7420f37 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -functions = Appwrite::Functions.new(client) +functions = Functions.new(client) response = functions.list() diff --git a/docs/examples/functions/retry-build.md b/docs/examples/functions/retry-build.md index 1e27f85..9d38310 100644 --- a/docs/examples/functions/retry-build.md +++ b/docs/examples/functions/retry-build.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -functions = Appwrite::Functions.new(client) +functions = Functions.new(client) response = functions.retry_build(function_id: '[FUNCTION_ID]', deployment_id: '[DEPLOYMENT_ID]', build_id: '[BUILD_ID]') diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-deployment.md index 02a5bb5..3d6cefd 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-deployment.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -functions = Appwrite::Functions.new(client) +functions = Functions.new(client) response = functions.update_deployment(function_id: '[FUNCTION_ID]', deployment_id: '[DEPLOYMENT_ID]') diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index 7851cf3..d8943d3 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -functions = Appwrite::Functions.new(client) +functions = Functions.new(client) response = functions.update_variable(function_id: '[FUNCTION_ID]', variable_id: '[VARIABLE_ID]', key: '[KEY]') diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index dab3656..83a80a7 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -functions = Appwrite::Functions.new(client) +functions = Functions.new(client) response = functions.update(function_id: '[FUNCTION_ID]', name: '[NAME]', execute: ["any"]) diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md index c9c0bd4..1584043 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -health = Appwrite::Health.new(client) +health = Health.new(client) response = health.get_antivirus() diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md index cbaa4b9..4af13db 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -health = Appwrite::Health.new(client) +health = Health.new(client) response = health.get_cache() diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-d-b.md index 9f7bedd..4d27307 100644 --- a/docs/examples/health/get-d-b.md +++ b/docs/examples/health/get-d-b.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -health = Appwrite::Health.new(client) +health = Health.new(client) response = health.get_db() diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index db44d4d..44e7a80 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -health = Appwrite::Health.new(client) +health = Health.new(client) response = health.get_queue_certificates() diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index 14b2043..72e3b89 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -health = Appwrite::Health.new(client) +health = Health.new(client) response = health.get_queue_functions() diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index 9c19ac2..32f91c7 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -health = Appwrite::Health.new(client) +health = Health.new(client) response = health.get_queue_logs() diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index 288b272..97ee084 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -health = Appwrite::Health.new(client) +health = Health.new(client) response = health.get_queue_webhooks() diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md index fc7ae24..9d34319 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -health = Appwrite::Health.new(client) +health = Health.new(client) response = health.get_storage_local() diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md index b296722..4ff3c3d 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -health = Appwrite::Health.new(client) +health = Health.new(client) response = health.get_time() diff --git a/docs/examples/health/get.md b/docs/examples/health/get.md index b7a82e6..0503ed6 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/health/get.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -health = Appwrite::Health.new(client) +health = Health.new(client) response = health.get() diff --git a/docs/examples/locale/get-continents.md b/docs/examples/locale/get-continents.md index 8857911..067f79a 100644 --- a/docs/examples/locale/get-continents.md +++ b/docs/examples/locale/get-continents.md @@ -1,13 +1,13 @@ require 'appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -locale = Appwrite::Locale.new(client) +locale = Locale.new(client) response = locale.get_continents() diff --git a/docs/examples/locale/get-countries-e-u.md b/docs/examples/locale/get-countries-e-u.md index 92e593e..37a1e09 100644 --- a/docs/examples/locale/get-countries-e-u.md +++ b/docs/examples/locale/get-countries-e-u.md @@ -1,13 +1,13 @@ require 'appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -locale = Appwrite::Locale.new(client) +locale = Locale.new(client) response = locale.get_countries_eu() diff --git a/docs/examples/locale/get-countries-phones.md b/docs/examples/locale/get-countries-phones.md index d3ae0c4..63e07e9 100644 --- a/docs/examples/locale/get-countries-phones.md +++ b/docs/examples/locale/get-countries-phones.md @@ -1,13 +1,13 @@ require 'appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -locale = Appwrite::Locale.new(client) +locale = Locale.new(client) response = locale.get_countries_phones() diff --git a/docs/examples/locale/get-countries.md b/docs/examples/locale/get-countries.md index 895917e..a73ce9b 100644 --- a/docs/examples/locale/get-countries.md +++ b/docs/examples/locale/get-countries.md @@ -1,13 +1,13 @@ require 'appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -locale = Appwrite::Locale.new(client) +locale = Locale.new(client) response = locale.get_countries() diff --git a/docs/examples/locale/get-currencies.md b/docs/examples/locale/get-currencies.md index 48278af..111f563 100644 --- a/docs/examples/locale/get-currencies.md +++ b/docs/examples/locale/get-currencies.md @@ -1,13 +1,13 @@ require 'appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -locale = Appwrite::Locale.new(client) +locale = Locale.new(client) response = locale.get_currencies() diff --git a/docs/examples/locale/get-languages.md b/docs/examples/locale/get-languages.md index dccf02d..784237e 100644 --- a/docs/examples/locale/get-languages.md +++ b/docs/examples/locale/get-languages.md @@ -1,13 +1,13 @@ require 'appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -locale = Appwrite::Locale.new(client) +locale = Locale.new(client) response = locale.get_languages() diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index f8e37d3..462a342 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -locale = Appwrite::Locale.new(client) +locale = Locale.new(client) response = locale.get() diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md new file mode 100644 index 0000000..9cee322 --- /dev/null +++ b/docs/examples/locale/list-continents.md @@ -0,0 +1,14 @@ +require 'Appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +locale = Locale.new(client) + +response = locale.list_continents() + +puts response.inspect \ No newline at end of file diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-e-u.md new file mode 100644 index 0000000..7773378 --- /dev/null +++ b/docs/examples/locale/list-countries-e-u.md @@ -0,0 +1,14 @@ +require 'Appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +locale = Locale.new(client) + +response = locale.list_countries_eu() + +puts response.inspect \ No newline at end of file diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md new file mode 100644 index 0000000..801e91a --- /dev/null +++ b/docs/examples/locale/list-countries-phones.md @@ -0,0 +1,14 @@ +require 'Appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +locale = Locale.new(client) + +response = locale.list_countries_phones() + +puts response.inspect \ No newline at end of file diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md new file mode 100644 index 0000000..4a3c4e5 --- /dev/null +++ b/docs/examples/locale/list-countries.md @@ -0,0 +1,14 @@ +require 'Appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +locale = Locale.new(client) + +response = locale.list_countries() + +puts response.inspect \ No newline at end of file diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md new file mode 100644 index 0000000..79ad3f5 --- /dev/null +++ b/docs/examples/locale/list-currencies.md @@ -0,0 +1,14 @@ +require 'Appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +locale = Locale.new(client) + +response = locale.list_currencies() + +puts response.inspect \ No newline at end of file diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md new file mode 100644 index 0000000..c3d5917 --- /dev/null +++ b/docs/examples/locale/list-languages.md @@ -0,0 +1,14 @@ +require 'Appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +locale = Locale.new(client) + +response = locale.list_languages() + +puts response.inspect \ No newline at end of file diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index cd5d7db..6e0549a 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -storage = Appwrite::Storage.new(client) +storage = Storage.new(client) response = storage.create_bucket(bucket_id: '[BUCKET_ID]', name: '[NAME]') diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index efac0b4..2341732 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -1,15 +1,14 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new -InputFile = Appwrite::InputFile +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -storage = Appwrite::Storage.new(client) +storage = Storage.new(client) -response = storage.create_file(bucket_id: '[BUCKET_ID]', file_id: '[FILE_ID]', file: Appwrite::InputFile.from_path('dir/file.png')) +response = storage.create_file(bucket_id: '[BUCKET_ID]', file_id: '[FILE_ID]', file: InputFile.from_path('dir/file.png')) puts response.inspect \ No newline at end of file diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index e44be35..cfb4f42 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -storage = Appwrite::Storage.new(client) +storage = Storage.new(client) response = storage.delete_bucket(bucket_id: '[BUCKET_ID]') diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index bba6c6e..2c53fec 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -storage = Appwrite::Storage.new(client) +storage = Storage.new(client) response = storage.delete_file(bucket_id: '[BUCKET_ID]', file_id: '[FILE_ID]') diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index d1d6b9a..20a208b 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -storage = Appwrite::Storage.new(client) +storage = Storage.new(client) response = storage.get_bucket(bucket_id: '[BUCKET_ID]') diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index f390307..f41355e 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -storage = Appwrite::Storage.new(client) +storage = Storage.new(client) response = storage.get_file_download(bucket_id: '[BUCKET_ID]', file_id: '[FILE_ID]') diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 6f2f249..fd11425 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -storage = Appwrite::Storage.new(client) +storage = Storage.new(client) response = storage.get_file_preview(bucket_id: '[BUCKET_ID]', file_id: '[FILE_ID]') diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index ea59ce1..8a271ba 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -storage = Appwrite::Storage.new(client) +storage = Storage.new(client) response = storage.get_file_view(bucket_id: '[BUCKET_ID]', file_id: '[FILE_ID]') diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index a7758d0..d59c322 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -storage = Appwrite::Storage.new(client) +storage = Storage.new(client) response = storage.get_file(bucket_id: '[BUCKET_ID]', file_id: '[FILE_ID]') diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 81ee829..d72f0a9 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -storage = Appwrite::Storage.new(client) +storage = Storage.new(client) response = storage.list_buckets() diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index f7c6bb8..6412bc5 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -storage = Appwrite::Storage.new(client) +storage = Storage.new(client) response = storage.list_files(bucket_id: '[BUCKET_ID]') diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index 32b37b6..3a4ab5f 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -storage = Appwrite::Storage.new(client) +storage = Storage.new(client) response = storage.update_bucket(bucket_id: '[BUCKET_ID]', name: '[NAME]') diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index bf42b7e..6d4c635 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -storage = Appwrite::Storage.new(client) +storage = Storage.new(client) response = storage.update_file(bucket_id: '[BUCKET_ID]', file_id: '[FILE_ID]') diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index 5c82311..23b4576 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -teams = Appwrite::Teams.new(client) +teams = Teams.new(client) response = teams.create_membership(team_id: '[TEAM_ID]', email: 'email@example.com', roles: [], url: 'https://example.com') diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index 58f09d8..832463a 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -teams = Appwrite::Teams.new(client) +teams = Teams.new(client) response = teams.create(team_id: '[TEAM_ID]', name: '[NAME]') diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index 5d41562..3922ef3 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -teams = Appwrite::Teams.new(client) +teams = Teams.new(client) response = teams.delete_membership(team_id: '[TEAM_ID]', membership_id: '[MEMBERSHIP_ID]') diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index 792abc2..8aff3ca 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -teams = Appwrite::Teams.new(client) +teams = Teams.new(client) response = teams.delete(team_id: '[TEAM_ID]') diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index be37320..ff3928f 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -teams = Appwrite::Teams.new(client) +teams = Teams.new(client) response = teams.get_membership(team_id: '[TEAM_ID]', membership_id: '[MEMBERSHIP_ID]') diff --git a/docs/examples/teams/get-memberships.md b/docs/examples/teams/get-memberships.md index de0d1a7..4efb7b3 100644 --- a/docs/examples/teams/get-memberships.md +++ b/docs/examples/teams/get-memberships.md @@ -1,13 +1,13 @@ require 'appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -teams = Appwrite::Teams.new(client) +teams = Teams.new(client) response = teams.get_memberships(team_id: '[TEAM_ID]') diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index eb42acf..94c6658 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -teams = Appwrite::Teams.new(client) +teams = Teams.new(client) response = teams.get(team_id: '[TEAM_ID]') diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md new file mode 100644 index 0000000..628519a --- /dev/null +++ b/docs/examples/teams/list-memberships.md @@ -0,0 +1,14 @@ +require 'Appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +teams = Teams.new(client) + +response = teams.list_memberships(team_id: '[TEAM_ID]') + +puts response.inspect \ No newline at end of file diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index f660fd7..3c322fc 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -teams = Appwrite::Teams.new(client) +teams = Teams.new(client) response = teams.list() diff --git a/docs/examples/teams/update-membership-roles.md b/docs/examples/teams/update-membership-roles.md index e754ec4..0dbd62f 100644 --- a/docs/examples/teams/update-membership-roles.md +++ b/docs/examples/teams/update-membership-roles.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -teams = Appwrite::Teams.new(client) +teams = Teams.new(client) response = teams.update_membership_roles(team_id: '[TEAM_ID]', membership_id: '[MEMBERSHIP_ID]', roles: []) diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 7f53990..3e38159 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -teams = Appwrite::Teams.new(client) +teams = Teams.new(client) response = teams.update_membership_status(team_id: '[TEAM_ID]', membership_id: '[MEMBERSHIP_ID]', user_id: '[USER_ID]', secret: '[SECRET]') diff --git a/docs/examples/teams/update.md b/docs/examples/teams/update.md index 2fb0e77..55851a5 100644 --- a/docs/examples/teams/update.md +++ b/docs/examples/teams/update.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -teams = Appwrite::Teams.new(client) +teams = Teams.new(client) response = teams.update(team_id: '[TEAM_ID]', name: '[NAME]') diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md index f042e12..5b7b5a2 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon2user.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.create_argon2_user(user_id: '[USER_ID]', email: 'email@example.com', password: 'password') diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index 3531837..58225a7 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.create_bcrypt_user(user_id: '[USER_ID]', email: 'email@example.com', password: 'password') diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-m-d5user.md index dba9b49..2d5c865 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-m-d5user.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.create_md5_user(user_id: '[USER_ID]', email: 'email@example.com', password: 'password') diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-p-h-pass-user.md index 73dd930..cbfbf98 100644 --- a/docs/examples/users/create-p-h-pass-user.md +++ b/docs/examples/users/create-p-h-pass-user.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.create_ph_pass_user(user_id: '[USER_ID]', email: 'email@example.com', password: 'password') diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-s-h-a-user.md index a2aae34..5da5147 100644 --- a/docs/examples/users/create-s-h-a-user.md +++ b/docs/examples/users/create-s-h-a-user.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.create_sha_user(user_id: '[USER_ID]', email: 'email@example.com', password: 'password') diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 55505b6..3ab9a20 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.create_scrypt_modified_user(user_id: '[USER_ID]', email: 'email@example.com', password: 'password', password_salt: '[PASSWORD_SALT]', password_salt_separator: '[PASSWORD_SALT_SEPARATOR]', password_signer_key: '[PASSWORD_SIGNER_KEY]') diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index d4be5fd..552f2a3 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.create_scrypt_user(user_id: '[USER_ID]', email: 'email@example.com', password: 'password', password_salt: '[PASSWORD_SALT]', password_cpu: null, password_memory: null, password_parallel: null, password_length: null) diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index 443b221..a10b659 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.create(user_id: '[USER_ID]') diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index 676d8dd..a1a8ce6 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.delete_session(user_id: '[USER_ID]', session_id: '[SESSION_ID]') diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 8578572..d978697 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.delete_sessions(user_id: '[USER_ID]') diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index 2504751..ea45cec 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.delete(user_id: '[USER_ID]') diff --git a/docs/examples/users/get-logs.md b/docs/examples/users/get-logs.md index e010503..38b9335 100644 --- a/docs/examples/users/get-logs.md +++ b/docs/examples/users/get-logs.md @@ -1,13 +1,13 @@ require 'appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.get_logs(user_id: '[USER_ID]') diff --git a/docs/examples/users/get-memberships.md b/docs/examples/users/get-memberships.md index e842039..a0319a9 100644 --- a/docs/examples/users/get-memberships.md +++ b/docs/examples/users/get-memberships.md @@ -1,13 +1,13 @@ require 'appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.get_memberships(user_id: '[USER_ID]') diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index d818802..58d2e94 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.get_prefs(user_id: '[USER_ID]') diff --git a/docs/examples/users/get-sessions.md b/docs/examples/users/get-sessions.md index 8a4b0e9..2622887 100644 --- a/docs/examples/users/get-sessions.md +++ b/docs/examples/users/get-sessions.md @@ -1,13 +1,13 @@ require 'appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.get_sessions(user_id: '[USER_ID]') diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index 93d1063..9a2fd04 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.get(user_id: '[USER_ID]') diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md new file mode 100644 index 0000000..53b5139 --- /dev/null +++ b/docs/examples/users/list-logs.md @@ -0,0 +1,14 @@ +require 'Appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +users = Users.new(client) + +response = users.list_logs(user_id: '[USER_ID]') + +puts response.inspect \ No newline at end of file diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md new file mode 100644 index 0000000..655db8b --- /dev/null +++ b/docs/examples/users/list-memberships.md @@ -0,0 +1,14 @@ +require 'Appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +users = Users.new(client) + +response = users.list_memberships(user_id: '[USER_ID]') + +puts response.inspect \ No newline at end of file diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md new file mode 100644 index 0000000..6eb4229 --- /dev/null +++ b/docs/examples/users/list-sessions.md @@ -0,0 +1,14 @@ +require 'Appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +users = Users.new(client) + +response = users.list_sessions(user_id: '[USER_ID]') + +puts response.inspect \ No newline at end of file diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index 5a17e19..474ed2c 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.list() diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index 10ede9b..350d786 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.update_email_verification(user_id: '[USER_ID]', email_verification: false) diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index 5d79814..db33e49 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.update_email(user_id: '[USER_ID]', email: 'email@example.com') diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index 6ddfe65..7b25fdc 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.update_name(user_id: '[USER_ID]', name: '[NAME]') diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 020893f..a423aa2 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.update_password(user_id: '[USER_ID]', password: 'password') diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index 9ac66d6..b04b8cb 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.update_phone_verification(user_id: '[USER_ID]', phone_verification: false) diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index 50321e9..719e228 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.update_phone(user_id: '[USER_ID]', number: '') diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index bd2055e..31e6b8a 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.update_prefs(user_id: '[USER_ID]', prefs: {}) diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index 4ff2530..960a8ca 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -1,13 +1,13 @@ -require 'appwrite' +require 'Appwrite' -client = Appwrite::Client.new +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -users = Appwrite::Users.new(client) +users = Users.new(client) response = users.update_status(user_id: '[USER_ID]', status: false) diff --git a/lib/appwrite/client.rb b/lib/appwrite/client.rb index 41ca684..37330af 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'=> '7.0.0-RC2', - 'X-Appwrite-Response-Format' => '1.0.0-RC1' + 'x-sdk-version'=> '7.0.0', + 'X-Appwrite-Response-Format' => '1.0.0' } @endpoint = 'https://HOSTNAME/v1' end diff --git a/lib/appwrite/models/document.rb b/lib/appwrite/models/document.rb index 6a1779e..15034e5 100644 --- a/lib/appwrite/models/document.rb +++ b/lib/appwrite/models/document.rb @@ -4,21 +4,24 @@ module Appwrite module Models class Document attr_reader :id - attr_reader :collection + attr_reader :collection_id + attr_reader :database_id attr_reader :created_at attr_reader :updated_at attr_reader :permissions def initialize( id:, - collection:, + collection_id:, + database_id:, created_at:, updated_at:, permissions:, data: ) @id = id - @collection = collection + @collection_id = collection_id + @database_id = database_id @created_at = created_at @updated_at = updated_at @permissions = permissions @@ -28,7 +31,8 @@ def initialize( def self.from(map:) Document.new( id: map["$id"], - collection: map["$collection"], + collection_id: map["$collectionId"], + database_id: map["$databaseId"], created_at: map["$createdAt"], updated_at: map["$updatedAt"], permissions: map["$permissions"], @@ -39,7 +43,8 @@ def self.from(map:) def to_map { "$id": @id, - "$collection": @collection, + "$collectionId": @collection_id, + "$databaseId": @database_id, "$createdAt": @created_at, "$updatedAt": @updated_at, "$permissions": @permissions, diff --git a/lib/appwrite/models/execution.rb b/lib/appwrite/models/execution.rb index 5e73fdb..6be3690 100644 --- a/lib/appwrite/models/execution.rb +++ b/lib/appwrite/models/execution.rb @@ -14,7 +14,7 @@ class Execution attr_reader :response attr_reader :stdout attr_reader :stderr - attr_reader :time + attr_reader :duration def initialize( id:, @@ -28,7 +28,7 @@ def initialize( response:, stdout:, stderr:, - time: + duration: ) @id = id @created_at = created_at @@ -41,7 +41,7 @@ def initialize( @response = response @stdout = stdout @stderr = stderr - @time = time + @duration = duration end def self.from(map:) @@ -57,7 +57,7 @@ def self.from(map:) response: map["response"], stdout: map["stdout"], stderr: map["stderr"], - time: map["time"] + duration: map["duration"] ) end @@ -74,7 +74,7 @@ def to_map "response": @response, "stdout": @stdout, "stderr": @stderr, - "time": @time + "duration": @duration } end end diff --git a/lib/appwrite/models/function.rb b/lib/appwrite/models/function.rb index c0c329d..60fe7a1 100644 --- a/lib/appwrite/models/function.rb +++ b/lib/appwrite/models/function.rb @@ -8,7 +8,7 @@ class Function attr_reader :updated_at attr_reader :execute attr_reader :name - attr_reader :status + attr_reader :enabled attr_reader :runtime attr_reader :deployment attr_reader :vars @@ -24,7 +24,7 @@ def initialize( updated_at:, execute:, name:, - status:, + enabled:, runtime:, deployment:, vars:, @@ -39,7 +39,7 @@ def initialize( @updated_at = updated_at @execute = execute @name = name - @status = status + @enabled = enabled @runtime = runtime @deployment = deployment @vars = vars @@ -57,7 +57,7 @@ def self.from(map:) updated_at: map["$updatedAt"], execute: map["execute"], name: map["name"], - status: map["status"], + enabled: map["enabled"], runtime: map["runtime"], deployment: map["deployment"], vars: map["vars"].map { |it| Variable.from(map: it) }, @@ -76,7 +76,7 @@ def to_map "$updatedAt": @updated_at, "execute": @execute, "name": @name, - "status": @status, + "enabled": @enabled, "runtime": @runtime, "deployment": @deployment, "vars": @vars.map { |it| it.to_map }, diff --git a/lib/appwrite/role.rb b/lib/appwrite/role.rb index 46bd331..969b35d 100644 --- a/lib/appwrite/role.rb +++ b/lib/appwrite/role.rb @@ -4,12 +4,20 @@ def self.any 'any' end - def self.user(id) - "user:#{id}" + def self.user(id, status = "") + if(status.empty?) + "user:#{id}" + else + "user:#{id}/#{status}" + end end - def self.users - 'users' + def self.users(status = "") + if(status.empty?) + 'users' + else + "users/#{status}" + end end def self.guests @@ -23,6 +31,10 @@ def self.team(id, role = "") "team:#{id}/#{role}" end end + + def self.member(id) + "member:#{id}" + end def self.status(status) "status:#{status}" diff --git a/lib/appwrite/services/account.rb b/lib/appwrite/services/account.rb index 465ad82..bc89a8a 100644 --- a/lib/appwrite/services/account.rb +++ b/lib/appwrite/services/account.rb @@ -12,7 +12,6 @@ def initialize(client) # # @return [Account] def get() - path = '/account' params = { @@ -46,9 +45,16 @@ def get() # # @return [Account] def update_email(email:, password:) - path = '/account/email' + if email.nil? + raise Appwrite::Exception.new('Missing required parameter: "email"') + end + + if password.nil? + raise Appwrite::Exception.new('Missing required parameter: "password"') + end + params = { email: email, password: password, @@ -57,14 +63,6 @@ def update_email(email:, password:) headers = { "content-type": 'application/json', } - if email.nil? - raise Appwrite::Exception.new('Missing required parameter: "email"') - end - - if password.nil? - raise Appwrite::Exception.new('Missing required parameter: "password"') - end - @client.call( method: 'PATCH', @@ -82,8 +80,7 @@ def update_email(email:, password:) # @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). Only supported methods are limit and offset # # @return [LogList] - def get_logs(queries: nil) - + def list_logs(queries: nil) path = '/account/logs' params = { @@ -110,9 +107,12 @@ def get_logs(queries: nil) # # @return [Account] def update_name(name:) - path = '/account/name' + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end + params = { name: name, } @@ -120,10 +120,6 @@ def update_name(name:) headers = { "content-type": 'application/json', } - if name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') - end - @client.call( method: 'PATCH', @@ -144,9 +140,12 @@ def update_name(name:) # # @return [Account] def update_password(password:, old_password: nil) - path = '/account/password' + if password.nil? + raise Appwrite::Exception.new('Missing required parameter: "password"') + end + params = { password: password, oldPassword: old_password, @@ -155,10 +154,6 @@ def update_password(password:, old_password: nil) headers = { "content-type": 'application/json', } - if password.nil? - raise Appwrite::Exception.new('Missing required parameter: "password"') - end - @client.call( method: 'PATCH', @@ -181,9 +176,16 @@ def update_password(password:, old_password: nil) # # @return [Account] def update_phone(phone:, password:) - path = '/account/phone' + if phone.nil? + raise Appwrite::Exception.new('Missing required parameter: "phone"') + end + + if password.nil? + raise Appwrite::Exception.new('Missing required parameter: "password"') + end + params = { phone: phone, password: password, @@ -192,14 +194,6 @@ def update_phone(phone:, password:) headers = { "content-type": 'application/json', } - if phone.nil? - raise Appwrite::Exception.new('Missing required parameter: "phone"') - end - - if password.nil? - raise Appwrite::Exception.new('Missing required parameter: "password"') - end - @client.call( method: 'PATCH', @@ -216,7 +210,6 @@ def update_phone(phone:, password:) # # @return [Preferences] def get_prefs() - path = '/account/prefs' params = { @@ -244,9 +237,12 @@ def get_prefs() # # @return [Account] def update_prefs(prefs:) - path = '/account/prefs' + if prefs.nil? + raise Appwrite::Exception.new('Missing required parameter: "prefs"') + end + params = { prefs: prefs, } @@ -254,10 +250,6 @@ def update_prefs(prefs:) headers = { "content-type": 'application/json', } - if prefs.nil? - raise Appwrite::Exception.new('Missing required parameter: "prefs"') - end - @client.call( method: 'PATCH', @@ -283,9 +275,16 @@ def update_prefs(prefs:) # # @return [Token] def create_recovery(email:, url:) - path = '/account/recovery' + if email.nil? + raise Appwrite::Exception.new('Missing required parameter: "email"') + end + + if url.nil? + raise Appwrite::Exception.new('Missing required parameter: "url"') + end + params = { email: email, url: url, @@ -294,14 +293,6 @@ def create_recovery(email:, url:) headers = { "content-type": 'application/json', } - if email.nil? - raise Appwrite::Exception.new('Missing required parameter: "email"') - end - - if url.nil? - raise Appwrite::Exception.new('Missing required parameter: "url"') - end - @client.call( method: 'POST', @@ -330,35 +321,34 @@ def create_recovery(email:, url:) # # @return [Token] def update_recovery(user_id:, secret:, password:, password_again:) - path = '/account/recovery' - params = { - userId: user_id, - secret: secret, - password: password, - passwordAgain: password_again, - } - - headers = { - "content-type": 'application/json', - } if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') + raise Appwrite::Exception.new('Missing required parameter: "userId"') end if secret.nil? - raise Appwrite::Exception.new('Missing required parameter: "secret"') + raise Appwrite::Exception.new('Missing required parameter: "secret"') end if password.nil? - raise Appwrite::Exception.new('Missing required parameter: "password"') + raise Appwrite::Exception.new('Missing required parameter: "password"') end if password_again.nil? - raise Appwrite::Exception.new('Missing required parameter: "passwordAgain"') + raise Appwrite::Exception.new('Missing required parameter: "passwordAgain"') end + params = { + userId: user_id, + secret: secret, + password: password, + passwordAgain: password_again, + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'PUT', @@ -375,8 +365,7 @@ def update_recovery(user_id:, secret:, password:, password_again:) # # # @return [SessionList] - def get_sessions() - + def list_sessions() path = '/account/sessions' params = { @@ -402,7 +391,6 @@ def get_sessions() # # @return [] def delete_sessions() - path = '/account/sessions' params = { @@ -428,8 +416,12 @@ def delete_sessions() # # @return [Session] def get_session(session_id:) - path = '/account/sessions/{sessionId}' + .gsub('{sessionId}', session_id) + + if session_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "sessionId"') + end params = { } @@ -437,11 +429,6 @@ def get_session(session_id:) headers = { "content-type": 'application/json', } - if session_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "sessionId"') - end - - .gsub('{sessionId}', session_id) @client.call( method: 'GET', @@ -461,8 +448,12 @@ def get_session(session_id:) # # @return [Session] def update_session(session_id:) - path = '/account/sessions/{sessionId}' + .gsub('{sessionId}', session_id) + + if session_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "sessionId"') + end params = { } @@ -470,11 +461,6 @@ def update_session(session_id:) headers = { "content-type": 'application/json', } - if session_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "sessionId"') - end - - .gsub('{sessionId}', session_id) @client.call( method: 'PATCH', @@ -495,8 +481,12 @@ def update_session(session_id:) # # @return [] def delete_session(session_id:) - path = '/account/sessions/{sessionId}' + .gsub('{sessionId}', session_id) + + if session_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "sessionId"') + end params = { } @@ -504,11 +494,6 @@ def delete_session(session_id:) headers = { "content-type": 'application/json', } - if session_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "sessionId"') - end - - .gsub('{sessionId}', session_id) @client.call( method: 'DELETE', @@ -526,7 +511,6 @@ def delete_session(session_id:) # # @return [Account] def update_status() - path = '/account/status' params = { @@ -566,9 +550,12 @@ def update_status() # # @return [Token] def create_verification(url:) - path = '/account/verification' + if url.nil? + raise Appwrite::Exception.new('Missing required parameter: "url"') + end + params = { url: url, } @@ -576,10 +563,6 @@ def create_verification(url:) headers = { "content-type": 'application/json', } - if url.nil? - raise Appwrite::Exception.new('Missing required parameter: "url"') - end - @client.call( method: 'POST', @@ -601,9 +584,16 @@ def create_verification(url:) # # @return [Token] def update_verification(user_id:, secret:) - path = '/account/verification' + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end + + if secret.nil? + raise Appwrite::Exception.new('Missing required parameter: "secret"') + end + params = { userId: user_id, secret: secret, @@ -612,14 +602,6 @@ def update_verification(user_id:, secret:) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - if secret.nil? - raise Appwrite::Exception.new('Missing required parameter: "secret"') - end - @client.call( method: 'PUT', @@ -641,7 +623,6 @@ def update_verification(user_id:, secret:) # # @return [Token] def create_phone_verification() - path = '/account/verification/phone' params = { @@ -671,9 +652,16 @@ def create_phone_verification() # # @return [Token] def update_phone_verification(user_id:, secret:) - path = '/account/verification/phone' + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end + + if secret.nil? + raise Appwrite::Exception.new('Missing required parameter: "secret"') + end + params = { userId: user_id, secret: secret, @@ -682,14 +670,6 @@ def update_phone_verification(user_id:, secret:) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - if secret.nil? - raise Appwrite::Exception.new('Missing required parameter: "secret"') - end - @client.call( method: 'PUT', diff --git a/lib/appwrite/services/avatars.rb b/lib/appwrite/services/avatars.rb index 294c8bc..28573c8 100644 --- a/lib/appwrite/services/avatars.rb +++ b/lib/appwrite/services/avatars.rb @@ -24,8 +24,12 @@ def initialize(client) # # @return [] def get_browser(code:, width: nil, height: nil, quality: nil) - path = '/avatars/browsers/{code}' + .gsub('{code}', code) + + if code.nil? + raise Appwrite::Exception.new('Missing required parameter: "code"') + end params = { width: width, @@ -36,11 +40,6 @@ def get_browser(code:, width: nil, height: nil, quality: nil) headers = { "content-type": 'application/json', } - if code.nil? - raise Appwrite::Exception.new('Missing required parameter: "code"') - end - - .gsub('{code}', code) @client.call( method: 'GET', @@ -68,8 +67,12 @@ def get_browser(code:, width: nil, height: nil, quality: nil) # # @return [] def get_credit_card(code:, width: nil, height: nil, quality: nil) - path = '/avatars/credit-cards/{code}' + .gsub('{code}', code) + + if code.nil? + raise Appwrite::Exception.new('Missing required parameter: "code"') + end params = { width: width, @@ -80,11 +83,6 @@ def get_credit_card(code:, width: nil, height: nil, quality: nil) headers = { "content-type": 'application/json', } - if code.nil? - raise Appwrite::Exception.new('Missing required parameter: "code"') - end - - .gsub('{code}', code) @client.call( method: 'GET', @@ -103,9 +101,12 @@ def get_credit_card(code:, width: nil, height: nil, quality: nil) # # @return [] def get_favicon(url:) - path = '/avatars/favicon' + if url.nil? + raise Appwrite::Exception.new('Missing required parameter: "url"') + end + params = { url: url, } @@ -113,10 +114,6 @@ def get_favicon(url:) headers = { "content-type": 'application/json', } - if url.nil? - raise Appwrite::Exception.new('Missing required parameter: "url"') - end - @client.call( method: 'GET', @@ -145,8 +142,12 @@ def get_favicon(url:) # # @return [] def get_flag(code:, width: nil, height: nil, quality: nil) - path = '/avatars/flags/{code}' + .gsub('{code}', code) + + if code.nil? + raise Appwrite::Exception.new('Missing required parameter: "code"') + end params = { width: width, @@ -157,11 +158,6 @@ def get_flag(code:, width: nil, height: nil, quality: nil) headers = { "content-type": 'application/json', } - if code.nil? - raise Appwrite::Exception.new('Missing required parameter: "code"') - end - - .gsub('{code}', code) @client.call( method: 'GET', @@ -189,9 +185,12 @@ def get_flag(code:, width: nil, height: nil, quality: nil) # # @return [] def get_image(url:, width: nil, height: nil) - path = '/avatars/image' + if url.nil? + raise Appwrite::Exception.new('Missing required parameter: "url"') + end + params = { url: url, width: width, @@ -201,10 +200,6 @@ def get_image(url:, width: nil, height: nil) headers = { "content-type": 'application/json', } - if url.nil? - raise Appwrite::Exception.new('Missing required parameter: "url"') - end - @client.call( method: 'GET', @@ -239,7 +234,6 @@ def get_image(url:, width: nil, height: nil) # # @return [] def get_initials(name: nil, width: nil, height: nil, background: nil) - path = '/avatars/initials' params = { @@ -273,9 +267,12 @@ def get_initials(name: nil, width: nil, height: nil, background: nil) # # @return [] def get_qr(text:, size: nil, margin: nil, download: nil) - path = '/avatars/qr' + if text.nil? + raise Appwrite::Exception.new('Missing required parameter: "text"') + end + params = { text: text, size: size, @@ -286,10 +283,6 @@ def get_qr(text:, size: nil, margin: nil, download: nil) headers = { "content-type": 'application/json', } - if text.nil? - raise Appwrite::Exception.new('Missing required parameter: "text"') - end - @client.call( method: 'GET', diff --git a/lib/appwrite/services/databases.rb b/lib/appwrite/services/databases.rb index f366e8e..2fe6e65 100644 --- a/lib/appwrite/services/databases.rb +++ b/lib/appwrite/services/databases.rb @@ -15,7 +15,6 @@ def initialize(client) # # @return [DatabaseList] def list(queries: nil, search: nil) - path = '/databases' params = { @@ -45,9 +44,16 @@ def list(queries: nil, search: nil) # # @return [Database] def create(database_id:, name:) - path = '/databases' + if database_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + end + + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end + params = { databaseId: database_id, name: name, @@ -56,14 +62,6 @@ def create(database_id:, name:) headers = { "content-type": 'application/json', } - if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') - end - - if name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') - end - @client.call( method: 'POST', @@ -82,8 +80,12 @@ def create(database_id:, name:) # # @return [Database] def get(database_id:) - path = '/databases/{databaseId}' + .gsub('{databaseId}', database_id) + + if database_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + end params = { } @@ -91,11 +93,6 @@ def get(database_id:) headers = { "content-type": 'application/json', } - if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') - end - - .gsub('{databaseId}', database_id) @client.call( method: 'GET', @@ -114,8 +111,16 @@ def get(database_id:) # # @return [Database] def update(database_id:, name:) - path = '/databases/{databaseId}' + .gsub('{databaseId}', database_id) + + if database_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + end + + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end params = { name: name, @@ -124,15 +129,6 @@ def update(database_id:, name:) headers = { "content-type": 'application/json', } - if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') - end - - if name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') - end - - .gsub('{databaseId}', database_id) @client.call( method: 'PUT', @@ -151,8 +147,12 @@ def update(database_id:, name:) # # @return [] def delete(database_id:) - path = '/databases/{databaseId}' + .gsub('{databaseId}', database_id) + + if database_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + end params = { } @@ -160,11 +160,6 @@ def delete(database_id:) headers = { "content-type": 'application/json', } - if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') - end - - .gsub('{databaseId}', database_id) @client.call( method: 'DELETE', @@ -184,8 +179,12 @@ def delete(database_id:) # # @return [CollectionList] def list_collections(database_id:, queries: nil, search: nil) - path = '/databases/{databaseId}/collections' + .gsub('{databaseId}', database_id) + + if database_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + end params = { queries: queries, @@ -195,11 +194,6 @@ def list_collections(database_id:, queries: nil, search: nil) headers = { "content-type": 'application/json', } - if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') - end - - .gsub('{databaseId}', database_id) @client.call( method: 'GET', @@ -224,8 +218,20 @@ def list_collections(database_id:, queries: nil, search: nil) # # @return [Collection] def create_collection(database_id:, collection_id:, name:, permissions: nil, document_security: nil) - path = '/databases/{databaseId}/collections' + .gsub('{databaseId}', database_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 name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end params = { collectionId: collection_id, @@ -237,19 +243,6 @@ def create_collection(database_id:, collection_id:, name:, permissions: nil, doc headers = { "content-type": 'application/json', } - 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 name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') - end - - .gsub('{databaseId}', database_id) @client.call( method: 'POST', @@ -269,25 +262,24 @@ def create_collection(database_id:, collection_id:, name:, permissions: nil, doc # # @return [Collection] def get_collection(database_id:, collection_id:) - path = '/databases/{databaseId}/collections/{collectionId}' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) - params = { - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'GET', @@ -310,8 +302,21 @@ def get_collection(database_id:, collection_id:) # # @return [Collection] def update_collection(database_id:, collection_id:, name:, permissions: nil, document_security: nil, enabled: nil) - path = '/databases/{databaseId}/collections/{collectionId}' + .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 name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end params = { name: name, @@ -323,20 +328,6 @@ def update_collection(database_id:, collection_id:, name:, permissions: nil, doc headers = { "content-type": 'application/json', } - 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 name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') - end - - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) @client.call( method: 'PUT', @@ -356,25 +347,24 @@ def update_collection(database_id:, collection_id:, name:, permissions: nil, doc # # @return [] def delete_collection(database_id:, collection_id:) - path = '/databases/{databaseId}/collections/{collectionId}' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) - params = { - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'DELETE', @@ -392,25 +382,24 @@ def delete_collection(database_id:, collection_id:) # # @return [AttributeList] def list_attributes(database_id:, collection_id:) - path = '/databases/{databaseId}/collections/{collectionId}/attributes' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) - params = { - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'GET', @@ -434,37 +423,36 @@ def list_attributes(database_id:, collection_id:) # # @return [AttributeBoolean] def create_boolean_attribute(database_id:, collection_id:, key:, required:, default: nil, array: nil) - path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) - params = { - key: key, - required: required, - default: default, - array: array, - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end if key.nil? - raise Appwrite::Exception.new('Missing required parameter: "key"') + raise Appwrite::Exception.new('Missing required parameter: "key"') end if required.nil? - raise Appwrite::Exception.new('Missing required parameter: "required"') + raise Appwrite::Exception.new('Missing required parameter: "required"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) + params = { + key: key, + required: required, + default: default, + array: array, + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'POST', @@ -487,37 +475,36 @@ def create_boolean_attribute(database_id:, collection_id:, key:, required:, defa # # @return [AttributeDatetime] def create_datetime_attribute(database_id:, collection_id:, key:, required:, default: nil, array: nil) - path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) - params = { - key: key, - required: required, - default: default, - array: array, - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end if key.nil? - raise Appwrite::Exception.new('Missing required parameter: "key"') + raise Appwrite::Exception.new('Missing required parameter: "key"') end if required.nil? - raise Appwrite::Exception.new('Missing required parameter: "required"') + raise Appwrite::Exception.new('Missing required parameter: "required"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) + params = { + key: key, + required: required, + default: default, + array: array, + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'POST', @@ -541,37 +528,36 @@ def create_datetime_attribute(database_id:, collection_id:, key:, required:, def # # @return [AttributeEmail] def create_email_attribute(database_id:, collection_id:, key:, required:, default: nil, array: nil) - path = '/databases/{databaseId}/collections/{collectionId}/attributes/email' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) - params = { - key: key, - required: required, - default: default, - array: array, - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end if key.nil? - raise Appwrite::Exception.new('Missing required parameter: "key"') + raise Appwrite::Exception.new('Missing required parameter: "key"') end if required.nil? - raise Appwrite::Exception.new('Missing required parameter: "required"') + raise Appwrite::Exception.new('Missing required parameter: "required"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) + params = { + key: key, + required: required, + default: default, + array: array, + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'POST', @@ -595,42 +581,41 @@ def create_email_attribute(database_id:, collection_id:, key:, required:, defaul # # @return [AttributeEnum] def create_enum_attribute(database_id:, collection_id:, key:, elements:, required:, default: nil, array: nil) - path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) - params = { - key: key, - elements: elements, - required: required, - default: default, - array: array, - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end if key.nil? - raise Appwrite::Exception.new('Missing required parameter: "key"') + raise Appwrite::Exception.new('Missing required parameter: "key"') end if elements.nil? - raise Appwrite::Exception.new('Missing required parameter: "elements"') + raise Appwrite::Exception.new('Missing required parameter: "elements"') end if required.nil? - raise Appwrite::Exception.new('Missing required parameter: "required"') + raise Appwrite::Exception.new('Missing required parameter: "required"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) + params = { + key: key, + elements: elements, + required: required, + default: default, + array: array, + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'POST', @@ -657,39 +642,38 @@ def create_enum_attribute(database_id:, collection_id:, key:, elements:, require # # @return [AttributeFloat] def create_float_attribute(database_id:, collection_id:, key:, required:, min: nil, max: nil, default: nil, array: nil) - path = '/databases/{databaseId}/collections/{collectionId}/attributes/float' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) - params = { - key: key, - required: required, - min: min, - max: max, - default: default, - array: array, - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end if key.nil? - raise Appwrite::Exception.new('Missing required parameter: "key"') + raise Appwrite::Exception.new('Missing required parameter: "key"') end if required.nil? - raise Appwrite::Exception.new('Missing required parameter: "required"') + raise Appwrite::Exception.new('Missing required parameter: "required"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) + params = { + key: key, + required: required, + min: min, + max: max, + default: default, + array: array, + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'POST', @@ -716,39 +700,38 @@ def create_float_attribute(database_id:, collection_id:, key:, required:, min: n # # @return [AttributeInteger] def create_integer_attribute(database_id:, collection_id:, key:, required:, min: nil, max: nil, default: nil, array: nil) - path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) - params = { - key: key, - required: required, - min: min, - max: max, - default: default, - array: array, - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end if key.nil? - raise Appwrite::Exception.new('Missing required parameter: "key"') + raise Appwrite::Exception.new('Missing required parameter: "key"') end if required.nil? - raise Appwrite::Exception.new('Missing required parameter: "required"') + raise Appwrite::Exception.new('Missing required parameter: "required"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) + params = { + key: key, + required: required, + min: min, + max: max, + default: default, + array: array, + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'POST', @@ -772,37 +755,36 @@ def create_integer_attribute(database_id:, collection_id:, key:, required:, min: # # @return [AttributeIp] def create_ip_attribute(database_id:, collection_id:, key:, required:, default: nil, array: nil) - path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) - params = { - key: key, - required: required, - default: default, - array: array, - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end if key.nil? - raise Appwrite::Exception.new('Missing required parameter: "key"') + raise Appwrite::Exception.new('Missing required parameter: "key"') end if required.nil? - raise Appwrite::Exception.new('Missing required parameter: "required"') + raise Appwrite::Exception.new('Missing required parameter: "required"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) + params = { + key: key, + required: required, + default: default, + array: array, + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'POST', @@ -827,42 +809,41 @@ def create_ip_attribute(database_id:, collection_id:, key:, required:, default: # # @return [AttributeString] def create_string_attribute(database_id:, collection_id:, key:, size:, required:, default: nil, array: nil) - path = '/databases/{databaseId}/collections/{collectionId}/attributes/string' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) - params = { - key: key, - size: size, - required: required, - default: default, - array: array, - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end if key.nil? - raise Appwrite::Exception.new('Missing required parameter: "key"') + raise Appwrite::Exception.new('Missing required parameter: "key"') end if size.nil? - raise Appwrite::Exception.new('Missing required parameter: "size"') + raise Appwrite::Exception.new('Missing required parameter: "size"') end if required.nil? - raise Appwrite::Exception.new('Missing required parameter: "required"') + raise Appwrite::Exception.new('Missing required parameter: "required"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) + params = { + key: key, + size: size, + required: required, + default: default, + array: array, + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'POST', @@ -886,37 +867,36 @@ def create_string_attribute(database_id:, collection_id:, key:, size:, required: # # @return [AttributeUrl] def create_url_attribute(database_id:, collection_id:, key:, required:, default: nil, array: nil) - path = '/databases/{databaseId}/collections/{collectionId}/attributes/url' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) - params = { - key: key, - required: required, - default: default, - array: array, - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end if key.nil? - raise Appwrite::Exception.new('Missing required parameter: "key"') + raise Appwrite::Exception.new('Missing required parameter: "key"') end if required.nil? - raise Appwrite::Exception.new('Missing required parameter: "required"') + raise Appwrite::Exception.new('Missing required parameter: "required"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) + params = { + key: key, + required: required, + default: default, + array: array, + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'POST', @@ -936,30 +916,29 @@ def create_url_attribute(database_id:, collection_id:, key:, required:, default: # # @return [] def get_attribute(database_id:, collection_id:, key:) - path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) + .gsub('{key}', key) - params = { - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end if key.nil? - raise Appwrite::Exception.new('Missing required parameter: "key"') + raise Appwrite::Exception.new('Missing required parameter: "key"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) - .gsub('{key}', key) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'GET', @@ -978,30 +957,29 @@ def get_attribute(database_id:, collection_id:, key:) # # @return [] def delete_attribute(database_id:, collection_id:, key:) - path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) + .gsub('{key}', key) - params = { - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end if key.nil? - raise Appwrite::Exception.new('Missing required parameter: "key"') + raise Appwrite::Exception.new('Missing required parameter: "key"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) - .gsub('{key}', key) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'DELETE', @@ -1023,8 +1001,17 @@ def delete_attribute(database_id:, collection_id:, key:) # # @return [DocumentList] def list_documents(database_id:, collection_id:, queries: nil) - path = '/databases/{databaseId}/collections/{collectionId}/documents' + .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 params = { queries: queries, @@ -1033,16 +1020,6 @@ def list_documents(database_id:, collection_id:, queries: nil) headers = { "content-type": 'application/json', } - 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 - - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) @client.call( method: 'GET', @@ -1067,36 +1044,35 @@ def list_documents(database_id:, collection_id:, queries: nil) # # @return [Document] def create_document(database_id:, collection_id:, document_id:, data:, permissions: nil) - path = '/databases/{databaseId}/collections/{collectionId}/documents' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) - params = { - documentId: document_id, - data: data, - permissions: permissions, - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end if document_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "documentId"') + raise Appwrite::Exception.new('Missing required parameter: "documentId"') end if data.nil? - raise Appwrite::Exception.new('Missing required parameter: "data"') + raise Appwrite::Exception.new('Missing required parameter: "data"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) + params = { + documentId: document_id, + data: data, + permissions: permissions, + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'POST', @@ -1117,30 +1093,29 @@ def create_document(database_id:, collection_id:, document_id:, data:, permissio # # @return [Document] def get_document(database_id:, collection_id:, document_id:) - path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) + .gsub('{documentId}', document_id) - params = { - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end if document_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "documentId"') + raise Appwrite::Exception.new('Missing required parameter: "documentId"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) - .gsub('{documentId}', document_id) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'GET', @@ -1163,32 +1138,31 @@ def get_document(database_id:, collection_id:, document_id:) # # @return [Document] def update_document(database_id:, collection_id:, document_id:, data: nil, permissions: nil) - path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) + .gsub('{documentId}', document_id) - params = { - data: data, - permissions: permissions, - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end if document_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "documentId"') + raise Appwrite::Exception.new('Missing required parameter: "documentId"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) - .gsub('{documentId}', document_id) + params = { + data: data, + permissions: permissions, + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'PATCH', @@ -1208,30 +1182,29 @@ def update_document(database_id:, collection_id:, document_id:, data: nil, permi # # @return [] def delete_document(database_id:, collection_id:, document_id:) - path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) + .gsub('{documentId}', document_id) - params = { - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end if document_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "documentId"') + raise Appwrite::Exception.new('Missing required parameter: "documentId"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) - .gsub('{documentId}', document_id) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'DELETE', @@ -1249,25 +1222,24 @@ def delete_document(database_id:, collection_id:, document_id:) # # @return [IndexList] def list_indexes(database_id:, collection_id:) - path = '/databases/{databaseId}/collections/{collectionId}/indexes' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) - params = { - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'GET', @@ -1290,41 +1262,40 @@ def list_indexes(database_id:, collection_id:) # # @return [Index] def create_index(database_id:, collection_id:, key:, type:, attributes:, orders: nil) - path = '/databases/{databaseId}/collections/{collectionId}/indexes' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) - params = { - key: key, - type: type, - attributes: attributes, - orders: orders, - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end if key.nil? - raise Appwrite::Exception.new('Missing required parameter: "key"') + raise Appwrite::Exception.new('Missing required parameter: "key"') end if type.nil? - raise Appwrite::Exception.new('Missing required parameter: "type"') + raise Appwrite::Exception.new('Missing required parameter: "type"') end if attributes.nil? - raise Appwrite::Exception.new('Missing required parameter: "attributes"') + raise Appwrite::Exception.new('Missing required parameter: "attributes"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) + params = { + key: key, + type: type, + attributes: attributes, + orders: orders, + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'POST', @@ -1344,30 +1315,29 @@ def create_index(database_id:, collection_id:, key:, type:, attributes:, orders: # # @return [Index] def get_index(database_id:, collection_id:, key:) - path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) + .gsub('{key}', key) - params = { - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end if key.nil? - raise Appwrite::Exception.new('Missing required parameter: "key"') + raise Appwrite::Exception.new('Missing required parameter: "key"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) - .gsub('{key}', key) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'GET', @@ -1387,30 +1357,29 @@ def get_index(database_id:, collection_id:, key:) # # @return [] def delete_index(database_id:, collection_id:, key:) - path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}' + .gsub('{databaseId}', database_id) + .gsub('{collectionId}', collection_id) + .gsub('{key}', key) - params = { - } - - headers = { - "content-type": 'application/json', - } if database_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "databaseId"') + raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if collection_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "collectionId"') + raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end if key.nil? - raise Appwrite::Exception.new('Missing required parameter: "key"') + raise Appwrite::Exception.new('Missing required parameter: "key"') end - .gsub('{databaseId}', database_id) - .gsub('{collectionId}', collection_id) - .gsub('{key}', key) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'DELETE', diff --git a/lib/appwrite/services/functions.rb b/lib/appwrite/services/functions.rb index a0f6b8c..9332db0 100644 --- a/lib/appwrite/services/functions.rb +++ b/lib/appwrite/services/functions.rb @@ -10,12 +10,11 @@ def initialize(client) # Get a list of all the project's functions. 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: name, status, runtime, deployment, schedule, scheduleNext, schedulePrevious, timeout + # @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: name, enabled, runtime, deployment, schedule, scheduleNext, schedulePrevious, timeout # @param [String] search Search term to filter your list results. Max length: 256 chars. # # @return [FunctionList] def list(queries: nil, search: nil) - path = '/functions' params = { @@ -48,12 +47,28 @@ def list(queries: nil, search: nil) # @param [Array] events Events list. Maximum of 100 events are allowed. # @param [String] schedule Schedule CRON syntax. # @param [Integer] timeout Function maximum execution time in seconds. + # @param [] enabled Is function enabled? # # @return [Function] - def create(function_id:, name:, execute:, runtime:, events: nil, schedule: nil, timeout: nil) - + def create(function_id:, name:, execute:, runtime:, events: nil, schedule: nil, timeout: nil, enabled: nil) path = '/functions' + if function_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "functionId"') + end + + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end + + if execute.nil? + raise Appwrite::Exception.new('Missing required parameter: "execute"') + end + + if runtime.nil? + raise Appwrite::Exception.new('Missing required parameter: "runtime"') + end + params = { functionId: function_id, name: name, @@ -62,27 +77,12 @@ def create(function_id:, name:, execute:, runtime:, events: nil, schedule: nil, events: events, schedule: schedule, timeout: timeout, + enabled: enabled, } headers = { "content-type": 'application/json', } - if function_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "functionId"') - end - - if name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') - end - - if execute.nil? - raise Appwrite::Exception.new('Missing required parameter: "execute"') - end - - if runtime.nil? - raise Appwrite::Exception.new('Missing required parameter: "runtime"') - end - @client.call( method: 'POST', @@ -99,7 +99,6 @@ def create(function_id:, name:, execute:, runtime:, events: nil, schedule: nil, # # @return [RuntimeList] def list_runtimes() - path = '/functions/runtimes' params = { @@ -125,8 +124,12 @@ def list_runtimes() # # @return [Function] def get(function_id:) - path = '/functions/{functionId}' + .gsub('{functionId}', function_id) + + if function_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "functionId"') + end params = { } @@ -134,11 +137,6 @@ def get(function_id:) headers = { "content-type": 'application/json', } - if function_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "functionId"') - end - - .gsub('{functionId}', function_id) @client.call( method: 'GET', @@ -158,11 +156,24 @@ def get(function_id:) # @param [Array] events Events list. Maximum of 100 events are allowed. # @param [String] schedule Schedule CRON syntax. # @param [Integer] timeout Maximum execution time in seconds. + # @param [] enabled Is function enabled? # # @return [Function] - def update(function_id:, name:, execute:, events: nil, schedule: nil, timeout: nil) - + def update(function_id:, name:, execute:, events: nil, schedule: nil, timeout: nil, enabled: nil) path = '/functions/{functionId}' + .gsub('{functionId}', function_id) + + if function_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "functionId"') + end + + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end + + if execute.nil? + raise Appwrite::Exception.new('Missing required parameter: "execute"') + end params = { name: name, @@ -170,24 +181,12 @@ def update(function_id:, name:, execute:, events: nil, schedule: nil, timeout: n events: events, schedule: schedule, timeout: timeout, + enabled: enabled, } headers = { "content-type": 'application/json', } - if function_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "functionId"') - end - - if name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') - end - - if execute.nil? - raise Appwrite::Exception.new('Missing required parameter: "execute"') - end - - .gsub('{functionId}', function_id) @client.call( method: 'PUT', @@ -205,8 +204,12 @@ def update(function_id:, name:, execute:, events: nil, schedule: nil, timeout: n # # @return [] def delete(function_id:) - path = '/functions/{functionId}' + .gsub('{functionId}', function_id) + + if function_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "functionId"') + end params = { } @@ -214,11 +217,6 @@ def delete(function_id:) headers = { "content-type": 'application/json', } - if function_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "functionId"') - end - - .gsub('{functionId}', function_id) @client.call( method: 'DELETE', @@ -238,8 +236,12 @@ def delete(function_id:) # # @return [DeploymentList] def list_deployments(function_id:, queries: nil, search: nil) - path = '/functions/{functionId}/deployments' + .gsub('{functionId}', function_id) + + if function_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "functionId"') + end params = { queries: queries, @@ -249,11 +251,6 @@ def list_deployments(function_id:, queries: nil, search: nil) headers = { "content-type": 'application/json', } - if function_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "functionId"') - end - - .gsub('{functionId}', function_id) @client.call( method: 'GET', @@ -283,35 +280,34 @@ def list_deployments(function_id:, queries: nil, search: nil) # # @return [Deployment] def create_deployment(function_id:, entrypoint:, code:, activate:, on_progress: nil) - path = '/functions/{functionId}/deployments' + .gsub('{functionId}', function_id) - params = { - entrypoint: entrypoint, - code: code, - activate: activate, - } - - headers = { - "content-type": 'multipart/form-data', - } if function_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "functionId"') + raise Appwrite::Exception.new('Missing required parameter: "functionId"') end if entrypoint.nil? - raise Appwrite::Exception.new('Missing required parameter: "entrypoint"') + raise Appwrite::Exception.new('Missing required parameter: "entrypoint"') end if code.nil? - raise Appwrite::Exception.new('Missing required parameter: "code"') + raise Appwrite::Exception.new('Missing required parameter: "code"') end if activate.nil? - raise Appwrite::Exception.new('Missing required parameter: "activate"') + raise Appwrite::Exception.new('Missing required parameter: "activate"') end - .gsub('{functionId}', function_id) + params = { + entrypoint: entrypoint, + code: code, + activate: activate, + } + + headers = { + "content-type": 'multipart/form-data', + } id_param_name = nil param_name = 'code' @@ -335,25 +331,24 @@ def create_deployment(function_id:, entrypoint:, code:, activate:, on_progress: # # @return [Deployment] def get_deployment(function_id:, deployment_id:) - path = '/functions/{functionId}/deployments/{deploymentId}' + .gsub('{functionId}', function_id) + .gsub('{deploymentId}', deployment_id) - params = { - } - - headers = { - "content-type": 'application/json', - } if function_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "functionId"') + raise Appwrite::Exception.new('Missing required parameter: "functionId"') end if deployment_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "deploymentId"') + raise Appwrite::Exception.new('Missing required parameter: "deploymentId"') end - .gsub('{functionId}', function_id) - .gsub('{deploymentId}', deployment_id) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'GET', @@ -374,25 +369,24 @@ def get_deployment(function_id:, deployment_id:) # # @return [Function] def update_deployment(function_id:, deployment_id:) - path = '/functions/{functionId}/deployments/{deploymentId}' + .gsub('{functionId}', function_id) + .gsub('{deploymentId}', deployment_id) - params = { - } - - headers = { - "content-type": 'application/json', - } if function_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "functionId"') + raise Appwrite::Exception.new('Missing required parameter: "functionId"') end if deployment_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "deploymentId"') + raise Appwrite::Exception.new('Missing required parameter: "deploymentId"') end - .gsub('{functionId}', function_id) - .gsub('{deploymentId}', deployment_id) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'PATCH', @@ -411,25 +405,24 @@ def update_deployment(function_id:, deployment_id:) # # @return [] def delete_deployment(function_id:, deployment_id:) - path = '/functions/{functionId}/deployments/{deploymentId}' + .gsub('{functionId}', function_id) + .gsub('{deploymentId}', deployment_id) - params = { - } - - headers = { - "content-type": 'application/json', - } if function_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "functionId"') + raise Appwrite::Exception.new('Missing required parameter: "functionId"') end if deployment_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "deploymentId"') + raise Appwrite::Exception.new('Missing required parameter: "deploymentId"') end - .gsub('{functionId}', function_id) - .gsub('{deploymentId}', deployment_id) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'DELETE', @@ -448,30 +441,29 @@ def delete_deployment(function_id:, deployment_id:) # # @return [] def retry_build(function_id:, deployment_id:, build_id:) - path = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}' + .gsub('{functionId}', function_id) + .gsub('{deploymentId}', deployment_id) + .gsub('{buildId}', build_id) - params = { - } - - headers = { - "content-type": 'application/json', - } if function_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "functionId"') + raise Appwrite::Exception.new('Missing required parameter: "functionId"') end if deployment_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "deploymentId"') + raise Appwrite::Exception.new('Missing required parameter: "deploymentId"') end if build_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "buildId"') + raise Appwrite::Exception.new('Missing required parameter: "buildId"') end - .gsub('{functionId}', function_id) - .gsub('{deploymentId}', deployment_id) - .gsub('{buildId}', build_id) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'POST', @@ -488,13 +480,17 @@ def retry_build(function_id:, deployment_id:, build_id:) # different API modes](/docs/admin). # # @param [String] function_id Function 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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, statusCode, time + # @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: trigger, status, statusCode, duration # @param [String] search Search term to filter your list results. Max length: 256 chars. # # @return [ExecutionList] def list_executions(function_id:, queries: nil, search: nil) - path = '/functions/{functionId}/executions' + .gsub('{functionId}', function_id) + + if function_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "functionId"') + end params = { queries: queries, @@ -504,11 +500,6 @@ def list_executions(function_id:, queries: nil, search: nil) headers = { "content-type": 'application/json', } - if function_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "functionId"') - end - - .gsub('{functionId}', function_id) @client.call( method: 'GET', @@ -527,12 +518,16 @@ def list_executions(function_id:, queries: nil, search: nil) # # @param [String] function_id Function ID. # @param [String] data String of custom data to send to function. - # @param [] async Execute code asynchronously. Default value is true. + # @param [] async Execute code in the background. Default value is false. # # @return [Execution] def create_execution(function_id:, data: nil, async: nil) - path = '/functions/{functionId}/executions' + .gsub('{functionId}', function_id) + + if function_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "functionId"') + end params = { data: data, @@ -542,11 +537,6 @@ def create_execution(function_id:, data: nil, async: nil) headers = { "content-type": 'application/json', } - if function_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "functionId"') - end - - .gsub('{functionId}', function_id) @client.call( method: 'POST', @@ -565,25 +555,24 @@ def create_execution(function_id:, data: nil, async: nil) # # @return [Execution] def get_execution(function_id:, execution_id:) - path = '/functions/{functionId}/executions/{executionId}' + .gsub('{functionId}', function_id) + .gsub('{executionId}', execution_id) - params = { - } - - headers = { - "content-type": 'application/json', - } if function_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "functionId"') + raise Appwrite::Exception.new('Missing required parameter: "functionId"') end if execution_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "executionId"') + raise Appwrite::Exception.new('Missing required parameter: "executionId"') end - .gsub('{functionId}', function_id) - .gsub('{executionId}', execution_id) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'GET', @@ -598,27 +587,22 @@ def get_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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key - # @param [String] search Search term to filter your list results. Max length: 256 chars. # # @return [VariableList] - def list_variables(function_id:, queries: nil, search: nil) - + def list_variables(function_id:) path = '/functions/{functionId}/variables' + .gsub('{functionId}', function_id) + + if function_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "functionId"') + end params = { - queries: queries, - search: search, } headers = { "content-type": 'application/json', } - if function_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "functionId"') - end - - .gsub('{functionId}', function_id) @client.call( method: 'GET', @@ -639,30 +623,29 @@ def list_variables(function_id:, queries: nil, search: nil) # # @return [Variable] def create_variable(function_id:, key:, value:) - path = '/functions/{functionId}/variables' + .gsub('{functionId}', function_id) - params = { - key: key, - value: value, - } - - headers = { - "content-type": 'application/json', - } if function_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "functionId"') + raise Appwrite::Exception.new('Missing required parameter: "functionId"') end if key.nil? - raise Appwrite::Exception.new('Missing required parameter: "key"') + raise Appwrite::Exception.new('Missing required parameter: "key"') end if value.nil? - raise Appwrite::Exception.new('Missing required parameter: "value"') + raise Appwrite::Exception.new('Missing required parameter: "value"') end - .gsub('{functionId}', function_id) + params = { + key: key, + value: value, + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'POST', @@ -681,25 +664,24 @@ def create_variable(function_id:, key:, value:) # # @return [Variable] def get_variable(function_id:, variable_id:) - path = '/functions/{functionId}/variables/{variableId}' + .gsub('{functionId}', function_id) + .gsub('{variableId}', variable_id) - params = { - } - - headers = { - "content-type": 'application/json', - } if function_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "functionId"') + raise Appwrite::Exception.new('Missing required parameter: "functionId"') end if variable_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "variableId"') + raise Appwrite::Exception.new('Missing required parameter: "variableId"') end - .gsub('{functionId}', function_id) - .gsub('{variableId}', variable_id) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'GET', @@ -720,31 +702,30 @@ def get_variable(function_id:, variable_id:) # # @return [Variable] def update_variable(function_id:, variable_id:, key:, value: nil) - path = '/functions/{functionId}/variables/{variableId}' + .gsub('{functionId}', function_id) + .gsub('{variableId}', variable_id) - params = { - key: key, - value: value, - } - - headers = { - "content-type": 'application/json', - } if function_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "functionId"') + raise Appwrite::Exception.new('Missing required parameter: "functionId"') end if variable_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "variableId"') + raise Appwrite::Exception.new('Missing required parameter: "variableId"') end if key.nil? - raise Appwrite::Exception.new('Missing required parameter: "key"') + raise Appwrite::Exception.new('Missing required parameter: "key"') end - .gsub('{functionId}', function_id) - .gsub('{variableId}', variable_id) + params = { + key: key, + value: value, + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'PUT', @@ -763,25 +744,24 @@ def update_variable(function_id:, variable_id:, key:, value: nil) # # @return [] def delete_variable(function_id:, variable_id:) - path = '/functions/{functionId}/variables/{variableId}' + .gsub('{functionId}', function_id) + .gsub('{variableId}', variable_id) - params = { - } - - headers = { - "content-type": 'application/json', - } if function_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "functionId"') + raise Appwrite::Exception.new('Missing required parameter: "functionId"') end if variable_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "variableId"') + raise Appwrite::Exception.new('Missing required parameter: "variableId"') end - .gsub('{functionId}', function_id) - .gsub('{variableId}', variable_id) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'DELETE', diff --git a/lib/appwrite/services/health.rb b/lib/appwrite/services/health.rb index 10e0eff..47f643a 100644 --- a/lib/appwrite/services/health.rb +++ b/lib/appwrite/services/health.rb @@ -12,7 +12,6 @@ def initialize(client) # # @return [HealthStatus] def get() - path = '/health' params = { @@ -37,7 +36,6 @@ def get() # # @return [HealthAntivirus] def get_antivirus() - path = '/health/anti-virus' params = { @@ -63,7 +61,6 @@ def get_antivirus() # # @return [HealthStatus] def get_cache() - path = '/health/cache' params = { @@ -88,7 +85,6 @@ def get_cache() # # @return [HealthStatus] def get_db() - path = '/health/db' params = { @@ -115,7 +111,6 @@ def get_db() # # @return [HealthQueue] def get_queue_certificates() - path = '/health/queue/certificates' params = { @@ -140,7 +135,6 @@ def get_queue_certificates() # # @return [HealthQueue] def get_queue_functions() - path = '/health/queue/functions' params = { @@ -166,7 +160,6 @@ def get_queue_functions() # # @return [HealthQueue] def get_queue_logs() - path = '/health/queue/logs' params = { @@ -192,7 +185,6 @@ def get_queue_logs() # # @return [HealthQueue] def get_queue_webhooks() - path = '/health/queue/webhooks' params = { @@ -217,7 +209,6 @@ def get_queue_webhooks() # # @return [HealthStatus] def get_storage_local() - path = '/health/storage/local' params = { @@ -248,7 +239,6 @@ def get_storage_local() # # @return [HealthTime] def get_time() - path = '/health/time' params = { diff --git a/lib/appwrite/services/locale.rb b/lib/appwrite/services/locale.rb index 8415251..b2e68ab 100644 --- a/lib/appwrite/services/locale.rb +++ b/lib/appwrite/services/locale.rb @@ -17,7 +17,6 @@ def initialize(client) # # @return [Locale] def get() - path = '/locale' params = { @@ -42,8 +41,7 @@ def get() # # # @return [ContinentList] - def get_continents() - + def list_continents() path = '/locale/continents' params = { @@ -68,8 +66,7 @@ def get_continents() # # # @return [CountryList] - def get_countries() - + def list_countries() path = '/locale/countries' params = { @@ -94,8 +91,7 @@ def get_countries() # # # @return [CountryList] - def get_countries_eu() - + def list_countries_eu() path = '/locale/countries/eu' params = { @@ -120,8 +116,7 @@ def get_countries_eu() # # # @return [PhoneList] - def get_countries_phones() - + def list_countries_phones() path = '/locale/countries/phones' params = { @@ -147,8 +142,7 @@ def get_countries_phones() # # # @return [CurrencyList] - def get_currencies() - + def list_currencies() path = '/locale/currencies' params = { @@ -173,8 +167,7 @@ def get_currencies() # # # @return [LanguageList] - def get_languages() - + def list_languages() path = '/locale/languages' params = { diff --git a/lib/appwrite/services/storage.rb b/lib/appwrite/services/storage.rb index 9620d6f..f226138 100644 --- a/lib/appwrite/services/storage.rb +++ b/lib/appwrite/services/storage.rb @@ -15,7 +15,6 @@ def initialize(client) # # @return [BucketList] def list_buckets(queries: nil, search: nil) - path = '/storage/buckets' params = { @@ -52,9 +51,16 @@ def list_buckets(queries: nil, search: nil) # # @return [Bucket] def create_bucket(bucket_id:, name:, permissions: nil, file_security: nil, enabled: nil, maximum_file_size: nil, allowed_file_extensions: nil, compression: nil, encryption: nil, antivirus: nil) - path = '/storage/buckets' + if bucket_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "bucketId"') + end + + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end + params = { bucketId: bucket_id, name: name, @@ -71,14 +77,6 @@ def create_bucket(bucket_id:, name:, permissions: nil, file_security: nil, enabl headers = { "content-type": 'application/json', } - if bucket_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "bucketId"') - end - - if name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') - end - @client.call( method: 'POST', @@ -97,8 +95,12 @@ def create_bucket(bucket_id:, name:, permissions: nil, file_security: nil, enabl # # @return [Bucket] def get_bucket(bucket_id:) - path = '/storage/buckets/{bucketId}' + .gsub('{bucketId}', bucket_id) + + if bucket_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "bucketId"') + end params = { } @@ -106,11 +108,6 @@ def get_bucket(bucket_id:) headers = { "content-type": 'application/json', } - if bucket_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "bucketId"') - end - - .gsub('{bucketId}', bucket_id) @client.call( method: 'GET', @@ -137,8 +134,16 @@ def get_bucket(bucket_id:) # # @return [Bucket] def update_bucket(bucket_id:, name:, permissions: nil, file_security: nil, enabled: nil, maximum_file_size: nil, allowed_file_extensions: nil, compression: nil, encryption: nil, antivirus: nil) - path = '/storage/buckets/{bucketId}' + .gsub('{bucketId}', bucket_id) + + if bucket_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "bucketId"') + end + + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end params = { name: name, @@ -155,15 +160,6 @@ def update_bucket(bucket_id:, name:, permissions: nil, file_security: nil, enabl headers = { "content-type": 'application/json', } - if bucket_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "bucketId"') - end - - if name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') - end - - .gsub('{bucketId}', bucket_id) @client.call( method: 'PUT', @@ -181,8 +177,12 @@ def update_bucket(bucket_id:, name:, permissions: nil, file_security: nil, enabl # # @return [] def delete_bucket(bucket_id:) - path = '/storage/buckets/{bucketId}' + .gsub('{bucketId}', bucket_id) + + if bucket_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "bucketId"') + end params = { } @@ -190,11 +190,6 @@ def delete_bucket(bucket_id:) headers = { "content-type": 'application/json', } - if bucket_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "bucketId"') - end - - .gsub('{bucketId}', bucket_id) @client.call( method: 'DELETE', @@ -215,8 +210,12 @@ def delete_bucket(bucket_id:) # # @return [FileList] def list_files(bucket_id:, queries: nil, search: nil) - path = '/storage/buckets/{bucketId}/files' + .gsub('{bucketId}', bucket_id) + + if bucket_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "bucketId"') + end params = { queries: queries, @@ -226,11 +225,6 @@ def list_files(bucket_id:, queries: nil, search: nil) headers = { "content-type": 'application/json', } - if bucket_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "bucketId"') - end - - .gsub('{bucketId}', bucket_id) @client.call( method: 'GET', @@ -268,31 +262,30 @@ def list_files(bucket_id:, queries: nil, search: nil) # # @return [File] def create_file(bucket_id:, file_id:, file:, permissions: nil, on_progress: nil) - path = '/storage/buckets/{bucketId}/files' + .gsub('{bucketId}', bucket_id) - params = { - fileId: file_id, - file: file, - permissions: permissions, - } - - headers = { - "content-type": 'multipart/form-data', - } if bucket_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "bucketId"') + raise Appwrite::Exception.new('Missing required parameter: "bucketId"') end if file_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "fileId"') + raise Appwrite::Exception.new('Missing required parameter: "fileId"') end if file.nil? - raise Appwrite::Exception.new('Missing required parameter: "file"') + raise Appwrite::Exception.new('Missing required parameter: "file"') end - .gsub('{bucketId}', bucket_id) + params = { + fileId: file_id, + file: file, + permissions: permissions, + } + + headers = { + "content-type": 'multipart/form-data', + } id_param_name = "fileId" param_name = 'file' @@ -317,25 +310,24 @@ def create_file(bucket_id:, file_id:, file:, permissions: nil, on_progress: nil) # # @return [File] def get_file(bucket_id:, file_id:) - path = '/storage/buckets/{bucketId}/files/{fileId}' + .gsub('{bucketId}', bucket_id) + .gsub('{fileId}', file_id) - params = { - } - - headers = { - "content-type": 'application/json', - } if bucket_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "bucketId"') + raise Appwrite::Exception.new('Missing required parameter: "bucketId"') end if file_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "fileId"') + raise Appwrite::Exception.new('Missing required parameter: "fileId"') end - .gsub('{bucketId}', bucket_id) - .gsub('{fileId}', file_id) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'GET', @@ -356,8 +348,17 @@ def get_file(bucket_id:, file_id:) # # @return [File] def update_file(bucket_id:, file_id:, permissions: nil) - path = '/storage/buckets/{bucketId}/files/{fileId}' + .gsub('{bucketId}', bucket_id) + .gsub('{fileId}', file_id) + + if bucket_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "bucketId"') + end + + if file_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "fileId"') + end params = { permissions: permissions, @@ -366,16 +367,6 @@ def update_file(bucket_id:, file_id:, permissions: nil) headers = { "content-type": 'application/json', } - if bucket_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "bucketId"') - end - - if file_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "fileId"') - end - - .gsub('{bucketId}', bucket_id) - .gsub('{fileId}', file_id) @client.call( method: 'PUT', @@ -395,25 +386,24 @@ def update_file(bucket_id:, file_id:, permissions: nil) # # @return [] def delete_file(bucket_id:, file_id:) - path = '/storage/buckets/{bucketId}/files/{fileId}' + .gsub('{bucketId}', bucket_id) + .gsub('{fileId}', file_id) - params = { - } - - headers = { - "content-type": 'application/json', - } if bucket_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "bucketId"') + raise Appwrite::Exception.new('Missing required parameter: "bucketId"') end if file_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "fileId"') + raise Appwrite::Exception.new('Missing required parameter: "fileId"') end - .gsub('{bucketId}', bucket_id) - .gsub('{fileId}', file_id) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'DELETE', @@ -433,25 +423,24 @@ def delete_file(bucket_id:, file_id:) # # @return [] def get_file_download(bucket_id:, file_id:) - path = '/storage/buckets/{bucketId}/files/{fileId}/download' + .gsub('{bucketId}', bucket_id) + .gsub('{fileId}', file_id) - params = { - } - - headers = { - "content-type": 'application/json', - } if bucket_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "bucketId"') + raise Appwrite::Exception.new('Missing required parameter: "bucketId"') end if file_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "fileId"') + raise Appwrite::Exception.new('Missing required parameter: "fileId"') end - .gsub('{bucketId}', bucket_id) - .gsub('{fileId}', file_id) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'GET', @@ -484,8 +473,17 @@ def get_file_download(bucket_id:, file_id:) # # @return [] def get_file_preview(bucket_id:, file_id:, width: nil, height: nil, gravity: nil, quality: nil, border_width: nil, border_color: nil, border_radius: nil, opacity: nil, rotation: nil, background: nil, output: nil) - path = '/storage/buckets/{bucketId}/files/{fileId}/preview' + .gsub('{bucketId}', bucket_id) + .gsub('{fileId}', file_id) + + if bucket_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "bucketId"') + end + + if file_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "fileId"') + end params = { width: width, @@ -504,16 +502,6 @@ def get_file_preview(bucket_id:, file_id:, width: nil, height: nil, gravity: nil headers = { "content-type": 'application/json', } - if bucket_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "bucketId"') - end - - if file_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "fileId"') - end - - .gsub('{bucketId}', bucket_id) - .gsub('{fileId}', file_id) @client.call( method: 'GET', @@ -533,25 +521,24 @@ def get_file_preview(bucket_id:, file_id:, width: nil, height: nil, gravity: nil # # @return [] def get_file_view(bucket_id:, file_id:) - path = '/storage/buckets/{bucketId}/files/{fileId}/view' + .gsub('{bucketId}', bucket_id) + .gsub('{fileId}', file_id) - params = { - } - - headers = { - "content-type": 'application/json', - } if bucket_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "bucketId"') + raise Appwrite::Exception.new('Missing required parameter: "bucketId"') end if file_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "fileId"') + raise Appwrite::Exception.new('Missing required parameter: "fileId"') end - .gsub('{bucketId}', bucket_id) - .gsub('{fileId}', file_id) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'GET', diff --git a/lib/appwrite/services/teams.rb b/lib/appwrite/services/teams.rb index 5ee13ce..685c033 100644 --- a/lib/appwrite/services/teams.rb +++ b/lib/appwrite/services/teams.rb @@ -18,7 +18,6 @@ def initialize(client) # # @return [TeamList] def list(queries: nil, search: nil) - path = '/teams' params = { @@ -50,9 +49,16 @@ def list(queries: nil, search: nil) # # @return [Team] def create(team_id:, name:, roles: nil) - path = '/teams' + if team_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "teamId"') + end + + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end + params = { teamId: team_id, name: name, @@ -62,14 +68,6 @@ def create(team_id:, name:, roles: nil) headers = { "content-type": 'application/json', } - if team_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "teamId"') - end - - if name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') - end - @client.call( method: 'POST', @@ -87,8 +85,12 @@ def create(team_id:, name:, roles: nil) # # @return [Team] def get(team_id:) - path = '/teams/{teamId}' + .gsub('{teamId}', team_id) + + if team_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "teamId"') + end params = { } @@ -96,11 +98,6 @@ def get(team_id:) headers = { "content-type": 'application/json', } - if team_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "teamId"') - end - - .gsub('{teamId}', team_id) @client.call( method: 'GET', @@ -120,8 +117,16 @@ def get(team_id:) # # @return [Team] def update(team_id:, name:) - path = '/teams/{teamId}' + .gsub('{teamId}', team_id) + + if team_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "teamId"') + end + + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end params = { name: name, @@ -130,15 +135,6 @@ def update(team_id:, name:) headers = { "content-type": 'application/json', } - if team_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "teamId"') - end - - if name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') - end - - .gsub('{teamId}', team_id) @client.call( method: 'PUT', @@ -157,8 +153,12 @@ def update(team_id:, name:) # # @return [] def delete(team_id:) - path = '/teams/{teamId}' + .gsub('{teamId}', team_id) + + if team_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "teamId"') + end params = { } @@ -166,11 +166,6 @@ def delete(team_id:) headers = { "content-type": 'application/json', } - if team_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "teamId"') - end - - .gsub('{teamId}', team_id) @client.call( method: 'DELETE', @@ -189,9 +184,13 @@ def delete(team_id:) # @param [String] search Search term to filter your list results. Max length: 256 chars. # # @return [MembershipList] - def get_memberships(team_id:, queries: nil, search: nil) - + def list_memberships(team_id:, queries: nil, search: nil) path = '/teams/{teamId}/memberships' + .gsub('{teamId}', team_id) + + if team_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "teamId"') + end params = { queries: queries, @@ -201,11 +200,6 @@ def get_memberships(team_id:, queries: nil, search: nil) headers = { "content-type": 'application/json', } - if team_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "teamId"') - end - - .gsub('{teamId}', team_id) @client.call( method: 'GET', @@ -241,36 +235,35 @@ def get_memberships(team_id:, queries: nil, search: nil) # # @return [Membership] def create_membership(team_id:, email:, roles:, url:, name: nil) - path = '/teams/{teamId}/memberships' + .gsub('{teamId}', team_id) - params = { - email: email, - roles: roles, - url: url, - name: name, - } - - headers = { - "content-type": 'application/json', - } if team_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "teamId"') + raise Appwrite::Exception.new('Missing required parameter: "teamId"') end if email.nil? - raise Appwrite::Exception.new('Missing required parameter: "email"') + raise Appwrite::Exception.new('Missing required parameter: "email"') end if roles.nil? - raise Appwrite::Exception.new('Missing required parameter: "roles"') + raise Appwrite::Exception.new('Missing required parameter: "roles"') end if url.nil? - raise Appwrite::Exception.new('Missing required parameter: "url"') + raise Appwrite::Exception.new('Missing required parameter: "url"') end - .gsub('{teamId}', team_id) + params = { + email: email, + roles: roles, + url: url, + name: name, + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'POST', @@ -290,25 +283,24 @@ def create_membership(team_id:, email:, roles:, url:, name: nil) # # @return [MembershipList] def get_membership(team_id:, membership_id:) - path = '/teams/{teamId}/memberships/{membershipId}' + .gsub('{teamId}', team_id) + .gsub('{membershipId}', membership_id) - params = { - } - - headers = { - "content-type": 'application/json', - } if team_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "teamId"') + raise Appwrite::Exception.new('Missing required parameter: "teamId"') end if membership_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "membershipId"') + raise Appwrite::Exception.new('Missing required parameter: "membershipId"') end - .gsub('{teamId}', team_id) - .gsub('{membershipId}', membership_id) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'GET', @@ -330,30 +322,29 @@ def get_membership(team_id:, membership_id:) # # @return [Membership] def update_membership_roles(team_id:, membership_id:, roles:) - path = '/teams/{teamId}/memberships/{membershipId}' + .gsub('{teamId}', team_id) + .gsub('{membershipId}', membership_id) - params = { - roles: roles, - } - - headers = { - "content-type": 'application/json', - } if team_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "teamId"') + raise Appwrite::Exception.new('Missing required parameter: "teamId"') end if membership_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "membershipId"') + raise Appwrite::Exception.new('Missing required parameter: "membershipId"') end if roles.nil? - raise Appwrite::Exception.new('Missing required parameter: "roles"') + raise Appwrite::Exception.new('Missing required parameter: "roles"') end - .gsub('{teamId}', team_id) - .gsub('{membershipId}', membership_id) + params = { + roles: roles, + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'PATCH', @@ -374,25 +365,24 @@ def update_membership_roles(team_id:, membership_id:, roles:) # # @return [] def delete_membership(team_id:, membership_id:) - path = '/teams/{teamId}/memberships/{membershipId}' + .gsub('{teamId}', team_id) + .gsub('{membershipId}', membership_id) - params = { - } - - headers = { - "content-type": 'application/json', - } if team_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "teamId"') + raise Appwrite::Exception.new('Missing required parameter: "teamId"') end if membership_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "membershipId"') + raise Appwrite::Exception.new('Missing required parameter: "membershipId"') end - .gsub('{teamId}', team_id) - .gsub('{membershipId}', membership_id) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'DELETE', @@ -418,35 +408,34 @@ def delete_membership(team_id:, membership_id:) # # @return [Membership] def update_membership_status(team_id:, membership_id:, user_id:, secret:) - path = '/teams/{teamId}/memberships/{membershipId}/status' + .gsub('{teamId}', team_id) + .gsub('{membershipId}', membership_id) - params = { - userId: user_id, - secret: secret, - } - - headers = { - "content-type": 'application/json', - } if team_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "teamId"') + raise Appwrite::Exception.new('Missing required parameter: "teamId"') end if membership_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "membershipId"') + raise Appwrite::Exception.new('Missing required parameter: "membershipId"') end if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') + raise Appwrite::Exception.new('Missing required parameter: "userId"') end if secret.nil? - raise Appwrite::Exception.new('Missing required parameter: "secret"') + raise Appwrite::Exception.new('Missing required parameter: "secret"') end - .gsub('{teamId}', team_id) - .gsub('{membershipId}', membership_id) + params = { + userId: user_id, + secret: secret, + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'PATCH', diff --git a/lib/appwrite/services/users.rb b/lib/appwrite/services/users.rb index ca64d95..8e2e9bf 100644 --- a/lib/appwrite/services/users.rb +++ b/lib/appwrite/services/users.rb @@ -15,7 +15,6 @@ def initialize(client) # # @return [UserList] def list(queries: nil, search: nil) - path = '/users' params = { @@ -47,9 +46,12 @@ def list(queries: nil, search: nil) # # @return [User] def create(user_id:, email: nil, phone: nil, password: nil, name: nil) - path = '/users' + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end + params = { userId: user_id, email: email, @@ -61,10 +63,6 @@ def create(user_id:, email: nil, phone: nil, password: nil, name: nil) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - @client.call( method: 'POST', @@ -88,9 +86,20 @@ def create(user_id:, email: nil, phone: nil, password: nil, name: nil) # # @return [User] def create_argon2_user(user_id:, email:, password:, name: nil) - path = '/users/argon2' + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end + + if email.nil? + raise Appwrite::Exception.new('Missing required parameter: "email"') + end + + if password.nil? + raise Appwrite::Exception.new('Missing required parameter: "password"') + end + params = { userId: user_id, email: email, @@ -101,18 +110,6 @@ def create_argon2_user(user_id:, email:, password:, name: nil) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - if email.nil? - raise Appwrite::Exception.new('Missing required parameter: "email"') - end - - if password.nil? - raise Appwrite::Exception.new('Missing required parameter: "password"') - end - @client.call( method: 'POST', @@ -136,9 +133,20 @@ def create_argon2_user(user_id:, email:, password:, name: nil) # # @return [User] def create_bcrypt_user(user_id:, email:, password:, name: nil) - path = '/users/bcrypt' + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end + + if email.nil? + raise Appwrite::Exception.new('Missing required parameter: "email"') + end + + if password.nil? + raise Appwrite::Exception.new('Missing required parameter: "password"') + end + params = { userId: user_id, email: email, @@ -149,18 +157,6 @@ def create_bcrypt_user(user_id:, email:, password:, name: nil) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - if email.nil? - raise Appwrite::Exception.new('Missing required parameter: "email"') - end - - if password.nil? - raise Appwrite::Exception.new('Missing required parameter: "password"') - end - @client.call( method: 'POST', @@ -184,9 +180,20 @@ def create_bcrypt_user(user_id:, email:, password:, name: nil) # # @return [User] def create_md5_user(user_id:, email:, password:, name: nil) - path = '/users/md5' + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end + + if email.nil? + raise Appwrite::Exception.new('Missing required parameter: "email"') + end + + if password.nil? + raise Appwrite::Exception.new('Missing required parameter: "password"') + end + params = { userId: user_id, email: email, @@ -197,18 +204,6 @@ def create_md5_user(user_id:, email:, password:, name: nil) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - if email.nil? - raise Appwrite::Exception.new('Missing required parameter: "email"') - end - - if password.nil? - raise Appwrite::Exception.new('Missing required parameter: "password"') - end - @client.call( method: 'POST', @@ -232,9 +227,20 @@ def create_md5_user(user_id:, email:, password:, name: nil) # # @return [User] def create_ph_pass_user(user_id:, email:, password:, name: nil) - path = '/users/phpass' + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end + + if email.nil? + raise Appwrite::Exception.new('Missing required parameter: "email"') + end + + if password.nil? + raise Appwrite::Exception.new('Missing required parameter: "password"') + end + params = { userId: user_id, email: email, @@ -245,18 +251,6 @@ def create_ph_pass_user(user_id:, email:, password:, name: nil) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - if email.nil? - raise Appwrite::Exception.new('Missing required parameter: "email"') - end - - if password.nil? - raise Appwrite::Exception.new('Missing required parameter: "password"') - end - @client.call( method: 'POST', @@ -285,56 +279,55 @@ def create_ph_pass_user(user_id:, email:, password:, name: nil) # # @return [User] def create_scrypt_user(user_id:, email:, password:, password_salt:, password_cpu:, password_memory:, password_parallel:, password_length:, name: nil) - path = '/users/scrypt' - params = { - userId: user_id, - email: email, - password: password, - passwordSalt: password_salt, - passwordCpu: password_cpu, - passwordMemory: password_memory, - passwordParallel: password_parallel, - passwordLength: password_length, - name: name, - } - - headers = { - "content-type": 'application/json', - } if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') + raise Appwrite::Exception.new('Missing required parameter: "userId"') end if email.nil? - raise Appwrite::Exception.new('Missing required parameter: "email"') + raise Appwrite::Exception.new('Missing required parameter: "email"') end if password.nil? - raise Appwrite::Exception.new('Missing required parameter: "password"') + raise Appwrite::Exception.new('Missing required parameter: "password"') end if password_salt.nil? - raise Appwrite::Exception.new('Missing required parameter: "passwordSalt"') + raise Appwrite::Exception.new('Missing required parameter: "passwordSalt"') end if password_cpu.nil? - raise Appwrite::Exception.new('Missing required parameter: "passwordCpu"') + raise Appwrite::Exception.new('Missing required parameter: "passwordCpu"') end if password_memory.nil? - raise Appwrite::Exception.new('Missing required parameter: "passwordMemory"') + raise Appwrite::Exception.new('Missing required parameter: "passwordMemory"') end if password_parallel.nil? - raise Appwrite::Exception.new('Missing required parameter: "passwordParallel"') + raise Appwrite::Exception.new('Missing required parameter: "passwordParallel"') end if password_length.nil? - raise Appwrite::Exception.new('Missing required parameter: "passwordLength"') + raise Appwrite::Exception.new('Missing required parameter: "passwordLength"') end + params = { + userId: user_id, + email: email, + password: password, + passwordSalt: password_salt, + passwordCpu: password_cpu, + passwordMemory: password_memory, + passwordParallel: password_parallel, + passwordLength: password_length, + name: name, + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'POST', @@ -361,46 +354,45 @@ def create_scrypt_user(user_id:, email:, password:, password_salt:, password_cpu # # @return [User] def create_scrypt_modified_user(user_id:, email:, password:, password_salt:, password_salt_separator:, password_signer_key:, name: nil) - path = '/users/scrypt-modified' - params = { - userId: user_id, - email: email, - password: password, - passwordSalt: password_salt, - passwordSaltSeparator: password_salt_separator, - passwordSignerKey: password_signer_key, - name: name, - } - - headers = { - "content-type": 'application/json', - } if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') + raise Appwrite::Exception.new('Missing required parameter: "userId"') end if email.nil? - raise Appwrite::Exception.new('Missing required parameter: "email"') + raise Appwrite::Exception.new('Missing required parameter: "email"') end if password.nil? - raise Appwrite::Exception.new('Missing required parameter: "password"') + raise Appwrite::Exception.new('Missing required parameter: "password"') end if password_salt.nil? - raise Appwrite::Exception.new('Missing required parameter: "passwordSalt"') + raise Appwrite::Exception.new('Missing required parameter: "passwordSalt"') end if password_salt_separator.nil? - raise Appwrite::Exception.new('Missing required parameter: "passwordSaltSeparator"') + raise Appwrite::Exception.new('Missing required parameter: "passwordSaltSeparator"') end if password_signer_key.nil? - raise Appwrite::Exception.new('Missing required parameter: "passwordSignerKey"') + raise Appwrite::Exception.new('Missing required parameter: "passwordSignerKey"') end + params = { + userId: user_id, + email: email, + password: password, + passwordSalt: password_salt, + passwordSaltSeparator: password_salt_separator, + passwordSignerKey: password_signer_key, + name: name, + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'POST', @@ -425,9 +417,20 @@ def create_scrypt_modified_user(user_id:, email:, password:, password_salt:, pas # # @return [User] def create_sha_user(user_id:, email:, password:, password_version: nil, name: nil) - path = '/users/sha' + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end + + if email.nil? + raise Appwrite::Exception.new('Missing required parameter: "email"') + end + + if password.nil? + raise Appwrite::Exception.new('Missing required parameter: "password"') + end + params = { userId: user_id, email: email, @@ -439,18 +442,6 @@ def create_sha_user(user_id:, email:, password:, password_version: nil, name: ni headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - if email.nil? - raise Appwrite::Exception.new('Missing required parameter: "email"') - end - - if password.nil? - raise Appwrite::Exception.new('Missing required parameter: "password"') - end - @client.call( method: 'POST', @@ -468,8 +459,12 @@ def create_sha_user(user_id:, email:, password:, password_version: nil, name: ni # # @return [User] def get(user_id:) - path = '/users/{userId}' + .gsub('{userId}', user_id) + + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end params = { } @@ -477,11 +472,6 @@ def get(user_id:) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - .gsub('{userId}', user_id) @client.call( method: 'GET', @@ -503,8 +493,12 @@ def get(user_id:) # # @return [] def delete(user_id:) - path = '/users/{userId}' + .gsub('{userId}', user_id) + + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end params = { } @@ -512,11 +506,6 @@ def delete(user_id:) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - .gsub('{userId}', user_id) @client.call( method: 'DELETE', @@ -534,8 +523,16 @@ def delete(user_id:) # # @return [User] def update_email(user_id:, email:) - path = '/users/{userId}/email' + .gsub('{userId}', user_id) + + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end + + if email.nil? + raise Appwrite::Exception.new('Missing required parameter: "email"') + end params = { email: email, @@ -544,15 +541,6 @@ def update_email(user_id:, email:) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - if email.nil? - raise Appwrite::Exception.new('Missing required parameter: "email"') - end - - .gsub('{userId}', user_id) @client.call( method: 'PATCH', @@ -570,9 +558,13 @@ def update_email(user_id:, email:) # @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). Only supported methods are limit and offset # # @return [LogList] - def get_logs(user_id:, queries: nil) - + def list_logs(user_id:, queries: nil) path = '/users/{userId}/logs' + .gsub('{userId}', user_id) + + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end params = { queries: queries, @@ -581,11 +573,6 @@ def get_logs(user_id:, queries: nil) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - .gsub('{userId}', user_id) @client.call( method: 'GET', @@ -602,9 +589,13 @@ def get_logs(user_id:, queries: nil) # @param [String] user_id User ID. # # @return [MembershipList] - def get_memberships(user_id:) - + def list_memberships(user_id:) path = '/users/{userId}/memberships' + .gsub('{userId}', user_id) + + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end params = { } @@ -612,11 +603,6 @@ def get_memberships(user_id:) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - .gsub('{userId}', user_id) @client.call( method: 'GET', @@ -635,8 +621,16 @@ def get_memberships(user_id:) # # @return [User] def update_name(user_id:, name:) - path = '/users/{userId}/name' + .gsub('{userId}', user_id) + + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end + + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end params = { name: name, @@ -645,15 +639,6 @@ def update_name(user_id:, name:) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - if name.nil? - raise Appwrite::Exception.new('Missing required parameter: "name"') - end - - .gsub('{userId}', user_id) @client.call( method: 'PATCH', @@ -672,8 +657,16 @@ def update_name(user_id:, name:) # # @return [User] def update_password(user_id:, password:) - path = '/users/{userId}/password' + .gsub('{userId}', user_id) + + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end + + if password.nil? + raise Appwrite::Exception.new('Missing required parameter: "password"') + end params = { password: password, @@ -682,15 +675,6 @@ def update_password(user_id:, password:) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - if password.nil? - raise Appwrite::Exception.new('Missing required parameter: "password"') - end - - .gsub('{userId}', user_id) @client.call( method: 'PATCH', @@ -709,8 +693,16 @@ def update_password(user_id:, password:) # # @return [User] def update_phone(user_id:, number:) - path = '/users/{userId}/phone' + .gsub('{userId}', user_id) + + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end + + if number.nil? + raise Appwrite::Exception.new('Missing required parameter: "number"') + end params = { number: number, @@ -719,15 +711,6 @@ def update_phone(user_id:, number:) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - if number.nil? - raise Appwrite::Exception.new('Missing required parameter: "number"') - end - - .gsub('{userId}', user_id) @client.call( method: 'PATCH', @@ -745,8 +728,12 @@ def update_phone(user_id:, number:) # # @return [Preferences] def get_prefs(user_id:) - path = '/users/{userId}/prefs' + .gsub('{userId}', user_id) + + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end params = { } @@ -754,11 +741,6 @@ def get_prefs(user_id:) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - .gsub('{userId}', user_id) @client.call( method: 'GET', @@ -779,8 +761,16 @@ def get_prefs(user_id:) # # @return [Preferences] def update_prefs(user_id:, prefs:) - path = '/users/{userId}/prefs' + .gsub('{userId}', user_id) + + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end + + if prefs.nil? + raise Appwrite::Exception.new('Missing required parameter: "prefs"') + end params = { prefs: prefs, @@ -789,15 +779,6 @@ def update_prefs(user_id:, prefs:) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - if prefs.nil? - raise Appwrite::Exception.new('Missing required parameter: "prefs"') - end - - .gsub('{userId}', user_id) @client.call( method: 'PATCH', @@ -814,9 +795,13 @@ def update_prefs(user_id:, prefs:) # @param [String] user_id User ID. # # @return [SessionList] - def get_sessions(user_id:) - + def list_sessions(user_id:) path = '/users/{userId}/sessions' + .gsub('{userId}', user_id) + + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end params = { } @@ -824,11 +809,6 @@ def get_sessions(user_id:) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - .gsub('{userId}', user_id) @client.call( method: 'GET', @@ -846,8 +826,12 @@ def get_sessions(user_id:) # # @return [] def delete_sessions(user_id:) - path = '/users/{userId}/sessions' + .gsub('{userId}', user_id) + + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end params = { } @@ -855,11 +839,6 @@ def delete_sessions(user_id:) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - .gsub('{userId}', user_id) @client.call( method: 'DELETE', @@ -877,25 +856,24 @@ def delete_sessions(user_id:) # # @return [] def delete_session(user_id:, session_id:) - path = '/users/{userId}/sessions/{sessionId}' + .gsub('{userId}', user_id) + .gsub('{sessionId}', session_id) - params = { - } - - headers = { - "content-type": 'application/json', - } if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') + raise Appwrite::Exception.new('Missing required parameter: "userId"') end if session_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "sessionId"') + raise Appwrite::Exception.new('Missing required parameter: "sessionId"') end - .gsub('{userId}', user_id) - .gsub('{sessionId}', session_id) + params = { + } + + headers = { + "content-type": 'application/json', + } @client.call( method: 'DELETE', @@ -914,8 +892,16 @@ def delete_session(user_id:, session_id:) # # @return [User] def update_status(user_id:, status:) - path = '/users/{userId}/status' + .gsub('{userId}', user_id) + + 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 params = { status: status, @@ -924,15 +910,6 @@ def update_status(user_id:, status:) headers = { "content-type": 'application/json', } - 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 - - .gsub('{userId}', user_id) @client.call( method: 'PATCH', @@ -951,8 +928,16 @@ def update_status(user_id:, status:) # # @return [User] def update_email_verification(user_id:, email_verification:) - path = '/users/{userId}/verification' + .gsub('{userId}', user_id) + + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end + + if email_verification.nil? + raise Appwrite::Exception.new('Missing required parameter: "emailVerification"') + end params = { emailVerification: email_verification, @@ -961,15 +946,6 @@ def update_email_verification(user_id:, email_verification:) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - if email_verification.nil? - raise Appwrite::Exception.new('Missing required parameter: "emailVerification"') - end - - .gsub('{userId}', user_id) @client.call( method: 'PATCH', @@ -988,8 +964,16 @@ def update_email_verification(user_id:, email_verification:) # # @return [User] def update_phone_verification(user_id:, phone_verification:) - path = '/users/{userId}/verification/phone' + .gsub('{userId}', user_id) + + if user_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "userId"') + end + + if phone_verification.nil? + raise Appwrite::Exception.new('Missing required parameter: "phoneVerification"') + end params = { phoneVerification: phone_verification, @@ -998,15 +982,6 @@ def update_phone_verification(user_id:, phone_verification:) headers = { "content-type": 'application/json', } - if user_id.nil? - raise Appwrite::Exception.new('Missing required parameter: "userId"') - end - - if phone_verification.nil? - raise Appwrite::Exception.new('Missing required parameter: "phoneVerification"') - end - - .gsub('{userId}', user_id) @client.call( method: 'PATCH',