appwrite 2.2.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +134 -57
  3. data/lib/appwrite/exception.rb +5 -7
  4. data/lib/appwrite/file.rb +5 -13
  5. data/lib/appwrite/models/attribute_boolean.rb +52 -0
  6. data/lib/appwrite/models/attribute_email.rb +57 -0
  7. data/lib/appwrite/models/attribute_enum.rb +62 -0
  8. data/lib/appwrite/models/attribute_float.rb +62 -0
  9. data/lib/appwrite/models/attribute_integer.rb +62 -0
  10. data/lib/appwrite/models/attribute_ip.rb +57 -0
  11. data/lib/appwrite/models/attribute_list.rb +32 -0
  12. data/lib/appwrite/models/attribute_string.rb +57 -0
  13. data/lib/appwrite/models/attribute_url.rb +57 -0
  14. data/lib/appwrite/models/collection.rb +62 -0
  15. data/lib/appwrite/models/collection_list.rb +32 -0
  16. data/lib/appwrite/models/continent.rb +32 -0
  17. data/lib/appwrite/models/continent_list.rb +32 -0
  18. data/lib/appwrite/models/country.rb +32 -0
  19. data/lib/appwrite/models/country_list.rb +32 -0
  20. data/lib/appwrite/models/currency.rb +57 -0
  21. data/lib/appwrite/models/currency_list.rb +32 -0
  22. data/lib/appwrite/models/document.rb +50 -0
  23. data/lib/appwrite/models/document_list.rb +36 -0
  24. data/lib/appwrite/models/execution.rb +72 -0
  25. data/lib/appwrite/models/execution_list.rb +32 -0
  26. data/lib/appwrite/models/file.rb +62 -0
  27. data/lib/appwrite/models/file_list.rb +32 -0
  28. data/lib/appwrite/models/function.rb +92 -0
  29. data/lib/appwrite/models/function_list.rb +32 -0
  30. data/lib/appwrite/models/health_antivirus.rb +32 -0
  31. data/lib/appwrite/models/health_queue.rb +27 -0
  32. data/lib/appwrite/models/health_status.rb +32 -0
  33. data/lib/appwrite/models/health_time.rb +37 -0
  34. data/lib/appwrite/models/index.rb +47 -0
  35. data/lib/appwrite/models/index_list.rb +32 -0
  36. data/lib/appwrite/models/language.rb +37 -0
  37. data/lib/appwrite/models/language_list.rb +32 -0
  38. data/lib/appwrite/models/locale.rb +57 -0
  39. data/lib/appwrite/models/log.rb +127 -0
  40. data/lib/appwrite/models/log_list.rb +32 -0
  41. data/lib/appwrite/models/membership.rb +67 -0
  42. data/lib/appwrite/models/membership_list.rb +32 -0
  43. data/lib/appwrite/models/phone.rb +37 -0
  44. data/lib/appwrite/models/phone_list.rb +32 -0
  45. data/lib/appwrite/models/preferences.rb +30 -0
  46. data/lib/appwrite/models/runtime.rb +57 -0
  47. data/lib/appwrite/models/runtime_list.rb +32 -0
  48. data/lib/appwrite/models/session.rb +132 -0
  49. data/lib/appwrite/models/session_list.rb +32 -0
  50. data/lib/appwrite/models/tag.rb +47 -0
  51. data/lib/appwrite/models/tag_list.rb +32 -0
  52. data/lib/appwrite/models/team.rb +42 -0
  53. data/lib/appwrite/models/team_list.rb +32 -0
  54. data/lib/appwrite/models/token.rb +42 -0
  55. data/lib/appwrite/models/user.rb +62 -0
  56. data/lib/appwrite/models/user_list.rb +32 -0
  57. data/lib/appwrite/query.rb +42 -0
  58. data/lib/appwrite/service.rb +0 -5
  59. data/lib/appwrite/services/account.rb +380 -133
  60. data/lib/appwrite/services/avatars.rb +189 -125
  61. data/lib/appwrite/services/database.rb +876 -130
  62. data/lib/appwrite/services/functions.rb +366 -184
  63. data/lib/appwrite/services/health.rb +202 -58
  64. data/lib/appwrite/services/locale.rb +134 -32
  65. data/lib/appwrite/services/storage.rb +211 -118
  66. data/lib/appwrite/services/teams.rb +299 -118
  67. data/lib/appwrite/services/users.rb +372 -85
  68. data/lib/appwrite.rb +55 -0
  69. metadata +72 -103
  70. data/.travis.yml +0 -16
  71. data/CHANGELOG.md +0 -1
  72. data/Gemfile +0 -4
  73. data/LICENSE +0 -12
  74. data/README.md +0 -97
  75. data/appwrite.gemspec +0 -11
  76. data/docs/examples/account/create-recovery.md +0 -15
  77. data/docs/examples/account/create-verification.md +0 -15
  78. data/docs/examples/account/delete-session.md +0 -15
  79. data/docs/examples/account/delete-sessions.md +0 -15
  80. data/docs/examples/account/delete.md +0 -15
  81. data/docs/examples/account/get-logs.md +0 -15
  82. data/docs/examples/account/get-prefs.md +0 -15
  83. data/docs/examples/account/get-sessions.md +0 -15
  84. data/docs/examples/account/get.md +0 -15
  85. data/docs/examples/account/update-email.md +0 -15
  86. data/docs/examples/account/update-name.md +0 -15
  87. data/docs/examples/account/update-password.md +0 -15
  88. data/docs/examples/account/update-prefs.md +0 -15
  89. data/docs/examples/account/update-recovery.md +0 -15
  90. data/docs/examples/account/update-verification.md +0 -15
  91. data/docs/examples/avatars/get-browser.md +0 -15
  92. data/docs/examples/avatars/get-credit-card.md +0 -15
  93. data/docs/examples/avatars/get-favicon.md +0 -15
  94. data/docs/examples/avatars/get-flag.md +0 -15
  95. data/docs/examples/avatars/get-image.md +0 -15
  96. data/docs/examples/avatars/get-initials.md +0 -15
  97. data/docs/examples/avatars/get-q-r.md +0 -15
  98. data/docs/examples/database/create-collection.md +0 -15
  99. data/docs/examples/database/create-document.md +0 -15
  100. data/docs/examples/database/delete-collection.md +0 -15
  101. data/docs/examples/database/delete-document.md +0 -15
  102. data/docs/examples/database/get-collection.md +0 -15
  103. data/docs/examples/database/get-document.md +0 -15
  104. data/docs/examples/database/list-collections.md +0 -15
  105. data/docs/examples/database/list-documents.md +0 -15
  106. data/docs/examples/database/update-collection.md +0 -15
  107. data/docs/examples/database/update-document.md +0 -15
  108. data/docs/examples/functions/create-execution.md +0 -15
  109. data/docs/examples/functions/create-tag.md +0 -15
  110. data/docs/examples/functions/create.md +0 -15
  111. data/docs/examples/functions/delete-tag.md +0 -15
  112. data/docs/examples/functions/delete.md +0 -15
  113. data/docs/examples/functions/get-execution.md +0 -15
  114. data/docs/examples/functions/get-tag.md +0 -15
  115. data/docs/examples/functions/get.md +0 -15
  116. data/docs/examples/functions/list-executions.md +0 -15
  117. data/docs/examples/functions/list-tags.md +0 -15
  118. data/docs/examples/functions/list.md +0 -15
  119. data/docs/examples/functions/update-tag.md +0 -15
  120. data/docs/examples/functions/update.md +0 -15
  121. data/docs/examples/health/get-anti-virus.md +0 -15
  122. data/docs/examples/health/get-cache.md +0 -15
  123. data/docs/examples/health/get-d-b.md +0 -15
  124. data/docs/examples/health/get-queue-certificates.md +0 -15
  125. data/docs/examples/health/get-queue-functions.md +0 -15
  126. data/docs/examples/health/get-queue-logs.md +0 -15
  127. data/docs/examples/health/get-queue-tasks.md +0 -15
  128. data/docs/examples/health/get-queue-usage.md +0 -15
  129. data/docs/examples/health/get-queue-webhooks.md +0 -15
  130. data/docs/examples/health/get-storage-local.md +0 -15
  131. data/docs/examples/health/get-time.md +0 -15
  132. data/docs/examples/health/get.md +0 -15
  133. data/docs/examples/locale/get-continents.md +0 -15
  134. data/docs/examples/locale/get-countries-e-u.md +0 -15
  135. data/docs/examples/locale/get-countries-phones.md +0 -15
  136. data/docs/examples/locale/get-countries.md +0 -15
  137. data/docs/examples/locale/get-currencies.md +0 -15
  138. data/docs/examples/locale/get-languages.md +0 -15
  139. data/docs/examples/locale/get.md +0 -15
  140. data/docs/examples/storage/create-file.md +0 -15
  141. data/docs/examples/storage/delete-file.md +0 -15
  142. data/docs/examples/storage/get-file-download.md +0 -15
  143. data/docs/examples/storage/get-file-preview.md +0 -15
  144. data/docs/examples/storage/get-file-view.md +0 -15
  145. data/docs/examples/storage/get-file.md +0 -15
  146. data/docs/examples/storage/list-files.md +0 -15
  147. data/docs/examples/storage/update-file.md +0 -15
  148. data/docs/examples/teams/create-membership.md +0 -15
  149. data/docs/examples/teams/create.md +0 -15
  150. data/docs/examples/teams/delete-membership.md +0 -15
  151. data/docs/examples/teams/delete.md +0 -15
  152. data/docs/examples/teams/get-memberships.md +0 -15
  153. data/docs/examples/teams/get.md +0 -15
  154. data/docs/examples/teams/list.md +0 -15
  155. data/docs/examples/teams/update-membership-roles.md +0 -15
  156. data/docs/examples/teams/update-membership-status.md +0 -15
  157. data/docs/examples/teams/update.md +0 -15
  158. data/docs/examples/users/create.md +0 -15
  159. data/docs/examples/users/delete-session.md +0 -15
  160. data/docs/examples/users/delete-sessions.md +0 -15
  161. data/docs/examples/users/delete.md +0 -15
  162. data/docs/examples/users/get-logs.md +0 -15
  163. data/docs/examples/users/get-prefs.md +0 -15
  164. data/docs/examples/users/get-sessions.md +0 -15
  165. data/docs/examples/users/get.md +0 -15
  166. data/docs/examples/users/list.md +0 -15
  167. data/docs/examples/users/update-prefs.md +0 -15
  168. data/docs/examples/users/update-status.md +0 -15
