appwrite 22.0.0 → 23.1.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 (116) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +35 -2
  3. data/lib/appwrite/enums/auth_method.rb +13 -0
  4. data/lib/appwrite/enums/build_runtime.rb +3 -0
  5. data/lib/appwrite/enums/email_template_locale.rb +137 -0
  6. data/lib/appwrite/enums/email_template_type.rb +13 -0
  7. data/lib/appwrite/enums/o_auth_provider.rb +6 -0
  8. data/lib/appwrite/enums/platform_type.rb +11 -0
  9. data/lib/appwrite/enums/project_policy.rb +15 -0
  10. data/lib/appwrite/enums/protocol_id.rb +9 -0
  11. data/lib/appwrite/enums/proxy_resource_type.rb +8 -0
  12. data/lib/appwrite/enums/proxy_rule_deployment_resource_type.rb +8 -0
  13. data/lib/appwrite/enums/proxy_rule_status.rb +9 -0
  14. data/lib/appwrite/enums/runtime.rb +3 -0
  15. data/lib/appwrite/enums/scopes.rb +44 -27
  16. data/lib/appwrite/enums/secure.rb +8 -0
  17. data/lib/appwrite/enums/service_id.rb +23 -0
  18. data/lib/appwrite/enums/status_code.rb +10 -0
  19. data/lib/appwrite/models/attribute_bigint.rb +96 -0
  20. data/lib/appwrite/models/auth_provider.rb +47 -0
  21. data/lib/appwrite/models/billing_limits.rb +62 -0
  22. data/lib/appwrite/models/block.rb +72 -0
  23. data/lib/appwrite/models/column_bigint.rb +96 -0
  24. data/lib/appwrite/models/dev_key.rb +62 -0
  25. data/lib/appwrite/models/email_template.rb +62 -0
  26. data/lib/appwrite/models/email_template_list.rb +32 -0
  27. data/lib/appwrite/models/ephemeral_key.rb +67 -0
  28. data/lib/appwrite/models/key.rb +67 -0
  29. data/lib/appwrite/models/key_list.rb +32 -0
  30. data/lib/appwrite/models/log.rb +5 -0
  31. data/lib/appwrite/models/membership.rb +5 -0
  32. data/lib/appwrite/models/mock_number.rb +42 -0
  33. data/lib/appwrite/models/mock_number_list.rb +32 -0
  34. data/lib/appwrite/models/o_auth2_amazon.rb +42 -0
  35. data/lib/appwrite/models/o_auth2_apple.rb +52 -0
  36. data/lib/appwrite/models/o_auth2_auth0.rb +47 -0
  37. data/lib/appwrite/models/o_auth2_authentik.rb +47 -0
  38. data/lib/appwrite/models/o_auth2_autodesk.rb +42 -0
  39. data/lib/appwrite/models/o_auth2_bitbucket.rb +42 -0
  40. data/lib/appwrite/models/o_auth2_bitly.rb +42 -0
  41. data/lib/appwrite/models/o_auth2_box.rb +42 -0
  42. data/lib/appwrite/models/o_auth2_dailymotion.rb +42 -0
  43. data/lib/appwrite/models/o_auth2_discord.rb +42 -0
  44. data/lib/appwrite/models/o_auth2_disqus.rb +42 -0
  45. data/lib/appwrite/models/o_auth2_dropbox.rb +42 -0
  46. data/lib/appwrite/models/o_auth2_etsy.rb +42 -0
  47. data/lib/appwrite/models/o_auth2_facebook.rb +42 -0
  48. data/lib/appwrite/models/o_auth2_figma.rb +42 -0
  49. data/lib/appwrite/models/o_auth2_fusion_auth.rb +47 -0
  50. data/lib/appwrite/models/o_auth2_github.rb +42 -0
  51. data/lib/appwrite/models/o_auth2_gitlab.rb +47 -0
  52. data/lib/appwrite/models/o_auth2_google.rb +42 -0
  53. data/lib/appwrite/models/o_auth2_keycloak.rb +52 -0
  54. data/lib/appwrite/models/o_auth2_kick.rb +42 -0
  55. data/lib/appwrite/models/o_auth2_linkedin.rb +42 -0
  56. data/lib/appwrite/models/o_auth2_microsoft.rb +47 -0
  57. data/lib/appwrite/models/o_auth2_notion.rb +42 -0
  58. data/lib/appwrite/models/o_auth2_oidc.rb +62 -0
  59. data/lib/appwrite/models/o_auth2_okta.rb +52 -0
  60. data/lib/appwrite/models/o_auth2_paypal.rb +42 -0
  61. data/lib/appwrite/models/o_auth2_podio.rb +42 -0
  62. data/lib/appwrite/models/o_auth2_provider_list.rb +32 -0
  63. data/lib/appwrite/models/o_auth2_salesforce.rb +42 -0
  64. data/lib/appwrite/models/o_auth2_slack.rb +42 -0
  65. data/lib/appwrite/models/o_auth2_spotify.rb +42 -0
  66. data/lib/appwrite/models/o_auth2_stripe.rb +42 -0
  67. data/lib/appwrite/models/o_auth2_tradeshift.rb +42 -0
  68. data/lib/appwrite/models/o_auth2_twitch.rb +42 -0
  69. data/lib/appwrite/models/o_auth2_word_press.rb +42 -0
  70. data/lib/appwrite/models/o_auth2_x.rb +42 -0
  71. data/lib/appwrite/models/o_auth2_yahoo.rb +42 -0
  72. data/lib/appwrite/models/o_auth2_yandex.rb +42 -0
  73. data/lib/appwrite/models/o_auth2_zoho.rb +42 -0
  74. data/lib/appwrite/models/o_auth2_zoom.rb +42 -0
  75. data/lib/appwrite/models/platform_android.rb +71 -0
  76. data/lib/appwrite/models/platform_apple.rb +71 -0
  77. data/lib/appwrite/models/platform_linux.rb +71 -0
  78. data/lib/appwrite/models/platform_list.rb +32 -0
  79. data/lib/appwrite/models/platform_web.rb +71 -0
  80. data/lib/appwrite/models/platform_windows.rb +71 -0
  81. data/lib/appwrite/models/policy_list.rb +32 -0
  82. data/lib/appwrite/models/policy_membership_privacy.rb +52 -0
  83. data/lib/appwrite/models/policy_password_dictionary.rb +32 -0
  84. data/lib/appwrite/models/policy_password_history.rb +32 -0
  85. data/lib/appwrite/models/policy_password_personal_data.rb +32 -0
  86. data/lib/appwrite/models/policy_session_alert.rb +32 -0
  87. data/lib/appwrite/models/policy_session_duration.rb +32 -0
  88. data/lib/appwrite/models/policy_session_invalidation.rb +32 -0
  89. data/lib/appwrite/models/policy_session_limit.rb +32 -0
  90. data/lib/appwrite/models/policy_user_limit.rb +32 -0
  91. data/lib/appwrite/models/project.rb +427 -0
  92. data/lib/appwrite/models/proxy_rule.rb +127 -0
  93. data/lib/appwrite/models/proxy_rule_list.rb +32 -0
  94. data/lib/appwrite/models/webhook.rb +20 -20
  95. data/lib/appwrite/service.rb +1 -1
  96. data/lib/appwrite/services/account.rb +47 -2
  97. data/lib/appwrite/services/activities.rb +3 -1
  98. data/lib/appwrite/services/avatars.rb +9 -1
  99. data/lib/appwrite/services/backups.rb +13 -1
  100. data/lib/appwrite/services/databases.rb +258 -6
  101. data/lib/appwrite/services/functions.rb +40 -8
  102. data/lib/appwrite/services/graphql.rb +5 -3
  103. data/lib/appwrite/services/health.rb +26 -1
  104. data/lib/appwrite/services/locale.rb +9 -1
  105. data/lib/appwrite/services/messaging.rb +49 -1
  106. data/lib/appwrite/services/project.rb +3251 -5
  107. data/lib/appwrite/services/proxy.rb +303 -0
  108. data/lib/appwrite/services/sites.rb +39 -8
  109. data/lib/appwrite/services/storage.rb +14 -1
  110. data/lib/appwrite/services/tables_db.rb +252 -6
  111. data/lib/appwrite/services/teams.rb +14 -1
  112. data/lib/appwrite/services/tokens.rb +6 -1
  113. data/lib/appwrite/services/users.rb +44 -1
  114. data/lib/appwrite/services/webhooks.rb +31 -21
  115. data/lib/appwrite.rb +86 -0
  116. metadata +88 -2
