appwrite 16.0.0 → 17.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +2 -2
  3. data/lib/appwrite/enums/build_runtime.rb +2 -0
  4. data/lib/appwrite/enums/image_format.rb +1 -0
  5. data/lib/appwrite/enums/runtime.rb +2 -0
  6. data/lib/appwrite/models/attribute_string.rb +8 -3
  7. data/lib/appwrite/models/column_boolean.rb +67 -0
  8. data/lib/appwrite/models/column_datetime.rb +72 -0
  9. data/lib/appwrite/models/column_email.rb +72 -0
  10. data/lib/appwrite/models/column_enum.rb +77 -0
  11. data/lib/appwrite/models/column_float.rb +77 -0
  12. data/lib/appwrite/models/column_index.rb +72 -0
  13. data/lib/appwrite/models/column_index_list.rb +32 -0
  14. data/lib/appwrite/models/column_integer.rb +77 -0
  15. data/lib/appwrite/models/column_ip.rb +72 -0
  16. data/lib/appwrite/models/column_list.rb +32 -0
  17. data/lib/appwrite/models/column_relationship.rb +92 -0
  18. data/lib/appwrite/models/column_string.rb +77 -0
  19. data/lib/appwrite/models/column_url.rb +72 -0
  20. data/lib/appwrite/models/database.rb +8 -3
  21. data/lib/appwrite/models/document.rb +5 -0
  22. data/lib/appwrite/models/execution.rb +5 -0
  23. data/lib/appwrite/models/index.rb +18 -13
  24. data/lib/appwrite/models/row.rb +66 -0
  25. data/lib/appwrite/models/row_list.rb +36 -0
  26. data/lib/appwrite/models/table.rb +72 -0
  27. data/lib/appwrite/models/table_list.rb +32 -0
  28. data/lib/appwrite/query.rb +36 -0
  29. data/lib/appwrite/services/account.rb +15 -48
  30. data/lib/appwrite/services/avatars.rb +0 -7
  31. data/lib/appwrite/services/databases.rb +356 -97
  32. data/lib/appwrite/services/functions.rb +0 -26
  33. data/lib/appwrite/services/graphql.rb +0 -2
  34. data/lib/appwrite/services/health.rb +0 -22
  35. data/lib/appwrite/services/locale.rb +0 -8
  36. data/lib/appwrite/services/messaging.rb +0 -46
  37. data/lib/appwrite/services/sites.rb +0 -25
  38. data/lib/appwrite/services/storage.rb +0 -13
  39. data/lib/appwrite/services/tables_db.rb +2318 -0
  40. data/lib/appwrite/services/teams.rb +0 -13
  41. data/lib/appwrite/services/tokens.rb +1 -6
  42. data/lib/appwrite/services/users.rb +1 -43
  43. data/lib/appwrite.rb +18 -0
  44. metadata +20 -2
@@ -7,6 +7,9 @@ module Appwrite
7
7
  @client = client
8
8
  end
9
9
 
10
+ #
11
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.list` instead.
12
+ #
10
13
  # Get a list of all databases from the current Appwrite project. You can use
11
14
  # the search parameter to filter your results.
12
15
  #
@@ -34,7 +37,9 @@ module Appwrite
34
37
  )
35
38
  end
36
39
 
37
-
40
+ #
41
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createDatabase` instead.
42
+ #
38
43
  # Create a new Database.
39
44
  #
40
45
  #
@@ -73,7 +78,9 @@ module Appwrite
73
78
  )
74
79
  end
75
80
 
76
-
81
+ #
82
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.get` instead.
83
+ #
77
84
  # Get a database by its unique ID. This endpoint response returns a JSON
78
85
  # object with the database metadata.
79
86
  #
@@ -103,7 +110,9 @@ module Appwrite
103
110
  )
104
111
  end
105
112
 
106
-
113
+ #
114
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.update` instead.
115
+ #
107
116
  # Update a database by its unique ID.
108
117
  #
109
118
  # @param [String] database_id Database ID.
@@ -141,7 +150,9 @@ module Appwrite
141
150
  )
142
151
  end
143
152
 
144
-
153
+ #
154
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.delete` instead.
155
+ #
145
156
  # Delete a database by its unique ID. Only API keys with with databases.write
146
157
  # scope can delete a database.
147
158
  #
@@ -171,7 +182,9 @@ module Appwrite
171
182
  )
172
183
  end
173
184
 
174
-
185
+ #
186
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listTables` instead.
187
+ #
175
188
  # Get a list of all collections that belong to the provided databaseId. You
