appwrite 30.0.1 → 30.2.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 (64) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +58 -24
  3. data/lib/appwrite/enums/appwrite_migration_resource.rb +47 -0
  4. data/lib/appwrite/enums/build_runtime.rb +4 -0
  5. data/lib/appwrite/enums/environment_resource.rb +40 -0
  6. data/lib/appwrite/enums/firebase_migration_resource.rb +16 -0
  7. data/lib/appwrite/enums/n_host_migration_resource.rb +17 -0
  8. data/lib/appwrite/enums/o_auth_provider.rb +2 -0
  9. data/lib/appwrite/enums/on_duplicate.rb +9 -0
  10. data/lib/appwrite/enums/project_key_scopes.rb +6 -0
  11. data/lib/appwrite/enums/project_o_auth_provider_id.rb +2 -0
  12. data/lib/appwrite/enums/project_policy_id.rb +2 -0
  13. data/lib/appwrite/enums/runtime.rb +4 -0
  14. data/lib/appwrite/enums/supabase_migration_resource.rb +17 -0
  15. data/lib/appwrite/models/activity_event.rb +9 -4
  16. data/lib/appwrite/models/billing_plan.rb +15 -0
  17. data/lib/appwrite/models/device.rb +58 -0
  18. data/lib/appwrite/models/environment.rb +48 -0
  19. data/lib/appwrite/models/environment_list.rb +33 -0
  20. data/lib/appwrite/models/migration.rb +128 -0
  21. data/lib/appwrite/models/migration_list.rb +33 -0
  22. data/lib/appwrite/models/o_auth2_vipps.rb +43 -0
  23. data/lib/appwrite/models/organization.rb +16 -1
  24. data/lib/appwrite/models/policy_account_devices.rb +33 -0
  25. data/lib/appwrite/models/policy_deny_realtime_guests.rb +33 -0
  26. data/lib/appwrite/models/project.rb +10 -0
  27. data/lib/appwrite/models/proxy_rule.rb +11 -1
  28. data/lib/appwrite/models/session.rb +6 -1
  29. data/lib/appwrite/models/waf_rule_bypass.rb +8 -3
  30. data/lib/appwrite/models/waf_rule_challenge.rb +5 -0
  31. data/lib/appwrite/models/waf_rule_deny.rb +8 -3
  32. data/lib/appwrite/models/waf_rule_rate_limit.rb +5 -0
  33. data/lib/appwrite/models/waf_rule_redirect.rb +5 -0
  34. data/lib/appwrite/services/account.rb +175 -20
  35. data/lib/appwrite/services/activities.rb +1 -1
  36. data/lib/appwrite/services/advisor.rb +5 -5
  37. data/lib/appwrite/services/apps.rb +25 -25
  38. data/lib/appwrite/services/avatars.rb +3 -3
  39. data/lib/appwrite/services/backups.rb +6 -6
  40. data/lib/appwrite/services/databases.rb +157 -157
  41. data/lib/appwrite/services/documents_db.rb +63 -63
  42. data/lib/appwrite/services/domains.rb +77 -77
  43. data/lib/appwrite/services/functions.rb +33 -33
  44. data/lib/appwrite/services/messaging.rb +30 -30
  45. data/lib/appwrite/services/migrations.rb +653 -0
  46. data/lib/appwrite/services/mongo.rb +37 -37
  47. data/lib/appwrite/services/mysql.rb +40 -40
  48. data/lib/appwrite/services/oauth2.rb +14 -14
  49. data/lib/appwrite/services/organization.rb +17 -17
  50. data/lib/appwrite/services/postgresql.rb +44 -44
  51. data/lib/appwrite/services/presences.rb +4 -4
  52. data/lib/appwrite/services/project.rb +321 -47
  53. data/lib/appwrite/services/proxy.rb +157 -4
  54. data/lib/appwrite/services/sites.rb +32 -32
  55. data/lib/appwrite/services/storage.rb +19 -19
  56. data/lib/appwrite/services/tables_db.rb +169 -169
  57. data/lib/appwrite/services/teams.rb +23 -23
  58. data/lib/appwrite/services/tokens.rb +7 -7
  59. data/lib/appwrite/services/users.rb +50 -50
  60. data/lib/appwrite/services/vectors_db.rb +55 -55
  61. data/lib/appwrite/services/waf.rb +97 -45
  62. data/lib/appwrite/services/webhooks.rb +4 -4
  63. data/lib/appwrite.rb +17 -0
  64. metadata +17 -2
