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
@@ -337,7 +337,7 @@ module Appwrite
337
337
  end
338
338
 
339
339
  api_path = '/proxy/rules/{ruleId}'
340
- .gsub('{ruleId}', rule_id)
340
+ .gsub('{ruleId}', @client.encode_path(rule_id))
341
341
 
342
342
  api_params = {}
343
343
 
@@ -368,7 +368,7 @@ module Appwrite
368
368
  end
369
369
 
370
370
  api_path = '/proxy/rules/{ruleId}'
371
- .gsub('{ruleId}', rule_id)
371
+ .gsub('{ruleId}', @client.encode_path(rule_id))
372
372
 
373
373
  api_params = {}
374
374
 
@@ -386,10 +386,163 @@ module Appwrite
386
386
  )
387
387
  end
388
388
 
389
+ # Update the function and VCS branch a function proxy rule executes. The rule
390
+ # domain cannot be changed.
391
+ #
392
+ # @param [String] rule_id Rule ID.
393
+ # @param [String] function_id ID of function to be executed.
394
+ # @param [String] branch Name of VCS branch to deploy changes automatically
395
+ #
396
+ # @return [ProxyRule]
397
+ def update_function_rule(
398
+ rule_id:,
399
+ function_id:,
400
+ branch: nil
401
+ )
402
+ if rule_id.nil? || rule_id == ''
403
+ raise Appwrite::Exception.new('Missing required parameter: "ruleId"')
404
+ end
405
+
406
+ if function_id.nil?
407
+ raise Appwrite::Exception.new('Missing required parameter: "functionId"')
408
+ end
409
+
410
+ api_path = '/proxy/rules/{ruleId}/function'
411
+ .gsub('{ruleId}', @client.encode_path(rule_id))
412
+
413
+ api_params = {
414
+ functionId: function_id,
415
+ branch: branch,
416
+ }
417
+
418
+ api_headers = {
419
+ "X-Appwrite-Project": @client.get_config('project'),
420
+ "content-type": 'application/json',
421
+ "accept": 'application/json',
422
+ }
423
+
424
+ @client.call(
425
+ method: 'PATCH',
426
+ path: api_path,
427
+ headers: api_headers,
428
+ params: api_params,
429
+ response_type: Models::ProxyRule
430
+ )
431
+ end
432
+
433
+ # Update the target URL, status code and parent resource of a redirect proxy
434
+ # rule. The rule domain cannot be changed.
435
+ #
436
+ # @param [String] rule_id Rule ID.
437
+ # @param [String] url Target URL of redirection
438
+ # @param [StatusCode] status_code Status code of redirection
439
+ # @param [String] resource_id ID of parent resource.
440
+ # @param [ProxyResourceType] resource_type Type of parent resource.
441
+ #
442
+ # @return [ProxyRule]
443
+ def update_redirect_rule(
444
+ rule_id:,
445
+ url:,
446
+ status_code:,
447
+ resource_id:,
448
+ resource_type:
449
+ )
450
+ if rule_id.nil? || rule_id == ''
451
+ raise Appwrite::Exception.new('Missing required parameter: "ruleId"')
452
+ end
453
+
454
+ if url.nil?
455
+ raise Appwrite::Exception.new('Missing required parameter: "url"')
456
+ end
457
+
458
+ if status_code.nil?
459
+ raise Appwrite::Exception.new('Missing required parameter: "statusCode"')
460
+ end
461
+
462
+ if resource_id.nil?
463
+ raise Appwrite::Exception.new('Missing required parameter: "resourceId"')
464
+ end
465
+
466
+ if resource_type.nil?
467
+ raise Appwrite::Exception.new('Missing required parameter: "resourceType"')
468
+ end
469
+
470
+ api_path = '/proxy/rules/{ruleId}/redirect'
471
+ .gsub('{ruleId}', @client.encode_path(rule_id))
472
+
473
+ api_params = {
474
+ url: url,
475
+ statusCode: status_code,
476
+ resourceId: resource_id,
477
+ resourceType: resource_type,
478
+ }
479
+
480
+ api_headers = {
481
+ "X-Appwrite-Project": @client.get_config('project'),
482
+ "content-type": 'application/json',
483
+ "accept": 'application/json',
484
+ }
485
+
486
+ @client.call(
487
+ method: 'PATCH',
488
+ path: api_path,
489
+ headers: api_headers,
490
+ params: api_params,
491
+ response_type: Models::ProxyRule
492
+ )
493
+ end
494
+
495
+ # Update the site and VCS branch a site proxy rule serves. The rule domain
496
+ # cannot be changed.
497
+ #
498
+ # @param [String] rule_id Rule ID.
499
+ # @param [String] site_id ID of site to be executed.
500
+ # @param [String] branch Name of VCS branch to deploy changes automatically
501
+ #
502
+ # @return [ProxyRule]
503
+ def update_site_rule(
504
+ rule_id:,
505
+ site_id:,
506
+ branch: nil
507
+ )
508
+ if rule_id.nil? || rule_id == ''
509
+ raise Appwrite::Exception.new('Missing required parameter: "ruleId"')
510
+ end
511
+
512
+ if site_id.nil?
513
+ raise Appwrite::Exception.new('Missing required parameter: "siteId"')
514
+ end
515
+
516
+ api_path = '/proxy/rules/{ruleId}/site'
517
+ .gsub('{ruleId}', @client.encode_path(rule_id))
518
+
519
+ api_params = {
520
+ siteId: site_id,
521
+ branch: branch,
522
+ }
523
+
524
+ api_headers = {
525
+ "X-Appwrite-Project": @client.get_config('project'),
526
+ "content-type": 'application/json',
527
+ "accept": 'application/json',
528
+ }
529
+
530
+ @client.call(
531
+ method: 'PATCH',
532
+ path: api_path,
533
+ headers: api_headers,
534
+ params: api_params,
535
+ response_type: Models::ProxyRule
536
+ )
537
+ end
538
+
389
539
  # If not succeeded yet, retry verification process of a proxy rule domain.
