appwrite 2.4.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +197 -56
  3. data/lib/appwrite/exception.rb +7 -7
  4. data/lib/appwrite/file.rb +9 -15
  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/bucket.rb +82 -0
  15. data/lib/appwrite/models/bucket_list.rb +32 -0
  16. data/lib/appwrite/models/collection.rb +62 -0
  17. data/lib/appwrite/models/collection_list.rb +32 -0
  18. data/lib/appwrite/models/continent.rb +32 -0
  19. data/lib/appwrite/models/continent_list.rb +32 -0
  20. data/lib/appwrite/models/country.rb +32 -0
  21. data/lib/appwrite/models/country_list.rb +32 -0
  22. data/lib/appwrite/models/currency.rb +57 -0
  23. data/lib/appwrite/models/currency_list.rb +32 -0
  24. data/lib/appwrite/models/deployment.rb +77 -0
  25. data/lib/appwrite/models/deployment_list.rb +32 -0
  26. data/lib/appwrite/models/document.rb +50 -0
  27. data/lib/appwrite/models/document_list.rb +36 -0
  28. data/lib/appwrite/models/execution.rb +72 -0
  29. data/lib/appwrite/models/execution_list.rb +32 -0
  30. data/lib/appwrite/models/file.rb +77 -0
  31. data/lib/appwrite/models/file_list.rb +32 -0
  32. data/lib/appwrite/models/function.rb +92 -0
  33. data/lib/appwrite/models/function_list.rb +32 -0
  34. data/lib/appwrite/models/health_antivirus.rb +32 -0
  35. data/lib/appwrite/models/health_queue.rb +27 -0
  36. data/lib/appwrite/models/health_status.rb +32 -0
  37. data/lib/appwrite/models/health_time.rb +37 -0
  38. data/lib/appwrite/models/index.rb +47 -0
  39. data/lib/appwrite/models/index_list.rb +32 -0
  40. data/lib/appwrite/models/language.rb +37 -0
  41. data/lib/appwrite/models/language_list.rb +32 -0
  42. data/lib/appwrite/models/locale.rb +57 -0
  43. data/lib/appwrite/models/log.rb +127 -0
  44. data/lib/appwrite/models/log_list.rb +32 -0
  45. data/lib/appwrite/models/membership.rb +67 -0
  46. data/lib/appwrite/models/membership_list.rb +32 -0
  47. data/lib/appwrite/models/phone.rb +37 -0
  48. data/lib/appwrite/models/phone_list.rb +32 -0
  49. data/lib/appwrite/models/preferences.rb +30 -0
  50. data/lib/appwrite/models/runtime.rb +57 -0
  51. data/lib/appwrite/models/runtime_list.rb +32 -0
  52. data/lib/appwrite/models/session.rb +142 -0
  53. data/lib/appwrite/models/session_list.rb +32 -0
  54. data/lib/appwrite/models/team.rb +42 -0
  55. data/lib/appwrite/models/team_list.rb +32 -0
  56. data/lib/appwrite/models/token.rb +42 -0
  57. data/lib/appwrite/models/user.rb +62 -0
  58. data/lib/appwrite/models/user_list.rb +32 -0
  59. data/lib/appwrite/query.rb +42 -0
  60. data/lib/appwrite/service.rb +0 -5
  61. data/lib/appwrite/services/account.rb +400 -138
  62. data/lib/appwrite/services/avatars.rb +188 -125
  63. data/lib/appwrite/services/database.rb +875 -130
  64. data/lib/appwrite/services/functions.rb +439 -207
  65. data/lib/appwrite/services/health.rb +201 -58
  66. data/lib/appwrite/services/locale.rb +133 -32
  67. data/lib/appwrite/services/storage.rb +469 -118
  68. data/lib/appwrite/services/teams.rb +302 -118
  69. data/lib/appwrite/services/users.rb +322 -127
  70. data/lib/appwrite.rb +57 -0
  71. metadata +74 -108
  72. data/.travis.yml +0 -16
  73. data/CHANGELOG.md +0 -1
  74. data/Gemfile +0 -4
  75. data/LICENSE +0 -12
  76. data/README.md +0 -96
  77. data/appwrite.gemspec +0 -11
  78. data/docs/examples/account/create-recovery.md +0 -15
  79. data/docs/examples/account/create-verification.md +0 -15
  80. data/docs/examples/account/delete-session.md +0 -15
  81. data/docs/examples/account/delete-sessions.md +0 -15
  82. data/docs/examples/account/delete.md +0 -15
  83. data/docs/examples/account/get-logs.md +0 -15
  84. data/docs/examples/account/get-prefs.md +0 -15
  85. data/docs/examples/account/get-session.md +0 -15
  86. data/docs/examples/account/get-sessions.md +0 -15
  87. data/docs/examples/account/get.md +0 -15
  88. data/docs/examples/account/update-email.md +0 -15
  89. data/docs/examples/account/update-name.md +0 -15
  90. data/docs/examples/account/update-password.md +0 -15
  91. data/docs/examples/account/update-prefs.md +0 -15
  92. data/docs/examples/account/update-recovery.md +0 -15
  93. data/docs/examples/account/update-verification.md +0 -15
  94. data/docs/examples/avatars/get-browser.md +0 -15
  95. data/docs/examples/avatars/get-credit-card.md +0 -15
  96. data/docs/examples/avatars/get-favicon.md +0 -15
  97. data/docs/examples/avatars/get-flag.md +0 -15
  98. data/docs/examples/avatars/get-image.md +0 -15
  99. data/docs/examples/avatars/get-initials.md +0 -15
  100. data/docs/examples/avatars/get-q-r.md +0 -15
  101. data/docs/examples/database/create-collection.md +0 -15
  102. data/docs/examples/database/create-document.md +0 -15
  103. data/docs/examples/database/delete-collection.md +0 -15
  104. data/docs/examples/database/delete-document.md +0 -15
  105. data/docs/examples/database/get-collection.md +0 -15
  106. data/docs/examples/database/get-document.md +0 -15
  107. data/docs/examples/database/list-collections.md +0 -15
  108. data/docs/examples/database/list-documents.md +0 -15
  109. data/docs/examples/database/update-collection.md +0 -15
  110. data/docs/examples/database/update-document.md +0 -15
  111. data/docs/examples/functions/create-execution.md +0 -15
  112. data/docs/examples/functions/create-tag.md +0 -15
  113. data/docs/examples/functions/create.md +0 -15
  114. data/docs/examples/functions/delete-tag.md +0 -15
  115. data/docs/examples/functions/delete.md +0 -15
  116. data/docs/examples/functions/get-execution.md +0 -15
  117. data/docs/examples/functions/get-tag.md +0 -15
  118. data/docs/examples/functions/get.md +0 -15
  119. data/docs/examples/functions/list-executions.md +0 -15
  120. data/docs/examples/functions/list-tags.md +0 -15
  121. data/docs/examples/functions/list.md +0 -15
  122. data/docs/examples/functions/update-tag.md +0 -15
  123. data/docs/examples/functions/update.md +0 -15
  124. data/docs/examples/health/get-anti-virus.md +0 -15
  125. data/docs/examples/health/get-cache.md +0 -15
  126. data/docs/examples/health/get-d-b.md +0 -15
  127. data/docs/examples/health/get-queue-certificates.md +0 -15
  128. data/docs/examples/health/get-queue-functions.md +0 -15
  129. data/docs/examples/health/get-queue-logs.md +0 -15
  130. data/docs/examples/health/get-queue-tasks.md +0 -15
  131. data/docs/examples/health/get-queue-usage.md +0 -15
  132. data/docs/examples/health/get-queue-webhooks.md +0 -15
  133. data/docs/examples/health/get-storage-local.md +0 -15
  134. data/docs/examples/health/get-time.md +0 -15
  135. data/docs/examples/health/get.md +0 -15
  136. data/docs/examples/locale/get-continents.md +0 -15
  137. data/docs/examples/locale/get-countries-e-u.md +0 -15
  138. data/docs/examples/locale/get-countries-phones.md +0 -15
  139. data/docs/examples/locale/get-countries.md +0 -15
  140. data/docs/examples/locale/get-currencies.md +0 -15
  141. data/docs/examples/locale/get-languages.md +0 -15
  142. data/docs/examples/locale/get.md +0 -15
  143. data/docs/examples/storage/create-file.md +0 -15
  144. data/docs/examples/storage/delete-file.md +0 -15
  145. data/docs/examples/storage/get-file-download.md +0 -15
  146. data/docs/examples/storage/get-file-preview.md +0 -15
  147. data/docs/examples/storage/get-file-view.md +0 -15
  148. data/docs/examples/storage/get-file.md +0 -15
  149. data/docs/examples/storage/list-files.md +0 -15
  150. data/docs/examples/storage/update-file.md +0 -15
  151. data/docs/examples/teams/create-membership.md +0 -15
  152. data/docs/examples/teams/create.md +0 -15
  153. data/docs/examples/teams/delete-membership.md +0 -15
  154. data/docs/examples/teams/delete.md +0 -15
  155. data/docs/examples/teams/get-memberships.md +0 -15
  156. data/docs/examples/teams/get.md +0 -15
  157. data/docs/examples/teams/list.md +0 -15
  158. data/docs/examples/teams/update-membership-roles.md +0 -15
  159. data/docs/examples/teams/update-membership-status.md +0 -15
  160. data/docs/examples/teams/update.md +0 -15
  161. data/docs/examples/users/create.md +0 -15
  162. data/docs/examples/users/delete-session.md +0 -15
  163. data/docs/examples/users/delete-sessions.md +0 -15
  164. data/docs/examples/users/delete.md +0 -15
  165. data/docs/examples/users/get-logs.md +0 -15
  166. data/docs/examples/users/get-prefs.md +0 -15
  167. data/docs/examples/users/get-sessions.md +0 -15
  168. data/docs/examples/users/get.md +0 -15
  169. data/docs/examples/users/list.md +0 -15
  170. data/docs/examples/users/update-email.md +0 -15
  171. data/docs/examples/users/update-name.md +0 -15
  172. data/docs/examples/users/update-password.md +0 -15
  173. data/docs/examples/users/update-prefs.md +0 -15
  174. data/docs/examples/users/update-status.md +0 -15
  175. data/docs/examples/users/update-verification.md +0 -15
