4242import com .ibm .watson .discovery .v2 .model .QueryNoticesResponse ;
4343import com .ibm .watson .discovery .v2 .model .QueryOptions ;
4444import com .ibm .watson .discovery .v2 .model .QueryResponse ;
45- import com .ibm .watson .discovery .v2 .model .TrainingExample ;
4645import com .ibm .watson .discovery .v2 .model .TrainingQuery ;
4746import com .ibm .watson .discovery .v2 .model .TrainingQuerySet ;
4847import com .ibm .watson .discovery .v2 .model .UpdateDocumentOptions ;
@@ -215,15 +214,13 @@ public ServiceCall<Completions> getAutocompletion(GetAutocompletionOptions getAu
215214 builder .header (header .getKey (), header .getValue ());
216215 }
217216 builder .header ("Accept" , "application/json" );
217+ builder .query ("prefix" , getAutocompletionOptions .prefix ());
218218 if (getAutocompletionOptions .collectionIds () != null ) {
219219 builder .query ("collection_ids" , RequestUtils .join (getAutocompletionOptions .collectionIds (), "," ));
220220 }
221221 if (getAutocompletionOptions .field () != null ) {
222222 builder .query ("field" , getAutocompletionOptions .field ());
223223 }
224- if (getAutocompletionOptions .prefix () != null ) {
225- builder .query ("prefix" , getAutocompletionOptions .prefix ());
226- }
227224 if (getAutocompletionOptions .count () != null ) {
228225 builder .query ("count" , String .valueOf (getAutocompletionOptions .count ()));
229226 }
@@ -264,27 +261,12 @@ public ServiceCall<QueryNoticesResponse> queryNotices(QueryNoticesOptions queryN
264261 if (queryNoticesOptions .naturalLanguageQuery () != null ) {
265262 builder .query ("natural_language_query" , queryNoticesOptions .naturalLanguageQuery ());
266263 }
267- if (queryNoticesOptions .aggregation () != null ) {
268- builder .query ("aggregation" , queryNoticesOptions .aggregation ());
269- }
270264 if (queryNoticesOptions .count () != null ) {
271265 builder .query ("count" , String .valueOf (queryNoticesOptions .count ()));
272266 }
273- if (queryNoticesOptions .xReturn () != null ) {
274- builder .query ("return" , RequestUtils .join (queryNoticesOptions .xReturn (), "," ));
275- }
276267 if (queryNoticesOptions .offset () != null ) {
277268 builder .query ("offset" , String .valueOf (queryNoticesOptions .offset ()));
278269 }
279- if (queryNoticesOptions .sort () != null ) {
280- builder .query ("sort" , RequestUtils .join (queryNoticesOptions .sort (), "," ));
281- }
282- if (queryNoticesOptions .highlight () != null ) {
283- builder .query ("highlight" , String .valueOf (queryNoticesOptions .highlight ()));
284- }
285- if (queryNoticesOptions .spellingSuggestions () != null ) {
286- builder .query ("spelling_suggestions" , String .valueOf (queryNoticesOptions .spellingSuggestions ()));
287- }
288270 ResponseConverter <QueryNoticesResponse > responseConverter = ResponseConverterUtils .getValue (
289271 new com .google .gson .reflect .TypeToken <QueryNoticesResponse >() {
290272 }.getType ());
@@ -633,9 +615,9 @@ public ServiceCall<TrainingQuery> getTrainingQuery(GetTrainingQueryOptions getTr
633615 * Updates an existing training query and it's examples.
634616 *
635617 * @param updateTrainingQueryOptions the {@link UpdateTrainingQueryOptions} containing the options for the call
636- * @return a {@link ServiceCall} with a response type of {@link TrainingExample }
618+ * @return a {@link ServiceCall} with a response type of {@link TrainingQuery }
637619 */
638- public ServiceCall <TrainingExample > updateTrainingQuery (UpdateTrainingQueryOptions updateTrainingQueryOptions ) {
620+ public ServiceCall <TrainingQuery > updateTrainingQuery (UpdateTrainingQueryOptions updateTrainingQueryOptions ) {
639621 com .ibm .cloud .sdk .core .util .Validator .notNull (updateTrainingQueryOptions ,
640622 "updateTrainingQueryOptions cannot be null" );
641623 String [] pathSegments = { "v2/projects" , "training_data/queries" };
@@ -660,8 +642,8 @@ public ServiceCall<TrainingExample> updateTrainingQuery(UpdateTrainingQueryOptio
660642 updateTrainingQueryOptions .examples ()));
661643 }
662644 builder .bodyJson (contentJson );
663- ResponseConverter <TrainingExample > responseConverter = ResponseConverterUtils .getValue (
664- new com .google .gson .reflect .TypeToken <TrainingExample >() {
645+ ResponseConverter <TrainingQuery > responseConverter = ResponseConverterUtils .getValue (
646+ new com .google .gson .reflect .TypeToken <TrainingQuery >() {
665647 }.getType ());
666648 return createServiceCall (builder .build (), responseConverter );
667649 }
0 commit comments