176
189
  # can use the search parameter to filter your results.
177
190
  #
@@ -205,7 +218,9 @@ module Appwrite
205
218
  )
206
219
  end
207
220
 
208
-
221
+ #
222
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createTable` instead.
223
+ #
209
224
  # Create a new Collection. Before using this route, you should create a new
210
225
  # database resource using either a [server
211
226
  # integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
@@ -256,7 +271,9 @@ module Appwrite
256
271
  )
257
272
  end
258
273
 
259
-
274
+ #
275
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getTable` instead.
276
+ #
260
277
  # Get a collection by its unique ID. This endpoint response returns a JSON
261
278
  # object with the collection metadata.
262
279
  #
@@ -292,7 +309,9 @@ module Appwrite
292
309
  )
293
310
  end
294
311
 
295
-
312
+ #
313
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateTable` instead.
314
+ #
296
315
  # Update a collection by its unique ID.
297
316
  #
298
317
  # @param [String] database_id Database ID.
@@ -340,7 +359,9 @@ module Appwrite
340
359
  )
341
360
  end
342
361
 
343
-
362
+ #
363
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteTable` instead.
364
+ #
344
365
  # Delete a collection by its unique ID. Only users with write permissions
345
366
  # have access to delete this resource.
346
367
  #
@@ -376,11 +397,13 @@ module Appwrite
376
397
  )
377
398
  end
378
399
 
379
-
400
+ #
401
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listColumns` instead.
402
+ #
380
403
  # List attributes in the collection.
381
404
  #
382
405
  # @param [String] database_id Database ID.
383
- # @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).
406
+ # @param [String] collection_id Collection ID.
384
407
  # @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
385
408
  #
386
409
  # @return [AttributeList]
@@ -413,12 +436,14 @@ module Appwrite
413
436
  )
414
437
  end
415
438
 
416
-
439
+ #
440
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createBooleanColumn` instead.
441
+ #
417
442
  # Create a boolean attribute.
418
443
  #
419
444
  #
420
445
  # @param [String] database_id Database ID.
421
- # @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).
446
+ # @param [String] collection_id Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
422
447
  # @param [String] key Attribute Key.
423
448
  # @param [] required Is attribute required?
424
449
  # @param [] default Default value for attribute when not provided. Cannot be set when attribute is required.
@@ -466,12 +491,14 @@ module Appwrite
466
491
  )
467
492
  end
468
493
 
469
-
494
+ #
495
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateBooleanColumn` instead.
496
+ #
470
497
  # Update a boolean attribute. Changing the `default` value will not update
471
498
  # already existing documents.
472
499
  #
473
500
  # @param [String] database_id Database ID.
474
- # @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).
501
+ # @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
475
502
  # @param [String] key Attribute Key.
476
503
  # @param [] required Is attribute required?
477
504
  # @param [] default Default value for attribute when not provided. Cannot be set when attribute is required.
@@ -523,11 +550,13 @@ module Appwrite
523
550
  )
524
551
  end
525
552
 
526
-
553
+ #
554
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createDatetimeColumn` instead.
555
+ #
527
556
  # Create a date time attribute according to the ISO 8601 standard.
528
557
  #
529
558
  # @param [String] database_id Database ID.
530
- # @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).
559
+ # @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
531
560
  # @param [String] key Attribute Key.
532
561
  # @param [] required Is attribute required?
533
562
  # @param [String] default Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.
@@ -575,12 +604,14 @@ module Appwrite
575
604
  )
576
605
  end
577
606
 
578
-
607
+ #
608
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateDatetimeColumn` instead.
609
+ #
579
610
  # Update a date time attribute. Changing the `default` value will not update
580
611
  # already existing documents.
581
612
  #
582
613
  # @param [String] database_id Database ID.
583
- # @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).
614
+ # @param [String] collection_id Collection ID.
584
615
  # @param [String] key Attribute Key.
585
616
  # @param [] required Is attribute required?
586
617
  # @param [String] default Default value for attribute when not provided. Cannot be set when attribute is required.
@@ -632,12 +663,14 @@ module Appwrite
632
663
  )
633
664
  end
634
665
 
635
-
666
+ #
667
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createEmailColumn` instead.
668
+ #
636
669
  # Create an email attribute.
637
670
  #
638
671
  #
639
672
  # @param [String] database_id Database ID.
640
- # @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).
673
+ # @param [String] collection_id Collection ID.
641
674
  # @param [String] key Attribute Key.
