Skip to content

Commit cabaadb

Browse files
committed
feat(Speech to Text): Add generated code from newest version of service
1 parent 786fe15 commit cabaadb

Some content is hidden

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

43 files changed

+598
-591
lines changed

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

Lines changed: 253 additions & 153 deletions
Large diffs are not rendered by default.

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

Lines changed: 71 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,22 @@
2626
public class AddAudioOptions extends GenericModel {
2727

2828
/**
29-
* For an audio-type resource, the format (MIME type) of the audio. For more information, see **Content types for
30-
* audio-type resources** in the method description.
29+
* **For an archive-type resource,** specify the format of the audio files that are contained in the archive file if
30+
* they are of type `audio/alaw`, `audio/basic`, `audio/l16`, or `audio/mulaw`. Include the `rate`, `channels`, and
31+
* `endianness` parameters where necessary. In this case, all audio files that are contained in the archive file must
32+
* be of the indicated type.
3133
*
32-
* For an archive-type resource, the media type of the archive file. For more information, see **Content types for
33-
* archive-type resources** in the method description.
34+
* For all other audio formats, you can omit the header. In this case, the audio files can be of multiple types as
35+
* long as they are not of the types listed in the previous paragraph.
36+
*
37+
* The parameter accepts all of the audio formats that are supported for use with speech recognition. For more
38+
* information, see **Content types for audio-type resources** in the method description.
39+
*
40+
* **For an audio-type resource,** omit the header.
3441
*/
35-
public interface ContentType {
36-
/** application/zip. */
37-
String APPLICATION_ZIP = "application/zip";
38-
/** application/gzip. */
39-
String APPLICATION_GZIP = "application/gzip";
42+
public interface ContainedContentType {
43+
/** audio/alaw. */
44+
String AUDIO_ALAW = "audio/alaw";
4045
/** audio/basic. */
4146
String AUDIO_BASIC = "audio/basic";
4247
/** audio/flac. */
@@ -68,12 +73,19 @@ public interface ContentType {
6873
}
6974

7075
/**
71-
* For an archive-type resource, specifies the format of the audio files that are contained in the archive file. The
72-
* parameter accepts all of the audio formats that are supported for use with speech recognition, including the
73-
* `rate`, `channels`, and `endianness` parameters that are used with some formats. For more information, see
74-
* **Content types for audio-type resources** in the method description.
76+
* For an audio-type resource, the format (MIME type) of the audio. For more information, see **Content types for
77+
* audio-type resources** in the method description.
78+
*
79+
* For an archive-type resource, the media type of the archive file. For more information, see **Content types for
80+
* archive-type resources** in the method description.
7581
*/
76-
public interface ContainedContentType {
82+
public interface ContentType {
83+
/** application/zip. */
84+
String APPLICATION_ZIP = "application/zip";
85+
/** application/gzip. */
86+
String APPLICATION_GZIP = "application/gzip";
87+
/** audio/alaw. */
88+
String AUDIO_ALAW = "audio/alaw";
7789
/** audio/basic. */
7890
String AUDIO_BASIC = "audio/basic";
7991
/** audio/flac. */
@@ -107,9 +119,9 @@ public interface ContainedContentType {
107119
private String customizationId;
108120
private String audioName;
109121
private InputStream audioResource;
110-
private String contentType;
111122
private String containedContentType;
112123
private Boolean allowOverwrite;
124+
private String contentType;
113125

114126
/**
115127
* Builder.
@@ -118,17 +130,17 @@ public static class Builder {
118130
private String customizationId;
119131
private String audioName;
120132
private InputStream audioResource;
121-
private String contentType;
122133
private String containedContentType;
123134
private Boolean allowOverwrite;
135+
private String contentType;
124136

125137
private Builder(AddAudioOptions addAudioOptions) {
126-
customizationId = addAudioOptions.customizationId;
127-
audioName = addAudioOptions.audioName;
128-
audioResource = addAudioOptions.audioResource;
129-
contentType = addAudioOptions.contentType;
130-
containedContentType = addAudioOptions.containedContentType;
131-
allowOverwrite = addAudioOptions.allowOverwrite;
138+
this.customizationId = addAudioOptions.customizationId;
139+
this.audioName = addAudioOptions.audioName;
140+
this.audioResource = addAudioOptions.audioResource;
141+
this.containedContentType = addAudioOptions.containedContentType;
142+
this.allowOverwrite = addAudioOptions.allowOverwrite;
143+
this.contentType = addAudioOptions.contentType;
132144
}
133145

134146
/**
@@ -137,34 +149,6 @@ private Builder(AddAudioOptions addAudioOptions) {
137149
public Builder() {
138150
}
139151

140-
/**
141-
* Instantiates a new builder.
142-
*
143-
* @param customizationId the customizationId
144-
* @param audioName the audioName
145-
* @deprecated audioResource is now required, so this constructor will be removed in the next major release.
146-
*/
147-
public Builder(String customizationId, String audioName) {
148-
this.customizationId = customizationId;
149-
this.audioName = audioName;
150-
}
151-
152-
/**
153-
* Instantiates a new builder.
154-
*
155-
* @param customizationId the customizationId
156-
* @param audioName the audioName
157-
* @param audioResource the audioResource
158-
* @param contentType the contentType
159-
* @deprecated contentType is no longer required, so this constructor will be removed in the next major release.
160-
*/
161-
public Builder(String customizationId, String audioName, InputStream audioResource, String contentType) {
162-
this.customizationId = customizationId;
163-
this.audioName = audioName;
164-
this.audioResource = audioResource;
165-
this.contentType = contentType;
166-
}
167-
168152
/**
169153
* Instantiates a new builder with required properties.
170154
*
@@ -220,17 +204,6 @@ public Builder audioResource(InputStream audioResource) {
220204
return this;
221205
}
222206

223-
/**
224-
* Set the contentType.
225-
*
226-
* @param contentType the contentType
227-
* @return the AddAudioOptions builder
228-
*/
229-
public Builder contentType(String contentType) {
230-
this.contentType = contentType;
231-
return this;
232-
}
233-
234207
/**
235208
* Set the containedContentType.
236209
*
@@ -253,6 +226,17 @@ public Builder allowOverwrite(Boolean allowOverwrite) {
253226
return this;
254227
}
255228

229+
/**
230+
* Set the contentType.
231+
*
232+
* @param contentType the contentType
233+
* @return the AddAudioOptions builder
234+
*/
235+
public Builder contentType(String contentType) {
236+
this.contentType = contentType;
237+
return this;
238+
}
239+
256240
/**
257241
* Set the audioResource.
258242
*
@@ -274,9 +258,9 @@ private AddAudioOptions(Builder builder) {
274258
customizationId = builder.customizationId;
275259
audioName = builder.audioName;
276260
audioResource = builder.audioResource;
277-
contentType = builder.contentType;
278261
containedContentType = builder.containedContentType;
279262
allowOverwrite = builder.allowOverwrite;
263+
contentType = builder.contentType;
280264
}
281265

282266
/**
@@ -327,27 +311,20 @@ public InputStream audioResource() {
327311
}
328312

329313
/**
330-
* Gets the contentType.
314+
* Gets the containedContentType.
331315
*
332-
* For an audio-type resource, the format (MIME type) of the audio. For more information, see **Content types for
333-
* audio-type resources** in the method description.
316+
* **For an archive-type resource,** specify the format of the audio files that are contained in the archive file if
317+
* they are of type `audio/alaw`, `audio/basic`, `audio/l16`, or `audio/mulaw`. Include the `rate`, `channels`, and
318+
* `endianness` parameters where necessary. In this case, all audio files that are contained in the archive file must
319+
* be of the indicated type.
334320
*
335-
* For an archive-type resource, the media type of the archive file. For more information, see **Content types for
336-
* archive-type resources** in the method description.
321+
* For all other audio formats, you can omit the header. In this case, the audio files can be of multiple types as
322+
* long as they are not of the types listed in the previous paragraph.
337323
*
338-
* @return the contentType
339-
*/
340-
public String contentType() {
341-
return contentType;
342-
}
343-
344-
/**
345-
* Gets the containedContentType.
324+
* The parameter accepts all of the audio formats that are supported for use with speech recognition. For more
325+
* information, see **Content types for audio-type resources** in the method description.
346326
*
347-
* For an archive-type resource, specifies the format of the audio files that are contained in the archive file. The
348-
* parameter accepts all of the audio formats that are supported for use with speech recognition, including the
349-
* `rate`, `channels`, and `endianness` parameters that are used with some formats. For more information, see
350-
* **Content types for audio-type resources** in the method description.
327+
* **For an audio-type resource,** omit the header.
351328
*
352329
* @return the containedContentType
353330
*/
@@ -367,4 +344,19 @@ public String containedContentType() {
367344
public Boolean allowOverwrite() {
368345
return allowOverwrite;
369346
}
347+
348+
/**
349+
* Gets the contentType.
350+
*
351+
* For an audio-type resource, the format (MIME type) of the audio. For more information, see **Content types for
352+
* audio-type resources** in the method description.
353+
*
354+
* For an archive-type resource, the media type of the archive file. For more information, see **Content types for
355+
* archive-type resources** in the method description.
356+
*
357+
* @return the contentType
358+
*/
359+
public String contentType() {
360+
return contentType;
361+
}
370362
}

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

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public class AddCorpusOptions extends GenericModel {
2828
private String customizationId;
2929
private String corpusName;
3030
private InputStream corpusFile;
31-
private String corpusFilename;
3231
private Boolean allowOverwrite;
3332

3433
/**
@@ -38,15 +37,13 @@ public static class Builder {
3837
private String customizationId;
3938
private String corpusName;
4039
private InputStream corpusFile;
41-
private String corpusFilename;
4240
private Boolean allowOverwrite;
4341

4442
private Builder(AddCorpusOptions addCorpusOptions) {
45-
customizationId = addCorpusOptions.customizationId;
46-
corpusName = addCorpusOptions.corpusName;
47-
corpusFile = addCorpusOptions.corpusFile;
48-
corpusFilename = addCorpusOptions.corpusFilename;
49-
allowOverwrite = addCorpusOptions.allowOverwrite;
43+
this.customizationId = addCorpusOptions.customizationId;
44+
this.corpusName = addCorpusOptions.corpusName;
45+
this.corpusFile = addCorpusOptions.corpusFile;
46+
this.allowOverwrite = addCorpusOptions.allowOverwrite;
5047
}
5148

5249
/**
@@ -110,17 +107,6 @@ public Builder corpusFile(InputStream corpusFile) {
110107
return this;
111108
}
112109

113-
/**
114-
* Set the corpusFilename.
115-
*
116-
* @param corpusFilename the corpusFilename
117-
* @return the AddCorpusOptions builder
118-
*/
119-
public Builder corpusFilename(String corpusFilename) {
120-
this.corpusFilename = corpusFilename;
121-
return this;
122-
}
123-
124110
/**
125111
* Set the allowOverwrite.
126112
*
@@ -142,7 +128,6 @@ public Builder allowOverwrite(Boolean allowOverwrite) {
142128
*/
143129
public Builder corpusFile(File corpusFile) throws FileNotFoundException {
144130
this.corpusFile = new FileInputStream(corpusFile);
145-
this.corpusFilename = corpusFile.getName();
146131
return this;
147132
}
148133
}
@@ -154,7 +139,6 @@ private AddCorpusOptions(Builder builder) {
154139
customizationId = builder.customizationId;
155140
corpusName = builder.corpusName;
156141
corpusFile = builder.corpusFile;
157-
corpusFilename = builder.corpusFilename;
158142
allowOverwrite = builder.allowOverwrite;
159143
}
160144

@@ -214,17 +198,6 @@ public InputStream corpusFile() {
214198
return corpusFile;
215199
}
216200

217-
/**
218-
* Gets the corpusFilename.
219-
*
220-
* The filename for corpusFile.
221-
*
222-
* @return the corpusFilename
223-
*/
224-
public String corpusFilename() {
225-
return corpusFilename;
226-
}
227-
228201
/**
229202
* Gets the allowOverwrite.
230203
*

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ public static class Builder {
5555
private Boolean allowOverwrite;
5656

5757
private Builder(AddGrammarOptions addGrammarOptions) {
58-
customizationId = addGrammarOptions.customizationId;
59-
grammarName = addGrammarOptions.grammarName;
60-
grammarFile = addGrammarOptions.grammarFile;
61-
contentType = addGrammarOptions.contentType;
62-
allowOverwrite = addGrammarOptions.allowOverwrite;
58+
this.customizationId = addGrammarOptions.customizationId;
59+
this.grammarName = addGrammarOptions.grammarName;
60+
this.grammarFile = addGrammarOptions.grammarFile;
61+
this.contentType = addGrammarOptions.contentType;
62+
this.allowOverwrite = addGrammarOptions.allowOverwrite;
6363
}
6464

6565
/**

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ public static class Builder {
4040
private String displayAs;
4141

4242
private Builder(AddWordOptions addWordOptions) {
43-
customizationId = addWordOptions.customizationId;
44-
wordName = addWordOptions.wordName;
45-
word = addWordOptions.word;
46-
soundsLike = addWordOptions.soundsLike;
47-
displayAs = addWordOptions.displayAs;
43+
this.customizationId = addWordOptions.customizationId;
44+
this.wordName = addWordOptions.wordName;
45+
this.word = addWordOptions.word;
46+
this.soundsLike = addWordOptions.soundsLike;
47+
this.displayAs = addWordOptions.displayAs;
4848
}
4949

5050
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public static class Builder {
3434
private List<CustomWord> words;
3535

3636
private Builder(AddWordsOptions addWordsOptions) {
37-
customizationId = addWordsOptions.customizationId;
38-
words = addWordsOptions.words;
37+
this.customizationId = addWordsOptions.customizationId;
38+
this.words = addWordsOptions.words;
3939
}
4040

4141
/**

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public interface Status {
4040
String INVALID = "invalid";
4141
}
4242

43-
private Double duration;
43+
private Long duration;
4444
private String name;
4545
private AudioDetails details;
4646
private String status;
@@ -50,12 +50,11 @@ public interface Status {
5050
/**
5151
* Gets the duration.
5252
*
53-
* **For an audio-type resource,** the total seconds of audio in the resource. The value is always a whole number.
54-
* Omitted for an archive-type resource.
53+
* **For an audio-type resource,** the total seconds of audio in the resource. Omitted for an archive-type resource.
5554
*
5655
* @return the duration
5756
*/
58-
public Double getDuration() {
57+
public Long getDuration() {
5958
return duration;
6059
}
6160

0 commit comments

Comments
 (0)