appwrite 1.0.9 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +16 -0
  3. data/CHANGELOG.md +1 -0
  4. data/Gemfile +1 -0
  5. data/LICENSE +1 -1
  6. data/README.md +80 -7
  7. data/appwrite.gemspec +2 -2
  8. data/docs/examples/account/create-recovery.md +15 -0
  9. data/docs/examples/account/create-verification.md +15 -0
  10. data/docs/examples/account/delete-session.md +15 -0
  11. data/docs/examples/account/delete-sessions.md +15 -0
  12. data/docs/examples/account/delete.md +15 -0
  13. data/docs/examples/account/get-logs.md +15 -0
  14. data/docs/examples/account/get-prefs.md +15 -0
  15. data/docs/examples/account/get-sessions.md +15 -0
  16. data/docs/examples/account/get.md +15 -0
  17. data/docs/examples/account/update-email.md +15 -0
  18. data/docs/examples/account/update-name.md +15 -0
  19. data/docs/examples/account/update-password.md +15 -0
  20. data/docs/examples/account/update-prefs.md +15 -0
  21. data/docs/examples/account/update-recovery.md +15 -0
  22. data/docs/examples/account/update-verification.md +15 -0
  23. data/docs/examples/avatars/get-browser.md +15 -0
  24. data/docs/examples/avatars/get-credit-card.md +15 -0
  25. data/docs/examples/avatars/get-favicon.md +15 -0
  26. data/docs/examples/avatars/get-flag.md +15 -0
  27. data/docs/examples/avatars/get-image.md +15 -0
  28. data/docs/examples/avatars/get-initials.md +15 -0
  29. data/docs/examples/avatars/get-q-r.md +15 -0
  30. data/docs/examples/database/create-collection.md +15 -0
  31. data/docs/examples/database/create-document.md +15 -0
  32. data/docs/examples/database/delete-collection.md +15 -0
  33. data/docs/examples/database/delete-document.md +15 -0
  34. data/docs/examples/database/get-collection.md +15 -0
  35. data/docs/examples/database/get-document.md +15 -0
  36. data/docs/examples/database/list-collections.md +15 -0
  37. data/docs/examples/database/list-documents.md +15 -0
  38. data/docs/examples/database/update-collection.md +15 -0
  39. data/docs/examples/database/update-document.md +15 -0
  40. data/docs/examples/functions/create-execution.md +15 -0
  41. data/docs/examples/functions/create-tag.md +15 -0
  42. data/docs/examples/functions/create.md +15 -0
  43. data/docs/examples/functions/delete-tag.md +15 -0
  44. data/docs/examples/functions/delete.md +15 -0
  45. data/docs/examples/functions/get-execution.md +15 -0
  46. data/docs/examples/functions/get-tag.md +15 -0
  47. data/docs/examples/functions/get.md +15 -0
  48. data/docs/examples/functions/list-executions.md +15 -0
  49. data/docs/examples/functions/list-tags.md +15 -0
  50. data/docs/examples/functions/list.md +15 -0
  51. data/docs/examples/functions/update-tag.md +15 -0
  52. data/docs/examples/functions/update.md +15 -0
  53. data/docs/examples/health/get-anti-virus.md +15 -0
  54. data/docs/examples/health/get-cache.md +15 -0
  55. data/docs/examples/health/get-d-b.md +15 -0
  56. data/docs/examples/health/get-queue-certificates.md +15 -0
  57. data/docs/examples/health/get-queue-functions.md +15 -0
  58. data/docs/examples/health/get-queue-logs.md +15 -0
  59. data/docs/examples/health/get-queue-tasks.md +15 -0
  60. data/docs/examples/health/get-queue-usage.md +15 -0
  61. data/docs/examples/health/get-queue-webhooks.md +15 -0
  62. data/docs/examples/health/get-storage-local.md +15 -0
  63. data/docs/examples/health/get-time.md +15 -0
  64. data/docs/examples/health/get.md +15 -0
  65. data/docs/examples/locale/get-continents.md +15 -0
  66. data/docs/examples/locale/get-countries-e-u.md +15 -0
  67. data/docs/examples/locale/get-countries-phones.md +15 -0
  68. data/docs/examples/locale/get-countries.md +15 -0
  69. data/docs/examples/locale/get-currencies.md +15 -0
  70. data/docs/examples/locale/get-languages.md +15 -0
  71. data/docs/examples/locale/get.md +15 -0
  72. data/docs/examples/storage/create-file.md +15 -0
  73. data/docs/examples/storage/delete-file.md +15 -0
  74. data/docs/examples/storage/get-file-download.md +15 -0
  75. data/docs/examples/storage/get-file-preview.md +15 -0
  76. data/docs/examples/storage/get-file-view.md +15 -0
  77. data/docs/examples/storage/get-file.md +15 -0
  78. data/docs/examples/storage/list-files.md +15 -0
  79. data/docs/examples/storage/update-file.md +15 -0
  80. data/docs/examples/teams/create-membership.md +15 -0
  81. data/docs/examples/teams/create.md +15 -0
  82. data/docs/examples/teams/delete-membership.md +15 -0
  83. data/docs/examples/teams/delete.md +15 -0
  84. data/docs/examples/teams/get-memberships.md +15 -0
  85. data/docs/examples/teams/get.md +15 -0
  86. data/docs/examples/teams/list.md +15 -0
  87. data/docs/examples/teams/update-membership-roles.md +15 -0
  88. data/docs/examples/teams/update-membership-status.md +15 -0
  89. data/docs/examples/teams/update.md +15 -0
  90. data/docs/examples/users/create.md +15 -0
  91. data/docs/examples/users/delete-session.md +15 -0
  92. data/docs/examples/users/delete-sessions.md +15 -0
  93. data/docs/examples/users/delete.md +15 -0
  94. data/docs/examples/users/get-logs.md +15 -0
  95. data/docs/examples/users/get-prefs.md +15 -0
  96. data/docs/examples/users/get-sessions.md +15 -0
  97. data/docs/examples/users/get.md +15 -0
  98. data/docs/examples/users/list.md +15 -0
  99. data/docs/examples/users/update-prefs.md +15 -0
  100. data/docs/examples/users/update-status.md +15 -0
  101. data/lib/appwrite.rb +6 -0
  102. data/lib/appwrite/client.rb +43 -8
  103. data/lib/appwrite/exception.rb +14 -0
  104. data/lib/appwrite/file.rb +23 -0
  105. data/lib/appwrite/services/account.rb +190 -0
  106. data/lib/appwrite/services/avatars.rb +17 -1
  107. data/lib/appwrite/services/database.rb +20 -22
  108. data/lib/appwrite/services/functions.rb +195 -0
  109. data/lib/appwrite/services/health.rb +141 -0
  110. data/lib/appwrite/services/locale.rb +11 -0
  111. data/lib/appwrite/services/storage.rb +14 -10
  112. data/lib/appwrite/services/teams.rb +43 -10
  113. data/lib/appwrite/services/users.rb +22 -10
  114. metadata +105 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 435a9e4f801ceb45d990c57a8f5aaffdb8c4068978527c8b1d9ce619ea6a7e1c
