Skip to content

Commit b20d191

Browse files
committed
chore(java-format): ran java_format_google.sh
1 parent 533b631 commit b20d191

16 files changed

Lines changed: 79 additions & 72 deletions

File tree

MIGRATION-V9.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ This document should serve as a guide to breaking changes for users moving from
1919

2020
#### Models Removed
2121

22+
`DialogSuggestionOutput`, `DialogSuggestionResponseGeneric`, `SystemResponse`
23+
2224
#### Model Properties Changed
2325

2426
`Context`
@@ -83,6 +85,8 @@ This document should serve as a guide to breaking changes for users moving from
8385

8486
#### Models Removed
8587

88+
`MessageContextSkills`
89+
8690
#### Model Properties Changed
8791

8892
`MessageContext`, `MessageContextStateless`
@@ -108,8 +112,6 @@ This document should serve as a guide to breaking changes for users moving from
108112

109113
### Compare Comply v1 Models
110114

111-
#### Models Removed
112-
113115
#### Model Properties Changed
114116

115117
`Category`, `TypeLabel`
@@ -133,6 +135,8 @@ This document should serve as a guide to breaking changes for users moving from
133135

134136
#### Models Removed
135137

138+
`NluEnrichmentCategories`
139+
136140
#### Model Properties Changed
137141

138142
`Configuration`
@@ -159,6 +163,8 @@ This document should serve as a guide to breaking changes for users moving from
159163

160164
#### Models Removed
161165

166+
`QueryNoticesResult`
167+
162168
#### Model Properties Changed
163169

164170
`CollectionDetails`
@@ -176,8 +182,6 @@ This document should serve as a guide to breaking changes for users moving from
176182

177183
### Language Translator v3 Models
178184

179-
#### Models Removed
180-
181185
#### Model Properties Changed
182186

183187
`ListDocumentsOptions`, `ListIdentifiableLanguagesOptions`, `ListLanguagesOptions`
@@ -189,8 +193,6 @@ This document should serve as a guide to breaking changes for users moving from
189193

190194
### Natural Language Classifier v1 Models
191195

192-
#### Models Removed
193-
194196
#### Model Properties Changed
195197

196198
`ListClassifiersOptions`
@@ -208,7 +210,7 @@ This document should serve as a guide to breaking changes for users moving from
208210

209211
#### Models Removed
210212

211-
`MetadataOptions`
213+
`MetadataOptions`, `AnalysisResultsMetadata`
212214

213215
#### Model Properties Changed
214216

@@ -242,6 +244,8 @@ This document should serve as a guide to breaking changes for users moving from
242244

243245
#### Models Removed
244246

247+
`SpeechTimestamp`, `SpeechWordConfidence`
248+
245249
#### Model Properties Changed
246250

247251
`CheckJobsOptions`, `ListModelOptions`
@@ -263,6 +267,8 @@ properties (Moved to `RecognizeWithWebsocketsOptions`)
263267

264268
#### Models Removed
265269

270+
`CreateVoiceModelOptions`, `DeleteVoiceModelOptions`, `GetVoiceModelOptions`, `ListVoiceModelsOptions`, `Marks`, `MarkTiming`, `Timings`, `UpdateVoiceModelOptions`, `VoiceModel`, `VoiceModels`, `WordTiming`
271+
266272
#### Model Properties Changed
267273

268274
`ListVoicesOptions`

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import static org.junit.Assert.fail;
2020

