Skip to content

Commit 45ec51d

Browse files
feat(discov2): add ocrEnabled parameter
1 parent ebad4d0 commit 45ec51d

File tree

62 files changed

+330
-205
lines changed

Some content is hidden

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

62 files changed

+330
-205
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2019, 2024.
2+
* (C) Copyright IBM Corp. 2024.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -461,6 +461,9 @@ public ServiceCall<CollectionDetails> createCollection(
461461
if (createCollectionOptions.language() != null) {
462462
contentJson.addProperty("language", createCollectionOptions.language());
463463
}
464+
if (createCollectionOptions.ocrEnabled() != null) {
465+
contentJson.addProperty("ocr_enabled", createCollectionOptions.ocrEnabled());
466+
}
464467
if (createCollectionOptions.enrichments() != null) {
465468
contentJson.add(
466469
"enrichments",
@@ -555,6 +558,9 @@ public ServiceCall<CollectionDetails> updateCollection(
555558
if (updateCollectionOptions.description() != null) {
556559
contentJson.addProperty("description", updateCollectionOptions.description());
557560
}
561+
if (updateCollectionOptions.ocrEnabled() != null) {
562+
contentJson.addProperty("ocr_enabled", updateCollectionOptions.ocrEnabled());
563+
}
558564
if (updateCollectionOptions.enrichments() != null) {
559565
contentJson.add(
560566
"enrichments",

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2019, 2024.
2+
* (C) Copyright IBM Corp. 2024.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -198,8 +198,8 @@ public Builder newBuilder() {
198198
/**
199199
* Gets the projectId.
200200
*
201-
* <p>The ID of the project. This information can be found from the *Integrate and Deploy* page in
202-
* Discovery.
201+
* <p>The Universally Unique Identifier (UUID) of the project. This information can be found from
202+
* the *Integrate and Deploy* page in Discovery.
203203
*
204204
* @return the projectId
205205
*/
@@ -210,7 +210,7 @@ public String projectId() {
210210
/**
211211
* Gets the collectionId.
212212
*
213-
* <p>The ID of the collection.
213+
* <p>The Universally Unique Identifier (UUID) of the collection.
214214
*
215215
* @return the collectionId
216216
*/

discovery/src/main/java/com/ibm/watson/discovery/v2/model/AnalyzeDocumentOptions.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2020, 2024.
2+
* (C) Copyright IBM Corp. 2024.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -183,8 +183,8 @@ public Builder newBuilder() {
183183
/**
184184
* Gets the projectId.
185185
*
186-
* <p>The ID of the project. This information can be found from the *Integrate and Deploy* page in
187-
* Discovery.
186+
* <p>The Universally Unique Identifier (UUID) of the project. This information can be found from
187+
* the *Integrate and Deploy* page in Discovery.
188188
*
189189
* @return the projectId
190190
*/
@@ -195,7 +195,7 @@ public String projectId() {
195195
/**
196196
* Gets the collectionId.
197197
*
198-
* <p>The ID of the collection.
198+
* <p>The Universally Unique Identifier (UUID) of the collection.
199199
*
200200
* @return the collectionId
201201
*/

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2019, 2023.
2+
* (C) Copyright IBM Corp. 2024.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -28,7 +28,7 @@ protected Collection() {}
2828
/**
2929
* Gets the collectionId.
3030
*
31-
* <p>The unique identifier of the collection.
31+
* <p>The Universally Unique Identifier (UUID) of the collection.
3232
*
3333
* @return the collectionId
3434
*/

discovery/src/main/java/com/ibm/watson/discovery/v2/model/CollectionDetails.java

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2020, 2024.
2+
* (C) Copyright IBM Corp. 2024.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -28,6 +28,10 @@ public class CollectionDetails extends GenericModel {
2828
protected String description;
2929
protected Date created;
3030
protected String language;
31+
32+
@SerializedName("ocr_enabled")
33+
protected Boolean ocrEnabled;
34+
3135
protected List<CollectionEnrichment> enrichments;
3236

3337
@SerializedName("smart_document_understanding")
@@ -38,6 +42,7 @@ public static class Builder {
3842
private String name;
3943
private String description;
4044
private String language;
45+
private Boolean ocrEnabled;
4146
private List<CollectionEnrichment> enrichments;
4247

4348
/**
@@ -49,6 +54,7 @@ private Builder(CollectionDetails collectionDetails) {
4954
this.name = collectionDetails.name;
5055
this.description = collectionDetails.description;
5156
this.language = collectionDetails.language;
57+
this.ocrEnabled = collectionDetails.ocrEnabled;
5258
this.enrichments = collectionDetails.enrichments;
5359
}
5460

@@ -121,6 +127,17 @@ public Builder language(String language) {
121127
return this;
122128
}
123129

130+
/**
131+
* Set the ocrEnabled.
132+
*
133+
* @param ocrEnabled the ocrEnabled
134+
* @return the CollectionDetails builder
135+
*/
136+
public Builder ocrEnabled(Boolean ocrEnabled) {
137+
this.ocrEnabled = ocrEnabled;
138+
return this;
139+
}
140+
124141
/**
125142
* Set the enrichments. Existing enrichments will be replaced.
126143
*
@@ -140,6 +157,7 @@ protected CollectionDetails(Builder builder) {
140157
name = builder.name;
141158
description = builder.description;
142159
language = builder.language;
160+
ocrEnabled = builder.ocrEnabled;
143161
enrichments = builder.enrichments;
144162
}
145163

@@ -155,7 +173,7 @@ public Builder newBuilder() {
155173
/**
156174
* Gets the collectionId.
157175
*
158-
* <p>The unique identifier of the collection.
176+
* <p>The Universally Unique Identifier (UUID) of the collection.
159177
*
160178
* @return the collectionId
161179
*/
@@ -208,6 +226,18 @@ public String language() {
208226
return language;
209227
}
210228

229+
/**
230+
* Gets the ocrEnabled.
231+
*
232+
* <p>If set to `true`, optical character recognition (OCR) is enabled. For more information, see
233+
* [Optical character recognition](/docs/discovery-data?topic=discovery-data-collections#ocr).
234+
*
235+
* @return the ocrEnabled
236+
*/
237+
public Boolean ocrEnabled() {
238+
return ocrEnabled;
239+
}
240+
211241
/**
212242
* Gets the enrichments.
213243
*

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

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public class CreateCollectionOptions extends GenericModel {
2323
protected String name;
2424
protected String description;
2525
protected String language;
26+
protected Boolean ocrEnabled;
2627
protected List<CollectionEnrichment> enrichments;
2728

2829
/** Builder. */
@@ -31,6 +32,7 @@ public static class Builder {
3132
private String name;
3233
private String description;
3334
private String language;
35+
private Boolean ocrEnabled;
3436
private List<CollectionEnrichment> enrichments;
3537

3638
/**
@@ -43,6 +45,7 @@ private Builder(CreateCollectionOptions createCollectionOptions) {
4345
this.name = createCollectionOptions.name;
4446
this.description = createCollectionOptions.description;
4547
this.language = createCollectionOptions.language;
48+
this.ocrEnabled = createCollectionOptions.ocrEnabled;
4649
this.enrichments = createCollectionOptions.enrichments;
4750
}
4851

@@ -128,6 +131,17 @@ public Builder language(String language) {
128131
return this;
129132
}
130133

134+
/**
135+
* Set the ocrEnabled.
136+
*
137+
* @param ocrEnabled the ocrEnabled
138+
* @return the CreateCollectionOptions builder
139+
*/
140+
public Builder ocrEnabled(Boolean ocrEnabled) {
141+
this.ocrEnabled = ocrEnabled;
142+
return this;
143+
}
144+
131145
/**
132146
* Set the enrichments. Existing enrichments will be replaced.
133147
*
@@ -149,6 +163,7 @@ public Builder collectionDetails(CollectionDetails collectionDetails) {
149163
this.name = collectionDetails.name();
150164
this.description = collectionDetails.description();
151165
this.language = collectionDetails.language();
166+
this.ocrEnabled = collectionDetails.ocrEnabled();
152167
this.enrichments = collectionDetails.enrichments();
153168
return this;
154169
}
@@ -163,6 +178,7 @@ protected CreateCollectionOptions(Builder builder) {
163178
name = builder.name;
164179
description = builder.description;
165180
language = builder.language;
181+
ocrEnabled = builder.ocrEnabled;
166182
enrichments = builder.enrichments;
167183
}
168184

@@ -178,8 +194,8 @@ public Builder newBuilder() {
178194
/**
179195
* Gets the projectId.
180196
*
181-
* <p>The ID of the project. This information can be found from the *Integrate and Deploy* page in
182-
* Discovery.
197+
* <p>The Universally Unique Identifier (UUID) of the project. This information can be found from
198+
* the *Integrate and Deploy* page in Discovery.
183199
*
184200
* @return the projectId
185201
*/
@@ -221,6 +237,18 @@ public String language() {
221237
return language;
222238
}
223239

240+
/**
241+
* Gets the ocrEnabled.
242+
*
243+
* <p>If set to `true`, optical character recognition (OCR) is enabled. For more information, see
244+
* [Optical character recognition](/docs/discovery-data?topic=discovery-data-collections#ocr).
245+
*
246+
* @return the ocrEnabled
247+
*/
248+
public Boolean ocrEnabled() {
249+
return ocrEnabled;
250+
}
251+
224252
/**
225253
* Gets the enrichments.
226254
*

discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateDocumentClassifierModelOptions.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2022, 2024.
2+
* (C) Copyright IBM Corp. 2024.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -247,8 +247,8 @@ public Builder newBuilder() {
247247
/**
248248
* Gets the projectId.
249249
*
250-
* <p>The ID of the project. This information can be found from the *Integrate and Deploy* page in
251-
* Discovery.
250+
* <p>The Universally Unique Identifier (UUID) of the project. This information can be found from
251+
* the *Integrate and Deploy* page in Discovery.
252252
*
253253
* @return the projectId
254254
*/
@@ -259,7 +259,7 @@ public String projectId() {
259259
/**
260260
* Gets the classifierId.
261261
*
262-
* <p>The ID of the classifier.
262+
* <p>The Universally Unique Identifier (UUID) of the classifier.
263263
*
264264
* @return the classifierId
265265
*/

discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateDocumentClassifierOptions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2022, 2023.
2+
* (C) Copyright IBM Corp. 2024.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -165,8 +165,8 @@ public Builder newBuilder() {
165165
/**
166166
* Gets the projectId.
167167
*
168-
* <p>The ID of the project. This information can be found from the *Integrate and Deploy* page in
169-
* Discovery.
168+
* <p>The Universally Unique Identifier (UUID) of the project. This information can be found from
169+
* the *Integrate and Deploy* page in Discovery.
170170
*
171171
* @return the projectId
172172
*/

discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateEnrichmentOptions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2020, 2024.
2+
* (C) Copyright IBM Corp. 2024.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -133,8 +133,8 @@ public Builder newBuilder() {
133133
/**
134134
* Gets the projectId.
135135
*
136-
* <p>The ID of the project. This information can be found from the *Integrate and Deploy* page in
137-
* Discovery.
136+
* <p>The Universally Unique Identifier (UUID) of the project. This information can be found from
137+
* the *Integrate and Deploy* page in Discovery.
138138
*
139139
* @return the projectId
140140
*/

discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateExpansionsOptions.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2022, 2024.
2+
* (C) Copyright IBM Corp. 2024.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -149,8 +149,8 @@ public Builder newBuilder() {
149149
/**
150150
* Gets the projectId.
151151
*
152-
* <p>The ID of the project. This information can be found from the *Integrate and Deploy* page in
153-
* Discovery.
152+
* <p>The Universally Unique Identifier (UUID) of the project. This information can be found from
153+
* the *Integrate and Deploy* page in Discovery.
154154
*
155155
* @return the projectId
156156
*/
@@ -161,7 +161,7 @@ public String projectId() {
161161
/**
162162
* Gets the collectionId.
163163
*
164-
* <p>The ID of the collection.
164+
* <p>The Universally Unique Identifier (UUID) of the collection.
165165
*
166166
* @return the collectionId
167167
*/

0 commit comments

Comments
 (0)