@@ -19,6 +19,8 @@ typedef DatabaseConnection = GetDatabaseConnectionResponse;
19
19
/// gRPC client used for retrieving, uploading, and modifying stored data from app.viam.com.
20
20
///
21
21
/// All calls must be authenticated.
22
+ ///
23
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
22
24
class DataClient {
23
25
final DataServiceClient _dataClient;
24
26
final DataSyncServiceClient _dataSyncClient;
@@ -43,6 +45,8 @@ class DataClient {
43
45
44
46
/// Filter and download tabular data. The data will be paginated into pages of `limit` items, and the last ID will be included in
45
47
/// the returned response.
48
+ ///
49
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
46
50
Future <TabularDataByFilterResponse > tabularDataByFilter (
47
51
{Filter ? filter, int ? limit, Order ? sortOrder, String ? last, countOnly = false }) async {
48
52
final dataRequest = _makeDataRequest (filter, limit, last, sortOrder);
@@ -54,6 +58,8 @@ class DataClient {
54
58
55
59
/// Filter and download binary data. The data will be paginated into pages of `limit` items, and the last ID will be included in the
56
60
/// returned response.
61
+ ///
62
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
57
63
Future <BinaryDataByFilterResponse > binaryDataByFilter (
58
64
{Filter ? filter, int ? limit, Order ? sortOrder, String ? last, countOnly = false }) async {
59
65
final dataRequest = _makeDataRequest (filter, limit, last, sortOrder);
@@ -64,13 +70,17 @@ class DataClient {
64
70
}
65
71
66
72
/// Retrieve binary data by IDs
73
+ ///
74
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
67
75
Future <List <BinaryData >> binaryDataByIds (List <BinaryID > binaryIds) async {
68
76
final request = BinaryDataByIDsRequest ()..binaryIds.addAll (binaryIds);
69
77
final response = await _dataClient.binaryDataByIDs (request);
70
78
return response.data;
71
79
}
72
80
73
81
/// Obtain unified tabular data and metadata, queried with SQL.
82
+ ///
83
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
74
84
Future <List <Map <String , dynamic >>> tabularDataBySql (String organizationId, String query) async {
75
85
final request = TabularDataBySQLRequest ()
76
86
..organizationId = organizationId
@@ -80,6 +90,8 @@ class DataClient {
80
90
}
81
91
82
92
/// Obtain unified tabular data and metadata, queried with MQL.
93
+ ///
94
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
83
95
Future <List <Map <String , dynamic >>> tabularDataByMql (String organizationId, List <Uint8List > query) async {
84
96
final request = TabularDataByMQLRequest ()
85
97
..organizationId = organizationId
@@ -91,6 +103,8 @@ class DataClient {
91
103
/// Delete tabular data older than a provided number of days from an organization.
92
104
///
93
105
/// Returns the number of pieces of data that were deleted.
106
+ ///
107
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
94
108
Future <int > deleteTabularData (String organizationId, int olderThanDays) async {
95
109
final request = DeleteTabularDataRequest ()
96
110
..organizationId = organizationId
@@ -103,6 +117,8 @@ class DataClient {
103
117
/// If a [filter] is not provided, all data will be deleted.
104
118
///
105
119
/// Returns the number of pieces of data that were deleted.
120
+ ///
121
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
106
122
Future <int > deleteBinaryDataByFilter (Filter ? filter, {bool includeInternalData = false }) async {
107
123
final request = DeleteBinaryDataByFilterRequest ()
108
124
..includeInternalData = includeInternalData
@@ -114,13 +130,17 @@ class DataClient {
114
130
/// Delete binary data based on data ID.
115
131
///
116
132
/// Returns the number of pieces of data that were deleted.
133
+ ///
134
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
117
135
Future <int > deleteBinaryDataByIds (List <BinaryID > binaryIds) async {
118
136
final request = DeleteBinaryDataByIDsRequest ()..binaryIds.addAll (binaryIds);
119
137
final response = await _dataClient.deleteBinaryDataByIDs (request);
120
138
return response.deletedCount.toInt ();
121
139
}
122
140
123
141
/// Adds tags to binary data based on IDs.
142
+ ///
143
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
124
144
Future <void > addTagsToBinaryDataByIds (List <String > tags, List <BinaryID > binaryIds) async {
125
145
final request = AddTagsToBinaryDataByIDsRequest ()
126
146
..tags.addAll (tags)
@@ -130,6 +150,8 @@ class DataClient {
130
150
131
151
/// Adds tags to binary data based on a filter.
132
152
/// If no [filter] is provided, all binary data will be tagged.
153
+ ///
154
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
133
155
Future <void > addTagsToBinaryDataByFilter (List <String > tags, Filter ? filter) async {
134
156
final request = AddTagsToBinaryDataByFilterRequest ()
135
157
..tags.addAll (tags)
@@ -141,6 +163,8 @@ class DataClient {
141
163
/// If a [filter] is not provided, the tags will be removed from all data.
142
164
///
143
165
/// Returns the number of tags deleted.
166
+ ///
167
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
144
168
Future <int > removeTagsFromBinaryDataByFilter (List <String > tags, Filter ? filter) async {
145
169
final request = RemoveTagsFromBinaryDataByFilterRequest ()
146
170
..tags.addAll (tags)
@@ -152,6 +176,8 @@ class DataClient {
152
176
/// Remove tags from binary data based on IDs.
153
177
///
154
178
/// Returns the number of tags deleted.
179
+ ///
180
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
155
181
Future <int > removeTagsFromBinaryDataByIds (List <String > tags, List <BinaryID > binaryIds) async {
156
182
final request = RemoveTagsFromBinaryDataByIDsRequest ()
157
183
..tags.addAll (tags)
@@ -163,6 +189,8 @@ class DataClient {
163
189
/// Add a bounding box to an image by ID, with x and y coordinates normalized from 0 to 1.
164
190
///
165
191
/// Returns the bounding box ID.
192
+ ///
193
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
166
194
Future <String > addBoundingBoxToImageById (
167
195
String label, BinaryID binaryId, double xMinNormalized, double yMinNormalized, double xMaxNormalized, double yMaxNormalized) async {
168
196
final request = AddBoundingBoxToImageByIDRequest ()
@@ -177,6 +205,8 @@ class DataClient {
177
205
}
178
206
179
207
/// Removes a bounding box from an image based on bbox ID and image ID.
208
+ ///
209
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
180
210
Future <void > removeBoundingBoxFromImageById (String bboxId, BinaryID binaryId) async {
181
211
final request = RemoveBoundingBoxFromImageByIDRequest ()
182
212
..bboxId = bboxId
@@ -186,6 +216,8 @@ class DataClient {
186
216
187
217
/// Returns a list of tags based on a filter.
188
218
/// If no [filter] is provided, all tags will be returned.
219
+ ///
220
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
189
221
Future <List <String >> tagsByFilter (Filter ? filter) async {
190
222
final request = TagsByFilterRequest ()..filter = filter ?? Filter ();
191
223
final response = await _dataClient.tagsByFilter (request);
@@ -194,19 +226,25 @@ class DataClient {
194
226
195
227
/// Returns a list of bounding box labels based on a filter.
196
228
/// If no [filter] is provided, all labels will be returned.
229
+ ///
230
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
197
231
Future <List <String >> boundingBoxLabelsByFilter (Filter ? filter) async {
198
232
final request = BoundingBoxLabelsByFilterRequest ()..filter = filter ?? Filter ();
199
233
final response = await _dataClient.boundingBoxLabelsByFilter (request);
200
234
return response.labels;
201
235
}
202
236
203
237
/// Returns a database connection to access a MongoDB Atlas Data Federation instance.
238
+ ///
239
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
204
240
Future <DatabaseConnection > getDatabaseConnection (String organizationId) async {
205
241
final request = GetDatabaseConnectionRequest ()..organizationId = organizationId;
206
242
return await _dataClient.getDatabaseConnection (request);
207
243
}
208
244
209
245
/// Configures a database user for Viam's MongoDB Atlas Data Federation instance.
246
+ ///
247
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
210
248
Future <void > configureDatabaseUser (String organizationId, String password) async {
211
249
final request = ConfigureDatabaseUserRequest ()
212
250
..password = password
@@ -215,6 +253,8 @@ class DataClient {
215
253
}
216
254
217
255
/// Adds binary data to a dataset based on IDs.
256
+ ///
257
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
218
258
Future <void > addBinaryDataToDatasetByIds (List <BinaryID > binaryIds, String datasetId) async {
219
259
final request = AddBinaryDataToDatasetByIDsRequest ()
220
260
..binaryIds.addAll (binaryIds)
@@ -223,6 +263,8 @@ class DataClient {
223
263
}
224
264
225
265
/// Removes binary data from a dataset based on IDs.
266
+ ///
267
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
226
268
Future <void > removeBinaryDataFromDatasetByIds (List <BinaryID > binaryIds, String datasetId) async {
227
269
final request = RemoveBinaryDataFromDatasetByIDsRequest ()
228
270
..binaryIds.addAll (binaryIds)
@@ -233,6 +275,8 @@ class DataClient {
233
275
/// Upload an image to Viam's Data Manager
234
276
///
235
277
/// If no name is provided, the current timestamp will be used as the filename.
278
+ ///
279
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
236
280
Future <String > uploadImage (ViamImage image, String partId,
237
281
{String ? fileName,
238
282
String ? componentType,
@@ -263,6 +307,8 @@ class DataClient {
263
307
/// Upload a file from its path to Viam's Data Manager
264
308
///
265
309
/// The file name can be overridden by providing the [fileName] parameter.
310
+ ///
311
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
266
312
Future <String > uploadFile (String path, String partId,
267
313
{String ? fileName,
268
314
String ? componentType,
@@ -307,6 +353,8 @@ class DataClient {
307
353
/// Upload binary sensor data to Viam's Data Manager
308
354
///
309
355
/// Returns the data's file ID.
356
+ ///
357
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
310
358
Future <String > binaryDataCaptureUpload (List <int > binaryData, String partId, String fileExtension,
311
359
{String ? componentType,
312
360
String ? componentName,
@@ -349,6 +397,8 @@ class DataClient {
349
397
/// Upload tabular sensor data to Viam's Data Manager
350
398
///
351
399
/// Returns the data's file ID.
400
+ ///
401
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
352
402
Future <String > tabularDataCaptureUpload (List <Map <String , dynamic >> tabularData, String partId,
353
403
{String ? componentType,
354
404
String ? componentName,
@@ -392,6 +442,8 @@ class DataClient {
392
442
/// Uploads the metadata and contents of streaming binary data
393
443
///
394
444
/// Returns the data's file ID.
445
+ ///
446
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
395
447
Future <String > streamingDataCaptureUpload (List <int > bytes, String partId, String fileExtension,
396
448
{String ? componentType,
397
449
String ? componentName,
@@ -433,6 +485,8 @@ class DataClient {
433
485
}
434
486
435
487
/// Creates a new dataset, returning the new dataset's ID.
488
+ ///
489
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
436
490
Future <String > createDataset (String orgId, String name) async {
437
491
final request = CreateDatasetRequest ()
438
492
..organizationId = orgId
@@ -442,12 +496,16 @@ class DataClient {
442
496
}
443
497
444
498
/// Deletes a dataset.
499
+ ///
500
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
445
501
Future <void > deleteDataset (String id) async {
446
502
final request = DeleteDatasetRequest ()..id = id;
447
503
await _datasetClient.deleteDataset (request);
448
504
}
449
505
450
506
/// Renames a dataset by ID.
507
+ ///
508
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
451
509
Future <void > renameDataset (String id, String name) async {
452
510
final request = RenameDatasetRequest ()
453
511
..id = id
@@ -456,13 +514,17 @@ class DataClient {
456
514
}
457
515
458
516
/// Returns a list of datasets within a given organization.
517
+ ///
518
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
459
519
Future <List <Dataset >> listDatasetsByOrganizationID (String orgId) async {
460
520
final request = ListDatasetsByOrganizationIDRequest ()..organizationId = orgId;
461
521
final response = await _datasetClient.listDatasetsByOrganizationID (request);
462
522
return response.datasets;
463
523
}
464
524
465
525
/// Looks up and returns a list of datasets by their IDs.
526
+ ///
527
+ /// For more information, see [Data Client API] (https://docs.viam.com/appendix/apis/data-client/).
466
528
Future <List <Dataset >> listDatasetsByIDs (List <String > ids) async {
467
529
final request = ListDatasetsByIDsRequest ()..ids.addAll (ids);
468
530
final response = await _datasetClient.listDatasetsByIDs (request);
0 commit comments