metadata CHANGED
@@ -1,124 +1,92 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appwrite
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Appwrite Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-07 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2022-01-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: mime-types
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 3.3.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 3.3.1
13
27
  description:
14
28
  email: team@appwrite.io
15
29
  executables: []
16
30
  extensions: []
17
31
  extra_rdoc_files: []
18
32
  files:
19
- - ".travis.yml"
20
- - CHANGELOG.md
21
- - Gemfile
22
- - LICENSE
23
- - README.md
24
- - appwrite.gemspec
25
- - docs/examples/account/create-recovery.md
26
- - docs/examples/account/create-verification.md
27
- - docs/examples/account/delete-session.md
28
- - docs/examples/account/delete-sessions.md
29
- - docs/examples/account/delete.md
30
- - docs/examples/account/get-logs.md
31
- - docs/examples/account/get-prefs.md
32
- - docs/examples/account/get-sessions.md
33
- - docs/examples/account/get.md
34
- - docs/examples/account/update-email.md
35
- - docs/examples/account/update-name.md
36
- - docs/examples/account/update-password.md
37
- - docs/examples/account/update-prefs.md
38
- - docs/examples/account/update-recovery.md
39
- - docs/examples/account/update-verification.md
40
- - docs/examples/avatars/get-browser.md
41
- - docs/examples/avatars/get-credit-card.md
42
- - docs/examples/avatars/get-favicon.md
43
- - docs/examples/avatars/get-flag.md
44
- - docs/examples/avatars/get-image.md
45
- - docs/examples/avatars/get-initials.md
46
- - docs/examples/avatars/get-q-r.md
47
- - docs/examples/database/create-collection.md
48
- - docs/examples/database/create-document.md
49
- - docs/examples/database/delete-collection.md
50
- - docs/examples/database/delete-document.md
51
- - docs/examples/database/get-collection.md
52
- - docs/examples/database/get-document.md
53
- - docs/examples/database/list-collections.md
54
- - docs/examples/database/list-documents.md
55
- - docs/examples/database/update-collection.md
56
- - docs/examples/database/update-document.md
57
- - docs/examples/functions/create-execution.md
58
- - docs/examples/functions/create-tag.md
59
- - docs/examples/functions/create.md
60
- - docs/examples/functions/delete-tag.md
61
- - docs/examples/functions/delete.md
62
- - docs/examples/functions/get-execution.md
63
- - docs/examples/functions/get-tag.md
64
- - docs/examples/functions/get.md
65
- - docs/examples/functions/list-executions.md
66
- - docs/examples/functions/list-tags.md
67
- - docs/examples/functions/list.md
68
- - docs/examples/functions/update-tag.md
69
- - docs/examples/functions/update.md
70
- - docs/examples/health/get-anti-virus.md
71
- - docs/examples/health/get-cache.md
72
- - docs/examples/health/get-d-b.md
73
- - docs/examples/health/get-queue-certificates.md
74
- - docs/examples/health/get-queue-functions.md
75
- - docs/examples/health/get-queue-logs.md
76
- - docs/examples/health/get-queue-tasks.md
77
- - docs/examples/health/get-queue-usage.md
78
- - docs/examples/health/get-queue-webhooks.md
79
- - docs/examples/health/get-storage-local.md
80
- - docs/examples/health/get-time.md
81
- - docs/examples/health/get.md
82
- - docs/examples/locale/get-continents.md
83
- - docs/examples/locale/get-countries-e-u.md
84
- - docs/examples/locale/get-countries-phones.md
85
- - docs/examples/locale/get-countries.md
86
- - docs/examples/locale/get-currencies.md
87
- - docs/examples/locale/get-languages.md
88
- - docs/examples/locale/get.md
89
- - docs/examples/storage/create-file.md
90
- - docs/examples/storage/delete-file.md
91
- - docs/examples/storage/get-file-download.md
92
- - docs/examples/storage/get-file-preview.md
93
- - docs/examples/storage/get-file-view.md
94
- - docs/examples/storage/get-file.md
95
- - docs/examples/storage/list-files.md
96
- - docs/examples/storage/update-file.md
97
- - docs/examples/teams/create-membership.md
98
- - docs/examples/teams/create.md
99
- - docs/examples/teams/delete-membership.md
100
- - docs/examples/teams/delete.md
101
- - docs/examples/teams/get-memberships.md
102
- - docs/examples/teams/get.md
103
- - docs/examples/teams/list.md
104
- - docs/examples/teams/update-membership-roles.md
105
- - docs/examples/teams/update-membership-status.md
106
- - docs/examples/teams/update.md
107
- - docs/examples/users/create.md
108
- - docs/examples/users/delete-session.md
109
- - docs/examples/users/delete-sessions.md
110
- - docs/examples/users/delete.md
111
- - docs/examples/users/get-logs.md
112
- - docs/examples/users/get-prefs.md
113
- - docs/examples/users/get-sessions.md
114
- - docs/examples/users/get.md
115
- - docs/examples/users/list.md
116
- - docs/examples/users/update-prefs.md
117
- - docs/examples/users/update-status.md
118
33
  - lib/appwrite.rb
