appwrite 7.0.0.pre.RC2 → 7.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/appwrite/client.rb +2 -2
- data/lib/appwrite/models/document.rb +10 -5
- data/lib/appwrite/models/execution.rb +5 -5
- data/lib/appwrite/models/function.rb +5 -5
- data/lib/appwrite/role.rb +15 -7
- data/lib/appwrite/services/account.rb +87 -107
- data/lib/appwrite/services/avatars.rb +27 -34
- data/lib/appwrite/services/databases.rb +379 -410
- data/lib/appwrite/services/functions.rb +180 -200
- data/lib/appwrite/services/health.rb +0 -10
- data/lib/appwrite/services/locale.rb +6 -13
- data/lib/appwrite/services/storage.rb +105 -118
- data/lib/appwrite/services/teams.rb +94 -105
- data/lib/appwrite/services/users.rb +226 -251
- metadata +4 -4
@@ -15,7 +15,6 @@ module Appwrite
|
|
15
15
|
#
|
16
16
|
# @return [DatabaseList]
|
17
17
|
def list(queries: nil, search: nil)
|
18
|
-
|
19
18
|
path = '/databases'
|
20
19
|
|
21
20
|
params = {
|
@@ -45,9 +44,16 @@ module Appwrite
|
|
45
44
|
#
|
46
45
|
# @return [Database]
|
47
46
|
def create(database_id:, name:)
|
48
|
-
|
49
47
|
path = '/databases'
|
50
48
|
|
49
|
+
if database_id.nil?
|
50
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
51
|
+
end
|
52
|
+
|
53
|
+
if name.nil?
|
54
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
55
|
+
end
|
56
|
+
|
51
57
|
params = {
|
52
58
|
databaseId: database_id,
|
53
59
|
name: name,
|
@@ -56,14 +62,6 @@ module Appwrite
|
|
56
62
|
headers = {
|
57
63
|
"content-type": 'application/json',
|
58
64
|
}
|
59
|
-
if database_id.nil?
|
60
|
-
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
61
|
-
end
|
62
|
-
|
63
|
-
if name.nil?
|
64
|
-
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
65
|
-
end
|
66
|
-
|
67
65
|
|
68
66
|
@client.call(
|
69
67
|
method: 'POST',
|
@@ -82,8 +80,12 @@ module Appwrite
|
|
82
80
|
#
|
83
81
|
# @return [Database]
|
84
82
|
def get(database_id:)
|
85
|
-
|
86
83
|
path = '/databases/{databaseId}'
|
84
|
+
.gsub('{databaseId}', database_id)
|
85
|
+
|
86
|
+
if database_id.nil?
|
87
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
88
|
+
end
|
87
89
|
|
88
90
|
params = {
|
89
91
|
}
|
@@ -91,11 +93,6 @@ module Appwrite
|
|
91
93
|
headers = {
|
92
94
|
"content-type": 'application/json',
|
93
95
|
}
|
94
|
-
if database_id.nil?
|
95
|
-
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
96
|
-
end
|
97
|
-
|
98
|
-
.gsub('{databaseId}', database_id)
|
99
96
|
|
100
97
|
@client.call(
|
101
98
|
method: 'GET',
|
@@ -114,8 +111,16 @@ module Appwrite
|
|
114
111
|
#
|
115
112
|
# @return [Database]
|
116
113
|
def update(database_id:, name:)
|
117
|
-
|
118
114
|
path = '/databases/{databaseId}'
|
115
|
+
.gsub('{databaseId}', database_id)
|
116
|
+
|
117
|
+
if database_id.nil?
|
118
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
119
|
+
end
|
120
|
+
|
121
|
+
if name.nil?
|
122
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
123
|
+
end
|
119
124
|
|
120
125
|
params = {
|
121
126
|
name: name,
|
@@ -124,15 +129,6 @@ module Appwrite
|
|
124
129
|
headers = {
|
125
130
|
"content-type": 'application/json',
|
126
131
|
}
|
127
|
-
if database_id.nil?
|
128
|
-
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
129
|
-
end
|
130
|
-
|
131
|
-
if name.nil?
|
132
|
-
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
133
|
-
end
|
134
|
-
|
135
|
-
.gsub('{databaseId}', database_id)
|
136
132
|
|
137
133
|
@client.call(
|
138
134
|
method: 'PUT',
|
@@ -151,8 +147,12 @@ module Appwrite
|
|
151
147
|
#
|
152
148
|
# @return []
|
153
149
|
def delete(database_id:)
|
154
|
-
|
155
150
|
path = '/databases/{databaseId}'
|
151
|
+
.gsub('{databaseId}', database_id)
|
152
|
+
|
153
|
+
if database_id.nil?
|
154
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
155
|
+
end
|
156
156
|
|
157
157
|
params = {
|
158
158
|
}
|
@@ -160,11 +160,6 @@ module Appwrite
|
|
160
160
|
headers = {
|
161
161
|
"content-type": 'application/json',
|
162
162
|
}
|
163
|
-
if database_id.nil?
|
164
|
-
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
165
|
-
end
|
166
|
-
|
167
|
-
.gsub('{databaseId}', database_id)
|
168
163
|
|
169
164
|
@client.call(
|
170
165
|
method: 'DELETE',
|
@@ -184,8 +179,12 @@ module Appwrite
|
|
184
179
|
#
|
185
180
|
# @return [CollectionList]
|
186
181
|
def list_collections(database_id:, queries: nil, search: nil)
|
187
|
-
|
188
182
|
path = '/databases/{databaseId}/collections'
|
183
|
+
.gsub('{databaseId}', database_id)
|
184
|
+
|
185
|
+
if database_id.nil?
|
186
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
187
|
+
end
|
189
188
|
|
190
189
|
params = {
|
191
190
|
queries: queries,
|
@@ -195,11 +194,6 @@ module Appwrite
|
|
195
194
|
headers = {
|
196
195
|
"content-type": 'application/json',
|
197
196
|
}
|
198
|
-
if database_id.nil?
|
199
|
-
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
200
|
-
end
|
201
|
-
|
202
|
-
.gsub('{databaseId}', database_id)
|
203
197
|
|
204
198
|
@client.call(
|
205
199
|
method: 'GET',
|
@@ -224,8 +218,20 @@ module Appwrite
|
|
224
218
|
#
|
225
219
|
# @return [Collection]
|
226
220
|
def create_collection(database_id:, collection_id:, name:, permissions: nil, document_security: nil)
|
227
|
-
|
228
221
|
path = '/databases/{databaseId}/collections'
|
222
|
+
.gsub('{databaseId}', database_id)
|
223
|
+
|
224
|
+
if database_id.nil?
|
225
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
226
|
+
end
|
227
|
+
|
228
|
+
if collection_id.nil?
|
229
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
230
|
+
end
|
231
|
+
|
232
|
+
if name.nil?
|
233
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
234
|
+
end
|
229
235
|
|
230
236
|
params = {
|
231
237
|
collectionId: collection_id,
|
@@ -237,19 +243,6 @@ module Appwrite
|
|
237
243
|
headers = {
|
238
244
|
"content-type": 'application/json',
|
239
245
|
}
|
240
|
-
if database_id.nil?
|
241
|
-
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
242
|
-
end
|
243
|
-
|
244
|
-
if collection_id.nil?
|
245
|
-
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
246
|
-
end
|
247
|
-
|
248
|
-
if name.nil?
|
249
|
-
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
250
|
-
end
|
251
|
-
|
252
|
-
.gsub('{databaseId}', database_id)
|
253
246
|
|
254
247
|
@client.call(
|
255
248
|
method: 'POST',
|
@@ -269,25 +262,24 @@ module Appwrite
|
|
269
262
|
#
|
270
263
|
# @return [Collection]
|
271
264
|
def get_collection(database_id:, collection_id:)
|
272
|
-
|
273
265
|
path = '/databases/{databaseId}/collections/{collectionId}'
|
266
|
+
.gsub('{databaseId}', database_id)
|
267
|
+
.gsub('{collectionId}', collection_id)
|
274
268
|
|
275
|
-
params = {
|
276
|
-
}
|
277
|
-
|
278
|
-
headers = {
|
279
|
-
"content-type": 'application/json',
|
280
|
-
}
|
281
269
|
if database_id.nil?
|
282
|
-
|
270
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
283
271
|
end
|
284
272
|
|
285
273
|
if collection_id.nil?
|
286
|
-
|
274
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
287
275
|
end
|
288
276
|
|
289
|
-
|
290
|
-
|
277
|
+
params = {
|
278
|
+
}
|
279
|
+
|
280
|
+
headers = {
|
281
|
+
"content-type": 'application/json',
|
282
|
+
}
|
291
283
|
|
292
284
|
@client.call(
|
293
285
|
method: 'GET',
|
@@ -310,8 +302,21 @@ module Appwrite
|
|
310
302
|
#
|
311
303
|
# @return [Collection]
|
312
304
|
def update_collection(database_id:, collection_id:, name:, permissions: nil, document_security: nil, enabled: nil)
|
313
|
-
|
314
305
|
path = '/databases/{databaseId}/collections/{collectionId}'
|
306
|
+
.gsub('{databaseId}', database_id)
|
307
|
+
.gsub('{collectionId}', collection_id)
|
308
|
+
|
309
|
+
if database_id.nil?
|
310
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
311
|
+
end
|
312
|
+
|
313
|
+
if collection_id.nil?
|
314
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
315
|
+
end
|
316
|
+
|
317
|
+
if name.nil?
|
318
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
319
|
+
end
|
315
320
|
|
316
321
|
params = {
|
317
322
|
name: name,
|
@@ -323,20 +328,6 @@ module Appwrite
|
|
323
328
|
headers = {
|
324
329
|
"content-type": 'application/json',
|
325
330
|
}
|
326
|
-
if database_id.nil?
|
327
|
-
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
328
|
-
end
|
329
|
-
|
330
|
-
if collection_id.nil?
|
331
|
-
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
332
|
-
end
|
333
|
-
|
334
|
-
if name.nil?
|
335
|
-
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
336
|
-
end
|
337
|
-
|
338
|
-
.gsub('{databaseId}', database_id)
|
339
|
-
.gsub('{collectionId}', collection_id)
|
340
331
|
|
341
332
|
@client.call(
|
342
333
|
method: 'PUT',
|
@@ -356,25 +347,24 @@ module Appwrite
|
|
356
347
|
#
|
357
348
|
# @return []
|
358
349
|
def delete_collection(database_id:, collection_id:)
|
359
|
-
|
360
350
|
path = '/databases/{databaseId}/collections/{collectionId}'
|
351
|
+
.gsub('{databaseId}', database_id)
|
352
|
+
.gsub('{collectionId}', collection_id)
|
361
353
|
|
362
|
-
params = {
|
363
|
-
}
|
364
|
-
|
365
|
-
headers = {
|
366
|
-
"content-type": 'application/json',
|
367
|
-
}
|
368
354
|
if database_id.nil?
|
369
|
-
|
355
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
370
356
|
end
|
371
357
|
|
372
358
|
if collection_id.nil?
|
373
|
-
|
359
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
374
360
|
end
|
375
361
|
|
376
|
-
|
377
|
-
|
362
|
+
params = {
|
363
|
+
}
|
364
|
+
|
365
|
+
headers = {
|
366
|
+
"content-type": 'application/json',
|
367
|
+
}
|
378
368
|
|
379
369
|
@client.call(
|
380
370
|
method: 'DELETE',
|
@@ -392,25 +382,24 @@ module Appwrite
|
|
392
382
|
#
|
393
383
|
# @return [AttributeList]
|
394
384
|
def list_attributes(database_id:, collection_id:)
|
395
|
-
|
396
385
|
path = '/databases/{databaseId}/collections/{collectionId}/attributes'
|
386
|
+
.gsub('{databaseId}', database_id)
|
387
|
+
.gsub('{collectionId}', collection_id)
|
397
388
|
|
398
|
-
params = {
|
399
|
-
}
|
400
|
-
|
401
|
-
headers = {
|
402
|
-
"content-type": 'application/json',
|
403
|
-
}
|
404
389
|
if database_id.nil?
|
405
|
-
|
390
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
406
391
|
end
|
407
392
|
|
408
393
|
if collection_id.nil?
|
409
|
-
|
394
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
410
395
|
end
|
411
396
|
|
412
|
-
|
413
|
-
|
397
|
+
params = {
|
398
|
+
}
|
399
|
+
|
400
|
+
headers = {
|
401
|
+
"content-type": 'application/json',
|
402
|
+
}
|
414
403
|
|
415
404
|
@client.call(
|
416
405
|
method: 'GET',
|
@@ -434,37 +423,36 @@ module Appwrite
|
|
434
423
|
#
|
435
424
|
# @return [AttributeBoolean]
|
436
425
|
def create_boolean_attribute(database_id:, collection_id:, key:, required:, default: nil, array: nil)
|
437
|
-
|
438
426
|
path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean'
|
427
|
+
.gsub('{databaseId}', database_id)
|
428
|
+
.gsub('{collectionId}', collection_id)
|
439
429
|
|
440
|
-
params = {
|
441
|
-
key: key,
|
442
|
-
required: required,
|
443
|
-
default: default,
|
444
|
-
array: array,
|
445
|
-
}
|
446
|
-
|
447
|
-
headers = {
|
448
|
-
"content-type": 'application/json',
|
449
|
-
}
|
450
430
|
if database_id.nil?
|
451
|
-
|
431
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
452
432
|
end
|
453
433
|
|
454
434
|
if collection_id.nil?
|
455
|
-
|
435
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
456
436
|
end
|
457
437
|
|
458
438
|
if key.nil?
|
459
|
-
|
439
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
460
440
|
end
|
461
441
|
|
462
442
|
if required.nil?
|
463
|
-
|
443
|
+
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
464
444
|
end
|
465
445
|
|
466
|
-
|
467
|
-
|
446
|
+
params = {
|
447
|
+
key: key,
|
448
|
+
required: required,
|
449
|
+
default: default,
|
450
|
+
array: array,
|
451
|
+
}
|
452
|
+
|
453
|
+
headers = {
|
454
|
+
"content-type": 'application/json',
|
455
|
+
}
|
468
456
|
|
469
457
|
@client.call(
|
470
458
|
method: 'POST',
|
@@ -487,37 +475,36 @@ module Appwrite
|
|
487
475
|
#
|
488
476
|
# @return [AttributeDatetime]
|
489
477
|
def create_datetime_attribute(database_id:, collection_id:, key:, required:, default: nil, array: nil)
|
490
|
-
|
491
478
|
path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime'
|
479
|
+
.gsub('{databaseId}', database_id)
|
480
|
+
.gsub('{collectionId}', collection_id)
|
492
481
|
|
493
|
-
params = {
|
494
|
-
key: key,
|
495
|
-
required: required,
|
496
|
-
default: default,
|
497
|
-
array: array,
|
498
|
-
}
|
499
|
-
|
500
|
-
headers = {
|
501
|
-
"content-type": 'application/json',
|
502
|
-
}
|
503
482
|
if database_id.nil?
|
504
|
-
|
483
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
505
484
|
end
|
506
485
|
|
507
486
|
if collection_id.nil?
|
508
|
-
|
487
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
509
488
|
end
|
510
489
|
|
511
490
|
if key.nil?
|
512
|
-
|
491
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
513
492
|
end
|
514
493
|
|
515
494
|
if required.nil?
|
516
|
-
|
495
|
+
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
517
496
|
end
|
518
497
|
|
519
|
-
|
520
|
-
|
498
|
+
params = {
|
499
|
+
key: key,
|
500
|
+
required: required,
|
501
|
+
default: default,
|
502
|
+
array: array,
|
503
|
+
}
|
504
|
+
|
505
|
+
headers = {
|
506
|
+
"content-type": 'application/json',
|
507
|
+
}
|
521
508
|
|
522
509
|
@client.call(
|
523
510
|
method: 'POST',
|
@@ -541,37 +528,36 @@ module Appwrite
|
|
541
528
|
#
|
542
529
|
# @return [AttributeEmail]
|
543
530
|
def create_email_attribute(database_id:, collection_id:, key:, required:, default: nil, array: nil)
|
544
|
-
|
545
531
|
path = '/databases/{databaseId}/collections/{collectionId}/attributes/email'
|
532
|
+
.gsub('{databaseId}', database_id)
|
533
|
+
.gsub('{collectionId}', collection_id)
|
546
534
|
|
547
|
-
params = {
|
548
|
-
key: key,
|
549
|
-
required: required,
|
550
|
-
default: default,
|
551
|
-
array: array,
|
552
|
-
}
|
553
|
-
|
554
|
-
headers = {
|
555
|
-
"content-type": 'application/json',
|
556
|
-
}
|
557
535
|
if database_id.nil?
|
558
|
-
|
536
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
559
537
|
end
|
560
538
|
|
561
539
|
if collection_id.nil?
|
562
|
-
|
540
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
563
541
|
end
|
564
542
|
|
565
543
|
if key.nil?
|
566
|
-
|
544
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
567
545
|
end
|
568
546
|
|
569
547
|
if required.nil?
|
570
|
-
|
548
|
+
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
571
549
|
end
|
572
550
|
|
573
|
-
|
574
|
-
|
551
|
+
params = {
|
552
|
+
key: key,
|
553
|
+
required: required,
|
554
|
+
default: default,
|
555
|
+
array: array,
|
556
|
+
}
|
557
|
+
|
558
|
+
headers = {
|
559
|
+
"content-type": 'application/json',
|
560
|
+
}
|
575
561
|
|
576
562
|
@client.call(
|
577
563
|
method: 'POST',
|
@@ -595,42 +581,41 @@ module Appwrite
|
|
595
581
|
#
|
596
582
|
# @return [AttributeEnum]
|
597
583
|
def create_enum_attribute(database_id:, collection_id:, key:, elements:, required:, default: nil, array: nil)
|
598
|
-
|
599
584
|
path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum'
|
585
|
+
.gsub('{databaseId}', database_id)
|
586
|
+
.gsub('{collectionId}', collection_id)
|
600
587
|
|
601
|
-
params = {
|
602
|
-
key: key,
|
603
|
-
elements: elements,
|
604
|
-
required: required,
|
605
|
-
default: default,
|
606
|
-
array: array,
|
607
|
-
}
|
608
|
-
|
609
|
-
headers = {
|
610
|
-
"content-type": 'application/json',
|
611
|
-
}
|
612
588
|
if database_id.nil?
|
613
|
-
|
589
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
614
590
|
end
|
615
591
|
|
616
592
|
if collection_id.nil?
|
617
|
-
|
593
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
618
594
|
end
|
619
595
|
|
620
596
|
if key.nil?
|
621
|
-
|
597
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
622
598
|
end
|
623
599
|
|
624
600
|
if elements.nil?
|
625
|
-
|
601
|
+
raise Appwrite::Exception.new('Missing required parameter: "elements"')
|
626
602
|
end
|
627
603
|
|
628
604
|
if required.nil?
|
629
|
-
|
605
|
+
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
630
606
|
end
|
631
607
|
|
632
|
-
|
633
|
-
|
608
|
+
params = {
|
609
|
+
key: key,
|
610
|
+
elements: elements,
|
611
|
+
required: required,
|
612
|
+
default: default,
|
613
|
+
array: array,
|
614
|
+
}
|
615
|
+
|
616
|
+
headers = {
|
617
|
+
"content-type": 'application/json',
|
618
|
+
}
|
634
619
|
|
635
620
|
@client.call(
|
636
621
|
method: 'POST',
|
@@ -657,39 +642,38 @@ module Appwrite
|
|
657
642
|
#
|
658
643
|
# @return [AttributeFloat]
|
659
644
|
def create_float_attribute(database_id:, collection_id:, key:, required:, min: nil, max: nil, default: nil, array: nil)
|
660
|
-
|
661
645
|
path = '/databases/{databaseId}/collections/{collectionId}/attributes/float'
|
646
|
+
.gsub('{databaseId}', database_id)
|
647
|
+
.gsub('{collectionId}', collection_id)
|
662
648
|
|
663
|
-
params = {
|
664
|
-
key: key,
|
665
|
-
required: required,
|
666
|
-
min: min,
|
667
|
-
max: max,
|
668
|
-
default: default,
|
669
|
-
array: array,
|
670
|
-
}
|
671
|
-
|
672
|
-
headers = {
|
673
|
-
"content-type": 'application/json',
|
674
|
-
}
|
675
649
|
if database_id.nil?
|
676
|
-
|
650
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
677
651
|
end
|
678
652
|
|
679
653
|
if collection_id.nil?
|
680
|
-
|
654
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
681
655
|
end
|
682
656
|
|
683
657
|
if key.nil?
|
684
|
-
|
658
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
685
659
|
end
|
686
660
|
|
687
661
|
if required.nil?
|
688
|
-
|
662
|
+
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
689
663
|
end
|
690
664
|
|
691
|
-
|
692
|
-
|
665
|
+
params = {
|
666
|
+
key: key,
|
667
|
+
required: required,
|
668
|
+
min: min,
|
669
|
+
max: max,
|
670
|
+
default: default,
|
671
|
+
array: array,
|
672
|
+
}
|
673
|
+
|
674
|
+
headers = {
|
675
|
+
"content-type": 'application/json',
|
676
|
+
}
|
693
677
|
|
694
678
|
@client.call(
|
695
679
|
method: 'POST',
|
@@ -716,39 +700,38 @@ module Appwrite
|
|
716
700
|
#
|
717
701
|
# @return [AttributeInteger]
|
718
702
|
def create_integer_attribute(database_id:, collection_id:, key:, required:, min: nil, max: nil, default: nil, array: nil)
|
719
|
-
|
720
703
|
path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer'
|
704
|
+
.gsub('{databaseId}', database_id)
|
705
|
+
.gsub('{collectionId}', collection_id)
|
721
706
|
|
722
|
-
params = {
|
723
|
-
key: key,
|
724
|
-
required: required,
|
725
|
-
min: min,
|
726
|
-
max: max,
|
727
|
-
default: default,
|
728
|
-
array: array,
|
729
|
-
}
|
730
|
-
|
731
|
-
headers = {
|
732
|
-
"content-type": 'application/json',
|
733
|
-
}
|
734
707
|
if database_id.nil?
|
735
|
-
|
708
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
736
709
|
end
|
737
710
|
|
738
711
|
if collection_id.nil?
|
739
|
-
|
712
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
740
713
|
end
|
741
714
|
|
742
715
|
if key.nil?
|
743
|
-
|
716
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
744
717
|
end
|
745
718
|
|
746
719
|
if required.nil?
|
747
|
-
|
720
|
+
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
748
721
|
end
|
749
722
|
|
750
|
-
|
751
|
-
|
723
|
+
params = {
|
724
|
+
key: key,
|
725
|
+
required: required,
|
726
|
+
min: min,
|
727
|
+
max: max,
|
728
|
+
default: default,
|
729
|
+
array: array,
|
730
|
+
}
|
731
|
+
|
732
|
+
headers = {
|
733
|
+
"content-type": 'application/json',
|
734
|
+
}
|
752
735
|
|
753
736
|
@client.call(
|
754
737
|
method: 'POST',
|
@@ -772,37 +755,36 @@ module Appwrite
|
|
772
755
|
#
|
773
756
|
# @return [AttributeIp]
|
774
757
|
def create_ip_attribute(database_id:, collection_id:, key:, required:, default: nil, array: nil)
|
775
|
-
|
776
758
|
path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip'
|
759
|
+
.gsub('{databaseId}', database_id)
|
760
|
+
.gsub('{collectionId}', collection_id)
|
777
761
|
|
778
|
-
params = {
|
779
|
-
key: key,
|
780
|
-
required: required,
|
781
|
-
default: default,
|
782
|
-
array: array,
|
783
|
-
}
|
784
|
-
|
785
|
-
headers = {
|
786
|
-
"content-type": 'application/json',
|
787
|
-
}
|
788
762
|
if database_id.nil?
|
789
|
-
|
763
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
790
764
|
end
|
791
765
|
|
792
766
|
if collection_id.nil?
|
793
|
-
|
767
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
794
768
|
end
|
795
769
|
|
796
770
|
if key.nil?
|
797
|
-
|
771
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
798
772
|
end
|
799
773
|
|
800
774
|
if required.nil?
|
801
|
-
|
775
|
+
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
802
776
|
end
|
803
777
|
|
804
|
-
|
805
|
-
|
778
|
+
params = {
|
779
|
+
key: key,
|
780
|
+
required: required,
|
781
|
+
default: default,
|
782
|
+
array: array,
|
783
|
+
}
|
784
|
+
|
785
|
+
headers = {
|
786
|
+
"content-type": 'application/json',
|
787
|
+
}
|
806
788
|
|
807
789
|
@client.call(
|
808
790
|
method: 'POST',
|
@@ -827,42 +809,41 @@ module Appwrite
|
|
827
809
|
#
|
828
810
|
# @return [AttributeString]
|
829
811
|
def create_string_attribute(database_id:, collection_id:, key:, size:, required:, default: nil, array: nil)
|
830
|
-
|
831
812
|
path = '/databases/{databaseId}/collections/{collectionId}/attributes/string'
|
813
|
+
.gsub('{databaseId}', database_id)
|
814
|
+
.gsub('{collectionId}', collection_id)
|
832
815
|
|
833
|
-
params = {
|
834
|
-
key: key,
|
835
|
-
size: size,
|
836
|
-
required: required,
|
837
|
-
default: default,
|
838
|
-
array: array,
|
839
|
-
}
|
840
|
-
|
841
|
-
headers = {
|
842
|
-
"content-type": 'application/json',
|
843
|
-
}
|
844
816
|
if database_id.nil?
|
845
|
-
|
817
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
846
818
|
end
|
847
819
|
|
848
820
|
if collection_id.nil?
|
849
|
-
|
821
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
850
822
|
end
|
851
823
|
|
852
824
|
if key.nil?
|
853
|
-
|
825
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
854
826
|
end
|
855
827
|
|
856
828
|
if size.nil?
|
857
|
-
|
829
|
+
raise Appwrite::Exception.new('Missing required parameter: "size"')
|
858
830
|
end
|
859
831
|
|
860
832
|
if required.nil?
|
861
|
-
|
833
|
+
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
862
834
|
end
|
863
835
|
|
864
|
-
|
865
|
-
|
836
|
+
params = {
|
837
|
+
key: key,
|
838
|
+
size: size,
|
839
|
+
required: required,
|
840
|
+
default: default,
|
841
|
+
array: array,
|
842
|
+
}
|
843
|
+
|
844
|
+
headers = {
|
845
|
+
"content-type": 'application/json',
|
846
|
+
}
|
866
847
|
|
867
848
|
@client.call(
|
868
849
|
method: 'POST',
|
@@ -886,37 +867,36 @@ module Appwrite
|
|
886
867
|
#
|
887
868
|
# @return [AttributeUrl]
|
888
869
|
def create_url_attribute(database_id:, collection_id:, key:, required:, default: nil, array: nil)
|
889
|
-
|
890
870
|
path = '/databases/{databaseId}/collections/{collectionId}/attributes/url'
|
871
|
+
.gsub('{databaseId}', database_id)
|
872
|
+
.gsub('{collectionId}', collection_id)
|
891
873
|
|
892
|
-
params = {
|
893
|
-
key: key,
|
894
|
-
required: required,
|
895
|
-
default: default,
|
896
|
-
array: array,
|
897
|
-
}
|
898
|
-
|
899
|
-
headers = {
|
900
|
-
"content-type": 'application/json',
|
901
|
-
}
|
902
874
|
if database_id.nil?
|
903
|
-
|
875
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
904
876
|
end
|
905
877
|
|
906
878
|
if collection_id.nil?
|
907
|
-
|
879
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
908
880
|
end
|
909
881
|
|
910
882
|
if key.nil?
|
911
|
-
|
883
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
912
884
|
end
|
913
885
|
|
914
886
|
if required.nil?
|
915
|
-
|
887
|
+
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
916
888
|
end
|
917
889
|
|
918
|
-
|
919
|
-
|
890
|
+
params = {
|
891
|
+
key: key,
|
892
|
+
required: required,
|
893
|
+
default: default,
|
894
|
+
array: array,
|
895
|
+
}
|
896
|
+
|
897
|
+
headers = {
|
898
|
+
"content-type": 'application/json',
|
899
|
+
}
|
920
900
|
|
921
901
|
@client.call(
|
922
902
|
method: 'POST',
|
@@ -936,30 +916,29 @@ module Appwrite
|
|
936
916
|
#
|
937
917
|
# @return []
|
938
918
|
def get_attribute(database_id:, collection_id:, key:)
|
939
|
-
|
940
919
|
path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'
|
920
|
+
.gsub('{databaseId}', database_id)
|
921
|
+
.gsub('{collectionId}', collection_id)
|
922
|
+
.gsub('{key}', key)
|
941
923
|
|
942
|
-
params = {
|
943
|
-
}
|
944
|
-
|
945
|
-
headers = {
|
946
|
-
"content-type": 'application/json',
|
947
|
-
}
|
948
924
|
if database_id.nil?
|
949
|
-
|
925
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
950
926
|
end
|
951
927
|
|
952
928
|
if collection_id.nil?
|
953
|
-
|
929
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
954
930
|
end
|
955
931
|
|
956
932
|
if key.nil?
|
957
|
-
|
933
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
958
934
|
end
|
959
935
|
|
960
|
-
|
961
|
-
|
962
|
-
|
936
|
+
params = {
|
937
|
+
}
|
938
|
+
|
939
|
+
headers = {
|
940
|
+
"content-type": 'application/json',
|
941
|
+
}
|
963
942
|
|
964
943
|
@client.call(
|
965
944
|
method: 'GET',
|
@@ -978,30 +957,29 @@ module Appwrite
|
|
978
957
|
#
|
979
958
|
# @return []
|
980
959
|
def delete_attribute(database_id:, collection_id:, key:)
|
981
|
-
|
982
960
|
path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'
|
961
|
+
.gsub('{databaseId}', database_id)
|
962
|
+
.gsub('{collectionId}', collection_id)
|
963
|
+
.gsub('{key}', key)
|
983
964
|
|
984
|
-
params = {
|
985
|
-
}
|
986
|
-
|
987
|
-
headers = {
|
988
|
-
"content-type": 'application/json',
|
989
|
-
}
|
990
965
|
if database_id.nil?
|
991
|
-
|
966
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
992
967
|
end
|
993
968
|
|
994
969
|
if collection_id.nil?
|
995
|
-
|
970
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
996
971
|
end
|
997
972
|
|
998
973
|
if key.nil?
|
999
|
-
|
974
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
1000
975
|
end
|
1001
976
|
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
977
|
+
params = {
|
978
|
+
}
|
979
|
+
|
980
|
+
headers = {
|
981
|
+
"content-type": 'application/json',
|
982
|
+
}
|
1005
983
|
|
1006
984
|
@client.call(
|
1007
985
|
method: 'DELETE',
|
@@ -1023,8 +1001,17 @@ module Appwrite
|
|
1023
1001
|
#
|
1024
1002
|
# @return [DocumentList]
|
1025
1003
|
def list_documents(database_id:, collection_id:, queries: nil)
|
1026
|
-
|
1027
1004
|
path = '/databases/{databaseId}/collections/{collectionId}/documents'
|
1005
|
+
.gsub('{databaseId}', database_id)
|
1006
|
+
.gsub('{collectionId}', collection_id)
|
1007
|
+
|
1008
|
+
if database_id.nil?
|
1009
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
1010
|
+
end
|
1011
|
+
|
1012
|
+
if collection_id.nil?
|
1013
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
1014
|
+
end
|
1028
1015
|
|
1029
1016
|
params = {
|
1030
1017
|
queries: queries,
|
@@ -1033,16 +1020,6 @@ module Appwrite
|
|
1033
1020
|
headers = {
|
1034
1021
|
"content-type": 'application/json',
|
1035
1022
|
}
|
1036
|
-
if database_id.nil?
|
1037
|
-
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
1038
|
-
end
|
1039
|
-
|
1040
|
-
if collection_id.nil?
|
1041
|
-
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
1042
|
-
end
|
1043
|
-
|
1044
|
-
.gsub('{databaseId}', database_id)
|
1045
|
-
.gsub('{collectionId}', collection_id)
|
1046
1023
|
|
1047
1024
|
@client.call(
|
1048
1025
|
method: 'GET',
|
@@ -1067,36 +1044,35 @@ module Appwrite
|
|
1067
1044
|
#
|
1068
1045
|
# @return [Document]
|
1069
1046
|
def create_document(database_id:, collection_id:, document_id:, data:, permissions: nil)
|
1070
|
-
|
1071
1047
|
path = '/databases/{databaseId}/collections/{collectionId}/documents'
|
1048
|
+
.gsub('{databaseId}', database_id)
|
1049
|
+
.gsub('{collectionId}', collection_id)
|
1072
1050
|
|
1073
|
-
params = {
|
1074
|
-
documentId: document_id,
|
1075
|
-
data: data,
|
1076
|
-
permissions: permissions,
|
1077
|
-
}
|
1078
|
-
|
1079
|
-
headers = {
|
1080
|
-
"content-type": 'application/json',
|
1081
|
-
}
|
1082
1051
|
if database_id.nil?
|
1083
|
-
|
1052
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
1084
1053
|
end
|
1085
1054
|
|
1086
1055
|
if collection_id.nil?
|
1087
|
-
|
1056
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
1088
1057
|
end
|
1089
1058
|
|
1090
1059
|
if document_id.nil?
|
1091
|
-
|
1060
|
+
raise Appwrite::Exception.new('Missing required parameter: "documentId"')
|
1092
1061
|
end
|
1093
1062
|
|
1094
1063
|
if data.nil?
|
1095
|
-
|
1064
|
+
raise Appwrite::Exception.new('Missing required parameter: "data"')
|
1096
1065
|
end
|
1097
1066
|
|
1098
|
-
|
1099
|
-
|
1067
|
+
params = {
|
1068
|
+
documentId: document_id,
|
1069
|
+
data: data,
|
1070
|
+
permissions: permissions,
|
1071
|
+
}
|
1072
|
+
|
1073
|
+
headers = {
|
1074
|
+
"content-type": 'application/json',
|
1075
|
+
}
|
1100
1076
|
|
1101
1077
|
@client.call(
|
1102
1078
|
method: 'POST',
|
@@ -1117,30 +1093,29 @@ module Appwrite
|
|
1117
1093
|
#
|
1118
1094
|
# @return [Document]
|
1119
1095
|
def get_document(database_id:, collection_id:, document_id:)
|
1120
|
-
|
1121
1096
|
path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'
|
1097
|
+
.gsub('{databaseId}', database_id)
|
1098
|
+
.gsub('{collectionId}', collection_id)
|
1099
|
+
.gsub('{documentId}', document_id)
|
1122
1100
|
|
1123
|
-
params = {
|
1124
|
-
}
|
1125
|
-
|
1126
|
-
headers = {
|
1127
|
-
"content-type": 'application/json',
|
1128
|
-
}
|
1129
1101
|
if database_id.nil?
|
1130
|
-
|
1102
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
1131
1103
|
end
|
1132
1104
|
|
1133
1105
|
if collection_id.nil?
|
1134
|
-
|
1106
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
1135
1107
|
end
|
1136
1108
|
|
1137
1109
|
if document_id.nil?
|
1138
|
-
|
1110
|
+
raise Appwrite::Exception.new('Missing required parameter: "documentId"')
|
1139
1111
|
end
|
1140
1112
|
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1113
|
+
params = {
|
1114
|
+
}
|
1115
|
+
|
1116
|
+
headers = {
|
1117
|
+
"content-type": 'application/json',
|
1118
|
+
}
|
1144
1119
|
|
1145
1120
|
@client.call(
|
1146
1121
|
method: 'GET',
|
@@ -1163,32 +1138,31 @@ module Appwrite
|
|
1163
1138
|
#
|
1164
1139
|
# @return [Document]
|
1165
1140
|
def update_document(database_id:, collection_id:, document_id:, data: nil, permissions: nil)
|
1166
|
-
|
1167
1141
|
path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'
|
1142
|
+
.gsub('{databaseId}', database_id)
|
1143
|
+
.gsub('{collectionId}', collection_id)
|
1144
|
+
.gsub('{documentId}', document_id)
|
1168
1145
|
|
1169
|
-
params = {
|
1170
|
-
data: data,
|
1171
|
-
permissions: permissions,
|
1172
|
-
}
|
1173
|
-
|
1174
|
-
headers = {
|
1175
|
-
"content-type": 'application/json',
|
1176
|
-
}
|
1177
1146
|
if database_id.nil?
|
1178
|
-
|
1147
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
1179
1148
|
end
|
1180
1149
|
|
1181
1150
|
if collection_id.nil?
|
1182
|
-
|
1151
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
1183
1152
|
end
|
1184
1153
|
|
1185
1154
|
if document_id.nil?
|
1186
|
-
|
1155
|
+
raise Appwrite::Exception.new('Missing required parameter: "documentId"')
|
1187
1156
|
end
|
1188
1157
|
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1158
|
+
params = {
|
1159
|
+
data: data,
|
1160
|
+
permissions: permissions,
|
1161
|
+
}
|
1162
|
+
|
1163
|
+
headers = {
|
1164
|
+
"content-type": 'application/json',
|
1165
|
+
}
|
1192
1166
|
|
1193
1167
|
@client.call(
|
1194
1168
|
method: 'PATCH',
|
@@ -1208,30 +1182,29 @@ module Appwrite
|
|
1208
1182
|
#
|
1209
1183
|
# @return []
|
1210
1184
|
def delete_document(database_id:, collection_id:, document_id:)
|
1211
|
-
|
1212
1185
|
path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'
|
1186
|
+
.gsub('{databaseId}', database_id)
|
1187
|
+
.gsub('{collectionId}', collection_id)
|
1188
|
+
.gsub('{documentId}', document_id)
|
1213
1189
|
|
1214
|
-
params = {
|
1215
|
-
}
|
1216
|
-
|
1217
|
-
headers = {
|
1218
|
-
"content-type": 'application/json',
|
1219
|
-
}
|
1220
1190
|
if database_id.nil?
|
1221
|
-
|
1191
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
1222
1192
|
end
|
1223
1193
|
|
1224
1194
|
if collection_id.nil?
|
1225
|
-
|
1195
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
1226
1196
|
end
|
1227
1197
|
|
1228
1198
|
if document_id.nil?
|
1229
|
-
|
1199
|
+
raise Appwrite::Exception.new('Missing required parameter: "documentId"')
|
1230
1200
|
end
|
1231
1201
|
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1202
|
+
params = {
|
1203
|
+
}
|
1204
|
+
|
1205
|
+
headers = {
|
1206
|
+
"content-type": 'application/json',
|
1207
|
+
}
|
1235
1208
|
|
1236
1209
|
@client.call(
|
1237
1210
|
method: 'DELETE',
|
@@ -1249,25 +1222,24 @@ module Appwrite
|
|
1249
1222
|
#
|
1250
1223
|
# @return [IndexList]
|
1251
1224
|
def list_indexes(database_id:, collection_id:)
|
1252
|
-
|
1253
1225
|
path = '/databases/{databaseId}/collections/{collectionId}/indexes'
|
1226
|
+
.gsub('{databaseId}', database_id)
|
1227
|
+
.gsub('{collectionId}', collection_id)
|
1254
1228
|
|
1255
|
-
params = {
|
1256
|
-
}
|
1257
|
-
|
1258
|
-
headers = {
|
1259
|
-
"content-type": 'application/json',
|
1260
|
-
}
|
1261
1229
|
if database_id.nil?
|
1262
|
-
|
1230
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
1263
1231
|
end
|
1264
1232
|
|
1265
1233
|
if collection_id.nil?
|
1266
|
-
|
1234
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
1267
1235
|
end
|
1268
1236
|
|
1269
|
-
|
1270
|
-
|
1237
|
+
params = {
|
1238
|
+
}
|
1239
|
+
|
1240
|
+
headers = {
|
1241
|
+
"content-type": 'application/json',
|
1242
|
+
}
|
1271
1243
|
|
1272
1244
|
@client.call(
|
1273
1245
|
method: 'GET',
|
@@ -1290,41 +1262,40 @@ module Appwrite
|
|
1290
1262
|
#
|
1291
1263
|
# @return [Index]
|
1292
1264
|
def create_index(database_id:, collection_id:, key:, type:, attributes:, orders: nil)
|
1293
|
-
|
1294
1265
|
path = '/databases/{databaseId}/collections/{collectionId}/indexes'
|
1266
|
+
.gsub('{databaseId}', database_id)
|
1267
|
+
.gsub('{collectionId}', collection_id)
|
1295
1268
|
|
1296
|
-
params = {
|
1297
|
-
key: key,
|
1298
|
-
type: type,
|
1299
|
-
attributes: attributes,
|
1300
|
-
orders: orders,
|
1301
|
-
}
|
1302
|
-
|
1303
|
-
headers = {
|
1304
|
-
"content-type": 'application/json',
|
1305
|
-
}
|
1306
1269
|
if database_id.nil?
|
1307
|
-
|
1270
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
1308
1271
|
end
|
1309
1272
|
|
1310
1273
|
if collection_id.nil?
|
1311
|
-
|
1274
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
1312
1275
|
end
|
1313
1276
|
|
1314
1277
|
if key.nil?
|
1315
|
-
|
1278
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
1316
1279
|
end
|
1317
1280
|
|
1318
1281
|
if type.nil?
|
1319
|
-
|
1282
|
+
raise Appwrite::Exception.new('Missing required parameter: "type"')
|
1320
1283
|
end
|
1321
1284
|
|
1322
1285
|
if attributes.nil?
|
1323
|
-
|
1286
|
+
raise Appwrite::Exception.new('Missing required parameter: "attributes"')
|
1324
1287
|
end
|
1325
1288
|
|
1326
|
-
|
1327
|
-
|
1289
|
+
params = {
|
1290
|
+
key: key,
|
1291
|
+
type: type,
|
1292
|
+
attributes: attributes,
|
1293
|
+
orders: orders,
|
1294
|
+
}
|
1295
|
+
|
1296
|
+
headers = {
|
1297
|
+
"content-type": 'application/json',
|
1298
|
+
}
|
1328
1299
|
|
1329
1300
|
@client.call(
|
1330
1301
|
method: 'POST',
|
@@ -1344,30 +1315,29 @@ module Appwrite
|
|
1344
1315
|
#
|
1345
1316
|
# @return [Index]
|
1346
1317
|
def get_index(database_id:, collection_id:, key:)
|
1347
|
-
|
1348
1318
|
path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'
|
1319
|
+
.gsub('{databaseId}', database_id)
|
1320
|
+
.gsub('{collectionId}', collection_id)
|
1321
|
+
.gsub('{key}', key)
|
1349
1322
|
|
1350
|
-
params = {
|
1351
|
-
}
|
1352
|
-
|
1353
|
-
headers = {
|
1354
|
-
"content-type": 'application/json',
|
1355
|
-
}
|
1356
1323
|
if database_id.nil?
|
1357
|
-
|
1324
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
1358
1325
|
end
|
1359
1326
|
|
1360
1327
|
if collection_id.nil?
|
1361
|
-
|
1328
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
1362
1329
|
end
|
1363
1330
|
|
1364
1331
|
if key.nil?
|
1365
|
-
|
1332
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
1366
1333
|
end
|
1367
1334
|
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1335
|
+
params = {
|
1336
|
+
}
|
1337
|
+
|
1338
|
+
headers = {
|
1339
|
+
"content-type": 'application/json',
|
1340
|
+
}
|
1371
1341
|
|
1372
1342
|
@client.call(
|
1373
1343
|
method: 'GET',
|
@@ -1387,30 +1357,29 @@ module Appwrite
|
|
1387
1357
|
#
|
1388
1358
|
# @return []
|
1389
1359
|
def delete_index(database_id:, collection_id:, key:)
|
1390
|
-
|
1391
1360
|
path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'
|
1361
|
+
.gsub('{databaseId}', database_id)
|
1362
|
+
.gsub('{collectionId}', collection_id)
|
1363
|
+
.gsub('{key}', key)
|
1392
1364
|
|
1393
|
-
params = {
|
1394
|
-
}
|
1395
|
-
|
1396
|
-
headers = {
|
1397
|
-
"content-type": 'application/json',
|
1398
|
-
}
|
1399
1365
|
if database_id.nil?
|
1400
|
-
|
1366
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
1401
1367
|
end
|
1402
1368
|
|
1403
1369
|
if collection_id.nil?
|
1404
|
-
|
1370
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
1405
1371
|
end
|
1406
1372
|
|
1407
1373
|
if key.nil?
|
1408
|
-
|
1374
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
1409
1375
|
end
|
1410
1376
|
|
1411
|
-
|
1412
|
-
|
1413
|
-
|
1377
|
+
params = {
|
1378
|
+
}
|
1379
|
+
|
1380
|
+
headers = {
|
1381
|
+
"content-type": 'application/json',
|
1382
|
+
}
|
1414
1383
|
|
1415
1384
|
@client.call(
|
1416
1385
|
method: 'DELETE',
|