390
540
  # This endpoint triggers domain verification by checking DNS records. If
391
541
  # verification is successful, a TLS certificate will be automatically
392
- # provisioned for the domain asynchronously in the background.
542
+ # provisioned for the domain asynchronously in the background. A verified
543
+ # rule whose certificate renewal failed or is blocked, or whose certificate
544
+ # expired, is checked the same way, and its certificate renewed in the
545
+ # background.
393
546
  #
394
547
  # @param [String] rule_id Rule ID.
395
548
  #
@@ -402,7 +555,7 @@ module Appwrite
402
555
  end
403
556
 
404
557
  api_path = '/proxy/rules/{ruleId}/status'
405
- .gsub('{ruleId}', rule_id)
558
+ .gsub('{ruleId}', @client.encode_path(rule_id))
406
559
 
407
560
  api_params = {}
408
561
 
@@ -65,7 +65,7 @@ module Appwrite
65
65
  # @param [Array] provider_paths List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes.
66
66
  # @param [String] build_specification Build specification for the site deployments.
67
67
  # @param [String] runtime_specification Runtime specification for the SSR executions.
68
- # @param [Integer] deployment_retention Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
68
+ # @param [Integer] deployment_retention Days to keep non-active deployments before deletion. Value 0 keeps all deployments unless the server applies a default retention.
69
69
  # @param [Array] scopes List of scopes allowed for API key auto-generated for every site build and SSR execution. Maximum of 200 scopes are allowed.
70
70
  # @param [String] description Optional description for the site.
71
71
  #
@@ -231,7 +231,7 @@ module Appwrite
231
231
  end
232
232
 
233
233
  api_path = '/sites/{siteId}'
234
- .gsub('{siteId}', site_id)
234
+ .gsub('{siteId}', @client.encode_path(site_id))
235
235
 
236
236
  api_params = {}
237
237
 
@@ -273,7 +273,7 @@ module Appwrite
273
273
  # @param [Array] provider_paths List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes.
274
274
  # @param [String] build_specification Build specification for the site deployments.
275
275
  # @param [String] runtime_specification Runtime specification for the SSR executions.
276
- # @param [Integer] deployment_retention Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
276
+ # @param [Integer] deployment_retention Days to keep non-active deployments before deletion. Value 0 keeps all deployments unless the server applies a default retention.
277
277
  # @param [Array] scopes List of scopes allowed for API key auto-generated for every site build and SSR execution. Maximum of 200 scopes are allowed.
278
278
  # @param [String] description Optional description for the site.
279
279
  #
@@ -318,7 +318,7 @@ module Appwrite
318
318
  end
319
319
 
320
320
  api_path = '/sites/{siteId}'
321
- .gsub('{siteId}', site_id)
321
+ .gsub('{siteId}', @client.encode_path(site_id))
322
322
 
