appwrite 16.1.0 → 18.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 (48) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +2 -2
  3. data/lib/appwrite/enums/credit_card.rb +1 -1
  4. data/lib/appwrite/enums/execution_method.rb +1 -0
  5. data/lib/appwrite/enums/index_type.rb +1 -0
  6. data/lib/appwrite/models/attribute_line.rb +67 -0
  7. data/lib/appwrite/models/attribute_point.rb +67 -0
  8. data/lib/appwrite/models/attribute_polygon.rb +67 -0
  9. data/lib/appwrite/models/column_boolean.rb +67 -0
  10. data/lib/appwrite/models/column_datetime.rb +72 -0
  11. data/lib/appwrite/models/column_email.rb +72 -0
  12. data/lib/appwrite/models/column_enum.rb +77 -0
  13. data/lib/appwrite/models/column_float.rb +77 -0
  14. data/lib/appwrite/models/column_index.rb +72 -0
  15. data/lib/appwrite/models/column_index_list.rb +32 -0
  16. data/lib/appwrite/models/column_integer.rb +77 -0
  17. data/lib/appwrite/models/column_ip.rb +72 -0
  18. data/lib/appwrite/models/column_line.rb +67 -0
  19. data/lib/appwrite/models/column_list.rb +32 -0
  20. data/lib/appwrite/models/column_point.rb +67 -0
  21. data/lib/appwrite/models/column_polygon.rb +67 -0
  22. data/lib/appwrite/models/column_relationship.rb +92 -0
  23. data/lib/appwrite/models/column_string.rb +77 -0
  24. data/lib/appwrite/models/column_url.rb +72 -0
  25. data/lib/appwrite/models/database.rb +8 -3
  26. data/lib/appwrite/models/execution.rb +5 -0
  27. data/lib/appwrite/models/index.rb +18 -13
  28. data/lib/appwrite/models/row.rb +66 -0
  29. data/lib/appwrite/models/row_list.rb +36 -0
  30. data/lib/appwrite/models/table.rb +72 -0
  31. data/lib/appwrite/models/table_list.rb +32 -0
  32. data/lib/appwrite/query.rb +92 -0
  33. data/lib/appwrite/services/account.rb +15 -48
  34. data/lib/appwrite/services/avatars.rb +1 -8
  35. data/lib/appwrite/services/databases.rb +519 -120
  36. data/lib/appwrite/services/functions.rb +1 -27
  37. data/lib/appwrite/services/graphql.rb +0 -2
  38. data/lib/appwrite/services/health.rb +0 -22
  39. data/lib/appwrite/services/locale.rb +0 -8
  40. data/lib/appwrite/services/messaging.rb +0 -46
  41. data/lib/appwrite/services/sites.rb +0 -25
  42. data/lib/appwrite/services/storage.rb +0 -13
  43. data/lib/appwrite/services/tables_db.rb +2621 -0
  44. data/lib/appwrite/services/teams.rb +0 -13
  45. data/lib/appwrite/services/tokens.rb +0 -5
  46. data/lib/appwrite/services/users.rb +0 -42
  47. data/lib/appwrite.rb +24 -0
  48. metadata +26 -2
