appwrite 25.0.0 → 26.0.0

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 (74) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +36 -6
  3. data/lib/appwrite/enums/billing_plan_group.rb +9 -0
  4. data/lib/appwrite/enums/database_status.rb +9 -0
  5. data/lib/appwrite/enums/o_auth2_oidc_prompt.rb +10 -0
  6. data/lib/appwrite/enums/o_auth_provider.rb +1 -0
  7. data/lib/appwrite/enums/organization_key_scopes.rb +4 -0
  8. data/lib/appwrite/enums/project_key_scopes.rb +9 -2
  9. data/lib/appwrite/enums/project_o_auth2_oidc_prompt.rb +10 -0
  10. data/lib/appwrite/enums/project_o_auth_provider_id.rb +1 -0
  11. data/lib/appwrite/enums/project_policy_id.rb +2 -0
  12. data/lib/appwrite/enums/project_service_id.rb +1 -0
  13. data/lib/appwrite/models/activity_event.rb +3 -73
  14. data/lib/appwrite/models/additional_resource.rb +52 -0
  15. data/lib/appwrite/models/backup_policy.rb +5 -0
  16. data/lib/appwrite/models/billing_plan.rb +379 -0
  17. data/lib/appwrite/models/billing_plan_addon.rb +32 -0
  18. data/lib/appwrite/models/billing_plan_addon_details.rb +62 -0
  19. data/lib/appwrite/models/billing_plan_dedicated_database_limits.rb +117 -0
  20. data/lib/appwrite/models/billing_plan_limits.rb +32 -0
  21. data/lib/appwrite/models/billing_plan_supported_addons.rb +37 -0
  22. data/lib/appwrite/models/block.rb +5 -0
  23. data/lib/appwrite/models/database.rb +19 -0
  24. data/lib/appwrite/models/locale.rb +58 -3
  25. data/lib/appwrite/models/membership.rb +5 -0
  26. data/lib/appwrite/models/o_auth2_appwrite.rb +42 -0
  27. data/lib/appwrite/models/o_auth2_oidc.rb +13 -3
  28. data/lib/appwrite/models/organization.rb +197 -0
  29. data/lib/appwrite/models/policy_deny_corporate_email.rb +32 -0
  30. data/lib/appwrite/models/policy_membership_privacy.rb +8 -3
  31. data/lib/appwrite/models/policy_password_strength.rb +52 -0
  32. data/lib/appwrite/models/program.rb +67 -0
  33. data/lib/appwrite/models/project.rb +93 -13
  34. data/lib/appwrite/models/usage_billing_plan.rb +77 -0
  35. data/lib/appwrite/models/user.rb +25 -0
  36. data/lib/appwrite/query.rb +13 -1
  37. data/lib/appwrite/services/account.rb +88 -2
  38. data/lib/appwrite/services/activities.rb +4 -0
  39. data/lib/appwrite/services/advisor.rb +9 -0
  40. data/lib/appwrite/services/avatars.rb +16 -0
  41. data/lib/appwrite/services/backups.rb +37 -1
  42. data/lib/appwrite/services/databases.rb +178 -0
  43. data/lib/appwrite/services/functions.rb +56 -4
  44. data/lib/appwrite/services/graphql.rb +4 -0
  45. data/lib/appwrite/services/locale.rb +16 -0
  46. data/lib/appwrite/services/messaging.rb +188 -132
  47. data/lib/appwrite/services/organization.rb +278 -3
  48. data/lib/appwrite/services/presences.rb +9 -0
  49. data/lib/appwrite/services/project.rb +417 -49
  50. data/lib/appwrite/services/proxy.rb +15 -0
  51. data/lib/appwrite/services/sites.rb +50 -1
  52. data/lib/appwrite/services/storage.rb +24 -0
  53. data/lib/appwrite/services/tables_db.rb +139 -1
  54. data/lib/appwrite/services/teams.rb +24 -0
  55. data/lib/appwrite/services/tokens.rb +9 -0
  56. data/lib/appwrite/services/users.rb +81 -1
  57. data/lib/appwrite/services/webhooks.rb +11 -0
  58. data/lib/appwrite.rb +17 -15
  59. metadata +19 -17
  60. data/lib/appwrite/enums/health_antivirus_status.rb +0 -9
  61. data/lib/appwrite/enums/health_check_status.rb +0 -8
  62. data/lib/appwrite/enums/health_queue_name.rb +0 -19
  63. data/lib/appwrite/models/health_antivirus.rb +0 -49
  64. data/lib/appwrite/models/health_certificate.rb +0 -52
  65. data/lib/appwrite/models/health_queue.rb +0 -27
  66. data/lib/appwrite/models/health_status.rb +0 -53
  67. data/lib/appwrite/models/health_status_list.rb +0 -32
  68. data/lib/appwrite/models/health_time.rb +0 -37
  69. data/lib/appwrite/models/usage_event.rb +0 -72
  70. data/lib/appwrite/models/usage_event_list.rb +0 -32
  71. data/lib/appwrite/models/usage_gauge.rb +0 -47
  72. data/lib/appwrite/models/usage_gauge_list.rb +0 -32
  73. data/lib/appwrite/services/health.rb +0 -630
  74. data/lib/appwrite/services/usage.rb +0 -86