@@ -0,0 +1,303 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ class Proxy < Service
5
+
6
+ def initialize(client)
7
+ @client = client
8
+ end
9
+
10
+ # Get a list of all the proxy rules. You can use the query params to filter
11
+ # your results.
12
+ #
13
+ # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch
14
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
15
+ #
16
+ # @return [ProxyRuleList]
17
+ def list_rules(queries: nil, total: nil)
18
+ api_path = '/proxy/rules'
19
+
20
+ api_params = {
21
+ queries: queries,
22
+ total: total,
23
+ }
24
+
25
+ api_headers = {
26
+ }
27
+
28
+ @client.call(
29
+ method: 'GET',
30
+ path: api_path,
31
+ headers: api_headers,
32
+ params: api_params,
33
+ response_type: Models::ProxyRuleList
34
+ )
35
+
36
+ end
37
+
38
+ # Create a new proxy rule for serving Appwrite's API on custom domain.
39
+ #
40
+ # Rule ID is automatically generated as MD5 hash of a rule domain for
41
+ # performance purposes.
42
+ #
43
+ # @param [String] domain Domain name.
44
+ #
45
+ # @return [ProxyRule]
46
+ def create_api_rule(domain:)
47
+ api_path = '/proxy/rules/api'
48
+
49
+ if domain.nil?
50
+ raise Appwrite::Exception.new('Missing required parameter: "domain"')
51
+ end
52
+
53
+ api_params = {
54
+ domain: domain,
55
+ }
56
+
57
+ api_headers = {
58
+ "content-type": 'application/json',
59
+ }
60
+
61
+ @client.call(
62
+ method: 'POST',
63
+ path: api_path,
64
+ headers: api_headers,
65
+ params: api_params,
66
+ response_type: Models::ProxyRule
67
+ )
68
+
69
+ end
70
+
71
+ # Create a new proxy rule for executing Appwrite Function on custom domain.
72
+ #
73
+ # Rule ID is automatically generated as MD5 hash of a rule domain for
74
+ # performance purposes.
75
+ #
76
+ # @param [String] domain Domain name.
77
+ # @param [String] function_id ID of function to be executed.
78
+ # @param [String] branch Name of VCS branch to deploy changes automatically
79
+ #
80
+ # @return [ProxyRule]
81
+ def create_function_rule(domain:, function_id:, branch: nil)
82
+ api_path = '/proxy/rules/function'
83
+
84
+ if domain.nil?
85
+ raise Appwrite::Exception.new('Missing required parameter: "domain"')
86
+ end
87
+
88
+ if function_id.nil?
89
+ raise Appwrite::Exception.new('Missing required parameter: "functionId"')
90
+ end
91
+
92
+ api_params = {
93
+ domain: domain,
94
+ functionId: function_id,
95
+ branch: branch,
96
+ }
97
+
98
+ api_headers = {
99
+ "content-type": 'application/json',
100
+ }
101
+
102
+ @client.call(
103
+ method: 'POST',
104
+ path: api_path,
105
+ headers: api_headers,
106
+ params: api_params,
107
+ response_type: Models::ProxyRule
108
+ )
109
+
110
+ end
111
+
112
+ # Create a new proxy rule for to redirect from custom domain to another
113
+ # domain.
114
+ #
115
+ # Rule ID is automatically generated as MD5 hash of a rule domain for
116
+ # performance purposes.
117
+ #
118
+ # @param [String] domain Domain name.
119
+ # @param [String] url Target URL of redirection
120
+ # @param [StatusCode] status_code Status code of redirection
121
+ # @param [String] resource_id ID of parent resource.
122
+ # @param [ProxyResourceType] resource_type Type of parent resource.
123
+ #
124
+ # @return [ProxyRule]
125
+ def create_redirect_rule(domain:, url:, status_code:, resource_id:, resource_type:)
126
+ api_path = '/proxy/rules/redirect'
127
+
128
+ if domain.nil?
129
+ raise Appwrite::Exception.new('Missing required parameter: "domain"')
130
+ end
131
+
132
+ if url.nil?
133
+ raise Appwrite::Exception.new('Missing required parameter: "url"')
134
+ end
135
+
136
+ if status_code.nil?
137
+ raise Appwrite::Exception.new('Missing required parameter: "statusCode"')
138
+ end
139
+
140
+ if resource_id.nil?
141
+ raise Appwrite::Exception.new('Missing required parameter: "resourceId"')
142
+ end
143
+
144
+ if resource_type.nil?
145
+ raise Appwrite::Exception.new('Missing required parameter: "resourceType"')
146
+ end
147
+
148
+ api_params = {
149
+ domain: domain,
150
+ url: url,
151
+ statusCode: status_code,
152
+ resourceId: resource_id,
153
+ resourceType: resource_type,
154
+ }
155
+
156
+ api_headers = {
157
+ "content-type": 'application/json',
158
+ }
159
+
160
+ @client.call(
161
+ method: 'POST',
162
+ path: api_path,
163
+ headers: api_headers,
164
+ params: api_params,
165
+ response_type: Models::ProxyRule
166
+ )
167
+
168
+ end
169
+
170
+ # Create a new proxy rule for serving Appwrite Site on custom domain.
171
+ #
172
+ # Rule ID is automatically generated as MD5 hash of a rule domain for
173
+ # performance purposes.
174
+ #
175
+ # @param [String] domain Domain name.
176
+ # @param [String] site_id ID of site to be executed.
177
+ # @param [String] branch Name of VCS branch to deploy changes automatically
178
+ #
179
+ # @return [ProxyRule]
180
+ def create_site_rule(domain:, site_id:, branch: nil)
181
+ api_path = '/proxy/rules/site'
182
+
183
+ if domain.nil?
184
+ raise Appwrite::Exception.new('Missing required parameter: "domain"')
185
+ end
186
+
187
+ if site_id.nil?
188
+ raise Appwrite::Exception.new('Missing required parameter: "siteId"')
189
+ end
190
+
191
+ api_params = {
192
+ domain: domain,
193
+ siteId: site_id,
194
+ branch: branch,
195
+ }
196
+
197
+ api_headers = {
198
+ "content-type": 'application/json',
199
+ }
200
+
201
+ @client.call(
202
+ method: 'POST',
203
+ path: api_path,
204
+ headers: api_headers,
205
+ params: api_params,
206
+ response_type: Models::ProxyRule
207
+ )
208
+
209
+ end
210
+
211
+ # Get a proxy rule by its unique ID.
212
+ #
213
+ # @param [String] rule_id Rule ID.
214
+ #
215
+ # @return [ProxyRule]
216
+ def get_rule(rule_id:)
217
+ api_path = '/proxy/rules/{ruleId}'
218
+ .gsub('{ruleId}', rule_id)
219
+
220
+ if rule_id.nil?
221
+ raise Appwrite::Exception.new('Missing required parameter: "ruleId"')
222
+ end
223
+
224
+ api_params = {
225
+ }
226
+
227
+ api_headers = {
228
+ }
229
+
230
+ @client.call(
231
+ method: 'GET',
232
+ path: api_path,
233
+ headers: api_headers,
234
+ params: api_params,
235
+ response_type: Models::ProxyRule
236
+ )
237
+
238
+ end
239
+
240
+ # Delete a proxy rule by its unique ID.
241
+ #
242
+ # @param [String] rule_id Rule ID.
243
+ #
244
+ # @return []
245
+ def delete_rule(rule_id:)
246
+ api_path = '/proxy/rules/{ruleId}'
247
+ .gsub('{ruleId}', rule_id)
248
+
249
+ if rule_id.nil?
250
+ raise Appwrite::Exception.new('Missing required parameter: "ruleId"')
251
+ end
252
+
253
+ api_params = {
254
+ }
255
+
256
+ api_headers = {
257
+ "content-type": 'application/json',
258
+ }
259
+
260
+ @client.call(
261
+ method: 'DELETE',
262
+ path: api_path,
263
+ headers: api_headers,
264
+ params: api_params,
265
+ )
266
+
267
+ end
268
+
269
+ # If not succeeded yet, retry verification process of a proxy rule domain.
270
+ # This endpoint triggers domain verification by checking DNS records. If
271
+ # verification is successful, a TLS certificate will be automatically
272
+ # provisioned for the domain asynchronously in the background.
273
+ #
274
+ # @param [String] rule_id Rule ID.
275
+ #
276
+ # @return [ProxyRule]
277
+ def update_rule_status(rule_id:)
278
+ api_path = '/proxy/rules/{ruleId}/status'
279
+ .gsub('{ruleId}', rule_id)
280
+
281
+ if rule_id.nil?
282
+ raise Appwrite::Exception.new('Missing required parameter: "ruleId"')
283
+ end
284
+
285
+ api_params = {
286
+ }
287
+
288
+ api_headers = {
289
+ "content-type": 'application/json',
290
+ }
291
+
292
+ @client.call(
293
+ method: 'PATCH',
294
+ path: api_path,
295
+ headers: api_headers,
296
+ params: api_params,
297
+ response_type: Models::ProxyRule
298
+ )
299
+
300
+ end
301
+
302
+ end
303
+ end
@@ -34,6 +34,7 @@ module Appwrite
34
34
  params: api_params,
