Skip to content

Commit 995e687

Browse files
fix(discov2): make enrichement_id required and linting changes
1 parent f9f4614 commit 995e687

File tree

8 files changed

+17
-12
lines changed

8 files changed

+17
-12
lines changed

assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventActionVisited.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
public class MessageOutputDebugTurnEventTurnEventActionVisited extends MessageOutputDebugTurnEvent {
1717

1818
private TurnEventActionSource source;
19-
19+
2020
/** The type of condition (if any) that is defined for the action. */
2121
public interface ConditionType {
2222
/** user_defined. */

assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventStepVisited.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
public class MessageOutputDebugTurnEventTurnEventStepVisited extends MessageOutputDebugTurnEvent {
1717

1818
private TurnEventActionSource source;
19-
19+
2020
/** The type of condition (if any) that is defined for the action. */
2121
public interface ConditionType {
2222
/** user_defined. */

assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantServiceIT.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,10 @@ public void testGettingEnvironments() {
246246
String environmentId = environments.getEnvironments().get(1).getEnvironmentId();
247247

248248
GetEnvironmentOptions getEnvironmentOptions =
249-
new GetEnvironmentOptions.Builder()
250-
.assistantId(assistantId)
251-
.environmentId(environmentId)
252-
.build();
249+
new GetEnvironmentOptions.Builder()
250+
.assistantId(assistantId)
251+
.environmentId(environmentId)
252+
.build();
253253

254254
Environment environment = service.getEnvironment(getEnvironmentOptions).execute().getResult();
255255

@@ -273,7 +273,7 @@ public void testGettingReleases() {
273273
String releaseId = releases.getReleases().get(0).getRelease();
274274

275275
GetReleaseOptions getReleasesOptions =
276-
new GetReleaseOptions.Builder().assistantId(assistantId).release(releaseId).build();
276+
new GetReleaseOptions.Builder().assistantId(assistantId).release(releaseId).build();
277277

278278
Release release = service.getRelease(getReleasesOptions).execute().getResult();
279279

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public String projectId() {
173173
/**
174174
* Gets the naturalLanguageQuery.
175175
*
176-
* <p>The natural text query for the training query.
176+
* <p>The natural text query that is used as the training query.
177177
*
178178
* @return the naturalLanguageQuery
179179
*/

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@ public Builder() {}
4444
/**
4545
* Instantiates a new builder with required properties.
4646
*
47+
* @param enrichmentId the enrichmentId
4748
* @param fields the fields
4849
*/
49-
public Builder(List<String> fields) {
50+
public Builder(String enrichmentId, List<String> fields) {
51+
this.enrichmentId = enrichmentId;
5052
this.fields = fields;
5153
}
5254

@@ -100,6 +102,8 @@ public Builder fields(List<String> fields) {
100102
protected DocumentClassifierEnrichment() {}
101103

102104
protected DocumentClassifierEnrichment(Builder builder) {
105+
com.ibm.cloud.sdk.core.util.Validator.notNull(
106+
builder.enrichmentId, "enrichmentId cannot be null");
103107
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.fields, "fields cannot be null");
104108
enrichmentId = builder.enrichmentId;
105109
fields = builder.fields;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public String queryId() {
150150
/**
151151
* Gets the naturalLanguageQuery.
152152
*
153-
* <p>The natural text query for the training query.
153+
* <p>The natural text query that is used as the training query.
154154
*
155155
* @return the naturalLanguageQuery
156156
*/

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public String queryId() {
206206
/**
207207
* Gets the naturalLanguageQuery.
208208
*
209-
* <p>The natural text query for the training query.
209+
* <p>The natural text query that is used as the training query.
210210
*
211211
* @return the naturalLanguageQuery
212212
*/

speech-to-text/src/test/java/com/ibm/watson/speech_to_text/v1/SpeechToTextTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,8 @@ public void testCheckJobsWRetries() throws Throwable {
587587
public void testCheckJobWOptions() throws Throwable {
588588
// Register a mock response
589589
String mockResponseBody =
590-
"{\"id\": \"id\", \"status\": \"waiting\", \"created\": \"created\", \"updated\": \"updated\", \"url\": \"url\", \"user_token\": \"userToken\", \"results\": [{\"results\": [{\"final\": true, \"alternatives\": [{\"transcript\": \"transcript\", \"confidence\": 0, \"timestamps\": [[\"timestamps\"]], \"word_confidence\": [[\"wordConfidence\"]]}], \"keywords_result\": {\"mapKey\": [{\"normalized_text\": \"normalizedText\", \"start_time\": 9, \"end_time\": 7, \"confidence\": 0}]}, \"word_alternatives\": [{\"start_time\": 9, \"end_time\": 7, \"alternatives\": [{\"confidence\": 0, \"word\": \"word\"}]}], \"end_of_utterance\": \"end_of_data\"}], \"result_index\": 11, \"speaker_labels\": [{\"from\": 4, \"to\": 2, \"speaker\": 7, \"confidence\": 10, \"final\": true}], \"processing_metrics\": {\"processed_audio\": {\"received\": 8, \"seen_by_engine\": 12, \"transcription\": 13, \"speaker_labels\": 13}, \"wall_clock_since_first_byte_received\": 31, \"periodic\": true}, \"audio_metrics\": {\"sampling_interval\": 16, \"accumulated\": {\"final\": true, \"end_time\": 7, \"signal_to_noise_ratio\": 18, \"speech_ratio\": 11, \"high_frequency_loss\": 17, \"direct_current_offset\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"clipping_rate\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"speech_level\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"non_speech_level\": [{\"begin\": 5, \"end\": 3, \"count\": 5}]}}, \"warnings\": [\"warnings\"]}], \"warnings\": [\"warnings\"]}"; String checkJobPath = "/v1/recognitions/testString";
590+
"{\"id\": \"id\", \"status\": \"waiting\", \"created\": \"created\", \"updated\": \"updated\", \"url\": \"url\", \"user_token\": \"userToken\", \"results\": [{\"results\": [{\"final\": true, \"alternatives\": [{\"transcript\": \"transcript\", \"confidence\": 0, \"timestamps\": [[\"timestamps\"]], \"word_confidence\": [[\"wordConfidence\"]]}], \"keywords_result\": {\"mapKey\": [{\"normalized_text\": \"normalizedText\", \"start_time\": 9, \"end_time\": 7, \"confidence\": 0}]}, \"word_alternatives\": [{\"start_time\": 9, \"end_time\": 7, \"alternatives\": [{\"confidence\": 0, \"word\": \"word\"}]}], \"end_of_utterance\": \"end_of_data\"}], \"result_index\": 11, \"speaker_labels\": [{\"from\": 4, \"to\": 2, \"speaker\": 7, \"confidence\": 10, \"final\": true}], \"processing_metrics\": {\"processed_audio\": {\"received\": 8, \"seen_by_engine\": 12, \"transcription\": 13, \"speaker_labels\": 13}, \"wall_clock_since_first_byte_received\": 31, \"periodic\": true}, \"audio_metrics\": {\"sampling_interval\": 16, \"accumulated\": {\"final\": true, \"end_time\": 7, \"signal_to_noise_ratio\": 18, \"speech_ratio\": 11, \"high_frequency_loss\": 17, \"direct_current_offset\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"clipping_rate\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"speech_level\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"non_speech_level\": [{\"begin\": 5, \"end\": 3, \"count\": 5}]}}, \"warnings\": [\"warnings\"]}], \"warnings\": [\"warnings\"]}";
591+
String checkJobPath = "/v1/recognitions/testString";
591592
server.enqueue(
592593
new MockResponse()
593594
.setHeader("Content-type", "application/json")

0 commit comments

Comments
 (0)