323
323
  api_params = {
324
324
  name: name,
@@ -375,7 +375,7 @@ module Appwrite
375
375
  end
376
376
 
377
377
  api_path = '/sites/{siteId}'
378
- .gsub('{siteId}', site_id)
378
+ .gsub('{siteId}', @client.encode_path(site_id))
379
379
 
380
380
  api_params = {}
381
381
 
@@ -413,7 +413,7 @@ module Appwrite
413
413
  end
414
414
 
415
415
  api_path = '/sites/{siteId}/deployment'
416
- .gsub('{siteId}', site_id)
416
+ .gsub('{siteId}', @client.encode_path(site_id))
417
417
 
418
418
  api_params = {
419
419
  deploymentId: deployment_id,
@@ -454,7 +454,7 @@ module Appwrite
454
454
  end
455
455
 
456
456
  api_path = '/sites/{siteId}/deployments'
457
- .gsub('{siteId}', site_id)
457
+ .gsub('{siteId}', @client.encode_path(site_id))
458
458
 
459
459
  api_params = {
460
460
  queries: queries,
@@ -506,7 +506,7 @@ module Appwrite
506
506
  end
507
507
 
508
508
  api_path = '/sites/{siteId}/deployments'
509
- .gsub('{siteId}', site_id)
509
+ .gsub('{siteId}', @client.encode_path(site_id))
510
510
 
511
511
  api_params = {
512
512
  installCommand: install_command,
@@ -560,7 +560,7 @@ module Appwrite
560
560
  end
561
561
 
562
562
  api_path = '/sites/{siteId}/deployments/duplicate'
563
- .gsub('{siteId}', site_id)
563
+ .gsub('{siteId}', @client.encode_path(site_id))
564
564
 
565
565
  api_params = {
566
566
  deploymentId: deployment_id,
@@ -630,7 +630,7 @@ module Appwrite
630
630
  end
631
631
 
632
632
  api_path = '/sites/{siteId}/deployments/template'
633
- .gsub('{siteId}', site_id)
633
+ .gsub('{siteId}', @client.encode_path(site_id))
634
634
 
635
635
  api_params = {
636
636
  repository: repository,
@@ -685,7 +685,7 @@ module Appwrite
685
685
  end
686
686
 
687
687
  api_path = '/sites/{siteId}/deployments/vcs'
688
- .gsub('{siteId}', site_id)
688
+ .gsub('{siteId}', @client.encode_path(site_id))
689
689
 
690
690
  api_params = {
691
691
  type: type,
@@ -727,8 +727,8 @@ module Appwrite
727
727
  end
728
728
 
729
729
  api_path = '/sites/{siteId}/deployments/{deploymentId}'
730
- .gsub('{siteId}', site_id)
731
- .gsub('{deploymentId}', deployment_id)
730
+ .gsub('{siteId}', @client.encode_path(site_id))
731
+ .gsub('{deploymentId}', @client.encode_path(deployment_id))
732
732
 
733
733
  api_params = {}
734
734
 
@@ -765,8 +765,8 @@ module Appwrite
765
765
  end
766
766
 
767
767
  api_path = '/sites/{siteId}/deployments/{deploymentId}'
768
- .gsub('{siteId}', site_id)
769
- .gsub('{deploymentId}', deployment_id)
768
+ .gsub('{siteId}', @client.encode_path(site_id))
769
+ .gsub('{deploymentId}', @client.encode_path(deployment_id))
770
770
 
771
771
  api_params = {}
772
772
 
@@ -809,8 +809,8 @@ module Appwrite
809
809
  end
810
810
 
811
811
  api_path = '/sites/{siteId}/deployments/{deploymentId}/download'
812
- .gsub('{siteId}', site_id)
813
- .gsub('{deploymentId}', deployment_id)
812
+ .gsub('{siteId}', @client.encode_path(site_id))
813
+ .gsub('{deploymentId}', @client.encode_path(deployment_id))
814
814
 
815
815
  api_params = {
816
816
  type: type,
@@ -853,8 +853,8 @@ module Appwrite
853
853
  end
854
854
 
855
855
  api_path = '/sites/{siteId}/deployments/{deploymentId}/status'
856
- .gsub('{siteId}', site_id)
857
- .gsub('{deploymentId}', deployment_id)
856
+ .gsub('{siteId}', @client.encode_path(site_id))
857
+ .gsub('{deploymentId}', @client.encode_path(deployment_id))
858
858
 
859
859
  api_params = {}
860
860
 
@@ -891,7 +891,7 @@ module Appwrite
891
891
  end
892
892
 
893
893
  api_path = '/sites/{siteId}/logs'
894
- .gsub('{siteId}', site_id)
894
+ .gsub('{siteId}', @client.encode_path(site_id))
895
895
 
896
896
  api_params = {
897
897
  queries: queries,
@@ -931,8 +931,8 @@ module Appwrite
931
931
  end
932
932
 
933
933
  api_path = '/sites/{siteId}/logs/{logId}'
934
- .gsub('{siteId}', site_id)
935
- .gsub('{logId}', log_id)
934
+ .gsub('{siteId}', @client.encode_path(site_id))
935
+ .gsub('{logId}', @client.encode_path(log_id))
936
936
 
937
937
  api_params = {}
938
938
 
@@ -969,8 +969,8 @@ module Appwrite
969
969
  end
970
970
 
971
971
  api_path = '/sites/{siteId}/logs/{logId}'
972
- .gsub('{siteId}', site_id)
973
- .gsub('{logId}', log_id)
972
+ .gsub('{siteId}', @client.encode_path(site_id))
973
+ .gsub('{logId}', @client.encode_path(log_id))
974
974
 
975
975
  api_params = {}
976
976
 
@@ -1005,7 +1005,7 @@ module Appwrite
1005
1005
  end
1006
1006
 
1007
1007
  api_path = '/sites/{siteId}/variables'
1008
- .gsub('{siteId}', site_id)
1008
+ .gsub('{siteId}', @client.encode_path(site_id))
1009
1009
 
1010
1010
  api_params = {
1011
1011
  queries: queries,
@@ -1062,7 +1062,7 @@ module Appwrite
1062
1062
  end
1063
1063
 
1064
1064
  api_path = '/sites/{siteId}/variables'
1065
- .gsub('{siteId}', site_id)
1065
+ .gsub('{siteId}', @client.encode_path(site_id))
1066
1066
 
1067
1067
  api_params = {
1068
1068
  variableId: variable_id,
@@ -1106,8 +1106,8 @@ module Appwrite
1106
1106
  end
1107
1107
 
1108
1108
  api_path = '/sites/{siteId}/variables/{variableId}'
1109
- .gsub('{siteId}', site_id)
1110
- .gsub('{variableId}', variable_id)
1109
+ .gsub('{siteId}', @client.encode_path(site_id))
1110
+ .gsub('{variableId}', @client.encode_path(variable_id))
1111
1111
 
1112
1112
  api_params = {}
1113
1113
 
@@ -1152,8 +1152,8 @@ module Appwrite
1152
1152
  end
1153
1153
 
1154
1154
  api_path = '/sites/{siteId}/variables/{variableId}'
1155
- .gsub('{siteId}', site_id)
1156
- .gsub('{variableId}', variable_id)
1155
+ .gsub('{siteId}', @client.encode_path(site_id))
1156
+ .gsub('{variableId}', @client.encode_path(variable_id))
1157
1157
 
1158
1158
  api_params = {
1159
1159
  key: key,
@@ -1196,8 +1196,8 @@ module Appwrite
1196
1196
  end
1197
1197
 
1198
1198
  api_path = '/sites/{siteId}/variables/{variableId}'
1199
- .gsub('{siteId}', site_id)
1200
- .gsub('{variableId}', variable_id)
1199
+ .gsub('{siteId}', @client.encode_path(site_id))
1200
+ .gsub('{variableId}', @client.encode_path(variable_id))
1201
1201
 
1202
1202
  api_params = {}
1203
1203
 
@@ -51,7 +51,7 @@ module Appwrite
51
51
  # @param [Integer] maximum_file_size Maximum file size allowed in bytes. Maximum allowed value is 5GB.
52
52
  # @param [Array] allowed_file_extensions Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
53
53
  # @param [Compression] compression Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
54
- # @param [] encryption Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
54
+ # @param [] encryption Is encryption enabled? Files of any size are encrypted.
55
55
  # @param [] antivirus Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
56
56
  # @param [] transformations Are image transformations enabled?
57
57
  # @param [String] description Optional description for the bucket.
@@ -128,7 +128,7 @@ module Appwrite
128
128
  end
129
129
 
130
130
  api_path = '/storage/buckets/{bucketId}'
131
- .gsub('{bucketId}', bucket_id)
131
+ .gsub('{bucketId}', @client.encode_path(bucket_id))
132
132
 
133
133
  api_params = {}
134
134
 
@@ -156,7 +156,7 @@ module Appwrite
156
156
  # @param [Integer] maximum_file_size Maximum file size allowed in bytes. Maximum allowed value is 5GB.
157
157
  # @param [Array] allowed_file_extensions Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
158
158
  # @param [Compression] compression Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
159
- # @param [] encryption Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
159
+ # @param [] encryption Is encryption enabled? Files of any size are encrypted.
160
160
  # @param [] antivirus Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
161
161
  # @param [] transformations Are image transformations enabled?
162
162
  # @param [String] description Optional description for the bucket.
@@ -187,7 +187,7 @@ module Appwrite
187
187
  end
188
188
 
189
189
  api_path = '/storage/buckets/{bucketId}'
190
- .gsub('{bucketId}', bucket_id)
190
+ .gsub('{bucketId}', @client.encode_path(bucket_id))
191
191
 
192
192
  api_params = {
193
193
  name: name,
@@ -232,7 +232,7 @@ module Appwrite
232
232
  end
233
233
 
234
234
  api_path = '/storage/buckets/{bucketId}'
235
- .gsub('{bucketId}', bucket_id)
235
+ .gsub('{bucketId}', @client.encode_path(bucket_id))
236
236
 
237
237
  api_params = {}
238
238
 
@@ -270,7 +270,7 @@ module Appwrite
270
270
  end
271
271
 
272
272
  api_path = '/storage/buckets/{bucketId}/files'
273
- .gsub('{bucketId}', bucket_id)
273
+ .gsub('{bucketId}', @client.encode_path(bucket_id))
274
274
 
275
275
  api_params = {
276
276
  queries: queries,
@@ -339,7 +339,7 @@ module Appwrite
339
339
  end
340
340
 
341
341
  api_path = '/storage/buckets/{bucketId}/files'
342
- .gsub('{bucketId}', bucket_id)
342
+ .gsub('{bucketId}', @client.encode_path(bucket_id))
343
343
 
344
344
  api_params = {
345
345
  fileId: file_id,
@@ -389,8 +389,8 @@ module Appwrite
389
389
  end
390
390
 
391
391
  api_path = '/storage/buckets/{bucketId}/files/{fileId}'
392
- .gsub('{bucketId}', bucket_id)
393
- .gsub('{fileId}', file_id)
392
+ .gsub('{bucketId}', @client.encode_path(bucket_id))
393
+ .gsub('{fileId}', @client.encode_path(file_id))
394
394
 
395
395
  api_params = {}
396
396
 
@@ -432,8 +432,8 @@ module Appwrite
432
432
  end
433
433
 
434
434
  api_path = '/storage/buckets/{bucketId}/files/{fileId}'
435
- .gsub('{bucketId}', bucket_id)
436
- .gsub('{fileId}', file_id)
435
+ .gsub('{bucketId}', @client.encode_path(bucket_id))
436
+ .gsub('{fileId}', @client.encode_path(file_id))
437
437
 
438
438
  api_params = {
439
439
  name: name,
@@ -475,8 +475,8 @@ module Appwrite
475
475
  end
476
476
 
477
477
  api_path = '/storage/buckets/{bucketId}/files/{fileId}'
478
- .gsub('{bucketId}', bucket_id)
479
- .gsub('{fileId}', file_id)
478
+ .gsub('{bucketId}', @client.encode_path(bucket_id))
479
+ .gsub('{fileId}', @client.encode_path(file_id))
480
480
 
481
481
  api_params = {}
482
482
 
@@ -517,8 +517,8 @@ module Appwrite
517
517
  end
518
518
 
519
519
  api_path = '/storage/buckets/{bucketId}/files/{fileId}/download'
520
- .gsub('{bucketId}', bucket_id)
521
- .gsub('{fileId}', file_id)
520
+ .gsub('{bucketId}', @client.encode_path(bucket_id))
521
+ .gsub('{fileId}', @client.encode_path(file_id))
522
522
 
523
523
  api_params = {
524
524
  token: token,
@@ -584,8 +584,8 @@ module Appwrite
584
584
  end
585
585
 
586
586
  api_path = '/storage/buckets/{bucketId}/files/{fileId}/preview'
587
- .gsub('{bucketId}', bucket_id)
588
- .gsub('{fileId}', file_id)
587
+ .gsub('{bucketId}', @client.encode_path(bucket_id))
588
+ .gsub('{fileId}', @client.encode_path(file_id))
589
589
 
590
590
  api_params = {
591
591
  width: width,
@@ -638,8 +638,8 @@ module Appwrite
638
638
  end
639
639
 
640
640
  api_path = '/storage/buckets/{bucketId}/files/{fileId}/view'
641
- .gsub('{bucketId}', bucket_id)
642
- .gsub('{fileId}', file_id)
641
+ .gsub('{bucketId}', @client.encode_path(bucket_id))
642
+ .gsub('{fileId}', @client.encode_path(file_id))
643
643
 
644
644
  api_params = {
645
645
  token: token,