@@ -7,6 +7,88 @@ module Appwrite
7
7
  @client = client
8
8
  end
9
9
 
10
+ # Get the current organization.
11
+ #
12
+ #
13
+ # @return [Organization]
14
+ def get()
15
+ api_path = '/organization'
16
+
17
+ api_params = {
18
+ }
19
+
20
+ api_headers = {
21
+ "X-Appwrite-Project": @client.get_config('project'),
22
+ "accept": 'application/json',
23
+ }
24
+
25
+ @client.call(
26
+ method: 'GET',
27
+ path: api_path,
28
+ headers: api_headers,
29
+ params: api_params,
30
+ response_type: Models::Organization
31
+ )
32
+
33
+ end
34
+
35
+ # Update the current organization's name.
36
+ #
37
+ # @param [String] name New organization name. Max length: 128 chars.
38
+ #
39
+ # @return [Organization]
40
+ def update(name:)
41
+ api_path = '/organization'
42
+
43
+ if name.nil?
44
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
45
+ end
46
+
47
+ api_params = {
48
+ name: name,
49
+ }
50
+
51
+ api_headers = {
52
+ "X-Appwrite-Project": @client.get_config('project'),
53
+ "content-type": 'application/json',
54
+ "accept": 'application/json',
55
+ }
56
+
57
+ @client.call(
58
+ method: 'PUT',
59
+ path: api_path,
60
+ headers: api_headers,
61
+ params: api_params,
62
+ response_type: Models::Organization
63
+ )
64
+
65
+ end
66
+
67
+ # Delete the current organization. All projects that belong to the
68
+ # organization are deleted as well.
69
+ #
70
+ #
71
+ # @return []
72
+ def delete()
73
+ api_path = '/organization'
74
+
75
+ api_params = {
76
+ }
77
+
78
+ api_headers = {
79
+ "X-Appwrite-Project": @client.get_config('project'),
80
+ "content-type": 'application/json',
81
+ }
82
+
83
+ @client.call(
84
+ method: 'DELETE',
85
+ path: api_path,
86
+ headers: api_headers,
87
+ params: api_params,
88
+ )
89
+
90
+ end
91
+
10
92
  # Get a list of all API keys from the current organization.
11
93
  #
12
94
  # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire, accessedAt, name, scopes
@@ -22,6 +104,8 @@ module Appwrite
22
104
  }
23
105
 
24
106
  api_headers = {
107
+ "X-Appwrite-Project": @client.get_config('project'),
108
+ "accept": 'application/json',
25
109
  }
26
110
 
27
111
  @client.call(
@@ -38,7 +122,7 @@ module Appwrite
38
122
  #
39
123
  # @param [String] key_id Key ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
40
124
  # @param [String] name Key name. Max length: 128 chars.
41
- # @param [Array] scopes Key scopes list. Maximum of 100 scopes are allowed.
125
+ # @param [Array] scopes Key scopes list. Maximum of 200 scopes are allowed.
42
126
  # @param [String] expire Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.
43
127
  #
44
128
  # @return [Key]
@@ -65,7 +149,9 @@ module Appwrite
65
149
  }
66
150
 
67
151
  api_headers = {
152
+ "X-Appwrite-Project": @client.get_config('project'),
68
153
  "content-type": 'application/json',
154
+ "accept": 'application/json',
69
155
  }
70
156
 
71
157
  @client.call(
@@ -96,6 +182,8 @@ module Appwrite
96
182
  }
97
183
 
98
184
  api_headers = {
185
+ "X-Appwrite-Project": @client.get_config('project'),
186
+ "accept": 'application/json',
99
187
  }
100
188
 
101
189
  @client.call(
@@ -113,7 +201,7 @@ module Appwrite
113
201
  #
114
202
  # @param [String] key_id Key unique ID.
115
203
  # @param [String] name Key name. Max length: 128 chars.
116
- # @param [Array] scopes Key scopes list. Maximum of 100 scopes are allowed.
204
+ # @param [Array] scopes Key scopes list. Maximum of 200 scopes are allowed.
117
205
  # @param [String] expire Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.
118
206
  #
119
207
  # @return [Key]
@@ -140,7 +228,9 @@ module Appwrite
140
228
  }