35
35
  response_type: Models::SiteList
36
36
  )
37
+
37
38
  end
38
39
 
39
40
  # Create a new site.
@@ -115,6 +116,7 @@ module Appwrite
115
116
  params: api_params,
116
117
  response_type: Models::Site
117
118
  )
119
+
118
120
  end
119
121
 
120
122
  # Get a list of all frameworks that are currently available on the server
@@ -138,6 +140,7 @@ module Appwrite
138
140
  params: api_params,
139
141
  response_type: Models::FrameworkList
140
142
  )
143
+
141
144
  end
142
145
 
143
146
  # List allowed site specifications for this instance.
@@ -160,6 +163,7 @@ module Appwrite
160
163
  params: api_params,
161
164
  response_type: Models::SpecificationList
162
165
  )
166
+
163
167
  end
164
168
 
165
169
  # Get a site by its unique ID.
@@ -188,6 +192,7 @@ module Appwrite
188
192
  params: api_params,
189
193
  response_type: Models::Site
190
194
  )
195
+
191
196
  end
192
197
 
193
198
  # Update site by its unique ID.
@@ -265,6 +270,7 @@ module Appwrite
265
270
  params: api_params,
266
271
  response_type: Models::Site
267
272
  )
273
+
268
274
  end
269
275
 
