appwrite 8.0.0 → 9.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +2 -2
  3. data/lib/appwrite/models/attribute_boolean.rb +5 -0
  4. data/lib/appwrite/models/attribute_datetime.rb +5 -0
  5. data/lib/appwrite/models/attribute_email.rb +5 -0
  6. data/lib/appwrite/models/attribute_enum.rb +5 -0
  7. data/lib/appwrite/models/attribute_float.rb +5 -0
  8. data/lib/appwrite/models/attribute_integer.rb +5 -0
  9. data/lib/appwrite/models/attribute_ip.rb +5 -0
  10. data/lib/appwrite/models/attribute_relationship.rb +5 -0
  11. data/lib/appwrite/models/attribute_string.rb +5 -0
  12. data/lib/appwrite/models/attribute_url.rb +5 -0
  13. data/lib/appwrite/models/database.rb +8 -3
  14. data/lib/appwrite/models/deployment.rb +63 -13
  15. data/lib/appwrite/models/execution.rb +40 -20
  16. data/lib/appwrite/models/function.rb +53 -13
  17. data/lib/appwrite/models/headers.rb +32 -0
  18. data/lib/appwrite/models/health_status.rb +5 -0
  19. data/lib/appwrite/models/identity.rb +72 -0
  20. data/lib/appwrite/models/identity_list.rb +32 -0
  21. data/lib/appwrite/models/index.rb +5 -0
  22. data/lib/appwrite/models/locale_code.rb +32 -0
  23. data/lib/appwrite/models/locale_code_list.rb +32 -0
  24. data/lib/appwrite/models/user.rb +13 -3
  25. data/lib/appwrite/models/variable.rb +10 -5
  26. data/lib/appwrite/services/account.rb +105 -50
  27. data/lib/appwrite/services/avatars.rb +14 -14
  28. data/lib/appwrite/services/databases.rb +106 -94
  29. data/lib/appwrite/services/functions.rb +149 -63
  30. data/lib/appwrite/services/graphql.rb +4 -4
  31. data/lib/appwrite/services/health.rb +71 -22
  32. data/lib/appwrite/services/locale.rb +39 -14
  33. data/lib/appwrite/services/storage.rb +33 -31
  34. data/lib/appwrite/services/teams.rb +28 -27
  35. data/lib/appwrite/services/users.rb +148 -50
  36. data/lib/appwrite.rb +5 -0
  37. metadata +7 -2
@@ -10,12 +10,12 @@ module Appwrite
10
10
  # Get a list of all the project's functions. You can use the query params to
11
11
  # filter your results.
12
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/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deployment, schedule, scheduleNext, schedulePrevious, timeout
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/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deployment, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId
14
14
  # @param [String] search Search term to filter your list results. Max length: 256 chars.
15
15
  #
16
16
  # @return [FunctionList]
17
17
  def list(queries: nil, search: nil)
18
- path = '/functions'
18
+ api_path = '/functions'
19
19
 
