Skip to content

Add generated code for Speech to Text service #857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Feb 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5af588b
Initial commit of generated STT
lpatino10 Jan 31, 2018
e555e91
Merge remote-tracking branch 'watson-developer-cloud/develop' into co…
lpatino10 Jan 31, 2018
383433b
Add unit tests for new endpoints and fix upgrade URLs
lpatino10 Jan 31, 2018
826021f
Add integration tests for new endpoints
lpatino10 Feb 1, 2018
6ec39bb
Merge remote-tracking branch 'watson-developer-cloud/develop' into co…
lpatino10 Feb 1, 2018
08ecb48
Add x-item-name extension changes
lpatino10 Feb 2, 2018
1dc32f6
Add final x-item-name change
lpatino10 Feb 2, 2018
e56c190
Add wait to hopefully stop timeout due to long STT testing
lpatino10 Feb 2, 2018
ebbdc28
Ignore tests that run extremely long
lpatino10 Feb 2, 2018
0613b70
Remove sessions methods and use single RecognizeOptions model
lpatino10 Feb 6, 2018
25ab5f3
Add RecognizeOptions model that I accidentally left out
lpatino10 Feb 6, 2018
81ec5f2
Add missing Javadoc info
lpatino10 Feb 6, 2018
f76673f
Add unit test to test more of createJob
lpatino10 Feb 6, 2018
7a8a812
:unamused: Fix checkstyle error
lpatino10 Feb 6, 2018
4e9ec43
Merge branch 'next' of https://github.com/watson-developer-cloud/java…
lpatino10 Feb 6, 2018
3024fe7
Address STT review comments
lpatino10 Feb 7, 2018
045dae5
Remove Transfer-Encoding and multipart parameters
lpatino10 Feb 7, 2018
9759444
Test extra parameters and avoid checking for other content types on J…
lpatino10 Feb 8, 2018
5b747ef
Add more test coverage additions
lpatino10 Feb 8, 2018
ae30453
Add integration test for adding an archive audio resource
lpatino10 Feb 8, 2018
54701ef
Small validator text fix
lpatino10 Feb 8, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import org.junit.Assume;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

