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
@@ -1,47 +0,0 @@
1
- #frozen_string_literal: true
2
-
3
- module Appwrite
4
- module Models
5
- class UsageGauge
6
- attr_reader :metric
7
- attr_reader :value
8
- attr_reader :time
9
- attr_reader :resource_type
10
- attr_reader :resource_id
11
-
12
- def initialize(
13
- metric:,
14
- value:,
15
- time:,
16
- resource_type:,
17
- resource_id:
18
- )
19
- @metric = metric
20
- @value = value
21
- @time = time
22
- @resource_type = resource_type
23
- @resource_id = resource_id
24
- end
25
-
26
- def self.from(map:)
27
- UsageGauge.new(
28
- metric: map["metric"],
29
- value: map["value"],
30
- time: map["time"],
31
- resource_type: map["resourceType"],
32
- resource_id: map["resourceId"]
33
- )
34
- end
35
-
36
- def to_map
37
- {
38
- "metric": @metric,
39
- "value": @value,
40
- "time": @time,
41
- "resourceType": @resource_type,
42
- "resourceId": @resource_id
43
- }
44
- end
45
- end
46
- end
47
- end
@@ -1,32 +0,0 @@
1
- #frozen_string_literal: true
2
-
3
- module Appwrite
4
- module Models
5
- class UsageGaugeList
6
- attr_reader :total
7
- attr_reader :gauges
8
-
9
- def initialize(
10
- total:,
11
- gauges:
12
- )
13
- @total = total
14
- @gauges = gauges
15
- end
16
-
17
- def self.from(map:)
18
- UsageGaugeList.new(
19
- total: map["total"],
20
- gauges: map["gauges"].map { |it| UsageGauge.from(map: it) }
21
- )
22
- end
23
-
24
- def to_map
25
- {
26
- "total": @total,
27
- "gauges": @gauges.map { |it| it.to_map }
28
- }
29
- end
30
- end
31
- end
32
- end
@@ -1,630 +0,0 @@
1
- #frozen_string_literal: true
2
-
3
- module Appwrite
4
- class Health < Service
5
-
6
- def initialize(client)
7
- @client = client
8
- end
9
-
10
- # Check the Appwrite HTTP server is up and responsive.
11
- #
12
- #
13
- # @return [HealthStatus]
14
- def get()
15
- api_path = '/health'
16
-
17
- api_params = {
18
- }
19
-
20
- api_headers = {
21
- }
22
-
23
- @client.call(
24
- method: 'GET',
25
- path: api_path,
26
- headers: api_headers,
27
- params: api_params,
28
- response_type: Models::HealthStatus
29
- )
30
-
31
- end
32
-
33
- # Check the Appwrite Antivirus server is up and connection is successful.
34
- #
35
- #
36
- # @return [HealthAntivirus]
37
- def get_antivirus()
38
- api_path = '/health/anti-virus'
39
-
40
- api_params = {
41
- }
42
-
43
- api_headers = {
44
- }
45
-
46
- @client.call(
47
- method: 'GET',
48
- path: api_path,
49
- headers: api_headers,
50
- params: api_params,
51
- response_type: Models::HealthAntivirus
52
- )
53
-
54
- end
55
-
56
- # Check the Appwrite in-memory cache servers are up and connection is
57
- # successful.
58
- #
59
- #
60
- # @return [HealthStatusList]
61
- def get_cache()
62
- api_path = '/health/cache'
63
-
64
- api_params = {
65
- }
66
-
67
- api_headers = {
68
- }
69
-
70
- @client.call(
71
- method: 'GET',
72
- path: api_path,
73
- headers: api_headers,
74
- params: api_params,
75
- response_type: Models::HealthStatusList
76
- )
77
-
78
- end
79
-
80
- # Get the SSL certificate for a domain
81
- #
82
- # @param [String] domain string
83
- #
84
- # @return [HealthCertificate]
85
- def get_certificate(domain: nil)
86
- api_path = '/health/certificate'
87
-
88
- api_params = {
89
- domain: domain,
90
- }
91
-
92
- api_headers = {
93
- }
94
-
95
- @client.call(
96
- method: 'GET',
97
- path: api_path,
98
- headers: api_headers,
99
- params: api_params,
100
- response_type: Models::HealthCertificate
101
- )
102
-
103
- end
104
-
105
- # Get console pausing health status. Monitors projects approaching the pause
106
- # threshold to detect potential issues with console access tracking.
107
- #
108
- #
109
- # @param [Integer] threshold Percentage threshold of projects approaching pause. When hit (equal or higher), endpoint returns server error. Default value is 10.
110
- # @param [Integer] inactivity_days Number of days of inactivity before a project is paused. Should match the plan's projectInactivityDays setting. Default value is 7.
111
- #
112
- # @return [HealthStatus]
113
- def get_console_pausing(threshold: nil, inactivity_days: nil)
114
- api_path = '/health/console-pausing'
115
-
116
- api_params = {
117
- threshold: threshold,
118
- inactivityDays: inactivity_days,
119
- }
120
-
121
- api_headers = {
122
- }
123
-
124
- @client.call(
125
- method: 'GET',
126
- path: api_path,
127
- headers: api_headers,
128
- params: api_params,
129
- response_type: Models::HealthStatus
130
- )
131
-
132
- end
133
-
134
- # Check the Appwrite database servers are up and connection is successful.
135
- #
136
- #
137
- # @return [HealthStatusList]
138
- def get_db()
139
- api_path = '/health/db'
140
-
141
- api_params = {
142
- }
143
-
144
- api_headers = {
145
- }
146
-
147
- @client.call(
148
- method: 'GET',
149
- path: api_path,
150
- headers: api_headers,
151
- params: api_params,
152
- response_type: Models::HealthStatusList
153
- )
154
-
155
- end
156
-
157
- # Check the Appwrite pub-sub servers are up and connection is successful.
158
- #
159
- #
160
- # @return [HealthStatusList]
161
- def get_pub_sub()
162
- api_path = '/health/pubsub'
163
-
164
- api_params = {
165
- }
166
-
167
- api_headers = {
168
- }
169
-
170
- @client.call(
171
- method: 'GET',
172
- path: api_path,
173
- headers: api_headers,
174
- params: api_params,
175
- response_type: Models::HealthStatusList
176
- )
177
-
178
- end
179
-
180
- # Get the number of audit logs that are waiting to be processed in the
181
- # Appwrite internal queue server.
182
- #
183
- #
184
- # @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
185
- #
186
- # @return [HealthQueue]
187
- def get_queue_audits(threshold: nil)
188
- api_path = '/health/queue/audits'
189
-
190
- api_params = {
191
- threshold: threshold,
192
- }
193
-
194
- api_headers = {
195
- }
196
-
197
- @client.call(
198
- method: 'GET',
199
- path: api_path,
200
- headers: api_headers,
201
- params: api_params,
202
- response_type: Models::HealthQueue
203
- )
204
-
205
- end
206
-
207
- # Get the number of builds that are waiting to be processed in the Appwrite
208
- # internal queue server.
209
- #
210
- # @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
211
- #
212
- # @return [HealthQueue]
213
- def get_queue_builds(threshold: nil)
214
- api_path = '/health/queue/builds'
215
-
216
- api_params = {
217
- threshold: threshold,
218
- }
219
-
220
- api_headers = {
221
- }
222
-
223
- @client.call(
224
- method: 'GET',
225
- path: api_path,
226
- headers: api_headers,
227
- params: api_params,
228
- response_type: Models::HealthQueue
229
- )
230
-
231
- end
232
-
233
- # Get the number of certificates that are waiting to be issued against
234
- # [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue
235
- # server.
236
- #
237
- # @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
238
- #
239
- # @return [HealthQueue]
240
- def get_queue_certificates(threshold: nil)
241
- api_path = '/health/queue/certificates'
242
-
243
- api_params = {
244
- threshold: threshold,
245
- }
246
-
247
- api_headers = {
248
- }
249
-
250
- @client.call(
251
- method: 'GET',
252
- path: api_path,
253
- headers: api_headers,
254
- params: api_params,
255
- response_type: Models::HealthQueue
256
- )
257
-
258
- end
259
-
260
- # Get the number of database changes that are waiting to be processed in the
261
- # Appwrite internal queue server.
262
- #
263
- # @param [String] name Queue name for which to check the queue size
264
- # @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
265
- #
266
- # @return [HealthQueue]
267
- def get_queue_databases(name: nil, threshold: nil)
268
- api_path = '/health/queue/databases'
269
-
270
- api_params = {
271
- name: name,
272
- threshold: threshold,
273
- }
274
-
275
- api_headers = {
276
- }
277
-
278
- @client.call(
279
- method: 'GET',
280
- path: api_path,
281
- headers: api_headers,
282
- params: api_params,
283
- response_type: Models::HealthQueue
284
- )
285
-
286
- end
287
-
288
- # Get the number of background destructive changes that are waiting to be
289
- # processed in the Appwrite internal queue server.
290
- #
291
- # @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
292
- #
293
- # @return [HealthQueue]
294
- def get_queue_deletes(threshold: nil)
295
- api_path = '/health/queue/deletes'
296
-
297
- api_params = {
298
- threshold: threshold,
299
- }
300
-
301
- api_headers = {
302
- }
303
-
304
- @client.call(
305
- method: 'GET',
306
- path: api_path,
307
- headers: api_headers,
308
- params: api_params,
309
- response_type: Models::HealthQueue
310
- )
311
-
312
- end
313
-
314
- # Returns the amount of failed jobs in a given queue.
315
- #
316
- #
317
- # @param [HealthQueueName] name The name of the queue
318
- # @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
319
- #
320
- # @return [HealthQueue]
321
- def get_failed_jobs(name:, threshold: nil)
322
- api_path = '/health/queue/failed/{name}'
323
- .gsub('{name}', name)
324
-
325
- if name.nil?
326
- raise Appwrite::Exception.new('Missing required parameter: "name"')
327
- end
328
-
329
- api_params = {
330
- threshold: threshold,
331
- }
332
-
333
- api_headers = {
334
- }
335
-
336
- @client.call(
337
- method: 'GET',
338
- path: api_path,
339
- headers: api_headers,
340
- params: api_params,
341
- response_type: Models::HealthQueue
342
- )
343
-
344
- end
345
-
346
- # Get the number of function executions that are waiting to be processed in
347
- # the Appwrite internal queue server.
348
- #
349
- # @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
350
- #
351
- # @return [HealthQueue]
352
- def get_queue_functions(threshold: nil)
353
- api_path = '/health/queue/functions'
354
-
355
- api_params = {
356
- threshold: threshold,
357
- }
358
-
359
- api_headers = {
360
- }
361
-
362
- @client.call(
363
- method: 'GET',
364
- path: api_path,
365
- headers: api_headers,
366
- params: api_params,
367
- response_type: Models::HealthQueue
368
- )
369
-
370
- end
371
-
372
- # Get the number of logs that are waiting to be processed in the Appwrite
373
- # internal queue server.
374
- #
375
- # @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
376
- #
377
- # @return [HealthQueue]
378
- def get_queue_logs(threshold: nil)
379
- api_path = '/health/queue/logs'
380
-
381
- api_params = {
382
- threshold: threshold,
383
- }
384
-
385
- api_headers = {
386
- }
387
-
388
- @client.call(
389
- method: 'GET',
390
- path: api_path,
391
- headers: api_headers,
392
- params: api_params,
393
- response_type: Models::HealthQueue
394
- )
395
-
396
- end
397
-
398
- # Get the number of mails that are waiting to be processed in the Appwrite
399
- # internal queue server.
400
- #
401
- # @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
402
- #
403
- # @return [HealthQueue]
404
- def get_queue_mails(threshold: nil)
405
- api_path = '/health/queue/mails'
406
-
407
- api_params = {
408
- threshold: threshold,
409
- }
410
-
411
- api_headers = {
412
- }
413
-
414
- @client.call(
415
- method: 'GET',
416
- path: api_path,
417
- headers: api_headers,
418
- params: api_params,
419
- response_type: Models::HealthQueue
420
- )
421
-
422
- end
423
-
424
- # Get the number of messages that are waiting to be processed in the Appwrite
425
- # internal queue server.
426
- #
427
- # @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
428
- #
429
- # @return [HealthQueue]
430
- def get_queue_messaging(threshold: nil)
431
- api_path = '/health/queue/messaging'
432
-
433
- api_params = {
434
- threshold: threshold,
435
- }
436
-
437
- api_headers = {
438
- }
439
-
440
- @client.call(
441
- method: 'GET',
442
- path: api_path,
443
- headers: api_headers,
444
- params: api_params,
445
- response_type: Models::HealthQueue
446
- )
447
-
448
- end
449
-
450
- # Get the number of migrations that are waiting to be processed in the
451
- # Appwrite internal queue server.
452
- #
453
- # @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
454
- #
455
- # @return [HealthQueue]
456
- def get_queue_migrations(threshold: nil)
457
- api_path = '/health/queue/migrations'
458
-
459
- api_params = {
460
- threshold: threshold,
461
- }
462
-
463
- api_headers = {
464
- }
465
-
466
- @client.call(
467
- method: 'GET',
468
- path: api_path,
469
- headers: api_headers,
470
- params: api_params,
471
- response_type: Models::HealthQueue
472
- )
473
-
474
- end
475
-
476
- # Get the number of metrics that are waiting to be processed in the Appwrite
477
- # stats resources queue.
478
- #
479
- # @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
480
- #
481
- # @return [HealthQueue]
482
- def get_queue_stats_resources(threshold: nil)
483
- api_path = '/health/queue/stats-resources'
484
-
485
- api_params = {
486
- threshold: threshold,
487
- }
488
-
489
- api_headers = {
490
- }
491
-
492
- @client.call(
493
- method: 'GET',
494
- path: api_path,
495
- headers: api_headers,
496
- params: api_params,
497
- response_type: Models::HealthQueue
498
- )
499
-
500
- end
501
-
502
- # Get the number of metrics that are waiting to be processed in the Appwrite
503
- # internal queue server.
504
- #
505
- # @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
506
- #
507
- # @return [HealthQueue]
508
- def get_queue_usage(threshold: nil)
509
- api_path = '/health/queue/stats-usage'
510
-
511
- api_params = {
512
- threshold: threshold,
513
- }
514
-
515
- api_headers = {
516
- }
517
-
518
- @client.call(
519
- method: 'GET',
520
- path: api_path,
521
- headers: api_headers,
522
- params: api_params,
523
- response_type: Models::HealthQueue
524
- )
525
-
526
- end
527
-
528
- # Get the number of webhooks that are waiting to be processed in the Appwrite
529
- # internal queue server.
530
- #
531
- # @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
532
- #
533
- # @return [HealthQueue]
534
- def get_queue_webhooks(threshold: nil)
535
- api_path = '/health/queue/webhooks'
536
-
537
- api_params = {
538
- threshold: threshold,
539
- }
540
-
541
- api_headers = {
542
- }
543
-
544
- @client.call(
545
- method: 'GET',
546
- path: api_path,
547
- headers: api_headers,
548
- params: api_params,
549
- response_type: Models::HealthQueue
550
- )
551
-
552
- end
553
-
554
- # Check the Appwrite storage device is up and connection is successful.
555
- #
556
- #
557
- # @return [HealthStatus]
558
- def get_storage()
559
- api_path = '/health/storage'
560
-
561
- api_params = {
562
- }
563
-
564
- api_headers = {
565
- }
566
-
567
- @client.call(
568
- method: 'GET',
569
- path: api_path,
570
- headers: api_headers,
571
- params: api_params,
572
- response_type: Models::HealthStatus
573
- )
574
-
575
- end
576
-
577
- # Check the Appwrite local storage device is up and connection is successful.
578
- #
579
- #
580
- # @return [HealthStatus]
581
- def get_storage_local()
582
- api_path = '/health/storage/local'
583
-
584
- api_params = {
585
- }
586
-
587
- api_headers = {
588
- }
589
-
590
- @client.call(
591
- method: 'GET',
592
- path: api_path,
593
- headers: api_headers,
594
- params: api_params,
595
- response_type: Models::HealthStatus
596
- )
597
-
598
- end
599
-
600
- # Check the Appwrite server time is synced with Google remote NTP server. We
601
- # use this technology to smoothly handle leap seconds with no disruptive
602
- # events. The [Network Time
603
- # Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is
604
- # used by hundreds of millions of computers and devices to synchronize their
605
- # clocks over the Internet. If your computer sets its own clock, it likely
606
- # uses NTP.
607
- #
608
- #
609
- # @return [HealthTime]
610
- def get_time()
611
- api_path = '/health/time'
612
-
613
- api_params = {
614
- }
615
-
616
- api_headers = {
617
- }
618
-
619
- @client.call(
620
- method: 'GET',
621
- path: api_path,
622
- headers: api_headers,
623
- params: api_params,
624
- response_type: Models::HealthTime
625
- )
626
-
627
- end
628
-
629
- end
630
- end