270
276
  # Delete a site by its unique ID.
@@ -293,6 +299,7 @@ module Appwrite
293
299
  headers: api_headers,
294
300
  params: api_params,
295
301
  )
302
+
296
303
  end
297
304
 
298
305
  # Update the site active deployment. Use this endpoint to switch the code
@@ -329,6 +336,7 @@ module Appwrite
329
336
  params: api_params,
330
337
  response_type: Models::Site
331
338
  )
339
+
332
340
  end
333
341
 
334
342
  # Get a list of all the site's code deployments. You can use the query params
@@ -364,6 +372,7 @@ module Appwrite
364
372
  params: api_params,
365
373
  response_type: Models::DeploymentList
366
374
  )
375
+
367
376
  end
368
377
 
369
378
  # Create a new site code deployment. Use this endpoint to upload a new
@@ -414,6 +423,7 @@ module Appwrite
414
423
  on_progress: on_progress,
415
424
  response_type: Models::Deployment
416
425
  )
426
+
417
427
  end
418
428
 
419
429
  # Create a new build for an existing site deployment. This endpoint allows
@@ -453,6 +463,7 @@ module Appwrite
453
463
  params: api_params,
454
464
  response_type: Models::Deployment
455
465
  )
466
+
456
467
  end
457
468
 