metadata CHANGED
@@ -1,129 +1,94 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appwrite
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 4.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-09-02 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2022-03-03 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.4.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.4.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-session.md
33
- - docs/examples/account/get-sessions.md
34
- - docs/examples/account/get.md
35
- - docs/examples/account/update-email.md
36
- - docs/examples/account/update-name.md
37
- - docs/examples/account/update-password.md
38
- - docs/examples/account/update-prefs.md
39
- - docs/examples/account/update-recovery.md
40
- - docs/examples/account/update-verification.md
41
- - docs/examples/avatars/get-browser.md
42
- - docs/examples/avatars/get-credit-card.md
43
- - docs/examples/avatars/get-favicon.md
44
- - docs/examples/avatars/get-flag.md
45
- - docs/examples/avatars/get-image.md
46
- - docs/examples/avatars/get-initials.md
47
- - docs/examples/avatars/get-q-r.md
48
- - docs/examples/database/create-collection.md
49
- - docs/examples/database/create-document.md
50
- - docs/examples/database/delete-collection.md
51
- - docs/examples/database/delete-document.md
52
- - docs/examples/database/get-collection.md
53
- - docs/examples/database/get-document.md
54
- - docs/examples/database/list-collections.md
55
- - docs/examples/database/list-documents.md
56
- - docs/examples/database/update-collection.md
57
- - docs/examples/database/update-document.md
58
- - docs/examples/functions/create-execution.md
59
- - docs/examples/functions/create-tag.md
60
- - docs/examples/functions/create.md
61
- - docs/examples/functions/delete-tag.md
62
- - docs/examples/functions/delete.md
63
- - docs/examples/functions/get-execution.md
64
- - docs/examples/functions/get-tag.md
65
- - docs/examples/functions/get.md
66
- - docs/examples/functions/list-executions.md
67
- - docs/examples/functions/list-tags.md
68
- - docs/examples/functions/list.md
69
- - docs/examples/functions/update-tag.md
70
- - docs/examples/functions/update.md
71
- - docs/examples/health/get-anti-virus.md
72
- - docs/examples/health/get-cache.md
73
- - docs/examples/health/get-d-b.md
74
- - docs/examples/health/get-queue-certificates.md
75
- - docs/examples/health/get-queue-functions.md
76
- - docs/examples/health/get-queue-logs.md
77
- - docs/examples/health/get-queue-tasks.md
78
- - docs/examples/health/get-queue-usage.md
79
- - docs/examples/health/get-queue-webhooks.md
80
- - docs/examples/health/get-storage-local.md
81
- - docs/examples/health/get-time.md
82
- - docs/examples/health/get.md
83
- - docs/examples/locale/get-continents.md
84
- - docs/examples/locale/get-countries-e-u.md
85
- - docs/examples/locale/get-countries-phones.md
86
- - docs/examples/locale/get-countries.md
87
- - docs/examples/locale/get-currencies.md
88
- - docs/examples/locale/get-languages.md
89
- - docs/examples/locale/get.md
90
- - docs/examples/storage/create-file.md
91
- - docs/examples/storage/delete-file.md
92
- - docs/examples/storage/get-file-download.md
93
- - docs/examples/storage/get-file-preview.md
94
- - docs/examples/storage/get-file-view.md
95
- - docs/examples/storage/get-file.md
96
- - docs/examples/storage/list-files.md
97
- - docs/examples/storage/update-file.md
98
- - docs/examples/teams/create-membership.md
99
- - docs/examples/teams/create.md
100
- - docs/examples/teams/delete-membership.md
101
- - docs/examples/teams/delete.md
102
- - docs/examples/teams/get-memberships.md
103
- - docs/examples/teams/get.md
104
- - docs/examples/teams/list.md
105
- - docs/examples/teams/update-membership-roles.md
106
- - docs/examples/teams/update-membership-status.md
107
- - docs/examples/teams/update.md
108
- - docs/examples/users/create.md
109
- - docs/examples/users/delete-session.md
110
- - docs/examples/users/delete-sessions.md
111
- - docs/examples/users/delete.md
112
- - docs/examples/users/get-logs.md
113
- - docs/examples/users/get-prefs.md
114
- - docs/examples/users/get-sessions.md
115
- - docs/examples/users/get.md
116
- - docs/examples/users/list.md
117
- - docs/examples/users/update-email.md
118
- - docs/examples/users/update-name.md
119
- - docs/examples/users/update-password.md
120
- - docs/examples/users/update-prefs.md
121
- - docs/examples/users/update-status.md
122
- - docs/examples/users/update-verification.md
123
33
  - lib/appwrite.rb
