appwrite 8.0.0 → 9.0.1
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 +4 -4
- data/lib/appwrite/models/attribute_boolean.rb +5 -0
- data/lib/appwrite/models/attribute_datetime.rb +5 -0
- data/lib/appwrite/models/attribute_email.rb +5 -0
- data/lib/appwrite/models/attribute_enum.rb +5 -0
- data/lib/appwrite/models/attribute_float.rb +5 -0
- data/lib/appwrite/models/attribute_integer.rb +5 -0
- data/lib/appwrite/models/attribute_ip.rb +5 -0
- data/lib/appwrite/models/attribute_relationship.rb +5 -0
- data/lib/appwrite/models/attribute_string.rb +5 -0
- data/lib/appwrite/models/attribute_url.rb +5 -0
- data/lib/appwrite/models/database.rb +8 -3
- data/lib/appwrite/models/deployment.rb +63 -13
- data/lib/appwrite/models/execution.rb +40 -20
- data/lib/appwrite/models/function.rb +53 -13
- data/lib/appwrite/models/headers.rb +32 -0
- data/lib/appwrite/models/health_status.rb +5 -0
- data/lib/appwrite/models/identity.rb +72 -0
- data/lib/appwrite/models/identity_list.rb +32 -0
- data/lib/appwrite/models/index.rb +5 -0
- data/lib/appwrite/models/locale_code.rb +32 -0
- data/lib/appwrite/models/locale_code_list.rb +32 -0
- data/lib/appwrite/models/user.rb +13 -3
- data/lib/appwrite/models/variable.rb +10 -5
- data/lib/appwrite/role.rb +56 -0
- data/lib/appwrite/services/account.rb +185 -130
- data/lib/appwrite/services/avatars.rb +42 -42
- data/lib/appwrite/services/databases.rb +274 -262
- data/lib/appwrite/services/functions.rb +229 -143
- data/lib/appwrite/services/graphql.rb +12 -12
- data/lib/appwrite/services/health.rb +111 -62
- data/lib/appwrite/services/locale.rb +67 -42
- data/lib/appwrite/services/storage.rb +85 -83
- data/lib/appwrite/services/teams.rb +80 -79
- data/lib/appwrite/services/users.rb +248 -150
- data/lib/appwrite.rb +5 -0
- metadata +7 -2
@@ -10,27 +10,27 @@ 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
|
-
|
18
|
+
api_path = '/functions'
|
19
19
|
|
20
|
-
|
20
|
+
api_params = {
|
21
21
|
queries: queries,
|
22
22
|
search: search,
|
23
23
|
}
|
24
24
|
|
25
|
-
|
25
|
+
api_headers = {
|
26
26
|
"content-type": 'application/json',
|
27
27
|
}
|
28
28
|
|
29
29
|
@client.call(
|
30
30
|
method: 'GET',
|
31
|
-
path:
|
32
|
-
headers:
|
33
|
-
params:
|
31
|
+
path: api_path,
|
32
|
+
headers: api_headers,
|
33
|
+
params: api_params,
|
34
34
|
response_type: Models::FunctionList
|
35
35
|
)
|
36
36
|
end
|
@@ -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
|
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
|
-
|
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"')
|
@@ -65,26 +77,38 @@ module Appwrite
|
|
65
77
|
raise Appwrite::Exception.new('Missing required parameter: "runtime"')
|
66
78
|
end
|
67
79
|
|
68
|
-
|
80
|
+
api_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
|
+
api_headers = {
|
80
104
|
"content-type": 'application/json',
|
81
105
|
}
|
82
106
|
|
83
107
|
@client.call(
|
84
108
|
method: 'POST',
|
85
|
-
path:
|
86
|
-
headers:
|
87
|
-
params:
|
109
|
+
path: api_path,
|
110
|
+
headers: api_headers,
|
111
|
+
params: api_params,
|
88
112
|
response_type: Models::Function
|
89
113
|
)
|
90
114
|
end
|
@@ -95,20 +119,20 @@ module Appwrite
|
|
95
119
|
#
|
96
120
|
# @return [RuntimeList]
|
97
121
|
def list_runtimes()
|
98
|
-
|
122
|
+
api_path = '/functions/runtimes'
|
99
123
|
|
100
|
-
|
124
|
+
api_params = {
|
101
125
|
}
|
102
126
|
|
103
|
-
|
127
|
+
api_headers = {
|
104
128
|
"content-type": 'application/json',
|
105
129
|
}
|
106
130
|
|
107
131
|
@client.call(
|
108
132
|
method: 'GET',
|
109
|
-
path:
|
110
|
-
headers:
|
111
|
-
params:
|
133
|
+
path: api_path,
|
134
|
+
headers: api_headers,
|
135
|
+
params: api_params,
|
112
136
|
response_type: Models::RuntimeList
|
113
137
|
)
|
114
138
|
end
|
@@ -120,25 +144,25 @@ module Appwrite
|
|
120
144
|
#
|
121
145
|
# @return [Function]
|
122
146
|
def get(function_id:)
|
123
|
-
|
147
|
+
api_path = '/functions/{functionId}'
|
124
148
|
.gsub('{functionId}', function_id)
|
125
149
|
|
126
150
|
if function_id.nil?
|
127
151
|
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
128
152
|
end
|
129
153
|
|
130
|
-
|
154
|
+
api_params = {
|
131
155
|
}
|
132
156
|
|
133
|
-
|
157
|
+
api_headers = {
|
134
158
|
"content-type": 'application/json',
|
135
159
|
}
|
136
160
|
|
137
161
|
@client.call(
|
138
162
|
method: 'GET',
|
139
|
-
path:
|
140
|
-
headers:
|
141
|
-
params:
|
163
|
+
path: api_path,
|
164
|
+
headers: api_headers,
|
165
|
+
params: api_params,
|
142
166
|
response_type: Models::Function
|
143
167
|
)
|
144
168
|
end
|
@@ -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 [
|
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
|
-
|
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,24 +200,37 @@ module Appwrite
|
|
167
200
|
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
168
201
|
end
|
169
202
|
|
170
|
-
|
203
|
+
if runtime.nil?
|
204
|
+
raise Appwrite::Exception.new('Missing required parameter: "runtime"')
|
205
|
+
end
|
206
|
+
|
207
|
+
api_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
|
+
api_headers = {
|
180
226
|
"content-type": 'application/json',
|
181
227
|
}
|
182
228
|
|
183
229
|
@client.call(
|
184
230
|
method: 'PUT',
|
185
|
-
path:
|
186
|
-
headers:
|
187
|
-
params:
|
231
|
+
path: api_path,
|
232
|
+
headers: api_headers,
|
233
|
+
params: api_params,
|
188
234
|
response_type: Models::Function
|
189
235
|
)
|
190
236
|
end
|
@@ -196,25 +242,25 @@ module Appwrite
|
|
196
242
|
#
|
197
243
|
# @return []
|
198
244
|
def delete(function_id:)
|
199
|
-
|
245
|
+
api_path = '/functions/{functionId}'
|
200
246
|
.gsub('{functionId}', function_id)
|
201
247
|
|
202
248
|
if function_id.nil?
|
203
249
|
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
204
250
|
end
|
205
251
|
|
206
|
-
|
252
|
+
api_params = {
|
207
253
|
}
|
208
254
|
|
209
|
-
|
255
|
+
api_headers = {
|
210
256
|
"content-type": 'application/json',
|
211
257
|
}
|
212
258
|
|
213
259
|
@client.call(
|
214
260
|
method: 'DELETE',
|
215
|
-
path:
|
216
|
-
headers:
|
217
|
-
params:
|
261
|
+
path: api_path,
|
262
|
+
headers: api_headers,
|
263
|
+
params: api_params,
|
218
264
|
)
|
219
265
|
end
|
220
266
|
|
@@ -223,32 +269,32 @@ 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:
|
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
|
-
|
277
|
+
api_path = '/functions/{functionId}/deployments'
|
232
278
|
.gsub('{functionId}', function_id)
|
233
279
|
|
234
280
|
if function_id.nil?
|
235
281
|
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
236
282
|
end
|
237
283
|
|
238
|
-
|
284
|
+
api_params = {
|
239
285
|
queries: queries,
|
240
286
|
search: search,
|
241
287
|
}
|
242
288
|
|
243
|
-
|
289
|
+
api_headers = {
|
244
290
|
"content-type": 'application/json',
|
245
291
|
}
|
246
292
|
|
247
293
|
@client.call(
|
248
294
|
method: 'GET',
|
249
|
-
path:
|
250
|
-
headers:
|
251
|
-
params:
|
295
|
+
path: api_path,
|
296
|
+
headers: api_headers,
|
297
|
+
params: api_params,
|
252
298
|
response_type: Models::DeploymentList
|
253
299
|
)
|
254
300
|
end
|
@@ -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
|
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:,
|
275
|
-
|
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
|
@@ -291,13 +334,14 @@ module Appwrite
|
|
291
334
|
raise Appwrite::Exception.new('Missing required parameter: "activate"')
|
292
335
|
end
|
293
336
|
|
294
|
-
|
337
|
+
api_params = {
|
295
338
|
entrypoint: entrypoint,
|
339
|
+
commands: commands,
|
296
340
|
code: code,
|
297
341
|
activate: activate,
|
298
342
|
}
|
299
343
|
|
300
|
-
|
344
|
+
api_headers = {
|
301
345
|
"content-type": 'multipart/form-data',
|
302
346
|
}
|
303
347
|
|
@@ -305,9 +349,9 @@ module Appwrite
|
|
305
349
|
param_name = 'code'
|
306
350
|
|
307
351
|
@client.chunked_upload(
|
308
|
-
path:
|
309
|
-
headers:
|
310
|
-
params:
|
352
|
+
path: api_path,
|
353
|
+
headers: api_headers,
|
354
|
+
params: api_params,
|
311
355
|
param_name: param_name,
|
312
356
|
id_param_name: id_param_name,
|
313
357
|
on_progress: on_progress,
|
@@ -323,7 +367,7 @@ module Appwrite
|
|
323
367
|
#
|
324
368
|
# @return [Deployment]
|
325
369
|
def get_deployment(function_id:, deployment_id:)
|
326
|
-
|
370
|
+
api_path = '/functions/{functionId}/deployments/{deploymentId}'
|
327
371
|
.gsub('{functionId}', function_id)
|
328
372
|
.gsub('{deploymentId}', deployment_id)
|
329
373
|
|
@@ -335,18 +379,18 @@ module Appwrite
|
|
335
379
|
raise Appwrite::Exception.new('Missing required parameter: "deploymentId"')
|
336
380
|
end
|
337
381
|
|
338
|
-
|
382
|
+
api_params = {
|
339
383
|
}
|
340
384
|
|
341
|
-
|
385
|
+
api_headers = {
|
342
386
|
"content-type": 'application/json',
|
343
387
|
}
|
344
388
|
|
345
389
|
@client.call(
|
346
390
|
method: 'GET',
|
347
|
-
path:
|
348
|
-
headers:
|
349
|
-
params:
|
391
|
+
path: api_path,
|
392
|
+
headers: api_headers,
|
393
|
+
params: api_params,
|
350
394
|
response_type: Models::Deployment
|
351
395
|
)
|
352
396
|
end
|
@@ -361,7 +405,7 @@ module Appwrite
|
|
361
405
|
#
|
362
406
|
# @return [Function]
|
363
407
|
def update_deployment(function_id:, deployment_id:)
|
364
|
-
|
408
|
+
api_path = '/functions/{functionId}/deployments/{deploymentId}'
|
365
409
|
.gsub('{functionId}', function_id)
|
366
410
|
.gsub('{deploymentId}', deployment_id)
|
367
411
|
|
@@ -373,18 +417,18 @@ module Appwrite
|
|
373
417
|
raise Appwrite::Exception.new('Missing required parameter: "deploymentId"')
|
374
418
|
end
|
375
419
|
|
376
|
-
|
420
|
+
api_params = {
|
377
421
|
}
|
378
422
|
|
379
|
-
|
423
|
+
api_headers = {
|
380
424
|
"content-type": 'application/json',
|
381
425
|
}
|
382
426
|
|
383
427
|
@client.call(
|
384
428
|
method: 'PATCH',
|
385
|
-
path:
|
386
|
-
headers:
|
387
|
-
params:
|
429
|
+
path: api_path,
|
430
|
+
headers: api_headers,
|
431
|
+
params: api_params,
|
388
432
|
response_type: Models::Function
|
389
433
|
)
|
390
434
|
end
|
@@ -397,7 +441,7 @@ module Appwrite
|
|
397
441
|
#
|
398
442
|
# @return []
|
399
443
|
def delete_deployment(function_id:, deployment_id:)
|
400
|
-
|
444
|
+
api_path = '/functions/{functionId}/deployments/{deploymentId}'
|
401
445
|
.gsub('{functionId}', function_id)
|
402
446
|
.gsub('{deploymentId}', deployment_id)
|
403
447
|
|
@@ -409,23 +453,24 @@ module Appwrite
|
|
409
453
|
raise Appwrite::Exception.new('Missing required parameter: "deploymentId"')
|
410
454
|
end
|
411
455
|
|
412
|
-
|
456
|
+
api_params = {
|
413
457
|
}
|
414
458
|
|
415
|
-
|
459
|
+
api_headers = {
|
416
460
|
"content-type": 'application/json',
|
417
461
|
}
|
418
462
|
|
419
463
|
@client.call(
|
420
464
|
method: 'DELETE',
|
421
|
-
path:
|
422
|
-
headers:
|
423
|
-
params:
|
465
|
+
path: api_path,
|
466
|
+
headers: api_headers,
|
467
|
+
params: api_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
|
-
|
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)
|
@@ -450,18 +495,53 @@ module Appwrite
|
|
450
495
|
raise Appwrite::Exception.new('Missing required parameter: "buildId"')
|
451
496
|
end
|
452
497
|
|
453
|
-
|
498
|
+
api_params = {
|
454
499
|
}
|
455
500
|
|
456
|
-
|
501
|
+
api_headers = {
|
457
502
|
"content-type": 'application/json',
|
458
503
|
}
|
459
504
|
|
460
505
|
@client.call(
|
461
506
|
method: 'POST',
|
462
|
-
path:
|
463
|
-
headers:
|
464
|
-
params:
|
507
|
+
path: api_path,
|
508
|
+
headers: api_headers,
|
509
|
+
params: api_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
|
+
api_params = {
|
534
|
+
}
|
535
|
+
|
536
|
+
api_headers = {
|
537
|
+
"content-type": 'application/json',
|
538
|
+
}
|
539
|
+
|
540
|
+
@client.call(
|
541
|
+
method: 'GET',
|
542
|
+
path: api_path,
|
543
|
+
headers: api_headers,
|
544
|
+
params: api_params,
|
465
545
|
)
|
466
546
|
end
|
467
547
|
|
@@ -470,32 +550,32 @@ 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,
|
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
|
-
|
558
|
+
api_path = '/functions/{functionId}/executions'
|
479
559
|
.gsub('{functionId}', function_id)
|
480
560
|
|
481
561
|
if function_id.nil?
|
482
562
|
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
483
563
|
end
|
484
564
|
|
485
|
-
|
565
|
+
api_params = {
|
486
566
|
queries: queries,
|
487
567
|
search: search,
|
488
568
|
}
|
489
569
|
|
490
|
-
|
570
|
+
api_headers = {
|
491
571
|
"content-type": 'application/json',
|
492
572
|
}
|
493
573
|
|
494
574
|
@client.call(
|
495
575
|
method: 'GET',
|
496
|
-
path:
|
497
|
-
headers:
|
498
|
-
params:
|
576
|
+
path: api_path,
|
577
|
+
headers: api_headers,
|
578
|
+
params: api_params,
|
499
579
|
response_type: Models::ExecutionList
|
500
580
|
)
|
501
581
|
end
|
@@ -507,32 +587,38 @@ module Appwrite
|
|
507
587
|
# function execution process will start asynchronously.
|
508
588
|
#
|
509
589
|
# @param [String] function_id Function ID.
|
510
|
-
# @param [String]
|
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:,
|
515
|
-
|
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?
|
519
602
|
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
520
603
|
end
|
521
604
|
|
522
|
-
|
523
|
-
|
605
|
+
api_params = {
|
606
|
+
body: body,
|
524
607
|
async: async,
|
608
|
+
path: xpath,
|
609
|
+
method: method,
|
610
|
+
headers: headers,
|
525
611
|
}
|
526
612
|
|
527
|
-
|
613
|
+
api_headers = {
|
528
614
|
"content-type": 'application/json',
|
529
615
|
}
|
530
616
|
|
531
617
|
@client.call(
|
532
618
|
method: 'POST',
|
533
|
-
path:
|
534
|
-
headers:
|
535
|
-
params:
|
619
|
+
path: api_path,
|
620
|
+
headers: api_headers,
|
621
|
+
params: api_params,
|
536
622
|
response_type: Models::Execution
|
537
623
|
)
|
538
624
|
end
|
@@ -545,7 +631,7 @@ module Appwrite
|
|
545
631
|
#
|
546
632
|
# @return [Execution]
|
547
633
|
def get_execution(function_id:, execution_id:)
|
548
|
-
|
634
|
+
api_path = '/functions/{functionId}/executions/{executionId}'
|
549
635
|
.gsub('{functionId}', function_id)
|
550
636
|
.gsub('{executionId}', execution_id)
|
551
637
|
|
@@ -557,18 +643,18 @@ module Appwrite
|
|
557
643
|
raise Appwrite::Exception.new('Missing required parameter: "executionId"')
|
558
644
|
end
|
559
645
|
|
560
|
-
|
646
|
+
api_params = {
|
561
647
|
}
|
562
648
|
|
563
|
-
|
649
|
+
api_headers = {
|
564
650
|
"content-type": 'application/json',
|
565
651
|
}
|
566
652
|
|
567
653
|
@client.call(
|
568
654
|
method: 'GET',
|
569
|
-
path:
|
570
|
-
headers:
|
571
|
-
params:
|
655
|
+
path: api_path,
|
656
|
+
headers: api_headers,
|
657
|
+
params: api_params,
|
572
658
|
response_type: Models::Execution
|
573
659
|
)
|
574
660
|
end
|
@@ -580,32 +666,32 @@ module Appwrite
|
|
580
666
|
#
|
581
667
|
# @return [VariableList]
|
582
668
|
def list_variables(function_id:)
|
583
|
-
|
669
|
+
api_path = '/functions/{functionId}/variables'
|
584
670
|
.gsub('{functionId}', function_id)
|
585
671
|
|
586
672
|
if function_id.nil?
|
587
673
|
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
588
674
|
end
|
589
675
|
|
590
|
-
|
676
|
+
api_params = {
|
591
677
|
}
|
592
678
|
|
593
|
-
|
679
|
+
api_headers = {
|
594
680
|
"content-type": 'application/json',
|
595
681
|
}
|
596
682
|
|
597
683
|
@client.call(
|
598
684
|
method: 'GET',
|
599
|
-
path:
|
600
|
-
headers:
|
601
|
-
params:
|
685
|
+
path: api_path,
|
686
|
+
headers: api_headers,
|
687
|
+
params: api_params,
|
602
688
|
response_type: Models::VariableList
|
603
689
|
)
|
604
690
|
end
|
605
691
|
|
606
692
|
|
607
|
-
# Create a new function variable. These variables can be accessed
|
608
|
-
#
|
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
|
-
|
702
|
+
api_path = '/functions/{functionId}/variables'
|
617
703
|
.gsub('{functionId}', function_id)
|
618
704
|
|
619
705
|
if function_id.nil?
|
@@ -628,20 +714,20 @@ module Appwrite
|
|
628
714
|
raise Appwrite::Exception.new('Missing required parameter: "value"')
|
629
715
|
end
|
630
716
|
|
631
|
-
|
717
|
+
api_params = {
|
632
718
|
key: key,
|
633
719
|
value: value,
|
634
720
|
}
|
635
721
|
|
636
|
-
|
722
|
+
api_headers = {
|
637
723
|
"content-type": 'application/json',
|
638
724
|
}
|
639
725
|
|
640
726
|
@client.call(
|
641
727
|
method: 'POST',
|
642
|
-
path:
|
643
|
-
headers:
|
644
|
-
params:
|
728
|
+
path: api_path,
|
729
|
+
headers: api_headers,
|
730
|
+
params: api_params,
|
645
731
|
response_type: Models::Variable
|
646
732
|
)
|
647
733
|
end
|
@@ -654,7 +740,7 @@ module Appwrite
|
|
654
740
|
#
|
655
741
|
# @return [Variable]
|
656
742
|
def get_variable(function_id:, variable_id:)
|
657
|
-
|
743
|
+
api_path = '/functions/{functionId}/variables/{variableId}'
|
658
744
|
.gsub('{functionId}', function_id)
|
659
745
|
.gsub('{variableId}', variable_id)
|
660
746
|
|
@@ -666,18 +752,18 @@ module Appwrite
|
|
666
752
|
raise Appwrite::Exception.new('Missing required parameter: "variableId"')
|
667
753
|
end
|
668
754
|
|
669
|
-
|
755
|
+
api_params = {
|
670
756
|
}
|
671
757
|
|
672
|
-
|
758
|
+
api_headers = {
|
673
759
|
"content-type": 'application/json',
|
674
760
|
}
|
675
761
|
|
676
762
|
@client.call(
|
677
763
|
method: 'GET',
|
678
|
-
path:
|
679
|
-
headers:
|
680
|
-
params:
|
764
|
+
path: api_path,
|
765
|
+
headers: api_headers,
|
766
|
+
params: api_params,
|
681
767
|
response_type: Models::Variable
|
682
768
|
)
|
683
769
|
end
|
@@ -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
|
-
|
781
|
+
api_path = '/functions/{functionId}/variables/{variableId}'
|
696
782
|
.gsub('{functionId}', function_id)
|
697
783
|
.gsub('{variableId}', variable_id)
|
698
784
|
|
@@ -708,20 +794,20 @@ module Appwrite
|
|
708
794
|
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
709
795
|
end
|
710
796
|
|
711
|
-
|
797
|
+
api_params = {
|
712
798
|
key: key,
|
713
799
|
value: value,
|
714
800
|
}
|
715
801
|
|
716
|
-
|
802
|
+
api_headers = {
|
717
803
|
"content-type": 'application/json',
|
718
804
|
}
|
719
805
|
|
720
806
|
@client.call(
|
721
807
|
method: 'PUT',
|
722
|
-
path:
|
723
|
-
headers:
|
724
|
-
params:
|
808
|
+
path: api_path,
|
809
|
+
headers: api_headers,
|
810
|
+
params: api_params,
|
725
811
|
response_type: Models::Variable
|
726
812
|
)
|
727
813
|
end
|
@@ -734,7 +820,7 @@ module Appwrite
|
|
734
820
|
#
|
735
821
|
# @return []
|
736
822
|
def delete_variable(function_id:, variable_id:)
|
737
|
-
|
823
|
+
api_path = '/functions/{functionId}/variables/{variableId}'
|
738
824
|
.gsub('{functionId}', function_id)
|
739
825
|
.gsub('{variableId}', variable_id)
|
740
826
|
|
@@ -746,18 +832,18 @@ module Appwrite
|
|
746
832
|
raise Appwrite::Exception.new('Missing required parameter: "variableId"')
|
747
833
|
end
|
748
834
|
|
749
|
-
|
835
|
+
api_params = {
|
750
836
|
}
|
751
837
|
|
752
|
-
|
838
|
+
api_headers = {
|
753
839
|
"content-type": 'application/json',
|
754
840
|
}
|
755
841
|
|
756
842
|
@client.call(
|
757
843
|
method: 'DELETE',
|
758
|
-
path:
|
759
|
-
headers:
|
760
|
-
params:
|
844
|
+
path: api_path,
|
845
|
+
headers: api_headers,
|
846
|
+
params: api_params,
|
761
847
|
)
|
762
848
|
end
|
763
849
|
|