appwrite 22.0.0 → 23.1.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 (116) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +35 -2
  3. data/lib/appwrite/enums/auth_method.rb +13 -0
  4. data/lib/appwrite/enums/build_runtime.rb +3 -0
  5. data/lib/appwrite/enums/email_template_locale.rb +137 -0
  6. data/lib/appwrite/enums/email_template_type.rb +13 -0
  7. data/lib/appwrite/enums/o_auth_provider.rb +6 -0
  8. data/lib/appwrite/enums/platform_type.rb +11 -0
  9. data/lib/appwrite/enums/project_policy.rb +15 -0
  10. data/lib/appwrite/enums/protocol_id.rb +9 -0
  11. data/lib/appwrite/enums/proxy_resource_type.rb +8 -0
  12. data/lib/appwrite/enums/proxy_rule_deployment_resource_type.rb +8 -0
  13. data/lib/appwrite/enums/proxy_rule_status.rb +9 -0
  14. data/lib/appwrite/enums/runtime.rb +3 -0
  15. data/lib/appwrite/enums/scopes.rb +44 -27
  16. data/lib/appwrite/enums/secure.rb +8 -0
  17. data/lib/appwrite/enums/service_id.rb +23 -0
  18. data/lib/appwrite/enums/status_code.rb +10 -0
  19. data/lib/appwrite/models/attribute_bigint.rb +96 -0
  20. data/lib/appwrite/models/auth_provider.rb +47 -0
  21. data/lib/appwrite/models/billing_limits.rb +62 -0
  22. data/lib/appwrite/models/block.rb +72 -0
  23. data/lib/appwrite/models/column_bigint.rb +96 -0
  24. data/lib/appwrite/models/dev_key.rb +62 -0
  25. data/lib/appwrite/models/email_template.rb +62 -0
  26. data/lib/appwrite/models/email_template_list.rb +32 -0
  27. data/lib/appwrite/models/ephemeral_key.rb +67 -0
  28. data/lib/appwrite/models/key.rb +67 -0
  29. data/lib/appwrite/models/key_list.rb +32 -0
  30. data/lib/appwrite/models/log.rb +5 -0
  31. data/lib/appwrite/models/membership.rb +5 -0
  32. data/lib/appwrite/models/mock_number.rb +42 -0
  33. data/lib/appwrite/models/mock_number_list.rb +32 -0
  34. data/lib/appwrite/models/o_auth2_amazon.rb +42 -0
  35. data/lib/appwrite/models/o_auth2_apple.rb +52 -0
  36. data/lib/appwrite/models/o_auth2_auth0.rb +47 -0
  37. data/lib/appwrite/models/o_auth2_authentik.rb +47 -0
  38. data/lib/appwrite/models/o_auth2_autodesk.rb +42 -0
  39. data/lib/appwrite/models/o_auth2_bitbucket.rb +42 -0
  40. data/lib/appwrite/models/o_auth2_bitly.rb +42 -0
  41. data/lib/appwrite/models/o_auth2_box.rb +42 -0
  42. data/lib/appwrite/models/o_auth2_dailymotion.rb +42 -0
  43. data/lib/appwrite/models/o_auth2_discord.rb +42 -0
  44. data/lib/appwrite/models/o_auth2_disqus.rb +42 -0
  45. data/lib/appwrite/models/o_auth2_dropbox.rb +42 -0
  46. data/lib/appwrite/models/o_auth2_etsy.rb +42 -0
  47. data/lib/appwrite/models/o_auth2_facebook.rb +42 -0
  48. data/lib/appwrite/models/o_auth2_figma.rb +42 -0
  49. data/lib/appwrite/models/o_auth2_fusion_auth.rb +47 -0
  50. data/lib/appwrite/models/o_auth2_github.rb +42 -0
  51. data/lib/appwrite/models/o_auth2_gitlab.rb +47 -0
  52. data/lib/appwrite/models/o_auth2_google.rb +42 -0
  53. data/lib/appwrite/models/o_auth2_keycloak.rb +52 -0
  54. data/lib/appwrite/models/o_auth2_kick.rb +42 -0
  55. data/lib/appwrite/models/o_auth2_linkedin.rb +42 -0
  56. data/lib/appwrite/models/o_auth2_microsoft.rb +47 -0
  57. data/lib/appwrite/models/o_auth2_notion.rb +42 -0
  58. data/lib/appwrite/models/o_auth2_oidc.rb +62 -0
  59. data/lib/appwrite/models/o_auth2_okta.rb +52 -0
  60. data/lib/appwrite/models/o_auth2_paypal.rb +42 -0
  61. data/lib/appwrite/models/o_auth2_podio.rb +42 -0
  62. data/lib/appwrite/models/o_auth2_provider_list.rb +32 -0
  63. data/lib/appwrite/models/o_auth2_salesforce.rb +42 -0
  64. data/lib/appwrite/models/o_auth2_slack.rb +42 -0
  65. data/lib/appwrite/models/o_auth2_spotify.rb +42 -0
  66. data/lib/appwrite/models/o_auth2_stripe.rb +42 -0
  67. data/lib/appwrite/models/o_auth2_tradeshift.rb +42 -0
  68. data/lib/appwrite/models/o_auth2_twitch.rb +42 -0
  69. data/lib/appwrite/models/o_auth2_word_press.rb +42 -0
  70. data/lib/appwrite/models/o_auth2_x.rb +42 -0
  71. data/lib/appwrite/models/o_auth2_yahoo.rb +42 -0
  72. data/lib/appwrite/models/o_auth2_yandex.rb +42 -0
  73. data/lib/appwrite/models/o_auth2_zoho.rb +42 -0
  74. data/lib/appwrite/models/o_auth2_zoom.rb +42 -0
  75. data/lib/appwrite/models/platform_android.rb +71 -0
  76. data/lib/appwrite/models/platform_apple.rb +71 -0
  77. data/lib/appwrite/models/platform_linux.rb +71 -0
  78. data/lib/appwrite/models/platform_list.rb +32 -0
  79. data/lib/appwrite/models/platform_web.rb +71 -0
  80. data/lib/appwrite/models/platform_windows.rb +71 -0
  81. data/lib/appwrite/models/policy_list.rb +32 -0
  82. data/lib/appwrite/models/policy_membership_privacy.rb +52 -0
  83. data/lib/appwrite/models/policy_password_dictionary.rb +32 -0
  84. data/lib/appwrite/models/policy_password_history.rb +32 -0
  85. data/lib/appwrite/models/policy_password_personal_data.rb +32 -0
  86. data/lib/appwrite/models/policy_session_alert.rb +32 -0
  87. data/lib/appwrite/models/policy_session_duration.rb +32 -0
  88. data/lib/appwrite/models/policy_session_invalidation.rb +32 -0
  89. data/lib/appwrite/models/policy_session_limit.rb +32 -0
  90. data/lib/appwrite/models/policy_user_limit.rb +32 -0
  91. data/lib/appwrite/models/project.rb +427 -0
  92. data/lib/appwrite/models/proxy_rule.rb +127 -0
  93. data/lib/appwrite/models/proxy_rule_list.rb +32 -0
  94. data/lib/appwrite/models/webhook.rb +20 -20
  95. data/lib/appwrite/service.rb +1 -1
  96. data/lib/appwrite/services/account.rb +47 -2
  97. data/lib/appwrite/services/activities.rb +3 -1
  98. data/lib/appwrite/services/avatars.rb +9 -1
  99. data/lib/appwrite/services/backups.rb +13 -1
  100. data/lib/appwrite/services/databases.rb +258 -6
  101. data/lib/appwrite/services/functions.rb +40 -8
  102. data/lib/appwrite/services/graphql.rb +5 -3
  103. data/lib/appwrite/services/health.rb +26 -1
  104. data/lib/appwrite/services/locale.rb +9 -1
  105. data/lib/appwrite/services/messaging.rb +49 -1
  106. data/lib/appwrite/services/project.rb +3251 -5
  107. data/lib/appwrite/services/proxy.rb +303 -0
  108. data/lib/appwrite/services/sites.rb +39 -8
  109. data/lib/appwrite/services/storage.rb +14 -1
  110. data/lib/appwrite/services/tables_db.rb +252 -6
  111. data/lib/appwrite/services/teams.rb +14 -1
  112. data/lib/appwrite/services/tokens.rb +6 -1
  113. data/lib/appwrite/services/users.rb +44 -1
  114. data/lib/appwrite/services/webhooks.rb +31 -21
  115. data/lib/appwrite.rb +86 -0
  116. metadata +88 -2
