Skip to content

Commit b7588a8

Browse files
committed
feat(Discovery): Add generated code from newest version of service
1 parent 571b914 commit b7588a8

File tree

113 files changed

+1255
-1232
lines changed

Some content is hidden

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

113 files changed

+1255
-1232
lines changed

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

Lines changed: 351 additions & 142 deletions
Large diffs are not rendered by default.

discovery/src/main/java/com/ibm/watson/discovery/v1/model/AddDocumentOptions.java

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public class AddDocumentOptions extends GenericModel {
2929
private String collectionId;
3030
private InputStream file;
3131
private String filename;
32-
private String metadata;
3332
private String fileContentType;
33+
private String metadata;
3434

3535
/**
3636
* Builder.
@@ -40,16 +40,16 @@ public static class Builder {
4040
private String collectionId;
4141
private InputStream file;
4242
private String filename;
43-
private String metadata;
4443
private String fileContentType;
44+
private String metadata;
4545

4646
private Builder(AddDocumentOptions addDocumentOptions) {
47-
environmentId = addDocumentOptions.environmentId;
48-
collectionId = addDocumentOptions.collectionId;
49-
file = addDocumentOptions.file;
50-
filename = addDocumentOptions.filename;
51-
metadata = addDocumentOptions.metadata;
52-
fileContentType = addDocumentOptions.fileContentType;
47+
this.environmentId = addDocumentOptions.environmentId;
48+
this.collectionId = addDocumentOptions.collectionId;
49+
this.file = addDocumentOptions.file;
50+
this.filename = addDocumentOptions.filename;
51+
this.fileContentType = addDocumentOptions.fileContentType;
52+
this.metadata = addDocumentOptions.metadata;
5353
}
5454

5555
/**
@@ -123,24 +123,24 @@ public Builder filename(String filename) {
123123
}
124124

125125
/**
126-
* Set the metadata.
126+
* Set the fileContentType.
127127
*
128-
* @param metadata the metadata
128+
* @param fileContentType the fileContentType
129129
* @return the AddDocumentOptions builder
130130
*/
131-
public Builder metadata(String metadata) {
132-
this.metadata = metadata;
131+
public Builder fileContentType(String fileContentType) {
132+
this.fileContentType = fileContentType;
133133
return this;
134134
}
135135

136136
/**
137-
* Set the fileContentType.
137+
* Set the metadata.
138138
*
139-
* @param fileContentType the fileContentType
139+
* @param metadata the metadata
140140
* @return the AddDocumentOptions builder
141141
*/
142-
public Builder fileContentType(String fileContentType) {
143-
this.fileContentType = fileContentType;
142+
public Builder metadata(String metadata) {
143+
this.metadata = metadata;
144144
return this;
145145
}
146146

@@ -168,8 +168,8 @@ private AddDocumentOptions(Builder builder) {
168168
collectionId = builder.collectionId;
169169
file = builder.file;
170170
filename = builder.filename;
171-
metadata = builder.metadata;
172171
fileContentType = builder.fileContentType;
172+
metadata = builder.metadata;
173173
}
174174

175175
/**
@@ -206,8 +206,9 @@ public String collectionId() {
206206
/**
207207
* Gets the file.
208208
*
209-
* The content of the document to ingest. The maximum supported file size is 50 megabytes. Files larger than 50
210-
* megabytes is rejected.
209+
* The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50
210+
* megabytes, the maximum supported file size when testing a confiruration is 1 megabyte. Files larger than the
211+
* supported size are rejected.
211212
*
212213
* @return the file
213214
*/
@@ -226,6 +227,17 @@ public String filename() {
226227
return filename;
227228
}
228229

230+
/**
231+
* Gets the fileContentType.
232+
*
233+
* The content type of file. Values for this parameter can be obtained from the HttpMediaType class.
234+
*
235+
* @return the fileContentType
236+
*/
237+
public String fileContentType() {
238+
return fileContentType;
239+
}
240+
229241
/**
230242
* Gets the metadata.
231243
*
@@ -242,15 +254,4 @@ public String filename() {
242254
public String metadata() {
243255
return metadata;
244256
}
245-
246-
/**
247-
* Gets the fileContentType.
248-
*
249-
* The content type of file. Values for this parameter can be obtained from the HttpMediaType class.
250-
*
251-
* @return the fileContentType
252-
*/
253-
public String fileContentType() {
254-
return fileContentType;
255-
}
256257
}

discovery/src/main/java/com/ibm/watson/discovery/v1/model/AddTrainingDataOptions.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ public static class Builder {
4040
private List<TrainingExample> examples;
4141

4242
private Builder(AddTrainingDataOptions addTrainingDataOptions) {
43-
environmentId = addTrainingDataOptions.environmentId;
44-
collectionId = addTrainingDataOptions.collectionId;
45-
naturalLanguageQuery = addTrainingDataOptions.naturalLanguageQuery;
46-
filter = addTrainingDataOptions.filter;
47-
examples = addTrainingDataOptions.examples;
43+
this.environmentId = addTrainingDataOptions.environmentId;
44+
this.collectionId = addTrainingDataOptions.collectionId;
45+
this.naturalLanguageQuery = addTrainingDataOptions.naturalLanguageQuery;
46+
this.filter = addTrainingDataOptions.filter;
47+
this.examples = addTrainingDataOptions.examples;
4848
}
4949

5050
/**
@@ -189,6 +189,8 @@ public String collectionId() {
189189
/**
190190
* Gets the naturalLanguageQuery.
191191
*
192+
* The natural text query for the new training query.
193+
*
192194
* @return the naturalLanguageQuery
193195
*/
194196
public String naturalLanguageQuery() {
@@ -198,6 +200,8 @@ public String naturalLanguageQuery() {
198200
/**
199201
* Gets the filter.
200202
*
203+
* The filter used on the collection before the **natural_language_query** is applied.
204+
*
201205
* @return the filter
202206
*/
203207
public String filter() {
@@ -207,6 +211,8 @@ public String filter() {
207211
/**
208212
* Gets the examples.
209213
*
214+
* Array of training examples.
215+
*
210216
* @return the examples
211217
*/
212218
public List<TrainingExample> examples() {

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,6 @@ public String getLanguage() {
145145
/**
146146
* Gets the documentCounts.
147147
*
148-
* The object providing information about the documents in the collection. Present only when retrieving details of a
149-
* collection.
150-
*
151148
* @return the documentCounts
152149
*/
153150
public DocumentCounts getDocumentCounts() {
@@ -168,8 +165,6 @@ public CollectionDiskUsage getDiskUsage() {
168165
/**
169166
* Gets the trainingStatus.
170167
*
171-
* Provides information about the status of relevance training for collection.
172-
*
173168
* @return the trainingStatus
174169
*/
175170
public TrainingStatus getTrainingStatus() {

discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateCollectionOptions.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public interface Language {
4444
String PT = "pt";
4545
/** nl. */
4646
String NL = "nl";
47+
/** zh-CN. */
48+
String ZH_CN = "zh-CN";
4749
}
4850

4951
private String environmentId;
@@ -63,11 +65,11 @@ public static class Builder {
6365
private String language;
6466

6567
private Builder(CreateCollectionOptions createCollectionOptions) {
66-
environmentId = createCollectionOptions.environmentId;
67-
name = createCollectionOptions.name;
68-
description = createCollectionOptions.description;
69-
configurationId = createCollectionOptions.configurationId;
70-
language = createCollectionOptions.language;
68+
this.environmentId = createCollectionOptions.environmentId;
69+
this.name = createCollectionOptions.name;
70+
this.description = createCollectionOptions.description;
71+
this.configurationId = createCollectionOptions.configurationId;
72+
this.language = createCollectionOptions.language;
7173
}
7274

7375
/**

discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateConfigurationOptions.java

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ public static class Builder {
4444
private Source source;
4545

4646
private Builder(CreateConfigurationOptions createConfigurationOptions) {
47-
environmentId = createConfigurationOptions.environmentId;
48-
name = createConfigurationOptions.name;
49-
description = createConfigurationOptions.description;
50-
conversions = createConfigurationOptions.conversions;
51-
enrichments = createConfigurationOptions.enrichments;
52-
normalizations = createConfigurationOptions.normalizations;
53-
source = createConfigurationOptions.source;
47+
this.environmentId = createConfigurationOptions.environmentId;
48+
this.name = createConfigurationOptions.name;
49+
this.description = createConfigurationOptions.description;
50+
this.conversions = createConfigurationOptions.conversions;
51+
this.enrichments = createConfigurationOptions.enrichments;
52+
this.normalizations = createConfigurationOptions.normalizations;
53+
this.source = createConfigurationOptions.source;
5454
}
5555

5656
/**
@@ -63,9 +63,11 @@ public Builder() {
6363
* Instantiates a new builder with required properties.
6464
*
6565
* @param environmentId the environmentId
66+
* @param name the name
6667
*/
67-
public Builder(String environmentId) {
68+
public Builder(String environmentId, String name) {
6869
this.environmentId = environmentId;
70+
this.name = name;
6971
}
7072

7173
/**
@@ -78,32 +80,32 @@ public CreateConfigurationOptions build() {
7880
}
7981

8082
/**
81-
* Adds an enrichments to enrichments.
83+
* Adds an enrichment to enrichments.
8284
*
83-
* @param enrichments the new enrichments
85+
* @param enrichment the new enrichment
8486
* @return the CreateConfigurationOptions builder
8587
*/
86-
public Builder addEnrichments(Enrichment enrichments) {
87-
Validator.notNull(enrichments, "enrichments cannot be null");
88+
public Builder addEnrichment(Enrichment enrichment) {
89+
Validator.notNull(enrichment, "enrichment cannot be null");
8890
if (this.enrichments == null) {
8991
this.enrichments = new ArrayList<Enrichment>();
9092
}
91-
this.enrichments.add(enrichments);
93+
this.enrichments.add(enrichment);
9294
return this;
9395
}
9496

9597
/**
96-
* Adds an normalizations to normalizations.
98+
* Adds an normalization to normalizations.
9799
*
98-
* @param normalizations the new normalizations
100+
* @param normalization the new normalization
99101
* @return the CreateConfigurationOptions builder
100102
*/
101-
public Builder addNormalizations(NormalizationOperation normalizations) {
102-
Validator.notNull(normalizations, "normalizations cannot be null");
103+
public Builder addNormalization(NormalizationOperation normalization) {
104+
Validator.notNull(normalization, "normalization cannot be null");
103105
if (this.normalizations == null) {
104106
this.normalizations = new ArrayList<NormalizationOperation>();
105107
}
106-
this.normalizations.add(normalizations);
108+
this.normalizations.add(normalization);
107109
return this;
108110
}
109111

@@ -205,6 +207,7 @@ public Builder configuration(Configuration configuration) {
205207

206208
private CreateConfigurationOptions(Builder builder) {
207209
Validator.notEmpty(builder.environmentId, "environmentId cannot be empty");
210+
Validator.notNull(builder.name, "name cannot be null");
208211
environmentId = builder.environmentId;
209212
name = builder.name;
210213
description = builder.description;

discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateCredentialsOptions.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class CreateCredentialsOptions extends GenericModel {
2626
* - `salesforce` indicates the credentials are used to connect to Salesforce.
2727
* - `sharepoint` indicates the credentials are used to connect to Microsoft SharePoint Online.
2828
* - `web_crawl` indicates the credentials are used to perform a web crawl.
29+
* = `cloud_object_storage` indicates the credentials are used to connect to an IBM Cloud Object Store.
2930
*/
3031
public interface SourceType {
3132
/** box. */
@@ -36,6 +37,8 @@ public interface SourceType {
3637
String SHAREPOINT = "sharepoint";
3738
/** web_crawl. */
3839
String WEB_CRAWL = "web_crawl";
40+
/** cloud_object_storage. */
41+
String CLOUD_OBJECT_STORAGE = "cloud_object_storage";
3942
}
4043

4144
private String environmentId;
@@ -51,9 +54,9 @@ public static class Builder {
5154
private CredentialDetails credentialDetails;
5255

5356
private Builder(CreateCredentialsOptions createCredentialsOptions) {
54-
environmentId = createCredentialsOptions.environmentId;
55-
sourceType = createCredentialsOptions.sourceType;
56-
credentialDetails = createCredentialsOptions.credentialDetails;
57+
this.environmentId = createCredentialsOptions.environmentId;
58+
this.sourceType = createCredentialsOptions.sourceType;
59+
this.credentialDetails = createCredentialsOptions.credentialDetails;
5760
}
5861

5962
/**
@@ -161,6 +164,7 @@ public String environmentId() {
161164
* - `salesforce` indicates the credentials are used to connect to Salesforce.
162165
* - `sharepoint` indicates the credentials are used to connect to Microsoft SharePoint Online.
163166
* - `web_crawl` indicates the credentials are used to perform a web crawl.
167+
* = `cloud_object_storage` indicates the credentials are used to connect to an IBM Cloud Object Store.
164168
*
165169
* @return the sourceType
166170
*/

discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateEnvironmentOptions.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ public static class Builder {
6060
private String size;
6161

6262
private Builder(CreateEnvironmentOptions createEnvironmentOptions) {
63-
name = createEnvironmentOptions.name;
64-
description = createEnvironmentOptions.description;
65-
size = createEnvironmentOptions.size;
63+
this.name = createEnvironmentOptions.name;
64+
this.description = createEnvironmentOptions.description;
65+
this.size = createEnvironmentOptions.size;
6666
}
6767

6868
/**
@@ -121,13 +121,6 @@ public Builder size(String size) {
121121
this.size = size;
122122
return this;
123123
}
124-
125-
/**
126-
* @deprecated This method no longer has an effect on the created environment. Please use the String method.
127-
*/
128-
public Builder size(Long size) {
129-
return this;
130-
}
131124
}
132125

133126
private CreateEnvironmentOptions(Builder builder) {

discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateEventOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public static class Builder {
3939
private EventData data;
4040

4141
private Builder(CreateEventOptions createEventOptions) {
42-
type = createEventOptions.type;
43-
data = createEventOptions.data;
42+
this.type = createEventOptions.type;
43+
this.data = createEventOptions.data;
4444
}
4545

4646
/**

0 commit comments

Comments
 (0)