642
675
  # @param [] required Is attribute required?
643
676
  # @param [String] default Default value for attribute when not provided. Cannot be set when attribute is required.
@@ -685,17 +718,19 @@ module Appwrite
685
718
  )
686
719
  end
687
720
 
688
-
721
+ #
722
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateEmailColumn` instead.
723
+ #
689
724
  # Update an email attribute. Changing the `default` value will not update
690
725
  # already existing documents.
691
726
  #
692
727
  #
693
728
  # @param [String] database_id Database ID.
694
- # @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).
729
+ # @param [String] collection_id Collection ID.
695
730
  # @param [String] key Attribute Key.
696
731
  # @param [] required Is attribute required?
697
732
  # @param [String] default Default value for attribute when not provided. Cannot be set when attribute is required.
698
- # @param [String] new_key New attribute key.
733
+ # @param [String] new_key New Attribute Key.
699
734
  #
700
735
  # @return [AttributeEmail]
701
736
  def update_email_attribute(database_id:, collection_id:, key:, required:, default:, new_key: nil)
@@ -743,15 +778,17 @@ module Appwrite
743
778
  )
744
779
  end
745
780
 
746
-
747
- # Create an enumeration attribute. The `elements` param acts as a white-list
748
- # of accepted values for this attribute.
781
+ #
782
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createEnumColumn` instead.
783
+ #
784
+ # Create an enum attribute. The `elements` param acts as a white-list of
785
+ # accepted values for this attribute.
749
786
  #
750
787
  #
751
788
  # @param [String] database_id Database ID.
752
- # @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).
789
+ # @param [String] collection_id Collection ID.
753
790
  # @param [String] key Attribute Key.
754
- # @param [Array] elements Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.
791
+ # @param [Array] elements Array of enum values.
755
792
  # @param [] required Is attribute required?
756
793
  # @param [String] default Default value for attribute when not provided. Cannot be set when attribute is required.
757
794
  # @param [] array Is attribute an array?
@@ -803,18 +840,20 @@ module Appwrite
803
840
  )
804
841
  end
805
842
 
806
-
843
+ #
844
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateEnumColumn` instead.
845
+ #
807
846
  # Update an enum attribute. Changing the `default` value will not update
808
847
  # already existing documents.
809
848
  #
810
849
  #
811
850
  # @param [String] database_id Database ID.
812
- # @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).
851
+ # @param [String] collection_id Collection ID.
813
852
  # @param [String] key Attribute Key.
814
- # @param [Array] elements Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.
853
+ # @param [Array] elements Updated list of enum values.
815
854
  # @param [] required Is attribute required?
816
855
  # @param [String] default Default value for attribute when not provided. Cannot be set when attribute is required.
817
- # @param [String] new_key New attribute key.
856
+ # @param [String] new_key New Attribute Key.
818
857
  #
819
858
  # @return [AttributeEnum]
820
859
  def update_enum_attribute(database_id:, collection_id:, key:, elements:, required:, default:, new_key: nil)
@@ -867,18 +906,20 @@ module Appwrite
867
906
  )
868
907
  end
869
908
 
870
-
909
+ #
910
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createFloatColumn` instead.
911
+ #
871
912
  # Create a float attribute. Optionally, minimum and maximum values can be
872
913
  # provided.
873
914
  #
874
915
  #
875
916
  # @param [String] database_id Database ID.
876
- # @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).
917
+ # @param [String] collection_id Collection ID.
877
918
  # @param [String] key Attribute Key.
878
919
  # @param [] required Is attribute required?
879
- # @param [Float] min Minimum value to enforce on new documents
880
- # @param [Float] max Maximum value to enforce on new documents
881
- # @param [Float] default Default value for attribute when not provided. Cannot be set when attribute is required.
920
+ # @param [Float] min Minimum value.
921
+ # @param [Float] max Maximum value.
922
+ # @param [Float] default Default value. Cannot be set when required.
882
923
  # @param [] array Is attribute an array?
883
924
  #
884
925
  # @return [AttributeFloat]
@@ -925,19 +966,21 @@ module Appwrite
925
966
  )
926
967
  end
927
968
 