@@ -34,6 +34,7 @@ module Appwrite
34
34
  params: api_params,
35
35
  response_type: Models::DatabaseList
36
36
  )
37
+
37
38
  end
38
39
 
39
40
  # Create a new Database.
@@ -72,6 +73,7 @@ module Appwrite
72
73
  params: api_params,
73
74
  response_type: Models::Database
74
75
  )
76
+
75
77
  end
76
78
 
77
79
  # List transactions across all databases.
@@ -96,6 +98,7 @@ module Appwrite
96
98
  params: api_params,
97
99
  response_type: Models::TransactionList
98
100
  )
101
+
99
102
  end
100
103
 
101
104
  # Create a new transaction.
@@ -121,6 +124,7 @@ module Appwrite
121
124
  params: api_params,
122
125
  response_type: Models::Transaction
123
126
  )
127
+
124
128
  end
125
129
 
126
130
  # Get a transaction by its unique ID.
@@ -149,6 +153,7 @@ module Appwrite
149
153
  params: api_params,
150
154
  response_type: Models::Transaction
151
155
  )
156
+
152
157
  end
153
158
 
154
159
  # Update a transaction, to either commit or roll back its operations.
@@ -182,6 +187,7 @@ module Appwrite
182
187
  params: api_params,
183
188
  response_type: Models::Transaction
