Search in sources :

Example 1 with GetTrainingExampleOptions

use of com.ibm.watson.developer_cloud.discovery.v1.model.GetTrainingExampleOptions in project java-sdk by watson-developer-cloud.

the class Discovery method getTrainingExample.

/**
 * Gets the details for this training example.
 *
 * @param getTrainingExampleOptions the {@link GetTrainingExampleOptions} containing the options for the call
 * @return a {@link ServiceCall} with a response type of {@link TrainingExample}
 */
public ServiceCall<TrainingExample> getTrainingExample(GetTrainingExampleOptions getTrainingExampleOptions) {
    Validator.notNull(getTrainingExampleOptions, "getTrainingExampleOptions cannot be null");
    String[] pathSegments = { "v1/environments", "collections", "training_data", "examples" };
    String[] pathParameters = { getTrainingExampleOptions.environmentId(), getTrainingExampleOptions.collectionId(), getTrainingExampleOptions.queryId(), getTrainingExampleOptions.exampleId() };
    RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters));
    builder.query(VERSION, versionDate);
    return createServiceCall(builder.build(), ResponseConverterUtils.getObject(TrainingExample.class));
}
Also used : RequestBuilder(com.ibm.watson.developer_cloud.http.RequestBuilder) TrainingExample(com.ibm.watson.developer_cloud.discovery.v1.model.TrainingExample)

Aggregations

TrainingExample (com.ibm.watson.developer_cloud.discovery.v1.model.TrainingExample)1 RequestBuilder (com.ibm.watson.developer_cloud.http.RequestBuilder)1