928
-
969
+ #
970
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateFloatColumn` instead.
971
+ #
929
972
  # Update a float attribute. Changing the `default` value will not update
930
973
  # already existing documents.
931
974
  #
932
975
  #
933
976
  # @param [String] database_id Database ID.
934
- # @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).
977
+ # @param [String] collection_id Collection ID.
935
978
  # @param [String] key Attribute Key.
936
979
  # @param [] required Is attribute required?
937
- # @param [Float] default Default value for attribute when not provided. Cannot be set when attribute is required.
938
- # @param [Float] min Minimum value to enforce on new documents
939
- # @param [Float] max Maximum value to enforce on new documents
940
- # @param [String] new_key New attribute key.
980
+ # @param [Float] default Default value. Cannot be set when required.
981
+ # @param [Float] min Minimum value.
982
+ # @param [Float] max Maximum value.
983
+ # @param [String] new_key New Attribute Key.
941
984
  #
942
985
  # @return [AttributeFloat]
943
986
  def update_float_attribute(database_id:, collection_id:, key:, required:, default:, min: nil, max: nil, new_key: nil)
@@ -987,18 +1030,20 @@ module Appwrite
987
1030
  )
988
1031
  end
989
1032
 
990
-
1033
+ #
1034
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createIntegerColumn` instead.
1035
+ #
991
1036
  # Create an integer attribute. Optionally, minimum and maximum values can be
992
1037
  # provided.
993
1038
  #
994
1039
  #
995
1040
  # @param [String] database_id Database ID.
996
- # @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).
1041
+ # @param [String] collection_id Collection ID.
997
1042
  # @param [String] key Attribute Key.
998
1043
  # @param [] required Is attribute required?
999
- # @param [Integer] min Minimum value to enforce on new documents
1000
- # @param [Integer] max Maximum value to enforce on new documents
1001
- # @param [Integer] default Default value for attribute when not provided. Cannot be set when attribute is required.
1044
+ # @param [Integer] min Minimum value
1045
+ # @param [Integer] max Maximum value
1046
+ # @param [Integer] default Default value. Cannot be set when attribute is required.
1002
1047
  # @param [] array Is attribute an array?
1003
1048
  #
1004
1049
  # @return [AttributeInteger]
@@ -1045,19 +1090,21 @@ module Appwrite
1045
1090
  )
1046
1091
  end
1047
1092
 
1048
-
1093
+ #
1094
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateIntegerColumn` instead.
1095
+ #
1049
1096
  # Update an integer attribute. Changing the `default` value will not update
1050
1097
  # already existing documents.
1051
1098
  #
1052
1099
  #
1053
1100
  # @param [String] database_id Database ID.
1054
- # @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).
1101
+ # @param [String] collection_id Collection ID.
1055
1102
  # @param [String] key Attribute Key.
1056
1103
  # @param [] required Is attribute required?
1057
- # @param [Integer] default Default value for attribute when not provided. Cannot be set when attribute is required.
1058
- # @param [Integer] min Minimum value to enforce on new documents
1059
- # @param [Integer] max Maximum value to enforce on new documents
1060
- # @param [String] new_key New attribute key.
1104
+ # @param [Integer] default Default value. Cannot be set when attribute is required.
1105
+ # @param [Integer] min Minimum value
1106
+ # @param [Integer] max Maximum value
1107
+ # @param [String] new_key New Attribute Key.
1061
1108
  #
1062
1109
  # @return [AttributeInteger]
1063
1110
  def update_integer_attribute(database_id:, collection_id:, key:, required:, default:, min: nil, max: nil, new_key: nil)
@@ -1107,15 +1154,17 @@ module Appwrite
1107
1154
  )
1108
1155
  end
1109
1156
 
1110
-
1157
+ #
1158
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createIpColumn` instead.
1159
+ #
1111
1160
  # Create IP address attribute.
1112
1161
  #
1113
1162
  #
1114
1163
  # @param [String] database_id Database ID.
1115
- # @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).
1164
+ # @param [String] collection_id Collection ID.
1116
1165
  # @param [String] key Attribute Key.
1117
1166
  # @param [] required Is attribute required?
1118
- # @param [String] default Default value for attribute when not provided. Cannot be set when attribute is required.
1167
+ # @param [String] default Default value. Cannot be set when attribute is required.
1119
1168
  # @param [] array Is attribute an array?
1120
1169
  #
1121
1170
  # @return [AttributeIp]
@@ -1160,17 +1209,19 @@ module Appwrite
1160
1209
  )
1161
1210
  end
1162
1211
 