184
189
  )
190
+
185
191
  end
186
192
 
187
193
  # Delete a transaction by its unique ID.
@@ -210,6 +216,7 @@ module Appwrite
210
216
  headers: api_headers,
211
217
  params: api_params,
212
218
  )
219
+
213
220
  end
214
221
 
215
222
  # Create multiple operations in a single transaction.
@@ -241,6 +248,7 @@ module Appwrite
241
248
  params: api_params,
242
249
  response_type: Models::Transaction
243
250
  )
251
+
244
252
  end
245
253
 
246
254
  # Get a database by its unique ID. This endpoint response returns a JSON
@@ -270,6 +278,7 @@ module Appwrite
270
278
  params: api_params,
271
279
  response_type: Models::Database
272
280
  )
281
+
273
282
  end
274
283
 
275
284
  # Update a database by its unique ID.
@@ -303,6 +312,7 @@ module Appwrite
303
312
  params: api_params,
304
313
  response_type: Models::Database
305
314
  )
315
+
306
316
  end
307
317
 
308
318
  # Delete a database by its unique ID. Only API keys with with databases.write
@@ -332,6 +342,7 @@ module Appwrite
332
342
  headers: api_headers,
333
343
  params: api_params,
334
344
  )
345
+
335
346
  end
336
347
 
337
348
  # Get a list of all tables that belong to the provided databaseId. You can
@@ -367,6 +378,7 @@ module Appwrite
367
378
  params: api_params,
368
379
  response_type: Models::TableList
369
380
  )
381
+
370
382
  end
371
383
 
372
384
  # Create a new Table. Before using this route, you should create a new
@@ -421,6 +433,7 @@ module Appwrite
421
433
  params: api_params,
422
434
  response_type: Models::Table
423
435
  )
436
+
424
437
  end
425
438
 
426
439
  # Get a table by its unique ID. This endpoint response returns a JSON object
@@ -456,6 +469,7 @@ module Appwrite
456
469
  params: api_params,
457
470
  response_type: Models::Table
458
471
  )
472
+
459
473
  end
460
474
 
461
475
  # Update a table by its unique ID.
@@ -466,9 +480,10 @@ module Appwrite
466
480
  # @param [Array] permissions An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
467
481
  # @param [] row_security Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).
468
482
  # @param [] enabled Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.
483
+ # @param [] purge When true, purge all cached list responses for this table as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire.
469
484
  #
470
485
  # @return [Table]
471
- def update_table(database_id:, table_id:, name: nil, permissions: nil, row_security: nil, enabled: nil)
486
+ def update_table(database_id:, table_id:, name: nil, permissions: nil, row_security: nil, enabled: nil, purge: nil)
472
487
  api_path = '/tablesdb/{databaseId}/tables/{tableId}'
473
488
  .gsub('{databaseId}', database_id)
474
489
  .gsub('{tableId}', table_id)
@@ -486,6 +501,7 @@ module Appwrite
486
501
  permissions: permissions,
487
502
  rowSecurity: row_security,
488
503
  enabled: enabled,
504
+ purge: purge,
489
505
  }
490
506
 
491
507
  api_headers = {
@@ -499,6 +515,7 @@ module Appwrite
499
515
  params: api_params,
500
516
  response_type: Models::Table
501
517
  )