@@ -44,9 +44,9 @@ module Appwrite
44
44
  # Create a bypass WAF rule. Conditions can match request attributes including
45
45
  # `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`,
46
46
  # `host`, `country`, `continent`, `headers.<name>`, `query.<key>`,
47
- # `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and
48
- # `browserVersion`. Conditions on `city` and `state` require the premium Geo
49
- # DB addon.
47
+ # `queryKeys`, `accept`, `acceptLanguage`, `cookie`, `userAgent`, `os`,
48
+ # `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and
49
+ # `state` require the premium Geo DB addon.
50
50
  #
51
51
  #
52
52
  # @param [String] rule_id Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -57,6 +57,7 @@ module Appwrite
57
57
  # @param [Integer] priority Evaluation priority. Lower numbers run earlier.
58
58
  # @param [] enabled Set to false to create the rule in a disabled state.
59
59
  # @param [Array] conditions Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
60
+ # @param [Hash] schedule When the rule is active: mode, days, interval, anchor, startTime and endTime (HH:MM), and an optional IANA timezone (UTC by default). Leave out for always on; on update, leave out to keep the current schedule and pass an empty object to remove it.
60
61
  #
61
62
  # @return [WafRuleBypass]
62
63
  def create_bypass_rule(
@@ -67,7 +68,8 @@ module Appwrite
67
68
  description: nil,
68
69
  priority: nil,
69
70
  enabled: nil,
70
- conditions: nil
71
+ conditions: nil,
72
+ schedule: nil
71
73
  )
72
74
  if rule_id.nil?
73
75
  raise Appwrite::Exception.new('Missing required parameter: "ruleId"')
@@ -92,6 +94,7 @@ module Appwrite
92
94
  priority: priority,
93
95
  enabled: enabled,
94
96
  conditions: conditions,
97
+ schedule: schedule,
95
98
  }
96
99
 
