appwrite 3.0.0 → 4.0.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.
- checksums.yaml +4 -4
- data/lib/appwrite/client.rb +69 -5
- data/lib/appwrite/exception.rb +3 -1
- data/lib/appwrite/file.rb +4 -2
- data/lib/appwrite/models/attribute_list.rb +5 -5
- data/lib/appwrite/models/bucket.rb +82 -0
- data/lib/appwrite/models/bucket_list.rb +32 -0
- data/lib/appwrite/models/collection_list.rb +5 -5
- data/lib/appwrite/models/continent_list.rb +5 -5
- data/lib/appwrite/models/country_list.rb +5 -5
- data/lib/appwrite/models/currency_list.rb +5 -5
- data/lib/appwrite/models/deployment.rb +77 -0
- data/lib/appwrite/models/deployment_list.rb +32 -0
- data/lib/appwrite/models/document_list.rb +5 -5
- data/lib/appwrite/models/execution.rb +5 -5
- data/lib/appwrite/models/execution_list.rb +5 -5
- data/lib/appwrite/models/file.rb +18 -3
- data/lib/appwrite/models/file_list.rb +5 -5
- data/lib/appwrite/models/function.rb +5 -5
- data/lib/appwrite/models/function_list.rb +5 -5
- data/lib/appwrite/models/index_list.rb +5 -5
- data/lib/appwrite/models/language_list.rb +5 -5
- data/lib/appwrite/models/log_list.rb +5 -5
- data/lib/appwrite/models/membership_list.rb +5 -5
- data/lib/appwrite/models/phone_list.rb +5 -5
- data/lib/appwrite/models/runtime_list.rb +5 -5
- data/lib/appwrite/models/session.rb +15 -5
- data/lib/appwrite/models/session_list.rb +5 -5
- data/lib/appwrite/models/team.rb +5 -5
- data/lib/appwrite/models/team_list.rb +5 -5
- data/lib/appwrite/models/user_list.rb +5 -5
- data/lib/appwrite/services/account.rb +62 -32
- data/lib/appwrite/services/avatars.rb +7 -8
- data/lib/appwrite/services/database.rb +52 -53
- data/lib/appwrite/services/functions.rb +175 -125
- data/lib/appwrite/services/health.rb +22 -23
- data/lib/appwrite/services/locale.rb +14 -15
- data/lib/appwrite/services/storage.rb +309 -47
- data/lib/appwrite/services/teams.rb +25 -22
- data/lib/appwrite/services/users.rb +31 -31
- data/lib/appwrite.rb +5 -3
- metadata +8 -6
- data/lib/appwrite/models/tag.rb +0 -47
- data/lib/appwrite/models/tag_list.rb +0 -32
@@ -3,7 +3,6 @@
|
|
3
3
|
module Appwrite
|
4
4
|
class Functions < Service
|
5
5
|
|
6
|
-
include Models
|
7
6
|
# Get a list of all the project's functions. You can use the query params to
|
8
7
|
# filter your results.
|
9
8
|
#
|
@@ -34,9 +33,9 @@ module Appwrite
|
|
34
33
|
@client.call(
|
35
34
|
method: 'GET',
|
36
35
|
path: path,
|
37
|
-
params: params,
|
38
36
|
headers: headers,
|
39
|
-
|
37
|
+
params: params,
|
38
|
+
response_type: Models::FunctionList
|
40
39
|
)
|
41
40
|
end
|
42
41
|
|
@@ -44,7 +43,7 @@ module Appwrite
|
|
44
43
|
# [permissions](/docs/permissions) to allow different project users or team
|
45
44
|
# with access to execute the function using the client API.
|
46
45
|
#
|
47
|
-
# @param [string] function_id Function ID. Choose your own unique ID or pass the string
|
46
|
+
# @param [string] function_id Function ID. Choose your own unique ID or pass the string "unique()" to auto generate it. 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.
|
48
47
|
# @param [string] name Function name. Max length: 128 chars.
|
49
48
|
# @param [array] execute An array of strings with execution permissions. By default no user is granted with any execute permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.
|
50
49
|
# @param [string] runtime Execution runtime.
|
@@ -91,9 +90,9 @@ module Appwrite
|
|
91
90
|
@client.call(
|
92
91
|
method: 'POST',
|
93
92
|
path: path,
|
94
|
-
params: params,
|
95
93
|
headers: headers,
|
96
|
-
|
94
|
+
params: params,
|
95
|
+
response_type: Models::Function
|
97
96
|
)
|
98
97
|
end
|
99
98
|
|
@@ -114,9 +113,9 @@ module Appwrite
|
|
114
113
|
@client.call(
|
115
114
|
method: 'GET',
|
116
115
|
path: path,
|
117
|
-
params: params,
|
118
116
|
headers: headers,
|
119
|
-
|
117
|
+
params: params,
|
118
|
+
response_type: Models::RuntimeList
|
120
119
|
)
|
121
120
|
end
|
122
121
|
|
@@ -143,9 +142,9 @@ module Appwrite
|
|
143
142
|
@client.call(
|
144
143
|
method: 'GET',
|
145
144
|
path: path,
|
146
|
-
params: params,
|
147
145
|
headers: headers,
|
148
|
-
|
146
|
+
params: params,
|
147
|
+
response_type: Models::Function
|
149
148
|
)
|
150
149
|
end
|
151
150
|
|
@@ -192,9 +191,9 @@ module Appwrite
|
|
192
191
|
@client.call(
|
193
192
|
method: 'PUT',
|
194
193
|
path: path,
|
195
|
-
params: params,
|
196
194
|
headers: headers,
|
197
|
-
|
195
|
+
params: params,
|
196
|
+
response_type: Models::Function
|
198
197
|
)
|
199
198
|
end
|
200
199
|
|
@@ -221,38 +220,38 @@ module Appwrite
|
|
221
220
|
@client.call(
|
222
221
|
method: 'DELETE',
|
223
222
|
path: path,
|
224
|
-
params: params,
|
225
223
|
headers: headers,
|
224
|
+
params: params,
|
226
225
|
)
|
227
226
|
end
|
228
227
|
|
229
|
-
# Get a list of all the
|
230
|
-
#
|
231
|
-
# return a list of all of the project's executions. [Learn more about
|
232
|
-
# different API modes](/docs/admin).
|
228
|
+
# Get a list of all the project's code deployments. You can use the query
|
229
|
+
# params to filter your results.
|
233
230
|
#
|
234
231
|
# @param [string] function_id Function ID.
|
235
|
-
# @param [number] limit Maximum number of executions to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.
|
236
|
-
# @param [number] offset Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)
|
237
232
|
# @param [string] search Search term to filter your list results. Max length: 256 chars.
|
238
|
-
# @param [
|
233
|
+
# @param [number] limit Maximum number of deployments to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.
|
234
|
+
# @param [number] offset Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)
|
235
|
+
# @param [string] cursor ID of the deployment used as the starting point for the query, excluding the deployment itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)
|
239
236
|
# @param [string] cursor_direction Direction of the cursor.
|
237
|
+
# @param [string] order_type Order result by ASC or DESC order.
|
240
238
|
#
|
241
|
-
# @return [
|
242
|
-
def
|
239
|
+
# @return [DeploymentList]
|
240
|
+
def list_deployments(function_id:, search: nil, limit: nil, offset: nil, cursor: nil, cursor_direction: nil, order_type: nil)
|
243
241
|
if function_id.nil?
|
244
242
|
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
245
243
|
end
|
246
244
|
|
247
|
-
path = '/functions/{functionId}/
|
245
|
+
path = '/functions/{functionId}/deployments'
|
248
246
|
.gsub('{functionId}', function_id)
|
249
247
|
|
250
248
|
params = {
|
249
|
+
search: search,
|
251
250
|
limit: limit,
|
252
251
|
offset: offset,
|
253
|
-
search: search,
|
254
252
|
cursor: cursor,
|
255
253
|
cursorDirection: cursor_direction,
|
254
|
+
orderType: order_type,
|
256
255
|
}
|
257
256
|
|
258
257
|
headers = {
|
@@ -262,64 +261,89 @@ module Appwrite
|
|
262
261
|
@client.call(
|
263
262
|
method: 'GET',
|
264
263
|
path: path,
|
265
|
-
params: params,
|
266
264
|
headers: headers,
|
267
|
-
|
265
|
+
params: params,
|
266
|
+
response_type: Models::DeploymentList
|
268
267
|
)
|
269
268
|
end
|
270
269
|
|
271
|
-
#
|
272
|
-
#
|
273
|
-
#
|
274
|
-
#
|
270
|
+
# Create a new function code deployment. Use this endpoint to upload a new
|
271
|
+
# version of your code function. To execute your newly uploaded code, you'll
|
272
|
+
# need to update the function's deployment to use your new deployment UID.
|
273
|
+
#
|
274
|
+
# This endpoint accepts a tar.gz file compressed with your code. Make sure to
|
275
|
+
# include any dependencies your code has within the compressed file. You can
|
276
|
+
# learn more about code packaging in the [Appwrite Cloud Functions
|
277
|
+
# tutorial](/docs/functions).
|
278
|
+
#
|
279
|
+
# Use the "command" param to set the entry point used to execute your code.
|
275
280
|
#
|
276
281
|
# @param [string] function_id Function ID.
|
277
|
-
# @param [string]
|
282
|
+
# @param [string] entrypoint Entrypoint File.
|
283
|
+
# @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.
|
284
|
+
# @param [boolean] activate Automatically activate the deployment when it is finished building.
|
278
285
|
#
|
279
|
-
# @return [
|
280
|
-
def
|
286
|
+
# @return [Deployment]
|
287
|
+
def create_deployment(function_id:, entrypoint:, code:, activate:, on_progress: nil)
|
281
288
|
if function_id.nil?
|
282
289
|
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
283
290
|
end
|
284
291
|
|
285
|
-
|
292
|
+
if entrypoint.nil?
|
293
|
+
raise Appwrite::Exception.new('Missing required parameter: "entrypoint"')
|
294
|
+
end
|
295
|
+
|
296
|
+
if code.nil?
|
297
|
+
raise Appwrite::Exception.new('Missing required parameter: "code"')
|
298
|
+
end
|
299
|
+
|
300
|
+
if activate.nil?
|
301
|
+
raise Appwrite::Exception.new('Missing required parameter: "activate"')
|
302
|
+
end
|
303
|
+
|
304
|
+
path = '/functions/{functionId}/deployments'
|
286
305
|
.gsub('{functionId}', function_id)
|
287
306
|
|
288
307
|
params = {
|
289
|
-
|
308
|
+
entrypoint: entrypoint,
|
309
|
+
code: code,
|
310
|
+
activate: activate,
|
290
311
|
}
|
291
312
|
|
292
313
|
headers = {
|
293
|
-
"content-type": '
|
314
|
+
"content-type": 'multipart/form-data',
|
294
315
|
}
|
295
316
|
|
296
|
-
|
297
|
-
|
317
|
+
param_name = 'code'
|
318
|
+
|
319
|
+
@client.chunked_upload(
|
298
320
|
path: path,
|
299
|
-
params: params,
|
300
321
|
headers: headers,
|
301
|
-
|
322
|
+
params: params,
|
323
|
+
param_name: param_name,
|
324
|
+
on_progress: on_progress,
|
325
|
+
response_type: Models::Deployment
|
302
326
|
)
|
303
327
|
end
|
304
328
|
|
305
|
-
# Get a
|
329
|
+
# Get a code deployment by its unique ID.
|
306
330
|
#
|
307
331
|
# @param [string] function_id Function ID.
|
308
|
-
# @param [string]
|
332
|
+
# @param [string] deployment_id Deployment ID.
|
309
333
|
#
|
310
|
-
# @return [
|
311
|
-
def
|
334
|
+
# @return [DeploymentList]
|
335
|
+
def get_deployment(function_id:, deployment_id:)
|
312
336
|
if function_id.nil?
|
313
337
|
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
314
338
|
end
|
315
339
|
|
316
|
-
if
|
317
|
-
raise Appwrite::Exception.new('Missing required parameter: "
|
340
|
+
if deployment_id.nil?
|
341
|
+
raise Appwrite::Exception.new('Missing required parameter: "deploymentId"')
|
318
342
|
end
|
319
343
|
|
320
|
-
path = '/functions/{functionId}/
|
344
|
+
path = '/functions/{functionId}/deployments/{deploymentId}'
|
321
345
|
.gsub('{functionId}', function_id)
|
322
|
-
.gsub('{
|
346
|
+
.gsub('{deploymentId}', deployment_id)
|
323
347
|
|
324
348
|
params = {
|
325
349
|
}
|
@@ -331,34 +355,34 @@ module Appwrite
|
|
331
355
|
@client.call(
|
332
356
|
method: 'GET',
|
333
357
|
path: path,
|
334
|
-
params: params,
|
335
358
|
headers: headers,
|
336
|
-
|
359
|
+
params: params,
|
360
|
+
response_type: Models::DeploymentList
|
337
361
|
)
|
338
362
|
end
|
339
363
|
|
340
|
-
# Update the function code
|
341
|
-
# endpoint to switch the code
|
342
|
-
# endpoint.
|
364
|
+
# Update the function code deployment ID using the unique function ID. Use
|
365
|
+
# this endpoint to switch the code deployment that should be executed by the
|
366
|
+
# execution endpoint.
|
343
367
|
#
|
344
368
|
# @param [string] function_id Function ID.
|
345
|
-
# @param [string]
|
369
|
+
# @param [string] deployment_id Deployment ID.
|
346
370
|
#
|
347
371
|
# @return [Function]
|
348
|
-
def
|
372
|
+
def update_deployment(function_id:, deployment_id:)
|
349
373
|
if function_id.nil?
|
350
374
|
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
351
375
|
end
|
352
376
|
|
353
|
-
if
|
354
|
-
raise Appwrite::Exception.new('Missing required parameter: "
|
377
|
+
if deployment_id.nil?
|
378
|
+
raise Appwrite::Exception.new('Missing required parameter: "deploymentId"')
|
355
379
|
end
|
356
380
|
|
357
|
-
path = '/functions/{functionId}/
|
381
|
+
path = '/functions/{functionId}/deployments/{deploymentId}'
|
358
382
|
.gsub('{functionId}', function_id)
|
383
|
+
.gsub('{deploymentId}', deployment_id)
|
359
384
|
|
360
385
|
params = {
|
361
|
-
tag: tag,
|
362
386
|
}
|
363
387
|
|
364
388
|
headers = {
|
@@ -368,39 +392,32 @@ module Appwrite
|
|
368
392
|
@client.call(
|
369
393
|
method: 'PATCH',
|
370
394
|
path: path,
|
371
|
-
params: params,
|
372
395
|
headers: headers,
|
373
|
-
|
396
|
+
params: params,
|
397
|
+
response_type: Models::Function
|
374
398
|
)
|
375
399
|
end
|
376
400
|
|
377
|
-
#
|
378
|
-
# filter your results.
|
401
|
+
# Delete a code deployment by its unique ID.
|
379
402
|
#
|
380
403
|
# @param [string] function_id Function ID.
|
381
|
-
# @param [string]
|
382
|
-
# @param [number] limit Maximum number of tags to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.
|
383
|
-
# @param [number] offset Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)
|
384
|
-
# @param [string] cursor ID of the tag used as the starting point for the query, excluding the tag itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)
|
385
|
-
# @param [string] cursor_direction Direction of the cursor.
|
386
|
-
# @param [string] order_type Order result by ASC or DESC order.
|
404
|
+
# @param [string] deployment_id Deployment ID.
|
387
405
|
#
|
388
|
-
# @return [
|
389
|
-
def
|
406
|
+
# @return []
|
407
|
+
def delete_deployment(function_id:, deployment_id:)
|
390
408
|
if function_id.nil?
|
391
409
|
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
392
410
|
end
|
393
411
|
|
394
|
-
|
412
|
+
if deployment_id.nil?
|
413
|
+
raise Appwrite::Exception.new('Missing required parameter: "deploymentId"')
|
414
|
+
end
|
415
|
+
|
416
|
+
path = '/functions/{functionId}/deployments/{deploymentId}'
|
395
417
|
.gsub('{functionId}', function_id)
|
418
|
+
.gsub('{deploymentId}', deployment_id)
|
396
419
|
|
397
420
|
params = {
|
398
|
-
search: search,
|
399
|
-
limit: limit,
|
400
|
-
offset: offset,
|
401
|
-
cursor: cursor,
|
402
|
-
cursorDirection: cursor_direction,
|
403
|
-
orderType: order_type,
|
404
421
|
}
|
405
422
|
|
406
423
|
headers = {
|
@@ -408,84 +425,80 @@ module Appwrite
|
|
408
425
|
}
|
409
426
|
|
410
427
|
@client.call(
|
411
|
-
method: '
|
428
|
+
method: 'DELETE',
|
412
429
|
path: path,
|
413
|
-
params: params,
|
414
430
|
headers: headers,
|
415
|
-
|
431
|
+
params: params,
|
416
432
|
)
|
417
433
|
end
|
418
434
|
|
419
|
-
# Create a new function code tag. Use this endpoint to upload a new version
|
420
|
-
# of your code function. To execute your newly uploaded code, you'll need to
|
421
|
-
# update the function's tag to use your new tag UID.
|
422
|
-
#
|
423
|
-
# This endpoint accepts a tar.gz file compressed with your code. Make sure to
|
424
|
-
# include any dependencies your code has within the compressed file. You can
|
425
|
-
# learn more about code packaging in the [Appwrite Cloud Functions
|
426
|
-
# tutorial](/docs/functions).
|
427
435
|
#
|
428
|
-
# Use the "command" param to set the entry point used to execute your code.
|
429
436
|
#
|
430
437
|
# @param [string] function_id Function ID.
|
431
|
-
# @param [string]
|
432
|
-
# @param [
|
438
|
+
# @param [string] deployment_id Deployment ID.
|
439
|
+
# @param [string] build_id Build unique ID.
|
433
440
|
#
|
434
|
-
# @return [
|
435
|
-
def
|
441
|
+
# @return []
|
442
|
+
def retry_build(function_id:, deployment_id:, build_id:)
|
436
443
|
if function_id.nil?
|
437
444
|
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
438
445
|
end
|
439
446
|
|
440
|
-
if
|
441
|
-
raise Appwrite::Exception.new('Missing required parameter: "
|
447
|
+
if deployment_id.nil?
|
448
|
+
raise Appwrite::Exception.new('Missing required parameter: "deploymentId"')
|
442
449
|
end
|
443
450
|
|
444
|
-
if
|
445
|
-
raise Appwrite::Exception.new('Missing required parameter: "
|
451
|
+
if build_id.nil?
|
452
|
+
raise Appwrite::Exception.new('Missing required parameter: "buildId"')
|
446
453
|
end
|
447
454
|
|
448
|
-
path = '/functions/{functionId}/
|
455
|
+
path = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}'
|
449
456
|
.gsub('{functionId}', function_id)
|
457
|
+
.gsub('{deploymentId}', deployment_id)
|
458
|
+
.gsub('{buildId}', build_id)
|
450
459
|
|
451
460
|
params = {
|
452
|
-
command: command,
|
453
|
-
code: code,
|
454
461
|
}
|
455
462
|
|
456
463
|
headers = {
|
457
|
-
"content-type": '
|
464
|
+
"content-type": 'application/json',
|
458
465
|
}
|
459
466
|
|
460
467
|
@client.call(
|
461
468
|
method: 'POST',
|
462
469
|
path: path,
|
463
|
-
params: params,
|
464
470
|
headers: headers,
|
465
|
-
|
471
|
+
params: params,
|
466
472
|
)
|
467
473
|
end
|
468
474
|
|
469
|
-
# Get a
|
475
|
+
# Get a list of all the current user function execution logs. You can use the
|
476
|
+
# query params to filter your results. On admin mode, this endpoint will
|
477
|
+
# return a list of all of the project's executions. [Learn more about
|
478
|
+
# different API modes](/docs/admin).
|
470
479
|
#
|
471
480
|
# @param [string] function_id Function ID.
|
472
|
-
# @param [
|
481
|
+
# @param [number] limit Maximum number of executions to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.
|
482
|
+
# @param [number] offset Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)
|
483
|
+
# @param [string] search Search term to filter your list results. Max length: 256 chars.
|
484
|
+
# @param [string] cursor ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)
|
485
|
+
# @param [string] cursor_direction Direction of the cursor.
|
473
486
|
#
|
474
|
-
# @return [
|
475
|
-
def
|
487
|
+
# @return [ExecutionList]
|
488
|
+
def list_executions(function_id:, limit: nil, offset: nil, search: nil, cursor: nil, cursor_direction: nil)
|
476
489
|
if function_id.nil?
|
477
490
|
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
478
491
|
end
|
479
492
|
|
480
|
-
|
481
|
-
raise Appwrite::Exception.new('Missing required parameter: "tagId"')
|
482
|
-
end
|
483
|
-
|
484
|
-
path = '/functions/{functionId}/tags/{tagId}'
|
493
|
+
path = '/functions/{functionId}/executions'
|
485
494
|
.gsub('{functionId}', function_id)
|
486
|
-
.gsub('{tagId}', tag_id)
|
487
495
|
|
488
496
|
params = {
|
497
|
+
limit: limit,
|
498
|
+
offset: offset,
|
499
|
+
search: search,
|
500
|
+
cursor: cursor,
|
501
|
+
cursorDirection: cursor_direction,
|
489
502
|
}
|
490
503
|
|
491
504
|
headers = {
|
@@ -495,30 +508,66 @@ module Appwrite
|
|
495
508
|
@client.call(
|
496
509
|
method: 'GET',
|
497
510
|
path: path,
|
511
|
+
headers: headers,
|
498
512
|
params: params,
|
513
|
+
response_type: Models::ExecutionList
|
514
|
+
)
|
515
|
+
end
|
516
|
+
|
517
|
+
# Trigger a function execution. The returned object will return you the
|
518
|
+
# current execution status. You can ping the `Get Execution` endpoint to get
|
519
|
+
# updates on the current execution status. Once this endpoint is called, your
|
520
|
+
# function execution process will start asynchronously.
|
521
|
+
#
|
522
|
+
# @param [string] function_id Function ID.
|
523
|
+
# @param [string] data String of custom data to send to function.
|
524
|
+
# @param [boolean] async Execute code asynchronously. Default value is true.
|
525
|
+
#
|
526
|
+
# @return [Execution]
|
527
|
+
def create_execution(function_id:, data: nil, async: nil)
|
528
|
+
if function_id.nil?
|
529
|
+
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
530
|
+
end
|
531
|
+
|
532
|
+
path = '/functions/{functionId}/executions'
|
533
|
+
.gsub('{functionId}', function_id)
|
534
|
+
|
535
|
+
params = {
|
536
|
+
data: data,
|
537
|
+
async: async,
|
538
|
+
}
|
539
|
+
|
540
|
+
headers = {
|
541
|
+
"content-type": 'application/json',
|
542
|
+
}
|
543
|
+
|
544
|
+
@client.call(
|
545
|
+
method: 'POST',
|
546
|
+
path: path,
|
499
547
|
headers: headers,
|
500
|
-
|
548
|
+
params: params,
|
549
|
+
response_type: Models::Execution
|
501
550
|
)
|
502
551
|
end
|
503
552
|
|
504
|
-
#
|
553
|
+
# Get a function execution log by its unique ID.
|
505
554
|
#
|
506
555
|
# @param [string] function_id Function ID.
|
507
|
-
# @param [string]
|
556
|
+
# @param [string] execution_id Execution ID.
|
508
557
|
#
|
509
|
-
# @return []
|
510
|
-
def
|
558
|
+
# @return [Execution]
|
559
|
+
def get_execution(function_id:, execution_id:)
|
511
560
|
if function_id.nil?
|
512
561
|
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
513
562
|
end
|
514
563
|
|
515
|
-
if
|
516
|
-
raise Appwrite::Exception.new('Missing required parameter: "
|
564
|
+
if execution_id.nil?
|
565
|
+
raise Appwrite::Exception.new('Missing required parameter: "executionId"')
|
517
566
|
end
|
518
567
|
|
519
|
-
path = '/functions/{functionId}/
|
568
|
+
path = '/functions/{functionId}/executions/{executionId}'
|
520
569
|
.gsub('{functionId}', function_id)
|
521
|
-
.gsub('{
|
570
|
+
.gsub('{executionId}', execution_id)
|
522
571
|
|
523
572
|
params = {
|
524
573
|
}
|
@@ -528,10 +577,11 @@ module Appwrite
|
|
528
577
|
}
|
529
578
|
|
530
579
|
@client.call(
|
531
|
-
method: '
|
580
|
+
method: 'GET',
|
532
581
|
path: path,
|
533
|
-
params: params,
|
534
582
|
headers: headers,
|
583
|
+
params: params,
|
584
|
+
response_type: Models::Execution
|
535
585
|
)
|
536
586
|
end
|
537
587
|
|