518
+
502
519
  end
503
520
 
504
521
  # Delete a table by its unique ID. Only users with write permissions have
@@ -534,6 +551,7 @@ module Appwrite
534
551
  headers: api_headers,
535
552
  params: api_params,
536
553
  )
554
+
537
555
  end
538
556
 
539
557
  # List columns in the table.
@@ -572,6 +590,127 @@ module Appwrite
572
590
  params: api_params,
573
591
  response_type: Models::ColumnList
574
592
  )
593
+
594
+ end
595
+
596
+ # Create a bigint column. Optionally, minimum and maximum values can be
597
+ # provided.
598
+ #
599
+ #
600
+ # @param [String] database_id Database ID.
601
+ # @param [String] table_id Table ID.
602
+ # @param [String] key Column Key.
603
+ # @param [] required Is column required?
604
+ # @param [Integer] min Minimum value
605
+ # @param [Integer] max Maximum value
606
+ # @param [Integer] default Default value. Cannot be set when column is required.
607
+ # @param [] array Is column an array?
608
+ #
609
+ # @return [ColumnBigint]
610
+ def create_big_int_column(database_id:, table_id:, key:, required:, min: nil, max: nil, default: nil, array: nil)
611
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/bigint'
612
+ .gsub('{databaseId}', database_id)
613
+ .gsub('{tableId}', table_id)
614
+
615
+ if database_id.nil?
616
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
617
+ end
618
+
619
+ if table_id.nil?
620
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
621
+ end
622
+
623
+ if key.nil?
624
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
625
+ end
626
+
627
+ if required.nil?
628
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
629
+ end
630
+
631
+ api_params = {
632
+ key: key,
633
+ required: required,
634
+ min: min,
635
+ max: max,
636
+ default: default,
637
+ array: array,
638
+ }
639
+
640
+ api_headers = {
641
+ "content-type": 'application/json',
642
+ }
643
+
644
+ @client.call(
645
+ method: 'POST',
646
+ path: api_path,
647
+ headers: api_headers,
648
+ params: api_params,
649
+ response_type: Models::ColumnBigint
650
+ )
651
+
652
+ end
653
+
654
+ # Update a bigint column. Changing the `default` value will not update
655
+ # already existing rows.
656
+ #
657
+ #
658
+ # @param [String] database_id Database ID.
659
+ # @param [String] table_id Table ID.
660
+ # @param [String] key Column Key.
661
+ # @param [] required Is column required?
662
+ # @param [Integer] default Default value. Cannot be set when column is required.
663
+ # @param [Integer] min Minimum value
664
+ # @param [Integer] max Maximum value
665
+ # @param [String] new_key New Column Key.
666
+ #
667
+ # @return [ColumnBigint]
668
+ def update_big_int_column(database_id:, table_id:, key:, required:, default:, min: nil, max: nil, new_key: nil)
669
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/bigint/{key}'
670
+ .gsub('{databaseId}', database_id)
671
+ .gsub('{tableId}', table_id)
672
+ .gsub('{key}', key)
673
+
674
+ if database_id.nil?
675
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
676
+ end
677
+
678
+ if table_id.nil?
679
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
680
+ end
681
+
682
+ if key.nil?
683
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
684
+ end
685
+
686
+ if required.nil?
687
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
688
+ end
689
+
690
+ if default.nil?
691
+ raise Appwrite::Exception.new('Missing required parameter: "default"')
692
+ end
693
+
694
+ api_params = {
695
+ required: required,
696
+ min: min,
697
+ max: max,
698
+ default: default,
699
+ newKey: new_key,
700
+ }
701
+
702
+ api_headers = {
703
+ "content-type": 'application/json',
704
+ }
705
+
706
+ @client.call(
707
+ method: 'PATCH',
708
+ path: api_path,
709
+ headers: api_headers,
710
+ params: api_params,
711
+ response_type: Models::ColumnBigint
712
+ )
713
+
575
714
  end
576
715
 
577
716
  # Create a boolean column.
@@ -624,6 +763,7 @@ module Appwrite
624
763
  params: api_params,
625
764
  response_type: Models::ColumnBoolean
626
765
  )
766
+
627
767
  end
628
768
 
629
769
  # Update a boolean column. Changing the `default` value will not update
@@ -680,6 +820,7 @@ module Appwrite
680
820
  params: api_params,
