appwrite 8.0.0 → 9.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +2 -2
  3. data/lib/appwrite/models/attribute_boolean.rb +5 -0
  4. data/lib/appwrite/models/attribute_datetime.rb +5 -0
  5. data/lib/appwrite/models/attribute_email.rb +5 -0
  6. data/lib/appwrite/models/attribute_enum.rb +5 -0
  7. data/lib/appwrite/models/attribute_float.rb +5 -0
  8. data/lib/appwrite/models/attribute_integer.rb +5 -0
  9. data/lib/appwrite/models/attribute_ip.rb +5 -0
  10. data/lib/appwrite/models/attribute_relationship.rb +5 -0
  11. data/lib/appwrite/models/attribute_string.rb +5 -0
  12. data/lib/appwrite/models/attribute_url.rb +5 -0
  13. data/lib/appwrite/models/database.rb +8 -3
  14. data/lib/appwrite/models/deployment.rb +63 -13
  15. data/lib/appwrite/models/execution.rb +40 -20
  16. data/lib/appwrite/models/function.rb +53 -13
  17. data/lib/appwrite/models/headers.rb +32 -0
  18. data/lib/appwrite/models/health_status.rb +5 -0
  19. data/lib/appwrite/models/identity.rb +72 -0
  20. data/lib/appwrite/models/identity_list.rb +32 -0
  21. data/lib/appwrite/models/index.rb +5 -0
  22. data/lib/appwrite/models/locale_code.rb +32 -0
  23. data/lib/appwrite/models/locale_code_list.rb +32 -0
  24. data/lib/appwrite/models/user.rb +13 -3
  25. data/lib/appwrite/models/variable.rb +10 -5
  26. data/lib/appwrite/services/account.rb +105 -50
  27. data/lib/appwrite/services/avatars.rb +14 -14
  28. data/lib/appwrite/services/databases.rb +106 -94
  29. data/lib/appwrite/services/functions.rb +149 -63
  30. data/lib/appwrite/services/graphql.rb +4 -4
  31. data/lib/appwrite/services/health.rb +71 -22
  32. data/lib/appwrite/services/locale.rb +39 -14
  33. data/lib/appwrite/services/storage.rb +33 -31
  34. data/lib/appwrite/services/teams.rb +28 -27
  35. data/lib/appwrite/services/users.rb +148 -50
  36. data/lib/appwrite.rb +5 -0
  37. metadata +7 -2
@@ -15,7 +15,7 @@ module Appwrite
15
15
  #
16
16
  # @return [DatabaseList]
17
17
  def list(queries: nil, search: nil)
18
- path = '/databases'
18
+ api_path = '/databases'
19
19
 