97
100
  api_headers = {
@@ -112,9 +115,9 @@ module Appwrite
112
115
  # Update a bypass WAF rule. Conditions can match request attributes including
113
116
  # `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`,
114
117
  # `host`, `country`, `continent`, `headers.<name>`, `query.<key>`,
115
- # `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and
116
- # `browserVersion`. Conditions on `city` and `state` require the premium Geo
117
- # DB addon.
118
+ # `queryKeys`, `accept`, `acceptLanguage`, `cookie`, `userAgent`, `os`,
119
+ # `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and
120
+ # `state` require the premium Geo DB addon.
118
121
  #
119
122
  #
120
123
  # @param [String] rule_id Rule ID.
@@ -125,6 +128,7 @@ module Appwrite
125
128
  # @param [Integer] priority Evaluation priority. Lower numbers run earlier.
126
129
  # @param [] enabled Set to false to disable the rule.
127
130
  # @param [Array] conditions Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
131
+ # @param [Hash] schedule When the rule is active: mode, days, interval, anchor, startTime and endTime (HH:MM), and an optional IANA timezone (UTC by default). Leave out for always on; on update, leave out to keep the current schedule and pass an empty object to remove it.
128
132
  #
129
133
  # @return [WafRuleBypass]
130
134
  def update_bypass_rule(
@@ -135,14 +139,15 @@ module Appwrite
135
139
  description: nil,
136
140
  priority: nil,
137
141
  enabled: nil,
138
- conditions: nil
142
+ conditions: nil,
143
+ schedule: nil
139
144
  )
140
145
  if rule_id.nil? || rule_id == ''
141
146
  raise Appwrite::Exception.new('Missing required parameter: "ruleId"')
142
147
  end
143
148
 
144
149
  api_path = '/waf/rules/bypass/{ruleId}'
145
- .gsub('{ruleId}', rule_id)
150
+ .gsub('{ruleId}', @client.encode_path(rule_id))
146
151
 
147
152
  api_params = {
148
153
  resourceType: resource_type,
@@ -152,6 +157,7 @@ module Appwrite
152
157
  priority: priority,
153
158
  enabled: enabled,
154
159
  conditions: conditions,
160
+ schedule: schedule,
155
161
  }
156
162
 
157
163
  api_headers = {
@@ -175,8 +181,9 @@ module Appwrite
175
181
  # challenged again. Conditions can match request attributes including `ip`
176
182
  # (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`,
177
183
  # `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`,
178
- # `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions
179
- # on `city` and `state` require the premium Geo DB addon.
184
+ # `accept`, `acceptLanguage`, `cookie`, `userAgent`, `os`, `osVersion`,
185
+ # `browser`, and `browserVersion`. Conditions on `city` and `state` require
186
+ # the premium Geo DB addon.
180
187
  #
181
188
  #
182
189
  # @param [String] rule_id Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -190,6 +197,7 @@ module Appwrite
190
197
  # @param [Array] conditions Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
191
198
  # @param [Integer] difficulty Challenge difficulty from 1 (easiest) to 5 (hardest). Higher values demand more client-side proof-of-work.
192
199
  # @param [Integer] ttl How long, in seconds, a visitor stays cleared after passing the challenge before being challenged again.
200
+ # @param [Hash] schedule When the rule is active: mode, days, interval, anchor, startTime and endTime (HH:MM), and an optional IANA timezone (UTC by default). Leave out for always on; on update, leave out to keep the current schedule and pass an empty object to remove it.
193
201
  #
194
202
  # @return [WafRuleChallenge]
195
203
  def create_challenge_rule(
@@ -203,7 +211,8 @@ module Appwrite
203
211
  enabled: nil,
204
212
  conditions: nil,
205
213
  difficulty: nil,
206
- ttl: nil
214
+ ttl: nil,
215
+ schedule: nil
207
216
  )
208
217
  if rule_id.nil?
209
218
  raise Appwrite::Exception.new('Missing required parameter: "ruleId"')
@@ -231,6 +240,7 @@ module Appwrite
231
240
  conditions: conditions,
232
241
  difficulty: difficulty,
233
242
  ttl: ttl,
243
+ schedule: schedule,
234
244
  }
235
245
 
236
246
  api_headers = {
@@ -254,8 +264,9 @@ module Appwrite
254
264
  # challenged again. Conditions can match request attributes including `ip`
255
265
  # (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`,
256
266
  # `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`,
257
- # `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions
258
- # on `city` and `state` require the premium Geo DB addon.
267
+ # `accept`, `acceptLanguage`, `cookie`, `userAgent`, `os`, `osVersion`,
268
+ # `browser`, and `browserVersion`. Conditions on `city` and `state` require
269
+ # the premium Geo DB addon.
259
270
  #
260
271
  #
261
272
  # @param [String] rule_id Rule ID.
@@ -269,6 +280,7 @@ module Appwrite
269
280
  # @param [Array] conditions Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
270
281
  # @param [Integer] difficulty Challenge difficulty from 1 (easiest) to 5 (hardest). Higher values demand more client-side proof-of-work.
271
282
  # @param [Integer] ttl How long, in seconds, a visitor stays cleared after passing the challenge before being challenged again.
283
+ # @param [Hash] schedule When the rule is active: mode, days, interval, anchor, startTime and endTime (HH:MM), and an optional IANA timezone (UTC by default). Leave out for always on; on update, leave out to keep the current schedule and pass an empty object to remove it.
272
284
  #
273
285
  # @return [WafRuleChallenge]
274
286
  def update_challenge_rule(
@@ -282,14 +294,15 @@ module Appwrite
282
294
  enabled: nil,
283
295
  conditions: nil,
284
296
  difficulty: nil,
285
- ttl: nil
297
+ ttl: nil,
298
+ schedule: nil
286
299
  )
287
300
  if rule_id.nil? || rule_id == ''
288
301
  raise Appwrite::Exception.new('Missing required parameter: "ruleId"')
289
302
  end
290
303
 
291
304
  api_path = '/waf/rules/challenge/{ruleId}'
292
- .gsub('{ruleId}', rule_id)
305
+ .gsub('{ruleId}', @client.encode_path(rule_id))
293
306
 
294
307
  api_params = {
295
308
  resourceType: resource_type,
@@ -302,6 +315,7 @@ module Appwrite
302
315
  conditions: conditions,
303
316
  difficulty: difficulty,
304
317
  ttl: ttl,
318
+ schedule: schedule,
305
319
  }
306
320
 
307
321
  api_headers = {
@@ -322,9 +336,19 @@ module Appwrite
322
336
  # Create a deny WAF rule. Conditions can match request attributes including
323
337
  # `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`,
324
338
  # `host`, `country`, `continent`, `headers.<name>`, `query.<key>`,
325
- # `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and
326
- # `browserVersion`. Conditions on `city` and `state` require the premium Geo
327
- # DB addon.
339
+ # `queryKeys`, `accept`, `acceptLanguage`, `cookie`, `userAgent`, `os`,
340
+ # `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and
341
+ # `state` require the premium Geo DB addon. `sessionAge` and `mfaAge` hold
342
+ # the seconds since the request's session was created and since its last MFA
343
+ # challenge. Both are null for requests without a session, such as guests and
344
+ # API keys, while a request authenticated with the `x-appwrite-jwt` header
345
+ # carries the age of the session its token is bound to; on `functions` rules
346
+ # the session comes from the `x-appwrite-user-jwt` header, and `mfaAge` is
347
+ # null when the session never completed MFA. A deny matching on `mfaAge`
348
+ # returns `user_challenge_required` and one matching on `sessionAge` returns
349
+ # `user_reauthentication_required`, both with status 401, so the user can
350
+ # sign in again and retry. To also deny requests without a session, combine
351
+ # `isNull` and `greaterThan` in an `or` condition.
328
352
  #
329
353
  #
330
354
  # @param [String] rule_id Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -335,6 +359,7 @@ module Appwrite
335
359
  # @param [Integer] priority Evaluation priority. Lower numbers run earlier.
336
360
  # @param [] enabled Set to false to create the rule in a disabled state.
337
361
  # @param [Array] conditions Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
362
+ # @param [Hash] schedule When the rule is active: mode, days, interval, anchor, startTime and endTime (HH:MM), and an optional IANA timezone (UTC by default). Leave out for always on; on update, leave out to keep the current schedule and pass an empty object to remove it.
338
363
  #
339
364
  # @return [WafRuleDeny]
340
365
  def create_deny_rule(
@@ -345,7 +370,8 @@ module Appwrite
345
370
  description: nil,
346
371
  priority: nil,
347
372
  enabled: nil,
348
- conditions: nil
373
+ conditions: nil,
374
+ schedule: nil
349
375
  )
350
376
  if rule_id.nil?
351
377
  raise Appwrite::Exception.new('Missing required parameter: "ruleId"')
@@ -370,6 +396,7 @@ module Appwrite
370
396
  priority: priority,
371
397
  enabled: enabled,
372
398
  conditions: conditions,
399
+ schedule: schedule,
373
400
  }
374
401
 
375
402
  api_headers = {
@@ -390,9 +417,19 @@ module Appwrite
390
417
  # Update a deny WAF rule. Conditions can match request attributes including
391
418
  # `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`,
392
419
  # `host`, `country`, `continent`, `headers.<name>`, `query.<key>`,
393
- # `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and
394
- # `browserVersion`. Conditions on `city` and `state` require the premium Geo
395
- # DB addon.
420
+ # `queryKeys`, `accept`, `acceptLanguage`, `cookie`, `userAgent`, `os`,
421
+ # `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and
422
+ # `state` require the premium Geo DB addon. `sessionAge` and `mfaAge` hold
423
+ # the seconds since the request's session was created and since its last MFA
424
+ # challenge. Both are null for requests without a session, such as guests and
425
+ # API keys, while a request authenticated with the `x-appwrite-jwt` header
426
+ # carries the age of the session its token is bound to; on `functions` rules
427
+ # the session comes from the `x-appwrite-user-jwt` header, and `mfaAge` is
428
+ # null when the session never completed MFA. A deny matching on `mfaAge`
429
+ # returns `user_challenge_required` and one matching on `sessionAge` returns
430
+ # `user_reauthentication_required`, both with status 401, so the user can
431
+ # sign in again and retry. To also deny requests without a session, combine
432
+ # `isNull` and `greaterThan` in an `or` condition.
396
433
  #
397
434
  #
398
435
  # @param [String] rule_id Rule ID.
@@ -403,6 +440,7 @@ module Appwrite
403
440
  # @param [Integer] priority Evaluation priority. Lower numbers run earlier.
404
441
  # @param [] enabled Set to false to disable the rule.
405
442
  # @param [Array] conditions Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
443
+ # @param [Hash] schedule When the rule is active: mode, days, interval, anchor, startTime and endTime (HH:MM), and an optional IANA timezone (UTC by default). Leave out for always on; on update, leave out to keep the current schedule and pass an empty object to remove it.
406
444
  #
407
445
  # @return [WafRuleDeny]
408
446
  def update_deny_rule(
@@ -413,14 +451,15 @@ module Appwrite
413
451
  description: nil,
414
452
  priority: nil,
415
453
  enabled: nil,
416
- conditions: nil
454
+ conditions: nil,
455
+ schedule: nil
417
456
  )
418
457
  if rule_id.nil? || rule_id == ''
419
458
  raise Appwrite::Exception.new('Missing required parameter: "ruleId"')
420
459
  end
421
460
 
422
461
  api_path = '/waf/rules/deny/{ruleId}'
423
- .gsub('{ruleId}', rule_id)
462
+ .gsub('{ruleId}', @client.encode_path(rule_id))
424
463
 
425
464
  api_params = {
426
465
  resourceType: resource_type,
@@ -430,6 +469,7 @@ module Appwrite
430
469
  priority: priority,
431
470
  enabled: enabled,
432
471
  conditions: conditions,
472
+ schedule: schedule,
433
473
  }
434
474
 
435
475
  api_headers = {
@@ -452,9 +492,9 @@ module Appwrite
452
492
  # without an authenticated user skip `userId` rules). Conditions can match
453
493
  # request attributes including `ip` (plain IPs or CIDR blocks like
454
494
  # `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`,
455
- # `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`,
456
- # `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and
457
- # `state` require the premium Geo DB addon.
495
+ # `headers.<name>`, `query.<key>`, `queryKeys`, `accept`, `acceptLanguage`,
496
+ # `cookie`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`.
497
+ # Conditions on `city` and `state` require the premium Geo DB addon.
458
498
  #
459
499
  #
460
500
  # @param [String] rule_id Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -470,6 +510,7 @@ module Appwrite
470
510
  # @param [Integer] priority Evaluation priority. Lower numbers run earlier.
471
511
  # @param [] enabled Set to false to create the rule in a disabled state.
472
512
  # @param [Array] conditions Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
513
+ # @param [Hash] schedule When the rule is active: mode, days, interval, anchor, startTime and endTime (HH:MM), and an optional IANA timezone (UTC by default). Leave out for always on; on update, leave out to keep the current schedule and pass an empty object to remove it.
473
514
  #
474
515
  # @return [WafRuleRateLimit]
475
516
  def create_rate_limit_rule(
@@ -485,7 +526,8 @@ module Appwrite
485
526
  max_bucket_size: nil,
486
527
  priority: nil,
487
528
  enabled: nil,
488
- conditions: nil
529
+ conditions: nil,
530
+ schedule: nil
489
531
  )
490
532
  if rule_id.nil?
491
533
  raise Appwrite::Exception.new('Missing required parameter: "ruleId"')
@@ -523,6 +565,7 @@ module Appwrite
523
565
  priority: priority,
524
566
  enabled: enabled,
525
567
  conditions: conditions,
568
+ schedule: schedule,
526
569
  }
527
570
 
528
571
  api_headers = {
@@ -545,9 +588,9 @@ module Appwrite
545
588
  # without an authenticated user skip `userId` rules). Conditions can match
546
589
  # request attributes including `ip` (plain IPs or CIDR blocks like
547
590
  # `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`,
548
- # `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`,
549
- # `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and
550
- # `state` require the premium Geo DB addon.
591
+ # `headers.<name>`, `query.<key>`, `queryKeys`, `accept`, `acceptLanguage`,
592
+ # `cookie`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`.
593
+ # Conditions on `city` and `state` require the premium Geo DB addon.
551
594
  #
552
595
  #
553
596
  # @param [String] rule_id Rule ID.
@@ -562,6 +605,7 @@ module Appwrite
562
605
  # @param [Integer] priority Evaluation priority. Lower numbers run earlier.
563
606
  # @param [] enabled Set to false to disable the rule.
564
607
  # @param [Array] conditions Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
608
+ # @param [Hash] schedule When the rule is active: mode, days, interval, anchor, startTime and endTime (HH:MM), and an optional IANA timezone (UTC by default). Leave out for always on; on update, leave out to keep the current schedule and pass an empty object to remove it.
565
609
  #
566
610
  # @return [WafRuleRateLimit]
567
611
  def update_rate_limit_rule(
@@ -576,14 +620,15 @@ module Appwrite
576
620
  max_bucket_size: nil,
577
621
  priority: nil,
578
622
  enabled: nil,
579
- conditions: nil
623
+ conditions: nil,
624
+ schedule: nil
580
625
  )
581
626
  if rule_id.nil? || rule_id == ''
582
627
  raise Appwrite::Exception.new('Missing required parameter: "ruleId"')
583
628
  end
584
629
 
585
630
  api_path = '/waf/rules/rate-limit/{ruleId}'
586
- .gsub('{ruleId}', rule_id)
631
+ .gsub('{ruleId}', @client.encode_path(rule_id))
587
632
 
588
633
  api_params = {
589
634
  resourceType: resource_type,
@@ -597,6 +642,7 @@ module Appwrite
597
642
  priority: priority,
598
643
  enabled: enabled,
599
644
  conditions: conditions,
645
+ schedule: schedule,
600
646
  }
601
647
 
602
648
  api_headers = {
@@ -617,9 +663,9 @@ module Appwrite
617
663
  # Create a redirect WAF rule. Conditions can match request attributes
618
664
  # including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`,
619
665
  # `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`,
620
- # `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and
621
- # `browserVersion`. Conditions on `city` and `state` require the premium Geo
622
- # DB addon.
666
+ # `queryKeys`, `accept`, `acceptLanguage`, `cookie`, `userAgent`, `os`,
667
+ # `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and
668
+ # `state` require the premium Geo DB addon.
623
669
  #
624
670
  #
625
671
  # @param [String] rule_id Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one.
@@ -632,6 +678,7 @@ module Appwrite
632
678
  # @param [Integer] priority Evaluation priority. Lower numbers run earlier.
633
679
  # @param [] enabled Set to false to create the rule in a disabled state.
634
680
  # @param [Array] conditions Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
681
+ # @param [Hash] schedule When the rule is active: mode, days, interval, anchor, startTime and endTime (HH:MM), and an optional IANA timezone (UTC by default). Leave out for always on; on update, leave out to keep the current schedule and pass an empty object to remove it.
635
682
  #
636
683
  # @return [WafRuleRedirect]
637
684
  def create_redirect_rule(
@@ -644,7 +691,8 @@ module Appwrite
644
691
  description: nil,
645
692
  priority: nil,
646
693
  enabled: nil,
647
- conditions: nil
694
+ conditions: nil,
695
+ schedule: nil
648
696
  )
649
697
  if rule_id.nil?
650
698
  raise Appwrite::Exception.new('Missing required parameter: "ruleId"')
@@ -679,6 +727,7 @@ module Appwrite
679
727
  priority: priority,
680
728
  enabled: enabled,
681
729
  conditions: conditions,
730
+ schedule: schedule,
682
731
  }
683
732
 
684
733
  api_headers = {
@@ -699,9 +748,9 @@ module Appwrite
699
748
  # Update a redirect WAF rule. Conditions can match request attributes
700
749
  # including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`,
701
750
  # `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`,
702
- # `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and
703
- # `browserVersion`. Conditions on `city` and `state` require the premium Geo
704
- # DB addon.
751
+ # `queryKeys`, `accept`, `acceptLanguage`, `cookie`, `userAgent`, `os`,
752
+ # `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and
753
+ # `state` require the premium Geo DB addon.
705
754
  #
706
755
  #
707
756
  # @param [String] rule_id Rule ID.
@@ -714,6 +763,7 @@ module Appwrite
714
763
  # @param [Integer] priority Evaluation priority. Lower numbers run earlier.
715
764
  # @param [] enabled Set to false to disable the rule.
716
765
  # @param [Array] conditions Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long.
766
+ # @param [Hash] schedule When the rule is active: mode, days, interval, anchor, startTime and endTime (HH:MM), and an optional IANA timezone (UTC by default). Leave out for always on; on update, leave out to keep the current schedule and pass an empty object to remove it.
717
767
  #
718
768
  # @return [WafRuleRedirect]
719
769
  def update_redirect_rule(
@@ -726,14 +776,15 @@ module Appwrite
726
776
  status_code: nil,
727
777
  priority: nil,
728
778
  enabled: nil,
729
- conditions: nil
779
+ conditions: nil,
780
+ schedule: nil
730
781
  )
731
782
  if rule_id.nil? || rule_id == ''
732
783
  raise Appwrite::Exception.new('Missing required parameter: "ruleId"')
733
784
  end
734
785
 
735
786
  api_path = '/waf/rules/redirect/{ruleId}'
736
- .gsub('{ruleId}', rule_id)
787
+ .gsub('{ruleId}', @client.encode_path(rule_id))
737
788
 
738
789
  api_params = {
739
790
  resourceType: resource_type,
@@ -745,6 +796,7 @@ module Appwrite
745
796
  priority: priority,
746
797
  enabled: enabled,
747
798
  conditions: conditions,
799
+ schedule: schedule,
748
800
  }
749
801
 
750
802
  api_headers = {
@@ -776,7 +828,7 @@ module Appwrite
776
828
  end
777
829
 
778
830
  api_path = '/waf/rules/{ruleId}'
779
- .gsub('{ruleId}', rule_id)
831
+ .gsub('{ruleId}', @client.encode_path(rule_id))
780
832
 
781
833
  api_params = {}
782
834
 
@@ -838,7 +890,7 @@ module Appwrite
838
890
  end
839
891
 
840
892
  api_path = '/waf/rules/{ruleId}'
841
- .gsub('{ruleId}', rule_id)
893
+ .gsub('{ruleId}', @client.encode_path(rule_id))
842
894
 
843
895
  api_params = {}
844
896
 
@@ -125,7 +125,7 @@ module Appwrite
125
125
  end
126
126
 
127
127
  api_path = '/webhooks/{webhookId}'
128
- .gsub('{webhookId}', webhook_id)
128
+ .gsub('{webhookId}', @client.encode_path(webhook_id))
129
129
 
130
130
  api_params = {}
131
131
 
@@ -185,7 +185,7 @@ module Appwrite
185
185
  end
186
186
 
187
187
  api_path = '/webhooks/{webhookId}'
188
- .gsub('{webhookId}', webhook_id)
188
+ .gsub('{webhookId}', @client.encode_path(webhook_id))
189
189
 
190
190
  api_params = {
191
191
  name: name,
@@ -227,7 +227,7 @@ module Appwrite
227
227
  end
228
228
 
229
229
  api_path = '/webhooks/{webhookId}'
230
- .gsub('{webhookId}', webhook_id)
230
+ .gsub('{webhookId}', @client.encode_path(webhook_id))
231
231
 
232
232
  api_params = {}
233
233
 
@@ -262,7 +262,7 @@ module Appwrite
262
262
  end
263
263
 
264
264
  api_path = '/webhooks/{webhookId}/secret'
265
- .gsub('{webhookId}', webhook_id)
265
+ .gsub('{webhookId}', @client.encode_path(webhook_id))
266
266
 
267
267
  api_params = {
268
268
  secret: secret,
data/lib/appwrite.rb CHANGED
@@ -1,4 +1,6 @@
1
1
  require 'net/http'
2
+ require 'openssl'
3
+ require 'securerandom'
2
4
  require 'uri'
3
5
  require 'json'
4
6
  require 'mime/types'
@@ -56,6 +58,7 @@ require_relative 'appwrite/models/topic_list'
56
58
  require_relative 'appwrite/models/subscriber_list'
57
59
  require_relative 'appwrite/models/target_list'
58
60
  require_relative 'appwrite/models/transaction_list'
61
+ require_relative 'appwrite/models/migration_list'
59
62
  require_relative 'appwrite/models/specification_list'
60
63
  require_relative 'appwrite/models/vectorsdb_collection_list'
61
64
  require_relative 'appwrite/models/embedding_list'
@@ -122,6 +125,7 @@ require_relative 'appwrite/models/algo_argon2'
122
125
  require_relative 'appwrite/models/account'
123
126
  require_relative 'appwrite/models/preferences'
124
127
  require_relative 'appwrite/models/session'
128
+ require_relative 'appwrite/models/device'
125
129
  require_relative 'appwrite/models/identity'
126
130
  require_relative 'appwrite/models/token'
127
131
  require_relative 'appwrite/models/jwt'
@@ -189,6 +193,7 @@ require_relative 'appwrite/models/o_auth2_keycloak'
189
193
  require_relative 'appwrite/models/o_auth2_oidc'
190
194
  require_relative 'appwrite/models/o_auth2_okta'
191
195
  require_relative 'appwrite/models/o_auth2_kick'
196
+ require_relative 'appwrite/models/o_auth2_vipps'
192
197
  require_relative 'appwrite/models/o_auth2_apple'
193
198
  require_relative 'appwrite/models/o_auth2_microsoft'
194
199
  require_relative 'appwrite/models/o_auth2_resend'
@@ -213,6 +218,8 @@ require_relative 'appwrite/models/policy_deny_aliased_email'
213
218
  require_relative 'appwrite/models/policy_deny_disposable_email'
214
219
  require_relative 'appwrite/models/policy_deny_free_email'
215
220
  require_relative 'appwrite/models/policy_deny_corporate_email'
221
+ require_relative 'appwrite/models/policy_deny_realtime_guests'
222
+ require_relative 'appwrite/models/policy_account_devices'
216
223
  require_relative 'appwrite/models/platform_web'
217
224
  require_relative 'appwrite/models/platform_apple'
218
225
  require_relative 'appwrite/models/platform_android'
@@ -244,6 +251,7 @@ require_relative 'appwrite/models/topic'
244
251
  require_relative 'appwrite/models/transaction'
245
252
  require_relative 'appwrite/models/subscriber'
246
253
  require_relative 'appwrite/models/target'
254
+ require_relative 'appwrite/models/migration'
247
255
  require_relative 'appwrite/models/insight'
248
256
  require_relative 'appwrite/models/insight_cta'
249
257
  require_relative 'appwrite/models/report'
@@ -285,6 +293,8 @@ require_relative 'appwrite/models/backup_policy'
285
293
  require_relative 'appwrite/models/dedicated_database_pooler'
286
294
  require_relative 'appwrite/models/postgres_extension'
287
295
  require_relative 'appwrite/models/program'
296
+ require_relative 'appwrite/models/environment'
297
+ require_relative 'appwrite/models/environment_list'
288
298
  require_relative 'appwrite/models/backup_restoration'
289
299
  require_relative 'appwrite/models/dedicated_database_restoration_list'
290
300
  require_relative 'appwrite/models/dedicated_database_specification'
@@ -363,8 +373,14 @@ require_relative 'appwrite/enums/deployment_download_type'
363
373
  require_relative 'appwrite/enums/execution_method'
364
374
  require_relative 'appwrite/enums/message_priority'
365
375
  require_relative 'appwrite/enums/smtp_encryption'
376
+ require_relative 'appwrite/enums/appwrite_migration_resource'
377
+ require_relative 'appwrite/enums/on_duplicate'
378
+ require_relative 'appwrite/enums/firebase_migration_resource'
379
+ require_relative 'appwrite/enums/n_host_migration_resource'
380
+ require_relative 'appwrite/enums/supabase_migration_resource'
366
381
  require_relative 'appwrite/enums/region'
367
382
  require_relative 'appwrite/enums/project_auth_method_id'
383
+ require_relative 'appwrite/enums/environment_resource'
368
384
  require_relative 'appwrite/enums/project_o_auth2_auth0_prompt'
369
385
  require_relative 'appwrite/enums/project_o_auth2_discord_prompt'
370
386
  require_relative 'appwrite/enums/project_o_auth2_git_hub_prompt'
@@ -435,6 +451,7 @@ require_relative 'appwrite/services/functions'
435
451
  require_relative 'appwrite/services/graphql'
436
452
  require_relative 'appwrite/services/locale'
437
453
  require_relative 'appwrite/services/messaging'
454
+ require_relative 'appwrite/services/migrations'
438
455
  require_relative 'appwrite/services/mongo'
439
456
  require_relative 'appwrite/services/mysql'
440
457
  require_relative 'appwrite/services/oauth2'