use of com.ibm.watson.developer_cloud.http.RequestBuilder in project java-sdk by watson-developer-cloud.
the class Discovery method getTrainingData.
/**
* Shows details for a specific training data query, including the query string and all examples.
*
* @param getTrainingDataOptions the {@link GetTrainingDataOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of {@link TrainingQuery}
*/
public ServiceCall<TrainingQuery> getTrainingData(GetTrainingDataOptions getTrainingDataOptions) {
Validator.notNull(getTrainingDataOptions, "getTrainingDataOptions cannot be null");
String[] pathSegments = { "v1/environments", "collections", "training_data" };
String[] pathParameters = { getTrainingDataOptions.environmentId(), getTrainingDataOptions.collectionId(), getTrainingDataOptions.queryId() };
RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters));
builder.query(VERSION, versionDate);
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(TrainingQuery.class));
}
use of com.ibm.watson.developer_cloud.http.RequestBuilder in project java-sdk by watson-developer-cloud.
the class Discovery method listCollectionFields.
/**
* List unique fields.
*
* Gets a list of the unique fields (and their types) stored in the index.
*
* @param listCollectionFieldsOptions the {@link ListCollectionFieldsOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of {@link ListCollectionFieldsResponse}
*/
public ServiceCall<ListCollectionFieldsResponse> listCollectionFields(ListCollectionFieldsOptions listCollectionFieldsOptions) {
Validator.notNull(listCollectionFieldsOptions, "listCollectionFieldsOptions cannot be null");
String[] pathSegments = { "v1/environments", "collections", "fields" };
String[] pathParameters = { listCollectionFieldsOptions.environmentId(), listCollectionFieldsOptions.collectionId() };
RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters));
builder.query(VERSION, versionDate);
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(ListCollectionFieldsResponse.class));
}
use of com.ibm.watson.developer_cloud.http.RequestBuilder 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));
}
use of com.ibm.watson.developer_cloud.http.RequestBuilder in project java-sdk by watson-developer-cloud.
the class Discovery method listExpansions.
/**
* List current expansions.
*
* Returns the current expansion list for the specified collection. If an expansion list is not specified, an object
* with empty expansion arrays is returned.
*
* @param listExpansionsOptions the {@link ListExpansionsOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of {@link Expansions}
*/
public ServiceCall<Expansions> listExpansions(ListExpansionsOptions listExpansionsOptions) {
Validator.notNull(listExpansionsOptions, "listExpansionsOptions cannot be null");
String[] pathSegments = { "v1/environments", "collections", "expansions" };
String[] pathParameters = { listExpansionsOptions.environmentId(), listExpansionsOptions.collectionId() };
RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters));
builder.query(VERSION, versionDate);
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Expansions.class));
}
use of com.ibm.watson.developer_cloud.http.RequestBuilder in project java-sdk by watson-developer-cloud.
the class LanguageTranslator method listIdentifiableLanguages.
/**
* List identifiable languages.
*
* Lists the languages that the service can identify. Returns the language code (for example, `en` for English or `es`
* for Spanish) and name of each language.
*
* @param listIdentifiableLanguagesOptions the {@link ListIdentifiableLanguagesOptions} containing the options for the
* call
* @return a {@link ServiceCall} with a response type of {@link IdentifiableLanguages}
*/
public ServiceCall<IdentifiableLanguages> listIdentifiableLanguages(ListIdentifiableLanguagesOptions listIdentifiableLanguagesOptions) {
String[] pathSegments = { "v2/identifiable_languages" };
RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments));
if (listIdentifiableLanguagesOptions != null) {
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(IdentifiableLanguages.class));
}
Aggregations