removeBinaryDataFromDatasetByIds method

Future<void> removeBinaryDataFromDatasetByIds(
  1. List<String> binaryDataIds,
  2. String datasetId
)

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 binaryDataIds = [
  '<YOUR-BINARY-DATA-ID>',
  '<YOUR-BINARY-DATA-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(
     binaryDataIds,
     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<String> binaryDataIds, String datasetId) async {
  final request = RemoveBinaryDataFromDatasetByIDsRequest()
    ..binaryDataIds.addAll(binaryDataIds)
    ..datasetId = datasetId;
  await _dataClient.removeBinaryDataFromDatasetByIDs(request);
}