1163
-
1212
+ #
1213
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateIpColumn` instead.
1214
+ #
1164
1215
  # Update an ip attribute. Changing the `default` value will not update
1165
1216
  # already existing documents.
1166
1217
  #
1167
1218
  #
1168
1219
  # @param [String] database_id Database ID.
1169
- # @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).
1220
+ # @param [String] collection_id Collection ID.
1170
1221
  # @param [String] key Attribute Key.
1171
1222
  # @param [] required Is attribute required?
1172
- # @param [String] default Default value for attribute when not provided. Cannot be set when attribute is required.
1173
- # @param [String] new_key New attribute key.
1223
+ # @param [String] default Default value. Cannot be set when attribute is required.
1224
+ # @param [String] new_key New Attribute Key.
1174
1225
  #
1175
1226
  # @return [AttributeIp]
1176
1227
  def update_ip_attribute(database_id:, collection_id:, key:, required:, default:, new_key: nil)
@@ -1218,14 +1269,16 @@ module Appwrite
1218
1269
  )
1219
1270
  end
1220
1271
 
1221
-
1272
+ #
1273
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRelationshipColumn` instead.
1274
+ #
1222
1275
  # Create relationship attribute. [Learn more about relationship
1223
1276
  # attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
1224
1277
  #
1225
1278
  #
1226
1279
  # @param [String] database_id Database ID.
1227
- # @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).
1228
- # @param [String] related_collection_id Related Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1280
+ # @param [String] collection_id Collection ID.
1281
+ # @param [String] related_collection_id Related Collection ID.
1229
1282
  # @param [RelationshipType] type Relation type
1230
1283
  # @param [] two_way Is Two Way?
1231
1284
  # @param [String] key Attribute Key.
@@ -1276,12 +1329,14 @@ module Appwrite
1276
1329
  )
1277
1330
  end
1278
1331
 
1279
-
1332
+ #
1333
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createStringColumn` instead.
1334
+ #
1280
1335
  # Create a string attribute.
1281
1336
  #
1282
1337
  #
1283
1338
  # @param [String] database_id Database ID.
1284
- # @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).
1339
+ # @param [String] collection_id Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1285
1340
  # @param [String] key Attribute Key.
1286
1341
  # @param [Integer] size Attribute size for text attributes, in number of characters.
1287
1342
  # @param [] required Is attribute required?
@@ -1337,18 +1392,20 @@ module Appwrite
1337
1392
  )
1338
1393
  end
1339
1394
 
1340
-
1395
+ #
1396
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateStringColumn` instead.
1397
+ #
1341
1398
  # Update a string attribute. Changing the `default` value will not update
1342
1399
  # already existing documents.
1343
1400
  #
1344
1401
  #
1345
1402
  # @param [String] database_id Database ID.
1346
- # @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).
1403
+ # @param [String] collection_id Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1347
1404
  # @param [String] key Attribute Key.
1348
1405
  # @param [] required Is attribute required?
1349
1406
  # @param [String] default Default value for attribute when not provided. Cannot be set when attribute is required.
1350
1407
  # @param [Integer] size Maximum size of the string attribute.
1351
- # @param [String] new_key New attribute key.
1408
+ # @param [String] new_key New Attribute Key.
1352
1409
  #
1353
1410
  # @return [AttributeString]
1354
1411
  def update_string_attribute(database_id:, collection_id:, key:, required:, default:, size: nil, new_key: nil)
@@ -1397,12 +1454,14 @@ module Appwrite
1397
1454
  )
1398
1455
  end
1399
1456
 
1400
-
1457
+ #
1458
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createUrlColumn` instead.
1459
+ #
1401
1460
  # Create a URL attribute.
1402
1461
  #
1403
1462
  #
1404
1463
  # @param [String] database_id Database ID.
1405
- # @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).
1464
+ # @param [String] collection_id Collection ID.
1406
1465
  # @param [String] key Attribute Key.
1407
1466
  # @param [] required Is attribute required?
1408
1467
  # @param [String] default Default value for attribute when not provided. Cannot be set when attribute is required.
@@ -1450,17 +1509,19 @@ module Appwrite
1450
1509
  )
1451
1510
  end
1452
1511
 
1453
-
1512
+ #
1513
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateUrlColumn` instead.
1514
+ #
1454
1515
  # Update an url attribute. Changing the `default` value will not update
1455
1516
  # already existing documents.
1456
1517
  #
1457
1518
  #
1458
1519
  # @param [String] database_id Database ID.
1459
- # @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).
1520
+ # @param [String] collection_id Collection ID.
1460
1521
  # @param [String] key Attribute Key.
1461
1522
  # @param [] required Is attribute required?
1462
1523
  # @param [String] default Default value for attribute when not provided. Cannot be set when attribute is required.
