appwrite 25.1.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 (73) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +18 -4
  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 +7 -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 +1 -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/program.rb +67 -0
  32. data/lib/appwrite/models/project.rb +46 -11
  33. data/lib/appwrite/models/usage_billing_plan.rb +77 -0
  34. data/lib/appwrite/models/user.rb +25 -0
  35. data/lib/appwrite/query.rb +13 -1
  36. data/lib/appwrite/services/account.rb +42 -1
  37. data/lib/appwrite/services/activities.rb +2 -0
  38. data/lib/appwrite/services/advisor.rb +4 -0
  39. data/lib/appwrite/services/avatars.rb +8 -0
  40. data/lib/appwrite/services/backups.rb +25 -1
  41. data/lib/appwrite/services/databases.rb +107 -0
  42. data/lib/appwrite/services/functions.rb +30 -4
  43. data/lib/appwrite/services/graphql.rb +2 -0
  44. data/lib/appwrite/services/locale.rb +8 -0
  45. data/lib/appwrite/services/messaging.rb +42 -136
  46. data/lib/appwrite/services/organization.rb +268 -3
  47. data/lib/appwrite/services/presences.rb +4 -0
  48. data/lib/appwrite/services/project.rb +190 -9
  49. data/lib/appwrite/services/proxy.rb +7 -0
  50. data/lib/appwrite/services/sites.rb +25 -1
  51. data/lib/appwrite/services/storage.rb +11 -0
  52. data/lib/appwrite/services/tables_db.rb +68 -1
  53. data/lib/appwrite/services/teams.rb +11 -0
  54. data/lib/appwrite/services/tokens.rb +4 -0
  55. data/lib/appwrite/services/users.rb +38 -1
  56. data/lib/appwrite/services/webhooks.rb +5 -0
  57. data/lib/appwrite.rb +16 -15
  58. metadata +18 -17
  59. data/lib/appwrite/enums/health_antivirus_status.rb +0 -9
  60. data/lib/appwrite/enums/health_check_status.rb +0 -8
  61. data/lib/appwrite/enums/health_queue_name.rb +0 -19
  62. data/lib/appwrite/models/health_antivirus.rb +0 -49
  63. data/lib/appwrite/models/health_certificate.rb +0 -52
  64. data/lib/appwrite/models/health_queue.rb +0 -27
  65. data/lib/appwrite/models/health_status.rb +0 -53
  66. data/lib/appwrite/models/health_status_list.rb +0 -32
  67. data/lib/appwrite/models/health_time.rb +0 -37
  68. data/lib/appwrite/models/usage_event.rb +0 -72
  69. data/lib/appwrite/models/usage_event_list.rb +0 -32
  70. data/lib/appwrite/models/usage_gauge.rb +0 -47
  71. data/lib/appwrite/models/usage_gauge_list.rb +0 -32
  72. data/lib/appwrite/services/health.rb +0 -681
  73. data/lib/appwrite/services/usage.rb +0 -88
@@ -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
@@ -23,6 +105,7 @@ module Appwrite
23
105
 
24
106
  api_headers = {
25
107
  "X-Appwrite-Project": @client.get_config('project'),
108
+ "accept": 'application/json',
26
109
  }
27
110
 
28
111
  @client.call(
@@ -39,7 +122,7 @@ module Appwrite
39
122
  #
40
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.
41
124
  # @param [String] name Key name. Max length: 128 chars.
42
- # @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.
43
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.
44
127
  #
45
128
  # @return [Key]
@@ -68,6 +151,7 @@ module Appwrite
68
151
  api_headers = {
69
152
  "X-Appwrite-Project": @client.get_config('project'),
70
153
  "content-type": 'application/json',
154
+ "accept": 'application/json',
71
155
  }
72
156
 
73
157
  @client.call(
@@ -99,6 +183,7 @@ module Appwrite
99
183
 
100
184
  api_headers = {
101
185
  "X-Appwrite-Project": @client.get_config('project'),
186
+ "accept": 'application/json',
102
187
  }
103
188
 
104
189
  @client.call(
@@ -116,7 +201,7 @@ module Appwrite
116
201
  #
117
202
  # @param [String] key_id Key unique ID.
118
203
  # @param [String] name Key name. Max length: 128 chars.
119
- # @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.
120
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.
121
206
  #
122
207
  # @return [Key]
@@ -145,6 +230,7 @@ module Appwrite
145
230
  api_headers = {
146
231
  "X-Appwrite-Project": @client.get_config('project'),
147
232
  "content-type": 'application/json',
233
+ "accept": 'application/json',
148
234
  }
149
235
 
150
236
  @client.call(
@@ -188,10 +274,186 @@ module Appwrite
188
274
 
189
275
  end
190
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'),
441
+ "content-type": 'application/json',
442
+ }
443
+
444
+ @client.call(
445
+ method: 'DELETE',
446
+ path: api_path,
447
+ headers: api_headers,
448
+ params: api_params,
449
+ )
450
+
451
+ end
452
+
191
453
  # Get a list of all projects. You can use the query params to filter your
192
454
  # results.
193
455
  #
194
- # @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
195
457
  # @param [String] search Search term to filter your list results. Max length: 256 chars.
196
458
  # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
197
459
  #
@@ -207,6 +469,7 @@ module Appwrite
207
469
 
208
470
  api_headers = {
209
471
  "X-Appwrite-Project": @client.get_config('project'),
472
+ "accept": 'application/json',
210
473
  }
211
474
 
212
475
  @client.call(
@@ -246,6 +509,7 @@ module Appwrite
246
509
  api_headers = {
247
510
  "X-Appwrite-Project": @client.get_config('project'),
248
511
  "content-type": 'application/json',
512
+ "accept": 'application/json',
249
513
  }
250
514
 
251
515
  @client.call(
@@ -313,6 +577,7 @@ module Appwrite
313
577
  api_headers = {
314
578
  "X-Appwrite-Project": @client.get_config('project'),
315
579
  "content-type": 'application/json',
580
+ "accept": 'application/json',
316
581
  }
317
582
 
318
583
  @client.call(
@@ -26,6 +26,7 @@ module Appwrite
26
26
 
27
27
  api_headers = {
28
28
  "X-Appwrite-Project": @client.get_config('project'),
29
+ "accept": 'application/json',
29
30
  }
30
31
 
31
32
  @client.call(
@@ -58,6 +59,7 @@ module Appwrite
58
59
 
59
60
  api_headers = {
60
61
  "X-Appwrite-Project": @client.get_config('project'),
62
+ "accept": 'application/json',
61
63
  }
62
64
 
63
65
  @client.call(
@@ -108,6 +110,7 @@ module Appwrite
108
110
  api_headers = {
109
111
  "X-Appwrite-Project": @client.get_config('project'),
110
112
  "content-type": 'application/json',
113
+ "accept": 'application/json',
111
114
  }
112
115
 
113
116
  @client.call(
@@ -157,6 +160,7 @@ module Appwrite
157
160
  api_headers = {
158
161
  "X-Appwrite-Project": @client.get_config('project'),
159
162
  "content-type": 'application/json',
163
+ "accept": 'application/json',
160
164
  }
161
165
 
162
166
  @client.call(