119
34
  - lib/appwrite/client.rb
120
35
  - lib/appwrite/exception.rb
121
36
  - lib/appwrite/file.rb
37
+ - lib/appwrite/models/attribute_boolean.rb
38
+ - lib/appwrite/models/attribute_email.rb
39
+ - lib/appwrite/models/attribute_enum.rb
40
+ - lib/appwrite/models/attribute_float.rb
41
+ - lib/appwrite/models/attribute_integer.rb
42
+ - lib/appwrite/models/attribute_ip.rb
43
+ - lib/appwrite/models/attribute_list.rb
44
+ - lib/appwrite/models/attribute_string.rb
45
+ - lib/appwrite/models/attribute_url.rb
46
+ - lib/appwrite/models/collection.rb
47
+ - lib/appwrite/models/collection_list.rb
48
+ - lib/appwrite/models/continent.rb
49
+ - lib/appwrite/models/continent_list.rb
50
+ - lib/appwrite/models/country.rb
51
+ - lib/appwrite/models/country_list.rb
52
+ - lib/appwrite/models/currency.rb
53
+ - lib/appwrite/models/currency_list.rb
54
+ - lib/appwrite/models/document.rb
55
+ - lib/appwrite/models/document_list.rb
56
+ - lib/appwrite/models/execution.rb
57
+ - lib/appwrite/models/execution_list.rb
58
+ - lib/appwrite/models/file.rb
59
+ - lib/appwrite/models/file_list.rb
60
+ - lib/appwrite/models/function.rb
61
+ - lib/appwrite/models/function_list.rb
62
+ - lib/appwrite/models/health_antivirus.rb
63
+ - lib/appwrite/models/health_queue.rb
64
+ - lib/appwrite/models/health_status.rb
65
+ - lib/appwrite/models/health_time.rb
66
+ - lib/appwrite/models/index.rb
67
+ - lib/appwrite/models/index_list.rb
68
+ - lib/appwrite/models/language.rb
69
+ - lib/appwrite/models/language_list.rb
70
+ - lib/appwrite/models/locale.rb
71
+ - lib/appwrite/models/log.rb
72
+ - lib/appwrite/models/log_list.rb
73
+ - lib/appwrite/models/membership.rb
74
+ - lib/appwrite/models/membership_list.rb
75
+ - lib/appwrite/models/phone.rb
76
+ - lib/appwrite/models/phone_list.rb
77
+ - lib/appwrite/models/preferences.rb
78
+ - lib/appwrite/models/runtime.rb
79
+ - lib/appwrite/models/runtime_list.rb
80
+ - lib/appwrite/models/session.rb
81
+ - lib/appwrite/models/session_list.rb
82
+ - lib/appwrite/models/tag.rb
83
+ - lib/appwrite/models/tag_list.rb
84
+ - lib/appwrite/models/team.rb
85
+ - lib/appwrite/models/team_list.rb
86
+ - lib/appwrite/models/token.rb
87
+ - lib/appwrite/models/user.rb
88
+ - lib/appwrite/models/user_list.rb
89
+ - lib/appwrite/query.rb
122
90
  - lib/appwrite/service.rb