1463
- # @param [String] new_key New attribute key.
1524
+ # @param [String] new_key New Attribute Key.
1464
1525
  #
1465
1526
  # @return [AttributeUrl]
1466
1527
  def update_url_attribute(database_id:, collection_id:, key:, required:, default:, new_key: nil)
@@ -1508,11 +1569,13 @@ module Appwrite
1508
1569
  )
1509
1570
  end
1510
1571
 
1511
-
1572
+ #
1573
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getColumn` instead.
1574
+ #
1512
1575
  # Get attribute by ID.
1513
1576
  #
1514
1577
  # @param [String] database_id Database ID.
1515
- # @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).
1578
+ # @param [String] collection_id Collection ID.
1516
1579
  # @param [String] key Attribute Key.
1517
1580
  #
1518
1581
  # @return []
@@ -1548,11 +1611,13 @@ module Appwrite
1548
1611
  )
1549
1612
  end
1550
1613
 
1551
-
1614
+ #
1615
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteColumn` instead.
1616
+ #
1552
1617
  # Deletes an attribute.
1553
1618
  #
1554
1619
  # @param [String] database_id Database ID.
1555
- # @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).
1620
+ # @param [String] collection_id Collection ID.
1556
1621
  # @param [String] key Attribute Key.
1557
1622
  #
1558
1623
  # @return []
@@ -1589,16 +1654,18 @@ module Appwrite
1589
1654
  )
1590
1655
  end
1591
1656
 
1592
-
1657
+ #
1658
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRelationshipColumn` instead.
1659
+ #
1593
1660
  # Update relationship attribute. [Learn more about relationship
1594
1661
  # attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
1595
1662
  #
1596
1663
  #
1597
1664
  # @param [String] database_id Database ID.
1598
- # @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).
1665
+ # @param [String] collection_id Collection ID.
1599
1666
  # @param [String] key Attribute Key.
1600
1667
  # @param [RelationMutate] on_delete Constraints option
1601
- # @param [String] new_key New attribute key.
1668
+ # @param [String] new_key New Attribute Key.
1602
1669
  #
1603
1670
  # @return [AttributeRelationship]
1604
1671
  def update_relationship_attribute(database_id:, collection_id:, key:, on_delete: nil, new_key: nil)
@@ -1637,7 +1704,9 @@ module Appwrite
1637
1704
  )
1638
1705
  end
1639
1706
 
1640
-
1707
+ #
1708
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead.
1709
+ #
1641
1710
  # Get a list of all the user's documents in a given collection. You can use
1642
1711
  # the query params to filter your results.
1643
1712
  #
@@ -1675,7 +1744,9 @@ module Appwrite
1675
1744
  )
1676
1745
  end
1677
1746
 
1678
-
1747
+ #
1748
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRow` instead.
1749
+ #
1679
1750
  # Create a new Document. Before using this route, you should create a new
1680
1751
  # collection resource using either a [server
1681
1752
  # integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
@@ -1728,7 +1799,9 @@ module Appwrite
1728
1799
  )
1729
1800
  end
1730
1801
 
1731
-
1802
+ #
1803
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRows` instead.
1804
+ #
1732
1805
  # Create new Documents. Before using this route, you should create a new
1733
1806
  # collection resource using either a [server
1734
1807
  # integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
@@ -1773,7 +1846,9 @@ module Appwrite
1773
1846
  )
1774
1847
  end
1775
1848
 
1776
-
1849
+ #
1850
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRows` instead.
1851
+ #
1777
1852
  # Create or update Documents. Before using this route, you should create a
1778
1853
  # new collection resource using either a [server
1779
1854
  # integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
@@ -1785,7 +1860,7 @@ module Appwrite
1785
1860
  # @param [Array] documents Array of document data as JSON objects. May contain partial documents.
1786
1861
  #
1787
1862
  # @return [DocumentList]
1788
- def upsert_documents(database_id:, collection_id:, documents: nil)
1863
+ def upsert_documents(database_id:, collection_id:, documents:)
1789
1864
  api_path = '/databases/{databaseId}/collections/{collectionId}/documents'
1790
1865
  .gsub('{databaseId}', database_id)
1791
1866
  .gsub('{collectionId}', collection_id)
@@ -1798,6 +1873,10 @@ module Appwrite
1798
1873
  raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
1799
1874
  end
1800
1875
 