124
34
  - lib/appwrite/client.rb
125
35
  - lib/appwrite/exception.rb
126
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/bucket.rb
47
+ - lib/appwrite/models/bucket_list.rb
48
+ - lib/appwrite/models/collection.rb
49
+ - lib/appwrite/models/collection_list.rb
50
+ - lib/appwrite/models/continent.rb
51
+ - lib/appwrite/models/continent_list.rb
52
+ - lib/appwrite/models/country.rb
53
+ - lib/appwrite/models/country_list.rb
54
+ - lib/appwrite/models/currency.rb
55
+ - lib/appwrite/models/currency_list.rb
56
+ - lib/appwrite/models/deployment.rb
57
+ - lib/appwrite/models/deployment_list.rb
58
+ - lib/appwrite/models/document.rb
59
+ - lib/appwrite/models/document_list.rb
60
+ - lib/appwrite/models/execution.rb
61
+ - lib/appwrite/models/execution_list.rb
62
+ - lib/appwrite/models/file.rb
63
+ - lib/appwrite/models/file_list.rb
64
+ - lib/appwrite/models/function.rb
65
+ - lib/appwrite/models/function_list.rb
66
+ - lib/appwrite/models/health_antivirus.rb
67
+ - lib/appwrite/models/health_queue.rb
68
+ - lib/appwrite/models/health_status.rb
69
+ - lib/appwrite/models/health_time.rb
70
+ - lib/appwrite/models/index.rb
71
+ - lib/appwrite/models/index_list.rb
72
+ - lib/appwrite/models/language.rb
73
+ - lib/appwrite/models/language_list.rb
74
+ - lib/appwrite/models/locale.rb
75
+ - lib/appwrite/models/log.rb
76
+ - lib/appwrite/models/log_list.rb
77
+ - lib/appwrite/models/membership.rb
78
+ - lib/appwrite/models/membership_list.rb
79
+ - lib/appwrite/models/phone.rb
80
+ - lib/appwrite/models/phone_list.rb
81
+ - lib/appwrite/models/preferences.rb
82
+ - lib/appwrite/models/runtime.rb
83
+ - lib/appwrite/models/runtime_list.rb
84
+ - lib/appwrite/models/session.rb
85
+ - lib/appwrite/models/session_list.rb
86
+ - lib/appwrite/models/team.rb
87
+ - lib/appwrite/models/team_list.rb
88
+ - lib/appwrite/models/token.rb
89
+ - lib/appwrite/models/user.rb
90
+ - lib/appwrite/models/user_list.rb
91
+ - lib/appwrite/query.rb
127
92
  - lib/appwrite/service.rb