@@ -0,0 +1,2621 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ class TablesDB < Service
5
+
6
+ def initialize(client)
7
+ @client = client
8
+ end
9
+
10
+ # Get a list of all databases from the current Appwrite project. You can use
11
+ # the search parameter to filter your results.
12
+ #
13
+ # @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 columns: name
14
+ # @param [String] search Search term to filter your list results. Max length: 256 chars.
15
+ #
16
+ # @return [DatabaseList]
17
+ def list(queries: nil, search: nil)
18
+ api_path = '/tablesdb'
19
+
20
+ api_params = {
21
+ queries: queries,
22
+ search: search,
23
+ }
24
+
25
+ api_headers = {
26
+ }
27
+
28
+ @client.call(
29
+ method: 'GET',
30
+ path: api_path,
31
+ headers: api_headers,
32
+ params: api_params,
33
+ response_type: Models::DatabaseList
34
+ )
35
+ end
36
+
37
+ # Create a new Database.
38
+ #
39
+ #
40
+ # @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.
41
+ # @param [String] name Database name. Max length: 128 chars.
42
+ # @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.
43
+ #
44
+ # @return [Database]
45
+ def create(database_id:, name:, enabled: nil)
46
+ api_path = '/tablesdb'
47
+
48
+ if database_id.nil?
49
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
50
+ end
51
+
52
+ if name.nil?
53
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
54
+ end
55
+
56
+ api_params = {
57
+ databaseId: database_id,
58
+ name: name,
59
+ enabled: enabled,
60
+ }
61
+
62
+ api_headers = {
63
+ "content-type": 'application/json',
64
+ }
65
+
66
+ @client.call(
67
+ method: 'POST',
68
+ path: api_path,
69
+ headers: api_headers,
70
+ params: api_params,
71
+ response_type: Models::Database
72
+ )
73
+ end
74
+
75
+ # Get a database by its unique ID. This endpoint response returns a JSON
76
+ # object with the database metadata.
77
+ #
78
+ # @param [String] database_id Database ID.
79
+ #
80
+ # @return [Database]
81
+ def get(database_id:)
82
+ api_path = '/tablesdb/{databaseId}'
83
+ .gsub('{databaseId}', database_id)
84
+
85
+ if database_id.nil?
86
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
87
+ end
88
+
89
+ api_params = {
90
+ }
91
+
92
+ api_headers = {
93
+ }
94
+
95
+ @client.call(
96
+ method: 'GET',
97
+ path: api_path,
98
+ headers: api_headers,
99
+ params: api_params,
100
+ response_type: Models::Database
101
+ )
102
+ end
103
+
104
+ # Update a database by its unique ID.
105
+ #
106
+ # @param [String] database_id Database ID.
107
+ # @param [String] name Database name. Max length: 128 chars.
108
+ # @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.
109
+ #
110
+ # @return [Database]
111
+ def update(database_id:, name:, enabled: nil)
112
+ api_path = '/tablesdb/{databaseId}'
113
+ .gsub('{databaseId}', database_id)
114
+
115
+ if database_id.nil?
116
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
117
+ end
118
+
119
+ if name.nil?
120
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
121
+ end
122
+
123
+ api_params = {
124
+ name: name,
125
+ enabled: enabled,
126
+ }
127
+
128
+ api_headers = {
129
+ "content-type": 'application/json',
130
+ }
131
+
132
+ @client.call(
133
+ method: 'PUT',
134
+ path: api_path,
135
+ headers: api_headers,
136
+ params: api_params,
137
+ response_type: Models::Database
138
+ )
139
+ end
140
+
141
+ # Delete a database by its unique ID. Only API keys with with databases.write
142
+ # scope can delete a database.
143
+ #
144
+ # @param [String] database_id Database ID.
145
+ #
146
+ # @return []
147
+ def delete(database_id:)
148
+ api_path = '/tablesdb/{databaseId}'
149
+ .gsub('{databaseId}', database_id)
150
+
151
+ if database_id.nil?
152
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
153
+ end
154
+
155
+ api_params = {
156
+ }
157
+
158
+ api_headers = {
159
+ "content-type": 'application/json',
160
+ }
161
+
162
+ @client.call(
163
+ method: 'DELETE',
164
+ path: api_path,
165
+ headers: api_headers,
166
+ params: api_params,
167
+ )
168
+ end
169
+
170
+ # Get a list of all tables that belong to the provided databaseId. You can
171
+ # use the search parameter to filter your results.
172
+ #
173
+ # @param [String] database_id Database ID.
174
+ # @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 columns: name, enabled, rowSecurity
175
+ # @param [String] search Search term to filter your list results. Max length: 256 chars.
176
+ #
177
+ # @return [TableList]
178
+ def list_tables(database_id:, queries: nil, search: nil)
179
+ api_path = '/tablesdb/{databaseId}/tables'
180
+ .gsub('{databaseId}', database_id)
181
+
182
+ if database_id.nil?
183
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
184
+ end
185
+
186
+ api_params = {
187
+ queries: queries,
188
+ search: search,
189
+ }
190
+
191
+ api_headers = {
192
+ }
193
+
194
+ @client.call(
195
+ method: 'GET',
196
+ path: api_path,
197
+ headers: api_headers,
198
+ params: api_params,
199
+ response_type: Models::TableList
200
+ )
201
+ end
202
+
203
+ # Create a new Table. Before using this route, you should create a new
204
+ # database resource using either a [server
205
+ # integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable)
206
+ # API or directly from your database console.
207
+ #
208
+ # @param [String] database_id Database ID.
209
+ # @param [String] table_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.
210
+ # @param [String] name Table name. Max length: 128 chars.
211
+ # @param [Array] permissions An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
212
+ # @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).
213
+ # @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.
214
+ #
215
+ # @return [Table]
216
+ def create_table(database_id:, table_id:, name:, permissions: nil, row_security: nil, enabled: nil)
217
+ api_path = '/tablesdb/{databaseId}/tables'
218
+ .gsub('{databaseId}', database_id)
219
+
220
+ if database_id.nil?
221
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
222
+ end
223
+
224
+ if table_id.nil?
225
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
226
+ end
227
+
228
+ if name.nil?
229
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
230
+ end
231
+
232
+ api_params = {
233
+ tableId: table_id,
234
+ name: name,
235
+ permissions: permissions,
236
+ rowSecurity: row_security,
237
+ enabled: enabled,
238
+ }
239
+
240
+ api_headers = {
241
+ "content-type": 'application/json',
242
+ }
243
+
244
+ @client.call(
245
+ method: 'POST',
246
+ path: api_path,
247
+ headers: api_headers,
248
+ params: api_params,
249
+ response_type: Models::Table
250
+ )
251
+ end
252
+
253
+ # Get a table by its unique ID. This endpoint response returns a JSON object
254
+ # with the table metadata.
255
+ #
256
+ # @param [String] database_id Database ID.
257
+ # @param [String] table_id Table ID.
258
+ #
259
+ # @return [Table]
260
+ def get_table(database_id:, table_id:)
261
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}'
262
+ .gsub('{databaseId}', database_id)
263
+ .gsub('{tableId}', table_id)
264
+
265
+ if database_id.nil?
266
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
267
+ end
268
+
269
+ if table_id.nil?
270
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
271
+ end
272
+
273
+ api_params = {
274
+ }
275
+
276
+ api_headers = {
277
+ }
278
+
279
+ @client.call(
280
+ method: 'GET',
281
+ path: api_path,
282
+ headers: api_headers,
283
+ params: api_params,
284
+ response_type: Models::Table
285
+ )
286
+ end
287
+
288
+ # Update a table by its unique ID.
289
+ #
290
+ # @param [String] database_id Database ID.
291
+ # @param [String] table_id Table ID.
292
+ # @param [String] name Table name. Max length: 128 chars.
293
+ # @param [Array] permissions An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
294
+ # @param [] row_security Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).
295
+ # @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.
296
+ #
297
+ # @return [Table]
298
+ def update_table(database_id:, table_id:, name:, permissions: nil, row_security: nil, enabled: nil)
299
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}'
300
+ .gsub('{databaseId}', database_id)
301
+ .gsub('{tableId}', table_id)
302
+
303
+ if database_id.nil?
304
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
305
+ end
306
+
307
+ if table_id.nil?
308
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
309
+ end
310
+
311
+ if name.nil?
312
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
313
+ end
314
+
315
+ api_params = {
316
+ name: name,
317
+ permissions: permissions,
318
+ rowSecurity: row_security,
319
+ enabled: enabled,
320
+ }
321
+
322
+ api_headers = {
323
+ "content-type": 'application/json',
324
+ }
325
+
326
+ @client.call(
327
+ method: 'PUT',
328
+ path: api_path,
329
+ headers: api_headers,
330
+ params: api_params,
331
+ response_type: Models::Table
332
+ )
333
+ end
334
+
335
+ # Delete a table by its unique ID. Only users with write permissions have
336
+ # access to delete this resource.
337
+ #
338
+ # @param [String] database_id Database ID.
339
+ # @param [String] table_id Table ID.
340
+ #
341
+ # @return []
342
+ def delete_table(database_id:, table_id:)
343
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}'
344
+ .gsub('{databaseId}', database_id)
345
+ .gsub('{tableId}', table_id)
346
+
347
+ if database_id.nil?
348
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
349
+ end
350
+
351
+ if table_id.nil?
352
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
353
+ end
354
+
355
+ api_params = {
356
+ }
357
+
358
+ api_headers = {
359
+ "content-type": 'application/json',
360
+ }
361
+
362
+ @client.call(
363
+ method: 'DELETE',
364
+ path: api_path,
365
+ headers: api_headers,
366
+ params: api_params,
367
+ )
368
+ end
369
+
370
+ # List columns in the table.
371
+ #
372
+ # @param [String] database_id Database ID.
373
+ # @param [String] table_id Table ID.
374
+ # @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 columns: key, type, size, required, array, status, error
375
+ #
376
+ # @return [ColumnList]
377
+ def list_columns(database_id:, table_id:, queries: nil)
378
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns'
379
+ .gsub('{databaseId}', database_id)
380
+ .gsub('{tableId}', table_id)
381
+
382
+ if database_id.nil?
383
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
384
+ end
385
+
386
+ if table_id.nil?
387
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
388
+ end
389
+
390
+ api_params = {
391
+ queries: queries,
392
+ }
393
+
394
+ api_headers = {
395
+ }
396
+
397
+ @client.call(
398
+ method: 'GET',
399
+ path: api_path,
400
+ headers: api_headers,
401
+ params: api_params,
402
+ response_type: Models::ColumnList
403
+ )
404
+ end
405
+
406
+ # Create a boolean column.
407
+ #
408
+ #
409
+ # @param [String] database_id Database ID.
410
+ # @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
411
+ # @param [String] key Column Key.
412
+ # @param [] required Is column required?
413
+ # @param [] default Default value for column when not provided. Cannot be set when column is required.
414
+ # @param [] array Is column an array?
415
+ #
416
+ # @return [ColumnBoolean]
417
+ def create_boolean_column(database_id:, table_id:, key:, required:, default: nil, array: nil)
418
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/boolean'
419
+ .gsub('{databaseId}', database_id)
420
+ .gsub('{tableId}', table_id)
421
+
422
+ if database_id.nil?
423
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
424
+ end
425
+
426
+ if table_id.nil?
427
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
428
+ end
429
+
430
+ if key.nil?
431
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
432
+ end
433
+
434
+ if required.nil?
435
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
436
+ end
437
+
438
+ api_params = {
439
+ key: key,
440
+ required: required,
441
+ default: default,
442
+ array: array,
443
+ }
444
+
445
+ api_headers = {
446
+ "content-type": 'application/json',
447
+ }
448
+
449
+ @client.call(
450
+ method: 'POST',
451
+ path: api_path,
452
+ headers: api_headers,
453
+ params: api_params,
454
+ response_type: Models::ColumnBoolean
455
+ )
456
+ end
457
+
458
+ # Update a boolean column. Changing the `default` value will not update
459
+ # already existing rows.
460
+ #
461
+ # @param [String] database_id Database ID.
462
+ # @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
463
+ # @param [String] key Column Key.
464
+ # @param [] required Is column required?
465
+ # @param [] default Default value for column when not provided. Cannot be set when column is required.
466
+ # @param [String] new_key New Column Key.
467
+ #
468
+ # @return [ColumnBoolean]
469
+ def update_boolean_column(database_id:, table_id:, key:, required:, default:, new_key: nil)
470
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/boolean/{key}'
471
+ .gsub('{databaseId}', database_id)
472
+ .gsub('{tableId}', table_id)
473
+ .gsub('{key}', key)
474
+
475
+ if database_id.nil?
476
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
477
+ end
478
+
479
+ if table_id.nil?
480
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
481
+ end
482
+
483
+ if key.nil?
484
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
485
+ end
486
+
487
+ if required.nil?
488
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
489
+ end
490
+
491
+ if default.nil?
492
+ raise Appwrite::Exception.new('Missing required parameter: "default"')
493
+ end
494
+
495
+ api_params = {
496
+ required: required,
497
+ default: default,
498
+ newKey: new_key,
499
+ }
500
+
501
+ api_headers = {
502
+ "content-type": 'application/json',
503
+ }
504
+
505
+ @client.call(
506
+ method: 'PATCH',
507
+ path: api_path,
508
+ headers: api_headers,
509
+ params: api_params,
510
+ response_type: Models::ColumnBoolean
511
+ )
512
+ end
513
+
514
+ # Create a date time column according to the ISO 8601 standard.
515
+ #
516
+ # @param [String] database_id Database ID.
517
+ # @param [String] table_id Table ID.
518
+ # @param [String] key Column Key.
519
+ # @param [] required Is column required?
520
+ # @param [String] default Default value for the column in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.
521
+ # @param [] array Is column an array?
522
+ #
523
+ # @return [ColumnDatetime]
524
+ def create_datetime_column(database_id:, table_id:, key:, required:, default: nil, array: nil)
525
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/datetime'
526
+ .gsub('{databaseId}', database_id)
527
+ .gsub('{tableId}', table_id)
528
+
529
+ if database_id.nil?
530
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
531
+ end
532
+
533
+ if table_id.nil?
534
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
535
+ end
536
+
537
+ if key.nil?
538
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
539
+ end
540
+
541
+ if required.nil?
542
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
543
+ end
544
+
545
+ api_params = {
546
+ key: key,
547
+ required: required,
548
+ default: default,
549
+ array: array,
550
+ }
551
+
552
+ api_headers = {
553
+ "content-type": 'application/json',
554
+ }
555
+
556
+ @client.call(
557
+ method: 'POST',
558
+ path: api_path,
559
+ headers: api_headers,
560
+ params: api_params,
561
+ response_type: Models::ColumnDatetime
562
+ )
563
+ end
564
+
565
+ # Update a date time column. Changing the `default` value will not update
566
+ # already existing rows.
567
+ #
568
+ # @param [String] database_id Database ID.
569
+ # @param [String] table_id Table ID.
570
+ # @param [String] key Column Key.
571
+ # @param [] required Is column required?
572
+ # @param [String] default Default value for column when not provided. Cannot be set when column is required.
573
+ # @param [String] new_key New Column Key.
574
+ #
575
+ # @return [ColumnDatetime]
576
+ def update_datetime_column(database_id:, table_id:, key:, required:, default:, new_key: nil)
577
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/datetime/{key}'
578
+ .gsub('{databaseId}', database_id)
579
+ .gsub('{tableId}', table_id)
580
+ .gsub('{key}', key)
581
+
582
+ if database_id.nil?
583
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
584
+ end
585
+
586
+ if table_id.nil?
587
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
588
+ end
589
+
590
+ if key.nil?
591
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
592
+ end
593
+
594
+ if required.nil?
595
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
596
+ end
597
+
598
+ if default.nil?
599
+ raise Appwrite::Exception.new('Missing required parameter: "default"')
600
+ end
601
+
602
+ api_params = {
603
+ required: required,
604
+ default: default,
605
+ newKey: new_key,
606
+ }
607
+
608
+ api_headers = {
609
+ "content-type": 'application/json',
610
+ }
611
+
612
+ @client.call(
613
+ method: 'PATCH',
614
+ path: api_path,
615
+ headers: api_headers,
616
+ params: api_params,
617
+ response_type: Models::ColumnDatetime
618
+ )
619
+ end
620
+
621
+ # Create an email column.
622
+ #
623
+ #
624
+ # @param [String] database_id Database ID.
625
+ # @param [String] table_id Table ID.
626
+ # @param [String] key Column Key.
627
+ # @param [] required Is column required?
628
+ # @param [String] default Default value for column when not provided. Cannot be set when column is required.
629
+ # @param [] array Is column an array?
630
+ #
631
+ # @return [ColumnEmail]
632
+ def create_email_column(database_id:, table_id:, key:, required:, default: nil, array: nil)
633
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/email'
634
+ .gsub('{databaseId}', database_id)
635
+ .gsub('{tableId}', table_id)
636
+
637
+ if database_id.nil?
638
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
639
+ end
640
+
641
+ if table_id.nil?
642
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
643
+ end
644
+
645
+ if key.nil?
646
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
647
+ end
648
+
649
+ if required.nil?
650
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
651
+ end
652
+
653
+ api_params = {
654
+ key: key,
655
+ required: required,
656
+ default: default,
657
+ array: array,
658
+ }
659
+
660
+ api_headers = {
661
+ "content-type": 'application/json',
662
+ }
663
+
664
+ @client.call(
665
+ method: 'POST',
666
+ path: api_path,
667
+ headers: api_headers,
668
+ params: api_params,
669
+ response_type: Models::ColumnEmail
670
+ )
671
+ end
672
+
673
+ # Update an email column. Changing the `default` value will not update
674
+ # already existing rows.
675
+ #
676
+ #
677
+ # @param [String] database_id Database ID.
678
+ # @param [String] table_id Table ID.
679
+ # @param [String] key Column Key.
680
+ # @param [] required Is column required?
681
+ # @param [String] default Default value for column when not provided. Cannot be set when column is required.
682
+ # @param [String] new_key New Column Key.
683
+ #
684
+ # @return [ColumnEmail]
685
+ def update_email_column(database_id:, table_id:, key:, required:, default:, new_key: nil)
686
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/email/{key}'
687
+ .gsub('{databaseId}', database_id)
688
+ .gsub('{tableId}', table_id)
689
+ .gsub('{key}', key)
690
+
691
+ if database_id.nil?
692
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
693
+ end
694
+
695
+ if table_id.nil?
696
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
697
+ end
698
+
699
+ if key.nil?
700
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
701
+ end
702
+
703
+ if required.nil?
704
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
705
+ end
706
+
707
+ if default.nil?
708
+ raise Appwrite::Exception.new('Missing required parameter: "default"')
709
+ end
710
+
711
+ api_params = {
712
+ required: required,
713
+ default: default,
714
+ newKey: new_key,
715
+ }
716
+
717
+ api_headers = {
718
+ "content-type": 'application/json',
719
+ }
720
+
721
+ @client.call(
722
+ method: 'PATCH',
723
+ path: api_path,
724
+ headers: api_headers,
725
+ params: api_params,
726
+ response_type: Models::ColumnEmail
727
+ )
728
+ end
729
+
730
+ # Create an enumeration column. The `elements` param acts as a white-list of
731
+ # accepted values for this column.
732
+ #
733
+ # @param [String] database_id Database ID.
734
+ # @param [String] table_id Table ID.
735
+ # @param [String] key Column Key.
736
+ # @param [Array] elements Array of enum values.
737
+ # @param [] required Is column required?
738
+ # @param [String] default Default value for column when not provided. Cannot be set when column is required.
739
+ # @param [] array Is column an array?
740
+ #
741
+ # @return [ColumnEnum]
742
+ def create_enum_column(database_id:, table_id:, key:, elements:, required:, default: nil, array: nil)
743
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/enum'
744
+ .gsub('{databaseId}', database_id)
745
+ .gsub('{tableId}', table_id)
746
+
747
+ if database_id.nil?
748
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
749
+ end
750
+
751
+ if table_id.nil?
752
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
753
+ end
754
+
755
+ if key.nil?
756
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
757
+ end
758
+
759
+ if elements.nil?
760
+ raise Appwrite::Exception.new('Missing required parameter: "elements"')
761
+ end
762
+
763
+ if required.nil?
764
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
765
+ end
766
+
767
+ api_params = {
768
+ key: key,
769
+ elements: elements,
770
+ required: required,
771
+ default: default,
772
+ array: array,
773
+ }
774
+
775
+ api_headers = {
776
+ "content-type": 'application/json',
777
+ }
778
+
779
+ @client.call(
780
+ method: 'POST',
781
+ path: api_path,
782
+ headers: api_headers,
783
+ params: api_params,
784
+ response_type: Models::ColumnEnum
785
+ )
786
+ end
787
+
788
+ # Update an enum column. Changing the `default` value will not update already
789
+ # existing rows.
790
+ #
791
+ #
792
+ # @param [String] database_id Database ID.
793
+ # @param [String] table_id Table ID.
794
+ # @param [String] key Column Key.
795
+ # @param [Array] elements Updated list of enum values.
796
+ # @param [] required Is column required?
797
+ # @param [String] default Default value for column when not provided. Cannot be set when column is required.
798
+ # @param [String] new_key New Column Key.
799
+ #
800
+ # @return [ColumnEnum]
801
+ def update_enum_column(database_id:, table_id:, key:, elements:, required:, default:, new_key: nil)
802
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/enum/{key}'
803
+ .gsub('{databaseId}', database_id)
804
+ .gsub('{tableId}', table_id)
805
+ .gsub('{key}', key)
806
+
807
+ if database_id.nil?
808
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
809
+ end
810
+
811
+ if table_id.nil?
812
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
813
+ end
814
+
815
+ if key.nil?
816
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
817
+ end
818
+
819
+ if elements.nil?
820
+ raise Appwrite::Exception.new('Missing required parameter: "elements"')
821
+ end
822
+
823
+ if required.nil?
824
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
825
+ end
826
+
827
+ if default.nil?
828
+ raise Appwrite::Exception.new('Missing required parameter: "default"')
829
+ end
830
+
831
+ api_params = {
832
+ elements: elements,
833
+ required: required,
834
+ default: default,
835
+ newKey: new_key,
836
+ }
837
+
838
+ api_headers = {
839
+ "content-type": 'application/json',
840
+ }
841
+
842
+ @client.call(
843
+ method: 'PATCH',
844
+ path: api_path,
845
+ headers: api_headers,
846
+ params: api_params,
847
+ response_type: Models::ColumnEnum
848
+ )
849
+ end
850
+
851
+ # Create a float column. Optionally, minimum and maximum values can be
852
+ # provided.
853
+ #
854
+ #
855
+ # @param [String] database_id Database ID.
856
+ # @param [String] table_id Table ID.
857
+ # @param [String] key Column Key.
858
+ # @param [] required Is column required?
859
+ # @param [Float] min Minimum value
860
+ # @param [Float] max Maximum value
861
+ # @param [Float] default Default value. Cannot be set when required.
862
+ # @param [] array Is column an array?
863
+ #
864
+ # @return [ColumnFloat]
865
+ def create_float_column(database_id:, table_id:, key:, required:, min: nil, max: nil, default: nil, array: nil)
866
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/float'
867
+ .gsub('{databaseId}', database_id)
868
+ .gsub('{tableId}', table_id)
869
+
870
+ if database_id.nil?
871
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
872
+ end
873
+
874
+ if table_id.nil?
875
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
876
+ end
877
+
878
+ if key.nil?
879
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
880
+ end
881
+
882
+ if required.nil?
883
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
884
+ end
885
+
886
+ api_params = {
887
+ key: key,
888
+ required: required,
889
+ min: min,
890
+ max: max,
891
+ default: default,
892
+ array: array,
893
+ }
894
+
895
+ api_headers = {
896
+ "content-type": 'application/json',
897
+ }
898
+
899
+ @client.call(
900
+ method: 'POST',
901
+ path: api_path,
902
+ headers: api_headers,
903
+ params: api_params,
904
+ response_type: Models::ColumnFloat
905
+ )
906
+ end
907
+
908
+ # Update a float column. Changing the `default` value will not update already
909
+ # existing rows.
910
+ #
911
+ #
912
+ # @param [String] database_id Database ID.
913
+ # @param [String] table_id Table ID.
914
+ # @param [String] key Column Key.
915
+ # @param [] required Is column required?
916
+ # @param [Float] default Default value. Cannot be set when required.
917
+ # @param [Float] min Minimum value
918
+ # @param [Float] max Maximum value
919
+ # @param [String] new_key New Column Key.
920
+ #
921
+ # @return [ColumnFloat]
922
+ def update_float_column(database_id:, table_id:, key:, required:, default:, min: nil, max: nil, new_key: nil)
923
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/float/{key}'
924
+ .gsub('{databaseId}', database_id)
925
+ .gsub('{tableId}', table_id)
926
+ .gsub('{key}', key)
927
+
928
+ if database_id.nil?
929
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
930
+ end
931
+
932
+ if table_id.nil?
933
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
934
+ end
935
+
936
+ if key.nil?
937
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
938
+ end
939
+
940
+ if required.nil?
941
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
942
+ end
943
+
944
+ if default.nil?
945
+ raise Appwrite::Exception.new('Missing required parameter: "default"')
946
+ end
947
+
948
+ api_params = {
949
+ required: required,
950
+ min: min,
951
+ max: max,
952
+ default: default,
953
+ newKey: new_key,
954
+ }
955
+
956
+ api_headers = {
957
+ "content-type": 'application/json',
958
+ }
959
+
960
+ @client.call(
961
+ method: 'PATCH',
962
+ path: api_path,
963
+ headers: api_headers,
964
+ params: api_params,
965
+ response_type: Models::ColumnFloat
966
+ )
967
+ end
968
+
969
+ # Create an integer column. Optionally, minimum and maximum values can be
970
+ # provided.
971
+ #
972
+ #
973
+ # @param [String] database_id Database ID.
974
+ # @param [String] table_id Table ID.
975
+ # @param [String] key Column Key.
976
+ # @param [] required Is column required?
977
+ # @param [Integer] min Minimum value
978
+ # @param [Integer] max Maximum value
979
+ # @param [Integer] default Default value. Cannot be set when column is required.
980
+ # @param [] array Is column an array?
981
+ #
982
+ # @return [ColumnInteger]
983
+ def create_integer_column(database_id:, table_id:, key:, required:, min: nil, max: nil, default: nil, array: nil)
984
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/integer'
985
+ .gsub('{databaseId}', database_id)
986
+ .gsub('{tableId}', table_id)
987
+
988
+ if database_id.nil?
989
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
990
+ end
991
+
992
+ if table_id.nil?
993
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
994
+ end
995
+
996
+ if key.nil?
997
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
998
+ end
999
+
1000
+ if required.nil?
1001
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
1002
+ end
1003
+
1004
+ api_params = {
1005
+ key: key,
1006
+ required: required,
1007
+ min: min,
1008
+ max: max,
1009
+ default: default,
1010
+ array: array,
1011
+ }
1012
+
1013
+ api_headers = {
1014
+ "content-type": 'application/json',
1015
+ }
1016
+
1017
+ @client.call(
1018
+ method: 'POST',
1019
+ path: api_path,
1020
+ headers: api_headers,
1021
+ params: api_params,
1022
+ response_type: Models::ColumnInteger
1023
+ )
1024
+ end
1025
+
1026
+ # Update an integer column. Changing the `default` value will not update
1027
+ # already existing rows.
1028
+ #
1029
+ #
1030
+ # @param [String] database_id Database ID.
1031
+ # @param [String] table_id Table ID.
1032
+ # @param [String] key Column Key.
1033
+ # @param [] required Is column required?
1034
+ # @param [Integer] default Default value. Cannot be set when column is required.
1035
+ # @param [Integer] min Minimum value
1036
+ # @param [Integer] max Maximum value
1037
+ # @param [String] new_key New Column Key.
1038
+ #
1039
+ # @return [ColumnInteger]
1040
+ def update_integer_column(database_id:, table_id:, key:, required:, default:, min: nil, max: nil, new_key: nil)
1041
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/integer/{key}'
1042
+ .gsub('{databaseId}', database_id)
1043
+ .gsub('{tableId}', table_id)
1044
+ .gsub('{key}', key)
1045
+
1046
+ if database_id.nil?
1047
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1048
+ end
1049
+
1050
+ if table_id.nil?
1051
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
1052
+ end
1053
+
1054
+ if key.nil?
1055
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
1056
+ end
1057
+
1058
+ if required.nil?
1059
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
1060
+ end
1061
+
1062
+ if default.nil?
1063
+ raise Appwrite::Exception.new('Missing required parameter: "default"')
1064
+ end
1065
+
1066
+ api_params = {
1067
+ required: required,
1068
+ min: min,
1069
+ max: max,
1070
+ default: default,
1071
+ newKey: new_key,
1072
+ }
1073
+
1074
+ api_headers = {
1075
+ "content-type": 'application/json',
1076
+ }
1077
+
1078
+ @client.call(
1079
+ method: 'PATCH',
1080
+ path: api_path,
1081
+ headers: api_headers,
1082
+ params: api_params,
1083
+ response_type: Models::ColumnInteger
1084
+ )
1085
+ end
1086
+
1087
+ # Create IP address column.
1088
+ #
1089
+ #
1090
+ # @param [String] database_id Database ID.
1091
+ # @param [String] table_id Table ID.
1092
+ # @param [String] key Column Key.
1093
+ # @param [] required Is column required?
1094
+ # @param [String] default Default value. Cannot be set when column is required.
1095
+ # @param [] array Is column an array?
1096
+ #
1097
+ # @return [ColumnIp]
1098
+ def create_ip_column(database_id:, table_id:, key:, required:, default: nil, array: nil)
1099
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/ip'
1100
+ .gsub('{databaseId}', database_id)
1101
+ .gsub('{tableId}', table_id)
1102
+
1103
+ if database_id.nil?
1104
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1105
+ end
1106
+
1107
+ if table_id.nil?
1108
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
1109
+ end
1110
+
1111
+ if key.nil?
1112
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
1113
+ end
1114
+
1115
+ if required.nil?
1116
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
1117
+ end
1118
+
1119
+ api_params = {
1120
+ key: key,
1121
+ required: required,
1122
+ default: default,
1123
+ array: array,
1124
+ }
1125
+
1126
+ api_headers = {
1127
+ "content-type": 'application/json',
1128
+ }
1129
+
1130
+ @client.call(
1131
+ method: 'POST',
1132
+ path: api_path,
1133
+ headers: api_headers,
1134
+ params: api_params,
1135
+ response_type: Models::ColumnIp
1136
+ )
1137
+ end
1138
+
1139
+ # Update an ip column. Changing the `default` value will not update already
1140
+ # existing rows.
1141
+ #
1142
+ #
1143
+ # @param [String] database_id Database ID.
1144
+ # @param [String] table_id Table ID.
1145
+ # @param [String] key Column Key.
1146
+ # @param [] required Is column required?
1147
+ # @param [String] default Default value. Cannot be set when column is required.
1148
+ # @param [String] new_key New Column Key.
1149
+ #
1150
+ # @return [ColumnIp]
1151
+ def update_ip_column(database_id:, table_id:, key:, required:, default:, new_key: nil)
1152
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/ip/{key}'
1153
+ .gsub('{databaseId}', database_id)
1154
+ .gsub('{tableId}', table_id)
1155
+ .gsub('{key}', key)
1156
+
1157
+ if database_id.nil?
1158
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1159
+ end
1160
+
1161
+ if table_id.nil?
1162
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
1163
+ end
1164
+
1165
+ if key.nil?
1166
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
1167
+ end
1168
+
1169
+ if required.nil?
1170
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
1171
+ end
1172
+
1173
+ if default.nil?
1174
+ raise Appwrite::Exception.new('Missing required parameter: "default"')
1175
+ end
1176
+
1177
+ api_params = {
1178
+ required: required,
1179
+ default: default,
1180
+ newKey: new_key,
1181
+ }
1182
+
1183
+ api_headers = {
1184
+ "content-type": 'application/json',
1185
+ }
1186
+
1187
+ @client.call(
1188
+ method: 'PATCH',
1189
+ path: api_path,
1190
+ headers: api_headers,
1191
+ params: api_params,
1192
+ response_type: Models::ColumnIp
1193
+ )
1194
+ end
1195
+
1196
+ # Create a geometric line column.
1197
+ #
1198
+ # @param [String] database_id Database ID.
1199
+ # @param [String] table_id Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
1200
+ # @param [String] key Column Key.
1201
+ # @param [] required Is column required?
1202
+ # @param [Array] default Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.
1203
+ #
1204
+ # @return [ColumnLine]
1205
+ def create_line_column(database_id:, table_id:, key:, required:, default: nil)
1206
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/line'
1207
+ .gsub('{databaseId}', database_id)
1208
+ .gsub('{tableId}', table_id)
1209
+
1210
+ if database_id.nil?
1211
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1212
+ end
1213
+
1214
+ if table_id.nil?
1215
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
1216
+ end
1217
+
1218
+ if key.nil?
1219
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
1220
+ end
1221
+
1222
+ if required.nil?
1223
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
1224
+ end
1225
+
1226
+ api_params = {
1227
+ key: key,
1228
+ required: required,
1229
+ default: default,
1230
+ }
1231
+
1232
+ api_headers = {
1233
+ "content-type": 'application/json',
1234
+ }
1235
+
1236
+ @client.call(
1237
+ method: 'POST',
1238
+ path: api_path,
1239
+ headers: api_headers,
1240
+ params: api_params,
1241
+ response_type: Models::ColumnLine
1242
+ )
1243
+ end
1244
+
1245
+ # Update a line column. Changing the `default` value will not update already
1246
+ # existing rows.
1247
+ #
1248
+ # @param [String] database_id Database ID.
1249
+ # @param [String] table_id Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
1250
+ # @param [String] key Column Key.
1251
+ # @param [] required Is column required?
1252
+ # @param [Array] default Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.
1253
+ # @param [String] new_key New Column Key.
1254
+ #
1255
+ # @return [ColumnLine]
1256
+ def update_line_column(database_id:, table_id:, key:, required:, default: nil, new_key: nil)
1257
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/line/{key}'
1258
+ .gsub('{databaseId}', database_id)
1259
+ .gsub('{tableId}', table_id)
1260
+ .gsub('{key}', key)
1261
+
1262
+ if database_id.nil?
1263
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1264
+ end
1265
+
1266
+ if table_id.nil?
1267
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
1268
+ end
1269
+
1270
+ if key.nil?
1271
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
1272
+ end
1273
+
1274
+ if required.nil?
1275
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
1276
+ end
1277
+
1278
+ api_params = {
1279
+ required: required,
1280
+ default: default,
1281
+ newKey: new_key,
1282
+ }
1283
+
1284
+ api_headers = {
1285
+ "content-type": 'application/json',
1286
+ }
1287
+
1288
+ @client.call(
1289
+ method: 'PATCH',
1290
+ path: api_path,
1291
+ headers: api_headers,
1292
+ params: api_params,
1293
+ response_type: Models::ColumnLine
1294
+ )
1295
+ end
1296
+
1297
+ # Create a geometric point column.
1298
+ #
1299
+ # @param [String] database_id Database ID.
1300
+ # @param [String] table_id Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
1301
+ # @param [String] key Column Key.
1302
+ # @param [] required Is column required?
1303
+ # @param [Array] default Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.
1304
+ #
1305
+ # @return [ColumnPoint]
1306
+ def create_point_column(database_id:, table_id:, key:, required:, default: nil)
1307
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/point'
1308
+ .gsub('{databaseId}', database_id)
1309
+ .gsub('{tableId}', table_id)
1310
+
1311
+ if database_id.nil?
1312
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1313
+ end
1314
+
1315
+ if table_id.nil?
1316
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
1317
+ end
1318
+
1319
+ if key.nil?
1320
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
1321
+ end
1322
+
1323
+ if required.nil?
1324
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
1325
+ end
1326
+
1327
+ api_params = {
1328
+ key: key,
1329
+ required: required,
1330
+ default: default,
1331
+ }
1332
+
1333
+ api_headers = {
1334
+ "content-type": 'application/json',
1335
+ }
1336
+
1337
+ @client.call(
1338
+ method: 'POST',
1339
+ path: api_path,
1340
+ headers: api_headers,
1341
+ params: api_params,
1342
+ response_type: Models::ColumnPoint
1343
+ )
1344
+ end
1345
+
1346
+ # Update a point column. Changing the `default` value will not update already
1347
+ # existing rows.
1348
+ #
1349
+ # @param [String] database_id Database ID.
1350
+ # @param [String] table_id Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
1351
+ # @param [String] key Column Key.
1352
+ # @param [] required Is column required?
1353
+ # @param [Array] default Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.
1354
+ # @param [String] new_key New Column Key.
1355
+ #
1356
+ # @return [ColumnPoint]
1357
+ def update_point_column(database_id:, table_id:, key:, required:, default: nil, new_key: nil)
1358
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/point/{key}'
1359
+ .gsub('{databaseId}', database_id)
1360
+ .gsub('{tableId}', table_id)
1361
+ .gsub('{key}', key)
1362
+
1363
+ if database_id.nil?
1364
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1365
+ end
1366
+
1367
+ if table_id.nil?
1368
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
1369
+ end
1370
+
1371
+ if key.nil?
1372
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
1373
+ end
1374
+
1375
+ if required.nil?
1376
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
1377
+ end
1378
+
1379
+ api_params = {
1380
+ required: required,
1381
+ default: default,
1382
+ newKey: new_key,
1383
+ }
1384
+
1385
+ api_headers = {
1386
+ "content-type": 'application/json',
1387
+ }
1388
+
1389
+ @client.call(
1390
+ method: 'PATCH',
1391
+ path: api_path,
1392
+ headers: api_headers,
1393
+ params: api_params,
1394
+ response_type: Models::ColumnPoint
1395
+ )
1396
+ end
1397
+
1398
+ # Create a geometric polygon column.
1399
+ #
1400
+ # @param [String] database_id Database ID.
1401
+ # @param [String] table_id Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
1402
+ # @param [String] key Column Key.
1403
+ # @param [] required Is column required?
1404
+ # @param [Array] default Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.
1405
+ #
1406
+ # @return [ColumnPolygon]
1407
+ def create_polygon_column(database_id:, table_id:, key:, required:, default: nil)
1408
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/polygon'
1409
+ .gsub('{databaseId}', database_id)
1410
+ .gsub('{tableId}', table_id)
1411
+
1412
+ if database_id.nil?
1413
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1414
+ end
1415
+
1416
+ if table_id.nil?
1417
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
1418
+ end
1419
+
1420
+ if key.nil?
1421
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
1422
+ end
1423
+
1424
+ if required.nil?
1425
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
1426
+ end
1427
+
1428
+ api_params = {
1429
+ key: key,
1430
+ required: required,
1431
+ default: default,
1432
+ }
1433
+
1434
+ api_headers = {
1435
+ "content-type": 'application/json',
1436
+ }
1437
+
1438
+ @client.call(
1439
+ method: 'POST',
1440
+ path: api_path,
1441
+ headers: api_headers,
1442
+ params: api_params,
1443
+ response_type: Models::ColumnPolygon
1444
+ )
1445
+ end
1446
+
1447
+ # Update a polygon column. Changing the `default` value will not update
1448
+ # already existing rows.
1449
+ #
1450
+ # @param [String] database_id Database ID.
1451
+ # @param [String] table_id Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
1452
+ # @param [String] key Column Key.
1453
+ # @param [] required Is column required?
1454
+ # @param [Array] default Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.
1455
+ # @param [String] new_key New Column Key.
1456
+ #
1457
+ # @return [ColumnPolygon]
1458
+ def update_polygon_column(database_id:, table_id:, key:, required:, default: nil, new_key: nil)
1459
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/polygon/{key}'
1460
+ .gsub('{databaseId}', database_id)
1461
+ .gsub('{tableId}', table_id)
1462
+ .gsub('{key}', key)
1463
+
1464
+ if database_id.nil?
1465
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1466
+ end
1467
+
1468
+ if table_id.nil?
1469
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
1470
+ end
1471
+
1472
+ if key.nil?
1473
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
1474
+ end
1475
+
1476
+ if required.nil?
1477
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
1478
+ end
1479
+
1480
+ api_params = {
1481
+ required: required,
1482
+ default: default,
1483
+ newKey: new_key,
1484
+ }
1485
+
1486
+ api_headers = {
1487
+ "content-type": 'application/json',
1488
+ }
1489
+
1490
+ @client.call(
1491
+ method: 'PATCH',
1492
+ path: api_path,
1493
+ headers: api_headers,
1494
+ params: api_params,
1495
+ response_type: Models::ColumnPolygon
1496
+ )
1497
+ end
1498
+
1499
+ # Create relationship column. [Learn more about relationship
1500
+ # columns](https://appwrite.io/docs/databases-relationships#relationship-columns).
1501
+ #
1502
+ #
1503
+ # @param [String] database_id Database ID.
1504
+ # @param [String] table_id Table ID.
1505
+ # @param [String] related_table_id Related Table ID.
1506
+ # @param [RelationshipType] type Relation type
1507
+ # @param [] two_way Is Two Way?
1508
+ # @param [String] key Column Key.
1509
+ # @param [String] two_way_key Two Way Column Key.
1510
+ # @param [RelationMutate] on_delete Constraints option
1511
+ #
1512
+ # @return [ColumnRelationship]
1513
+ def create_relationship_column(database_id:, table_id:, related_table_id:, type:, two_way: nil, key: nil, two_way_key: nil, on_delete: nil)
1514
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/relationship'
1515
+ .gsub('{databaseId}', database_id)
1516
+ .gsub('{tableId}', table_id)
1517
+
1518
+ if database_id.nil?
1519
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1520
+ end
1521
+
1522
+ if table_id.nil?
1523
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
1524
+ end
1525
+
1526
+ if related_table_id.nil?
1527
+ raise Appwrite::Exception.new('Missing required parameter: "relatedTableId"')
1528
+ end
1529
+
1530
+ if type.nil?
1531
+ raise Appwrite::Exception.new('Missing required parameter: "type"')
1532
+ end
1533
+
1534
+ api_params = {
1535
+ relatedTableId: related_table_id,
1536
+ type: type,
1537
+ twoWay: two_way,
1538
+ key: key,
1539
+ twoWayKey: two_way_key,
1540
+ onDelete: on_delete,
1541
+ }
1542
+
1543
+ api_headers = {
1544
+ "content-type": 'application/json',
1545
+ }
1546
+
1547
+ @client.call(
1548
+ method: 'POST',
1549
+ path: api_path,
1550
+ headers: api_headers,
1551
+ params: api_params,
1552
+ response_type: Models::ColumnRelationship
1553
+ )
1554
+ end
1555
+
1556
+ # Create a string column.
1557
+ #
1558
+ #
1559
+ # @param [String] database_id Database ID.
1560
+ # @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
1561
+ # @param [String] key Column Key.
1562
+ # @param [Integer] size Column size for text columns, in number of characters.
1563
+ # @param [] required Is column required?
1564
+ # @param [String] default Default value for column when not provided. Cannot be set when column is required.
1565
+ # @param [] array Is column an array?
1566
+ # @param [] encrypt Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.
1567
+ #
1568
+ # @return [ColumnString]
1569
+ def create_string_column(database_id:, table_id:, key:, size:, required:, default: nil, array: nil, encrypt: nil)
1570
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/string'
1571
+ .gsub('{databaseId}', database_id)
1572
+ .gsub('{tableId}', table_id)
1573
+
1574
+ if database_id.nil?
1575
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1576
+ end
1577
+
1578
+ if table_id.nil?
1579
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
1580
+ end
1581
+
1582
+ if key.nil?
1583
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
1584
+ end
1585
+
1586
+ if size.nil?
1587
+ raise Appwrite::Exception.new('Missing required parameter: "size"')
1588
+ end
1589
+
1590
+ if required.nil?
1591
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
1592
+ end
1593
+
1594
+ api_params = {
1595
+ key: key,
1596
+ size: size,
1597
+ required: required,
1598
+ default: default,
1599
+ array: array,
1600
+ encrypt: encrypt,
1601
+ }
1602
+
1603
+ api_headers = {
1604
+ "content-type": 'application/json',
1605
+ }
1606
+
1607
+ @client.call(
1608
+ method: 'POST',
1609
+ path: api_path,
1610
+ headers: api_headers,
1611
+ params: api_params,
1612
+ response_type: Models::ColumnString
1613
+ )
1614
+ end
1615
+
1616
+ # Update a string column. Changing the `default` value will not update
1617
+ # already existing rows.
1618
+ #
1619
+ #
1620
+ # @param [String] database_id Database ID.
1621
+ # @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
1622
+ # @param [String] key Column Key.
1623
+ # @param [] required Is column required?
1624
+ # @param [String] default Default value for column when not provided. Cannot be set when column is required.
1625
+ # @param [Integer] size Maximum size of the string column.
1626
+ # @param [String] new_key New Column Key.
1627
+ #
1628
+ # @return [ColumnString]
1629
+ def update_string_column(database_id:, table_id:, key:, required:, default:, size: nil, new_key: nil)
1630
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/string/{key}'
1631
+ .gsub('{databaseId}', database_id)
1632
+ .gsub('{tableId}', table_id)
1633
+ .gsub('{key}', key)
1634
+
1635
+ if database_id.nil?
1636
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1637
+ end
1638
+
1639
+ if table_id.nil?
1640
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
1641
+ end
1642
+
1643
+ if key.nil?
1644
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
1645
+ end
1646
+
1647
+ if required.nil?
1648
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
1649
+ end
1650
+
1651
+ if default.nil?
1652
+ raise Appwrite::Exception.new('Missing required parameter: "default"')
1653
+ end
1654
+
1655
+ api_params = {
1656
+ required: required,
1657
+ default: default,
1658
+ size: size,
1659
+ newKey: new_key,
1660
+ }
1661
+
1662
+ api_headers = {
1663
+ "content-type": 'application/json',
1664
+ }
1665
+
1666
+ @client.call(
1667
+ method: 'PATCH',
1668
+ path: api_path,
1669
+ headers: api_headers,
1670
+ params: api_params,
1671
+ response_type: Models::ColumnString
1672
+ )
1673
+ end
1674
+
1675
+ # Create a URL column.
1676
+ #
1677
+ #
1678
+ # @param [String] database_id Database ID.
1679
+ # @param [String] table_id Table ID.
1680
+ # @param [String] key Column Key.
1681
+ # @param [] required Is column required?
1682
+ # @param [String] default Default value for column when not provided. Cannot be set when column is required.
1683
+ # @param [] array Is column an array?
1684
+ #
1685
+ # @return [ColumnUrl]
1686
+ def create_url_column(database_id:, table_id:, key:, required:, default: nil, array: nil)
1687
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/url'
1688
+ .gsub('{databaseId}', database_id)
1689
+ .gsub('{tableId}', table_id)
1690
+
1691
+ if database_id.nil?
1692
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1693
+ end
1694
+
1695
+ if table_id.nil?
1696
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
1697
+ end
1698
+
1699
+ if key.nil?
1700
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
1701
+ end
1702
+
1703
+ if required.nil?
1704
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
1705
+ end
1706
+
1707
+ api_params = {
1708
+ key: key,
1709
+ required: required,
1710
+ default: default,
1711
+ array: array,
1712
+ }
1713
+
1714
+ api_headers = {
1715
+ "content-type": 'application/json',
1716
+ }
1717
+
1718
+ @client.call(
1719
+ method: 'POST',
1720
+ path: api_path,
1721
+ headers: api_headers,
1722
+ params: api_params,
1723
+ response_type: Models::ColumnUrl
1724
+ )
1725
+ end
1726
+
1727
+ # Update an url column. Changing the `default` value will not update already
1728
+ # existing rows.
1729
+ #
1730
+ #
1731
+ # @param [String] database_id Database ID.
1732
+ # @param [String] table_id Table ID.
1733
+ # @param [String] key Column Key.
1734
+ # @param [] required Is column required?
1735
+ # @param [String] default Default value for column when not provided. Cannot be set when column is required.
1736
+ # @param [String] new_key New Column Key.
1737
+ #
1738
+ # @return [ColumnUrl]
1739
+ def update_url_column(database_id:, table_id:, key:, required:, default:, new_key: nil)
1740
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/url/{key}'
1741
+ .gsub('{databaseId}', database_id)
1742
+ .gsub('{tableId}', table_id)
1743
+ .gsub('{key}', key)
1744
+
1745
+ if database_id.nil?
1746
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1747
+ end
1748
+
1749
+ if table_id.nil?
1750
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
1751
+ end
1752
+
1753
+ if key.nil?
1754
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
1755
+ end
1756
+
1757
+ if required.nil?
1758
+ raise Appwrite::Exception.new('Missing required parameter: "required"')
1759
+ end
1760
+
1761
+ if default.nil?
1762
+ raise Appwrite::Exception.new('Missing required parameter: "default"')
1763
+ end
1764
+
1765
+ api_params = {
1766
+ required: required,
1767
+ default: default,
1768
+ newKey: new_key,
1769
+ }
1770
+
1771
+ api_headers = {
1772
+ "content-type": 'application/json',
1773
+ }
1774
+
1775
+ @client.call(
1776
+ method: 'PATCH',
1777
+ path: api_path,
1778
+ headers: api_headers,
1779
+ params: api_params,
1780
+ response_type: Models::ColumnUrl
1781
+ )
1782
+ end
1783
+
1784
+ # Get column by ID.
1785
+ #
1786
+ # @param [String] database_id Database ID.
1787
+ # @param [String] table_id Table ID.
1788
+ # @param [String] key Column Key.
1789
+ #
1790
+ # @return []
1791
+ def get_column(database_id:, table_id:, key:)
1792
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}'
1793
+ .gsub('{databaseId}', database_id)
1794
+ .gsub('{tableId}', table_id)
1795
+ .gsub('{key}', key)
1796
+
1797
+ if database_id.nil?
1798
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1799
+ end
1800
+
1801
+ if table_id.nil?
1802
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
1803
+ end
1804
+
1805
+ if key.nil?
1806
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
1807
+ end
1808
+
1809
+ api_params = {
1810
+ }
1811
+
1812
+ api_headers = {
1813
+ }
1814
+
1815
+ @client.call(
1816
+ method: 'GET',
1817
+ path: api_path,
1818
+ headers: api_headers,
1819
+ params: api_params,
1820
+ )
1821
+ end
1822
+
1823
+ # Deletes a column.
1824
+ #
1825
+ # @param [String] database_id Database ID.
1826
+ # @param [String] table_id Table ID.
1827
+ # @param [String] key Column Key.
1828
+ #
1829
+ # @return []
1830
+ def delete_column(database_id:, table_id:, key:)
1831
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}'
1832
+ .gsub('{databaseId}', database_id)
1833
+ .gsub('{tableId}', table_id)
1834
+ .gsub('{key}', key)
1835
+
1836
+ if database_id.nil?
1837
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1838
+ end
1839
+
1840
+ if table_id.nil?
1841
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
1842
+ end
1843
+
1844
+ if key.nil?
1845
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
1846
+ end
1847
+
1848
+ api_params = {
1849
+ }
1850
+
1851
+ api_headers = {
1852
+ "content-type": 'application/json',
1853
+ }
1854
+
1855
+ @client.call(
1856
+ method: 'DELETE',
1857
+ path: api_path,
1858
+ headers: api_headers,
1859
+ params: api_params,
1860
+ )
1861
+ end
1862
+
1863
+ # Update relationship column. [Learn more about relationship
1864
+ # columns](https://appwrite.io/docs/databases-relationships#relationship-columns).
1865
+ #
1866
+ #
1867
+ # @param [String] database_id Database ID.
1868
+ # @param [String] table_id Table ID.
1869
+ # @param [String] key Column Key.
1870
+ # @param [RelationMutate] on_delete Constraints option
1871
+ # @param [String] new_key New Column Key.
1872
+ #
1873
+ # @return [ColumnRelationship]
1874
+ def update_relationship_column(database_id:, table_id:, key:, on_delete: nil, new_key: nil)
1875
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship'
1876
+ .gsub('{databaseId}', database_id)
1877
+ .gsub('{tableId}', table_id)
1878
+ .gsub('{key}', key)
1879
+
1880
+ if database_id.nil?
1881
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1882
+ end
1883
+
1884
+ if table_id.nil?
1885
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
1886
+ end
1887
+
1888
+ if key.nil?
1889
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
1890
+ end
1891
+
1892
+ api_params = {
1893
+ onDelete: on_delete,
1894
+ newKey: new_key,
1895
+ }
1896
+
1897
+ api_headers = {
1898
+ "content-type": 'application/json',
1899
+ }
1900
+
1901
+ @client.call(
1902
+ method: 'PATCH',
1903
+ path: api_path,
1904
+ headers: api_headers,
1905
+ params: api_params,
1906
+ response_type: Models::ColumnRelationship
1907
+ )
1908
+ end
1909
+
1910
+ # List indexes on the table.
1911
+ #
1912
+ # @param [String] database_id Database ID.
1913
+ # @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
1914
+ # @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 columns: key, type, status, attributes, error
1915
+ #
1916
+ # @return [ColumnIndexList]
1917
+ def list_indexes(database_id:, table_id:, queries: nil)
1918
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/indexes'
1919
+ .gsub('{databaseId}', database_id)
1920
+ .gsub('{tableId}', table_id)
1921
+
1922
+ if database_id.nil?
1923
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1924
+ end
1925
+
1926
+ if table_id.nil?
1927
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
1928
+ end
1929
+
1930
+ api_params = {
1931
+ queries: queries,
1932
+ }
1933
+
1934
+ api_headers = {
1935
+ }
1936
+
1937
+ @client.call(
1938
+ method: 'GET',
1939
+ path: api_path,
1940
+ headers: api_headers,
1941
+ params: api_params,
1942
+ response_type: Models::ColumnIndexList
1943
+ )
1944
+ end
1945
+
1946
+ # Creates an index on the columns listed. Your index should include all the
1947
+ # columns you will query in a single request.
1948
+ # Type can be `key`, `fulltext`, or `unique`.
1949
+ #
1950
+ # @param [String] database_id Database ID.
1951
+ # @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
1952
+ # @param [String] key Index Key.
1953
+ # @param [IndexType] type Index type.
1954
+ # @param [Array] columns Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.
1955
+ # @param [Array] orders Array of index orders. Maximum of 100 orders are allowed.
1956
+ # @param [Array] lengths Length of index. Maximum of 100
1957
+ #
1958
+ # @return [ColumnIndex]
1959
+ def create_index(database_id:, table_id:, key:, type:, columns:, orders: nil, lengths: nil)
1960
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/indexes'
1961
+ .gsub('{databaseId}', database_id)
1962
+ .gsub('{tableId}', table_id)
1963
+
1964
+ if database_id.nil?
1965
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1966
+ end
1967
+
1968
+ if table_id.nil?
1969
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
1970
+ end
1971
+
1972
+ if key.nil?
1973
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
1974
+ end
1975
+
1976
+ if type.nil?
1977
+ raise Appwrite::Exception.new('Missing required parameter: "type"')
1978
+ end
1979
+
1980
+ if columns.nil?
1981
+ raise Appwrite::Exception.new('Missing required parameter: "columns"')
1982
+ end
1983
+
1984
+ api_params = {
1985
+ key: key,
1986
+ type: type,
1987
+ columns: columns,
1988
+ orders: orders,
1989
+ lengths: lengths,
1990
+ }
1991
+
1992
+ api_headers = {
1993
+ "content-type": 'application/json',
1994
+ }
1995
+
1996
+ @client.call(
1997
+ method: 'POST',
1998
+ path: api_path,
1999
+ headers: api_headers,
2000
+ params: api_params,
2001
+ response_type: Models::ColumnIndex
2002
+ )
2003
+ end
2004
+
2005
+ # Get index by ID.
2006
+ #
2007
+ # @param [String] database_id Database ID.
2008
+ # @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
2009
+ # @param [String] key Index Key.
2010
+ #
2011
+ # @return [ColumnIndex]
2012
+ def get_index(database_id:, table_id:, key:)
2013
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}'
2014
+ .gsub('{databaseId}', database_id)
2015
+ .gsub('{tableId}', table_id)
2016
+ .gsub('{key}', key)
2017
+
2018
+ if database_id.nil?
2019
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
2020
+ end
2021
+
2022
+ if table_id.nil?
2023
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
2024
+ end
2025
+
2026
+ if key.nil?
2027
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
2028
+ end
2029
+
2030
+ api_params = {
2031
+ }
2032
+
2033
+ api_headers = {
2034
+ }
2035
+
2036
+ @client.call(
2037
+ method: 'GET',
2038
+ path: api_path,
2039
+ headers: api_headers,
2040
+ params: api_params,
2041
+ response_type: Models::ColumnIndex
2042
+ )
2043
+ end
2044
+
2045
+ # Delete an index.
2046
+ #
2047
+ # @param [String] database_id Database ID.
2048
+ # @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
2049
+ # @param [String] key Index Key.
2050
+ #
2051
+ # @return []
2052
+ def delete_index(database_id:, table_id:, key:)
2053
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}'
2054
+ .gsub('{databaseId}', database_id)
2055
+ .gsub('{tableId}', table_id)
2056
+ .gsub('{key}', key)
2057
+
2058
+ if database_id.nil?
2059
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
2060
+ end
2061
+
2062
+ if table_id.nil?
2063
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
2064
+ end
2065
+
2066
+ if key.nil?
2067
+ raise Appwrite::Exception.new('Missing required parameter: "key"')
2068
+ end
2069
+
2070
+ api_params = {
2071
+ }
2072
+
2073
+ api_headers = {
2074
+ "content-type": 'application/json',
2075
+ }
2076
+
2077
+ @client.call(
2078
+ method: 'DELETE',
2079
+ path: api_path,
2080
+ headers: api_headers,
2081
+ params: api_params,
2082
+ )
2083
+ end
2084
+
2085
+ # Get a list of all the user's rows in a given table. You can use the query
2086
+ # params to filter your results.
2087
+ #
2088
+ # @param [String] database_id Database ID.
2089
+ # @param [String] table_id Table ID. You can create a new table using the TableDB service [server integration](https://appwrite.io/docs/server/tablesdbdb#tablesdbCreate).
2090
+ # @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.
2091
+ #
2092
+ # @return [RowList]
2093
+ def list_rows(database_id:, table_id:, queries: nil)
2094
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/rows'
2095
+ .gsub('{databaseId}', database_id)
2096
+ .gsub('{tableId}', table_id)
2097
+
2098
+ if database_id.nil?
2099
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
2100
+ end
2101
+
2102
+ if table_id.nil?
2103
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
2104
+ end
2105
+
2106
+ api_params = {
2107
+ queries: queries,
2108
+ }
2109
+
2110
+ api_headers = {
2111
+ }
2112
+
2113
+ @client.call(
2114
+ method: 'GET',
2115
+ path: api_path,
2116
+ headers: api_headers,
2117
+ params: api_params,
2118
+ response_type: Models::RowList
2119
+ )
2120
+ end
2121
+
2122
+ # Create a new Row. Before using this route, you should create a new table
2123
+ # resource using either a [server
2124
+ # integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable)
2125
+ # API or directly from your database console.
2126
+ #
2127
+ # @param [String] database_id Database ID.
2128
+ # @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.
2129
+ # @param [String] row_id Row 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.
2130
+ # @param [Hash] data Row data as JSON object.
2131
+ # @param [Array] permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
2132
+ #
2133
+ # @return [Row]
2134
+ def create_row(database_id:, table_id:, row_id:, data:, permissions: nil)
2135
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/rows'
2136
+ .gsub('{databaseId}', database_id)
2137
+ .gsub('{tableId}', table_id)
2138
+
2139
+ if database_id.nil?
2140
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
2141
+ end
2142
+
2143
+ if table_id.nil?
2144
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
2145
+ end
2146
+
2147
+ if row_id.nil?
2148
+ raise Appwrite::Exception.new('Missing required parameter: "rowId"')
2149
+ end
2150
+
2151
+ if data.nil?
2152
+ raise Appwrite::Exception.new('Missing required parameter: "data"')
2153
+ end
2154
+
2155
+ api_params = {
2156
+ rowId: row_id,
2157
+ data: data,
2158
+ permissions: permissions,
2159
+ }
2160
+
2161
+ api_headers = {
2162
+ "content-type": 'application/json',
2163
+ }
2164
+
2165
+ @client.call(
2166
+ method: 'POST',
2167
+ path: api_path,
2168
+ headers: api_headers,
2169
+ params: api_params,
2170
+ response_type: Models::Row
2171
+ )
2172
+ end
2173
+
2174
+ # Create new Rows. Before using this route, you should create a new table
2175
+ # resource using either a [server
2176
+ # integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable)
2177
+ # API or directly from your database console.
2178
+ #
2179
+ # @param [String] database_id Database ID.
2180
+ # @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.
2181
+ # @param [Array] rows Array of documents data as JSON objects.
2182
+ #
2183
+ # @return [RowList]
2184
+ def create_rows(database_id:, table_id:, rows:)
2185
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/rows'
2186
+ .gsub('{databaseId}', database_id)
2187
+ .gsub('{tableId}', table_id)
2188
+
2189
+ if database_id.nil?
2190
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
2191
+ end
2192
+
2193
+ if table_id.nil?
2194
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
2195
+ end
2196
+
2197
+ if rows.nil?
2198
+ raise Appwrite::Exception.new('Missing required parameter: "rows"')
2199
+ end
2200
+
2201
+ api_params = {
2202
+ rows: rows,
2203
+ }
2204
+
2205
+ api_headers = {
2206
+ "content-type": 'application/json',
2207
+ }
2208
+
2209
+ @client.call(
2210
+ method: 'POST',
2211
+ path: api_path,
2212
+ headers: api_headers,
2213
+ params: api_params,
2214
+ response_type: Models::RowList
2215
+ )
2216
+ end
2217
+
2218
+ # Create or update Rows. Before using this route, you should create a new
2219
+ # table resource using either a [server
2220
+ # integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable)
2221
+ # API or directly from your database console.
2222
+ #
2223
+ #
2224
+ # @param [String] database_id Database ID.
2225
+ # @param [String] table_id Table ID.
2226
+ # @param [Array] rows Array of row data as JSON objects. May contain partial rows.
2227
+ #
2228
+ # @return [RowList]
2229
+ def upsert_rows(database_id:, table_id:, rows:)
2230
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/rows'
2231
+ .gsub('{databaseId}', database_id)
2232
+ .gsub('{tableId}', table_id)
2233
+
2234
+ if database_id.nil?
2235
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
2236
+ end
2237
+
2238
+ if table_id.nil?
2239
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
2240
+ end
2241
+
2242
+ if rows.nil?
2243
+ raise Appwrite::Exception.new('Missing required parameter: "rows"')
2244
+ end
2245
+
2246
+ api_params = {
2247
+ rows: rows,
2248
+ }
2249
+
2250
+ api_headers = {
2251
+ "content-type": 'application/json',
2252
+ }
2253
+
2254
+ @client.call(
2255
+ method: 'PUT',
2256
+ path: api_path,
2257
+ headers: api_headers,
2258
+ params: api_params,
2259
+ response_type: Models::RowList
2260
+ )
2261
+ end
2262
+
2263
+ # Update all rows that match your queries, if no queries are submitted then
2264
+ # all rows are updated. You can pass only specific fields to be updated.
2265
+ #
2266
+ # @param [String] database_id Database ID.
2267
+ # @param [String] table_id Table ID.
2268
+ # @param [Hash] data Row data as JSON object. Include only column and value pairs to be updated.
2269
+ # @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.
2270
+ #
2271
+ # @return [RowList]
2272
+ def update_rows(database_id:, table_id:, data: nil, queries: nil)
2273
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/rows'
2274
+ .gsub('{databaseId}', database_id)
2275
+ .gsub('{tableId}', table_id)
2276
+
2277
+ if database_id.nil?
2278
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
2279
+ end
2280
+
2281
+ if table_id.nil?
2282
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
2283
+ end
2284
+
2285
+ api_params = {
2286
+ data: data,
2287
+ queries: queries,
2288
+ }
2289
+
2290
+ api_headers = {
2291
+ "content-type": 'application/json',
2292
+ }
2293
+
2294
+ @client.call(
2295
+ method: 'PATCH',
2296
+ path: api_path,
2297
+ headers: api_headers,
2298
+ params: api_params,
2299
+ response_type: Models::RowList
2300
+ )
2301
+ end
2302
+
2303
+ # Bulk delete rows using queries, if no queries are passed then all rows are
2304
+ # deleted.
2305
+ #
2306
+ # @param [String] database_id Database ID.
2307
+ # @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
2308
+ # @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.
2309
+ #
2310
+ # @return [RowList]
2311
+ def delete_rows(database_id:, table_id:, queries: nil)
2312
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/rows'
2313
+ .gsub('{databaseId}', database_id)
2314
+ .gsub('{tableId}', table_id)
2315
+
2316
+ if database_id.nil?
2317
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
2318
+ end
2319
+
2320
+ if table_id.nil?
2321
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
2322
+ end
2323
+
2324
+ api_params = {
2325
+ queries: queries,
2326
+ }
2327
+
2328
+ api_headers = {
2329
+ "content-type": 'application/json',
2330
+ }
2331
+
2332
+ @client.call(
2333
+ method: 'DELETE',
2334
+ path: api_path,
2335
+ headers: api_headers,
2336
+ params: api_params,
2337
+ response_type: Models::RowList
2338
+ )
2339
+ end
2340
+
2341
+ # Get a row by its unique ID. This endpoint response returns a JSON object
2342
+ # with the row data.
2343
+ #
2344
+ # @param [String] database_id Database ID.
2345
+ # @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
2346
+ # @param [String] row_id Row ID.
2347
+ # @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.
2348
+ #
2349
+ # @return [Row]
2350
+ def get_row(database_id:, table_id:, row_id:, queries: nil)
2351
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'
2352
+ .gsub('{databaseId}', database_id)
2353
+ .gsub('{tableId}', table_id)
2354
+ .gsub('{rowId}', row_id)
2355
+
2356
+ if database_id.nil?
2357
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
2358
+ end
2359
+
2360
+ if table_id.nil?
2361
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
2362
+ end
2363
+
2364
+ if row_id.nil?
2365
+ raise Appwrite::Exception.new('Missing required parameter: "rowId"')
2366
+ end
2367
+
2368
+ api_params = {
2369
+ queries: queries,
2370
+ }
2371
+
2372
+ api_headers = {
2373
+ }
2374
+
2375
+ @client.call(
2376
+ method: 'GET',
2377
+ path: api_path,
2378
+ headers: api_headers,
2379
+ params: api_params,
2380
+ response_type: Models::Row
2381
+ )
2382
+ end
2383
+
2384
+ # Create or update a Row. Before using this route, you should create a new
2385
+ # table resource using either a [server
2386
+ # integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable)
2387
+ # API or directly from your database console.
2388
+ #
2389
+ # @param [String] database_id Database ID.
2390
+ # @param [String] table_id Table ID.
2391
+ # @param [String] row_id Row ID.
2392
+ # @param [Hash] data Row data as JSON object. Include all required columns of the row to be created or updated.
2393
+ # @param [Array] permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
2394
+ #
2395
+ # @return [Row]
2396
+ def upsert_row(database_id:, table_id:, row_id:, data: nil, permissions: nil)
2397
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'
2398
+ .gsub('{databaseId}', database_id)
2399
+ .gsub('{tableId}', table_id)
2400
+ .gsub('{rowId}', row_id)
2401
+
2402
+ if database_id.nil?
2403
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
2404
+ end
2405
+
2406
+ if table_id.nil?
2407
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
2408
+ end
2409
+
2410
+ if row_id.nil?
2411
+ raise Appwrite::Exception.new('Missing required parameter: "rowId"')
2412
+ end
2413
+
2414
+ api_params = {
2415
+ data: data,
2416
+ permissions: permissions,
2417
+ }
2418
+
2419
+ api_headers = {
2420
+ "content-type": 'application/json',
2421
+ }
2422
+
2423
+ @client.call(
2424
+ method: 'PUT',
2425
+ path: api_path,
2426
+ headers: api_headers,
2427
+ params: api_params,
2428
+ response_type: Models::Row
2429
+ )
2430
+ end
2431
+
2432
+ # Update a row by its unique ID. Using the patch method you can pass only
2433
+ # specific fields that will get updated.
2434
+ #
2435
+ # @param [String] database_id Database ID.
2436
+ # @param [String] table_id Table ID.
2437
+ # @param [String] row_id Row ID.
2438
+ # @param [Hash] data Row data as JSON object. Include only columns and value pairs to be updated.
2439
+ # @param [Array] permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
2440
+ #
2441
+ # @return [Row]
2442
+ def update_row(database_id:, table_id:, row_id:, data: nil, permissions: nil)
2443
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'
2444
+ .gsub('{databaseId}', database_id)
2445
+ .gsub('{tableId}', table_id)
2446
+ .gsub('{rowId}', row_id)
2447
+
2448
+ if database_id.nil?
2449
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
2450
+ end
2451
+
2452
+ if table_id.nil?
2453
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
2454
+ end
2455
+
2456
+ if row_id.nil?
2457
+ raise Appwrite::Exception.new('Missing required parameter: "rowId"')
2458
+ end
2459
+
2460
+ api_params = {
2461
+ data: data,
2462
+ permissions: permissions,
2463
+ }
2464
+
2465
+ api_headers = {
2466
+ "content-type": 'application/json',
2467
+ }
2468
+
2469
+ @client.call(
2470
+ method: 'PATCH',
2471
+ path: api_path,
2472
+ headers: api_headers,
2473
+ params: api_params,
2474
+ response_type: Models::Row
2475
+ )
2476
+ end
2477
+
2478
+ # Delete a row by its unique ID.
2479
+ #
2480
+ # @param [String] database_id Database ID.
2481
+ # @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
2482
+ # @param [String] row_id Row ID.
2483
+ #
2484
+ # @return []
2485
+ def delete_row(database_id:, table_id:, row_id:)
2486
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'
2487
+ .gsub('{databaseId}', database_id)
2488
+ .gsub('{tableId}', table_id)
2489
+ .gsub('{rowId}', row_id)
2490
+
2491
+ if database_id.nil?
2492
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
2493
+ end
2494
+
2495
+ if table_id.nil?
2496
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
2497
+ end
2498
+
2499
+ if row_id.nil?
2500
+ raise Appwrite::Exception.new('Missing required parameter: "rowId"')
2501
+ end
2502
+
2503
+ api_params = {
2504
+ }
2505
+
2506
+ api_headers = {
2507
+ "content-type": 'application/json',
2508
+ }
2509
+
2510
+ @client.call(
2511
+ method: 'DELETE',
2512
+ path: api_path,
2513
+ headers: api_headers,
2514
+ params: api_params,
2515
+ )
2516
+ end
2517
+
2518
+ # Decrement a specific column of a row by a given value.
2519
+ #
2520
+ # @param [String] database_id Database ID.
2521
+ # @param [String] table_id Table ID.
2522
+ # @param [String] row_id Row ID.
2523
+ # @param [String] column Column key.
2524
+ # @param [Float] value Value to increment the column by. The value must be a number.
2525
+ # @param [Float] min Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.
2526
+ #
2527
+ # @return [Row]
2528
+ def decrement_row_column(database_id:, table_id:, row_id:, column:, value: nil, min: nil)
2529
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement'
2530
+ .gsub('{databaseId}', database_id)
2531
+ .gsub('{tableId}', table_id)
2532
+ .gsub('{rowId}', row_id)
2533
+ .gsub('{column}', column)
2534
+
2535
+ if database_id.nil?
2536
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
2537
+ end
2538
+
2539
+ if table_id.nil?
2540
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
2541
+ end
2542
+
2543
+ if row_id.nil?
2544
+ raise Appwrite::Exception.new('Missing required parameter: "rowId"')
2545
+ end
2546
+
2547
+ if column.nil?
2548
+ raise Appwrite::Exception.new('Missing required parameter: "column"')
2549
+ end
2550
+
2551
+ api_params = {
2552
+ value: value,
2553
+ min: min,
2554
+ }
2555
+
2556
+ api_headers = {
2557
+ "content-type": 'application/json',
2558
+ }
2559
+
2560
+ @client.call(
2561
+ method: 'PATCH',
2562
+ path: api_path,
2563
+ headers: api_headers,
2564
+ params: api_params,
2565
+ response_type: Models::Row
2566
+ )
2567
+ end
2568
+
2569
+ # Increment a specific column of a row by a given value.
2570
+ #
2571
+ # @param [String] database_id Database ID.
2572
+ # @param [String] table_id Table ID.
2573
+ # @param [String] row_id Row ID.
2574
+ # @param [String] column Column key.
2575
+ # @param [Float] value Value to increment the column by. The value must be a number.
2576
+ # @param [Float] max Maximum value for the column. If the current value is greater than this value, an error will be thrown.
2577
+ #
2578
+ # @return [Row]
2579
+ def increment_row_column(database_id:, table_id:, row_id:, column:, value: nil, max: nil)
2580
+ api_path = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment'
2581
+ .gsub('{databaseId}', database_id)
2582
+ .gsub('{tableId}', table_id)
2583
+ .gsub('{rowId}', row_id)
2584
+ .gsub('{column}', column)
2585
+
2586
+ if database_id.nil?
2587
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
2588
+ end
2589
+
2590
+ if table_id.nil?
2591
+ raise Appwrite::Exception.new('Missing required parameter: "tableId"')
2592
+ end
2593
+
2594
+ if row_id.nil?
2595
+ raise Appwrite::Exception.new('Missing required parameter: "rowId"')
2596
+ end
2597
+
2598
+ if column.nil?
2599
+ raise Appwrite::Exception.new('Missing required parameter: "column"')
2600
+ end
2601
+
2602
+ api_params = {
2603
+ value: value,
2604
+ max: max,
2605
+ }
2606
+
2607
+ api_headers = {
2608
+ "content-type": 'application/json',
2609
+ }
2610
+
2611
+ @client.call(
2612
+ method: 'PATCH',
2613
+ path: api_path,
2614
+ headers: api_headers,
2615
+ params: api_params,
2616
+ response_type: Models::Row
2617
+ )
2618
+ end
2619
+
2620
+ end
2621
+ end