appwrite 8.0.0 → 9.0.1
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 +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
@@ -15,22 +15,22 @@ module Appwrite
|
|
15
15
|
#
|
16
16
|
# @return [DatabaseList]
|
17
17
|
def list(queries: nil, search: nil)
|
18
|
-
|
18
|
+
api_path = '/databases'
|
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::DatabaseList
|
35
35
|
)
|
36
36
|
end
|
@@ -40,11 +40,12 @@ module Appwrite
|
|
40
40
|
#
|
41
41
|
#
|
42
42
|
# @param [String] database_id Unique 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.
|
43
|
-
# @param [String] name
|
43
|
+
# @param [String] name Database name. Max length: 128 chars.
|
44
|
+
# @param [] enabled Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
|
44
45
|
#
|
45
46
|
# @return [Database]
|
46
|
-
def create(database_id:, name:)
|
47
|
-
|
47
|
+
def create(database_id:, name:, enabled: nil)
|
48
|
+
api_path = '/databases'
|
48
49
|
|
49
50
|
if database_id.nil?
|
50
51
|
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
@@ -54,20 +55,21 @@ module Appwrite
|
|
54
55
|
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
55
56
|
end
|
56
57
|
|
57
|
-
|
58
|
+
api_params = {
|
58
59
|
databaseId: database_id,
|
59
60
|
name: name,
|
61
|
+
enabled: enabled,
|
60
62
|
}
|
61
63
|
|
62
|
-
|
64
|
+
api_headers = {
|
63
65
|
"content-type": 'application/json',
|
64
66
|
}
|
65
67
|
|
66
68
|
@client.call(
|
67
69
|
method: 'POST',
|
68
|
-
path:
|
69
|
-
headers:
|
70
|
-
params:
|
70
|
+
path: api_path,
|
71
|
+
headers: api_headers,
|
72
|
+
params: api_params,
|
71
73
|
response_type: Models::Database
|
72
74
|
)
|
73
75
|
end
|
@@ -80,25 +82,25 @@ module Appwrite
|
|
80
82
|
#
|
81
83
|
# @return [Database]
|
82
84
|
def get(database_id:)
|
83
|
-
|
85
|
+
api_path = '/databases/{databaseId}'
|
84
86
|
.gsub('{databaseId}', database_id)
|
85
87
|
|
86
88
|
if database_id.nil?
|
87
89
|
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
88
90
|
end
|
89
91
|
|
90
|
-
|
92
|
+
api_params = {
|
91
93
|
}
|
92
94
|
|
93
|
-
|
95
|
+
api_headers = {
|
94
96
|
"content-type": 'application/json',
|
95
97
|
}
|
96
98
|
|
97
99
|
@client.call(
|
98
100
|
method: 'GET',
|
99
|
-
path:
|
100
|
-
headers:
|
101
|
-
params:
|
101
|
+
path: api_path,
|
102
|
+
headers: api_headers,
|
103
|
+
params: api_params,
|
102
104
|
response_type: Models::Database
|
103
105
|
)
|
104
106
|
end
|
@@ -108,10 +110,11 @@ module Appwrite
|
|
108
110
|
#
|
109
111
|
# @param [String] database_id Database ID.
|
110
112
|
# @param [String] name Database name. Max length: 128 chars.
|
113
|
+
# @param [] enabled Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
|
111
114
|
#
|
112
115
|
# @return [Database]
|
113
|
-
def update(database_id:, name:)
|
114
|
-
|
116
|
+
def update(database_id:, name:, enabled: nil)
|
117
|
+
api_path = '/databases/{databaseId}'
|
115
118
|
.gsub('{databaseId}', database_id)
|
116
119
|
|
117
120
|
if database_id.nil?
|
@@ -122,19 +125,20 @@ module Appwrite
|
|
122
125
|
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
123
126
|
end
|
124
127
|
|
125
|
-
|
128
|
+
api_params = {
|
126
129
|
name: name,
|
130
|
+
enabled: enabled,
|
127
131
|
}
|
128
132
|
|
129
|
-
|
133
|
+
api_headers = {
|
130
134
|
"content-type": 'application/json',
|
131
135
|
}
|
132
136
|
|
133
137
|
@client.call(
|
134
138
|
method: 'PUT',
|
135
|
-
path:
|
136
|
-
headers:
|
137
|
-
params:
|
139
|
+
path: api_path,
|
140
|
+
headers: api_headers,
|
141
|
+
params: api_params,
|
138
142
|
response_type: Models::Database
|
139
143
|
)
|
140
144
|
end
|
@@ -147,25 +151,25 @@ module Appwrite
|
|
147
151
|
#
|
148
152
|
# @return []
|
149
153
|
def delete(database_id:)
|
150
|
-
|
154
|
+
api_path = '/databases/{databaseId}'
|
151
155
|
.gsub('{databaseId}', database_id)
|
152
156
|
|
153
157
|
if database_id.nil?
|
154
158
|
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
155
159
|
end
|
156
160
|
|
157
|
-
|
161
|
+
api_params = {
|
158
162
|
}
|
159
163
|
|
160
|
-
|
164
|
+
api_headers = {
|
161
165
|
"content-type": 'application/json',
|
162
166
|
}
|
163
167
|
|
164
168
|
@client.call(
|
165
169
|
method: 'DELETE',
|
166
|
-
path:
|
167
|
-
headers:
|
168
|
-
params:
|
170
|
+
path: api_path,
|
171
|
+
headers: api_headers,
|
172
|
+
params: api_params,
|
169
173
|
)
|
170
174
|
end
|
171
175
|
|
@@ -179,27 +183,27 @@ module Appwrite
|
|
179
183
|
#
|
180
184
|
# @return [CollectionList]
|
181
185
|
def list_collections(database_id:, queries: nil, search: nil)
|
182
|
-
|
186
|
+
api_path = '/databases/{databaseId}/collections'
|
183
187
|
.gsub('{databaseId}', database_id)
|
184
188
|
|
185
189
|
if database_id.nil?
|
186
190
|
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
187
191
|
end
|
188
192
|
|
189
|
-
|
193
|
+
api_params = {
|
190
194
|
queries: queries,
|
191
195
|
search: search,
|
192
196
|
}
|
193
197
|
|
194
|
-
|
198
|
+
api_headers = {
|
195
199
|
"content-type": 'application/json',
|
196
200
|
}
|
197
201
|
|
198
202
|
@client.call(
|
199
203
|
method: 'GET',
|
200
|
-
path:
|
201
|
-
headers:
|
202
|
-
params:
|
204
|
+
path: api_path,
|
205
|
+
headers: api_headers,
|
206
|
+
params: api_params,
|
203
207
|
response_type: Models::CollectionList
|
204
208
|
)
|
205
209
|
end
|
@@ -215,10 +219,11 @@ module Appwrite
|
|
215
219
|
# @param [String] name Collection name. Max length: 128 chars.
|
216
220
|
# @param [Array] permissions An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](/docs/permissions).
|
217
221
|
# @param [] document_security Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](/docs/permissions).
|
222
|
+
# @param [] enabled Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.
|
218
223
|
#
|
219
224
|
# @return [Collection]
|
220
|
-
def create_collection(database_id:, collection_id:, name:, permissions: nil, document_security: nil)
|
221
|
-
|
225
|
+
def create_collection(database_id:, collection_id:, name:, permissions: nil, document_security: nil, enabled: nil)
|
226
|
+
api_path = '/databases/{databaseId}/collections'
|
222
227
|
.gsub('{databaseId}', database_id)
|
223
228
|
|
224
229
|
if database_id.nil?
|
@@ -233,22 +238,23 @@ module Appwrite
|
|
233
238
|
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
234
239
|
end
|
235
240
|
|
236
|
-
|
241
|
+
api_params = {
|
237
242
|
collectionId: collection_id,
|
238
243
|
name: name,
|
239
244
|
permissions: permissions,
|
240
245
|
documentSecurity: document_security,
|
246
|
+
enabled: enabled,
|
241
247
|
}
|
242
248
|
|
243
|
-
|
249
|
+
api_headers = {
|
244
250
|
"content-type": 'application/json',
|
245
251
|
}
|
246
252
|
|
247
253
|
@client.call(
|
248
254
|
method: 'POST',
|
249
|
-
path:
|
250
|
-
headers:
|
251
|
-
params:
|
255
|
+
path: api_path,
|
256
|
+
headers: api_headers,
|
257
|
+
params: api_params,
|
252
258
|
response_type: Models::Collection
|
253
259
|
)
|
254
260
|
end
|
@@ -262,7 +268,7 @@ module Appwrite
|
|
262
268
|
#
|
263
269
|
# @return [Collection]
|
264
270
|
def get_collection(database_id:, collection_id:)
|
265
|
-
|
271
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}'
|
266
272
|
.gsub('{databaseId}', database_id)
|
267
273
|
.gsub('{collectionId}', collection_id)
|
268
274
|
|
@@ -274,18 +280,18 @@ module Appwrite
|
|
274
280
|
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
275
281
|
end
|
276
282
|
|
277
|
-
|
283
|
+
api_params = {
|
278
284
|
}
|
279
285
|
|
280
|
-
|
286
|
+
api_headers = {
|
281
287
|
"content-type": 'application/json',
|
282
288
|
}
|
283
289
|
|
284
290
|
@client.call(
|
285
291
|
method: 'GET',
|
286
|
-
path:
|
287
|
-
headers:
|
288
|
-
params:
|
292
|
+
path: api_path,
|
293
|
+
headers: api_headers,
|
294
|
+
params: api_params,
|
289
295
|
response_type: Models::Collection
|
290
296
|
)
|
291
297
|
end
|
@@ -298,11 +304,11 @@ module Appwrite
|
|
298
304
|
# @param [String] name Collection name. Max length: 128 chars.
|
299
305
|
# @param [Array] permissions An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](/docs/permissions).
|
300
306
|
# @param [] document_security Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](/docs/permissions).
|
301
|
-
# @param [] enabled Is collection enabled?
|
307
|
+
# @param [] enabled Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.
|
302
308
|
#
|
303
309
|
# @return [Collection]
|
304
310
|
def update_collection(database_id:, collection_id:, name:, permissions: nil, document_security: nil, enabled: nil)
|
305
|
-
|
311
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}'
|
306
312
|
.gsub('{databaseId}', database_id)
|
307
313
|
.gsub('{collectionId}', collection_id)
|
308
314
|
|
@@ -318,22 +324,22 @@ module Appwrite
|
|
318
324
|
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
319
325
|
end
|
320
326
|
|
321
|
-
|
327
|
+
api_params = {
|
322
328
|
name: name,
|
323
329
|
permissions: permissions,
|
324
330
|
documentSecurity: document_security,
|
325
331
|
enabled: enabled,
|
326
332
|
}
|
327
333
|
|
328
|
-
|
334
|
+
api_headers = {
|
329
335
|
"content-type": 'application/json',
|
330
336
|
}
|
331
337
|
|
332
338
|
@client.call(
|
333
339
|
method: 'PUT',
|
334
|
-
path:
|
335
|
-
headers:
|
336
|
-
params:
|
340
|
+
path: api_path,
|
341
|
+
headers: api_headers,
|
342
|
+
params: api_params,
|
337
343
|
response_type: Models::Collection
|
338
344
|
)
|
339
345
|
end
|
@@ -347,7 +353,7 @@ module Appwrite
|
|
347
353
|
#
|
348
354
|
# @return []
|
349
355
|
def delete_collection(database_id:, collection_id:)
|
350
|
-
|
356
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}'
|
351
357
|
.gsub('{databaseId}', database_id)
|
352
358
|
.gsub('{collectionId}', collection_id)
|
353
359
|
|
@@ -359,18 +365,18 @@ module Appwrite
|
|
359
365
|
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
360
366
|
end
|
361
367
|
|
362
|
-
|
368
|
+
api_params = {
|
363
369
|
}
|
364
370
|
|
365
|
-
|
371
|
+
api_headers = {
|
366
372
|
"content-type": 'application/json',
|
367
373
|
}
|
368
374
|
|
369
375
|
@client.call(
|
370
376
|
method: 'DELETE',
|
371
|
-
path:
|
372
|
-
headers:
|
373
|
-
params:
|
377
|
+
path: api_path,
|
378
|
+
headers: api_headers,
|
379
|
+
params: api_params,
|
374
380
|
)
|
375
381
|
end
|
376
382
|
|
@@ -379,10 +385,11 @@ module Appwrite
|
|
379
385
|
#
|
380
386
|
# @param [String] database_id Database ID.
|
381
387
|
# @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
388
|
+
# @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error
|
382
389
|
#
|
383
390
|
# @return [AttributeList]
|
384
|
-
def list_attributes(database_id:, collection_id:)
|
385
|
-
|
391
|
+
def list_attributes(database_id:, collection_id:, queries: nil)
|
392
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes'
|
386
393
|
.gsub('{databaseId}', database_id)
|
387
394
|
.gsub('{collectionId}', collection_id)
|
388
395
|
|
@@ -394,18 +401,19 @@ module Appwrite
|
|
394
401
|
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
395
402
|
end
|
396
403
|
|
397
|
-
|
404
|
+
api_params = {
|
405
|
+
queries: queries,
|
398
406
|
}
|
399
407
|
|
400
|
-
|
408
|
+
api_headers = {
|
401
409
|
"content-type": 'application/json',
|
402
410
|
}
|
403
411
|
|
404
412
|
@client.call(
|
405
413
|
method: 'GET',
|
406
|
-
path:
|
407
|
-
headers:
|
408
|
-
params:
|
414
|
+
path: api_path,
|
415
|
+
headers: api_headers,
|
416
|
+
params: api_params,
|
409
417
|
response_type: Models::AttributeList
|
410
418
|
)
|
411
419
|
end
|
@@ -423,7 +431,7 @@ module Appwrite
|
|
423
431
|
#
|
424
432
|
# @return [AttributeBoolean]
|
425
433
|
def create_boolean_attribute(database_id:, collection_id:, key:, required:, default: nil, array: nil)
|
426
|
-
|
434
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean'
|
427
435
|
.gsub('{databaseId}', database_id)
|
428
436
|
.gsub('{collectionId}', collection_id)
|
429
437
|
|
@@ -443,22 +451,22 @@ module Appwrite
|
|
443
451
|
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
444
452
|
end
|
445
453
|
|
446
|
-
|
454
|
+
api_params = {
|
447
455
|
key: key,
|
448
456
|
required: required,
|
449
457
|
default: default,
|
450
458
|
array: array,
|
451
459
|
}
|
452
460
|
|
453
|
-
|
461
|
+
api_headers = {
|
454
462
|
"content-type": 'application/json',
|
455
463
|
}
|
456
464
|
|
457
465
|
@client.call(
|
458
466
|
method: 'POST',
|
459
|
-
path:
|
460
|
-
headers:
|
461
|
-
params:
|
467
|
+
path: api_path,
|
468
|
+
headers: api_headers,
|
469
|
+
params: api_params,
|
462
470
|
response_type: Models::AttributeBoolean
|
463
471
|
)
|
464
472
|
end
|
@@ -474,7 +482,7 @@ module Appwrite
|
|
474
482
|
#
|
475
483
|
# @return [AttributeBoolean]
|
476
484
|
def update_boolean_attribute(database_id:, collection_id:, key:, required:, default:)
|
477
|
-
|
485
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}'
|
478
486
|
.gsub('{databaseId}', database_id)
|
479
487
|
.gsub('{collectionId}', collection_id)
|
480
488
|
.gsub('{key}', key)
|
@@ -499,20 +507,20 @@ module Appwrite
|
|
499
507
|
raise Appwrite::Exception.new('Missing required parameter: "default"')
|
500
508
|
end
|
501
509
|
|
502
|
-
|
510
|
+
api_params = {
|
503
511
|
required: required,
|
504
512
|
default: default,
|
505
513
|
}
|
506
514
|
|
507
|
-
|
515
|
+
api_headers = {
|
508
516
|
"content-type": 'application/json',
|
509
517
|
}
|
510
518
|
|
511
519
|
@client.call(
|
512
520
|
method: 'PATCH',
|
513
|
-
path:
|
514
|
-
headers:
|
515
|
-
params:
|
521
|
+
path: api_path,
|
522
|
+
headers: api_headers,
|
523
|
+
params: api_params,
|
516
524
|
response_type: Models::AttributeBoolean
|
517
525
|
)
|
518
526
|
end
|
@@ -529,7 +537,7 @@ module Appwrite
|
|
529
537
|
#
|
530
538
|
# @return [AttributeDatetime]
|
531
539
|
def create_datetime_attribute(database_id:, collection_id:, key:, required:, default: nil, array: nil)
|
532
|
-
|
540
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime'
|
533
541
|
.gsub('{databaseId}', database_id)
|
534
542
|
.gsub('{collectionId}', collection_id)
|
535
543
|
|
@@ -549,22 +557,22 @@ module Appwrite
|
|
549
557
|
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
550
558
|
end
|
551
559
|
|
552
|
-
|
560
|
+
api_params = {
|
553
561
|
key: key,
|
554
562
|
required: required,
|
555
563
|
default: default,
|
556
564
|
array: array,
|
557
565
|
}
|
558
566
|
|
559
|
-
|
567
|
+
api_headers = {
|
560
568
|
"content-type": 'application/json',
|
561
569
|
}
|
562
570
|
|
563
571
|
@client.call(
|
564
572
|
method: 'POST',
|
565
|
-
path:
|
566
|
-
headers:
|
567
|
-
params:
|
573
|
+
path: api_path,
|
574
|
+
headers: api_headers,
|
575
|
+
params: api_params,
|
568
576
|
response_type: Models::AttributeDatetime
|
569
577
|
)
|
570
578
|
end
|
@@ -580,7 +588,7 @@ module Appwrite
|
|
580
588
|
#
|
581
589
|
# @return [AttributeDatetime]
|
582
590
|
def update_datetime_attribute(database_id:, collection_id:, key:, required:, default:)
|
583
|
-
|
591
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}'
|
584
592
|
.gsub('{databaseId}', database_id)
|
585
593
|
.gsub('{collectionId}', collection_id)
|
586
594
|
.gsub('{key}', key)
|
@@ -605,20 +613,20 @@ module Appwrite
|
|
605
613
|
raise Appwrite::Exception.new('Missing required parameter: "default"')
|
606
614
|
end
|
607
615
|
|
608
|
-
|
616
|
+
api_params = {
|
609
617
|
required: required,
|
610
618
|
default: default,
|
611
619
|
}
|
612
620
|
|
613
|
-
|
621
|
+
api_headers = {
|
614
622
|
"content-type": 'application/json',
|
615
623
|
}
|
616
624
|
|
617
625
|
@client.call(
|
618
626
|
method: 'PATCH',
|
619
|
-
path:
|
620
|
-
headers:
|
621
|
-
params:
|
627
|
+
path: api_path,
|
628
|
+
headers: api_headers,
|
629
|
+
params: api_params,
|
622
630
|
response_type: Models::AttributeDatetime
|
623
631
|
)
|
624
632
|
end
|
@@ -636,7 +644,7 @@ module Appwrite
|
|
636
644
|
#
|
637
645
|
# @return [AttributeEmail]
|
638
646
|
def create_email_attribute(database_id:, collection_id:, key:, required:, default: nil, array: nil)
|
639
|
-
|
647
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/email'
|
640
648
|
.gsub('{databaseId}', database_id)
|
641
649
|
.gsub('{collectionId}', collection_id)
|
642
650
|
|
@@ -656,22 +664,22 @@ module Appwrite
|
|
656
664
|
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
657
665
|
end
|
658
666
|
|
659
|
-
|
667
|
+
api_params = {
|
660
668
|
key: key,
|
661
669
|
required: required,
|
662
670
|
default: default,
|
663
671
|
array: array,
|
664
672
|
}
|
665
673
|
|
666
|
-
|
674
|
+
api_headers = {
|
667
675
|
"content-type": 'application/json',
|
668
676
|
}
|
669
677
|
|
670
678
|
@client.call(
|
671
679
|
method: 'POST',
|
672
|
-
path:
|
673
|
-
headers:
|
674
|
-
params:
|
680
|
+
path: api_path,
|
681
|
+
headers: api_headers,
|
682
|
+
params: api_params,
|
675
683
|
response_type: Models::AttributeEmail
|
676
684
|
)
|
677
685
|
end
|
@@ -689,7 +697,7 @@ module Appwrite
|
|
689
697
|
#
|
690
698
|
# @return [AttributeEmail]
|
691
699
|
def update_email_attribute(database_id:, collection_id:, key:, required:, default:)
|
692
|
-
|
700
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}'
|
693
701
|
.gsub('{databaseId}', database_id)
|
694
702
|
.gsub('{collectionId}', collection_id)
|
695
703
|
.gsub('{key}', key)
|
@@ -714,20 +722,20 @@ module Appwrite
|
|
714
722
|
raise Appwrite::Exception.new('Missing required parameter: "default"')
|
715
723
|
end
|
716
724
|
|
717
|
-
|
725
|
+
api_params = {
|
718
726
|
required: required,
|
719
727
|
default: default,
|
720
728
|
}
|
721
729
|
|
722
|
-
|
730
|
+
api_headers = {
|
723
731
|
"content-type": 'application/json',
|
724
732
|
}
|
725
733
|
|
726
734
|
@client.call(
|
727
735
|
method: 'PATCH',
|
728
|
-
path:
|
729
|
-
headers:
|
730
|
-
params:
|
736
|
+
path: api_path,
|
737
|
+
headers: api_headers,
|
738
|
+
params: api_params,
|
731
739
|
response_type: Models::AttributeEmail
|
732
740
|
)
|
733
741
|
end
|
@@ -745,7 +753,7 @@ module Appwrite
|
|
745
753
|
#
|
746
754
|
# @return [AttributeEnum]
|
747
755
|
def create_enum_attribute(database_id:, collection_id:, key:, elements:, required:, default: nil, array: nil)
|
748
|
-
|
756
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum'
|
749
757
|
.gsub('{databaseId}', database_id)
|
750
758
|
.gsub('{collectionId}', collection_id)
|
751
759
|
|
@@ -769,7 +777,7 @@ module Appwrite
|
|
769
777
|
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
770
778
|
end
|
771
779
|
|
772
|
-
|
780
|
+
api_params = {
|
773
781
|
key: key,
|
774
782
|
elements: elements,
|
775
783
|
required: required,
|
@@ -777,15 +785,15 @@ module Appwrite
|
|
777
785
|
array: array,
|
778
786
|
}
|
779
787
|
|
780
|
-
|
788
|
+
api_headers = {
|
781
789
|
"content-type": 'application/json',
|
782
790
|
}
|
783
791
|
|
784
792
|
@client.call(
|
785
793
|
method: 'POST',
|
786
|
-
path:
|
787
|
-
headers:
|
788
|
-
params:
|
794
|
+
path: api_path,
|
795
|
+
headers: api_headers,
|
796
|
+
params: api_params,
|
789
797
|
response_type: Models::AttributeEnum
|
790
798
|
)
|
791
799
|
end
|
@@ -804,7 +812,7 @@ module Appwrite
|
|
804
812
|
#
|
805
813
|
# @return [AttributeEnum]
|
806
814
|
def update_enum_attribute(database_id:, collection_id:, key:, elements:, required:, default:)
|
807
|
-
|
815
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'
|
808
816
|
.gsub('{databaseId}', database_id)
|
809
817
|
.gsub('{collectionId}', collection_id)
|
810
818
|
.gsub('{key}', key)
|
@@ -833,21 +841,21 @@ module Appwrite
|
|
833
841
|
raise Appwrite::Exception.new('Missing required parameter: "default"')
|
834
842
|
end
|
835
843
|
|
836
|
-
|
844
|
+
api_params = {
|
837
845
|
elements: elements,
|
838
846
|
required: required,
|
839
847
|
default: default,
|
840
848
|
}
|
841
849
|
|
842
|
-
|
850
|
+
api_headers = {
|
843
851
|
"content-type": 'application/json',
|
844
852
|
}
|
845
853
|
|
846
854
|
@client.call(
|
847
855
|
method: 'PATCH',
|
848
|
-
path:
|
849
|
-
headers:
|
850
|
-
params:
|
856
|
+
path: api_path,
|
857
|
+
headers: api_headers,
|
858
|
+
params: api_params,
|
851
859
|
response_type: Models::AttributeEnum
|
852
860
|
)
|
853
861
|
end
|
@@ -868,7 +876,7 @@ module Appwrite
|
|
868
876
|
#
|
869
877
|
# @return [AttributeFloat]
|
870
878
|
def create_float_attribute(database_id:, collection_id:, key:, required:, min: nil, max: nil, default: nil, array: nil)
|
871
|
-
|
879
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/float'
|
872
880
|
.gsub('{databaseId}', database_id)
|
873
881
|
.gsub('{collectionId}', collection_id)
|
874
882
|
|
@@ -888,7 +896,7 @@ module Appwrite
|
|
888
896
|
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
889
897
|
end
|
890
898
|
|
891
|
-
|
899
|
+
api_params = {
|
892
900
|
key: key,
|
893
901
|
required: required,
|
894
902
|
min: min,
|
@@ -897,15 +905,15 @@ module Appwrite
|
|
897
905
|
array: array,
|
898
906
|
}
|
899
907
|
|
900
|
-
|
908
|
+
api_headers = {
|
901
909
|
"content-type": 'application/json',
|
902
910
|
}
|
903
911
|
|
904
912
|
@client.call(
|
905
913
|
method: 'POST',
|
906
|
-
path:
|
907
|
-
headers:
|
908
|
-
params:
|
914
|
+
path: api_path,
|
915
|
+
headers: api_headers,
|
916
|
+
params: api_params,
|
909
917
|
response_type: Models::AttributeFloat
|
910
918
|
)
|
911
919
|
end
|
@@ -925,7 +933,7 @@ module Appwrite
|
|
925
933
|
#
|
926
934
|
# @return [AttributeFloat]
|
927
935
|
def update_float_attribute(database_id:, collection_id:, key:, required:, min:, max:, default:)
|
928
|
-
|
936
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}'
|
929
937
|
.gsub('{databaseId}', database_id)
|
930
938
|
.gsub('{collectionId}', collection_id)
|
931
939
|
.gsub('{key}', key)
|
@@ -958,22 +966,22 @@ module Appwrite
|
|
958
966
|
raise Appwrite::Exception.new('Missing required parameter: "default"')
|
959
967
|
end
|
960
968
|
|
961
|
-
|
969
|
+
api_params = {
|
962
970
|
required: required,
|
963
971
|
min: min,
|
964
972
|
max: max,
|
965
973
|
default: default,
|
966
974
|
}
|
967
975
|
|
968
|
-
|
976
|
+
api_headers = {
|
969
977
|
"content-type": 'application/json',
|
970
978
|
}
|
971
979
|
|
972
980
|
@client.call(
|
973
981
|
method: 'PATCH',
|
974
|
-
path:
|
975
|
-
headers:
|
976
|
-
params:
|
982
|
+
path: api_path,
|
983
|
+
headers: api_headers,
|
984
|
+
params: api_params,
|
977
985
|
response_type: Models::AttributeFloat
|
978
986
|
)
|
979
987
|
end
|
@@ -994,7 +1002,7 @@ module Appwrite
|
|
994
1002
|
#
|
995
1003
|
# @return [AttributeInteger]
|
996
1004
|
def create_integer_attribute(database_id:, collection_id:, key:, required:, min: nil, max: nil, default: nil, array: nil)
|
997
|
-
|
1005
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer'
|
998
1006
|
.gsub('{databaseId}', database_id)
|
999
1007
|
.gsub('{collectionId}', collection_id)
|
1000
1008
|
|
@@ -1014,7 +1022,7 @@ module Appwrite
|
|
1014
1022
|
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
1015
1023
|
end
|
1016
1024
|
|
1017
|
-
|
1025
|
+
api_params = {
|
1018
1026
|
key: key,
|
1019
1027
|
required: required,
|
1020
1028
|
min: min,
|
@@ -1023,15 +1031,15 @@ module Appwrite
|
|
1023
1031
|
array: array,
|
1024
1032
|
}
|
1025
1033
|
|
1026
|
-
|
1034
|
+
api_headers = {
|
1027
1035
|
"content-type": 'application/json',
|
1028
1036
|
}
|
1029
1037
|
|
1030
1038
|
@client.call(
|
1031
1039
|
method: 'POST',
|
1032
|
-
path:
|
1033
|
-
headers:
|
1034
|
-
params:
|
1040
|
+
path: api_path,
|
1041
|
+
headers: api_headers,
|
1042
|
+
params: api_params,
|
1035
1043
|
response_type: Models::AttributeInteger
|
1036
1044
|
)
|
1037
1045
|
end
|
@@ -1051,7 +1059,7 @@ module Appwrite
|
|
1051
1059
|
#
|
1052
1060
|
# @return [AttributeInteger]
|
1053
1061
|
def update_integer_attribute(database_id:, collection_id:, key:, required:, min:, max:, default:)
|
1054
|
-
|
1062
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}'
|
1055
1063
|
.gsub('{databaseId}', database_id)
|
1056
1064
|
.gsub('{collectionId}', collection_id)
|
1057
1065
|
.gsub('{key}', key)
|
@@ -1084,22 +1092,22 @@ module Appwrite
|
|
1084
1092
|
raise Appwrite::Exception.new('Missing required parameter: "default"')
|
1085
1093
|
end
|
1086
1094
|
|
1087
|
-
|
1095
|
+
api_params = {
|
1088
1096
|
required: required,
|
1089
1097
|
min: min,
|
1090
1098
|
max: max,
|
1091
1099
|
default: default,
|
1092
1100
|
}
|
1093
1101
|
|
1094
|
-
|
1102
|
+
api_headers = {
|
1095
1103
|
"content-type": 'application/json',
|
1096
1104
|
}
|
1097
1105
|
|
1098
1106
|
@client.call(
|
1099
1107
|
method: 'PATCH',
|
1100
|
-
path:
|
1101
|
-
headers:
|
1102
|
-
params:
|
1108
|
+
path: api_path,
|
1109
|
+
headers: api_headers,
|
1110
|
+
params: api_params,
|
1103
1111
|
response_type: Models::AttributeInteger
|
1104
1112
|
)
|
1105
1113
|
end
|
@@ -1117,7 +1125,7 @@ module Appwrite
|
|
1117
1125
|
#
|
1118
1126
|
# @return [AttributeIp]
|
1119
1127
|
def create_ip_attribute(database_id:, collection_id:, key:, required:, default: nil, array: nil)
|
1120
|
-
|
1128
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip'
|
1121
1129
|
.gsub('{databaseId}', database_id)
|
1122
1130
|
.gsub('{collectionId}', collection_id)
|
1123
1131
|
|
@@ -1137,22 +1145,22 @@ module Appwrite
|
|
1137
1145
|
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
1138
1146
|
end
|
1139
1147
|
|
1140
|
-
|
1148
|
+
api_params = {
|
1141
1149
|
key: key,
|
1142
1150
|
required: required,
|
1143
1151
|
default: default,
|
1144
1152
|
array: array,
|
1145
1153
|
}
|
1146
1154
|
|
1147
|
-
|
1155
|
+
api_headers = {
|
1148
1156
|
"content-type": 'application/json',
|
1149
1157
|
}
|
1150
1158
|
|
1151
1159
|
@client.call(
|
1152
1160
|
method: 'POST',
|
1153
|
-
path:
|
1154
|
-
headers:
|
1155
|
-
params:
|
1161
|
+
path: api_path,
|
1162
|
+
headers: api_headers,
|
1163
|
+
params: api_params,
|
1156
1164
|
response_type: Models::AttributeIp
|
1157
1165
|
)
|
1158
1166
|
end
|
@@ -1170,7 +1178,7 @@ module Appwrite
|
|
1170
1178
|
#
|
1171
1179
|
# @return [AttributeIp]
|
1172
1180
|
def update_ip_attribute(database_id:, collection_id:, key:, required:, default:)
|
1173
|
-
|
1181
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}'
|
1174
1182
|
.gsub('{databaseId}', database_id)
|
1175
1183
|
.gsub('{collectionId}', collection_id)
|
1176
1184
|
.gsub('{key}', key)
|
@@ -1195,27 +1203,27 @@ module Appwrite
|
|
1195
1203
|
raise Appwrite::Exception.new('Missing required parameter: "default"')
|
1196
1204
|
end
|
1197
1205
|
|
1198
|
-
|
1206
|
+
api_params = {
|
1199
1207
|
required: required,
|
1200
1208
|
default: default,
|
1201
1209
|
}
|
1202
1210
|
|
1203
|
-
|
1211
|
+
api_headers = {
|
1204
1212
|
"content-type": 'application/json',
|
1205
1213
|
}
|
1206
1214
|
|
1207
1215
|
@client.call(
|
1208
1216
|
method: 'PATCH',
|
1209
|
-
path:
|
1210
|
-
headers:
|
1211
|
-
params:
|
1217
|
+
path: api_path,
|
1218
|
+
headers: api_headers,
|
1219
|
+
params: api_params,
|
1212
1220
|
response_type: Models::AttributeIp
|
1213
1221
|
)
|
1214
1222
|
end
|
1215
1223
|
|
1216
1224
|
|
1217
1225
|
# Create relationship attribute. [Learn more about relationship
|
1218
|
-
# attributes](docs/databases-relationships#relationship-attributes).
|
1226
|
+
# attributes](/docs/databases-relationships#relationship-attributes).
|
1219
1227
|
#
|
1220
1228
|
#
|
1221
1229
|
# @param [String] database_id Database ID.
|
@@ -1229,7 +1237,7 @@ module Appwrite
|
|
1229
1237
|
#
|
1230
1238
|
# @return [AttributeRelationship]
|
1231
1239
|
def create_relationship_attribute(database_id:, collection_id:, related_collection_id:, type:, two_way: nil, key: nil, two_way_key: nil, on_delete: nil)
|
1232
|
-
|
1240
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship'
|
1233
1241
|
.gsub('{databaseId}', database_id)
|
1234
1242
|
.gsub('{collectionId}', collection_id)
|
1235
1243
|
|
@@ -1249,7 +1257,7 @@ module Appwrite
|
|
1249
1257
|
raise Appwrite::Exception.new('Missing required parameter: "type"')
|
1250
1258
|
end
|
1251
1259
|
|
1252
|
-
|
1260
|
+
api_params = {
|
1253
1261
|
relatedCollectionId: related_collection_id,
|
1254
1262
|
type: type,
|
1255
1263
|
twoWay: two_way,
|
@@ -1258,15 +1266,15 @@ module Appwrite
|
|
1258
1266
|
onDelete: on_delete,
|
1259
1267
|
}
|
1260
1268
|
|
1261
|
-
|
1269
|
+
api_headers = {
|
1262
1270
|
"content-type": 'application/json',
|
1263
1271
|
}
|
1264
1272
|
|
1265
1273
|
@client.call(
|
1266
1274
|
method: 'POST',
|
1267
|
-
path:
|
1268
|
-
headers:
|
1269
|
-
params:
|
1275
|
+
path: api_path,
|
1276
|
+
headers: api_headers,
|
1277
|
+
params: api_params,
|
1270
1278
|
response_type: Models::AttributeRelationship
|
1271
1279
|
)
|
1272
1280
|
end
|
@@ -1282,10 +1290,11 @@ module Appwrite
|
|
1282
1290
|
# @param [] required Is attribute required?
|
1283
1291
|
# @param [String] default Default value for attribute when not provided. Cannot be set when attribute is required.
|
1284
1292
|
# @param [] array Is attribute an array?
|
1293
|
+
# @param [] encrypt Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.
|
1285
1294
|
#
|
1286
1295
|
# @return [AttributeString]
|
1287
|
-
def create_string_attribute(database_id:, collection_id:, key:, size:, required:, default: nil, array: nil)
|
1288
|
-
|
1296
|
+
def create_string_attribute(database_id:, collection_id:, key:, size:, required:, default: nil, array: nil, encrypt: nil)
|
1297
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/string'
|
1289
1298
|
.gsub('{databaseId}', database_id)
|
1290
1299
|
.gsub('{collectionId}', collection_id)
|
1291
1300
|
|
@@ -1309,23 +1318,24 @@ module Appwrite
|
|
1309
1318
|
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
1310
1319
|
end
|
1311
1320
|
|
1312
|
-
|
1321
|
+
api_params = {
|
1313
1322
|
key: key,
|
1314
1323
|
size: size,
|
1315
1324
|
required: required,
|
1316
1325
|
default: default,
|
1317
1326
|
array: array,
|
1327
|
+
encrypt: encrypt,
|
1318
1328
|
}
|
1319
1329
|
|
1320
|
-
|
1330
|
+
api_headers = {
|
1321
1331
|
"content-type": 'application/json',
|
1322
1332
|
}
|
1323
1333
|
|
1324
1334
|
@client.call(
|
1325
1335
|
method: 'POST',
|
1326
|
-
path:
|
1327
|
-
headers:
|
1328
|
-
params:
|
1336
|
+
path: api_path,
|
1337
|
+
headers: api_headers,
|
1338
|
+
params: api_params,
|
1329
1339
|
response_type: Models::AttributeString
|
1330
1340
|
)
|
1331
1341
|
end
|
@@ -1343,7 +1353,7 @@ module Appwrite
|
|
1343
1353
|
#
|
1344
1354
|
# @return [AttributeString]
|
1345
1355
|
def update_string_attribute(database_id:, collection_id:, key:, required:, default:)
|
1346
|
-
|
1356
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'
|
1347
1357
|
.gsub('{databaseId}', database_id)
|
1348
1358
|
.gsub('{collectionId}', collection_id)
|
1349
1359
|
.gsub('{key}', key)
|
@@ -1368,20 +1378,20 @@ module Appwrite
|
|
1368
1378
|
raise Appwrite::Exception.new('Missing required parameter: "default"')
|
1369
1379
|
end
|
1370
1380
|
|
1371
|
-
|
1381
|
+
api_params = {
|
1372
1382
|
required: required,
|
1373
1383
|
default: default,
|
1374
1384
|
}
|
1375
1385
|
|
1376
|
-
|
1386
|
+
api_headers = {
|
1377
1387
|
"content-type": 'application/json',
|
1378
1388
|
}
|
1379
1389
|
|
1380
1390
|
@client.call(
|
1381
1391
|
method: 'PATCH',
|
1382
|
-
path:
|
1383
|
-
headers:
|
1384
|
-
params:
|
1392
|
+
path: api_path,
|
1393
|
+
headers: api_headers,
|
1394
|
+
params: api_params,
|
1385
1395
|
response_type: Models::AttributeString
|
1386
1396
|
)
|
1387
1397
|
end
|
@@ -1399,7 +1409,7 @@ module Appwrite
|
|
1399
1409
|
#
|
1400
1410
|
# @return [AttributeUrl]
|
1401
1411
|
def create_url_attribute(database_id:, collection_id:, key:, required:, default: nil, array: nil)
|
1402
|
-
|
1412
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/url'
|
1403
1413
|
.gsub('{databaseId}', database_id)
|
1404
1414
|
.gsub('{collectionId}', collection_id)
|
1405
1415
|
|
@@ -1419,22 +1429,22 @@ module Appwrite
|
|
1419
1429
|
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
1420
1430
|
end
|
1421
1431
|
|
1422
|
-
|
1432
|
+
api_params = {
|
1423
1433
|
key: key,
|
1424
1434
|
required: required,
|
1425
1435
|
default: default,
|
1426
1436
|
array: array,
|
1427
1437
|
}
|
1428
1438
|
|
1429
|
-
|
1439
|
+
api_headers = {
|
1430
1440
|
"content-type": 'application/json',
|
1431
1441
|
}
|
1432
1442
|
|
1433
1443
|
@client.call(
|
1434
1444
|
method: 'POST',
|
1435
|
-
path:
|
1436
|
-
headers:
|
1437
|
-
params:
|
1445
|
+
path: api_path,
|
1446
|
+
headers: api_headers,
|
1447
|
+
params: api_params,
|
1438
1448
|
response_type: Models::AttributeUrl
|
1439
1449
|
)
|
1440
1450
|
end
|
@@ -1452,7 +1462,7 @@ module Appwrite
|
|
1452
1462
|
#
|
1453
1463
|
# @return [AttributeUrl]
|
1454
1464
|
def update_url_attribute(database_id:, collection_id:, key:, required:, default:)
|
1455
|
-
|
1465
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}'
|
1456
1466
|
.gsub('{databaseId}', database_id)
|
1457
1467
|
.gsub('{collectionId}', collection_id)
|
1458
1468
|
.gsub('{key}', key)
|
@@ -1477,20 +1487,20 @@ module Appwrite
|
|
1477
1487
|
raise Appwrite::Exception.new('Missing required parameter: "default"')
|
1478
1488
|
end
|
1479
1489
|
|
1480
|
-
|
1490
|
+
api_params = {
|
1481
1491
|
required: required,
|
1482
1492
|
default: default,
|
1483
1493
|
}
|
1484
1494
|
|
1485
|
-
|
1495
|
+
api_headers = {
|
1486
1496
|
"content-type": 'application/json',
|
1487
1497
|
}
|
1488
1498
|
|
1489
1499
|
@client.call(
|
1490
1500
|
method: 'PATCH',
|
1491
|
-
path:
|
1492
|
-
headers:
|
1493
|
-
params:
|
1501
|
+
path: api_path,
|
1502
|
+
headers: api_headers,
|
1503
|
+
params: api_params,
|
1494
1504
|
response_type: Models::AttributeUrl
|
1495
1505
|
)
|
1496
1506
|
end
|
@@ -1504,7 +1514,7 @@ module Appwrite
|
|
1504
1514
|
#
|
1505
1515
|
# @return []
|
1506
1516
|
def get_attribute(database_id:, collection_id:, key:)
|
1507
|
-
|
1517
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'
|
1508
1518
|
.gsub('{databaseId}', database_id)
|
1509
1519
|
.gsub('{collectionId}', collection_id)
|
1510
1520
|
.gsub('{key}', key)
|
@@ -1521,18 +1531,18 @@ module Appwrite
|
|
1521
1531
|
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
1522
1532
|
end
|
1523
1533
|
|
1524
|
-
|
1534
|
+
api_params = {
|
1525
1535
|
}
|
1526
1536
|
|
1527
|
-
|
1537
|
+
api_headers = {
|
1528
1538
|
"content-type": 'application/json',
|
1529
1539
|
}
|
1530
1540
|
|
1531
1541
|
@client.call(
|
1532
1542
|
method: 'GET',
|
1533
|
-
path:
|
1534
|
-
headers:
|
1535
|
-
params:
|
1543
|
+
path: api_path,
|
1544
|
+
headers: api_headers,
|
1545
|
+
params: api_params,
|
1536
1546
|
)
|
1537
1547
|
end
|
1538
1548
|
|
@@ -1545,7 +1555,7 @@ module Appwrite
|
|
1545
1555
|
#
|
1546
1556
|
# @return []
|
1547
1557
|
def delete_attribute(database_id:, collection_id:, key:)
|
1548
|
-
|
1558
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'
|
1549
1559
|
.gsub('{databaseId}', database_id)
|
1550
1560
|
.gsub('{collectionId}', collection_id)
|
1551
1561
|
.gsub('{key}', key)
|
@@ -1562,24 +1572,24 @@ module Appwrite
|
|
1562
1572
|
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
1563
1573
|
end
|
1564
1574
|
|
1565
|
-
|
1575
|
+
api_params = {
|
1566
1576
|
}
|
1567
1577
|
|
1568
|
-
|
1578
|
+
api_headers = {
|
1569
1579
|
"content-type": 'application/json',
|
1570
1580
|
}
|
1571
1581
|
|
1572
1582
|
@client.call(
|
1573
1583
|
method: 'DELETE',
|
1574
|
-
path:
|
1575
|
-
headers:
|
1576
|
-
params:
|
1584
|
+
path: api_path,
|
1585
|
+
headers: api_headers,
|
1586
|
+
params: api_params,
|
1577
1587
|
)
|
1578
1588
|
end
|
1579
1589
|
|
1580
1590
|
|
1581
1591
|
# Update relationship attribute. [Learn more about relationship
|
1582
|
-
# attributes](docs/databases-relationships#relationship-attributes).
|
1592
|
+
# attributes](/docs/databases-relationships#relationship-attributes).
|
1583
1593
|
#
|
1584
1594
|
#
|
1585
1595
|
# @param [String] database_id Database ID.
|
@@ -1589,7 +1599,7 @@ module Appwrite
|
|
1589
1599
|
#
|
1590
1600
|
# @return [AttributeRelationship]
|
1591
1601
|
def update_relationship_attribute(database_id:, collection_id:, key:, on_delete: nil)
|
1592
|
-
|
1602
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'
|
1593
1603
|
.gsub('{databaseId}', database_id)
|
1594
1604
|
.gsub('{collectionId}', collection_id)
|
1595
1605
|
.gsub('{key}', key)
|
@@ -1606,19 +1616,19 @@ module Appwrite
|
|
1606
1616
|
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
1607
1617
|
end
|
1608
1618
|
|
1609
|
-
|
1619
|
+
api_params = {
|
1610
1620
|
onDelete: on_delete,
|
1611
1621
|
}
|
1612
1622
|
|
1613
|
-
|
1623
|
+
api_headers = {
|
1614
1624
|
"content-type": 'application/json',
|
1615
1625
|
}
|
1616
1626
|
|
1617
1627
|
@client.call(
|
1618
1628
|
method: 'PATCH',
|
1619
|
-
path:
|
1620
|
-
headers:
|
1621
|
-
params:
|
1629
|
+
path: api_path,
|
1630
|
+
headers: api_headers,
|
1631
|
+
params: api_params,
|
1622
1632
|
response_type: Models::AttributeRelationship
|
1623
1633
|
)
|
1624
1634
|
end
|
@@ -1633,7 +1643,7 @@ module Appwrite
|
|
1633
1643
|
#
|
1634
1644
|
# @return [DocumentList]
|
1635
1645
|
def list_documents(database_id:, collection_id:, queries: nil)
|
1636
|
-
|
1646
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/documents'
|
1637
1647
|
.gsub('{databaseId}', database_id)
|
1638
1648
|
.gsub('{collectionId}', collection_id)
|
1639
1649
|
|
@@ -1645,19 +1655,19 @@ module Appwrite
|
|
1645
1655
|
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
1646
1656
|
end
|
1647
1657
|
|
1648
|
-
|
1658
|
+
api_params = {
|
1649
1659
|
queries: queries,
|
1650
1660
|
}
|
1651
1661
|
|
1652
|
-
|
1662
|
+
api_headers = {
|
1653
1663
|
"content-type": 'application/json',
|
1654
1664
|
}
|
1655
1665
|
|
1656
1666
|
@client.call(
|
1657
1667
|
method: 'GET',
|
1658
|
-
path:
|
1659
|
-
headers:
|
1660
|
-
params:
|
1668
|
+
path: api_path,
|
1669
|
+
headers: api_headers,
|
1670
|
+
params: api_params,
|
1661
1671
|
response_type: Models::DocumentList
|
1662
1672
|
)
|
1663
1673
|
end
|
@@ -1676,7 +1686,7 @@ module Appwrite
|
|
1676
1686
|
#
|
1677
1687
|
# @return [Document]
|
1678
1688
|
def create_document(database_id:, collection_id:, document_id:, data:, permissions: nil)
|
1679
|
-
|
1689
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/documents'
|
1680
1690
|
.gsub('{databaseId}', database_id)
|
1681
1691
|
.gsub('{collectionId}', collection_id)
|
1682
1692
|
|
@@ -1696,21 +1706,21 @@ module Appwrite
|
|
1696
1706
|
raise Appwrite::Exception.new('Missing required parameter: "data"')
|
1697
1707
|
end
|
1698
1708
|
|
1699
|
-
|
1709
|
+
api_params = {
|
1700
1710
|
documentId: document_id,
|
1701
1711
|
data: data,
|
1702
1712
|
permissions: permissions,
|
1703
1713
|
}
|
1704
1714
|
|
1705
|
-
|
1715
|
+
api_headers = {
|
1706
1716
|
"content-type": 'application/json',
|
1707
1717
|
}
|
1708
1718
|
|
1709
1719
|
@client.call(
|
1710
1720
|
method: 'POST',
|
1711
|
-
path:
|
1712
|
-
headers:
|
1713
|
-
params:
|
1721
|
+
path: api_path,
|
1722
|
+
headers: api_headers,
|
1723
|
+
params: api_params,
|
1714
1724
|
response_type: Models::Document
|
1715
1725
|
)
|
1716
1726
|
end
|
@@ -1726,7 +1736,7 @@ module Appwrite
|
|
1726
1736
|
#
|
1727
1737
|
# @return [Document]
|
1728
1738
|
def get_document(database_id:, collection_id:, document_id:, queries: nil)
|
1729
|
-
|
1739
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'
|
1730
1740
|
.gsub('{databaseId}', database_id)
|
1731
1741
|
.gsub('{collectionId}', collection_id)
|
1732
1742
|
.gsub('{documentId}', document_id)
|
@@ -1743,19 +1753,19 @@ module Appwrite
|
|
1743
1753
|
raise Appwrite::Exception.new('Missing required parameter: "documentId"')
|
1744
1754
|
end
|
1745
1755
|
|
1746
|
-
|
1756
|
+
api_params = {
|
1747
1757
|
queries: queries,
|
1748
1758
|
}
|
1749
1759
|
|
1750
|
-
|
1760
|
+
api_headers = {
|
1751
1761
|
"content-type": 'application/json',
|
1752
1762
|
}
|
1753
1763
|
|
1754
1764
|
@client.call(
|
1755
1765
|
method: 'GET',
|
1756
|
-
path:
|
1757
|
-
headers:
|
1758
|
-
params:
|
1766
|
+
path: api_path,
|
1767
|
+
headers: api_headers,
|
1768
|
+
params: api_params,
|
1759
1769
|
response_type: Models::Document
|
1760
1770
|
)
|
1761
1771
|
end
|
@@ -1772,7 +1782,7 @@ module Appwrite
|
|
1772
1782
|
#
|
1773
1783
|
# @return [Document]
|
1774
1784
|
def update_document(database_id:, collection_id:, document_id:, data: nil, permissions: nil)
|
1775
|
-
|
1785
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'
|
1776
1786
|
.gsub('{databaseId}', database_id)
|
1777
1787
|
.gsub('{collectionId}', collection_id)
|
1778
1788
|
.gsub('{documentId}', document_id)
|
@@ -1789,20 +1799,20 @@ module Appwrite
|
|
1789
1799
|
raise Appwrite::Exception.new('Missing required parameter: "documentId"')
|
1790
1800
|
end
|
1791
1801
|
|
1792
|
-
|
1802
|
+
api_params = {
|
1793
1803
|
data: data,
|
1794
1804
|
permissions: permissions,
|
1795
1805
|
}
|
1796
1806
|
|
1797
|
-
|
1807
|
+
api_headers = {
|
1798
1808
|
"content-type": 'application/json',
|
1799
1809
|
}
|
1800
1810
|
|
1801
1811
|
@client.call(
|
1802
1812
|
method: 'PATCH',
|
1803
|
-
path:
|
1804
|
-
headers:
|
1805
|
-
params:
|
1813
|
+
path: api_path,
|
1814
|
+
headers: api_headers,
|
1815
|
+
params: api_params,
|
1806
1816
|
response_type: Models::Document
|
1807
1817
|
)
|
1808
1818
|
end
|
@@ -1816,7 +1826,7 @@ module Appwrite
|
|
1816
1826
|
#
|
1817
1827
|
# @return []
|
1818
1828
|
def delete_document(database_id:, collection_id:, document_id:)
|
1819
|
-
|
1829
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'
|
1820
1830
|
.gsub('{databaseId}', database_id)
|
1821
1831
|
.gsub('{collectionId}', collection_id)
|
1822
1832
|
.gsub('{documentId}', document_id)
|
@@ -1833,18 +1843,18 @@ module Appwrite
|
|
1833
1843
|
raise Appwrite::Exception.new('Missing required parameter: "documentId"')
|
1834
1844
|
end
|
1835
1845
|
|
1836
|
-
|
1846
|
+
api_params = {
|
1837
1847
|
}
|
1838
1848
|
|
1839
|
-
|
1849
|
+
api_headers = {
|
1840
1850
|
"content-type": 'application/json',
|
1841
1851
|
}
|
1842
1852
|
|
1843
1853
|
@client.call(
|
1844
1854
|
method: 'DELETE',
|
1845
|
-
path:
|
1846
|
-
headers:
|
1847
|
-
params:
|
1855
|
+
path: api_path,
|
1856
|
+
headers: api_headers,
|
1857
|
+
params: api_params,
|
1848
1858
|
)
|
1849
1859
|
end
|
1850
1860
|
|
@@ -1853,10 +1863,11 @@ module Appwrite
|
|
1853
1863
|
#
|
1854
1864
|
# @param [String] database_id Database ID.
|
1855
1865
|
# @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
1866
|
+
# @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error
|
1856
1867
|
#
|
1857
1868
|
# @return [IndexList]
|
1858
|
-
def list_indexes(database_id:, collection_id:)
|
1859
|
-
|
1869
|
+
def list_indexes(database_id:, collection_id:, queries: nil)
|
1870
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/indexes'
|
1860
1871
|
.gsub('{databaseId}', database_id)
|
1861
1872
|
.gsub('{collectionId}', collection_id)
|
1862
1873
|
|
@@ -1868,18 +1879,19 @@ module Appwrite
|
|
1868
1879
|
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
1869
1880
|
end
|
1870
1881
|
|
1871
|
-
|
1882
|
+
api_params = {
|
1883
|
+
queries: queries,
|
1872
1884
|
}
|
1873
1885
|
|
1874
|
-
|
1886
|
+
api_headers = {
|
1875
1887
|
"content-type": 'application/json',
|
1876
1888
|
}
|
1877
1889
|
|
1878
1890
|
@client.call(
|
1879
1891
|
method: 'GET',
|
1880
|
-
path:
|
1881
|
-
headers:
|
1882
|
-
params:
|
1892
|
+
path: api_path,
|
1893
|
+
headers: api_headers,
|
1894
|
+
params: api_params,
|
1883
1895
|
response_type: Models::IndexList
|
1884
1896
|
)
|
1885
1897
|
end
|
@@ -1896,7 +1908,7 @@ module Appwrite
|
|
1896
1908
|
#
|
1897
1909
|
# @return [Index]
|
1898
1910
|
def create_index(database_id:, collection_id:, key:, type:, attributes:, orders: nil)
|
1899
|
-
|
1911
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/indexes'
|
1900
1912
|
.gsub('{databaseId}', database_id)
|
1901
1913
|
.gsub('{collectionId}', collection_id)
|
1902
1914
|
|
@@ -1920,22 +1932,22 @@ module Appwrite
|
|
1920
1932
|
raise Appwrite::Exception.new('Missing required parameter: "attributes"')
|
1921
1933
|
end
|
1922
1934
|
|
1923
|
-
|
1935
|
+
api_params = {
|
1924
1936
|
key: key,
|
1925
1937
|
type: type,
|
1926
1938
|
attributes: attributes,
|
1927
1939
|
orders: orders,
|
1928
1940
|
}
|
1929
1941
|
|
1930
|
-
|
1942
|
+
api_headers = {
|
1931
1943
|
"content-type": 'application/json',
|
1932
1944
|
}
|
1933
1945
|
|
1934
1946
|
@client.call(
|
1935
1947
|
method: 'POST',
|
1936
|
-
path:
|
1937
|
-
headers:
|
1938
|
-
params:
|
1948
|
+
path: api_path,
|
1949
|
+
headers: api_headers,
|
1950
|
+
params: api_params,
|
1939
1951
|
response_type: Models::Index
|
1940
1952
|
)
|
1941
1953
|
end
|
@@ -1949,7 +1961,7 @@ module Appwrite
|
|
1949
1961
|
#
|
1950
1962
|
# @return [Index]
|
1951
1963
|
def get_index(database_id:, collection_id:, key:)
|
1952
|
-
|
1964
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'
|
1953
1965
|
.gsub('{databaseId}', database_id)
|
1954
1966
|
.gsub('{collectionId}', collection_id)
|
1955
1967
|
.gsub('{key}', key)
|
@@ -1966,18 +1978,18 @@ module Appwrite
|
|
1966
1978
|
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
1967
1979
|
end
|
1968
1980
|
|
1969
|
-
|
1981
|
+
api_params = {
|
1970
1982
|
}
|
1971
1983
|
|
1972
|
-
|
1984
|
+
api_headers = {
|
1973
1985
|
"content-type": 'application/json',
|
1974
1986
|
}
|
1975
1987
|
|
1976
1988
|
@client.call(
|
1977
1989
|
method: 'GET',
|
1978
|
-
path:
|
1979
|
-
headers:
|
1980
|
-
params:
|
1990
|
+
path: api_path,
|
1991
|
+
headers: api_headers,
|
1992
|
+
params: api_params,
|
1981
1993
|
response_type: Models::Index
|
1982
1994
|
)
|
1983
1995
|
end
|
@@ -1991,7 +2003,7 @@ module Appwrite
|
|
1991
2003
|
#
|
1992
2004
|
# @return []
|
1993
2005
|
def delete_index(database_id:, collection_id:, key:)
|
1994
|
-
|
2006
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'
|
1995
2007
|
.gsub('{databaseId}', database_id)
|
1996
2008
|
.gsub('{collectionId}', collection_id)
|
1997
2009
|
.gsub('{key}', key)
|
@@ -2008,18 +2020,18 @@ module Appwrite
|
|
2008
2020
|
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
2009
2021
|
end
|
2010
2022
|
|
2011
|
-
|
2023
|
+
api_params = {
|
2012
2024
|
}
|
2013
2025
|
|
2014
|
-
|
2026
|
+
api_headers = {
|
2015
2027
|
"content-type": 'application/json',
|
2016
2028
|
}
|
2017
2029
|
|
2018
2030
|
@client.call(
|
2019
2031
|
method: 'DELETE',
|
2020
|
-
path:
|
2021
|
-
headers:
|
2022
|
-
params:
|
2032
|
+
path: api_path,
|
2033
|
+
headers: api_headers,
|
2034
|
+
params: api_params,
|
2023
2035
|
)
|
2024
2036
|
end
|
2025
2037
|
|