681
821
  response_type: Models::ColumnBoolean
682
822
  )
823
+
683
824
  end
684
825
 
685
826
  # Create a date time column according to the ISO 8601 standard.
@@ -731,6 +872,7 @@ module Appwrite
731
872
  params: api_params,
732
873
  response_type: Models::ColumnDatetime
733
874
  )
875
+
734
876
  end
735
877
 
736
878
  # Update a date time column. Changing the `default` value will not update
@@ -787,6 +929,7 @@ module Appwrite
787
929
  params: api_params,
788
930
  response_type: Models::ColumnDatetime
789
931
  )
932
+
790
933
  end
791
934
 
792
935
  # Create an email column.
@@ -839,6 +982,7 @@ module Appwrite
839
982
  params: api_params,
840
983
  response_type: Models::ColumnEmail
841
984
  )
985
+
842
986
  end
843
987
 
844
988
  # Update an email column. Changing the `default` value will not update
@@ -896,6 +1040,7 @@ module Appwrite
896
1040
  params: api_params,
897
1041
  response_type: Models::ColumnEmail
898
1042
  )
1043
+
899
1044
  end
900
1045
 
901
1046
  # Create an enumeration column. The `elements` param acts as a white-list of
@@ -954,6 +1099,7 @@ module Appwrite
954
1099
  params: api_params,
955
1100
  response_type: Models::ColumnEnum
956
1101
  )
1102
+
957
1103
  end
958
1104
 
959
1105
  # Update an enum column. Changing the `default` value will not update already
@@ -1017,6 +1163,7 @@ module Appwrite
1017
1163
  params: api_params,
1018
1164
  response_type: Models::ColumnEnum
1019
1165
  )
1166
+
1020
1167
  end
1021
1168
 
1022
1169
  # Create a float column. Optionally, minimum and maximum values can be
@@ -1074,6 +1221,7 @@ module Appwrite
1074
1221
  params: api_params,
1075
1222
  response_type: Models::ColumnFloat
1076
1223
  )
1224
+
1077
1225
  end
1078
1226
 
1079
1227
  # Update a float column. Changing the `default` value will not update already
@@ -1135,6 +1283,7 @@ module Appwrite
1135
1283
  params: api_params,
1136
1284
  response_type: Models::ColumnFloat
1137
1285
  )
1286
+
1138
1287
  end
1139
1288
 
1140
1289
  # Create an integer column. Optionally, minimum and maximum values can be
@@ -1192,6 +1341,7 @@ module Appwrite
1192
1341
  params: api_params,
1193
1342
  response_type: Models::ColumnInteger
1194
1343
  )
1344
+
1195
1345
  end
1196
1346
 
1197
1347
  # Update an integer column. Changing the `default` value will not update
@@ -1253,6 +1403,7 @@ module Appwrite
1253
1403
  params: api_params,
1254
1404
  response_type: Models::ColumnInteger
1255
1405
  )
1406
+
1256
1407
  end
1257
1408
 
1258
1409
  # Create IP address column.
@@ -1305,6 +1456,7 @@ module Appwrite
1305
1456
  params: api_params,
1306
1457
  response_type: Models::ColumnIp
1307
1458
  )
1459
+
1308
1460
  end
1309
1461
 
1310
1462
  # Update an ip column. Changing the `default` value will not update already
@@ -1362,6 +1514,7 @@ module Appwrite
1362
1514
  params: api_params,
1363
1515
  response_type: Models::ColumnIp
1364
1516
  )
1517
+
1365
1518
  end
1366
1519
 
1367
1520
  # Create a geometric line column.
@@ -1411,6 +1564,7 @@ module Appwrite
1411
1564
  params: api_params,
1412
1565
  response_type: Models::ColumnLine
1413
1566
  )
1567
+
1414
1568
  end
1415
1569
 
1416
1570
  # Update a line column. Changing the `default` value will not update already
@@ -1463,6 +1617,7 @@ module Appwrite
1463
1617
  params: api_params,
1464
1618
  response_type: Models::ColumnLine
1465
1619
  )
1620
+
1466
1621
  end
1467
1622
 
1468
1623
  # Create a longtext column.
@@ -1517,6 +1672,7 @@ module Appwrite
1517
1672
  params: api_params,
1518
1673
  response_type: Models::ColumnLongtext
1519
1674
  )
1675
+
1520
1676
  end
1521
1677
 
