Skip to content

Commit 7e0d978

Browse files
Merge pull request #879 from watson-developer-cloud/codegen/discovery
[Discovery] Add newest generated code and update tests
2 parents 902dc4b + 4edd475 commit 7e0d978

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+728
-2376
lines changed

discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/Discovery.java

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -99,19 +99,6 @@ public class Discovery extends WatsonService {
9999

100100
private String versionDate;
101101

102-
/** The Constant VERSION_DATE_2017_11_07. */
103-
public static final String VERSION_DATE_2017_11_07 = "2017-11-07";
104-
/** The Constant VERSION_DATE_2017_09_01. */
105-
public static final String VERSION_DATE_2017_09_01 = "2017-09-01";
106-
/** The Constant VERSION_DATE_2017_08_01. */
107-
public static final String VERSION_DATE_2017_08_01 = "2017-08-01";
108-
/** The Constant VERSION_DATE_2017_07_19. */
109-
public static final String VERSION_DATE_2017_07_19 = "2017-07-19";
110-
/** The Constant VERSION_DATE_2017_06_25. */
111-
public static final String VERSION_DATE_2017_06_25 = "2017-06-25";
112-
/** The Constant VERSION_DATE_2016_12_01. */
113-
public static final String VERSION_DATE_2016_12_01 = "2016-12-01";
114-
115102
/**
116103
* Instantiates a new `Discovery`.
117104
*
@@ -124,8 +111,7 @@ public Discovery(String versionDate) {
124111
setEndPoint(URL);
125112
}
126113

127-
Validator.isTrue((versionDate != null) && !versionDate.isEmpty(),
128-
"'version cannot be null. Use " + VERSION_DATE_2017_11_07);
114+
Validator.isTrue((versionDate != null) && !versionDate.isEmpty(), "version cannot be null.");
129115

130116
this.versionDate = versionDate;
131117
}
@@ -227,9 +213,9 @@ public ServiceCall<ListEnvironmentsResponse> listEnvironments() {
227213
}
228214

229215
/**
230-
* List fields in specified collecitons.
216+
* List fields in specified collections.
231217
*
232-
* Gets a list of the unique fields (and their types) stored in the indexes of the specified collecitons.
218+
* Gets a list of the unique fields (and their types) stored in the indexes of the specified collections.
233219
*
234220
* @param listFieldsOptions the {@link ListFieldsOptions} containing the options for the call
235221
* @return a {@link ServiceCall} with a response type of {@link ListCollectionFieldsResponse}
@@ -763,6 +749,15 @@ public ServiceCall<QueryResponse> federatedQuery(FederatedQueryOptions federated
763749
if (federatedQueryOptions.deduplicateField() != null) {
764750
builder.query("deduplicate.field", federatedQueryOptions.deduplicateField());
765751
}
752+
if (federatedQueryOptions.similar() != null) {
753+
builder.query("similar", String.valueOf(federatedQueryOptions.similar()));
754+
}
755+
if (federatedQueryOptions.similarDocumentIds() != null) {
756+
builder.query("similar.document_ids", RequestUtils.join(federatedQueryOptions.similarDocumentIds(), ","));
757+
}
758+
if (federatedQueryOptions.similarFields() != null) {
759+
builder.query("similar.fields", RequestUtils.join(federatedQueryOptions.similarFields(), ","));
760+
}
766761
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(QueryResponse.class));
767762
}
768763

@@ -814,6 +809,15 @@ public ServiceCall<QueryNoticesResponse> federatedQueryNotices(
814809
if (federatedQueryNoticesOptions.deduplicateField() != null) {
815810
builder.query("deduplicate.field", federatedQueryNoticesOptions.deduplicateField());
816811
}
812+
if (federatedQueryNoticesOptions.similar() != null) {
813+
builder.query("similar", String.valueOf(federatedQueryNoticesOptions.similar()));
814+
}
815+
if (federatedQueryNoticesOptions.similarDocumentIds() != null) {
816+
builder.query("similar.document_ids", RequestUtils.join(federatedQueryNoticesOptions.similarDocumentIds(), ","));
817+
}
818+
if (federatedQueryNoticesOptions.similarFields() != null) {
819+
builder.query("similar.fields", RequestUtils.join(federatedQueryNoticesOptions.similarFields(), ","));
820+
}
817821
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(QueryNoticesResponse.class));
818822
}
819823

@@ -876,6 +880,15 @@ public ServiceCall<QueryResponse> query(QueryOptions queryOptions) {
876880
if (queryOptions.deduplicateField() != null) {
877881
builder.query("deduplicate.field", queryOptions.deduplicateField());
878882
}
883+
if (queryOptions.similar() != null) {
884+
builder.query("similar", String.valueOf(queryOptions.similar()));
885+
}
886+
if (queryOptions.similarDocumentIds() != null) {
887+
builder.query("similar.document_ids", RequestUtils.join(queryOptions.similarDocumentIds(), ","));
888+
}
889+
if (queryOptions.similarFields() != null) {
890+
builder.query("similar.fields", RequestUtils.join(queryOptions.similarFields(), ","));
891+
}
879892
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(QueryResponse.class));
880893
}
881894

@@ -968,6 +981,15 @@ public ServiceCall<QueryNoticesResponse> queryNotices(QueryNoticesOptions queryN
968981
if (queryNoticesOptions.deduplicateField() != null) {
969982
builder.query("deduplicate.field", queryNoticesOptions.deduplicateField());
970983
}
984+
if (queryNoticesOptions.similar() != null) {
985+
builder.query("similar", String.valueOf(queryNoticesOptions.similar()));
986+
}
987+
if (queryNoticesOptions.similarDocumentIds() != null) {
988+
builder.query("similar.document_ids", RequestUtils.join(queryNoticesOptions.similarDocumentIds(), ","));
989+
}
990+
if (queryNoticesOptions.similarFields() != null) {
991+
builder.query("similar.fields", RequestUtils.join(queryNoticesOptions.similarFields(), ","));
992+
}
971993
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(QueryNoticesResponse.class));
972994
}
973995

discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/AggregationResult.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -59,31 +59,4 @@ public Long getMatchingResults() {
5959
public List<QueryAggregation> getAggregations() {
6060
return aggregations;
6161
}
62-
63-
/**
64-
* Sets the key.
65-
*
66-
* @param key the new key
67-
*/
68-
public void setKey(final String key) {
69-
this.key = key;
70-
}
71-
72-
/**
73-
* Sets the matchingResults.
74-
*
75-
* @param matchingResults the new matchingResults
76-
*/
77-
public void setMatchingResults(final long matchingResults) {
78-
this.matchingResults = matchingResults;
79-
}
80-
81-
/**
82-
* Sets the aggregations.
83-
*
84-
* @param aggregations the new aggregations
85-
*/
86-
public void setAggregations(final List<QueryAggregation> aggregations) {
87-
this.aggregations = aggregations;
88-
}
8962
}

discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/Collection.java

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -174,67 +174,4 @@ public CollectionDiskUsage getDiskUsage() {
174174
public TrainingStatus getTrainingStatus() {
175175
return trainingStatus;
176176
}
177-
178-
/**
179-
* Sets the name.
180-
*
181-
* @param name the new name
182-
*/
183-
public void setName(final String name) {
184-
this.name = name;
185-
}
186-
187-
/**
188-
* Sets the description.
189-
*
190-
* @param description the new description
191-
*/
192-
public void setDescription(final String description) {
193-
this.description = description;
194-
}
195-
196-
/**
197-
* Sets the configurationId.
198-
*
199-
* @param configurationId the new configurationId
200-
*/
201-
public void setConfigurationId(final String configurationId) {
202-
this.configurationId = configurationId;
203-
}
204-
205-
/**
206-
* Sets the language.
207-
*
208-
* @param language the new language
209-
*/
210-
public void setLanguage(final String language) {
211-
this.language = language;
212-
}
213-
214-
/**
215-
* Sets the documentCounts.
216-
*
217-
* @param documentCounts the new documentCounts
218-
*/
219-
public void setDocumentCounts(final DocumentCounts documentCounts) {
220-
this.documentCounts = documentCounts;
221-
}
222-
223-
/**
224-
* Sets the diskUsage.
225-
*
226-
* @param diskUsage the new diskUsage
227-
*/
228-
public void setDiskUsage(final CollectionDiskUsage diskUsage) {
229-
this.diskUsage = diskUsage;
230-
}
231-
232-
/**
233-
* Sets the trainingStatus.
234-
*
235-
* @param trainingStatus the new trainingStatus
236-
*/
237-
public void setTrainingStatus(final TrainingStatus trainingStatus) {
238-
this.trainingStatus = trainingStatus;
239-
}
240177
}

discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/CreateCollectionRequest.java

Lines changed: 0 additions & 132 deletions
This file was deleted.

0 commit comments

Comments
 (0)