appwrite 8.0.0 → 9.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +4 -4
  3. data/lib/appwrite/models/attribute_boolean.rb +5 -0
  4. data/lib/appwrite/models/attribute_datetime.rb +5 -0
  5. data/lib/appwrite/models/attribute_email.rb +5 -0
  6. data/lib/appwrite/models/attribute_enum.rb +5 -0
  7. data/lib/appwrite/models/attribute_float.rb +5 -0
  8. data/lib/appwrite/models/attribute_integer.rb +5 -0
  9. data/lib/appwrite/models/attribute_ip.rb +5 -0
  10. data/lib/appwrite/models/attribute_relationship.rb +5 -0
  11. data/lib/appwrite/models/attribute_string.rb +5 -0
  12. data/lib/appwrite/models/attribute_url.rb +5 -0
  13. data/lib/appwrite/models/database.rb +8 -3
  14. data/lib/appwrite/models/deployment.rb +63 -13
  15. data/lib/appwrite/models/execution.rb +40 -20
  16. data/lib/appwrite/models/function.rb +53 -13
  17. data/lib/appwrite/models/headers.rb +32 -0
  18. data/lib/appwrite/models/health_status.rb +5 -0
  19. data/lib/appwrite/models/identity.rb +72 -0
  20. data/lib/appwrite/models/identity_list.rb +32 -0
  21. data/lib/appwrite/models/index.rb +5 -0
  22. data/lib/appwrite/models/locale_code.rb +32 -0
  23. data/lib/appwrite/models/locale_code_list.rb +32 -0
  24. data/lib/appwrite/models/user.rb +13 -3
  25. data/lib/appwrite/models/variable.rb +10 -5
  26. data/lib/appwrite/role.rb +56 -0
  27. data/lib/appwrite/services/account.rb +185 -130
  28. data/lib/appwrite/services/avatars.rb +42 -42
  29. data/lib/appwrite/services/databases.rb +274 -262
  30. data/lib/appwrite/services/functions.rb +229 -143
  31. data/lib/appwrite/services/graphql.rb +12 -12
  32. data/lib/appwrite/services/health.rb +111 -62
  33. data/lib/appwrite/services/locale.rb +67 -42
  34. data/lib/appwrite/services/storage.rb +85 -83
  35. data/lib/appwrite/services/teams.rb +80 -79
  36. data/lib/appwrite/services/users.rb +248 -150
  37. data/lib/appwrite.rb +5 -0
  38. metadata +7 -2
@@ -13,26 +13,26 @@ module Appwrite
13
13
  #
14
14
  # @return [Any]
15
15
  def query(query:)
16
- path = '/graphql'
16
+ api_path = '/graphql'
17
17
 
18
18
  if query.nil?
19
19
  raise Appwrite::Exception.new('Missing required parameter: "query"')
20
20
  end
21
21
 