1522
1678
  # Update a longtext column. Changing the `default` value will not update
@@ -1574,6 +1730,7 @@ module Appwrite
1574
1730
  params: api_params,
1575
1731
  response_type: Models::ColumnLongtext
1576
1732
  )
1733
+
1577
1734
  end
1578
1735
 
1579
1736
  # Create a mediumtext column.
@@ -1628,6 +1785,7 @@ module Appwrite
1628
1785
  params: api_params,
1629
1786
  response_type: Models::ColumnMediumtext
1630
1787
  )
1788
+
1631
1789
  end
1632
1790
 
1633
1791
  # Update a mediumtext column. Changing the `default` value will not update
@@ -1685,6 +1843,7 @@ module Appwrite
1685
1843
  params: api_params,
1686
1844
  response_type: Models::ColumnMediumtext
1687
1845
  )
1846
+
1688
1847
  end
1689
1848
 
1690
1849
  # Create a geometric point column.
@@ -1734,6 +1893,7 @@ module Appwrite
1734
1893
  params: api_params,
1735
1894
  response_type: Models::ColumnPoint
1736
1895
  )
1896
+
1737
1897
  end
1738
1898
 
1739
1899
  # Update a point column. Changing the `default` value will not update already
@@ -1786,6 +1946,7 @@ module Appwrite
1786
1946
  params: api_params,
1787
1947
  response_type: Models::ColumnPoint
1788
1948
  )
1949
+
1789
1950
  end
1790
1951
 
1791
1952
  # Create a geometric polygon column.
@@ -1835,6 +1996,7 @@ module Appwrite
1835
1996
  params: api_params,
1836
1997
  response_type: Models::ColumnPolygon
1837
1998
  )
1999
+
1838
2000
  end
1839
2001
 
1840
2002
  # Update a polygon column. Changing the `default` value will not update
@@ -1887,6 +2049,7 @@ module Appwrite
1887
2049
  params: api_params,
1888
2050
  response_type: Models::ColumnPolygon
1889
2051
  )
2052
+
1890
2053
  end
1891
2054
 
1892
2055
  # Create relationship column. [Learn more about relationship
@@ -1944,6 +2107,7 @@ module Appwrite
1944
2107
  params: api_params,
1945
2108
  response_type: Models::ColumnRelationship
1946
2109
  )
2110
+
1947
2111
  end
1948
2112
 
1949
2113
  #
@@ -2007,6 +2171,7 @@ module Appwrite
2007
2171
  params: api_params,
2008
2172
  response_type: Models::ColumnString
2009
2173
  )
2174
+
2010
2175
  end
2011
2176
 
2012
2177
  #
@@ -2069,6 +2234,7 @@ module Appwrite
2069
2234
  params: api_params,
2070
2235
  response_type: Models::ColumnString
2071
2236
  )
2237
+
2072
2238
  end
2073
2239
 
2074
2240
  # Create a text column.
@@ -2123,6 +2289,7 @@ module Appwrite
2123
2289
  params: api_params,
2124
2290
  response_type: Models::ColumnText
2125
2291
  )
2292
+
2126
2293
  end
2127
2294
 
2128
2295
  # Update a text column. Changing the `default` value will not update already
@@ -2180,6 +2347,7 @@ module Appwrite
2180
2347
  params: api_params,
2181
2348
  response_type: Models::ColumnText
2182
2349
  )
2350
+
2183
2351
  end
2184
2352
 
2185
2353
  # Create a URL column.
@@ -2232,6 +2400,7 @@ module Appwrite
2232
2400
  params: api_params,
2233
2401
  response_type: Models::ColumnUrl
2234
2402
  )
2403
+
2235
2404
  end
2236
2405
 
2237
2406
  # Update an url column. Changing the `default` value will not update already
@@ -2289,6 +2458,7 @@ module Appwrite
2289
2458
  params: api_params,
2290
2459
  response_type: Models::ColumnUrl
2291
2460
  )
2461
+
2292
2462
  end
2293
2463
 
2294
2464
  # Create a varchar column.
@@ -2349,6 +2519,7 @@ module Appwrite
2349
2519
  params: api_params,
2350
2520
  response_type: Models::ColumnVarchar
2351
2521
  )
2522
+
2352
2523
  end
2353
2524
 
2354
2525
  # Update a varchar column. Changing the `default` value will not update
@@ -2408,6 +2579,7 @@ module Appwrite
2408
2579
  params: api_params,