1876
+ if documents.nil?
1877
+ raise Appwrite::Exception.new('Missing required parameter: "documents"')
1878
+ end
1879
+
1801
1880
  api_params = {
1802
1881
  documents: documents,
1803
1882
  }
@@ -1815,7 +1894,9 @@ module Appwrite
1815
1894
  )
1816
1895
  end
1817
1896
 
1818
-
1897
+ #
1898
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRows` instead.
1899
+ #
1819
1900
  # Update all documents that match your queries, if no queries are submitted
1820
1901
  # then all documents are updated. You can pass only specific fields to be
1821
1902
  # updated.
@@ -1857,7 +1938,9 @@ module Appwrite
1857
1938
  )
1858
1939
  end
1859
1940
 
1860
-
1941
+ #
1942
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRows` instead.
1943
+ #
1861
1944
  # Bulk delete documents using queries, if no queries are passed then all
1862
1945
  # documents are deleted.
1863
1946
  #
@@ -1896,7 +1979,9 @@ module Appwrite
1896
1979
  )
1897
1980
  end
1898
1981
 
1899
-
1982
+ #
1983
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getRow` instead.
1984
+ #
1900
1985
  # Get a document by its unique ID. This endpoint response returns a JSON
1901
1986
  # object with the document data.
1902
1987
  #
@@ -1940,7 +2025,64 @@ module Appwrite
1940
2025
  )
1941
2026
  end
1942
2027
 
1943
-
2028
+ #
2029
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRow` instead.
2030
+ #
2031
+ # Create or update a Document. Before using this route, you should create a
2032
+ # new collection resource using either a [server
2033
+ # integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
2034
+ # API or directly from your database console.
2035
+ #
2036
+ # @param [String] database_id Database ID.
2037
+ # @param [String] collection_id Collection ID.
2038
+ # @param [String] document_id Document ID.
2039
+ # @param [Hash] data Document data as JSON object. Include all required attributes of the document to be created or updated.
2040
+ # @param [Array] permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
2041
+ #
2042
+ # @return [Document]
2043
+ def upsert_document(database_id:, collection_id:, document_id:, data:, permissions: nil)
2044
+ api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'
2045
+ .gsub('{databaseId}', database_id)
2046
+ .gsub('{collectionId}', collection_id)
2047
+ .gsub('{documentId}', document_id)
2048
+
2049
+ if database_id.nil?
2050
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
2051
+ end
2052
+
2053
+ if collection_id.nil?
2054
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
2055
+ end
2056
+
2057
+ if document_id.nil?
2058
+ raise Appwrite::Exception.new('Missing required parameter: "documentId"')
2059
+ end
2060
+
2061
+ if data.nil?
2062
+ raise Appwrite::Exception.new('Missing required parameter: "data"')
2063
+ end
2064
+
2065
+ api_params = {
2066
+ data: data,
2067
+ permissions: permissions,
2068
+ }
2069
+
2070
+ api_headers = {
2071
+ "content-type": 'application/json',
2072
+ }
2073
+
2074
+ @client.call(
2075
+ method: 'PUT',
2076
+ path: api_path,
2077
+ headers: api_headers,
2078
+ params: api_params,
2079
+ response_type: Models::Document
2080
+ )
2081
+ end
2082
+
2083
+ #
2084
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRow` instead.
2085
+ #
1944
2086
  # Update a document by its unique ID. Using the patch method you can pass
1945
2087
  # only specific fields that will get updated.
1946
2088
  #
@@ -1987,7 +2129,9 @@ module Appwrite
1987
2129
  )
1988
2130
  end
1989
2131
 
1990
-
2132
+ #
2133
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRow` instead.
2134
+ #
1991
2135
  # Delete a document by its unique ID.
1992
2136
  #
1993
2137
  # @param [String] database_id Database ID.
@@ -2028,7 +2172,117 @@ module Appwrite
2028
2172
  )
2029
2173
  end
2030
2174
 
