use of com.ibm.watson.natural_language_classifier.v1.model.ClassifierList in project java-sdk by watson-developer-cloud.
the class NaturalLanguageClassifier method listClassifiers.
/**
* List classifiers.
*
* <p>Returns an empty array if no classifiers are available.
*
* @param listClassifiersOptions the {@link ListClassifiersOptions} containing the options for the
* call
* @return a {@link ServiceCall} with a result of type {@link ClassifierList}
*/
public ServiceCall<ClassifierList> listClassifiers(ListClassifiersOptions listClassifiersOptions) {
RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/classifiers"));
Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("natural_language_classifier", "v1", "listClassifiers");
for (Entry<String, String> header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
ResponseConverter<ClassifierList> responseConverter = ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<ClassifierList>() {
}.getType());
return createServiceCall(builder.build(), responseConverter);
}
Aggregations