2409
2580
  response_type: Models::ColumnVarchar
2410
2581
  )
2582
+
2411
2583
  end
2412
2584
 
2413
2585
  # Get column by ID.
@@ -2416,7 +2588,7 @@ module Appwrite
2416
2588
  # @param [String] table_id Table ID.
2417
2589
  # @param [String] key Column Key.
2418
2590
  #
2419
- # @return []
2591
+ # @return [ColumnBoolean, ColumnInteger, ColumnFloat, ColumnEmail, ColumnEnum, ColumnUrl, ColumnIp, ColumnDatetime, ColumnRelationship, ColumnString]
2420
2592
  def get_column(database_id:, table_id:, key:)
2421
2593
  api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}'
2422
2594
  .gsub('{databaseId}', database_id)
@@ -2441,13 +2613,69 @@ module Appwrite
2441
2613
  api_headers = {
2442
2614
  }
2443
2615
 
2444
- @client.call(
2616
+ response = @client.call(
2445
2617
  method: 'GET',
2446
2618
  path: api_path,
2447
2619
  headers: api_headers,
2448
2620
  params: api_params,
2449
- response_type: Models::ColumnBoolean
2450
2621
  )
2622
+
2623
+ unless response.is_a?(Hash)
2624
+ raise Exception, "Expected object response when hydrating a response model"
2625
+ end
2626
+
2627
+ if response['type'] == 'string' && response['format'] == 'email'
2628
+
2629
+ return Models::ColumnEmail.from(map: response)
2630
+ end
2631
+
2632
+ if response['type'] == 'string' && response['format'] == 'enum'
2633
+
2634
+ return Models::ColumnEnum.from(map: response)
2635
+ end
2636
+
2637
+ if response['type'] == 'string' && response['format'] == 'url'
2638
+
2639
+ return Models::ColumnUrl.from(map: response)
2640
+ end
2641
+
2642
+ if response['type'] == 'string' && response['format'] == 'ip'
2643
+
2644
+ return Models::ColumnIp.from(map: response)
2645
+ end
2646
+
2647
+ if response['type'] == 'boolean'
2648
+
2649
+ return Models::ColumnBoolean.from(map: response)
2650
+ end
2651
+
2652
+ if response['type'] == 'integer'
2653
+
2654
+ return Models::ColumnInteger.from(map: response)
2655
+ end
2656
+
2657
+ if response['type'] == 'double'
2658
+
2659
+ return Models::ColumnFloat.from(map: response)
2660
+ end
2661
+
2662
+ if response['type'] == 'datetime'
2663
+
2664
+ return Models::ColumnDatetime.from(map: response)
2665
+ end
2666
+
2667
+ if response['type'] == 'relationship'
2668
+
2669
+ return Models::ColumnRelationship.from(map: response)
2670
+ end
2671
+
2672
+ if response['type'] == 'string'
2673
+
2674
+ return Models::ColumnString.from(map: response)
2675
+ end
2676
+
2677
+ raise Exception, "Unable to match response to any expected response model"
2678
+
2451
2679
  end
2452
2680
 
2453
2681
  # Deletes a column.
@@ -2488,6 +2716,7 @@ module Appwrite
2488
2716
  headers: api_headers,
2489
2717
  params: api_params,
2490
2718
  )
2719
+
2491
2720
  end
2492
2721
 
2493
2722
  # Update relationship column. [Learn more about relationship
@@ -2535,6 +2764,7 @@ module Appwrite
2535
2764
  params: api_params,
2536
2765
  response_type: Models::ColumnRelationship
2537
2766
  )
2767
+
2538
2768
  end
2539
2769
 
2540
2770
  # List indexes on the table.
@@ -2573,6 +2803,7 @@ module Appwrite
2573
2803
  params: api_params,
2574
2804
  response_type: Models::ColumnIndexList
2575
2805
  )
2806
+
2576
2807
  end
2577
2808
 
2578
2809
  # Creates an index on the columns listed. Your index should include all the
@@ -2632,6 +2863,7 @@ module Appwrite
2632
2863
  params: api_params,
2633
2864
  response_type: Models::ColumnIndex
2634
2865
  )
2866
+
2635
2867
  end
2636
2868
 
2637
2869
  # Get index by ID.
@@ -2672,6 +2904,7 @@ module Appwrite
2672
2904
  params: api_params,
2673
2905
  response_type: Models::ColumnIndex
