use of com.ibm.watson.discovery.v2.model.Enrichment in project java-sdk by watson-developer-cloud.
the class Discovery method getEnrichment.
/**
* Get enrichment.
*
* <p>Get details about a specific enrichment.
*
* @param getEnrichmentOptions the {@link GetEnrichmentOptions} containing the options for the
* call
* @return a {@link ServiceCall} with a result of type {@link Enrichment}
*/
public ServiceCall<Enrichment> getEnrichment(GetEnrichmentOptions getEnrichmentOptions) {
com.ibm.cloud.sdk.core.util.Validator.notNull(getEnrichmentOptions, "getEnrichmentOptions cannot be null");
Map<String, String> pathParamsMap = new HashMap<String, String>();
pathParamsMap.put("project_id", getEnrichmentOptions.projectId());
pathParamsMap.put("enrichment_id", getEnrichmentOptions.enrichmentId());
RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v2/projects/{project_id}/enrichments/{enrichment_id}", pathParamsMap));
Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v2", "getEnrichment");
for (Entry<String, String> header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
builder.query("version", String.valueOf(this.version));
ResponseConverter<Enrichment> responseConverter = ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<Enrichment>() {
}.getType());
return createServiceCall(builder.build(), responseConverter);
}
Aggregations