141
229
 
142
230
  api_headers = {
231
+ "X-Appwrite-Project": @client.get_config('project'),
143
232
  "content-type": 'application/json',
233
+ "accept": 'application/json',
144
234
  }
145
235
 
146
236
  @client.call(
@@ -171,6 +261,183 @@ module Appwrite
171
261
  }
172
262
 
173
263
  api_headers = {
264
+ "X-Appwrite-Project": @client.get_config('project'),
265
+ "content-type": 'application/json',
266
+ }
267
+
268
+ @client.call(
269
+ method: 'DELETE',
270
+ path: api_path,
271
+ headers: api_headers,
272
+ params: api_params,
273
+ )
274
+
275
+ end
276
+
277
+ # Get a list of all memberships from the current organization.
278
+ #
279
+ # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles
280
+ # @param [String] search Search term to filter your list results. Max length: 256 chars.
281
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
282
+ #
283
+ # @return [MembershipList]
284
+ def list_memberships(queries: nil, search: nil, total: nil)
285
+ api_path = '/organization/memberships'
286
+
287
+ api_params = {
288
+ queries: queries,
289
+ search: search,
290
+ total: total,
291
+ }
292
+
293
+ api_headers = {
294
+ "X-Appwrite-Project": @client.get_config('project'),
295
+ "accept": 'application/json',
296
+ }
297
+
298
+ @client.call(
299
+ method: 'GET',
300
+ path: api_path,
301
+ headers: api_headers,
302
+ params: api_params,
303
+ response_type: Models::MembershipList
304
+ )
305
+
306
+ end
307
+
308
+ # Invite a new member to join the current organization. An email with a link
309
+ # to join the organization will be sent to the new member's email address. If
310
+ # member doesn't exist in the project it will be automatically created.
311
+ #
312
+ # @param [Array] roles Array of strings. Use this param to set the user roles in the organization. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long.
313
+ # @param [String] email Email of the new organization member.
314
+ # @param [String] user_id ID of the user to be added to the organization.
315
+ # @param [String] phone Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
316
+ # @param [String] url URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied.
317
+ # @param [String] name Name of the new organization member. Max length: 128 chars.
318
+ #
319
+ # @return [Membership]
320
+ def create_membership(roles:, email: nil, user_id: nil, phone: nil, url: nil, name: nil)
321
+ api_path = '/organization/memberships'
322
+
323
+ if roles.nil?
324
+ raise Appwrite::Exception.new('Missing required parameter: "roles"')
325
+ end
326
+
327
+ api_params = {
328
+ email: email,
329
+ userId: user_id,
330
+ phone: phone,
331
+ roles: roles,
332
+ url: url,
333
+ name: name,
334
+ }
335
+
336
+ api_headers = {
337
+ "X-Appwrite-Project": @client.get_config('project'),
338
+ "content-type": 'application/json',
339
+ "accept": 'application/json',
340
+ }
341
+
342
+ @client.call(
343
+ method: 'POST',
344
+ path: api_path,
345
+ headers: api_headers,
346
+ params: api_params,
347
+ response_type: Models::Membership
348
+ )
349
+
350
+ end
351
+
352
+ # Get a membership from the current organization by its unique ID.
353
+ #
354
+ # @param [String] membership_id Membership ID.
355
+ #
356
+ # @return [Membership]
357
+ def get_membership(membership_id:)
358
+ api_path = '/organization/memberships/{membershipId}'
359
+ .gsub('{membershipId}', membership_id)
360
+
361
+ if membership_id.nil?
362
+ raise Appwrite::Exception.new('Missing required parameter: "membershipId"')
363
+ end
364
+
365
+ api_params = {
366
+ }
367
+
368
+ api_headers = {
369
+ "X-Appwrite-Project": @client.get_config('project'),
370
+ "accept": 'application/json',
371
+ }
372
+
373
+ @client.call(
374
+ method: 'GET',
375
+ path: api_path,
376
+ headers: api_headers,
377
+ params: api_params,
378
+ response_type: Models::Membership
379
+ )
380
+
381
+ end
382
+
383
+ # Modify the roles of a member in the current organization.
384
+ #
385
+ # @param [String] membership_id Membership ID.
386
+ # @param [Array] roles An array of strings. Use this param to set the user's roles in the organization. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long.
387
+ #
388
+ # @return [Membership]
389
+ def update_membership(membership_id:, roles:)
390
+ api_path = '/organization/memberships/{membershipId}'
391
+ .gsub('{membershipId}', membership_id)
392
+
393
+ if membership_id.nil?
394
+ raise Appwrite::Exception.new('Missing required parameter: "membershipId"')
395
+ end
396
+
397
+ if roles.nil?
398
+ raise Appwrite::Exception.new('Missing required parameter: "roles"')
399
+ end
400
+
401
+ api_params = {
402
+ roles: roles,
403
+ }
404
+
405
+ api_headers = {
406
+ "X-Appwrite-Project": @client.get_config('project'),
407
+ "content-type": 'application/json',
408
+ "accept": 'application/json',
409
+ }
410
+
411
+ @client.call(
412
+ method: 'PATCH',
413
+ path: api_path,
414
+ headers: api_headers,
415
+ params: api_params,
416
+ response_type: Models::Membership
417
+ )
418
+
419
+ end
420
+
421
+ # Remove a member from the current organization. The member is removed
422
+ # whether they accepted the invitation or not; a pending invitation is
423
+ # revoked.
424
+ #
425
+ # @param [String] membership_id Membership ID.
426
+ #
427
+ # @return []
428
+ def delete_membership(membership_id:)
429
+ api_path = '/organization/memberships/{membershipId}'
430
+ .gsub('{membershipId}', membership_id)
431
+
432
+ if membership_id.nil?
433
+ raise Appwrite::Exception.new('Missing required parameter: "membershipId"')
434
+ end
435
+
436
+ api_params = {
437
+ }
438
+
439
+ api_headers = {
440
+ "X-Appwrite-Project": @client.get_config('project'),
174
441
  "content-type": 'application/json',
175
442
  }