2674
2906
  )
2907
+
2675
2908
  end
2676
2909
 
2677
2910
  # Delete an index.
@@ -2712,6 +2945,7 @@ module Appwrite
2712
2945
  headers: api_headers,
2713
2946
  params: api_params,
2714
2947
  )
2948
+
2715
2949
  end
2716
2950
 
2717
2951
  # Get a list of all the user's rows in a given table. You can use the query
@@ -2722,7 +2956,7 @@ module Appwrite
2722
2956
  # @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.
2723
2957
  # @param [String] transaction_id Transaction ID to read uncommitted changes within the transaction.
2724
2958
  # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
2725
- # @param [Integer] ttl TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
2959
+ # @param [Integer] ttl TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).
2726
2960
  #
2727
2961
  # @return [RowList]
2728
2962
  def list_rows(database_id:, table_id:, queries: nil, transaction_id: nil, total: nil, ttl: nil)
@@ -2755,6 +2989,7 @@ module Appwrite
2755
2989
  params: api_params,
2756
2990
  response_type: Models::RowList
2757
2991
  )
2992
+
2758
2993
  end
2759
2994
 
2760
2995
  # Create a new Row. Before using this route, you should create a new table
@@ -2809,6 +3044,7 @@ module Appwrite
2809
3044
  params: api_params,
2810
3045
  response_type: Models::Row
2811
3046
  )
3047
+
2812
3048
  end
2813
3049
 
2814
3050
  # Create new Rows. Before using this route, you should create a new table
@@ -2855,6 +3091,7 @@ module Appwrite
2855
3091
  params: api_params,
2856
3092
  response_type: Models::RowList
2857
3093
  )
3094
+
2858
3095
  end
2859
3096
 
2860
3097
  # Create or update Rows. Before using this route, you should create a new
@@ -2902,6 +3139,7 @@ module Appwrite
2902
3139
  params: api_params,
2903
3140
  response_type: Models::RowList
2904
3141
  )
3142
+
2905
3143
  end
2906
3144
 
2907
3145
  # Update all rows that match your queries, if no queries are submitted then
@@ -2944,6 +3182,7 @@ module Appwrite
2944
3182
  params: api_params,
2945
3183
  response_type: Models::RowList
2946
3184
  )
3185
+
2947
3186
  end
2948
3187
 
2949
3188
  # Bulk delete rows using queries, if no queries are passed then all rows are
@@ -2984,6 +3223,7 @@ module Appwrite
2984
3223
  params: api_params,
2985
3224
  response_type: Models::RowList
2986
3225
  )
3226
+
2987
3227
  end
2988
3228
 
2989
3229
  # Get a row by its unique ID. This endpoint response returns a JSON object
@@ -3029,6 +3269,7 @@ module Appwrite
3029
3269
  params: api_params,
3030
3270
  response_type: Models::Row
3031
3271
  )
3272
+
3032
3273
  end
3033
3274
 
3034
3275
  # Create or update a Row. Before using this route, you should create a new
@@ -3079,6 +3320,7 @@ module Appwrite
3079
3320
  params: api_params,
3080
3321
  response_type: Models::Row
3081
3322
  )
3323
+
3082
3324
  end
3083
3325
 
3084
3326
  # Update a row by its unique ID. Using the patch method you can pass only
@@ -3127,6 +3369,7 @@ module Appwrite
3127
3369
  params: api_params,
3128
3370
  response_type: Models::Row
3129
3371
  )
3372
+
3130
3373
  end
3131
3374
 
3132
3375
  # Delete a row by its unique ID.
@@ -3169,6 +3412,7 @@ module Appwrite
3169
3412
  headers: api_headers,
3170
3413
  params: api_params,
3171
3414
  )
3415
+
3172
3416
  end
3173
3417
 
3174
3418
  # Decrement a specific column of a row by a given value.
@@ -3222,6 +3466,7 @@ module Appwrite
3222
3466
  params: api_params,
3223
3467
  response_type: Models::Row
3224
3468
  )
3469
+
3225
3470
  end
3226
3471
 
3227
3472
  # Increment a specific column of a row by a given value.
@@ -3275,7 +3520,8 @@ module Appwrite
3275
3520
  params: api_params,
3276
3521
  response_type: Models::Row
3277
3522
  )
3523
+
3278
3524
  end
3279
3525
 
3280
3526
  end
3281
- end
3527
+ end