123
91
  - lib/appwrite/services/account.rb
124
92
  - lib/appwrite/services/avatars.rb
@@ -130,7 +98,8 @@ files:
130
98
  - lib/appwrite/services/teams.rb
131
99
  - lib/appwrite/services/users.rb
132
100
  homepage: https://appwrite.io/support
133
- licenses: []
101
+ licenses:
102
+ - BSD-3-Clause
134
103
  metadata: {}
135
104
  post_install_message:
136
105
  rdoc_options: []
data/.travis.yml DELETED
@@ -1,16 +0,0 @@
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 DELETED
@@ -1 +0,0 @@
1
- # Change Log
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'mime-types', '~> 3.1'
4
- gemspec
data/LICENSE DELETED
@@ -1,12 +0,0 @@
1
- Copyright (c) 2021 Appwrite (https://appwrite.io) and individual contributors.
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
-
6
- 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
-
8
- 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9
-
10
- 3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11
-
12
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md DELETED
@@ -1,97 +0,0 @@
1
- # Appwrite Ruby SDK
2
-
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)
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).**
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)
13
-
14
- ![Appwrite](https://appwrite.io/images/github.png)
15
-
16
- ## Installation
17
-
18
- To install via [Gem](https://rubygems.org/):
19
-
20
- ```bash
21
- gem install appwrite --save
22
- ```
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
-
95
- ## License
96
-
97
- Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.
data/appwrite.gemspec DELETED
@@ -1,11 +0,0 @@
1
- Gem::Specification.new do |s|
2
-
3
- s.name = 'appwrite'
4
- s.version = '2.2.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
- s.author = 'Appwrite Team'
7
- s.homepage = 'https://appwrite.io/support'
8
- s.email = 'team@appwrite.io'
9
- s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
10
-
11
- end
@@ -1,15 +0,0 @@
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_jwt('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
@@ -1,15 +0,0 @@
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_jwt('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
@@ -1,15 +0,0 @@
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_jwt('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
@@ -1,15 +0,0 @@
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_jwt('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
@@ -1,15 +0,0 @@
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_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
9
- ;
10
-
11
- account = Appwrite::Account.new(client);
12
-
13
- response = account.delete();
14
-
15
- puts response
@@ -1,15 +0,0 @@
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_jwt('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
@@ -1,15 +0,0 @@
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_jwt('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
@@ -1,15 +0,0 @@
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_jwt('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
@@ -1,15 +0,0 @@
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_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
9
- ;
10
-
11
- account = Appwrite::Account.new(client);
12
-
13
- response = account.get();
14
-
15
- puts response
@@ -1,15 +0,0 @@
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_jwt('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
@@ -1,15 +0,0 @@
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_jwt('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
@@ -1,15 +0,0 @@
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_jwt('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
@@ -1,15 +0,0 @@
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_jwt('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
@@ -1,15 +0,0 @@
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_jwt('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
@@ -1,15 +0,0 @@
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_jwt('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
@@ -1,15 +0,0 @@
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
@@ -1,15 +0,0 @@
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
@@ -1,15 +0,0 @@
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_favicon(url: 'https://example.com');
14
-
15
- puts response
@@ -1,15 +0,0 @@
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_flag(code: 'af');
14
-
15
- puts response