458
469
  # Create a deployment based on a template.
@@ -518,6 +529,7 @@ module Appwrite
518
529
  params: api_params,
519
530
  response_type: Models::Deployment
520
531
  )
532
+
521
533
  end
522
534
 
523
535
  # Create a deployment when a site is connected to VCS.
@@ -563,6 +575,7 @@ module Appwrite
563
575
  params: api_params,
564
576
  response_type: Models::Deployment
565
577
  )
578
+
566
579
  end
567
580
 
568
581
  # Get a site deployment by its unique ID.
@@ -597,6 +610,7 @@ module Appwrite
597
610
  params: api_params,
598
611
  response_type: Models::Deployment
599
612
  )
613
+
600
614
  end
601
615
 
602
616
  # Delete a site deployment by its unique ID.
@@ -631,6 +645,7 @@ module Appwrite
631
645
  headers: api_headers,
632
646
  params: api_params,
633
647
  )
648
+
634
649
  end
635
650
 
636
651
  # Get a site deployment content by its unique ID. The endpoint response
@@ -668,6 +683,7 @@ module Appwrite
668
683
  headers: api_headers,
669
684
  params: api_params,
670
685
  )
686
+
671
687
  end
672
688
 
673
689
  # Cancel an ongoing site deployment build. If the build is already in