import com.google.gson.JsonObject;
Expand Down Expand Up @@ -81,6 +82,7 @@ public void setUp() throws Exception {
* Test Convert to answers unit.
*/
@Test
@Ignore
public void testConvertToAnswers() {
for (final File file : files) {
final Answers answers = service.convertDocumentToAnswer(file).execute();
Expand All @@ -94,6 +96,7 @@ public void testConvertToAnswers() {
* Test convert to HTML.
*/
@Test
@Ignore
public void testConvertToHtml() {
for (final File file : files) {
final String html = service.convertDocumentToHTML(file).execute();
Expand All @@ -106,6 +109,7 @@ public void testConvertToHtml() {
* Test convert to Text.
*/
@Test
@Ignore
public void testConvertToText() {
for (final File file : files) {
final String text = service.convertDocumentToText(file).execute();
Expand All @@ -118,6 +122,7 @@ public void testConvertToText() {
* Test a dry run of the index document api with document only.
*/
@Test
@Ignore
public void testIndexDocumentDryRun() {
for (final File file : files) {
IndexDocumentOptions indexDocumentOptions =
Expand All @@ -132,6 +137,7 @@ public void testIndexDocumentDryRun() {
* Test a dry run of the index document api with metadata only.
*/
@Test
@Ignore
public void testIndexMetadataDryRun() {
IndexDocumentOptions indexDocumentOptions =
new IndexDocumentOptions.Builder().metadata(metadata).dryRun(dryRun).build();
Expand All @@ -146,6 +152,7 @@ public void testIndexMetadataDryRun() {
* Test a dry run of the index document api with document and metadata.
*/
@Test
@Ignore
public void testIndexDocumentAndMetadataDryRun() {
for (final File file : files) {
IndexDocumentOptions indexDocumentOptions =
Expand All @@ -162,6 +169,7 @@ public void testIndexDocumentAndMetadataDryRun() {
* Test a dry run of the index document api with document, metadata, and convert document config.
*/
@Test
@Ignore
public void testIndexDocumentAndMetadataAndConvertDocConfig() {
for (final File file : files) {
IndexDocumentOptions indexDocumentOptions = new IndexDocumentOptions.Builder().document(file).metadata(metadata)
Expand All @@ -178,6 +186,7 @@ public void testIndexDocumentAndMetadataAndConvertDocConfig() {
* Test a dry run of the index document api with document, metadata, convert document config, and index config.
*/
@Test
@Ignore
public void testIndexDocumentAndMetadataConvertDocConfigAndIndexConfig() {
for (final File file : files) {
IndexDocumentOptions indexDocumentOptions = new IndexDocumentOptions.Builder().document(file).metadata(metadata)
Expand Down
1,581 changes: 945 additions & 636 deletions ...-to-text/src/main/java/com/ibm/watson/developer_cloud/speech_to_text/v1/SpeechToText.java
100755 → 100644

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,291 @@
/*
* Copyright 2018 IBM Corp. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.ibm.watson.developer_cloud.speech_to_text.v1.model;

import java.util.List;

import com.google.gson.annotations.SerializedName;
import com.ibm.watson.developer_cloud.service.model.GenericModel;

/**
* AcousticModel.
*/
public class AcousticModel extends GenericModel {

/**
* The current status of the custom acoustic model: * `pending` indicates that the model was created but is waiting
* either for training data to be added or for the service to finish analyzing added data. * `ready` indicates that
* the model contains data and is ready to be trained. * `training` indicates that the model is currently being
* trained. * `available` indicates that the model is trained and ready to use. * `upgrading` indicates that the model
* is currently being upgraded. * `failed` indicates that training of the model failed.
*/
public interface Status {
/** pending. */
String PENDING = "pending";
/** ready. */
String READY = "ready";
/** training. */
String TRAINING = "training";
/** available. */
String AVAILABLE = "available";
/** upgrading. */
String UPGRADING = "upgrading";
/** failed. */
String FAILED = "failed";
}

@SerializedName("customization_id")
private String customizationId;
private String created;
private String language;
private List<String> versions;
private String owner;
private String name;
private String description;
@SerializedName("base_model_name")
private String baseModelName;
private String status;
private Long progress;
private String warnings;

/**
* Gets the customizationId.
*
* The customization ID (GUID) of the custom acoustic model. **Note:** When you create a new custom acoustic model,
* the service returns only the GUID of the new model; it does not return the other fields of this object.
*
* @return the customizationId
*/
public String getCustomizationId() {
return customizationId;
}

/**
* Gets the created.
*
* The date and time in Coordinated Universal Time (UTC) at which the custom acoustic model was created. The value is
* provided in full ISO 8601 format (`YYYY-MM-DDThh:mm:ss.sTZD`).
*
* @return the created
*/
public String getCreated() {
return created;
}

/**
* Gets the language.
*
* The language identifier of the custom acoustic model (for example, `en-US`).
*
* @return the language
*/
public String getLanguage() {
return language;
}

/**
* Gets the versions.
*
* A list of the available versions of the custom acoustic model. Each element of the array indicates a version of the
* base model with which the custom model can be used. Multiple versions exist only if the custom model has been
* upgraded; otherwise, only a single version is shown.
*
* @return the versions
*/
public List<String> getVersions() {
return versions;
}

/**
* Gets the owner.
*
* The GUID of the service credentials for the instance of the service that owns the custom acoustic model.
*
* @return the owner
*/
public String getOwner() {
return owner;
}

/**
* Gets the name.
*
* The name of the custom acoustic model.
*
* @return the name
*/
public String getName() {
return name;
}

/**
* Gets the description.
*
* The description of the custom acoustic model.
*
* @return the description
*/
public String getDescription() {
return description;
}

/**
* Gets the baseModelName.
*
* The name of the language model for which the custom acoustic model was created.
*
* @return the baseModelName
*/
public String getBaseModelName() {
return baseModelName;
}

/**
* Gets the status.
*
* The current status of the custom acoustic model: * `pending` indicates that the model was created but is waiting
* either for training data to be added or for the service to finish analyzing added data. * `ready` indicates that
* the model contains data and is ready to be trained. * `training` indicates that the model is currently being
* trained. * `available` indicates that the model is trained and ready to use. * `upgrading` indicates that the model
* is currently being upgraded. * `failed` indicates that training of the model failed.
*
* @return the status
*/
public String getStatus() {
return status;
}

/**
* Gets the progress.
*
* A percentage that indicates the progress of the custom acoustic model's current training. A value of `100` means
* that the model is fully trained. **Note:** The `progress` field does not currently reflect the progress of the
* training; the field changes from `0` to `100` when training is complete.
*
* @return the progress
*/
public Long getProgress() {
return progress;
}

/**
* Gets the warnings.
*
* If the request included unknown query parameters, the following message: `Unexpected query parameter(s)
* ['parameters'] detected`, where `parameters` is a list that includes a quoted string for each unknown parameter.
*
* @return the warnings
*/
public String getWarnings() {
return warnings;
}

/**
* Sets the customizationId.
*
* @param customizationId the new customizationId
*/
public void setCustomizationId(final String customizationId) {
this.customizationId = customizationId;
}

/**
* Sets the created.
*
* @param created the new created
*/
public void setCreated(final String created) {
this.created = created;
}

/**
* Sets the language.
*
* @param language the new language
*/
public void setLanguage(final String language) {
this.language = language;
}

/**
* Sets the versions.
*
* @param versions the new versions
*/
public void setVersions(final List<String> versions) {
this.versions = versions;
}

/**
* Sets the owner.
*
* @param owner the new owner
*/
public void setOwner(final String owner) {
this.owner = owner;
}

/**
* Sets the name.
*
* @param name the new name
*/
public void setName(final String name) {
this.name = name;
}

/**
* Sets the description.
*
* @param description the new description
*/
public void setDescription(final String description) {
this.description = description;
}

/**
* Sets the baseModelName.
*
* @param baseModelName the new baseModelName
*/
public void setBaseModelName(final String baseModelName) {
this.baseModelName = baseModelName;
}

/**
* Sets the status.
*
* @param status the new status
*/
public void setStatus(final String status) {
this.status = status;
}

/**
* Sets the progress.
*
* @param progress the new progress
*/
public void setProgress(final long progress) {
this.progress = progress;
}

/**
* Sets the warnings.
*
* @param warnings the new warnings
*/
public void setWarnings(final String warnings) {
this.warnings = warnings;
}
}
Loading