appwrite 7.0.0.pre.RC2 → 7.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/appwrite/client.rb +2 -2
- data/lib/appwrite/models/document.rb +10 -5
- data/lib/appwrite/models/execution.rb +5 -5
- data/lib/appwrite/models/function.rb +5 -5
- data/lib/appwrite/role.rb +15 -7
- data/lib/appwrite/services/account.rb +87 -107
- data/lib/appwrite/services/avatars.rb +27 -34
- data/lib/appwrite/services/databases.rb +379 -410
- data/lib/appwrite/services/functions.rb +180 -200
- data/lib/appwrite/services/health.rb +0 -10
- data/lib/appwrite/services/locale.rb +6 -13
- data/lib/appwrite/services/storage.rb +105 -118
- data/lib/appwrite/services/teams.rb +94 -105
- data/lib/appwrite/services/users.rb +226 -251
- metadata +4 -4
@@ -10,12 +10,11 @@ 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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name,
|
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: name, enabled, runtime, deployment, schedule, scheduleNext, schedulePrevious, timeout
|
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
|
-
|
19
18
|
path = '/functions'
|
20
19
|
|
21
20
|
params = {
|
@@ -48,12 +47,28 @@ module Appwrite
|
|
48
47
|
# @param [Array] events Events list. Maximum of 100 events are allowed.
|
49
48
|
# @param [String] schedule Schedule CRON syntax.
|
50
49
|
# @param [Integer] timeout Function maximum execution time in seconds.
|
50
|
+
# @param [] enabled Is function enabled?
|
51
51
|
#
|
52
52
|
# @return [Function]
|
53
|
-
def create(function_id:, name:, execute:, runtime:, events: nil, schedule: nil, timeout: nil)
|
54
|
-
|
53
|
+
def create(function_id:, name:, execute:, runtime:, events: nil, schedule: nil, timeout: nil, enabled: nil)
|
55
54
|
path = '/functions'
|
56
55
|
|
56
|
+
if function_id.nil?
|
57
|
+
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
58
|
+
end
|
59
|
+
|
60
|
+
if name.nil?
|
61
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
62
|
+
end
|
63
|
+
|
64
|
+
if execute.nil?
|
65
|
+
raise Appwrite::Exception.new('Missing required parameter: "execute"')
|
66
|
+
end
|
67
|
+
|
68
|
+
if runtime.nil?
|
69
|
+
raise Appwrite::Exception.new('Missing required parameter: "runtime"')
|
70
|
+
end
|
71
|
+
|
57
72
|
params = {
|
58
73
|
functionId: function_id,
|
59
74
|
name: name,
|
@@ -62,27 +77,12 @@ module Appwrite
|
|
62
77
|
events: events,
|
63
78
|
schedule: schedule,
|
64
79
|
timeout: timeout,
|
80
|
+
enabled: enabled,
|
65
81
|
}
|
66
82
|
|
67
83
|
headers = {
|
68
84
|
"content-type": 'application/json',
|
69
85
|
}
|
70
|
-
if function_id.nil?
|
71
|
-
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
72
|
-
end
|
73
|
-
|
74
|
-
if name.nil?
|
75
|
-
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
76
|
-
end
|
77
|
-
|
78
|
-
if execute.nil?
|
79
|
-
raise Appwrite::Exception.new('Missing required parameter: "execute"')
|
80
|
-
end
|
81
|
-
|
82
|
-
if runtime.nil?
|
83
|
-
raise Appwrite::Exception.new('Missing required parameter: "runtime"')
|
84
|
-
end
|
85
|
-
|
86
86
|
|
87
87
|
@client.call(
|
88
88
|
method: 'POST',
|
@@ -99,7 +99,6 @@ module Appwrite
|
|
99
99
|
#
|
100
100
|
# @return [RuntimeList]
|
101
101
|
def list_runtimes()
|
102
|
-
|
103
102
|
path = '/functions/runtimes'
|
104
103
|
|
105
104
|
params = {
|
@@ -125,8 +124,12 @@ module Appwrite
|
|
125
124
|
#
|
126
125
|
# @return [Function]
|
127
126
|
def get(function_id:)
|
128
|
-
|
129
127
|
path = '/functions/{functionId}'
|
128
|
+
.gsub('{functionId}', function_id)
|
129
|
+
|
130
|
+
if function_id.nil?
|
131
|
+
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
132
|
+
end
|
130
133
|
|
131
134
|
params = {
|
132
135
|
}
|
@@ -134,11 +137,6 @@ module Appwrite
|
|
134
137
|
headers = {
|
135
138
|
"content-type": 'application/json',
|
136
139
|
}
|
137
|
-
if function_id.nil?
|
138
|
-
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
139
|
-
end
|
140
|
-
|
141
|
-
.gsub('{functionId}', function_id)
|
142
140
|
|
143
141
|
@client.call(
|
144
142
|
method: 'GET',
|
@@ -158,11 +156,24 @@ module Appwrite
|
|
158
156
|
# @param [Array] events Events list. Maximum of 100 events are allowed.
|
159
157
|
# @param [String] schedule Schedule CRON syntax.
|
160
158
|
# @param [Integer] timeout Maximum execution time in seconds.
|
159
|
+
# @param [] enabled Is function enabled?
|
161
160
|
#
|
162
161
|
# @return [Function]
|
163
|
-
def update(function_id:, name:, execute:, events: nil, schedule: nil, timeout: nil)
|
164
|
-
|
162
|
+
def update(function_id:, name:, execute:, events: nil, schedule: nil, timeout: nil, enabled: nil)
|
165
163
|
path = '/functions/{functionId}'
|
164
|
+
.gsub('{functionId}', function_id)
|
165
|
+
|
166
|
+
if function_id.nil?
|
167
|
+
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
168
|
+
end
|
169
|
+
|
170
|
+
if name.nil?
|
171
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
172
|
+
end
|
173
|
+
|
174
|
+
if execute.nil?
|
175
|
+
raise Appwrite::Exception.new('Missing required parameter: "execute"')
|
176
|
+
end
|
166
177
|
|
167
178
|
params = {
|
168
179
|
name: name,
|
@@ -170,24 +181,12 @@ module Appwrite
|
|
170
181
|
events: events,
|
171
182
|
schedule: schedule,
|
172
183
|
timeout: timeout,
|
184
|
+
enabled: enabled,
|
173
185
|
}
|
174
186
|
|
175
187
|
headers = {
|
176
188
|
"content-type": 'application/json',
|
177
189
|
}
|
178
|
-
if function_id.nil?
|
179
|
-
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
180
|
-
end
|
181
|
-
|
182
|
-
if name.nil?
|
183
|
-
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
184
|
-
end
|
185
|
-
|
186
|
-
if execute.nil?
|
187
|
-
raise Appwrite::Exception.new('Missing required parameter: "execute"')
|
188
|
-
end
|
189
|
-
|
190
|
-
.gsub('{functionId}', function_id)
|
191
190
|
|
192
191
|
@client.call(
|
193
192
|
method: 'PUT',
|
@@ -205,8 +204,12 @@ module Appwrite
|
|
205
204
|
#
|
206
205
|
# @return []
|
207
206
|
def delete(function_id:)
|
208
|
-
|
209
207
|
path = '/functions/{functionId}'
|
208
|
+
.gsub('{functionId}', function_id)
|
209
|
+
|
210
|
+
if function_id.nil?
|
211
|
+
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
212
|
+
end
|
210
213
|
|
211
214
|
params = {
|
212
215
|
}
|
@@ -214,11 +217,6 @@ module Appwrite
|
|
214
217
|
headers = {
|
215
218
|
"content-type": 'application/json',
|
216
219
|
}
|
217
|
-
if function_id.nil?
|
218
|
-
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
219
|
-
end
|
220
|
-
|
221
|
-
.gsub('{functionId}', function_id)
|
222
220
|
|
223
221
|
@client.call(
|
224
222
|
method: 'DELETE',
|
@@ -238,8 +236,12 @@ module Appwrite
|
|
238
236
|
#
|
239
237
|
# @return [DeploymentList]
|
240
238
|
def list_deployments(function_id:, queries: nil, search: nil)
|
241
|
-
|
242
239
|
path = '/functions/{functionId}/deployments'
|
240
|
+
.gsub('{functionId}', function_id)
|
241
|
+
|
242
|
+
if function_id.nil?
|
243
|
+
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
244
|
+
end
|
243
245
|
|
244
246
|
params = {
|
245
247
|
queries: queries,
|
@@ -249,11 +251,6 @@ module Appwrite
|
|
249
251
|
headers = {
|
250
252
|
"content-type": 'application/json',
|
251
253
|
}
|
252
|
-
if function_id.nil?
|
253
|
-
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
254
|
-
end
|
255
|
-
|
256
|
-
.gsub('{functionId}', function_id)
|
257
254
|
|
258
255
|
@client.call(
|
259
256
|
method: 'GET',
|
@@ -283,35 +280,34 @@ module Appwrite
|
|
283
280
|
#
|
284
281
|
# @return [Deployment]
|
285
282
|
def create_deployment(function_id:, entrypoint:, code:, activate:, on_progress: nil)
|
286
|
-
|
287
283
|
path = '/functions/{functionId}/deployments'
|
284
|
+
.gsub('{functionId}', function_id)
|
288
285
|
|
289
|
-
params = {
|
290
|
-
entrypoint: entrypoint,
|
291
|
-
code: code,
|
292
|
-
activate: activate,
|
293
|
-
}
|
294
|
-
|
295
|
-
headers = {
|
296
|
-
"content-type": 'multipart/form-data',
|
297
|
-
}
|
298
286
|
if function_id.nil?
|
299
|
-
|
287
|
+
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
300
288
|
end
|
301
289
|
|
302
290
|
if entrypoint.nil?
|
303
|
-
|
291
|
+
raise Appwrite::Exception.new('Missing required parameter: "entrypoint"')
|
304
292
|
end
|
305
293
|
|
306
294
|
if code.nil?
|
307
|
-
|
295
|
+
raise Appwrite::Exception.new('Missing required parameter: "code"')
|
308
296
|
end
|
309
297
|
|
310
298
|
if activate.nil?
|
311
|
-
|
299
|
+
raise Appwrite::Exception.new('Missing required parameter: "activate"')
|
312
300
|
end
|
313
301
|
|
314
|
-
|
302
|
+
params = {
|
303
|
+
entrypoint: entrypoint,
|
304
|
+
code: code,
|
305
|
+
activate: activate,
|
306
|
+
}
|
307
|
+
|
308
|
+
headers = {
|
309
|
+
"content-type": 'multipart/form-data',
|
310
|
+
}
|
315
311
|
|
316
312
|
id_param_name = nil
|
317
313
|
param_name = 'code'
|
@@ -335,25 +331,24 @@ module Appwrite
|
|
335
331
|
#
|
336
332
|
# @return [Deployment]
|
337
333
|
def get_deployment(function_id:, deployment_id:)
|
338
|
-
|
339
334
|
path = '/functions/{functionId}/deployments/{deploymentId}'
|
335
|
+
.gsub('{functionId}', function_id)
|
336
|
+
.gsub('{deploymentId}', deployment_id)
|
340
337
|
|
341
|
-
params = {
|
342
|
-
}
|
343
|
-
|
344
|
-
headers = {
|
345
|
-
"content-type": 'application/json',
|
346
|
-
}
|
347
338
|
if function_id.nil?
|
348
|
-
|
339
|
+
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
349
340
|
end
|
350
341
|
|
351
342
|
if deployment_id.nil?
|
352
|
-
|
343
|
+
raise Appwrite::Exception.new('Missing required parameter: "deploymentId"')
|
353
344
|
end
|
354
345
|
|
355
|
-
|
356
|
-
|
346
|
+
params = {
|
347
|
+
}
|
348
|
+
|
349
|
+
headers = {
|
350
|
+
"content-type": 'application/json',
|
351
|
+
}
|
357
352
|
|
358
353
|
@client.call(
|
359
354
|
method: 'GET',
|
@@ -374,25 +369,24 @@ module Appwrite
|
|
374
369
|
#
|
375
370
|
# @return [Function]
|
376
371
|
def update_deployment(function_id:, deployment_id:)
|
377
|
-
|
378
372
|
path = '/functions/{functionId}/deployments/{deploymentId}'
|
373
|
+
.gsub('{functionId}', function_id)
|
374
|
+
.gsub('{deploymentId}', deployment_id)
|
379
375
|
|
380
|
-
params = {
|
381
|
-
}
|
382
|
-
|
383
|
-
headers = {
|
384
|
-
"content-type": 'application/json',
|
385
|
-
}
|
386
376
|
if function_id.nil?
|
387
|
-
|
377
|
+
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
388
378
|
end
|
389
379
|
|
390
380
|
if deployment_id.nil?
|
391
|
-
|
381
|
+
raise Appwrite::Exception.new('Missing required parameter: "deploymentId"')
|
392
382
|
end
|
393
383
|
|
394
|
-
|
395
|
-
|
384
|
+
params = {
|
385
|
+
}
|
386
|
+
|
387
|
+
headers = {
|
388
|
+
"content-type": 'application/json',
|
389
|
+
}
|
396
390
|
|
397
391
|
@client.call(
|
398
392
|
method: 'PATCH',
|
@@ -411,25 +405,24 @@ module Appwrite
|
|
411
405
|
#
|
412
406
|
# @return []
|
413
407
|
def delete_deployment(function_id:, deployment_id:)
|
414
|
-
|
415
408
|
path = '/functions/{functionId}/deployments/{deploymentId}'
|
409
|
+
.gsub('{functionId}', function_id)
|
410
|
+
.gsub('{deploymentId}', deployment_id)
|
416
411
|
|
417
|
-
params = {
|
418
|
-
}
|
419
|
-
|
420
|
-
headers = {
|
421
|
-
"content-type": 'application/json',
|
422
|
-
}
|
423
412
|
if function_id.nil?
|
424
|
-
|
413
|
+
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
425
414
|
end
|
426
415
|
|
427
416
|
if deployment_id.nil?
|
428
|
-
|
417
|
+
raise Appwrite::Exception.new('Missing required parameter: "deploymentId"')
|
429
418
|
end
|
430
419
|
|
431
|
-
|
432
|
-
|
420
|
+
params = {
|
421
|
+
}
|
422
|
+
|
423
|
+
headers = {
|
424
|
+
"content-type": 'application/json',
|
425
|
+
}
|
433
426
|
|
434
427
|
@client.call(
|
435
428
|
method: 'DELETE',
|
@@ -448,30 +441,29 @@ module Appwrite
|
|
448
441
|
#
|
449
442
|
# @return []
|
450
443
|
def retry_build(function_id:, deployment_id:, build_id:)
|
451
|
-
|
452
444
|
path = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}'
|
445
|
+
.gsub('{functionId}', function_id)
|
446
|
+
.gsub('{deploymentId}', deployment_id)
|
447
|
+
.gsub('{buildId}', build_id)
|
453
448
|
|
454
|
-
params = {
|
455
|
-
}
|
456
|
-
|
457
|
-
headers = {
|
458
|
-
"content-type": 'application/json',
|
459
|
-
}
|
460
449
|
if function_id.nil?
|
461
|
-
|
450
|
+
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
462
451
|
end
|
463
452
|
|
464
453
|
if deployment_id.nil?
|
465
|
-
|
454
|
+
raise Appwrite::Exception.new('Missing required parameter: "deploymentId"')
|
466
455
|
end
|
467
456
|
|
468
457
|
if build_id.nil?
|
469
|
-
|
458
|
+
raise Appwrite::Exception.new('Missing required parameter: "buildId"')
|
470
459
|
end
|
471
460
|
|
472
|
-
|
473
|
-
|
474
|
-
|
461
|
+
params = {
|
462
|
+
}
|
463
|
+
|
464
|
+
headers = {
|
465
|
+
"content-type": 'application/json',
|
466
|
+
}
|
475
467
|
|
476
468
|
@client.call(
|
477
469
|
method: 'POST',
|
@@ -488,13 +480,17 @@ module Appwrite
|
|
488
480
|
# different API modes](/docs/admin).
|
489
481
|
#
|
490
482
|
# @param [String] function_id Function ID.
|
491
|
-
# @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: trigger, status, statusCode,
|
483
|
+
# @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: trigger, status, statusCode, duration
|
492
484
|
# @param [String] search Search term to filter your list results. Max length: 256 chars.
|
493
485
|
#
|
494
486
|
# @return [ExecutionList]
|
495
487
|
def list_executions(function_id:, queries: nil, search: nil)
|
496
|
-
|
497
488
|
path = '/functions/{functionId}/executions'
|
489
|
+
.gsub('{functionId}', function_id)
|
490
|
+
|
491
|
+
if function_id.nil?
|
492
|
+
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
493
|
+
end
|
498
494
|
|
499
495
|
params = {
|
500
496
|
queries: queries,
|
@@ -504,11 +500,6 @@ module Appwrite
|
|
504
500
|
headers = {
|
505
501
|
"content-type": 'application/json',
|
506
502
|
}
|
507
|
-
if function_id.nil?
|
508
|
-
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
509
|
-
end
|
510
|
-
|
511
|
-
.gsub('{functionId}', function_id)
|
512
503
|
|
513
504
|
@client.call(
|
514
505
|
method: 'GET',
|
@@ -527,12 +518,16 @@ module Appwrite
|
|
527
518
|
#
|
528
519
|
# @param [String] function_id Function ID.
|
529
520
|
# @param [String] data String of custom data to send to function.
|
530
|
-
# @param [] async Execute code
|
521
|
+
# @param [] async Execute code in the background. Default value is false.
|
531
522
|
#
|
532
523
|
# @return [Execution]
|
533
524
|
def create_execution(function_id:, data: nil, async: nil)
|
534
|
-
|
535
525
|
path = '/functions/{functionId}/executions'
|
526
|
+
.gsub('{functionId}', function_id)
|
527
|
+
|
528
|
+
if function_id.nil?
|
529
|
+
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
530
|
+
end
|
536
531
|
|
537
532
|
params = {
|
538
533
|
data: data,
|
@@ -542,11 +537,6 @@ module Appwrite
|
|
542
537
|
headers = {
|
543
538
|
"content-type": 'application/json',
|
544
539
|
}
|
545
|
-
if function_id.nil?
|
546
|
-
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
547
|
-
end
|
548
|
-
|
549
|
-
.gsub('{functionId}', function_id)
|
550
540
|
|
551
541
|
@client.call(
|
552
542
|
method: 'POST',
|
@@ -565,25 +555,24 @@ module Appwrite
|
|
565
555
|
#
|
566
556
|
# @return [Execution]
|
567
557
|
def get_execution(function_id:, execution_id:)
|
568
|
-
|
569
558
|
path = '/functions/{functionId}/executions/{executionId}'
|
559
|
+
.gsub('{functionId}', function_id)
|
560
|
+
.gsub('{executionId}', execution_id)
|
570
561
|
|
571
|
-
params = {
|
572
|
-
}
|
573
|
-
|
574
|
-
headers = {
|
575
|
-
"content-type": 'application/json',
|
576
|
-
}
|
577
562
|
if function_id.nil?
|
578
|
-
|
563
|
+
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
579
564
|
end
|
580
565
|
|
581
566
|
if execution_id.nil?
|
582
|
-
|
567
|
+
raise Appwrite::Exception.new('Missing required parameter: "executionId"')
|
583
568
|
end
|
584
569
|
|
585
|
-
|
586
|
-
|
570
|
+
params = {
|
571
|
+
}
|
572
|
+
|
573
|
+
headers = {
|
574
|
+
"content-type": 'application/json',
|
575
|
+
}
|
587
576
|
|
588
577
|
@client.call(
|
589
578
|
method: 'GET',
|
@@ -598,27 +587,22 @@ module Appwrite
|
|
598
587
|
# Get a list of all variables of a specific function.
|
599
588
|
#
|
600
589
|
# @param [String] function_id Function unique ID.
|
601
|
-
# @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: key
|
602
|
-
# @param [String] search Search term to filter your list results. Max length: 256 chars.
|
603
590
|
#
|
604
591
|
# @return [VariableList]
|
605
|
-
def list_variables(function_id
|
606
|
-
|
592
|
+
def list_variables(function_id:)
|
607
593
|
path = '/functions/{functionId}/variables'
|
594
|
+
.gsub('{functionId}', function_id)
|
595
|
+
|
596
|
+
if function_id.nil?
|
597
|
+
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
598
|
+
end
|
608
599
|
|
609
600
|
params = {
|
610
|
-
queries: queries,
|
611
|
-
search: search,
|
612
601
|
}
|
613
602
|
|
614
603
|
headers = {
|
615
604
|
"content-type": 'application/json',
|
616
605
|
}
|
617
|
-
if function_id.nil?
|
618
|
-
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
619
|
-
end
|
620
|
-
|
621
|
-
.gsub('{functionId}', function_id)
|
622
606
|
|
623
607
|
@client.call(
|
624
608
|
method: 'GET',
|
@@ -639,30 +623,29 @@ module Appwrite
|
|
639
623
|
#
|
640
624
|
# @return [Variable]
|
641
625
|
def create_variable(function_id:, key:, value:)
|
642
|
-
|
643
626
|
path = '/functions/{functionId}/variables'
|
627
|
+
.gsub('{functionId}', function_id)
|
644
628
|
|
645
|
-
params = {
|
646
|
-
key: key,
|
647
|
-
value: value,
|
648
|
-
}
|
649
|
-
|
650
|
-
headers = {
|
651
|
-
"content-type": 'application/json',
|
652
|
-
}
|
653
629
|
if function_id.nil?
|
654
|
-
|
630
|
+
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
655
631
|
end
|
656
632
|
|
657
633
|
if key.nil?
|
658
|
-
|
634
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
659
635
|
end
|
660
636
|
|
661
637
|
if value.nil?
|
662
|
-
|
638
|
+
raise Appwrite::Exception.new('Missing required parameter: "value"')
|
663
639
|
end
|
664
640
|
|
665
|
-
|
641
|
+
params = {
|
642
|
+
key: key,
|
643
|
+
value: value,
|
644
|
+
}
|
645
|
+
|
646
|
+
headers = {
|
647
|
+
"content-type": 'application/json',
|
648
|
+
}
|
666
649
|
|
667
650
|
@client.call(
|
668
651
|
method: 'POST',
|
@@ -681,25 +664,24 @@ module Appwrite
|
|
681
664
|
#
|
682
665
|
# @return [Variable]
|
683
666
|
def get_variable(function_id:, variable_id:)
|
684
|
-
|
685
667
|
path = '/functions/{functionId}/variables/{variableId}'
|
668
|
+
.gsub('{functionId}', function_id)
|
669
|
+
.gsub('{variableId}', variable_id)
|
686
670
|
|
687
|
-
params = {
|
688
|
-
}
|
689
|
-
|
690
|
-
headers = {
|
691
|
-
"content-type": 'application/json',
|
692
|
-
}
|
693
671
|
if function_id.nil?
|
694
|
-
|
672
|
+
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
695
673
|
end
|
696
674
|
|
697
675
|
if variable_id.nil?
|
698
|
-
|
676
|
+
raise Appwrite::Exception.new('Missing required parameter: "variableId"')
|
699
677
|
end
|
700
678
|
|
701
|
-
|
702
|
-
|
679
|
+
params = {
|
680
|
+
}
|
681
|
+
|
682
|
+
headers = {
|
683
|
+
"content-type": 'application/json',
|
684
|
+
}
|
703
685
|
|
704
686
|
@client.call(
|
705
687
|
method: 'GET',
|
@@ -720,31 +702,30 @@ module Appwrite
|
|
720
702
|
#
|
721
703
|
# @return [Variable]
|
722
704
|
def update_variable(function_id:, variable_id:, key:, value: nil)
|
723
|
-
|
724
705
|
path = '/functions/{functionId}/variables/{variableId}'
|
706
|
+
.gsub('{functionId}', function_id)
|
707
|
+
.gsub('{variableId}', variable_id)
|
725
708
|
|
726
|
-
params = {
|
727
|
-
key: key,
|
728
|
-
value: value,
|
729
|
-
}
|
730
|
-
|
731
|
-
headers = {
|
732
|
-
"content-type": 'application/json',
|
733
|
-
}
|
734
709
|
if function_id.nil?
|
735
|
-
|
710
|
+
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
736
711
|
end
|
737
712
|
|
738
713
|
if variable_id.nil?
|
739
|
-
|
714
|
+
raise Appwrite::Exception.new('Missing required parameter: "variableId"')
|
740
715
|
end
|
741
716
|
|
742
717
|
if key.nil?
|
743
|
-
|
718
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
744
719
|
end
|
745
720
|
|
746
|
-
|
747
|
-
|
721
|
+
params = {
|
722
|
+
key: key,
|
723
|
+
value: value,
|
724
|
+
}
|
725
|
+
|
726
|
+
headers = {
|
727
|
+
"content-type": 'application/json',
|
728
|
+
}
|
748
729
|
|
749
730
|
@client.call(
|
750
731
|
method: 'PUT',
|
@@ -763,25 +744,24 @@ module Appwrite
|
|
763
744
|
#
|
764
745
|
# @return []
|
765
746
|
def delete_variable(function_id:, variable_id:)
|
766
|
-
|
767
747
|
path = '/functions/{functionId}/variables/{variableId}'
|
748
|
+
.gsub('{functionId}', function_id)
|
749
|
+
.gsub('{variableId}', variable_id)
|
768
750
|
|
769
|
-
params = {
|
770
|
-
}
|
771
|
-
|
772
|
-
headers = {
|
773
|
-
"content-type": 'application/json',
|
774
|
-
}
|
775
751
|
if function_id.nil?
|
776
|
-
|
752
|
+
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
777
753
|
end
|
778
754
|
|
779
755
|
if variable_id.nil?
|
780
|
-
|
756
|
+
raise Appwrite::Exception.new('Missing required parameter: "variableId"')
|
781
757
|
end
|
782
758
|
|
783
|
-
|
784
|
-
|
759
|
+
params = {
|
760
|
+
}
|
761
|
+
|
762
|
+
headers = {
|
763
|
+
"content-type": 'application/json',
|
764
|
+
}
|
785
765
|
|
786
766
|
@client.call(
|
787
767
|
method: 'DELETE',
|