diff --git a/README.md b/README.md index 758a2da..cbc2cf7 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # Appwrite Ruby SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.6.0-blue.svg?v=1) +![Version](https://img.shields.io/badge/api%20version-0.6.1-blue.svg?v=1) -**This SDK is compatible with Appwrite server version 0.6.0. For older versions, please check previous releases.** +**This SDK is compatible with Appwrite server version 0.6.1. For older versions, please check previous 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. diff --git a/appwrite.gemspec b/appwrite.gemspec index 66c69d1..f550cec 100644 --- a/appwrite.gemspec +++ b/appwrite.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = 'appwrite' - s.version = '1.0.10' + s.version = '1.0.11' s.summary = "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)" diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md new file mode 100644 index 0000000..fc0cfc9 --- /dev/null +++ b/docs/examples/avatars/get-browser.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = avatars.get_browser(code: 'aa'); + +puts response \ No newline at end of file diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md new file mode 100644 index 0000000..b3763f0 --- /dev/null +++ b/docs/examples/avatars/get-credit-card.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = avatars.get_credit_card(code: 'amex'); + +puts response \ No newline at end of file diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md new file mode 100644 index 0000000..2ee4e75 --- /dev/null +++ b/docs/examples/avatars/get-favicon.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = avatars.get_favicon(url: 'https://example.com'); + +puts response \ No newline at end of file diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md new file mode 100644 index 0000000..2e2f01f --- /dev/null +++ b/docs/examples/avatars/get-flag.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = avatars.get_flag(code: 'af'); + +puts response \ No newline at end of file diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md new file mode 100644 index 0000000..682d6bf --- /dev/null +++ b/docs/examples/avatars/get-image.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = avatars.get_image(url: 'https://example.com'); + +puts response \ No newline at end of file diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md new file mode 100644 index 0000000..f145425 --- /dev/null +++ b/docs/examples/avatars/get-q-r.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = avatars.get_q_r(text: '[TEXT]'); + +puts response \ No newline at end of file diff --git a/docs/examples/database/create-collection.md b/docs/examples/database/create-collection.md new file mode 100644 index 0000000..0317ed9 --- /dev/null +++ b/docs/examples/database/create-collection.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.create_collection(name: '[NAME]', read: [], write: [], rules: []); + +puts response \ No newline at end of file diff --git a/docs/examples/database/create-document.md b/docs/examples/database/create-document.md new file mode 100644 index 0000000..0101c74 --- /dev/null +++ b/docs/examples/database/create-document.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.create_document(collection_id: '[COLLECTION_ID]', data: {}, read: [], write: []); + +puts response \ No newline at end of file diff --git a/docs/examples/database/delete-collection.md b/docs/examples/database/delete-collection.md new file mode 100644 index 0000000..b91c369 --- /dev/null +++ b/docs/examples/database/delete-collection.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.delete_collection(collection_id: '[COLLECTION_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/database/delete-document.md b/docs/examples/database/delete-document.md new file mode 100644 index 0000000..6548ec2 --- /dev/null +++ b/docs/examples/database/delete-document.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.delete_document(collection_id: '[COLLECTION_ID]', document_id: '[DOCUMENT_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/database/get-collection-logs.md b/docs/examples/database/get-collection-logs.md new file mode 100644 index 0000000..65938d1 --- /dev/null +++ b/docs/examples/database/get-collection-logs.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.get_collection_logs(collection_id: '[COLLECTION_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/database/get-collection.md b/docs/examples/database/get-collection.md new file mode 100644 index 0000000..1e54e94 --- /dev/null +++ b/docs/examples/database/get-collection.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.get_collection(collection_id: '[COLLECTION_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/database/get-document.md b/docs/examples/database/get-document.md new file mode 100644 index 0000000..3040b82 --- /dev/null +++ b/docs/examples/database/get-document.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.get_document(collection_id: '[COLLECTION_ID]', document_id: '[DOCUMENT_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/database/list-collections.md b/docs/examples/database/list-collections.md new file mode 100644 index 0000000..ec15fe3 --- /dev/null +++ b/docs/examples/database/list-collections.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.list_collections(); + +puts response \ No newline at end of file diff --git a/docs/examples/database/list-documents.md b/docs/examples/database/list-documents.md new file mode 100644 index 0000000..fa33f10 --- /dev/null +++ b/docs/examples/database/list-documents.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.list_documents(collection_id: '[COLLECTION_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/database/update-collection.md b/docs/examples/database/update-collection.md new file mode 100644 index 0000000..3ecfbdb --- /dev/null +++ b/docs/examples/database/update-collection.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.update_collection(collection_id: '[COLLECTION_ID]', name: '[NAME]', read: [], write: []); + +puts response \ No newline at end of file diff --git a/docs/examples/database/update-document.md b/docs/examples/database/update-document.md new file mode 100644 index 0000000..492d4f3 --- /dev/null +++ b/docs/examples/database/update-document.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.update_document(collection_id: '[COLLECTION_ID]', document_id: '[DOCUMENT_ID]', data: {}, read: [], write: []); + +puts response \ No newline at end of file diff --git a/docs/examples/health/get-anti-virus.md b/docs/examples/health/get-anti-virus.md new file mode 100644 index 0000000..0c83a06 --- /dev/null +++ b/docs/examples/health/get-anti-virus.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = health.get_anti_virus(); + +puts response \ No newline at end of file diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md new file mode 100644 index 0000000..6f51fb6 --- /dev/null +++ b/docs/examples/health/get-cache.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = health.get_cache(); + +puts response \ No newline at end of file diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-d-b.md new file mode 100644 index 0000000..4bb0057 --- /dev/null +++ b/docs/examples/health/get-d-b.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = health.get_d_b(); + +puts response \ No newline at end of file diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md new file mode 100644 index 0000000..f758b7c --- /dev/null +++ b/docs/examples/health/get-queue-certificates.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = health.get_queue_certificates(); + +puts response \ No newline at end of file diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md new file mode 100644 index 0000000..653607f --- /dev/null +++ b/docs/examples/health/get-queue-functions.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = health.get_queue_functions(); + +puts response \ No newline at end of file diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md new file mode 100644 index 0000000..c6751f7 --- /dev/null +++ b/docs/examples/health/get-queue-logs.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = health.get_queue_logs(); + +puts response \ No newline at end of file diff --git a/docs/examples/health/get-queue-tasks.md b/docs/examples/health/get-queue-tasks.md new file mode 100644 index 0000000..c6da388 --- /dev/null +++ b/docs/examples/health/get-queue-tasks.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = health.get_queue_tasks(); + +puts response \ No newline at end of file diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md new file mode 100644 index 0000000..ed81452 --- /dev/null +++ b/docs/examples/health/get-queue-usage.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = health.get_queue_usage(); + +puts response \ No newline at end of file diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000..9e55ab1 --- /dev/null +++ b/docs/examples/health/get-queue-webhooks.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = health.get_queue_webhooks(); + +puts response \ No newline at end of file diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md new file mode 100644 index 0000000..09c47ae --- /dev/null +++ b/docs/examples/health/get-storage-local.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = health.get_storage_local(); + +puts response \ No newline at end of file diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md new file mode 100644 index 0000000..3d72794 --- /dev/null +++ b/docs/examples/health/get-time.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = health.get_time(); + +puts response \ No newline at end of file diff --git a/docs/examples/health/get.md b/docs/examples/health/get.md new file mode 100644 index 0000000..9496c31 --- /dev/null +++ b/docs/examples/health/get.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = health.get(); + +puts response \ No newline at end of file diff --git a/docs/examples/locale/get-continents.md b/docs/examples/locale/get-continents.md new file mode 100644 index 0000000..92f3892 --- /dev/null +++ b/docs/examples/locale/get-continents.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = locale.get_continents(); + +puts response \ No newline at end of file diff --git a/docs/examples/locale/get-countries-e-u.md b/docs/examples/locale/get-countries-e-u.md new file mode 100644 index 0000000..b83125d --- /dev/null +++ b/docs/examples/locale/get-countries-e-u.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = locale.get_countries_e_u(); + +puts response \ No newline at end of file diff --git a/docs/examples/locale/get-countries-phones.md b/docs/examples/locale/get-countries-phones.md new file mode 100644 index 0000000..728a1b3 --- /dev/null +++ b/docs/examples/locale/get-countries-phones.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = locale.get_countries_phones(); + +puts response \ No newline at end of file diff --git a/docs/examples/locale/get-countries.md b/docs/examples/locale/get-countries.md new file mode 100644 index 0000000..54975db --- /dev/null +++ b/docs/examples/locale/get-countries.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = locale.get_countries(); + +puts response \ No newline at end of file diff --git a/docs/examples/locale/get-currencies.md b/docs/examples/locale/get-currencies.md new file mode 100644 index 0000000..4e39b43 --- /dev/null +++ b/docs/examples/locale/get-currencies.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = locale.get_currencies(); + +puts response \ No newline at end of file diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md new file mode 100644 index 0000000..b390d50 --- /dev/null +++ b/docs/examples/locale/get.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = locale.get(); + +puts response \ No newline at end of file diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md new file mode 100644 index 0000000..b044e35 --- /dev/null +++ b/docs/examples/storage/create-file.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = storage.create_file(file: File.new(), read: [], write: []); + +puts response \ No newline at end of file diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md new file mode 100644 index 0000000..1aa67b3 --- /dev/null +++ b/docs/examples/storage/delete-file.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = storage.delete_file(file_id: '[FILE_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md new file mode 100644 index 0000000..777c565 --- /dev/null +++ b/docs/examples/storage/get-file-download.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = storage.get_file_download(file_id: '[FILE_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md new file mode 100644 index 0000000..48be3a0 --- /dev/null +++ b/docs/examples/storage/get-file-preview.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = storage.get_file_preview(file_id: '[FILE_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md new file mode 100644 index 0000000..a3dc012 --- /dev/null +++ b/docs/examples/storage/get-file-view.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = storage.get_file_view(file_id: '[FILE_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md new file mode 100644 index 0000000..203a4df --- /dev/null +++ b/docs/examples/storage/get-file.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = storage.get_file(file_id: '[FILE_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md new file mode 100644 index 0000000..a148da7 --- /dev/null +++ b/docs/examples/storage/list-files.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = storage.list_files(); + +puts response \ No newline at end of file diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md new file mode 100644 index 0000000..36d5049 --- /dev/null +++ b/docs/examples/storage/update-file.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = storage.update_file(file_id: '[FILE_ID]', read: [], write: []); + +puts response \ No newline at end of file diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md new file mode 100644 index 0000000..fc0a249 --- /dev/null +++ b/docs/examples/teams/create-membership.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = teams.create_membership(team_id: '[TEAM_ID]', email: 'email@example.com', roles: [], url: 'https://example.com'); + +puts response \ No newline at end of file diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md new file mode 100644 index 0000000..d7f9c2f --- /dev/null +++ b/docs/examples/teams/create.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = teams.create(name: '[NAME]'); + +puts response \ No newline at end of file diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md new file mode 100644 index 0000000..545cacc --- /dev/null +++ b/docs/examples/teams/delete-membership.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = teams.delete_membership(team_id: '[TEAM_ID]', invite_id: '[INVITE_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md new file mode 100644 index 0000000..d28907f --- /dev/null +++ b/docs/examples/teams/delete.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = teams.delete(team_id: '[TEAM_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/teams/get-memberships.md b/docs/examples/teams/get-memberships.md new file mode 100644 index 0000000..013d952 --- /dev/null +++ b/docs/examples/teams/get-memberships.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = teams.get_memberships(team_id: '[TEAM_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md new file mode 100644 index 0000000..1dd4918 --- /dev/null +++ b/docs/examples/teams/get.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = teams.get(team_id: '[TEAM_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md new file mode 100644 index 0000000..c0cd72a --- /dev/null +++ b/docs/examples/teams/list.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = teams.list(); + +puts response \ No newline at end of file diff --git a/docs/examples/teams/update.md b/docs/examples/teams/update.md new file mode 100644 index 0000000..b7e87a8 --- /dev/null +++ b/docs/examples/teams/update.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = teams.update(team_id: '[TEAM_ID]', name: '[NAME]'); + +puts response \ No newline at end of file diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md new file mode 100644 index 0000000..0a152ac --- /dev/null +++ b/docs/examples/users/create.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = users.create(email: 'email@example.com', password: 'password'); + +puts response \ No newline at end of file diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md new file mode 100644 index 0000000..149c7d9 --- /dev/null +++ b/docs/examples/users/delete-session.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = users.delete_session(user_id: '[USER_ID]', session_id: '[SESSION_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md new file mode 100644 index 0000000..3f02e08 --- /dev/null +++ b/docs/examples/users/delete-sessions.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = users.delete_sessions(user_id: '[USER_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/users/get-logs.md b/docs/examples/users/get-logs.md new file mode 100644 index 0000000..695a77a --- /dev/null +++ b/docs/examples/users/get-logs.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = users.get_logs(user_id: '[USER_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md new file mode 100644 index 0000000..4a0761e --- /dev/null +++ b/docs/examples/users/get-prefs.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = users.get_prefs(user_id: '[USER_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/users/get-sessions.md b/docs/examples/users/get-sessions.md new file mode 100644 index 0000000..52f37a4 --- /dev/null +++ b/docs/examples/users/get-sessions.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = users.get_sessions(user_id: '[USER_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md new file mode 100644 index 0000000..562ac95 --- /dev/null +++ b/docs/examples/users/get.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = users.get(user_id: '[USER_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md new file mode 100644 index 0000000..096ce85 --- /dev/null +++ b/docs/examples/users/list.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = users.list(); + +puts response \ No newline at end of file diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md new file mode 100644 index 0000000..2bb2d42 --- /dev/null +++ b/docs/examples/users/update-prefs.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = users.update_prefs(user_id: '[USER_ID]', prefs: {}); + +puts response \ No newline at end of file diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md new file mode 100644 index 0000000..088ee38 --- /dev/null +++ b/docs/examples/users/update-status.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .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); + +response = users.update_status(user_id: '[USER_ID]', status: '1'); + +puts response \ No newline at end of file diff --git a/lib/appwrite/client.rb b/lib/appwrite/client.rb index 0620069..2cd09d5 100644 --- a/lib/appwrite/client.rb +++ b/lib/appwrite/client.rb @@ -20,7 +20,7 @@ def initialize() @headers = { 'content-type' => '', 'user-agent' => RUBY_PLATFORM + ':ruby-' + RUBY_VERSION, - 'x-sdk-version' => 'appwrite:ruby:1.0.10' + 'x-sdk-version' => 'appwrite:ruby:1.0.11' } @endpoint = 'https://appwrite.io/v1'; end diff --git a/lib/appwrite/services/database.rb b/lib/appwrite/services/database.rb index 8bb9c3b..d8efcc3 100644 --- a/lib/appwrite/services/database.rb +++ b/lib/appwrite/services/database.rb @@ -33,7 +33,7 @@ def create_collection(name:, read:, write:, rules:) def get_collection(collection_id:) path = '/database/collections/{collectionId}' - .gsub('{collection_id}', collection_id) + .gsub('{collectionId}', collection_id) params = { } @@ -45,7 +45,7 @@ def get_collection(collection_id:) def update_collection(collection_id:, name:, read:, write:, rules: []) path = '/database/collections/{collectionId}' - .gsub('{collection_id}', collection_id) + .gsub('{collectionId}', collection_id) params = { 'name': name, @@ -61,7 +61,7 @@ def update_collection(collection_id:, name:, read:, write:, rules: []) def delete_collection(collection_id:) path = '/database/collections/{collectionId}' - .gsub('{collection_id}', collection_id) + .gsub('{collectionId}', collection_id) params = { } @@ -73,7 +73,7 @@ def delete_collection(collection_id:) def list_documents(collection_id:, filters: [], offset: 0, limit: 50, order_field: '$id', order_type: 'ASC', order_cast: 'string', search: '', first: 0, last: 0) path = '/database/collections/{collectionId}/documents' - .gsub('{collection_id}', collection_id) + .gsub('{collectionId}', collection_id) params = { 'filters': filters, @@ -94,7 +94,7 @@ def list_documents(collection_id:, filters: [], offset: 0, limit: 50, order_fiel def create_document(collection_id:, data:, read:, write:, parent_document: '', parent_property: '', parent_property_type: 'assign') path = '/database/collections/{collectionId}/documents' - .gsub('{collection_id}', collection_id) + .gsub('{collectionId}', collection_id) params = { 'data': data, @@ -112,8 +112,8 @@ def create_document(collection_id:, data:, read:, write:, parent_document: '', p def get_document(collection_id:, document_id:) path = '/database/collections/{collectionId}/documents/{documentId}' - .gsub('{collection_id}', collection_id) - .gsub('{document_id}', document_id) + .gsub('{collectionId}', collection_id) + .gsub('{documentId}', document_id) params = { } @@ -125,8 +125,8 @@ def get_document(collection_id:, document_id:) def update_document(collection_id:, document_id:, data:, read:, write:) path = '/database/collections/{collectionId}/documents/{documentId}' - .gsub('{collection_id}', collection_id) - .gsub('{document_id}', document_id) + .gsub('{collectionId}', collection_id) + .gsub('{documentId}', document_id) params = { 'data': data, @@ -141,8 +141,8 @@ def update_document(collection_id:, document_id:, data:, read:, write:) def delete_document(collection_id:, document_id:) path = '/database/collections/{collectionId}/documents/{documentId}' - .gsub('{collection_id}', collection_id) - .gsub('{document_id}', document_id) + .gsub('{collectionId}', collection_id) + .gsub('{documentId}', document_id) params = { } @@ -154,7 +154,7 @@ def delete_document(collection_id:, document_id:) def get_collection_logs(collection_id:) path = '/database/collections/{collectionId}/logs' - .gsub('{collection_id}', collection_id) + .gsub('{collectionId}', collection_id) params = { } diff --git a/lib/appwrite/services/storage.rb b/lib/appwrite/services/storage.rb index 2fe1a57..0e99a2b 100644 --- a/lib/appwrite/services/storage.rb +++ b/lib/appwrite/services/storage.rb @@ -32,7 +32,7 @@ def create_file(file:, read:, write:) def get_file(file_id:) path = '/storage/files/{fileId}' - .gsub('{file_id}', file_id) + .gsub('{fileId}', file_id) params = { } @@ -44,7 +44,7 @@ def get_file(file_id:) def update_file(file_id:, read:, write:) path = '/storage/files/{fileId}' - .gsub('{file_id}', file_id) + .gsub('{fileId}', file_id) params = { 'read': read, @@ -58,7 +58,7 @@ def update_file(file_id:, read:, write:) def delete_file(file_id:) path = '/storage/files/{fileId}' - .gsub('{file_id}', file_id) + .gsub('{fileId}', file_id) params = { } @@ -70,7 +70,7 @@ def delete_file(file_id:) def get_file_download(file_id:) path = '/storage/files/{fileId}/download' - .gsub('{file_id}', file_id) + .gsub('{fileId}', file_id) params = { } @@ -82,7 +82,7 @@ def get_file_download(file_id:) def get_file_preview(file_id:, width: 0, height: 0, quality: 100, background: '', output: '') path = '/storage/files/{fileId}/preview' - .gsub('{file_id}', file_id) + .gsub('{fileId}', file_id) params = { 'width': width, @@ -99,7 +99,7 @@ def get_file_preview(file_id:, width: 0, height: 0, quality: 100, background: '' def get_file_view(file_id:, as: '') path = '/storage/files/{fileId}/view' - .gsub('{file_id}', file_id) + .gsub('{fileId}', file_id) params = { 'as': as diff --git a/lib/appwrite/services/teams.rb b/lib/appwrite/services/teams.rb index de6079b..0e67747 100644 --- a/lib/appwrite/services/teams.rb +++ b/lib/appwrite/services/teams.rb @@ -31,7 +31,7 @@ def create(name:, roles: ["owner"]) def get(team_id:) path = '/teams/{teamId}' - .gsub('{team_id}', team_id) + .gsub('{teamId}', team_id) params = { } @@ -43,7 +43,7 @@ def get(team_id:) def update(team_id:, name:) path = '/teams/{teamId}' - .gsub('{team_id}', team_id) + .gsub('{teamId}', team_id) params = { 'name': name @@ -56,7 +56,7 @@ def update(team_id:, name:) def delete(team_id:) path = '/teams/{teamId}' - .gsub('{team_id}', team_id) + .gsub('{teamId}', team_id) params = { } @@ -68,7 +68,7 @@ def delete(team_id:) def get_memberships(team_id:) path = '/teams/{teamId}/memberships' - .gsub('{team_id}', team_id) + .gsub('{teamId}', team_id) params = { } @@ -80,7 +80,7 @@ def get_memberships(team_id:) def create_membership(team_id:, email:, roles:, url:, name: '') path = '/teams/{teamId}/memberships' - .gsub('{team_id}', team_id) + .gsub('{teamId}', team_id) params = { 'email': email, @@ -96,8 +96,8 @@ def create_membership(team_id:, email:, roles:, url:, name: '') def delete_membership(team_id:, invite_id:) path = '/teams/{teamId}/memberships/{inviteId}' - .gsub('{team_id}', team_id) - .gsub('{invite_id}', invite_id) + .gsub('{teamId}', team_id) + .gsub('{inviteId}', invite_id) params = { } diff --git a/lib/appwrite/services/users.rb b/lib/appwrite/services/users.rb index ae790c9..f75434b 100644 --- a/lib/appwrite/services/users.rb +++ b/lib/appwrite/services/users.rb @@ -32,7 +32,7 @@ def create(email:, password:, name: '') def get(user_id:) path = '/users/{userId}' - .gsub('{user_id}', user_id) + .gsub('{userId}', user_id) params = { } @@ -44,7 +44,7 @@ def get(user_id:) def get_logs(user_id:) path = '/users/{userId}/logs' - .gsub('{user_id}', user_id) + .gsub('{userId}', user_id) params = { } @@ -56,7 +56,7 @@ def get_logs(user_id:) def get_prefs(user_id:) path = '/users/{userId}/prefs' - .gsub('{user_id}', user_id) + .gsub('{userId}', user_id) params = { } @@ -68,7 +68,7 @@ def get_prefs(user_id:) def update_prefs(user_id:, prefs:) path = '/users/{userId}/prefs' - .gsub('{user_id}', user_id) + .gsub('{userId}', user_id) params = { 'prefs': prefs @@ -81,7 +81,7 @@ def update_prefs(user_id:, prefs:) def get_sessions(user_id:) path = '/users/{userId}/sessions' - .gsub('{user_id}', user_id) + .gsub('{userId}', user_id) params = { } @@ -93,7 +93,7 @@ def get_sessions(user_id:) def delete_sessions(user_id:) path = '/users/{userId}/sessions' - .gsub('{user_id}', user_id) + .gsub('{userId}', user_id) params = { } @@ -105,8 +105,8 @@ def delete_sessions(user_id:) def delete_session(user_id:, session_id:) path = '/users/{userId}/sessions/{sessionId}' - .gsub('{user_id}', user_id) - .gsub('{session_id}', session_id) + .gsub('{userId}', user_id) + .gsub('{sessionId}', session_id) params = { } @@ -118,7 +118,7 @@ def delete_session(user_id:, session_id:) def update_status(user_id:, status:) path = '/users/{userId}/status' - .gsub('{user_id}', user_id) + .gsub('{userId}', user_id) params = { 'status': status