2031
-
2175
+ #
2176
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.decrementRowColumn` instead.
2177
+ #
2178
+ # Decrement a specific attribute of a document by a given value.
2179
+ #
2180
+ # @param [String] database_id Database ID.
2181
+ # @param [String] collection_id Collection ID.
2182
+ # @param [String] document_id Document ID.
2183
+ # @param [String] attribute Attribute key.
2184
+ # @param [Float] value Value to increment the attribute by. The value must be a number.
2185
+ # @param [Float] min Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.
2186
+ #
2187
+ # @return [Document]
2188
+ def decrement_document_attribute(database_id:, collection_id:, document_id:, attribute:, value: nil, min: nil)
2189
+ api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement'
2190
+ .gsub('{databaseId}', database_id)
2191
+ .gsub('{collectionId}', collection_id)
2192
+ .gsub('{documentId}', document_id)
2193
+ .gsub('{attribute}', attribute)
2194
+
2195
+ if database_id.nil?
2196
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
2197
+ end
2198
+
2199
+ if collection_id.nil?
2200
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
2201
+ end
2202
+
2203
+ if document_id.nil?
2204
+ raise Appwrite::Exception.new('Missing required parameter: "documentId"')
2205
+ end
2206
+
2207
+ if attribute.nil?
2208
+ raise Appwrite::Exception.new('Missing required parameter: "attribute"')
2209
+ end
2210
+
2211
+ api_params = {
2212
+ value: value,
2213
+ min: min,
2214
+ }
2215
+
2216
+ api_headers = {
2217
+ "content-type": 'application/json',
2218
+ }
2219
+
2220
+ @client.call(
2221
+ method: 'PATCH',
2222
+ path: api_path,
2223
+ headers: api_headers,
2224
+ params: api_params,
2225
+ response_type: Models::Document
2226
+ )
2227
+ end
2228
+
2229
+ #
2230
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.incrementRowColumn` instead.
2231
+ #
2232
+ # Increment a specific attribute of a document by a given value.
2233
+ #
2234
+ # @param [String] database_id Database ID.
2235
+ # @param [String] collection_id Collection ID.
2236
+ # @param [String] document_id Document ID.
2237
+ # @param [String] attribute Attribute key.
2238
+ # @param [Float] value Value to increment the attribute by. The value must be a number.
2239
+ # @param [Float] max Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.
2240
+ #
2241
+ # @return [Document]
2242
+ def increment_document_attribute(database_id:, collection_id:, document_id:, attribute:, value: nil, max: nil)
2243
+ api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment'
2244
+ .gsub('{databaseId}', database_id)
2245
+ .gsub('{collectionId}', collection_id)
2246
+ .gsub('{documentId}', document_id)
2247
+ .gsub('{attribute}', attribute)
2248
+
2249
+ if database_id.nil?
2250
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
2251
+ end
2252
+
2253
+ if collection_id.nil?
2254
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
2255
+ end
2256
+
2257
+ if document_id.nil?
2258
+ raise Appwrite::Exception.new('Missing required parameter: "documentId"')
2259
+ end
2260
+
2261
+ if attribute.nil?
2262
+ raise Appwrite::Exception.new('Missing required parameter: "attribute"')
2263
+ end
2264
+
2265
+ api_params = {
2266
+ value: value,
2267
+ max: max,
2268
+ }
2269
+
2270
+ api_headers = {
2271
+ "content-type": 'application/json',
2272
+ }
2273
+
2274
+ @client.call(
2275
+ method: 'PATCH',
2276
+ path: api_path,
2277
+ headers: api_headers,
2278
+ params: api_params,
2279
+ response_type: Models::Document
2280
+ )
2281
+ end
2282
+
2283
+ #
2284
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listIndexes` instead.
2285
+ #
2032
2286
  # List indexes in the collection.
2033
2287
  #
2034
2288
  # @param [String] database_id Database ID.
@@ -2065,7 +2319,9 @@ module Appwrite
2065
2319
  )
2066
2320
  end
2067
2321
 
2068
-
2322
+ #
2323
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createIndex` instead.
2324
+ #
2069
2325
  # Creates an index on the attributes listed. Your index should include all
2070
2326
  # the attributes you will query in a single request.
2071
2327
  # Attributes can be `key`, `fulltext`, and `unique`.
@@ -2125,7 +2381,9 @@ module Appwrite
2125
2381
  )
2126
2382
  end
2127
2383
 
2128
-
2384
+ #
2385
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getIndex` instead.
2386
+ #
2129
2387
  # Get index by ID.
2130
2388
  #
2131
2389
  # @param [String] database_id Database ID.
@@ -2166,7 +2424,9 @@ module Appwrite
2166
2424
  )
2167
2425
  end
2168
2426
 
2169
-
2427
+ #
2428
+ # @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteIndex` instead.
2429
+ #
2170
2430
  # Delete an index.
2171
2431
  #
2172
2432
  # @param [String] database_id Database ID.
@@ -2207,6 +2467,5 @@ module Appwrite
2207
2467
  )
2208
2468
  end
2209
2469
 
2210
-
2211
2470
  end
2212
2471
  end