20
20
  params = {
21
21
  queries: queries,
@@ -28,7 +28,7 @@ module Appwrite
28
28
 
29
29
  @client.call(
30
30
  method: 'GET',
31
- path: path,
31
+ path: api_path,
32
32
  headers: headers,
33
33
  params: params,
34
34
  response_type: Models::FunctionList
@@ -43,15 +43,27 @@ module Appwrite
43
43
  # @param [String] function_id Function 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.
44
44
  # @param [String] name Function name. Max length: 128 chars.
45
45
  # @param [String] runtime Execution runtime.
46
- # @param [Array] execute An array of strings with execution roles. By default no user is granted with any execute permissions. [learn more about permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 64 characters long.
46
+ # @param [Array] execute An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
47
47
  # @param [Array] events Events list. Maximum of 100 events are allowed.
48
48
  # @param [String] schedule Schedule CRON syntax.
49
49
  # @param [Integer] timeout Function maximum execution time in seconds.
50
- # @param [] enabled Is function enabled?
50
+ # @param [] enabled Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
51
+ # @param [] logging Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.
52
+ # @param [String] entrypoint Entrypoint File. This path is relative to the "providerRootDirectory".
53
+ # @param [String] commands Build Commands.
54
+ # @param [String] installation_id Appwrite Installation ID for VCS (Version Control System) deployment.
55
+ # @param [String] provider_repository_id Repository ID of the repo linked to the function.
56
+ # @param [String] provider_branch Production branch for the repo linked to the function.
57
+ # @param [] provider_silent_mode Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
58
+ # @param [String] provider_root_directory Path to function code in the linked repo.
59
+ # @param [String] template_repository Repository name of the template.
60
+ # @param [String] template_owner The name of the owner of the template.
61
+ # @param [String] template_root_directory Path to function code in the template repo.
62
+ # @param [String] template_branch Production branch for the repo linked to the function template.
51
63
  #
52
64
  # @return [Function]
53
- def create(function_id:, name:, runtime:, execute: nil, events: nil, schedule: nil, timeout: nil, enabled: nil)
54
- path = '/functions'
65
+ def create(function_id:, name:, runtime:, execute: nil, events: nil, schedule: nil, timeout: nil, enabled: nil, logging: nil, entrypoint: nil, commands: nil, installation_id: nil, provider_repository_id: nil, provider_branch: nil, provider_silent_mode: nil, provider_root_directory: nil, template_repository: nil, template_owner: nil, template_root_directory: nil, template_branch: nil)
66
+ api_path = '/functions'
55
67
 
56
68
  if function_id.nil?
57
69
  raise Appwrite::Exception.new('Missing required parameter: "functionId"')
@@ -68,12 +80,24 @@ module Appwrite
68
80
  params = {
69
81
  functionId: function_id,
70
82
  name: name,
71
- execute: execute,
72
83
  runtime: runtime,
84
+ execute: execute,
73
85
  events: events,
74
86
  schedule: schedule,
75
87
  timeout: timeout,
76
88
  enabled: enabled,
89
+ logging: logging,
90
+ entrypoint: entrypoint,
91
+ commands: commands,
92
+ installationId: installation_id,
93
+ providerRepositoryId: provider_repository_id,
94
+ providerBranch: provider_branch,
95
+ providerSilentMode: provider_silent_mode,
96
+ providerRootDirectory: provider_root_directory,
97
+ templateRepository: template_repository,
98
+ templateOwner: template_owner,
99
+ templateRootDirectory: template_root_directory,
100
+ templateBranch: template_branch,
77
101
  }
78
102
 
79
103
  headers = {
@@ -82,7 +106,7 @@ module Appwrite
82
106
 
83
107
  @client.call(
84
108
  method: 'POST',
85
- path: path,
109
+ path: api_path,
86
110
  headers: headers,
87
111
  params: params,
88
112
  response_type: Models::Function
@@ -95,7 +119,7 @@ module Appwrite
95
119
  #
96
120
  # @return [RuntimeList]
97
121
  def list_runtimes()
98
- path = '/functions/runtimes'
122
+ api_path = '/functions/runtimes'
99
123
 
100
124
  params = {
101
125
  }
@@ -106,7 +130,7 @@ module Appwrite
106
130
 
107
131
  @client.call(
108
132
  method: 'GET',
109
- path: path,
133
+ path: api_path,
110
134
  headers: headers,
111
135
  params: params,
112
136
  response_type: Models::RuntimeList
@@ -120,7 +144,7 @@ module Appwrite
120
144
  #
121
145
  # @return [Function]
122
146
  def get(function_id:)
123
- path = '/functions/{functionId}'
147
+ api_path = '/functions/{functionId}'
124
148
  .gsub('{functionId}', function_id)
125
149
 
126
150
  if function_id.nil?
@@ -136,7 +160,7 @@ module Appwrite
136
160
 
137
161
  @client.call(
138
162
  method: 'GET',
139
- path: path,
163
+ path: api_path,
140
164
  headers: headers,
141
165
  params: params,
142
166
  response_type: Models::Function
@@ -148,15 +172,24 @@ module Appwrite
148
172
  #
149
173
  # @param [String] function_id Function ID.
150
174
  # @param [String] name Function name. Max length: 128 chars.
151
- # @param [Array] execute An array of strings with execution roles. By default no user is granted with any execute permissions. [learn more about permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 64 characters long.
175
+ # @param [String] runtime Execution runtime.
176
+ # @param [Array] execute An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
152
177
  # @param [Array] events Events list. Maximum of 100 events are allowed.
153
178
  # @param [String] schedule Schedule CRON syntax.
154
179
  # @param [Integer] timeout Maximum execution time in seconds.
155
- # @param [] enabled Is function enabled?
180
+ # @param [] enabled Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
181
+ # @param [] logging Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.
182
+ # @param [String] entrypoint Entrypoint File. This path is relative to the "providerRootDirectory".
183
+ # @param [String] commands Build Commands.
184
+ # @param [String] installation_id Appwrite Installation ID for VCS (Version Controle System) deployment.
185
+ # @param [String] provider_repository_id Repository ID of the repo linked to the function
186
+ # @param [String] provider_branch Production branch for the repo linked to the function
187
+ # @param [] provider_silent_mode Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
188
+ # @param [String] provider_root_directory Path to function code in the linked repo.
156
189
  #
157
190
  # @return [Function]
158
- def update(function_id:, name:, execute: nil, events: nil, schedule: nil, timeout: nil, enabled: nil)
159
- path = '/functions/{functionId}'
191
+ def update(function_id:, name:, runtime:, execute: nil, events: nil, schedule: nil, timeout: nil, enabled: nil, logging: nil, entrypoint: nil, commands: nil, installation_id: nil, provider_repository_id: nil, provider_branch: nil, provider_silent_mode: nil, provider_root_directory: nil)
192
+ api_path = '/functions/{functionId}'
160
193
  .gsub('{functionId}', function_id)
161
194
 
162
195
  if function_id.nil?
@@ -167,13 +200,26 @@ module Appwrite
167
200
  raise Appwrite::Exception.new('Missing required parameter: "name"')
168
201
  end
169
202
 
203
+ if runtime.nil?
204
+ raise Appwrite::Exception.new('Missing required parameter: "runtime"')
205
+ end
206
+
170
207
  params = {
171
208
  name: name,
209
+ runtime: runtime,
172
210
  execute: execute,
173
211
  events: events,
174
212
  schedule: schedule,
175
213
  timeout: timeout,
176
214
  enabled: enabled,
215
+ logging: logging,
216
+ entrypoint: entrypoint,
217
+ commands: commands,
218
+ installationId: installation_id,
219
+ providerRepositoryId: provider_repository_id,
220
+ providerBranch: provider_branch,
221
+ providerSilentMode: provider_silent_mode,
222
+ providerRootDirectory: provider_root_directory,
177
223
  }
178
224
 
179
225
  headers = {
@@ -182,7 +228,7 @@ module Appwrite
182
228
 
183
229
  @client.call(
184
230
  method: 'PUT',
185
- path: path,
231
+ path: api_path,
186
232
  headers: headers,
187
233
  params: params,
188
234
  response_type: Models::Function
@@ -196,7 +242,7 @@ module Appwrite
196
242
  #
197
243
  # @return []
198
244
  def delete(function_id:)
199
- path = '/functions/{functionId}'
245
+ api_path = '/functions/{functionId}'
200
246
  .gsub('{functionId}', function_id)
201
247
 
202
248
  if function_id.nil?
@@ -212,7 +258,7 @@ module Appwrite
212
258
 
213
259
  @client.call(
214
260
  method: 'DELETE',
215
- path: path,
261
+ path: api_path,
216
262
  headers: headers,
217
263
  params: params,
218
264
  )
@@ -223,12 +269,12 @@ module Appwrite
223
269
  # params to filter your results.
224
270
  #
225
271
  # @param [String] function_id Function ID.
226
- # @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: entrypoint, size, buildId, activate
272
+ # @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: size, buildId, activate, entrypoint, commands
227
273
  # @param [String] search Search term to filter your list results. Max length: 256 chars.
228
274
  #
229
275
  # @return [DeploymentList]
230
276
  def list_deployments(function_id:, queries: nil, search: nil)
231
- path = '/functions/{functionId}/deployments'
277
+ api_path = '/functions/{functionId}/deployments'
232
278
  .gsub('{functionId}', function_id)
233
279
 
234
280
  if function_id.nil?
@@ -246,7 +292,7 @@ module Appwrite
246
292
 
247
293
  @client.call(
248
294
  method: 'GET',
249
- path: path,
295
+ path: api_path,
250
296
  headers: headers,
251
297
  params: params,
252
298
  response_type: Models::DeploymentList
@@ -263,26 +309,23 @@ module Appwrite
263
309
  # learn more about code packaging in the [Appwrite Cloud Functions
264
310
  # tutorial](/docs/functions).
265
311
  #
266
- # Use the "command" param to set the entry point used to execute your code.
312
+ # Use the "command" param to set the entrypoint used to execute your code.
267
313
  #
268
314
  # @param [String] function_id Function ID.
269
- # @param [String] entrypoint Entrypoint File.
270
315
  # @param [file] code Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
271
316
  # @param [] activate Automatically activate the deployment when it is finished building.
317
+ # @param [String] entrypoint Entrypoint File.
318
+ # @param [String] commands Build Commands.
272
319
  #
273
320
  # @return [Deployment]
274
- def create_deployment(function_id:, entrypoint:, code:, activate:, on_progress: nil)
275
- path = '/functions/{functionId}/deployments'
321
+ def create_deployment(function_id:, code:, activate:, entrypoint: nil, commands: nil, on_progress: nil)
322
+ api_path = '/functions/{functionId}/deployments'
276
323
  .gsub('{functionId}', function_id)
277
324
 
278
325
  if function_id.nil?
279
326
  raise Appwrite::Exception.new('Missing required parameter: "functionId"')
280
327
  end
281
328
 
282
- if entrypoint.nil?
283
- raise Appwrite::Exception.new('Missing required parameter: "entrypoint"')
284
- end
285
-
286
329
  if code.nil?
287
330
  raise Appwrite::Exception.new('Missing required parameter: "code"')
288
331
  end
@@ -293,6 +336,7 @@ module Appwrite
293
336
 
294
337
  params = {
295
338
  entrypoint: entrypoint,
339
+ commands: commands,
296
340
  code: code,
297
341
  activate: activate,
298
342
  }
@@ -305,7 +349,7 @@ module Appwrite
305
349
  param_name = 'code'
306
350
 
307
351
  @client.chunked_upload(
308
- path: path,
352
+ path: api_path,
309
353
  headers: headers,
310
354
  params: params,
311
355
  param_name: param_name,
@@ -323,7 +367,7 @@ module Appwrite
323
367
  #
324
368
  # @return [Deployment]
325
369
  def get_deployment(function_id:, deployment_id:)
326
- path = '/functions/{functionId}/deployments/{deploymentId}'
370
+ api_path = '/functions/{functionId}/deployments/{deploymentId}'
327
371
  .gsub('{functionId}', function_id)
328
372
  .gsub('{deploymentId}', deployment_id)
329
373
 
@@ -344,7 +388,7 @@ module Appwrite
344
388
 
345
389
  @client.call(
346
390
  method: 'GET',
347
- path: path,
391
+ path: api_path,
348
392
  headers: headers,
349
393
  params: params,
350
394
  response_type: Models::Deployment
@@ -361,7 +405,7 @@ module Appwrite
361
405
  #
362
406
  # @return [Function]
363
407
  def update_deployment(function_id:, deployment_id:)
364
- path = '/functions/{functionId}/deployments/{deploymentId}'
408
+ api_path = '/functions/{functionId}/deployments/{deploymentId}'
365
409
  .gsub('{functionId}', function_id)
366
410
  .gsub('{deploymentId}', deployment_id)
367
411
 
@@ -382,7 +426,7 @@ module Appwrite
382
426
 
383
427
  @client.call(
384
428
  method: 'PATCH',
385
- path: path,
429
+ path: api_path,
386
430
  headers: headers,
387
431
  params: params,
388
432
  response_type: Models::Function
@@ -397,7 +441,7 @@ module Appwrite
397
441
  #
398
442
  # @return []
399
443
  def delete_deployment(function_id:, deployment_id:)
400
- path = '/functions/{functionId}/deployments/{deploymentId}'
444
+ api_path = '/functions/{functionId}/deployments/{deploymentId}'
401
445
  .gsub('{functionId}', function_id)
402
446
  .gsub('{deploymentId}', deployment_id)
403
447
 
@@ -418,14 +462,15 @@ module Appwrite
418
462
 
419
463
  @client.call(
420
464
  method: 'DELETE',
421
- path: path,
465
+ path: api_path,
422
466
  headers: headers,
423
467
  params: params,
424
468
  )
425
469
  end
426
470
 
427
471
 
428
- #
472
+ # Create a new build for an Appwrite Function deployment. This endpoint can
473
+ # be used to retry a failed build.
429
474
  #
430
475
  # @param [String] function_id Function ID.
431
476
  # @param [String] deployment_id Deployment ID.
@@ -433,7 +478,7 @@ module Appwrite
433
478
  #
434
479
  # @return []
435
480
  def create_build(function_id:, deployment_id:, build_id:)
436
- path = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}'
481
+ api_path = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}'
437
482
  .gsub('{functionId}', function_id)
438
483
  .gsub('{deploymentId}', deployment_id)
439
484
  .gsub('{buildId}', build_id)
@@ -459,7 +504,42 @@ module Appwrite
459
504
 
460
505
  @client.call(
461
506
  method: 'POST',
462
- path: path,
507
+ path: api_path,
508
+ headers: headers,
509
+ params: params,
510
+ )
511
+ end
512
+
513
+
514
+ #
515
+ #
516
+ # @param [String] function_id Function ID.
517
+ # @param [String] deployment_id Deployment ID.
518
+ #
519
+ # @return []
520
+ def download_deployment(function_id:, deployment_id:)
521
+ api_path = '/functions/{functionId}/deployments/{deploymentId}/download'
522
+ .gsub('{functionId}', function_id)
523
+ .gsub('{deploymentId}', deployment_id)
524
+
525
+ if function_id.nil?
526
+ raise Appwrite::Exception.new('Missing required parameter: "functionId"')
527
+ end
528
+
529
+ if deployment_id.nil?
530
+ raise Appwrite::Exception.new('Missing required parameter: "deploymentId"')
531
+ end
532
+
533
+ params = {
534
+ }
535
+
536
+ headers = {
537
+ "content-type": 'application/json',
538
+ }
539
+
540
+ @client.call(
541
+ method: 'GET',
542
+ path: api_path,
463
543
  headers: headers,
464
544
  params: params,
465
545
  )
@@ -470,12 +550,12 @@ module Appwrite
470
550
  # query params to filter your results.
471
551
  #
472
552
  # @param [String] function_id Function ID.
473
- # @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: trigger, status, statusCode, duration
553
+ # @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: trigger, status, responseStatusCode, duration
474
554
  # @param [String] search Search term to filter your list results. Max length: 256 chars.
475
555
  #
476
556
  # @return [ExecutionList]
477
557
  def list_executions(function_id:, queries: nil, search: nil)
478
- path = '/functions/{functionId}/executions'
558
+ api_path = '/functions/{functionId}/executions'
479
559
  .gsub('{functionId}', function_id)
480
560
 
481
561
  if function_id.nil?
@@ -493,7 +573,7 @@ module Appwrite
493
573
 
494
574
  @client.call(
495
575
  method: 'GET',
496
- path: path,
576
+ path: api_path,
497
577
  headers: headers,
498
578
  params: params,
499
579
  response_type: Models::ExecutionList
@@ -507,12 +587,15 @@ module Appwrite
507
587
  # function execution process will start asynchronously.
508
588
  #
509
589
  # @param [String] function_id Function ID.
510
- # @param [String] data String of custom data to send to function.
590
+ # @param [String] body HTTP body of execution. Default value is empty string.
511
591
  # @param [] async Execute code in the background. Default value is false.
592
+ # @param [String] xpath HTTP path of execution. Path can include query params. Default value is /
593
+ # @param [String] method HTTP method of execution. Default value is GET.
594
+ # @param [Hash] headers HTTP headers of execution. Defaults to empty.
512
595
  #
513
596
  # @return [Execution]
514
- def create_execution(function_id:, data: nil, async: nil)
515
- path = '/functions/{functionId}/executions'
597
+ def create_execution(function_id:, body: nil, async: nil, xpath: nil, method: nil, headers: nil)
598
+ api_path = '/functions/{functionId}/executions'
516
599
  .gsub('{functionId}', function_id)
517
600
 
518
601
  if function_id.nil?
@@ -520,8 +603,11 @@ module Appwrite
520
603
  end
521
604
 
522
605
  params = {
523
- data: data,
606
+ body: body,
524
607
  async: async,
608
+ path: xpath,
609
+ method: method,
610
+ headers: headers,
525
611
  }
526
612
 
527
613
  headers = {
@@ -530,7 +616,7 @@ module Appwrite
530
616
 
531
617
  @client.call(
532
618
  method: 'POST',
533
- path: path,
619
+ path: api_path,
534
620
  headers: headers,
535
621
  params: params,
536
622
  response_type: Models::Execution
@@ -545,7 +631,7 @@ module Appwrite
545
631
  #
546
632
  # @return [Execution]
547
633
  def get_execution(function_id:, execution_id:)
548
- path = '/functions/{functionId}/executions/{executionId}'
634
+ api_path = '/functions/{functionId}/executions/{executionId}'
549
635
  .gsub('{functionId}', function_id)
550
636
  .gsub('{executionId}', execution_id)
551
637
 
@@ -566,7 +652,7 @@ module Appwrite
566
652
 
567
653
  @client.call(
568
654
  method: 'GET',
569
- path: path,
655
+ path: api_path,
570
656
  headers: headers,
571
657
  params: params,
572
658
  response_type: Models::Execution
@@ -580,7 +666,7 @@ module Appwrite
580
666
  #
581
667
  # @return [VariableList]
582
668
  def list_variables(function_id:)
583
- path = '/functions/{functionId}/variables'
669
+ api_path = '/functions/{functionId}/variables'
584
670
  .gsub('{functionId}', function_id)
585
671
 
586
672
  if function_id.nil?
@@ -596,7 +682,7 @@ module Appwrite
596
682
 
597
683
  @client.call(
598
684
  method: 'GET',
599
- path: path,
685
+ path: api_path,
600
686
  headers: headers,
601
687
  params: params,
602
688
  response_type: Models::VariableList
@@ -604,8 +690,8 @@ module Appwrite
604
690
  end
605
691
 
606
692
 
607
- # Create a new function variable. These variables can be accessed within
608
- # function in the `env` object under the request variable.
693
+ # Create a new function environment variable. These variables can be accessed
694
+ # in the function at runtime as environment variables.
609
695
  #
610
696
  # @param [String] function_id Function unique ID.
611
697
  # @param [String] key Variable key. Max length: 255 chars.
@@ -613,7 +699,7 @@ module Appwrite
613
699
  #
614
700
  # @return [Variable]
615
701
  def create_variable(function_id:, key:, value:)
616
- path = '/functions/{functionId}/variables'
702
+ api_path = '/functions/{functionId}/variables'
617
703
  .gsub('{functionId}', function_id)
618
704
 
619
705
  if function_id.nil?
@@ -639,7 +725,7 @@ module Appwrite
639
725
 
640
726
  @client.call(
641
727
  method: 'POST',
642
- path: path,
728
+ path: api_path,
643
729
  headers: headers,
644
730
  params: params,
645
731
  response_type: Models::Variable
@@ -654,7 +740,7 @@ module Appwrite
654
740
  #
655
741
  # @return [Variable]
656
742
  def get_variable(function_id:, variable_id:)
657
- path = '/functions/{functionId}/variables/{variableId}'
743
+ api_path = '/functions/{functionId}/variables/{variableId}'
658
744
  .gsub('{functionId}', function_id)
659
745
  .gsub('{variableId}', variable_id)
660
746
 
@@ -675,7 +761,7 @@ module Appwrite
675
761
 
676
762
  @client.call(
677
763
  method: 'GET',
678
- path: path,
764
+ path: api_path,
679
765
  headers: headers,
680
766
  params: params,
681
767
  response_type: Models::Variable
@@ -692,7 +778,7 @@ module Appwrite
692
778
  #
693
779
  # @return [Variable]
694
780
  def update_variable(function_id:, variable_id:, key:, value: nil)
695
- path = '/functions/{functionId}/variables/{variableId}'
781
+ api_path = '/functions/{functionId}/variables/{variableId}'
696
782
  .gsub('{functionId}', function_id)
697
783
  .gsub('{variableId}', variable_id)
698
784
 
@@ -719,7 +805,7 @@ module Appwrite
719
805
 
720
806
  @client.call(
721
807
  method: 'PUT',
722
- path: path,
808
+ path: api_path,
723
809
  headers: headers,
724
810
  params: params,
725
811
  response_type: Models::Variable
@@ -734,7 +820,7 @@ module Appwrite
734
820
  #
735
821
  # @return []
736
822
  def delete_variable(function_id:, variable_id:)
737
- path = '/functions/{functionId}/variables/{variableId}'
823
+ api_path = '/functions/{functionId}/variables/{variableId}'
738
824
  .gsub('{functionId}', function_id)
739
825
  .gsub('{variableId}', variable_id)
740
826
 
@@ -755,7 +841,7 @@ module Appwrite
755
841
 
756
842
  @client.call(
757
843
  method: 'DELETE',
758
- path: path,
844
+ path: api_path,
759
845
  headers: headers,
760
846
  params: params,
761
847
  )
@@ -13,7 +13,7 @@ module Appwrite
13
13
  #
14
14
  # @return [Any]
15
15
  def query(query:)
16
- path = '/graphql'
16
+ api_path = '/graphql'
17
17
 
18
18
  if query.nil?
19
19
  raise Appwrite::Exception.new('Missing required parameter: "query"')
@@ -30,7 +30,7 @@ module Appwrite
30
30
 
31
31
  @client.call(
32
32
  method: 'POST',
33
- path: path,
33
+ path: api_path,
34
34
  headers: headers,
35
35
  params: params,
36
36
  )
@@ -43,7 +43,7 @@ module Appwrite
43
43
  #
44
44
  # @return [Any]
45
45
  def mutation(query:)
46
- path = '/graphql/mutation'
46
+ api_path = '/graphql/mutation'
47
47
 
48
48
  if query.nil?
49
49
  raise Appwrite::Exception.new('Missing required parameter: "query"')
@@ -60,7 +60,7 @@ module Appwrite
60
60
 
61
61
  @client.call(
62
62
  method: 'POST',
63
- path: path,
63
+ path: api_path,
64
64
  headers: headers,
65
65
  params: params,
66
66
  )