removeBinaryDataFromDatasetByIds method
Removes binary data from a dataset based on IDs.
_viam = await Viam.withApiKey(
dotenv.env['API_KEY_ID'] ?? '',
dotenv.env['API_KEY'] ?? ''
);
final dataClient = _viam.dataClient;
// Example binary IDs to remove from the dataset
final binaryIds = [
BinaryID(fileId: '<YOUR-FILE-ID>', organizationId: '<YOUR-ORG-ID>', locationId: '<YOUR-LOCATION-ID>'),
BinaryID(fileId: '<YOUR-FILE-ID>', organizationId: '<YOUR-ORG-ID>', locationId: '<YOUR-LOCATION-ID>')
];
// Dataset ID where the binary data will be removed
const datasetId = '<YOUR-DATASET-ID>';
try {
// Remove the binary data from the dataset
await dataClient.removeBinaryDataFromDatasetByIds(
binaryIds,
datasetId
);
print('Successfully removed binary data from dataset');
} catch (e) {
print('Error removing binary data from dataset: $e');
}
For more information, see Data Client API.
Implementation
Future<void> removeBinaryDataFromDatasetByIds(List<BinaryID> binaryIds, String datasetId) async {
final request = RemoveBinaryDataFromDatasetByIDsRequest()
..binaryIds.addAll(binaryIds)
..datasetId = datasetId;
await _dataClient.removeBinaryDataFromDatasetByIDs(request);
}