diff --git a/java-speech/README.md b/java-speech/README.md index b1cb1c2af76a..7f7c8f9a04d3 100644 --- a/java-speech/README.md +++ b/java-speech/README.md @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file: com.google.cloud google-cloud-speech - 4.0.0 + 4.1.0 ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-speech:4.0.0' +implementation 'com.google.cloud:google-cloud-speech:4.1.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-speech" % "4.0.0" +libraryDependencies += "com.google.cloud" % "google-cloud-speech" % "4.1.0" ``` ## Authentication @@ -195,16 +195,16 @@ Java is a registered trademark of Oracle and/or its affiliates. [product-docs]: https://cloud.google.com/speech-to-text/docs/ [javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-speech/latest/overview -[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-speech/java7.svg -[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-speech/java7.html -[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-speech/java8.svg -[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-speech/java8.html -[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-speech/java8-osx.svg -[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-speech/java8-osx.html -[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-speech/java8-win.svg -[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-speech/java8-win.html -[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-speech/java11.svg -[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-speech/java11.html +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-speech.svg [maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-speech&core=gav @@ -216,9 +216,9 @@ Java is a registered trademark of Oracle and/or its affiliates. [create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects [cloud-sdk]: https://cloud.google.com/sdk/ [troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting -[contributing]: https://github.com/googleapis/java-speech/blob/main/CONTRIBUTING.md -[code-of-conduct]: https://github.com/googleapis/java-speech/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct -[license]: https://github.com/googleapis/java-speech/blob/main/LICENSE +[contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=speech.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM diff --git a/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonAdaptationStub.java b/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonAdaptationStub.java index acc891cc94de..ff9393d05e25 100644 --- a/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonAdaptationStub.java +++ b/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonAdaptationStub.java @@ -88,12 +88,13 @@ public class HttpJsonAdaptationStub extends AdaptationStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearParent().build(), false)) + .toBody("*", request.toBuilder().clearParent().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -124,6 +125,7 @@ public class HttpJsonAdaptationStub extends AdaptationStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -159,6 +161,7 @@ public class HttpJsonAdaptationStub extends AdaptationStub { ProtoRestSerializer.create(); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -194,12 +197,13 @@ public class HttpJsonAdaptationStub extends AdaptationStub { ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("phraseSet", request.getPhraseSet(), false)) + .toBody("phraseSet", request.getPhraseSet(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -230,6 +234,7 @@ public class HttpJsonAdaptationStub extends AdaptationStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -263,12 +268,13 @@ public class HttpJsonAdaptationStub extends AdaptationStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearParent().build(), false)) + .toBody("*", request.toBuilder().clearParent().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -299,6 +305,7 @@ public class HttpJsonAdaptationStub extends AdaptationStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -334,6 +341,7 @@ public class HttpJsonAdaptationStub extends AdaptationStub { ProtoRestSerializer.create(); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -369,12 +377,13 @@ public class HttpJsonAdaptationStub extends AdaptationStub { ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("customClass", request.getCustomClass(), false)) + .toBody("customClass", request.getCustomClass(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -405,6 +414,7 @@ public class HttpJsonAdaptationStub extends AdaptationStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) diff --git a/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonSpeechStub.java b/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonSpeechStub.java index 8432fb0b5acb..1422cfaae62b 100644 --- a/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonSpeechStub.java +++ b/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonSpeechStub.java @@ -82,12 +82,13 @@ public class HttpJsonSpeechStub extends SpeechStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) + .toBody("*", request.toBuilder().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -117,12 +118,13 @@ public class HttpJsonSpeechStub extends SpeechStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) + .toBody("*", request.toBuilder().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() diff --git a/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonAdaptationStub.java b/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonAdaptationStub.java index 0f5e1743cfdb..2e8dd0f046bb 100644 --- a/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonAdaptationStub.java +++ b/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonAdaptationStub.java @@ -88,12 +88,13 @@ public class HttpJsonAdaptationStub extends AdaptationStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearParent().build(), false)) + .toBody("*", request.toBuilder().clearParent().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -124,6 +125,7 @@ public class HttpJsonAdaptationStub extends AdaptationStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -159,6 +161,7 @@ public class HttpJsonAdaptationStub extends AdaptationStub { ProtoRestSerializer.create(); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -194,12 +197,13 @@ public class HttpJsonAdaptationStub extends AdaptationStub { ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("phraseSet", request.getPhraseSet(), false)) + .toBody("phraseSet", request.getPhraseSet(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -230,6 +234,7 @@ public class HttpJsonAdaptationStub extends AdaptationStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -263,12 +268,13 @@ public class HttpJsonAdaptationStub extends AdaptationStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearParent().build(), false)) + .toBody("*", request.toBuilder().clearParent().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -299,6 +305,7 @@ public class HttpJsonAdaptationStub extends AdaptationStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -334,6 +341,7 @@ public class HttpJsonAdaptationStub extends AdaptationStub { ProtoRestSerializer.create(); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -369,12 +377,13 @@ public class HttpJsonAdaptationStub extends AdaptationStub { ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("customClass", request.getCustomClass(), false)) + .toBody("customClass", request.getCustomClass(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -405,6 +414,7 @@ public class HttpJsonAdaptationStub extends AdaptationStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) diff --git a/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonSpeechStub.java b/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonSpeechStub.java index ea83c8d98b21..215cc5f807a7 100644 --- a/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonSpeechStub.java +++ b/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonSpeechStub.java @@ -82,12 +82,13 @@ public class HttpJsonSpeechStub extends SpeechStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) + .toBody("*", request.toBuilder().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -117,12 +118,13 @@ public class HttpJsonSpeechStub extends SpeechStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) + .toBody("*", request.toBuilder().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() diff --git a/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v2/stub/HttpJsonSpeechStub.java b/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v2/stub/HttpJsonSpeechStub.java index c9914f783f48..d1d750b8665e 100644 --- a/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v2/stub/HttpJsonSpeechStub.java +++ b/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v2/stub/HttpJsonSpeechStub.java @@ -121,12 +121,13 @@ public class HttpJsonSpeechStub extends SpeechStub { fields, "recognizerId", request.getRecognizerId()); serializer.putQueryParam( fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("recognizer", request.getRecognizer(), false)) + .toBody("recognizer", request.getRecognizer(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -164,6 +165,7 @@ public class HttpJsonSpeechStub extends SpeechStub { serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam( fields, "showDeleted", request.getShowDeleted()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -197,6 +199,7 @@ public class HttpJsonSpeechStub extends SpeechStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -234,12 +237,13 @@ public class HttpJsonSpeechStub extends SpeechStub { serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); serializer.putQueryParam( fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("recognizer", request.getRecognizer(), false)) + .toBody("recognizer", request.getRecognizer(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -278,6 +282,7 @@ public class HttpJsonSpeechStub extends SpeechStub { serializer.putQueryParam(fields, "etag", request.getEtag()); serializer.putQueryParam( fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -314,12 +319,13 @@ public class HttpJsonSpeechStub extends SpeechStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearName().build(), false)) + .toBody("*", request.toBuilder().clearName().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -353,13 +359,13 @@ public class HttpJsonSpeechStub extends SpeechStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody( - "*", request.toBuilder().clearRecognizer().build(), false)) + .toBody("*", request.toBuilder().clearRecognizer().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -390,13 +396,13 @@ public class HttpJsonSpeechStub extends SpeechStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody( - "*", request.toBuilder().clearRecognizer().build(), false)) + .toBody("*", request.toBuilder().clearRecognizer().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -429,6 +435,7 @@ public class HttpJsonSpeechStub extends SpeechStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -464,12 +471,13 @@ public class HttpJsonSpeechStub extends SpeechStub { ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("config", request.getConfig(), false)) + .toBody("config", request.getConfig(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -504,12 +512,13 @@ public class HttpJsonSpeechStub extends SpeechStub { fields, "customClassId", request.getCustomClassId()); serializer.putQueryParam( fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("customClass", request.getCustomClass(), false)) + .toBody("customClass", request.getCustomClass(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -547,6 +556,7 @@ public class HttpJsonSpeechStub extends SpeechStub { serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam( fields, "showDeleted", request.getShowDeleted()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -580,6 +590,7 @@ public class HttpJsonSpeechStub extends SpeechStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -617,12 +628,13 @@ public class HttpJsonSpeechStub extends SpeechStub { serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); serializer.putQueryParam( fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("customClass", request.getCustomClass(), false)) + .toBody("customClass", request.getCustomClass(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -661,6 +673,7 @@ public class HttpJsonSpeechStub extends SpeechStub { serializer.putQueryParam(fields, "etag", request.getEtag()); serializer.putQueryParam( fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -697,12 +710,13 @@ public class HttpJsonSpeechStub extends SpeechStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearName().build(), false)) + .toBody("*", request.toBuilder().clearName().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -740,12 +754,13 @@ public class HttpJsonSpeechStub extends SpeechStub { fields, "phraseSetId", request.getPhraseSetId()); serializer.putQueryParam( fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("phraseSet", request.getPhraseSet(), false)) + .toBody("phraseSet", request.getPhraseSet(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -783,6 +798,7 @@ public class HttpJsonSpeechStub extends SpeechStub { serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam( fields, "showDeleted", request.getShowDeleted()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -816,6 +832,7 @@ public class HttpJsonSpeechStub extends SpeechStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -853,12 +870,13 @@ public class HttpJsonSpeechStub extends SpeechStub { serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); serializer.putQueryParam( fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("phraseSet", request.getPhraseSet(), false)) + .toBody("phraseSet", request.getPhraseSet(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -897,6 +915,7 @@ public class HttpJsonSpeechStub extends SpeechStub { serializer.putQueryParam(fields, "etag", request.getEtag()); serializer.putQueryParam( fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -933,12 +952,13 @@ public class HttpJsonSpeechStub extends SpeechStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearName().build(), false)) + .toBody("*", request.toBuilder().clearName().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() diff --git a/java-speech/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientHttpJsonTest.java b/java-speech/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientHttpJsonTest.java index f924cc6c4f59..08df1f722e74 100644 --- a/java-speech/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientHttpJsonTest.java +++ b/java-speech/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientHttpJsonTest.java @@ -82,6 +82,8 @@ public void recognizeTest() throws Exception { RecognizeResponse.newBuilder() .addAllResults(new ArrayList()) .setTotalBilledTime(Duration.newBuilder().build()) + .setSpeechAdaptationInfo(SpeechAdaptationInfo.newBuilder().build()) + .setRequestId(37109963) .build(); mockService.addResponse(expectedResponse); @@ -131,6 +133,8 @@ public void longRunningRecognizeTest() throws Exception { .setTotalBilledTime(Duration.newBuilder().build()) .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) .setOutputError(Status.newBuilder().build()) + .setSpeechAdaptationInfo(SpeechAdaptationInfo.newBuilder().build()) + .setRequestId(37109963) .build(); Operation resultOperation = Operation.newBuilder() diff --git a/java-speech/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientTest.java b/java-speech/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientTest.java index 29ddc3801755..d7213a292436 100644 --- a/java-speech/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientTest.java +++ b/java-speech/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientTest.java @@ -91,6 +91,8 @@ public void recognizeTest() throws Exception { RecognizeResponse.newBuilder() .addAllResults(new ArrayList()) .setTotalBilledTime(Duration.newBuilder().build()) + .setSpeechAdaptationInfo(SpeechAdaptationInfo.newBuilder().build()) + .setRequestId(37109963) .build(); mockSpeech.addResponse(expectedResponse); @@ -135,6 +137,8 @@ public void longRunningRecognizeTest() throws Exception { .setTotalBilledTime(Duration.newBuilder().build()) .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) .setOutputError(Status.newBuilder().build()) + .setSpeechAdaptationInfo(SpeechAdaptationInfo.newBuilder().build()) + .setRequestId(37109963) .build(); Operation resultOperation = Operation.newBuilder() @@ -188,6 +192,8 @@ public void streamingRecognizeTest() throws Exception { .setError(Status.newBuilder().build()) .addAllResults(new ArrayList()) .setTotalBilledTime(Duration.newBuilder().build()) + .setSpeechAdaptationInfo(SpeechAdaptationInfo.newBuilder().build()) + .setRequestId(37109963) .build(); mockSpeech.addResponse(expectedResponse); StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build(); diff --git a/java-speech/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientHttpJsonTest.java b/java-speech/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientHttpJsonTest.java index 565f69611631..ac8ae61614dd 100644 --- a/java-speech/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientHttpJsonTest.java +++ b/java-speech/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientHttpJsonTest.java @@ -82,6 +82,8 @@ public void recognizeTest() throws Exception { RecognizeResponse.newBuilder() .addAllResults(new ArrayList()) .setTotalBilledTime(Duration.newBuilder().build()) + .setSpeechAdaptationInfo(SpeechAdaptationInfo.newBuilder().build()) + .setRequestId(37109963) .build(); mockService.addResponse(expectedResponse); @@ -131,6 +133,8 @@ public void longRunningRecognizeTest() throws Exception { .setTotalBilledTime(Duration.newBuilder().build()) .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) .setOutputError(Status.newBuilder().build()) + .setSpeechAdaptationInfo(SpeechAdaptationInfo.newBuilder().build()) + .setRequestId(37109963) .build(); Operation resultOperation = Operation.newBuilder() diff --git a/java-speech/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java b/java-speech/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java index 47c54e81eed9..a72c0183abd6 100644 --- a/java-speech/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java +++ b/java-speech/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java @@ -91,6 +91,8 @@ public void recognizeTest() throws Exception { RecognizeResponse.newBuilder() .addAllResults(new ArrayList()) .setTotalBilledTime(Duration.newBuilder().build()) + .setSpeechAdaptationInfo(SpeechAdaptationInfo.newBuilder().build()) + .setRequestId(37109963) .build(); mockSpeech.addResponse(expectedResponse); @@ -135,6 +137,8 @@ public void longRunningRecognizeTest() throws Exception { .setTotalBilledTime(Duration.newBuilder().build()) .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) .setOutputError(Status.newBuilder().build()) + .setSpeechAdaptationInfo(SpeechAdaptationInfo.newBuilder().build()) + .setRequestId(37109963) .build(); Operation resultOperation = Operation.newBuilder() @@ -188,6 +192,8 @@ public void streamingRecognizeTest() throws Exception { .setError(Status.newBuilder().build()) .addAllResults(new ArrayList()) .setTotalBilledTime(Duration.newBuilder().build()) + .setSpeechAdaptationInfo(SpeechAdaptationInfo.newBuilder().build()) + .setRequestId(37109963) .build(); mockSpeech.addResponse(expectedResponse); StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build(); diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponse.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponse.java index b859ab8c0110..4744aa855739 100644 --- a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponse.java +++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponse.java @@ -288,6 +288,74 @@ public com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder() { return getOutputError(); } + public static final int SPEECH_ADAPTATION_INFO_FIELD_NUMBER = 8; + private com.google.cloud.speech.v1.SpeechAdaptationInfo speechAdaptationInfo_; + /** + * + * + *
+   * Provides information on speech adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 8; + * + * @return Whether the speechAdaptationInfo field is set. + */ + @java.lang.Override + public boolean hasSpeechAdaptationInfo() { + return speechAdaptationInfo_ != null; + } + /** + * + * + *
+   * Provides information on speech adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 8; + * + * @return The speechAdaptationInfo. + */ + @java.lang.Override + public com.google.cloud.speech.v1.SpeechAdaptationInfo getSpeechAdaptationInfo() { + return speechAdaptationInfo_ == null + ? com.google.cloud.speech.v1.SpeechAdaptationInfo.getDefaultInstance() + : speechAdaptationInfo_; + } + /** + * + * + *
+   * Provides information on speech adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 8; + */ + @java.lang.Override + public com.google.cloud.speech.v1.SpeechAdaptationInfoOrBuilder + getSpeechAdaptationInfoOrBuilder() { + return getSpeechAdaptationInfo(); + } + + public static final int REQUEST_ID_FIELD_NUMBER = 9; + private long requestId_; + /** + * + * + *
+   * The ID associated with the request. This is a unique ID specific only to
+   * the given request.
+   * 
+ * + * int64 request_id = 9; + * + * @return The requestId. + */ + @java.lang.Override + public long getRequestId() { + return requestId_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -314,6 +382,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (outputError_ != null) { output.writeMessage(7, getOutputError()); } + if (speechAdaptationInfo_ != null) { + output.writeMessage(8, getSpeechAdaptationInfo()); + } + if (requestId_ != 0L) { + output.writeInt64(9, requestId_); + } getUnknownFields().writeTo(output); } @@ -335,6 +409,13 @@ public int getSerializedSize() { if (outputError_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getOutputError()); } + if (speechAdaptationInfo_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(8, getSpeechAdaptationInfo()); + } + if (requestId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(9, requestId_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -364,6 +445,11 @@ public boolean equals(final java.lang.Object obj) { if (hasOutputError()) { if (!getOutputError().equals(other.getOutputError())) return false; } + if (hasSpeechAdaptationInfo() != other.hasSpeechAdaptationInfo()) return false; + if (hasSpeechAdaptationInfo()) { + if (!getSpeechAdaptationInfo().equals(other.getSpeechAdaptationInfo())) return false; + } + if (getRequestId() != other.getRequestId()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -391,6 +477,12 @@ public int hashCode() { hash = (37 * hash) + OUTPUT_ERROR_FIELD_NUMBER; hash = (53 * hash) + getOutputError().hashCode(); } + if (hasSpeechAdaptationInfo()) { + hash = (37 * hash) + SPEECH_ADAPTATION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getSpeechAdaptationInfo().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRequestId()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -559,6 +651,14 @@ public Builder clear() { outputError_ = null; outputErrorBuilder_ = null; } + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfo_ = null; + } else { + speechAdaptationInfo_ = null; + speechAdaptationInfoBuilder_ = null; + } + requestId_ = 0L; + return this; } @@ -611,6 +711,12 @@ public com.google.cloud.speech.v1.LongRunningRecognizeResponse buildPartial() { } else { result.outputError_ = outputErrorBuilder_.build(); } + if (speechAdaptationInfoBuilder_ == null) { + result.speechAdaptationInfo_ = speechAdaptationInfo_; + } else { + result.speechAdaptationInfo_ = speechAdaptationInfoBuilder_.build(); + } + result.requestId_ = requestId_; onBuilt(); return result; } @@ -697,6 +803,12 @@ public Builder mergeFrom(com.google.cloud.speech.v1.LongRunningRecognizeResponse if (other.hasOutputError()) { mergeOutputError(other.getOutputError()); } + if (other.hasSpeechAdaptationInfo()) { + mergeSpeechAdaptationInfo(other.getSpeechAdaptationInfo()); + } + if (other.getRequestId() != 0L) { + setRequestId(other.getRequestId()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -755,6 +867,19 @@ public Builder mergeFrom( break; } // case 58 + case 66: + { + input.readMessage( + getSpeechAdaptationInfoFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 66 + case 72: + { + requestId_ = input.readInt64(); + + break; + } // case 72 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1691,6 +1816,250 @@ public com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder() { return outputErrorBuilder_; } + private com.google.cloud.speech.v1.SpeechAdaptationInfo speechAdaptationInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.SpeechAdaptationInfo, + com.google.cloud.speech.v1.SpeechAdaptationInfo.Builder, + com.google.cloud.speech.v1.SpeechAdaptationInfoOrBuilder> + speechAdaptationInfoBuilder_; + /** + * + * + *
+     * Provides information on speech adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 8; + * + * @return Whether the speechAdaptationInfo field is set. + */ + public boolean hasSpeechAdaptationInfo() { + return speechAdaptationInfoBuilder_ != null || speechAdaptationInfo_ != null; + } + /** + * + * + *
+     * Provides information on speech adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 8; + * + * @return The speechAdaptationInfo. + */ + public com.google.cloud.speech.v1.SpeechAdaptationInfo getSpeechAdaptationInfo() { + if (speechAdaptationInfoBuilder_ == null) { + return speechAdaptationInfo_ == null + ? com.google.cloud.speech.v1.SpeechAdaptationInfo.getDefaultInstance() + : speechAdaptationInfo_; + } else { + return speechAdaptationInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Provides information on speech adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 8; + */ + public Builder setSpeechAdaptationInfo(com.google.cloud.speech.v1.SpeechAdaptationInfo value) { + if (speechAdaptationInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + speechAdaptationInfo_ = value; + onChanged(); + } else { + speechAdaptationInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Provides information on speech adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 8; + */ + public Builder setSpeechAdaptationInfo( + com.google.cloud.speech.v1.SpeechAdaptationInfo.Builder builderForValue) { + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfo_ = builderForValue.build(); + onChanged(); + } else { + speechAdaptationInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Provides information on speech adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 8; + */ + public Builder mergeSpeechAdaptationInfo( + com.google.cloud.speech.v1.SpeechAdaptationInfo value) { + if (speechAdaptationInfoBuilder_ == null) { + if (speechAdaptationInfo_ != null) { + speechAdaptationInfo_ = + com.google.cloud.speech.v1.SpeechAdaptationInfo.newBuilder(speechAdaptationInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + speechAdaptationInfo_ = value; + } + onChanged(); + } else { + speechAdaptationInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Provides information on speech adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 8; + */ + public Builder clearSpeechAdaptationInfo() { + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfo_ = null; + onChanged(); + } else { + speechAdaptationInfo_ = null; + speechAdaptationInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Provides information on speech adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 8; + */ + public com.google.cloud.speech.v1.SpeechAdaptationInfo.Builder + getSpeechAdaptationInfoBuilder() { + + onChanged(); + return getSpeechAdaptationInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Provides information on speech adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 8; + */ + public com.google.cloud.speech.v1.SpeechAdaptationInfoOrBuilder + getSpeechAdaptationInfoOrBuilder() { + if (speechAdaptationInfoBuilder_ != null) { + return speechAdaptationInfoBuilder_.getMessageOrBuilder(); + } else { + return speechAdaptationInfo_ == null + ? com.google.cloud.speech.v1.SpeechAdaptationInfo.getDefaultInstance() + : speechAdaptationInfo_; + } + } + /** + * + * + *
+     * Provides information on speech adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.SpeechAdaptationInfo, + com.google.cloud.speech.v1.SpeechAdaptationInfo.Builder, + com.google.cloud.speech.v1.SpeechAdaptationInfoOrBuilder> + getSpeechAdaptationInfoFieldBuilder() { + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.SpeechAdaptationInfo, + com.google.cloud.speech.v1.SpeechAdaptationInfo.Builder, + com.google.cloud.speech.v1.SpeechAdaptationInfoOrBuilder>( + getSpeechAdaptationInfo(), getParentForChildren(), isClean()); + speechAdaptationInfo_ = null; + } + return speechAdaptationInfoBuilder_; + } + + private long requestId_; + /** + * + * + *
+     * The ID associated with the request. This is a unique ID specific only to
+     * the given request.
+     * 
+ * + * int64 request_id = 9; + * + * @return The requestId. + */ + @java.lang.Override + public long getRequestId() { + return requestId_; + } + /** + * + * + *
+     * The ID associated with the request. This is a unique ID specific only to
+     * the given request.
+     * 
+ * + * int64 request_id = 9; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(long value) { + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID associated with the request. This is a unique ID specific only to
+     * the given request.
+     * 
+ * + * int64 request_id = 9; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = 0L; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponseOrBuilder.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponseOrBuilder.java index 5078fa81a9e3..38e77a1cc96c 100644 --- a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponseOrBuilder.java +++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponseOrBuilder.java @@ -184,4 +184,53 @@ public interface LongRunningRecognizeResponseOrBuilder * .google.rpc.Status output_error = 7; */ com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder(); + + /** + * + * + *
+   * Provides information on speech adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 8; + * + * @return Whether the speechAdaptationInfo field is set. + */ + boolean hasSpeechAdaptationInfo(); + /** + * + * + *
+   * Provides information on speech adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 8; + * + * @return The speechAdaptationInfo. + */ + com.google.cloud.speech.v1.SpeechAdaptationInfo getSpeechAdaptationInfo(); + /** + * + * + *
+   * Provides information on speech adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 8; + */ + com.google.cloud.speech.v1.SpeechAdaptationInfoOrBuilder getSpeechAdaptationInfoOrBuilder(); + + /** + * + * + *
+   * The ID associated with the request. This is a unique ID specific only to
+   * the given request.
+   * 
+ * + * int64 request_id = 9; + * + * @return The requestId. + */ + long getRequestId(); } diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfig.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfig.java index f907f5bf8f29..161f5639e442 100644 --- a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfig.java +++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfig.java @@ -496,8 +496,7 @@ public int getSampleRateHertz() { *
    * The number of channels in the input audio data.
    * ONLY set this for MULTI-CHANNEL recognition.
-   * Valid values for LINEAR16 and FLAC are `1`-`8`.
-   * Valid values for OGG_OPUS are '1'-'254'.
+   * Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`.
    * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
    * If `0` or omitted, defaults to one channel (mono).
    * Note: We only recognize the first channel by default.
@@ -2412,8 +2411,7 @@ public Builder clearSampleRateHertz() {
      * 
      * The number of channels in the input audio data.
      * ONLY set this for MULTI-CHANNEL recognition.
-     * Valid values for LINEAR16 and FLAC are `1`-`8`.
-     * Valid values for OGG_OPUS are '1'-'254'.
+     * Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`.
      * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
      * If `0` or omitted, defaults to one channel (mono).
      * Note: We only recognize the first channel by default.
@@ -2435,8 +2433,7 @@ public int getAudioChannelCount() {
      * 
      * The number of channels in the input audio data.
      * ONLY set this for MULTI-CHANNEL recognition.
-     * Valid values for LINEAR16 and FLAC are `1`-`8`.
-     * Valid values for OGG_OPUS are '1'-'254'.
+     * Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`.
      * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
      * If `0` or omitted, defaults to one channel (mono).
      * Note: We only recognize the first channel by default.
@@ -2461,8 +2458,7 @@ public Builder setAudioChannelCount(int value) {
      * 
      * The number of channels in the input audio data.
      * ONLY set this for MULTI-CHANNEL recognition.
-     * Valid values for LINEAR16 and FLAC are `1`-`8`.
-     * Valid values for OGG_OPUS are '1'-'254'.
+     * Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`.
      * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
      * If `0` or omitted, defaults to one channel (mono).
      * Note: We only recognize the first channel by default.
diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfigOrBuilder.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfigOrBuilder.java
index c3bdcc43d557..323d1dbc34f4 100644
--- a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfigOrBuilder.java
+++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfigOrBuilder.java
@@ -77,8 +77,7 @@ public interface RecognitionConfigOrBuilder
    * 
    * The number of channels in the input audio data.
    * ONLY set this for MULTI-CHANNEL recognition.
-   * Valid values for LINEAR16 and FLAC are `1`-`8`.
-   * Valid values for OGG_OPUS are '1'-'254'.
+   * Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`.
    * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
    * If `0` or omitted, defaults to one channel (mono).
    * Note: We only recognize the first channel by default.
diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponse.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponse.java
index 7d1b821e07b7..b14536b839ea 100644
--- a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponse.java
+++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponse.java
@@ -192,6 +192,74 @@ public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() {
     return getTotalBilledTime();
   }
 
+  public static final int SPEECH_ADAPTATION_INFO_FIELD_NUMBER = 7;
+  private com.google.cloud.speech.v1.SpeechAdaptationInfo speechAdaptationInfo_;
+  /**
+   *
+   *
+   * 
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 7; + * + * @return Whether the speechAdaptationInfo field is set. + */ + @java.lang.Override + public boolean hasSpeechAdaptationInfo() { + return speechAdaptationInfo_ != null; + } + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 7; + * + * @return The speechAdaptationInfo. + */ + @java.lang.Override + public com.google.cloud.speech.v1.SpeechAdaptationInfo getSpeechAdaptationInfo() { + return speechAdaptationInfo_ == null + ? com.google.cloud.speech.v1.SpeechAdaptationInfo.getDefaultInstance() + : speechAdaptationInfo_; + } + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 7; + */ + @java.lang.Override + public com.google.cloud.speech.v1.SpeechAdaptationInfoOrBuilder + getSpeechAdaptationInfoOrBuilder() { + return getSpeechAdaptationInfo(); + } + + public static final int REQUEST_ID_FIELD_NUMBER = 8; + private long requestId_; + /** + * + * + *
+   * The ID associated with the request. This is a unique ID specific only to
+   * the given request.
+   * 
+ * + * int64 request_id = 8; + * + * @return The requestId. + */ + @java.lang.Override + public long getRequestId() { + return requestId_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -212,6 +280,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (totalBilledTime_ != null) { output.writeMessage(3, getTotalBilledTime()); } + if (speechAdaptationInfo_ != null) { + output.writeMessage(7, getSpeechAdaptationInfo()); + } + if (requestId_ != 0L) { + output.writeInt64(8, requestId_); + } getUnknownFields().writeTo(output); } @@ -227,6 +301,13 @@ public int getSerializedSize() { if (totalBilledTime_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTotalBilledTime()); } + if (speechAdaptationInfo_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(7, getSpeechAdaptationInfo()); + } + if (requestId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(8, requestId_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -248,6 +329,11 @@ public boolean equals(final java.lang.Object obj) { if (hasTotalBilledTime()) { if (!getTotalBilledTime().equals(other.getTotalBilledTime())) return false; } + if (hasSpeechAdaptationInfo() != other.hasSpeechAdaptationInfo()) return false; + if (hasSpeechAdaptationInfo()) { + if (!getSpeechAdaptationInfo().equals(other.getSpeechAdaptationInfo())) return false; + } + if (getRequestId() != other.getRequestId()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -267,6 +353,12 @@ public int hashCode() { hash = (37 * hash) + TOTAL_BILLED_TIME_FIELD_NUMBER; hash = (53 * hash) + getTotalBilledTime().hashCode(); } + if (hasSpeechAdaptationInfo()) { + hash = (37 * hash) + SPEECH_ADAPTATION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getSpeechAdaptationInfo().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRequestId()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -420,6 +512,14 @@ public Builder clear() { totalBilledTime_ = null; totalBilledTimeBuilder_ = null; } + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfo_ = null; + } else { + speechAdaptationInfo_ = null; + speechAdaptationInfoBuilder_ = null; + } + requestId_ = 0L; + return this; } @@ -462,6 +562,12 @@ public com.google.cloud.speech.v1.RecognizeResponse buildPartial() { } else { result.totalBilledTime_ = totalBilledTimeBuilder_.build(); } + if (speechAdaptationInfoBuilder_ == null) { + result.speechAdaptationInfo_ = speechAdaptationInfo_; + } else { + result.speechAdaptationInfo_ = speechAdaptationInfoBuilder_.build(); + } + result.requestId_ = requestId_; onBuilt(); return result; } @@ -541,6 +647,12 @@ public Builder mergeFrom(com.google.cloud.speech.v1.RecognizeResponse other) { if (other.hasTotalBilledTime()) { mergeTotalBilledTime(other.getTotalBilledTime()); } + if (other.hasSpeechAdaptationInfo()) { + mergeSpeechAdaptationInfo(other.getSpeechAdaptationInfo()); + } + if (other.getRequestId() != 0L) { + setRequestId(other.getRequestId()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -587,6 +699,19 @@ public Builder mergeFrom( break; } // case 26 + case 58: + { + input.readMessage( + getSpeechAdaptationInfoFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 58 + case 64: + { + requestId_ = input.readInt64(); + + break; + } // case 64 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1162,6 +1287,250 @@ public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { return totalBilledTimeBuilder_; } + private com.google.cloud.speech.v1.SpeechAdaptationInfo speechAdaptationInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.SpeechAdaptationInfo, + com.google.cloud.speech.v1.SpeechAdaptationInfo.Builder, + com.google.cloud.speech.v1.SpeechAdaptationInfoOrBuilder> + speechAdaptationInfoBuilder_; + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 7; + * + * @return Whether the speechAdaptationInfo field is set. + */ + public boolean hasSpeechAdaptationInfo() { + return speechAdaptationInfoBuilder_ != null || speechAdaptationInfo_ != null; + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 7; + * + * @return The speechAdaptationInfo. + */ + public com.google.cloud.speech.v1.SpeechAdaptationInfo getSpeechAdaptationInfo() { + if (speechAdaptationInfoBuilder_ == null) { + return speechAdaptationInfo_ == null + ? com.google.cloud.speech.v1.SpeechAdaptationInfo.getDefaultInstance() + : speechAdaptationInfo_; + } else { + return speechAdaptationInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 7; + */ + public Builder setSpeechAdaptationInfo(com.google.cloud.speech.v1.SpeechAdaptationInfo value) { + if (speechAdaptationInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + speechAdaptationInfo_ = value; + onChanged(); + } else { + speechAdaptationInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 7; + */ + public Builder setSpeechAdaptationInfo( + com.google.cloud.speech.v1.SpeechAdaptationInfo.Builder builderForValue) { + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfo_ = builderForValue.build(); + onChanged(); + } else { + speechAdaptationInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 7; + */ + public Builder mergeSpeechAdaptationInfo( + com.google.cloud.speech.v1.SpeechAdaptationInfo value) { + if (speechAdaptationInfoBuilder_ == null) { + if (speechAdaptationInfo_ != null) { + speechAdaptationInfo_ = + com.google.cloud.speech.v1.SpeechAdaptationInfo.newBuilder(speechAdaptationInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + speechAdaptationInfo_ = value; + } + onChanged(); + } else { + speechAdaptationInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 7; + */ + public Builder clearSpeechAdaptationInfo() { + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfo_ = null; + onChanged(); + } else { + speechAdaptationInfo_ = null; + speechAdaptationInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 7; + */ + public com.google.cloud.speech.v1.SpeechAdaptationInfo.Builder + getSpeechAdaptationInfoBuilder() { + + onChanged(); + return getSpeechAdaptationInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 7; + */ + public com.google.cloud.speech.v1.SpeechAdaptationInfoOrBuilder + getSpeechAdaptationInfoOrBuilder() { + if (speechAdaptationInfoBuilder_ != null) { + return speechAdaptationInfoBuilder_.getMessageOrBuilder(); + } else { + return speechAdaptationInfo_ == null + ? com.google.cloud.speech.v1.SpeechAdaptationInfo.getDefaultInstance() + : speechAdaptationInfo_; + } + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.SpeechAdaptationInfo, + com.google.cloud.speech.v1.SpeechAdaptationInfo.Builder, + com.google.cloud.speech.v1.SpeechAdaptationInfoOrBuilder> + getSpeechAdaptationInfoFieldBuilder() { + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.SpeechAdaptationInfo, + com.google.cloud.speech.v1.SpeechAdaptationInfo.Builder, + com.google.cloud.speech.v1.SpeechAdaptationInfoOrBuilder>( + getSpeechAdaptationInfo(), getParentForChildren(), isClean()); + speechAdaptationInfo_ = null; + } + return speechAdaptationInfoBuilder_; + } + + private long requestId_; + /** + * + * + *
+     * The ID associated with the request. This is a unique ID specific only to
+     * the given request.
+     * 
+ * + * int64 request_id = 8; + * + * @return The requestId. + */ + @java.lang.Override + public long getRequestId() { + return requestId_; + } + /** + * + * + *
+     * The ID associated with the request. This is a unique ID specific only to
+     * the given request.
+     * 
+ * + * int64 request_id = 8; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(long value) { + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID associated with the request. This is a unique ID specific only to
+     * the given request.
+     * 
+ * + * int64 request_id = 8; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = 0L; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponseOrBuilder.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponseOrBuilder.java index ea3880945a59..47f347663cae 100644 --- a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponseOrBuilder.java +++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponseOrBuilder.java @@ -114,4 +114,53 @@ public interface RecognizeResponseOrBuilder * .google.protobuf.Duration total_billed_time = 3; */ com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder(); + + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 7; + * + * @return Whether the speechAdaptationInfo field is set. + */ + boolean hasSpeechAdaptationInfo(); + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 7; + * + * @return The speechAdaptationInfo. + */ + com.google.cloud.speech.v1.SpeechAdaptationInfo getSpeechAdaptationInfo(); + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 7; + */ + com.google.cloud.speech.v1.SpeechAdaptationInfoOrBuilder getSpeechAdaptationInfoOrBuilder(); + + /** + * + * + *
+   * The ID associated with the request. This is a unique ID specific only to
+   * the given request.
+   * 
+ * + * int64 request_id = 8; + * + * @return The requestId. + */ + long getRequestId(); } diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfig.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfig.java index 73c2c5bba6ed..76c1e3332520 100644 --- a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfig.java +++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfig.java @@ -138,7 +138,7 @@ public int getMaxSpeakerCount() { * * * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. See - * google/cloud/speech/v1/cloud_speech.proto;l=457 + * google/cloud/speech/v1/cloud_speech.proto;l=456 * @return The speakerTag. */ @java.lang.Override @@ -725,7 +725,7 @@ public Builder clearMaxSpeakerCount() { * * * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. See - * google/cloud/speech/v1/cloud_speech.proto;l=457 + * google/cloud/speech/v1/cloud_speech.proto;l=456 * @return The speakerTag. */ @java.lang.Override @@ -744,7 +744,7 @@ public int getSpeakerTag() { * * * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. See - * google/cloud/speech/v1/cloud_speech.proto;l=457 + * google/cloud/speech/v1/cloud_speech.proto;l=456 * @param value The speakerTag to set. * @return This builder for chaining. */ @@ -766,7 +766,7 @@ public Builder setSpeakerTag(int value) { * * * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. See - * google/cloud/speech/v1/cloud_speech.proto;l=457 + * google/cloud/speech/v1/cloud_speech.proto;l=456 * @return This builder for chaining. */ @java.lang.Deprecated diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfigOrBuilder.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfigOrBuilder.java index cf71a32e1b0c..d754b4e464ec 100644 --- a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfigOrBuilder.java +++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfigOrBuilder.java @@ -79,7 +79,7 @@ public interface SpeakerDiarizationConfigOrBuilder * * * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. See - * google/cloud/speech/v1/cloud_speech.proto;l=457 + * google/cloud/speech/v1/cloud_speech.proto;l=456 * @return The speakerTag. */ @java.lang.Deprecated diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationInfo.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationInfo.java new file mode 100644 index 000000000000..c3ee9953d36d --- /dev/null +++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationInfo.java @@ -0,0 +1,717 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +/** + * + * + *
+ * Information on speech adaptation use in results
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.SpeechAdaptationInfo} + */ +public final class SpeechAdaptationInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.SpeechAdaptationInfo) + SpeechAdaptationInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use SpeechAdaptationInfo.newBuilder() to construct. + private SpeechAdaptationInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SpeechAdaptationInfo() { + timeoutMessage_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SpeechAdaptationInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto + .internal_static_google_cloud_speech_v1_SpeechAdaptationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto + .internal_static_google_cloud_speech_v1_SpeechAdaptationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.SpeechAdaptationInfo.class, + com.google.cloud.speech.v1.SpeechAdaptationInfo.Builder.class); + } + + public static final int ADAPTATION_TIMEOUT_FIELD_NUMBER = 1; + private boolean adaptationTimeout_; + /** + * + * + *
+   * Whether there was a timeout when applying speech adaptation. If true,
+   * adaptation had no effect in the response transcript.
+   * 
+ * + * bool adaptation_timeout = 1; + * + * @return The adaptationTimeout. + */ + @java.lang.Override + public boolean getAdaptationTimeout() { + return adaptationTimeout_; + } + + public static final int TIMEOUT_MESSAGE_FIELD_NUMBER = 4; + private volatile java.lang.Object timeoutMessage_; + /** + * + * + *
+   * If set, returns a message specifying which part of the speech adaptation
+   * request timed out.
+   * 
+ * + * string timeout_message = 4; + * + * @return The timeoutMessage. + */ + @java.lang.Override + public java.lang.String getTimeoutMessage() { + java.lang.Object ref = timeoutMessage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeoutMessage_ = s; + return s; + } + } + /** + * + * + *
+   * If set, returns a message specifying which part of the speech adaptation
+   * request timed out.
+   * 
+ * + * string timeout_message = 4; + * + * @return The bytes for timeoutMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTimeoutMessageBytes() { + java.lang.Object ref = timeoutMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeoutMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (adaptationTimeout_ != false) { + output.writeBool(1, adaptationTimeout_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(timeoutMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, timeoutMessage_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (adaptationTimeout_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, adaptationTimeout_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(timeoutMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, timeoutMessage_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.SpeechAdaptationInfo)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.SpeechAdaptationInfo other = + (com.google.cloud.speech.v1.SpeechAdaptationInfo) obj; + + if (getAdaptationTimeout() != other.getAdaptationTimeout()) return false; + if (!getTimeoutMessage().equals(other.getTimeoutMessage())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ADAPTATION_TIMEOUT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAdaptationTimeout()); + hash = (37 * hash) + TIMEOUT_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getTimeoutMessage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.SpeechAdaptationInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1.SpeechAdaptationInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1.SpeechAdaptationInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1.SpeechAdaptationInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1.SpeechAdaptationInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1.SpeechAdaptationInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1.SpeechAdaptationInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1.SpeechAdaptationInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1.SpeechAdaptationInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1.SpeechAdaptationInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1.SpeechAdaptationInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1.SpeechAdaptationInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.speech.v1.SpeechAdaptationInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Information on speech adaptation use in results
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.SpeechAdaptationInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.SpeechAdaptationInfo) + com.google.cloud.speech.v1.SpeechAdaptationInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto + .internal_static_google_cloud_speech_v1_SpeechAdaptationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto + .internal_static_google_cloud_speech_v1_SpeechAdaptationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.SpeechAdaptationInfo.class, + com.google.cloud.speech.v1.SpeechAdaptationInfo.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.SpeechAdaptationInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + adaptationTimeout_ = false; + + timeoutMessage_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechProto + .internal_static_google_cloud_speech_v1_SpeechAdaptationInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeechAdaptationInfo getDefaultInstanceForType() { + return com.google.cloud.speech.v1.SpeechAdaptationInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeechAdaptationInfo build() { + com.google.cloud.speech.v1.SpeechAdaptationInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeechAdaptationInfo buildPartial() { + com.google.cloud.speech.v1.SpeechAdaptationInfo result = + new com.google.cloud.speech.v1.SpeechAdaptationInfo(this); + result.adaptationTimeout_ = adaptationTimeout_; + result.timeoutMessage_ = timeoutMessage_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.SpeechAdaptationInfo) { + return mergeFrom((com.google.cloud.speech.v1.SpeechAdaptationInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.SpeechAdaptationInfo other) { + if (other == com.google.cloud.speech.v1.SpeechAdaptationInfo.getDefaultInstance()) + return this; + if (other.getAdaptationTimeout() != false) { + setAdaptationTimeout(other.getAdaptationTimeout()); + } + if (!other.getTimeoutMessage().isEmpty()) { + timeoutMessage_ = other.timeoutMessage_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + adaptationTimeout_ = input.readBool(); + + break; + } // case 8 + case 34: + { + timeoutMessage_ = input.readStringRequireUtf8(); + + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private boolean adaptationTimeout_; + /** + * + * + *
+     * Whether there was a timeout when applying speech adaptation. If true,
+     * adaptation had no effect in the response transcript.
+     * 
+ * + * bool adaptation_timeout = 1; + * + * @return The adaptationTimeout. + */ + @java.lang.Override + public boolean getAdaptationTimeout() { + return adaptationTimeout_; + } + /** + * + * + *
+     * Whether there was a timeout when applying speech adaptation. If true,
+     * adaptation had no effect in the response transcript.
+     * 
+ * + * bool adaptation_timeout = 1; + * + * @param value The adaptationTimeout to set. + * @return This builder for chaining. + */ + public Builder setAdaptationTimeout(boolean value) { + + adaptationTimeout_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether there was a timeout when applying speech adaptation. If true,
+     * adaptation had no effect in the response transcript.
+     * 
+ * + * bool adaptation_timeout = 1; + * + * @return This builder for chaining. + */ + public Builder clearAdaptationTimeout() { + + adaptationTimeout_ = false; + onChanged(); + return this; + } + + private java.lang.Object timeoutMessage_ = ""; + /** + * + * + *
+     * If set, returns a message specifying which part of the speech adaptation
+     * request timed out.
+     * 
+ * + * string timeout_message = 4; + * + * @return The timeoutMessage. + */ + public java.lang.String getTimeoutMessage() { + java.lang.Object ref = timeoutMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeoutMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If set, returns a message specifying which part of the speech adaptation
+     * request timed out.
+     * 
+ * + * string timeout_message = 4; + * + * @return The bytes for timeoutMessage. + */ + public com.google.protobuf.ByteString getTimeoutMessageBytes() { + java.lang.Object ref = timeoutMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeoutMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If set, returns a message specifying which part of the speech adaptation
+     * request timed out.
+     * 
+ * + * string timeout_message = 4; + * + * @param value The timeoutMessage to set. + * @return This builder for chaining. + */ + public Builder setTimeoutMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + timeoutMessage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, returns a message specifying which part of the speech adaptation
+     * request timed out.
+     * 
+ * + * string timeout_message = 4; + * + * @return This builder for chaining. + */ + public Builder clearTimeoutMessage() { + + timeoutMessage_ = getDefaultInstance().getTimeoutMessage(); + onChanged(); + return this; + } + /** + * + * + *
+     * If set, returns a message specifying which part of the speech adaptation
+     * request timed out.
+     * 
+ * + * string timeout_message = 4; + * + * @param value The bytes for timeoutMessage to set. + * @return This builder for chaining. + */ + public Builder setTimeoutMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + timeoutMessage_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.SpeechAdaptationInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeechAdaptationInfo) + private static final com.google.cloud.speech.v1.SpeechAdaptationInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.SpeechAdaptationInfo(); + } + + public static com.google.cloud.speech.v1.SpeechAdaptationInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SpeechAdaptationInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeechAdaptationInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationInfoOrBuilder.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationInfoOrBuilder.java new file mode 100644 index 000000000000..da65be18b760 --- /dev/null +++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationInfoOrBuilder.java @@ -0,0 +1,66 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +public interface SpeechAdaptationInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.SpeechAdaptationInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether there was a timeout when applying speech adaptation. If true,
+   * adaptation had no effect in the response transcript.
+   * 
+ * + * bool adaptation_timeout = 1; + * + * @return The adaptationTimeout. + */ + boolean getAdaptationTimeout(); + + /** + * + * + *
+   * If set, returns a message specifying which part of the speech adaptation
+   * request timed out.
+   * 
+ * + * string timeout_message = 4; + * + * @return The timeoutMessage. + */ + java.lang.String getTimeoutMessage(); + /** + * + * + *
+   * If set, returns a message specifying which part of the speech adaptation
+   * request timed out.
+   * 
+ * + * string timeout_message = 4; + * + * @return The bytes for timeoutMessage. + */ + com.google.protobuf.ByteString getTimeoutMessageBytes(); +} diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechProto.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechProto.java index c8ab1411b55f..00b8954f454a 100644 --- a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechProto.java +++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechProto.java @@ -99,6 +99,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_speech_v1_WordInfo_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_speech_v1_WordInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_SpeechAdaptationInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_SpeechAdaptationInfo_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -193,67 +197,77 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\005\022\027\n\023OTHER_INDOOR_DEVICE\020\006:\002\030\001\"/\n\rSpeech" + "Context\022\017\n\007phrases\030\001 \003(\t\022\r\n\005boost\030\004 \001(\002\"" + "D\n\020RecognitionAudio\022\021\n\007content\030\001 \001(\014H\000\022\r" - + "\n\003uri\030\002 \001(\tH\000B\016\n\014audio_source\"\213\001\n\021Recogn" + + "\n\003uri\030\002 \001(\tH\000B\016\n\014audio_source\"\355\001\n\021Recogn" + "izeResponse\022@\n\007results\030\002 \003(\0132/.google.cl" + "oud.speech.v1.SpeechRecognitionResult\0224\n" + "\021total_billed_time\030\003 \001(\0132\031.google.protob" - + "uf.Duration\"\207\002\n\034LongRunningRecognizeResp" - + "onse\022@\n\007results\030\002 \003(\0132/.google.cloud.spe" - + "ech.v1.SpeechRecognitionResult\0224\n\021total_" - + "billed_time\030\003 \001(\0132\031.google.protobuf.Dura" - + "tion\022E\n\routput_config\030\006 \001(\0132..google.clo" - + "ud.speech.v1.TranscriptOutputConfig\022(\n\014o" - + "utput_error\030\007 \001(\0132\022.google.rpc.Status\"\260\001" - + "\n\034LongRunningRecognizeMetadata\022\030\n\020progre" - + "ss_percent\030\001 \001(\005\022.\n\nstart_time\030\002 \001(\0132\032.g" - + "oogle.protobuf.Timestamp\0224\n\020last_update_" - + "time\030\003 \001(\0132\032.google.protobuf.Timestamp\022\020" - + "\n\003uri\030\004 \001(\tB\003\340A\003\"\347\002\n\032StreamingRecognizeR" - + "esponse\022!\n\005error\030\001 \001(\0132\022.google.rpc.Stat" - + "us\022C\n\007results\030\002 \003(\01322.google.cloud.speec" - + "h.v1.StreamingRecognitionResult\022]\n\021speec" - + "h_event_type\030\004 \001(\0162B.google.cloud.speech" - + ".v1.StreamingRecognizeResponse.SpeechEve" - + "ntType\0224\n\021total_billed_time\030\005 \001(\0132\031.goog" - + "le.protobuf.Duration\"L\n\017SpeechEventType\022" - + "\034\n\030SPEECH_EVENT_UNSPECIFIED\020\000\022\033\n\027END_OF_" - + "SINGLE_UTTERANCE\020\001\"\362\001\n\032StreamingRecognit" - + "ionResult\022J\n\014alternatives\030\001 \003(\01324.google" - + ".cloud.speech.v1.SpeechRecognitionAltern" - + "ative\022\020\n\010is_final\030\002 \001(\010\022\021\n\tstability\030\003 \001" - + "(\002\0222\n\017result_end_time\030\004 \001(\0132\031.google.pro" - + "tobuf.Duration\022\023\n\013channel_tag\030\005 \001(\005\022\032\n\rl" - + "anguage_code\030\006 \001(\tB\003\340A\003\"\312\001\n\027SpeechRecogn" - + "itionResult\022J\n\014alternatives\030\001 \003(\01324.goog" - + "le.cloud.speech.v1.SpeechRecognitionAlte" - + "rnative\022\023\n\013channel_tag\030\002 \001(\005\0222\n\017result_e" - + "nd_time\030\004 \001(\0132\031.google.protobuf.Duration" - + "\022\032\n\rlanguage_code\030\005 \001(\tB\003\340A\003\"w\n\034SpeechRe" - + "cognitionAlternative\022\022\n\ntranscript\030\001 \001(\t" - + "\022\022\n\nconfidence\030\002 \001(\002\022/\n\005words\030\003 \003(\0132 .go" - + "ogle.cloud.speech.v1.WordInfo\"\242\001\n\010WordIn" - + "fo\022-\n\nstart_time\030\001 \001(\0132\031.google.protobuf" - + ".Duration\022+\n\010end_time\030\002 \001(\0132\031.google.pro" - + "tobuf.Duration\022\014\n\004word\030\003 \001(\t\022\022\n\nconfiden" - + "ce\030\004 \001(\002\022\030\n\013speaker_tag\030\005 \001(\005B\003\340A\0032\321\004\n\006S" - + "peech\022\220\001\n\tRecognize\022(.google.cloud.speec" - + "h.v1.RecognizeRequest\032).google.cloud.spe" - + "ech.v1.RecognizeResponse\".\202\323\344\223\002\031\"\024/v1/sp" - + "eech:recognize:\001*\332A\014config,audio\022\344\001\n\024Lon" - + "gRunningRecognize\0223.google.cloud.speech." - + "v1.LongRunningRecognizeRequest\032\035.google." - + "longrunning.Operation\"x\202\323\344\223\002$\"\037/v1/speec" - + "h:longrunningrecognize:\001*\332A\014config,audio" - + "\312A<\n\034LongRunningRecognizeResponse\022\034LongR" - + "unningRecognizeMetadata\022\201\001\n\022StreamingRec" - + "ognize\0221.google.cloud.speech.v1.Streamin" - + "gRecognizeRequest\0322.google.cloud.speech." - + "v1.StreamingRecognizeResponse\"\000(\0010\001\032I\312A\025" - + "speech.googleapis.com\322A.https://www.goog" - + "leapis.com/auth/cloud-platformBr\n\032com.go" - + "ogle.cloud.speech.v1B\013SpeechProtoP\001Z + * Provides information on adaptation behavior in response + *
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 9; + * + * @return Whether the speechAdaptationInfo field is set. + */ + @java.lang.Override + public boolean hasSpeechAdaptationInfo() { + return speechAdaptationInfo_ != null; + } + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 9; + * + * @return The speechAdaptationInfo. + */ + @java.lang.Override + public com.google.cloud.speech.v1.SpeechAdaptationInfo getSpeechAdaptationInfo() { + return speechAdaptationInfo_ == null + ? com.google.cloud.speech.v1.SpeechAdaptationInfo.getDefaultInstance() + : speechAdaptationInfo_; + } + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 9; + */ + @java.lang.Override + public com.google.cloud.speech.v1.SpeechAdaptationInfoOrBuilder + getSpeechAdaptationInfoOrBuilder() { + return getSpeechAdaptationInfo(); + } + + public static final int REQUEST_ID_FIELD_NUMBER = 10; + private long requestId_; + /** + * + * + *
+   * The ID associated with the request. This is a unique ID specific only to
+   * the given request.
+   * 
+ * + * int64 request_id = 10; + * + * @return The requestId. + */ + @java.lang.Override + public long getRequestId() { + return requestId_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -510,6 +578,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (totalBilledTime_ != null) { output.writeMessage(5, getTotalBilledTime()); } + if (speechAdaptationInfo_ != null) { + output.writeMessage(9, getSpeechAdaptationInfo()); + } + if (requestId_ != 0L) { + output.writeInt64(10, requestId_); + } getUnknownFields().writeTo(output); } @@ -534,6 +608,13 @@ public int getSerializedSize() { if (totalBilledTime_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getTotalBilledTime()); } + if (speechAdaptationInfo_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(9, getSpeechAdaptationInfo()); + } + if (requestId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(10, requestId_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -560,6 +641,11 @@ public boolean equals(final java.lang.Object obj) { if (hasTotalBilledTime()) { if (!getTotalBilledTime().equals(other.getTotalBilledTime())) return false; } + if (hasSpeechAdaptationInfo() != other.hasSpeechAdaptationInfo()) return false; + if (hasSpeechAdaptationInfo()) { + if (!getSpeechAdaptationInfo().equals(other.getSpeechAdaptationInfo())) return false; + } + if (getRequestId() != other.getRequestId()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -585,6 +671,12 @@ public int hashCode() { hash = (37 * hash) + TOTAL_BILLED_TIME_FIELD_NUMBER; hash = (53 * hash) + getTotalBilledTime().hashCode(); } + if (hasSpeechAdaptationInfo()) { + hash = (37 * hash) + SPEECH_ADAPTATION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getSpeechAdaptationInfo().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRequestId()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -780,6 +872,14 @@ public Builder clear() { totalBilledTime_ = null; totalBilledTimeBuilder_ = null; } + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfo_ = null; + } else { + speechAdaptationInfo_ = null; + speechAdaptationInfoBuilder_ = null; + } + requestId_ = 0L; + return this; } @@ -828,6 +928,12 @@ public com.google.cloud.speech.v1.StreamingRecognizeResponse buildPartial() { } else { result.totalBilledTime_ = totalBilledTimeBuilder_.build(); } + if (speechAdaptationInfoBuilder_ == null) { + result.speechAdaptationInfo_ = speechAdaptationInfo_; + } else { + result.speechAdaptationInfo_ = speechAdaptationInfoBuilder_.build(); + } + result.requestId_ = requestId_; onBuilt(); return result; } @@ -914,6 +1020,12 @@ public Builder mergeFrom(com.google.cloud.speech.v1.StreamingRecognizeResponse o if (other.hasTotalBilledTime()) { mergeTotalBilledTime(other.getTotalBilledTime()); } + if (other.hasSpeechAdaptationInfo()) { + mergeSpeechAdaptationInfo(other.getSpeechAdaptationInfo()); + } + if (other.getRequestId() != 0L) { + setRequestId(other.getRequestId()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -972,6 +1084,19 @@ public Builder mergeFrom( break; } // case 42 + case 74: + { + input.readMessage( + getSpeechAdaptationInfoFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 74 + case 80: + { + requestId_ = input.readInt64(); + + break; + } // case 80 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1886,6 +2011,250 @@ public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { return totalBilledTimeBuilder_; } + private com.google.cloud.speech.v1.SpeechAdaptationInfo speechAdaptationInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.SpeechAdaptationInfo, + com.google.cloud.speech.v1.SpeechAdaptationInfo.Builder, + com.google.cloud.speech.v1.SpeechAdaptationInfoOrBuilder> + speechAdaptationInfoBuilder_; + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 9; + * + * @return Whether the speechAdaptationInfo field is set. + */ + public boolean hasSpeechAdaptationInfo() { + return speechAdaptationInfoBuilder_ != null || speechAdaptationInfo_ != null; + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 9; + * + * @return The speechAdaptationInfo. + */ + public com.google.cloud.speech.v1.SpeechAdaptationInfo getSpeechAdaptationInfo() { + if (speechAdaptationInfoBuilder_ == null) { + return speechAdaptationInfo_ == null + ? com.google.cloud.speech.v1.SpeechAdaptationInfo.getDefaultInstance() + : speechAdaptationInfo_; + } else { + return speechAdaptationInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 9; + */ + public Builder setSpeechAdaptationInfo(com.google.cloud.speech.v1.SpeechAdaptationInfo value) { + if (speechAdaptationInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + speechAdaptationInfo_ = value; + onChanged(); + } else { + speechAdaptationInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 9; + */ + public Builder setSpeechAdaptationInfo( + com.google.cloud.speech.v1.SpeechAdaptationInfo.Builder builderForValue) { + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfo_ = builderForValue.build(); + onChanged(); + } else { + speechAdaptationInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 9; + */ + public Builder mergeSpeechAdaptationInfo( + com.google.cloud.speech.v1.SpeechAdaptationInfo value) { + if (speechAdaptationInfoBuilder_ == null) { + if (speechAdaptationInfo_ != null) { + speechAdaptationInfo_ = + com.google.cloud.speech.v1.SpeechAdaptationInfo.newBuilder(speechAdaptationInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + speechAdaptationInfo_ = value; + } + onChanged(); + } else { + speechAdaptationInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 9; + */ + public Builder clearSpeechAdaptationInfo() { + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfo_ = null; + onChanged(); + } else { + speechAdaptationInfo_ = null; + speechAdaptationInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 9; + */ + public com.google.cloud.speech.v1.SpeechAdaptationInfo.Builder + getSpeechAdaptationInfoBuilder() { + + onChanged(); + return getSpeechAdaptationInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 9; + */ + public com.google.cloud.speech.v1.SpeechAdaptationInfoOrBuilder + getSpeechAdaptationInfoOrBuilder() { + if (speechAdaptationInfoBuilder_ != null) { + return speechAdaptationInfoBuilder_.getMessageOrBuilder(); + } else { + return speechAdaptationInfo_ == null + ? com.google.cloud.speech.v1.SpeechAdaptationInfo.getDefaultInstance() + : speechAdaptationInfo_; + } + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.SpeechAdaptationInfo, + com.google.cloud.speech.v1.SpeechAdaptationInfo.Builder, + com.google.cloud.speech.v1.SpeechAdaptationInfoOrBuilder> + getSpeechAdaptationInfoFieldBuilder() { + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.SpeechAdaptationInfo, + com.google.cloud.speech.v1.SpeechAdaptationInfo.Builder, + com.google.cloud.speech.v1.SpeechAdaptationInfoOrBuilder>( + getSpeechAdaptationInfo(), getParentForChildren(), isClean()); + speechAdaptationInfo_ = null; + } + return speechAdaptationInfoBuilder_; + } + + private long requestId_; + /** + * + * + *
+     * The ID associated with the request. This is a unique ID specific only to
+     * the given request.
+     * 
+ * + * int64 request_id = 10; + * + * @return The requestId. + */ + @java.lang.Override + public long getRequestId() { + return requestId_; + } + /** + * + * + *
+     * The ID associated with the request. This is a unique ID specific only to
+     * the given request.
+     * 
+ * + * int64 request_id = 10; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(long value) { + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID associated with the request. This is a unique ID specific only to
+     * the given request.
+     * 
+ * + * int64 request_id = 10; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = 0L; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponseOrBuilder.java b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponseOrBuilder.java index 2c285ed9f96f..d047556c57ee 100644 --- a/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponseOrBuilder.java +++ b/java-speech/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponseOrBuilder.java @@ -192,4 +192,53 @@ public interface StreamingRecognizeResponseOrBuilder * .google.protobuf.Duration total_billed_time = 5; */ com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder(); + + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 9; + * + * @return Whether the speechAdaptationInfo field is set. + */ + boolean hasSpeechAdaptationInfo(); + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 9; + * + * @return The speechAdaptationInfo. + */ + com.google.cloud.speech.v1.SpeechAdaptationInfo getSpeechAdaptationInfo(); + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptationInfo speech_adaptation_info = 9; + */ + com.google.cloud.speech.v1.SpeechAdaptationInfoOrBuilder getSpeechAdaptationInfoOrBuilder(); + + /** + * + * + *
+   * The ID associated with the request. This is a unique ID specific only to
+   * the given request.
+   * 
+ * + * int64 request_id = 10; + * + * @return The requestId. + */ + long getRequestId(); } diff --git a/java-speech/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto b/java-speech/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto index 65aed9837e85..e8f19603087f 100644 --- a/java-speech/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto +++ b/java-speech/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto @@ -260,8 +260,7 @@ message RecognitionConfig { // The number of channels in the input audio data. // ONLY set this for MULTI-CHANNEL recognition. - // Valid values for LINEAR16 and FLAC are `1`-`8`. - // Valid values for OGG_OPUS are '1'-'254'. + // Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`. // Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`. // If `0` or omitted, defaults to one channel (mono). // Note: We only recognize the first channel by default. @@ -652,6 +651,13 @@ message RecognizeResponse { // When available, billed audio seconds for the corresponding request. google.protobuf.Duration total_billed_time = 3; + + // Provides information on adaptation behavior in response + SpeechAdaptationInfo speech_adaptation_info = 7; + + // The ID associated with the request. This is a unique ID specific only to + // the given request. + int64 request_id = 8; } // The only message returned to the client by the `LongRunningRecognize` method. @@ -672,6 +678,13 @@ message LongRunningRecognizeResponse { // If the transcript output fails this field contains the relevant error. google.rpc.Status output_error = 7; + + // Provides information on speech adaptation behavior in response + SpeechAdaptationInfo speech_adaptation_info = 8; + + // The ID associated with the request. This is a unique ID specific only to + // the given request. + int64 request_id = 9; } // Describes the progress of a long-running `LongRunningRecognize` call. It is @@ -774,6 +787,13 @@ message StreamingRecognizeResponse { // When available, billed audio seconds for the stream. // Set only if this is the last response in the stream. google.protobuf.Duration total_billed_time = 5; + + // Provides information on adaptation behavior in response + SpeechAdaptationInfo speech_adaptation_info = 9; + + // The ID associated with the request. This is a unique ID specific only to + // the given request. + int64 request_id = 10; } // A streaming speech recognition result corresponding to a portion of the audio @@ -897,3 +917,14 @@ message WordInfo { // top alternative. int32 speaker_tag = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; } + +// Information on speech adaptation use in results +message SpeechAdaptationInfo { + // Whether there was a timeout when applying speech adaptation. If true, + // adaptation had no effect in the response transcript. + bool adaptation_timeout = 1; + + // If set, returns a message specifying which part of the speech adaptation + // request timed out. + string timeout_message = 4; +} diff --git a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponse.java b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponse.java index 22d119209a0d..fb493c2d1a8a 100644 --- a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponse.java +++ b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponse.java @@ -291,6 +291,74 @@ public com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder() { return getOutputError(); } + public static final int SPEECH_ADAPTATION_INFO_FIELD_NUMBER = 8; + private com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speechAdaptationInfo_; + /** + * + * + *
+   * Provides information on speech adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 8; + * + * @return Whether the speechAdaptationInfo field is set. + */ + @java.lang.Override + public boolean hasSpeechAdaptationInfo() { + return speechAdaptationInfo_ != null; + } + /** + * + * + *
+   * Provides information on speech adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 8; + * + * @return The speechAdaptationInfo. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo getSpeechAdaptationInfo() { + return speechAdaptationInfo_ == null + ? com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.getDefaultInstance() + : speechAdaptationInfo_; + } + /** + * + * + *
+   * Provides information on speech adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 8; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfoOrBuilder + getSpeechAdaptationInfoOrBuilder() { + return getSpeechAdaptationInfo(); + } + + public static final int REQUEST_ID_FIELD_NUMBER = 9; + private long requestId_; + /** + * + * + *
+   * The ID associated with the request. This is a unique ID specific only to
+   * the given request.
+   * 
+ * + * int64 request_id = 9; + * + * @return The requestId. + */ + @java.lang.Override + public long getRequestId() { + return requestId_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -317,6 +385,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (outputError_ != null) { output.writeMessage(7, getOutputError()); } + if (speechAdaptationInfo_ != null) { + output.writeMessage(8, getSpeechAdaptationInfo()); + } + if (requestId_ != 0L) { + output.writeInt64(9, requestId_); + } getUnknownFields().writeTo(output); } @@ -338,6 +412,13 @@ public int getSerializedSize() { if (outputError_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getOutputError()); } + if (speechAdaptationInfo_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(8, getSpeechAdaptationInfo()); + } + if (requestId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(9, requestId_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -367,6 +448,11 @@ public boolean equals(final java.lang.Object obj) { if (hasOutputError()) { if (!getOutputError().equals(other.getOutputError())) return false; } + if (hasSpeechAdaptationInfo() != other.hasSpeechAdaptationInfo()) return false; + if (hasSpeechAdaptationInfo()) { + if (!getSpeechAdaptationInfo().equals(other.getSpeechAdaptationInfo())) return false; + } + if (getRequestId() != other.getRequestId()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -394,6 +480,12 @@ public int hashCode() { hash = (37 * hash) + OUTPUT_ERROR_FIELD_NUMBER; hash = (53 * hash) + getOutputError().hashCode(); } + if (hasSpeechAdaptationInfo()) { + hash = (37 * hash) + SPEECH_ADAPTATION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getSpeechAdaptationInfo().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRequestId()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -562,6 +654,14 @@ public Builder clear() { outputError_ = null; outputErrorBuilder_ = null; } + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfo_ = null; + } else { + speechAdaptationInfo_ = null; + speechAdaptationInfoBuilder_ = null; + } + requestId_ = 0L; + return this; } @@ -615,6 +715,12 @@ public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse buildParti } else { result.outputError_ = outputErrorBuilder_.build(); } + if (speechAdaptationInfoBuilder_ == null) { + result.speechAdaptationInfo_ = speechAdaptationInfo_; + } else { + result.speechAdaptationInfo_ = speechAdaptationInfoBuilder_.build(); + } + result.requestId_ = requestId_; onBuilt(); return result; } @@ -702,6 +808,12 @@ public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeR if (other.hasOutputError()) { mergeOutputError(other.getOutputError()); } + if (other.hasSpeechAdaptationInfo()) { + mergeSpeechAdaptationInfo(other.getSpeechAdaptationInfo()); + } + if (other.getRequestId() != 0L) { + setRequestId(other.getRequestId()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -760,6 +872,19 @@ public Builder mergeFrom( break; } // case 58 + case 66: + { + input.readMessage( + getSpeechAdaptationInfoFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 66 + case 72: + { + requestId_ = input.readInt64(); + + break; + } // case 72 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1711,6 +1836,252 @@ public com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder() { return outputErrorBuilder_; } + private com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speechAdaptationInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo, + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.Builder, + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfoOrBuilder> + speechAdaptationInfoBuilder_; + /** + * + * + *
+     * Provides information on speech adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 8; + * + * @return Whether the speechAdaptationInfo field is set. + */ + public boolean hasSpeechAdaptationInfo() { + return speechAdaptationInfoBuilder_ != null || speechAdaptationInfo_ != null; + } + /** + * + * + *
+     * Provides information on speech adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 8; + * + * @return The speechAdaptationInfo. + */ + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo getSpeechAdaptationInfo() { + if (speechAdaptationInfoBuilder_ == null) { + return speechAdaptationInfo_ == null + ? com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.getDefaultInstance() + : speechAdaptationInfo_; + } else { + return speechAdaptationInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Provides information on speech adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 8; + */ + public Builder setSpeechAdaptationInfo( + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo value) { + if (speechAdaptationInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + speechAdaptationInfo_ = value; + onChanged(); + } else { + speechAdaptationInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Provides information on speech adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 8; + */ + public Builder setSpeechAdaptationInfo( + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.Builder builderForValue) { + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfo_ = builderForValue.build(); + onChanged(); + } else { + speechAdaptationInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Provides information on speech adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 8; + */ + public Builder mergeSpeechAdaptationInfo( + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo value) { + if (speechAdaptationInfoBuilder_ == null) { + if (speechAdaptationInfo_ != null) { + speechAdaptationInfo_ = + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.newBuilder( + speechAdaptationInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + speechAdaptationInfo_ = value; + } + onChanged(); + } else { + speechAdaptationInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Provides information on speech adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 8; + */ + public Builder clearSpeechAdaptationInfo() { + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfo_ = null; + onChanged(); + } else { + speechAdaptationInfo_ = null; + speechAdaptationInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Provides information on speech adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 8; + */ + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.Builder + getSpeechAdaptationInfoBuilder() { + + onChanged(); + return getSpeechAdaptationInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Provides information on speech adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 8; + */ + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfoOrBuilder + getSpeechAdaptationInfoOrBuilder() { + if (speechAdaptationInfoBuilder_ != null) { + return speechAdaptationInfoBuilder_.getMessageOrBuilder(); + } else { + return speechAdaptationInfo_ == null + ? com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.getDefaultInstance() + : speechAdaptationInfo_; + } + } + /** + * + * + *
+     * Provides information on speech adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo, + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.Builder, + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfoOrBuilder> + getSpeechAdaptationInfoFieldBuilder() { + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo, + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.Builder, + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfoOrBuilder>( + getSpeechAdaptationInfo(), getParentForChildren(), isClean()); + speechAdaptationInfo_ = null; + } + return speechAdaptationInfoBuilder_; + } + + private long requestId_; + /** + * + * + *
+     * The ID associated with the request. This is a unique ID specific only to
+     * the given request.
+     * 
+ * + * int64 request_id = 9; + * + * @return The requestId. + */ + @java.lang.Override + public long getRequestId() { + return requestId_; + } + /** + * + * + *
+     * The ID associated with the request. This is a unique ID specific only to
+     * the given request.
+     * 
+ * + * int64 request_id = 9; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(long value) { + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID associated with the request. This is a unique ID specific only to
+     * the given request.
+     * 
+ * + * int64 request_id = 9; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = 0L; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponseOrBuilder.java b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponseOrBuilder.java index e5af4809698c..62b75e4f97ee 100644 --- a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponseOrBuilder.java +++ b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponseOrBuilder.java @@ -184,4 +184,54 @@ public interface LongRunningRecognizeResponseOrBuilder * .google.rpc.Status output_error = 7; */ com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder(); + + /** + * + * + *
+   * Provides information on speech adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 8; + * + * @return Whether the speechAdaptationInfo field is set. + */ + boolean hasSpeechAdaptationInfo(); + /** + * + * + *
+   * Provides information on speech adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 8; + * + * @return The speechAdaptationInfo. + */ + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo getSpeechAdaptationInfo(); + /** + * + * + *
+   * Provides information on speech adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 8; + */ + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfoOrBuilder + getSpeechAdaptationInfoOrBuilder(); + + /** + * + * + *
+   * The ID associated with the request. This is a unique ID specific only to
+   * the given request.
+   * 
+ * + * int64 request_id = 9; + * + * @return The requestId. + */ + long getRequestId(); } diff --git a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfig.java b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfig.java index eaa082c56feb..94009f71dbd8 100644 --- a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfig.java +++ b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfig.java @@ -526,8 +526,7 @@ public int getSampleRateHertz() { *
    * The number of channels in the input audio data.
    * ONLY set this for MULTI-CHANNEL recognition.
-   * Valid values for LINEAR16 and FLAC are `1`-`8`.
-   * Valid values for OGG_OPUS are '1'-'254'.
+   * Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`.
    * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
    * If `0` or omitted, defaults to one channel (mono).
    * Note: We only recognize the first channel by default.
@@ -1189,7 +1188,7 @@ public com.google.protobuf.BoolValueOrBuilder getEnableSpokenEmojisOrBuilder() {
    * bool enable_speaker_diarization = 16 [deprecated = true];
    *
    * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.enable_speaker_diarization is
-   *     deprecated. See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=378
+   *     deprecated. See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=377
    * @return The enableSpeakerDiarization.
    */
   @java.lang.Override
@@ -1212,7 +1211,7 @@ public boolean getEnableSpeakerDiarization() {
    * int32 diarization_speaker_count = 17 [deprecated = true];
    *
    * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.diarization_speaker_count is
-   *     deprecated. See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=383
+   *     deprecated. See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=382
    * @return The diarizationSpeakerCount.
    */
   @java.lang.Override
@@ -2633,8 +2632,7 @@ public Builder clearSampleRateHertz() {
      * 
      * The number of channels in the input audio data.
      * ONLY set this for MULTI-CHANNEL recognition.
-     * Valid values for LINEAR16 and FLAC are `1`-`8`.
-     * Valid values for OGG_OPUS are '1'-'254'.
+     * Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`.
      * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
      * If `0` or omitted, defaults to one channel (mono).
      * Note: We only recognize the first channel by default.
@@ -2656,8 +2654,7 @@ public int getAudioChannelCount() {
      * 
      * The number of channels in the input audio data.
      * ONLY set this for MULTI-CHANNEL recognition.
-     * Valid values for LINEAR16 and FLAC are `1`-`8`.
-     * Valid values for OGG_OPUS are '1'-'254'.
+     * Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`.
      * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
      * If `0` or omitted, defaults to one channel (mono).
      * Note: We only recognize the first channel by default.
@@ -2682,8 +2679,7 @@ public Builder setAudioChannelCount(int value) {
      * 
      * The number of channels in the input audio data.
      * ONLY set this for MULTI-CHANNEL recognition.
-     * Valid values for LINEAR16 and FLAC are `1`-`8`.
-     * Valid values for OGG_OPUS are '1'-'254'.
+     * Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`.
      * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
      * If `0` or omitted, defaults to one channel (mono).
      * Note: We only recognize the first channel by default.
@@ -4832,7 +4828,7 @@ public com.google.protobuf.BoolValueOrBuilder getEnableSpokenEmojisOrBuilder() {
      * bool enable_speaker_diarization = 16 [deprecated = true];
      *
      * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.enable_speaker_diarization is
-     *     deprecated. See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=378
+     *     deprecated. See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=377
      * @return The enableSpeakerDiarization.
      */
     @java.lang.Override
@@ -4853,7 +4849,7 @@ public boolean getEnableSpeakerDiarization() {
      * bool enable_speaker_diarization = 16 [deprecated = true];
      *
      * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.enable_speaker_diarization is
-     *     deprecated. See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=378
+     *     deprecated. See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=377
      * @param value The enableSpeakerDiarization to set.
      * @return This builder for chaining.
      */
@@ -4877,7 +4873,7 @@ public Builder setEnableSpeakerDiarization(boolean value) {
      * bool enable_speaker_diarization = 16 [deprecated = true];
      *
      * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.enable_speaker_diarization is
-     *     deprecated. See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=378
+     *     deprecated. See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=377
      * @return This builder for chaining.
      */
     @java.lang.Deprecated
@@ -4901,7 +4897,7 @@ public Builder clearEnableSpeakerDiarization() {
      * int32 diarization_speaker_count = 17 [deprecated = true];
      *
      * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.diarization_speaker_count is
-     *     deprecated. See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=383
+     *     deprecated. See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=382
      * @return The diarizationSpeakerCount.
      */
     @java.lang.Override
@@ -4921,7 +4917,7 @@ public int getDiarizationSpeakerCount() {
      * int32 diarization_speaker_count = 17 [deprecated = true];
      *
      * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.diarization_speaker_count is
-     *     deprecated. See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=383
+     *     deprecated. See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=382
      * @param value The diarizationSpeakerCount to set.
      * @return This builder for chaining.
      */
@@ -4944,7 +4940,7 @@ public Builder setDiarizationSpeakerCount(int value) {
      * int32 diarization_speaker_count = 17 [deprecated = true];
      *
      * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.diarization_speaker_count is
-     *     deprecated. See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=383
+     *     deprecated. See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=382
      * @return This builder for chaining.
      */
     @java.lang.Deprecated
diff --git a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfigOrBuilder.java b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfigOrBuilder.java
index f4a4a6f87b27..8511b88f1247 100644
--- a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfigOrBuilder.java
+++ b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfigOrBuilder.java
@@ -77,8 +77,7 @@ public interface RecognitionConfigOrBuilder
    * 
    * The number of channels in the input audio data.
    * ONLY set this for MULTI-CHANNEL recognition.
-   * Valid values for LINEAR16 and FLAC are `1`-`8`.
-   * Valid values for OGG_OPUS are '1'-'254'.
+   * Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`.
    * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
    * If `0` or omitted, defaults to one channel (mono).
    * Note: We only recognize the first channel by default.
@@ -601,7 +600,7 @@ public interface RecognitionConfigOrBuilder
    * bool enable_speaker_diarization = 16 [deprecated = true];
    *
    * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.enable_speaker_diarization is
-   *     deprecated. See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=378
+   *     deprecated. See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=377
    * @return The enableSpeakerDiarization.
    */
   @java.lang.Deprecated
@@ -619,7 +618,7 @@ public interface RecognitionConfigOrBuilder
    * int32 diarization_speaker_count = 17 [deprecated = true];
    *
    * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.diarization_speaker_count is
-   *     deprecated. See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=383
+   *     deprecated. See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=382
    * @return The diarizationSpeakerCount.
    */
   @java.lang.Deprecated
diff --git a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadata.java b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadata.java
index 53c4ae30db82..65c2fed6c6fa 100644
--- a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadata.java
+++ b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadata.java
@@ -1298,7 +1298,7 @@ public com.google.protobuf.ByteString getOriginalMimeTypeBytes() {
    * int64 obfuscated_id = 9 [deprecated = true];
    *
    * @deprecated google.cloud.speech.v1p1beta1.RecognitionMetadata.obfuscated_id is deprecated. See
-   *     google/cloud/speech/v1p1beta1/cloud_speech.proto;l=612
+   *     google/cloud/speech/v1p1beta1/cloud_speech.proto;l=611
    * @return The obfuscatedId.
    */
   @java.lang.Override
@@ -2617,7 +2617,7 @@ public Builder setOriginalMimeTypeBytes(com.google.protobuf.ByteString value) {
      * int64 obfuscated_id = 9 [deprecated = true];
      *
      * @deprecated google.cloud.speech.v1p1beta1.RecognitionMetadata.obfuscated_id is deprecated.
-     *     See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=612
+     *     See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=611
      * @return The obfuscatedId.
      */
     @java.lang.Override
@@ -2636,7 +2636,7 @@ public long getObfuscatedId() {
      * int64 obfuscated_id = 9 [deprecated = true];
      *
      * @deprecated google.cloud.speech.v1p1beta1.RecognitionMetadata.obfuscated_id is deprecated.
-     *     See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=612
+     *     See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=611
      * @param value The obfuscatedId to set.
      * @return This builder for chaining.
      */
@@ -2658,7 +2658,7 @@ public Builder setObfuscatedId(long value) {
      * int64 obfuscated_id = 9 [deprecated = true];
      *
      * @deprecated google.cloud.speech.v1p1beta1.RecognitionMetadata.obfuscated_id is deprecated.
-     *     See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=612
+     *     See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=611
      * @return This builder for chaining.
      */
     @java.lang.Deprecated
diff --git a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadataOrBuilder.java b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadataOrBuilder.java
index cebde2a8f48a..592a1fe85d0e 100644
--- a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadataOrBuilder.java
+++ b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadataOrBuilder.java
@@ -226,7 +226,7 @@ public interface RecognitionMetadataOrBuilder
    * int64 obfuscated_id = 9 [deprecated = true];
    *
    * @deprecated google.cloud.speech.v1p1beta1.RecognitionMetadata.obfuscated_id is deprecated. See
-   *     google/cloud/speech/v1p1beta1/cloud_speech.proto;l=612
+   *     google/cloud/speech/v1p1beta1/cloud_speech.proto;l=611
    * @return The obfuscatedId.
    */
   @java.lang.Deprecated
diff --git a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponse.java b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponse.java
index fd817fa70b95..de55ad71cf15 100644
--- a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponse.java
+++ b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponse.java
@@ -194,6 +194,74 @@ public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() {
     return getTotalBilledTime();
   }
 
+  public static final int SPEECH_ADAPTATION_INFO_FIELD_NUMBER = 7;
+  private com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speechAdaptationInfo_;
+  /**
+   *
+   *
+   * 
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7; + * + * @return Whether the speechAdaptationInfo field is set. + */ + @java.lang.Override + public boolean hasSpeechAdaptationInfo() { + return speechAdaptationInfo_ != null; + } + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7; + * + * @return The speechAdaptationInfo. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo getSpeechAdaptationInfo() { + return speechAdaptationInfo_ == null + ? com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.getDefaultInstance() + : speechAdaptationInfo_; + } + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfoOrBuilder + getSpeechAdaptationInfoOrBuilder() { + return getSpeechAdaptationInfo(); + } + + public static final int REQUEST_ID_FIELD_NUMBER = 8; + private long requestId_; + /** + * + * + *
+   * The ID associated with the request. This is a unique ID specific only to
+   * the given request.
+   * 
+ * + * int64 request_id = 8; + * + * @return The requestId. + */ + @java.lang.Override + public long getRequestId() { + return requestId_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -214,6 +282,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (totalBilledTime_ != null) { output.writeMessage(3, getTotalBilledTime()); } + if (speechAdaptationInfo_ != null) { + output.writeMessage(7, getSpeechAdaptationInfo()); + } + if (requestId_ != 0L) { + output.writeInt64(8, requestId_); + } getUnknownFields().writeTo(output); } @@ -229,6 +303,13 @@ public int getSerializedSize() { if (totalBilledTime_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTotalBilledTime()); } + if (speechAdaptationInfo_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(7, getSpeechAdaptationInfo()); + } + if (requestId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(8, requestId_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -250,6 +331,11 @@ public boolean equals(final java.lang.Object obj) { if (hasTotalBilledTime()) { if (!getTotalBilledTime().equals(other.getTotalBilledTime())) return false; } + if (hasSpeechAdaptationInfo() != other.hasSpeechAdaptationInfo()) return false; + if (hasSpeechAdaptationInfo()) { + if (!getSpeechAdaptationInfo().equals(other.getSpeechAdaptationInfo())) return false; + } + if (getRequestId() != other.getRequestId()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -269,6 +355,12 @@ public int hashCode() { hash = (37 * hash) + TOTAL_BILLED_TIME_FIELD_NUMBER; hash = (53 * hash) + getTotalBilledTime().hashCode(); } + if (hasSpeechAdaptationInfo()) { + hash = (37 * hash) + SPEECH_ADAPTATION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getSpeechAdaptationInfo().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRequestId()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -422,6 +514,14 @@ public Builder clear() { totalBilledTime_ = null; totalBilledTimeBuilder_ = null; } + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfo_ = null; + } else { + speechAdaptationInfo_ = null; + speechAdaptationInfoBuilder_ = null; + } + requestId_ = 0L; + return this; } @@ -464,6 +564,12 @@ public com.google.cloud.speech.v1p1beta1.RecognizeResponse buildPartial() { } else { result.totalBilledTime_ = totalBilledTimeBuilder_.build(); } + if (speechAdaptationInfoBuilder_ == null) { + result.speechAdaptationInfo_ = speechAdaptationInfo_; + } else { + result.speechAdaptationInfo_ = speechAdaptationInfoBuilder_.build(); + } + result.requestId_ = requestId_; onBuilt(); return result; } @@ -544,6 +650,12 @@ public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.RecognizeResponse oth if (other.hasTotalBilledTime()) { mergeTotalBilledTime(other.getTotalBilledTime()); } + if (other.hasSpeechAdaptationInfo()) { + mergeSpeechAdaptationInfo(other.getSpeechAdaptationInfo()); + } + if (other.getRequestId() != 0L) { + setRequestId(other.getRequestId()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -590,6 +702,19 @@ public Builder mergeFrom( break; } // case 26 + case 58: + { + input.readMessage( + getSpeechAdaptationInfoFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 58 + case 64: + { + requestId_ = input.readInt64(); + + break; + } // case 64 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1177,6 +1302,252 @@ public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { return totalBilledTimeBuilder_; } + private com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speechAdaptationInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo, + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.Builder, + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfoOrBuilder> + speechAdaptationInfoBuilder_; + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7; + * + * @return Whether the speechAdaptationInfo field is set. + */ + public boolean hasSpeechAdaptationInfo() { + return speechAdaptationInfoBuilder_ != null || speechAdaptationInfo_ != null; + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7; + * + * @return The speechAdaptationInfo. + */ + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo getSpeechAdaptationInfo() { + if (speechAdaptationInfoBuilder_ == null) { + return speechAdaptationInfo_ == null + ? com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.getDefaultInstance() + : speechAdaptationInfo_; + } else { + return speechAdaptationInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7; + */ + public Builder setSpeechAdaptationInfo( + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo value) { + if (speechAdaptationInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + speechAdaptationInfo_ = value; + onChanged(); + } else { + speechAdaptationInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7; + */ + public Builder setSpeechAdaptationInfo( + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.Builder builderForValue) { + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfo_ = builderForValue.build(); + onChanged(); + } else { + speechAdaptationInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7; + */ + public Builder mergeSpeechAdaptationInfo( + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo value) { + if (speechAdaptationInfoBuilder_ == null) { + if (speechAdaptationInfo_ != null) { + speechAdaptationInfo_ = + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.newBuilder( + speechAdaptationInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + speechAdaptationInfo_ = value; + } + onChanged(); + } else { + speechAdaptationInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7; + */ + public Builder clearSpeechAdaptationInfo() { + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfo_ = null; + onChanged(); + } else { + speechAdaptationInfo_ = null; + speechAdaptationInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7; + */ + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.Builder + getSpeechAdaptationInfoBuilder() { + + onChanged(); + return getSpeechAdaptationInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7; + */ + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfoOrBuilder + getSpeechAdaptationInfoOrBuilder() { + if (speechAdaptationInfoBuilder_ != null) { + return speechAdaptationInfoBuilder_.getMessageOrBuilder(); + } else { + return speechAdaptationInfo_ == null + ? com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.getDefaultInstance() + : speechAdaptationInfo_; + } + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo, + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.Builder, + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfoOrBuilder> + getSpeechAdaptationInfoFieldBuilder() { + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo, + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.Builder, + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfoOrBuilder>( + getSpeechAdaptationInfo(), getParentForChildren(), isClean()); + speechAdaptationInfo_ = null; + } + return speechAdaptationInfoBuilder_; + } + + private long requestId_; + /** + * + * + *
+     * The ID associated with the request. This is a unique ID specific only to
+     * the given request.
+     * 
+ * + * int64 request_id = 8; + * + * @return The requestId. + */ + @java.lang.Override + public long getRequestId() { + return requestId_; + } + /** + * + * + *
+     * The ID associated with the request. This is a unique ID specific only to
+     * the given request.
+     * 
+ * + * int64 request_id = 8; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(long value) { + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID associated with the request. This is a unique ID specific only to
+     * the given request.
+     * 
+ * + * int64 request_id = 8; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = 0L; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponseOrBuilder.java b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponseOrBuilder.java index c03d3c9b7003..e98bffda311b 100644 --- a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponseOrBuilder.java +++ b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponseOrBuilder.java @@ -114,4 +114,54 @@ public interface RecognizeResponseOrBuilder * .google.protobuf.Duration total_billed_time = 3; */ com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder(); + + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7; + * + * @return Whether the speechAdaptationInfo field is set. + */ + boolean hasSpeechAdaptationInfo(); + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7; + * + * @return The speechAdaptationInfo. + */ + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo getSpeechAdaptationInfo(); + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7; + */ + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfoOrBuilder + getSpeechAdaptationInfoOrBuilder(); + + /** + * + * + *
+   * The ID associated with the request. This is a unique ID specific only to
+   * the given request.
+   * 
+ * + * int64 request_id = 8; + * + * @return The requestId. + */ + long getRequestId(); } diff --git a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfig.java b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfig.java index 8b4ea3612a65..d8800715d636 100644 --- a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfig.java +++ b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfig.java @@ -138,7 +138,7 @@ public int getMaxSpeakerCount() { * * * @deprecated google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.speaker_tag is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=480 + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=479 * @return The speakerTag. */ @java.lang.Override @@ -726,7 +726,7 @@ public Builder clearMaxSpeakerCount() { * * * @deprecated google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.speaker_tag is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=480 + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=479 * @return The speakerTag. */ @java.lang.Override @@ -745,7 +745,7 @@ public int getSpeakerTag() { * * * @deprecated google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.speaker_tag is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=480 + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=479 * @param value The speakerTag to set. * @return This builder for chaining. */ @@ -767,7 +767,7 @@ public Builder setSpeakerTag(int value) { * * * @deprecated google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.speaker_tag is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=480 + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=479 * @return This builder for chaining. */ @java.lang.Deprecated diff --git a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfigOrBuilder.java b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfigOrBuilder.java index 00c1be0d03dd..37f7409eca89 100644 --- a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfigOrBuilder.java +++ b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfigOrBuilder.java @@ -79,7 +79,7 @@ public interface SpeakerDiarizationConfigOrBuilder * * * @deprecated google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.speaker_tag is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=480 + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=479 * @return The speakerTag. */ @java.lang.Deprecated diff --git a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationInfo.java b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationInfo.java new file mode 100644 index 000000000000..41dd009b843a --- /dev/null +++ b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationInfo.java @@ -0,0 +1,718 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + * + * + *
+ * Information on speech adaptation use in results
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechAdaptationInfo} + */ +public final class SpeechAdaptationInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.SpeechAdaptationInfo) + SpeechAdaptationInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use SpeechAdaptationInfo.newBuilder() to construct. + private SpeechAdaptationInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SpeechAdaptationInfo() { + timeoutMessage_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SpeechAdaptationInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto + .internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto + .internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.class, + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.Builder.class); + } + + public static final int ADAPTATION_TIMEOUT_FIELD_NUMBER = 1; + private boolean adaptationTimeout_; + /** + * + * + *
+   * Whether there was a timeout when applying speech adaptation. If true,
+   * adaptation had no effect in the response transcript.
+   * 
+ * + * bool adaptation_timeout = 1; + * + * @return The adaptationTimeout. + */ + @java.lang.Override + public boolean getAdaptationTimeout() { + return adaptationTimeout_; + } + + public static final int TIMEOUT_MESSAGE_FIELD_NUMBER = 4; + private volatile java.lang.Object timeoutMessage_; + /** + * + * + *
+   * If set, returns a message specifying which part of the speech adaptation
+   * request timed out.
+   * 
+ * + * string timeout_message = 4; + * + * @return The timeoutMessage. + */ + @java.lang.Override + public java.lang.String getTimeoutMessage() { + java.lang.Object ref = timeoutMessage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeoutMessage_ = s; + return s; + } + } + /** + * + * + *
+   * If set, returns a message specifying which part of the speech adaptation
+   * request timed out.
+   * 
+ * + * string timeout_message = 4; + * + * @return The bytes for timeoutMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTimeoutMessageBytes() { + java.lang.Object ref = timeoutMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeoutMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (adaptationTimeout_ != false) { + output.writeBool(1, adaptationTimeout_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(timeoutMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, timeoutMessage_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (adaptationTimeout_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, adaptationTimeout_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(timeoutMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, timeoutMessage_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo other = + (com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo) obj; + + if (getAdaptationTimeout() != other.getAdaptationTimeout()) return false; + if (!getTimeoutMessage().equals(other.getTimeoutMessage())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ADAPTATION_TIMEOUT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAdaptationTimeout()); + hash = (37 * hash) + TIMEOUT_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getTimeoutMessage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Information on speech adaptation use in results
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechAdaptationInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.SpeechAdaptationInfo) + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto + .internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto + .internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.class, + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + adaptationTimeout_ = false; + + timeoutMessage_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechProto + .internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptationInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo build() { + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo buildPartial() { + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo result = + new com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo(this); + result.adaptationTimeout_ = adaptationTimeout_; + result.timeoutMessage_ = timeoutMessage_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo other) { + if (other == com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.getDefaultInstance()) + return this; + if (other.getAdaptationTimeout() != false) { + setAdaptationTimeout(other.getAdaptationTimeout()); + } + if (!other.getTimeoutMessage().isEmpty()) { + timeoutMessage_ = other.timeoutMessage_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + adaptationTimeout_ = input.readBool(); + + break; + } // case 8 + case 34: + { + timeoutMessage_ = input.readStringRequireUtf8(); + + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private boolean adaptationTimeout_; + /** + * + * + *
+     * Whether there was a timeout when applying speech adaptation. If true,
+     * adaptation had no effect in the response transcript.
+     * 
+ * + * bool adaptation_timeout = 1; + * + * @return The adaptationTimeout. + */ + @java.lang.Override + public boolean getAdaptationTimeout() { + return adaptationTimeout_; + } + /** + * + * + *
+     * Whether there was a timeout when applying speech adaptation. If true,
+     * adaptation had no effect in the response transcript.
+     * 
+ * + * bool adaptation_timeout = 1; + * + * @param value The adaptationTimeout to set. + * @return This builder for chaining. + */ + public Builder setAdaptationTimeout(boolean value) { + + adaptationTimeout_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether there was a timeout when applying speech adaptation. If true,
+     * adaptation had no effect in the response transcript.
+     * 
+ * + * bool adaptation_timeout = 1; + * + * @return This builder for chaining. + */ + public Builder clearAdaptationTimeout() { + + adaptationTimeout_ = false; + onChanged(); + return this; + } + + private java.lang.Object timeoutMessage_ = ""; + /** + * + * + *
+     * If set, returns a message specifying which part of the speech adaptation
+     * request timed out.
+     * 
+ * + * string timeout_message = 4; + * + * @return The timeoutMessage. + */ + public java.lang.String getTimeoutMessage() { + java.lang.Object ref = timeoutMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeoutMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If set, returns a message specifying which part of the speech adaptation
+     * request timed out.
+     * 
+ * + * string timeout_message = 4; + * + * @return The bytes for timeoutMessage. + */ + public com.google.protobuf.ByteString getTimeoutMessageBytes() { + java.lang.Object ref = timeoutMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeoutMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If set, returns a message specifying which part of the speech adaptation
+     * request timed out.
+     * 
+ * + * string timeout_message = 4; + * + * @param value The timeoutMessage to set. + * @return This builder for chaining. + */ + public Builder setTimeoutMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + timeoutMessage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, returns a message specifying which part of the speech adaptation
+     * request timed out.
+     * 
+ * + * string timeout_message = 4; + * + * @return This builder for chaining. + */ + public Builder clearTimeoutMessage() { + + timeoutMessage_ = getDefaultInstance().getTimeoutMessage(); + onChanged(); + return this; + } + /** + * + * + *
+     * If set, returns a message specifying which part of the speech adaptation
+     * request timed out.
+     * 
+ * + * string timeout_message = 4; + * + * @param value The bytes for timeoutMessage to set. + * @return This builder for chaining. + */ + public Builder setTimeoutMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + timeoutMessage_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.SpeechAdaptationInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.SpeechAdaptationInfo) + private static final com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo(); + } + + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SpeechAdaptationInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationInfoOrBuilder.java b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationInfoOrBuilder.java new file mode 100644 index 000000000000..bd5508cea1c6 --- /dev/null +++ b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationInfoOrBuilder.java @@ -0,0 +1,66 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface SpeechAdaptationInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.SpeechAdaptationInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether there was a timeout when applying speech adaptation. If true,
+   * adaptation had no effect in the response transcript.
+   * 
+ * + * bool adaptation_timeout = 1; + * + * @return The adaptationTimeout. + */ + boolean getAdaptationTimeout(); + + /** + * + * + *
+   * If set, returns a message specifying which part of the speech adaptation
+   * request timed out.
+   * 
+ * + * string timeout_message = 4; + * + * @return The timeoutMessage. + */ + java.lang.String getTimeoutMessage(); + /** + * + * + *
+   * If set, returns a message specifying which part of the speech adaptation
+   * request timed out.
+   * 
+ * + * string timeout_message = 4; + * + * @return The bytes for timeoutMessage. + */ + com.google.protobuf.ByteString getTimeoutMessageBytes(); +} diff --git a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java index 2d6aa673c20c..c0e43bb88557 100644 --- a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java +++ b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java @@ -99,6 +99,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_speech_v1p1beta1_WordInfo_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_speech_v1p1beta1_WordInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptationInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptationInfo_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -202,72 +206,82 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "CE\020\006:\002\030\001\"/\n\rSpeechContext\022\017\n\007phrases\030\001 \003" + "(\t\022\r\n\005boost\030\004 \001(\002\"D\n\020RecognitionAudio\022\021\n" + "\007content\030\001 \001(\014H\000\022\r\n\003uri\030\002 \001(\tH\000B\016\n\014audio" - + "_source\"\222\001\n\021RecognizeResponse\022G\n\007results" - + "\030\002 \003(\01326.google.cloud.speech.v1p1beta1.S" - + "peechRecognitionResult\0224\n\021total_billed_t" - + "ime\030\003 \001(\0132\031.google.protobuf.Duration\"\225\002\n" - + "\034LongRunningRecognizeResponse\022G\n\007results" + + "_source\"\373\001\n\021RecognizeResponse\022G\n\007results" + "\030\002 \003(\01326.google.cloud.speech.v1p1beta1.S" + "peechRecognitionResult\0224\n\021total_billed_t" - + "ime\030\003 \001(\0132\031.google.protobuf.Duration\022L\n\r" - + "output_config\030\006 \001(\01325.google.cloud.speec" - + "h.v1p1beta1.TranscriptOutputConfig\022(\n\014ou" - + "tput_error\030\007 \001(\0132\022.google.rpc.Status\"\203\002\n" - + "\034LongRunningRecognizeMetadata\022\030\n\020progres" - + "s_percent\030\001 \001(\005\022.\n\nstart_time\030\002 \001(\0132\032.go" - + "ogle.protobuf.Timestamp\0224\n\020last_update_t" - + "ime\030\003 \001(\0132\032.google.protobuf.Timestamp\022\020\n" - + "\003uri\030\004 \001(\tB\003\340A\003\022Q\n\routput_config\030\005 \001(\01325" - + ".google.cloud.speech.v1p1beta1.Transcrip" - + "tOutputConfigB\003\340A\003\"\365\002\n\032StreamingRecogniz" - + "eResponse\022!\n\005error\030\001 \001(\0132\022.google.rpc.St" - + "atus\022J\n\007results\030\002 \003(\01329.google.cloud.spe" - + "ech.v1p1beta1.StreamingRecognitionResult" - + "\022d\n\021speech_event_type\030\004 \001(\0162I.google.clo" - + "ud.speech.v1p1beta1.StreamingRecognizeRe" - + "sponse.SpeechEventType\0224\n\021total_billed_t" - + "ime\030\005 \001(\0132\031.google.protobuf.Duration\"L\n\017" - + "SpeechEventType\022\034\n\030SPEECH_EVENT_UNSPECIF" - + "IED\020\000\022\033\n\027END_OF_SINGLE_UTTERANCE\020\001\"\371\001\n\032S" - + "treamingRecognitionResult\022Q\n\014alternative" - + "s\030\001 \003(\0132;.google.cloud.speech.v1p1beta1." - + "SpeechRecognitionAlternative\022\020\n\010is_final" - + "\030\002 \001(\010\022\021\n\tstability\030\003 \001(\002\0222\n\017result_end_" - + "time\030\004 \001(\0132\031.google.protobuf.Duration\022\023\n" - + "\013channel_tag\030\005 \001(\005\022\032\n\rlanguage_code\030\006 \001(" - + "\tB\003\340A\003\"\321\001\n\027SpeechRecognitionResult\022Q\n\014al" - + "ternatives\030\001 \003(\0132;.google.cloud.speech.v" - + "1p1beta1.SpeechRecognitionAlternative\022\023\n" - + "\013channel_tag\030\002 \001(\005\0222\n\017result_end_time\030\004 " - + "\001(\0132\031.google.protobuf.Duration\022\032\n\rlangua" - + "ge_code\030\005 \001(\tB\003\340A\003\"~\n\034SpeechRecognitionA" - + "lternative\022\022\n\ntranscript\030\001 \001(\t\022\022\n\nconfid" - + "ence\030\002 \001(\002\0226\n\005words\030\003 \003(\0132\'.google.cloud" - + ".speech.v1p1beta1.WordInfo\"\242\001\n\010WordInfo\022" - + "-\n\nstart_time\030\001 \001(\0132\031.google.protobuf.Du" - + "ration\022+\n\010end_time\030\002 \001(\0132\031.google.protob" - + "uf.Duration\022\014\n\004word\030\003 \001(\t\022\022\n\nconfidence\030" - + "\004 \001(\002\022\030\n\013speaker_tag\030\005 \001(\005B\003\340A\0032\202\005\n\006Spee" - + "ch\022\245\001\n\tRecognize\022/.google.cloud.speech.v" - + "1p1beta1.RecognizeRequest\0320.google.cloud" - + ".speech.v1p1beta1.RecognizeResponse\"5\202\323\344" - + "\223\002 \"\033/v1p1beta1/speech:recognize:\001*\332A\014co" - + "nfig,audio\022\362\001\n\024LongRunningRecognize\022:.go" - + "ogle.cloud.speech.v1p1beta1.LongRunningR" - + "ecognizeRequest\032\035.google.longrunning.Ope" - + "ration\"\177\202\323\344\223\002+\"&/v1p1beta1/speech:longru" - + "nningrecognize:\001*\332A\014config,audio\312A<\n\034Lon" - + "gRunningRecognizeResponse\022\034LongRunningRe" - + "cognizeMetadata\022\217\001\n\022StreamingRecognize\0228" - + ".google.cloud.speech.v1p1beta1.Streaming" - + "RecognizeRequest\0329.google.cloud.speech.v" - + "1p1beta1.StreamingRecognizeResponse\"\000(\0010" - + "\001\032I\312A\025speech.googleapis.com\322A.https://ww" - + "w.googleapis.com/auth/cloud-platformB\200\001\n" - + "!com.google.cloud.speech.v1p1beta1B\013Spee" - + "chProtoP\001ZCgoogle.golang.org/genproto/go" - + "ogleapis/cloud/speech/v1p1beta1;speech\370\001" - + "\001\242\002\003GCSb\006proto3" + + "ime\030\003 \001(\0132\031.google.protobuf.Duration\022S\n\026" + + "speech_adaptation_info\030\007 \001(\01323.google.cl" + + "oud.speech.v1p1beta1.SpeechAdaptationInf" + + "o\022\022\n\nrequest_id\030\010 \001(\003\"\376\002\n\034LongRunningRec" + + "ognizeResponse\022G\n\007results\030\002 \003(\01326.google" + + ".cloud.speech.v1p1beta1.SpeechRecognitio" + + "nResult\0224\n\021total_billed_time\030\003 \001(\0132\031.goo" + + "gle.protobuf.Duration\022L\n\routput_config\030\006" + + " \001(\01325.google.cloud.speech.v1p1beta1.Tra" + + "nscriptOutputConfig\022(\n\014output_error\030\007 \001(" + + "\0132\022.google.rpc.Status\022S\n\026speech_adaptati" + + "on_info\030\010 \001(\01323.google.cloud.speech.v1p1" + + "beta1.SpeechAdaptationInfo\022\022\n\nrequest_id" + + "\030\t \001(\003\"\203\002\n\034LongRunningRecognizeMetadata\022" + + "\030\n\020progress_percent\030\001 \001(\005\022.\n\nstart_time\030" + + "\002 \001(\0132\032.google.protobuf.Timestamp\0224\n\020las" + + "t_update_time\030\003 \001(\0132\032.google.protobuf.Ti" + + "mestamp\022\020\n\003uri\030\004 \001(\tB\003\340A\003\022Q\n\routput_conf" + + "ig\030\005 \001(\01325.google.cloud.speech.v1p1beta1" + + ".TranscriptOutputConfigB\003\340A\003\"\336\003\n\032Streami" + + "ngRecognizeResponse\022!\n\005error\030\001 \001(\0132\022.goo" + + "gle.rpc.Status\022J\n\007results\030\002 \003(\01329.google" + + ".cloud.speech.v1p1beta1.StreamingRecogni" + + "tionResult\022d\n\021speech_event_type\030\004 \001(\0162I." + + "google.cloud.speech.v1p1beta1.StreamingR" + + "ecognizeResponse.SpeechEventType\0224\n\021tota" + + "l_billed_time\030\005 \001(\0132\031.google.protobuf.Du" + + "ration\022S\n\026speech_adaptation_info\030\t \001(\01323" + + ".google.cloud.speech.v1p1beta1.SpeechAda" + + "ptationInfo\022\022\n\nrequest_id\030\n \001(\003\"L\n\017Speec" + + "hEventType\022\034\n\030SPEECH_EVENT_UNSPECIFIED\020\000" + + "\022\033\n\027END_OF_SINGLE_UTTERANCE\020\001\"\371\001\n\032Stream" + + "ingRecognitionResult\022Q\n\014alternatives\030\001 \003" + + "(\0132;.google.cloud.speech.v1p1beta1.Speec" + + "hRecognitionAlternative\022\020\n\010is_final\030\002 \001(" + + "\010\022\021\n\tstability\030\003 \001(\002\0222\n\017result_end_time\030" + + "\004 \001(\0132\031.google.protobuf.Duration\022\023\n\013chan" + + "nel_tag\030\005 \001(\005\022\032\n\rlanguage_code\030\006 \001(\tB\003\340A" + + "\003\"\321\001\n\027SpeechRecognitionResult\022Q\n\014alterna" + + "tives\030\001 \003(\0132;.google.cloud.speech.v1p1be" + + "ta1.SpeechRecognitionAlternative\022\023\n\013chan" + + "nel_tag\030\002 \001(\005\0222\n\017result_end_time\030\004 \001(\0132\031" + + ".google.protobuf.Duration\022\032\n\rlanguage_co" + + "de\030\005 \001(\tB\003\340A\003\"~\n\034SpeechRecognitionAltern" + + "ative\022\022\n\ntranscript\030\001 \001(\t\022\022\n\nconfidence\030" + + "\002 \001(\002\0226\n\005words\030\003 \003(\0132\'.google.cloud.spee" + + "ch.v1p1beta1.WordInfo\"\242\001\n\010WordInfo\022-\n\nst" + + "art_time\030\001 \001(\0132\031.google.protobuf.Duratio" + + "n\022+\n\010end_time\030\002 \001(\0132\031.google.protobuf.Du" + + "ration\022\014\n\004word\030\003 \001(\t\022\022\n\nconfidence\030\004 \001(\002" + + "\022\030\n\013speaker_tag\030\005 \001(\005B\003\340A\003\"K\n\024SpeechAdap" + + "tationInfo\022\032\n\022adaptation_timeout\030\001 \001(\010\022\027" + + "\n\017timeout_message\030\004 \001(\t2\202\005\n\006Speech\022\245\001\n\tR" + + "ecognize\022/.google.cloud.speech.v1p1beta1" + + ".RecognizeRequest\0320.google.cloud.speech." + + "v1p1beta1.RecognizeResponse\"5\202\323\344\223\002 \"\033/v1" + + "p1beta1/speech:recognize:\001*\332A\014config,aud" + + "io\022\362\001\n\024LongRunningRecognize\022:.google.clo" + + "ud.speech.v1p1beta1.LongRunningRecognize" + + "Request\032\035.google.longrunning.Operation\"\177" + + "\202\323\344\223\002+\"&/v1p1beta1/speech:longrunningrec" + + "ognize:\001*\332A\014config,audio\312A<\n\034LongRunning" + + "RecognizeResponse\022\034LongRunningRecognizeM" + + "etadata\022\217\001\n\022StreamingRecognize\0228.google." + + "cloud.speech.v1p1beta1.StreamingRecogniz" + + "eRequest\0329.google.cloud.speech.v1p1beta1" + + ".StreamingRecognizeResponse\"\000(\0010\001\032I\312A\025sp" + + "eech.googleapis.com\322A.https://www.google" + + "apis.com/auth/cloud-platformB\200\001\n!com.goo" + + "gle.cloud.speech.v1p1beta1B\013SpeechProtoP" + + "\001ZCgoogle.golang.org/genproto/googleapis" + + "/cloud/speech/v1p1beta1;speech\370\001\001\242\002\003GCSb" + + "\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -398,7 +412,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_descriptor, new java.lang.String[] { - "Results", "TotalBilledTime", + "Results", "TotalBilledTime", "SpeechAdaptationInfo", "RequestId", }); internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_descriptor = getDescriptor().getMessageTypes().get(11); @@ -406,7 +420,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_descriptor, new java.lang.String[] { - "Results", "TotalBilledTime", "OutputConfig", "OutputError", + "Results", + "TotalBilledTime", + "OutputConfig", + "OutputError", + "SpeechAdaptationInfo", + "RequestId", }); internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_descriptor = getDescriptor().getMessageTypes().get(12); @@ -422,7 +441,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_descriptor, new java.lang.String[] { - "Error", "Results", "SpeechEventType", "TotalBilledTime", + "Error", + "Results", + "SpeechEventType", + "TotalBilledTime", + "SpeechAdaptationInfo", + "RequestId", }); internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_descriptor = getDescriptor().getMessageTypes().get(14); @@ -456,6 +480,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "StartTime", "EndTime", "Word", "Confidence", "SpeakerTag", }); + internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptationInfo_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptationInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptationInfo_descriptor, + new java.lang.String[] { + "AdaptationTimeout", "TimeoutMessage", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); diff --git a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponse.java b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponse.java index 2d354eea1f12..75bbd59ce1b1 100644 --- a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponse.java +++ b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponse.java @@ -485,6 +485,74 @@ public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { return getTotalBilledTime(); } + public static final int SPEECH_ADAPTATION_INFO_FIELD_NUMBER = 9; + private com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speechAdaptationInfo_; + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 9; + * + * @return Whether the speechAdaptationInfo field is set. + */ + @java.lang.Override + public boolean hasSpeechAdaptationInfo() { + return speechAdaptationInfo_ != null; + } + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 9; + * + * @return The speechAdaptationInfo. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo getSpeechAdaptationInfo() { + return speechAdaptationInfo_ == null + ? com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.getDefaultInstance() + : speechAdaptationInfo_; + } + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 9; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfoOrBuilder + getSpeechAdaptationInfoOrBuilder() { + return getSpeechAdaptationInfo(); + } + + public static final int REQUEST_ID_FIELD_NUMBER = 10; + private long requestId_; + /** + * + * + *
+   * The ID associated with the request. This is a unique ID specific only to
+   * the given request.
+   * 
+ * + * int64 request_id = 10; + * + * @return The requestId. + */ + @java.lang.Override + public long getRequestId() { + return requestId_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -514,6 +582,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (totalBilledTime_ != null) { output.writeMessage(5, getTotalBilledTime()); } + if (speechAdaptationInfo_ != null) { + output.writeMessage(9, getSpeechAdaptationInfo()); + } + if (requestId_ != 0L) { + output.writeInt64(10, requestId_); + } getUnknownFields().writeTo(output); } @@ -538,6 +612,13 @@ public int getSerializedSize() { if (totalBilledTime_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getTotalBilledTime()); } + if (speechAdaptationInfo_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(9, getSpeechAdaptationInfo()); + } + if (requestId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(10, requestId_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -564,6 +645,11 @@ public boolean equals(final java.lang.Object obj) { if (hasTotalBilledTime()) { if (!getTotalBilledTime().equals(other.getTotalBilledTime())) return false; } + if (hasSpeechAdaptationInfo() != other.hasSpeechAdaptationInfo()) return false; + if (hasSpeechAdaptationInfo()) { + if (!getSpeechAdaptationInfo().equals(other.getSpeechAdaptationInfo())) return false; + } + if (getRequestId() != other.getRequestId()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -589,6 +675,12 @@ public int hashCode() { hash = (37 * hash) + TOTAL_BILLED_TIME_FIELD_NUMBER; hash = (53 * hash) + getTotalBilledTime().hashCode(); } + if (hasSpeechAdaptationInfo()) { + hash = (37 * hash) + SPEECH_ADAPTATION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getSpeechAdaptationInfo().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRequestId()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -784,6 +876,14 @@ public Builder clear() { totalBilledTime_ = null; totalBilledTimeBuilder_ = null; } + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfo_ = null; + } else { + speechAdaptationInfo_ = null; + speechAdaptationInfoBuilder_ = null; + } + requestId_ = 0L; + return this; } @@ -833,6 +933,12 @@ public com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse buildPartial } else { result.totalBilledTime_ = totalBilledTimeBuilder_.build(); } + if (speechAdaptationInfoBuilder_ == null) { + result.speechAdaptationInfo_ = speechAdaptationInfo_; + } else { + result.speechAdaptationInfo_ = speechAdaptationInfoBuilder_.build(); + } + result.requestId_ = requestId_; onBuilt(); return result; } @@ -920,6 +1026,12 @@ public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.StreamingRecognizeRes if (other.hasTotalBilledTime()) { mergeTotalBilledTime(other.getTotalBilledTime()); } + if (other.hasSpeechAdaptationInfo()) { + mergeSpeechAdaptationInfo(other.getSpeechAdaptationInfo()); + } + if (other.getRequestId() != 0L) { + setRequestId(other.getRequestId()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -978,6 +1090,19 @@ public Builder mergeFrom( break; } // case 42 + case 74: + { + input.readMessage( + getSpeechAdaptationInfoFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 74 + case 80: + { + requestId_ = input.readInt64(); + + break; + } // case 80 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1900,6 +2025,252 @@ public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { return totalBilledTimeBuilder_; } + private com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speechAdaptationInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo, + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.Builder, + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfoOrBuilder> + speechAdaptationInfoBuilder_; + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 9; + * + * @return Whether the speechAdaptationInfo field is set. + */ + public boolean hasSpeechAdaptationInfo() { + return speechAdaptationInfoBuilder_ != null || speechAdaptationInfo_ != null; + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 9; + * + * @return The speechAdaptationInfo. + */ + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo getSpeechAdaptationInfo() { + if (speechAdaptationInfoBuilder_ == null) { + return speechAdaptationInfo_ == null + ? com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.getDefaultInstance() + : speechAdaptationInfo_; + } else { + return speechAdaptationInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 9; + */ + public Builder setSpeechAdaptationInfo( + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo value) { + if (speechAdaptationInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + speechAdaptationInfo_ = value; + onChanged(); + } else { + speechAdaptationInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 9; + */ + public Builder setSpeechAdaptationInfo( + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.Builder builderForValue) { + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfo_ = builderForValue.build(); + onChanged(); + } else { + speechAdaptationInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 9; + */ + public Builder mergeSpeechAdaptationInfo( + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo value) { + if (speechAdaptationInfoBuilder_ == null) { + if (speechAdaptationInfo_ != null) { + speechAdaptationInfo_ = + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.newBuilder( + speechAdaptationInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + speechAdaptationInfo_ = value; + } + onChanged(); + } else { + speechAdaptationInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 9; + */ + public Builder clearSpeechAdaptationInfo() { + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfo_ = null; + onChanged(); + } else { + speechAdaptationInfo_ = null; + speechAdaptationInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 9; + */ + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.Builder + getSpeechAdaptationInfoBuilder() { + + onChanged(); + return getSpeechAdaptationInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 9; + */ + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfoOrBuilder + getSpeechAdaptationInfoOrBuilder() { + if (speechAdaptationInfoBuilder_ != null) { + return speechAdaptationInfoBuilder_.getMessageOrBuilder(); + } else { + return speechAdaptationInfo_ == null + ? com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.getDefaultInstance() + : speechAdaptationInfo_; + } + } + /** + * + * + *
+     * Provides information on adaptation behavior in response
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo, + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.Builder, + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfoOrBuilder> + getSpeechAdaptationInfoFieldBuilder() { + if (speechAdaptationInfoBuilder_ == null) { + speechAdaptationInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo, + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo.Builder, + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfoOrBuilder>( + getSpeechAdaptationInfo(), getParentForChildren(), isClean()); + speechAdaptationInfo_ = null; + } + return speechAdaptationInfoBuilder_; + } + + private long requestId_; + /** + * + * + *
+     * The ID associated with the request. This is a unique ID specific only to
+     * the given request.
+     * 
+ * + * int64 request_id = 10; + * + * @return The requestId. + */ + @java.lang.Override + public long getRequestId() { + return requestId_; + } + /** + * + * + *
+     * The ID associated with the request. This is a unique ID specific only to
+     * the given request.
+     * 
+ * + * int64 request_id = 10; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(long value) { + + requestId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID associated with the request. This is a unique ID specific only to
+     * the given request.
+     * 
+ * + * int64 request_id = 10; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = 0L; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponseOrBuilder.java b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponseOrBuilder.java index d58bc6551f68..5997fc2d431a 100644 --- a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponseOrBuilder.java +++ b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponseOrBuilder.java @@ -195,4 +195,54 @@ com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder getResults * .google.protobuf.Duration total_billed_time = 5; */ com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder(); + + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 9; + * + * @return Whether the speechAdaptationInfo field is set. + */ + boolean hasSpeechAdaptationInfo(); + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 9; + * + * @return The speechAdaptationInfo. + */ + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo getSpeechAdaptationInfo(); + /** + * + * + *
+   * Provides information on adaptation behavior in response
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 9; + */ + com.google.cloud.speech.v1p1beta1.SpeechAdaptationInfoOrBuilder + getSpeechAdaptationInfoOrBuilder(); + + /** + * + * + *
+   * The ID associated with the request. This is a unique ID specific only to
+   * the given request.
+   * 
+ * + * int64 request_id = 10; + * + * @return The requestId. + */ + long getRequestId(); } diff --git a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto index 9bf36fccf208..d1396692b608 100644 --- a/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto +++ b/java-speech/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto @@ -266,8 +266,7 @@ message RecognitionConfig { // The number of channels in the input audio data. // ONLY set this for MULTI-CHANNEL recognition. - // Valid values for LINEAR16 and FLAC are `1`-`8`. - // Valid values for OGG_OPUS are '1'-'254'. + // Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`. // Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`. // If `0` or omitted, defaults to one channel (mono). // Note: We only recognize the first channel by default. @@ -679,6 +678,13 @@ message RecognizeResponse { // When available, billed audio seconds for the corresponding request. google.protobuf.Duration total_billed_time = 3; + + // Provides information on adaptation behavior in response + SpeechAdaptationInfo speech_adaptation_info = 7; + + // The ID associated with the request. This is a unique ID specific only to + // the given request. + int64 request_id = 8; } // The only message returned to the client by the `LongRunningRecognize` method. @@ -699,6 +705,13 @@ message LongRunningRecognizeResponse { // If the transcript output fails this field contains the relevant error. google.rpc.Status output_error = 7; + + // Provides information on speech adaptation behavior in response + SpeechAdaptationInfo speech_adaptation_info = 8; + + // The ID associated with the request. This is a unique ID specific only to + // the given request. + int64 request_id = 9; } // Describes the progress of a long-running `LongRunningRecognize` call. It is @@ -804,6 +817,13 @@ message StreamingRecognizeResponse { // When available, billed audio seconds for the stream. // Set only if this is the last response in the stream. google.protobuf.Duration total_billed_time = 5; + + // Provides information on adaptation behavior in response + SpeechAdaptationInfo speech_adaptation_info = 9; + + // The ID associated with the request. This is a unique ID specific only to + // the given request. + int64 request_id = 10; } // A streaming speech recognition result corresponding to a portion of the audio @@ -927,3 +947,14 @@ message WordInfo { // top alternative. int32 speaker_tag = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; } + +// Information on speech adaptation use in results +message SpeechAdaptationInfo { + // Whether there was a timeout when applying speech adaptation. If true, + // adaptation had no effect in the response transcript. + bool adaptation_timeout = 1; + + // If set, returns a message specifying which part of the speech adaptation + // request timed out. + string timeout_message = 4; +}