20
20
  params = {
21
21
  queries: queries,
@@ -28,7 +28,7 @@ module Appwrite
28
28
 
29
29
  @client.call(
30
30
  method: 'GET',
31
- path: path,
31
+ path: api_path,
32
32
  headers: headers,
33
33
  params: params,
34
34
  response_type: Models::DatabaseList
@@ -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 Collection name. Max length: 128 chars.
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
- path = '/databases'
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"')
@@ -57,6 +58,7 @@ module Appwrite
57
58
  params = {
58
59
  databaseId: database_id,
59
60
  name: name,
61
+ enabled: enabled,
60
62
  }
61
63
 
62
64
  headers = {
@@ -65,7 +67,7 @@ module Appwrite
65
67
 
66
68
  @client.call(
67
69
  method: 'POST',
68
- path: path,
70
+ path: api_path,
69
71
  headers: headers,
70
72
  params: params,
71
73
  response_type: Models::Database
@@ -80,7 +82,7 @@ module Appwrite
80
82
  #
81
83
  # @return [Database]
82
84
  def get(database_id:)
83
- path = '/databases/{databaseId}'
85
+ api_path = '/databases/{databaseId}'
84
86
  .gsub('{databaseId}', database_id)
85
87
 
86
88
  if database_id.nil?
@@ -96,7 +98,7 @@ module Appwrite
96
98
 
97
99
  @client.call(
98
100
  method: 'GET',
99
- path: path,
101
+ path: api_path,
100
102
  headers: headers,
101
103
  params: params,
102
104
  response_type: Models::Database
@@ -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
- path = '/databases/{databaseId}'
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?
@@ -124,6 +127,7 @@ module Appwrite
124
127
 
125
128
  params = {
126
129
  name: name,
130
+ enabled: enabled,
127
131
  }
128
132
 
129
133
  headers = {
@@ -132,7 +136,7 @@ module Appwrite
132
136
 
133
137
  @client.call(
134
138
  method: 'PUT',
135
- path: path,
139
+ path: api_path,
136
140
  headers: headers,
137
141
  params: params,
138
142
  response_type: Models::Database
@@ -147,7 +151,7 @@ module Appwrite
147
151
  #
148
152
  # @return []
149
153
  def delete(database_id:)
150
- path = '/databases/{databaseId}'
154
+ api_path = '/databases/{databaseId}'
151
155
  .gsub('{databaseId}', database_id)
152
156
 
153
157
  if database_id.nil?
@@ -163,7 +167,7 @@ module Appwrite
163
167
 
164
168
  @client.call(
165
169
  method: 'DELETE',
166
- path: path,
170
+ path: api_path,
167
171
  headers: headers,
168
172
  params: params,
169
173
  )
@@ -179,7 +183,7 @@ module Appwrite
179
183
  #
180
184
  # @return [CollectionList]
181
185
  def list_collections(database_id:, queries: nil, search: nil)
182
- path = '/databases/{databaseId}/collections'
186
+ api_path = '/databases/{databaseId}/collections'
183
187
  .gsub('{databaseId}', database_id)
184
188
 
185
189
  if database_id.nil?
@@ -197,7 +201,7 @@ module Appwrite
197
201
 
198
202
  @client.call(
199
203
  method: 'GET',
200
- path: path,
204
+ path: api_path,
201
205
  headers: headers,
202
206
  params: params,
203
207
  response_type: Models::CollectionList
@@ -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
- path = '/databases/{databaseId}/collections'
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?
@@ -238,6 +243,7 @@ module Appwrite
238
243
  name: name,
239
244
  permissions: permissions,
240
245
  documentSecurity: document_security,
246
+ enabled: enabled,
241
247
  }
242
248
 
243
249
  headers = {
@@ -246,7 +252,7 @@ module Appwrite
246
252
 
247
253
  @client.call(
248
254
  method: 'POST',
249
- path: path,
255
+ path: api_path,
250
256
  headers: headers,
251
257
  params: params,
252
258
  response_type: Models::Collection
@@ -262,7 +268,7 @@ module Appwrite
262
268
  #
263
269
  # @return [Collection]
264
270
  def get_collection(database_id:, collection_id:)
265
- path = '/databases/{databaseId}/collections/{collectionId}'
271
+ api_path = '/databases/{databaseId}/collections/{collectionId}'
266
272
  .gsub('{databaseId}', database_id)
267
273
  .gsub('{collectionId}', collection_id)
268
274
 
@@ -283,7 +289,7 @@ module Appwrite
283
289
 
284
290
  @client.call(
285
291
  method: 'GET',
286
- path: path,
292
+ path: api_path,
287
293
  headers: headers,
288
294
  params: params,
289
295
  response_type: Models::Collection
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}'
311
+ api_path = '/databases/{databaseId}/collections/{collectionId}'
306
312
  .gsub('{databaseId}', database_id)
307
313
  .gsub('{collectionId}', collection_id)
308
314
 
@@ -331,7 +337,7 @@ module Appwrite
331
337
 
332
338
  @client.call(
333
339
  method: 'PUT',
334
- path: path,
340
+ path: api_path,
335
341
  headers: headers,
336
342
  params: params,
337
343
  response_type: Models::Collection
@@ -347,7 +353,7 @@ module Appwrite
347
353
  #
348
354
  # @return []
349
355
  def delete_collection(database_id:, collection_id:)
350
- path = '/databases/{databaseId}/collections/{collectionId}'
356
+ api_path = '/databases/{databaseId}/collections/{collectionId}'
351
357
  .gsub('{databaseId}', database_id)
352
358
  .gsub('{collectionId}', collection_id)
353
359
 
@@ -368,7 +374,7 @@ module Appwrite
368
374
 
369
375
  @client.call(
370
376
  method: 'DELETE',
371
- path: path,
377
+ path: api_path,
372
378
  headers: headers,
373
379
  params: params,
374
380
  )
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes'
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
 
@@ -395,6 +402,7 @@ module Appwrite
395
402
  end
396
403
 
397
404
  params = {
405
+ queries: queries,
398
406
  }
399
407
 
400
408
  headers = {
@@ -403,7 +411,7 @@ module Appwrite
403
411
 
404
412
  @client.call(
405
413
  method: 'GET',
406
- path: path,
414
+ path: api_path,
407
415
  headers: headers,
408
416
  params: params,
409
417
  response_type: Models::AttributeList
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean'
434
+ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean'
427
435
  .gsub('{databaseId}', database_id)
428
436
  .gsub('{collectionId}', collection_id)
429
437
 
@@ -456,7 +464,7 @@ module Appwrite
456
464
 
457
465
  @client.call(
458
466
  method: 'POST',
459
- path: path,
467
+ path: api_path,
460
468
  headers: headers,
461
469
  params: params,
462
470
  response_type: Models::AttributeBoolean
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}'
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)
@@ -510,7 +518,7 @@ module Appwrite
510
518
 
511
519
  @client.call(
512
520
  method: 'PATCH',
513
- path: path,
521
+ path: api_path,
514
522
  headers: headers,
515
523
  params: params,
516
524
  response_type: Models::AttributeBoolean
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime'
540
+ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime'
533
541
  .gsub('{databaseId}', database_id)
534
542
  .gsub('{collectionId}', collection_id)
535
543
 
@@ -562,7 +570,7 @@ module Appwrite
562
570
 
563
571
  @client.call(
564
572
  method: 'POST',
565
- path: path,
573
+ path: api_path,
566
574
  headers: headers,
567
575
  params: params,
568
576
  response_type: Models::AttributeDatetime
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}'
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)
@@ -616,7 +624,7 @@ module Appwrite
616
624
 
617
625
  @client.call(
618
626
  method: 'PATCH',
619
- path: path,
627
+ path: api_path,
620
628
  headers: headers,
621
629
  params: params,
622
630
  response_type: Models::AttributeDatetime
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/email'
647
+ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/email'
640
648
  .gsub('{databaseId}', database_id)
641
649
  .gsub('{collectionId}', collection_id)
642
650
 
@@ -669,7 +677,7 @@ module Appwrite
669
677
 
670
678
  @client.call(
671
679
  method: 'POST',
672
- path: path,
680
+ path: api_path,
673
681
  headers: headers,
674
682
  params: params,
675
683
  response_type: Models::AttributeEmail
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}'
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)
@@ -725,7 +733,7 @@ module Appwrite
725
733
 
726
734
  @client.call(
727
735
  method: 'PATCH',
728
- path: path,
736
+ path: api_path,
729
737
  headers: headers,
730
738
  params: params,
731
739
  response_type: Models::AttributeEmail
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum'
756
+ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum'
749
757
  .gsub('{databaseId}', database_id)
750
758
  .gsub('{collectionId}', collection_id)
751
759
 
@@ -783,7 +791,7 @@ module Appwrite
783
791
 
784
792
  @client.call(
785
793
  method: 'POST',
786
- path: path,
794
+ path: api_path,
787
795
  headers: headers,
788
796
  params: params,
789
797
  response_type: Models::AttributeEnum
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'
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)
@@ -845,7 +853,7 @@ module Appwrite
845
853
 
846
854
  @client.call(
847
855
  method: 'PATCH',
848
- path: path,
856
+ path: api_path,
849
857
  headers: headers,
850
858
  params: params,
851
859
  response_type: Models::AttributeEnum
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/float'
879
+ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/float'
872
880
  .gsub('{databaseId}', database_id)
873
881
  .gsub('{collectionId}', collection_id)
874
882
 
@@ -903,7 +911,7 @@ module Appwrite
903
911
 
904
912
  @client.call(
905
913
  method: 'POST',
906
- path: path,
914
+ path: api_path,
907
915
  headers: headers,
908
916
  params: params,
909
917
  response_type: Models::AttributeFloat
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}'
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)
@@ -971,7 +979,7 @@ module Appwrite
971
979
 
972
980
  @client.call(
973
981
  method: 'PATCH',
974
- path: path,
982
+ path: api_path,
975
983
  headers: headers,
976
984
  params: params,
977
985
  response_type: Models::AttributeFloat
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer'
1005
+ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer'
998
1006
  .gsub('{databaseId}', database_id)
999
1007
  .gsub('{collectionId}', collection_id)
1000
1008
 
@@ -1029,7 +1037,7 @@ module Appwrite
1029
1037
 
1030
1038
  @client.call(
1031
1039
  method: 'POST',
1032
- path: path,
1040
+ path: api_path,
1033
1041
  headers: headers,
1034
1042
  params: params,
1035
1043
  response_type: Models::AttributeInteger
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}'
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)
@@ -1097,7 +1105,7 @@ module Appwrite
1097
1105
 
1098
1106
  @client.call(
1099
1107
  method: 'PATCH',
1100
- path: path,
1108
+ path: api_path,
1101
1109
  headers: headers,
1102
1110
  params: params,
1103
1111
  response_type: Models::AttributeInteger
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip'
1128
+ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip'
1121
1129
  .gsub('{databaseId}', database_id)
1122
1130
  .gsub('{collectionId}', collection_id)
1123
1131
 
@@ -1150,7 +1158,7 @@ module Appwrite
1150
1158
 
1151
1159
  @client.call(
1152
1160
  method: 'POST',
1153
- path: path,
1161
+ path: api_path,
1154
1162
  headers: headers,
1155
1163
  params: params,
1156
1164
  response_type: Models::AttributeIp
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}'
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)
@@ -1206,7 +1214,7 @@ module Appwrite
1206
1214
 
1207
1215
  @client.call(
1208
1216
  method: 'PATCH',
1209
- path: path,
1217
+ path: api_path,
1210
1218
  headers: headers,
1211
1219
  params: params,
1212
1220
  response_type: Models::AttributeIp
@@ -1215,7 +1223,7 @@ module Appwrite
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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship'
1240
+ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship'
1233
1241
  .gsub('{databaseId}', database_id)
1234
1242
  .gsub('{collectionId}', collection_id)
1235
1243
 
@@ -1264,7 +1272,7 @@ module Appwrite
1264
1272
 
1265
1273
  @client.call(
1266
1274
  method: 'POST',
1267
- path: path,
1275
+ path: api_path,
1268
1276
  headers: headers,
1269
1277
  params: params,
1270
1278
  response_type: Models::AttributeRelationship
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/string'
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
 
@@ -1315,6 +1324,7 @@ module Appwrite
1315
1324
  required: required,
1316
1325
  default: default,
1317
1326
  array: array,
1327
+ encrypt: encrypt,
1318
1328
  }
1319
1329
 
1320
1330
  headers = {
@@ -1323,7 +1333,7 @@ module Appwrite
1323
1333
 
1324
1334
  @client.call(
1325
1335
  method: 'POST',
1326
- path: path,
1336
+ path: api_path,
1327
1337
  headers: headers,
1328
1338
  params: params,
1329
1339
  response_type: Models::AttributeString
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'
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)
@@ -1379,7 +1389,7 @@ module Appwrite
1379
1389
 
1380
1390
  @client.call(
1381
1391
  method: 'PATCH',
1382
- path: path,
1392
+ path: api_path,
1383
1393
  headers: headers,
1384
1394
  params: params,
1385
1395
  response_type: Models::AttributeString
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/url'
1412
+ api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/url'
1403
1413
  .gsub('{databaseId}', database_id)
1404
1414
  .gsub('{collectionId}', collection_id)
1405
1415
 
@@ -1432,7 +1442,7 @@ module Appwrite
1432
1442
 
1433
1443
  @client.call(
1434
1444
  method: 'POST',
1435
- path: path,
1445
+ path: api_path,
1436
1446
  headers: headers,
1437
1447
  params: params,
1438
1448
  response_type: Models::AttributeUrl
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}'
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)
@@ -1488,7 +1498,7 @@ module Appwrite
1488
1498
 
1489
1499
  @client.call(
1490
1500
  method: 'PATCH',
1491
- path: path,
1501
+ path: api_path,
1492
1502
  headers: headers,
1493
1503
  params: params,
1494
1504
  response_type: Models::AttributeUrl
@@ -1504,7 +1514,7 @@ module Appwrite
1504
1514
  #
1505
1515
  # @return []
1506
1516
  def get_attribute(database_id:, collection_id:, key:)
1507
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'
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)
@@ -1530,7 +1540,7 @@ module Appwrite
1530
1540
 
1531
1541
  @client.call(
1532
1542
  method: 'GET',
1533
- path: path,
1543
+ path: api_path,
1534
1544
  headers: headers,
1535
1545
  params: params,
1536
1546
  )
@@ -1545,7 +1555,7 @@ module Appwrite
1545
1555
  #
1546
1556
  # @return []
1547
1557
  def delete_attribute(database_id:, collection_id:, key:)
1548
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'
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)
@@ -1571,7 +1581,7 @@ module Appwrite
1571
1581
 
1572
1582
  @client.call(
1573
1583
  method: 'DELETE',
1574
- path: path,
1584
+ path: api_path,
1575
1585
  headers: headers,
1576
1586
  params: params,
1577
1587
  )
@@ -1579,7 +1589,7 @@ module Appwrite
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
- path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'
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)
@@ -1616,7 +1626,7 @@ module Appwrite
1616
1626
 
1617
1627
  @client.call(
1618
1628
  method: 'PATCH',
1619
- path: path,
1629
+ path: api_path,
1620
1630
  headers: headers,
1621
1631
  params: params,
1622
1632
  response_type: Models::AttributeRelationship
@@ -1633,7 +1643,7 @@ module Appwrite
1633
1643
  #
1634
1644
  # @return [DocumentList]
1635
1645
  def list_documents(database_id:, collection_id:, queries: nil)
1636
- path = '/databases/{databaseId}/collections/{collectionId}/documents'
1646
+ api_path = '/databases/{databaseId}/collections/{collectionId}/documents'
1637
1647
  .gsub('{databaseId}', database_id)
1638
1648
  .gsub('{collectionId}', collection_id)
1639
1649
 
@@ -1655,7 +1665,7 @@ module Appwrite
1655
1665
 
1656
1666
  @client.call(
1657
1667
  method: 'GET',
1658
- path: path,
1668
+ path: api_path,
1659
1669
  headers: headers,
1660
1670
  params: params,
1661
1671
  response_type: Models::DocumentList
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/documents'
1689
+ api_path = '/databases/{databaseId}/collections/{collectionId}/documents'
1680
1690
  .gsub('{databaseId}', database_id)
1681
1691
  .gsub('{collectionId}', collection_id)
1682
1692
 
@@ -1708,7 +1718,7 @@ module Appwrite
1708
1718
 
1709
1719
  @client.call(
1710
1720
  method: 'POST',
1711
- path: path,
1721
+ path: api_path,
1712
1722
  headers: headers,
1713
1723
  params: params,
1714
1724
  response_type: Models::Document
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'
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)
@@ -1753,7 +1763,7 @@ module Appwrite
1753
1763
 
1754
1764
  @client.call(
1755
1765
  method: 'GET',
1756
- path: path,
1766
+ path: api_path,
1757
1767
  headers: headers,
1758
1768
  params: params,
1759
1769
  response_type: Models::Document
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'
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)
@@ -1800,7 +1810,7 @@ module Appwrite
1800
1810
 
1801
1811
  @client.call(
1802
1812
  method: 'PATCH',
1803
- path: path,
1813
+ path: api_path,
1804
1814
  headers: headers,
1805
1815
  params: params,
1806
1816
  response_type: Models::Document
@@ -1816,7 +1826,7 @@ module Appwrite
1816
1826
  #
1817
1827
  # @return []
1818
1828
  def delete_document(database_id:, collection_id:, document_id:)
1819
- path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'
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)
@@ -1842,7 +1852,7 @@ module Appwrite
1842
1852
 
1843
1853
  @client.call(
1844
1854
  method: 'DELETE',
1845
- path: path,
1855
+ path: api_path,
1846
1856
  headers: headers,
1847
1857
  params: params,
1848
1858
  )
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/indexes'
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
 
@@ -1869,6 +1880,7 @@ module Appwrite
1869
1880
  end
1870
1881
 
1871
1882
  params = {
1883
+ queries: queries,
1872
1884
  }
1873
1885
 
1874
1886
  headers = {
@@ -1877,7 +1889,7 @@ module Appwrite
1877
1889
 
1878
1890
  @client.call(
1879
1891
  method: 'GET',
1880
- path: path,
1892
+ path: api_path,
1881
1893
  headers: headers,
1882
1894
  params: params,
1883
1895
  response_type: Models::IndexList
@@ -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
- path = '/databases/{databaseId}/collections/{collectionId}/indexes'
1911
+ api_path = '/databases/{databaseId}/collections/{collectionId}/indexes'
1900
1912
  .gsub('{databaseId}', database_id)
1901
1913
  .gsub('{collectionId}', collection_id)
1902
1914
 
@@ -1933,7 +1945,7 @@ module Appwrite
1933
1945
 
1934
1946
  @client.call(
1935
1947
  method: 'POST',
1936
- path: path,
1948
+ path: api_path,
1937
1949
  headers: headers,
1938
1950
  params: params,
1939
1951
  response_type: Models::Index
@@ -1949,7 +1961,7 @@ module Appwrite
1949
1961
  #
1950
1962
  # @return [Index]
1951
1963
  def get_index(database_id:, collection_id:, key:)
1952
- path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'
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)
@@ -1975,7 +1987,7 @@ module Appwrite
1975
1987
 
1976
1988
  @client.call(
1977
1989
  method: 'GET',
1978
- path: path,
1990
+ path: api_path,
1979
1991
  headers: headers,
1980
1992
  params: params,
1981
1993
  response_type: Models::Index
@@ -1991,7 +2003,7 @@ module Appwrite
1991
2003
  #
1992
2004
  # @return []
1993
2005
  def delete_index(database_id:, collection_id:, key:)
1994
- path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'
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)
@@ -2017,7 +2029,7 @@ module Appwrite
2017
2029
 
2018
2030
  @client.call(
2019
2031
  method: 'DELETE',
2020
- path: path,
2032
+ path: api_path,
2021
2033
  headers: headers,
2022
2034
  params: params,
2023
2035
  )