deleteTabularData method

Future<int> deleteTabularData(
  1. String organizationId,
  2. int olderThanDays
)

Delete tabular data older than a provided number of days from an organization.

Returns the number of pieces of data that were deleted.

_viam = await Viam.withApiKey(
    dotenv.env['API_KEY_ID'] ?? '',
    dotenv.env['API_KEY'] ?? ''
);
final dataClient = _viam.dataClient;

try {
  dataClient.deleteTabularData("<YOUR-ORG-ID>", 5);

 print('Successfully deleted tabular data');
} catch (e) {
 print('Error deleting tabular data: $e');
}

For more information, see Data Client API.

Implementation

Future<int> deleteTabularData(String organizationId, int olderThanDays) async {
  final request = DeleteTabularDataRequest()
    ..organizationId = organizationId
    ..deleteOlderThanDays = olderThanDays;
  final response = await _dataClient.deleteTabularData(request);
  return response.deletedCount.toInt();
}