use of com.ibm.watson.discovery.v1.model.TrainingDataSet in project java-sdk by watson-developer-cloud.
the class DiscoveryServiceIT method deleteAllCollectionTrainingDataIsSuccessful.
@Test
public void deleteAllCollectionTrainingDataIsSuccessful() {
String collId = setupTestQueries(collectionId);
DeleteAllTrainingDataOptions.Builder deleteBuilder = new DeleteAllTrainingDataOptions.Builder(environmentId, collId);
discovery.deleteAllTrainingData(deleteBuilder.build()).execute();
ListTrainingDataOptions.Builder listBuilder = new ListTrainingDataOptions.Builder(environmentId, collId);
TrainingDataSet trainingData = discovery.listTrainingData(listBuilder.build()).execute();
assertEquals(trainingData.getQueries().size(), 0);
}
use of com.ibm.watson.discovery.v1.model.TrainingDataSet in project java-sdk by watson-developer-cloud.
the class Discovery method listTrainingData.
/**
* Lists the training data for this collection.
*
* @param listTrainingDataOptions the {@link ListTrainingDataOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of {@link TrainingDataSet}
*/
public ServiceCall<TrainingDataSet> listTrainingData(ListTrainingDataOptions listTrainingDataOptions) {
Validator.notNull(listTrainingDataOptions, "listTrainingDataOptions cannot be null");
String[] pathSegments = { "v1/environments", "collections", "training_data" };
String[] pathParameters = { listTrainingDataOptions.environmentId(), listTrainingDataOptions.collectionId() };
RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters));
builder.query(VERSION, versionDate);
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(TrainingDataSet.class));
}
Aggregations