2121
import com.ibm.cloud.sdk.core.http.Response;
22-
import com.ibm.cloud.sdk.core.http.ServiceCall;
2322
import com.ibm.cloud.sdk.core.http.ServiceCallback;
2423
import com.ibm.cloud.sdk.core.security.BasicAuthenticator;
2524
import com.ibm.cloud.sdk.core.service.exception.ForbiddenException;
@@ -1785,11 +1784,12 @@ public void testListMentions() {
17851784
@Test
17861785
public void testBulkClassify() {
17871786
BulkClassifyUtterance bulkClassifyUtterance =
1788-
new BulkClassifyUtterance.Builder().text("help I need help").build();
1787+
new BulkClassifyUtterance.Builder().text("help I need help").build();
17891788
BulkClassifyOptions bulkClassifyOptions =
1790-
new BulkClassifyOptions.Builder()
1789+
new BulkClassifyOptions.Builder()
17911790
.addInput(bulkClassifyUtterance)
1792-
.workspaceId("{workspaceId}").build();
1791+
.workspaceId("{workspaceId}")
1792+
.build();
17931793
BulkClassifyResponse response = service.bulkClassify(bulkClassifyOptions).execute().getResult();
17941794

17951795
assertNotNull(response);

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,12 @@ public void testListLogs() {
181181
@Test
182182
public void testBulkClassify() {
183183
BulkClassifyUtterance bulkClassifyUtterance =
184-
new BulkClassifyUtterance.Builder().text("text text").build();
184+
new BulkClassifyUtterance.Builder().text("text text").build();
185185
BulkClassifyOptions bulkClassifyOptions =
186-
new BulkClassifyOptions.Builder()
186+
new BulkClassifyOptions.Builder()
187187
.addInput(bulkClassifyUtterance)
188-
.skillId("{skillId}").build();
188+
.skillId("{skillId}")
189+
.build();
189190
BulkClassifyResponse response = service.bulkClassify(bulkClassifyOptions).execute().getResult();
190191

191192
assertNotNull(response);

discovery/src/test/java/com/ibm/watson/discovery/v2/DiscoveryIT.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,14 +1154,16 @@ public void TestAnalyzeDocument() throws FileNotFoundException {
11541154
String metadata = "{ \"metadata\": \"value\" }";
11551155

11561156
AnalyzeDocumentOptions analyzeDocumentOptions =
1157-
new AnalyzeDocumentOptions.Builder()
1157+
new AnalyzeDocumentOptions.Builder()
11581158
.projectId(PROJECT_ID)
11591159
.collectionId(COLLECTION_ID)
11601160
.file(testFile)
11611161
.filename("test-file")
11621162
.fileContentType(HttpMediaType.APPLICATION_PDF)
1163-
.metadata(metadata).build();
1164-
AnalyzedDocument analyzedDocument = service.analyzeDocument(analyzeDocumentOptions).execute().getResult();
1163+
.metadata(metadata)
1164+
.build();
1165+
AnalyzedDocument analyzedDocument =
1166+
service.analyzeDocument(analyzeDocumentOptions).execute().getResult();
11651167

11661168
assertNotNull(analyzedDocument);
11671169
}

natural-language-understanding/src/test/java/com/ibm/watson/natural_language_understanding/v1/NaturalLanguageUnderstandingIT.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,10 @@
2222
import com.ibm.watson.common.RetryRunner;
2323
import com.ibm.watson.common.WatsonServiceTest;
2424
import com.ibm.watson.natural_language_understanding.v1.model.*;
25-
2625
import java.io.FileInputStream;
2726
import java.util.Arrays;
2827
import java.util.HashMap;
2928
import java.util.List;
30-
import java.util.Map;
31-
3229
import org.junit.Assume;
3330
import org.junit.Before;
3431
import org.junit.FixMethodOrder;
@@ -296,8 +293,7 @@ public void analyzeHtmlForMetadataIsSuccessful() throws Exception {
296293
String fileTitle = "This 5,000-year-old recipe for beer actually sounds pretty tasty";
297294
String fileDate = "2016-05-23T20:13:00";
298295
String fileAuthor = "Annalee Newitz";
299-
Features features =
300-
new Features.Builder().metadata(new HashMap<String, Object>()).build();
296+
Features features = new Features.Builder().metadata(new HashMap<String, Object>()).build();
301297
AnalyzeOptions parameters =
302298
new AnalyzeOptions.Builder().html(html).features(features).returnAnalyzedText(true).build();
303299

personality-insights/src/main/java/com/ibm/watson/personality_insights/v3/PersonalityInsights.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,11 @@ public PersonalityInsights(String version, String serviceName, Authenticator aut
115115
setVersion(version);
116116
this.configureService(serviceName);
117117

118-
System.err.println("On 1 December 2021, Personality Insights will no longer be available." +
119-
" Consider migrating to Watson Natural Language Understanding." +
120-
"\nFor more information, see Personality Insights Deprecation " +
121-
"(https://github.com/watson-developer-cloud/java-sdk/tree/master#personality-insights-deprecation).");
118+
System.err.println(
119+
"On 1 December 2021, Personality Insights will no longer be available."
120+
+ " Consider migrating to Watson Natural Language Understanding."
121+
+ "\nFor more information, see Personality Insights Deprecation "
122+
+ "(https://github.com/watson-developer-cloud/java-sdk/tree/master#personality-insights-deprecation).");
122123
}
123124

124125
/**

speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/SpeechToText.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,12 @@
8888
import com.ibm.watson.speech_to_text.v1.model.UpgradeLanguageModelOptions;
8989
import com.ibm.watson.speech_to_text.v1.model.Word;
9090
import com.ibm.watson.speech_to_text.v1.model.Words;
91+
import com.ibm.watson.speech_to_text.v1.websocket.RecognizeCallback;
92+
import com.ibm.watson.speech_to_text.v1.websocket.SpeechToTextWebSocketListener;
9193
import java.util.HashMap;
9294
import java.util.Map;
9395
import java.util.Map.Entry;
94-
95-
import com.ibm.watson.speech_to_text.v1.websocket.RecognizeCallback;
96-
import com.ibm.watson.speech_to_text.v1.websocket.SpeechToTextWebSocketListener;
9796
import okhttp3.HttpUrl;
98-
import okhttp3.MultipartBody;
9997
import okhttp3.OkHttpClient;
10098
import okhttp3.Request;
10199
import okhttp3.WebSocket;
@@ -449,9 +447,9 @@ public ServiceCall<SpeechRecognitionResults> recognize(RecognizeOptions recogniz
449447
* @return the {@link WebSocket}
450448
*/
451449
public WebSocket recognizeUsingWebSocket(
452-
RecognizeWithWebsocketsOptions recognizeOptions, RecognizeCallback callback) {
450+
RecognizeWithWebsocketsOptions recognizeOptions, RecognizeCallback callback) {
453451
com.ibm.cloud.sdk.core.util.Validator.notNull(
454-
recognizeOptions, "recognizeOptions cannot be null");
452+
recognizeOptions, "recognizeOptions cannot be null");
455453
com.ibm.cloud.sdk.core.util.Validator.notNull(recognizeOptions.audio(), "audio cannot be null");
456454
com.ibm.cloud.sdk.core.util.Validator.notNull(callback, "callback cannot be null");
457455

@@ -465,11 +463,11 @@ public WebSocket recognizeUsingWebSocket(
465463
}
466464
if (recognizeOptions.languageCustomizationId() != null) {
467465
urlBuilder.addQueryParameter(
468-
"language_customization_id", recognizeOptions.languageCustomizationId());
466+
"language_customization_id", recognizeOptions.languageCustomizationId());
469467
}
470468
if (recognizeOptions.acousticCustomizationId() != null) {
471469
urlBuilder.addQueryParameter(
472-
"acoustic_customization_id", recognizeOptions.acousticCustomizationId());
470+
"acoustic_customization_id", recognizeOptions.acousticCustomizationId());
473471
}
474472
if (recognizeOptions.baseModelVersion() != null) {
475473
urlBuilder.addQueryParameter("base_model_version", recognizeOptions.baseModelVersion());
@@ -483,7 +481,7 @@ public WebSocket recognizeUsingWebSocket(
483481

484482
OkHttpClient client = configureHttpClient();
485483
return client.newWebSocket(
486-
builder.build(), new SpeechToTextWebSocketListener(recognizeOptions, callback));
484+
builder.build(), new SpeechToTextWebSocketListener(recognizeOptions, callback));
487485
}
488486

489487
/**

speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RecognizeOptions.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,10 @@ public interface Model {
108108
}
109109

110110
protected InputStream audio;
111+
111112
@SerializedName("content-type")
112113
protected String contentType;
114+
113115
protected String model;
114116
protected String languageCustomizationId;
115117
protected String acousticCustomizationId;

speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RecognizeWithWebsocketsOptions.java

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,10 @@ public interface Model {
108108
}
109109

110110
protected transient InputStream audio;
111+
111112
@SerializedName("content-type")
112113
protected String contentType;
114+
113115
protected String model;
114116
protected String languageCustomizationId;
115117
protected String acousticCustomizationId;
@@ -1029,10 +1031,11 @@ public Float backgroundAudioSuppression() {
10291031
/**
10301032
* Gets the interimResults.
10311033
*
1032-
* If `true`, the service returns interim results as a stream of `SpeechRecognitionResults` objects. By default,
1033-
* the service returns a single `SpeechRecognitionResults` object with final results only.
1034+
* <p>If `true`, the service returns interim results as a stream of `SpeechRecognitionResults`
1035+
* objects. By default, the service returns a single `SpeechRecognitionResults` object with final
1036+
* results only.
10341037
*
1035-
* NOTE: This parameter only works for the `recognizeUsingWebSocket` method.
1038+
* <p>NOTE: This parameter only works for the `recognizeUsingWebSocket` method.
10361039
*
10371040
* @return the interimResults
10381041
*/
@@ -1043,12 +1046,13 @@ public Boolean interimResults() {
10431046
/**
10441047
* Gets the processingMetrics.
10451048
*
1046-
* If `true`, requests processing metrics about the service's transcription of the input audio. The service returns
1047-
* processing metrics at the interval specified by the `processing_metrics_interval` parameter. It also returns
1048-
* processing metrics for transcription events, for example, for final and interim results. By default, the service
1049-
* returns no processing metrics.
1049+
* <p>If `true`, requests processing metrics about the service's transcription of the input audio.
1050+
* The service returns processing metrics at the interval specified by the
1051+
* `processing_metrics_interval` parameter. It also returns processing metrics for transcription
1052+
* events, for example, for final and interim results. By default, the service returns no
1053+
* processing metrics.
10501054
*
1051-
* NOTE: This parameter only works for the `recognizeUsingWebSocket` method.
1055+
* <p>NOTE: This parameter only works for the `recognizeUsingWebSocket` method.
10521056
*
10531057
* @return the processingMetrics
10541058
*/
@@ -1059,17 +1063,19 @@ public Boolean processingMetrics() {
10591063
/**
10601064
* Gets the processingMetricsInterval.
10611065
*
1062-
* Specifies the interval in real wall-clock seconds at which the service is to return processing metrics. The
1063-
* parameter is ignored unless the `processing_metrics` parameter is set to `true`.
1066+
* <p>Specifies the interval in real wall-clock seconds at which the service is to return
1067+
* processing metrics. The parameter is ignored unless the `processing_metrics` parameter is set
1068+
* to `true`.
10641069
*
1065-
* The parameter accepts a minimum value of 0.1 seconds. The level of precision is not restricted, so you can
1066-
* specify values such as 0.25 and 0.125.
1070+
* <p>The parameter accepts a minimum value of 0.1 seconds. The level of precision is not
1071+
* restricted, so you can specify values such as 0.25 and 0.125.
10671072
*
1068-
* The service does not impose a maximum value. If you want to receive processing metrics only for transcription
1069-
* events instead of at periodic intervals, set the value to a large number. If the value is larger than the
1070-
* duration of the audio, the service returns processing metrics only for transcription events.
1073+
* <p>The service does not impose a maximum value. If you want to receive processing metrics only
1074+
* for transcription events instead of at periodic intervals, set the value to a large number. If
1075+
* the value is larger than the duration of the audio, the service returns processing metrics only
1076+
* for transcription events.
10711077
*
1072-
* NOTE: This parameter only works for the `recognizeUsingWebSocket` method.
1078+
* <p>NOTE: This parameter only works for the `recognizeUsingWebSocket` method.
10731079
*
10741080
* @return the processingMetricsInterval
10751081
*/

speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/websocket/SpeechToTextWebSocketListener.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import com.google.gson.JsonParser;
2020
import com.ibm.cloud.sdk.core.util.GsonSingleton;
2121
import com.ibm.watson.speech_to_text.v1.SpeechToText;
22-
import com.ibm.watson.speech_to_text.v1.model.RecognizeOptions;
2322
import com.ibm.watson.speech_to_text.v1.model.RecognizeWithWebsocketsOptions;
2423
import com.ibm.watson.speech_to_text.v1.model.SpeechRecognitionResults;
2524
import java.io.IOException;
@@ -82,7 +81,7 @@ public final class SpeechToTextWebSocketListener extends WebSocketListener {
8281
* @param callback the callback
8382
*/
8483
public SpeechToTextWebSocketListener(
85-
final RecognizeWithWebsocketsOptions options, final RecognizeCallback callback) {
84+
final RecognizeWithWebsocketsOptions options, final RecognizeCallback callback) {
8685
this.stream = options.audio();
8786
this.options = options;
8887
this.callback = callback;

0 commit comments

Comments
 (0)