4
- data.tar.gz: 2171bf4a196ba398f3444dbe5d53e4082fc970a97eea5d7b13560c7250411220
3
+ metadata.gz: 60c647c8e3078dfcaf45b0f34cdd816df13d2c8bece8b86c89be41264ea04933
4
+ data.tar.gz: 85d0f920c5004020948bee06cb900db62f31f15570f0153c9a15fec633169981
5
5
  SHA512:
6
- metadata.gz: 06a40d4c714c50b9ab205e90c2bfe3adcd6814c9c53193c8266c295b4559bd04e253b5cd70a4adfe801ba1141a4669e66eef6b21101fcbd4ad85294aba4a98f3
7
- data.tar.gz: dd3d40be334f7650b8664959f246063d55b2e0b8563bf0d592c64f229582fc05dc868f20194e9ed2f379f9a47d95d944bd2e2412936fc9b6bb4b1fa1ba98facc
6
+ metadata.gz: 1b12a4dd2b4ccef9fddfa8e9648cd54398d2d764c63a3e6ffcd90b3aef2812987f471b93b7cc061a3ebd988e32bb7d5eb8f78984e6e383a7a559484c58080fd5
7
+ data.tar.gz: 6338164ad49b29ccf0c6c642ba97a86206bdfac6395df959b435b4234d7c4304fce32d556fa591d8106a63b8d19cc4c1d695ab556a01979934cf769f8e51fa4f
data/.travis.yml ADDED
@@ -0,0 +1,16 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - 2.7
5
+
6
+ jobs:
7
+ include:
8
+ - stage: ruby gems release
9
+ rvm: "2.7"
10
+ script: echo "Deploying to ruby gems ..."
11
+ deploy:
12
+ provider: rubygems
13
+ api_key: $RUBYGEMS_TOKEN
14
+ gem: appwrite
15
+ on:
16
+ tags: true
data/CHANGELOG.md ADDED
@@ -0,0 +1 @@
1
+ # Change Log
data/Gemfile CHANGED
@@ -1,3 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ gem 'mime-types', '~> 3.1'
3
4
  gemspec
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors.
1
+ Copyright (c) 2021 Appwrite (https://appwrite.io) and individual contributors.
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
data/README.md CHANGED
@@ -1,13 +1,15 @@
1
- # Appwrite SDK for Ruby
1
+ # Appwrite Ruby SDK
2
2
 
3
- ![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?v=1)
4
- ![Version](https://img.shields.io/badge/api%20version-0.5.0-blue.svg?v=1)
5
-
6
- **This SDK is compatible with Appwrite server version . For older versions, please check previous releases.**
7
-
8
- Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
3
+ ![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?style=flat-square)
4
+ ![Version](https://img.shields.io/badge/api%20version-0.8.0-blue.svg?style=flat-square)
5
+ [![Twitter Account](https://img.shields.io/twitter/follow/appwrite_io?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite_io)
6
+ [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
9
7
 
8
+ **This SDK is compatible with Appwrite server version 0.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-ruby/releases).**
10
9
 
10
+ 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.
11
+ Use the Ruby SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.
12
+ For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
11
13
 
12
14
  ![Appwrite](https://appwrite.io/images/github.png)
13
15
 
@@ -19,6 +21,77 @@ To install via [Gem](https://rubygems.org/):
19
21
  gem install appwrite --save
20
22
  ```
21
23
 
24
+
25
+ ## Getting Started
26
+
27
+ ### Init your SDK
28
+ Initialize your SDK code with your project ID which can be found in your project settings page and your new API secret Key from project's API keys section.
29
+
30
+ ```ruby
31
+ require 'appwrite'
32
+
33
+ client = Appwrite::Client.new()
34
+
35
+ client
36
+ .set_endpoint(ENV["APPWRITE_ENDPOINT"]) # Your API Endpoint
37
+ .set_project(ENV["APPWRITE_PROJECT"]) # Your project ID
38
+ .set_key(ENV["APPWRITE_SECRET"]) # Your secret API key
39
+ .setSelfSigned() # Use only on dev mode with a self-signed SSL cert
40
+ ;
41
+ ```
42
+
43
+ ### Make Your First Request
44
+ Once your SDK object is set, create any of the Appwrite service objects and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the API References section.
45
+
46
+ ```ruby
47
+ users = Appwrite::Users.new(client);
48
+
49
+ result = users.create(email: 'email@example.com', password: 'password');
50
+ ```
51
+
52
+ ### Full Example
53
+ ```ruby
54
+ require 'appwrite'
55
+
56
+ client = Appwrite::Client.new()
57
+
58
+ client
59
+ .set_endpoint(ENV["APPWRITE_ENDPOINT"]) # Your API Endpoint
60
+ .set_project(ENV["APPWRITE_PROJECT"]) # Your project ID
61
+ .set_key(ENV["APPWRITE_SECRET"]) # Your secret API key
62
+ .setSelfSigned() # Use only on dev mode with a self-signed SSL cert
63
+ ;
64
+
65
+ users = Appwrite::Users.new(client);
66
+
67
+ result = users.create(email: 'email@example.com', password: 'password');
68
+ ```
69
+
70
+ ### Error Handling
71
+ The Appwrite Ruby SDK raises `Appwrite::Exception` object with `message`, `code` and `response` properties. You can handle any errors by catching `Appwrite::Exception` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example.
72
+
73
+ ```ruby
74
+ users = Appwrite::Users.new(client);
75
+
76
+ begin
77
+ result = users.create(email: 'email@example.com', password: 'password');
78
+ rescue Appwrite::Exception => error
79
+ puts error.message
80
+ end
81
+ ```
82
+
83
+ ### Learn more
84
+ You can use followng resources to learn more and get help
85
+ - 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
86
+ - 📜 [Appwrite Docs](https://appwrite.io/docs)
87
+ - 💬 [Discord Community](https://appwrite.io/discord)
88
+ - 🚂 [Appwrite Ruby Playground](https://github.com/appwrite/playground-for-ruby)
89
+
90
+
91
+ ## Contribution
92
+
93
+ This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request.
94
+
22
95
  ## License
23
96
 
24
97
  Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.
data/appwrite.gemspec CHANGED
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'appwrite'
4
- s.version = '1.0.9'
5
- s.summary = "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)"
4
+ s.version = '2.1.0'
5
+ s.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"
6
6
  s.author = 'Appwrite Team'
7
7
  s.homepage = 'https://appwrite.io/support'
8
8
  s.email = 'team@appwrite.io'
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
9
+ ;
10
+
11
+ account = Appwrite::Account.new(client);
12
+
13
+ response = account.create_recovery(email: 'email@example.com', url: 'https://example.com');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
9
+ ;
10
+
11
+ account = Appwrite::Account.new(client);
12
+
13
+ response = account.create_verification(url: 'https://example.com');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
9
+ ;
10
+
11
+ account = Appwrite::Account.new(client);
12
+
13
+ response = account.delete_session(session_id: '[SESSION_ID]');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
9
+ ;
10
+
11
+ account = Appwrite::Account.new(client);
12
+
13
+ response = account.delete_sessions();
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
9
+ ;
10
+
11
+ account = Appwrite::Account.new(client);
12
+
13
+ response = account.delete();
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
9
+ ;
10
+
11
+ account = Appwrite::Account.new(client);
12
+
13
+ response = account.get_logs();
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
9
+ ;
10
+
11
+ account = Appwrite::Account.new(client);
12
+
13
+ response = account.get_prefs();
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
9
+ ;
10
+
11
+ account = Appwrite::Account.new(client);
12
+
13
+ response = account.get_sessions();
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
9
+ ;
10
+
11
+ account = Appwrite::Account.new(client);
12
+
13
+ response = account.get();
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
9
+ ;
10
+
11
+ account = Appwrite::Account.new(client);
12
+
13
+ response = account.update_email(email: 'email@example.com', password: 'password');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
9
+ ;
10
+
11
+ account = Appwrite::Account.new(client);
12
+
13
+ response = account.update_name(name: '[NAME]');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
9
+ ;
10
+
11
+ account = Appwrite::Account.new(client);
12
+
13
+ response = account.update_password(password: 'password');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
9
+ ;
10
+
11
+ account = Appwrite::Account.new(client);
12
+
13
+ response = account.update_prefs(prefs: {});
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
9
+ ;
10
+
11
+ account = Appwrite::Account.new(client);
12
+
13
+ response = account.update_recovery(user_id: '[USER_ID]', secret: '[SECRET]', password: 'password', password_again: 'password');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
9
+ ;
10
+
11
+ account = Appwrite::Account.new(client);
12
+
13
+ response = account.update_verification(user_id: '[USER_ID]', secret: '[SECRET]');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ avatars = Appwrite::Avatars.new(client);
12
+
13
+ response = avatars.get_browser(code: 'aa');
14
+
15
+ puts response
@@ -0,0 +1,15 @@
1
+ require 'appwrite'
2
+
3
+ client = Appwrite::Client.new()
4
+
5
+ client
6
+ .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7
+ .set_project('5df5acd0d48c2') # Your project ID
8
+ .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9
+ ;
10
+
11
+ avatars = Appwrite::Avatars.new(client);
12
+
13
+ response = avatars.get_credit_card(code: 'amex');
14
+
15
+ puts response