@@ -707,6 +723,7 @@ module Appwrite
707
723
  params: api_params,
708
724
  response_type: Models::Deployment
709
725
  )
726
+
710
727
  end
711
728
 
712
729
  # Get a list of all site logs. You can use the query params to filter your
@@ -740,6 +757,7 @@ module Appwrite
740
757
  params: api_params,
741
758
  response_type: Models::ExecutionList
742
759
  )
760
+
743
761
  end
744
762
 
745
763
  # Get a site request log by its unique ID.
@@ -774,6 +792,7 @@ module Appwrite
774
792
  params: api_params,
775
793
  response_type: Models::Execution
776
794
  )
795
+
777
796
  end
778
797
 
779
798
  # Delete a site log by its unique ID.
@@ -808,14 +827,17 @@ module Appwrite
808
827
  headers: api_headers,
809
828
  params: api_params,
810
829
  )
830
+
811
831
  end
812
832
 
813
833
  # Get a list of all variables of a specific site.
814
834
  #
815
835
  # @param [String] site_id Site unique ID.
836
+ # @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: key, resourceType, resourceId, secret
837
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
816
838
  #
817
839
  # @return [VariableList]
818
- def list_variables(site_id:)
840
+ def list_variables(site_id:, queries: nil, total: nil)
819
841
  api_path = '/sites/{siteId}/variables'
820
842
  .gsub('{siteId}', site_id)
821
843
 
@@ -824,6 +846,8 @@ module Appwrite
824
846
  end
825
847
 
826
848
  api_params = {
849
+ queries: queries,
850
+ total: total,
827
851
  }
828
852
 
829
853
  api_headers = {
@@ -836,18 +860,20 @@ module Appwrite
836
860
  params: api_params,
837
861
  response_type: Models::VariableList
838
862
  )
863
+
839
864
  end
840
865
 
841
866
  # Create a new site variable. These variables can be accessed during build
842
867
  # and runtime (server-side rendering) as environment variables.
843
868
  #
844
869
  # @param [String] site_id Site unique ID.
870
+ # @param [String] variable_id Variable 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.
845
871
  # @param [String] key Variable key. Max length: 255 chars.
846
872
  # @param [String] value Variable value. Max length: 8192 chars.
847
873
  # @param [] secret Secret variables can be updated or deleted, but only sites can read them during build and runtime.
848
874
  #
849
875
  # @return [Variable]
850
- def create_variable(site_id:, key:, value:, secret: nil)
876
+ def create_variable(site_id:, variable_id:, key:, value:, secret: nil)
851
877
  api_path = '/sites/{siteId}/variables'
852
878
  .gsub('{siteId}', site_id)
853
879
 
@@ -855,6 +881,10 @@ module Appwrite
855
881
  raise Appwrite::Exception.new('Missing required parameter: "siteId"')
856
882
  end
857
883
 
884
+ if variable_id.nil?
885
+ raise Appwrite::Exception.new('Missing required parameter: "variableId"')
886
+ end
887
+
858
888
  if key.nil?
859
889
  raise Appwrite::Exception.new('Missing required parameter: "key"')
860
890
  end
@@ -864,6 +894,7 @@ module Appwrite
864
894
  end
865
895
 
866
896
  api_params = {
897
+ variableId: variable_id,
867
898
  key: key,
868
899
  value: value,
869
900
  secret: secret,
@@ -880,6 +911,7 @@ module Appwrite
880
911
  params: api_params,
881
912
  response_type: Models::Variable
882
913
  )
914
+
883
915
  end
884
916
 
885
917
  # Get a variable by its unique ID.
@@ -914,6 +946,7 @@ module Appwrite
914
946
  params: api_params,
915
947
  response_type: Models::Variable
916
948
  )
949
+
917
950
  end
918
951
 
919
952
  # Update variable by its unique ID.
@@ -925,7 +958,7 @@ module Appwrite
925
958
  # @param [] secret Secret variables can be updated or deleted, but only sites can read them during build and runtime.
926
959
  #
927
960
  # @return [Variable]
928
- def update_variable(site_id:, variable_id:, key:, value: nil, secret: nil)
961
+ def update_variable(site_id:, variable_id:, key: nil, value: nil, secret: nil)
929
962
  api_path = '/sites/{siteId}/variables/{variableId}'