22
- params = {
22
+ api_params = {
23
23
  query: query,
24
24
  }
25
25
 
26
- headers = {
26
+ api_headers = {
27
27
  "x-sdk-graphql": 'true',
28
28
  "content-type": 'application/json',
29
29
  }
30
30
 
31
31
  @client.call(
32
32
  method: 'POST',
33
- path: path,
34
- headers: headers,
35
- params: params,
33
+ path: api_path,
34
+ headers: api_headers,
35
+ params: api_params,
36
36
  )
37
37
  end
38
38
 
@@ -43,26 +43,26 @@ module Appwrite
43
43
  #
44
44
  # @return [Any]
45
45
  def mutation(query:)
46
- path = '/graphql/mutation'
46
+ api_path = '/graphql/mutation'
47
47
 
48
48
  if query.nil?
49
49
  raise Appwrite::Exception.new('Missing required parameter: "query"')
50
50
  end
51
51
 
52
- params = {
52
+ api_params = {
53
53
  query: query,
54
54
  }
55
55
 
56
- headers = {
56
+ api_headers = {
57
57
  "x-sdk-graphql": 'true',
58
58
  "content-type": 'application/json',
59
59
  }
60
60
 
61
61
  @client.call(
62
62
  method: 'POST',
63
- path: path,
64
- headers: headers,
65
- params: params,
63
+ path: api_path,
64
+ headers: api_headers,
65
+ params: api_params,
66
66
  )
67
67
  end
68
68
 
@@ -12,20 +12,20 @@ module Appwrite
12
12
  #
13
13
  # @return [HealthStatus]
14
14
  def get()
15
- path = '/health'
15
+ api_path = '/health'
16
16
 
17
- params = {
17
+ api_params = {
18
18
  }
19
19
 
20
- headers = {
20
+ api_headers = {
21
21
  "content-type": 'application/json',
22
22
  }
23
23
 
24
24
  @client.call(
25
25
  method: 'GET',
26
- path: path,
27
- headers: headers,
28
- params: params,
26
+ path: api_path,
27
+ headers: api_headers,
28
+ params: api_params,
29
29
  response_type: Models::HealthStatus
30
30
  )
31
31
  end
@@ -36,69 +36,118 @@ module Appwrite
36
36
  #
37
37
  # @return [HealthAntivirus]
38
38
  def get_antivirus()
39
- path = '/health/anti-virus'
39
+ api_path = '/health/anti-virus'
40
40
 
41
- params = {
41
+ api_params = {
42
42
  }
43
43
 
44
- headers = {
44
+ api_headers = {
45
45
  "content-type": 'application/json',
46
46
  }
47
47
 
48
48
  @client.call(
49
49
  method: 'GET',
50
- path: path,
51
- headers: headers,
52
- params: params,
50
+ path: api_path,
51
+ headers: api_headers,
52
+ params: api_params,
53
53
  response_type: Models::HealthAntivirus
54
54
  )
55
55
  end
56
56
 
57
57
 
58
- # Check the Appwrite in-memory cache server is up and connection is
58
+ # Check the Appwrite in-memory cache servers are up and connection is
59
59
  # successful.
60
60
  #
61
61
  #
62
62
  # @return [HealthStatus]
63
63
  def get_cache()
64
- path = '/health/cache'
64
+ api_path = '/health/cache'
65
65
 
66
- params = {
66
+ api_params = {
67
67
  }
68
68
 
69
- headers = {
69
+ api_headers = {
70
70
  "content-type": 'application/json',
71
71
  }
72
72
 
73
73
  @client.call(
74
74
  method: 'GET',
75
- path: path,
76
- headers: headers,
77
- params: params,
75
+ path: api_path,
76
+ headers: api_headers,
77
+ params: api_params,
78
78
  response_type: Models::HealthStatus
79
79
  )
80
80
  end
81
81
 
82
82
 
83
- # Check the Appwrite database server is up and connection is successful.
83
+ # Check the Appwrite database servers are up and connection is successful.
84
84
  #
85
85
  #
86
86
  # @return [HealthStatus]
87
87
  def get_db()
88
- path = '/health/db'
88
+ api_path = '/health/db'
89
89
 
90
- params = {
90
+ api_params = {
91
91
  }
92
92
 
93
- headers = {
93
+ api_headers = {
94
94
  "content-type": 'application/json',
95
95
  }
96
96
 
97
97
  @client.call(
98
98
  method: 'GET',
99
- path: path,
100
- headers: headers,
101
- params: params,
99
+ path: api_path,
100
+ headers: api_headers,
101
+ params: api_params,
102
+ response_type: Models::HealthStatus
103
+ )
104
+ end
105
+
106
+
107
+ # Check the Appwrite pub-sub servers are up and connection is successful.
108
+ #
109
+ #
110
+ # @return [HealthStatus]
111
+ def get_pub_sub()
112
+ api_path = '/health/pubsub'
113
+
114
+ api_params = {
115
+ }
116
+
117
+ api_headers = {
118
+ "content-type": 'application/json',
119
+ }
120
+
121
+ @client.call(
122
+ method: 'GET',
123
+ path: api_path,
124
+ headers: api_headers,
125
+ params: api_params,
126
+ response_type: Models::HealthStatus
127
+ )
128
+ end
129
+
130
+
131
+ # Check the Appwrite queue messaging servers are up and connection is
132
+ # successful.
133
+ #
134
+ #
135
+ # @return [HealthStatus]
136
+ def get_queue()
137
+ api_path = '/health/queue'
138
+
139
+ api_params = {
140
+ }
141
+
142
+ api_headers = {
143
+ "content-type": 'application/json',
144
+ }
145
+
146
+ @client.call(
147
+ method: 'GET',
148
+ path: api_path,
149
+ headers: api_headers,
150
+ params: api_params,
102
151
  response_type: Models::HealthStatus
103
152
  )
104
153
  end
@@ -111,20 +160,20 @@ module Appwrite
111
160
  #
112
161
  # @return [HealthQueue]
113
162
  def get_queue_certificates()
114
- path = '/health/queue/certificates'
163
+ api_path = '/health/queue/certificates'
115
164
 
116
- params = {
165
+ api_params = {
117
166
  }
118
167
 
119
- headers = {
168
+ api_headers = {
120
169
  "content-type": 'application/json',
121
170
  }
122
171
 
123
172
  @client.call(
124
173
  method: 'GET',
125
- path: path,
126
- headers: headers,
127
- params: params,
174
+ path: api_path,
175
+ headers: api_headers,
176
+ params: api_params,
128
177
  response_type: Models::HealthQueue
129
178
  )
130
179
  end
@@ -135,20 +184,20 @@ module Appwrite
135
184
  #
136
185
  # @return [HealthQueue]
137
186
  def get_queue_functions()
138
- path = '/health/queue/functions'
187
+ api_path = '/health/queue/functions'
139
188
 
140
- params = {
189
+ api_params = {
141
190
  }
142
191
 
143
- headers = {
192
+ api_headers = {
144
193
  "content-type": 'application/json',
145
194
  }
146
195
 
147
196
  @client.call(
148
197
  method: 'GET',
149
- path: path,
150
- headers: headers,
151
- params: params,
198
+ path: api_path,
199
+ headers: api_headers,
200
+ params: api_params,
152
201
  response_type: Models::HealthQueue
153
202
  )
154
203
  end
@@ -160,20 +209,20 @@ module Appwrite
160
209
  #
161
210
  # @return [HealthQueue]
162
211
  def get_queue_logs()
163
- path = '/health/queue/logs'
212
+ api_path = '/health/queue/logs'
164
213
 
165
- params = {
214
+ api_params = {
166
215
  }
167
216
 
168
- headers = {
217
+ api_headers = {
169
218
  "content-type": 'application/json',
170
219
  }
171
220
 
172
221
  @client.call(
173
222
  method: 'GET',
174
- path: path,
175
- headers: headers,
176
- params: params,
223
+ path: api_path,
224
+ headers: api_headers,
225
+ params: api_params,
177
226
  response_type: Models::HealthQueue
178
227
  )
179
228
  end
@@ -185,20 +234,20 @@ module Appwrite
185
234
  #
186
235
  # @return [HealthQueue]
187
236
  def get_queue_webhooks()
188
- path = '/health/queue/webhooks'
237
+ api_path = '/health/queue/webhooks'
189
238
 
190
- params = {
239
+ api_params = {
191
240
  }
192
241
 
193
- headers = {
242
+ api_headers = {
194
243
  "content-type": 'application/json',
195
244
  }
196
245
 
197
246
  @client.call(
198
247
  method: 'GET',
199
- path: path,
200
- headers: headers,
201
- params: params,
248
+ path: api_path,
249
+ headers: api_headers,
250
+ params: api_params,
202
251
  response_type: Models::HealthQueue
203
252
  )
204
253
  end
@@ -209,20 +258,20 @@ module Appwrite
209
258
  #
210
259
  # @return [HealthStatus]
211
260
  def get_storage_local()
212
- path = '/health/storage/local'
261
+ api_path = '/health/storage/local'
213
262
 
214
- params = {
263
+ api_params = {
215
264
  }
216
265
 
217
- headers = {
266
+ api_headers = {
218
267
  "content-type": 'application/json',
219
268
  }
220
269
 
221
270
  @client.call(
222
271
  method: 'GET',
223
- path: path,
224
- headers: headers,
225
- params: params,
272
+ path: api_path,
273
+ headers: api_headers,
274
+ params: api_params,
226
275
  response_type: Models::HealthStatus
227
276
  )
228
277
  end
@@ -239,20 +288,20 @@ module Appwrite
239
288
  #
240
289
  # @return [HealthTime]
241
290
  def get_time()
242
- path = '/health/time'
291
+ api_path = '/health/time'
243
292
 
244
- params = {
293
+ api_params = {
245
294
  }
246
295
 
247
- headers = {
296
+ api_headers = {
248
297
  "content-type": 'application/json',
249
298
  }
250
299
 
251
300
  @client.call(
252
301
  method: 'GET',
253
- path: path,
254
- headers: headers,
255
- params: params,
302
+ path: api_path,
303
+ headers: api_headers,
304
+ params: api_params,
256
305
  response_type: Models::HealthTime
257
306
  )
258
307
  end
@@ -17,45 +17,70 @@ module Appwrite
17
17
  #
18
18
  # @return [Locale]
19
19
  def get()
20
- path = '/locale'
20
+ api_path = '/locale'
21
21
 
22
- params = {
22
+ api_params = {
23
23
  }
24
24
 
25
- headers = {
25
+ api_headers = {
26
26
  "content-type": 'application/json',
27
27
  }
28
28
 
29
29
  @client.call(
30
30
  method: 'GET',
31
- path: path,
32
- headers: headers,
33
- params: params,
31
+ path: api_path,
32
+ headers: api_headers,
33
+ params: api_params,
34
34
  response_type: Models::Locale
35
35
  )
36
36
  end
37
37
 
38
38
 
39
+ # List of all locale codes in [ISO
40
+ # 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
41
+ #
42
+ #
43
+ # @return [LocaleCodeList]
44
+ def list_codes()
45
+ api_path = '/locale/codes'
46
+
47
+ api_params = {
48
+ }
49
+
50
+ api_headers = {
51
+ "content-type": 'application/json',
52
+ }
53
+
54
+ @client.call(
55
+ method: 'GET',
56
+ path: api_path,
57
+ headers: api_headers,
58
+ params: api_params,
59
+ response_type: Models::LocaleCodeList
60
+ )
61
+ end
62
+
63
+
39
64
  # List of all continents. You can use the locale header to get the data in a
40
65
  # supported language.
41
66
  #
42
67
  #
43
68
  # @return [ContinentList]
44
69
  def list_continents()
45
- path = '/locale/continents'
70
+ api_path = '/locale/continents'
46
71
 
47
- params = {
72
+ api_params = {
48
73
  }
49
74
 
50
- headers = {
75
+ api_headers = {
51
76
  "content-type": 'application/json',
52
77
  }
53
78
 
54
79
  @client.call(
55
80
  method: 'GET',
56
- path: path,
57
- headers: headers,
58
- params: params,
81
+ path: api_path,
82
+ headers: api_headers,
83
+ params: api_params,
59
84
  response_type: Models::ContinentList
60
85
  )
61
86
  end
@@ -67,20 +92,20 @@ module Appwrite
67
92
  #
68
93
  # @return [CountryList]
69
94
  def list_countries()
70
- path = '/locale/countries'
95
+ api_path = '/locale/countries'
71
96
 
72
- params = {
97
+ api_params = {
73
98
  }
74
99
 
75
- headers = {
100
+ api_headers = {
76
101
  "content-type": 'application/json',
77
102
  }
78
103
 
79
104
  @client.call(
80
105
  method: 'GET',
81
- path: path,
82
- headers: headers,
83
- params: params,
106
+ path: api_path,
107
+ headers: api_headers,
108
+ params: api_params,
84
109
  response_type: Models::CountryList
85
110
  )
86
111
  end
@@ -92,20 +117,20 @@ module Appwrite
92
117
  #
93
118
  # @return [CountryList]
94
119
  def list_countries_eu()
95
- path = '/locale/countries/eu'
120
+ api_path = '/locale/countries/eu'
96
121
 
97
- params = {
122
+ api_params = {
98
123
  }
99
124
 
100
- headers = {
125
+ api_headers = {
101
126
  "content-type": 'application/json',
102
127
  }
103
128
 
104
129
  @client.call(
105
130
  method: 'GET',
106
- path: path,
107
- headers: headers,
108
- params: params,
131
+ path: api_path,
132
+ headers: api_headers,
133
+ params: api_params,
109
134
  response_type: Models::CountryList
110
135
  )
111
136
  end
@@ -117,20 +142,20 @@ module Appwrite
117
142
  #
118
143
  # @return [PhoneList]
119
144
  def list_countries_phones()
120
- path = '/locale/countries/phones'
145
+ api_path = '/locale/countries/phones'
121
146
 
122
- params = {
147
+ api_params = {
123
148
  }
124
149
 
125
- headers = {
150
+ api_headers = {
126
151
  "content-type": 'application/json',
127
152
  }
128
153
 
129
154
  @client.call(
130
155
  method: 'GET',
131
- path: path,
132
- headers: headers,
133
- params: params,
156
+ path: api_path,
157
+ headers: api_headers,
158
+ params: api_params,
134
159
  response_type: Models::PhoneList
135
160
  )
136
161
  end
@@ -143,20 +168,20 @@ module Appwrite
143
168
  #
144
169
  # @return [CurrencyList]
145
170
  def list_currencies()
146
- path = '/locale/currencies'
171
+ api_path = '/locale/currencies'
147
172
 
148
- params = {
173
+ api_params = {
149
174
  }
150
175
 
151
- headers = {
176
+ api_headers = {
152
177
  "content-type": 'application/json',
153
178
  }
154
179
 
155
180
  @client.call(
156
181
  method: 'GET',
157
- path: path,
158
- headers: headers,
159
- params: params,
182
+ path: api_path,
183
+ headers: api_headers,
184
+ params: api_params,
160
185
  response_type: Models::CurrencyList
161
186
  )
162
187
  end
@@ -168,20 +193,20 @@ module Appwrite
168
193
  #
169
194
  # @return [LanguageList]
170
195
  def list_languages()
171
- path = '/locale/languages'
196
+ api_path = '/locale/languages'
172
197
 
173
- params = {
198
+ api_params = {
174
199
  }
175
200
 
176
- headers = {
201
+ api_headers = {
177
202
  "content-type": 'application/json',
178
203
  }
179
204
 
180
205
  @client.call(
181
206
  method: 'GET',
182
- path: path,
183
- headers: headers,
184
- params: params,
207
+ path: api_path,
208
+ headers: api_headers,
209
+ params: api_params,
185
210
  response_type: Models::LanguageList
186
211
  )
187
212
  end