176
443
 
@@ -186,7 +453,7 @@ module Appwrite
186
453
  # Get a list of all projects. You can use the query params to filter your
187
454
  # results.
188
455
  #
189
- # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search
456
+ # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search, accessedAt
190
457
  # @param [String] search Search term to filter your list results. Max length: 256 chars.
191
458
  # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
192
459
  #
@@ -201,6 +468,8 @@ module Appwrite
201
468
  }
202
469
 
203
470
  api_headers = {
471
+ "X-Appwrite-Project": @client.get_config('project'),
472
+ "accept": 'application/json',
204
473
  }
205
474
 
206
475
  @client.call(
@@ -238,7 +507,9 @@ module Appwrite
238
507
  }
239
508
 
240
509
  api_headers = {
510
+ "X-Appwrite-Project": @client.get_config('project'),
241
511
  "content-type": 'application/json',
512
+ "accept": 'application/json',
242
513
  }
243
514
 
244
515
  @client.call(
@@ -268,6 +539,7 @@ module Appwrite
268
539
  }
269
540
 
270
541
  api_headers = {
542
+ "X-Appwrite-Project": @client.get_config('project'),
271
543
  }
272
544
 
273
545
  @client.call(
@@ -303,7 +575,9 @@ module Appwrite
303
575
  }
304
576
 
305
577
  api_headers = {
578
+ "X-Appwrite-Project": @client.get_config('project'),
306
579
  "content-type": 'application/json',
580
+ "accept": 'application/json',
307
581
  }
308
582
 
309
583
  @client.call(
@@ -333,6 +607,7 @@ module Appwrite
333
607
  }
334
608
 
335
609
  api_headers = {
610
+ "X-Appwrite-Project": @client.get_config('project'),
336
611
  "content-type": 'application/json',
337
612
  }
338
613
 
@@ -25,6 +25,8 @@ module Appwrite
25
25
  }
26
26
 
27
27
  api_headers = {
28
+ "X-Appwrite-Project": @client.get_config('project'),
29
+ "accept": 'application/json',
28
30
  }
29
31
 
30
32
  @client.call(
@@ -56,6 +58,8 @@ module Appwrite
56
58
  }
57
59
 
58
60
  api_headers = {
61
+ "X-Appwrite-Project": @client.get_config('project'),
62
+ "accept": 'application/json',
59
63
  }
60
64
 
61
65
  @client.call(
@@ -104,7 +108,9 @@ module Appwrite
104
108
  }
105
109
 
106
110
  api_headers = {
111
+ "X-Appwrite-Project": @client.get_config('project'),
107
112
  "content-type": 'application/json',
113
+ "accept": 'application/json',
108
114
  }
109
115
 
110
116
  @client.call(
@@ -152,7 +158,9 @@ module Appwrite
152
158
  }
153
159
 
154
160
  api_headers = {
161
+ "X-Appwrite-Project": @client.get_config('project'),
155
162
  "content-type": 'application/json',
163
+ "accept": 'application/json',
156
164
  }
157
165
 
158
166
  @client.call(
@@ -183,6 +191,7 @@ module Appwrite
183
191
  }
184
192
 
185
193
  api_headers = {
194
+ "X-Appwrite-Project": @client.get_config('project'),
186
195
  "content-type": 'application/json',
187
196
  }
188
197