930
963
  .gsub('{siteId}', site_id)
931
964
  .gsub('{variableId}', variable_id)
@@ -938,10 +971,6 @@ module Appwrite
938
971
  raise Appwrite::Exception.new('Missing required parameter: "variableId"')
939
972
  end
940
973
 
941
- if key.nil?
942
- raise Appwrite::Exception.new('Missing required parameter: "key"')
943
- end
944
-
945
974
  api_params = {
946
975
  key: key,
947
976
  value: value,
@@ -959,6 +988,7 @@ module Appwrite
959
988
  params: api_params,
960
989
  response_type: Models::Variable
961
990
  )
991
+
962
992
  end
963
993
 
964
994
  # Delete a variable by its unique ID.
@@ -993,7 +1023,8 @@ module Appwrite
993
1023
  headers: api_headers,
994
1024
  params: api_params,
995
1025
  )
1026
+
996
1027
  end
997
1028
 
998
1029
  end
999
- end
1030
+ end
@@ -34,6 +34,7 @@ module Appwrite
34
34
  params: api_params,
35
35
  response_type: Models::BucketList
36
36
  )
37
+
37
38
  end
38
39
 
39
40
  # Create a new storage bucket.
@@ -87,6 +88,7 @@ module Appwrite
87
88
  params: api_params,
88
89
  response_type: Models::Bucket
89
90
  )
91
+
90
92
  end
91
93
 
92
94
  # Get a storage bucket by its unique ID. This endpoint response returns a
@@ -116,6 +118,7 @@ module Appwrite
116
118
  params: api_params,
117
119
  response_type: Models::Bucket
118
120
  )
121
+
119
122
  end
120
123
 
121
124
  # Update a storage bucket by its unique ID.
@@ -169,6 +172,7 @@ module Appwrite
169
172
  params: api_params,
170
173
  response_type: Models::Bucket
171
174
  )
175
+
172
176
  end
173
177
 
174
178
  # Delete a storage bucket by its unique ID.
@@ -197,6 +201,7 @@ module Appwrite
197
201
  headers: api_headers,
198
202
  params: api_params,
199
203
  )
204
+
200
205
  end
201
206
 
202
207
  # Get a list of all the user files. You can use the query params to filter
@@ -232,6 +237,7 @@ module Appwrite
232
237
  params: api_params,
233
238
  response_type: Models::FileList
234
239
  )
240
+
235
241
  end
236
242
 
237
243
  # Create a new file. Before using this route, you should create a new bucket
@@ -297,6 +303,7 @@ module Appwrite
297
303
  on_progress: on_progress,
298
304
  response_type: Models::File
299
305
  )
306
+
300
307
  end
301
308
 
302
309
  # Get a file by its unique ID. This endpoint response returns a JSON object
@@ -332,6 +339,7 @@ module Appwrite
332
339
  params: api_params,
333
340
  response_type: Models::File
334
341
  )
342
+
335
343
  end
336
344
 
337
345
  # Update a file by its unique ID. Only users with write permissions have
@@ -372,6 +380,7 @@ module Appwrite
372
380
  params: api_params,
373
381
  response_type: Models::File
374
382
  )
383
+
375
384
  end
376
385
 
377
386
  # Delete a file by its unique ID. Only users with write permissions have
@@ -407,6 +416,7 @@ module Appwrite
407
416
  headers: api_headers,
408
417
  params: api_params,
409
418
  )
419
+
410
420
  end
411
421
 
412
422
  # Get a file content by its unique ID. The endpoint response return with a
@@ -444,6 +454,7 @@ module Appwrite
444
454
  headers: api_headers,
445
455
  params: api_params,
446
456
  )
457
+
447
458
  end
448
459
 
449
460
  # Get a file preview image. Currently, this method supports preview for image
@@ -505,6 +516,7 @@ module Appwrite
505
516
  headers: api_headers,
506
517
  params: api_params,
507
518
  )
519
+
508
520
  end
509
521
 
510
522
  # Get a file content by its unique ID. This endpoint is similar to the
@@ -542,7 +554,8 @@ module Appwrite
542
554
  headers: api_headers,
543
555
  params: api_params,
544
556
  )
557
+
545
558
  end
546
559
 
547
560
  end
548
- end
561
+ end