128
93
  - lib/appwrite/services/account.rb
129
94
  - lib/appwrite/services/avatars.rb
@@ -135,7 +100,8 @@ files:
135
100
  - lib/appwrite/services/teams.rb
136
101
  - lib/appwrite/services/users.rb
137
102
  homepage: https://appwrite.io/support
138
- licenses: []
103
+ licenses:
104
+ - BSD-3-Clause
139
105
  metadata: {}
140
106
  post_install_message:
141
107
  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.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,96 +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.10.0-blue.svg?style=flat-square)
5
- [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
6
- [![Twitter Account](https://img.shields.io/twitter/follow/appwrite_io?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite_io)
7
- [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
8
-
9
- **This SDK is compatible with Appwrite server version 0.10.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-ruby/releases).**
10
-
11
- 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)
12
-
13
- ![Appwrite](https://appwrite.io/images/github.png)
14
-
15
- ## Installation
16
-
17
- To install via [Gem](https://rubygems.org/):
18
-
19
- ```bash
20
- gem install appwrite --save
21
- ```
22
-
23
-
24
- ## Getting Started
25
-
26
- ### Init your SDK
27
- Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page and your new API secret Key from project's API keys section.
28
-
29
- ```ruby
30
- require 'appwrite'
31
-
32
- client = Appwrite::Client.new()
33
-
34
- client
35
- .set_endpoint(ENV["APPWRITE_ENDPOINT"]) # Your API Endpoint
36
- .set_project(ENV["APPWRITE_PROJECT"]) # Your project ID
37
- .set_key(ENV["APPWRITE_SECRET"]) # Your secret API key
38
- .setSelfSigned() # Use only on dev mode with a self-signed SSL cert
39
- ;
40
- ```
41
-
42
- ### Make Your First Request
43
- 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](https://appwrite.io/docs) section.
44
-
45
- ```ruby
46
- users = Appwrite::Users.new(client);
47
-
48
- result = users.create(email: 'email@example.com', password: 'password');
49
- ```
50
-
51
- ### Full Example
52
- ```ruby
53
- require 'appwrite'
54
-
55
- client = Appwrite::Client.new()
56
-
57
- client
58
- .set_endpoint(ENV["APPWRITE_ENDPOINT"]) # Your API Endpoint
59
- .set_project(ENV["APPWRITE_PROJECT"]) # Your project ID
60
- .set_key(ENV["APPWRITE_SECRET"]) # Your secret API key
61
- .setSelfSigned() # Use only on dev mode with a self-signed SSL cert
62
- ;
63
-
64
- users = Appwrite::Users.new(client);
65
-
66
- result = users.create(email: 'email@example.com', password: 'password');
67
- ```
68
-
69
- ### Error Handling
70
- 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.
71
-
72
- ```ruby
73
- users = Appwrite::Users.new(client);
74
-
75
- begin
76
- result = users.create(email: 'email@example.com', password: 'password');
77
- rescue Appwrite::Exception => error
78
- puts error.message
79
- end
80
- ```
81
-
82
- ### Learn more
83
- You can use the following resources to learn more and get help
84
- - 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
85
- - 📜 [Appwrite Docs](https://appwrite.io/docs)
86
- - 💬 [Discord Community](https://appwrite.io/discord)
87
- - 🚂 [Appwrite Ruby Playground](https://github.com/appwrite/playground-for-ruby)
88
-
89
-
90
- ## Contribution
91
-
92
- 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.
93
-
94
- ## License
95
-
96
- 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.4.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_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.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