diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 6137bef2a..000000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,8 +0,0 @@ -# Code owners file. -# This file controls who is tagged for review for any given pull request. - -# For syntax help see: -# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax - -# The java-samples-reviewers team is the default owner for samples changes -samples/**/*.java @googleapis/java-samples-reviewers diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 10f45bb4c..000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve - ---- - -Thanks for stopping by to let us know something could be better! - -**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. - -Please run down the following list and make sure you've tried the usual "quick fixes": - - - Search the issues already opened: https://github.com/googleapis/java-speech/issues - - Check for answers on StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform - -If you are still having issues, please include as much information as possible: - -#### Environment details - -1. Specify the API at the beginning of the title. For example, "BigQuery: ..."). - General, Core, and Other are also allowed as types -2. OS type and version: -3. Java version: -4. speech version(s): - -#### Steps to reproduce - - 1. ? - 2. ? - -#### Code example - -```java -// example -``` - -#### Stack trace -``` -Any relevant stacktrace here. -``` - -#### External references such as API reference guides - -- ? - -#### Any additional information below - - -Following these steps guarantees the quickest resolution possible. - -Thanks! diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 754e30c68..000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this library - ---- - -Thanks for stopping by to let us know something could be better! - -**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. - -**Is your feature request related to a problem? Please describe.** -What the problem is. Example: I'm always frustrated when [...] - -**Describe the solution you'd like** -What you want to happen. - -**Describe alternatives you've considered** -Any alternative solutions or features you've considered. - -**Additional context** -Any other context or screenshots about the feature request. diff --git a/.github/ISSUE_TEMPLATE/support_request.md b/.github/ISSUE_TEMPLATE/support_request.md deleted file mode 100644 index 995869032..000000000 --- a/.github/ISSUE_TEMPLATE/support_request.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -name: Support request -about: If you have a support contract with Google, please create an issue in the Google Cloud Support console. - ---- - -**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 120aa6d38..000000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ -Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: -- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-speech/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea -- [ ] Ensure the tests and linter pass -- [ ] Code coverage does not decrease (if any source code was changed) -- [ ] Appropriate docs were updated (if necessary) - -Fixes # ☕️ diff --git a/.github/release-please.yml b/.github/release-please.yml index dce2c8450..7bf580765 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1,2 +1,8 @@ +bumpMinorPreMajor: true +handleGHRelease: true releaseType: java-yoshi -bumpMinorPreMajor: true \ No newline at end of file +branches: + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-yoshi + branch: java7 diff --git a/.github/release-trigger.yml b/.github/release-trigger.yml new file mode 100644 index 000000000..d9e80dfbf --- /dev/null +++ b/.github/release-trigger.yml @@ -0,0 +1,2 @@ +enabled: true +multiScmName: java-speech diff --git a/.github/trusted-contribution.yml b/.github/trusted-contribution.yml deleted file mode 100644 index f247d5c78..000000000 --- a/.github/trusted-contribution.yml +++ /dev/null @@ -1,2 +0,0 @@ -trustedContributors: -- renovate-bot \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index 683022075..000000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,79 +0,0 @@ -on: - push: - branches: - - master - pull_request: -name: ci -jobs: - units: - runs-on: ubuntu-latest - strategy: - matrix: - java: [7, 8, 11] - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 - with: - java-version: ${{matrix.java}} - - run: java -version - - run: .kokoro/build.sh - env: - JOB_TYPE: test - - name: coverage - uses: codecov/codecov-action@v1 - with: - name: actions ${{matrix.java}} - windows: - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 - with: - java-version: 8 - - run: java -version - - run: .kokoro/build.bat - env: - JOB_TYPE: test - dependencies: - runs-on: ubuntu-latest - strategy: - matrix: - java: [8, 11] - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 - with: - java-version: ${{matrix.java}} - - run: java -version - - run: .kokoro/dependencies.sh - linkage-monitor: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 - with: - java-version: 8 - - run: java -version - - run: .kokoro/linkage-monitor.sh - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 - with: - java-version: 8 - - run: java -version - - run: .kokoro/build.sh - env: - JOB_TYPE: lint - clirr: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 - with: - java-version: 8 - - run: java -version - - run: .kokoro/build.sh - env: - JOB_TYPE: clirr \ No newline at end of file diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml deleted file mode 100644 index a1d500730..000000000 --- a/.github/workflows/samples.yaml +++ /dev/null @@ -1,14 +0,0 @@ -on: - pull_request: -name: samples -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 - with: - java-version: 8 - - name: Run checkstyle - run: mvn -P lint --quiet --batch-mode checkstyle:check - working-directory: samples/snippets diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 069d08fc7..000000000 --- a/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -# Maven -target/ - -# Eclipse -.classpath -.project -.settings - -# Intellij -*.iml -.idea/ - -# python utilities -*.pyc -__pycache__ - -.flattened-pom.xml diff --git a/.kokoro/build.bat b/.kokoro/build.bat deleted file mode 100644 index 05826ad93..000000000 --- a/.kokoro/build.bat +++ /dev/null @@ -1,3 +0,0 @@ -:: See documentation in type-shell-output.bat - -"C:\Program Files\Git\bin\bash.exe" %~dp0build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh deleted file mode 100755 index bd7b71a1c..000000000 --- a/.kokoro/build.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/bash -# Copyright 2019 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -## Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -# include common functions -source ${scriptDir}/common.sh - -# Print out Java version -java -version -echo ${JOB_TYPE} - -# attempt to install 3 times with exponential backoff (starting with 10 seconds) -retry_with_backoff 3 10 \ - mvn install -B -V \ - -DskipTests=true \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dmaven.javadoc.skip=true \ - -Dgcloud.download.skip=true \ - -T 1C - -# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it -if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then - export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS}) -fi - -RETURN_CODE=0 -set +e - -case ${JOB_TYPE} in -test) - mvn test -B -Dclirr.skip=true -Denforcer.skip=true - RETURN_CODE=$? - ;; -lint) - mvn com.coveo:fmt-maven-plugin:check - RETURN_CODE=$? - ;; -javadoc) - mvn javadoc:javadoc javadoc:test-javadoc - RETURN_CODE=$? - ;; -integration) - mvn -B ${INTEGRATION_TEST_ARGS} \ - -Penable-integration-tests \ - -DtrimStackTrace=false \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -fae \ - verify - RETURN_CODE=$? - ;; -samples) - if [[ -f samples/pom.xml ]] - then - pushd samples - mvn -B \ - -Penable-samples \ - -DtrimStackTrace=false \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -fae \ - verify - RETURN_CODE=$? - popd - else - echo "no sample pom.xml found - skipping sample tests" - fi - ;; -clirr) - mvn -B -Denforcer.skip=true clirr:check - RETURN_CODE=$? - ;; -*) - ;; -esac - -if [ "${REPORT_COVERAGE}" == "true" ] -then - bash ${KOKORO_GFILE_DIR}/codecov.sh -fi - -# fix output location of logs -bash .kokoro/coerce_logs.sh - -if [[ "${ENABLE_BUILD_COP}" == "true" ]] -then - chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/buildcop - ${KOKORO_GFILE_DIR}/linux_amd64/buildcop -repo=googleapis/java-speech -fi - -echo "exiting with ${RETURN_CODE}" -exit ${RETURN_CODE} diff --git a/.kokoro/coerce_logs.sh b/.kokoro/coerce_logs.sh deleted file mode 100755 index 5cf7ba49e..000000000 --- a/.kokoro/coerce_logs.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# Copyright 2019 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This script finds and moves sponge logs so that they can be found by placer -# and are not flagged as flaky by sponge. - -set -eo pipefail - -## Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -job=$(basename ${KOKORO_JOB_NAME}) - -echo "coercing sponge logs..." -for xml in `find . -name *-sponge_log.xml` -do - echo "processing ${xml}" - class=$(basename ${xml} | cut -d- -f2) - dir=$(dirname ${xml})/${job}/${class} - text=$(dirname ${xml})/${class}-sponge_log.txt - mkdir -p ${dir} - mv ${xml} ${dir}/sponge_log.xml - mv ${text} ${dir}/sponge_log.txt -done diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg deleted file mode 100644 index bee7219c1..000000000 --- a/.kokoro/common.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# All builds use the trampoline script to run in docker. -build_file: "java-speech/.kokoro/trampoline.sh" - -# Tell the trampoline which build file to use. -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-speech/.kokoro/build.sh" -} diff --git a/.kokoro/common.sh b/.kokoro/common.sh deleted file mode 100644 index a8d0ea04d..000000000 --- a/.kokoro/common.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -function retry_with_backoff { - attempts_left=$1 - sleep_seconds=$2 - shift 2 - command=$@ - - - # store current flag state - flags=$- - - # allow a failures to continue - set +e - echo "${command}" - ${command} - exit_code=$? - - # restore "e" flag - if [[ ${flags} =~ e ]] - then set -e - else set +e - fi - - if [[ $exit_code == 0 ]] - then - return 0 - fi - - # failure - if [[ ${attempts_left} > 0 ]] - then - echo "failure (${exit_code}), sleeping ${sleep_seconds}..." - sleep ${sleep_seconds} - new_attempts=$((${attempts_left} - 1)) - new_sleep=$((${sleep_seconds} * 2)) - retry_with_backoff ${new_attempts} ${new_sleep} ${command} - fi - - return $exit_code -} - -## Helper functionss -function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; } -function msg() { println "$*" >&2; } -function println() { printf '%s\n' "$(now) $*"; } \ No newline at end of file diff --git a/.kokoro/continuous/common.cfg b/.kokoro/continuous/common.cfg deleted file mode 100644 index 9356b7e85..000000000 --- a/.kokoro/continuous/common.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - regex: "**/*sponge_log.txt" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-speech/.kokoro/trampoline.sh" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-speech/.kokoro/build.sh" -} - -env_vars: { - key: "JOB_TYPE" - value: "test" -} diff --git a/.kokoro/continuous/java8.cfg b/.kokoro/continuous/java8.cfg deleted file mode 100644 index 495cc7bac..000000000 --- a/.kokoro/continuous/java8.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "REPORT_COVERAGE" - value: "true" -} diff --git a/.kokoro/continuous/propose_release.sh b/.kokoro/continuous/propose_release.sh deleted file mode 100755 index 18f3485b8..000000000 --- a/.kokoro/continuous/propose_release.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -# Copyright 2019 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. - -set -eo pipefail - -export NPM_CONFIG_PREFIX=/home/node/.npm-global - -if [ -f ${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please ]; then - # Groom the release PR as new commits are merged. - npx release-please release-pr --token=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-token-release-please \ - --repo-url=googleapis/java-speech \ - --package-name="google-cloud-speech" \ - --api-url=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please \ - --proxy-key=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-key-release-please \ - --release-type=java-yoshi -fi diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh deleted file mode 100755 index c91e5a569..000000000 --- a/.kokoro/dependencies.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash -# Copyright 2019 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -## Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -# include common functions -source ${scriptDir}/common.sh - -# Print out Java -java -version -echo $JOB_TYPE - -export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" - -# this should run maven enforcer -retry_with_backoff 3 10 \ - mvn install -B -V \ - -DskipTests=true \ - -Dclirr.skip=true - -mvn -B dependency:analyze -DfailOnWarning=true - -echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************" -## Run dependency list completeness check -function completenessCheck() { - # Output dep list with compile scope generated using the original pom - # Running mvn dependency:list on Java versions that support modules will also include the module of the dependency. - # This is stripped from the output as it is not present in the flattened pom. - # Only dependencies with 'compile' or 'runtime' scope are included from original dependency list. - msg "Generating dependency list using original pom..." - mvn dependency:list -f pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// >.org-list.txt - - # Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes) - msg "Generating dependency list using flattened pom..." - mvn dependency:list -f .flattened-pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt - - # Compare two dependency lists - msg "Comparing dependency lists..." - diff .org-list.txt .new-list.txt >.diff.txt - if [[ $? == 0 ]] - then - msg "Success. No diff!" - else - msg "Diff found. See below: " - msg "You can also check .diff.txt file located in $1." - cat .diff.txt - return 1 - fi -} - -# Allow failures to continue running the script -set +e - -error_count=0 -for path in $(find -name ".flattened-pom.xml") -do - # Check flattened pom in each dir that contains it for completeness - dir=$(dirname "$path") - pushd "$dir" - completenessCheck "$dir" - error_count=$(($error_count + $?)) - popd -done - -if [[ $error_count == 0 ]] -then - msg "All checks passed." - exit 0 -else - msg "Errors found. See log statements above." - exit 1 -fi \ No newline at end of file diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh deleted file mode 100755 index 759ab4e2c..000000000 --- a/.kokoro/linkage-monitor.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# Copyright 2019 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail -# Display commands being run. -set -x - -## Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -# include common functions -source ${scriptDir}/common.sh - -# Print out Java version -java -version -echo ${JOB_TYPE} - -# attempt to install 3 times with exponential backoff (starting with 10 seconds) -retry_with_backoff 3 10 \ - mvn install -B -V \ - -DskipTests=true \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dmaven.javadoc.skip=true \ - -Dgcloud.download.skip=true - -# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR -JAR=linkage-monitor-latest-all-deps.jar -curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/${JAR}" - -# Fails if there's new linkage errors compared with baseline -java -jar ${JAR} com.google.cloud:libraries-bom diff --git a/.kokoro/nightly/common.cfg b/.kokoro/nightly/common.cfg deleted file mode 100644 index 9356b7e85..000000000 --- a/.kokoro/nightly/common.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - regex: "**/*sponge_log.txt" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-speech/.kokoro/trampoline.sh" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-speech/.kokoro/build.sh" -} - -env_vars: { - key: "JOB_TYPE" - value: "test" -} diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg deleted file mode 100644 index 0048c8ece..000000000 --- a/.kokoro/nightly/integration.cfg +++ /dev/null @@ -1,37 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "integration" -} -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "ENABLE_BUILD_COP" - value: "true" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-it-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-it-service-account" -} diff --git a/.kokoro/nightly/java11.cfg b/.kokoro/nightly/java11.cfg deleted file mode 100644 index 709f2b4c7..000000000 --- a/.kokoro/nightly/java11.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} diff --git a/.kokoro/nightly/java7.cfg b/.kokoro/nightly/java7.cfg deleted file mode 100644 index cb24f44ee..000000000 --- a/.kokoro/nightly/java7.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java7" -} diff --git a/.kokoro/nightly/java8-osx.cfg b/.kokoro/nightly/java8-osx.cfg deleted file mode 100644 index 62b69687f..000000000 --- a/.kokoro/nightly/java8-osx.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-speech/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg deleted file mode 100644 index 510b04772..000000000 --- a/.kokoro/nightly/java8-win.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-speech/.kokoro/build.bat" diff --git a/.kokoro/nightly/java8.cfg b/.kokoro/nightly/java8.cfg deleted file mode 100644 index 495cc7bac..000000000 --- a/.kokoro/nightly/java8.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "REPORT_COVERAGE" - value: "true" -} diff --git a/.kokoro/nightly/samples.cfg b/.kokoro/nightly/samples.cfg deleted file mode 100644 index f25429314..000000000 --- a/.kokoro/nightly/samples.cfg +++ /dev/null @@ -1,38 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "samples" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-docs-samples-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-docs-samples-service-account" -} - -env_vars: { - key: "ENABLE_BUILD_COP" - value: "true" -} diff --git a/.kokoro/populate-secrets.sh b/.kokoro/populate-secrets.sh deleted file mode 100755 index f52514257..000000000 --- a/.kokoro/populate-secrets.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} -function msg { println "$*" >&2 ;} -function println { printf '%s\n' "$(now) $*" ;} - - -# Populates requested secrets set in SECRET_MANAGER_KEYS from service account: -# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com -SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" -msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" -mkdir -p ${SECRET_LOCATION} -for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") -do - msg "Retrieving secret ${key}" - docker run --entrypoint=gcloud \ - --volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \ - gcr.io/google.com/cloudsdktool/cloud-sdk \ - secrets versions access latest \ - --project cloud-devrel-kokoro-resources \ - --secret ${key} > \ - "${SECRET_LOCATION}/${key}" - if [[ $? == 0 ]]; then - msg "Secret written to ${SECRET_LOCATION}/${key}" - else - msg "Error retrieving secret ${key}" - fi -done diff --git a/.kokoro/presubmit/clirr.cfg b/.kokoro/presubmit/clirr.cfg deleted file mode 100644 index ec572442e..000000000 --- a/.kokoro/presubmit/clirr.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. - -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "clirr" -} \ No newline at end of file diff --git a/.kokoro/presubmit/common.cfg b/.kokoro/presubmit/common.cfg deleted file mode 100644 index 139314517..000000000 --- a/.kokoro/presubmit/common.cfg +++ /dev/null @@ -1,34 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - regex: "**/*sponge_log.txt" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-speech/.kokoro/trampoline.sh" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-speech/.kokoro/build.sh" -} - -env_vars: { - key: "JOB_TYPE" - value: "test" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "dpebot_codecov_token" - } - } -} diff --git a/.kokoro/presubmit/dependencies.cfg b/.kokoro/presubmit/dependencies.cfg deleted file mode 100644 index 6663e1c71..000000000 --- a/.kokoro/presubmit/dependencies.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-speech/.kokoro/dependencies.sh" -} diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg deleted file mode 100644 index dded67a9d..000000000 --- a/.kokoro/presubmit/integration.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "integration" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-it-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-it-service-account" -} diff --git a/.kokoro/presubmit/java11.cfg b/.kokoro/presubmit/java11.cfg deleted file mode 100644 index 709f2b4c7..000000000 --- a/.kokoro/presubmit/java11.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} diff --git a/.kokoro/presubmit/java7.cfg b/.kokoro/presubmit/java7.cfg deleted file mode 100644 index cb24f44ee..000000000 --- a/.kokoro/presubmit/java7.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java7" -} diff --git a/.kokoro/presubmit/java8-osx.cfg b/.kokoro/presubmit/java8-osx.cfg deleted file mode 100644 index 62b69687f..000000000 --- a/.kokoro/presubmit/java8-osx.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-speech/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg deleted file mode 100644 index 510b04772..000000000 --- a/.kokoro/presubmit/java8-win.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-speech/.kokoro/build.bat" diff --git a/.kokoro/presubmit/java8.cfg b/.kokoro/presubmit/java8.cfg deleted file mode 100644 index 495cc7bac..000000000 --- a/.kokoro/presubmit/java8.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "REPORT_COVERAGE" - value: "true" -} diff --git a/.kokoro/presubmit/linkage-monitor.cfg b/.kokoro/presubmit/linkage-monitor.cfg deleted file mode 100644 index 96bbf92d3..000000000 --- a/.kokoro/presubmit/linkage-monitor.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-speech/.kokoro/linkage-monitor.sh" -} \ No newline at end of file diff --git a/.kokoro/presubmit/lint.cfg b/.kokoro/presubmit/lint.cfg deleted file mode 100644 index 6d323c8ae..000000000 --- a/.kokoro/presubmit/lint.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. - -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "lint" -} \ No newline at end of file diff --git a/.kokoro/presubmit/samples.cfg b/.kokoro/presubmit/samples.cfg deleted file mode 100644 index 01e096004..000000000 --- a/.kokoro/presubmit/samples.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "samples" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-docs-samples-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-docs-samples-service-account" -} \ No newline at end of file diff --git a/.kokoro/release/bump_snapshot.cfg b/.kokoro/release/bump_snapshot.cfg deleted file mode 100644 index d9324e08c..000000000 --- a/.kokoro/release/bump_snapshot.cfg +++ /dev/null @@ -1,53 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-speech/.kokoro/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-speech/.kokoro/release/bump_snapshot.sh" -} - -# tokens used by release-please to keep an up-to-date release PR. -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-key-release-please" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-token-release-please" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-url-release-please" - } - } -} diff --git a/.kokoro/release/bump_snapshot.sh b/.kokoro/release/bump_snapshot.sh deleted file mode 100755 index aa468f49d..000000000 --- a/.kokoro/release/bump_snapshot.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -# Copyright 2019 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. - -set -eo pipefail - -export NPM_CONFIG_PREFIX=/home/node/.npm-global - -if [ -f ${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please ]; then - # Groom the snapshot release PR immediately after publishing a release - npx release-please release-pr --token=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-token-release-please \ - --repo-url=googleapis/java-speech \ - --package-name="google-cloud-speech" \ - --api-url=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please \ - --proxy-key=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-key-release-please \ - --snapshot \ - --release-type=java-auth-yoshi -fi diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg deleted file mode 100644 index 4c53833d8..000000000 --- a/.kokoro/release/common.cfg +++ /dev/null @@ -1,49 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-speech/.kokoro/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-keyring" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-passphrase" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-pubkeyring" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "sonatype-credentials" - } - } -} diff --git a/.kokoro/release/common.sh b/.kokoro/release/common.sh deleted file mode 100755 index 6e3f65999..000000000 --- a/.kokoro/release/common.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# Get secrets from keystore and set and environment variables -setup_environment_secrets() { - export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) - export GPG_TTY=$(tty) - export GPG_HOMEDIR=/gpg - mkdir $GPG_HOMEDIR - mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg - mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg - export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') - export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') -} - -create_settings_xml_file() { - echo " - - - ossrh - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - - sonatype-nexus-staging - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - - sonatype-nexus-snapshots - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - -" > $1 -} \ No newline at end of file diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg deleted file mode 100644 index 456d2afff..000000000 --- a/.kokoro/release/drop.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-speech/.kokoro/release/drop.sh" -} diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh deleted file mode 100755 index 5c4551efa..000000000 --- a/.kokoro/release/drop.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# STAGING_REPOSITORY_ID must be set -if [ -z "${STAGING_REPOSITORY_ID}" ]; then - echo "Missing STAGING_REPOSITORY_ID environment variable" - exit 1 -fi - -source $(dirname "$0")/common.sh -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn nexus-staging:drop -B \ - --settings=settings.xml \ - -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/promote.cfg b/.kokoro/release/promote.cfg deleted file mode 100644 index bec881a41..000000000 --- a/.kokoro/release/promote.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-speech/.kokoro/release/promote.sh" -} diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh deleted file mode 100755 index 1fa95fa53..000000000 --- a/.kokoro/release/promote.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# STAGING_REPOSITORY_ID must be set -if [ -z "${STAGING_REPOSITORY_ID}" ]; then - echo "Missing STAGING_REPOSITORY_ID environment variable" - exit 1 -fi - -source $(dirname "$0")/common.sh - -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn nexus-staging:release -B \ - -DperformRelease=true \ - --settings=settings.xml \ - -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg deleted file mode 100644 index 5825faba6..000000000 --- a/.kokoro/release/publish_javadoc.cfg +++ /dev/null @@ -1,29 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/doc-templates/" - -env_vars: { - key: "STAGING_BUCKET" - value: "docs-staging" -} - -env_vars: { - key: "STAGING_BUCKET_V2" - value: "docs-staging-v2-staging" - # Production will be at: docs-staging-v2 -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-speech/.kokoro/release/publish_javadoc.sh" -} - - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "docuploader_service_account" - } - } -} diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh deleted file mode 100755 index fe9f45310..000000000 --- a/.kokoro/release/publish_javadoc.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -if [[ -z "${CREDENTIALS}" ]]; then - CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account -fi - -if [[ -z "${STAGING_BUCKET}" ]]; then - echo "Need to set STAGING_BUCKET environment variable" - exit 1 -fi - -if [[ -z "${STAGING_BUCKET_V2}" ]]; then - echo "Need to set STAGING_BUCKET_V2 environment variable" - exit 1 -fi - -# work from the git root directory -pushd $(dirname "$0")/../../ - -# install docuploader package -python3 -m pip install gcp-docuploader - -# compile all packages -mvn clean install -B -q -DskipTests=true - -NAME=google-cloud-speech -VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) - -# build the docs -mvn site -B -q - -pushd target/site/apidocs - -# create metadata -python3 -m docuploader create-metadata \ - --name ${NAME} \ - --version ${VERSION} \ - --language java - -# upload docs -python3 -m docuploader upload . \ - --credentials ${CREDENTIALS} \ - --staging-bucket ${STAGING_BUCKET} - -popd - -# V2 -mvn clean site -B -q -Ddevsite.template="${KOKORO_GFILE_DIR}/java/" - -pushd target/devsite - -# create metadata -python3 -m docuploader create-metadata \ - --name ${NAME} \ - --version ${VERSION} \ - --language java - -# upload docs -python3 -m docuploader upload . \ - --credentials ${CREDENTIALS} \ - --staging-bucket ${STAGING_BUCKET_V2} diff --git a/.kokoro/release/snapshot.cfg b/.kokoro/release/snapshot.cfg deleted file mode 100644 index af3b7ed71..000000000 --- a/.kokoro/release/snapshot.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-speech/.kokoro/release/snapshot.sh" -} \ No newline at end of file diff --git a/.kokoro/release/snapshot.sh b/.kokoro/release/snapshot.sh deleted file mode 100755 index 098168a73..000000000 --- a/.kokoro/release/snapshot.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# Copyright 2019 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -source $(dirname "$0")/common.sh -MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml -pushd $(dirname "$0")/../../ - -# ensure we're trying to push a snapshot (no-result returns non-zero exit code) -grep SNAPSHOT versions.txt - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn clean install deploy -B \ - --settings ${MAVEN_SETTINGS_FILE} \ - -DperformRelease=true \ - -Dgpg.executable=gpg \ - -Dgpg.passphrase=${GPG_PASSPHRASE} \ - -Dgpg.homedir=${GPG_HOMEDIR} diff --git a/.kokoro/release/stage.cfg b/.kokoro/release/stage.cfg deleted file mode 100644 index 4029e3dc8..000000000 --- a/.kokoro/release/stage.cfg +++ /dev/null @@ -1,19 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-speech/.kokoro/release/stage.sh" -} - -# Need to save the properties file -action { - define_artifacts { - regex: "github/java-speech/target/nexus-staging/staging/*.properties" - strip_prefix: "github/java-speech" - } -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" -} diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh deleted file mode 100755 index 3c482cbc5..000000000 --- a/.kokoro/release/stage.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# Start the releasetool reporter -python3 -m pip install gcp-releasetool -python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script - -source $(dirname "$0")/common.sh -MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn clean install deploy -B \ - --settings ${MAVEN_SETTINGS_FILE} \ - -DskipTests=true \ - -DperformRelease=true \ - -Dgpg.executable=gpg \ - -Dgpg.passphrase=${GPG_PASSPHRASE} \ - -Dgpg.homedir=${GPG_HOMEDIR} - -if [[ -n "${AUTORELEASE_PR}" ]] -then - mvn nexus-staging:release -B \ - -DperformRelease=true \ - --settings=settings.xml -fi \ No newline at end of file diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh deleted file mode 100644 index 9da0f8398..000000000 --- a/.kokoro/trampoline.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -set -eo pipefail -# Always run the cleanup script, regardless of the success of bouncing into -# the container. -function cleanup() { - chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh - ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh - echo "cleanup"; -} -trap cleanup EXIT - -$(dirname $0)/populate-secrets.sh # Secret Manager secrets. -python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/.readme-partials.yaml b/.readme-partials.yaml deleted file mode 100644 index 82eae0bb0..000000000 --- a/.readme-partials.yaml +++ /dev/null @@ -1,37 +0,0 @@ -custom_content: | - ### Recognizing speech - The following code sample shows how to recognize speech using an audio file from a Cloud Storage bucket as input. - First, add the following imports at the top of your file: - - ```java - import com.google.cloud.speech.v1.SpeechClient; - import com.google.cloud.speech.v1.RecognitionAudio; - import com.google.cloud.speech.v1.RecognitionConfig; - import com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding; - import com.google.cloud.speech.v1.RecognizeResponse; - ``` - Then add the following code to do the speech recognization: - ```java - try (SpeechClient speechClient = SpeechClient.create()) { - RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC; - int sampleRateHertz = 44100; - String languageCode = "en-US"; - RecognitionConfig config = RecognitionConfig.newBuilder() - .setEncoding(encoding) - .setSampleRateHertz(sampleRateHertz) - .setLanguageCode(languageCode) - .build(); - String uri = "gs://bucket_name/file_name.flac"; - RecognitionAudio audio = RecognitionAudio.newBuilder() - .setUri(uri) - .build(); - RecognizeResponse response = speechClient.recognize(config, audio); - } - ``` - - #### Complete source code - - In [RecognizeSpeech.java](https://github.com/googleapis/google-cloud-java/blob/master/google-cloud-examples/src/main/java/com/google/cloud/examples/speech/snippets/RecognizeSpeech.java) we put a quick start example, which shows how you can use Google Speech API to automatically recognize speech based on a local file. - - For an example audio file, you can use the [audio.raw](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/speech/cloud-client/resources/audio.raw) file from the samples repository. - Note, to play the file on Unix-like system you may use the following command: `play -t raw -r 16k -e signed -b 16 -c 1 audio.raw` \ No newline at end of file diff --git a/.repo-metadata.json b/.repo-metadata.json deleted file mode 100644 index 8cbbe7de6..000000000 --- a/.repo-metadata.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "speech", - "name_pretty": "Cloud Speech", - "release_level": "ga", - "language": "java", - "repo": "googleapis/java-speech", - "repo_short": "java-speech", - "distribution_name": "com.google.cloud:google-cloud-speech", - "client_documentation": "https://googleapis.dev/java/google-cloud-speech/latest/", - "transport": "grpc", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559758", - "requires_billing": false, - "api_id": "speech.googleapis.com", - "product_documentation": "https://cloud.google.com/speech-to-text/docs/", - "api_description": "enables easy integration of Google speech recognition technologies into developer applications. Send audio and receive a text transcription from the Speech-to-Text API service." -} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 147de2d35..000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,152 +0,0 @@ -# Changelog - -### [1.24.1](https://www.github.com/googleapis/java-speech/compare/v1.24.0...v1.24.1) (2020-08-17) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.8.2 ([#232](https://www.github.com/googleapis/java-speech/issues/232)) ([aa22c17](https://www.github.com/googleapis/java-speech/commit/aa22c1770a06f61f131b0e4cb3d50fdc9bbbb8eb)) -* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.8.3 ([#236](https://www.github.com/googleapis/java-speech/issues/236)) ([19e21a3](https://www.github.com/googleapis/java-speech/commit/19e21a3979527cef0d64181b3e0913f8a5fc132e)) - -## [1.24.0](https://www.github.com/googleapis/java-speech/compare/v1.23.0...v1.24.0) (2020-06-22) - - -### Features - -* **deps:** adopt flatten plugin and google-cloud-shared-dependencies ([#218](https://www.github.com/googleapis/java-speech/issues/218)) ([d1a0e06](https://www.github.com/googleapis/java-speech/commit/d1a0e0672ff8f50768ccc4e6d77e3084950e839f)) - - -### Bug Fixes - -* **generator:** delay removing streaming response until used ([#166](https://www.github.com/googleapis/java-speech/issues/166)) ([fef1a16](https://www.github.com/googleapis/java-speech/commit/fef1a16937ff81ea96e8504b053289d2025d8a21)) -* migrate retry configs to grpc_service_config ([#217](https://www.github.com/googleapis/java-speech/issues/217)) ([9a07a5e](https://www.github.com/googleapis/java-speech/commit/9a07a5ed85ceac5f6c2b2212101fa13e0d46374d)) -* restore GAPIC v2 retry configs ([#178](https://www.github.com/googleapis/java-speech/issues/178)) ([243add1](https://www.github.com/googleapis/java-speech/commit/243add1197d7407d48422f9432086331f243947a)) - - -### Dependencies - -* update core dependencies ([#205](https://www.github.com/googleapis/java-speech/issues/205)) ([cc7ae23](https://www.github.com/googleapis/java-speech/commit/cc7ae23507808c0d9619e6f081016cdb8aefc5ac)) -* update dependency com.google.api:api-common to v1.9.1 ([#184](https://www.github.com/googleapis/java-speech/issues/184)) ([a9f07eb](https://www.github.com/googleapis/java-speech/commit/a9f07eb60c37dec5ab0b26aa88a4285b85ed7600)) -* update dependency com.google.api:api-common to v1.9.2 ([#194](https://www.github.com/googleapis/java-speech/issues/194)) ([9b2b2d1](https://www.github.com/googleapis/java-speech/commit/9b2b2d12ef28434ae07ae51fa399b290a374a839)) -* update dependency com.google.api.grpc:proto-google-common-protos to v1.18.0 ([#172](https://www.github.com/googleapis/java-speech/issues/172)) ([8028557](https://www.github.com/googleapis/java-speech/commit/80285577a0186f7e2618e3c6a61110bcd5431690)) -* update dependency com.google.cloud:google-cloud-core-grpc to v1.93.5 ([#188](https://www.github.com/googleapis/java-speech/issues/188)) ([c782fda](https://www.github.com/googleapis/java-speech/commit/c782fda74917c861b5a4761e2c1e94cb09f0be45)) -* update dependency com.google.errorprone:error_prone_annotations to v2.4.0 ([#186](https://www.github.com/googleapis/java-speech/issues/186)) ([2b37cf2](https://www.github.com/googleapis/java-speech/commit/2b37cf25478e62799fb0695baf3bbcd013700503)) -* update dependency com.google.protobuf:protobuf-java to v3.12.2 ([#176](https://www.github.com/googleapis/java-speech/issues/176)) ([34a68fc](https://www.github.com/googleapis/java-speech/commit/34a68fca5b5eb8a3be33a0d23dad3a45334f10a1)) -* update dependency io.grpc:grpc-bom to v1.29.0 ([#159](https://www.github.com/googleapis/java-speech/issues/159)) ([8fe074c](https://www.github.com/googleapis/java-speech/commit/8fe074c183d0521a4ea645c3c498248b33d7debd)) -* update dependency io.grpc:grpc-bom to v1.30.0 ([#198](https://www.github.com/googleapis/java-speech/issues/198)) ([e4056d1](https://www.github.com/googleapis/java-speech/commit/e4056d1bdf41fb0d2e733fa3805a7379d3628edb)) -* update dependency org.threeten:threetenbp to v1.4.4 ([#165](https://www.github.com/googleapis/java-speech/issues/165)) ([b2520fa](https://www.github.com/googleapis/java-speech/commit/b2520fab884d15591cbd0167f582602239a3f1eb)) - -## [1.23.0](https://www.github.com/googleapis/java-speech/compare/v1.22.6...v1.23.0) (2020-04-21) - - -### Features - -* **v1p1beta1:** Add speech adaptation, phrase sets, and custom classes ([#156](https://www.github.com/googleapis/java-speech/issues/156)) ([ad9a2aa](https://www.github.com/googleapis/java-speech/commit/ad9a2aa98a1fee600ea9dfec6adca6ec64ec0ad5)) - - -### Dependencies - -* update dependency com.google.guava:guava-bom to v29 ([#141](https://www.github.com/googleapis/java-speech/issues/141)) ([b3fdac9](https://www.github.com/googleapis/java-speech/commit/b3fdac93cef38cd62e74dbf5309f316791271ded)) - -### [1.22.6](https://www.github.com/googleapis/java-speech/compare/v1.22.5...v1.22.6) (2020-04-07) - - -### Dependencies - -* update core dependencies ([#113](https://www.github.com/googleapis/java-speech/issues/113)) ([38aec43](https://www.github.com/googleapis/java-speech/commit/38aec43b19ff0587ea316b41434349402d52f4c6)) -* update dependency com.google.api:api-common to v1.9.0 ([#128](https://www.github.com/googleapis/java-speech/issues/128)) ([9591116](https://www.github.com/googleapis/java-speech/commit/9591116696d9f6bc0017898987f3cf67fe5f3dc4)) -* update dependency com.google.cloud:google-cloud-core-grpc to v1.93.4 ([#135](https://www.github.com/googleapis/java-speech/issues/135)) ([59b076a](https://www.github.com/googleapis/java-speech/commit/59b076a9aa4b79e902c7171903e664c135385da0)) -* update dependency org.threeten:threetenbp to v1.4.3 ([#121](https://www.github.com/googleapis/java-speech/issues/121)) ([8753cde](https://www.github.com/googleapis/java-speech/commit/8753cde2b9fa8231e55eed09c5833390c6c8c20f)) - -### [1.22.5](https://www.github.com/googleapis/java-speech/compare/v1.22.4...v1.22.5) (2020-03-05) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-core-grpc to v1.93.1 ([#110](https://www.github.com/googleapis/java-speech/issues/110)) ([d78ca42](https://www.github.com/googleapis/java-speech/commit/d78ca4299fc42e4c8e6fb4b95658a6d950f278ea)) - -### [1.22.4](https://www.github.com/googleapis/java-speech/compare/v1.22.3...v1.22.4) (2020-02-20) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-core-grpc to v1.92.5 ([a10f997](https://www.github.com/googleapis/java-speech/commit/a10f997dc5cdbc9c7f03254e46fda57b06cdb99a)) - - -### Documentation - -* **regen:** update sample code to set total timeout, add API client header test ([186be5d](https://www.github.com/googleapis/java-speech/commit/186be5d8cf027ad1c68e55ab714f61c225b41a21)) - -### [1.22.3](https://www.github.com/googleapis/java-speech/compare/v1.22.2...v1.22.3) (2020-02-04) - - -### Dependencies - -* update core dependencies ([#70](https://www.github.com/googleapis/java-speech/issues/70)) ([176d86d](https://www.github.com/googleapis/java-speech/commit/176d86db67ecac9d5c20ef635a4ae2fa2ebdf713)) -* update core dependencies ([#85](https://www.github.com/googleapis/java-speech/issues/85)) ([37693d4](https://www.github.com/googleapis/java-speech/commit/37693d4b7264bb38155d61a0240d5872210b133e)) -* update dependency com.google.protobuf:protobuf-java to v3.11.3 ([#87](https://www.github.com/googleapis/java-speech/issues/87)) ([961ea81](https://www.github.com/googleapis/java-speech/commit/961ea81c56e42422804ddbd83e4ac1f62cd3ece9)) -* update dependency org.threeten:threetenbp to v1.4.1 ([47a65fe](https://www.github.com/googleapis/java-speech/commit/47a65fe91d8b915a643df0fa85f92baeacc4d1f5)) - -### [1.22.2](https://www.github.com/googleapis/java-speech/compare/v1.22.1...v1.22.2) (2020-01-07) - - -### Bug Fixes - -* update timeout settings ([#56](https://www.github.com/googleapis/java-speech/issues/56)) ([1403d85](https://www.github.com/googleapis/java-speech/commit/1403d857201b14630694937f2890f10c9557a360)) -* **regen:** update timeout configs, javadoc from protoc update ([#62](https://www.github.com/googleapis/java-speech/issues/62)) ([505ecb7](https://www.github.com/googleapis/java-speech/commit/505ecb7c4e715d2c2477ef192094a6b0ef437e1a)) - - -### Dependencies - -* update dependency com.google.cloud:google-cloud-core-grpc to v1.92.0 ([#66](https://www.github.com/googleapis/java-speech/issues/66)) ([b8c7cb1](https://www.github.com/googleapis/java-speech/commit/b8c7cb103223f503c507bcd31d0068a4b359c615)) -* update dependency com.google.errorprone:error_prone_annotations to v2.3.4 ([#51](https://www.github.com/googleapis/java-speech/issues/51)) ([c4487f7](https://www.github.com/googleapis/java-speech/commit/c4487f770704b6fd08456e09f7dfb17723524985)) -* update dependency com.google.guava:guava-bom to v28.2-android ([cf2d614](https://www.github.com/googleapis/java-speech/commit/cf2d6142e1e588330e4a15ae97206c3853995707)) -* update dependency com.google.protobuf:protobuf-java to v3.11.1 ([86baa06](https://www.github.com/googleapis/java-speech/commit/86baa06fd63e06231eaae3c13be978340804fa31)) -* update dependency io.grpc:grpc-bom to v1.26.0 ([#64](https://www.github.com/googleapis/java-speech/issues/64)) ([0deab5b](https://www.github.com/googleapis/java-speech/commit/0deab5b971baf0f7799d4a3d7d49d2b569ccae21)) -* update gax.version to v1.52.0 ([#52](https://www.github.com/googleapis/java-speech/issues/52)) ([508d25d](https://www.github.com/googleapis/java-speech/commit/508d25d512078058422aa33a37e89186cc99448c)) - -### [1.22.1](https://www.github.com/googleapis/java-speech/compare/v1.22.0...v1.22.1) (2019-11-21) - - -### Bug Fixes - -* **regen:** speech recognize marked as an idempotent method for retry ([#48](https://www.github.com/googleapis/java-speech/issues/48)) ([7b621c8](https://www.github.com/googleapis/java-speech/commit/7b621c89fa8953bc35ecf72060053ad1c5f2a42d)) - -## [1.22.0](https://www.github.com/googleapis/java-speech/compare/v1.21.0...v1.22.0) (2019-11-12) - - -### Features - -* add speaker_tag to WordInfo ([#40](https://www.github.com/googleapis/java-speech/issues/40)) ([3ccf3fe](https://www.github.com/googleapis/java-speech/commit/3ccf3fe57e5edef83f11efb13f4d44305b810f26)) - - -### Dependencies - -* update dependency io.grpc:grpc-bom to v1.25.0 ([#37](https://www.github.com/googleapis/java-speech/issues/37)) ([453858a](https://www.github.com/googleapis/java-speech/commit/453858a0caf6b2724150b627c1405a36b33ba568)) -* update gax.version to v1.50.1 ([#38](https://www.github.com/googleapis/java-speech/issues/38)) ([a9f3ef0](https://www.github.com/googleapis/java-speech/commit/a9f3ef003dee89a7c48e21ce99c239b15f860e4d)) - -## [1.21.0](https://www.github.com/googleapis/java-speech/compare/v1.20.0...v1.21.0) (2019-10-25) - - -### Features - -* add google-cloud-speech-bom ([#29](https://www.github.com/googleapis/java-speech/issues/29)) ([7279dbd](https://www.github.com/googleapis/java-speech/commit/7279dbd7ec79e16caa4cee031b017ab85fe419bc)) -* add parent pom ([#3](https://www.github.com/googleapis/java-speech/issues/3)) ([9607117](https://www.github.com/googleapis/java-speech/commit/9607117e8c4921432f1a88aa946453bb059a7a49)) - - -### Dependencies - -* update dependency com.google.api.grpc:proto-google-common-protos to v1.17.0 ([#17](https://www.github.com/googleapis/java-speech/issues/17)) ([166d568](https://www.github.com/googleapis/java-speech/commit/166d568c1857f881969ffdd8a19bd6d3470f8252)) -* update dependency com.google.cloud:google-cloud-core-grpc to v1.91.1 ([#10](https://www.github.com/googleapis/java-speech/issues/10)) ([718d408](https://www.github.com/googleapis/java-speech/commit/718d408734cf9733cb1fa79b2216b8baffd4de53)) -* update dependency com.google.cloud:google-cloud-core-grpc to v1.91.2 ([#14](https://www.github.com/googleapis/java-speech/issues/14)) ([c00d2c0](https://www.github.com/googleapis/java-speech/commit/c00d2c0d8f82abdfe787bb6ab3bed788740ac0aa)) -* update dependency com.google.cloud:google-cloud-core-grpc to v1.91.3 ([#34](https://www.github.com/googleapis/java-speech/issues/34)) ([5f9f856](https://www.github.com/googleapis/java-speech/commit/5f9f8564c1c6f1168f14513bff368579716014ef)) -* update dependency com.google.protobuf:protobuf-java to v3.10.0 ([#11](https://www.github.com/googleapis/java-speech/issues/11)) ([fcf123e](https://www.github.com/googleapis/java-speech/commit/fcf123e63967f889dc642f7212998b3c0839266e)) -* update dependency io.grpc:grpc-bom to v1.24.0 ([#12](https://www.github.com/googleapis/java-speech/issues/12)) ([444ff1a](https://www.github.com/googleapis/java-speech/commit/444ff1a601fd68fdcb6fbde76c85ae5382c1370c)) -* update dependency io.grpc:grpc-bom to v1.24.1 ([f17bde1](https://www.github.com/googleapis/java-speech/commit/f17bde1b0494e5b146011004931c20bf4bc5caad)) -* update gax.version to v1.49.0, guava to 28.1-android ([#13](https://www.github.com/googleapis/java-speech/issues/13)) ([63479e8](https://www.github.com/googleapis/java-speech/commit/63479e8ab9ad8b089ff10452af1de15db64e8d05)) -* update gax.version to v1.49.1 ([72d842a](https://www.github.com/googleapis/java-speech/commit/72d842a10e518e9d93b2f6429363ed18893415ce)) - - -### Documentation - -* fix sample link ([#24](https://www.github.com/googleapis/java-speech/issues/24)) ([acf24a4](https://www.github.com/googleapis/java-speech/commit/acf24a421ecf71650949682906dd07edf37b622a)) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 6b2238bb7..2add2547a 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,3 +1,4 @@ + # Code of Conduct ## Our Pledge @@ -69,12 +70,12 @@ dispute. If you are unable to resolve the matter for any reason, or if the behavior is threatening or harassing, report it. We are dedicated to providing an environment where participants feel welcome and safe. -Reports should be directed to *[PROJECT STEWARD NAME(s) AND EMAIL(s)]*, the -Project Steward(s) for *[PROJECT NAME]*. It is the Project Steward’s duty to +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to receive and address reported violations of the code of conduct. They will then work with a committee consisting of representatives from the Open Source Programs Office and the Google Open Source Strategy team. If for any reason you -are uncomfortable reaching out the Project Steward, please email +are uncomfortable reaching out to the Project Steward, please email opensource@google.com. We will investigate every complaint, but you may not receive a direct response. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f2dbdee06..b65dd279c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -53,12 +53,12 @@ mvn -Penable-integration-tests clean verify ## Code Samples -Code Samples must be bundled in separate Maven modules, and guarded by a -Maven profile with the name `enable-samples`. +All code samples must be in compliance with the [java sample formatting guide][3]. +Code Samples must be bundled in separate Maven modules. The samples must be separate from the primary project for a few reasons: -1. Primary projects have a minimum Java version of Java 7 whereas samples have - a minimum Java version of Java 8. Due to this we need the ability to +1. Primary projects have a minimum Java version of Java 8 whereas samples can have + Java version of Java 11. Due to this we need the ability to selectively exclude samples from a build run. 2. Many code samples depend on external GCP services and need credentials to access the service. @@ -68,39 +68,16 @@ The samples must be separate from the primary project for a few reasons: ### Building ```bash -mvn -Penable-samples clean verify +mvn clean verify ``` Some samples require access to GCP services and require a service account: ```bash export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json -mvn -Penable-samples clean verify +mvn clean verify ``` -### Profile Config - -1. To add samples in a profile to your Maven project, add the following to your -`pom.xml` - - ```xml - - [...] - - - enable-samples - - sample - - - - [...] - - ``` - -2. [Activate](#profile-activation) the profile. -3. Define your samples in a normal Maven project in the `samples/` directory. - ### Code Formatting Code in this repo is formatted with @@ -110,30 +87,6 @@ To run formatting on your project, you can run: mvn com.coveo:fmt-maven-plugin:format ``` -### Profile Activation - -To include code samples when building and testing the project, enable the -`enable-samples` Maven profile. - -#### Command line - -To activate the Maven profile on the command line add `-Penable-samples` to your -Maven command. - -#### Maven `settings.xml` - -To activate the Maven profile in your `~/.m2/settings.xml` add an entry of -`enable-samples` following the instructions in [Active Profiles][2]. - -This method has the benefit of applying to all projects you build (and is -respected by IntelliJ IDEA) and is recommended if you are going to be -contributing samples to several projects. - -#### IntelliJ IDEA - -To activate the Maven Profile inside IntelliJ IDEA, follow the instructions in -[Activate Maven profiles][3] to activate `enable-samples`. - [1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account [2]: https://maven.apache.org/settings.html#Active_Profiles -[3]: https://www.jetbrains.com/help/idea/work-with-maven-profiles.html#activate_maven_profiles +[3]: https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md \ No newline at end of file diff --git a/LICENSE b/LICENSE index d64569567..261eeb9e9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,3 @@ - Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ diff --git a/README.md b/README.md index 671fb4d7f..70f805928 100644 --- a/README.md +++ b/README.md @@ -8,16 +8,25 @@ Java idiomatic client for [Cloud Speech][product-docs]. - [Product Documentation][product-docs] - [Client Library Documentation][javadocs] + +:bus: In October 2022, this library has moved to +[google-cloud-java/java-speech]( +https://github.com/googleapis/google-cloud-java/tree/main/java-speech). +This repository will be archived in the future. +Future releases will appear in the new repository (https://github.com/googleapis/google-cloud-java/releases). +The Maven artifact coordinates (`com.google.cloud:google-cloud-speech`) remain the same. + ## Quickstart -If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: + ```xml com.google.cloud libraries-bom - 8.1.0 + 26.1.3 pom import @@ -25,6 +34,11 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file + + org.json + json + 20220924 + com.google.cloud google-cloud-speech @@ -35,31 +49,43 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file If you are using Maven without BOM, add this to your dependencies: + ```xml com.google.cloud google-cloud-speech - 1.24.0 + 2.6.1 ``` -[//]: # ({x-version-update-start:google-cloud-speech:released}) +If you are using Gradle 5.x or later, add this to your dependencies: -If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-speech:1.24.0' +implementation platform('com.google.cloud:libraries-bom:26.1.4') + +implementation 'com.google.cloud:google-cloud-speech' ``` -If you are using SBT, add this to your dependencies +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +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" % "1.24.0" +libraryDependencies += "com.google.cloud" % "google-cloud-speech" % "4.1.0" ``` -[//]: # ({x-version-update-end}) ## Authentication See the [Authentication][authentication] section in the base directory's README. +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired Cloud Speech APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Cloud Speech API calls. + ## Getting Started ### Prerequisites @@ -125,38 +151,14 @@ Note, to play the file on Unix-like system you may use the following command: `p ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/java-speech/tree/master/samples) directory. The samples' `README.md` -has instructions for running the samples. +Samples are in the [`samples/`](https://github.com/googleapis/java-speech/tree/main/samples) directory. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Transcribe Audio File using Long Running Operation (Local File) (LRO) | [source code](https://github.com/googleapis/java-speech/blob/master/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeAsync.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeAsync.java) | -| Transcript Audio File using Long Running Operation (Cloud Storage) (LRO) | [source code](https://github.com/googleapis/java-speech/blob/master/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeAsyncGcs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeAsyncGcs.java) | -| Getting word timestamps (Cloud Storage) (LRO) | [source code](https://github.com/googleapis/java-speech/blob/master/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeAsyncWordTimeOffsetsGcs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeAsyncWordTimeOffsetsGcs.java) | -| Using Enhanced Models (Local File) | [source code](https://github.com/googleapis/java-speech/blob/master/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeEnhancedModel.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeEnhancedModel.java) | -| Selecting a Transcription Model (Local File) | [source code](https://github.com/googleapis/java-speech/blob/master/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeModelSelection.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeModelSelection.java) | -| Selecting a Transcription Model (Cloud Storage) | [source code](https://github.com/googleapis/java-speech/blob/master/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeModelSelectionGcs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeModelSelectionGcs.java) | -| Multi-Channel Audio Transcription (Local File) | [source code](https://github.com/googleapis/java-speech/blob/master/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeMultichannel.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeMultichannel.java) | -| Multi-Channel Audio Transcription (Cloud Storage) | [source code](https://github.com/googleapis/java-speech/blob/master/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeMultichannelGcs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeMultichannelGcs.java) | -| Transcribe Audio File (Local File) | [source code](https://github.com/googleapis/java-speech/blob/master/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeSync.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeSync.java) | -| Transcript Audio File (Cloud Storage) | [source code](https://github.com/googleapis/java-speech/blob/master/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeSyncGcs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeSyncGcs.java) | -| Speech Adaptation (Cloud Storage) | [source code](https://github.com/googleapis/java-speech/blob/master/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechAdaptationBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechAdaptationBeta.java) | -| Using Context Classes (Cloud Storage) | [source code](https://github.com/googleapis/java-speech/blob/master/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechContextsClassesBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechContextsClassesBeta.java) | -| Quickstart Beta | [source code](https://github.com/googleapis/java-speech/blob/master/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechQuickstartBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechQuickstartBeta.java) | -| Getting punctuation in results (Local File) (Beta) | [source code](https://github.com/googleapis/java-speech/blob/master/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeAutoPunctuationBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeAutoPunctuationBeta.java) | -| Separating different speakers (Local File) (LRO) (Beta) | [source code](https://github.com/googleapis/java-speech/blob/master/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeDiarizationBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeDiarizationBeta.java) | -| Detecting language spoken automatically (Local File) (Beta) | [source code](https://github.com/googleapis/java-speech/blob/master/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeMultilanguageBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeMultilanguageBeta.java) | -| Adding recognition metadata (Local File) (Beta) | [source code](https://github.com/googleapis/java-speech/blob/master/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeRecognitionMetadataBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeRecognitionMetadataBeta.java) | -| Enabling word-level confidence (Local File) (Beta) | [source code](https://github.com/googleapis/java-speech/blob/master/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeWordLevelConfidenceBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeWordLevelConfidenceBeta.java) | -| Infinite Stream Recognize | [source code](https://github.com/googleapis/java-speech/blob/master/samples/snippets/src/main/java/com/example/speech/InfiniteStreamRecognize.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/InfiniteStreamRecognize.java) | -| Infinite Stream Recognize Options | [source code](https://github.com/googleapis/java-speech/blob/master/samples/snippets/src/main/java/com/example/speech/InfiniteStreamRecognizeOptions.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/InfiniteStreamRecognizeOptions.java) | -| Quickstart Sample | [source code](https://github.com/googleapis/java-speech/blob/master/samples/snippets/src/main/java/com/example/speech/QuickstartSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/QuickstartSample.java) | -| Recognize | [source code](https://github.com/googleapis/java-speech/blob/master/samples/snippets/src/main/java/com/example/speech/Recognize.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/Recognize.java) | -| Recognize Beta | [source code](https://github.com/googleapis/java-speech/blob/master/samples/snippets/src/main/java/com/example/speech/RecognizeBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/RecognizeBeta.java) | -| Speech Adaptation | [source code](https://github.com/googleapis/java-speech/blob/master/samples/snippets/src/main/java/com/example/speech/SpeechAdaptation.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/SpeechAdaptation.java) | -| Transcribe Context Classes | [source code](https://github.com/googleapis/java-speech/blob/master/samples/snippets/src/main/java/com/example/speech/TranscribeContextClasses.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/TranscribeContextClasses.java) | -| Transcribe Diarization | [source code](https://github.com/googleapis/java-speech/blob/master/samples/snippets/src/main/java/com/example/speech/TranscribeDiarization.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/TranscribeDiarization.java) | -| Transcribe Diarization Gcs | [source code](https://github.com/googleapis/java-speech/blob/master/samples/snippets/src/main/java/com/example/speech/TranscribeDiarizationGcs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/TranscribeDiarizationGcs.java) | +| Export To Storage Beta | [source code](https://github.com/googleapis/java-speech/blob/main/samples/snippets/src/main/java/com/example/speech/ExportToStorageBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/ExportToStorageBeta.java) | +| Speech Model Adaptation Beta | [source code](https://github.com/googleapis/java-speech/blob/main/samples/snippets/src/main/java/com/example/speech/SpeechModelAdaptationBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/SpeechModelAdaptationBeta.java) | +| Speech Transcribe Multi Region | [source code](https://github.com/googleapis/java-speech/blob/main/samples/snippets/src/main/java/com/example/speech/SpeechTranscribeMultiRegion.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/SpeechTranscribeMultiRegion.java) | +| Transcribe Context Classes | [source code](https://github.com/googleapis/java-speech/blob/main/samples/snippets/src/main/java/com/example/speech/TranscribeContextClasses.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/TranscribeContextClasses.java) | @@ -168,9 +170,49 @@ To get help, follow the instructions in the [shared Troubleshooting document][tr Cloud Speech uses gRPC for the transport layer. -## Java Versions +## Supported Java Versions + +Java 8 or above is required for using this client. -Java 7 or above is required for using this client. +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. ## Versioning @@ -178,6 +220,7 @@ Java 7 or above is required for using this client. This library follows [Semantic Versioning](http://semver.org/). + ## Contributing @@ -189,6 +232,7 @@ Please note that this project is released with a Contributor Code of Conduct. By this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information. + ## License Apache 2.0 - See [LICENSE][license] for more information. @@ -197,14 +241,15 @@ Apache 2.0 - See [LICENSE][license] for more information. Java Version | Status ------------ | ------ -Java 7 | [![Kokoro CI][kokoro-badge-image-1]][kokoro-badge-link-1] Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] +Java is a registered trademark of Oracle and/or its affiliates. + [product-docs]: https://cloud.google.com/speech-to-text/docs/ -[javadocs]: https://googleapis.dev/java/google-cloud-speech/latest/ +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-speech/latest/history [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 @@ -215,18 +260,27 @@ Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] [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 -[stability-image]: https://img.shields.io/badge/stability-ga-green +[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 [authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy [developer-console]: https://console.developers.google.com/ [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/master/troubleshooting/readme.md#troubleshooting -[contributing]: https://github.com/googleapis/java-speech/blob/master/CONTRIBUTING.md -[code-of-conduct]: https://github.com/googleapis/java-speech/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct -[license]: https://github.com/googleapis/java-speech/blob/master/LICENSE +[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 [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 [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..8b58ae9c0 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,7 @@ +# Security Policy + +To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). + +The Google Security Team will respond within 5 working days of your report on g.co/vulnz. + +We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. diff --git a/codecov.yaml b/codecov.yaml deleted file mode 100644 index 5724ea947..000000000 --- a/codecov.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -codecov: - ci: - - source.cloud.google.com diff --git a/google-cloud-speech-bom/pom.xml b/google-cloud-speech-bom/pom.xml deleted file mode 100644 index 0ae12a2c4..000000000 --- a/google-cloud-speech-bom/pom.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - 4.0.0 - com.google.cloud - google-cloud-speech-bom - 1.24.2-SNAPSHOT - pom - - com.google.cloud - google-cloud-shared-config - 0.9.2 - - - Google Cloud Speech BOM - https://github.com/googleapis/java-speech - - BOM for Google Cloud Speech - - - - Google LLC - - - - - chingor13 - Jeff Ching - chingor@google.com - Google LLC - - Developer - - - - - - scm:git:https://github.com/googleapis/java-speech.git - scm:git:git@github.com:googleapis/java-speech.git - https://github.com/googleapis/java-speech - - - - - sonatype-nexus-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - - sonatype-nexus-staging - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - - com.google.cloud - google-cloud-speech - 1.24.2-SNAPSHOT - - - com.google.api.grpc - proto-google-cloud-speech-v1 - 1.24.2-SNAPSHOT - - - com.google.api.grpc - proto-google-cloud-speech-v1beta1 - 0.77.2-SNAPSHOT - - - com.google.api.grpc - proto-google-cloud-speech-v1p1beta1 - 0.77.2-SNAPSHOT - - - com.google.api.grpc - grpc-google-cloud-speech-v1 - 1.24.2-SNAPSHOT - - - com.google.api.grpc - grpc-google-cloud-speech-v1beta1 - 0.77.2-SNAPSHOT - - - com.google.api.grpc - grpc-google-cloud-speech-v1p1beta1 - 0.77.2-SNAPSHOT - - - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - true - - - - - \ No newline at end of file diff --git a/google-cloud-speech/pom.xml b/google-cloud-speech/pom.xml deleted file mode 100644 index 051e7ecec..000000000 --- a/google-cloud-speech/pom.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - 4.0.0 - com.google.cloud - google-cloud-speech - 1.24.2-SNAPSHOT - jar - Google Cloud Speech - https://github.com/googleapis/java-speech - - Java idiomatic client for Google Cloud Speech. - - - com.google.cloud - google-cloud-speech-parent - 1.24.2-SNAPSHOT - - - google-cloud-speech - - - - com.google.api.grpc - proto-google-cloud-speech-v1p1beta1 - - - com.google.api.grpc - proto-google-cloud-speech-v1 - - - com.google.api - api-common - - - com.google.guava - guava - - - io.grpc - grpc-api - - - io.grpc - grpc-stub - - - io.grpc - grpc-protobuf - - - com.google.protobuf - protobuf-java - - - com.google.api.grpc - proto-google-common-protos - - - com.google.api - gax - - - com.google.api - gax-grpc - - - org.threeten - threetenbp - - - - - junit - junit - test - - - com.google.api.grpc - grpc-google-cloud-speech-v1p1beta1 - test - - - com.google.api.grpc - grpc-google-cloud-speech-v1 - test - - - com.google.api - gax-grpc - testlib - test - - - com.google.truth - truth - test - - - - - - java9 - - [9,) - - - - javax.annotation - javax.annotation-api - - - - - - - - - org.codehaus.mojo - flatten-maven-plugin - - - - diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechClient.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechClient.java deleted file mode 100644 index af38695c1..000000000 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechClient.java +++ /dev/null @@ -1,495 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.longrunning.OperationFuture; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1.stub.SpeechStub; -import com.google.cloud.speech.v1.stub.SpeechStubSettings; -import com.google.longrunning.Operation; -import com.google.longrunning.OperationsClient; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND SERVICE -/** - * Service Description: Service that implements Google Cloud Speech API. - * - *

This class provides the ability to make remote calls to the backing service through method - * calls that map to API methods. Sample code to get started: - * - *

- * 
- * try (SpeechClient speechClient = SpeechClient.create()) {
- *   RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
- *   int sampleRateHertz = 44100;
- *   String languageCode = "en-US";
- *   RecognitionConfig config = RecognitionConfig.newBuilder()
- *     .setEncoding(encoding)
- *     .setSampleRateHertz(sampleRateHertz)
- *     .setLanguageCode(languageCode)
- *     .build();
- *   String uri = "gs://bucket_name/file_name.flac";
- *   RecognitionAudio audio = RecognitionAudio.newBuilder()
- *     .setUri(uri)
- *     .build();
- *   RecognizeResponse response = speechClient.recognize(config, audio);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the speechClient object to clean up resources such as - * threads. In the example above, try-with-resources is used, which automatically calls close(). - * - *

The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
- * - *

See the individual methods for example code. - * - *

Many parameters require resource names to be formatted in a particular way. To assist with - * these names, this class includes a format method for each type of name, and additionally a parse - * method to extract the individual identifiers contained within names that are returned. - * - *

This class can be customized by passing in a custom instance of SpeechSettings to create(). - * For example: - * - *

To customize credentials: - * - *

- * 
- * SpeechSettings speechSettings =
- *     SpeechSettings.newBuilder()
- *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- *         .build();
- * SpeechClient speechClient =
- *     SpeechClient.create(speechSettings);
- * 
- * 
- * - * To customize the endpoint: - * - *
- * 
- * SpeechSettings speechSettings =
- *     SpeechSettings.newBuilder().setEndpoint(myEndpoint).build();
- * SpeechClient speechClient =
- *     SpeechClient.create(speechSettings);
- * 
- * 
- */ -@Generated("by gapic-generator") -@BetaApi -public class SpeechClient implements BackgroundResource { - private final SpeechSettings settings; - private final SpeechStub stub; - private final OperationsClient operationsClient; - - /** Constructs an instance of SpeechClient with default settings. */ - public static final SpeechClient create() throws IOException { - return create(SpeechSettings.newBuilder().build()); - } - - /** - * Constructs an instance of SpeechClient, using the given settings. The channels are created - * based on the settings passed in, or defaults for any settings that are not set. - */ - public static final SpeechClient create(SpeechSettings settings) throws IOException { - return new SpeechClient(settings); - } - - /** - * Constructs an instance of SpeechClient, using the given stub for making calls. This is for - * advanced usage - prefer to use SpeechSettings}. - */ - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public static final SpeechClient create(SpeechStub stub) { - return new SpeechClient(stub); - } - - /** - * Constructs an instance of SpeechClient, using the given settings. This is protected so that it - * is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ - protected SpeechClient(SpeechSettings settings) throws IOException { - this.settings = settings; - this.stub = ((SpeechStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); - } - - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - protected SpeechClient(SpeechStub stub) { - this.settings = null; - this.stub = stub; - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); - } - - public final SpeechSettings getSettings() { - return settings; - } - - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public SpeechStub getStub() { - return stub; - } - - /** - * Returns the OperationsClient that can be used to query the status of a long-running operation - * returned by another API method call. - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationsClient getOperationsClient() { - return operationsClient; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Performs synchronous speech recognition: receive results after all audio has been sent and - * processed. - * - *

Sample code: - * - *


-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
-   *   int sampleRateHertz = 44100;
-   *   String languageCode = "en-US";
-   *   RecognitionConfig config = RecognitionConfig.newBuilder()
-   *     .setEncoding(encoding)
-   *     .setSampleRateHertz(sampleRateHertz)
-   *     .setLanguageCode(languageCode)
-   *     .build();
-   *   String uri = "gs://bucket_name/file_name.flac";
-   *   RecognitionAudio audio = RecognitionAudio.newBuilder()
-   *     .setUri(uri)
-   *     .build();
-   *   RecognizeResponse response = speechClient.recognize(config, audio);
-   * }
-   * 
- * - * @param config Required. Provides information to the recognizer that specifies how to process - * the request. - * @param audio Required. The audio data to be recognized. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final RecognizeResponse recognize(RecognitionConfig config, RecognitionAudio audio) { - RecognizeRequest request = - RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - return recognize(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Performs synchronous speech recognition: receive results after all audio has been sent and - * processed. - * - *

Sample code: - * - *


-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
-   *   int sampleRateHertz = 44100;
-   *   String languageCode = "en-US";
-   *   RecognitionConfig config = RecognitionConfig.newBuilder()
-   *     .setEncoding(encoding)
-   *     .setSampleRateHertz(sampleRateHertz)
-   *     .setLanguageCode(languageCode)
-   *     .build();
-   *   String uri = "gs://bucket_name/file_name.flac";
-   *   RecognitionAudio audio = RecognitionAudio.newBuilder()
-   *     .setUri(uri)
-   *     .build();
-   *   RecognizeRequest request = RecognizeRequest.newBuilder()
-   *     .setConfig(config)
-   *     .setAudio(audio)
-   *     .build();
-   *   RecognizeResponse response = speechClient.recognize(request);
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final RecognizeResponse recognize(RecognizeRequest request) { - return recognizeCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Performs synchronous speech recognition: receive results after all audio has been sent and - * processed. - * - *

Sample code: - * - *


-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
-   *   int sampleRateHertz = 44100;
-   *   String languageCode = "en-US";
-   *   RecognitionConfig config = RecognitionConfig.newBuilder()
-   *     .setEncoding(encoding)
-   *     .setSampleRateHertz(sampleRateHertz)
-   *     .setLanguageCode(languageCode)
-   *     .build();
-   *   String uri = "gs://bucket_name/file_name.flac";
-   *   RecognitionAudio audio = RecognitionAudio.newBuilder()
-   *     .setUri(uri)
-   *     .build();
-   *   RecognizeRequest request = RecognizeRequest.newBuilder()
-   *     .setConfig(config)
-   *     .setAudio(audio)
-   *     .build();
-   *   ApiFuture<RecognizeResponse> future = speechClient.recognizeCallable().futureCall(request);
-   *   // Do something
-   *   RecognizeResponse response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable recognizeCallable() { - return stub.recognizeCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations - * interface. Returns either an `Operation.error` or an `Operation.response` which contains a - * `LongRunningRecognizeResponse` message. For more information on asynchronous speech - * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - * - *

Sample code: - * - *


-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
-   *   int sampleRateHertz = 44100;
-   *   String languageCode = "en-US";
-   *   RecognitionConfig config = RecognitionConfig.newBuilder()
-   *     .setEncoding(encoding)
-   *     .setSampleRateHertz(sampleRateHertz)
-   *     .setLanguageCode(languageCode)
-   *     .build();
-   *   String uri = "gs://bucket_name/file_name.flac";
-   *   RecognitionAudio audio = RecognitionAudio.newBuilder()
-   *     .setUri(uri)
-   *     .build();
-   *   LongRunningRecognizeResponse response = speechClient.longRunningRecognizeAsync(config, audio).get();
-   * }
-   * 
- * - * @param config Required. Provides information to the recognizer that specifies how to process - * the request. - * @param audio Required. The audio data to be recognized. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture - longRunningRecognizeAsync(RecognitionConfig config, RecognitionAudio audio) { - LongRunningRecognizeRequest request = - LongRunningRecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - return longRunningRecognizeAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations - * interface. Returns either an `Operation.error` or an `Operation.response` which contains a - * `LongRunningRecognizeResponse` message. For more information on asynchronous speech - * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - * - *

Sample code: - * - *


-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
-   *   int sampleRateHertz = 44100;
-   *   String languageCode = "en-US";
-   *   RecognitionConfig config = RecognitionConfig.newBuilder()
-   *     .setEncoding(encoding)
-   *     .setSampleRateHertz(sampleRateHertz)
-   *     .setLanguageCode(languageCode)
-   *     .build();
-   *   String uri = "gs://bucket_name/file_name.flac";
-   *   RecognitionAudio audio = RecognitionAudio.newBuilder()
-   *     .setUri(uri)
-   *     .build();
-   *   LongRunningRecognizeRequest request = LongRunningRecognizeRequest.newBuilder()
-   *     .setConfig(config)
-   *     .setAudio(audio)
-   *     .build();
-   *   LongRunningRecognizeResponse response = speechClient.longRunningRecognizeAsync(request).get();
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture - longRunningRecognizeAsync(LongRunningRecognizeRequest request) { - return longRunningRecognizeOperationCallable().futureCall(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations - * interface. Returns either an `Operation.error` or an `Operation.response` which contains a - * `LongRunningRecognizeResponse` message. For more information on asynchronous speech - * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - * - *

Sample code: - * - *


-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
-   *   int sampleRateHertz = 44100;
-   *   String languageCode = "en-US";
-   *   RecognitionConfig config = RecognitionConfig.newBuilder()
-   *     .setEncoding(encoding)
-   *     .setSampleRateHertz(sampleRateHertz)
-   *     .setLanguageCode(languageCode)
-   *     .build();
-   *   String uri = "gs://bucket_name/file_name.flac";
-   *   RecognitionAudio audio = RecognitionAudio.newBuilder()
-   *     .setUri(uri)
-   *     .build();
-   *   LongRunningRecognizeRequest request = LongRunningRecognizeRequest.newBuilder()
-   *     .setConfig(config)
-   *     .setAudio(audio)
-   *     .build();
-   *   OperationFuture<LongRunningRecognizeResponse, LongRunningRecognizeMetadata> future = speechClient.longRunningRecognizeOperationCallable().futureCall(request);
-   *   // Do something
-   *   LongRunningRecognizeResponse response = future.get();
-   * }
-   * 
- */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationCallable() { - return stub.longRunningRecognizeOperationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations - * interface. Returns either an `Operation.error` or an `Operation.response` which contains a - * `LongRunningRecognizeResponse` message. For more information on asynchronous speech - * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - * - *

Sample code: - * - *


-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
-   *   int sampleRateHertz = 44100;
-   *   String languageCode = "en-US";
-   *   RecognitionConfig config = RecognitionConfig.newBuilder()
-   *     .setEncoding(encoding)
-   *     .setSampleRateHertz(sampleRateHertz)
-   *     .setLanguageCode(languageCode)
-   *     .build();
-   *   String uri = "gs://bucket_name/file_name.flac";
-   *   RecognitionAudio audio = RecognitionAudio.newBuilder()
-   *     .setUri(uri)
-   *     .build();
-   *   LongRunningRecognizeRequest request = LongRunningRecognizeRequest.newBuilder()
-   *     .setConfig(config)
-   *     .setAudio(audio)
-   *     .build();
-   *   ApiFuture<Operation> future = speechClient.longRunningRecognizeCallable().futureCall(request);
-   *   // Do something
-   *   Operation response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable - longRunningRecognizeCallable() { - return stub.longRunningRecognizeCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Performs bidirectional streaming speech recognition: receive results while sending audio. This - * method is only available via the gRPC API (not REST). - * - *

Sample code: - * - *


-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   BidiStream<StreamingRecognizeRequest, StreamingRecognizeResponse> bidiStream =
-   *       speechClient.streamingRecognizeCallable().call();
-   *
-   *   StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build();
-   *   bidiStream.send(request);
-   *   for (StreamingRecognizeResponse response : bidiStream) {
-   *     // Do something when receive a response
-   *   }
-   * }
-   * 
- */ - public final BidiStreamingCallable - streamingRecognizeCallable() { - return stub.streamingRecognizeCallable(); - } - - @Override - public final void close() { - stub.close(); - } - - @Override - public void shutdown() { - stub.shutdown(); - } - - @Override - public boolean isShutdown() { - return stub.isShutdown(); - } - - @Override - public boolean isTerminated() { - return stub.isTerminated(); - } - - @Override - public void shutdownNow() { - stub.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return stub.awaitTermination(duration, unit); - } -} diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechSettings.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechSettings.java deleted file mode 100644 index 846574b84..000000000 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechSettings.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.cloud.speech.v1.stub.SpeechStubSettings; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.util.List; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * Settings class to configure an instance of {@link SpeechClient}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (speech.googleapis.com) and default port (443) are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. - * - *

For example, to set the total timeout of recognize to 30 seconds: - * - *

- * 
- * SpeechSettings.Builder speechSettingsBuilder =
- *     SpeechSettings.newBuilder();
- * speechSettingsBuilder
- *     .recognizeSettings()
- *     .setRetrySettings(
- *         speechSettingsBuilder.recognizeSettings().getRetrySettings().toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * SpeechSettings speechSettings = speechSettingsBuilder.build();
- * 
- * 
- */ -@Generated("by gapic-generator") -@BetaApi -public class SpeechSettings extends ClientSettings { - /** Returns the object with the settings used for calls to recognize. */ - public UnaryCallSettings recognizeSettings() { - return ((SpeechStubSettings) getStubSettings()).recognizeSettings(); - } - - /** Returns the object with the settings used for calls to longRunningRecognize. */ - public UnaryCallSettings longRunningRecognizeSettings() { - return ((SpeechStubSettings) getStubSettings()).longRunningRecognizeSettings(); - } - - /** Returns the object with the settings used for calls to longRunningRecognize. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings() { - return ((SpeechStubSettings) getStubSettings()).longRunningRecognizeOperationSettings(); - } - - /** Returns the object with the settings used for calls to streamingRecognize. */ - public StreamingCallSettings - streamingRecognizeSettings() { - return ((SpeechStubSettings) getStubSettings()).streamingRecognizeSettings(); - } - - public static final SpeechSettings create(SpeechStubSettings stub) throws IOException { - return new SpeechSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return SpeechStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return SpeechStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return SpeechStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return SpeechStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return SpeechStubSettings.defaultGrpcTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return SpeechStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return SpeechStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected SpeechSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for SpeechSettings. */ - public static class Builder extends ClientSettings.Builder { - protected Builder() throws IOException { - this((ClientContext) null); - } - - protected Builder(ClientContext clientContext) { - super(SpeechStubSettings.newBuilder(clientContext)); - } - - private static Builder createDefault() { - return new Builder(SpeechStubSettings.newBuilder()); - } - - protected Builder(SpeechSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(SpeechStubSettings.Builder stubSettings) { - super(stubSettings); - } - - public SpeechStubSettings.Builder getStubSettingsBuilder() { - return ((SpeechStubSettings.Builder) getStubSettings()); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - *

Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods( - getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); - return this; - } - - /** Returns the builder for the settings used for calls to recognize. */ - public UnaryCallSettings.Builder recognizeSettings() { - return getStubSettingsBuilder().recognizeSettings(); - } - - /** Returns the builder for the settings used for calls to longRunningRecognize. */ - public UnaryCallSettings.Builder - longRunningRecognizeSettings() { - return getStubSettingsBuilder().longRunningRecognizeSettings(); - } - - /** Returns the builder for the settings used for calls to longRunningRecognize. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings.Builder< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings() { - return getStubSettingsBuilder().longRunningRecognizeOperationSettings(); - } - - /** Returns the builder for the settings used for calls to streamingRecognize. */ - public StreamingCallSettings.Builder - streamingRecognizeSettings() { - return getStubSettingsBuilder().streamingRecognizeSettings(); - } - - @Override - public SpeechSettings build() throws IOException { - return new SpeechSettings(this); - } - } -} diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/package-info.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/package-info.java deleted file mode 100644 index 42cb54546..000000000 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/package-info.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ - -/** - * A client to Cloud Speech-to-Text API. - * - *

The interfaces provided are listed below, along with usage samples. - * - *

============ SpeechClient ============ - * - *

Service Description: Service that implements Google Cloud Speech API. - * - *

Sample for SpeechClient: - * - *

- * 
- * try (SpeechClient speechClient = SpeechClient.create()) {
- *   RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
- *   int sampleRateHertz = 44100;
- *   String languageCode = "en-US";
- *   RecognitionConfig config = RecognitionConfig.newBuilder()
- *     .setEncoding(encoding)
- *     .setSampleRateHertz(sampleRateHertz)
- *     .setLanguageCode(languageCode)
- *     .build();
- *   String uri = "gs://bucket_name/file_name.flac";
- *   RecognitionAudio audio = RecognitionAudio.newBuilder()
- *     .setUri(uri)
- *     .build();
- *   RecognizeResponse response = speechClient.recognize(config, audio);
- * }
- * 
- * 
- */ -@Generated("by gapic-generator") -package com.google.cloud.speech.v1; - -import javax.annotation.Generated; diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechCallableFactory.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechCallableFactory.java deleted file mode 100644 index 650d98bc9..000000000 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechCallableFactory.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * gRPC callable factory implementation for Cloud Speech-to-Text API. - * - *

This class is for advanced usage. - */ -@Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") -public class GrpcSpeechCallableFactory implements GrpcStubCallableFactory { - @Override - public UnaryCallable createUnaryCallable( - GrpcCallSettings grpcCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); - } - - @Override - public - BidiStreamingCallable createBidiStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); - } - - @Override - public - ClientStreamingCallable createClientStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); - } -} diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechStub.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechStub.java deleted file mode 100644 index 052e61ce8..000000000 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechStub.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1.RecognizeRequest; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.StreamingRecognizeRequest; -import com.google.cloud.speech.v1.StreamingRecognizeResponse; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.GrpcOperationsStub; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * gRPC stub implementation for Cloud Speech-to-Text API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") -public class GrpcSpeechStub extends SpeechStub { - - private static final MethodDescriptor - recognizeMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1.Speech/Recognize") - .setRequestMarshaller(ProtoUtils.marshaller(RecognizeRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RecognizeResponse.getDefaultInstance())) - .build(); - private static final MethodDescriptor - longRunningRecognizeMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1.Speech/LongRunningRecognize") - .setRequestMarshaller( - ProtoUtils.marshaller(LongRunningRecognizeRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); - private static final MethodDescriptor - streamingRecognizeMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName("google.cloud.speech.v1.Speech/StreamingRecognize") - .setRequestMarshaller( - ProtoUtils.marshaller(StreamingRecognizeRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(StreamingRecognizeResponse.getDefaultInstance())) - .build(); - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - - private final UnaryCallable recognizeCallable; - private final UnaryCallable longRunningRecognizeCallable; - private final OperationCallable< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationCallable; - private final BidiStreamingCallable - streamingRecognizeCallable; - - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcSpeechStub create(SpeechStubSettings settings) throws IOException { - return new GrpcSpeechStub(settings, ClientContext.create(settings)); - } - - public static final GrpcSpeechStub create(ClientContext clientContext) throws IOException { - return new GrpcSpeechStub(SpeechStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcSpeechStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcSpeechStub( - SpeechStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcSpeechStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ - protected GrpcSpeechStub(SpeechStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcSpeechCallableFactory()); - } - - /** - * Constructs an instance of GrpcSpeechStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ - protected GrpcSpeechStub( - SpeechStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings recognizeTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(recognizeMethodDescriptor) - .build(); - GrpcCallSettings longRunningRecognizeTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(longRunningRecognizeMethodDescriptor) - .build(); - GrpcCallSettings - streamingRecognizeTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(streamingRecognizeMethodDescriptor) - .build(); - - this.recognizeCallable = - callableFactory.createUnaryCallable( - recognizeTransportSettings, settings.recognizeSettings(), clientContext); - this.longRunningRecognizeCallable = - callableFactory.createUnaryCallable( - longRunningRecognizeTransportSettings, - settings.longRunningRecognizeSettings(), - clientContext); - this.longRunningRecognizeOperationCallable = - callableFactory.createOperationCallable( - longRunningRecognizeTransportSettings, - settings.longRunningRecognizeOperationSettings(), - clientContext, - this.operationsStub); - this.streamingRecognizeCallable = - callableFactory.createBidiStreamingCallable( - streamingRecognizeTransportSettings, - settings.streamingRecognizeSettings(), - clientContext); - - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - public UnaryCallable recognizeCallable() { - return recognizeCallable; - } - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationCallable() { - return longRunningRecognizeOperationCallable; - } - - public UnaryCallable longRunningRecognizeCallable() { - return longRunningRecognizeCallable; - } - - public BidiStreamingCallable - streamingRecognizeCallable() { - return streamingRecognizeCallable; - } - - @Override - public final void close() { - shutdown(); - } - - @Override - public void shutdown() { - backgroundResources.shutdown(); - } - - @Override - public boolean isShutdown() { - return backgroundResources.isShutdown(); - } - - @Override - public boolean isTerminated() { - return backgroundResources.isTerminated(); - } - - @Override - public void shutdownNow() { - backgroundResources.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return backgroundResources.awaitTermination(duration, unit); - } -} diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStub.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStub.java deleted file mode 100644 index 9b30d0e3c..000000000 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStub.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1.RecognizeRequest; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.StreamingRecognizeRequest; -import com.google.cloud.speech.v1.StreamingRecognizeResponse; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * Base stub class for Cloud Speech-to-Text API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") -public abstract class SpeechStub implements BackgroundResource { - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationsStub getOperationsStub() { - throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); - } - - public UnaryCallable recognizeCallable() { - throw new UnsupportedOperationException("Not implemented: recognizeCallable()"); - } - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationCallable() { - throw new UnsupportedOperationException( - "Not implemented: longRunningRecognizeOperationCallable()"); - } - - public UnaryCallable longRunningRecognizeCallable() { - throw new UnsupportedOperationException("Not implemented: longRunningRecognizeCallable()"); - } - - public BidiStreamingCallable - streamingRecognizeCallable() { - throw new UnsupportedOperationException("Not implemented: streamingRecognizeCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStubSettings.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStubSettings.java deleted file mode 100644 index 53e520a01..000000000 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStubSettings.java +++ /dev/null @@ -1,393 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1.stub; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.grpc.ProtoOperationTransformers; -import com.google.api.gax.longrunning.OperationSnapshot; -import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1.RecognizeRequest; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.StreamingRecognizeRequest; -import com.google.cloud.speech.v1.StreamingRecognizeResponse; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.util.List; -import javax.annotation.Generated; -import org.threeten.bp.Duration; - -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * Settings class to configure an instance of {@link SpeechStub}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (speech.googleapis.com) and default port (443) are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. - * - *

For example, to set the total timeout of recognize to 30 seconds: - * - *

- * 
- * SpeechStubSettings.Builder speechSettingsBuilder =
- *     SpeechStubSettings.newBuilder();
- * speechSettingsBuilder
- *     .recognizeSettings()
- *     .setRetrySettings(
- *         speechSettingsBuilder.recognizeSettings().getRetrySettings().toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * SpeechStubSettings speechSettings = speechSettingsBuilder.build();
- * 
- * 
- */ -@Generated("by gapic-generator") -@BetaApi -public class SpeechStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); - - private final UnaryCallSettings recognizeSettings; - private final UnaryCallSettings - longRunningRecognizeSettings; - private final OperationCallSettings< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings; - private final StreamingCallSettings - streamingRecognizeSettings; - - /** Returns the object with the settings used for calls to recognize. */ - public UnaryCallSettings recognizeSettings() { - return recognizeSettings; - } - - /** Returns the object with the settings used for calls to longRunningRecognize. */ - public UnaryCallSettings longRunningRecognizeSettings() { - return longRunningRecognizeSettings; - } - - /** Returns the object with the settings used for calls to longRunningRecognize. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings() { - return longRunningRecognizeOperationSettings; - } - - /** Returns the object with the settings used for calls to streamingRecognize. */ - public StreamingCallSettings - streamingRecognizeSettings() { - return streamingRecognizeSettings; - } - - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public SpeechStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcSpeechStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); - } - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return InstantiatingExecutorProvider.newBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return "speech.googleapis.com:443"; - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return DEFAULT_SERVICE_SCOPES; - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); - } - - /** Returns a builder for the default ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SpeechStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected SpeechStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - recognizeSettings = settingsBuilder.recognizeSettings().build(); - longRunningRecognizeSettings = settingsBuilder.longRunningRecognizeSettings().build(); - longRunningRecognizeOperationSettings = - settingsBuilder.longRunningRecognizeOperationSettings().build(); - streamingRecognizeSettings = settingsBuilder.streamingRecognizeSettings().build(); - } - - /** Builder for SpeechStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - - private final UnaryCallSettings.Builder recognizeSettings; - private final UnaryCallSettings.Builder - longRunningRecognizeSettings; - private final OperationCallSettings.Builder< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings; - private final StreamingCallSettings.Builder< - StreamingRecognizeRequest, StreamingRecognizeResponse> - streamingRecognizeSettings; - - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put( - "retry_policy_1_codes", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); - RETRYABLE_CODE_DEFINITIONS = definitions.build(); - } - - private static final ImmutableMap RETRY_PARAM_DEFINITIONS; - - static { - ImmutableMap.Builder definitions = ImmutableMap.builder(); - RetrySettings settings = null; - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(5000000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(5000000L)) - .setTotalTimeout(Duration.ofMillis(5000000L)) - .build(); - definitions.put("retry_policy_1_params", settings); - settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); - definitions.put("no_retry_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(5000000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(5000000L)) - .setTotalTimeout(Duration.ofMillis(5000000L)) - .build(); - definitions.put("no_retry_1_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this((ClientContext) null); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - recognizeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - longRunningRecognizeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - longRunningRecognizeOperationSettings = OperationCallSettings.newBuilder(); - - streamingRecognizeSettings = StreamingCallSettings.newBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - recognizeSettings, longRunningRecognizeSettings); - - initDefaults(this); - } - - private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - - builder - .recognizeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - builder - .longRunningRecognizeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); - builder - .longRunningRecognizeOperationSettings() - .setInitialCallSettings( - UnaryCallSettings - .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) - .build()) - .setResponseTransformer( - ProtoOperationTransformers.ResponseTransformer.create( - LongRunningRecognizeResponse.class)) - .setMetadataTransformer( - ProtoOperationTransformers.MetadataTransformer.create( - LongRunningRecognizeMetadata.class)) - .setPollingAlgorithm( - OperationTimedPollAlgorithm.create( - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) - .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(300000L)) - .build())); - - return builder; - } - - protected Builder(SpeechStubSettings settings) { - super(settings); - - recognizeSettings = settings.recognizeSettings.toBuilder(); - longRunningRecognizeSettings = settings.longRunningRecognizeSettings.toBuilder(); - longRunningRecognizeOperationSettings = - settings.longRunningRecognizeOperationSettings.toBuilder(); - streamingRecognizeSettings = settings.streamingRecognizeSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - recognizeSettings, longRunningRecognizeSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - *

Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); - return this; - } - - public ImmutableList> unaryMethodSettingsBuilders() { - return unaryMethodSettingsBuilders; - } - - /** Returns the builder for the settings used for calls to recognize. */ - public UnaryCallSettings.Builder recognizeSettings() { - return recognizeSettings; - } - - /** Returns the builder for the settings used for calls to longRunningRecognize. */ - public UnaryCallSettings.Builder - longRunningRecognizeSettings() { - return longRunningRecognizeSettings; - } - - /** Returns the builder for the settings used for calls to longRunningRecognize. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings() { - return longRunningRecognizeOperationSettings; - } - - /** Returns the builder for the settings used for calls to streamingRecognize. */ - public StreamingCallSettings.Builder - streamingRecognizeSettings() { - return streamingRecognizeSettings; - } - - @Override - public SpeechStubSettings build() throws IOException { - return new SpeechStubSettings(this); - } - } -} diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechClient.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechClient.java deleted file mode 100644 index a8b4d84d8..000000000 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechClient.java +++ /dev/null @@ -1,495 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1p1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.longrunning.OperationFuture; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1p1beta1.stub.SpeechStub; -import com.google.cloud.speech.v1p1beta1.stub.SpeechStubSettings; -import com.google.longrunning.Operation; -import com.google.longrunning.OperationsClient; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND SERVICE -/** - * Service Description: Service that implements Google Cloud Speech API. - * - *

This class provides the ability to make remote calls to the backing service through method - * calls that map to API methods. Sample code to get started: - * - *

- * 
- * try (SpeechClient speechClient = SpeechClient.create()) {
- *   RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
- *   int sampleRateHertz = 44100;
- *   String languageCode = "en-US";
- *   RecognitionConfig config = RecognitionConfig.newBuilder()
- *     .setEncoding(encoding)
- *     .setSampleRateHertz(sampleRateHertz)
- *     .setLanguageCode(languageCode)
- *     .build();
- *   String uri = "gs://bucket_name/file_name.flac";
- *   RecognitionAudio audio = RecognitionAudio.newBuilder()
- *     .setUri(uri)
- *     .build();
- *   RecognizeResponse response = speechClient.recognize(config, audio);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the speechClient object to clean up resources such as - * threads. In the example above, try-with-resources is used, which automatically calls close(). - * - *

The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
- * - *

See the individual methods for example code. - * - *

Many parameters require resource names to be formatted in a particular way. To assist with - * these names, this class includes a format method for each type of name, and additionally a parse - * method to extract the individual identifiers contained within names that are returned. - * - *

This class can be customized by passing in a custom instance of SpeechSettings to create(). - * For example: - * - *

To customize credentials: - * - *

- * 
- * SpeechSettings speechSettings =
- *     SpeechSettings.newBuilder()
- *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- *         .build();
- * SpeechClient speechClient =
- *     SpeechClient.create(speechSettings);
- * 
- * 
- * - * To customize the endpoint: - * - *
- * 
- * SpeechSettings speechSettings =
- *     SpeechSettings.newBuilder().setEndpoint(myEndpoint).build();
- * SpeechClient speechClient =
- *     SpeechClient.create(speechSettings);
- * 
- * 
- */ -@Generated("by gapic-generator") -@BetaApi -public class SpeechClient implements BackgroundResource { - private final SpeechSettings settings; - private final SpeechStub stub; - private final OperationsClient operationsClient; - - /** Constructs an instance of SpeechClient with default settings. */ - public static final SpeechClient create() throws IOException { - return create(SpeechSettings.newBuilder().build()); - } - - /** - * Constructs an instance of SpeechClient, using the given settings. The channels are created - * based on the settings passed in, or defaults for any settings that are not set. - */ - public static final SpeechClient create(SpeechSettings settings) throws IOException { - return new SpeechClient(settings); - } - - /** - * Constructs an instance of SpeechClient, using the given stub for making calls. This is for - * advanced usage - prefer to use SpeechSettings}. - */ - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public static final SpeechClient create(SpeechStub stub) { - return new SpeechClient(stub); - } - - /** - * Constructs an instance of SpeechClient, using the given settings. This is protected so that it - * is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ - protected SpeechClient(SpeechSettings settings) throws IOException { - this.settings = settings; - this.stub = ((SpeechStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); - } - - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - protected SpeechClient(SpeechStub stub) { - this.settings = null; - this.stub = stub; - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); - } - - public final SpeechSettings getSettings() { - return settings; - } - - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public SpeechStub getStub() { - return stub; - } - - /** - * Returns the OperationsClient that can be used to query the status of a long-running operation - * returned by another API method call. - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationsClient getOperationsClient() { - return operationsClient; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Performs synchronous speech recognition: receive results after all audio has been sent and - * processed. - * - *

Sample code: - * - *


-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
-   *   int sampleRateHertz = 44100;
-   *   String languageCode = "en-US";
-   *   RecognitionConfig config = RecognitionConfig.newBuilder()
-   *     .setEncoding(encoding)
-   *     .setSampleRateHertz(sampleRateHertz)
-   *     .setLanguageCode(languageCode)
-   *     .build();
-   *   String uri = "gs://bucket_name/file_name.flac";
-   *   RecognitionAudio audio = RecognitionAudio.newBuilder()
-   *     .setUri(uri)
-   *     .build();
-   *   RecognizeResponse response = speechClient.recognize(config, audio);
-   * }
-   * 
- * - * @param config Required. Provides information to the recognizer that specifies how to process - * the request. - * @param audio Required. The audio data to be recognized. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final RecognizeResponse recognize(RecognitionConfig config, RecognitionAudio audio) { - RecognizeRequest request = - RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - return recognize(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Performs synchronous speech recognition: receive results after all audio has been sent and - * processed. - * - *

Sample code: - * - *


-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
-   *   int sampleRateHertz = 44100;
-   *   String languageCode = "en-US";
-   *   RecognitionConfig config = RecognitionConfig.newBuilder()
-   *     .setEncoding(encoding)
-   *     .setSampleRateHertz(sampleRateHertz)
-   *     .setLanguageCode(languageCode)
-   *     .build();
-   *   String uri = "gs://bucket_name/file_name.flac";
-   *   RecognitionAudio audio = RecognitionAudio.newBuilder()
-   *     .setUri(uri)
-   *     .build();
-   *   RecognizeRequest request = RecognizeRequest.newBuilder()
-   *     .setConfig(config)
-   *     .setAudio(audio)
-   *     .build();
-   *   RecognizeResponse response = speechClient.recognize(request);
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final RecognizeResponse recognize(RecognizeRequest request) { - return recognizeCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Performs synchronous speech recognition: receive results after all audio has been sent and - * processed. - * - *

Sample code: - * - *


-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
-   *   int sampleRateHertz = 44100;
-   *   String languageCode = "en-US";
-   *   RecognitionConfig config = RecognitionConfig.newBuilder()
-   *     .setEncoding(encoding)
-   *     .setSampleRateHertz(sampleRateHertz)
-   *     .setLanguageCode(languageCode)
-   *     .build();
-   *   String uri = "gs://bucket_name/file_name.flac";
-   *   RecognitionAudio audio = RecognitionAudio.newBuilder()
-   *     .setUri(uri)
-   *     .build();
-   *   RecognizeRequest request = RecognizeRequest.newBuilder()
-   *     .setConfig(config)
-   *     .setAudio(audio)
-   *     .build();
-   *   ApiFuture<RecognizeResponse> future = speechClient.recognizeCallable().futureCall(request);
-   *   // Do something
-   *   RecognizeResponse response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable recognizeCallable() { - return stub.recognizeCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations - * interface. Returns either an `Operation.error` or an `Operation.response` which contains a - * `LongRunningRecognizeResponse` message. For more information on asynchronous speech - * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - * - *

Sample code: - * - *


-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
-   *   int sampleRateHertz = 44100;
-   *   String languageCode = "en-US";
-   *   RecognitionConfig config = RecognitionConfig.newBuilder()
-   *     .setEncoding(encoding)
-   *     .setSampleRateHertz(sampleRateHertz)
-   *     .setLanguageCode(languageCode)
-   *     .build();
-   *   String uri = "gs://bucket_name/file_name.flac";
-   *   RecognitionAudio audio = RecognitionAudio.newBuilder()
-   *     .setUri(uri)
-   *     .build();
-   *   LongRunningRecognizeResponse response = speechClient.longRunningRecognizeAsync(config, audio).get();
-   * }
-   * 
- * - * @param config Required. Provides information to the recognizer that specifies how to process - * the request. - * @param audio Required. The audio data to be recognized. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture - longRunningRecognizeAsync(RecognitionConfig config, RecognitionAudio audio) { - LongRunningRecognizeRequest request = - LongRunningRecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - return longRunningRecognizeAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations - * interface. Returns either an `Operation.error` or an `Operation.response` which contains a - * `LongRunningRecognizeResponse` message. For more information on asynchronous speech - * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - * - *

Sample code: - * - *


-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
-   *   int sampleRateHertz = 44100;
-   *   String languageCode = "en-US";
-   *   RecognitionConfig config = RecognitionConfig.newBuilder()
-   *     .setEncoding(encoding)
-   *     .setSampleRateHertz(sampleRateHertz)
-   *     .setLanguageCode(languageCode)
-   *     .build();
-   *   String uri = "gs://bucket_name/file_name.flac";
-   *   RecognitionAudio audio = RecognitionAudio.newBuilder()
-   *     .setUri(uri)
-   *     .build();
-   *   LongRunningRecognizeRequest request = LongRunningRecognizeRequest.newBuilder()
-   *     .setConfig(config)
-   *     .setAudio(audio)
-   *     .build();
-   *   LongRunningRecognizeResponse response = speechClient.longRunningRecognizeAsync(request).get();
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture - longRunningRecognizeAsync(LongRunningRecognizeRequest request) { - return longRunningRecognizeOperationCallable().futureCall(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations - * interface. Returns either an `Operation.error` or an `Operation.response` which contains a - * `LongRunningRecognizeResponse` message. For more information on asynchronous speech - * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - * - *

Sample code: - * - *


-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
-   *   int sampleRateHertz = 44100;
-   *   String languageCode = "en-US";
-   *   RecognitionConfig config = RecognitionConfig.newBuilder()
-   *     .setEncoding(encoding)
-   *     .setSampleRateHertz(sampleRateHertz)
-   *     .setLanguageCode(languageCode)
-   *     .build();
-   *   String uri = "gs://bucket_name/file_name.flac";
-   *   RecognitionAudio audio = RecognitionAudio.newBuilder()
-   *     .setUri(uri)
-   *     .build();
-   *   LongRunningRecognizeRequest request = LongRunningRecognizeRequest.newBuilder()
-   *     .setConfig(config)
-   *     .setAudio(audio)
-   *     .build();
-   *   OperationFuture<LongRunningRecognizeResponse, LongRunningRecognizeMetadata> future = speechClient.longRunningRecognizeOperationCallable().futureCall(request);
-   *   // Do something
-   *   LongRunningRecognizeResponse response = future.get();
-   * }
-   * 
- */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationCallable() { - return stub.longRunningRecognizeOperationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations - * interface. Returns either an `Operation.error` or an `Operation.response` which contains a - * `LongRunningRecognizeResponse` message. For more information on asynchronous speech - * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - * - *

Sample code: - * - *


-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
-   *   int sampleRateHertz = 44100;
-   *   String languageCode = "en-US";
-   *   RecognitionConfig config = RecognitionConfig.newBuilder()
-   *     .setEncoding(encoding)
-   *     .setSampleRateHertz(sampleRateHertz)
-   *     .setLanguageCode(languageCode)
-   *     .build();
-   *   String uri = "gs://bucket_name/file_name.flac";
-   *   RecognitionAudio audio = RecognitionAudio.newBuilder()
-   *     .setUri(uri)
-   *     .build();
-   *   LongRunningRecognizeRequest request = LongRunningRecognizeRequest.newBuilder()
-   *     .setConfig(config)
-   *     .setAudio(audio)
-   *     .build();
-   *   ApiFuture<Operation> future = speechClient.longRunningRecognizeCallable().futureCall(request);
-   *   // Do something
-   *   Operation response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable - longRunningRecognizeCallable() { - return stub.longRunningRecognizeCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Performs bidirectional streaming speech recognition: receive results while sending audio. This - * method is only available via the gRPC API (not REST). - * - *

Sample code: - * - *


-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   BidiStream<StreamingRecognizeRequest, StreamingRecognizeResponse> bidiStream =
-   *       speechClient.streamingRecognizeCallable().call();
-   *
-   *   StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build();
-   *   bidiStream.send(request);
-   *   for (StreamingRecognizeResponse response : bidiStream) {
-   *     // Do something when receive a response
-   *   }
-   * }
-   * 
- */ - public final BidiStreamingCallable - streamingRecognizeCallable() { - return stub.streamingRecognizeCallable(); - } - - @Override - public final void close() { - stub.close(); - } - - @Override - public void shutdown() { - stub.shutdown(); - } - - @Override - public boolean isShutdown() { - return stub.isShutdown(); - } - - @Override - public boolean isTerminated() { - return stub.isTerminated(); - } - - @Override - public void shutdownNow() { - stub.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return stub.awaitTermination(duration, unit); - } -} diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechSettings.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechSettings.java deleted file mode 100644 index 3c267fac2..000000000 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechSettings.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1p1beta1; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.cloud.speech.v1p1beta1.stub.SpeechStubSettings; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.util.List; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * Settings class to configure an instance of {@link SpeechClient}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (speech.googleapis.com) and default port (443) are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. - * - *

For example, to set the total timeout of recognize to 30 seconds: - * - *

- * 
- * SpeechSettings.Builder speechSettingsBuilder =
- *     SpeechSettings.newBuilder();
- * speechSettingsBuilder
- *     .recognizeSettings()
- *     .setRetrySettings(
- *         speechSettingsBuilder.recognizeSettings().getRetrySettings().toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * SpeechSettings speechSettings = speechSettingsBuilder.build();
- * 
- * 
- */ -@Generated("by gapic-generator") -@BetaApi -public class SpeechSettings extends ClientSettings { - /** Returns the object with the settings used for calls to recognize. */ - public UnaryCallSettings recognizeSettings() { - return ((SpeechStubSettings) getStubSettings()).recognizeSettings(); - } - - /** Returns the object with the settings used for calls to longRunningRecognize. */ - public UnaryCallSettings longRunningRecognizeSettings() { - return ((SpeechStubSettings) getStubSettings()).longRunningRecognizeSettings(); - } - - /** Returns the object with the settings used for calls to longRunningRecognize. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings() { - return ((SpeechStubSettings) getStubSettings()).longRunningRecognizeOperationSettings(); - } - - /** Returns the object with the settings used for calls to streamingRecognize. */ - public StreamingCallSettings - streamingRecognizeSettings() { - return ((SpeechStubSettings) getStubSettings()).streamingRecognizeSettings(); - } - - public static final SpeechSettings create(SpeechStubSettings stub) throws IOException { - return new SpeechSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return SpeechStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return SpeechStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return SpeechStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return SpeechStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return SpeechStubSettings.defaultGrpcTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return SpeechStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return SpeechStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected SpeechSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for SpeechSettings. */ - public static class Builder extends ClientSettings.Builder { - protected Builder() throws IOException { - this((ClientContext) null); - } - - protected Builder(ClientContext clientContext) { - super(SpeechStubSettings.newBuilder(clientContext)); - } - - private static Builder createDefault() { - return new Builder(SpeechStubSettings.newBuilder()); - } - - protected Builder(SpeechSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(SpeechStubSettings.Builder stubSettings) { - super(stubSettings); - } - - public SpeechStubSettings.Builder getStubSettingsBuilder() { - return ((SpeechStubSettings.Builder) getStubSettings()); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - *

Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods( - getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); - return this; - } - - /** Returns the builder for the settings used for calls to recognize. */ - public UnaryCallSettings.Builder recognizeSettings() { - return getStubSettingsBuilder().recognizeSettings(); - } - - /** Returns the builder for the settings used for calls to longRunningRecognize. */ - public UnaryCallSettings.Builder - longRunningRecognizeSettings() { - return getStubSettingsBuilder().longRunningRecognizeSettings(); - } - - /** Returns the builder for the settings used for calls to longRunningRecognize. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings.Builder< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings() { - return getStubSettingsBuilder().longRunningRecognizeOperationSettings(); - } - - /** Returns the builder for the settings used for calls to streamingRecognize. */ - public StreamingCallSettings.Builder - streamingRecognizeSettings() { - return getStubSettingsBuilder().streamingRecognizeSettings(); - } - - @Override - public SpeechSettings build() throws IOException { - return new SpeechSettings(this); - } - } -} diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/package-info.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/package-info.java deleted file mode 100644 index d8ee877cf..000000000 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/package-info.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ - -/** - * A client to Cloud Speech-to-Text API. - * - *

The interfaces provided are listed below, along with usage samples. - * - *

============ SpeechClient ============ - * - *

Service Description: Service that implements Google Cloud Speech API. - * - *

Sample for SpeechClient: - * - *

- * 
- * try (SpeechClient speechClient = SpeechClient.create()) {
- *   RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
- *   int sampleRateHertz = 44100;
- *   String languageCode = "en-US";
- *   RecognitionConfig config = RecognitionConfig.newBuilder()
- *     .setEncoding(encoding)
- *     .setSampleRateHertz(sampleRateHertz)
- *     .setLanguageCode(languageCode)
- *     .build();
- *   String uri = "gs://bucket_name/file_name.flac";
- *   RecognitionAudio audio = RecognitionAudio.newBuilder()
- *     .setUri(uri)
- *     .build();
- *   RecognizeResponse response = speechClient.recognize(config, audio);
- * }
- * 
- * 
- */ -@Generated("by gapic-generator") -package com.google.cloud.speech.v1p1beta1; - -import javax.annotation.Generated; diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechCallableFactory.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechCallableFactory.java deleted file mode 100644 index 070912143..000000000 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechCallableFactory.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1p1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * gRPC callable factory implementation for Cloud Speech-to-Text API. - * - *

This class is for advanced usage. - */ -@Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") -public class GrpcSpeechCallableFactory implements GrpcStubCallableFactory { - @Override - public UnaryCallable createUnaryCallable( - GrpcCallSettings grpcCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); - } - - @Override - public - BidiStreamingCallable createBidiStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); - } - - @Override - public - ClientStreamingCallable createClientStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); - } -} diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechStub.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechStub.java deleted file mode 100644 index 8a080848a..000000000 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechStub.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1p1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1p1beta1.RecognizeRequest; -import com.google.cloud.speech.v1p1beta1.RecognizeResponse; -import com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest; -import com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.GrpcOperationsStub; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * gRPC stub implementation for Cloud Speech-to-Text API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") -public class GrpcSpeechStub extends SpeechStub { - - private static final MethodDescriptor - recognizeMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1p1beta1.Speech/Recognize") - .setRequestMarshaller(ProtoUtils.marshaller(RecognizeRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RecognizeResponse.getDefaultInstance())) - .build(); - private static final MethodDescriptor - longRunningRecognizeMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1p1beta1.Speech/LongRunningRecognize") - .setRequestMarshaller( - ProtoUtils.marshaller(LongRunningRecognizeRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); - private static final MethodDescriptor - streamingRecognizeMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName("google.cloud.speech.v1p1beta1.Speech/StreamingRecognize") - .setRequestMarshaller( - ProtoUtils.marshaller(StreamingRecognizeRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(StreamingRecognizeResponse.getDefaultInstance())) - .build(); - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - - private final UnaryCallable recognizeCallable; - private final UnaryCallable longRunningRecognizeCallable; - private final OperationCallable< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationCallable; - private final BidiStreamingCallable - streamingRecognizeCallable; - - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcSpeechStub create(SpeechStubSettings settings) throws IOException { - return new GrpcSpeechStub(settings, ClientContext.create(settings)); - } - - public static final GrpcSpeechStub create(ClientContext clientContext) throws IOException { - return new GrpcSpeechStub(SpeechStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcSpeechStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcSpeechStub( - SpeechStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcSpeechStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ - protected GrpcSpeechStub(SpeechStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcSpeechCallableFactory()); - } - - /** - * Constructs an instance of GrpcSpeechStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ - protected GrpcSpeechStub( - SpeechStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings recognizeTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(recognizeMethodDescriptor) - .build(); - GrpcCallSettings longRunningRecognizeTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(longRunningRecognizeMethodDescriptor) - .build(); - GrpcCallSettings - streamingRecognizeTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(streamingRecognizeMethodDescriptor) - .build(); - - this.recognizeCallable = - callableFactory.createUnaryCallable( - recognizeTransportSettings, settings.recognizeSettings(), clientContext); - this.longRunningRecognizeCallable = - callableFactory.createUnaryCallable( - longRunningRecognizeTransportSettings, - settings.longRunningRecognizeSettings(), - clientContext); - this.longRunningRecognizeOperationCallable = - callableFactory.createOperationCallable( - longRunningRecognizeTransportSettings, - settings.longRunningRecognizeOperationSettings(), - clientContext, - this.operationsStub); - this.streamingRecognizeCallable = - callableFactory.createBidiStreamingCallable( - streamingRecognizeTransportSettings, - settings.streamingRecognizeSettings(), - clientContext); - - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - public UnaryCallable recognizeCallable() { - return recognizeCallable; - } - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationCallable() { - return longRunningRecognizeOperationCallable; - } - - public UnaryCallable longRunningRecognizeCallable() { - return longRunningRecognizeCallable; - } - - public BidiStreamingCallable - streamingRecognizeCallable() { - return streamingRecognizeCallable; - } - - @Override - public final void close() { - shutdown(); - } - - @Override - public void shutdown() { - backgroundResources.shutdown(); - } - - @Override - public boolean isShutdown() { - return backgroundResources.isShutdown(); - } - - @Override - public boolean isTerminated() { - return backgroundResources.isTerminated(); - } - - @Override - public void shutdownNow() { - backgroundResources.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return backgroundResources.awaitTermination(duration, unit); - } -} diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStub.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStub.java deleted file mode 100644 index 99baa38c8..000000000 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStub.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1p1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1p1beta1.RecognizeRequest; -import com.google.cloud.speech.v1p1beta1.RecognizeResponse; -import com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest; -import com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * Base stub class for Cloud Speech-to-Text API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") -public abstract class SpeechStub implements BackgroundResource { - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationsStub getOperationsStub() { - throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); - } - - public UnaryCallable recognizeCallable() { - throw new UnsupportedOperationException("Not implemented: recognizeCallable()"); - } - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationCallable() { - throw new UnsupportedOperationException( - "Not implemented: longRunningRecognizeOperationCallable()"); - } - - public UnaryCallable longRunningRecognizeCallable() { - throw new UnsupportedOperationException("Not implemented: longRunningRecognizeCallable()"); - } - - public BidiStreamingCallable - streamingRecognizeCallable() { - throw new UnsupportedOperationException("Not implemented: streamingRecognizeCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStubSettings.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStubSettings.java deleted file mode 100644 index 83e1291b2..000000000 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStubSettings.java +++ /dev/null @@ -1,393 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1p1beta1.stub; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.grpc.ProtoOperationTransformers; -import com.google.api.gax.longrunning.OperationSnapshot; -import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1p1beta1.RecognizeRequest; -import com.google.cloud.speech.v1p1beta1.RecognizeResponse; -import com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest; -import com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.util.List; -import javax.annotation.Generated; -import org.threeten.bp.Duration; - -// AUTO-GENERATED DOCUMENTATION AND CLASS -/** - * Settings class to configure an instance of {@link SpeechStub}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (speech.googleapis.com) and default port (443) are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. - * - *

For example, to set the total timeout of recognize to 30 seconds: - * - *

- * 
- * SpeechStubSettings.Builder speechSettingsBuilder =
- *     SpeechStubSettings.newBuilder();
- * speechSettingsBuilder
- *     .recognizeSettings()
- *     .setRetrySettings(
- *         speechSettingsBuilder.recognizeSettings().getRetrySettings().toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * SpeechStubSettings speechSettings = speechSettingsBuilder.build();
- * 
- * 
- */ -@Generated("by gapic-generator") -@BetaApi -public class SpeechStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); - - private final UnaryCallSettings recognizeSettings; - private final UnaryCallSettings - longRunningRecognizeSettings; - private final OperationCallSettings< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings; - private final StreamingCallSettings - streamingRecognizeSettings; - - /** Returns the object with the settings used for calls to recognize. */ - public UnaryCallSettings recognizeSettings() { - return recognizeSettings; - } - - /** Returns the object with the settings used for calls to longRunningRecognize. */ - public UnaryCallSettings longRunningRecognizeSettings() { - return longRunningRecognizeSettings; - } - - /** Returns the object with the settings used for calls to longRunningRecognize. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings() { - return longRunningRecognizeOperationSettings; - } - - /** Returns the object with the settings used for calls to streamingRecognize. */ - public StreamingCallSettings - streamingRecognizeSettings() { - return streamingRecognizeSettings; - } - - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") - public SpeechStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcSpeechStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); - } - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return InstantiatingExecutorProvider.newBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return "speech.googleapis.com:443"; - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return DEFAULT_SERVICE_SCOPES; - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); - } - - /** Returns a builder for the default ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SpeechStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected SpeechStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - recognizeSettings = settingsBuilder.recognizeSettings().build(); - longRunningRecognizeSettings = settingsBuilder.longRunningRecognizeSettings().build(); - longRunningRecognizeOperationSettings = - settingsBuilder.longRunningRecognizeOperationSettings().build(); - streamingRecognizeSettings = settingsBuilder.streamingRecognizeSettings().build(); - } - - /** Builder for SpeechStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - - private final UnaryCallSettings.Builder recognizeSettings; - private final UnaryCallSettings.Builder - longRunningRecognizeSettings; - private final OperationCallSettings.Builder< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings; - private final StreamingCallSettings.Builder< - StreamingRecognizeRequest, StreamingRecognizeResponse> - streamingRecognizeSettings; - - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put( - "retry_policy_1_codes", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); - RETRYABLE_CODE_DEFINITIONS = definitions.build(); - } - - private static final ImmutableMap RETRY_PARAM_DEFINITIONS; - - static { - ImmutableMap.Builder definitions = ImmutableMap.builder(); - RetrySettings settings = null; - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(5000000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(5000000L)) - .setTotalTimeout(Duration.ofMillis(5000000L)) - .build(); - definitions.put("retry_policy_1_params", settings); - settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); - definitions.put("no_retry_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(5000000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(5000000L)) - .setTotalTimeout(Duration.ofMillis(5000000L)) - .build(); - definitions.put("no_retry_1_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this((ClientContext) null); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - recognizeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - longRunningRecognizeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - longRunningRecognizeOperationSettings = OperationCallSettings.newBuilder(); - - streamingRecognizeSettings = StreamingCallSettings.newBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - recognizeSettings, longRunningRecognizeSettings); - - initDefaults(this); - } - - private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - - builder - .recognizeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - builder - .longRunningRecognizeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); - builder - .longRunningRecognizeOperationSettings() - .setInitialCallSettings( - UnaryCallSettings - .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) - .build()) - .setResponseTransformer( - ProtoOperationTransformers.ResponseTransformer.create( - LongRunningRecognizeResponse.class)) - .setMetadataTransformer( - ProtoOperationTransformers.MetadataTransformer.create( - LongRunningRecognizeMetadata.class)) - .setPollingAlgorithm( - OperationTimedPollAlgorithm.create( - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) - .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(300000L)) - .build())); - - return builder; - } - - protected Builder(SpeechStubSettings settings) { - super(settings); - - recognizeSettings = settings.recognizeSettings.toBuilder(); - longRunningRecognizeSettings = settings.longRunningRecognizeSettings.toBuilder(); - longRunningRecognizeOperationSettings = - settings.longRunningRecognizeOperationSettings.toBuilder(); - streamingRecognizeSettings = settings.streamingRecognizeSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - recognizeSettings, longRunningRecognizeSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - *

Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { - super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); - return this; - } - - public ImmutableList> unaryMethodSettingsBuilders() { - return unaryMethodSettingsBuilders; - } - - /** Returns the builder for the settings used for calls to recognize. */ - public UnaryCallSettings.Builder recognizeSettings() { - return recognizeSettings; - } - - /** Returns the builder for the settings used for calls to longRunningRecognize. */ - public UnaryCallSettings.Builder - longRunningRecognizeSettings() { - return longRunningRecognizeSettings; - } - - /** Returns the builder for the settings used for calls to longRunningRecognize. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings() { - return longRunningRecognizeOperationSettings; - } - - /** Returns the builder for the settings used for calls to streamingRecognize. */ - public StreamingCallSettings.Builder - streamingRecognizeSettings() { - return streamingRecognizeSettings; - } - - @Override - public SpeechStubSettings build() throws IOException { - return new SpeechStubSettings(this); - } - } -} diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeech.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeech.java deleted file mode 100644 index 3cc33c7e5..000000000 --- a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeech.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; - -@javax.annotation.Generated("by GAPIC") -@BetaApi -public class MockSpeech implements MockGrpcService { - private final MockSpeechImpl serviceImpl; - - public MockSpeech() { - serviceImpl = new MockSpeechImpl(); - } - - @Override - public List getRequests() { - return serviceImpl.getRequests(); - } - - @Override - public void addResponse(AbstractMessage response) { - serviceImpl.addResponse(response); - } - - @Override - public void addException(Exception exception) { - serviceImpl.addException(exception); - } - - @Override - public ServerServiceDefinition getServiceDefinition() { - return serviceImpl.bindService(); - } - - @Override - public void reset() { - serviceImpl.reset(); - } -} diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeechImpl.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeechImpl.java deleted file mode 100644 index 695c51722..000000000 --- a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeechImpl.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1; - -import com.google.api.core.BetaApi; -import com.google.cloud.speech.v1.SpeechGrpc.SpeechImplBase; -import com.google.longrunning.Operation; -import com.google.protobuf.AbstractMessage; -import io.grpc.stub.StreamObserver; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Queue; - -@javax.annotation.Generated("by GAPIC") -@BetaApi -public class MockSpeechImpl extends SpeechImplBase { - private List requests; - private Queue responses; - - public MockSpeechImpl() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - public List getRequests() { - return requests; - } - - public void addResponse(AbstractMessage response) { - responses.add(response); - } - - public void setResponses(List responses) { - this.responses = new LinkedList(responses); - } - - public void addException(Exception exception) { - responses.add(exception); - } - - public void reset() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - @Override - public void recognize( - RecognizeRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); - if (response instanceof RecognizeResponse) { - requests.add(request); - responseObserver.onNext((RecognizeResponse) response); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); - } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); - } - } - - @Override - public void longRunningRecognize( - LongRunningRecognizeRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); - if (response instanceof Operation) { - requests.add(request); - responseObserver.onNext((Operation) response); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); - } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); - } - } - - @Override - public StreamObserver streamingRecognize( - final StreamObserver responseObserver) { - StreamObserver requestObserver = - new StreamObserver() { - @Override - public void onNext(StreamingRecognizeRequest value) { - requests.add(value); - final Object response = responses.remove(); - if (response instanceof StreamingRecognizeResponse) { - responseObserver.onNext((StreamingRecognizeResponse) response); - } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); - } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); - } - } - - @Override - public void onError(Throwable t) { - responseObserver.onError(t); - } - - @Override - public void onCompleted() { - responseObserver.onCompleted(); - } - }; - return requestObserver; - } -} diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientTest.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientTest.java deleted file mode 100644 index 9e5203488..000000000 --- a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientTest.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.testing.LocalChannelProvider; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.api.gax.grpc.testing.MockServiceHelper; -import com.google.api.gax.grpc.testing.MockStreamObserver; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiStreamObserver; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.longrunning.Operation; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Any; -import io.grpc.Status; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import java.util.concurrent.ExecutionException; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@javax.annotation.Generated("by GAPIC") -public class SpeechClientTest { - private static MockSpeech mockSpeech; - private static MockServiceHelper serviceHelper; - private SpeechClient client; - private LocalChannelProvider channelProvider; - - @BeforeClass - public static void startStaticServer() { - mockSpeech = new MockSpeech(); - serviceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockSpeech)); - serviceHelper.start(); - } - - @AfterClass - public static void stopServer() { - serviceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); - SpeechSettings settings = - SpeechSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = SpeechClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - @SuppressWarnings("all") - public void recognizeTest() { - RecognizeResponse expectedResponse = RecognizeResponse.newBuilder().build(); - mockSpeech.addResponse(expectedResponse); - - RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC; - int sampleRateHertz = 44100; - String languageCode = "en-US"; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(encoding) - .setSampleRateHertz(sampleRateHertz) - .setLanguageCode(languageCode) - .build(); - String uri = "gs://bucket_name/file_name.flac"; - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(uri).build(); - - RecognizeResponse actualResponse = client.recognize(config, audio); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSpeech.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RecognizeRequest actualRequest = (RecognizeRequest) actualRequests.get(0); - - Assert.assertEquals(config, actualRequest.getConfig()); - Assert.assertEquals(audio, actualRequest.getAudio()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void recognizeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockSpeech.addException(exception); - - try { - RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC; - int sampleRateHertz = 44100; - String languageCode = "en-US"; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(encoding) - .setSampleRateHertz(sampleRateHertz) - .setLanguageCode(languageCode) - .build(); - String uri = "gs://bucket_name/file_name.flac"; - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(uri).build(); - - client.recognize(config, audio); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void longRunningRecognizeTest() throws Exception { - LongRunningRecognizeResponse expectedResponse = - LongRunningRecognizeResponse.newBuilder().build(); - Operation resultOperation = - Operation.newBuilder() - .setName("longRunningRecognizeTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockSpeech.addResponse(resultOperation); - - RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC; - int sampleRateHertz = 44100; - String languageCode = "en-US"; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(encoding) - .setSampleRateHertz(sampleRateHertz) - .setLanguageCode(languageCode) - .build(); - String uri = "gs://bucket_name/file_name.flac"; - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(uri).build(); - - LongRunningRecognizeResponse actualResponse = - client.longRunningRecognizeAsync(config, audio).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSpeech.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - LongRunningRecognizeRequest actualRequest = (LongRunningRecognizeRequest) actualRequests.get(0); - - Assert.assertEquals(config, actualRequest.getConfig()); - Assert.assertEquals(audio, actualRequest.getAudio()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void longRunningRecognizeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockSpeech.addException(exception); - - try { - RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC; - int sampleRateHertz = 44100; - String languageCode = "en-US"; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(encoding) - .setSampleRateHertz(sampleRateHertz) - .setLanguageCode(languageCode) - .build(); - String uri = "gs://bucket_name/file_name.flac"; - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(uri).build(); - - client.longRunningRecognizeAsync(config, audio).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - @SuppressWarnings("all") - public void streamingRecognizeTest() throws Exception { - StreamingRecognizeResponse expectedResponse = StreamingRecognizeResponse.newBuilder().build(); - mockSpeech.addResponse(expectedResponse); - StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = - client.streamingRecognizeCallable(); - ApiStreamObserver requestObserver = - callable.bidiStreamingCall(responseObserver); - - requestObserver.onNext(request); - requestObserver.onCompleted(); - - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); - } - - @Test - @SuppressWarnings("all") - public void streamingRecognizeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockSpeech.addException(exception); - StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = - client.streamingRecognizeCallable(); - ApiStreamObserver requestObserver = - callable.bidiStreamingCall(responseObserver); - - requestObserver.onNext(request); - - try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } -} diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechSmokeTest.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechSmokeTest.java deleted file mode 100644 index 7696fc580..000000000 --- a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechSmokeTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1; - -import com.google.common.base.Preconditions; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.junit.Assume; -import org.junit.Test; - -@javax.annotation.Generated("by GAPIC") -public class SpeechSmokeTest { - private static final String PROJECT_ENV_NAME = "GOOGLE_CLOUD_PROJECT"; - private static final String LEGACY_PROJECT_ENV_NAME = "GCLOUD_PROJECT"; - - @Test - public void run() { - // Skip smoke tests if running in VPCSC because our V1 integration tests - // cover VPC-SC. - Assume.assumeTrue(System.getenv("GOOGLE_CLOUD_TESTS_IN_VPCSC") == null); - main(null); - } - - public static void main(String args[]) { - Logger.getLogger("").setLevel(Level.WARNING); - try { - executeNoCatch(); - System.out.println("OK"); - } catch (Exception e) { - System.err.println("Failed with exception:"); - e.printStackTrace(System.err); - System.exit(1); - } - } - - public static void executeNoCatch() throws Exception { - try (SpeechClient client = SpeechClient.create()) { - String languageCode = "en-US"; - int sampleRateHertz = 44100; - RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setLanguageCode(languageCode) - .setSampleRateHertz(sampleRateHertz) - .setEncoding(encoding) - .build(); - String uri = "gs://cloud-samples-data/speech/brooklyn_bridge.flac"; - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(uri).build(); - - RecognizeResponse response = client.recognize(config, audio); - } - } - - private static String getProjectId() { - String projectId = System.getProperty(PROJECT_ENV_NAME, System.getenv(PROJECT_ENV_NAME)); - if (projectId == null) { - projectId = - System.getProperty(LEGACY_PROJECT_ENV_NAME, System.getenv(LEGACY_PROJECT_ENV_NAME)); - } - Preconditions.checkArgument(projectId != null, "A project ID is required."); - return projectId; - } -} diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/it/ITSpeechTest.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/it/ITSpeechTest.java deleted file mode 100644 index 73546ae21..000000000 --- a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/it/ITSpeechTest.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright 2017 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.speech.v1.it; - -import com.google.api.gax.rpc.ApiStreamObserver; -import com.google.cloud.speech.v1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.StreamingRecognitionConfig; -import com.google.cloud.speech.v1.StreamingRecognizeRequest; -import com.google.cloud.speech.v1.StreamingRecognizeResponse; -import com.google.common.truth.Truth; -import com.google.common.util.concurrent.SettableFuture; -import com.google.protobuf.ByteString; -import java.util.List; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.Timeout; - -public class ITSpeechTest { - private static SpeechClient speechClient; - - @Rule public Timeout globalTimeout = Timeout.seconds(300); - - @BeforeClass - public static void setupClass() throws Exception { - speechClient = SpeechClient.create(); - } - - @AfterClass - public static void tearDownClass() throws Exception { - speechClient.close(); - } - - @Test - public void syncRecognize() { - RecognizeResponse response = speechClient.recognize(config(2), audio()); - - Truth.assertThat(response.getResultsCount()).isGreaterThan(0); - Truth.assertThat(response.getResults(0).getAlternativesCount()).isGreaterThan(0); - String text = response.getResults(0).getAlternatives(0).getTranscript(); - Truth.assertThat(text).isEqualTo("hello"); - } - - @Test - public void longrunningRecognize() throws Exception { - LongRunningRecognizeResponse response = - speechClient.longRunningRecognizeAsync(config(2), audio()).get(); - - Truth.assertThat(response.getResultsCount()).isGreaterThan(0); - Truth.assertThat(response.getResults(0).getAlternativesCount()).isGreaterThan(0); - String text = response.getResults(0).getAlternatives(0).getTranscript(); - Truth.assertThat(text).isEqualTo("hello"); - } - - @Test - public void streamingRecognize() throws Exception { - byte[] audioBytes = - ByteString.readFrom(getClass().getClassLoader().getResourceAsStream("hello.flac")) - .toByteArray(); - - StreamingRecognitionConfig streamingConfig = - StreamingRecognitionConfig.newBuilder().setConfig(config(1)).build(); - - ResponseApiStreamingObserver responseObserver = - new ResponseApiStreamingObserver<>(); - - ApiStreamObserver requestObserver = - speechClient.streamingRecognizeCallable().bidiStreamingCall(responseObserver); - - // The first request must **only** contain the audio configuration: - requestObserver.onNext( - StreamingRecognizeRequest.newBuilder().setStreamingConfig(streamingConfig).build()); - - // Subsequent requests must **only** contain the audio data. - requestObserver.onNext( - StreamingRecognizeRequest.newBuilder() - .setAudioContent(ByteString.copyFrom(audioBytes)) - .build()); - - // Mark transmission as completed after sending the data. - requestObserver.onCompleted(); - - List responses = responseObserver.future().get(); - - Truth.assertThat(responses.size()).isGreaterThan(0); - Truth.assertThat(responses.get(0).getResultsCount()).isGreaterThan(0); - Truth.assertThat(responses.get(0).getResults(0).getAlternativesCount()).isGreaterThan(0); - String text = responses.get(0).getResults(0).getAlternatives(0).getTranscript(); - Truth.assertThat(text).isEqualTo("hello"); - } - - private static class ResponseApiStreamingObserver implements ApiStreamObserver { - private final SettableFuture> future = SettableFuture.create(); - private final List messages = new java.util.ArrayList(); - - @Override - public void onNext(T message) { - messages.add(message); - } - - @Override - public void onError(Throwable t) { - future.setException(t); - } - - @Override - public void onCompleted() { - future.set(messages); - } - - // Returns the SettableFuture object to get received messages / exceptions. - public SettableFuture> future() { - return future; - } - } - - private RecognitionConfig config(int channels) { - String languageCode = "en-US"; - int sampleRateHertz = 44100; - RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setLanguageCode(languageCode) - .setSampleRateHertz(sampleRateHertz) - .setEncoding(encoding) - .setAudioChannelCount(channels) - .build(); - return config; - } - - public RecognitionAudio audio() { - String audio_gcs_uri = System.getenv("AUDIO_GCS_URI"); - if (audio_gcs_uri != null) { - return RecognitionAudio.newBuilder().setUri(audio_gcs_uri).build(); - } - return RecognitionAudio.newBuilder() - .setUri("gs://cloud-samples-data/speech/hello.flac") - .build(); - } -} diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeech.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeech.java deleted file mode 100644 index 59612e211..000000000 --- a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeech.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1p1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; - -@javax.annotation.Generated("by GAPIC") -@BetaApi -public class MockSpeech implements MockGrpcService { - private final MockSpeechImpl serviceImpl; - - public MockSpeech() { - serviceImpl = new MockSpeechImpl(); - } - - @Override - public List getRequests() { - return serviceImpl.getRequests(); - } - - @Override - public void addResponse(AbstractMessage response) { - serviceImpl.addResponse(response); - } - - @Override - public void addException(Exception exception) { - serviceImpl.addException(exception); - } - - @Override - public ServerServiceDefinition getServiceDefinition() { - return serviceImpl.bindService(); - } - - @Override - public void reset() { - serviceImpl.reset(); - } -} diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeechImpl.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeechImpl.java deleted file mode 100644 index d052cdf11..000000000 --- a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeechImpl.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1p1beta1; - -import com.google.api.core.BetaApi; -import com.google.cloud.speech.v1p1beta1.SpeechGrpc.SpeechImplBase; -import com.google.longrunning.Operation; -import com.google.protobuf.AbstractMessage; -import io.grpc.stub.StreamObserver; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Queue; - -@javax.annotation.Generated("by GAPIC") -@BetaApi -public class MockSpeechImpl extends SpeechImplBase { - private List requests; - private Queue responses; - - public MockSpeechImpl() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - public List getRequests() { - return requests; - } - - public void addResponse(AbstractMessage response) { - responses.add(response); - } - - public void setResponses(List responses) { - this.responses = new LinkedList(responses); - } - - public void addException(Exception exception) { - responses.add(exception); - } - - public void reset() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - @Override - public void recognize( - RecognizeRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); - if (response instanceof RecognizeResponse) { - requests.add(request); - responseObserver.onNext((RecognizeResponse) response); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); - } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); - } - } - - @Override - public void longRunningRecognize( - LongRunningRecognizeRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); - if (response instanceof Operation) { - requests.add(request); - responseObserver.onNext((Operation) response); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); - } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); - } - } - - @Override - public StreamObserver streamingRecognize( - final StreamObserver responseObserver) { - StreamObserver requestObserver = - new StreamObserver() { - @Override - public void onNext(StreamingRecognizeRequest value) { - requests.add(value); - final Object response = responses.remove(); - if (response instanceof StreamingRecognizeResponse) { - responseObserver.onNext((StreamingRecognizeResponse) response); - } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); - } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); - } - } - - @Override - public void onError(Throwable t) { - responseObserver.onError(t); - } - - @Override - public void onCompleted() { - responseObserver.onCompleted(); - } - }; - return requestObserver; - } -} diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java deleted file mode 100644 index 5e85a52e7..000000000 --- a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1p1beta1; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.testing.LocalChannelProvider; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.api.gax.grpc.testing.MockServiceHelper; -import com.google.api.gax.grpc.testing.MockStreamObserver; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiStreamObserver; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.longrunning.Operation; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Any; -import io.grpc.Status; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import java.util.concurrent.ExecutionException; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@javax.annotation.Generated("by GAPIC") -public class SpeechClientTest { - private static MockSpeech mockSpeech; - private static MockServiceHelper serviceHelper; - private SpeechClient client; - private LocalChannelProvider channelProvider; - - @BeforeClass - public static void startStaticServer() { - mockSpeech = new MockSpeech(); - serviceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockSpeech)); - serviceHelper.start(); - } - - @AfterClass - public static void stopServer() { - serviceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); - SpeechSettings settings = - SpeechSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = SpeechClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - @SuppressWarnings("all") - public void recognizeTest() { - RecognizeResponse expectedResponse = RecognizeResponse.newBuilder().build(); - mockSpeech.addResponse(expectedResponse); - - RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC; - int sampleRateHertz = 44100; - String languageCode = "en-US"; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(encoding) - .setSampleRateHertz(sampleRateHertz) - .setLanguageCode(languageCode) - .build(); - String uri = "gs://bucket_name/file_name.flac"; - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(uri).build(); - - RecognizeResponse actualResponse = client.recognize(config, audio); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSpeech.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RecognizeRequest actualRequest = (RecognizeRequest) actualRequests.get(0); - - Assert.assertEquals(config, actualRequest.getConfig()); - Assert.assertEquals(audio, actualRequest.getAudio()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void recognizeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockSpeech.addException(exception); - - try { - RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC; - int sampleRateHertz = 44100; - String languageCode = "en-US"; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(encoding) - .setSampleRateHertz(sampleRateHertz) - .setLanguageCode(languageCode) - .build(); - String uri = "gs://bucket_name/file_name.flac"; - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(uri).build(); - - client.recognize(config, audio); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void longRunningRecognizeTest() throws Exception { - LongRunningRecognizeResponse expectedResponse = - LongRunningRecognizeResponse.newBuilder().build(); - Operation resultOperation = - Operation.newBuilder() - .setName("longRunningRecognizeTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockSpeech.addResponse(resultOperation); - - RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC; - int sampleRateHertz = 44100; - String languageCode = "en-US"; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(encoding) - .setSampleRateHertz(sampleRateHertz) - .setLanguageCode(languageCode) - .build(); - String uri = "gs://bucket_name/file_name.flac"; - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(uri).build(); - - LongRunningRecognizeResponse actualResponse = - client.longRunningRecognizeAsync(config, audio).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSpeech.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - LongRunningRecognizeRequest actualRequest = (LongRunningRecognizeRequest) actualRequests.get(0); - - Assert.assertEquals(config, actualRequest.getConfig()); - Assert.assertEquals(audio, actualRequest.getAudio()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void longRunningRecognizeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockSpeech.addException(exception); - - try { - RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC; - int sampleRateHertz = 44100; - String languageCode = "en-US"; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(encoding) - .setSampleRateHertz(sampleRateHertz) - .setLanguageCode(languageCode) - .build(); - String uri = "gs://bucket_name/file_name.flac"; - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(uri).build(); - - client.longRunningRecognizeAsync(config, audio).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - @SuppressWarnings("all") - public void streamingRecognizeTest() throws Exception { - StreamingRecognizeResponse expectedResponse = StreamingRecognizeResponse.newBuilder().build(); - mockSpeech.addResponse(expectedResponse); - StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = - client.streamingRecognizeCallable(); - ApiStreamObserver requestObserver = - callable.bidiStreamingCall(responseObserver); - - requestObserver.onNext(request); - requestObserver.onCompleted(); - - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); - } - - @Test - @SuppressWarnings("all") - public void streamingRecognizeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockSpeech.addException(exception); - StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = - client.streamingRecognizeCallable(); - ApiStreamObserver requestObserver = - callable.bidiStreamingCall(responseObserver); - - requestObserver.onNext(request); - - try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } -} diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechSmokeTest.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechSmokeTest.java deleted file mode 100644 index 2d8adaf1f..000000000 --- a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechSmokeTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1p1beta1; - -import com.google.common.base.Preconditions; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.junit.Assume; -import org.junit.Test; - -@javax.annotation.Generated("by GAPIC") -public class SpeechSmokeTest { - private static final String PROJECT_ENV_NAME = "GOOGLE_CLOUD_PROJECT"; - private static final String LEGACY_PROJECT_ENV_NAME = "GCLOUD_PROJECT"; - - @Test - public void run() { - // Skip smoke tests if running in VPCSC because our V1 integration tests - // cover VPC-SC. - Assume.assumeTrue(System.getenv("GOOGLE_CLOUD_TESTS_IN_VPCSC") == null); - main(null); - } - - public static void main(String args[]) { - Logger.getLogger("").setLevel(Level.WARNING); - try { - executeNoCatch(); - System.out.println("OK"); - } catch (Exception e) { - System.err.println("Failed with exception:"); - e.printStackTrace(System.err); - System.exit(1); - } - } - - public static void executeNoCatch() throws Exception { - try (SpeechClient client = SpeechClient.create()) { - String languageCode = "en-US"; - int sampleRateHertz = 44100; - RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setLanguageCode(languageCode) - .setSampleRateHertz(sampleRateHertz) - .setEncoding(encoding) - .build(); - String uri = "gs://cloud-samples-data/speech/brooklyn_bridge.flac"; - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(uri).build(); - - RecognizeResponse response = client.recognize(config, audio); - } - } - - private static String getProjectId() { - String projectId = System.getProperty(PROJECT_ENV_NAME, System.getenv(PROJECT_ENV_NAME)); - if (projectId == null) { - projectId = - System.getProperty(LEGACY_PROJECT_ENV_NAME, System.getenv(LEGACY_PROJECT_ENV_NAME)); - } - Preconditions.checkArgument(projectId != null, "A project ID is required."); - return projectId; - } -} diff --git a/google-cloud-speech/src/test/resources/hello.flac b/google-cloud-speech/src/test/resources/hello.flac deleted file mode 100644 index 62d9c2a0a..000000000 Binary files a/google-cloud-speech/src/test/resources/hello.flac and /dev/null differ diff --git a/grpc-google-cloud-speech-v1/clirr-ignored-differences.xml b/grpc-google-cloud-speech-v1/clirr-ignored-differences.xml deleted file mode 100644 index e4f9b652e..000000000 --- a/grpc-google-cloud-speech-v1/clirr-ignored-differences.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - 6001 - com/google/cloud/speech/v1/*Grpc - METHOD_* - - diff --git a/grpc-google-cloud-speech-v1/pom.xml b/grpc-google-cloud-speech-v1/pom.xml deleted file mode 100644 index de55ebc7c..000000000 --- a/grpc-google-cloud-speech-v1/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ - - 4.0.0 - com.google.api.grpc - grpc-google-cloud-speech-v1 - 1.24.2-SNAPSHOT - grpc-google-cloud-speech-v1 - GRPC library for grpc-google-cloud-speech-v1 - - com.google.cloud - google-cloud-speech-parent - 1.24.2-SNAPSHOT - - - - io.grpc - grpc-api - - - io.grpc - grpc-stub - - - io.grpc - grpc-protobuf - - - com.google.api.grpc - proto-google-cloud-speech-v1 - - - com.google.guava - guava - - - com.google.api.grpc - proto-google-common-protos - - - com.google.protobuf - protobuf-java - - - - - - java9 - - [9,) - - - - javax.annotation - javax.annotation-api - - - - - - - - - org.codehaus.mojo - flatten-maven-plugin - - - - diff --git a/grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechGrpc.java b/grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechGrpc.java deleted file mode 100644 index dc296967a..000000000 --- a/grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechGrpc.java +++ /dev/null @@ -1,582 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1; - -import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; - -/** - * - * - *
- * Service that implements Google Cloud Speech API.
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/cloud/speech/v1/cloud_speech.proto") -public final class SpeechGrpc { - - private SpeechGrpc() {} - - public static final String SERVICE_NAME = "google.cloud.speech.v1.Speech"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.speech.v1.RecognizeRequest, com.google.cloud.speech.v1.RecognizeResponse> - getRecognizeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "Recognize", - requestType = com.google.cloud.speech.v1.RecognizeRequest.class, - responseType = com.google.cloud.speech.v1.RecognizeResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.speech.v1.RecognizeRequest, com.google.cloud.speech.v1.RecognizeResponse> - getRecognizeMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.speech.v1.RecognizeRequest, - com.google.cloud.speech.v1.RecognizeResponse> - getRecognizeMethod; - if ((getRecognizeMethod = SpeechGrpc.getRecognizeMethod) == null) { - synchronized (SpeechGrpc.class) { - if ((getRecognizeMethod = SpeechGrpc.getRecognizeMethod) == null) { - SpeechGrpc.getRecognizeMethod = - getRecognizeMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Recognize")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.RecognizeRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.RecognizeResponse.getDefaultInstance())) - .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("Recognize")) - .build(); - } - } - } - return getRecognizeMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.speech.v1.LongRunningRecognizeRequest, com.google.longrunning.Operation> - getLongRunningRecognizeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "LongRunningRecognize", - requestType = com.google.cloud.speech.v1.LongRunningRecognizeRequest.class, - responseType = com.google.longrunning.Operation.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.speech.v1.LongRunningRecognizeRequest, com.google.longrunning.Operation> - getLongRunningRecognizeMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.speech.v1.LongRunningRecognizeRequest, - com.google.longrunning.Operation> - getLongRunningRecognizeMethod; - if ((getLongRunningRecognizeMethod = SpeechGrpc.getLongRunningRecognizeMethod) == null) { - synchronized (SpeechGrpc.class) { - if ((getLongRunningRecognizeMethod = SpeechGrpc.getLongRunningRecognizeMethod) == null) { - SpeechGrpc.getLongRunningRecognizeMethod = - getLongRunningRecognizeMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - generateFullMethodName(SERVICE_NAME, "LongRunningRecognize")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.LongRunningRecognizeRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.longrunning.Operation.getDefaultInstance())) - .setSchemaDescriptor( - new SpeechMethodDescriptorSupplier("LongRunningRecognize")) - .build(); - } - } - } - return getLongRunningRecognizeMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.speech.v1.StreamingRecognizeRequest, - com.google.cloud.speech.v1.StreamingRecognizeResponse> - getStreamingRecognizeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "StreamingRecognize", - requestType = com.google.cloud.speech.v1.StreamingRecognizeRequest.class, - responseType = com.google.cloud.speech.v1.StreamingRecognizeResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - public static io.grpc.MethodDescriptor< - com.google.cloud.speech.v1.StreamingRecognizeRequest, - com.google.cloud.speech.v1.StreamingRecognizeResponse> - getStreamingRecognizeMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.speech.v1.StreamingRecognizeRequest, - com.google.cloud.speech.v1.StreamingRecognizeResponse> - getStreamingRecognizeMethod; - if ((getStreamingRecognizeMethod = SpeechGrpc.getStreamingRecognizeMethod) == null) { - synchronized (SpeechGrpc.class) { - if ((getStreamingRecognizeMethod = SpeechGrpc.getStreamingRecognizeMethod) == null) { - SpeechGrpc.getStreamingRecognizeMethod = - getStreamingRecognizeMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamingRecognize")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.StreamingRecognizeRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.StreamingRecognizeResponse - .getDefaultInstance())) - .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("StreamingRecognize")) - .build(); - } - } - } - return getStreamingRecognizeMethod; - } - - /** Creates a new async stub that supports all call types for the service */ - public static SpeechStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public SpeechStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechStub(channel, callOptions); - } - }; - return SpeechStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static SpeechBlockingStub newBlockingStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public SpeechBlockingStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechBlockingStub(channel, callOptions); - } - }; - return SpeechBlockingStub.newStub(factory, channel); - } - - /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ - public static SpeechFutureStub newFutureStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public SpeechFutureStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechFutureStub(channel, callOptions); - } - }; - return SpeechFutureStub.newStub(factory, channel); - } - - /** - * - * - *
-   * Service that implements Google Cloud Speech API.
-   * 
- */ - public abstract static class SpeechImplBase implements io.grpc.BindableService { - - /** - * - * - *
-     * Performs synchronous speech recognition: receive results after all audio
-     * has been sent and processed.
-     * 
- */ - public void recognize( - com.google.cloud.speech.v1.RecognizeRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - asyncUnimplementedUnaryCall(getRecognizeMethod(), responseObserver); - } - - /** - * - * - *
-     * Performs asynchronous speech recognition: receive results via the
-     * google.longrunning.Operations interface. Returns either an
-     * `Operation.error` or an `Operation.response` which contains
-     * a `LongRunningRecognizeResponse` message.
-     * For more information on asynchronous speech recognition, see the
-     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
-     * 
- */ - public void longRunningRecognize( - com.google.cloud.speech.v1.LongRunningRecognizeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getLongRunningRecognizeMethod(), responseObserver); - } - - /** - * - * - *
-     * Performs bidirectional streaming speech recognition: receive results while
-     * sending audio. This method is only available via the gRPC API (not REST).
-     * 
- */ - public io.grpc.stub.StreamObserver - streamingRecognize( - io.grpc.stub.StreamObserver - responseObserver) { - return asyncUnimplementedStreamingCall(getStreamingRecognizeMethod(), responseObserver); - } - - @java.lang.Override - public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getRecognizeMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1.RecognizeRequest, - com.google.cloud.speech.v1.RecognizeResponse>(this, METHODID_RECOGNIZE))) - .addMethod( - getLongRunningRecognizeMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1.LongRunningRecognizeRequest, - com.google.longrunning.Operation>(this, METHODID_LONG_RUNNING_RECOGNIZE))) - .addMethod( - getStreamingRecognizeMethod(), - asyncBidiStreamingCall( - new MethodHandlers< - com.google.cloud.speech.v1.StreamingRecognizeRequest, - com.google.cloud.speech.v1.StreamingRecognizeResponse>( - this, METHODID_STREAMING_RECOGNIZE))) - .build(); - } - } - - /** - * - * - *
-   * Service that implements Google Cloud Speech API.
-   * 
- */ - public static final class SpeechStub extends io.grpc.stub.AbstractAsyncStub { - private SpeechStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SpeechStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechStub(channel, callOptions); - } - - /** - * - * - *
-     * Performs synchronous speech recognition: receive results after all audio
-     * has been sent and processed.
-     * 
- */ - public void recognize( - com.google.cloud.speech.v1.RecognizeRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - asyncUnaryCall( - getChannel().newCall(getRecognizeMethod(), getCallOptions()), request, responseObserver); - } - - /** - * - * - *
-     * Performs asynchronous speech recognition: receive results via the
-     * google.longrunning.Operations interface. Returns either an
-     * `Operation.error` or an `Operation.response` which contains
-     * a `LongRunningRecognizeResponse` message.
-     * For more information on asynchronous speech recognition, see the
-     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
-     * 
- */ - public void longRunningRecognize( - com.google.cloud.speech.v1.LongRunningRecognizeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getLongRunningRecognizeMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Performs bidirectional streaming speech recognition: receive results while
-     * sending audio. This method is only available via the gRPC API (not REST).
-     * 
- */ - public io.grpc.stub.StreamObserver - streamingRecognize( - io.grpc.stub.StreamObserver - responseObserver) { - return asyncBidiStreamingCall( - getChannel().newCall(getStreamingRecognizeMethod(), getCallOptions()), responseObserver); - } - } - - /** - * - * - *
-   * Service that implements Google Cloud Speech API.
-   * 
- */ - public static final class SpeechBlockingStub - extends io.grpc.stub.AbstractBlockingStub { - private SpeechBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SpeechBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechBlockingStub(channel, callOptions); - } - - /** - * - * - *
-     * Performs synchronous speech recognition: receive results after all audio
-     * has been sent and processed.
-     * 
- */ - public com.google.cloud.speech.v1.RecognizeResponse recognize( - com.google.cloud.speech.v1.RecognizeRequest request) { - return blockingUnaryCall(getChannel(), getRecognizeMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Performs asynchronous speech recognition: receive results via the
-     * google.longrunning.Operations interface. Returns either an
-     * `Operation.error` or an `Operation.response` which contains
-     * a `LongRunningRecognizeResponse` message.
-     * For more information on asynchronous speech recognition, see the
-     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
-     * 
- */ - public com.google.longrunning.Operation longRunningRecognize( - com.google.cloud.speech.v1.LongRunningRecognizeRequest request) { - return blockingUnaryCall( - getChannel(), getLongRunningRecognizeMethod(), getCallOptions(), request); - } - } - - /** - * - * - *
-   * Service that implements Google Cloud Speech API.
-   * 
- */ - public static final class SpeechFutureStub - extends io.grpc.stub.AbstractFutureStub { - private SpeechFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SpeechFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechFutureStub(channel, callOptions); - } - - /** - * - * - *
-     * Performs synchronous speech recognition: receive results after all audio
-     * has been sent and processed.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.speech.v1.RecognizeResponse> - recognize(com.google.cloud.speech.v1.RecognizeRequest request) { - return futureUnaryCall(getChannel().newCall(getRecognizeMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Performs asynchronous speech recognition: receive results via the
-     * google.longrunning.Operations interface. Returns either an
-     * `Operation.error` or an `Operation.response` which contains
-     * a `LongRunningRecognizeResponse` message.
-     * For more information on asynchronous speech recognition, see the
-     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - longRunningRecognize(com.google.cloud.speech.v1.LongRunningRecognizeRequest request) { - return futureUnaryCall( - getChannel().newCall(getLongRunningRecognizeMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_RECOGNIZE = 0; - private static final int METHODID_LONG_RUNNING_RECOGNIZE = 1; - private static final int METHODID_STREAMING_RECOGNIZE = 2; - - private static final class MethodHandlers - implements io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final SpeechImplBase serviceImpl; - private final int methodId; - - MethodHandlers(SpeechImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_RECOGNIZE: - serviceImpl.recognize( - (com.google.cloud.speech.v1.RecognizeRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_LONG_RUNNING_RECOGNIZE: - serviceImpl.longRunningRecognize( - (com.google.cloud.speech.v1.LongRunningRecognizeRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_STREAMING_RECOGNIZE: - return (io.grpc.stub.StreamObserver) - serviceImpl.streamingRecognize( - (io.grpc.stub.StreamObserver< - com.google.cloud.speech.v1.StreamingRecognizeResponse>) - responseObserver); - default: - throw new AssertionError(); - } - } - } - - private abstract static class SpeechBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, - io.grpc.protobuf.ProtoServiceDescriptorSupplier { - SpeechBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("Speech"); - } - } - - private static final class SpeechFileDescriptorSupplier extends SpeechBaseDescriptorSupplier { - SpeechFileDescriptorSupplier() {} - } - - private static final class SpeechMethodDescriptorSupplier extends SpeechBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - SpeechMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (SpeechGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = - result = - io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new SpeechFileDescriptorSupplier()) - .addMethod(getRecognizeMethod()) - .addMethod(getLongRunningRecognizeMethod()) - .addMethod(getStreamingRecognizeMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/grpc-google-cloud-speech-v1beta1/clirr-ignored-differences.xml b/grpc-google-cloud-speech-v1beta1/clirr-ignored-differences.xml deleted file mode 100644 index 965de678b..000000000 --- a/grpc-google-cloud-speech-v1beta1/clirr-ignored-differences.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - 6001 - com/google/cloud/speech/v1beta1/*Grpc - METHOD_* - - diff --git a/grpc-google-cloud-speech-v1beta1/pom.xml b/grpc-google-cloud-speech-v1beta1/pom.xml deleted file mode 100644 index bd704a7e8..000000000 --- a/grpc-google-cloud-speech-v1beta1/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ - - 4.0.0 - com.google.api.grpc - grpc-google-cloud-speech-v1beta1 - 0.77.2-SNAPSHOT - grpc-google-cloud-speech-v1beta1 - GRPC library for grpc-google-cloud-speech-v1beta1 - - com.google.cloud - google-cloud-speech-parent - 1.24.2-SNAPSHOT - - - - io.grpc - grpc-api - - - io.grpc - grpc-stub - - - io.grpc - grpc-protobuf - - - com.google.api.grpc - proto-google-cloud-speech-v1beta1 - - - com.google.guava - guava - - - com.google.api.grpc - proto-google-common-protos - - - com.google.protobuf - protobuf-java - - - - - - java9 - - [9,) - - - - javax.annotation - javax.annotation-api - - - - - - - - - org.codehaus.mojo - flatten-maven-plugin - - - - diff --git a/grpc-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechGrpc.java b/grpc-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechGrpc.java deleted file mode 100644 index 13cecfd93..000000000 --- a/grpc-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechGrpc.java +++ /dev/null @@ -1,611 +0,0 @@ -/* - * Copyright 2019 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. - */ -package com.google.cloud.speech.v1beta1; - -import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; - -/** - * - * - *
- * Service that implements Google Cloud Speech API.
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler (version 1.10.0)", - comments = "Source: google/cloud/speech/v1beta1/cloud_speech.proto") -public final class SpeechGrpc { - - private SpeechGrpc() {} - - public static final String SERVICE_NAME = "google.cloud.speech.v1beta1.Speech"; - - // Static method descriptors that strictly reflect the proto. - @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") - @java.lang.Deprecated // Use {@link #getSyncRecognizeMethod()} instead. - public static final io.grpc.MethodDescriptor< - com.google.cloud.speech.v1beta1.SyncRecognizeRequest, - com.google.cloud.speech.v1beta1.SyncRecognizeResponse> - METHOD_SYNC_RECOGNIZE = getSyncRecognizeMethodHelper(); - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.speech.v1beta1.SyncRecognizeRequest, - com.google.cloud.speech.v1beta1.SyncRecognizeResponse> - getSyncRecognizeMethod; - - @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") - public static io.grpc.MethodDescriptor< - com.google.cloud.speech.v1beta1.SyncRecognizeRequest, - com.google.cloud.speech.v1beta1.SyncRecognizeResponse> - getSyncRecognizeMethod() { - return getSyncRecognizeMethodHelper(); - } - - private static io.grpc.MethodDescriptor< - com.google.cloud.speech.v1beta1.SyncRecognizeRequest, - com.google.cloud.speech.v1beta1.SyncRecognizeResponse> - getSyncRecognizeMethodHelper() { - io.grpc.MethodDescriptor< - com.google.cloud.speech.v1beta1.SyncRecognizeRequest, - com.google.cloud.speech.v1beta1.SyncRecognizeResponse> - getSyncRecognizeMethod; - if ((getSyncRecognizeMethod = SpeechGrpc.getSyncRecognizeMethod) == null) { - synchronized (SpeechGrpc.class) { - if ((getSyncRecognizeMethod = SpeechGrpc.getSyncRecognizeMethod) == null) { - SpeechGrpc.getSyncRecognizeMethod = - getSyncRecognizeMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - generateFullMethodName( - "google.cloud.speech.v1beta1.Speech", "SyncRecognize")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1beta1.SyncRecognizeRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1beta1.SyncRecognizeResponse - .getDefaultInstance())) - .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("SyncRecognize")) - .build(); - } - } - } - return getSyncRecognizeMethod; - } - - @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") - @java.lang.Deprecated // Use {@link #getAsyncRecognizeMethod()} instead. - public static final io.grpc.MethodDescriptor< - com.google.cloud.speech.v1beta1.AsyncRecognizeRequest, com.google.longrunning.Operation> - METHOD_ASYNC_RECOGNIZE = getAsyncRecognizeMethodHelper(); - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.speech.v1beta1.AsyncRecognizeRequest, com.google.longrunning.Operation> - getAsyncRecognizeMethod; - - @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") - public static io.grpc.MethodDescriptor< - com.google.cloud.speech.v1beta1.AsyncRecognizeRequest, com.google.longrunning.Operation> - getAsyncRecognizeMethod() { - return getAsyncRecognizeMethodHelper(); - } - - private static io.grpc.MethodDescriptor< - com.google.cloud.speech.v1beta1.AsyncRecognizeRequest, com.google.longrunning.Operation> - getAsyncRecognizeMethodHelper() { - io.grpc.MethodDescriptor< - com.google.cloud.speech.v1beta1.AsyncRecognizeRequest, com.google.longrunning.Operation> - getAsyncRecognizeMethod; - if ((getAsyncRecognizeMethod = SpeechGrpc.getAsyncRecognizeMethod) == null) { - synchronized (SpeechGrpc.class) { - if ((getAsyncRecognizeMethod = SpeechGrpc.getAsyncRecognizeMethod) == null) { - SpeechGrpc.getAsyncRecognizeMethod = - getAsyncRecognizeMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - generateFullMethodName( - "google.cloud.speech.v1beta1.Speech", "AsyncRecognize")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1beta1.AsyncRecognizeRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.longrunning.Operation.getDefaultInstance())) - .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("AsyncRecognize")) - .build(); - } - } - } - return getAsyncRecognizeMethod; - } - - @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") - @java.lang.Deprecated // Use {@link #getStreamingRecognizeMethod()} instead. - public static final io.grpc.MethodDescriptor< - com.google.cloud.speech.v1beta1.StreamingRecognizeRequest, - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse> - METHOD_STREAMING_RECOGNIZE = getStreamingRecognizeMethodHelper(); - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.speech.v1beta1.StreamingRecognizeRequest, - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse> - getStreamingRecognizeMethod; - - @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") - public static io.grpc.MethodDescriptor< - com.google.cloud.speech.v1beta1.StreamingRecognizeRequest, - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse> - getStreamingRecognizeMethod() { - return getStreamingRecognizeMethodHelper(); - } - - private static io.grpc.MethodDescriptor< - com.google.cloud.speech.v1beta1.StreamingRecognizeRequest, - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse> - getStreamingRecognizeMethodHelper() { - io.grpc.MethodDescriptor< - com.google.cloud.speech.v1beta1.StreamingRecognizeRequest, - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse> - getStreamingRecognizeMethod; - if ((getStreamingRecognizeMethod = SpeechGrpc.getStreamingRecognizeMethod) == null) { - synchronized (SpeechGrpc.class) { - if ((getStreamingRecognizeMethod = SpeechGrpc.getStreamingRecognizeMethod) == null) { - SpeechGrpc.getStreamingRecognizeMethod = - getStreamingRecognizeMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName( - generateFullMethodName( - "google.cloud.speech.v1beta1.Speech", "StreamingRecognize")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1beta1.StreamingRecognizeRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse - .getDefaultInstance())) - .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("StreamingRecognize")) - .build(); - } - } - } - return getStreamingRecognizeMethod; - } - - /** Creates a new async stub that supports all call types for the service */ - public static SpeechStub newStub(io.grpc.Channel channel) { - return new SpeechStub(channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static SpeechBlockingStub newBlockingStub(io.grpc.Channel channel) { - return new SpeechBlockingStub(channel); - } - - /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ - public static SpeechFutureStub newFutureStub(io.grpc.Channel channel) { - return new SpeechFutureStub(channel); - } - - /** - * - * - *
-   * Service that implements Google Cloud Speech API.
-   * 
- */ - public abstract static class SpeechImplBase implements io.grpc.BindableService { - - /** - * - * - *
-     * Performs synchronous speech recognition: receive results after all audio
-     * has been sent and processed.
-     * 
- */ - public void syncRecognize( - com.google.cloud.speech.v1beta1.SyncRecognizeRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - asyncUnimplementedUnaryCall(getSyncRecognizeMethodHelper(), responseObserver); - } - - /** - * - * - *
-     * Performs asynchronous speech recognition: receive results via the
-     * [google.longrunning.Operations]
-     * (/speech/reference/rest/v1beta1/operations#Operation)
-     * interface. Returns either an
-     * `Operation.error` or an `Operation.response` which contains
-     * an `AsyncRecognizeResponse` message.
-     * 
- */ - public void asyncRecognize( - com.google.cloud.speech.v1beta1.AsyncRecognizeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getAsyncRecognizeMethodHelper(), responseObserver); - } - - /** - * - * - *
-     * Performs bidirectional streaming speech recognition: receive results while
-     * sending audio. This method is only available via the gRPC API (not REST).
-     * 
- */ - public io.grpc.stub.StreamObserver - streamingRecognize( - io.grpc.stub.StreamObserver - responseObserver) { - return asyncUnimplementedStreamingCall(getStreamingRecognizeMethodHelper(), responseObserver); - } - - @java.lang.Override - public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getSyncRecognizeMethodHelper(), - asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1beta1.SyncRecognizeRequest, - com.google.cloud.speech.v1beta1.SyncRecognizeResponse>( - this, METHODID_SYNC_RECOGNIZE))) - .addMethod( - getAsyncRecognizeMethodHelper(), - asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1beta1.AsyncRecognizeRequest, - com.google.longrunning.Operation>(this, METHODID_ASYNC_RECOGNIZE))) - .addMethod( - getStreamingRecognizeMethodHelper(), - asyncBidiStreamingCall( - new MethodHandlers< - com.google.cloud.speech.v1beta1.StreamingRecognizeRequest, - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse>( - this, METHODID_STREAMING_RECOGNIZE))) - .build(); - } - } - - /** - * - * - *
-   * Service that implements Google Cloud Speech API.
-   * 
- */ - public static final class SpeechStub extends io.grpc.stub.AbstractStub { - private SpeechStub(io.grpc.Channel channel) { - super(channel); - } - - private SpeechStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SpeechStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechStub(channel, callOptions); - } - - /** - * - * - *
-     * Performs synchronous speech recognition: receive results after all audio
-     * has been sent and processed.
-     * 
- */ - public void syncRecognize( - com.google.cloud.speech.v1beta1.SyncRecognizeRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - asyncUnaryCall( - getChannel().newCall(getSyncRecognizeMethodHelper(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Performs asynchronous speech recognition: receive results via the
-     * [google.longrunning.Operations]
-     * (/speech/reference/rest/v1beta1/operations#Operation)
-     * interface. Returns either an
-     * `Operation.error` or an `Operation.response` which contains
-     * an `AsyncRecognizeResponse` message.
-     * 
- */ - public void asyncRecognize( - com.google.cloud.speech.v1beta1.AsyncRecognizeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getAsyncRecognizeMethodHelper(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Performs bidirectional streaming speech recognition: receive results while
-     * sending audio. This method is only available via the gRPC API (not REST).
-     * 
- */ - public io.grpc.stub.StreamObserver - streamingRecognize( - io.grpc.stub.StreamObserver - responseObserver) { - return asyncBidiStreamingCall( - getChannel().newCall(getStreamingRecognizeMethodHelper(), getCallOptions()), - responseObserver); - } - } - - /** - * - * - *
-   * Service that implements Google Cloud Speech API.
-   * 
- */ - public static final class SpeechBlockingStub - extends io.grpc.stub.AbstractStub { - private SpeechBlockingStub(io.grpc.Channel channel) { - super(channel); - } - - private SpeechBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SpeechBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechBlockingStub(channel, callOptions); - } - - /** - * - * - *
-     * Performs synchronous speech recognition: receive results after all audio
-     * has been sent and processed.
-     * 
- */ - public com.google.cloud.speech.v1beta1.SyncRecognizeResponse syncRecognize( - com.google.cloud.speech.v1beta1.SyncRecognizeRequest request) { - return blockingUnaryCall( - getChannel(), getSyncRecognizeMethodHelper(), getCallOptions(), request); - } - - /** - * - * - *
-     * Performs asynchronous speech recognition: receive results via the
-     * [google.longrunning.Operations]
-     * (/speech/reference/rest/v1beta1/operations#Operation)
-     * interface. Returns either an
-     * `Operation.error` or an `Operation.response` which contains
-     * an `AsyncRecognizeResponse` message.
-     * 
- */ - public com.google.longrunning.Operation asyncRecognize( - com.google.cloud.speech.v1beta1.AsyncRecognizeRequest request) { - return blockingUnaryCall( - getChannel(), getAsyncRecognizeMethodHelper(), getCallOptions(), request); - } - } - - /** - * - * - *
-   * Service that implements Google Cloud Speech API.
-   * 
- */ - public static final class SpeechFutureStub extends io.grpc.stub.AbstractStub { - private SpeechFutureStub(io.grpc.Channel channel) { - super(channel); - } - - private SpeechFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SpeechFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechFutureStub(channel, callOptions); - } - - /** - * - * - *
-     * Performs synchronous speech recognition: receive results after all audio
-     * has been sent and processed.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.speech.v1beta1.SyncRecognizeResponse> - syncRecognize(com.google.cloud.speech.v1beta1.SyncRecognizeRequest request) { - return futureUnaryCall( - getChannel().newCall(getSyncRecognizeMethodHelper(), getCallOptions()), request); - } - - /** - * - * - *
-     * Performs asynchronous speech recognition: receive results via the
-     * [google.longrunning.Operations]
-     * (/speech/reference/rest/v1beta1/operations#Operation)
-     * interface. Returns either an
-     * `Operation.error` or an `Operation.response` which contains
-     * an `AsyncRecognizeResponse` message.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - asyncRecognize(com.google.cloud.speech.v1beta1.AsyncRecognizeRequest request) { - return futureUnaryCall( - getChannel().newCall(getAsyncRecognizeMethodHelper(), getCallOptions()), request); - } - } - - private static final int METHODID_SYNC_RECOGNIZE = 0; - private static final int METHODID_ASYNC_RECOGNIZE = 1; - private static final int METHODID_STREAMING_RECOGNIZE = 2; - - private static final class MethodHandlers - implements io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final SpeechImplBase serviceImpl; - private final int methodId; - - MethodHandlers(SpeechImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_SYNC_RECOGNIZE: - serviceImpl.syncRecognize( - (com.google.cloud.speech.v1beta1.SyncRecognizeRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_ASYNC_RECOGNIZE: - serviceImpl.asyncRecognize( - (com.google.cloud.speech.v1beta1.AsyncRecognizeRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_STREAMING_RECOGNIZE: - return (io.grpc.stub.StreamObserver) - serviceImpl.streamingRecognize( - (io.grpc.stub.StreamObserver< - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse>) - responseObserver); - default: - throw new AssertionError(); - } - } - } - - private abstract static class SpeechBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, - io.grpc.protobuf.ProtoServiceDescriptorSupplier { - SpeechBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("Speech"); - } - } - - private static final class SpeechFileDescriptorSupplier extends SpeechBaseDescriptorSupplier { - SpeechFileDescriptorSupplier() {} - } - - private static final class SpeechMethodDescriptorSupplier extends SpeechBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - SpeechMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (SpeechGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = - result = - io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new SpeechFileDescriptorSupplier()) - .addMethod(getSyncRecognizeMethodHelper()) - .addMethod(getAsyncRecognizeMethodHelper()) - .addMethod(getStreamingRecognizeMethodHelper()) - .build(); - } - } - } - return result; - } -} diff --git a/grpc-google-cloud-speech-v1p1beta1/clirr-ignored-differences.xml b/grpc-google-cloud-speech-v1p1beta1/clirr-ignored-differences.xml deleted file mode 100644 index 8477e1503..000000000 --- a/grpc-google-cloud-speech-v1p1beta1/clirr-ignored-differences.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - 6001 - com/google/cloud/speech/v1p1beta1/*Grpc - METHOD_* - - diff --git a/grpc-google-cloud-speech-v1p1beta1/pom.xml b/grpc-google-cloud-speech-v1p1beta1/pom.xml deleted file mode 100644 index 20a043bd6..000000000 --- a/grpc-google-cloud-speech-v1p1beta1/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ - - 4.0.0 - com.google.api.grpc - grpc-google-cloud-speech-v1p1beta1 - 0.77.2-SNAPSHOT - grpc-google-cloud-speech-v1p1beta1 - GRPC library for grpc-google-cloud-speech-v1p1beta1 - - com.google.cloud - google-cloud-speech-parent - 1.24.2-SNAPSHOT - - - - io.grpc - grpc-api - - - io.grpc - grpc-stub - - - io.grpc - grpc-protobuf - - - com.google.api.grpc - proto-google-cloud-speech-v1p1beta1 - - - com.google.guava - guava - - - com.google.api.grpc - proto-google-common-protos - - - com.google.protobuf - protobuf-java - - - - - - java9 - - [9,) - - - - javax.annotation - javax.annotation-api - - - - - - - - - org.codehaus.mojo - flatten-maven-plugin - - - - diff --git a/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechGrpc.java b/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechGrpc.java deleted file mode 100644 index 9f1d0057d..000000000 --- a/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechGrpc.java +++ /dev/null @@ -1,592 +0,0 @@ -/* - * 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. - */ -package com.google.cloud.speech.v1p1beta1; - -import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; - -/** - * - * - *
- * Service that implements Google Cloud Speech API.
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/cloud/speech/v1p1beta1/cloud_speech.proto") -public final class SpeechGrpc { - - private SpeechGrpc() {} - - public static final String SERVICE_NAME = "google.cloud.speech.v1p1beta1.Speech"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.speech.v1p1beta1.RecognizeRequest, - com.google.cloud.speech.v1p1beta1.RecognizeResponse> - getRecognizeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "Recognize", - requestType = com.google.cloud.speech.v1p1beta1.RecognizeRequest.class, - responseType = com.google.cloud.speech.v1p1beta1.RecognizeResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.speech.v1p1beta1.RecognizeRequest, - com.google.cloud.speech.v1p1beta1.RecognizeResponse> - getRecognizeMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.speech.v1p1beta1.RecognizeRequest, - com.google.cloud.speech.v1p1beta1.RecognizeResponse> - getRecognizeMethod; - if ((getRecognizeMethod = SpeechGrpc.getRecognizeMethod) == null) { - synchronized (SpeechGrpc.class) { - if ((getRecognizeMethod = SpeechGrpc.getRecognizeMethod) == null) { - SpeechGrpc.getRecognizeMethod = - getRecognizeMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Recognize")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.RecognizeRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.RecognizeResponse - .getDefaultInstance())) - .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("Recognize")) - .build(); - } - } - } - return getRecognizeMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest, - com.google.longrunning.Operation> - getLongRunningRecognizeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "LongRunningRecognize", - requestType = com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.class, - responseType = com.google.longrunning.Operation.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest, - com.google.longrunning.Operation> - getLongRunningRecognizeMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest, - com.google.longrunning.Operation> - getLongRunningRecognizeMethod; - if ((getLongRunningRecognizeMethod = SpeechGrpc.getLongRunningRecognizeMethod) == null) { - synchronized (SpeechGrpc.class) { - if ((getLongRunningRecognizeMethod = SpeechGrpc.getLongRunningRecognizeMethod) == null) { - SpeechGrpc.getLongRunningRecognizeMethod = - getLongRunningRecognizeMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - generateFullMethodName(SERVICE_NAME, "LongRunningRecognize")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.longrunning.Operation.getDefaultInstance())) - .setSchemaDescriptor( - new SpeechMethodDescriptorSupplier("LongRunningRecognize")) - .build(); - } - } - } - return getLongRunningRecognizeMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest, - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse> - getStreamingRecognizeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "StreamingRecognize", - requestType = com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.class, - responseType = com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - public static io.grpc.MethodDescriptor< - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest, - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse> - getStreamingRecognizeMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest, - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse> - getStreamingRecognizeMethod; - if ((getStreamingRecognizeMethod = SpeechGrpc.getStreamingRecognizeMethod) == null) { - synchronized (SpeechGrpc.class) { - if ((getStreamingRecognizeMethod = SpeechGrpc.getStreamingRecognizeMethod) == null) { - SpeechGrpc.getStreamingRecognizeMethod = - getStreamingRecognizeMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamingRecognize")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse - .getDefaultInstance())) - .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("StreamingRecognize")) - .build(); - } - } - } - return getStreamingRecognizeMethod; - } - - /** Creates a new async stub that supports all call types for the service */ - public static SpeechStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public SpeechStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechStub(channel, callOptions); - } - }; - return SpeechStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static SpeechBlockingStub newBlockingStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public SpeechBlockingStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechBlockingStub(channel, callOptions); - } - }; - return SpeechBlockingStub.newStub(factory, channel); - } - - /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ - public static SpeechFutureStub newFutureStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public SpeechFutureStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechFutureStub(channel, callOptions); - } - }; - return SpeechFutureStub.newStub(factory, channel); - } - - /** - * - * - *
-   * Service that implements Google Cloud Speech API.
-   * 
- */ - public abstract static class SpeechImplBase implements io.grpc.BindableService { - - /** - * - * - *
-     * Performs synchronous speech recognition: receive results after all audio
-     * has been sent and processed.
-     * 
- */ - public void recognize( - com.google.cloud.speech.v1p1beta1.RecognizeRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - asyncUnimplementedUnaryCall(getRecognizeMethod(), responseObserver); - } - - /** - * - * - *
-     * Performs asynchronous speech recognition: receive results via the
-     * google.longrunning.Operations interface. Returns either an
-     * `Operation.error` or an `Operation.response` which contains
-     * a `LongRunningRecognizeResponse` message.
-     * For more information on asynchronous speech recognition, see the
-     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
-     * 
- */ - public void longRunningRecognize( - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getLongRunningRecognizeMethod(), responseObserver); - } - - /** - * - * - *
-     * Performs bidirectional streaming speech recognition: receive results while
-     * sending audio. This method is only available via the gRPC API (not REST).
-     * 
- */ - public io.grpc.stub.StreamObserver - streamingRecognize( - io.grpc.stub.StreamObserver< - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse> - responseObserver) { - return asyncUnimplementedStreamingCall(getStreamingRecognizeMethod(), responseObserver); - } - - @java.lang.Override - public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getRecognizeMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1p1beta1.RecognizeRequest, - com.google.cloud.speech.v1p1beta1.RecognizeResponse>( - this, METHODID_RECOGNIZE))) - .addMethod( - getLongRunningRecognizeMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest, - com.google.longrunning.Operation>(this, METHODID_LONG_RUNNING_RECOGNIZE))) - .addMethod( - getStreamingRecognizeMethod(), - asyncBidiStreamingCall( - new MethodHandlers< - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest, - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse>( - this, METHODID_STREAMING_RECOGNIZE))) - .build(); - } - } - - /** - * - * - *
-   * Service that implements Google Cloud Speech API.
-   * 
- */ - public static final class SpeechStub extends io.grpc.stub.AbstractAsyncStub { - private SpeechStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SpeechStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechStub(channel, callOptions); - } - - /** - * - * - *
-     * Performs synchronous speech recognition: receive results after all audio
-     * has been sent and processed.
-     * 
- */ - public void recognize( - com.google.cloud.speech.v1p1beta1.RecognizeRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - asyncUnaryCall( - getChannel().newCall(getRecognizeMethod(), getCallOptions()), request, responseObserver); - } - - /** - * - * - *
-     * Performs asynchronous speech recognition: receive results via the
-     * google.longrunning.Operations interface. Returns either an
-     * `Operation.error` or an `Operation.response` which contains
-     * a `LongRunningRecognizeResponse` message.
-     * For more information on asynchronous speech recognition, see the
-     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
-     * 
- */ - public void longRunningRecognize( - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getLongRunningRecognizeMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Performs bidirectional streaming speech recognition: receive results while
-     * sending audio. This method is only available via the gRPC API (not REST).
-     * 
- */ - public io.grpc.stub.StreamObserver - streamingRecognize( - io.grpc.stub.StreamObserver< - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse> - responseObserver) { - return asyncBidiStreamingCall( - getChannel().newCall(getStreamingRecognizeMethod(), getCallOptions()), responseObserver); - } - } - - /** - * - * - *
-   * Service that implements Google Cloud Speech API.
-   * 
- */ - public static final class SpeechBlockingStub - extends io.grpc.stub.AbstractBlockingStub { - private SpeechBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SpeechBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechBlockingStub(channel, callOptions); - } - - /** - * - * - *
-     * Performs synchronous speech recognition: receive results after all audio
-     * has been sent and processed.
-     * 
- */ - public com.google.cloud.speech.v1p1beta1.RecognizeResponse recognize( - com.google.cloud.speech.v1p1beta1.RecognizeRequest request) { - return blockingUnaryCall(getChannel(), getRecognizeMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Performs asynchronous speech recognition: receive results via the
-     * google.longrunning.Operations interface. Returns either an
-     * `Operation.error` or an `Operation.response` which contains
-     * a `LongRunningRecognizeResponse` message.
-     * For more information on asynchronous speech recognition, see the
-     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
-     * 
- */ - public com.google.longrunning.Operation longRunningRecognize( - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest request) { - return blockingUnaryCall( - getChannel(), getLongRunningRecognizeMethod(), getCallOptions(), request); - } - } - - /** - * - * - *
-   * Service that implements Google Cloud Speech API.
-   * 
- */ - public static final class SpeechFutureStub - extends io.grpc.stub.AbstractFutureStub { - private SpeechFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SpeechFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechFutureStub(channel, callOptions); - } - - /** - * - * - *
-     * Performs synchronous speech recognition: receive results after all audio
-     * has been sent and processed.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.speech.v1p1beta1.RecognizeResponse> - recognize(com.google.cloud.speech.v1p1beta1.RecognizeRequest request) { - return futureUnaryCall(getChannel().newCall(getRecognizeMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Performs asynchronous speech recognition: receive results via the
-     * google.longrunning.Operations interface. Returns either an
-     * `Operation.error` or an `Operation.response` which contains
-     * a `LongRunningRecognizeResponse` message.
-     * For more information on asynchronous speech recognition, see the
-     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - longRunningRecognize( - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest request) { - return futureUnaryCall( - getChannel().newCall(getLongRunningRecognizeMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_RECOGNIZE = 0; - private static final int METHODID_LONG_RUNNING_RECOGNIZE = 1; - private static final int METHODID_STREAMING_RECOGNIZE = 2; - - private static final class MethodHandlers - implements io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final SpeechImplBase serviceImpl; - private final int methodId; - - MethodHandlers(SpeechImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_RECOGNIZE: - serviceImpl.recognize( - (com.google.cloud.speech.v1p1beta1.RecognizeRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_LONG_RUNNING_RECOGNIZE: - serviceImpl.longRunningRecognize( - (com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_STREAMING_RECOGNIZE: - return (io.grpc.stub.StreamObserver) - serviceImpl.streamingRecognize( - (io.grpc.stub.StreamObserver< - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse>) - responseObserver); - default: - throw new AssertionError(); - } - } - } - - private abstract static class SpeechBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, - io.grpc.protobuf.ProtoServiceDescriptorSupplier { - SpeechBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("Speech"); - } - } - - private static final class SpeechFileDescriptorSupplier extends SpeechBaseDescriptorSupplier { - SpeechFileDescriptorSupplier() {} - } - - private static final class SpeechMethodDescriptorSupplier extends SpeechBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - SpeechMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (SpeechGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = - result = - io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new SpeechFileDescriptorSupplier()) - .addMethod(getRecognizeMethod()) - .addMethod(getLongRunningRecognizeMethod()) - .addMethod(getStreamingRecognizeMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/java.header b/java.header deleted file mode 100644 index 3a9b503aa..000000000 --- a/java.header +++ /dev/null @@ -1,15 +0,0 @@ -^/\*$ -^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)( All [rR]ights [rR]eserved\.)?$ -^ \*$ -^ \* 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\.$ -^ \*/$ diff --git a/license-checks.xml b/license-checks.xml deleted file mode 100644 index 6597fced8..000000000 --- a/license-checks.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - diff --git a/pom.xml b/pom.xml deleted file mode 100644 index b08bc005a..000000000 --- a/pom.xml +++ /dev/null @@ -1,314 +0,0 @@ - - - 4.0.0 - com.google.cloud - google-cloud-speech-parent - pom - 1.24.2-SNAPSHOT - Google Cloud speech Parent - https://github.com/googleapis/java-speech - - Java idiomatic client for Google Cloud Platform services. - - - - com.google.cloud - google-cloud-shared-config - 0.9.2 - - - - - garrettjonesgoogle - Garrett Jones - garrettjones@google.com - Google - - Developer - - - - pongad - Michael Darakananda - pongad@google.com - Google - - Developer - - - - shinfan - Shin Fan - shinfan@google.com - Google - - Developer - - - - michaelbausor - Micheal Bausor - michaelbausor@google.com - Google - - Developer - - - - vam-google - Vadym Matsishevskyi - vam@google.com - Google - - Developer - - - - tswast - Tim Swast - tswast@google.com - Google - - Developer - - - - neozwu - Neo Wu - neowu@google.com - Google - - Developer - - - - lesv - Les Vogel - lesv@google.com - Google - - Developer - - - - schmidt_sebastian - Sebastian Schmidt - mrschmidt@google.com - Google - - Developer - - - - andreamlin - Andrea Lin - andrealin@google.com - - Developer - - - - hzyi-google - Hanzhen Yi - hzyi@google.com - - Developer - - - - - Google LLC - - - scm:git:git@github.com:googleapis/java-speech.git - scm:git:git@github.com:googleapis/java-speech.git - https://github.com/googleapis/java-speech - HEAD - - - https://github.com/googleapis/java-speech/issues - GitHub Issues - - - - sonatype-nexus-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - - sonatype-nexus-staging - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - - - Apache-2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt - - - - - UTF-8 - UTF-8 - github - google-cloud-speech-parent - - - - - - com.google.api.grpc - proto-google-cloud-speech-v1 - 1.24.2-SNAPSHOT - - - com.google.api.grpc - proto-google-cloud-speech-v1beta1 - 0.77.2-SNAPSHOT - - - com.google.api.grpc - proto-google-cloud-speech-v1p1beta1 - 0.77.2-SNAPSHOT - - - com.google.api.grpc - grpc-google-cloud-speech-v1 - 1.24.2-SNAPSHOT - - - com.google.api.grpc - grpc-google-cloud-speech-v1beta1 - 0.77.2-SNAPSHOT - - - com.google.api.grpc - grpc-google-cloud-speech-v1p1beta1 - 0.77.2-SNAPSHOT - - - - com.google.cloud - google-cloud-shared-dependencies - 0.9.0 - pom - import - - - com.google.errorprone - error_prone_annotations - 2.4.0 - - - - junit - junit - 4.13 - test - - - com.google.truth - truth - 1.0.1 - test - - - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - org.objenesis:objenesis - javax.annotation:javax.annotation-api - - - - - - - - - proto-google-cloud-speech-v1 - proto-google-cloud-speech-v1beta1 - proto-google-cloud-speech-v1p1beta1 - grpc-google-cloud-speech-v1 - grpc-google-cloud-speech-v1beta1 - grpc-google-cloud-speech-v1p1beta1 - google-cloud-speech - google-cloud-speech-bom - - - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 3.1.1 - - - - index - dependency-info - team - ci-management - issue-management - licenses - scm - dependency-management - distribution-management - summary - modules - - - - - true - ${site.installationModule} - jar - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.2.0 - - - html - - aggregate - javadoc - - - - - none - protected - true - ${project.build.directory}/javadoc - - - Test helpers packages - com.google.cloud.testing - - - SPI packages - com.google.cloud.spi* - - - - - https://grpc.io/grpc-java/javadoc/ - https://developers.google.com/protocol-buffers/docs/reference/java/ - https://googleapis.dev/java/google-auth-library/latest/ - https://googleapis.dev/java/gax/latest/ - https://googleapis.github.io/api-common-java/ - - - - - - diff --git a/proto-google-cloud-speech-v1/clirr-ignored-differences.xml b/proto-google-cloud-speech-v1/clirr-ignored-differences.xml deleted file mode 100644 index 83a043328..000000000 --- a/proto-google-cloud-speech-v1/clirr-ignored-differences.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - 7012 - com/google/cloud/speech/v1/*OrBuilder - * get*(*) - - - 7012 - com/google/cloud/speech/v1/*OrBuilder - boolean contains*(*) - - - 7012 - com/google/cloud/speech/v1/*OrBuilder - boolean has*(*) - - diff --git a/proto-google-cloud-speech-v1/pom.xml b/proto-google-cloud-speech-v1/pom.xml deleted file mode 100644 index 84099381c..000000000 --- a/proto-google-cloud-speech-v1/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - 4.0.0 - com.google.api.grpc - proto-google-cloud-speech-v1 - 1.24.2-SNAPSHOT - proto-google-cloud-speech-v1 - PROTO library for proto-google-cloud-speech-v1 - - com.google.cloud - google-cloud-speech-parent - 1.24.2-SNAPSHOT - - - - com.google.protobuf - protobuf-java - compile - - - com.google.api.grpc - proto-google-common-protos - compile - - - - - - - org.codehaus.mojo - flatten-maven-plugin - - - - \ No newline at end of file diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadata.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadata.java deleted file mode 100644 index dc1f4c2d9..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadata.java +++ /dev/null @@ -1,1099 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * Describes the progress of a long-running `LongRunningRecognize` call. It is
- * included in the `metadata` field of the `Operation` returned by the
- * `GetOperation` call of the `google::longrunning::Operations` service.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.LongRunningRecognizeMetadata} - */ -public final class LongRunningRecognizeMetadata extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.LongRunningRecognizeMetadata) - LongRunningRecognizeMetadataOrBuilder { - private static final long serialVersionUID = 0L; - // Use LongRunningRecognizeMetadata.newBuilder() to construct. - private LongRunningRecognizeMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private LongRunningRecognizeMetadata() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new LongRunningRecognizeMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private LongRunningRecognizeMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - progressPercent_ = input.readInt32(); - break; - } - case 18: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (startTime_ != null) { - subBuilder = startTime_.toBuilder(); - } - startTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(startTime_); - startTime_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (lastUpdateTime_ != null) { - subBuilder = lastUpdateTime_.toBuilder(); - } - lastUpdateTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(lastUpdateTime_); - lastUpdateTime_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_LongRunningRecognizeMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_LongRunningRecognizeMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.LongRunningRecognizeMetadata.class, - com.google.cloud.speech.v1.LongRunningRecognizeMetadata.Builder.class); - } - - public static final int PROGRESS_PERCENT_FIELD_NUMBER = 1; - private int progressPercent_; - /** - * - * - *
-   * Approximate percentage of audio processed thus far. Guaranteed to be 100
-   * when the audio is fully processed and the results are available.
-   * 
- * - * int32 progress_percent = 1; - * - * @return The progressPercent. - */ - @java.lang.Override - public int getProgressPercent() { - return progressPercent_; - } - - public static final int START_TIME_FIELD_NUMBER = 2; - private com.google.protobuf.Timestamp startTime_; - /** - * - * - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - * - * @return Whether the startTime field is set. - */ - @java.lang.Override - public boolean hasStartTime() { - return startTime_ != null; - } - /** - * - * - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - * - * @return The startTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getStartTime() { - return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; - } - /** - * - * - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { - return getStartTime(); - } - - public static final int LAST_UPDATE_TIME_FIELD_NUMBER = 3; - private com.google.protobuf.Timestamp lastUpdateTime_; - /** - * - * - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * - * @return Whether the lastUpdateTime field is set. - */ - @java.lang.Override - public boolean hasLastUpdateTime() { - return lastUpdateTime_ != null; - } - /** - * - * - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * - * @return The lastUpdateTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getLastUpdateTime() { - return lastUpdateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : lastUpdateTime_; - } - /** - * - * - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder() { - return getLastUpdateTime(); - } - - 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 (progressPercent_ != 0) { - output.writeInt32(1, progressPercent_); - } - if (startTime_ != null) { - output.writeMessage(2, getStartTime()); - } - if (lastUpdateTime_ != null) { - output.writeMessage(3, getLastUpdateTime()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (progressPercent_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, progressPercent_); - } - if (startTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); - } - if (lastUpdateTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getLastUpdateTime()); - } - size += unknownFields.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.LongRunningRecognizeMetadata)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.LongRunningRecognizeMetadata other = - (com.google.cloud.speech.v1.LongRunningRecognizeMetadata) obj; - - if (getProgressPercent() != other.getProgressPercent()) return false; - if (hasStartTime() != other.hasStartTime()) return false; - if (hasStartTime()) { - if (!getStartTime().equals(other.getStartTime())) return false; - } - if (hasLastUpdateTime() != other.hasLastUpdateTime()) return false; - if (hasLastUpdateTime()) { - if (!getLastUpdateTime().equals(other.getLastUpdateTime())) return false; - } - if (!unknownFields.equals(other.unknownFields)) 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) + PROGRESS_PERCENT_FIELD_NUMBER; - hash = (53 * hash) + getProgressPercent(); - if (hasStartTime()) { - hash = (37 * hash) + START_TIME_FIELD_NUMBER; - hash = (53 * hash) + getStartTime().hashCode(); - } - if (hasLastUpdateTime()) { - hash = (37 * hash) + LAST_UPDATE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getLastUpdateTime().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata 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.LongRunningRecognizeMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata 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.LongRunningRecognizeMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata 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.LongRunningRecognizeMetadata parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata 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.LongRunningRecognizeMetadata parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata 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.LongRunningRecognizeMetadata 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.LongRunningRecognizeMetadata 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.LongRunningRecognizeMetadata 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; - } - /** - * - * - *
-   * Describes the progress of a long-running `LongRunningRecognize` call. It is
-   * included in the `metadata` field of the `Operation` returned by the
-   * `GetOperation` call of the `google::longrunning::Operations` service.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.LongRunningRecognizeMetadata} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.LongRunningRecognizeMetadata) - com.google.cloud.speech.v1.LongRunningRecognizeMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_LongRunningRecognizeMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_LongRunningRecognizeMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.LongRunningRecognizeMetadata.class, - com.google.cloud.speech.v1.LongRunningRecognizeMetadata.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.LongRunningRecognizeMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - progressPercent_ = 0; - - if (startTimeBuilder_ == null) { - startTime_ = null; - } else { - startTime_ = null; - startTimeBuilder_ = null; - } - if (lastUpdateTimeBuilder_ == null) { - lastUpdateTime_ = null; - } else { - lastUpdateTime_ = null; - lastUpdateTimeBuilder_ = null; - } - 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_LongRunningRecognizeMetadata_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeMetadata getDefaultInstanceForType() { - return com.google.cloud.speech.v1.LongRunningRecognizeMetadata.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeMetadata build() { - com.google.cloud.speech.v1.LongRunningRecognizeMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeMetadata buildPartial() { - com.google.cloud.speech.v1.LongRunningRecognizeMetadata result = - new com.google.cloud.speech.v1.LongRunningRecognizeMetadata(this); - result.progressPercent_ = progressPercent_; - if (startTimeBuilder_ == null) { - result.startTime_ = startTime_; - } else { - result.startTime_ = startTimeBuilder_.build(); - } - if (lastUpdateTimeBuilder_ == null) { - result.lastUpdateTime_ = lastUpdateTime_; - } else { - result.lastUpdateTime_ = lastUpdateTimeBuilder_.build(); - } - 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.LongRunningRecognizeMetadata) { - return mergeFrom((com.google.cloud.speech.v1.LongRunningRecognizeMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.LongRunningRecognizeMetadata other) { - if (other == com.google.cloud.speech.v1.LongRunningRecognizeMetadata.getDefaultInstance()) - return this; - if (other.getProgressPercent() != 0) { - setProgressPercent(other.getProgressPercent()); - } - if (other.hasStartTime()) { - mergeStartTime(other.getStartTime()); - } - if (other.hasLastUpdateTime()) { - mergeLastUpdateTime(other.getLastUpdateTime()); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1.LongRunningRecognizeMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1.LongRunningRecognizeMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int progressPercent_; - /** - * - * - *
-     * Approximate percentage of audio processed thus far. Guaranteed to be 100
-     * when the audio is fully processed and the results are available.
-     * 
- * - * int32 progress_percent = 1; - * - * @return The progressPercent. - */ - @java.lang.Override - public int getProgressPercent() { - return progressPercent_; - } - /** - * - * - *
-     * Approximate percentage of audio processed thus far. Guaranteed to be 100
-     * when the audio is fully processed and the results are available.
-     * 
- * - * int32 progress_percent = 1; - * - * @param value The progressPercent to set. - * @return This builder for chaining. - */ - public Builder setProgressPercent(int value) { - - progressPercent_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Approximate percentage of audio processed thus far. Guaranteed to be 100
-     * when the audio is fully processed and the results are available.
-     * 
- * - * int32 progress_percent = 1; - * - * @return This builder for chaining. - */ - public Builder clearProgressPercent() { - - progressPercent_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp startTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - startTimeBuilder_; - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - * - * @return Whether the startTime field is set. - */ - public boolean hasStartTime() { - return startTimeBuilder_ != null || startTime_ != null; - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - * - * @return The startTime. - */ - public com.google.protobuf.Timestamp getStartTime() { - if (startTimeBuilder_ == null) { - return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; - } else { - return startTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public Builder setStartTime(com.google.protobuf.Timestamp value) { - if (startTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - startTime_ = value; - onChanged(); - } else { - startTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (startTimeBuilder_ == null) { - startTime_ = builderForValue.build(); - onChanged(); - } else { - startTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public Builder mergeStartTime(com.google.protobuf.Timestamp value) { - if (startTimeBuilder_ == null) { - if (startTime_ != null) { - startTime_ = - com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); - } else { - startTime_ = value; - } - onChanged(); - } else { - startTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public Builder clearStartTime() { - if (startTimeBuilder_ == null) { - startTime_ = null; - onChanged(); - } else { - startTime_ = null; - startTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { - - onChanged(); - return getStartTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { - if (startTimeBuilder_ != null) { - return startTimeBuilder_.getMessageOrBuilder(); - } else { - return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; - } - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getStartTimeFieldBuilder() { - if (startTimeBuilder_ == null) { - startTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getStartTime(), getParentForChildren(), isClean()); - startTime_ = null; - } - return startTimeBuilder_; - } - - private com.google.protobuf.Timestamp lastUpdateTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - lastUpdateTimeBuilder_; - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * - * @return Whether the lastUpdateTime field is set. - */ - public boolean hasLastUpdateTime() { - return lastUpdateTimeBuilder_ != null || lastUpdateTime_ != null; - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * - * @return The lastUpdateTime. - */ - public com.google.protobuf.Timestamp getLastUpdateTime() { - if (lastUpdateTimeBuilder_ == null) { - return lastUpdateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : lastUpdateTime_; - } else { - return lastUpdateTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public Builder setLastUpdateTime(com.google.protobuf.Timestamp value) { - if (lastUpdateTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - lastUpdateTime_ = value; - onChanged(); - } else { - lastUpdateTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public Builder setLastUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (lastUpdateTimeBuilder_ == null) { - lastUpdateTime_ = builderForValue.build(); - onChanged(); - } else { - lastUpdateTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public Builder mergeLastUpdateTime(com.google.protobuf.Timestamp value) { - if (lastUpdateTimeBuilder_ == null) { - if (lastUpdateTime_ != null) { - lastUpdateTime_ = - com.google.protobuf.Timestamp.newBuilder(lastUpdateTime_) - .mergeFrom(value) - .buildPartial(); - } else { - lastUpdateTime_ = value; - } - onChanged(); - } else { - lastUpdateTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public Builder clearLastUpdateTime() { - if (lastUpdateTimeBuilder_ == null) { - lastUpdateTime_ = null; - onChanged(); - } else { - lastUpdateTime_ = null; - lastUpdateTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public com.google.protobuf.Timestamp.Builder getLastUpdateTimeBuilder() { - - onChanged(); - return getLastUpdateTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder() { - if (lastUpdateTimeBuilder_ != null) { - return lastUpdateTimeBuilder_.getMessageOrBuilder(); - } else { - return lastUpdateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : lastUpdateTime_; - } - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getLastUpdateTimeFieldBuilder() { - if (lastUpdateTimeBuilder_ == null) { - lastUpdateTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getLastUpdateTime(), getParentForChildren(), isClean()); - lastUpdateTime_ = null; - } - return lastUpdateTimeBuilder_; - } - - @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.LongRunningRecognizeMetadata) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.LongRunningRecognizeMetadata) - private static final com.google.cloud.speech.v1.LongRunningRecognizeMetadata DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.LongRunningRecognizeMetadata(); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public LongRunningRecognizeMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new LongRunningRecognizeMetadata(input, extensionRegistry); - } - }; - - 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.LongRunningRecognizeMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadataOrBuilder.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadataOrBuilder.java deleted file mode 100644 index 4b9835f3d..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadataOrBuilder.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * 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 LongRunningRecognizeMetadataOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.LongRunningRecognizeMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Approximate percentage of audio processed thus far. Guaranteed to be 100
-   * when the audio is fully processed and the results are available.
-   * 
- * - * int32 progress_percent = 1; - * - * @return The progressPercent. - */ - int getProgressPercent(); - - /** - * - * - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - * - * @return Whether the startTime field is set. - */ - boolean hasStartTime(); - /** - * - * - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - * - * @return The startTime. - */ - com.google.protobuf.Timestamp getStartTime(); - /** - * - * - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); - - /** - * - * - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * - * @return Whether the lastUpdateTime field is set. - */ - boolean hasLastUpdateTime(); - /** - * - * - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * - * @return The lastUpdateTime. - */ - com.google.protobuf.Timestamp getLastUpdateTime(); - /** - * - * - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder(); -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequest.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequest.java deleted file mode 100644 index 99010b1e1..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequest.java +++ /dev/null @@ -1,1073 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * The top-level message sent by the client for the `LongRunningRecognize`
- * method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.LongRunningRecognizeRequest} - */ -public final class LongRunningRecognizeRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.LongRunningRecognizeRequest) - LongRunningRecognizeRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use LongRunningRecognizeRequest.newBuilder() to construct. - private LongRunningRecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private LongRunningRecognizeRequest() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new LongRunningRecognizeRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private LongRunningRecognizeRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.speech.v1.RecognitionConfig.Builder subBuilder = null; - if (config_ != null) { - subBuilder = config_.toBuilder(); - } - config_ = - input.readMessage( - com.google.cloud.speech.v1.RecognitionConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(config_); - config_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.cloud.speech.v1.RecognitionAudio.Builder subBuilder = null; - if (audio_ != null) { - subBuilder = audio_.toBuilder(); - } - audio_ = - input.readMessage( - com.google.cloud.speech.v1.RecognitionAudio.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(audio_); - audio_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_LongRunningRecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_LongRunningRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.LongRunningRecognizeRequest.class, - com.google.cloud.speech.v1.LongRunningRecognizeRequest.Builder.class); - } - - public static final int CONFIG_FIELD_NUMBER = 1; - private com.google.cloud.speech.v1.RecognitionConfig config_; - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the config field is set. - */ - @java.lang.Override - public boolean hasConfig() { - return config_ != null; - } - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The config. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfig getConfig() { - return config_ == null - ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() - : config_; - } - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder() { - return getConfig(); - } - - public static final int AUDIO_FIELD_NUMBER = 2; - private com.google.cloud.speech.v1.RecognitionAudio audio_; - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the audio field is set. - */ - @java.lang.Override - public boolean hasAudio() { - return audio_ != null; - } - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The audio. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionAudio getAudio() { - return audio_ == null - ? com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance() - : audio_; - } - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionAudioOrBuilder getAudioOrBuilder() { - return getAudio(); - } - - 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 (config_ != null) { - output.writeMessage(1, getConfig()); - } - if (audio_ != null) { - output.writeMessage(2, getAudio()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (config_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getConfig()); - } - if (audio_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAudio()); - } - size += unknownFields.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.LongRunningRecognizeRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.LongRunningRecognizeRequest other = - (com.google.cloud.speech.v1.LongRunningRecognizeRequest) obj; - - if (hasConfig() != other.hasConfig()) return false; - if (hasConfig()) { - if (!getConfig().equals(other.getConfig())) return false; - } - if (hasAudio() != other.hasAudio()) return false; - if (hasAudio()) { - if (!getAudio().equals(other.getAudio())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConfig()) { - hash = (37 * hash) + CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getConfig().hashCode(); - } - if (hasAudio()) { - hash = (37 * hash) + AUDIO_FIELD_NUMBER; - hash = (53 * hash) + getAudio().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeRequest 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.LongRunningRecognizeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeRequest 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.LongRunningRecognizeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeRequest 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.LongRunningRecognizeRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeRequest 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.LongRunningRecognizeRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeRequest 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.LongRunningRecognizeRequest 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.LongRunningRecognizeRequest 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.LongRunningRecognizeRequest 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; - } - /** - * - * - *
-   * The top-level message sent by the client for the `LongRunningRecognize`
-   * method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.LongRunningRecognizeRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.LongRunningRecognizeRequest) - com.google.cloud.speech.v1.LongRunningRecognizeRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_LongRunningRecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_LongRunningRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.LongRunningRecognizeRequest.class, - com.google.cloud.speech.v1.LongRunningRecognizeRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.LongRunningRecognizeRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (configBuilder_ == null) { - config_ = null; - } else { - config_ = null; - configBuilder_ = null; - } - if (audioBuilder_ == null) { - audio_ = null; - } else { - audio_ = null; - audioBuilder_ = null; - } - 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_LongRunningRecognizeRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1.LongRunningRecognizeRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeRequest build() { - com.google.cloud.speech.v1.LongRunningRecognizeRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeRequest buildPartial() { - com.google.cloud.speech.v1.LongRunningRecognizeRequest result = - new com.google.cloud.speech.v1.LongRunningRecognizeRequest(this); - if (configBuilder_ == null) { - result.config_ = config_; - } else { - result.config_ = configBuilder_.build(); - } - if (audioBuilder_ == null) { - result.audio_ = audio_; - } else { - result.audio_ = audioBuilder_.build(); - } - 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.LongRunningRecognizeRequest) { - return mergeFrom((com.google.cloud.speech.v1.LongRunningRecognizeRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.LongRunningRecognizeRequest other) { - if (other == com.google.cloud.speech.v1.LongRunningRecognizeRequest.getDefaultInstance()) - return this; - if (other.hasConfig()) { - mergeConfig(other.getConfig()); - } - if (other.hasAudio()) { - mergeAudio(other.getAudio()); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1.LongRunningRecognizeRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1.LongRunningRecognizeRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.speech.v1.RecognitionConfig config_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionConfig, - com.google.cloud.speech.v1.RecognitionConfig.Builder, - com.google.cloud.speech.v1.RecognitionConfigOrBuilder> - configBuilder_; - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the config field is set. - */ - public boolean hasConfig() { - return configBuilder_ != null || config_ != null; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The config. - */ - public com.google.cloud.speech.v1.RecognitionConfig getConfig() { - if (configBuilder_ == null) { - return config_ == null - ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() - : config_; - } else { - return configBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setConfig(com.google.cloud.speech.v1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - config_ = value; - onChanged(); - } else { - configBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setConfig(com.google.cloud.speech.v1.RecognitionConfig.Builder builderForValue) { - if (configBuilder_ == null) { - config_ = builderForValue.build(); - onChanged(); - } else { - configBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeConfig(com.google.cloud.speech.v1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (config_ != null) { - config_ = - com.google.cloud.speech.v1.RecognitionConfig.newBuilder(config_) - .mergeFrom(value) - .buildPartial(); - } else { - config_ = value; - } - onChanged(); - } else { - configBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearConfig() { - if (configBuilder_ == null) { - config_ = null; - onChanged(); - } else { - config_ = null; - configBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.speech.v1.RecognitionConfig.Builder getConfigBuilder() { - - onChanged(); - return getConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder() { - if (configBuilder_ != null) { - return configBuilder_.getMessageOrBuilder(); - } else { - return config_ == null - ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() - : config_; - } - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionConfig, - com.google.cloud.speech.v1.RecognitionConfig.Builder, - com.google.cloud.speech.v1.RecognitionConfigOrBuilder> - getConfigFieldBuilder() { - if (configBuilder_ == null) { - configBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionConfig, - com.google.cloud.speech.v1.RecognitionConfig.Builder, - com.google.cloud.speech.v1.RecognitionConfigOrBuilder>( - getConfig(), getParentForChildren(), isClean()); - config_ = null; - } - return configBuilder_; - } - - private com.google.cloud.speech.v1.RecognitionAudio audio_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionAudio, - com.google.cloud.speech.v1.RecognitionAudio.Builder, - com.google.cloud.speech.v1.RecognitionAudioOrBuilder> - audioBuilder_; - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the audio field is set. - */ - public boolean hasAudio() { - return audioBuilder_ != null || audio_ != null; - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The audio. - */ - public com.google.cloud.speech.v1.RecognitionAudio getAudio() { - if (audioBuilder_ == null) { - return audio_ == null - ? com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance() - : audio_; - } else { - return audioBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setAudio(com.google.cloud.speech.v1.RecognitionAudio value) { - if (audioBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - audio_ = value; - onChanged(); - } else { - audioBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setAudio(com.google.cloud.speech.v1.RecognitionAudio.Builder builderForValue) { - if (audioBuilder_ == null) { - audio_ = builderForValue.build(); - onChanged(); - } else { - audioBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeAudio(com.google.cloud.speech.v1.RecognitionAudio value) { - if (audioBuilder_ == null) { - if (audio_ != null) { - audio_ = - com.google.cloud.speech.v1.RecognitionAudio.newBuilder(audio_) - .mergeFrom(value) - .buildPartial(); - } else { - audio_ = value; - } - onChanged(); - } else { - audioBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearAudio() { - if (audioBuilder_ == null) { - audio_ = null; - onChanged(); - } else { - audio_ = null; - audioBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.speech.v1.RecognitionAudio.Builder getAudioBuilder() { - - onChanged(); - return getAudioFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.speech.v1.RecognitionAudioOrBuilder getAudioOrBuilder() { - if (audioBuilder_ != null) { - return audioBuilder_.getMessageOrBuilder(); - } else { - return audio_ == null - ? com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance() - : audio_; - } - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionAudio, - com.google.cloud.speech.v1.RecognitionAudio.Builder, - com.google.cloud.speech.v1.RecognitionAudioOrBuilder> - getAudioFieldBuilder() { - if (audioBuilder_ == null) { - audioBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionAudio, - com.google.cloud.speech.v1.RecognitionAudio.Builder, - com.google.cloud.speech.v1.RecognitionAudioOrBuilder>( - getAudio(), getParentForChildren(), isClean()); - audio_ = null; - } - return audioBuilder_; - } - - @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.LongRunningRecognizeRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.LongRunningRecognizeRequest) - private static final com.google.cloud.speech.v1.LongRunningRecognizeRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.LongRunningRecognizeRequest(); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public LongRunningRecognizeRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new LongRunningRecognizeRequest(input, extensionRegistry); - } - }; - - 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.LongRunningRecognizeRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequestOrBuilder.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequestOrBuilder.java deleted file mode 100644 index f6fba77a2..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequestOrBuilder.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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 LongRunningRecognizeRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.LongRunningRecognizeRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the config field is set. - */ - boolean hasConfig(); - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The config. - */ - com.google.cloud.speech.v1.RecognitionConfig getConfig(); - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder(); - - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the audio field is set. - */ - boolean hasAudio(); - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The audio. - */ - com.google.cloud.speech.v1.RecognitionAudio getAudio(); - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.speech.v1.RecognitionAudioOrBuilder getAudioOrBuilder(); -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponse.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponse.java deleted file mode 100644 index 53981f26c..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponse.java +++ /dev/null @@ -1,988 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * The only message returned to the client by the `LongRunningRecognize` method.
- * It contains the result as zero or more sequential `SpeechRecognitionResult`
- * messages. It is included in the `result.response` field of the `Operation`
- * returned by the `GetOperation` call of the `google::longrunning::Operations`
- * service.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.LongRunningRecognizeResponse} - */ -public final class LongRunningRecognizeResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.LongRunningRecognizeResponse) - LongRunningRecognizeResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use LongRunningRecognizeResponse.newBuilder() to construct. - private LongRunningRecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private LongRunningRecognizeResponse() { - results_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new LongRunningRecognizeResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private LongRunningRecognizeResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - results_.add( - input.readMessage( - com.google.cloud.speech.v1.SpeechRecognitionResult.parser(), - extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_LongRunningRecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_LongRunningRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.LongRunningRecognizeResponse.class, - com.google.cloud.speech.v1.LongRunningRecognizeResponse.Builder.class); - } - - public static final int RESULTS_FIELD_NUMBER = 2; - private java.util.List results_; - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List getResultsList() { - return results_; - } - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List - getResultsOrBuilderList() { - return results_; - } - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public int getResultsCount() { - return results_.size(); - } - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionResult getResults(int index) { - return results_.get(index); - } - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - return results_.get(index); - } - - 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 { - for (int i = 0; i < results_.size(); i++) { - output.writeMessage(2, results_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < results_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, results_.get(i)); - } - size += unknownFields.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.LongRunningRecognizeResponse)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.LongRunningRecognizeResponse other = - (com.google.cloud.speech.v1.LongRunningRecognizeResponse) obj; - - if (!getResultsList().equals(other.getResultsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getResultsCount() > 0) { - hash = (37 * hash) + RESULTS_FIELD_NUMBER; - hash = (53 * hash) + getResultsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeResponse 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.LongRunningRecognizeResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeResponse 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.LongRunningRecognizeResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeResponse 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.LongRunningRecognizeResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeResponse 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.LongRunningRecognizeResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeResponse 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.LongRunningRecognizeResponse 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.LongRunningRecognizeResponse 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.LongRunningRecognizeResponse 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; - } - /** - * - * - *
-   * The only message returned to the client by the `LongRunningRecognize` method.
-   * It contains the result as zero or more sequential `SpeechRecognitionResult`
-   * messages. It is included in the `result.response` field of the `Operation`
-   * returned by the `GetOperation` call of the `google::longrunning::Operations`
-   * service.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.LongRunningRecognizeResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.LongRunningRecognizeResponse) - com.google.cloud.speech.v1.LongRunningRecognizeResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_LongRunningRecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_LongRunningRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.LongRunningRecognizeResponse.class, - com.google.cloud.speech.v1.LongRunningRecognizeResponse.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.LongRunningRecognizeResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getResultsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - resultsBuilder_.clear(); - } - 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_LongRunningRecognizeResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeResponse getDefaultInstanceForType() { - return com.google.cloud.speech.v1.LongRunningRecognizeResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeResponse build() { - com.google.cloud.speech.v1.LongRunningRecognizeResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeResponse buildPartial() { - com.google.cloud.speech.v1.LongRunningRecognizeResponse result = - new com.google.cloud.speech.v1.LongRunningRecognizeResponse(this); - int from_bitField0_ = bitField0_; - if (resultsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.results_ = results_; - } else { - result.results_ = resultsBuilder_.build(); - } - 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.LongRunningRecognizeResponse) { - return mergeFrom((com.google.cloud.speech.v1.LongRunningRecognizeResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.LongRunningRecognizeResponse other) { - if (other == com.google.cloud.speech.v1.LongRunningRecognizeResponse.getDefaultInstance()) - return this; - if (resultsBuilder_ == null) { - if (!other.results_.isEmpty()) { - if (results_.isEmpty()) { - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResultsIsMutable(); - results_.addAll(other.results_); - } - onChanged(); - } - } else { - if (!other.results_.isEmpty()) { - if (resultsBuilder_.isEmpty()) { - resultsBuilder_.dispose(); - resultsBuilder_ = null; - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - resultsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getResultsFieldBuilder() - : null; - } else { - resultsBuilder_.addAllMessages(other.results_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1.LongRunningRecognizeResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1.LongRunningRecognizeResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List results_ = - java.util.Collections.emptyList(); - - private void ensureResultsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - results_ = - new java.util.ArrayList(results_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionResult, - com.google.cloud.speech.v1.SpeechRecognitionResult.Builder, - com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder> - resultsBuilder_; - - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public java.util.List getResultsList() { - if (resultsBuilder_ == null) { - return java.util.Collections.unmodifiableList(results_); - } else { - return resultsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public int getResultsCount() { - if (resultsBuilder_ == null) { - return results_.size(); - } else { - return resultsBuilder_.getCount(); - } - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.SpeechRecognitionResult getResults(int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder setResults(int index, com.google.cloud.speech.v1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.set(index, value); - onChanged(); - } else { - resultsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.set(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder addResults(com.google.cloud.speech.v1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(value); - onChanged(); - } else { - resultsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder addResults(int index, com.google.cloud.speech.v1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(index, value); - onChanged(); - } else { - resultsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - com.google.cloud.speech.v1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder addAllResults( - java.lang.Iterable values) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); - onChanged(); - } else { - resultsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder clearResults() { - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - resultsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder removeResults(int index) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.remove(index); - onChanged(); - } else { - resultsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.SpeechRecognitionResult.Builder getResultsBuilder(int index) { - return getResultsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsOrBuilderList() { - if (resultsBuilder_ != null) { - return resultsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(results_); - } - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.SpeechRecognitionResult.Builder addResultsBuilder() { - return getResultsFieldBuilder() - .addBuilder(com.google.cloud.speech.v1.SpeechRecognitionResult.getDefaultInstance()); - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.SpeechRecognitionResult.Builder addResultsBuilder(int index) { - return getResultsFieldBuilder() - .addBuilder( - index, com.google.cloud.speech.v1.SpeechRecognitionResult.getDefaultInstance()); - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsBuilderList() { - return getResultsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionResult, - com.google.cloud.speech.v1.SpeechRecognitionResult.Builder, - com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder> - getResultsFieldBuilder() { - if (resultsBuilder_ == null) { - resultsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionResult, - com.google.cloud.speech.v1.SpeechRecognitionResult.Builder, - com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder>( - results_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - results_ = null; - } - return resultsBuilder_; - } - - @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.LongRunningRecognizeResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.LongRunningRecognizeResponse) - private static final com.google.cloud.speech.v1.LongRunningRecognizeResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.LongRunningRecognizeResponse(); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public LongRunningRecognizeResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new LongRunningRecognizeResponse(input, extensionRegistry); - } - }; - - 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.LongRunningRecognizeResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponseOrBuilder.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponseOrBuilder.java deleted file mode 100644 index f36273762..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponseOrBuilder.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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 LongRunningRecognizeResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.LongRunningRecognizeResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - java.util.List getResultsList(); - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - com.google.cloud.speech.v1.SpeechRecognitionResult getResults(int index); - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - int getResultsCount(); - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - java.util.List - getResultsOrBuilderList(); - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder getResultsOrBuilder(int index); -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudio.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudio.java deleted file mode 100644 index df04b6b76..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudio.java +++ /dev/null @@ -1,901 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * Contains audio data in the encoding specified in the `RecognitionConfig`.
- * Either `content` or `uri` must be supplied. Supplying both or neither
- * returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See
- * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.RecognitionAudio} - */ -public final class RecognitionAudio extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.RecognitionAudio) - RecognitionAudioOrBuilder { - private static final long serialVersionUID = 0L; - // Use RecognitionAudio.newBuilder() to construct. - private RecognitionAudio(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private RecognitionAudio() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RecognitionAudio(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private RecognitionAudio( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - audioSourceCase_ = 1; - audioSource_ = input.readBytes(); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - audioSourceCase_ = 2; - audioSource_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_RecognitionAudio_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_RecognitionAudio_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.RecognitionAudio.class, - com.google.cloud.speech.v1.RecognitionAudio.Builder.class); - } - - private int audioSourceCase_ = 0; - private java.lang.Object audioSource_; - - public enum AudioSourceCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - CONTENT(1), - URI(2), - AUDIOSOURCE_NOT_SET(0); - private final int value; - - private AudioSourceCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static AudioSourceCase valueOf(int value) { - return forNumber(value); - } - - public static AudioSourceCase forNumber(int value) { - switch (value) { - case 1: - return CONTENT; - case 2: - return URI; - case 0: - return AUDIOSOURCE_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public AudioSourceCase getAudioSourceCase() { - return AudioSourceCase.forNumber(audioSourceCase_); - } - - public static final int CONTENT_FIELD_NUMBER = 1; - /** - * - * - *
-   * The audio data bytes encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation, whereas JSON representations use base64.
-   * 
- * - * bytes content = 1; - * - * @return The content. - */ - @java.lang.Override - public com.google.protobuf.ByteString getContent() { - if (audioSourceCase_ == 1) { - return (com.google.protobuf.ByteString) audioSource_; - } - return com.google.protobuf.ByteString.EMPTY; - } - - public static final int URI_FIELD_NUMBER = 2; - /** - * - * - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-   * Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - * - * @return The uri. - */ - public java.lang.String getUri() { - java.lang.Object ref = ""; - if (audioSourceCase_ == 2) { - ref = audioSource_; - } - 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(); - if (audioSourceCase_ == 2) { - audioSource_ = s; - } - return s; - } - } - /** - * - * - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-   * Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - * - * @return The bytes for uri. - */ - public com.google.protobuf.ByteString getUriBytes() { - java.lang.Object ref = ""; - if (audioSourceCase_ == 2) { - ref = audioSource_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - if (audioSourceCase_ == 2) { - audioSource_ = 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 (audioSourceCase_ == 1) { - output.writeBytes(1, (com.google.protobuf.ByteString) audioSource_); - } - if (audioSourceCase_ == 2) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, audioSource_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (audioSourceCase_ == 1) { - size += - com.google.protobuf.CodedOutputStream.computeBytesSize( - 1, (com.google.protobuf.ByteString) audioSource_); - } - if (audioSourceCase_ == 2) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, audioSource_); - } - size += unknownFields.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.RecognitionAudio)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.RecognitionAudio other = - (com.google.cloud.speech.v1.RecognitionAudio) obj; - - if (!getAudioSourceCase().equals(other.getAudioSourceCase())) return false; - switch (audioSourceCase_) { - case 1: - if (!getContent().equals(other.getContent())) return false; - break; - case 2: - if (!getUri().equals(other.getUri())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (audioSourceCase_) { - case 1: - hash = (37 * hash) + CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getContent().hashCode(); - break; - case 2: - hash = (37 * hash) + URI_FIELD_NUMBER; - hash = (53 * hash) + getUri().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.RecognitionAudio parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.RecognitionAudio 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.RecognitionAudio parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.RecognitionAudio 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.RecognitionAudio parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.RecognitionAudio 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.RecognitionAudio parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.RecognitionAudio 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.RecognitionAudio parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.RecognitionAudio 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.RecognitionAudio 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.RecognitionAudio 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.RecognitionAudio 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; - } - /** - * - * - *
-   * Contains audio data in the encoding specified in the `RecognitionConfig`.
-   * Either `content` or `uri` must be supplied. Supplying both or neither
-   * returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See
-   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.RecognitionAudio} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.RecognitionAudio) - com.google.cloud.speech.v1.RecognitionAudioOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_RecognitionAudio_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_RecognitionAudio_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.RecognitionAudio.class, - com.google.cloud.speech.v1.RecognitionAudio.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.RecognitionAudio.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - audioSourceCase_ = 0; - audioSource_ = null; - 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_RecognitionAudio_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionAudio getDefaultInstanceForType() { - return com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionAudio build() { - com.google.cloud.speech.v1.RecognitionAudio result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionAudio buildPartial() { - com.google.cloud.speech.v1.RecognitionAudio result = - new com.google.cloud.speech.v1.RecognitionAudio(this); - if (audioSourceCase_ == 1) { - result.audioSource_ = audioSource_; - } - if (audioSourceCase_ == 2) { - result.audioSource_ = audioSource_; - } - result.audioSourceCase_ = audioSourceCase_; - 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.RecognitionAudio) { - return mergeFrom((com.google.cloud.speech.v1.RecognitionAudio) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.RecognitionAudio other) { - if (other == com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance()) return this; - switch (other.getAudioSourceCase()) { - case CONTENT: - { - setContent(other.getContent()); - break; - } - case URI: - { - audioSourceCase_ = 2; - audioSource_ = other.audioSource_; - onChanged(); - break; - } - case AUDIOSOURCE_NOT_SET: - { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1.RecognitionAudio parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.RecognitionAudio) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int audioSourceCase_ = 0; - private java.lang.Object audioSource_; - - public AudioSourceCase getAudioSourceCase() { - return AudioSourceCase.forNumber(audioSourceCase_); - } - - public Builder clearAudioSource() { - audioSourceCase_ = 0; - audioSource_ = null; - onChanged(); - return this; - } - - /** - * - * - *
-     * The audio data bytes encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation, whereas JSON representations use base64.
-     * 
- * - * bytes content = 1; - * - * @return The content. - */ - public com.google.protobuf.ByteString getContent() { - if (audioSourceCase_ == 1) { - return (com.google.protobuf.ByteString) audioSource_; - } - return com.google.protobuf.ByteString.EMPTY; - } - /** - * - * - *
-     * The audio data bytes encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation, whereas JSON representations use base64.
-     * 
- * - * bytes content = 1; - * - * @param value The content to set. - * @return This builder for chaining. - */ - public Builder setContent(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - audioSourceCase_ = 1; - audioSource_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The audio data bytes encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation, whereas JSON representations use base64.
-     * 
- * - * bytes content = 1; - * - * @return This builder for chaining. - */ - public Builder clearContent() { - if (audioSourceCase_ == 1) { - audioSourceCase_ = 0; - audioSource_ = null; - onChanged(); - } - return this; - } - - /** - * - * - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * - * @return The uri. - */ - @java.lang.Override - public java.lang.String getUri() { - java.lang.Object ref = ""; - if (audioSourceCase_ == 2) { - ref = audioSource_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (audioSourceCase_ == 2) { - audioSource_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * - * @return The bytes for uri. - */ - @java.lang.Override - public com.google.protobuf.ByteString getUriBytes() { - java.lang.Object ref = ""; - if (audioSourceCase_ == 2) { - ref = audioSource_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - if (audioSourceCase_ == 2) { - audioSource_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * - * @param value The uri to set. - * @return This builder for chaining. - */ - public Builder setUri(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - audioSourceCase_ = 2; - audioSource_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * - * @return This builder for chaining. - */ - public Builder clearUri() { - if (audioSourceCase_ == 2) { - audioSourceCase_ = 0; - audioSource_ = null; - onChanged(); - } - return this; - } - /** - * - * - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * - * @param value The bytes for uri to set. - * @return This builder for chaining. - */ - public Builder setUriBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - audioSourceCase_ = 2; - audioSource_ = 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.RecognitionAudio) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognitionAudio) - private static final com.google.cloud.speech.v1.RecognitionAudio DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.RecognitionAudio(); - } - - public static com.google.cloud.speech.v1.RecognitionAudio getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecognitionAudio parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognitionAudio(input, extensionRegistry); - } - }; - - 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.RecognitionAudio getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudioOrBuilder.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudioOrBuilder.java deleted file mode 100644 index d5a8cca14..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudioOrBuilder.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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 RecognitionAudioOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.RecognitionAudio) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The audio data bytes encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation, whereas JSON representations use base64.
-   * 
- * - * bytes content = 1; - * - * @return The content. - */ - com.google.protobuf.ByteString getContent(); - - /** - * - * - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-   * Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - * - * @return The uri. - */ - java.lang.String getUri(); - /** - * - * - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-   * Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - * - * @return The bytes for uri. - */ - com.google.protobuf.ByteString getUriBytes(); - - public com.google.cloud.speech.v1.RecognitionAudio.AudioSourceCase getAudioSourceCase(); -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfig.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfig.java deleted file mode 100644 index 61696f28b..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfig.java +++ /dev/null @@ -1,3691 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * Provides information to the recognizer that specifies how to process the
- * request.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.RecognitionConfig} - */ -public final class RecognitionConfig extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.RecognitionConfig) - RecognitionConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use RecognitionConfig.newBuilder() to construct. - private RecognitionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private RecognitionConfig() { - encoding_ = 0; - languageCode_ = ""; - speechContexts_ = java.util.Collections.emptyList(); - model_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RecognitionConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private RecognitionConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - int rawValue = input.readEnum(); - - encoding_ = rawValue; - break; - } - case 16: - { - sampleRateHertz_ = input.readInt32(); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - languageCode_ = s; - break; - } - case 32: - { - maxAlternatives_ = input.readInt32(); - break; - } - case 40: - { - profanityFilter_ = input.readBool(); - break; - } - case 50: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - speechContexts_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - speechContexts_.add( - input.readMessage( - com.google.cloud.speech.v1.SpeechContext.parser(), extensionRegistry)); - break; - } - case 56: - { - audioChannelCount_ = input.readInt32(); - break; - } - case 64: - { - enableWordTimeOffsets_ = input.readBool(); - break; - } - case 74: - { - com.google.cloud.speech.v1.RecognitionMetadata.Builder subBuilder = null; - if (metadata_ != null) { - subBuilder = metadata_.toBuilder(); - } - metadata_ = - input.readMessage( - com.google.cloud.speech.v1.RecognitionMetadata.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metadata_); - metadata_ = subBuilder.buildPartial(); - } - - break; - } - case 88: - { - enableAutomaticPunctuation_ = input.readBool(); - break; - } - case 96: - { - enableSeparateRecognitionPerChannel_ = input.readBool(); - break; - } - case 106: - { - java.lang.String s = input.readStringRequireUtf8(); - - model_ = s; - break; - } - case 112: - { - useEnhanced_ = input.readBool(); - break; - } - case 154: - { - com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder subBuilder = null; - if (diarizationConfig_ != null) { - subBuilder = diarizationConfig_.toBuilder(); - } - diarizationConfig_ = - input.readMessage( - com.google.cloud.speech.v1.SpeakerDiarizationConfig.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(diarizationConfig_); - diarizationConfig_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - speechContexts_ = java.util.Collections.unmodifiableList(speechContexts_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_RecognitionConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_RecognitionConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.RecognitionConfig.class, - com.google.cloud.speech.v1.RecognitionConfig.Builder.class); - } - - /** - * - * - *
-   * The encoding of the audio data sent in the request.
-   * All encodings support only 1 channel (mono) audio, unless the
-   * `audio_channel_count` and `enable_separate_recognition_per_channel` fields
-   * are set.
-   * For best results, the audio source should be captured and transmitted using
-   * a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech
-   * recognition can be reduced if lossy codecs are used to capture or transmit
-   * audio, particularly if background noise is present. Lossy codecs include
-   * `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, and `MP3`.
-   * The `FLAC` and `WAV` audio file formats include a header that describes the
-   * included audio content. You can request recognition for `WAV` files that
-   * contain either `LINEAR16` or `MULAW` encoded audio.
-   * If you send `FLAC` or `WAV` audio file format in
-   * your request, you do not need to specify an `AudioEncoding`; the audio
-   * encoding format is determined from the file header. If you specify
-   * an `AudioEncoding` when you send  send `FLAC` or `WAV` audio, the
-   * encoding configuration must match the encoding described in the audio
-   * header; otherwise the request returns an
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error code.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1.RecognitionConfig.AudioEncoding} - */ - public enum AudioEncoding implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * Not specified.
-     * 
- * - * ENCODING_UNSPECIFIED = 0; - */ - ENCODING_UNSPECIFIED(0), - /** - * - * - *
-     * Uncompressed 16-bit signed little-endian samples (Linear PCM).
-     * 
- * - * LINEAR16 = 1; - */ - LINEAR16(1), - /** - * - * - *
-     * `FLAC` (Free Lossless Audio
-     * Codec) is the recommended encoding because it is
-     * lossless--therefore recognition is not compromised--and
-     * requires only about half the bandwidth of `LINEAR16`. `FLAC` stream
-     * encoding supports 16-bit and 24-bit samples, however, not all fields in
-     * `STREAMINFO` are supported.
-     * 
- * - * FLAC = 2; - */ - FLAC(2), - /** - * - * - *
-     * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
-     * 
- * - * MULAW = 3; - */ - MULAW(3), - /** - * - * - *
-     * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
-     * 
- * - * AMR = 4; - */ - AMR(4), - /** - * - * - *
-     * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
-     * 
- * - * AMR_WB = 5; - */ - AMR_WB(5), - /** - * - * - *
-     * Opus encoded audio frames in Ogg container
-     * ([OggOpus](https://wiki.xiph.org/OggOpus)).
-     * `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000.
-     * 
- * - * OGG_OPUS = 6; - */ - OGG_OPUS(6), - /** - * - * - *
-     * Although the use of lossy encodings is not recommended, if a very low
-     * bitrate encoding is required, `OGG_OPUS` is highly preferred over
-     * Speex encoding. The [Speex](https://speex.org/)  encoding supported by
-     * Cloud Speech API has a header byte in each block, as in MIME type
-     * `audio/x-speex-with-header-byte`.
-     * It is a variant of the RTP Speex encoding defined in
-     * [RFC 5574](https://tools.ietf.org/html/rfc5574).
-     * The stream is a sequence of blocks, one block per RTP packet. Each block
-     * starts with a byte containing the length of the block, in bytes, followed
-     * by one or more frames of Speex data, padded to an integral number of
-     * bytes (octets) as specified in RFC 5574. In other words, each RTP header
-     * is replaced with a single byte containing the block length. Only Speex
-     * wideband is supported. `sample_rate_hertz` must be 16000.
-     * 
- * - * SPEEX_WITH_HEADER_BYTE = 7; - */ - SPEEX_WITH_HEADER_BYTE(7), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * Not specified.
-     * 
- * - * ENCODING_UNSPECIFIED = 0; - */ - public static final int ENCODING_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * Uncompressed 16-bit signed little-endian samples (Linear PCM).
-     * 
- * - * LINEAR16 = 1; - */ - public static final int LINEAR16_VALUE = 1; - /** - * - * - *
-     * `FLAC` (Free Lossless Audio
-     * Codec) is the recommended encoding because it is
-     * lossless--therefore recognition is not compromised--and
-     * requires only about half the bandwidth of `LINEAR16`. `FLAC` stream
-     * encoding supports 16-bit and 24-bit samples, however, not all fields in
-     * `STREAMINFO` are supported.
-     * 
- * - * FLAC = 2; - */ - public static final int FLAC_VALUE = 2; - /** - * - * - *
-     * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
-     * 
- * - * MULAW = 3; - */ - public static final int MULAW_VALUE = 3; - /** - * - * - *
-     * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
-     * 
- * - * AMR = 4; - */ - public static final int AMR_VALUE = 4; - /** - * - * - *
-     * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
-     * 
- * - * AMR_WB = 5; - */ - public static final int AMR_WB_VALUE = 5; - /** - * - * - *
-     * Opus encoded audio frames in Ogg container
-     * ([OggOpus](https://wiki.xiph.org/OggOpus)).
-     * `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000.
-     * 
- * - * OGG_OPUS = 6; - */ - public static final int OGG_OPUS_VALUE = 6; - /** - * - * - *
-     * Although the use of lossy encodings is not recommended, if a very low
-     * bitrate encoding is required, `OGG_OPUS` is highly preferred over
-     * Speex encoding. The [Speex](https://speex.org/)  encoding supported by
-     * Cloud Speech API has a header byte in each block, as in MIME type
-     * `audio/x-speex-with-header-byte`.
-     * It is a variant of the RTP Speex encoding defined in
-     * [RFC 5574](https://tools.ietf.org/html/rfc5574).
-     * The stream is a sequence of blocks, one block per RTP packet. Each block
-     * starts with a byte containing the length of the block, in bytes, followed
-     * by one or more frames of Speex data, padded to an integral number of
-     * bytes (octets) as specified in RFC 5574. In other words, each RTP header
-     * is replaced with a single byte containing the block length. Only Speex
-     * wideband is supported. `sample_rate_hertz` must be 16000.
-     * 
- * - * SPEEX_WITH_HEADER_BYTE = 7; - */ - public static final int SPEEX_WITH_HEADER_BYTE_VALUE = 7; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static AudioEncoding valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static AudioEncoding forNumber(int value) { - switch (value) { - case 0: - return ENCODING_UNSPECIFIED; - case 1: - return LINEAR16; - case 2: - return FLAC; - case 3: - return MULAW; - case 4: - return AMR; - case 5: - return AMR_WB; - case 6: - return OGG_OPUS; - case 7: - return SPEEX_WITH_HEADER_BYTE; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public AudioEncoding findValueByNumber(int number) { - return AudioEncoding.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.speech.v1.RecognitionConfig.getDescriptor().getEnumTypes().get(0); - } - - private static final AudioEncoding[] VALUES = values(); - - public static AudioEncoding valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private AudioEncoding(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1.RecognitionConfig.AudioEncoding) - } - - public static final int ENCODING_FIELD_NUMBER = 1; - private int encoding_; - /** - * - * - *
-   * Encoding of audio data sent in all `RecognitionAudio` messages.
-   * This field is optional for `FLAC` and `WAV` audio files and required
-   * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - * - * @return The enum numeric value on the wire for encoding. - */ - @java.lang.Override - public int getEncodingValue() { - return encoding_; - } - /** - * - * - *
-   * Encoding of audio data sent in all `RecognitionAudio` messages.
-   * This field is optional for `FLAC` and `WAV` audio files and required
-   * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - * - * @return The encoding. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding getEncoding() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding result = - com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding.valueOf(encoding_); - return result == null - ? com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding.UNRECOGNIZED - : result; - } - - public static final int SAMPLE_RATE_HERTZ_FIELD_NUMBER = 2; - private int sampleRateHertz_; - /** - * - * - *
-   * Sample rate in Hertz of the audio data sent in all
-   * `RecognitionAudio` messages. Valid values are: 8000-48000.
-   * 16000 is optimal. For best results, set the sampling rate of the audio
-   * source to 16000 Hz. If that's not possible, use the native sample rate of
-   * the audio source (instead of re-sampling).
-   * This field is optional for FLAC and WAV audio files, but is
-   * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-   * 
- * - * int32 sample_rate_hertz = 2; - * - * @return The sampleRateHertz. - */ - @java.lang.Override - public int getSampleRateHertz() { - return sampleRateHertz_; - } - - public static final int AUDIO_CHANNEL_COUNT_FIELD_NUMBER = 7; - private int audioChannelCount_; - /** - * - * - *
-   * 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 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.
-   * To perform independent recognition on each channel set
-   * `enable_separate_recognition_per_channel` to 'true'.
-   * 
- * - * int32 audio_channel_count = 7; - * - * @return The audioChannelCount. - */ - @java.lang.Override - public int getAudioChannelCount() { - return audioChannelCount_; - } - - public static final int ENABLE_SEPARATE_RECOGNITION_PER_CHANNEL_FIELD_NUMBER = 12; - private boolean enableSeparateRecognitionPerChannel_; - /** - * - * - *
-   * This needs to be set to `true` explicitly and `audio_channel_count` > 1
-   * to get each channel recognized separately. The recognition result will
-   * contain a `channel_tag` field to state which channel that result belongs
-   * to. If this is not true, we will only recognize the first channel. The
-   * request is billed cumulatively for all channels recognized:
-   * `audio_channel_count` multiplied by the length of the audio.
-   * 
- * - * bool enable_separate_recognition_per_channel = 12; - * - * @return The enableSeparateRecognitionPerChannel. - */ - @java.lang.Override - public boolean getEnableSeparateRecognitionPerChannel() { - return enableSeparateRecognitionPerChannel_; - } - - public static final int LANGUAGE_CODE_FIELD_NUMBER = 3; - private volatile java.lang.Object languageCode_; - /** - * - * - *
-   * Required. The language of the supplied audio as a
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-   * Example: "en-US".
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes.
-   * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The languageCode. - */ - @java.lang.Override - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - 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(); - languageCode_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The language of the supplied audio as a
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-   * Example: "en-US".
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes.
-   * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for languageCode. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int MAX_ALTERNATIVES_FIELD_NUMBER = 4; - private int maxAlternatives_; - /** - * - * - *
-   * Maximum number of recognition hypotheses to be returned.
-   * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-   * within each `SpeechRecognitionResult`.
-   * The server may return fewer than `max_alternatives`.
-   * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-   * one. If omitted, will return a maximum of one.
-   * 
- * - * int32 max_alternatives = 4; - * - * @return The maxAlternatives. - */ - @java.lang.Override - public int getMaxAlternatives() { - return maxAlternatives_; - } - - public static final int PROFANITY_FILTER_FIELD_NUMBER = 5; - private boolean profanityFilter_; - /** - * - * - *
-   * If set to `true`, the server will attempt to filter out
-   * profanities, replacing all but the initial character in each filtered word
-   * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-   * won't be filtered out.
-   * 
- * - * bool profanity_filter = 5; - * - * @return The profanityFilter. - */ - @java.lang.Override - public boolean getProfanityFilter() { - return profanityFilter_; - } - - public static final int SPEECH_CONTEXTS_FIELD_NUMBER = 6; - private java.util.List speechContexts_; - /** - * - * - *
-   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - @java.lang.Override - public java.util.List getSpeechContextsList() { - return speechContexts_; - } - /** - * - * - *
-   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - @java.lang.Override - public java.util.List - getSpeechContextsOrBuilderList() { - return speechContexts_; - } - /** - * - * - *
-   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - @java.lang.Override - public int getSpeechContextsCount() { - return speechContexts_.size(); - } - /** - * - * - *
-   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechContext getSpeechContexts(int index) { - return speechContexts_.get(index); - } - /** - * - * - *
-   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechContextOrBuilder getSpeechContextsOrBuilder(int index) { - return speechContexts_.get(index); - } - - public static final int ENABLE_WORD_TIME_OFFSETS_FIELD_NUMBER = 8; - private boolean enableWordTimeOffsets_; - /** - * - * - *
-   * If `true`, the top result includes a list of words and
-   * the start and end time offsets (timestamps) for those words. If
-   * `false`, no word-level time offset information is returned. The default is
-   * `false`.
-   * 
- * - * bool enable_word_time_offsets = 8; - * - * @return The enableWordTimeOffsets. - */ - @java.lang.Override - public boolean getEnableWordTimeOffsets() { - return enableWordTimeOffsets_; - } - - public static final int ENABLE_AUTOMATIC_PUNCTUATION_FIELD_NUMBER = 11; - private boolean enableAutomaticPunctuation_; - /** - * - * - *
-   * If 'true', adds punctuation to recognition result hypotheses.
-   * This feature is only available in select languages. Setting this for
-   * requests in other languages has no effect at all.
-   * The default 'false' value does not add punctuation to result hypotheses.
-   * Note: This is currently offered as an experimental service, complimentary
-   * to all users. In the future this may be exclusively available as a
-   * premium feature.
-   * 
- * - * bool enable_automatic_punctuation = 11; - * - * @return The enableAutomaticPunctuation. - */ - @java.lang.Override - public boolean getEnableAutomaticPunctuation() { - return enableAutomaticPunctuation_; - } - - public static final int DIARIZATION_CONFIG_FIELD_NUMBER = 19; - private com.google.cloud.speech.v1.SpeakerDiarizationConfig diarizationConfig_; - /** - * - * - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - * - * @return Whether the diarizationConfig field is set. - */ - @java.lang.Override - public boolean hasDiarizationConfig() { - return diarizationConfig_ != null; - } - /** - * - * - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - * - * @return The diarizationConfig. - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeakerDiarizationConfig getDiarizationConfig() { - return diarizationConfig_ == null - ? com.google.cloud.speech.v1.SpeakerDiarizationConfig.getDefaultInstance() - : diarizationConfig_; - } - /** - * - * - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder - getDiarizationConfigOrBuilder() { - return getDiarizationConfig(); - } - - public static final int METADATA_FIELD_NUMBER = 9; - private com.google.cloud.speech.v1.RecognitionMetadata metadata_; - /** - * - * - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - * - * @return Whether the metadata field is set. - */ - @java.lang.Override - public boolean hasMetadata() { - return metadata_ != null; - } - /** - * - * - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - * - * @return The metadata. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata getMetadata() { - return metadata_ == null - ? com.google.cloud.speech.v1.RecognitionMetadata.getDefaultInstance() - : metadata_; - } - /** - * - * - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadataOrBuilder getMetadataOrBuilder() { - return getMetadata(); - } - - public static final int MODEL_FIELD_NUMBER = 13; - private volatile java.lang.Object model_; - /** - * - * - *
-   * Which model to select for the given request. Select the model
-   * best suited to your domain to get best results. If a model is not
-   * explicitly specified, then we auto-select a model based on the parameters
-   * in the RecognitionConfig.
-   * <table>
-   *   <tr>
-   *     <td><b>Model</b></td>
-   *     <td><b>Description</b></td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>command_and_search</code></td>
-   *     <td>Best for short queries such as voice commands or voice search.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>phone_call</code></td>
-   *     <td>Best for audio that originated from a phone call (typically
-   *     recorded at an 8khz sampling rate).</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>video</code></td>
-   *     <td>Best for audio that originated from from video or includes multiple
-   *         speakers. Ideally the audio is recorded at a 16khz or greater
-   *         sampling rate. This is a premium model that costs more than the
-   *         standard rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>default</code></td>
-   *     <td>Best for audio that is not one of the specific audio models.
-   *         For example, long-form audio. Ideally the audio is high-fidelity,
-   *         recorded at a 16khz or greater sampling rate.</td>
-   *   </tr>
-   * </table>
-   * 
- * - * string model = 13; - * - * @return The model. - */ - @java.lang.Override - public java.lang.String getModel() { - java.lang.Object ref = model_; - 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(); - model_ = s; - return s; - } - } - /** - * - * - *
-   * Which model to select for the given request. Select the model
-   * best suited to your domain to get best results. If a model is not
-   * explicitly specified, then we auto-select a model based on the parameters
-   * in the RecognitionConfig.
-   * <table>
-   *   <tr>
-   *     <td><b>Model</b></td>
-   *     <td><b>Description</b></td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>command_and_search</code></td>
-   *     <td>Best for short queries such as voice commands or voice search.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>phone_call</code></td>
-   *     <td>Best for audio that originated from a phone call (typically
-   *     recorded at an 8khz sampling rate).</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>video</code></td>
-   *     <td>Best for audio that originated from from video or includes multiple
-   *         speakers. Ideally the audio is recorded at a 16khz or greater
-   *         sampling rate. This is a premium model that costs more than the
-   *         standard rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>default</code></td>
-   *     <td>Best for audio that is not one of the specific audio models.
-   *         For example, long-form audio. Ideally the audio is high-fidelity,
-   *         recorded at a 16khz or greater sampling rate.</td>
-   *   </tr>
-   * </table>
-   * 
- * - * string model = 13; - * - * @return The bytes for model. - */ - @java.lang.Override - public com.google.protobuf.ByteString getModelBytes() { - java.lang.Object ref = model_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - model_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int USE_ENHANCED_FIELD_NUMBER = 14; - private boolean useEnhanced_; - /** - * - * - *
-   * Set to true to use an enhanced model for speech recognition.
-   * If `use_enhanced` is set to true and the `model` field is not set, then
-   * an appropriate enhanced model is chosen if an enhanced model exists for
-   * the audio.
-   * If `use_enhanced` is true and an enhanced version of the specified model
-   * does not exist, then the speech is recognized using the standard version
-   * of the specified model.
-   * 
- * - * bool use_enhanced = 14; - * - * @return The useEnhanced. - */ - @java.lang.Override - public boolean getUseEnhanced() { - return useEnhanced_; - } - - 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 (encoding_ - != com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding.ENCODING_UNSPECIFIED - .getNumber()) { - output.writeEnum(1, encoding_); - } - if (sampleRateHertz_ != 0) { - output.writeInt32(2, sampleRateHertz_); - } - if (!getLanguageCodeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languageCode_); - } - if (maxAlternatives_ != 0) { - output.writeInt32(4, maxAlternatives_); - } - if (profanityFilter_ != false) { - output.writeBool(5, profanityFilter_); - } - for (int i = 0; i < speechContexts_.size(); i++) { - output.writeMessage(6, speechContexts_.get(i)); - } - if (audioChannelCount_ != 0) { - output.writeInt32(7, audioChannelCount_); - } - if (enableWordTimeOffsets_ != false) { - output.writeBool(8, enableWordTimeOffsets_); - } - if (metadata_ != null) { - output.writeMessage(9, getMetadata()); - } - if (enableAutomaticPunctuation_ != false) { - output.writeBool(11, enableAutomaticPunctuation_); - } - if (enableSeparateRecognitionPerChannel_ != false) { - output.writeBool(12, enableSeparateRecognitionPerChannel_); - } - if (!getModelBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 13, model_); - } - if (useEnhanced_ != false) { - output.writeBool(14, useEnhanced_); - } - if (diarizationConfig_ != null) { - output.writeMessage(19, getDiarizationConfig()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (encoding_ - != com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding.ENCODING_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, encoding_); - } - if (sampleRateHertz_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, sampleRateHertz_); - } - if (!getLanguageCodeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, languageCode_); - } - if (maxAlternatives_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, maxAlternatives_); - } - if (profanityFilter_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, profanityFilter_); - } - for (int i = 0; i < speechContexts_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, speechContexts_.get(i)); - } - if (audioChannelCount_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, audioChannelCount_); - } - if (enableWordTimeOffsets_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(8, enableWordTimeOffsets_); - } - if (metadata_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getMetadata()); - } - if (enableAutomaticPunctuation_ != false) { - size += - com.google.protobuf.CodedOutputStream.computeBoolSize(11, enableAutomaticPunctuation_); - } - if (enableSeparateRecognitionPerChannel_ != false) { - size += - com.google.protobuf.CodedOutputStream.computeBoolSize( - 12, enableSeparateRecognitionPerChannel_); - } - if (!getModelBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, model_); - } - if (useEnhanced_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(14, useEnhanced_); - } - if (diarizationConfig_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, getDiarizationConfig()); - } - size += unknownFields.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.RecognitionConfig)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.RecognitionConfig other = - (com.google.cloud.speech.v1.RecognitionConfig) obj; - - if (encoding_ != other.encoding_) return false; - if (getSampleRateHertz() != other.getSampleRateHertz()) return false; - if (getAudioChannelCount() != other.getAudioChannelCount()) return false; - if (getEnableSeparateRecognitionPerChannel() != other.getEnableSeparateRecognitionPerChannel()) - return false; - if (!getLanguageCode().equals(other.getLanguageCode())) return false; - if (getMaxAlternatives() != other.getMaxAlternatives()) return false; - if (getProfanityFilter() != other.getProfanityFilter()) return false; - if (!getSpeechContextsList().equals(other.getSpeechContextsList())) return false; - if (getEnableWordTimeOffsets() != other.getEnableWordTimeOffsets()) return false; - if (getEnableAutomaticPunctuation() != other.getEnableAutomaticPunctuation()) return false; - if (hasDiarizationConfig() != other.hasDiarizationConfig()) return false; - if (hasDiarizationConfig()) { - if (!getDiarizationConfig().equals(other.getDiarizationConfig())) return false; - } - if (hasMetadata() != other.hasMetadata()) return false; - if (hasMetadata()) { - if (!getMetadata().equals(other.getMetadata())) return false; - } - if (!getModel().equals(other.getModel())) return false; - if (getUseEnhanced() != other.getUseEnhanced()) return false; - if (!unknownFields.equals(other.unknownFields)) 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) + ENCODING_FIELD_NUMBER; - hash = (53 * hash) + encoding_; - hash = (37 * hash) + SAMPLE_RATE_HERTZ_FIELD_NUMBER; - hash = (53 * hash) + getSampleRateHertz(); - hash = (37 * hash) + AUDIO_CHANNEL_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getAudioChannelCount(); - hash = (37 * hash) + ENABLE_SEPARATE_RECOGNITION_PER_CHANNEL_FIELD_NUMBER; - hash = - (53 * hash) - + com.google.protobuf.Internal.hashBoolean(getEnableSeparateRecognitionPerChannel()); - hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; - hash = (53 * hash) + getLanguageCode().hashCode(); - hash = (37 * hash) + MAX_ALTERNATIVES_FIELD_NUMBER; - hash = (53 * hash) + getMaxAlternatives(); - hash = (37 * hash) + PROFANITY_FILTER_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getProfanityFilter()); - if (getSpeechContextsCount() > 0) { - hash = (37 * hash) + SPEECH_CONTEXTS_FIELD_NUMBER; - hash = (53 * hash) + getSpeechContextsList().hashCode(); - } - hash = (37 * hash) + ENABLE_WORD_TIME_OFFSETS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableWordTimeOffsets()); - hash = (37 * hash) + ENABLE_AUTOMATIC_PUNCTUATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableAutomaticPunctuation()); - if (hasDiarizationConfig()) { - hash = (37 * hash) + DIARIZATION_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getDiarizationConfig().hashCode(); - } - if (hasMetadata()) { - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - } - hash = (37 * hash) + MODEL_FIELD_NUMBER; - hash = (53 * hash) + getModel().hashCode(); - hash = (37 * hash) + USE_ENHANCED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUseEnhanced()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.RecognitionConfig parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.RecognitionConfig 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.RecognitionConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.RecognitionConfig 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.RecognitionConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.RecognitionConfig 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.RecognitionConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.RecognitionConfig 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.RecognitionConfig parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.RecognitionConfig 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.RecognitionConfig 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.RecognitionConfig 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.RecognitionConfig 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; - } - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.RecognitionConfig} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.RecognitionConfig) - com.google.cloud.speech.v1.RecognitionConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_RecognitionConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_RecognitionConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.RecognitionConfig.class, - com.google.cloud.speech.v1.RecognitionConfig.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.RecognitionConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getSpeechContextsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - encoding_ = 0; - - sampleRateHertz_ = 0; - - audioChannelCount_ = 0; - - enableSeparateRecognitionPerChannel_ = false; - - languageCode_ = ""; - - maxAlternatives_ = 0; - - profanityFilter_ = false; - - if (speechContextsBuilder_ == null) { - speechContexts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - speechContextsBuilder_.clear(); - } - enableWordTimeOffsets_ = false; - - enableAutomaticPunctuation_ = false; - - if (diarizationConfigBuilder_ == null) { - diarizationConfig_ = null; - } else { - diarizationConfig_ = null; - diarizationConfigBuilder_ = null; - } - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadata_ = null; - metadataBuilder_ = null; - } - model_ = ""; - - useEnhanced_ = false; - - 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_RecognitionConfig_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfig getDefaultInstanceForType() { - return com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfig build() { - com.google.cloud.speech.v1.RecognitionConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfig buildPartial() { - com.google.cloud.speech.v1.RecognitionConfig result = - new com.google.cloud.speech.v1.RecognitionConfig(this); - int from_bitField0_ = bitField0_; - result.encoding_ = encoding_; - result.sampleRateHertz_ = sampleRateHertz_; - result.audioChannelCount_ = audioChannelCount_; - result.enableSeparateRecognitionPerChannel_ = enableSeparateRecognitionPerChannel_; - result.languageCode_ = languageCode_; - result.maxAlternatives_ = maxAlternatives_; - result.profanityFilter_ = profanityFilter_; - if (speechContextsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - speechContexts_ = java.util.Collections.unmodifiableList(speechContexts_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.speechContexts_ = speechContexts_; - } else { - result.speechContexts_ = speechContextsBuilder_.build(); - } - result.enableWordTimeOffsets_ = enableWordTimeOffsets_; - result.enableAutomaticPunctuation_ = enableAutomaticPunctuation_; - if (diarizationConfigBuilder_ == null) { - result.diarizationConfig_ = diarizationConfig_; - } else { - result.diarizationConfig_ = diarizationConfigBuilder_.build(); - } - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); - } - result.model_ = model_; - result.useEnhanced_ = useEnhanced_; - 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.RecognitionConfig) { - return mergeFrom((com.google.cloud.speech.v1.RecognitionConfig) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.RecognitionConfig other) { - if (other == com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance()) return this; - if (other.encoding_ != 0) { - setEncodingValue(other.getEncodingValue()); - } - if (other.getSampleRateHertz() != 0) { - setSampleRateHertz(other.getSampleRateHertz()); - } - if (other.getAudioChannelCount() != 0) { - setAudioChannelCount(other.getAudioChannelCount()); - } - if (other.getEnableSeparateRecognitionPerChannel() != false) { - setEnableSeparateRecognitionPerChannel(other.getEnableSeparateRecognitionPerChannel()); - } - if (!other.getLanguageCode().isEmpty()) { - languageCode_ = other.languageCode_; - onChanged(); - } - if (other.getMaxAlternatives() != 0) { - setMaxAlternatives(other.getMaxAlternatives()); - } - if (other.getProfanityFilter() != false) { - setProfanityFilter(other.getProfanityFilter()); - } - if (speechContextsBuilder_ == null) { - if (!other.speechContexts_.isEmpty()) { - if (speechContexts_.isEmpty()) { - speechContexts_ = other.speechContexts_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureSpeechContextsIsMutable(); - speechContexts_.addAll(other.speechContexts_); - } - onChanged(); - } - } else { - if (!other.speechContexts_.isEmpty()) { - if (speechContextsBuilder_.isEmpty()) { - speechContextsBuilder_.dispose(); - speechContextsBuilder_ = null; - speechContexts_ = other.speechContexts_; - bitField0_ = (bitField0_ & ~0x00000001); - speechContextsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getSpeechContextsFieldBuilder() - : null; - } else { - speechContextsBuilder_.addAllMessages(other.speechContexts_); - } - } - } - if (other.getEnableWordTimeOffsets() != false) { - setEnableWordTimeOffsets(other.getEnableWordTimeOffsets()); - } - if (other.getEnableAutomaticPunctuation() != false) { - setEnableAutomaticPunctuation(other.getEnableAutomaticPunctuation()); - } - if (other.hasDiarizationConfig()) { - mergeDiarizationConfig(other.getDiarizationConfig()); - } - if (other.hasMetadata()) { - mergeMetadata(other.getMetadata()); - } - if (!other.getModel().isEmpty()) { - model_ = other.model_; - onChanged(); - } - if (other.getUseEnhanced() != false) { - setUseEnhanced(other.getUseEnhanced()); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1.RecognitionConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.RecognitionConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private int encoding_ = 0; - /** - * - * - *
-     * Encoding of audio data sent in all `RecognitionAudio` messages.
-     * This field is optional for `FLAC` and `WAV` audio files and required
-     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - * - * @return The enum numeric value on the wire for encoding. - */ - @java.lang.Override - public int getEncodingValue() { - return encoding_; - } - /** - * - * - *
-     * Encoding of audio data sent in all `RecognitionAudio` messages.
-     * This field is optional for `FLAC` and `WAV` audio files and required
-     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - * - * @param value The enum numeric value on the wire for encoding to set. - * @return This builder for chaining. - */ - public Builder setEncodingValue(int value) { - - encoding_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Encoding of audio data sent in all `RecognitionAudio` messages.
-     * This field is optional for `FLAC` and `WAV` audio files and required
-     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - * - * @return The encoding. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding getEncoding() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding result = - com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding.valueOf(encoding_); - return result == null - ? com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding.UNRECOGNIZED - : result; - } - /** - * - * - *
-     * Encoding of audio data sent in all `RecognitionAudio` messages.
-     * This field is optional for `FLAC` and `WAV` audio files and required
-     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - * - * @param value The encoding to set. - * @return This builder for chaining. - */ - public Builder setEncoding(com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding value) { - if (value == null) { - throw new NullPointerException(); - } - - encoding_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * Encoding of audio data sent in all `RecognitionAudio` messages.
-     * This field is optional for `FLAC` and `WAV` audio files and required
-     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - * - * @return This builder for chaining. - */ - public Builder clearEncoding() { - - encoding_ = 0; - onChanged(); - return this; - } - - private int sampleRateHertz_; - /** - * - * - *
-     * Sample rate in Hertz of the audio data sent in all
-     * `RecognitionAudio` messages. Valid values are: 8000-48000.
-     * 16000 is optimal. For best results, set the sampling rate of the audio
-     * source to 16000 Hz. If that's not possible, use the native sample rate of
-     * the audio source (instead of re-sampling).
-     * This field is optional for FLAC and WAV audio files, but is
-     * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-     * 
- * - * int32 sample_rate_hertz = 2; - * - * @return The sampleRateHertz. - */ - @java.lang.Override - public int getSampleRateHertz() { - return sampleRateHertz_; - } - /** - * - * - *
-     * Sample rate in Hertz of the audio data sent in all
-     * `RecognitionAudio` messages. Valid values are: 8000-48000.
-     * 16000 is optimal. For best results, set the sampling rate of the audio
-     * source to 16000 Hz. If that's not possible, use the native sample rate of
-     * the audio source (instead of re-sampling).
-     * This field is optional for FLAC and WAV audio files, but is
-     * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-     * 
- * - * int32 sample_rate_hertz = 2; - * - * @param value The sampleRateHertz to set. - * @return This builder for chaining. - */ - public Builder setSampleRateHertz(int value) { - - sampleRateHertz_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Sample rate in Hertz of the audio data sent in all
-     * `RecognitionAudio` messages. Valid values are: 8000-48000.
-     * 16000 is optimal. For best results, set the sampling rate of the audio
-     * source to 16000 Hz. If that's not possible, use the native sample rate of
-     * the audio source (instead of re-sampling).
-     * This field is optional for FLAC and WAV audio files, but is
-     * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-     * 
- * - * int32 sample_rate_hertz = 2; - * - * @return This builder for chaining. - */ - public Builder clearSampleRateHertz() { - - sampleRateHertz_ = 0; - onChanged(); - return this; - } - - private int audioChannelCount_; - /** - * - * - *
-     * 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 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.
-     * To perform independent recognition on each channel set
-     * `enable_separate_recognition_per_channel` to 'true'.
-     * 
- * - * int32 audio_channel_count = 7; - * - * @return The audioChannelCount. - */ - @java.lang.Override - public int getAudioChannelCount() { - return audioChannelCount_; - } - /** - * - * - *
-     * 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 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.
-     * To perform independent recognition on each channel set
-     * `enable_separate_recognition_per_channel` to 'true'.
-     * 
- * - * int32 audio_channel_count = 7; - * - * @param value The audioChannelCount to set. - * @return This builder for chaining. - */ - public Builder setAudioChannelCount(int value) { - - audioChannelCount_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * 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 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.
-     * To perform independent recognition on each channel set
-     * `enable_separate_recognition_per_channel` to 'true'.
-     * 
- * - * int32 audio_channel_count = 7; - * - * @return This builder for chaining. - */ - public Builder clearAudioChannelCount() { - - audioChannelCount_ = 0; - onChanged(); - return this; - } - - private boolean enableSeparateRecognitionPerChannel_; - /** - * - * - *
-     * This needs to be set to `true` explicitly and `audio_channel_count` > 1
-     * to get each channel recognized separately. The recognition result will
-     * contain a `channel_tag` field to state which channel that result belongs
-     * to. If this is not true, we will only recognize the first channel. The
-     * request is billed cumulatively for all channels recognized:
-     * `audio_channel_count` multiplied by the length of the audio.
-     * 
- * - * bool enable_separate_recognition_per_channel = 12; - * - * @return The enableSeparateRecognitionPerChannel. - */ - @java.lang.Override - public boolean getEnableSeparateRecognitionPerChannel() { - return enableSeparateRecognitionPerChannel_; - } - /** - * - * - *
-     * This needs to be set to `true` explicitly and `audio_channel_count` > 1
-     * to get each channel recognized separately. The recognition result will
-     * contain a `channel_tag` field to state which channel that result belongs
-     * to. If this is not true, we will only recognize the first channel. The
-     * request is billed cumulatively for all channels recognized:
-     * `audio_channel_count` multiplied by the length of the audio.
-     * 
- * - * bool enable_separate_recognition_per_channel = 12; - * - * @param value The enableSeparateRecognitionPerChannel to set. - * @return This builder for chaining. - */ - public Builder setEnableSeparateRecognitionPerChannel(boolean value) { - - enableSeparateRecognitionPerChannel_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * This needs to be set to `true` explicitly and `audio_channel_count` > 1
-     * to get each channel recognized separately. The recognition result will
-     * contain a `channel_tag` field to state which channel that result belongs
-     * to. If this is not true, we will only recognize the first channel. The
-     * request is billed cumulatively for all channels recognized:
-     * `audio_channel_count` multiplied by the length of the audio.
-     * 
- * - * bool enable_separate_recognition_per_channel = 12; - * - * @return This builder for chaining. - */ - public Builder clearEnableSeparateRecognitionPerChannel() { - - enableSeparateRecognitionPerChannel_ = false; - onChanged(); - return this; - } - - private java.lang.Object languageCode_ = ""; - /** - * - * - *
-     * Required. The language of the supplied audio as a
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-     * Example: "en-US".
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes.
-     * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The languageCode. - */ - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - languageCode_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The language of the supplied audio as a
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-     * Example: "en-US".
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes.
-     * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for languageCode. - */ - public com.google.protobuf.ByteString getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The language of the supplied audio as a
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-     * Example: "en-US".
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes.
-     * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCode(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - languageCode_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The language of the supplied audio as a
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-     * Example: "en-US".
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes.
-     * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearLanguageCode() { - - languageCode_ = getDefaultInstance().getLanguageCode(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The language of the supplied audio as a
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-     * Example: "en-US".
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes.
-     * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - languageCode_ = value; - onChanged(); - return this; - } - - private int maxAlternatives_; - /** - * - * - *
-     * Maximum number of recognition hypotheses to be returned.
-     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-     * within each `SpeechRecognitionResult`.
-     * The server may return fewer than `max_alternatives`.
-     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-     * one. If omitted, will return a maximum of one.
-     * 
- * - * int32 max_alternatives = 4; - * - * @return The maxAlternatives. - */ - @java.lang.Override - public int getMaxAlternatives() { - return maxAlternatives_; - } - /** - * - * - *
-     * Maximum number of recognition hypotheses to be returned.
-     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-     * within each `SpeechRecognitionResult`.
-     * The server may return fewer than `max_alternatives`.
-     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-     * one. If omitted, will return a maximum of one.
-     * 
- * - * int32 max_alternatives = 4; - * - * @param value The maxAlternatives to set. - * @return This builder for chaining. - */ - public Builder setMaxAlternatives(int value) { - - maxAlternatives_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Maximum number of recognition hypotheses to be returned.
-     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-     * within each `SpeechRecognitionResult`.
-     * The server may return fewer than `max_alternatives`.
-     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-     * one. If omitted, will return a maximum of one.
-     * 
- * - * int32 max_alternatives = 4; - * - * @return This builder for chaining. - */ - public Builder clearMaxAlternatives() { - - maxAlternatives_ = 0; - onChanged(); - return this; - } - - private boolean profanityFilter_; - /** - * - * - *
-     * If set to `true`, the server will attempt to filter out
-     * profanities, replacing all but the initial character in each filtered word
-     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-     * won't be filtered out.
-     * 
- * - * bool profanity_filter = 5; - * - * @return The profanityFilter. - */ - @java.lang.Override - public boolean getProfanityFilter() { - return profanityFilter_; - } - /** - * - * - *
-     * If set to `true`, the server will attempt to filter out
-     * profanities, replacing all but the initial character in each filtered word
-     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-     * won't be filtered out.
-     * 
- * - * bool profanity_filter = 5; - * - * @param value The profanityFilter to set. - * @return This builder for chaining. - */ - public Builder setProfanityFilter(boolean value) { - - profanityFilter_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If set to `true`, the server will attempt to filter out
-     * profanities, replacing all but the initial character in each filtered word
-     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-     * won't be filtered out.
-     * 
- * - * bool profanity_filter = 5; - * - * @return This builder for chaining. - */ - public Builder clearProfanityFilter() { - - profanityFilter_ = false; - onChanged(); - return this; - } - - private java.util.List speechContexts_ = - java.util.Collections.emptyList(); - - private void ensureSpeechContextsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - speechContexts_ = - new java.util.ArrayList(speechContexts_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechContext, - com.google.cloud.speech.v1.SpeechContext.Builder, - com.google.cloud.speech.v1.SpeechContextOrBuilder> - speechContextsBuilder_; - - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public java.util.List getSpeechContextsList() { - if (speechContextsBuilder_ == null) { - return java.util.Collections.unmodifiableList(speechContexts_); - } else { - return speechContextsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public int getSpeechContextsCount() { - if (speechContextsBuilder_ == null) { - return speechContexts_.size(); - } else { - return speechContextsBuilder_.getCount(); - } - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public com.google.cloud.speech.v1.SpeechContext getSpeechContexts(int index) { - if (speechContextsBuilder_ == null) { - return speechContexts_.get(index); - } else { - return speechContextsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public Builder setSpeechContexts(int index, com.google.cloud.speech.v1.SpeechContext value) { - if (speechContextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSpeechContextsIsMutable(); - speechContexts_.set(index, value); - onChanged(); - } else { - speechContextsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public Builder setSpeechContexts( - int index, com.google.cloud.speech.v1.SpeechContext.Builder builderForValue) { - if (speechContextsBuilder_ == null) { - ensureSpeechContextsIsMutable(); - speechContexts_.set(index, builderForValue.build()); - onChanged(); - } else { - speechContextsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public Builder addSpeechContexts(com.google.cloud.speech.v1.SpeechContext value) { - if (speechContextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSpeechContextsIsMutable(); - speechContexts_.add(value); - onChanged(); - } else { - speechContextsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public Builder addSpeechContexts(int index, com.google.cloud.speech.v1.SpeechContext value) { - if (speechContextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSpeechContextsIsMutable(); - speechContexts_.add(index, value); - onChanged(); - } else { - speechContextsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public Builder addSpeechContexts( - com.google.cloud.speech.v1.SpeechContext.Builder builderForValue) { - if (speechContextsBuilder_ == null) { - ensureSpeechContextsIsMutable(); - speechContexts_.add(builderForValue.build()); - onChanged(); - } else { - speechContextsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public Builder addSpeechContexts( - int index, com.google.cloud.speech.v1.SpeechContext.Builder builderForValue) { - if (speechContextsBuilder_ == null) { - ensureSpeechContextsIsMutable(); - speechContexts_.add(index, builderForValue.build()); - onChanged(); - } else { - speechContextsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public Builder addAllSpeechContexts( - java.lang.Iterable values) { - if (speechContextsBuilder_ == null) { - ensureSpeechContextsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, speechContexts_); - onChanged(); - } else { - speechContextsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public Builder clearSpeechContexts() { - if (speechContextsBuilder_ == null) { - speechContexts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - speechContextsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public Builder removeSpeechContexts(int index) { - if (speechContextsBuilder_ == null) { - ensureSpeechContextsIsMutable(); - speechContexts_.remove(index); - onChanged(); - } else { - speechContextsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public com.google.cloud.speech.v1.SpeechContext.Builder getSpeechContextsBuilder(int index) { - return getSpeechContextsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public com.google.cloud.speech.v1.SpeechContextOrBuilder getSpeechContextsOrBuilder(int index) { - if (speechContextsBuilder_ == null) { - return speechContexts_.get(index); - } else { - return speechContextsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public java.util.List - getSpeechContextsOrBuilderList() { - if (speechContextsBuilder_ != null) { - return speechContextsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(speechContexts_); - } - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public com.google.cloud.speech.v1.SpeechContext.Builder addSpeechContextsBuilder() { - return getSpeechContextsFieldBuilder() - .addBuilder(com.google.cloud.speech.v1.SpeechContext.getDefaultInstance()); - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public com.google.cloud.speech.v1.SpeechContext.Builder addSpeechContextsBuilder(int index) { - return getSpeechContextsFieldBuilder() - .addBuilder(index, com.google.cloud.speech.v1.SpeechContext.getDefaultInstance()); - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public java.util.List - getSpeechContextsBuilderList() { - return getSpeechContextsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechContext, - com.google.cloud.speech.v1.SpeechContext.Builder, - com.google.cloud.speech.v1.SpeechContextOrBuilder> - getSpeechContextsFieldBuilder() { - if (speechContextsBuilder_ == null) { - speechContextsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechContext, - com.google.cloud.speech.v1.SpeechContext.Builder, - com.google.cloud.speech.v1.SpeechContextOrBuilder>( - speechContexts_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - speechContexts_ = null; - } - return speechContextsBuilder_; - } - - private boolean enableWordTimeOffsets_; - /** - * - * - *
-     * If `true`, the top result includes a list of words and
-     * the start and end time offsets (timestamps) for those words. If
-     * `false`, no word-level time offset information is returned. The default is
-     * `false`.
-     * 
- * - * bool enable_word_time_offsets = 8; - * - * @return The enableWordTimeOffsets. - */ - @java.lang.Override - public boolean getEnableWordTimeOffsets() { - return enableWordTimeOffsets_; - } - /** - * - * - *
-     * If `true`, the top result includes a list of words and
-     * the start and end time offsets (timestamps) for those words. If
-     * `false`, no word-level time offset information is returned. The default is
-     * `false`.
-     * 
- * - * bool enable_word_time_offsets = 8; - * - * @param value The enableWordTimeOffsets to set. - * @return This builder for chaining. - */ - public Builder setEnableWordTimeOffsets(boolean value) { - - enableWordTimeOffsets_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If `true`, the top result includes a list of words and
-     * the start and end time offsets (timestamps) for those words. If
-     * `false`, no word-level time offset information is returned. The default is
-     * `false`.
-     * 
- * - * bool enable_word_time_offsets = 8; - * - * @return This builder for chaining. - */ - public Builder clearEnableWordTimeOffsets() { - - enableWordTimeOffsets_ = false; - onChanged(); - return this; - } - - private boolean enableAutomaticPunctuation_; - /** - * - * - *
-     * If 'true', adds punctuation to recognition result hypotheses.
-     * This feature is only available in select languages. Setting this for
-     * requests in other languages has no effect at all.
-     * The default 'false' value does not add punctuation to result hypotheses.
-     * Note: This is currently offered as an experimental service, complimentary
-     * to all users. In the future this may be exclusively available as a
-     * premium feature.
-     * 
- * - * bool enable_automatic_punctuation = 11; - * - * @return The enableAutomaticPunctuation. - */ - @java.lang.Override - public boolean getEnableAutomaticPunctuation() { - return enableAutomaticPunctuation_; - } - /** - * - * - *
-     * If 'true', adds punctuation to recognition result hypotheses.
-     * This feature is only available in select languages. Setting this for
-     * requests in other languages has no effect at all.
-     * The default 'false' value does not add punctuation to result hypotheses.
-     * Note: This is currently offered as an experimental service, complimentary
-     * to all users. In the future this may be exclusively available as a
-     * premium feature.
-     * 
- * - * bool enable_automatic_punctuation = 11; - * - * @param value The enableAutomaticPunctuation to set. - * @return This builder for chaining. - */ - public Builder setEnableAutomaticPunctuation(boolean value) { - - enableAutomaticPunctuation_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If 'true', adds punctuation to recognition result hypotheses.
-     * This feature is only available in select languages. Setting this for
-     * requests in other languages has no effect at all.
-     * The default 'false' value does not add punctuation to result hypotheses.
-     * Note: This is currently offered as an experimental service, complimentary
-     * to all users. In the future this may be exclusively available as a
-     * premium feature.
-     * 
- * - * bool enable_automatic_punctuation = 11; - * - * @return This builder for chaining. - */ - public Builder clearEnableAutomaticPunctuation() { - - enableAutomaticPunctuation_ = false; - onChanged(); - return this; - } - - private com.google.cloud.speech.v1.SpeakerDiarizationConfig diarizationConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.SpeakerDiarizationConfig, - com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder, - com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder> - diarizationConfigBuilder_; - /** - * - * - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - * - * @return Whether the diarizationConfig field is set. - */ - public boolean hasDiarizationConfig() { - return diarizationConfigBuilder_ != null || diarizationConfig_ != null; - } - /** - * - * - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - * - * @return The diarizationConfig. - */ - public com.google.cloud.speech.v1.SpeakerDiarizationConfig getDiarizationConfig() { - if (diarizationConfigBuilder_ == null) { - return diarizationConfig_ == null - ? com.google.cloud.speech.v1.SpeakerDiarizationConfig.getDefaultInstance() - : diarizationConfig_; - } else { - return diarizationConfigBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - */ - public Builder setDiarizationConfig(com.google.cloud.speech.v1.SpeakerDiarizationConfig value) { - if (diarizationConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - diarizationConfig_ = value; - onChanged(); - } else { - diarizationConfigBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - */ - public Builder setDiarizationConfig( - com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder builderForValue) { - if (diarizationConfigBuilder_ == null) { - diarizationConfig_ = builderForValue.build(); - onChanged(); - } else { - diarizationConfigBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - */ - public Builder mergeDiarizationConfig( - com.google.cloud.speech.v1.SpeakerDiarizationConfig value) { - if (diarizationConfigBuilder_ == null) { - if (diarizationConfig_ != null) { - diarizationConfig_ = - com.google.cloud.speech.v1.SpeakerDiarizationConfig.newBuilder(diarizationConfig_) - .mergeFrom(value) - .buildPartial(); - } else { - diarizationConfig_ = value; - } - onChanged(); - } else { - diarizationConfigBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - */ - public Builder clearDiarizationConfig() { - if (diarizationConfigBuilder_ == null) { - diarizationConfig_ = null; - onChanged(); - } else { - diarizationConfig_ = null; - diarizationConfigBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - */ - public com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder - getDiarizationConfigBuilder() { - - onChanged(); - return getDiarizationConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - */ - public com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder - getDiarizationConfigOrBuilder() { - if (diarizationConfigBuilder_ != null) { - return diarizationConfigBuilder_.getMessageOrBuilder(); - } else { - return diarizationConfig_ == null - ? com.google.cloud.speech.v1.SpeakerDiarizationConfig.getDefaultInstance() - : diarizationConfig_; - } - } - /** - * - * - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.SpeakerDiarizationConfig, - com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder, - com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder> - getDiarizationConfigFieldBuilder() { - if (diarizationConfigBuilder_ == null) { - diarizationConfigBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.SpeakerDiarizationConfig, - com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder, - com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder>( - getDiarizationConfig(), getParentForChildren(), isClean()); - diarizationConfig_ = null; - } - return diarizationConfigBuilder_; - } - - private com.google.cloud.speech.v1.RecognitionMetadata metadata_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionMetadata, - com.google.cloud.speech.v1.RecognitionMetadata.Builder, - com.google.cloud.speech.v1.RecognitionMetadataOrBuilder> - metadataBuilder_; - /** - * - * - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - * - * @return Whether the metadata field is set. - */ - public boolean hasMetadata() { - return metadataBuilder_ != null || metadata_ != null; - } - /** - * - * - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - * - * @return The metadata. - */ - public com.google.cloud.speech.v1.RecognitionMetadata getMetadata() { - if (metadataBuilder_ == null) { - return metadata_ == null - ? com.google.cloud.speech.v1.RecognitionMetadata.getDefaultInstance() - : metadata_; - } else { - return metadataBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - */ - public Builder setMetadata(com.google.cloud.speech.v1.RecognitionMetadata value) { - if (metadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metadata_ = value; - onChanged(); - } else { - metadataBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - */ - public Builder setMetadata( - com.google.cloud.speech.v1.RecognitionMetadata.Builder builderForValue) { - if (metadataBuilder_ == null) { - metadata_ = builderForValue.build(); - onChanged(); - } else { - metadataBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - */ - public Builder mergeMetadata(com.google.cloud.speech.v1.RecognitionMetadata value) { - if (metadataBuilder_ == null) { - if (metadata_ != null) { - metadata_ = - com.google.cloud.speech.v1.RecognitionMetadata.newBuilder(metadata_) - .mergeFrom(value) - .buildPartial(); - } else { - metadata_ = value; - } - onChanged(); - } else { - metadataBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - */ - public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadata_ = null; - metadataBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - */ - public com.google.cloud.speech.v1.RecognitionMetadata.Builder getMetadataBuilder() { - - onChanged(); - return getMetadataFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - */ - public com.google.cloud.speech.v1.RecognitionMetadataOrBuilder getMetadataOrBuilder() { - if (metadataBuilder_ != null) { - return metadataBuilder_.getMessageOrBuilder(); - } else { - return metadata_ == null - ? com.google.cloud.speech.v1.RecognitionMetadata.getDefaultInstance() - : metadata_; - } - } - /** - * - * - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionMetadata, - com.google.cloud.speech.v1.RecognitionMetadata.Builder, - com.google.cloud.speech.v1.RecognitionMetadataOrBuilder> - getMetadataFieldBuilder() { - if (metadataBuilder_ == null) { - metadataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionMetadata, - com.google.cloud.speech.v1.RecognitionMetadata.Builder, - com.google.cloud.speech.v1.RecognitionMetadataOrBuilder>( - getMetadata(), getParentForChildren(), isClean()); - metadata_ = null; - } - return metadataBuilder_; - } - - private java.lang.Object model_ = ""; - /** - * - * - *
-     * Which model to select for the given request. Select the model
-     * best suited to your domain to get best results. If a model is not
-     * explicitly specified, then we auto-select a model based on the parameters
-     * in the RecognitionConfig.
-     * <table>
-     *   <tr>
-     *     <td><b>Model</b></td>
-     *     <td><b>Description</b></td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>command_and_search</code></td>
-     *     <td>Best for short queries such as voice commands or voice search.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>phone_call</code></td>
-     *     <td>Best for audio that originated from a phone call (typically
-     *     recorded at an 8khz sampling rate).</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>video</code></td>
-     *     <td>Best for audio that originated from from video or includes multiple
-     *         speakers. Ideally the audio is recorded at a 16khz or greater
-     *         sampling rate. This is a premium model that costs more than the
-     *         standard rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>default</code></td>
-     *     <td>Best for audio that is not one of the specific audio models.
-     *         For example, long-form audio. Ideally the audio is high-fidelity,
-     *         recorded at a 16khz or greater sampling rate.</td>
-     *   </tr>
-     * </table>
-     * 
- * - * string model = 13; - * - * @return The model. - */ - public java.lang.String getModel() { - java.lang.Object ref = model_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - model_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Which model to select for the given request. Select the model
-     * best suited to your domain to get best results. If a model is not
-     * explicitly specified, then we auto-select a model based on the parameters
-     * in the RecognitionConfig.
-     * <table>
-     *   <tr>
-     *     <td><b>Model</b></td>
-     *     <td><b>Description</b></td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>command_and_search</code></td>
-     *     <td>Best for short queries such as voice commands or voice search.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>phone_call</code></td>
-     *     <td>Best for audio that originated from a phone call (typically
-     *     recorded at an 8khz sampling rate).</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>video</code></td>
-     *     <td>Best for audio that originated from from video or includes multiple
-     *         speakers. Ideally the audio is recorded at a 16khz or greater
-     *         sampling rate. This is a premium model that costs more than the
-     *         standard rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>default</code></td>
-     *     <td>Best for audio that is not one of the specific audio models.
-     *         For example, long-form audio. Ideally the audio is high-fidelity,
-     *         recorded at a 16khz or greater sampling rate.</td>
-     *   </tr>
-     * </table>
-     * 
- * - * string model = 13; - * - * @return The bytes for model. - */ - public com.google.protobuf.ByteString getModelBytes() { - java.lang.Object ref = model_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - model_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Which model to select for the given request. Select the model
-     * best suited to your domain to get best results. If a model is not
-     * explicitly specified, then we auto-select a model based on the parameters
-     * in the RecognitionConfig.
-     * <table>
-     *   <tr>
-     *     <td><b>Model</b></td>
-     *     <td><b>Description</b></td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>command_and_search</code></td>
-     *     <td>Best for short queries such as voice commands or voice search.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>phone_call</code></td>
-     *     <td>Best for audio that originated from a phone call (typically
-     *     recorded at an 8khz sampling rate).</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>video</code></td>
-     *     <td>Best for audio that originated from from video or includes multiple
-     *         speakers. Ideally the audio is recorded at a 16khz or greater
-     *         sampling rate. This is a premium model that costs more than the
-     *         standard rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>default</code></td>
-     *     <td>Best for audio that is not one of the specific audio models.
-     *         For example, long-form audio. Ideally the audio is high-fidelity,
-     *         recorded at a 16khz or greater sampling rate.</td>
-     *   </tr>
-     * </table>
-     * 
- * - * string model = 13; - * - * @param value The model to set. - * @return This builder for chaining. - */ - public Builder setModel(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - model_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Which model to select for the given request. Select the model
-     * best suited to your domain to get best results. If a model is not
-     * explicitly specified, then we auto-select a model based on the parameters
-     * in the RecognitionConfig.
-     * <table>
-     *   <tr>
-     *     <td><b>Model</b></td>
-     *     <td><b>Description</b></td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>command_and_search</code></td>
-     *     <td>Best for short queries such as voice commands or voice search.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>phone_call</code></td>
-     *     <td>Best for audio that originated from a phone call (typically
-     *     recorded at an 8khz sampling rate).</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>video</code></td>
-     *     <td>Best for audio that originated from from video or includes multiple
-     *         speakers. Ideally the audio is recorded at a 16khz or greater
-     *         sampling rate. This is a premium model that costs more than the
-     *         standard rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>default</code></td>
-     *     <td>Best for audio that is not one of the specific audio models.
-     *         For example, long-form audio. Ideally the audio is high-fidelity,
-     *         recorded at a 16khz or greater sampling rate.</td>
-     *   </tr>
-     * </table>
-     * 
- * - * string model = 13; - * - * @return This builder for chaining. - */ - public Builder clearModel() { - - model_ = getDefaultInstance().getModel(); - onChanged(); - return this; - } - /** - * - * - *
-     * Which model to select for the given request. Select the model
-     * best suited to your domain to get best results. If a model is not
-     * explicitly specified, then we auto-select a model based on the parameters
-     * in the RecognitionConfig.
-     * <table>
-     *   <tr>
-     *     <td><b>Model</b></td>
-     *     <td><b>Description</b></td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>command_and_search</code></td>
-     *     <td>Best for short queries such as voice commands or voice search.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>phone_call</code></td>
-     *     <td>Best for audio that originated from a phone call (typically
-     *     recorded at an 8khz sampling rate).</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>video</code></td>
-     *     <td>Best for audio that originated from from video or includes multiple
-     *         speakers. Ideally the audio is recorded at a 16khz or greater
-     *         sampling rate. This is a premium model that costs more than the
-     *         standard rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>default</code></td>
-     *     <td>Best for audio that is not one of the specific audio models.
-     *         For example, long-form audio. Ideally the audio is high-fidelity,
-     *         recorded at a 16khz or greater sampling rate.</td>
-     *   </tr>
-     * </table>
-     * 
- * - * string model = 13; - * - * @param value The bytes for model to set. - * @return This builder for chaining. - */ - public Builder setModelBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - model_ = value; - onChanged(); - return this; - } - - private boolean useEnhanced_; - /** - * - * - *
-     * Set to true to use an enhanced model for speech recognition.
-     * If `use_enhanced` is set to true and the `model` field is not set, then
-     * an appropriate enhanced model is chosen if an enhanced model exists for
-     * the audio.
-     * If `use_enhanced` is true and an enhanced version of the specified model
-     * does not exist, then the speech is recognized using the standard version
-     * of the specified model.
-     * 
- * - * bool use_enhanced = 14; - * - * @return The useEnhanced. - */ - @java.lang.Override - public boolean getUseEnhanced() { - return useEnhanced_; - } - /** - * - * - *
-     * Set to true to use an enhanced model for speech recognition.
-     * If `use_enhanced` is set to true and the `model` field is not set, then
-     * an appropriate enhanced model is chosen if an enhanced model exists for
-     * the audio.
-     * If `use_enhanced` is true and an enhanced version of the specified model
-     * does not exist, then the speech is recognized using the standard version
-     * of the specified model.
-     * 
- * - * bool use_enhanced = 14; - * - * @param value The useEnhanced to set. - * @return This builder for chaining. - */ - public Builder setUseEnhanced(boolean value) { - - useEnhanced_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Set to true to use an enhanced model for speech recognition.
-     * If `use_enhanced` is set to true and the `model` field is not set, then
-     * an appropriate enhanced model is chosen if an enhanced model exists for
-     * the audio.
-     * If `use_enhanced` is true and an enhanced version of the specified model
-     * does not exist, then the speech is recognized using the standard version
-     * of the specified model.
-     * 
- * - * bool use_enhanced = 14; - * - * @return This builder for chaining. - */ - public Builder clearUseEnhanced() { - - useEnhanced_ = false; - 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.RecognitionConfig) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognitionConfig) - private static final com.google.cloud.speech.v1.RecognitionConfig DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.RecognitionConfig(); - } - - public static com.google.cloud.speech.v1.RecognitionConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecognitionConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognitionConfig(input, extensionRegistry); - } - }; - - 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.RecognitionConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfigOrBuilder.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfigOrBuilder.java deleted file mode 100644 index 48baaed73..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfigOrBuilder.java +++ /dev/null @@ -1,485 +0,0 @@ -/* - * 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 RecognitionConfigOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.RecognitionConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Encoding of audio data sent in all `RecognitionAudio` messages.
-   * This field is optional for `FLAC` and `WAV` audio files and required
-   * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - * - * @return The enum numeric value on the wire for encoding. - */ - int getEncodingValue(); - /** - * - * - *
-   * Encoding of audio data sent in all `RecognitionAudio` messages.
-   * This field is optional for `FLAC` and `WAV` audio files and required
-   * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - * - * @return The encoding. - */ - com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding getEncoding(); - - /** - * - * - *
-   * Sample rate in Hertz of the audio data sent in all
-   * `RecognitionAudio` messages. Valid values are: 8000-48000.
-   * 16000 is optimal. For best results, set the sampling rate of the audio
-   * source to 16000 Hz. If that's not possible, use the native sample rate of
-   * the audio source (instead of re-sampling).
-   * This field is optional for FLAC and WAV audio files, but is
-   * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-   * 
- * - * int32 sample_rate_hertz = 2; - * - * @return The sampleRateHertz. - */ - 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 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.
-   * To perform independent recognition on each channel set
-   * `enable_separate_recognition_per_channel` to 'true'.
-   * 
- * - * int32 audio_channel_count = 7; - * - * @return The audioChannelCount. - */ - int getAudioChannelCount(); - - /** - * - * - *
-   * This needs to be set to `true` explicitly and `audio_channel_count` > 1
-   * to get each channel recognized separately. The recognition result will
-   * contain a `channel_tag` field to state which channel that result belongs
-   * to. If this is not true, we will only recognize the first channel. The
-   * request is billed cumulatively for all channels recognized:
-   * `audio_channel_count` multiplied by the length of the audio.
-   * 
- * - * bool enable_separate_recognition_per_channel = 12; - * - * @return The enableSeparateRecognitionPerChannel. - */ - boolean getEnableSeparateRecognitionPerChannel(); - - /** - * - * - *
-   * Required. The language of the supplied audio as a
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-   * Example: "en-US".
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes.
-   * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The languageCode. - */ - java.lang.String getLanguageCode(); - /** - * - * - *
-   * Required. The language of the supplied audio as a
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-   * Example: "en-US".
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes.
-   * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for languageCode. - */ - com.google.protobuf.ByteString getLanguageCodeBytes(); - - /** - * - * - *
-   * Maximum number of recognition hypotheses to be returned.
-   * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-   * within each `SpeechRecognitionResult`.
-   * The server may return fewer than `max_alternatives`.
-   * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-   * one. If omitted, will return a maximum of one.
-   * 
- * - * int32 max_alternatives = 4; - * - * @return The maxAlternatives. - */ - int getMaxAlternatives(); - - /** - * - * - *
-   * If set to `true`, the server will attempt to filter out
-   * profanities, replacing all but the initial character in each filtered word
-   * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-   * won't be filtered out.
-   * 
- * - * bool profanity_filter = 5; - * - * @return The profanityFilter. - */ - boolean getProfanityFilter(); - - /** - * - * - *
-   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - java.util.List getSpeechContextsList(); - /** - * - * - *
-   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - com.google.cloud.speech.v1.SpeechContext getSpeechContexts(int index); - /** - * - * - *
-   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - int getSpeechContextsCount(); - /** - * - * - *
-   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - java.util.List - getSpeechContextsOrBuilderList(); - /** - * - * - *
-   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - com.google.cloud.speech.v1.SpeechContextOrBuilder getSpeechContextsOrBuilder(int index); - - /** - * - * - *
-   * If `true`, the top result includes a list of words and
-   * the start and end time offsets (timestamps) for those words. If
-   * `false`, no word-level time offset information is returned. The default is
-   * `false`.
-   * 
- * - * bool enable_word_time_offsets = 8; - * - * @return The enableWordTimeOffsets. - */ - boolean getEnableWordTimeOffsets(); - - /** - * - * - *
-   * If 'true', adds punctuation to recognition result hypotheses.
-   * This feature is only available in select languages. Setting this for
-   * requests in other languages has no effect at all.
-   * The default 'false' value does not add punctuation to result hypotheses.
-   * Note: This is currently offered as an experimental service, complimentary
-   * to all users. In the future this may be exclusively available as a
-   * premium feature.
-   * 
- * - * bool enable_automatic_punctuation = 11; - * - * @return The enableAutomaticPunctuation. - */ - boolean getEnableAutomaticPunctuation(); - - /** - * - * - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - * - * @return Whether the diarizationConfig field is set. - */ - boolean hasDiarizationConfig(); - /** - * - * - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - * - * @return The diarizationConfig. - */ - com.google.cloud.speech.v1.SpeakerDiarizationConfig getDiarizationConfig(); - /** - * - * - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - */ - com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder getDiarizationConfigOrBuilder(); - - /** - * - * - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - * - * @return Whether the metadata field is set. - */ - boolean hasMetadata(); - /** - * - * - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - * - * @return The metadata. - */ - com.google.cloud.speech.v1.RecognitionMetadata getMetadata(); - /** - * - * - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - */ - com.google.cloud.speech.v1.RecognitionMetadataOrBuilder getMetadataOrBuilder(); - - /** - * - * - *
-   * Which model to select for the given request. Select the model
-   * best suited to your domain to get best results. If a model is not
-   * explicitly specified, then we auto-select a model based on the parameters
-   * in the RecognitionConfig.
-   * <table>
-   *   <tr>
-   *     <td><b>Model</b></td>
-   *     <td><b>Description</b></td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>command_and_search</code></td>
-   *     <td>Best for short queries such as voice commands or voice search.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>phone_call</code></td>
-   *     <td>Best for audio that originated from a phone call (typically
-   *     recorded at an 8khz sampling rate).</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>video</code></td>
-   *     <td>Best for audio that originated from from video or includes multiple
-   *         speakers. Ideally the audio is recorded at a 16khz or greater
-   *         sampling rate. This is a premium model that costs more than the
-   *         standard rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>default</code></td>
-   *     <td>Best for audio that is not one of the specific audio models.
-   *         For example, long-form audio. Ideally the audio is high-fidelity,
-   *         recorded at a 16khz or greater sampling rate.</td>
-   *   </tr>
-   * </table>
-   * 
- * - * string model = 13; - * - * @return The model. - */ - java.lang.String getModel(); - /** - * - * - *
-   * Which model to select for the given request. Select the model
-   * best suited to your domain to get best results. If a model is not
-   * explicitly specified, then we auto-select a model based on the parameters
-   * in the RecognitionConfig.
-   * <table>
-   *   <tr>
-   *     <td><b>Model</b></td>
-   *     <td><b>Description</b></td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>command_and_search</code></td>
-   *     <td>Best for short queries such as voice commands or voice search.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>phone_call</code></td>
-   *     <td>Best for audio that originated from a phone call (typically
-   *     recorded at an 8khz sampling rate).</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>video</code></td>
-   *     <td>Best for audio that originated from from video or includes multiple
-   *         speakers. Ideally the audio is recorded at a 16khz or greater
-   *         sampling rate. This is a premium model that costs more than the
-   *         standard rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>default</code></td>
-   *     <td>Best for audio that is not one of the specific audio models.
-   *         For example, long-form audio. Ideally the audio is high-fidelity,
-   *         recorded at a 16khz or greater sampling rate.</td>
-   *   </tr>
-   * </table>
-   * 
- * - * string model = 13; - * - * @return The bytes for model. - */ - com.google.protobuf.ByteString getModelBytes(); - - /** - * - * - *
-   * Set to true to use an enhanced model for speech recognition.
-   * If `use_enhanced` is set to true and the `model` field is not set, then
-   * an appropriate enhanced model is chosen if an enhanced model exists for
-   * the audio.
-   * If `use_enhanced` is true and an enhanced version of the specified model
-   * does not exist, then the speech is recognized using the standard version
-   * of the specified model.
-   * 
- * - * bool use_enhanced = 14; - * - * @return The useEnhanced. - */ - boolean getUseEnhanced(); -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadata.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadata.java deleted file mode 100644 index a8cbb8246..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadata.java +++ /dev/null @@ -1,2722 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * Description of audio data to be recognized.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.RecognitionMetadata} - */ -public final class RecognitionMetadata extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.RecognitionMetadata) - RecognitionMetadataOrBuilder { - private static final long serialVersionUID = 0L; - // Use RecognitionMetadata.newBuilder() to construct. - private RecognitionMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private RecognitionMetadata() { - interactionType_ = 0; - microphoneDistance_ = 0; - originalMediaType_ = 0; - recordingDeviceType_ = 0; - recordingDeviceName_ = ""; - originalMimeType_ = ""; - audioTopic_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RecognitionMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private RecognitionMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - int rawValue = input.readEnum(); - - interactionType_ = rawValue; - break; - } - case 24: - { - industryNaicsCodeOfAudio_ = input.readUInt32(); - break; - } - case 32: - { - int rawValue = input.readEnum(); - - microphoneDistance_ = rawValue; - break; - } - case 40: - { - int rawValue = input.readEnum(); - - originalMediaType_ = rawValue; - break; - } - case 48: - { - int rawValue = input.readEnum(); - - recordingDeviceType_ = rawValue; - break; - } - case 58: - { - java.lang.String s = input.readStringRequireUtf8(); - - recordingDeviceName_ = s; - break; - } - case 66: - { - java.lang.String s = input.readStringRequireUtf8(); - - originalMimeType_ = s; - break; - } - case 82: - { - java.lang.String s = input.readStringRequireUtf8(); - - audioTopic_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_RecognitionMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_RecognitionMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.RecognitionMetadata.class, - com.google.cloud.speech.v1.RecognitionMetadata.Builder.class); - } - - /** - * - * - *
-   * Use case categories that the audio recognition request can be described
-   * by.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1.RecognitionMetadata.InteractionType} - */ - public enum InteractionType implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * Use case is either unknown or is something other than one of the other
-     * values below.
-     * 
- * - * INTERACTION_TYPE_UNSPECIFIED = 0; - */ - INTERACTION_TYPE_UNSPECIFIED(0), - /** - * - * - *
-     * Multiple people in a conversation or discussion. For example in a
-     * meeting with two or more people actively participating. Typically
-     * all the primary people speaking would be in the same room (if not,
-     * see PHONE_CALL)
-     * 
- * - * DISCUSSION = 1; - */ - DISCUSSION(1), - /** - * - * - *
-     * One or more persons lecturing or presenting to others, mostly
-     * uninterrupted.
-     * 
- * - * PRESENTATION = 2; - */ - PRESENTATION(2), - /** - * - * - *
-     * A phone-call or video-conference in which two or more people, who are
-     * not in the same room, are actively participating.
-     * 
- * - * PHONE_CALL = 3; - */ - PHONE_CALL(3), - /** - * - * - *
-     * A recorded message intended for another person to listen to.
-     * 
- * - * VOICEMAIL = 4; - */ - VOICEMAIL(4), - /** - * - * - *
-     * Professionally produced audio (eg. TV Show, Podcast).
-     * 
- * - * PROFESSIONALLY_PRODUCED = 5; - */ - PROFESSIONALLY_PRODUCED(5), - /** - * - * - *
-     * Transcribe spoken questions and queries into text.
-     * 
- * - * VOICE_SEARCH = 6; - */ - VOICE_SEARCH(6), - /** - * - * - *
-     * Transcribe voice commands, such as for controlling a device.
-     * 
- * - * VOICE_COMMAND = 7; - */ - VOICE_COMMAND(7), - /** - * - * - *
-     * Transcribe speech to text to create a written document, such as a
-     * text-message, email or report.
-     * 
- * - * DICTATION = 8; - */ - DICTATION(8), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * Use case is either unknown or is something other than one of the other
-     * values below.
-     * 
- * - * INTERACTION_TYPE_UNSPECIFIED = 0; - */ - public static final int INTERACTION_TYPE_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * Multiple people in a conversation or discussion. For example in a
-     * meeting with two or more people actively participating. Typically
-     * all the primary people speaking would be in the same room (if not,
-     * see PHONE_CALL)
-     * 
- * - * DISCUSSION = 1; - */ - public static final int DISCUSSION_VALUE = 1; - /** - * - * - *
-     * One or more persons lecturing or presenting to others, mostly
-     * uninterrupted.
-     * 
- * - * PRESENTATION = 2; - */ - public static final int PRESENTATION_VALUE = 2; - /** - * - * - *
-     * A phone-call or video-conference in which two or more people, who are
-     * not in the same room, are actively participating.
-     * 
- * - * PHONE_CALL = 3; - */ - public static final int PHONE_CALL_VALUE = 3; - /** - * - * - *
-     * A recorded message intended for another person to listen to.
-     * 
- * - * VOICEMAIL = 4; - */ - public static final int VOICEMAIL_VALUE = 4; - /** - * - * - *
-     * Professionally produced audio (eg. TV Show, Podcast).
-     * 
- * - * PROFESSIONALLY_PRODUCED = 5; - */ - public static final int PROFESSIONALLY_PRODUCED_VALUE = 5; - /** - * - * - *
-     * Transcribe spoken questions and queries into text.
-     * 
- * - * VOICE_SEARCH = 6; - */ - public static final int VOICE_SEARCH_VALUE = 6; - /** - * - * - *
-     * Transcribe voice commands, such as for controlling a device.
-     * 
- * - * VOICE_COMMAND = 7; - */ - public static final int VOICE_COMMAND_VALUE = 7; - /** - * - * - *
-     * Transcribe speech to text to create a written document, such as a
-     * text-message, email or report.
-     * 
- * - * DICTATION = 8; - */ - public static final int DICTATION_VALUE = 8; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static InteractionType valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static InteractionType forNumber(int value) { - switch (value) { - case 0: - return INTERACTION_TYPE_UNSPECIFIED; - case 1: - return DISCUSSION; - case 2: - return PRESENTATION; - case 3: - return PHONE_CALL; - case 4: - return VOICEMAIL; - case 5: - return PROFESSIONALLY_PRODUCED; - case 6: - return VOICE_SEARCH; - case 7: - return VOICE_COMMAND; - case 8: - return DICTATION; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public InteractionType findValueByNumber(int number) { - return InteractionType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.speech.v1.RecognitionMetadata.getDescriptor().getEnumTypes().get(0); - } - - private static final InteractionType[] VALUES = values(); - - public static InteractionType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private InteractionType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1.RecognitionMetadata.InteractionType) - } - - /** - * - * - *
-   * Enumerates the types of capture settings describing an audio file.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance} - */ - public enum MicrophoneDistance implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * Audio type is not known.
-     * 
- * - * MICROPHONE_DISTANCE_UNSPECIFIED = 0; - */ - MICROPHONE_DISTANCE_UNSPECIFIED(0), - /** - * - * - *
-     * The audio was captured from a closely placed microphone. Eg. phone,
-     * dictaphone, or handheld microphone. Generally if there speaker is within
-     * 1 meter of the microphone.
-     * 
- * - * NEARFIELD = 1; - */ - NEARFIELD(1), - /** - * - * - *
-     * The speaker if within 3 meters of the microphone.
-     * 
- * - * MIDFIELD = 2; - */ - MIDFIELD(2), - /** - * - * - *
-     * The speaker is more than 3 meters away from the microphone.
-     * 
- * - * FARFIELD = 3; - */ - FARFIELD(3), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * Audio type is not known.
-     * 
- * - * MICROPHONE_DISTANCE_UNSPECIFIED = 0; - */ - public static final int MICROPHONE_DISTANCE_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * The audio was captured from a closely placed microphone. Eg. phone,
-     * dictaphone, or handheld microphone. Generally if there speaker is within
-     * 1 meter of the microphone.
-     * 
- * - * NEARFIELD = 1; - */ - public static final int NEARFIELD_VALUE = 1; - /** - * - * - *
-     * The speaker if within 3 meters of the microphone.
-     * 
- * - * MIDFIELD = 2; - */ - public static final int MIDFIELD_VALUE = 2; - /** - * - * - *
-     * The speaker is more than 3 meters away from the microphone.
-     * 
- * - * FARFIELD = 3; - */ - public static final int FARFIELD_VALUE = 3; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static MicrophoneDistance valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static MicrophoneDistance forNumber(int value) { - switch (value) { - case 0: - return MICROPHONE_DISTANCE_UNSPECIFIED; - case 1: - return NEARFIELD; - case 2: - return MIDFIELD; - case 3: - return FARFIELD; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public MicrophoneDistance findValueByNumber(int number) { - return MicrophoneDistance.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.speech.v1.RecognitionMetadata.getDescriptor().getEnumTypes().get(1); - } - - private static final MicrophoneDistance[] VALUES = values(); - - public static MicrophoneDistance valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private MicrophoneDistance(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance) - } - - /** - * - * - *
-   * The original media the speech was recorded on.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType} - */ - public enum OriginalMediaType implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * Unknown original media type.
-     * 
- * - * ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; - */ - ORIGINAL_MEDIA_TYPE_UNSPECIFIED(0), - /** - * - * - *
-     * The speech data is an audio recording.
-     * 
- * - * AUDIO = 1; - */ - AUDIO(1), - /** - * - * - *
-     * The speech data originally recorded on a video.
-     * 
- * - * VIDEO = 2; - */ - VIDEO(2), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * Unknown original media type.
-     * 
- * - * ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; - */ - public static final int ORIGINAL_MEDIA_TYPE_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * The speech data is an audio recording.
-     * 
- * - * AUDIO = 1; - */ - public static final int AUDIO_VALUE = 1; - /** - * - * - *
-     * The speech data originally recorded on a video.
-     * 
- * - * VIDEO = 2; - */ - public static final int VIDEO_VALUE = 2; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OriginalMediaType valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static OriginalMediaType forNumber(int value) { - switch (value) { - case 0: - return ORIGINAL_MEDIA_TYPE_UNSPECIFIED; - case 1: - return AUDIO; - case 2: - return VIDEO; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public OriginalMediaType findValueByNumber(int number) { - return OriginalMediaType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.speech.v1.RecognitionMetadata.getDescriptor().getEnumTypes().get(2); - } - - private static final OriginalMediaType[] VALUES = values(); - - public static OriginalMediaType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private OriginalMediaType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType) - } - - /** - * - * - *
-   * The type of device the speech was recorded with.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType} - */ - public enum RecordingDeviceType implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * The recording device is unknown.
-     * 
- * - * RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; - */ - RECORDING_DEVICE_TYPE_UNSPECIFIED(0), - /** - * - * - *
-     * Speech was recorded on a smartphone.
-     * 
- * - * SMARTPHONE = 1; - */ - SMARTPHONE(1), - /** - * - * - *
-     * Speech was recorded using a personal computer or tablet.
-     * 
- * - * PC = 2; - */ - PC(2), - /** - * - * - *
-     * Speech was recorded over a phone line.
-     * 
- * - * PHONE_LINE = 3; - */ - PHONE_LINE(3), - /** - * - * - *
-     * Speech was recorded in a vehicle.
-     * 
- * - * VEHICLE = 4; - */ - VEHICLE(4), - /** - * - * - *
-     * Speech was recorded outdoors.
-     * 
- * - * OTHER_OUTDOOR_DEVICE = 5; - */ - OTHER_OUTDOOR_DEVICE(5), - /** - * - * - *
-     * Speech was recorded indoors.
-     * 
- * - * OTHER_INDOOR_DEVICE = 6; - */ - OTHER_INDOOR_DEVICE(6), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * The recording device is unknown.
-     * 
- * - * RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; - */ - public static final int RECORDING_DEVICE_TYPE_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * Speech was recorded on a smartphone.
-     * 
- * - * SMARTPHONE = 1; - */ - public static final int SMARTPHONE_VALUE = 1; - /** - * - * - *
-     * Speech was recorded using a personal computer or tablet.
-     * 
- * - * PC = 2; - */ - public static final int PC_VALUE = 2; - /** - * - * - *
-     * Speech was recorded over a phone line.
-     * 
- * - * PHONE_LINE = 3; - */ - public static final int PHONE_LINE_VALUE = 3; - /** - * - * - *
-     * Speech was recorded in a vehicle.
-     * 
- * - * VEHICLE = 4; - */ - public static final int VEHICLE_VALUE = 4; - /** - * - * - *
-     * Speech was recorded outdoors.
-     * 
- * - * OTHER_OUTDOOR_DEVICE = 5; - */ - public static final int OTHER_OUTDOOR_DEVICE_VALUE = 5; - /** - * - * - *
-     * Speech was recorded indoors.
-     * 
- * - * OTHER_INDOOR_DEVICE = 6; - */ - public static final int OTHER_INDOOR_DEVICE_VALUE = 6; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static RecordingDeviceType valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static RecordingDeviceType forNumber(int value) { - switch (value) { - case 0: - return RECORDING_DEVICE_TYPE_UNSPECIFIED; - case 1: - return SMARTPHONE; - case 2: - return PC; - case 3: - return PHONE_LINE; - case 4: - return VEHICLE; - case 5: - return OTHER_OUTDOOR_DEVICE; - case 6: - return OTHER_INDOOR_DEVICE; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public RecordingDeviceType findValueByNumber(int number) { - return RecordingDeviceType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.speech.v1.RecognitionMetadata.getDescriptor().getEnumTypes().get(3); - } - - private static final RecordingDeviceType[] VALUES = values(); - - public static RecordingDeviceType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private RecordingDeviceType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType) - } - - public static final int INTERACTION_TYPE_FIELD_NUMBER = 1; - private int interactionType_; - /** - * - * - *
-   * The use case most closely describing the audio content to be recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; - * - * @return The enum numeric value on the wire for interactionType. - */ - @java.lang.Override - public int getInteractionTypeValue() { - return interactionType_; - } - /** - * - * - *
-   * The use case most closely describing the audio content to be recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; - * - * @return The interactionType. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata.InteractionType getInteractionType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.RecognitionMetadata.InteractionType result = - com.google.cloud.speech.v1.RecognitionMetadata.InteractionType.valueOf(interactionType_); - return result == null - ? com.google.cloud.speech.v1.RecognitionMetadata.InteractionType.UNRECOGNIZED - : result; - } - - public static final int INDUSTRY_NAICS_CODE_OF_AUDIO_FIELD_NUMBER = 3; - private int industryNaicsCodeOfAudio_; - /** - * - * - *
-   * The industry vertical to which this speech recognition request most
-   * closely applies. This is most indicative of the topics contained
-   * in the audio.  Use the 6-digit NAICS code to identify the industry
-   * vertical - see https://www.naics.com/search/.
-   * 
- * - * uint32 industry_naics_code_of_audio = 3; - * - * @return The industryNaicsCodeOfAudio. - */ - @java.lang.Override - public int getIndustryNaicsCodeOfAudio() { - return industryNaicsCodeOfAudio_; - } - - public static final int MICROPHONE_DISTANCE_FIELD_NUMBER = 4; - private int microphoneDistance_; - /** - * - * - *
-   * The audio type that most closely describes the audio being recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * - * - * @return The enum numeric value on the wire for microphoneDistance. - */ - @java.lang.Override - public int getMicrophoneDistanceValue() { - return microphoneDistance_; - } - /** - * - * - *
-   * The audio type that most closely describes the audio being recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * - * - * @return The microphoneDistance. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance getMicrophoneDistance() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance result = - com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance.valueOf( - microphoneDistance_); - return result == null - ? com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance.UNRECOGNIZED - : result; - } - - public static final int ORIGINAL_MEDIA_TYPE_FIELD_NUMBER = 5; - private int originalMediaType_; - /** - * - * - *
-   * The original media the speech was recorded on.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * - * - * @return The enum numeric value on the wire for originalMediaType. - */ - @java.lang.Override - public int getOriginalMediaTypeValue() { - return originalMediaType_; - } - /** - * - * - *
-   * The original media the speech was recorded on.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * - * - * @return The originalMediaType. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType getOriginalMediaType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType result = - com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType.valueOf( - originalMediaType_); - return result == null - ? com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType.UNRECOGNIZED - : result; - } - - public static final int RECORDING_DEVICE_TYPE_FIELD_NUMBER = 6; - private int recordingDeviceType_; - /** - * - * - *
-   * The type of device the speech was recorded with.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * - * - * @return The enum numeric value on the wire for recordingDeviceType. - */ - @java.lang.Override - public int getRecordingDeviceTypeValue() { - return recordingDeviceType_; - } - /** - * - * - *
-   * The type of device the speech was recorded with.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * - * - * @return The recordingDeviceType. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType - getRecordingDeviceType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType result = - com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType.valueOf( - recordingDeviceType_); - return result == null - ? com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType.UNRECOGNIZED - : result; - } - - public static final int RECORDING_DEVICE_NAME_FIELD_NUMBER = 7; - private volatile java.lang.Object recordingDeviceName_; - /** - * - * - *
-   * The device used to make the recording.  Examples 'Nexus 5X' or
-   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-   * 'Cardioid Microphone'.
-   * 
- * - * string recording_device_name = 7; - * - * @return The recordingDeviceName. - */ - @java.lang.Override - public java.lang.String getRecordingDeviceName() { - java.lang.Object ref = recordingDeviceName_; - 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(); - recordingDeviceName_ = s; - return s; - } - } - /** - * - * - *
-   * The device used to make the recording.  Examples 'Nexus 5X' or
-   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-   * 'Cardioid Microphone'.
-   * 
- * - * string recording_device_name = 7; - * - * @return The bytes for recordingDeviceName. - */ - @java.lang.Override - public com.google.protobuf.ByteString getRecordingDeviceNameBytes() { - java.lang.Object ref = recordingDeviceName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - recordingDeviceName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ORIGINAL_MIME_TYPE_FIELD_NUMBER = 8; - private volatile java.lang.Object originalMimeType_; - /** - * - * - *
-   * Mime type of the original audio file.  For example `audio/m4a`,
-   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-   * A list of possible audio mime types is maintained at
-   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-   * 
- * - * string original_mime_type = 8; - * - * @return The originalMimeType. - */ - @java.lang.Override - public java.lang.String getOriginalMimeType() { - java.lang.Object ref = originalMimeType_; - 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(); - originalMimeType_ = s; - return s; - } - } - /** - * - * - *
-   * Mime type of the original audio file.  For example `audio/m4a`,
-   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-   * A list of possible audio mime types is maintained at
-   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-   * 
- * - * string original_mime_type = 8; - * - * @return The bytes for originalMimeType. - */ - @java.lang.Override - public com.google.protobuf.ByteString getOriginalMimeTypeBytes() { - java.lang.Object ref = originalMimeType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - originalMimeType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int AUDIO_TOPIC_FIELD_NUMBER = 10; - private volatile java.lang.Object audioTopic_; - /** - * - * - *
-   * Description of the content. Eg. "Recordings of federal supreme court
-   * hearings from 2012".
-   * 
- * - * string audio_topic = 10; - * - * @return The audioTopic. - */ - @java.lang.Override - public java.lang.String getAudioTopic() { - java.lang.Object ref = audioTopic_; - 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(); - audioTopic_ = s; - return s; - } - } - /** - * - * - *
-   * Description of the content. Eg. "Recordings of federal supreme court
-   * hearings from 2012".
-   * 
- * - * string audio_topic = 10; - * - * @return The bytes for audioTopic. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAudioTopicBytes() { - java.lang.Object ref = audioTopic_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - audioTopic_ = 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 (interactionType_ - != com.google.cloud.speech.v1.RecognitionMetadata.InteractionType - .INTERACTION_TYPE_UNSPECIFIED - .getNumber()) { - output.writeEnum(1, interactionType_); - } - if (industryNaicsCodeOfAudio_ != 0) { - output.writeUInt32(3, industryNaicsCodeOfAudio_); - } - if (microphoneDistance_ - != com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance - .MICROPHONE_DISTANCE_UNSPECIFIED - .getNumber()) { - output.writeEnum(4, microphoneDistance_); - } - if (originalMediaType_ - != com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType - .ORIGINAL_MEDIA_TYPE_UNSPECIFIED - .getNumber()) { - output.writeEnum(5, originalMediaType_); - } - if (recordingDeviceType_ - != com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType - .RECORDING_DEVICE_TYPE_UNSPECIFIED - .getNumber()) { - output.writeEnum(6, recordingDeviceType_); - } - if (!getRecordingDeviceNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, recordingDeviceName_); - } - if (!getOriginalMimeTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, originalMimeType_); - } - if (!getAudioTopicBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 10, audioTopic_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (interactionType_ - != com.google.cloud.speech.v1.RecognitionMetadata.InteractionType - .INTERACTION_TYPE_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, interactionType_); - } - if (industryNaicsCodeOfAudio_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeUInt32Size(3, industryNaicsCodeOfAudio_); - } - if (microphoneDistance_ - != com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance - .MICROPHONE_DISTANCE_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, microphoneDistance_); - } - if (originalMediaType_ - != com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType - .ORIGINAL_MEDIA_TYPE_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, originalMediaType_); - } - if (recordingDeviceType_ - != com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType - .RECORDING_DEVICE_TYPE_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, recordingDeviceType_); - } - if (!getRecordingDeviceNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, recordingDeviceName_); - } - if (!getOriginalMimeTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, originalMimeType_); - } - if (!getAudioTopicBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, audioTopic_); - } - size += unknownFields.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.RecognitionMetadata)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.RecognitionMetadata other = - (com.google.cloud.speech.v1.RecognitionMetadata) obj; - - if (interactionType_ != other.interactionType_) return false; - if (getIndustryNaicsCodeOfAudio() != other.getIndustryNaicsCodeOfAudio()) return false; - if (microphoneDistance_ != other.microphoneDistance_) return false; - if (originalMediaType_ != other.originalMediaType_) return false; - if (recordingDeviceType_ != other.recordingDeviceType_) return false; - if (!getRecordingDeviceName().equals(other.getRecordingDeviceName())) return false; - if (!getOriginalMimeType().equals(other.getOriginalMimeType())) return false; - if (!getAudioTopic().equals(other.getAudioTopic())) return false; - if (!unknownFields.equals(other.unknownFields)) 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) + INTERACTION_TYPE_FIELD_NUMBER; - hash = (53 * hash) + interactionType_; - hash = (37 * hash) + INDUSTRY_NAICS_CODE_OF_AUDIO_FIELD_NUMBER; - hash = (53 * hash) + getIndustryNaicsCodeOfAudio(); - hash = (37 * hash) + MICROPHONE_DISTANCE_FIELD_NUMBER; - hash = (53 * hash) + microphoneDistance_; - hash = (37 * hash) + ORIGINAL_MEDIA_TYPE_FIELD_NUMBER; - hash = (53 * hash) + originalMediaType_; - hash = (37 * hash) + RECORDING_DEVICE_TYPE_FIELD_NUMBER; - hash = (53 * hash) + recordingDeviceType_; - hash = (37 * hash) + RECORDING_DEVICE_NAME_FIELD_NUMBER; - hash = (53 * hash) + getRecordingDeviceName().hashCode(); - hash = (37 * hash) + ORIGINAL_MIME_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getOriginalMimeType().hashCode(); - hash = (37 * hash) + AUDIO_TOPIC_FIELD_NUMBER; - hash = (53 * hash) + getAudioTopic().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.RecognitionMetadata 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.RecognitionMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.RecognitionMetadata 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.RecognitionMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.RecognitionMetadata 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.RecognitionMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.RecognitionMetadata 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.RecognitionMetadata parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.RecognitionMetadata 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.RecognitionMetadata 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.RecognitionMetadata 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.RecognitionMetadata 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; - } - /** - * - * - *
-   * Description of audio data to be recognized.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.RecognitionMetadata} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.RecognitionMetadata) - com.google.cloud.speech.v1.RecognitionMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_RecognitionMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_RecognitionMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.RecognitionMetadata.class, - com.google.cloud.speech.v1.RecognitionMetadata.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.RecognitionMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - interactionType_ = 0; - - industryNaicsCodeOfAudio_ = 0; - - microphoneDistance_ = 0; - - originalMediaType_ = 0; - - recordingDeviceType_ = 0; - - recordingDeviceName_ = ""; - - originalMimeType_ = ""; - - audioTopic_ = ""; - - 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_RecognitionMetadata_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata getDefaultInstanceForType() { - return com.google.cloud.speech.v1.RecognitionMetadata.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata build() { - com.google.cloud.speech.v1.RecognitionMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata buildPartial() { - com.google.cloud.speech.v1.RecognitionMetadata result = - new com.google.cloud.speech.v1.RecognitionMetadata(this); - result.interactionType_ = interactionType_; - result.industryNaicsCodeOfAudio_ = industryNaicsCodeOfAudio_; - result.microphoneDistance_ = microphoneDistance_; - result.originalMediaType_ = originalMediaType_; - result.recordingDeviceType_ = recordingDeviceType_; - result.recordingDeviceName_ = recordingDeviceName_; - result.originalMimeType_ = originalMimeType_; - result.audioTopic_ = audioTopic_; - 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.RecognitionMetadata) { - return mergeFrom((com.google.cloud.speech.v1.RecognitionMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.RecognitionMetadata other) { - if (other == com.google.cloud.speech.v1.RecognitionMetadata.getDefaultInstance()) return this; - if (other.interactionType_ != 0) { - setInteractionTypeValue(other.getInteractionTypeValue()); - } - if (other.getIndustryNaicsCodeOfAudio() != 0) { - setIndustryNaicsCodeOfAudio(other.getIndustryNaicsCodeOfAudio()); - } - if (other.microphoneDistance_ != 0) { - setMicrophoneDistanceValue(other.getMicrophoneDistanceValue()); - } - if (other.originalMediaType_ != 0) { - setOriginalMediaTypeValue(other.getOriginalMediaTypeValue()); - } - if (other.recordingDeviceType_ != 0) { - setRecordingDeviceTypeValue(other.getRecordingDeviceTypeValue()); - } - if (!other.getRecordingDeviceName().isEmpty()) { - recordingDeviceName_ = other.recordingDeviceName_; - onChanged(); - } - if (!other.getOriginalMimeType().isEmpty()) { - originalMimeType_ = other.originalMimeType_; - onChanged(); - } - if (!other.getAudioTopic().isEmpty()) { - audioTopic_ = other.audioTopic_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1.RecognitionMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.RecognitionMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int interactionType_ = 0; - /** - * - * - *
-     * The use case most closely describing the audio content to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; - * - * - * @return The enum numeric value on the wire for interactionType. - */ - @java.lang.Override - public int getInteractionTypeValue() { - return interactionType_; - } - /** - * - * - *
-     * The use case most closely describing the audio content to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; - * - * - * @param value The enum numeric value on the wire for interactionType to set. - * @return This builder for chaining. - */ - public Builder setInteractionTypeValue(int value) { - - interactionType_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The use case most closely describing the audio content to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; - * - * - * @return The interactionType. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata.InteractionType getInteractionType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.RecognitionMetadata.InteractionType result = - com.google.cloud.speech.v1.RecognitionMetadata.InteractionType.valueOf(interactionType_); - return result == null - ? com.google.cloud.speech.v1.RecognitionMetadata.InteractionType.UNRECOGNIZED - : result; - } - /** - * - * - *
-     * The use case most closely describing the audio content to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; - * - * - * @param value The interactionType to set. - * @return This builder for chaining. - */ - public Builder setInteractionType( - com.google.cloud.speech.v1.RecognitionMetadata.InteractionType value) { - if (value == null) { - throw new NullPointerException(); - } - - interactionType_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * The use case most closely describing the audio content to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; - * - * - * @return This builder for chaining. - */ - public Builder clearInteractionType() { - - interactionType_ = 0; - onChanged(); - return this; - } - - private int industryNaicsCodeOfAudio_; - /** - * - * - *
-     * The industry vertical to which this speech recognition request most
-     * closely applies. This is most indicative of the topics contained
-     * in the audio.  Use the 6-digit NAICS code to identify the industry
-     * vertical - see https://www.naics.com/search/.
-     * 
- * - * uint32 industry_naics_code_of_audio = 3; - * - * @return The industryNaicsCodeOfAudio. - */ - @java.lang.Override - public int getIndustryNaicsCodeOfAudio() { - return industryNaicsCodeOfAudio_; - } - /** - * - * - *
-     * The industry vertical to which this speech recognition request most
-     * closely applies. This is most indicative of the topics contained
-     * in the audio.  Use the 6-digit NAICS code to identify the industry
-     * vertical - see https://www.naics.com/search/.
-     * 
- * - * uint32 industry_naics_code_of_audio = 3; - * - * @param value The industryNaicsCodeOfAudio to set. - * @return This builder for chaining. - */ - public Builder setIndustryNaicsCodeOfAudio(int value) { - - industryNaicsCodeOfAudio_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The industry vertical to which this speech recognition request most
-     * closely applies. This is most indicative of the topics contained
-     * in the audio.  Use the 6-digit NAICS code to identify the industry
-     * vertical - see https://www.naics.com/search/.
-     * 
- * - * uint32 industry_naics_code_of_audio = 3; - * - * @return This builder for chaining. - */ - public Builder clearIndustryNaicsCodeOfAudio() { - - industryNaicsCodeOfAudio_ = 0; - onChanged(); - return this; - } - - private int microphoneDistance_ = 0; - /** - * - * - *
-     * The audio type that most closely describes the audio being recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * - * - * @return The enum numeric value on the wire for microphoneDistance. - */ - @java.lang.Override - public int getMicrophoneDistanceValue() { - return microphoneDistance_; - } - /** - * - * - *
-     * The audio type that most closely describes the audio being recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * - * - * @param value The enum numeric value on the wire for microphoneDistance to set. - * @return This builder for chaining. - */ - public Builder setMicrophoneDistanceValue(int value) { - - microphoneDistance_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The audio type that most closely describes the audio being recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * - * - * @return The microphoneDistance. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance - getMicrophoneDistance() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance result = - com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance.valueOf( - microphoneDistance_); - return result == null - ? com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance.UNRECOGNIZED - : result; - } - /** - * - * - *
-     * The audio type that most closely describes the audio being recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * - * - * @param value The microphoneDistance to set. - * @return This builder for chaining. - */ - public Builder setMicrophoneDistance( - com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance value) { - if (value == null) { - throw new NullPointerException(); - } - - microphoneDistance_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * The audio type that most closely describes the audio being recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * - * - * @return This builder for chaining. - */ - public Builder clearMicrophoneDistance() { - - microphoneDistance_ = 0; - onChanged(); - return this; - } - - private int originalMediaType_ = 0; - /** - * - * - *
-     * The original media the speech was recorded on.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * - * - * @return The enum numeric value on the wire for originalMediaType. - */ - @java.lang.Override - public int getOriginalMediaTypeValue() { - return originalMediaType_; - } - /** - * - * - *
-     * The original media the speech was recorded on.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * - * - * @param value The enum numeric value on the wire for originalMediaType to set. - * @return This builder for chaining. - */ - public Builder setOriginalMediaTypeValue(int value) { - - originalMediaType_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The original media the speech was recorded on.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * - * - * @return The originalMediaType. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType getOriginalMediaType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType result = - com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType.valueOf( - originalMediaType_); - return result == null - ? com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType.UNRECOGNIZED - : result; - } - /** - * - * - *
-     * The original media the speech was recorded on.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * - * - * @param value The originalMediaType to set. - * @return This builder for chaining. - */ - public Builder setOriginalMediaType( - com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType value) { - if (value == null) { - throw new NullPointerException(); - } - - originalMediaType_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * The original media the speech was recorded on.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * - * - * @return This builder for chaining. - */ - public Builder clearOriginalMediaType() { - - originalMediaType_ = 0; - onChanged(); - return this; - } - - private int recordingDeviceType_ = 0; - /** - * - * - *
-     * The type of device the speech was recorded with.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * - * - * @return The enum numeric value on the wire for recordingDeviceType. - */ - @java.lang.Override - public int getRecordingDeviceTypeValue() { - return recordingDeviceType_; - } - /** - * - * - *
-     * The type of device the speech was recorded with.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * - * - * @param value The enum numeric value on the wire for recordingDeviceType to set. - * @return This builder for chaining. - */ - public Builder setRecordingDeviceTypeValue(int value) { - - recordingDeviceType_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The type of device the speech was recorded with.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * - * - * @return The recordingDeviceType. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType - getRecordingDeviceType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType result = - com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType.valueOf( - recordingDeviceType_); - return result == null - ? com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType.UNRECOGNIZED - : result; - } - /** - * - * - *
-     * The type of device the speech was recorded with.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * - * - * @param value The recordingDeviceType to set. - * @return This builder for chaining. - */ - public Builder setRecordingDeviceType( - com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType value) { - if (value == null) { - throw new NullPointerException(); - } - - recordingDeviceType_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * The type of device the speech was recorded with.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * - * - * @return This builder for chaining. - */ - public Builder clearRecordingDeviceType() { - - recordingDeviceType_ = 0; - onChanged(); - return this; - } - - private java.lang.Object recordingDeviceName_ = ""; - /** - * - * - *
-     * The device used to make the recording.  Examples 'Nexus 5X' or
-     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-     * 'Cardioid Microphone'.
-     * 
- * - * string recording_device_name = 7; - * - * @return The recordingDeviceName. - */ - public java.lang.String getRecordingDeviceName() { - java.lang.Object ref = recordingDeviceName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - recordingDeviceName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The device used to make the recording.  Examples 'Nexus 5X' or
-     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-     * 'Cardioid Microphone'.
-     * 
- * - * string recording_device_name = 7; - * - * @return The bytes for recordingDeviceName. - */ - public com.google.protobuf.ByteString getRecordingDeviceNameBytes() { - java.lang.Object ref = recordingDeviceName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - recordingDeviceName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The device used to make the recording.  Examples 'Nexus 5X' or
-     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-     * 'Cardioid Microphone'.
-     * 
- * - * string recording_device_name = 7; - * - * @param value The recordingDeviceName to set. - * @return This builder for chaining. - */ - public Builder setRecordingDeviceName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - recordingDeviceName_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The device used to make the recording.  Examples 'Nexus 5X' or
-     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-     * 'Cardioid Microphone'.
-     * 
- * - * string recording_device_name = 7; - * - * @return This builder for chaining. - */ - public Builder clearRecordingDeviceName() { - - recordingDeviceName_ = getDefaultInstance().getRecordingDeviceName(); - onChanged(); - return this; - } - /** - * - * - *
-     * The device used to make the recording.  Examples 'Nexus 5X' or
-     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-     * 'Cardioid Microphone'.
-     * 
- * - * string recording_device_name = 7; - * - * @param value The bytes for recordingDeviceName to set. - * @return This builder for chaining. - */ - public Builder setRecordingDeviceNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - recordingDeviceName_ = value; - onChanged(); - return this; - } - - private java.lang.Object originalMimeType_ = ""; - /** - * - * - *
-     * Mime type of the original audio file.  For example `audio/m4a`,
-     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-     * A list of possible audio mime types is maintained at
-     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-     * 
- * - * string original_mime_type = 8; - * - * @return The originalMimeType. - */ - public java.lang.String getOriginalMimeType() { - java.lang.Object ref = originalMimeType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - originalMimeType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Mime type of the original audio file.  For example `audio/m4a`,
-     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-     * A list of possible audio mime types is maintained at
-     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-     * 
- * - * string original_mime_type = 8; - * - * @return The bytes for originalMimeType. - */ - public com.google.protobuf.ByteString getOriginalMimeTypeBytes() { - java.lang.Object ref = originalMimeType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - originalMimeType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Mime type of the original audio file.  For example `audio/m4a`,
-     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-     * A list of possible audio mime types is maintained at
-     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-     * 
- * - * string original_mime_type = 8; - * - * @param value The originalMimeType to set. - * @return This builder for chaining. - */ - public Builder setOriginalMimeType(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - originalMimeType_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Mime type of the original audio file.  For example `audio/m4a`,
-     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-     * A list of possible audio mime types is maintained at
-     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-     * 
- * - * string original_mime_type = 8; - * - * @return This builder for chaining. - */ - public Builder clearOriginalMimeType() { - - originalMimeType_ = getDefaultInstance().getOriginalMimeType(); - onChanged(); - return this; - } - /** - * - * - *
-     * Mime type of the original audio file.  For example `audio/m4a`,
-     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-     * A list of possible audio mime types is maintained at
-     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-     * 
- * - * string original_mime_type = 8; - * - * @param value The bytes for originalMimeType to set. - * @return This builder for chaining. - */ - public Builder setOriginalMimeTypeBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - originalMimeType_ = value; - onChanged(); - return this; - } - - private java.lang.Object audioTopic_ = ""; - /** - * - * - *
-     * Description of the content. Eg. "Recordings of federal supreme court
-     * hearings from 2012".
-     * 
- * - * string audio_topic = 10; - * - * @return The audioTopic. - */ - public java.lang.String getAudioTopic() { - java.lang.Object ref = audioTopic_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - audioTopic_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Description of the content. Eg. "Recordings of federal supreme court
-     * hearings from 2012".
-     * 
- * - * string audio_topic = 10; - * - * @return The bytes for audioTopic. - */ - public com.google.protobuf.ByteString getAudioTopicBytes() { - java.lang.Object ref = audioTopic_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - audioTopic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Description of the content. Eg. "Recordings of federal supreme court
-     * hearings from 2012".
-     * 
- * - * string audio_topic = 10; - * - * @param value The audioTopic to set. - * @return This builder for chaining. - */ - public Builder setAudioTopic(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - audioTopic_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Description of the content. Eg. "Recordings of federal supreme court
-     * hearings from 2012".
-     * 
- * - * string audio_topic = 10; - * - * @return This builder for chaining. - */ - public Builder clearAudioTopic() { - - audioTopic_ = getDefaultInstance().getAudioTopic(); - onChanged(); - return this; - } - /** - * - * - *
-     * Description of the content. Eg. "Recordings of federal supreme court
-     * hearings from 2012".
-     * 
- * - * string audio_topic = 10; - * - * @param value The bytes for audioTopic to set. - * @return This builder for chaining. - */ - public Builder setAudioTopicBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - audioTopic_ = 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.RecognitionMetadata) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognitionMetadata) - private static final com.google.cloud.speech.v1.RecognitionMetadata DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.RecognitionMetadata(); - } - - public static com.google.cloud.speech.v1.RecognitionMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecognitionMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognitionMetadata(input, extensionRegistry); - } - }; - - 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.RecognitionMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadataOrBuilder.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadataOrBuilder.java deleted file mode 100644 index 2c6508778..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadataOrBuilder.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * 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 RecognitionMetadataOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.RecognitionMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The use case most closely describing the audio content to be recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; - * - * @return The enum numeric value on the wire for interactionType. - */ - int getInteractionTypeValue(); - /** - * - * - *
-   * The use case most closely describing the audio content to be recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; - * - * @return The interactionType. - */ - com.google.cloud.speech.v1.RecognitionMetadata.InteractionType getInteractionType(); - - /** - * - * - *
-   * The industry vertical to which this speech recognition request most
-   * closely applies. This is most indicative of the topics contained
-   * in the audio.  Use the 6-digit NAICS code to identify the industry
-   * vertical - see https://www.naics.com/search/.
-   * 
- * - * uint32 industry_naics_code_of_audio = 3; - * - * @return The industryNaicsCodeOfAudio. - */ - int getIndustryNaicsCodeOfAudio(); - - /** - * - * - *
-   * The audio type that most closely describes the audio being recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * - * - * @return The enum numeric value on the wire for microphoneDistance. - */ - int getMicrophoneDistanceValue(); - /** - * - * - *
-   * The audio type that most closely describes the audio being recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * - * - * @return The microphoneDistance. - */ - com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance getMicrophoneDistance(); - - /** - * - * - *
-   * The original media the speech was recorded on.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * - * - * @return The enum numeric value on the wire for originalMediaType. - */ - int getOriginalMediaTypeValue(); - /** - * - * - *
-   * The original media the speech was recorded on.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * - * - * @return The originalMediaType. - */ - com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType getOriginalMediaType(); - - /** - * - * - *
-   * The type of device the speech was recorded with.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * - * - * @return The enum numeric value on the wire for recordingDeviceType. - */ - int getRecordingDeviceTypeValue(); - /** - * - * - *
-   * The type of device the speech was recorded with.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * - * - * @return The recordingDeviceType. - */ - com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType getRecordingDeviceType(); - - /** - * - * - *
-   * The device used to make the recording.  Examples 'Nexus 5X' or
-   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-   * 'Cardioid Microphone'.
-   * 
- * - * string recording_device_name = 7; - * - * @return The recordingDeviceName. - */ - java.lang.String getRecordingDeviceName(); - /** - * - * - *
-   * The device used to make the recording.  Examples 'Nexus 5X' or
-   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-   * 'Cardioid Microphone'.
-   * 
- * - * string recording_device_name = 7; - * - * @return The bytes for recordingDeviceName. - */ - com.google.protobuf.ByteString getRecordingDeviceNameBytes(); - - /** - * - * - *
-   * Mime type of the original audio file.  For example `audio/m4a`,
-   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-   * A list of possible audio mime types is maintained at
-   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-   * 
- * - * string original_mime_type = 8; - * - * @return The originalMimeType. - */ - java.lang.String getOriginalMimeType(); - /** - * - * - *
-   * Mime type of the original audio file.  For example `audio/m4a`,
-   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-   * A list of possible audio mime types is maintained at
-   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-   * 
- * - * string original_mime_type = 8; - * - * @return The bytes for originalMimeType. - */ - com.google.protobuf.ByteString getOriginalMimeTypeBytes(); - - /** - * - * - *
-   * Description of the content. Eg. "Recordings of federal supreme court
-   * hearings from 2012".
-   * 
- * - * string audio_topic = 10; - * - * @return The audioTopic. - */ - java.lang.String getAudioTopic(); - /** - * - * - *
-   * Description of the content. Eg. "Recordings of federal supreme court
-   * hearings from 2012".
-   * 
- * - * string audio_topic = 10; - * - * @return The bytes for audioTopic. - */ - com.google.protobuf.ByteString getAudioTopicBytes(); -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequest.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequest.java deleted file mode 100644 index 9f6fd3f2b..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequest.java +++ /dev/null @@ -1,1068 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * The top-level message sent by the client for the `Recognize` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.RecognizeRequest} - */ -public final class RecognizeRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.RecognizeRequest) - RecognizeRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use RecognizeRequest.newBuilder() to construct. - private RecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private RecognizeRequest() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RecognizeRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private RecognizeRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.speech.v1.RecognitionConfig.Builder subBuilder = null; - if (config_ != null) { - subBuilder = config_.toBuilder(); - } - config_ = - input.readMessage( - com.google.cloud.speech.v1.RecognitionConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(config_); - config_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.cloud.speech.v1.RecognitionAudio.Builder subBuilder = null; - if (audio_ != null) { - subBuilder = audio_.toBuilder(); - } - audio_ = - input.readMessage( - com.google.cloud.speech.v1.RecognitionAudio.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(audio_); - audio_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_RecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_RecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.RecognizeRequest.class, - com.google.cloud.speech.v1.RecognizeRequest.Builder.class); - } - - public static final int CONFIG_FIELD_NUMBER = 1; - private com.google.cloud.speech.v1.RecognitionConfig config_; - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the config field is set. - */ - @java.lang.Override - public boolean hasConfig() { - return config_ != null; - } - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The config. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfig getConfig() { - return config_ == null - ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() - : config_; - } - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder() { - return getConfig(); - } - - public static final int AUDIO_FIELD_NUMBER = 2; - private com.google.cloud.speech.v1.RecognitionAudio audio_; - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the audio field is set. - */ - @java.lang.Override - public boolean hasAudio() { - return audio_ != null; - } - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The audio. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionAudio getAudio() { - return audio_ == null - ? com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance() - : audio_; - } - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionAudioOrBuilder getAudioOrBuilder() { - return getAudio(); - } - - 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 (config_ != null) { - output.writeMessage(1, getConfig()); - } - if (audio_ != null) { - output.writeMessage(2, getAudio()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (config_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getConfig()); - } - if (audio_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAudio()); - } - size += unknownFields.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.RecognizeRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.RecognizeRequest other = - (com.google.cloud.speech.v1.RecognizeRequest) obj; - - if (hasConfig() != other.hasConfig()) return false; - if (hasConfig()) { - if (!getConfig().equals(other.getConfig())) return false; - } - if (hasAudio() != other.hasAudio()) return false; - if (hasAudio()) { - if (!getAudio().equals(other.getAudio())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConfig()) { - hash = (37 * hash) + CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getConfig().hashCode(); - } - if (hasAudio()) { - hash = (37 * hash) + AUDIO_FIELD_NUMBER; - hash = (53 * hash) + getAudio().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.RecognizeRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.RecognizeRequest 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.RecognizeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.RecognizeRequest 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.RecognizeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.RecognizeRequest 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.RecognizeRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.RecognizeRequest 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.RecognizeRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.RecognizeRequest 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.RecognizeRequest 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.RecognizeRequest 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.RecognizeRequest 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; - } - /** - * - * - *
-   * The top-level message sent by the client for the `Recognize` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.RecognizeRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.RecognizeRequest) - com.google.cloud.speech.v1.RecognizeRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_RecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_RecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.RecognizeRequest.class, - com.google.cloud.speech.v1.RecognizeRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.RecognizeRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (configBuilder_ == null) { - config_ = null; - } else { - config_ = null; - configBuilder_ = null; - } - if (audioBuilder_ == null) { - audio_ = null; - } else { - audio_ = null; - audioBuilder_ = null; - } - 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_RecognizeRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognizeRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1.RecognizeRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognizeRequest build() { - com.google.cloud.speech.v1.RecognizeRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognizeRequest buildPartial() { - com.google.cloud.speech.v1.RecognizeRequest result = - new com.google.cloud.speech.v1.RecognizeRequest(this); - if (configBuilder_ == null) { - result.config_ = config_; - } else { - result.config_ = configBuilder_.build(); - } - if (audioBuilder_ == null) { - result.audio_ = audio_; - } else { - result.audio_ = audioBuilder_.build(); - } - 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.RecognizeRequest) { - return mergeFrom((com.google.cloud.speech.v1.RecognizeRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.RecognizeRequest other) { - if (other == com.google.cloud.speech.v1.RecognizeRequest.getDefaultInstance()) return this; - if (other.hasConfig()) { - mergeConfig(other.getConfig()); - } - if (other.hasAudio()) { - mergeAudio(other.getAudio()); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1.RecognizeRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.RecognizeRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.speech.v1.RecognitionConfig config_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionConfig, - com.google.cloud.speech.v1.RecognitionConfig.Builder, - com.google.cloud.speech.v1.RecognitionConfigOrBuilder> - configBuilder_; - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the config field is set. - */ - public boolean hasConfig() { - return configBuilder_ != null || config_ != null; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The config. - */ - public com.google.cloud.speech.v1.RecognitionConfig getConfig() { - if (configBuilder_ == null) { - return config_ == null - ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() - : config_; - } else { - return configBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setConfig(com.google.cloud.speech.v1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - config_ = value; - onChanged(); - } else { - configBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setConfig(com.google.cloud.speech.v1.RecognitionConfig.Builder builderForValue) { - if (configBuilder_ == null) { - config_ = builderForValue.build(); - onChanged(); - } else { - configBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeConfig(com.google.cloud.speech.v1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (config_ != null) { - config_ = - com.google.cloud.speech.v1.RecognitionConfig.newBuilder(config_) - .mergeFrom(value) - .buildPartial(); - } else { - config_ = value; - } - onChanged(); - } else { - configBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearConfig() { - if (configBuilder_ == null) { - config_ = null; - onChanged(); - } else { - config_ = null; - configBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.speech.v1.RecognitionConfig.Builder getConfigBuilder() { - - onChanged(); - return getConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder() { - if (configBuilder_ != null) { - return configBuilder_.getMessageOrBuilder(); - } else { - return config_ == null - ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() - : config_; - } - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionConfig, - com.google.cloud.speech.v1.RecognitionConfig.Builder, - com.google.cloud.speech.v1.RecognitionConfigOrBuilder> - getConfigFieldBuilder() { - if (configBuilder_ == null) { - configBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionConfig, - com.google.cloud.speech.v1.RecognitionConfig.Builder, - com.google.cloud.speech.v1.RecognitionConfigOrBuilder>( - getConfig(), getParentForChildren(), isClean()); - config_ = null; - } - return configBuilder_; - } - - private com.google.cloud.speech.v1.RecognitionAudio audio_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionAudio, - com.google.cloud.speech.v1.RecognitionAudio.Builder, - com.google.cloud.speech.v1.RecognitionAudioOrBuilder> - audioBuilder_; - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the audio field is set. - */ - public boolean hasAudio() { - return audioBuilder_ != null || audio_ != null; - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The audio. - */ - public com.google.cloud.speech.v1.RecognitionAudio getAudio() { - if (audioBuilder_ == null) { - return audio_ == null - ? com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance() - : audio_; - } else { - return audioBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setAudio(com.google.cloud.speech.v1.RecognitionAudio value) { - if (audioBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - audio_ = value; - onChanged(); - } else { - audioBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setAudio(com.google.cloud.speech.v1.RecognitionAudio.Builder builderForValue) { - if (audioBuilder_ == null) { - audio_ = builderForValue.build(); - onChanged(); - } else { - audioBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeAudio(com.google.cloud.speech.v1.RecognitionAudio value) { - if (audioBuilder_ == null) { - if (audio_ != null) { - audio_ = - com.google.cloud.speech.v1.RecognitionAudio.newBuilder(audio_) - .mergeFrom(value) - .buildPartial(); - } else { - audio_ = value; - } - onChanged(); - } else { - audioBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearAudio() { - if (audioBuilder_ == null) { - audio_ = null; - onChanged(); - } else { - audio_ = null; - audioBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.speech.v1.RecognitionAudio.Builder getAudioBuilder() { - - onChanged(); - return getAudioFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.speech.v1.RecognitionAudioOrBuilder getAudioOrBuilder() { - if (audioBuilder_ != null) { - return audioBuilder_.getMessageOrBuilder(); - } else { - return audio_ == null - ? com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance() - : audio_; - } - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionAudio, - com.google.cloud.speech.v1.RecognitionAudio.Builder, - com.google.cloud.speech.v1.RecognitionAudioOrBuilder> - getAudioFieldBuilder() { - if (audioBuilder_ == null) { - audioBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionAudio, - com.google.cloud.speech.v1.RecognitionAudio.Builder, - com.google.cloud.speech.v1.RecognitionAudioOrBuilder>( - getAudio(), getParentForChildren(), isClean()); - audio_ = null; - } - return audioBuilder_; - } - - @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.RecognizeRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognizeRequest) - private static final com.google.cloud.speech.v1.RecognizeRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.RecognizeRequest(); - } - - public static com.google.cloud.speech.v1.RecognizeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecognizeRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognizeRequest(input, extensionRegistry); - } - }; - - 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.RecognizeRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequestOrBuilder.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequestOrBuilder.java deleted file mode 100644 index df0bfe2ab..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequestOrBuilder.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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 RecognizeRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.RecognizeRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the config field is set. - */ - boolean hasConfig(); - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The config. - */ - com.google.cloud.speech.v1.RecognitionConfig getConfig(); - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder(); - - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the audio field is set. - */ - boolean hasAudio(); - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The audio. - */ - com.google.cloud.speech.v1.RecognitionAudio getAudio(); - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.speech.v1.RecognitionAudioOrBuilder getAudioOrBuilder(); -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponse.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponse.java deleted file mode 100644 index 85e489d01..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponse.java +++ /dev/null @@ -1,981 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * The only message returned to the client by the `Recognize` method. It
- * contains the result as zero or more sequential `SpeechRecognitionResult`
- * messages.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.RecognizeResponse} - */ -public final class RecognizeResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.RecognizeResponse) - RecognizeResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use RecognizeResponse.newBuilder() to construct. - private RecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private RecognizeResponse() { - results_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RecognizeResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private RecognizeResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - results_.add( - input.readMessage( - com.google.cloud.speech.v1.SpeechRecognitionResult.parser(), - extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_RecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_RecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.RecognizeResponse.class, - com.google.cloud.speech.v1.RecognizeResponse.Builder.class); - } - - public static final int RESULTS_FIELD_NUMBER = 2; - private java.util.List results_; - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List getResultsList() { - return results_; - } - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List - getResultsOrBuilderList() { - return results_; - } - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public int getResultsCount() { - return results_.size(); - } - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionResult getResults(int index) { - return results_.get(index); - } - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - return results_.get(index); - } - - 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 { - for (int i = 0; i < results_.size(); i++) { - output.writeMessage(2, results_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < results_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, results_.get(i)); - } - size += unknownFields.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.RecognizeResponse)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.RecognizeResponse other = - (com.google.cloud.speech.v1.RecognizeResponse) obj; - - if (!getResultsList().equals(other.getResultsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getResultsCount() > 0) { - hash = (37 * hash) + RESULTS_FIELD_NUMBER; - hash = (53 * hash) + getResultsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.RecognizeResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.RecognizeResponse 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.RecognizeResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.RecognizeResponse 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.RecognizeResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.RecognizeResponse 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.RecognizeResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.RecognizeResponse 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.RecognizeResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.RecognizeResponse 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.RecognizeResponse 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.RecognizeResponse 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.RecognizeResponse 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; - } - /** - * - * - *
-   * The only message returned to the client by the `Recognize` method. It
-   * contains the result as zero or more sequential `SpeechRecognitionResult`
-   * messages.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.RecognizeResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.RecognizeResponse) - com.google.cloud.speech.v1.RecognizeResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_RecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_RecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.RecognizeResponse.class, - com.google.cloud.speech.v1.RecognizeResponse.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.RecognizeResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getResultsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - resultsBuilder_.clear(); - } - 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_RecognizeResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognizeResponse getDefaultInstanceForType() { - return com.google.cloud.speech.v1.RecognizeResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognizeResponse build() { - com.google.cloud.speech.v1.RecognizeResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognizeResponse buildPartial() { - com.google.cloud.speech.v1.RecognizeResponse result = - new com.google.cloud.speech.v1.RecognizeResponse(this); - int from_bitField0_ = bitField0_; - if (resultsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.results_ = results_; - } else { - result.results_ = resultsBuilder_.build(); - } - 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.RecognizeResponse) { - return mergeFrom((com.google.cloud.speech.v1.RecognizeResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.RecognizeResponse other) { - if (other == com.google.cloud.speech.v1.RecognizeResponse.getDefaultInstance()) return this; - if (resultsBuilder_ == null) { - if (!other.results_.isEmpty()) { - if (results_.isEmpty()) { - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResultsIsMutable(); - results_.addAll(other.results_); - } - onChanged(); - } - } else { - if (!other.results_.isEmpty()) { - if (resultsBuilder_.isEmpty()) { - resultsBuilder_.dispose(); - resultsBuilder_ = null; - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - resultsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getResultsFieldBuilder() - : null; - } else { - resultsBuilder_.addAllMessages(other.results_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1.RecognizeResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.RecognizeResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List results_ = - java.util.Collections.emptyList(); - - private void ensureResultsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - results_ = - new java.util.ArrayList(results_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionResult, - com.google.cloud.speech.v1.SpeechRecognitionResult.Builder, - com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder> - resultsBuilder_; - - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public java.util.List getResultsList() { - if (resultsBuilder_ == null) { - return java.util.Collections.unmodifiableList(results_); - } else { - return resultsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public int getResultsCount() { - if (resultsBuilder_ == null) { - return results_.size(); - } else { - return resultsBuilder_.getCount(); - } - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.SpeechRecognitionResult getResults(int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder setResults(int index, com.google.cloud.speech.v1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.set(index, value); - onChanged(); - } else { - resultsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.set(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder addResults(com.google.cloud.speech.v1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(value); - onChanged(); - } else { - resultsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder addResults(int index, com.google.cloud.speech.v1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(index, value); - onChanged(); - } else { - resultsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - com.google.cloud.speech.v1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder addAllResults( - java.lang.Iterable values) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); - onChanged(); - } else { - resultsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder clearResults() { - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - resultsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder removeResults(int index) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.remove(index); - onChanged(); - } else { - resultsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.SpeechRecognitionResult.Builder getResultsBuilder(int index) { - return getResultsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsOrBuilderList() { - if (resultsBuilder_ != null) { - return resultsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(results_); - } - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.SpeechRecognitionResult.Builder addResultsBuilder() { - return getResultsFieldBuilder() - .addBuilder(com.google.cloud.speech.v1.SpeechRecognitionResult.getDefaultInstance()); - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.SpeechRecognitionResult.Builder addResultsBuilder(int index) { - return getResultsFieldBuilder() - .addBuilder( - index, com.google.cloud.speech.v1.SpeechRecognitionResult.getDefaultInstance()); - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsBuilderList() { - return getResultsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionResult, - com.google.cloud.speech.v1.SpeechRecognitionResult.Builder, - com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder> - getResultsFieldBuilder() { - if (resultsBuilder_ == null) { - resultsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionResult, - com.google.cloud.speech.v1.SpeechRecognitionResult.Builder, - com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder>( - results_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - results_ = null; - } - return resultsBuilder_; - } - - @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.RecognizeResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognizeResponse) - private static final com.google.cloud.speech.v1.RecognizeResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.RecognizeResponse(); - } - - public static com.google.cloud.speech.v1.RecognizeResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecognizeResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognizeResponse(input, extensionRegistry); - } - }; - - 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.RecognizeResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponseOrBuilder.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponseOrBuilder.java deleted file mode 100644 index b8d5e2fc2..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponseOrBuilder.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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 RecognizeResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.RecognizeResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - java.util.List getResultsList(); - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - com.google.cloud.speech.v1.SpeechRecognitionResult getResults(int index); - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - int getResultsCount(); - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - java.util.List - getResultsOrBuilderList(); - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder getResultsOrBuilder(int index); -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfig.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfig.java deleted file mode 100644 index 55438a074..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfig.java +++ /dev/null @@ -1,848 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * Config to enable speaker diarization.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.SpeakerDiarizationConfig} - */ -public final class SpeakerDiarizationConfig extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.SpeakerDiarizationConfig) - SpeakerDiarizationConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use SpeakerDiarizationConfig.newBuilder() to construct. - private SpeakerDiarizationConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SpeakerDiarizationConfig() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SpeakerDiarizationConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private SpeakerDiarizationConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - enableSpeakerDiarization_ = input.readBool(); - break; - } - case 16: - { - minSpeakerCount_ = input.readInt32(); - break; - } - case 24: - { - maxSpeakerCount_ = input.readInt32(); - break; - } - case 40: - { - speakerTag_ = input.readInt32(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.SpeakerDiarizationConfig.class, - com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder.class); - } - - public static final int ENABLE_SPEAKER_DIARIZATION_FIELD_NUMBER = 1; - private boolean enableSpeakerDiarization_; - /** - * - * - *
-   * If 'true', enables speaker detection for each recognized word in
-   * the top alternative of the recognition result using a speaker_tag provided
-   * in the WordInfo.
-   * 
- * - * bool enable_speaker_diarization = 1; - * - * @return The enableSpeakerDiarization. - */ - @java.lang.Override - public boolean getEnableSpeakerDiarization() { - return enableSpeakerDiarization_; - } - - public static final int MIN_SPEAKER_COUNT_FIELD_NUMBER = 2; - private int minSpeakerCount_; - /** - * - * - *
-   * Minimum number of speakers in the conversation. This range gives you more
-   * flexibility by allowing the system to automatically determine the correct
-   * number of speakers. If not set, the default value is 2.
-   * 
- * - * int32 min_speaker_count = 2; - * - * @return The minSpeakerCount. - */ - @java.lang.Override - public int getMinSpeakerCount() { - return minSpeakerCount_; - } - - public static final int MAX_SPEAKER_COUNT_FIELD_NUMBER = 3; - private int maxSpeakerCount_; - /** - * - * - *
-   * Maximum number of speakers in the conversation. This range gives you more
-   * flexibility by allowing the system to automatically determine the correct
-   * number of speakers. If not set, the default value is 6.
-   * 
- * - * int32 max_speaker_count = 3; - * - * @return The maxSpeakerCount. - */ - @java.lang.Override - public int getMaxSpeakerCount() { - return maxSpeakerCount_; - } - - public static final int SPEAKER_TAG_FIELD_NUMBER = 5; - private int speakerTag_; - /** - * - * - *
-   * Unused.
-   * 
- * - * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The speakerTag. - */ - @java.lang.Override - @java.lang.Deprecated - public int getSpeakerTag() { - return speakerTag_; - } - - 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 (enableSpeakerDiarization_ != false) { - output.writeBool(1, enableSpeakerDiarization_); - } - if (minSpeakerCount_ != 0) { - output.writeInt32(2, minSpeakerCount_); - } - if (maxSpeakerCount_ != 0) { - output.writeInt32(3, maxSpeakerCount_); - } - if (speakerTag_ != 0) { - output.writeInt32(5, speakerTag_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (enableSpeakerDiarization_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enableSpeakerDiarization_); - } - if (minSpeakerCount_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, minSpeakerCount_); - } - if (maxSpeakerCount_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, maxSpeakerCount_); - } - if (speakerTag_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, speakerTag_); - } - size += unknownFields.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.SpeakerDiarizationConfig)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.SpeakerDiarizationConfig other = - (com.google.cloud.speech.v1.SpeakerDiarizationConfig) obj; - - if (getEnableSpeakerDiarization() != other.getEnableSpeakerDiarization()) return false; - if (getMinSpeakerCount() != other.getMinSpeakerCount()) return false; - if (getMaxSpeakerCount() != other.getMaxSpeakerCount()) return false; - if (getSpeakerTag() != other.getSpeakerTag()) return false; - if (!unknownFields.equals(other.unknownFields)) 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) + ENABLE_SPEAKER_DIARIZATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableSpeakerDiarization()); - hash = (37 * hash) + MIN_SPEAKER_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getMinSpeakerCount(); - hash = (37 * hash) + MAX_SPEAKER_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getMaxSpeakerCount(); - hash = (37 * hash) + SPEAKER_TAG_FIELD_NUMBER; - hash = (53 * hash) + getSpeakerTag(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.SpeakerDiarizationConfig 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.SpeakerDiarizationConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.SpeakerDiarizationConfig 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.SpeakerDiarizationConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.SpeakerDiarizationConfig 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.SpeakerDiarizationConfig parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.SpeakerDiarizationConfig 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.SpeakerDiarizationConfig parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.SpeakerDiarizationConfig 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.SpeakerDiarizationConfig 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.SpeakerDiarizationConfig 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.SpeakerDiarizationConfig 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; - } - /** - * - * - *
-   * Config to enable speaker diarization.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.SpeakerDiarizationConfig} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.SpeakerDiarizationConfig) - com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.SpeakerDiarizationConfig.class, - com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.SpeakerDiarizationConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - enableSpeakerDiarization_ = false; - - minSpeakerCount_ = 0; - - maxSpeakerCount_ = 0; - - speakerTag_ = 0; - - 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_SpeakerDiarizationConfig_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeakerDiarizationConfig getDefaultInstanceForType() { - return com.google.cloud.speech.v1.SpeakerDiarizationConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeakerDiarizationConfig build() { - com.google.cloud.speech.v1.SpeakerDiarizationConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeakerDiarizationConfig buildPartial() { - com.google.cloud.speech.v1.SpeakerDiarizationConfig result = - new com.google.cloud.speech.v1.SpeakerDiarizationConfig(this); - result.enableSpeakerDiarization_ = enableSpeakerDiarization_; - result.minSpeakerCount_ = minSpeakerCount_; - result.maxSpeakerCount_ = maxSpeakerCount_; - result.speakerTag_ = speakerTag_; - 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.SpeakerDiarizationConfig) { - return mergeFrom((com.google.cloud.speech.v1.SpeakerDiarizationConfig) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.SpeakerDiarizationConfig other) { - if (other == com.google.cloud.speech.v1.SpeakerDiarizationConfig.getDefaultInstance()) - return this; - if (other.getEnableSpeakerDiarization() != false) { - setEnableSpeakerDiarization(other.getEnableSpeakerDiarization()); - } - if (other.getMinSpeakerCount() != 0) { - setMinSpeakerCount(other.getMinSpeakerCount()); - } - if (other.getMaxSpeakerCount() != 0) { - setMaxSpeakerCount(other.getMaxSpeakerCount()); - } - if (other.getSpeakerTag() != 0) { - setSpeakerTag(other.getSpeakerTag()); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1.SpeakerDiarizationConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1.SpeakerDiarizationConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean enableSpeakerDiarization_; - /** - * - * - *
-     * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
-     * 
- * - * bool enable_speaker_diarization = 1; - * - * @return The enableSpeakerDiarization. - */ - @java.lang.Override - public boolean getEnableSpeakerDiarization() { - return enableSpeakerDiarization_; - } - /** - * - * - *
-     * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
-     * 
- * - * bool enable_speaker_diarization = 1; - * - * @param value The enableSpeakerDiarization to set. - * @return This builder for chaining. - */ - public Builder setEnableSpeakerDiarization(boolean value) { - - enableSpeakerDiarization_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
-     * 
- * - * bool enable_speaker_diarization = 1; - * - * @return This builder for chaining. - */ - public Builder clearEnableSpeakerDiarization() { - - enableSpeakerDiarization_ = false; - onChanged(); - return this; - } - - private int minSpeakerCount_; - /** - * - * - *
-     * Minimum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 2.
-     * 
- * - * int32 min_speaker_count = 2; - * - * @return The minSpeakerCount. - */ - @java.lang.Override - public int getMinSpeakerCount() { - return minSpeakerCount_; - } - /** - * - * - *
-     * Minimum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 2.
-     * 
- * - * int32 min_speaker_count = 2; - * - * @param value The minSpeakerCount to set. - * @return This builder for chaining. - */ - public Builder setMinSpeakerCount(int value) { - - minSpeakerCount_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Minimum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 2.
-     * 
- * - * int32 min_speaker_count = 2; - * - * @return This builder for chaining. - */ - public Builder clearMinSpeakerCount() { - - minSpeakerCount_ = 0; - onChanged(); - return this; - } - - private int maxSpeakerCount_; - /** - * - * - *
-     * Maximum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 6.
-     * 
- * - * int32 max_speaker_count = 3; - * - * @return The maxSpeakerCount. - */ - @java.lang.Override - public int getMaxSpeakerCount() { - return maxSpeakerCount_; - } - /** - * - * - *
-     * Maximum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 6.
-     * 
- * - * int32 max_speaker_count = 3; - * - * @param value The maxSpeakerCount to set. - * @return This builder for chaining. - */ - public Builder setMaxSpeakerCount(int value) { - - maxSpeakerCount_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Maximum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 6.
-     * 
- * - * int32 max_speaker_count = 3; - * - * @return This builder for chaining. - */ - public Builder clearMaxSpeakerCount() { - - maxSpeakerCount_ = 0; - onChanged(); - return this; - } - - private int speakerTag_; - /** - * - * - *
-     * Unused.
-     * 
- * - * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The speakerTag. - */ - @java.lang.Override - @java.lang.Deprecated - public int getSpeakerTag() { - return speakerTag_; - } - /** - * - * - *
-     * Unused.
-     * 
- * - * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @param value The speakerTag to set. - * @return This builder for chaining. - */ - @java.lang.Deprecated - public Builder setSpeakerTag(int value) { - - speakerTag_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Unused.
-     * 
- * - * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return This builder for chaining. - */ - @java.lang.Deprecated - public Builder clearSpeakerTag() { - - speakerTag_ = 0; - 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.SpeakerDiarizationConfig) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeakerDiarizationConfig) - private static final com.google.cloud.speech.v1.SpeakerDiarizationConfig DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.SpeakerDiarizationConfig(); - } - - public static com.google.cloud.speech.v1.SpeakerDiarizationConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SpeakerDiarizationConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeakerDiarizationConfig(input, extensionRegistry); - } - }; - - 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.SpeakerDiarizationConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfigOrBuilder.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfigOrBuilder.java deleted file mode 100644 index 7f51aa1ae..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfigOrBuilder.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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 SpeakerDiarizationConfigOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.SpeakerDiarizationConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * If 'true', enables speaker detection for each recognized word in
-   * the top alternative of the recognition result using a speaker_tag provided
-   * in the WordInfo.
-   * 
- * - * bool enable_speaker_diarization = 1; - * - * @return The enableSpeakerDiarization. - */ - boolean getEnableSpeakerDiarization(); - - /** - * - * - *
-   * Minimum number of speakers in the conversation. This range gives you more
-   * flexibility by allowing the system to automatically determine the correct
-   * number of speakers. If not set, the default value is 2.
-   * 
- * - * int32 min_speaker_count = 2; - * - * @return The minSpeakerCount. - */ - int getMinSpeakerCount(); - - /** - * - * - *
-   * Maximum number of speakers in the conversation. This range gives you more
-   * flexibility by allowing the system to automatically determine the correct
-   * number of speakers. If not set, the default value is 6.
-   * 
- * - * int32 max_speaker_count = 3; - * - * @return The maxSpeakerCount. - */ - int getMaxSpeakerCount(); - - /** - * - * - *
-   * Unused.
-   * 
- * - * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The speakerTag. - */ - @java.lang.Deprecated - int getSpeakerTag(); -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechContext.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechContext.java deleted file mode 100644 index 90fbab884..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechContext.java +++ /dev/null @@ -1,866 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * Provides "hints" to the speech recognizer to favor specific words and phrases
- * in the results.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.SpeechContext} - */ -public final class SpeechContext extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.SpeechContext) - SpeechContextOrBuilder { - private static final long serialVersionUID = 0L; - // Use SpeechContext.newBuilder() to construct. - private SpeechContext(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SpeechContext() { - phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SpeechContext(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private SpeechContext( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - phrases_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - phrases_.add(s); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - phrases_ = phrases_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_SpeechContext_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_SpeechContext_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.SpeechContext.class, - com.google.cloud.speech.v1.SpeechContext.Builder.class); - } - - public static final int PHRASES_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList phrases_; - /** - * - * - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * - * @return A list containing the phrases. - */ - public com.google.protobuf.ProtocolStringList getPhrasesList() { - return phrases_; - } - /** - * - * - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * - * @return The count of phrases. - */ - public int getPhrasesCount() { - return phrases_.size(); - } - /** - * - * - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * - * @param index The index of the element to return. - * @return The phrases at the given index. - */ - public java.lang.String getPhrases(int index) { - return phrases_.get(index); - } - /** - * - * - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * - * @param index The index of the value to return. - * @return The bytes of the phrases at the given index. - */ - public com.google.protobuf.ByteString getPhrasesBytes(int index) { - return phrases_.getByteString(index); - } - - 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 { - for (int i = 0; i < phrases_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, phrases_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < phrases_.size(); i++) { - dataSize += computeStringSizeNoTag(phrases_.getRaw(i)); - } - size += dataSize; - size += 1 * getPhrasesList().size(); - } - size += unknownFields.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.SpeechContext)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.SpeechContext other = (com.google.cloud.speech.v1.SpeechContext) obj; - - if (!getPhrasesList().equals(other.getPhrasesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getPhrasesCount() > 0) { - hash = (37 * hash) + PHRASES_FIELD_NUMBER; - hash = (53 * hash) + getPhrasesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.SpeechContext parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.SpeechContext 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.SpeechContext parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.SpeechContext 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.SpeechContext parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.SpeechContext 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.SpeechContext parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.SpeechContext 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.SpeechContext parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.SpeechContext 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.SpeechContext 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.SpeechContext 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.SpeechContext 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; - } - /** - * - * - *
-   * Provides "hints" to the speech recognizer to favor specific words and phrases
-   * in the results.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.SpeechContext} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.SpeechContext) - com.google.cloud.speech.v1.SpeechContextOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_SpeechContext_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_SpeechContext_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.SpeechContext.class, - com.google.cloud.speech.v1.SpeechContext.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.SpeechContext.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - 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_SpeechContext_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechContext getDefaultInstanceForType() { - return com.google.cloud.speech.v1.SpeechContext.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechContext build() { - com.google.cloud.speech.v1.SpeechContext result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechContext buildPartial() { - com.google.cloud.speech.v1.SpeechContext result = - new com.google.cloud.speech.v1.SpeechContext(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - phrases_ = phrases_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.phrases_ = phrases_; - 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.SpeechContext) { - return mergeFrom((com.google.cloud.speech.v1.SpeechContext) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.SpeechContext other) { - if (other == com.google.cloud.speech.v1.SpeechContext.getDefaultInstance()) return this; - if (!other.phrases_.isEmpty()) { - if (phrases_.isEmpty()) { - phrases_ = other.phrases_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePhrasesIsMutable(); - phrases_.addAll(other.phrases_); - } - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1.SpeechContext parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.SpeechContext) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private com.google.protobuf.LazyStringList phrases_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensurePhrasesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - phrases_ = new com.google.protobuf.LazyStringArrayList(phrases_); - bitField0_ |= 0x00000001; - } - } - /** - * - * - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * - * @return A list containing the phrases. - */ - public com.google.protobuf.ProtocolStringList getPhrasesList() { - return phrases_.getUnmodifiableView(); - } - /** - * - * - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * - * @return The count of phrases. - */ - public int getPhrasesCount() { - return phrases_.size(); - } - /** - * - * - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * - * @param index The index of the element to return. - * @return The phrases at the given index. - */ - public java.lang.String getPhrases(int index) { - return phrases_.get(index); - } - /** - * - * - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * - * @param index The index of the value to return. - * @return The bytes of the phrases at the given index. - */ - public com.google.protobuf.ByteString getPhrasesBytes(int index) { - return phrases_.getByteString(index); - } - /** - * - * - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * - * @param index The index to set the value at. - * @param value The phrases to set. - * @return This builder for chaining. - */ - public Builder setPhrases(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhrasesIsMutable(); - phrases_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * - * @param value The phrases to add. - * @return This builder for chaining. - */ - public Builder addPhrases(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhrasesIsMutable(); - phrases_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * - * @param values The phrases to add. - * @return This builder for chaining. - */ - public Builder addAllPhrases(java.lang.Iterable values) { - ensurePhrasesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, phrases_); - onChanged(); - return this; - } - /** - * - * - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * - * @return This builder for chaining. - */ - public Builder clearPhrases() { - phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * - * @param value The bytes of the phrases to add. - * @return This builder for chaining. - */ - public Builder addPhrasesBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensurePhrasesIsMutable(); - phrases_.add(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.SpeechContext) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeechContext) - private static final com.google.cloud.speech.v1.SpeechContext DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.SpeechContext(); - } - - public static com.google.cloud.speech.v1.SpeechContext getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SpeechContext parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeechContext(input, extensionRegistry); - } - }; - - 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.SpeechContext getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechContextOrBuilder.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechContextOrBuilder.java deleted file mode 100644 index 04daade92..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechContextOrBuilder.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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 SpeechContextOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.SpeechContext) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * - * @return A list containing the phrases. - */ - java.util.List getPhrasesList(); - /** - * - * - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * - * @return The count of phrases. - */ - int getPhrasesCount(); - /** - * - * - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * - * @param index The index of the element to return. - * @return The phrases at the given index. - */ - java.lang.String getPhrases(int index); - /** - * - * - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * - * @param index The index of the value to return. - * @return The bytes of the phrases at the given index. - */ - com.google.protobuf.ByteString getPhrasesBytes(int index); -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechProto.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechProto.java deleted file mode 100644 index 5affb03a4..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechProto.java +++ /dev/null @@ -1,423 +0,0 @@ -/* - * 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 final class SpeechProto { - private SpeechProto() {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_RecognizeRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_RecognizeRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_LongRunningRecognizeRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_LongRunningRecognizeRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_StreamingRecognizeRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_StreamingRecognizeRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_StreamingRecognitionConfig_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_StreamingRecognitionConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_RecognitionConfig_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_RecognitionConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_RecognitionMetadata_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_RecognitionMetadata_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_SpeechContext_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_SpeechContext_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_RecognitionAudio_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_RecognitionAudio_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_RecognizeResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_RecognizeResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_LongRunningRecognizeResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_LongRunningRecognizeResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_LongRunningRecognizeMetadata_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_LongRunningRecognizeMetadata_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_StreamingRecognizeResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_StreamingRecognizeResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_StreamingRecognitionResult_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_StreamingRecognitionResult_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_SpeechRecognitionResult_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_SpeechRecognitionResult_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_SpeechRecognitionAlternative_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_SpeechRecognitionAlternative_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_WordInfo_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_WordInfo_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - - static { - java.lang.String[] descriptorData = { - "\n)google/cloud/speech/v1/cloud_speech.pr" - + "oto\022\026google.cloud.speech.v1\032\034google/api/" - + "annotations.proto\032\027google/api/client.pro" - + "to\032\037google/api/field_behavior.proto\032#goo" - + "gle/longrunning/operations.proto\032\031google" - + "/protobuf/any.proto\032\036google/protobuf/dur" - + "ation.proto\032\037google/protobuf/timestamp.p" - + "roto\032\027google/rpc/status.proto\"\220\001\n\020Recogn" - + "izeRequest\022>\n\006config\030\001 \001(\0132).google.clou" - + "d.speech.v1.RecognitionConfigB\003\340A\002\022<\n\005au" - + "dio\030\002 \001(\0132(.google.cloud.speech.v1.Recog" - + "nitionAudioB\003\340A\002\"\233\001\n\033LongRunningRecogniz" - + "eRequest\022>\n\006config\030\001 \001(\0132).google.cloud." - + "speech.v1.RecognitionConfigB\003\340A\002\022<\n\005audi" - + "o\030\002 \001(\0132(.google.cloud.speech.v1.Recogni" - + "tionAudioB\003\340A\002\"\231\001\n\031StreamingRecognizeReq" - + "uest\022N\n\020streaming_config\030\001 \001(\01322.google." - + "cloud.speech.v1.StreamingRecognitionConf" - + "igH\000\022\027\n\raudio_content\030\002 \001(\014H\000B\023\n\021streami" - + "ng_request\"\217\001\n\032StreamingRecognitionConfi" - + "g\022>\n\006config\030\001 \001(\0132).google.cloud.speech." - + "v1.RecognitionConfigB\003\340A\002\022\030\n\020single_utte" - + "rance\030\002 \001(\010\022\027\n\017interim_results\030\003 \001(\010\"\337\005\n" - + "\021RecognitionConfig\022I\n\010encoding\030\001 \001(\01627.g" - + "oogle.cloud.speech.v1.RecognitionConfig." - + "AudioEncoding\022\031\n\021sample_rate_hertz\030\002 \001(\005" - + "\022\033\n\023audio_channel_count\030\007 \001(\005\022/\n\'enable_" - + "separate_recognition_per_channel\030\014 \001(\010\022\032" - + "\n\rlanguage_code\030\003 \001(\tB\003\340A\002\022\030\n\020max_altern" - + "atives\030\004 \001(\005\022\030\n\020profanity_filter\030\005 \001(\010\022>" - + "\n\017speech_contexts\030\006 \003(\0132%.google.cloud.s" - + "peech.v1.SpeechContext\022 \n\030enable_word_ti" - + "me_offsets\030\010 \001(\010\022$\n\034enable_automatic_pun" - + "ctuation\030\013 \001(\010\022L\n\022diarization_config\030\023 \001" - + "(\01320.google.cloud.speech.v1.SpeakerDiari" - + "zationConfig\022=\n\010metadata\030\t \001(\0132+.google." - + "cloud.speech.v1.RecognitionMetadata\022\r\n\005m" - + "odel\030\r \001(\t\022\024\n\014use_enhanced\030\016 \001(\010\"\213\001\n\rAud" - + "ioEncoding\022\030\n\024ENCODING_UNSPECIFIED\020\000\022\014\n\010" - + "LINEAR16\020\001\022\010\n\004FLAC\020\002\022\t\n\005MULAW\020\003\022\007\n\003AMR\020\004" - + "\022\n\n\006AMR_WB\020\005\022\014\n\010OGG_OPUS\020\006\022\032\n\026SPEEX_WITH" - + "_HEADER_BYTE\020\007\"\220\001\n\030SpeakerDiarizationCon" - + "fig\022\"\n\032enable_speaker_diarization\030\001 \001(\010\022" - + "\031\n\021min_speaker_count\030\002 \001(\005\022\031\n\021max_speake" - + "r_count\030\003 \001(\005\022\032\n\013speaker_tag\030\005 \001(\005B\005\030\001\340A" - + "\003\"\240\010\n\023RecognitionMetadata\022U\n\020interaction" - + "_type\030\001 \001(\0162;.google.cloud.speech.v1.Rec" - + "ognitionMetadata.InteractionType\022$\n\034indu" - + "stry_naics_code_of_audio\030\003 \001(\r\022[\n\023microp" - + "hone_distance\030\004 \001(\0162>.google.cloud.speec" - + "h.v1.RecognitionMetadata.MicrophoneDista" - + "nce\022Z\n\023original_media_type\030\005 \001(\0162=.googl" - + "e.cloud.speech.v1.RecognitionMetadata.Or" - + "iginalMediaType\022^\n\025recording_device_type" - + "\030\006 \001(\0162?.google.cloud.speech.v1.Recognit" - + "ionMetadata.RecordingDeviceType\022\035\n\025recor" - + "ding_device_name\030\007 \001(\t\022\032\n\022original_mime_" - + "type\030\010 \001(\t\022\023\n\013audio_topic\030\n \001(\t\"\305\001\n\017Inte" - + "ractionType\022 \n\034INTERACTION_TYPE_UNSPECIF" - + "IED\020\000\022\016\n\nDISCUSSION\020\001\022\020\n\014PRESENTATION\020\002\022" - + "\016\n\nPHONE_CALL\020\003\022\r\n\tVOICEMAIL\020\004\022\033\n\027PROFES" - + "SIONALLY_PRODUCED\020\005\022\020\n\014VOICE_SEARCH\020\006\022\021\n" - + "\rVOICE_COMMAND\020\007\022\r\n\tDICTATION\020\010\"d\n\022Micro" - + "phoneDistance\022#\n\037MICROPHONE_DISTANCE_UNS" - + "PECIFIED\020\000\022\r\n\tNEARFIELD\020\001\022\014\n\010MIDFIELD\020\002\022" - + "\014\n\010FARFIELD\020\003\"N\n\021OriginalMediaType\022#\n\037OR" - + "IGINAL_MEDIA_TYPE_UNSPECIFIED\020\000\022\t\n\005AUDIO" - + "\020\001\022\t\n\005VIDEO\020\002\"\244\001\n\023RecordingDeviceType\022%\n" - + "!RECORDING_DEVICE_TYPE_UNSPECIFIED\020\000\022\016\n\n" - + "SMARTPHONE\020\001\022\006\n\002PC\020\002\022\016\n\nPHONE_LINE\020\003\022\013\n\007" - + "VEHICLE\020\004\022\030\n\024OTHER_OUTDOOR_DEVICE\020\005\022\027\n\023O" - + "THER_INDOOR_DEVICE\020\006\" \n\rSpeechContext\022\017\n" - + "\007phrases\030\001 \003(\t\"D\n\020RecognitionAudio\022\021\n\007co" - + "ntent\030\001 \001(\014H\000\022\r\n\003uri\030\002 \001(\tH\000B\016\n\014audio_so" - + "urce\"U\n\021RecognizeResponse\022@\n\007results\030\002 \003" - + "(\0132/.google.cloud.speech.v1.SpeechRecogn" - + "itionResult\"`\n\034LongRunningRecognizeRespo" - + "nse\022@\n\007results\030\002 \003(\0132/.google.cloud.spee" - + "ch.v1.SpeechRecognitionResult\"\236\001\n\034LongRu" - + "nningRecognizeMetadata\022\030\n\020progress_perce" - + "nt\030\001 \001(\005\022.\n\nstart_time\030\002 \001(\0132\032.google.pr" - + "otobuf.Timestamp\0224\n\020last_update_time\030\003 \001" - + "(\0132\032.google.protobuf.Timestamp\"\261\002\n\032Strea" - + "mingRecognizeResponse\022!\n\005error\030\001 \001(\0132\022.g" - + "oogle.rpc.Status\022C\n\007results\030\002 \003(\01322.goog" - + "le.cloud.speech.v1.StreamingRecognitionR" - + "esult\022]\n\021speech_event_type\030\004 \001(\0162B.googl" - + "e.cloud.speech.v1.StreamingRecognizeResp" - + "onse.SpeechEventType\"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\"z\n\027SpeechRecogni" - + "tionResult\022J\n\014alternatives\030\001 \003(\01324.googl" - + "e.cloud.speech.v1.SpeechRecognitionAlter" - + "native\022\023\n\013channel_tag\030\002 \001(\005\"w\n\034SpeechRec" - + "ognitionAlternative\022\022\n\ntranscript\030\001 \001(\t\022" - + "\022\n\nconfidence\030\002 \001(\002\022/\n\005words\030\003 \003(\0132 .goo" - + "gle.cloud.speech.v1.WordInfo\"\216\001\n\010WordInf" - + "o\022-\n\nstart_time\030\001 \001(\0132\031.google.protobuf." - + "Duration\022+\n\010end_time\030\002 \001(\0132\031.google.prot" - + "obuf.Duration\022\014\n\004word\030\003 \001(\t\022\030\n\013speaker_t" - + "ag\030\005 \001(\005B\003\340A\0032\321\004\n\006Speech\022\220\001\n\tRecognize\022(" - + ".google.cloud.speech.v1.RecognizeRequest" - + "\032).google.cloud.speech.v1.RecognizeRespo" - + "nse\".\202\323\344\223\002\031\"\024/v1/speech:recognize:\001*\332A\014c" - + "onfig,audio\022\344\001\n\024LongRunningRecognize\0223.g" - + "oogle.cloud.speech.v1.LongRunningRecogni" - + "zeRequest\032\035.google.longrunning.Operation" - + "\"x\202\323\344\223\002$\"\037/v1/speech:longrunningrecogniz" - + "e:\001*\332A\014config,audio\312A<\n\034LongRunningRecog" - + "nizeResponse\022\034LongRunningRecognizeMetada" - + "ta\022\201\001\n\022StreamingRecognize\0221.google.cloud" - + ".speech.v1.StreamingRecognizeRequest\0322.g" - + "oogle.cloud.speech.v1.StreamingRecognize" - + "Response\"\000(\0010\001\032I\312A\025speech.googleapis.com" - + "\322A.https://www.googleapis.com/auth/cloud" - + "-platformBr\n\032com.google.cloud.speech.v1B" - + "\013SpeechProtoP\001Z - * Alternative hypotheses (a.k.a. n-best list). - * - * - * Protobuf type {@code google.cloud.speech.v1.SpeechRecognitionAlternative} - */ -public final class SpeechRecognitionAlternative extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.SpeechRecognitionAlternative) - SpeechRecognitionAlternativeOrBuilder { - private static final long serialVersionUID = 0L; - // Use SpeechRecognitionAlternative.newBuilder() to construct. - private SpeechRecognitionAlternative(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SpeechRecognitionAlternative() { - transcript_ = ""; - words_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SpeechRecognitionAlternative(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private SpeechRecognitionAlternative( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - transcript_ = s; - break; - } - case 21: - { - confidence_ = input.readFloat(); - break; - } - case 26: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - words_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - words_.add( - input.readMessage( - com.google.cloud.speech.v1.WordInfo.parser(), extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - words_ = java.util.Collections.unmodifiableList(words_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_SpeechRecognitionAlternative_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_SpeechRecognitionAlternative_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.SpeechRecognitionAlternative.class, - com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder.class); - } - - public static final int TRANSCRIPT_FIELD_NUMBER = 1; - private volatile java.lang.Object transcript_; - /** - * - * - *
-   * Transcript text representing the words that the user spoke.
-   * 
- * - * string transcript = 1; - * - * @return The transcript. - */ - @java.lang.Override - public java.lang.String getTranscript() { - java.lang.Object ref = transcript_; - 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(); - transcript_ = s; - return s; - } - } - /** - * - * - *
-   * Transcript text representing the words that the user spoke.
-   * 
- * - * string transcript = 1; - * - * @return The bytes for transcript. - */ - @java.lang.Override - public com.google.protobuf.ByteString getTranscriptBytes() { - java.lang.Object ref = transcript_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - transcript_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONFIDENCE_FIELD_NUMBER = 2; - private float confidence_; - /** - * - * - *
-   * The confidence estimate between 0.0 and 1.0. A higher number
-   * indicates an estimated greater likelihood that the recognized words are
-   * correct. This field is set only for the top alternative of a non-streaming
-   * result or, of a streaming result where `is_final=true`.
-   * This field is not guaranteed to be accurate and users should not rely on it
-   * to be always provided.
-   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-   * 
- * - * float confidence = 2; - * - * @return The confidence. - */ - @java.lang.Override - public float getConfidence() { - return confidence_; - } - - public static final int WORDS_FIELD_NUMBER = 3; - private java.util.List words_; - /** - * - * - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - @java.lang.Override - public java.util.List getWordsList() { - return words_; - } - /** - * - * - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - @java.lang.Override - public java.util.List - getWordsOrBuilderList() { - return words_; - } - /** - * - * - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - @java.lang.Override - public int getWordsCount() { - return words_.size(); - } - /** - * - * - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - @java.lang.Override - public com.google.cloud.speech.v1.WordInfo getWords(int index) { - return words_.get(index); - } - /** - * - * - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - @java.lang.Override - public com.google.cloud.speech.v1.WordInfoOrBuilder getWordsOrBuilder(int index) { - return words_.get(index); - } - - 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 (!getTranscriptBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, transcript_); - } - if (confidence_ != 0F) { - output.writeFloat(2, confidence_); - } - for (int i = 0; i < words_.size(); i++) { - output.writeMessage(3, words_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getTranscriptBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, transcript_); - } - if (confidence_ != 0F) { - size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, confidence_); - } - for (int i = 0; i < words_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, words_.get(i)); - } - size += unknownFields.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.SpeechRecognitionAlternative)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.SpeechRecognitionAlternative other = - (com.google.cloud.speech.v1.SpeechRecognitionAlternative) obj; - - if (!getTranscript().equals(other.getTranscript())) return false; - if (java.lang.Float.floatToIntBits(getConfidence()) - != java.lang.Float.floatToIntBits(other.getConfidence())) return false; - if (!getWordsList().equals(other.getWordsList())) return false; - if (!unknownFields.equals(other.unknownFields)) 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) + TRANSCRIPT_FIELD_NUMBER; - hash = (53 * hash) + getTranscript().hashCode(); - hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidence()); - if (getWordsCount() > 0) { - hash = (37 * hash) + WORDS_FIELD_NUMBER; - hash = (53 * hash) + getWordsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.SpeechRecognitionAlternative 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.SpeechRecognitionAlternative parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.SpeechRecognitionAlternative 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.SpeechRecognitionAlternative parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.SpeechRecognitionAlternative 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.SpeechRecognitionAlternative parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.SpeechRecognitionAlternative 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.SpeechRecognitionAlternative parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.SpeechRecognitionAlternative 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.SpeechRecognitionAlternative 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.SpeechRecognitionAlternative 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.SpeechRecognitionAlternative 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; - } - /** - * - * - *
-   * Alternative hypotheses (a.k.a. n-best list).
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.SpeechRecognitionAlternative} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.SpeechRecognitionAlternative) - com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_SpeechRecognitionAlternative_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_SpeechRecognitionAlternative_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.SpeechRecognitionAlternative.class, - com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.SpeechRecognitionAlternative.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getWordsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - transcript_ = ""; - - confidence_ = 0F; - - if (wordsBuilder_ == null) { - words_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - wordsBuilder_.clear(); - } - 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_SpeechRecognitionAlternative_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionAlternative getDefaultInstanceForType() { - return com.google.cloud.speech.v1.SpeechRecognitionAlternative.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionAlternative build() { - com.google.cloud.speech.v1.SpeechRecognitionAlternative result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionAlternative buildPartial() { - com.google.cloud.speech.v1.SpeechRecognitionAlternative result = - new com.google.cloud.speech.v1.SpeechRecognitionAlternative(this); - int from_bitField0_ = bitField0_; - result.transcript_ = transcript_; - result.confidence_ = confidence_; - if (wordsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - words_ = java.util.Collections.unmodifiableList(words_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.words_ = words_; - } else { - result.words_ = wordsBuilder_.build(); - } - 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.SpeechRecognitionAlternative) { - return mergeFrom((com.google.cloud.speech.v1.SpeechRecognitionAlternative) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.SpeechRecognitionAlternative other) { - if (other == com.google.cloud.speech.v1.SpeechRecognitionAlternative.getDefaultInstance()) - return this; - if (!other.getTranscript().isEmpty()) { - transcript_ = other.transcript_; - onChanged(); - } - if (other.getConfidence() != 0F) { - setConfidence(other.getConfidence()); - } - if (wordsBuilder_ == null) { - if (!other.words_.isEmpty()) { - if (words_.isEmpty()) { - words_ = other.words_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureWordsIsMutable(); - words_.addAll(other.words_); - } - onChanged(); - } - } else { - if (!other.words_.isEmpty()) { - if (wordsBuilder_.isEmpty()) { - wordsBuilder_.dispose(); - wordsBuilder_ = null; - words_ = other.words_; - bitField0_ = (bitField0_ & ~0x00000001); - wordsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getWordsFieldBuilder() - : null; - } else { - wordsBuilder_.addAllMessages(other.words_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1.SpeechRecognitionAlternative parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1.SpeechRecognitionAlternative) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object transcript_ = ""; - /** - * - * - *
-     * Transcript text representing the words that the user spoke.
-     * 
- * - * string transcript = 1; - * - * @return The transcript. - */ - public java.lang.String getTranscript() { - java.lang.Object ref = transcript_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - transcript_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Transcript text representing the words that the user spoke.
-     * 
- * - * string transcript = 1; - * - * @return The bytes for transcript. - */ - public com.google.protobuf.ByteString getTranscriptBytes() { - java.lang.Object ref = transcript_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - transcript_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Transcript text representing the words that the user spoke.
-     * 
- * - * string transcript = 1; - * - * @param value The transcript to set. - * @return This builder for chaining. - */ - public Builder setTranscript(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - transcript_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Transcript text representing the words that the user spoke.
-     * 
- * - * string transcript = 1; - * - * @return This builder for chaining. - */ - public Builder clearTranscript() { - - transcript_ = getDefaultInstance().getTranscript(); - onChanged(); - return this; - } - /** - * - * - *
-     * Transcript text representing the words that the user spoke.
-     * 
- * - * string transcript = 1; - * - * @param value The bytes for transcript to set. - * @return This builder for chaining. - */ - public Builder setTranscriptBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - transcript_ = value; - onChanged(); - return this; - } - - private float confidence_; - /** - * - * - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 2; - * - * @return The confidence. - */ - @java.lang.Override - public float getConfidence() { - return confidence_; - } - /** - * - * - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 2; - * - * @param value The confidence to set. - * @return This builder for chaining. - */ - public Builder setConfidence(float value) { - - confidence_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 2; - * - * @return This builder for chaining. - */ - public Builder clearConfidence() { - - confidence_ = 0F; - onChanged(); - return this; - } - - private java.util.List words_ = - java.util.Collections.emptyList(); - - private void ensureWordsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - words_ = new java.util.ArrayList(words_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.WordInfo, - com.google.cloud.speech.v1.WordInfo.Builder, - com.google.cloud.speech.v1.WordInfoOrBuilder> - wordsBuilder_; - - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public java.util.List getWordsList() { - if (wordsBuilder_ == null) { - return java.util.Collections.unmodifiableList(words_); - } else { - return wordsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public int getWordsCount() { - if (wordsBuilder_ == null) { - return words_.size(); - } else { - return wordsBuilder_.getCount(); - } - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public com.google.cloud.speech.v1.WordInfo getWords(int index) { - if (wordsBuilder_ == null) { - return words_.get(index); - } else { - return wordsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public Builder setWords(int index, com.google.cloud.speech.v1.WordInfo value) { - if (wordsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureWordsIsMutable(); - words_.set(index, value); - onChanged(); - } else { - wordsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public Builder setWords( - int index, com.google.cloud.speech.v1.WordInfo.Builder builderForValue) { - if (wordsBuilder_ == null) { - ensureWordsIsMutable(); - words_.set(index, builderForValue.build()); - onChanged(); - } else { - wordsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public Builder addWords(com.google.cloud.speech.v1.WordInfo value) { - if (wordsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureWordsIsMutable(); - words_.add(value); - onChanged(); - } else { - wordsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public Builder addWords(int index, com.google.cloud.speech.v1.WordInfo value) { - if (wordsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureWordsIsMutable(); - words_.add(index, value); - onChanged(); - } else { - wordsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public Builder addWords(com.google.cloud.speech.v1.WordInfo.Builder builderForValue) { - if (wordsBuilder_ == null) { - ensureWordsIsMutable(); - words_.add(builderForValue.build()); - onChanged(); - } else { - wordsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public Builder addWords( - int index, com.google.cloud.speech.v1.WordInfo.Builder builderForValue) { - if (wordsBuilder_ == null) { - ensureWordsIsMutable(); - words_.add(index, builderForValue.build()); - onChanged(); - } else { - wordsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public Builder addAllWords( - java.lang.Iterable values) { - if (wordsBuilder_ == null) { - ensureWordsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, words_); - onChanged(); - } else { - wordsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public Builder clearWords() { - if (wordsBuilder_ == null) { - words_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - wordsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public Builder removeWords(int index) { - if (wordsBuilder_ == null) { - ensureWordsIsMutable(); - words_.remove(index); - onChanged(); - } else { - wordsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public com.google.cloud.speech.v1.WordInfo.Builder getWordsBuilder(int index) { - return getWordsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public com.google.cloud.speech.v1.WordInfoOrBuilder getWordsOrBuilder(int index) { - if (wordsBuilder_ == null) { - return words_.get(index); - } else { - return wordsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public java.util.List - getWordsOrBuilderList() { - if (wordsBuilder_ != null) { - return wordsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(words_); - } - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public com.google.cloud.speech.v1.WordInfo.Builder addWordsBuilder() { - return getWordsFieldBuilder() - .addBuilder(com.google.cloud.speech.v1.WordInfo.getDefaultInstance()); - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public com.google.cloud.speech.v1.WordInfo.Builder addWordsBuilder(int index) { - return getWordsFieldBuilder() - .addBuilder(index, com.google.cloud.speech.v1.WordInfo.getDefaultInstance()); - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public java.util.List getWordsBuilderList() { - return getWordsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.WordInfo, - com.google.cloud.speech.v1.WordInfo.Builder, - com.google.cloud.speech.v1.WordInfoOrBuilder> - getWordsFieldBuilder() { - if (wordsBuilder_ == null) { - wordsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.WordInfo, - com.google.cloud.speech.v1.WordInfo.Builder, - com.google.cloud.speech.v1.WordInfoOrBuilder>( - words_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - words_ = null; - } - return wordsBuilder_; - } - - @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.SpeechRecognitionAlternative) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeechRecognitionAlternative) - private static final com.google.cloud.speech.v1.SpeechRecognitionAlternative DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.SpeechRecognitionAlternative(); - } - - public static com.google.cloud.speech.v1.SpeechRecognitionAlternative getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SpeechRecognitionAlternative parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeechRecognitionAlternative(input, extensionRegistry); - } - }; - - 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.SpeechRecognitionAlternative getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionAlternativeOrBuilder.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionAlternativeOrBuilder.java deleted file mode 100644 index fba8255dd..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionAlternativeOrBuilder.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 SpeechRecognitionAlternativeOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.SpeechRecognitionAlternative) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Transcript text representing the words that the user spoke.
-   * 
- * - * string transcript = 1; - * - * @return The transcript. - */ - java.lang.String getTranscript(); - /** - * - * - *
-   * Transcript text representing the words that the user spoke.
-   * 
- * - * string transcript = 1; - * - * @return The bytes for transcript. - */ - com.google.protobuf.ByteString getTranscriptBytes(); - - /** - * - * - *
-   * The confidence estimate between 0.0 and 1.0. A higher number
-   * indicates an estimated greater likelihood that the recognized words are
-   * correct. This field is set only for the top alternative of a non-streaming
-   * result or, of a streaming result where `is_final=true`.
-   * This field is not guaranteed to be accurate and users should not rely on it
-   * to be always provided.
-   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-   * 
- * - * float confidence = 2; - * - * @return The confidence. - */ - float getConfidence(); - - /** - * - * - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - java.util.List getWordsList(); - /** - * - * - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - com.google.cloud.speech.v1.WordInfo getWords(int index); - /** - * - * - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - int getWordsCount(); - /** - * - * - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - java.util.List getWordsOrBuilderList(); - /** - * - * - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - com.google.cloud.speech.v1.WordInfoOrBuilder getWordsOrBuilder(int index); -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResult.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResult.java deleted file mode 100644 index cf202d286..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResult.java +++ /dev/null @@ -1,1136 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * A speech recognition result corresponding to a portion of the audio.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.SpeechRecognitionResult} - */ -public final class SpeechRecognitionResult extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.SpeechRecognitionResult) - SpeechRecognitionResultOrBuilder { - private static final long serialVersionUID = 0L; - // Use SpeechRecognitionResult.newBuilder() to construct. - private SpeechRecognitionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SpeechRecognitionResult() { - alternatives_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SpeechRecognitionResult(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private SpeechRecognitionResult( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - alternatives_ = - new java.util.ArrayList< - com.google.cloud.speech.v1.SpeechRecognitionAlternative>(); - mutable_bitField0_ |= 0x00000001; - } - alternatives_.add( - input.readMessage( - com.google.cloud.speech.v1.SpeechRecognitionAlternative.parser(), - extensionRegistry)); - break; - } - case 16: - { - channelTag_ = input.readInt32(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - alternatives_ = java.util.Collections.unmodifiableList(alternatives_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_SpeechRecognitionResult_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_SpeechRecognitionResult_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.SpeechRecognitionResult.class, - com.google.cloud.speech.v1.SpeechRecognitionResult.Builder.class); - } - - public static final int ALTERNATIVES_FIELD_NUMBER = 1; - private java.util.List alternatives_; - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public java.util.List - getAlternativesList() { - return alternatives_; - } - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public java.util.List - getAlternativesOrBuilderList() { - return alternatives_; - } - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public int getAlternativesCount() { - return alternatives_.size(); - } - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionAlternative getAlternatives(int index) { - return alternatives_.get(index); - } - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( - int index) { - return alternatives_.get(index); - } - - public static final int CHANNEL_TAG_FIELD_NUMBER = 2; - private int channelTag_; - /** - * - * - *
-   * For multi-channel audio, this is the channel number corresponding to the
-   * recognized result for the audio from that channel.
-   * For audio_channel_count = N, its output values can range from '1' to 'N'.
-   * 
- * - * int32 channel_tag = 2; - * - * @return The channelTag. - */ - @java.lang.Override - public int getChannelTag() { - return channelTag_; - } - - 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 { - for (int i = 0; i < alternatives_.size(); i++) { - output.writeMessage(1, alternatives_.get(i)); - } - if (channelTag_ != 0) { - output.writeInt32(2, channelTag_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < alternatives_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, alternatives_.get(i)); - } - if (channelTag_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, channelTag_); - } - size += unknownFields.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.SpeechRecognitionResult)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.SpeechRecognitionResult other = - (com.google.cloud.speech.v1.SpeechRecognitionResult) obj; - - if (!getAlternativesList().equals(other.getAlternativesList())) return false; - if (getChannelTag() != other.getChannelTag()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getAlternativesCount() > 0) { - hash = (37 * hash) + ALTERNATIVES_FIELD_NUMBER; - hash = (53 * hash) + getAlternativesList().hashCode(); - } - hash = (37 * hash) + CHANNEL_TAG_FIELD_NUMBER; - hash = (53 * hash) + getChannelTag(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.SpeechRecognitionResult 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.SpeechRecognitionResult parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.SpeechRecognitionResult 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.SpeechRecognitionResult parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.SpeechRecognitionResult 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.SpeechRecognitionResult parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.SpeechRecognitionResult 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.SpeechRecognitionResult parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.SpeechRecognitionResult 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.SpeechRecognitionResult 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.SpeechRecognitionResult 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.SpeechRecognitionResult 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; - } - /** - * - * - *
-   * A speech recognition result corresponding to a portion of the audio.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.SpeechRecognitionResult} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.SpeechRecognitionResult) - com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_SpeechRecognitionResult_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_SpeechRecognitionResult_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.SpeechRecognitionResult.class, - com.google.cloud.speech.v1.SpeechRecognitionResult.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.SpeechRecognitionResult.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getAlternativesFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (alternativesBuilder_ == null) { - alternatives_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - alternativesBuilder_.clear(); - } - channelTag_ = 0; - - 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_SpeechRecognitionResult_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionResult getDefaultInstanceForType() { - return com.google.cloud.speech.v1.SpeechRecognitionResult.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionResult build() { - com.google.cloud.speech.v1.SpeechRecognitionResult result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionResult buildPartial() { - com.google.cloud.speech.v1.SpeechRecognitionResult result = - new com.google.cloud.speech.v1.SpeechRecognitionResult(this); - int from_bitField0_ = bitField0_; - if (alternativesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - alternatives_ = java.util.Collections.unmodifiableList(alternatives_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.alternatives_ = alternatives_; - } else { - result.alternatives_ = alternativesBuilder_.build(); - } - result.channelTag_ = channelTag_; - 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.SpeechRecognitionResult) { - return mergeFrom((com.google.cloud.speech.v1.SpeechRecognitionResult) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.SpeechRecognitionResult other) { - if (other == com.google.cloud.speech.v1.SpeechRecognitionResult.getDefaultInstance()) - return this; - if (alternativesBuilder_ == null) { - if (!other.alternatives_.isEmpty()) { - if (alternatives_.isEmpty()) { - alternatives_ = other.alternatives_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAlternativesIsMutable(); - alternatives_.addAll(other.alternatives_); - } - onChanged(); - } - } else { - if (!other.alternatives_.isEmpty()) { - if (alternativesBuilder_.isEmpty()) { - alternativesBuilder_.dispose(); - alternativesBuilder_ = null; - alternatives_ = other.alternatives_; - bitField0_ = (bitField0_ & ~0x00000001); - alternativesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getAlternativesFieldBuilder() - : null; - } else { - alternativesBuilder_.addAllMessages(other.alternatives_); - } - } - } - if (other.getChannelTag() != 0) { - setChannelTag(other.getChannelTag()); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1.SpeechRecognitionResult parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1.SpeechRecognitionResult) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List alternatives_ = - java.util.Collections.emptyList(); - - private void ensureAlternativesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - alternatives_ = - new java.util.ArrayList( - alternatives_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionAlternative, - com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder, - com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder> - alternativesBuilder_; - - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public java.util.List - getAlternativesList() { - if (alternativesBuilder_ == null) { - return java.util.Collections.unmodifiableList(alternatives_); - } else { - return alternativesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public int getAlternativesCount() { - if (alternativesBuilder_ == null) { - return alternatives_.size(); - } else { - return alternativesBuilder_.getCount(); - } - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1.SpeechRecognitionAlternative getAlternatives(int index) { - if (alternativesBuilder_ == null) { - return alternatives_.get(index); - } else { - return alternativesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder setAlternatives( - int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.set(index, value); - onChanged(); - } else { - alternativesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder setAlternatives( - int index, - com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.set(index, builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives(com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.add(value); - onChanged(); - } else { - alternativesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives( - int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.add(index, value); - onChanged(); - } else { - alternativesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives( - com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.add(builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives( - int index, - com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.add(index, builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAllAlternatives( - java.lang.Iterable - values) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, alternatives_); - onChanged(); - } else { - alternativesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder clearAlternatives() { - if (alternativesBuilder_ == null) { - alternatives_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - alternativesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder removeAlternatives(int index) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.remove(index); - onChanged(); - } else { - alternativesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder getAlternativesBuilder( - int index) { - return getAlternativesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder - getAlternativesOrBuilder(int index) { - if (alternativesBuilder_ == null) { - return alternatives_.get(index); - } else { - return alternativesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public java.util.List< - ? extends com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder> - getAlternativesOrBuilderList() { - if (alternativesBuilder_ != null) { - return alternativesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(alternatives_); - } - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder - addAlternativesBuilder() { - return getAlternativesFieldBuilder() - .addBuilder(com.google.cloud.speech.v1.SpeechRecognitionAlternative.getDefaultInstance()); - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder addAlternativesBuilder( - int index) { - return getAlternativesFieldBuilder() - .addBuilder( - index, com.google.cloud.speech.v1.SpeechRecognitionAlternative.getDefaultInstance()); - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public java.util.List - getAlternativesBuilderList() { - return getAlternativesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionAlternative, - com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder, - com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder> - getAlternativesFieldBuilder() { - if (alternativesBuilder_ == null) { - alternativesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionAlternative, - com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder, - com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder>( - alternatives_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - alternatives_ = null; - } - return alternativesBuilder_; - } - - private int channelTag_; - /** - * - * - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 2; - * - * @return The channelTag. - */ - @java.lang.Override - public int getChannelTag() { - return channelTag_; - } - /** - * - * - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 2; - * - * @param value The channelTag to set. - * @return This builder for chaining. - */ - public Builder setChannelTag(int value) { - - channelTag_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 2; - * - * @return This builder for chaining. - */ - public Builder clearChannelTag() { - - channelTag_ = 0; - 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.SpeechRecognitionResult) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeechRecognitionResult) - private static final com.google.cloud.speech.v1.SpeechRecognitionResult DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.SpeechRecognitionResult(); - } - - public static com.google.cloud.speech.v1.SpeechRecognitionResult getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SpeechRecognitionResult parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeechRecognitionResult(input, extensionRegistry); - } - }; - - 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.SpeechRecognitionResult getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResultOrBuilder.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResultOrBuilder.java deleted file mode 100644 index cfb90df9c..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResultOrBuilder.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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 SpeechRecognitionResultOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.SpeechRecognitionResult) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - java.util.List getAlternativesList(); - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - com.google.cloud.speech.v1.SpeechRecognitionAlternative getAlternatives(int index); - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - int getAlternativesCount(); - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - java.util.List - getAlternativesOrBuilderList(); - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( - int index); - - /** - * - * - *
-   * For multi-channel audio, this is the channel number corresponding to the
-   * recognized result for the audio from that channel.
-   * For audio_channel_count = N, its output values can range from '1' to 'N'.
-   * 
- * - * int32 channel_tag = 2; - * - * @return The channelTag. - */ - int getChannelTag(); -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionConfig.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionConfig.java deleted file mode 100644 index a2e12018c..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionConfig.java +++ /dev/null @@ -1,1000 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * Provides information to the recognizer that specifies how to process the
- * request.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.StreamingRecognitionConfig} - */ -public final class StreamingRecognitionConfig extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.StreamingRecognitionConfig) - StreamingRecognitionConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use StreamingRecognitionConfig.newBuilder() to construct. - private StreamingRecognitionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private StreamingRecognitionConfig() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new StreamingRecognitionConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private StreamingRecognitionConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.speech.v1.RecognitionConfig.Builder subBuilder = null; - if (config_ != null) { - subBuilder = config_.toBuilder(); - } - config_ = - input.readMessage( - com.google.cloud.speech.v1.RecognitionConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(config_); - config_ = subBuilder.buildPartial(); - } - - break; - } - case 16: - { - singleUtterance_ = input.readBool(); - break; - } - case 24: - { - interimResults_ = input.readBool(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_StreamingRecognitionConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_StreamingRecognitionConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.StreamingRecognitionConfig.class, - com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder.class); - } - - public static final int CONFIG_FIELD_NUMBER = 1; - private com.google.cloud.speech.v1.RecognitionConfig config_; - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the config field is set. - */ - @java.lang.Override - public boolean hasConfig() { - return config_ != null; - } - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The config. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfig getConfig() { - return config_ == null - ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() - : config_; - } - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder() { - return getConfig(); - } - - public static final int SINGLE_UTTERANCE_FIELD_NUMBER = 2; - private boolean singleUtterance_; - /** - * - * - *
-   * If `false` or omitted, the recognizer will perform continuous
-   * recognition (continuing to wait for and process audio even if the user
-   * pauses speaking) until the client closes the input stream (gRPC API) or
-   * until the maximum time limit has been reached. May return multiple
-   * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-   * If `true`, the recognizer will detect a single spoken utterance. When it
-   * detects that the user has paused or stopped speaking, it will return an
-   * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
-   * more than one `StreamingRecognitionResult` with the `is_final` flag set to
-   * `true`.
-   * 
- * - * bool single_utterance = 2; - * - * @return The singleUtterance. - */ - @java.lang.Override - public boolean getSingleUtterance() { - return singleUtterance_; - } - - public static final int INTERIM_RESULTS_FIELD_NUMBER = 3; - private boolean interimResults_; - /** - * - * - *
-   * If `true`, interim results (tentative hypotheses) may be
-   * returned as they become available (these interim results are indicated with
-   * the `is_final=false` flag).
-   * If `false` or omitted, only `is_final=true` result(s) are returned.
-   * 
- * - * bool interim_results = 3; - * - * @return The interimResults. - */ - @java.lang.Override - public boolean getInterimResults() { - return interimResults_; - } - - 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 (config_ != null) { - output.writeMessage(1, getConfig()); - } - if (singleUtterance_ != false) { - output.writeBool(2, singleUtterance_); - } - if (interimResults_ != false) { - output.writeBool(3, interimResults_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (config_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getConfig()); - } - if (singleUtterance_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, singleUtterance_); - } - if (interimResults_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, interimResults_); - } - size += unknownFields.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.StreamingRecognitionConfig)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.StreamingRecognitionConfig other = - (com.google.cloud.speech.v1.StreamingRecognitionConfig) obj; - - if (hasConfig() != other.hasConfig()) return false; - if (hasConfig()) { - if (!getConfig().equals(other.getConfig())) return false; - } - if (getSingleUtterance() != other.getSingleUtterance()) return false; - if (getInterimResults() != other.getInterimResults()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConfig()) { - hash = (37 * hash) + CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getConfig().hashCode(); - } - hash = (37 * hash) + SINGLE_UTTERANCE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSingleUtterance()); - hash = (37 * hash) + INTERIM_RESULTS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getInterimResults()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.StreamingRecognitionConfig 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.StreamingRecognitionConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.StreamingRecognitionConfig 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.StreamingRecognitionConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.StreamingRecognitionConfig 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.StreamingRecognitionConfig parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.StreamingRecognitionConfig 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.StreamingRecognitionConfig parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.StreamingRecognitionConfig 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.StreamingRecognitionConfig 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.StreamingRecognitionConfig 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.StreamingRecognitionConfig 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; - } - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.StreamingRecognitionConfig} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.StreamingRecognitionConfig) - com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_StreamingRecognitionConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_StreamingRecognitionConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.StreamingRecognitionConfig.class, - com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.StreamingRecognitionConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (configBuilder_ == null) { - config_ = null; - } else { - config_ = null; - configBuilder_ = null; - } - singleUtterance_ = false; - - interimResults_ = false; - - 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_StreamingRecognitionConfig_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionConfig getDefaultInstanceForType() { - return com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionConfig build() { - com.google.cloud.speech.v1.StreamingRecognitionConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionConfig buildPartial() { - com.google.cloud.speech.v1.StreamingRecognitionConfig result = - new com.google.cloud.speech.v1.StreamingRecognitionConfig(this); - if (configBuilder_ == null) { - result.config_ = config_; - } else { - result.config_ = configBuilder_.build(); - } - result.singleUtterance_ = singleUtterance_; - result.interimResults_ = interimResults_; - 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.StreamingRecognitionConfig) { - return mergeFrom((com.google.cloud.speech.v1.StreamingRecognitionConfig) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.StreamingRecognitionConfig other) { - if (other == com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance()) - return this; - if (other.hasConfig()) { - mergeConfig(other.getConfig()); - } - if (other.getSingleUtterance() != false) { - setSingleUtterance(other.getSingleUtterance()); - } - if (other.getInterimResults() != false) { - setInterimResults(other.getInterimResults()); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1.StreamingRecognitionConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1.StreamingRecognitionConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.speech.v1.RecognitionConfig config_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionConfig, - com.google.cloud.speech.v1.RecognitionConfig.Builder, - com.google.cloud.speech.v1.RecognitionConfigOrBuilder> - configBuilder_; - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the config field is set. - */ - public boolean hasConfig() { - return configBuilder_ != null || config_ != null; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The config. - */ - public com.google.cloud.speech.v1.RecognitionConfig getConfig() { - if (configBuilder_ == null) { - return config_ == null - ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() - : config_; - } else { - return configBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setConfig(com.google.cloud.speech.v1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - config_ = value; - onChanged(); - } else { - configBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setConfig(com.google.cloud.speech.v1.RecognitionConfig.Builder builderForValue) { - if (configBuilder_ == null) { - config_ = builderForValue.build(); - onChanged(); - } else { - configBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeConfig(com.google.cloud.speech.v1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (config_ != null) { - config_ = - com.google.cloud.speech.v1.RecognitionConfig.newBuilder(config_) - .mergeFrom(value) - .buildPartial(); - } else { - config_ = value; - } - onChanged(); - } else { - configBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearConfig() { - if (configBuilder_ == null) { - config_ = null; - onChanged(); - } else { - config_ = null; - configBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.speech.v1.RecognitionConfig.Builder getConfigBuilder() { - - onChanged(); - return getConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder() { - if (configBuilder_ != null) { - return configBuilder_.getMessageOrBuilder(); - } else { - return config_ == null - ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() - : config_; - } - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionConfig, - com.google.cloud.speech.v1.RecognitionConfig.Builder, - com.google.cloud.speech.v1.RecognitionConfigOrBuilder> - getConfigFieldBuilder() { - if (configBuilder_ == null) { - configBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionConfig, - com.google.cloud.speech.v1.RecognitionConfig.Builder, - com.google.cloud.speech.v1.RecognitionConfigOrBuilder>( - getConfig(), getParentForChildren(), isClean()); - config_ = null; - } - return configBuilder_; - } - - private boolean singleUtterance_; - /** - * - * - *
-     * If `false` or omitted, the recognizer will perform continuous
-     * recognition (continuing to wait for and process audio even if the user
-     * pauses speaking) until the client closes the input stream (gRPC API) or
-     * until the maximum time limit has been reached. May return multiple
-     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-     * If `true`, the recognizer will detect a single spoken utterance. When it
-     * detects that the user has paused or stopped speaking, it will return an
-     * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
-     * more than one `StreamingRecognitionResult` with the `is_final` flag set to
-     * `true`.
-     * 
- * - * bool single_utterance = 2; - * - * @return The singleUtterance. - */ - @java.lang.Override - public boolean getSingleUtterance() { - return singleUtterance_; - } - /** - * - * - *
-     * If `false` or omitted, the recognizer will perform continuous
-     * recognition (continuing to wait for and process audio even if the user
-     * pauses speaking) until the client closes the input stream (gRPC API) or
-     * until the maximum time limit has been reached. May return multiple
-     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-     * If `true`, the recognizer will detect a single spoken utterance. When it
-     * detects that the user has paused or stopped speaking, it will return an
-     * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
-     * more than one `StreamingRecognitionResult` with the `is_final` flag set to
-     * `true`.
-     * 
- * - * bool single_utterance = 2; - * - * @param value The singleUtterance to set. - * @return This builder for chaining. - */ - public Builder setSingleUtterance(boolean value) { - - singleUtterance_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If `false` or omitted, the recognizer will perform continuous
-     * recognition (continuing to wait for and process audio even if the user
-     * pauses speaking) until the client closes the input stream (gRPC API) or
-     * until the maximum time limit has been reached. May return multiple
-     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-     * If `true`, the recognizer will detect a single spoken utterance. When it
-     * detects that the user has paused or stopped speaking, it will return an
-     * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
-     * more than one `StreamingRecognitionResult` with the `is_final` flag set to
-     * `true`.
-     * 
- * - * bool single_utterance = 2; - * - * @return This builder for chaining. - */ - public Builder clearSingleUtterance() { - - singleUtterance_ = false; - onChanged(); - return this; - } - - private boolean interimResults_; - /** - * - * - *
-     * If `true`, interim results (tentative hypotheses) may be
-     * returned as they become available (these interim results are indicated with
-     * the `is_final=false` flag).
-     * If `false` or omitted, only `is_final=true` result(s) are returned.
-     * 
- * - * bool interim_results = 3; - * - * @return The interimResults. - */ - @java.lang.Override - public boolean getInterimResults() { - return interimResults_; - } - /** - * - * - *
-     * If `true`, interim results (tentative hypotheses) may be
-     * returned as they become available (these interim results are indicated with
-     * the `is_final=false` flag).
-     * If `false` or omitted, only `is_final=true` result(s) are returned.
-     * 
- * - * bool interim_results = 3; - * - * @param value The interimResults to set. - * @return This builder for chaining. - */ - public Builder setInterimResults(boolean value) { - - interimResults_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If `true`, interim results (tentative hypotheses) may be
-     * returned as they become available (these interim results are indicated with
-     * the `is_final=false` flag).
-     * If `false` or omitted, only `is_final=true` result(s) are returned.
-     * 
- * - * bool interim_results = 3; - * - * @return This builder for chaining. - */ - public Builder clearInterimResults() { - - interimResults_ = false; - 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.StreamingRecognitionConfig) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.StreamingRecognitionConfig) - private static final com.google.cloud.speech.v1.StreamingRecognitionConfig DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.StreamingRecognitionConfig(); - } - - public static com.google.cloud.speech.v1.StreamingRecognitionConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StreamingRecognitionConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingRecognitionConfig(input, extensionRegistry); - } - }; - - 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.StreamingRecognitionConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionConfigOrBuilder.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionConfigOrBuilder.java deleted file mode 100644 index 714f58f1a..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionConfigOrBuilder.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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 StreamingRecognitionConfigOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.StreamingRecognitionConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the config field is set. - */ - boolean hasConfig(); - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The config. - */ - com.google.cloud.speech.v1.RecognitionConfig getConfig(); - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder(); - - /** - * - * - *
-   * If `false` or omitted, the recognizer will perform continuous
-   * recognition (continuing to wait for and process audio even if the user
-   * pauses speaking) until the client closes the input stream (gRPC API) or
-   * until the maximum time limit has been reached. May return multiple
-   * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-   * If `true`, the recognizer will detect a single spoken utterance. When it
-   * detects that the user has paused or stopped speaking, it will return an
-   * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
-   * more than one `StreamingRecognitionResult` with the `is_final` flag set to
-   * `true`.
-   * 
- * - * bool single_utterance = 2; - * - * @return The singleUtterance. - */ - boolean getSingleUtterance(); - - /** - * - * - *
-   * If `true`, interim results (tentative hypotheses) may be
-   * returned as they become available (these interim results are indicated with
-   * the `is_final=false` flag).
-   * If `false` or omitted, only `is_final=true` result(s) are returned.
-   * 
- * - * bool interim_results = 3; - * - * @return The interimResults. - */ - boolean getInterimResults(); -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResult.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResult.java deleted file mode 100644 index 82c5bfe02..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResult.java +++ /dev/null @@ -1,1833 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * A streaming speech recognition result corresponding to a portion of the audio
- * that is currently being processed.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.StreamingRecognitionResult} - */ -public final class StreamingRecognitionResult extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.StreamingRecognitionResult) - StreamingRecognitionResultOrBuilder { - private static final long serialVersionUID = 0L; - // Use StreamingRecognitionResult.newBuilder() to construct. - private StreamingRecognitionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private StreamingRecognitionResult() { - alternatives_ = java.util.Collections.emptyList(); - languageCode_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new StreamingRecognitionResult(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private StreamingRecognitionResult( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - alternatives_ = - new java.util.ArrayList< - com.google.cloud.speech.v1.SpeechRecognitionAlternative>(); - mutable_bitField0_ |= 0x00000001; - } - alternatives_.add( - input.readMessage( - com.google.cloud.speech.v1.SpeechRecognitionAlternative.parser(), - extensionRegistry)); - break; - } - case 16: - { - isFinal_ = input.readBool(); - break; - } - case 29: - { - stability_ = input.readFloat(); - break; - } - case 34: - { - com.google.protobuf.Duration.Builder subBuilder = null; - if (resultEndTime_ != null) { - subBuilder = resultEndTime_.toBuilder(); - } - resultEndTime_ = - input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(resultEndTime_); - resultEndTime_ = subBuilder.buildPartial(); - } - - break; - } - case 40: - { - channelTag_ = input.readInt32(); - break; - } - case 50: - { - java.lang.String s = input.readStringRequireUtf8(); - - languageCode_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - alternatives_ = java.util.Collections.unmodifiableList(alternatives_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_StreamingRecognitionResult_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_StreamingRecognitionResult_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.StreamingRecognitionResult.class, - com.google.cloud.speech.v1.StreamingRecognitionResult.Builder.class); - } - - public static final int ALTERNATIVES_FIELD_NUMBER = 1; - private java.util.List alternatives_; - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public java.util.List - getAlternativesList() { - return alternatives_; - } - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public java.util.List - getAlternativesOrBuilderList() { - return alternatives_; - } - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public int getAlternativesCount() { - return alternatives_.size(); - } - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionAlternative getAlternatives(int index) { - return alternatives_.get(index); - } - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( - int index) { - return alternatives_.get(index); - } - - public static final int IS_FINAL_FIELD_NUMBER = 2; - private boolean isFinal_; - /** - * - * - *
-   * If `false`, this `StreamingRecognitionResult` represents an
-   * interim result that may change. If `true`, this is the final time the
-   * speech service will return this particular `StreamingRecognitionResult`,
-   * the recognizer will not return any further hypotheses for this portion of
-   * the transcript and corresponding audio.
-   * 
- * - * bool is_final = 2; - * - * @return The isFinal. - */ - @java.lang.Override - public boolean getIsFinal() { - return isFinal_; - } - - public static final int STABILITY_FIELD_NUMBER = 3; - private float stability_; - /** - * - * - *
-   * An estimate of the likelihood that the recognizer will not
-   * change its guess about this interim result. Values range from 0.0
-   * (completely unstable) to 1.0 (completely stable).
-   * This field is only provided for interim results (`is_final=false`).
-   * The default of 0.0 is a sentinel value indicating `stability` was not set.
-   * 
- * - * float stability = 3; - * - * @return The stability. - */ - @java.lang.Override - public float getStability() { - return stability_; - } - - public static final int RESULT_END_TIME_FIELD_NUMBER = 4; - private com.google.protobuf.Duration resultEndTime_; - /** - * - * - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * - * @return Whether the resultEndTime field is set. - */ - @java.lang.Override - public boolean hasResultEndTime() { - return resultEndTime_ != null; - } - /** - * - * - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * - * @return The resultEndTime. - */ - @java.lang.Override - public com.google.protobuf.Duration getResultEndTime() { - return resultEndTime_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : resultEndTime_; - } - /** - * - * - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder() { - return getResultEndTime(); - } - - public static final int CHANNEL_TAG_FIELD_NUMBER = 5; - private int channelTag_; - /** - * - * - *
-   * For multi-channel audio, this is the channel number corresponding to the
-   * recognized result for the audio from that channel.
-   * For audio_channel_count = N, its output values can range from '1' to 'N'.
-   * 
- * - * int32 channel_tag = 5; - * - * @return The channelTag. - */ - @java.lang.Override - public int getChannelTag() { - return channelTag_; - } - - public static final int LANGUAGE_CODE_FIELD_NUMBER = 6; - private volatile java.lang.Object languageCode_; - /** - * - * - *
-   * The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag of
-   * the language in this result. This language code was detected to have the
-   * most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The languageCode. - */ - @java.lang.Override - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - 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(); - languageCode_ = s; - return s; - } - } - /** - * - * - *
-   * The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag of
-   * the language in this result. This language code was detected to have the
-   * most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for languageCode. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - languageCode_ = 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 { - for (int i = 0; i < alternatives_.size(); i++) { - output.writeMessage(1, alternatives_.get(i)); - } - if (isFinal_ != false) { - output.writeBool(2, isFinal_); - } - if (stability_ != 0F) { - output.writeFloat(3, stability_); - } - if (resultEndTime_ != null) { - output.writeMessage(4, getResultEndTime()); - } - if (channelTag_ != 0) { - output.writeInt32(5, channelTag_); - } - if (!getLanguageCodeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, languageCode_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < alternatives_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, alternatives_.get(i)); - } - if (isFinal_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, isFinal_); - } - if (stability_ != 0F) { - size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, stability_); - } - if (resultEndTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getResultEndTime()); - } - if (channelTag_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, channelTag_); - } - if (!getLanguageCodeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, languageCode_); - } - size += unknownFields.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.StreamingRecognitionResult)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.StreamingRecognitionResult other = - (com.google.cloud.speech.v1.StreamingRecognitionResult) obj; - - if (!getAlternativesList().equals(other.getAlternativesList())) return false; - if (getIsFinal() != other.getIsFinal()) return false; - if (java.lang.Float.floatToIntBits(getStability()) - != java.lang.Float.floatToIntBits(other.getStability())) return false; - if (hasResultEndTime() != other.hasResultEndTime()) return false; - if (hasResultEndTime()) { - if (!getResultEndTime().equals(other.getResultEndTime())) return false; - } - if (getChannelTag() != other.getChannelTag()) return false; - if (!getLanguageCode().equals(other.getLanguageCode())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getAlternativesCount() > 0) { - hash = (37 * hash) + ALTERNATIVES_FIELD_NUMBER; - hash = (53 * hash) + getAlternativesList().hashCode(); - } - hash = (37 * hash) + IS_FINAL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsFinal()); - hash = (37 * hash) + STABILITY_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits(getStability()); - if (hasResultEndTime()) { - hash = (37 * hash) + RESULT_END_TIME_FIELD_NUMBER; - hash = (53 * hash) + getResultEndTime().hashCode(); - } - hash = (37 * hash) + CHANNEL_TAG_FIELD_NUMBER; - hash = (53 * hash) + getChannelTag(); - hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; - hash = (53 * hash) + getLanguageCode().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.StreamingRecognitionResult 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.StreamingRecognitionResult parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.StreamingRecognitionResult 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.StreamingRecognitionResult parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.StreamingRecognitionResult 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.StreamingRecognitionResult parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.StreamingRecognitionResult 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.StreamingRecognitionResult parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.StreamingRecognitionResult 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.StreamingRecognitionResult 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.StreamingRecognitionResult 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.StreamingRecognitionResult 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; - } - /** - * - * - *
-   * A streaming speech recognition result corresponding to a portion of the audio
-   * that is currently being processed.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.StreamingRecognitionResult} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.StreamingRecognitionResult) - com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_StreamingRecognitionResult_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_StreamingRecognitionResult_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.StreamingRecognitionResult.class, - com.google.cloud.speech.v1.StreamingRecognitionResult.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.StreamingRecognitionResult.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getAlternativesFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (alternativesBuilder_ == null) { - alternatives_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - alternativesBuilder_.clear(); - } - isFinal_ = false; - - stability_ = 0F; - - if (resultEndTimeBuilder_ == null) { - resultEndTime_ = null; - } else { - resultEndTime_ = null; - resultEndTimeBuilder_ = null; - } - channelTag_ = 0; - - languageCode_ = ""; - - 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_StreamingRecognitionResult_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionResult getDefaultInstanceForType() { - return com.google.cloud.speech.v1.StreamingRecognitionResult.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionResult build() { - com.google.cloud.speech.v1.StreamingRecognitionResult result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionResult buildPartial() { - com.google.cloud.speech.v1.StreamingRecognitionResult result = - new com.google.cloud.speech.v1.StreamingRecognitionResult(this); - int from_bitField0_ = bitField0_; - if (alternativesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - alternatives_ = java.util.Collections.unmodifiableList(alternatives_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.alternatives_ = alternatives_; - } else { - result.alternatives_ = alternativesBuilder_.build(); - } - result.isFinal_ = isFinal_; - result.stability_ = stability_; - if (resultEndTimeBuilder_ == null) { - result.resultEndTime_ = resultEndTime_; - } else { - result.resultEndTime_ = resultEndTimeBuilder_.build(); - } - result.channelTag_ = channelTag_; - result.languageCode_ = languageCode_; - 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.StreamingRecognitionResult) { - return mergeFrom((com.google.cloud.speech.v1.StreamingRecognitionResult) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.StreamingRecognitionResult other) { - if (other == com.google.cloud.speech.v1.StreamingRecognitionResult.getDefaultInstance()) - return this; - if (alternativesBuilder_ == null) { - if (!other.alternatives_.isEmpty()) { - if (alternatives_.isEmpty()) { - alternatives_ = other.alternatives_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAlternativesIsMutable(); - alternatives_.addAll(other.alternatives_); - } - onChanged(); - } - } else { - if (!other.alternatives_.isEmpty()) { - if (alternativesBuilder_.isEmpty()) { - alternativesBuilder_.dispose(); - alternativesBuilder_ = null; - alternatives_ = other.alternatives_; - bitField0_ = (bitField0_ & ~0x00000001); - alternativesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getAlternativesFieldBuilder() - : null; - } else { - alternativesBuilder_.addAllMessages(other.alternatives_); - } - } - } - if (other.getIsFinal() != false) { - setIsFinal(other.getIsFinal()); - } - if (other.getStability() != 0F) { - setStability(other.getStability()); - } - if (other.hasResultEndTime()) { - mergeResultEndTime(other.getResultEndTime()); - } - if (other.getChannelTag() != 0) { - setChannelTag(other.getChannelTag()); - } - if (!other.getLanguageCode().isEmpty()) { - languageCode_ = other.languageCode_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1.StreamingRecognitionResult parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1.StreamingRecognitionResult) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List alternatives_ = - java.util.Collections.emptyList(); - - private void ensureAlternativesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - alternatives_ = - new java.util.ArrayList( - alternatives_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionAlternative, - com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder, - com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder> - alternativesBuilder_; - - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public java.util.List - getAlternativesList() { - if (alternativesBuilder_ == null) { - return java.util.Collections.unmodifiableList(alternatives_); - } else { - return alternativesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public int getAlternativesCount() { - if (alternativesBuilder_ == null) { - return alternatives_.size(); - } else { - return alternativesBuilder_.getCount(); - } - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1.SpeechRecognitionAlternative getAlternatives(int index) { - if (alternativesBuilder_ == null) { - return alternatives_.get(index); - } else { - return alternativesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder setAlternatives( - int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.set(index, value); - onChanged(); - } else { - alternativesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder setAlternatives( - int index, - com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.set(index, builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives(com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.add(value); - onChanged(); - } else { - alternativesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives( - int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.add(index, value); - onChanged(); - } else { - alternativesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives( - com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.add(builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives( - int index, - com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.add(index, builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAllAlternatives( - java.lang.Iterable - values) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, alternatives_); - onChanged(); - } else { - alternativesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder clearAlternatives() { - if (alternativesBuilder_ == null) { - alternatives_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - alternativesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder removeAlternatives(int index) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.remove(index); - onChanged(); - } else { - alternativesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder getAlternativesBuilder( - int index) { - return getAlternativesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder - getAlternativesOrBuilder(int index) { - if (alternativesBuilder_ == null) { - return alternatives_.get(index); - } else { - return alternativesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public java.util.List< - ? extends com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder> - getAlternativesOrBuilderList() { - if (alternativesBuilder_ != null) { - return alternativesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(alternatives_); - } - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder - addAlternativesBuilder() { - return getAlternativesFieldBuilder() - .addBuilder(com.google.cloud.speech.v1.SpeechRecognitionAlternative.getDefaultInstance()); - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder addAlternativesBuilder( - int index) { - return getAlternativesFieldBuilder() - .addBuilder( - index, com.google.cloud.speech.v1.SpeechRecognitionAlternative.getDefaultInstance()); - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public java.util.List - getAlternativesBuilderList() { - return getAlternativesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionAlternative, - com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder, - com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder> - getAlternativesFieldBuilder() { - if (alternativesBuilder_ == null) { - alternativesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionAlternative, - com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder, - com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder>( - alternatives_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - alternatives_ = null; - } - return alternativesBuilder_; - } - - private boolean isFinal_; - /** - * - * - *
-     * If `false`, this `StreamingRecognitionResult` represents an
-     * interim result that may change. If `true`, this is the final time the
-     * speech service will return this particular `StreamingRecognitionResult`,
-     * the recognizer will not return any further hypotheses for this portion of
-     * the transcript and corresponding audio.
-     * 
- * - * bool is_final = 2; - * - * @return The isFinal. - */ - @java.lang.Override - public boolean getIsFinal() { - return isFinal_; - } - /** - * - * - *
-     * If `false`, this `StreamingRecognitionResult` represents an
-     * interim result that may change. If `true`, this is the final time the
-     * speech service will return this particular `StreamingRecognitionResult`,
-     * the recognizer will not return any further hypotheses for this portion of
-     * the transcript and corresponding audio.
-     * 
- * - * bool is_final = 2; - * - * @param value The isFinal to set. - * @return This builder for chaining. - */ - public Builder setIsFinal(boolean value) { - - isFinal_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If `false`, this `StreamingRecognitionResult` represents an
-     * interim result that may change. If `true`, this is the final time the
-     * speech service will return this particular `StreamingRecognitionResult`,
-     * the recognizer will not return any further hypotheses for this portion of
-     * the transcript and corresponding audio.
-     * 
- * - * bool is_final = 2; - * - * @return This builder for chaining. - */ - public Builder clearIsFinal() { - - isFinal_ = false; - onChanged(); - return this; - } - - private float stability_; - /** - * - * - *
-     * An estimate of the likelihood that the recognizer will not
-     * change its guess about this interim result. Values range from 0.0
-     * (completely unstable) to 1.0 (completely stable).
-     * This field is only provided for interim results (`is_final=false`).
-     * The default of 0.0 is a sentinel value indicating `stability` was not set.
-     * 
- * - * float stability = 3; - * - * @return The stability. - */ - @java.lang.Override - public float getStability() { - return stability_; - } - /** - * - * - *
-     * An estimate of the likelihood that the recognizer will not
-     * change its guess about this interim result. Values range from 0.0
-     * (completely unstable) to 1.0 (completely stable).
-     * This field is only provided for interim results (`is_final=false`).
-     * The default of 0.0 is a sentinel value indicating `stability` was not set.
-     * 
- * - * float stability = 3; - * - * @param value The stability to set. - * @return This builder for chaining. - */ - public Builder setStability(float value) { - - stability_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * An estimate of the likelihood that the recognizer will not
-     * change its guess about this interim result. Values range from 0.0
-     * (completely unstable) to 1.0 (completely stable).
-     * This field is only provided for interim results (`is_final=false`).
-     * The default of 0.0 is a sentinel value indicating `stability` was not set.
-     * 
- * - * float stability = 3; - * - * @return This builder for chaining. - */ - public Builder clearStability() { - - stability_ = 0F; - onChanged(); - return this; - } - - private com.google.protobuf.Duration resultEndTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - resultEndTimeBuilder_; - /** - * - * - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - * - * @return Whether the resultEndTime field is set. - */ - public boolean hasResultEndTime() { - return resultEndTimeBuilder_ != null || resultEndTime_ != null; - } - /** - * - * - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - * - * @return The resultEndTime. - */ - public com.google.protobuf.Duration getResultEndTime() { - if (resultEndTimeBuilder_ == null) { - return resultEndTime_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : resultEndTime_; - } else { - return resultEndTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder setResultEndTime(com.google.protobuf.Duration value) { - if (resultEndTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - resultEndTime_ = value; - onChanged(); - } else { - resultEndTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder setResultEndTime(com.google.protobuf.Duration.Builder builderForValue) { - if (resultEndTimeBuilder_ == null) { - resultEndTime_ = builderForValue.build(); - onChanged(); - } else { - resultEndTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder mergeResultEndTime(com.google.protobuf.Duration value) { - if (resultEndTimeBuilder_ == null) { - if (resultEndTime_ != null) { - resultEndTime_ = - com.google.protobuf.Duration.newBuilder(resultEndTime_) - .mergeFrom(value) - .buildPartial(); - } else { - resultEndTime_ = value; - } - onChanged(); - } else { - resultEndTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder clearResultEndTime() { - if (resultEndTimeBuilder_ == null) { - resultEndTime_ = null; - onChanged(); - } else { - resultEndTime_ = null; - resultEndTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public com.google.protobuf.Duration.Builder getResultEndTimeBuilder() { - - onChanged(); - return getResultEndTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder() { - if (resultEndTimeBuilder_ != null) { - return resultEndTimeBuilder_.getMessageOrBuilder(); - } else { - return resultEndTime_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : resultEndTime_; - } - } - /** - * - * - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - getResultEndTimeFieldBuilder() { - if (resultEndTimeBuilder_ == null) { - resultEndTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder>( - getResultEndTime(), getParentForChildren(), isClean()); - resultEndTime_ = null; - } - return resultEndTimeBuilder_; - } - - private int channelTag_; - /** - * - * - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 5; - * - * @return The channelTag. - */ - @java.lang.Override - public int getChannelTag() { - return channelTag_; - } - /** - * - * - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 5; - * - * @param value The channelTag to set. - * @return This builder for chaining. - */ - public Builder setChannelTag(int value) { - - channelTag_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 5; - * - * @return This builder for chaining. - */ - public Builder clearChannelTag() { - - channelTag_ = 0; - onChanged(); - return this; - } - - private java.lang.Object languageCode_ = ""; - /** - * - * - *
-     * The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag of
-     * the language in this result. This language code was detected to have the
-     * most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The languageCode. - */ - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - languageCode_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag of
-     * the language in this result. This language code was detected to have the
-     * most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for languageCode. - */ - public com.google.protobuf.ByteString getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag of
-     * the language in this result. This language code was detected to have the
-     * most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCode(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - languageCode_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag of
-     * the language in this result. This language code was detected to have the
-     * most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return This builder for chaining. - */ - public Builder clearLanguageCode() { - - languageCode_ = getDefaultInstance().getLanguageCode(); - onChanged(); - return this; - } - /** - * - * - *
-     * The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag of
-     * the language in this result. This language code was detected to have the
-     * most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The bytes for languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - languageCode_ = 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.StreamingRecognitionResult) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.StreamingRecognitionResult) - private static final com.google.cloud.speech.v1.StreamingRecognitionResult DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.StreamingRecognitionResult(); - } - - public static com.google.cloud.speech.v1.StreamingRecognitionResult getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StreamingRecognitionResult parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingRecognitionResult(input, extensionRegistry); - } - }; - - 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.StreamingRecognitionResult getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResultOrBuilder.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResultOrBuilder.java deleted file mode 100644 index 1954365c9..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResultOrBuilder.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * 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 StreamingRecognitionResultOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.StreamingRecognitionResult) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - java.util.List getAlternativesList(); - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - com.google.cloud.speech.v1.SpeechRecognitionAlternative getAlternatives(int index); - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - int getAlternativesCount(); - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - java.util.List - getAlternativesOrBuilderList(); - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( - int index); - - /** - * - * - *
-   * If `false`, this `StreamingRecognitionResult` represents an
-   * interim result that may change. If `true`, this is the final time the
-   * speech service will return this particular `StreamingRecognitionResult`,
-   * the recognizer will not return any further hypotheses for this portion of
-   * the transcript and corresponding audio.
-   * 
- * - * bool is_final = 2; - * - * @return The isFinal. - */ - boolean getIsFinal(); - - /** - * - * - *
-   * An estimate of the likelihood that the recognizer will not
-   * change its guess about this interim result. Values range from 0.0
-   * (completely unstable) to 1.0 (completely stable).
-   * This field is only provided for interim results (`is_final=false`).
-   * The default of 0.0 is a sentinel value indicating `stability` was not set.
-   * 
- * - * float stability = 3; - * - * @return The stability. - */ - float getStability(); - - /** - * - * - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * - * @return Whether the resultEndTime field is set. - */ - boolean hasResultEndTime(); - /** - * - * - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * - * @return The resultEndTime. - */ - com.google.protobuf.Duration getResultEndTime(); - /** - * - * - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder(); - - /** - * - * - *
-   * For multi-channel audio, this is the channel number corresponding to the
-   * recognized result for the audio from that channel.
-   * For audio_channel_count = N, its output values can range from '1' to 'N'.
-   * 
- * - * int32 channel_tag = 5; - * - * @return The channelTag. - */ - int getChannelTag(); - - /** - * - * - *
-   * The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag of
-   * the language in this result. This language code was detected to have the
-   * most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The languageCode. - */ - java.lang.String getLanguageCode(); - /** - * - * - *
-   * The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag of
-   * the language in this result. This language code was detected to have the
-   * most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for languageCode. - */ - com.google.protobuf.ByteString getLanguageCodeBytes(); -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequest.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequest.java deleted file mode 100644 index 9d456331e..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequest.java +++ /dev/null @@ -1,1016 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * The top-level message sent by the client for the `StreamingRecognize` method.
- * Multiple `StreamingRecognizeRequest` messages are sent. The first message
- * must contain a `streaming_config` message and must not contain
- * `audio_content`. All subsequent messages must contain `audio_content` and
- * must not contain a `streaming_config` message.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.StreamingRecognizeRequest} - */ -public final class StreamingRecognizeRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.StreamingRecognizeRequest) - StreamingRecognizeRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use StreamingRecognizeRequest.newBuilder() to construct. - private StreamingRecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private StreamingRecognizeRequest() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new StreamingRecognizeRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private StreamingRecognizeRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder subBuilder = null; - if (streamingRequestCase_ == 1) { - subBuilder = - ((com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_) - .toBuilder(); - } - streamingRequest_ = - input.readMessage( - com.google.cloud.speech.v1.StreamingRecognitionConfig.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_); - streamingRequest_ = subBuilder.buildPartial(); - } - streamingRequestCase_ = 1; - break; - } - case 18: - { - streamingRequestCase_ = 2; - streamingRequest_ = input.readBytes(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_StreamingRecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_StreamingRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.StreamingRecognizeRequest.class, - com.google.cloud.speech.v1.StreamingRecognizeRequest.Builder.class); - } - - private int streamingRequestCase_ = 0; - private java.lang.Object streamingRequest_; - - public enum StreamingRequestCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - STREAMING_CONFIG(1), - AUDIO_CONTENT(2), - STREAMINGREQUEST_NOT_SET(0); - private final int value; - - private StreamingRequestCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static StreamingRequestCase valueOf(int value) { - return forNumber(value); - } - - public static StreamingRequestCase forNumber(int value) { - switch (value) { - case 1: - return STREAMING_CONFIG; - case 2: - return AUDIO_CONTENT; - case 0: - return STREAMINGREQUEST_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public StreamingRequestCase getStreamingRequestCase() { - return StreamingRequestCase.forNumber(streamingRequestCase_); - } - - public static final int STREAMING_CONFIG_FIELD_NUMBER = 1; - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - * - * @return Whether the streamingConfig field is set. - */ - @java.lang.Override - public boolean hasStreamingConfig() { - return streamingRequestCase_ == 1; - } - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - * - * @return The streamingConfig. - */ - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionConfig getStreamingConfig() { - if (streamingRequestCase_ == 1) { - return (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_; - } - return com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); - } - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder - getStreamingConfigOrBuilder() { - if (streamingRequestCase_ == 1) { - return (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_; - } - return com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); - } - - public static final int AUDIO_CONTENT_FIELD_NUMBER = 2; - /** - * - * - *
-   * The audio data to be recognized. Sequential chunks of audio data are sent
-   * in sequential `StreamingRecognizeRequest` messages. The first
-   * `StreamingRecognizeRequest` message must not contain `audio_content` data
-   * and all subsequent `StreamingRecognizeRequest` messages must contain
-   * `audio_content` data. The audio bytes must be encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation (not base64). See
-   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * 
- * - * bytes audio_content = 2; - * - * @return The audioContent. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAudioContent() { - if (streamingRequestCase_ == 2) { - return (com.google.protobuf.ByteString) streamingRequest_; - } - return com.google.protobuf.ByteString.EMPTY; - } - - 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 (streamingRequestCase_ == 1) { - output.writeMessage( - 1, (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_); - } - if (streamingRequestCase_ == 2) { - output.writeBytes(2, (com.google.protobuf.ByteString) streamingRequest_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (streamingRequestCase_ == 1) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 1, (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_); - } - if (streamingRequestCase_ == 2) { - size += - com.google.protobuf.CodedOutputStream.computeBytesSize( - 2, (com.google.protobuf.ByteString) streamingRequest_); - } - size += unknownFields.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.StreamingRecognizeRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.StreamingRecognizeRequest other = - (com.google.cloud.speech.v1.StreamingRecognizeRequest) obj; - - if (!getStreamingRequestCase().equals(other.getStreamingRequestCase())) return false; - switch (streamingRequestCase_) { - case 1: - if (!getStreamingConfig().equals(other.getStreamingConfig())) return false; - break; - case 2: - if (!getAudioContent().equals(other.getAudioContent())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (streamingRequestCase_) { - case 1: - hash = (37 * hash) + STREAMING_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getStreamingConfig().hashCode(); - break; - case 2: - hash = (37 * hash) + AUDIO_CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getAudioContent().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.StreamingRecognizeRequest 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.StreamingRecognizeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.StreamingRecognizeRequest 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.StreamingRecognizeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.StreamingRecognizeRequest 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.StreamingRecognizeRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.StreamingRecognizeRequest 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.StreamingRecognizeRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.StreamingRecognizeRequest 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.StreamingRecognizeRequest 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.StreamingRecognizeRequest 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.StreamingRecognizeRequest 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; - } - /** - * - * - *
-   * The top-level message sent by the client for the `StreamingRecognize` method.
-   * Multiple `StreamingRecognizeRequest` messages are sent. The first message
-   * must contain a `streaming_config` message and must not contain
-   * `audio_content`. All subsequent messages must contain `audio_content` and
-   * must not contain a `streaming_config` message.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.StreamingRecognizeRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.StreamingRecognizeRequest) - com.google.cloud.speech.v1.StreamingRecognizeRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_StreamingRecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_StreamingRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.StreamingRecognizeRequest.class, - com.google.cloud.speech.v1.StreamingRecognizeRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.StreamingRecognizeRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - streamingRequestCase_ = 0; - streamingRequest_ = null; - 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_StreamingRecognizeRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognizeRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1.StreamingRecognizeRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognizeRequest build() { - com.google.cloud.speech.v1.StreamingRecognizeRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognizeRequest buildPartial() { - com.google.cloud.speech.v1.StreamingRecognizeRequest result = - new com.google.cloud.speech.v1.StreamingRecognizeRequest(this); - if (streamingRequestCase_ == 1) { - if (streamingConfigBuilder_ == null) { - result.streamingRequest_ = streamingRequest_; - } else { - result.streamingRequest_ = streamingConfigBuilder_.build(); - } - } - if (streamingRequestCase_ == 2) { - result.streamingRequest_ = streamingRequest_; - } - result.streamingRequestCase_ = streamingRequestCase_; - 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.StreamingRecognizeRequest) { - return mergeFrom((com.google.cloud.speech.v1.StreamingRecognizeRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.StreamingRecognizeRequest other) { - if (other == com.google.cloud.speech.v1.StreamingRecognizeRequest.getDefaultInstance()) - return this; - switch (other.getStreamingRequestCase()) { - case STREAMING_CONFIG: - { - mergeStreamingConfig(other.getStreamingConfig()); - break; - } - case AUDIO_CONTENT: - { - setAudioContent(other.getAudioContent()); - break; - } - case STREAMINGREQUEST_NOT_SET: - { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1.StreamingRecognizeRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1.StreamingRecognizeRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int streamingRequestCase_ = 0; - private java.lang.Object streamingRequest_; - - public StreamingRequestCase getStreamingRequestCase() { - return StreamingRequestCase.forNumber(streamingRequestCase_); - } - - public Builder clearStreamingRequest() { - streamingRequestCase_ = 0; - streamingRequest_ = null; - onChanged(); - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.StreamingRecognitionConfig, - com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder, - com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder> - streamingConfigBuilder_; - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - * - * @return Whether the streamingConfig field is set. - */ - @java.lang.Override - public boolean hasStreamingConfig() { - return streamingRequestCase_ == 1; - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - * - * @return The streamingConfig. - */ - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionConfig getStreamingConfig() { - if (streamingConfigBuilder_ == null) { - if (streamingRequestCase_ == 1) { - return (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_; - } - return com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); - } else { - if (streamingRequestCase_ == 1) { - return streamingConfigBuilder_.getMessage(); - } - return com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); - } - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - */ - public Builder setStreamingConfig(com.google.cloud.speech.v1.StreamingRecognitionConfig value) { - if (streamingConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - streamingRequest_ = value; - onChanged(); - } else { - streamingConfigBuilder_.setMessage(value); - } - streamingRequestCase_ = 1; - return this; - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - */ - public Builder setStreamingConfig( - com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder builderForValue) { - if (streamingConfigBuilder_ == null) { - streamingRequest_ = builderForValue.build(); - onChanged(); - } else { - streamingConfigBuilder_.setMessage(builderForValue.build()); - } - streamingRequestCase_ = 1; - return this; - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - */ - public Builder mergeStreamingConfig( - com.google.cloud.speech.v1.StreamingRecognitionConfig value) { - if (streamingConfigBuilder_ == null) { - if (streamingRequestCase_ == 1 - && streamingRequest_ - != com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance()) { - streamingRequest_ = - com.google.cloud.speech.v1.StreamingRecognitionConfig.newBuilder( - (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_) - .mergeFrom(value) - .buildPartial(); - } else { - streamingRequest_ = value; - } - onChanged(); - } else { - if (streamingRequestCase_ == 1) { - streamingConfigBuilder_.mergeFrom(value); - } - streamingConfigBuilder_.setMessage(value); - } - streamingRequestCase_ = 1; - return this; - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - */ - public Builder clearStreamingConfig() { - if (streamingConfigBuilder_ == null) { - if (streamingRequestCase_ == 1) { - streamingRequestCase_ = 0; - streamingRequest_ = null; - onChanged(); - } - } else { - if (streamingRequestCase_ == 1) { - streamingRequestCase_ = 0; - streamingRequest_ = null; - } - streamingConfigBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - */ - public com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder - getStreamingConfigBuilder() { - return getStreamingConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder - getStreamingConfigOrBuilder() { - if ((streamingRequestCase_ == 1) && (streamingConfigBuilder_ != null)) { - return streamingConfigBuilder_.getMessageOrBuilder(); - } else { - if (streamingRequestCase_ == 1) { - return (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_; - } - return com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); - } - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.StreamingRecognitionConfig, - com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder, - com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder> - getStreamingConfigFieldBuilder() { - if (streamingConfigBuilder_ == null) { - if (!(streamingRequestCase_ == 1)) { - streamingRequest_ = - com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); - } - streamingConfigBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.StreamingRecognitionConfig, - com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder, - com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder>( - (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_, - getParentForChildren(), - isClean()); - streamingRequest_ = null; - } - streamingRequestCase_ = 1; - onChanged(); - ; - return streamingConfigBuilder_; - } - - /** - * - * - *
-     * The audio data to be recognized. Sequential chunks of audio data are sent
-     * in sequential `StreamingRecognizeRequest` messages. The first
-     * `StreamingRecognizeRequest` message must not contain `audio_content` data
-     * and all subsequent `StreamingRecognizeRequest` messages must contain
-     * `audio_content` data. The audio bytes must be encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation (not base64). See
-     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * 
- * - * bytes audio_content = 2; - * - * @return The audioContent. - */ - public com.google.protobuf.ByteString getAudioContent() { - if (streamingRequestCase_ == 2) { - return (com.google.protobuf.ByteString) streamingRequest_; - } - return com.google.protobuf.ByteString.EMPTY; - } - /** - * - * - *
-     * The audio data to be recognized. Sequential chunks of audio data are sent
-     * in sequential `StreamingRecognizeRequest` messages. The first
-     * `StreamingRecognizeRequest` message must not contain `audio_content` data
-     * and all subsequent `StreamingRecognizeRequest` messages must contain
-     * `audio_content` data. The audio bytes must be encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation (not base64). See
-     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * 
- * - * bytes audio_content = 2; - * - * @param value The audioContent to set. - * @return This builder for chaining. - */ - public Builder setAudioContent(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - streamingRequestCase_ = 2; - streamingRequest_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The audio data to be recognized. Sequential chunks of audio data are sent
-     * in sequential `StreamingRecognizeRequest` messages. The first
-     * `StreamingRecognizeRequest` message must not contain `audio_content` data
-     * and all subsequent `StreamingRecognizeRequest` messages must contain
-     * `audio_content` data. The audio bytes must be encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation (not base64). See
-     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * 
- * - * bytes audio_content = 2; - * - * @return This builder for chaining. - */ - public Builder clearAudioContent() { - if (streamingRequestCase_ == 2) { - streamingRequestCase_ = 0; - streamingRequest_ = null; - 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.StreamingRecognizeRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.StreamingRecognizeRequest) - private static final com.google.cloud.speech.v1.StreamingRecognizeRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.StreamingRecognizeRequest(); - } - - public static com.google.cloud.speech.v1.StreamingRecognizeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StreamingRecognizeRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingRecognizeRequest(input, extensionRegistry); - } - }; - - 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.StreamingRecognizeRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequestOrBuilder.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequestOrBuilder.java deleted file mode 100644 index ca902250e..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequestOrBuilder.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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 StreamingRecognizeRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.StreamingRecognizeRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - * - * @return Whether the streamingConfig field is set. - */ - boolean hasStreamingConfig(); - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - * - * @return The streamingConfig. - */ - com.google.cloud.speech.v1.StreamingRecognitionConfig getStreamingConfig(); - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - */ - com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder getStreamingConfigOrBuilder(); - - /** - * - * - *
-   * The audio data to be recognized. Sequential chunks of audio data are sent
-   * in sequential `StreamingRecognizeRequest` messages. The first
-   * `StreamingRecognizeRequest` message must not contain `audio_content` data
-   * and all subsequent `StreamingRecognizeRequest` messages must contain
-   * `audio_content` data. The audio bytes must be encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation (not base64). See
-   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * 
- * - * bytes audio_content = 2; - * - * @return The audioContent. - */ - com.google.protobuf.ByteString getAudioContent(); - - public com.google.cloud.speech.v1.StreamingRecognizeRequest.StreamingRequestCase - getStreamingRequestCase(); -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponse.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponse.java deleted file mode 100644 index b5731cb41..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponse.java +++ /dev/null @@ -1,1704 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * `StreamingRecognizeResponse` is the only message returned to the client by
- * `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse`
- * messages are streamed back to the client. If there is no recognizable
- * audio, and `single_utterance` is set to false, then no messages are streamed
- * back to the client.
- * Here's an example of a series of ten `StreamingRecognizeResponse`s that might
- * be returned while processing audio:
- * 1. results { alternatives { transcript: "tube" } stability: 0.01 }
- * 2. results { alternatives { transcript: "to be a" } stability: 0.01 }
- * 3. results { alternatives { transcript: "to be" } stability: 0.9 }
- *    results { alternatives { transcript: " or not to be" } stability: 0.01 }
- * 4. results { alternatives { transcript: "to be or not to be"
- *                             confidence: 0.92 }
- *              alternatives { transcript: "to bee or not to bee" }
- *              is_final: true }
- * 5. results { alternatives { transcript: " that's" } stability: 0.01 }
- * 6. results { alternatives { transcript: " that is" } stability: 0.9 }
- *    results { alternatives { transcript: " the question" } stability: 0.01 }
- * 7. results { alternatives { transcript: " that is the question"
- *                             confidence: 0.98 }
- *              alternatives { transcript: " that was the question" }
- *              is_final: true }
- * Notes:
- * - Only two of the above responses #4 and #7 contain final results; they are
- *   indicated by `is_final: true`. Concatenating these together generates the
- *   full transcript: "to be or not to be that is the question".
- * - The others contain interim `results`. #3 and #6 contain two interim
- *   `results`: the first portion has a high stability and is less likely to
- *   change; the second portion has a low stability and is very likely to
- *   change. A UI designer might choose to show only high stability `results`.
- * - The specific `stability` and `confidence` values shown above are only for
- *   illustrative purposes. Actual values may vary.
- * - In each response, only one of these fields will be set:
- *     `error`,
- *     `speech_event_type`, or
- *     one or more (repeated) `results`.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.StreamingRecognizeResponse} - */ -public final class StreamingRecognizeResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.StreamingRecognizeResponse) - StreamingRecognizeResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use StreamingRecognizeResponse.newBuilder() to construct. - private StreamingRecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private StreamingRecognizeResponse() { - results_ = java.util.Collections.emptyList(); - speechEventType_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new StreamingRecognizeResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private StreamingRecognizeResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.rpc.Status.Builder subBuilder = null; - if (error_ != null) { - subBuilder = error_.toBuilder(); - } - error_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(error_); - error_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = - new java.util.ArrayList< - com.google.cloud.speech.v1.StreamingRecognitionResult>(); - mutable_bitField0_ |= 0x00000001; - } - results_.add( - input.readMessage( - com.google.cloud.speech.v1.StreamingRecognitionResult.parser(), - extensionRegistry)); - break; - } - case 32: - { - int rawValue = input.readEnum(); - - speechEventType_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_StreamingRecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_StreamingRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.StreamingRecognizeResponse.class, - com.google.cloud.speech.v1.StreamingRecognizeResponse.Builder.class); - } - - /** - * - * - *
-   * Indicates the type of speech event.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType} - */ - public enum SpeechEventType implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * No speech event specified.
-     * 
- * - * SPEECH_EVENT_UNSPECIFIED = 0; - */ - SPEECH_EVENT_UNSPECIFIED(0), - /** - * - * - *
-     * This event indicates that the server has detected the end of the user's
-     * speech utterance and expects no additional speech. Therefore, the server
-     * will not process additional audio (although it may subsequently return
-     * additional results). The client should stop sending additional audio
-     * data, half-close the gRPC connection, and wait for any additional results
-     * until the server closes the gRPC connection. This event is only sent if
-     * `single_utterance` was set to `true`, and is not used otherwise.
-     * 
- * - * END_OF_SINGLE_UTTERANCE = 1; - */ - END_OF_SINGLE_UTTERANCE(1), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * No speech event specified.
-     * 
- * - * SPEECH_EVENT_UNSPECIFIED = 0; - */ - public static final int SPEECH_EVENT_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * This event indicates that the server has detected the end of the user's
-     * speech utterance and expects no additional speech. Therefore, the server
-     * will not process additional audio (although it may subsequently return
-     * additional results). The client should stop sending additional audio
-     * data, half-close the gRPC connection, and wait for any additional results
-     * until the server closes the gRPC connection. This event is only sent if
-     * `single_utterance` was set to `true`, and is not used otherwise.
-     * 
- * - * END_OF_SINGLE_UTTERANCE = 1; - */ - public static final int END_OF_SINGLE_UTTERANCE_VALUE = 1; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static SpeechEventType valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static SpeechEventType forNumber(int value) { - switch (value) { - case 0: - return SPEECH_EVENT_UNSPECIFIED; - case 1: - return END_OF_SINGLE_UTTERANCE; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public SpeechEventType findValueByNumber(int number) { - return SpeechEventType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.speech.v1.StreamingRecognizeResponse.getDescriptor() - .getEnumTypes() - .get(0); - } - - private static final SpeechEventType[] VALUES = values(); - - public static SpeechEventType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private SpeechEventType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType) - } - - public static final int ERROR_FIELD_NUMBER = 1; - private com.google.rpc.Status error_; - /** - * - * - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - * - * @return Whether the error field is set. - */ - @java.lang.Override - public boolean hasError() { - return error_ != null; - } - /** - * - * - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - * - * @return The error. - */ - @java.lang.Override - public com.google.rpc.Status getError() { - return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; - } - /** - * - * - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - */ - @java.lang.Override - public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { - return getError(); - } - - public static final int RESULTS_FIELD_NUMBER = 2; - private java.util.List results_; - /** - * - * - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List getResultsList() { - return results_; - } - /** - * - * - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List - getResultsOrBuilderList() { - return results_; - } - /** - * - * - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - @java.lang.Override - public int getResultsCount() { - return results_.size(); - } - /** - * - * - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionResult getResults(int index) { - return results_.get(index); - } - /** - * - * - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - return results_.get(index); - } - - public static final int SPEECH_EVENT_TYPE_FIELD_NUMBER = 4; - private int speechEventType_; - /** - * - * - *
-   * Indicates the type of speech event.
-   * 
- * - * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * - * - * @return The enum numeric value on the wire for speechEventType. - */ - @java.lang.Override - public int getSpeechEventTypeValue() { - return speechEventType_; - } - /** - * - * - *
-   * Indicates the type of speech event.
-   * 
- * - * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * - * - * @return The speechEventType. - */ - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType - getSpeechEventType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType result = - com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType.valueOf( - speechEventType_); - return result == null - ? com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType.UNRECOGNIZED - : result; - } - - 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 (error_ != null) { - output.writeMessage(1, getError()); - } - for (int i = 0; i < results_.size(); i++) { - output.writeMessage(2, results_.get(i)); - } - if (speechEventType_ - != com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType - .SPEECH_EVENT_UNSPECIFIED - .getNumber()) { - output.writeEnum(4, speechEventType_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (error_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getError()); - } - for (int i = 0; i < results_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, results_.get(i)); - } - if (speechEventType_ - != com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType - .SPEECH_EVENT_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, speechEventType_); - } - size += unknownFields.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.StreamingRecognizeResponse)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.StreamingRecognizeResponse other = - (com.google.cloud.speech.v1.StreamingRecognizeResponse) obj; - - if (hasError() != other.hasError()) return false; - if (hasError()) { - if (!getError().equals(other.getError())) return false; - } - if (!getResultsList().equals(other.getResultsList())) return false; - if (speechEventType_ != other.speechEventType_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasError()) { - hash = (37 * hash) + ERROR_FIELD_NUMBER; - hash = (53 * hash) + getError().hashCode(); - } - if (getResultsCount() > 0) { - hash = (37 * hash) + RESULTS_FIELD_NUMBER; - hash = (53 * hash) + getResultsList().hashCode(); - } - hash = (37 * hash) + SPEECH_EVENT_TYPE_FIELD_NUMBER; - hash = (53 * hash) + speechEventType_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.StreamingRecognizeResponse 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.StreamingRecognizeResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.StreamingRecognizeResponse 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.StreamingRecognizeResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.StreamingRecognizeResponse 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.StreamingRecognizeResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.StreamingRecognizeResponse 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.StreamingRecognizeResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.StreamingRecognizeResponse 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.StreamingRecognizeResponse 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.StreamingRecognizeResponse 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.StreamingRecognizeResponse 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; - } - /** - * - * - *
-   * `StreamingRecognizeResponse` is the only message returned to the client by
-   * `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse`
-   * messages are streamed back to the client. If there is no recognizable
-   * audio, and `single_utterance` is set to false, then no messages are streamed
-   * back to the client.
-   * Here's an example of a series of ten `StreamingRecognizeResponse`s that might
-   * be returned while processing audio:
-   * 1. results { alternatives { transcript: "tube" } stability: 0.01 }
-   * 2. results { alternatives { transcript: "to be a" } stability: 0.01 }
-   * 3. results { alternatives { transcript: "to be" } stability: 0.9 }
-   *    results { alternatives { transcript: " or not to be" } stability: 0.01 }
-   * 4. results { alternatives { transcript: "to be or not to be"
-   *                             confidence: 0.92 }
-   *              alternatives { transcript: "to bee or not to bee" }
-   *              is_final: true }
-   * 5. results { alternatives { transcript: " that's" } stability: 0.01 }
-   * 6. results { alternatives { transcript: " that is" } stability: 0.9 }
-   *    results { alternatives { transcript: " the question" } stability: 0.01 }
-   * 7. results { alternatives { transcript: " that is the question"
-   *                             confidence: 0.98 }
-   *              alternatives { transcript: " that was the question" }
-   *              is_final: true }
-   * Notes:
-   * - Only two of the above responses #4 and #7 contain final results; they are
-   *   indicated by `is_final: true`. Concatenating these together generates the
-   *   full transcript: "to be or not to be that is the question".
-   * - The others contain interim `results`. #3 and #6 contain two interim
-   *   `results`: the first portion has a high stability and is less likely to
-   *   change; the second portion has a low stability and is very likely to
-   *   change. A UI designer might choose to show only high stability `results`.
-   * - The specific `stability` and `confidence` values shown above are only for
-   *   illustrative purposes. Actual values may vary.
-   * - In each response, only one of these fields will be set:
-   *     `error`,
-   *     `speech_event_type`, or
-   *     one or more (repeated) `results`.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.StreamingRecognizeResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.StreamingRecognizeResponse) - com.google.cloud.speech.v1.StreamingRecognizeResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_StreamingRecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_StreamingRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.StreamingRecognizeResponse.class, - com.google.cloud.speech.v1.StreamingRecognizeResponse.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.StreamingRecognizeResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getResultsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (errorBuilder_ == null) { - error_ = null; - } else { - error_ = null; - errorBuilder_ = null; - } - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - resultsBuilder_.clear(); - } - speechEventType_ = 0; - - 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_StreamingRecognizeResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognizeResponse getDefaultInstanceForType() { - return com.google.cloud.speech.v1.StreamingRecognizeResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognizeResponse build() { - com.google.cloud.speech.v1.StreamingRecognizeResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognizeResponse buildPartial() { - com.google.cloud.speech.v1.StreamingRecognizeResponse result = - new com.google.cloud.speech.v1.StreamingRecognizeResponse(this); - int from_bitField0_ = bitField0_; - if (errorBuilder_ == null) { - result.error_ = error_; - } else { - result.error_ = errorBuilder_.build(); - } - if (resultsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.results_ = results_; - } else { - result.results_ = resultsBuilder_.build(); - } - result.speechEventType_ = speechEventType_; - 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.StreamingRecognizeResponse) { - return mergeFrom((com.google.cloud.speech.v1.StreamingRecognizeResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.StreamingRecognizeResponse other) { - if (other == com.google.cloud.speech.v1.StreamingRecognizeResponse.getDefaultInstance()) - return this; - if (other.hasError()) { - mergeError(other.getError()); - } - if (resultsBuilder_ == null) { - if (!other.results_.isEmpty()) { - if (results_.isEmpty()) { - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResultsIsMutable(); - results_.addAll(other.results_); - } - onChanged(); - } - } else { - if (!other.results_.isEmpty()) { - if (resultsBuilder_.isEmpty()) { - resultsBuilder_.dispose(); - resultsBuilder_ = null; - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - resultsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getResultsFieldBuilder() - : null; - } else { - resultsBuilder_.addAllMessages(other.results_); - } - } - } - if (other.speechEventType_ != 0) { - setSpeechEventTypeValue(other.getSpeechEventTypeValue()); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1.StreamingRecognizeResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1.StreamingRecognizeResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private com.google.rpc.Status error_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> - errorBuilder_; - /** - * - * - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - * - * @return Whether the error field is set. - */ - public boolean hasError() { - return errorBuilder_ != null || error_ != null; - } - /** - * - * - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - * - * @return The error. - */ - public com.google.rpc.Status getError() { - if (errorBuilder_ == null) { - return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; - } else { - return errorBuilder_.getMessage(); - } - } - /** - * - * - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public Builder setError(com.google.rpc.Status value) { - if (errorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - error_ = value; - onChanged(); - } else { - errorBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public Builder setError(com.google.rpc.Status.Builder builderForValue) { - if (errorBuilder_ == null) { - error_ = builderForValue.build(); - onChanged(); - } else { - errorBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public Builder mergeError(com.google.rpc.Status value) { - if (errorBuilder_ == null) { - if (error_ != null) { - error_ = com.google.rpc.Status.newBuilder(error_).mergeFrom(value).buildPartial(); - } else { - error_ = value; - } - onChanged(); - } else { - errorBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public Builder clearError() { - if (errorBuilder_ == null) { - error_ = null; - onChanged(); - } else { - error_ = null; - errorBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public com.google.rpc.Status.Builder getErrorBuilder() { - - onChanged(); - return getErrorFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { - if (errorBuilder_ != null) { - return errorBuilder_.getMessageOrBuilder(); - } else { - return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; - } - } - /** - * - * - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> - getErrorFieldBuilder() { - if (errorBuilder_ == null) { - errorBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, - com.google.rpc.Status.Builder, - com.google.rpc.StatusOrBuilder>(getError(), getParentForChildren(), isClean()); - error_ = null; - } - return errorBuilder_; - } - - private java.util.List results_ = - java.util.Collections.emptyList(); - - private void ensureResultsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - results_ = - new java.util.ArrayList( - results_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.StreamingRecognitionResult, - com.google.cloud.speech.v1.StreamingRecognitionResult.Builder, - com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder> - resultsBuilder_; - - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public java.util.List getResultsList() { - if (resultsBuilder_ == null) { - return java.util.Collections.unmodifiableList(results_); - } else { - return resultsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public int getResultsCount() { - if (resultsBuilder_ == null) { - return results_.size(); - } else { - return resultsBuilder_.getCount(); - } - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.StreamingRecognitionResult getResults(int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1.StreamingRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.set(index, value); - onChanged(); - } else { - resultsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1.StreamingRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.set(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public Builder addResults(com.google.cloud.speech.v1.StreamingRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(value); - onChanged(); - } else { - resultsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1.StreamingRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(index, value); - onChanged(); - } else { - resultsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public Builder addResults( - com.google.cloud.speech.v1.StreamingRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1.StreamingRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public Builder addAllResults( - java.lang.Iterable - values) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); - onChanged(); - } else { - resultsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public Builder clearResults() { - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - resultsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public Builder removeResults(int index) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.remove(index); - onChanged(); - } else { - resultsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.StreamingRecognitionResult.Builder getResultsBuilder( - int index) { - return getResultsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public java.util.List - getResultsOrBuilderList() { - if (resultsBuilder_ != null) { - return resultsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(results_); - } - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.StreamingRecognitionResult.Builder addResultsBuilder() { - return getResultsFieldBuilder() - .addBuilder(com.google.cloud.speech.v1.StreamingRecognitionResult.getDefaultInstance()); - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.StreamingRecognitionResult.Builder addResultsBuilder( - int index) { - return getResultsFieldBuilder() - .addBuilder( - index, com.google.cloud.speech.v1.StreamingRecognitionResult.getDefaultInstance()); - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public java.util.List - getResultsBuilderList() { - return getResultsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.StreamingRecognitionResult, - com.google.cloud.speech.v1.StreamingRecognitionResult.Builder, - com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder> - getResultsFieldBuilder() { - if (resultsBuilder_ == null) { - resultsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.StreamingRecognitionResult, - com.google.cloud.speech.v1.StreamingRecognitionResult.Builder, - com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder>( - results_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - results_ = null; - } - return resultsBuilder_; - } - - private int speechEventType_ = 0; - /** - * - * - *
-     * Indicates the type of speech event.
-     * 
- * - * - * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * - * - * @return The enum numeric value on the wire for speechEventType. - */ - @java.lang.Override - public int getSpeechEventTypeValue() { - return speechEventType_; - } - /** - * - * - *
-     * Indicates the type of speech event.
-     * 
- * - * - * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * - * - * @param value The enum numeric value on the wire for speechEventType to set. - * @return This builder for chaining. - */ - public Builder setSpeechEventTypeValue(int value) { - - speechEventType_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Indicates the type of speech event.
-     * 
- * - * - * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * - * - * @return The speechEventType. - */ - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType - getSpeechEventType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType result = - com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType.valueOf( - speechEventType_); - return result == null - ? com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType.UNRECOGNIZED - : result; - } - /** - * - * - *
-     * Indicates the type of speech event.
-     * 
- * - * - * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * - * - * @param value The speechEventType to set. - * @return This builder for chaining. - */ - public Builder setSpeechEventType( - com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType value) { - if (value == null) { - throw new NullPointerException(); - } - - speechEventType_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * Indicates the type of speech event.
-     * 
- * - * - * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * - * - * @return This builder for chaining. - */ - public Builder clearSpeechEventType() { - - speechEventType_ = 0; - 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.StreamingRecognizeResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.StreamingRecognizeResponse) - private static final com.google.cloud.speech.v1.StreamingRecognizeResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.StreamingRecognizeResponse(); - } - - public static com.google.cloud.speech.v1.StreamingRecognizeResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StreamingRecognizeResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingRecognizeResponse(input, extensionRegistry); - } - }; - - 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.StreamingRecognizeResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponseOrBuilder.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponseOrBuilder.java deleted file mode 100644 index f0b5d93d7..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponseOrBuilder.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * 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 StreamingRecognizeResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.StreamingRecognizeResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - * - * @return Whether the error field is set. - */ - boolean hasError(); - /** - * - * - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - * - * @return The error. - */ - com.google.rpc.Status getError(); - /** - * - * - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - */ - com.google.rpc.StatusOrBuilder getErrorOrBuilder(); - - /** - * - * - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - java.util.List getResultsList(); - /** - * - * - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - com.google.cloud.speech.v1.StreamingRecognitionResult getResults(int index); - /** - * - * - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - int getResultsCount(); - /** - * - * - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - java.util.List - getResultsOrBuilderList(); - /** - * - * - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder getResultsOrBuilder(int index); - - /** - * - * - *
-   * Indicates the type of speech event.
-   * 
- * - * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * - * - * @return The enum numeric value on the wire for speechEventType. - */ - int getSpeechEventTypeValue(); - /** - * - * - *
-   * Indicates the type of speech event.
-   * 
- * - * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * - * - * @return The speechEventType. - */ - com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType getSpeechEventType(); -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfo.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfo.java deleted file mode 100644 index 48d9612d3..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfo.java +++ /dev/null @@ -1,1393 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * Word-specific information for recognized words.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.WordInfo} - */ -public final class WordInfo extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.WordInfo) - WordInfoOrBuilder { - private static final long serialVersionUID = 0L; - // Use WordInfo.newBuilder() to construct. - private WordInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private WordInfo() { - word_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new WordInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private WordInfo( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.protobuf.Duration.Builder subBuilder = null; - if (startTime_ != null) { - subBuilder = startTime_.toBuilder(); - } - startTime_ = - input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(startTime_); - startTime_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.protobuf.Duration.Builder subBuilder = null; - if (endTime_ != null) { - subBuilder = endTime_.toBuilder(); - } - endTime_ = - input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(endTime_); - endTime_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - word_ = s; - break; - } - case 40: - { - speakerTag_ = input.readInt32(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_WordInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_WordInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.WordInfo.class, - com.google.cloud.speech.v1.WordInfo.Builder.class); - } - - public static final int START_TIME_FIELD_NUMBER = 1; - private com.google.protobuf.Duration startTime_; - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - * - * @return Whether the startTime field is set. - */ - @java.lang.Override - public boolean hasStartTime() { - return startTime_ != null; - } - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - * - * @return The startTime. - */ - @java.lang.Override - public com.google.protobuf.Duration getStartTime() { - return startTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startTime_; - } - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder() { - return getStartTime(); - } - - public static final int END_TIME_FIELD_NUMBER = 2; - private com.google.protobuf.Duration endTime_; - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - * - * @return Whether the endTime field is set. - */ - @java.lang.Override - public boolean hasEndTime() { - return endTime_ != null; - } - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - * - * @return The endTime. - */ - @java.lang.Override - public com.google.protobuf.Duration getEndTime() { - return endTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endTime_; - } - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder() { - return getEndTime(); - } - - public static final int WORD_FIELD_NUMBER = 3; - private volatile java.lang.Object word_; - /** - * - * - *
-   * The word corresponding to this set of information.
-   * 
- * - * string word = 3; - * - * @return The word. - */ - @java.lang.Override - public java.lang.String getWord() { - java.lang.Object ref = word_; - 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(); - word_ = s; - return s; - } - } - /** - * - * - *
-   * The word corresponding to this set of information.
-   * 
- * - * string word = 3; - * - * @return The bytes for word. - */ - @java.lang.Override - public com.google.protobuf.ByteString getWordBytes() { - java.lang.Object ref = word_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - word_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SPEAKER_TAG_FIELD_NUMBER = 5; - private int speakerTag_; - /** - * - * - *
-   * A distinct integer value is assigned for every speaker within
-   * the audio. This field specifies which one of those speakers was detected to
-   * have spoken this word. Value ranges from '1' to diarization_speaker_count.
-   * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
-   * top alternative.
-   * 
- * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The speakerTag. - */ - @java.lang.Override - public int getSpeakerTag() { - return speakerTag_; - } - - 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 (startTime_ != null) { - output.writeMessage(1, getStartTime()); - } - if (endTime_ != null) { - output.writeMessage(2, getEndTime()); - } - if (!getWordBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, word_); - } - if (speakerTag_ != 0) { - output.writeInt32(5, speakerTag_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (startTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStartTime()); - } - if (endTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); - } - if (!getWordBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, word_); - } - if (speakerTag_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, speakerTag_); - } - size += unknownFields.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.WordInfo)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.WordInfo other = (com.google.cloud.speech.v1.WordInfo) obj; - - if (hasStartTime() != other.hasStartTime()) return false; - if (hasStartTime()) { - if (!getStartTime().equals(other.getStartTime())) return false; - } - if (hasEndTime() != other.hasEndTime()) return false; - if (hasEndTime()) { - if (!getEndTime().equals(other.getEndTime())) return false; - } - if (!getWord().equals(other.getWord())) return false; - if (getSpeakerTag() != other.getSpeakerTag()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasStartTime()) { - hash = (37 * hash) + START_TIME_FIELD_NUMBER; - hash = (53 * hash) + getStartTime().hashCode(); - } - if (hasEndTime()) { - hash = (37 * hash) + END_TIME_FIELD_NUMBER; - hash = (53 * hash) + getEndTime().hashCode(); - } - hash = (37 * hash) + WORD_FIELD_NUMBER; - hash = (53 * hash) + getWord().hashCode(); - hash = (37 * hash) + SPEAKER_TAG_FIELD_NUMBER; - hash = (53 * hash) + getSpeakerTag(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.WordInfo parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.WordInfo 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.WordInfo parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.WordInfo 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.WordInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1.WordInfo 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.WordInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.WordInfo 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.WordInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1.WordInfo 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.WordInfo 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.WordInfo 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.WordInfo 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; - } - /** - * - * - *
-   * Word-specific information for recognized words.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.WordInfo} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.WordInfo) - com.google.cloud.speech.v1.WordInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_WordInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto - .internal_static_google_cloud_speech_v1_WordInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.WordInfo.class, - com.google.cloud.speech.v1.WordInfo.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.WordInfo.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (startTimeBuilder_ == null) { - startTime_ = null; - } else { - startTime_ = null; - startTimeBuilder_ = null; - } - if (endTimeBuilder_ == null) { - endTime_ = null; - } else { - endTime_ = null; - endTimeBuilder_ = null; - } - word_ = ""; - - speakerTag_ = 0; - - 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_WordInfo_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.WordInfo getDefaultInstanceForType() { - return com.google.cloud.speech.v1.WordInfo.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.WordInfo build() { - com.google.cloud.speech.v1.WordInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.WordInfo buildPartial() { - com.google.cloud.speech.v1.WordInfo result = new com.google.cloud.speech.v1.WordInfo(this); - if (startTimeBuilder_ == null) { - result.startTime_ = startTime_; - } else { - result.startTime_ = startTimeBuilder_.build(); - } - if (endTimeBuilder_ == null) { - result.endTime_ = endTime_; - } else { - result.endTime_ = endTimeBuilder_.build(); - } - result.word_ = word_; - result.speakerTag_ = speakerTag_; - 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.WordInfo) { - return mergeFrom((com.google.cloud.speech.v1.WordInfo) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.WordInfo other) { - if (other == com.google.cloud.speech.v1.WordInfo.getDefaultInstance()) return this; - if (other.hasStartTime()) { - mergeStartTime(other.getStartTime()); - } - if (other.hasEndTime()) { - mergeEndTime(other.getEndTime()); - } - if (!other.getWord().isEmpty()) { - word_ = other.word_; - onChanged(); - } - if (other.getSpeakerTag() != 0) { - setSpeakerTag(other.getSpeakerTag()); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1.WordInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.WordInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.protobuf.Duration startTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - startTimeBuilder_; - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - * - * @return Whether the startTime field is set. - */ - public boolean hasStartTime() { - return startTimeBuilder_ != null || startTime_ != null; - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - * - * @return The startTime. - */ - public com.google.protobuf.Duration getStartTime() { - if (startTimeBuilder_ == null) { - return startTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startTime_; - } else { - return startTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public Builder setStartTime(com.google.protobuf.Duration value) { - if (startTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - startTime_ = value; - onChanged(); - } else { - startTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public Builder setStartTime(com.google.protobuf.Duration.Builder builderForValue) { - if (startTimeBuilder_ == null) { - startTime_ = builderForValue.build(); - onChanged(); - } else { - startTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public Builder mergeStartTime(com.google.protobuf.Duration value) { - if (startTimeBuilder_ == null) { - if (startTime_ != null) { - startTime_ = - com.google.protobuf.Duration.newBuilder(startTime_).mergeFrom(value).buildPartial(); - } else { - startTime_ = value; - } - onChanged(); - } else { - startTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public Builder clearStartTime() { - if (startTimeBuilder_ == null) { - startTime_ = null; - onChanged(); - } else { - startTime_ = null; - startTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public com.google.protobuf.Duration.Builder getStartTimeBuilder() { - - onChanged(); - return getStartTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder() { - if (startTimeBuilder_ != null) { - return startTimeBuilder_.getMessageOrBuilder(); - } else { - return startTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startTime_; - } - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - getStartTimeFieldBuilder() { - if (startTimeBuilder_ == null) { - startTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder>( - getStartTime(), getParentForChildren(), isClean()); - startTime_ = null; - } - return startTimeBuilder_; - } - - private com.google.protobuf.Duration endTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - endTimeBuilder_; - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - * - * @return Whether the endTime field is set. - */ - public boolean hasEndTime() { - return endTimeBuilder_ != null || endTime_ != null; - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - * - * @return The endTime. - */ - public com.google.protobuf.Duration getEndTime() { - if (endTimeBuilder_ == null) { - return endTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endTime_; - } else { - return endTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public Builder setEndTime(com.google.protobuf.Duration value) { - if (endTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - endTime_ = value; - onChanged(); - } else { - endTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public Builder setEndTime(com.google.protobuf.Duration.Builder builderForValue) { - if (endTimeBuilder_ == null) { - endTime_ = builderForValue.build(); - onChanged(); - } else { - endTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public Builder mergeEndTime(com.google.protobuf.Duration value) { - if (endTimeBuilder_ == null) { - if (endTime_ != null) { - endTime_ = - com.google.protobuf.Duration.newBuilder(endTime_).mergeFrom(value).buildPartial(); - } else { - endTime_ = value; - } - onChanged(); - } else { - endTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public Builder clearEndTime() { - if (endTimeBuilder_ == null) { - endTime_ = null; - onChanged(); - } else { - endTime_ = null; - endTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public com.google.protobuf.Duration.Builder getEndTimeBuilder() { - - onChanged(); - return getEndTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder() { - if (endTimeBuilder_ != null) { - return endTimeBuilder_.getMessageOrBuilder(); - } else { - return endTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endTime_; - } - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - getEndTimeFieldBuilder() { - if (endTimeBuilder_ == null) { - endTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder>( - getEndTime(), getParentForChildren(), isClean()); - endTime_ = null; - } - return endTimeBuilder_; - } - - private java.lang.Object word_ = ""; - /** - * - * - *
-     * The word corresponding to this set of information.
-     * 
- * - * string word = 3; - * - * @return The word. - */ - public java.lang.String getWord() { - java.lang.Object ref = word_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - word_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The word corresponding to this set of information.
-     * 
- * - * string word = 3; - * - * @return The bytes for word. - */ - public com.google.protobuf.ByteString getWordBytes() { - java.lang.Object ref = word_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - word_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The word corresponding to this set of information.
-     * 
- * - * string word = 3; - * - * @param value The word to set. - * @return This builder for chaining. - */ - public Builder setWord(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - word_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The word corresponding to this set of information.
-     * 
- * - * string word = 3; - * - * @return This builder for chaining. - */ - public Builder clearWord() { - - word_ = getDefaultInstance().getWord(); - onChanged(); - return this; - } - /** - * - * - *
-     * The word corresponding to this set of information.
-     * 
- * - * string word = 3; - * - * @param value The bytes for word to set. - * @return This builder for chaining. - */ - public Builder setWordBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - word_ = value; - onChanged(); - return this; - } - - private int speakerTag_; - /** - * - * - *
-     * A distinct integer value is assigned for every speaker within
-     * the audio. This field specifies which one of those speakers was detected to
-     * have spoken this word. Value ranges from '1' to diarization_speaker_count.
-     * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
-     * top alternative.
-     * 
- * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The speakerTag. - */ - @java.lang.Override - public int getSpeakerTag() { - return speakerTag_; - } - /** - * - * - *
-     * A distinct integer value is assigned for every speaker within
-     * the audio. This field specifies which one of those speakers was detected to
-     * have spoken this word. Value ranges from '1' to diarization_speaker_count.
-     * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
-     * top alternative.
-     * 
- * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The speakerTag to set. - * @return This builder for chaining. - */ - public Builder setSpeakerTag(int value) { - - speakerTag_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * A distinct integer value is assigned for every speaker within
-     * the audio. This field specifies which one of those speakers was detected to
-     * have spoken this word. Value ranges from '1' to diarization_speaker_count.
-     * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
-     * top alternative.
-     * 
- * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return This builder for chaining. - */ - public Builder clearSpeakerTag() { - - speakerTag_ = 0; - 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.WordInfo) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.WordInfo) - private static final com.google.cloud.speech.v1.WordInfo DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.WordInfo(); - } - - public static com.google.cloud.speech.v1.WordInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public WordInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new WordInfo(input, extensionRegistry); - } - }; - - 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.WordInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfoOrBuilder.java b/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfoOrBuilder.java deleted file mode 100644 index 18e0ef83a..000000000 --- a/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfoOrBuilder.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * 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 WordInfoOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.WordInfo) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - * - * @return Whether the startTime field is set. - */ - boolean hasStartTime(); - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - * - * @return The startTime. - */ - com.google.protobuf.Duration getStartTime(); - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - */ - com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder(); - - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - * - * @return Whether the endTime field is set. - */ - boolean hasEndTime(); - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - * - * @return The endTime. - */ - com.google.protobuf.Duration getEndTime(); - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - */ - com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder(); - - /** - * - * - *
-   * The word corresponding to this set of information.
-   * 
- * - * string word = 3; - * - * @return The word. - */ - java.lang.String getWord(); - /** - * - * - *
-   * The word corresponding to this set of information.
-   * 
- * - * string word = 3; - * - * @return The bytes for word. - */ - com.google.protobuf.ByteString getWordBytes(); - - /** - * - * - *
-   * A distinct integer value is assigned for every speaker within
-   * the audio. This field specifies which one of those speakers was detected to
-   * have spoken this word. Value ranges from '1' to diarization_speaker_count.
-   * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
-   * top alternative.
-   * 
- * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The speakerTag. - */ - int getSpeakerTag(); -} diff --git a/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto b/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto deleted file mode 100644 index f343fa21d..000000000 --- a/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto +++ /dev/null @@ -1,759 +0,0 @@ -// Copyright 2019 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 -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.speech.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/speech/v1;speech"; -option java_multiple_files = true; -option java_outer_classname = "SpeechProto"; -option java_package = "com.google.cloud.speech.v1"; -option objc_class_prefix = "GCS"; - -// Service that implements Google Cloud Speech API. -service Speech { - option (google.api.default_host) = "speech.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Performs synchronous speech recognition: receive results after all audio - // has been sent and processed. - rpc Recognize(RecognizeRequest) returns (RecognizeResponse) { - option (google.api.http) = { - post: "/v1/speech:recognize" - body: "*" - }; - option (google.api.method_signature) = "config,audio"; - } - - // Performs asynchronous speech recognition: receive results via the - // google.longrunning.Operations interface. Returns either an - // `Operation.error` or an `Operation.response` which contains - // a `LongRunningRecognizeResponse` message. - // For more information on asynchronous speech recognition, see the - // [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - rpc LongRunningRecognize(LongRunningRecognizeRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/speech:longrunningrecognize" - body: "*" - }; - option (google.api.method_signature) = "config,audio"; - option (google.longrunning.operation_info) = { - response_type: "LongRunningRecognizeResponse" - metadata_type: "LongRunningRecognizeMetadata" - }; - } - - // Performs bidirectional streaming speech recognition: receive results while - // sending audio. This method is only available via the gRPC API (not REST). - rpc StreamingRecognize(stream StreamingRecognizeRequest) returns (stream StreamingRecognizeResponse) { - } -} - -// The top-level message sent by the client for the `Recognize` method. -message RecognizeRequest { - // Required. Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The audio data to be recognized. - RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The top-level message sent by the client for the `LongRunningRecognize` -// method. -message LongRunningRecognizeRequest { - // Required. Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The audio data to be recognized. - RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The top-level message sent by the client for the `StreamingRecognize` method. -// Multiple `StreamingRecognizeRequest` messages are sent. The first message -// must contain a `streaming_config` message and must not contain -// `audio_content`. All subsequent messages must contain `audio_content` and -// must not contain a `streaming_config` message. -message StreamingRecognizeRequest { - // The streaming request, which is either a streaming config or audio content. - oneof streaming_request { - // Provides information to the recognizer that specifies how to process the - // request. The first `StreamingRecognizeRequest` message must contain a - // `streaming_config` message. - StreamingRecognitionConfig streaming_config = 1; - - // The audio data to be recognized. Sequential chunks of audio data are sent - // in sequential `StreamingRecognizeRequest` messages. The first - // `StreamingRecognizeRequest` message must not contain `audio_content` data - // and all subsequent `StreamingRecognizeRequest` messages must contain - // `audio_content` data. The audio bytes must be encoded as specified in - // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a - // pure binary representation (not base64). See - // [content limits](https://cloud.google.com/speech-to-text/quotas#content). - bytes audio_content = 2; - } -} - -// Provides information to the recognizer that specifies how to process the -// request. -message StreamingRecognitionConfig { - // Required. Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; - - // If `false` or omitted, the recognizer will perform continuous - // recognition (continuing to wait for and process audio even if the user - // pauses speaking) until the client closes the input stream (gRPC API) or - // until the maximum time limit has been reached. May return multiple - // `StreamingRecognitionResult`s with the `is_final` flag set to `true`. - // - // If `true`, the recognizer will detect a single spoken utterance. When it - // detects that the user has paused or stopped speaking, it will return an - // `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no - // more than one `StreamingRecognitionResult` with the `is_final` flag set to - // `true`. - bool single_utterance = 2; - - // If `true`, interim results (tentative hypotheses) may be - // returned as they become available (these interim results are indicated with - // the `is_final=false` flag). - // If `false` or omitted, only `is_final=true` result(s) are returned. - bool interim_results = 3; -} - -// Provides information to the recognizer that specifies how to process the -// request. -message RecognitionConfig { - // The encoding of the audio data sent in the request. - // - // All encodings support only 1 channel (mono) audio, unless the - // `audio_channel_count` and `enable_separate_recognition_per_channel` fields - // are set. - // - // For best results, the audio source should be captured and transmitted using - // a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech - // recognition can be reduced if lossy codecs are used to capture or transmit - // audio, particularly if background noise is present. Lossy codecs include - // `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, and `MP3`. - // - // The `FLAC` and `WAV` audio file formats include a header that describes the - // included audio content. You can request recognition for `WAV` files that - // contain either `LINEAR16` or `MULAW` encoded audio. - // If you send `FLAC` or `WAV` audio file format in - // your request, you do not need to specify an `AudioEncoding`; the audio - // encoding format is determined from the file header. If you specify - // an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the - // encoding configuration must match the encoding described in the audio - // header; otherwise the request returns an - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error code. - enum AudioEncoding { - // Not specified. - ENCODING_UNSPECIFIED = 0; - - // Uncompressed 16-bit signed little-endian samples (Linear PCM). - LINEAR16 = 1; - - // `FLAC` (Free Lossless Audio - // Codec) is the recommended encoding because it is - // lossless--therefore recognition is not compromised--and - // requires only about half the bandwidth of `LINEAR16`. `FLAC` stream - // encoding supports 16-bit and 24-bit samples, however, not all fields in - // `STREAMINFO` are supported. - FLAC = 2; - - // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. - MULAW = 3; - - // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. - AMR = 4; - - // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. - AMR_WB = 5; - - // Opus encoded audio frames in Ogg container - // ([OggOpus](https://wiki.xiph.org/OggOpus)). - // `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000. - OGG_OPUS = 6; - - // Although the use of lossy encodings is not recommended, if a very low - // bitrate encoding is required, `OGG_OPUS` is highly preferred over - // Speex encoding. The [Speex](https://speex.org/) encoding supported by - // Cloud Speech API has a header byte in each block, as in MIME type - // `audio/x-speex-with-header-byte`. - // It is a variant of the RTP Speex encoding defined in - // [RFC 5574](https://tools.ietf.org/html/rfc5574). - // The stream is a sequence of blocks, one block per RTP packet. Each block - // starts with a byte containing the length of the block, in bytes, followed - // by one or more frames of Speex data, padded to an integral number of - // bytes (octets) as specified in RFC 5574. In other words, each RTP header - // is replaced with a single byte containing the block length. Only Speex - // wideband is supported. `sample_rate_hertz` must be 16000. - SPEEX_WITH_HEADER_BYTE = 7; - } - - // Encoding of audio data sent in all `RecognitionAudio` messages. - // This field is optional for `FLAC` and `WAV` audio files and required - // for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding]. - AudioEncoding encoding = 1; - - // Sample rate in Hertz of the audio data sent in all - // `RecognitionAudio` messages. Valid values are: 8000-48000. - // 16000 is optimal. For best results, set the sampling rate of the audio - // source to 16000 Hz. If that's not possible, use the native sample rate of - // the audio source (instead of re-sampling). - // This field is optional for FLAC and WAV audio files, but is - // required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding]. - int32 sample_rate_hertz = 2; - - // 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 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. - // To perform independent recognition on each channel set - // `enable_separate_recognition_per_channel` to 'true'. - int32 audio_channel_count = 7; - - // This needs to be set to `true` explicitly and `audio_channel_count` > 1 - // to get each channel recognized separately. The recognition result will - // contain a `channel_tag` field to state which channel that result belongs - // to. If this is not true, we will only recognize the first channel. The - // request is billed cumulatively for all channels recognized: - // `audio_channel_count` multiplied by the length of the audio. - bool enable_separate_recognition_per_channel = 12; - - // Required. The language of the supplied audio as a - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - // Example: "en-US". - // See [Language - // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list - // of the currently supported language codes. - string language_code = 3 [(google.api.field_behavior) = REQUIRED]; - - // Maximum number of recognition hypotheses to be returned. - // Specifically, the maximum number of `SpeechRecognitionAlternative` messages - // within each `SpeechRecognitionResult`. - // The server may return fewer than `max_alternatives`. - // Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of - // one. If omitted, will return a maximum of one. - int32 max_alternatives = 4; - - // If set to `true`, the server will attempt to filter out - // profanities, replacing all but the initial character in each filtered word - // with asterisks, e.g. "f***". If set to `false` or omitted, profanities - // won't be filtered out. - bool profanity_filter = 5; - - // Array of [SpeechContext][google.cloud.speech.v1.SpeechContext]. - // A means to provide context to assist the speech recognition. For more - // information, see - // [speech - // adaptation](https://cloud.google.com/speech-to-text/docs/context-strength). - repeated SpeechContext speech_contexts = 6; - - // If `true`, the top result includes a list of words and - // the start and end time offsets (timestamps) for those words. If - // `false`, no word-level time offset information is returned. The default is - // `false`. - bool enable_word_time_offsets = 8; - - // If 'true', adds punctuation to recognition result hypotheses. - // This feature is only available in select languages. Setting this for - // requests in other languages has no effect at all. - // The default 'false' value does not add punctuation to result hypotheses. - // Note: This is currently offered as an experimental service, complimentary - // to all users. In the future this may be exclusively available as a - // premium feature. - bool enable_automatic_punctuation = 11; - - // Config to enable speaker diarization and set additional - // parameters to make diarization better suited for your application. - // Note: When this is enabled, we send all the words from the beginning of the - // audio for the top alternative in every consecutive STREAMING responses. - // This is done in order to improve our speaker tags as our models learn to - // identify the speakers in the conversation over time. - // For non-streaming requests, the diarization results will be provided only - // in the top alternative of the FINAL SpeechRecognitionResult. - SpeakerDiarizationConfig diarization_config = 19; - - // Metadata regarding this request. - RecognitionMetadata metadata = 9; - - // Which model to select for the given request. Select the model - // best suited to your domain to get best results. If a model is not - // explicitly specified, then we auto-select a model based on the parameters - // in the RecognitionConfig. - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - //
ModelDescription
command_and_searchBest for short queries such as voice commands or voice search.
phone_callBest for audio that originated from a phone call (typically - // recorded at an 8khz sampling rate).
videoBest for audio that originated from from video or includes multiple - // speakers. Ideally the audio is recorded at a 16khz or greater - // sampling rate. This is a premium model that costs more than the - // standard rate.
defaultBest for audio that is not one of the specific audio models. - // For example, long-form audio. Ideally the audio is high-fidelity, - // recorded at a 16khz or greater sampling rate.
- string model = 13; - - // Set to true to use an enhanced model for speech recognition. - // If `use_enhanced` is set to true and the `model` field is not set, then - // an appropriate enhanced model is chosen if an enhanced model exists for - // the audio. - // - // If `use_enhanced` is true and an enhanced version of the specified model - // does not exist, then the speech is recognized using the standard version - // of the specified model. - bool use_enhanced = 14; -} - -// Config to enable speaker diarization. -message SpeakerDiarizationConfig { - // If 'true', enables speaker detection for each recognized word in - // the top alternative of the recognition result using a speaker_tag provided - // in the WordInfo. - bool enable_speaker_diarization = 1; - - // Minimum number of speakers in the conversation. This range gives you more - // flexibility by allowing the system to automatically determine the correct - // number of speakers. If not set, the default value is 2. - int32 min_speaker_count = 2; - - // Maximum number of speakers in the conversation. This range gives you more - // flexibility by allowing the system to automatically determine the correct - // number of speakers. If not set, the default value is 6. - int32 max_speaker_count = 3; - - // Unused. - int32 speaker_tag = 5 - [(google.api.field_behavior) = OUTPUT_ONLY, deprecated = true]; -} - -// Description of audio data to be recognized. -message RecognitionMetadata { - // Use case categories that the audio recognition request can be described - // by. - enum InteractionType { - // Use case is either unknown or is something other than one of the other - // values below. - INTERACTION_TYPE_UNSPECIFIED = 0; - - // Multiple people in a conversation or discussion. For example in a - // meeting with two or more people actively participating. Typically - // all the primary people speaking would be in the same room (if not, - // see PHONE_CALL) - DISCUSSION = 1; - - // One or more persons lecturing or presenting to others, mostly - // uninterrupted. - PRESENTATION = 2; - - // A phone-call or video-conference in which two or more people, who are - // not in the same room, are actively participating. - PHONE_CALL = 3; - - // A recorded message intended for another person to listen to. - VOICEMAIL = 4; - - // Professionally produced audio (eg. TV Show, Podcast). - PROFESSIONALLY_PRODUCED = 5; - - // Transcribe spoken questions and queries into text. - VOICE_SEARCH = 6; - - // Transcribe voice commands, such as for controlling a device. - VOICE_COMMAND = 7; - - // Transcribe speech to text to create a written document, such as a - // text-message, email or report. - DICTATION = 8; - } - - // Enumerates the types of capture settings describing an audio file. - enum MicrophoneDistance { - // Audio type is not known. - MICROPHONE_DISTANCE_UNSPECIFIED = 0; - - // The audio was captured from a closely placed microphone. Eg. phone, - // dictaphone, or handheld microphone. Generally if there speaker is within - // 1 meter of the microphone. - NEARFIELD = 1; - - // The speaker if within 3 meters of the microphone. - MIDFIELD = 2; - - // The speaker is more than 3 meters away from the microphone. - FARFIELD = 3; - } - - // The original media the speech was recorded on. - enum OriginalMediaType { - // Unknown original media type. - ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; - - // The speech data is an audio recording. - AUDIO = 1; - - // The speech data originally recorded on a video. - VIDEO = 2; - } - - // The type of device the speech was recorded with. - enum RecordingDeviceType { - // The recording device is unknown. - RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; - - // Speech was recorded on a smartphone. - SMARTPHONE = 1; - - // Speech was recorded using a personal computer or tablet. - PC = 2; - - // Speech was recorded over a phone line. - PHONE_LINE = 3; - - // Speech was recorded in a vehicle. - VEHICLE = 4; - - // Speech was recorded outdoors. - OTHER_OUTDOOR_DEVICE = 5; - - // Speech was recorded indoors. - OTHER_INDOOR_DEVICE = 6; - } - - // The use case most closely describing the audio content to be recognized. - InteractionType interaction_type = 1; - - // The industry vertical to which this speech recognition request most - // closely applies. This is most indicative of the topics contained - // in the audio. Use the 6-digit NAICS code to identify the industry - // vertical - see https://www.naics.com/search/. - uint32 industry_naics_code_of_audio = 3; - - // The audio type that most closely describes the audio being recognized. - MicrophoneDistance microphone_distance = 4; - - // The original media the speech was recorded on. - OriginalMediaType original_media_type = 5; - - // The type of device the speech was recorded with. - RecordingDeviceType recording_device_type = 6; - - // The device used to make the recording. Examples 'Nexus 5X' or - // 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or - // 'Cardioid Microphone'. - string recording_device_name = 7; - - // Mime type of the original audio file. For example `audio/m4a`, - // `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`. - // A list of possible audio mime types is maintained at - // http://www.iana.org/assignments/media-types/media-types.xhtml#audio - string original_mime_type = 8; - - // Description of the content. Eg. "Recordings of federal supreme court - // hearings from 2012". - string audio_topic = 10; -} - -// Provides "hints" to the speech recognizer to favor specific words and phrases -// in the results. -message SpeechContext { - // A list of strings containing words and phrases "hints" so that - // the speech recognition is more likely to recognize them. This can be used - // to improve the accuracy for specific words and phrases, for example, if - // specific commands are typically spoken by the user. This can also be used - // to add additional words to the vocabulary of the recognizer. See - // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). - // - // List items can also be set to classes for groups of words that represent - // common concepts that occur in natural language. For example, rather than - // providing phrase hints for every month of the year, using the $MONTH class - // improves the likelihood of correctly transcribing audio that includes - // months. - repeated string phrases = 1; -} - -// Contains audio data in the encoding specified in the `RecognitionConfig`. -// Either `content` or `uri` must be supplied. Supplying both or neither -// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See -// [content limits](https://cloud.google.com/speech-to-text/quotas#content). -message RecognitionAudio { - // The audio source, which is either inline content or a Google Cloud - // Storage uri. - oneof audio_source { - // The audio data bytes encoded as specified in - // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a - // pure binary representation, whereas JSON representations use base64. - bytes content = 1; - - // URI that points to a file that contains audio data bytes as specified in - // `RecognitionConfig`. The file must not be compressed (for example, gzip). - // Currently, only Google Cloud Storage URIs are - // supported, which must be specified in the following format: - // `gs://bucket_name/object_name` (other URI formats return - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see - // [Request URIs](https://cloud.google.com/storage/docs/reference-uris). - string uri = 2; - } -} - -// The only message returned to the client by the `Recognize` method. It -// contains the result as zero or more sequential `SpeechRecognitionResult` -// messages. -message RecognizeResponse { - // Sequential list of transcription results corresponding to - // sequential portions of audio. - repeated SpeechRecognitionResult results = 2; -} - -// The only message returned to the client by the `LongRunningRecognize` method. -// It contains the result as zero or more sequential `SpeechRecognitionResult` -// messages. It is included in the `result.response` field of the `Operation` -// returned by the `GetOperation` call of the `google::longrunning::Operations` -// service. -message LongRunningRecognizeResponse { - // Sequential list of transcription results corresponding to - // sequential portions of audio. - repeated SpeechRecognitionResult results = 2; -} - -// Describes the progress of a long-running `LongRunningRecognize` call. It is -// included in the `metadata` field of the `Operation` returned by the -// `GetOperation` call of the `google::longrunning::Operations` service. -message LongRunningRecognizeMetadata { - // Approximate percentage of audio processed thus far. Guaranteed to be 100 - // when the audio is fully processed and the results are available. - int32 progress_percent = 1; - - // Time when the request was received. - google.protobuf.Timestamp start_time = 2; - - // Time of the most recent processing update. - google.protobuf.Timestamp last_update_time = 3; -} - -// `StreamingRecognizeResponse` is the only message returned to the client by -// `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` -// messages are streamed back to the client. If there is no recognizable -// audio, and `single_utterance` is set to false, then no messages are streamed -// back to the client. -// -// Here's an example of a series of ten `StreamingRecognizeResponse`s that might -// be returned while processing audio: -// -// 1. results { alternatives { transcript: "tube" } stability: 0.01 } -// -// 2. results { alternatives { transcript: "to be a" } stability: 0.01 } -// -// 3. results { alternatives { transcript: "to be" } stability: 0.9 } -// results { alternatives { transcript: " or not to be" } stability: 0.01 } -// -// 4. results { alternatives { transcript: "to be or not to be" -// confidence: 0.92 } -// alternatives { transcript: "to bee or not to bee" } -// is_final: true } -// -// 5. results { alternatives { transcript: " that's" } stability: 0.01 } -// -// 6. results { alternatives { transcript: " that is" } stability: 0.9 } -// results { alternatives { transcript: " the question" } stability: 0.01 } -// -// 7. results { alternatives { transcript: " that is the question" -// confidence: 0.98 } -// alternatives { transcript: " that was the question" } -// is_final: true } -// -// Notes: -// -// - Only two of the above responses #4 and #7 contain final results; they are -// indicated by `is_final: true`. Concatenating these together generates the -// full transcript: "to be or not to be that is the question". -// -// - The others contain interim `results`. #3 and #6 contain two interim -// `results`: the first portion has a high stability and is less likely to -// change; the second portion has a low stability and is very likely to -// change. A UI designer might choose to show only high stability `results`. -// -// - The specific `stability` and `confidence` values shown above are only for -// illustrative purposes. Actual values may vary. -// -// - In each response, only one of these fields will be set: -// `error`, -// `speech_event_type`, or -// one or more (repeated) `results`. -message StreamingRecognizeResponse { - // Indicates the type of speech event. - enum SpeechEventType { - // No speech event specified. - SPEECH_EVENT_UNSPECIFIED = 0; - - // This event indicates that the server has detected the end of the user's - // speech utterance and expects no additional speech. Therefore, the server - // will not process additional audio (although it may subsequently return - // additional results). The client should stop sending additional audio - // data, half-close the gRPC connection, and wait for any additional results - // until the server closes the gRPC connection. This event is only sent if - // `single_utterance` was set to `true`, and is not used otherwise. - END_OF_SINGLE_UTTERANCE = 1; - } - - // If set, returns a [google.rpc.Status][google.rpc.Status] message that - // specifies the error for the operation. - google.rpc.Status error = 1; - - // This repeated list contains zero or more results that - // correspond to consecutive portions of the audio currently being processed. - // It contains zero or one `is_final=true` result (the newly settled portion), - // followed by zero or more `is_final=false` results (the interim results). - repeated StreamingRecognitionResult results = 2; - - // Indicates the type of speech event. - SpeechEventType speech_event_type = 4; -} - -// A streaming speech recognition result corresponding to a portion of the audio -// that is currently being processed. -message StreamingRecognitionResult { - // May contain one or more recognition hypotheses (up to the - // maximum specified in `max_alternatives`). - // These alternatives are ordered in terms of accuracy, with the top (first) - // alternative being the most probable, as ranked by the recognizer. - repeated SpeechRecognitionAlternative alternatives = 1; - - // If `false`, this `StreamingRecognitionResult` represents an - // interim result that may change. If `true`, this is the final time the - // speech service will return this particular `StreamingRecognitionResult`, - // the recognizer will not return any further hypotheses for this portion of - // the transcript and corresponding audio. - bool is_final = 2; - - // An estimate of the likelihood that the recognizer will not - // change its guess about this interim result. Values range from 0.0 - // (completely unstable) to 1.0 (completely stable). - // This field is only provided for interim results (`is_final=false`). - // The default of 0.0 is a sentinel value indicating `stability` was not set. - float stability = 3; - - // Time offset of the end of this result relative to the - // beginning of the audio. - google.protobuf.Duration result_end_time = 4; - - // For multi-channel audio, this is the channel number corresponding to the - // recognized result for the audio from that channel. - // For audio_channel_count = N, its output values can range from '1' to 'N'. - int32 channel_tag = 5; - - // The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag of - // the language in this result. This language code was detected to have the - // most likelihood of being spoken in the audio. - string language_code = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A speech recognition result corresponding to a portion of the audio. -message SpeechRecognitionResult { - // May contain one or more recognition hypotheses (up to the - // maximum specified in `max_alternatives`). - // These alternatives are ordered in terms of accuracy, with the top (first) - // alternative being the most probable, as ranked by the recognizer. - repeated SpeechRecognitionAlternative alternatives = 1; - - // For multi-channel audio, this is the channel number corresponding to the - // recognized result for the audio from that channel. - // For audio_channel_count = N, its output values can range from '1' to 'N'. - int32 channel_tag = 2; -} - -// Alternative hypotheses (a.k.a. n-best list). -message SpeechRecognitionAlternative { - // Transcript text representing the words that the user spoke. - string transcript = 1; - - // The confidence estimate between 0.0 and 1.0. A higher number - // indicates an estimated greater likelihood that the recognized words are - // correct. This field is set only for the top alternative of a non-streaming - // result or, of a streaming result where `is_final=true`. - // This field is not guaranteed to be accurate and users should not rely on it - // to be always provided. - // The default of 0.0 is a sentinel value indicating `confidence` was not set. - float confidence = 2; - - // A list of word-specific information for each recognized word. - // Note: When `enable_speaker_diarization` is true, you will see all the words - // from the beginning of the audio. - repeated WordInfo words = 3; -} - -// Word-specific information for recognized words. -message WordInfo { - // Time offset relative to the beginning of the audio, - // and corresponding to the start of the spoken word. - // This field is only set if `enable_word_time_offsets=true` and only - // in the top hypothesis. - // This is an experimental feature and the accuracy of the time offset can - // vary. - google.protobuf.Duration start_time = 1; - - // Time offset relative to the beginning of the audio, - // and corresponding to the end of the spoken word. - // This field is only set if `enable_word_time_offsets=true` and only - // in the top hypothesis. - // This is an experimental feature and the accuracy of the time offset can - // vary. - google.protobuf.Duration end_time = 2; - - // The word corresponding to this set of information. - string word = 3; - - // A distinct integer value is assigned for every speaker within - // the audio. This field specifies which one of those speakers was detected to - // have spoken this word. Value ranges from '1' to diarization_speaker_count. - // speaker_tag is set if enable_speaker_diarization = 'true' and only in the - // top alternative. - int32 speaker_tag = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/proto-google-cloud-speech-v1beta1/pom.xml b/proto-google-cloud-speech-v1beta1/pom.xml deleted file mode 100644 index 1f055d768..000000000 --- a/proto-google-cloud-speech-v1beta1/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - 4.0.0 - com.google.api.grpc - proto-google-cloud-speech-v1beta1 - 0.77.2-SNAPSHOT - proto-google-cloud-speech-v1beta1 - PROTO library for proto-google-cloud-speech-v1beta1 - - com.google.cloud - google-cloud-speech-parent - 1.24.2-SNAPSHOT - - - - com.google.protobuf - protobuf-java - compile - - - com.google.api.grpc - proto-google-common-protos - compile - - - - - - - org.codehaus.mojo - flatten-maven-plugin - - - - \ No newline at end of file diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/AsyncRecognizeMetadata.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/AsyncRecognizeMetadata.java deleted file mode 100644 index 989f4236b..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/AsyncRecognizeMetadata.java +++ /dev/null @@ -1,1039 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -/** - * - * - *
- * Describes the progress of a long-running `AsyncRecognize` call. It is
- * included in the `metadata` field of the `Operation` returned by the
- * `GetOperation` call of the `google::longrunning::Operations` service.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.AsyncRecognizeMetadata} - */ -public final class AsyncRecognizeMetadata extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1beta1.AsyncRecognizeMetadata) - AsyncRecognizeMetadataOrBuilder { - private static final long serialVersionUID = 0L; - // Use AsyncRecognizeMetadata.newBuilder() to construct. - private AsyncRecognizeMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AsyncRecognizeMetadata() { - progressPercent_ = 0; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private AsyncRecognizeMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: - { - progressPercent_ = input.readInt32(); - break; - } - case 18: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (startTime_ != null) { - subBuilder = startTime_.toBuilder(); - } - startTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(startTime_); - startTime_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (lastUpdateTime_ != null) { - subBuilder = lastUpdateTime_.toBuilder(); - } - lastUpdateTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(lastUpdateTime_); - lastUpdateTime_ = subBuilder.buildPartial(); - } - - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_AsyncRecognizeMetadata_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_AsyncRecognizeMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata.class, - com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata.Builder.class); - } - - public static final int PROGRESS_PERCENT_FIELD_NUMBER = 1; - private int progressPercent_; - /** - * - * - *
-   * Approximate percentage of audio processed thus far. Guaranteed to be 100
-   * when the audio is fully processed and the results are available.
-   * 
- * - * int32 progress_percent = 1; - */ - public int getProgressPercent() { - return progressPercent_; - } - - public static final int START_TIME_FIELD_NUMBER = 2; - private com.google.protobuf.Timestamp startTime_; - /** - * - * - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public boolean hasStartTime() { - return startTime_ != null; - } - /** - * - * - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public com.google.protobuf.Timestamp getStartTime() { - return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; - } - /** - * - * - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { - return getStartTime(); - } - - public static final int LAST_UPDATE_TIME_FIELD_NUMBER = 3; - private com.google.protobuf.Timestamp lastUpdateTime_; - /** - * - * - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public boolean hasLastUpdateTime() { - return lastUpdateTime_ != null; - } - /** - * - * - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public com.google.protobuf.Timestamp getLastUpdateTime() { - return lastUpdateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : lastUpdateTime_; - } - /** - * - * - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder() { - return getLastUpdateTime(); - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (progressPercent_ != 0) { - output.writeInt32(1, progressPercent_); - } - if (startTime_ != null) { - output.writeMessage(2, getStartTime()); - } - if (lastUpdateTime_ != null) { - output.writeMessage(3, getLastUpdateTime()); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (progressPercent_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, progressPercent_); - } - if (startTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); - } - if (lastUpdateTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getLastUpdateTime()); - } - size += unknownFields.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.v1beta1.AsyncRecognizeMetadata)) { - return super.equals(obj); - } - com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata other = - (com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata) obj; - - boolean result = true; - result = result && (getProgressPercent() == other.getProgressPercent()); - result = result && (hasStartTime() == other.hasStartTime()); - if (hasStartTime()) { - result = result && getStartTime().equals(other.getStartTime()); - } - result = result && (hasLastUpdateTime() == other.hasLastUpdateTime()); - if (hasLastUpdateTime()) { - result = result && getLastUpdateTime().equals(other.getLastUpdateTime()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PROGRESS_PERCENT_FIELD_NUMBER; - hash = (53 * hash) + getProgressPercent(); - if (hasStartTime()) { - hash = (37 * hash) + START_TIME_FIELD_NUMBER; - hash = (53 * hash) + getStartTime().hashCode(); - } - if (hasLastUpdateTime()) { - hash = (37 * hash) + LAST_UPDATE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getLastUpdateTime().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata 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.v1beta1.AsyncRecognizeMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata 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.v1beta1.AsyncRecognizeMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata 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.v1beta1.AsyncRecognizeMetadata parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata 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.v1beta1.AsyncRecognizeMetadata parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - 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; - } - /** - * - * - *
-   * Describes the progress of a long-running `AsyncRecognize` call. It is
-   * included in the `metadata` field of the `Operation` returned by the
-   * `GetOperation` call of the `google::longrunning::Operations` service.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.AsyncRecognizeMetadata} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1beta1.AsyncRecognizeMetadata) - com.google.cloud.speech.v1beta1.AsyncRecognizeMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_AsyncRecognizeMetadata_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_AsyncRecognizeMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata.class, - com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata.Builder.class); - } - - // Construct using com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - public Builder clear() { - super.clear(); - progressPercent_ = 0; - - if (startTimeBuilder_ == null) { - startTime_ = null; - } else { - startTime_ = null; - startTimeBuilder_ = null; - } - if (lastUpdateTimeBuilder_ == null) { - lastUpdateTime_ = null; - } else { - lastUpdateTime_ = null; - lastUpdateTimeBuilder_ = null; - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_AsyncRecognizeMetadata_descriptor; - } - - public com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata getDefaultInstanceForType() { - return com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata.getDefaultInstance(); - } - - public com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata build() { - com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata buildPartial() { - com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata result = - new com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata(this); - result.progressPercent_ = progressPercent_; - if (startTimeBuilder_ == null) { - result.startTime_ = startTime_; - } else { - result.startTime_ = startTimeBuilder_.build(); - } - if (lastUpdateTimeBuilder_ == null) { - result.lastUpdateTime_ = lastUpdateTime_; - } else { - result.lastUpdateTime_ = lastUpdateTimeBuilder_.build(); - } - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata) { - return mergeFrom((com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata other) { - if (other == com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata.getDefaultInstance()) - return this; - if (other.getProgressPercent() != 0) { - setProgressPercent(other.getProgressPercent()); - } - if (other.hasStartTime()) { - mergeStartTime(other.getStartTime()); - } - if (other.hasLastUpdateTime()) { - mergeLastUpdateTime(other.getLastUpdateTime()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int progressPercent_; - /** - * - * - *
-     * Approximate percentage of audio processed thus far. Guaranteed to be 100
-     * when the audio is fully processed and the results are available.
-     * 
- * - * int32 progress_percent = 1; - */ - public int getProgressPercent() { - return progressPercent_; - } - /** - * - * - *
-     * Approximate percentage of audio processed thus far. Guaranteed to be 100
-     * when the audio is fully processed and the results are available.
-     * 
- * - * int32 progress_percent = 1; - */ - public Builder setProgressPercent(int value) { - - progressPercent_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Approximate percentage of audio processed thus far. Guaranteed to be 100
-     * when the audio is fully processed and the results are available.
-     * 
- * - * int32 progress_percent = 1; - */ - public Builder clearProgressPercent() { - - progressPercent_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp startTime_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - startTimeBuilder_; - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public boolean hasStartTime() { - return startTimeBuilder_ != null || startTime_ != null; - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public com.google.protobuf.Timestamp getStartTime() { - if (startTimeBuilder_ == null) { - return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; - } else { - return startTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public Builder setStartTime(com.google.protobuf.Timestamp value) { - if (startTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - startTime_ = value; - onChanged(); - } else { - startTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (startTimeBuilder_ == null) { - startTime_ = builderForValue.build(); - onChanged(); - } else { - startTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public Builder mergeStartTime(com.google.protobuf.Timestamp value) { - if (startTimeBuilder_ == null) { - if (startTime_ != null) { - startTime_ = - com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); - } else { - startTime_ = value; - } - onChanged(); - } else { - startTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public Builder clearStartTime() { - if (startTimeBuilder_ == null) { - startTime_ = null; - onChanged(); - } else { - startTime_ = null; - startTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { - - onChanged(); - return getStartTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { - if (startTimeBuilder_ != null) { - return startTimeBuilder_.getMessageOrBuilder(); - } else { - return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; - } - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getStartTimeFieldBuilder() { - if (startTimeBuilder_ == null) { - startTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getStartTime(), getParentForChildren(), isClean()); - startTime_ = null; - } - return startTimeBuilder_; - } - - private com.google.protobuf.Timestamp lastUpdateTime_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - lastUpdateTimeBuilder_; - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public boolean hasLastUpdateTime() { - return lastUpdateTimeBuilder_ != null || lastUpdateTime_ != null; - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public com.google.protobuf.Timestamp getLastUpdateTime() { - if (lastUpdateTimeBuilder_ == null) { - return lastUpdateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : lastUpdateTime_; - } else { - return lastUpdateTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public Builder setLastUpdateTime(com.google.protobuf.Timestamp value) { - if (lastUpdateTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - lastUpdateTime_ = value; - onChanged(); - } else { - lastUpdateTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public Builder setLastUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (lastUpdateTimeBuilder_ == null) { - lastUpdateTime_ = builderForValue.build(); - onChanged(); - } else { - lastUpdateTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public Builder mergeLastUpdateTime(com.google.protobuf.Timestamp value) { - if (lastUpdateTimeBuilder_ == null) { - if (lastUpdateTime_ != null) { - lastUpdateTime_ = - com.google.protobuf.Timestamp.newBuilder(lastUpdateTime_) - .mergeFrom(value) - .buildPartial(); - } else { - lastUpdateTime_ = value; - } - onChanged(); - } else { - lastUpdateTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public Builder clearLastUpdateTime() { - if (lastUpdateTimeBuilder_ == null) { - lastUpdateTime_ = null; - onChanged(); - } else { - lastUpdateTime_ = null; - lastUpdateTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public com.google.protobuf.Timestamp.Builder getLastUpdateTimeBuilder() { - - onChanged(); - return getLastUpdateTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder() { - if (lastUpdateTimeBuilder_ != null) { - return lastUpdateTimeBuilder_.getMessageOrBuilder(); - } else { - return lastUpdateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : lastUpdateTime_; - } - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getLastUpdateTimeFieldBuilder() { - if (lastUpdateTimeBuilder_ == null) { - lastUpdateTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getLastUpdateTime(), getParentForChildren(), isClean()); - lastUpdateTime_ = null; - } - return lastUpdateTimeBuilder_; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1beta1.AsyncRecognizeMetadata) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1beta1.AsyncRecognizeMetadata) - private static final com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata(); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public AsyncRecognizeMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AsyncRecognizeMetadata(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.cloud.speech.v1beta1.AsyncRecognizeMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/AsyncRecognizeMetadataOrBuilder.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/AsyncRecognizeMetadataOrBuilder.java deleted file mode 100644 index 9840b822b..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/AsyncRecognizeMetadataOrBuilder.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -public interface AsyncRecognizeMetadataOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1beta1.AsyncRecognizeMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Approximate percentage of audio processed thus far. Guaranteed to be 100
-   * when the audio is fully processed and the results are available.
-   * 
- * - * int32 progress_percent = 1; - */ - int getProgressPercent(); - - /** - * - * - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - boolean hasStartTime(); - /** - * - * - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - com.google.protobuf.Timestamp getStartTime(); - /** - * - * - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); - - /** - * - * - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - boolean hasLastUpdateTime(); - /** - * - * - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - com.google.protobuf.Timestamp getLastUpdateTime(); - /** - * - * - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder(); -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/AsyncRecognizeRequest.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/AsyncRecognizeRequest.java deleted file mode 100644 index ba481428d..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/AsyncRecognizeRequest.java +++ /dev/null @@ -1,975 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -/** - * - * - *
- * The top-level message sent by the client for the `AsyncRecognize` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.AsyncRecognizeRequest} - */ -public final class AsyncRecognizeRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1beta1.AsyncRecognizeRequest) - AsyncRecognizeRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use AsyncRecognizeRequest.newBuilder() to construct. - private AsyncRecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AsyncRecognizeRequest() {} - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private AsyncRecognizeRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - com.google.cloud.speech.v1beta1.RecognitionConfig.Builder subBuilder = null; - if (config_ != null) { - subBuilder = config_.toBuilder(); - } - config_ = - input.readMessage( - com.google.cloud.speech.v1beta1.RecognitionConfig.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(config_); - config_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.cloud.speech.v1beta1.RecognitionAudio.Builder subBuilder = null; - if (audio_ != null) { - subBuilder = audio_.toBuilder(); - } - audio_ = - input.readMessage( - com.google.cloud.speech.v1beta1.RecognitionAudio.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(audio_); - audio_ = subBuilder.buildPartial(); - } - - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_AsyncRecognizeRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_AsyncRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.AsyncRecognizeRequest.class, - com.google.cloud.speech.v1beta1.AsyncRecognizeRequest.Builder.class); - } - - public static final int CONFIG_FIELD_NUMBER = 1; - private com.google.cloud.speech.v1beta1.RecognitionConfig config_; - /** - * - * - *
-   * *Required* Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public boolean hasConfig() { - return config_ != null; - } - /** - * - * - *
-   * *Required* Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public com.google.cloud.speech.v1beta1.RecognitionConfig getConfig() { - return config_ == null - ? com.google.cloud.speech.v1beta1.RecognitionConfig.getDefaultInstance() - : config_; - } - /** - * - * - *
-   * *Required* Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public com.google.cloud.speech.v1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { - return getConfig(); - } - - public static final int AUDIO_FIELD_NUMBER = 2; - private com.google.cloud.speech.v1beta1.RecognitionAudio audio_; - /** - * - * - *
-   * *Required* The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public boolean hasAudio() { - return audio_ != null; - } - /** - * - * - *
-   * *Required* The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public com.google.cloud.speech.v1beta1.RecognitionAudio getAudio() { - return audio_ == null - ? com.google.cloud.speech.v1beta1.RecognitionAudio.getDefaultInstance() - : audio_; - } - /** - * - * - *
-   * *Required* The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public com.google.cloud.speech.v1beta1.RecognitionAudioOrBuilder getAudioOrBuilder() { - return getAudio(); - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (config_ != null) { - output.writeMessage(1, getConfig()); - } - if (audio_ != null) { - output.writeMessage(2, getAudio()); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (config_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getConfig()); - } - if (audio_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAudio()); - } - size += unknownFields.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.v1beta1.AsyncRecognizeRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1beta1.AsyncRecognizeRequest other = - (com.google.cloud.speech.v1beta1.AsyncRecognizeRequest) obj; - - boolean result = true; - result = result && (hasConfig() == other.hasConfig()); - if (hasConfig()) { - result = result && getConfig().equals(other.getConfig()); - } - result = result && (hasAudio() == other.hasAudio()); - if (hasAudio()) { - result = result && getAudio().equals(other.getAudio()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConfig()) { - hash = (37 * hash) + CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getConfig().hashCode(); - } - if (hasAudio()) { - hash = (37 * hash) + AUDIO_FIELD_NUMBER; - hash = (53 * hash) + getAudio().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeRequest 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.v1beta1.AsyncRecognizeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeRequest 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.v1beta1.AsyncRecognizeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeRequest 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.v1beta1.AsyncRecognizeRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeRequest 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.v1beta1.AsyncRecognizeRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.speech.v1beta1.AsyncRecognizeRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - 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; - } - /** - * - * - *
-   * The top-level message sent by the client for the `AsyncRecognize` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.AsyncRecognizeRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1beta1.AsyncRecognizeRequest) - com.google.cloud.speech.v1beta1.AsyncRecognizeRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_AsyncRecognizeRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_AsyncRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.AsyncRecognizeRequest.class, - com.google.cloud.speech.v1beta1.AsyncRecognizeRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1beta1.AsyncRecognizeRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - public Builder clear() { - super.clear(); - if (configBuilder_ == null) { - config_ = null; - } else { - config_ = null; - configBuilder_ = null; - } - if (audioBuilder_ == null) { - audio_ = null; - } else { - audio_ = null; - audioBuilder_ = null; - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_AsyncRecognizeRequest_descriptor; - } - - public com.google.cloud.speech.v1beta1.AsyncRecognizeRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1beta1.AsyncRecognizeRequest.getDefaultInstance(); - } - - public com.google.cloud.speech.v1beta1.AsyncRecognizeRequest build() { - com.google.cloud.speech.v1beta1.AsyncRecognizeRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.cloud.speech.v1beta1.AsyncRecognizeRequest buildPartial() { - com.google.cloud.speech.v1beta1.AsyncRecognizeRequest result = - new com.google.cloud.speech.v1beta1.AsyncRecognizeRequest(this); - if (configBuilder_ == null) { - result.config_ = config_; - } else { - result.config_ = configBuilder_.build(); - } - if (audioBuilder_ == null) { - result.audio_ = audio_; - } else { - result.audio_ = audioBuilder_.build(); - } - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1beta1.AsyncRecognizeRequest) { - return mergeFrom((com.google.cloud.speech.v1beta1.AsyncRecognizeRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1beta1.AsyncRecognizeRequest other) { - if (other == com.google.cloud.speech.v1beta1.AsyncRecognizeRequest.getDefaultInstance()) - return this; - if (other.hasConfig()) { - mergeConfig(other.getConfig()); - } - if (other.hasAudio()) { - mergeAudio(other.getAudio()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1beta1.AsyncRecognizeRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1beta1.AsyncRecognizeRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.speech.v1beta1.RecognitionConfig config_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.RecognitionConfig, - com.google.cloud.speech.v1beta1.RecognitionConfig.Builder, - com.google.cloud.speech.v1beta1.RecognitionConfigOrBuilder> - configBuilder_; - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public boolean hasConfig() { - return configBuilder_ != null || config_ != null; - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public com.google.cloud.speech.v1beta1.RecognitionConfig getConfig() { - if (configBuilder_ == null) { - return config_ == null - ? com.google.cloud.speech.v1beta1.RecognitionConfig.getDefaultInstance() - : config_; - } else { - return configBuilder_.getMessage(); - } - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public Builder setConfig(com.google.cloud.speech.v1beta1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - config_ = value; - onChanged(); - } else { - configBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public Builder setConfig( - com.google.cloud.speech.v1beta1.RecognitionConfig.Builder builderForValue) { - if (configBuilder_ == null) { - config_ = builderForValue.build(); - onChanged(); - } else { - configBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public Builder mergeConfig(com.google.cloud.speech.v1beta1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (config_ != null) { - config_ = - com.google.cloud.speech.v1beta1.RecognitionConfig.newBuilder(config_) - .mergeFrom(value) - .buildPartial(); - } else { - config_ = value; - } - onChanged(); - } else { - configBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public Builder clearConfig() { - if (configBuilder_ == null) { - config_ = null; - onChanged(); - } else { - config_ = null; - configBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public com.google.cloud.speech.v1beta1.RecognitionConfig.Builder getConfigBuilder() { - - onChanged(); - return getConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public com.google.cloud.speech.v1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { - if (configBuilder_ != null) { - return configBuilder_.getMessageOrBuilder(); - } else { - return config_ == null - ? com.google.cloud.speech.v1beta1.RecognitionConfig.getDefaultInstance() - : config_; - } - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.RecognitionConfig, - com.google.cloud.speech.v1beta1.RecognitionConfig.Builder, - com.google.cloud.speech.v1beta1.RecognitionConfigOrBuilder> - getConfigFieldBuilder() { - if (configBuilder_ == null) { - configBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.RecognitionConfig, - com.google.cloud.speech.v1beta1.RecognitionConfig.Builder, - com.google.cloud.speech.v1beta1.RecognitionConfigOrBuilder>( - getConfig(), getParentForChildren(), isClean()); - config_ = null; - } - return configBuilder_; - } - - private com.google.cloud.speech.v1beta1.RecognitionAudio audio_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.RecognitionAudio, - com.google.cloud.speech.v1beta1.RecognitionAudio.Builder, - com.google.cloud.speech.v1beta1.RecognitionAudioOrBuilder> - audioBuilder_; - /** - * - * - *
-     * *Required* The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public boolean hasAudio() { - return audioBuilder_ != null || audio_ != null; - } - /** - * - * - *
-     * *Required* The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public com.google.cloud.speech.v1beta1.RecognitionAudio getAudio() { - if (audioBuilder_ == null) { - return audio_ == null - ? com.google.cloud.speech.v1beta1.RecognitionAudio.getDefaultInstance() - : audio_; - } else { - return audioBuilder_.getMessage(); - } - } - /** - * - * - *
-     * *Required* The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public Builder setAudio(com.google.cloud.speech.v1beta1.RecognitionAudio value) { - if (audioBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - audio_ = value; - onChanged(); - } else { - audioBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * *Required* The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public Builder setAudio( - com.google.cloud.speech.v1beta1.RecognitionAudio.Builder builderForValue) { - if (audioBuilder_ == null) { - audio_ = builderForValue.build(); - onChanged(); - } else { - audioBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * *Required* The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public Builder mergeAudio(com.google.cloud.speech.v1beta1.RecognitionAudio value) { - if (audioBuilder_ == null) { - if (audio_ != null) { - audio_ = - com.google.cloud.speech.v1beta1.RecognitionAudio.newBuilder(audio_) - .mergeFrom(value) - .buildPartial(); - } else { - audio_ = value; - } - onChanged(); - } else { - audioBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * *Required* The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public Builder clearAudio() { - if (audioBuilder_ == null) { - audio_ = null; - onChanged(); - } else { - audio_ = null; - audioBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * *Required* The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public com.google.cloud.speech.v1beta1.RecognitionAudio.Builder getAudioBuilder() { - - onChanged(); - return getAudioFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * *Required* The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public com.google.cloud.speech.v1beta1.RecognitionAudioOrBuilder getAudioOrBuilder() { - if (audioBuilder_ != null) { - return audioBuilder_.getMessageOrBuilder(); - } else { - return audio_ == null - ? com.google.cloud.speech.v1beta1.RecognitionAudio.getDefaultInstance() - : audio_; - } - } - /** - * - * - *
-     * *Required* The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.RecognitionAudio, - com.google.cloud.speech.v1beta1.RecognitionAudio.Builder, - com.google.cloud.speech.v1beta1.RecognitionAudioOrBuilder> - getAudioFieldBuilder() { - if (audioBuilder_ == null) { - audioBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.RecognitionAudio, - com.google.cloud.speech.v1beta1.RecognitionAudio.Builder, - com.google.cloud.speech.v1beta1.RecognitionAudioOrBuilder>( - getAudio(), getParentForChildren(), isClean()); - audio_ = null; - } - return audioBuilder_; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1beta1.AsyncRecognizeRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1beta1.AsyncRecognizeRequest) - private static final com.google.cloud.speech.v1beta1.AsyncRecognizeRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1beta1.AsyncRecognizeRequest(); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public AsyncRecognizeRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AsyncRecognizeRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.cloud.speech.v1beta1.AsyncRecognizeRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/AsyncRecognizeRequestOrBuilder.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/AsyncRecognizeRequestOrBuilder.java deleted file mode 100644 index 4f1ba2c89..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/AsyncRecognizeRequestOrBuilder.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -public interface AsyncRecognizeRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1beta1.AsyncRecognizeRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * *Required* Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - boolean hasConfig(); - /** - * - * - *
-   * *Required* Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - com.google.cloud.speech.v1beta1.RecognitionConfig getConfig(); - /** - * - * - *
-   * *Required* Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - com.google.cloud.speech.v1beta1.RecognitionConfigOrBuilder getConfigOrBuilder(); - - /** - * - * - *
-   * *Required* The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - boolean hasAudio(); - /** - * - * - *
-   * *Required* The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - com.google.cloud.speech.v1beta1.RecognitionAudio getAudio(); - /** - * - * - *
-   * *Required* The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - com.google.cloud.speech.v1beta1.RecognitionAudioOrBuilder getAudioOrBuilder(); -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/AsyncRecognizeResponse.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/AsyncRecognizeResponse.java deleted file mode 100644 index 96883c6ff..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/AsyncRecognizeResponse.java +++ /dev/null @@ -1,965 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -/** - * - * - *
- * The only message returned to the client by `AsyncRecognize`. It contains the
- * result as zero or more sequential `SpeechRecognitionResult` messages. It is
- * included in the `result.response` field of the `Operation` returned by the
- * `GetOperation` call of the `google::longrunning::Operations` service.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.AsyncRecognizeResponse} - */ -public final class AsyncRecognizeResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1beta1.AsyncRecognizeResponse) - AsyncRecognizeResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use AsyncRecognizeResponse.newBuilder() to construct. - private AsyncRecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AsyncRecognizeResponse() { - results_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private AsyncRecognizeResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - results_ = - new java.util.ArrayList< - com.google.cloud.speech.v1beta1.SpeechRecognitionResult>(); - mutable_bitField0_ |= 0x00000001; - } - results_.add( - input.readMessage( - com.google.cloud.speech.v1beta1.SpeechRecognitionResult.parser(), - extensionRegistry)); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - results_ = java.util.Collections.unmodifiableList(results_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_AsyncRecognizeResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_AsyncRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.AsyncRecognizeResponse.class, - com.google.cloud.speech.v1beta1.AsyncRecognizeResponse.Builder.class); - } - - public static final int RESULTS_FIELD_NUMBER = 2; - private java.util.List results_; - /** - * - * - *
-   * *Output-only* Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List getResultsList() { - return results_; - } - /** - * - * - *
-   * *Output-only* Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsOrBuilderList() { - return results_; - } - /** - * - * - *
-   * *Output-only* Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public int getResultsCount() { - return results_.size(); - } - /** - * - * - *
-   * *Output-only* Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionResult getResults(int index) { - return results_.get(index); - } - /** - * - * - *
-   * *Output-only* Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - return results_.get(index); - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < results_.size(); i++) { - output.writeMessage(2, results_.get(i)); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < results_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, results_.get(i)); - } - size += unknownFields.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.v1beta1.AsyncRecognizeResponse)) { - return super.equals(obj); - } - com.google.cloud.speech.v1beta1.AsyncRecognizeResponse other = - (com.google.cloud.speech.v1beta1.AsyncRecognizeResponse) obj; - - boolean result = true; - result = result && getResultsList().equals(other.getResultsList()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getResultsCount() > 0) { - hash = (37 * hash) + RESULTS_FIELD_NUMBER; - hash = (53 * hash) + getResultsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeResponse parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeResponse 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.v1beta1.AsyncRecognizeResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeResponse 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.v1beta1.AsyncRecognizeResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeResponse 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.v1beta1.AsyncRecognizeResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeResponse 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.v1beta1.AsyncRecognizeResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.speech.v1beta1.AsyncRecognizeResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - 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; - } - /** - * - * - *
-   * The only message returned to the client by `AsyncRecognize`. It contains the
-   * result as zero or more sequential `SpeechRecognitionResult` messages. It is
-   * included in the `result.response` field of the `Operation` returned by the
-   * `GetOperation` call of the `google::longrunning::Operations` service.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.AsyncRecognizeResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1beta1.AsyncRecognizeResponse) - com.google.cloud.speech.v1beta1.AsyncRecognizeResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_AsyncRecognizeResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_AsyncRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.AsyncRecognizeResponse.class, - com.google.cloud.speech.v1beta1.AsyncRecognizeResponse.Builder.class); - } - - // Construct using com.google.cloud.speech.v1beta1.AsyncRecognizeResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getResultsFieldBuilder(); - } - } - - public Builder clear() { - super.clear(); - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - resultsBuilder_.clear(); - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_AsyncRecognizeResponse_descriptor; - } - - public com.google.cloud.speech.v1beta1.AsyncRecognizeResponse getDefaultInstanceForType() { - return com.google.cloud.speech.v1beta1.AsyncRecognizeResponse.getDefaultInstance(); - } - - public com.google.cloud.speech.v1beta1.AsyncRecognizeResponse build() { - com.google.cloud.speech.v1beta1.AsyncRecognizeResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.cloud.speech.v1beta1.AsyncRecognizeResponse buildPartial() { - com.google.cloud.speech.v1beta1.AsyncRecognizeResponse result = - new com.google.cloud.speech.v1beta1.AsyncRecognizeResponse(this); - int from_bitField0_ = bitField0_; - if (resultsBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - results_ = java.util.Collections.unmodifiableList(results_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.results_ = results_; - } else { - result.results_ = resultsBuilder_.build(); - } - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1beta1.AsyncRecognizeResponse) { - return mergeFrom((com.google.cloud.speech.v1beta1.AsyncRecognizeResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1beta1.AsyncRecognizeResponse other) { - if (other == com.google.cloud.speech.v1beta1.AsyncRecognizeResponse.getDefaultInstance()) - return this; - if (resultsBuilder_ == null) { - if (!other.results_.isEmpty()) { - if (results_.isEmpty()) { - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResultsIsMutable(); - results_.addAll(other.results_); - } - onChanged(); - } - } else { - if (!other.results_.isEmpty()) { - if (resultsBuilder_.isEmpty()) { - resultsBuilder_.dispose(); - resultsBuilder_ = null; - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - resultsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getResultsFieldBuilder() - : null; - } else { - resultsBuilder_.addAllMessages(other.results_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1beta1.AsyncRecognizeResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1beta1.AsyncRecognizeResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List results_ = - java.util.Collections.emptyList(); - - private void ensureResultsIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - results_ = - new java.util.ArrayList( - results_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1beta1.SpeechRecognitionResult, - com.google.cloud.speech.v1beta1.SpeechRecognitionResult.Builder, - com.google.cloud.speech.v1beta1.SpeechRecognitionResultOrBuilder> - resultsBuilder_; - - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsList() { - if (resultsBuilder_ == null) { - return java.util.Collections.unmodifiableList(results_); - } else { - return resultsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public int getResultsCount() { - if (resultsBuilder_ == null) { - return results_.size(); - } else { - return resultsBuilder_.getCount(); - } - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionResult getResults(int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1beta1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.set(index, value); - onChanged(); - } else { - resultsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public Builder setResults( - int index, - com.google.cloud.speech.v1beta1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.set(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults(com.google.cloud.speech.v1beta1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(value); - onChanged(); - } else { - resultsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1beta1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(index, value); - onChanged(); - } else { - resultsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - com.google.cloud.speech.v1beta1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - int index, - com.google.cloud.speech.v1beta1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addAllResults( - java.lang.Iterable - values) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); - onChanged(); - } else { - resultsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public Builder clearResults() { - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - resultsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public Builder removeResults(int index) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.remove(index); - onChanged(); - } else { - resultsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionResult.Builder getResultsBuilder( - int index) { - return getResultsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List< - ? extends com.google.cloud.speech.v1beta1.SpeechRecognitionResultOrBuilder> - getResultsOrBuilderList() { - if (resultsBuilder_ != null) { - return resultsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(results_); - } - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionResult.Builder addResultsBuilder() { - return getResultsFieldBuilder() - .addBuilder(com.google.cloud.speech.v1beta1.SpeechRecognitionResult.getDefaultInstance()); - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionResult.Builder addResultsBuilder( - int index) { - return getResultsFieldBuilder() - .addBuilder( - index, com.google.cloud.speech.v1beta1.SpeechRecognitionResult.getDefaultInstance()); - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsBuilderList() { - return getResultsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1beta1.SpeechRecognitionResult, - com.google.cloud.speech.v1beta1.SpeechRecognitionResult.Builder, - com.google.cloud.speech.v1beta1.SpeechRecognitionResultOrBuilder> - getResultsFieldBuilder() { - if (resultsBuilder_ == null) { - resultsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1beta1.SpeechRecognitionResult, - com.google.cloud.speech.v1beta1.SpeechRecognitionResult.Builder, - com.google.cloud.speech.v1beta1.SpeechRecognitionResultOrBuilder>( - results_, - ((bitField0_ & 0x00000001) == 0x00000001), - getParentForChildren(), - isClean()); - results_ = null; - } - return resultsBuilder_; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1beta1.AsyncRecognizeResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1beta1.AsyncRecognizeResponse) - private static final com.google.cloud.speech.v1beta1.AsyncRecognizeResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1beta1.AsyncRecognizeResponse(); - } - - public static com.google.cloud.speech.v1beta1.AsyncRecognizeResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public AsyncRecognizeResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AsyncRecognizeResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.cloud.speech.v1beta1.AsyncRecognizeResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/AsyncRecognizeResponseOrBuilder.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/AsyncRecognizeResponseOrBuilder.java deleted file mode 100644 index 50d49cfb0..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/AsyncRecognizeResponseOrBuilder.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -public interface AsyncRecognizeResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1beta1.AsyncRecognizeResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * *Output-only* Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - java.util.List getResultsList(); - /** - * - * - *
-   * *Output-only* Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - com.google.cloud.speech.v1beta1.SpeechRecognitionResult getResults(int index); - /** - * - * - *
-   * *Output-only* Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - int getResultsCount(); - /** - * - * - *
-   * *Output-only* Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - java.util.List - getResultsOrBuilderList(); - /** - * - * - *
-   * *Output-only* Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - com.google.cloud.speech.v1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder(int index); -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/RecognitionAudio.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/RecognitionAudio.java deleted file mode 100644 index c4372ebd1..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/RecognitionAudio.java +++ /dev/null @@ -1,832 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -/** - * - * - *
- * Contains audio data in the encoding specified in the `RecognitionConfig`.
- * Either `content` or `uri` must be supplied. Supplying both or neither
- * returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See
- * [audio limits](https://cloud.google.com/speech/limits#content).
- * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.RecognitionAudio} - */ -public final class RecognitionAudio extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1beta1.RecognitionAudio) - RecognitionAudioOrBuilder { - private static final long serialVersionUID = 0L; - // Use RecognitionAudio.newBuilder() to construct. - private RecognitionAudio(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private RecognitionAudio() {} - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private RecognitionAudio( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - audioSourceCase_ = 1; - audioSource_ = input.readBytes(); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - audioSourceCase_ = 2; - audioSource_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_RecognitionAudio_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_RecognitionAudio_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.RecognitionAudio.class, - com.google.cloud.speech.v1beta1.RecognitionAudio.Builder.class); - } - - private int audioSourceCase_ = 0; - private java.lang.Object audioSource_; - - public enum AudioSourceCase implements com.google.protobuf.Internal.EnumLite { - CONTENT(1), - URI(2), - AUDIOSOURCE_NOT_SET(0); - private final int value; - - private AudioSourceCase(int value) { - this.value = value; - } - /** @deprecated Use {@link #forNumber(int)} instead. */ - @java.lang.Deprecated - public static AudioSourceCase valueOf(int value) { - return forNumber(value); - } - - public static AudioSourceCase forNumber(int value) { - switch (value) { - case 1: - return CONTENT; - case 2: - return URI; - case 0: - return AUDIOSOURCE_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public AudioSourceCase getAudioSourceCase() { - return AudioSourceCase.forNumber(audioSourceCase_); - } - - public static final int CONTENT_FIELD_NUMBER = 1; - /** - * - * - *
-   * The audio data bytes encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, protobuffers use a
-   * pure binary representation, whereas JSON representations use base64.
-   * 
- * - * bytes content = 1; - */ - public com.google.protobuf.ByteString getContent() { - if (audioSourceCase_ == 1) { - return (com.google.protobuf.ByteString) audioSource_; - } - return com.google.protobuf.ByteString.EMPTY; - } - - public static final int URI_FIELD_NUMBER = 2; - /** - * - * - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - */ - public java.lang.String getUri() { - java.lang.Object ref = ""; - if (audioSourceCase_ == 2) { - ref = audioSource_; - } - 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(); - if (audioSourceCase_ == 2) { - audioSource_ = s; - } - return s; - } - } - /** - * - * - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - */ - public com.google.protobuf.ByteString getUriBytes() { - java.lang.Object ref = ""; - if (audioSourceCase_ == 2) { - ref = audioSource_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - if (audioSourceCase_ == 2) { - audioSource_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (audioSourceCase_ == 1) { - output.writeBytes(1, (com.google.protobuf.ByteString) audioSource_); - } - if (audioSourceCase_ == 2) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, audioSource_); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (audioSourceCase_ == 1) { - size += - com.google.protobuf.CodedOutputStream.computeBytesSize( - 1, (com.google.protobuf.ByteString) audioSource_); - } - if (audioSourceCase_ == 2) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, audioSource_); - } - size += unknownFields.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.v1beta1.RecognitionAudio)) { - return super.equals(obj); - } - com.google.cloud.speech.v1beta1.RecognitionAudio other = - (com.google.cloud.speech.v1beta1.RecognitionAudio) obj; - - boolean result = true; - result = result && getAudioSourceCase().equals(other.getAudioSourceCase()); - if (!result) return false; - switch (audioSourceCase_) { - case 1: - result = result && getContent().equals(other.getContent()); - break; - case 2: - result = result && getUri().equals(other.getUri()); - break; - case 0: - default: - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (audioSourceCase_) { - case 1: - hash = (37 * hash) + CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getContent().hashCode(); - break; - case 2: - hash = (37 * hash) + URI_FIELD_NUMBER; - hash = (53 * hash) + getUri().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1beta1.RecognitionAudio parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.RecognitionAudio 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.v1beta1.RecognitionAudio parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.RecognitionAudio 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.v1beta1.RecognitionAudio parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.RecognitionAudio parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.speech.v1beta1.RecognitionAudio parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.RecognitionAudio 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.v1beta1.RecognitionAudio parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.RecognitionAudio 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.v1beta1.RecognitionAudio parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.RecognitionAudio parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.cloud.speech.v1beta1.RecognitionAudio prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - 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; - } - /** - * - * - *
-   * Contains audio data in the encoding specified in the `RecognitionConfig`.
-   * Either `content` or `uri` must be supplied. Supplying both or neither
-   * returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See
-   * [audio limits](https://cloud.google.com/speech/limits#content).
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.RecognitionAudio} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1beta1.RecognitionAudio) - com.google.cloud.speech.v1beta1.RecognitionAudioOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_RecognitionAudio_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_RecognitionAudio_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.RecognitionAudio.class, - com.google.cloud.speech.v1beta1.RecognitionAudio.Builder.class); - } - - // Construct using com.google.cloud.speech.v1beta1.RecognitionAudio.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - public Builder clear() { - super.clear(); - audioSourceCase_ = 0; - audioSource_ = null; - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_RecognitionAudio_descriptor; - } - - public com.google.cloud.speech.v1beta1.RecognitionAudio getDefaultInstanceForType() { - return com.google.cloud.speech.v1beta1.RecognitionAudio.getDefaultInstance(); - } - - public com.google.cloud.speech.v1beta1.RecognitionAudio build() { - com.google.cloud.speech.v1beta1.RecognitionAudio result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.cloud.speech.v1beta1.RecognitionAudio buildPartial() { - com.google.cloud.speech.v1beta1.RecognitionAudio result = - new com.google.cloud.speech.v1beta1.RecognitionAudio(this); - if (audioSourceCase_ == 1) { - result.audioSource_ = audioSource_; - } - if (audioSourceCase_ == 2) { - result.audioSource_ = audioSource_; - } - result.audioSourceCase_ = audioSourceCase_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1beta1.RecognitionAudio) { - return mergeFrom((com.google.cloud.speech.v1beta1.RecognitionAudio) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1beta1.RecognitionAudio other) { - if (other == com.google.cloud.speech.v1beta1.RecognitionAudio.getDefaultInstance()) - return this; - switch (other.getAudioSourceCase()) { - case CONTENT: - { - setContent(other.getContent()); - break; - } - case URI: - { - audioSourceCase_ = 2; - audioSource_ = other.audioSource_; - onChanged(); - break; - } - case AUDIOSOURCE_NOT_SET: - { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1beta1.RecognitionAudio parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1beta1.RecognitionAudio) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int audioSourceCase_ = 0; - private java.lang.Object audioSource_; - - public AudioSourceCase getAudioSourceCase() { - return AudioSourceCase.forNumber(audioSourceCase_); - } - - public Builder clearAudioSource() { - audioSourceCase_ = 0; - audioSource_ = null; - onChanged(); - return this; - } - - /** - * - * - *
-     * The audio data bytes encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, protobuffers use a
-     * pure binary representation, whereas JSON representations use base64.
-     * 
- * - * bytes content = 1; - */ - public com.google.protobuf.ByteString getContent() { - if (audioSourceCase_ == 1) { - return (com.google.protobuf.ByteString) audioSource_; - } - return com.google.protobuf.ByteString.EMPTY; - } - /** - * - * - *
-     * The audio data bytes encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, protobuffers use a
-     * pure binary representation, whereas JSON representations use base64.
-     * 
- * - * bytes content = 1; - */ - public Builder setContent(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - audioSourceCase_ = 1; - audioSource_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The audio data bytes encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, protobuffers use a
-     * pure binary representation, whereas JSON representations use base64.
-     * 
- * - * bytes content = 1; - */ - public Builder clearContent() { - if (audioSourceCase_ == 1) { - audioSourceCase_ = 0; - audioSource_ = null; - onChanged(); - } - return this; - } - - /** - * - * - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - */ - public java.lang.String getUri() { - java.lang.Object ref = ""; - if (audioSourceCase_ == 2) { - ref = audioSource_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (audioSourceCase_ == 2) { - audioSource_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - */ - public com.google.protobuf.ByteString getUriBytes() { - java.lang.Object ref = ""; - if (audioSourceCase_ == 2) { - ref = audioSource_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - if (audioSourceCase_ == 2) { - audioSource_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - */ - public Builder setUri(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - audioSourceCase_ = 2; - audioSource_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - */ - public Builder clearUri() { - if (audioSourceCase_ == 2) { - audioSourceCase_ = 0; - audioSource_ = null; - onChanged(); - } - return this; - } - /** - * - * - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - */ - public Builder setUriBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - audioSourceCase_ = 2; - audioSource_ = value; - onChanged(); - return this; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1beta1.RecognitionAudio) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1beta1.RecognitionAudio) - private static final com.google.cloud.speech.v1beta1.RecognitionAudio DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1beta1.RecognitionAudio(); - } - - public static com.google.cloud.speech.v1beta1.RecognitionAudio getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public RecognitionAudio parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognitionAudio(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.cloud.speech.v1beta1.RecognitionAudio getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/RecognitionAudioOrBuilder.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/RecognitionAudioOrBuilder.java deleted file mode 100644 index 8527f7a2a..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/RecognitionAudioOrBuilder.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -public interface RecognitionAudioOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1beta1.RecognitionAudio) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The audio data bytes encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, protobuffers use a
-   * pure binary representation, whereas JSON representations use base64.
-   * 
- * - * bytes content = 1; - */ - com.google.protobuf.ByteString getContent(); - - /** - * - * - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - */ - java.lang.String getUri(); - /** - * - * - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - */ - com.google.protobuf.ByteString getUriBytes(); - - public com.google.cloud.speech.v1beta1.RecognitionAudio.AudioSourceCase getAudioSourceCase(); -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/RecognitionConfig.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/RecognitionConfig.java deleted file mode 100644 index 145dc965d..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/RecognitionConfig.java +++ /dev/null @@ -1,1544 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -/** - * - * - *
- * Provides information to the recognizer that specifies how to process the
- * request.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.RecognitionConfig} - */ -public final class RecognitionConfig extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1beta1.RecognitionConfig) - RecognitionConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use RecognitionConfig.newBuilder() to construct. - private RecognitionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private RecognitionConfig() { - encoding_ = 0; - sampleRate_ = 0; - languageCode_ = ""; - maxAlternatives_ = 0; - profanityFilter_ = false; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private RecognitionConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: - { - int rawValue = input.readEnum(); - - encoding_ = rawValue; - break; - } - case 16: - { - sampleRate_ = input.readInt32(); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - languageCode_ = s; - break; - } - case 32: - { - maxAlternatives_ = input.readInt32(); - break; - } - case 40: - { - profanityFilter_ = input.readBool(); - break; - } - case 50: - { - com.google.cloud.speech.v1beta1.SpeechContext.Builder subBuilder = null; - if (speechContext_ != null) { - subBuilder = speechContext_.toBuilder(); - } - speechContext_ = - input.readMessage( - com.google.cloud.speech.v1beta1.SpeechContext.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(speechContext_); - speechContext_ = subBuilder.buildPartial(); - } - - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_RecognitionConfig_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_RecognitionConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.RecognitionConfig.class, - com.google.cloud.speech.v1beta1.RecognitionConfig.Builder.class); - } - - /** - * - * - *
-   * Audio encoding of the data sent in the audio message. All encodings support
-   * only 1 channel (mono) audio. Only `FLAC` includes a header that describes
-   * the bytes of audio that follow the header. The other encodings are raw
-   * audio bytes with no header.
-   * For best results, the audio source should be captured and transmitted using
-   * a lossless encoding (`FLAC` or `LINEAR16`). Recognition accuracy may be
-   * reduced if lossy codecs (such as AMR, AMR_WB and MULAW) are used to capture
-   * or transmit the audio, particularly if background noise is present.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding} - */ - public enum AudioEncoding implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
-     * 
- * - * ENCODING_UNSPECIFIED = 0; - */ - ENCODING_UNSPECIFIED(0), - /** - * - * - *
-     * Uncompressed 16-bit signed little-endian samples (Linear PCM).
-     * This is the only encoding that may be used by `AsyncRecognize`.
-     * 
- * - * LINEAR16 = 1; - */ - LINEAR16(1), - /** - * - * - *
-     * This is the recommended encoding for `SyncRecognize` and
-     * `StreamingRecognize` because it uses lossless compression; therefore
-     * recognition accuracy is not compromised by a lossy codec.
-     * The stream FLAC (Free Lossless Audio Codec) encoding is specified at:
-     * http://flac.sourceforge.net/documentation.html.
-     * 16-bit and 24-bit samples are supported.
-     * Not all fields in STREAMINFO are supported.
-     * 
- * - * FLAC = 2; - */ - FLAC(2), - /** - * - * - *
-     * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
-     * 
- * - * MULAW = 3; - */ - MULAW(3), - /** - * - * - *
-     * Adaptive Multi-Rate Narrowband codec. `sample_rate` must be 8000 Hz.
-     * 
- * - * AMR = 4; - */ - AMR(4), - /** - * - * - *
-     * Adaptive Multi-Rate Wideband codec. `sample_rate` must be 16000 Hz.
-     * 
- * - * AMR_WB = 5; - */ - AMR_WB(5), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
-     * 
- * - * ENCODING_UNSPECIFIED = 0; - */ - public static final int ENCODING_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * Uncompressed 16-bit signed little-endian samples (Linear PCM).
-     * This is the only encoding that may be used by `AsyncRecognize`.
-     * 
- * - * LINEAR16 = 1; - */ - public static final int LINEAR16_VALUE = 1; - /** - * - * - *
-     * This is the recommended encoding for `SyncRecognize` and
-     * `StreamingRecognize` because it uses lossless compression; therefore
-     * recognition accuracy is not compromised by a lossy codec.
-     * The stream FLAC (Free Lossless Audio Codec) encoding is specified at:
-     * http://flac.sourceforge.net/documentation.html.
-     * 16-bit and 24-bit samples are supported.
-     * Not all fields in STREAMINFO are supported.
-     * 
- * - * FLAC = 2; - */ - public static final int FLAC_VALUE = 2; - /** - * - * - *
-     * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
-     * 
- * - * MULAW = 3; - */ - public static final int MULAW_VALUE = 3; - /** - * - * - *
-     * Adaptive Multi-Rate Narrowband codec. `sample_rate` must be 8000 Hz.
-     * 
- * - * AMR = 4; - */ - public static final int AMR_VALUE = 4; - /** - * - * - *
-     * Adaptive Multi-Rate Wideband codec. `sample_rate` must be 16000 Hz.
-     * 
- * - * AMR_WB = 5; - */ - public static final int AMR_WB_VALUE = 5; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** @deprecated Use {@link #forNumber(int)} instead. */ - @java.lang.Deprecated - public static AudioEncoding valueOf(int value) { - return forNumber(value); - } - - public static AudioEncoding forNumber(int value) { - switch (value) { - case 0: - return ENCODING_UNSPECIFIED; - case 1: - return LINEAR16; - case 2: - return FLAC; - case 3: - return MULAW; - case 4: - return AMR; - case 5: - return AMR_WB; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public AudioEncoding findValueByNumber(int number) { - return AudioEncoding.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.RecognitionConfig.getDescriptor() - .getEnumTypes() - .get(0); - } - - private static final AudioEncoding[] VALUES = values(); - - public static AudioEncoding valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private AudioEncoding(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding) - } - - public static final int ENCODING_FIELD_NUMBER = 1; - private int encoding_; - /** - * - * - *
-   * *Required* Encoding of audio data sent in all `RecognitionAudio` messages.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1; - */ - public int getEncodingValue() { - return encoding_; - } - /** - * - * - *
-   * *Required* Encoding of audio data sent in all `RecognitionAudio` messages.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1; - */ - public com.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding getEncoding() { - com.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding result = - com.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding.valueOf(encoding_); - return result == null - ? com.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding.UNRECOGNIZED - : result; - } - - public static final int SAMPLE_RATE_FIELD_NUMBER = 2; - private int sampleRate_; - /** - * - * - *
-   * *Required* Sample rate in Hertz of the audio data sent in all
-   * `RecognitionAudio` messages. Valid values are: 8000-48000.
-   * 16000 is optimal. For best results, set the sampling rate of the audio
-   * source to 16000 Hz. If that's not possible, use the native sample rate of
-   * the audio source (instead of re-sampling).
-   * 
- * - * int32 sample_rate = 2; - */ - public int getSampleRate() { - return sampleRate_; - } - - public static final int LANGUAGE_CODE_FIELD_NUMBER = 3; - private volatile java.lang.Object languageCode_; - /** - * - * - *
-   * *Optional* The language of the supplied audio as a BCP-47 language tag.
-   * Example: "en-GB"  https://www.rfc-editor.org/rfc/bcp/bcp47.txt
-   * If omitted, defaults to "en-US". See
-   * [Language Support](https://cloud.google.com/speech/docs/languages)
-   * for a list of the currently supported language codes.
-   * 
- * - * string language_code = 3; - */ - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - 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(); - languageCode_ = s; - return s; - } - } - /** - * - * - *
-   * *Optional* The language of the supplied audio as a BCP-47 language tag.
-   * Example: "en-GB"  https://www.rfc-editor.org/rfc/bcp/bcp47.txt
-   * If omitted, defaults to "en-US". See
-   * [Language Support](https://cloud.google.com/speech/docs/languages)
-   * for a list of the currently supported language codes.
-   * 
- * - * string language_code = 3; - */ - public com.google.protobuf.ByteString getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int MAX_ALTERNATIVES_FIELD_NUMBER = 4; - private int maxAlternatives_; - /** - * - * - *
-   * *Optional* Maximum number of recognition hypotheses to be returned.
-   * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-   * within each `SpeechRecognitionResult`.
-   * The server may return fewer than `max_alternatives`.
-   * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-   * one. If omitted, will return a maximum of one.
-   * 
- * - * int32 max_alternatives = 4; - */ - public int getMaxAlternatives() { - return maxAlternatives_; - } - - public static final int PROFANITY_FILTER_FIELD_NUMBER = 5; - private boolean profanityFilter_; - /** - * - * - *
-   * *Optional* If set to `true`, the server will attempt to filter out
-   * profanities, replacing all but the initial character in each filtered word
-   * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-   * won't be filtered out.
-   * 
- * - * bool profanity_filter = 5; - */ - public boolean getProfanityFilter() { - return profanityFilter_; - } - - public static final int SPEECH_CONTEXT_FIELD_NUMBER = 6; - private com.google.cloud.speech.v1beta1.SpeechContext speechContext_; - /** - * - * - *
-   * *Optional* A means to provide context to assist the speech recognition.
-   * 
- * - * .google.cloud.speech.v1beta1.SpeechContext speech_context = 6; - */ - public boolean hasSpeechContext() { - return speechContext_ != null; - } - /** - * - * - *
-   * *Optional* A means to provide context to assist the speech recognition.
-   * 
- * - * .google.cloud.speech.v1beta1.SpeechContext speech_context = 6; - */ - public com.google.cloud.speech.v1beta1.SpeechContext getSpeechContext() { - return speechContext_ == null - ? com.google.cloud.speech.v1beta1.SpeechContext.getDefaultInstance() - : speechContext_; - } - /** - * - * - *
-   * *Optional* A means to provide context to assist the speech recognition.
-   * 
- * - * .google.cloud.speech.v1beta1.SpeechContext speech_context = 6; - */ - public com.google.cloud.speech.v1beta1.SpeechContextOrBuilder getSpeechContextOrBuilder() { - return getSpeechContext(); - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (encoding_ - != com.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding.ENCODING_UNSPECIFIED - .getNumber()) { - output.writeEnum(1, encoding_); - } - if (sampleRate_ != 0) { - output.writeInt32(2, sampleRate_); - } - if (!getLanguageCodeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languageCode_); - } - if (maxAlternatives_ != 0) { - output.writeInt32(4, maxAlternatives_); - } - if (profanityFilter_ != false) { - output.writeBool(5, profanityFilter_); - } - if (speechContext_ != null) { - output.writeMessage(6, getSpeechContext()); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (encoding_ - != com.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding.ENCODING_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, encoding_); - } - if (sampleRate_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, sampleRate_); - } - if (!getLanguageCodeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, languageCode_); - } - if (maxAlternatives_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, maxAlternatives_); - } - if (profanityFilter_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, profanityFilter_); - } - if (speechContext_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getSpeechContext()); - } - size += unknownFields.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.v1beta1.RecognitionConfig)) { - return super.equals(obj); - } - com.google.cloud.speech.v1beta1.RecognitionConfig other = - (com.google.cloud.speech.v1beta1.RecognitionConfig) obj; - - boolean result = true; - result = result && encoding_ == other.encoding_; - result = result && (getSampleRate() == other.getSampleRate()); - result = result && getLanguageCode().equals(other.getLanguageCode()); - result = result && (getMaxAlternatives() == other.getMaxAlternatives()); - result = result && (getProfanityFilter() == other.getProfanityFilter()); - result = result && (hasSpeechContext() == other.hasSpeechContext()); - if (hasSpeechContext()) { - result = result && getSpeechContext().equals(other.getSpeechContext()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ENCODING_FIELD_NUMBER; - hash = (53 * hash) + encoding_; - hash = (37 * hash) + SAMPLE_RATE_FIELD_NUMBER; - hash = (53 * hash) + getSampleRate(); - hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; - hash = (53 * hash) + getLanguageCode().hashCode(); - hash = (37 * hash) + MAX_ALTERNATIVES_FIELD_NUMBER; - hash = (53 * hash) + getMaxAlternatives(); - hash = (37 * hash) + PROFANITY_FILTER_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getProfanityFilter()); - if (hasSpeechContext()) { - hash = (37 * hash) + SPEECH_CONTEXT_FIELD_NUMBER; - hash = (53 * hash) + getSpeechContext().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1beta1.RecognitionConfig parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.RecognitionConfig 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.v1beta1.RecognitionConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.RecognitionConfig 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.v1beta1.RecognitionConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.RecognitionConfig parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.speech.v1beta1.RecognitionConfig parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.RecognitionConfig 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.v1beta1.RecognitionConfig parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.RecognitionConfig 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.v1beta1.RecognitionConfig parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.RecognitionConfig parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.cloud.speech.v1beta1.RecognitionConfig prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - 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; - } - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.RecognitionConfig} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1beta1.RecognitionConfig) - com.google.cloud.speech.v1beta1.RecognitionConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_RecognitionConfig_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_RecognitionConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.RecognitionConfig.class, - com.google.cloud.speech.v1beta1.RecognitionConfig.Builder.class); - } - - // Construct using com.google.cloud.speech.v1beta1.RecognitionConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - public Builder clear() { - super.clear(); - encoding_ = 0; - - sampleRate_ = 0; - - languageCode_ = ""; - - maxAlternatives_ = 0; - - profanityFilter_ = false; - - if (speechContextBuilder_ == null) { - speechContext_ = null; - } else { - speechContext_ = null; - speechContextBuilder_ = null; - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_RecognitionConfig_descriptor; - } - - public com.google.cloud.speech.v1beta1.RecognitionConfig getDefaultInstanceForType() { - return com.google.cloud.speech.v1beta1.RecognitionConfig.getDefaultInstance(); - } - - public com.google.cloud.speech.v1beta1.RecognitionConfig build() { - com.google.cloud.speech.v1beta1.RecognitionConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.cloud.speech.v1beta1.RecognitionConfig buildPartial() { - com.google.cloud.speech.v1beta1.RecognitionConfig result = - new com.google.cloud.speech.v1beta1.RecognitionConfig(this); - result.encoding_ = encoding_; - result.sampleRate_ = sampleRate_; - result.languageCode_ = languageCode_; - result.maxAlternatives_ = maxAlternatives_; - result.profanityFilter_ = profanityFilter_; - if (speechContextBuilder_ == null) { - result.speechContext_ = speechContext_; - } else { - result.speechContext_ = speechContextBuilder_.build(); - } - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1beta1.RecognitionConfig) { - return mergeFrom((com.google.cloud.speech.v1beta1.RecognitionConfig) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1beta1.RecognitionConfig other) { - if (other == com.google.cloud.speech.v1beta1.RecognitionConfig.getDefaultInstance()) - return this; - if (other.encoding_ != 0) { - setEncodingValue(other.getEncodingValue()); - } - if (other.getSampleRate() != 0) { - setSampleRate(other.getSampleRate()); - } - if (!other.getLanguageCode().isEmpty()) { - languageCode_ = other.languageCode_; - onChanged(); - } - if (other.getMaxAlternatives() != 0) { - setMaxAlternatives(other.getMaxAlternatives()); - } - if (other.getProfanityFilter() != false) { - setProfanityFilter(other.getProfanityFilter()); - } - if (other.hasSpeechContext()) { - mergeSpeechContext(other.getSpeechContext()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1beta1.RecognitionConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1beta1.RecognitionConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int encoding_ = 0; - /** - * - * - *
-     * *Required* Encoding of audio data sent in all `RecognitionAudio` messages.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1; - */ - public int getEncodingValue() { - return encoding_; - } - /** - * - * - *
-     * *Required* Encoding of audio data sent in all `RecognitionAudio` messages.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1; - */ - public Builder setEncodingValue(int value) { - encoding_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * *Required* Encoding of audio data sent in all `RecognitionAudio` messages.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1; - */ - public com.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding getEncoding() { - com.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding result = - com.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding.valueOf(encoding_); - return result == null - ? com.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding.UNRECOGNIZED - : result; - } - /** - * - * - *
-     * *Required* Encoding of audio data sent in all `RecognitionAudio` messages.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1; - */ - public Builder setEncoding( - com.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding value) { - if (value == null) { - throw new NullPointerException(); - } - - encoding_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * *Required* Encoding of audio data sent in all `RecognitionAudio` messages.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1; - */ - public Builder clearEncoding() { - - encoding_ = 0; - onChanged(); - return this; - } - - private int sampleRate_; - /** - * - * - *
-     * *Required* Sample rate in Hertz of the audio data sent in all
-     * `RecognitionAudio` messages. Valid values are: 8000-48000.
-     * 16000 is optimal. For best results, set the sampling rate of the audio
-     * source to 16000 Hz. If that's not possible, use the native sample rate of
-     * the audio source (instead of re-sampling).
-     * 
- * - * int32 sample_rate = 2; - */ - public int getSampleRate() { - return sampleRate_; - } - /** - * - * - *
-     * *Required* Sample rate in Hertz of the audio data sent in all
-     * `RecognitionAudio` messages. Valid values are: 8000-48000.
-     * 16000 is optimal. For best results, set the sampling rate of the audio
-     * source to 16000 Hz. If that's not possible, use the native sample rate of
-     * the audio source (instead of re-sampling).
-     * 
- * - * int32 sample_rate = 2; - */ - public Builder setSampleRate(int value) { - - sampleRate_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * *Required* Sample rate in Hertz of the audio data sent in all
-     * `RecognitionAudio` messages. Valid values are: 8000-48000.
-     * 16000 is optimal. For best results, set the sampling rate of the audio
-     * source to 16000 Hz. If that's not possible, use the native sample rate of
-     * the audio source (instead of re-sampling).
-     * 
- * - * int32 sample_rate = 2; - */ - public Builder clearSampleRate() { - - sampleRate_ = 0; - onChanged(); - return this; - } - - private java.lang.Object languageCode_ = ""; - /** - * - * - *
-     * *Optional* The language of the supplied audio as a BCP-47 language tag.
-     * Example: "en-GB"  https://www.rfc-editor.org/rfc/bcp/bcp47.txt
-     * If omitted, defaults to "en-US". See
-     * [Language Support](https://cloud.google.com/speech/docs/languages)
-     * for a list of the currently supported language codes.
-     * 
- * - * string language_code = 3; - */ - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - languageCode_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * *Optional* The language of the supplied audio as a BCP-47 language tag.
-     * Example: "en-GB"  https://www.rfc-editor.org/rfc/bcp/bcp47.txt
-     * If omitted, defaults to "en-US". See
-     * [Language Support](https://cloud.google.com/speech/docs/languages)
-     * for a list of the currently supported language codes.
-     * 
- * - * string language_code = 3; - */ - public com.google.protobuf.ByteString getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * *Optional* The language of the supplied audio as a BCP-47 language tag.
-     * Example: "en-GB"  https://www.rfc-editor.org/rfc/bcp/bcp47.txt
-     * If omitted, defaults to "en-US". See
-     * [Language Support](https://cloud.google.com/speech/docs/languages)
-     * for a list of the currently supported language codes.
-     * 
- * - * string language_code = 3; - */ - public Builder setLanguageCode(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - languageCode_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * *Optional* The language of the supplied audio as a BCP-47 language tag.
-     * Example: "en-GB"  https://www.rfc-editor.org/rfc/bcp/bcp47.txt
-     * If omitted, defaults to "en-US". See
-     * [Language Support](https://cloud.google.com/speech/docs/languages)
-     * for a list of the currently supported language codes.
-     * 
- * - * string language_code = 3; - */ - public Builder clearLanguageCode() { - - languageCode_ = getDefaultInstance().getLanguageCode(); - onChanged(); - return this; - } - /** - * - * - *
-     * *Optional* The language of the supplied audio as a BCP-47 language tag.
-     * Example: "en-GB"  https://www.rfc-editor.org/rfc/bcp/bcp47.txt
-     * If omitted, defaults to "en-US". See
-     * [Language Support](https://cloud.google.com/speech/docs/languages)
-     * for a list of the currently supported language codes.
-     * 
- * - * string language_code = 3; - */ - public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - languageCode_ = value; - onChanged(); - return this; - } - - private int maxAlternatives_; - /** - * - * - *
-     * *Optional* Maximum number of recognition hypotheses to be returned.
-     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-     * within each `SpeechRecognitionResult`.
-     * The server may return fewer than `max_alternatives`.
-     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-     * one. If omitted, will return a maximum of one.
-     * 
- * - * int32 max_alternatives = 4; - */ - public int getMaxAlternatives() { - return maxAlternatives_; - } - /** - * - * - *
-     * *Optional* Maximum number of recognition hypotheses to be returned.
-     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-     * within each `SpeechRecognitionResult`.
-     * The server may return fewer than `max_alternatives`.
-     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-     * one. If omitted, will return a maximum of one.
-     * 
- * - * int32 max_alternatives = 4; - */ - public Builder setMaxAlternatives(int value) { - - maxAlternatives_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * *Optional* Maximum number of recognition hypotheses to be returned.
-     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-     * within each `SpeechRecognitionResult`.
-     * The server may return fewer than `max_alternatives`.
-     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-     * one. If omitted, will return a maximum of one.
-     * 
- * - * int32 max_alternatives = 4; - */ - public Builder clearMaxAlternatives() { - - maxAlternatives_ = 0; - onChanged(); - return this; - } - - private boolean profanityFilter_; - /** - * - * - *
-     * *Optional* If set to `true`, the server will attempt to filter out
-     * profanities, replacing all but the initial character in each filtered word
-     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-     * won't be filtered out.
-     * 
- * - * bool profanity_filter = 5; - */ - public boolean getProfanityFilter() { - return profanityFilter_; - } - /** - * - * - *
-     * *Optional* If set to `true`, the server will attempt to filter out
-     * profanities, replacing all but the initial character in each filtered word
-     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-     * won't be filtered out.
-     * 
- * - * bool profanity_filter = 5; - */ - public Builder setProfanityFilter(boolean value) { - - profanityFilter_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * *Optional* If set to `true`, the server will attempt to filter out
-     * profanities, replacing all but the initial character in each filtered word
-     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-     * won't be filtered out.
-     * 
- * - * bool profanity_filter = 5; - */ - public Builder clearProfanityFilter() { - - profanityFilter_ = false; - onChanged(); - return this; - } - - private com.google.cloud.speech.v1beta1.SpeechContext speechContext_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.SpeechContext, - com.google.cloud.speech.v1beta1.SpeechContext.Builder, - com.google.cloud.speech.v1beta1.SpeechContextOrBuilder> - speechContextBuilder_; - /** - * - * - *
-     * *Optional* A means to provide context to assist the speech recognition.
-     * 
- * - * .google.cloud.speech.v1beta1.SpeechContext speech_context = 6; - */ - public boolean hasSpeechContext() { - return speechContextBuilder_ != null || speechContext_ != null; - } - /** - * - * - *
-     * *Optional* A means to provide context to assist the speech recognition.
-     * 
- * - * .google.cloud.speech.v1beta1.SpeechContext speech_context = 6; - */ - public com.google.cloud.speech.v1beta1.SpeechContext getSpeechContext() { - if (speechContextBuilder_ == null) { - return speechContext_ == null - ? com.google.cloud.speech.v1beta1.SpeechContext.getDefaultInstance() - : speechContext_; - } else { - return speechContextBuilder_.getMessage(); - } - } - /** - * - * - *
-     * *Optional* A means to provide context to assist the speech recognition.
-     * 
- * - * .google.cloud.speech.v1beta1.SpeechContext speech_context = 6; - */ - public Builder setSpeechContext(com.google.cloud.speech.v1beta1.SpeechContext value) { - if (speechContextBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - speechContext_ = value; - onChanged(); - } else { - speechContextBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * *Optional* A means to provide context to assist the speech recognition.
-     * 
- * - * .google.cloud.speech.v1beta1.SpeechContext speech_context = 6; - */ - public Builder setSpeechContext( - com.google.cloud.speech.v1beta1.SpeechContext.Builder builderForValue) { - if (speechContextBuilder_ == null) { - speechContext_ = builderForValue.build(); - onChanged(); - } else { - speechContextBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * *Optional* A means to provide context to assist the speech recognition.
-     * 
- * - * .google.cloud.speech.v1beta1.SpeechContext speech_context = 6; - */ - public Builder mergeSpeechContext(com.google.cloud.speech.v1beta1.SpeechContext value) { - if (speechContextBuilder_ == null) { - if (speechContext_ != null) { - speechContext_ = - com.google.cloud.speech.v1beta1.SpeechContext.newBuilder(speechContext_) - .mergeFrom(value) - .buildPartial(); - } else { - speechContext_ = value; - } - onChanged(); - } else { - speechContextBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * *Optional* A means to provide context to assist the speech recognition.
-     * 
- * - * .google.cloud.speech.v1beta1.SpeechContext speech_context = 6; - */ - public Builder clearSpeechContext() { - if (speechContextBuilder_ == null) { - speechContext_ = null; - onChanged(); - } else { - speechContext_ = null; - speechContextBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * *Optional* A means to provide context to assist the speech recognition.
-     * 
- * - * .google.cloud.speech.v1beta1.SpeechContext speech_context = 6; - */ - public com.google.cloud.speech.v1beta1.SpeechContext.Builder getSpeechContextBuilder() { - - onChanged(); - return getSpeechContextFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * *Optional* A means to provide context to assist the speech recognition.
-     * 
- * - * .google.cloud.speech.v1beta1.SpeechContext speech_context = 6; - */ - public com.google.cloud.speech.v1beta1.SpeechContextOrBuilder getSpeechContextOrBuilder() { - if (speechContextBuilder_ != null) { - return speechContextBuilder_.getMessageOrBuilder(); - } else { - return speechContext_ == null - ? com.google.cloud.speech.v1beta1.SpeechContext.getDefaultInstance() - : speechContext_; - } - } - /** - * - * - *
-     * *Optional* A means to provide context to assist the speech recognition.
-     * 
- * - * .google.cloud.speech.v1beta1.SpeechContext speech_context = 6; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.SpeechContext, - com.google.cloud.speech.v1beta1.SpeechContext.Builder, - com.google.cloud.speech.v1beta1.SpeechContextOrBuilder> - getSpeechContextFieldBuilder() { - if (speechContextBuilder_ == null) { - speechContextBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.SpeechContext, - com.google.cloud.speech.v1beta1.SpeechContext.Builder, - com.google.cloud.speech.v1beta1.SpeechContextOrBuilder>( - getSpeechContext(), getParentForChildren(), isClean()); - speechContext_ = null; - } - return speechContextBuilder_; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1beta1.RecognitionConfig) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1beta1.RecognitionConfig) - private static final com.google.cloud.speech.v1beta1.RecognitionConfig DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1beta1.RecognitionConfig(); - } - - public static com.google.cloud.speech.v1beta1.RecognitionConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public RecognitionConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognitionConfig(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.cloud.speech.v1beta1.RecognitionConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/RecognitionConfigOrBuilder.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/RecognitionConfigOrBuilder.java deleted file mode 100644 index c0996b92f..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/RecognitionConfigOrBuilder.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -public interface RecognitionConfigOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1beta1.RecognitionConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * *Required* Encoding of audio data sent in all `RecognitionAudio` messages.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1; - */ - int getEncodingValue(); - /** - * - * - *
-   * *Required* Encoding of audio data sent in all `RecognitionAudio` messages.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1; - */ - com.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding getEncoding(); - - /** - * - * - *
-   * *Required* Sample rate in Hertz of the audio data sent in all
-   * `RecognitionAudio` messages. Valid values are: 8000-48000.
-   * 16000 is optimal. For best results, set the sampling rate of the audio
-   * source to 16000 Hz. If that's not possible, use the native sample rate of
-   * the audio source (instead of re-sampling).
-   * 
- * - * int32 sample_rate = 2; - */ - int getSampleRate(); - - /** - * - * - *
-   * *Optional* The language of the supplied audio as a BCP-47 language tag.
-   * Example: "en-GB"  https://www.rfc-editor.org/rfc/bcp/bcp47.txt
-   * If omitted, defaults to "en-US". See
-   * [Language Support](https://cloud.google.com/speech/docs/languages)
-   * for a list of the currently supported language codes.
-   * 
- * - * string language_code = 3; - */ - java.lang.String getLanguageCode(); - /** - * - * - *
-   * *Optional* The language of the supplied audio as a BCP-47 language tag.
-   * Example: "en-GB"  https://www.rfc-editor.org/rfc/bcp/bcp47.txt
-   * If omitted, defaults to "en-US". See
-   * [Language Support](https://cloud.google.com/speech/docs/languages)
-   * for a list of the currently supported language codes.
-   * 
- * - * string language_code = 3; - */ - com.google.protobuf.ByteString getLanguageCodeBytes(); - - /** - * - * - *
-   * *Optional* Maximum number of recognition hypotheses to be returned.
-   * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-   * within each `SpeechRecognitionResult`.
-   * The server may return fewer than `max_alternatives`.
-   * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-   * one. If omitted, will return a maximum of one.
-   * 
- * - * int32 max_alternatives = 4; - */ - int getMaxAlternatives(); - - /** - * - * - *
-   * *Optional* If set to `true`, the server will attempt to filter out
-   * profanities, replacing all but the initial character in each filtered word
-   * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-   * won't be filtered out.
-   * 
- * - * bool profanity_filter = 5; - */ - boolean getProfanityFilter(); - - /** - * - * - *
-   * *Optional* A means to provide context to assist the speech recognition.
-   * 
- * - * .google.cloud.speech.v1beta1.SpeechContext speech_context = 6; - */ - boolean hasSpeechContext(); - /** - * - * - *
-   * *Optional* A means to provide context to assist the speech recognition.
-   * 
- * - * .google.cloud.speech.v1beta1.SpeechContext speech_context = 6; - */ - com.google.cloud.speech.v1beta1.SpeechContext getSpeechContext(); - /** - * - * - *
-   * *Optional* A means to provide context to assist the speech recognition.
-   * 
- * - * .google.cloud.speech.v1beta1.SpeechContext speech_context = 6; - */ - com.google.cloud.speech.v1beta1.SpeechContextOrBuilder getSpeechContextOrBuilder(); -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechContext.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechContext.java deleted file mode 100644 index b91a93a05..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechContext.java +++ /dev/null @@ -1,737 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -/** - * - * - *
- * Provides "hints" to the speech recognizer to favor specific words and phrases
- * in the results.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.SpeechContext} - */ -public final class SpeechContext extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1beta1.SpeechContext) - SpeechContextOrBuilder { - private static final long serialVersionUID = 0L; - // Use SpeechContext.newBuilder() to construct. - private SpeechContext(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SpeechContext() { - phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private SpeechContext( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - phrases_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - phrases_.add(s); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - phrases_ = phrases_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SpeechContext_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SpeechContext_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.SpeechContext.class, - com.google.cloud.speech.v1beta1.SpeechContext.Builder.class); - } - - public static final int PHRASES_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList phrases_; - /** - * - * - *
-   * *Optional* A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech/limits#content).
-   * 
- * - * repeated string phrases = 1; - */ - public com.google.protobuf.ProtocolStringList getPhrasesList() { - return phrases_; - } - /** - * - * - *
-   * *Optional* A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech/limits#content).
-   * 
- * - * repeated string phrases = 1; - */ - public int getPhrasesCount() { - return phrases_.size(); - } - /** - * - * - *
-   * *Optional* A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech/limits#content).
-   * 
- * - * repeated string phrases = 1; - */ - public java.lang.String getPhrases(int index) { - return phrases_.get(index); - } - /** - * - * - *
-   * *Optional* A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech/limits#content).
-   * 
- * - * repeated string phrases = 1; - */ - public com.google.protobuf.ByteString getPhrasesBytes(int index) { - return phrases_.getByteString(index); - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < phrases_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, phrases_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < phrases_.size(); i++) { - dataSize += computeStringSizeNoTag(phrases_.getRaw(i)); - } - size += dataSize; - size += 1 * getPhrasesList().size(); - } - size += unknownFields.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.v1beta1.SpeechContext)) { - return super.equals(obj); - } - com.google.cloud.speech.v1beta1.SpeechContext other = - (com.google.cloud.speech.v1beta1.SpeechContext) obj; - - boolean result = true; - result = result && getPhrasesList().equals(other.getPhrasesList()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getPhrasesCount() > 0) { - hash = (37 * hash) + PHRASES_FIELD_NUMBER; - hash = (53 * hash) + getPhrasesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1beta1.SpeechContext parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.SpeechContext 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.v1beta1.SpeechContext parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.SpeechContext 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.v1beta1.SpeechContext parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.SpeechContext parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.speech.v1beta1.SpeechContext parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.SpeechContext 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.v1beta1.SpeechContext parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.SpeechContext 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.v1beta1.SpeechContext parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.SpeechContext parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.cloud.speech.v1beta1.SpeechContext prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - 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; - } - /** - * - * - *
-   * Provides "hints" to the speech recognizer to favor specific words and phrases
-   * in the results.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.SpeechContext} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1beta1.SpeechContext) - com.google.cloud.speech.v1beta1.SpeechContextOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SpeechContext_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SpeechContext_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.SpeechContext.class, - com.google.cloud.speech.v1beta1.SpeechContext.Builder.class); - } - - // Construct using com.google.cloud.speech.v1beta1.SpeechContext.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - public Builder clear() { - super.clear(); - phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SpeechContext_descriptor; - } - - public com.google.cloud.speech.v1beta1.SpeechContext getDefaultInstanceForType() { - return com.google.cloud.speech.v1beta1.SpeechContext.getDefaultInstance(); - } - - public com.google.cloud.speech.v1beta1.SpeechContext build() { - com.google.cloud.speech.v1beta1.SpeechContext result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.cloud.speech.v1beta1.SpeechContext buildPartial() { - com.google.cloud.speech.v1beta1.SpeechContext result = - new com.google.cloud.speech.v1beta1.SpeechContext(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - phrases_ = phrases_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.phrases_ = phrases_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1beta1.SpeechContext) { - return mergeFrom((com.google.cloud.speech.v1beta1.SpeechContext) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1beta1.SpeechContext other) { - if (other == com.google.cloud.speech.v1beta1.SpeechContext.getDefaultInstance()) return this; - if (!other.phrases_.isEmpty()) { - if (phrases_.isEmpty()) { - phrases_ = other.phrases_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePhrasesIsMutable(); - phrases_.addAll(other.phrases_); - } - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1beta1.SpeechContext parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1beta1.SpeechContext) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private com.google.protobuf.LazyStringList phrases_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensurePhrasesIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - phrases_ = new com.google.protobuf.LazyStringArrayList(phrases_); - bitField0_ |= 0x00000001; - } - } - /** - * - * - *
-     * *Optional* A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech/limits#content).
-     * 
- * - * repeated string phrases = 1; - */ - public com.google.protobuf.ProtocolStringList getPhrasesList() { - return phrases_.getUnmodifiableView(); - } - /** - * - * - *
-     * *Optional* A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech/limits#content).
-     * 
- * - * repeated string phrases = 1; - */ - public int getPhrasesCount() { - return phrases_.size(); - } - /** - * - * - *
-     * *Optional* A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech/limits#content).
-     * 
- * - * repeated string phrases = 1; - */ - public java.lang.String getPhrases(int index) { - return phrases_.get(index); - } - /** - * - * - *
-     * *Optional* A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech/limits#content).
-     * 
- * - * repeated string phrases = 1; - */ - public com.google.protobuf.ByteString getPhrasesBytes(int index) { - return phrases_.getByteString(index); - } - /** - * - * - *
-     * *Optional* A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech/limits#content).
-     * 
- * - * repeated string phrases = 1; - */ - public Builder setPhrases(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhrasesIsMutable(); - phrases_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-     * *Optional* A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech/limits#content).
-     * 
- * - * repeated string phrases = 1; - */ - public Builder addPhrases(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhrasesIsMutable(); - phrases_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-     * *Optional* A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech/limits#content).
-     * 
- * - * repeated string phrases = 1; - */ - public Builder addAllPhrases(java.lang.Iterable values) { - ensurePhrasesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, phrases_); - onChanged(); - return this; - } - /** - * - * - *
-     * *Optional* A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech/limits#content).
-     * 
- * - * repeated string phrases = 1; - */ - public Builder clearPhrases() { - phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * *Optional* A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech/limits#content).
-     * 
- * - * repeated string phrases = 1; - */ - public Builder addPhrasesBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensurePhrasesIsMutable(); - phrases_.add(value); - onChanged(); - return this; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1beta1.SpeechContext) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1beta1.SpeechContext) - private static final com.google.cloud.speech.v1beta1.SpeechContext DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1beta1.SpeechContext(); - } - - public static com.google.cloud.speech.v1beta1.SpeechContext getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public SpeechContext parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeechContext(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.cloud.speech.v1beta1.SpeechContext getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechContextOrBuilder.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechContextOrBuilder.java deleted file mode 100644 index c1f860a3a..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechContextOrBuilder.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -public interface SpeechContextOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1beta1.SpeechContext) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * *Optional* A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech/limits#content).
-   * 
- * - * repeated string phrases = 1; - */ - java.util.List getPhrasesList(); - /** - * - * - *
-   * *Optional* A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech/limits#content).
-   * 
- * - * repeated string phrases = 1; - */ - int getPhrasesCount(); - /** - * - * - *
-   * *Optional* A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech/limits#content).
-   * 
- * - * repeated string phrases = 1; - */ - java.lang.String getPhrases(int index); - /** - * - * - *
-   * *Optional* A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech/limits#content).
-   * 
- * - * repeated string phrases = 1; - */ - com.google.protobuf.ByteString getPhrasesBytes(int index); -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechProto.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechProto.java deleted file mode 100644 index b2ebc2326..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechProto.java +++ /dev/null @@ -1,319 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -public final class SpeechProto { - private SpeechProto() {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1beta1_SyncRecognizeRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1beta1_SyncRecognizeRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1beta1_AsyncRecognizeRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1beta1_AsyncRecognizeRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1beta1_StreamingRecognizeRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1beta1_StreamingRecognizeRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1beta1_StreamingRecognitionConfig_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1beta1_StreamingRecognitionConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1beta1_RecognitionConfig_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1beta1_RecognitionConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1beta1_SpeechContext_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1beta1_SpeechContext_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1beta1_RecognitionAudio_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1beta1_RecognitionAudio_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1beta1_SyncRecognizeResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1beta1_SyncRecognizeResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1beta1_AsyncRecognizeResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1beta1_AsyncRecognizeResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1beta1_AsyncRecognizeMetadata_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1beta1_AsyncRecognizeMetadata_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1beta1_StreamingRecognizeResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1beta1_StreamingRecognizeResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1beta1_StreamingRecognitionResult_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1beta1_StreamingRecognitionResult_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1beta1_SpeechRecognitionResult_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1beta1_SpeechRecognitionResult_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1beta1_SpeechRecognitionAlternative_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1beta1_SpeechRecognitionAlternative_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - - static { - java.lang.String[] descriptorData = { - "\n.google/cloud/speech/v1beta1/cloud_spee" - + "ch.proto\022\033google.cloud.speech.v1beta1\032\034g" - + "oogle/api/annotations.proto\032#google/long" - + "running/operations.proto\032\036google/protobu" - + "f/duration.proto\032\037google/protobuf/timest" - + "amp.proto\032\027google/rpc/status.proto\"\224\001\n\024S" - + "yncRecognizeRequest\022>\n\006config\030\001 \001(\0132..go" - + "ogle.cloud.speech.v1beta1.RecognitionCon" - + "fig\022<\n\005audio\030\002 \001(\0132-.google.cloud.speech" - + ".v1beta1.RecognitionAudio\"\225\001\n\025AsyncRecog" - + "nizeRequest\022>\n\006config\030\001 \001(\0132..google.clo" - + "ud.speech.v1beta1.RecognitionConfig\022<\n\005a" - + "udio\030\002 \001(\0132-.google.cloud.speech.v1beta1" - + ".RecognitionAudio\"\236\001\n\031StreamingRecognize" - + "Request\022S\n\020streaming_config\030\001 \001(\01327.goog" - + "le.cloud.speech.v1beta1.StreamingRecogni" - + "tionConfigH\000\022\027\n\raudio_content\030\002 \001(\014H\000B\023\n" - + "\021streaming_request\"\217\001\n\032StreamingRecognit" - + "ionConfig\022>\n\006config\030\001 \001(\0132..google.cloud" - + ".speech.v1beta1.RecognitionConfig\022\030\n\020sin" - + "gle_utterance\030\002 \001(\010\022\027\n\017interim_results\030\003" - + " \001(\010\"\352\002\n\021RecognitionConfig\022N\n\010encoding\030\001" - + " \001(\0162<.google.cloud.speech.v1beta1.Recog" - + "nitionConfig.AudioEncoding\022\023\n\013sample_rat" - + "e\030\002 \001(\005\022\025\n\rlanguage_code\030\003 \001(\t\022\030\n\020max_al" - + "ternatives\030\004 \001(\005\022\030\n\020profanity_filter\030\005 \001" - + "(\010\022B\n\016speech_context\030\006 \001(\0132*.google.clou" - + "d.speech.v1beta1.SpeechContext\"a\n\rAudioE" - + "ncoding\022\030\n\024ENCODING_UNSPECIFIED\020\000\022\014\n\010LIN" - + "EAR16\020\001\022\010\n\004FLAC\020\002\022\t\n\005MULAW\020\003\022\007\n\003AMR\020\004\022\n\n" - + "\006AMR_WB\020\005\" \n\rSpeechContext\022\017\n\007phrases\030\001 " - + "\003(\t\"D\n\020RecognitionAudio\022\021\n\007content\030\001 \001(\014" - + "H\000\022\r\n\003uri\030\002 \001(\tH\000B\016\n\014audio_source\"^\n\025Syn" - + "cRecognizeResponse\022E\n\007results\030\002 \003(\01324.go" - + "ogle.cloud.speech.v1beta1.SpeechRecognit" - + "ionResult\"_\n\026AsyncRecognizeResponse\022E\n\007r" - + "esults\030\002 \003(\01324.google.cloud.speech.v1bet" - + "a1.SpeechRecognitionResult\"\230\001\n\026AsyncReco" - + "gnizeMetadata\022\030\n\020progress_percent\030\001 \001(\005\022" - + ".\n\nstart_time\030\002 \001(\0132\032.google.protobuf.Ti" - + "mestamp\0224\n\020last_update_time\030\003 \001(\0132\032.goog" - + "le.protobuf.Timestamp\"\205\003\n\032StreamingRecog" - + "nizeResponse\022!\n\005error\030\001 \001(\0132\022.google.rpc" - + ".Status\022H\n\007results\030\002 \003(\01327.google.cloud." - + "speech.v1beta1.StreamingRecognitionResul" - + "t\022\024\n\014result_index\030\003 \001(\005\022_\n\017endpointer_ty" - + "pe\030\004 \001(\0162F.google.cloud.speech.v1beta1.S" - + "treamingRecognizeResponse.EndpointerType" - + "\"\202\001\n\016EndpointerType\022 \n\034ENDPOINTER_EVENT_" - + "UNSPECIFIED\020\000\022\023\n\017START_OF_SPEECH\020\001\022\021\n\rEN" - + "D_OF_SPEECH\020\002\022\020\n\014END_OF_AUDIO\020\003\022\024\n\020END_O" - + "F_UTTERANCE\020\004\"\222\001\n\032StreamingRecognitionRe" - + "sult\022O\n\014alternatives\030\001 \003(\01329.google.clou" - + "d.speech.v1beta1.SpeechRecognitionAltern" - + "ative\022\020\n\010is_final\030\002 \001(\010\022\021\n\tstability\030\003 \001" - + "(\002\"j\n\027SpeechRecognitionResult\022O\n\014alterna" - + "tives\030\001 \003(\01329.google.cloud.speech.v1beta" - + "1.SpeechRecognitionAlternative\"F\n\034Speech" - + "RecognitionAlternative\022\022\n\ntranscript\030\001 \001" - + "(\t\022\022\n\nconfidence\030\002 \001(\0022\310\003\n\006Speech\022\240\001\n\rSy" - + "ncRecognize\0221.google.cloud.speech.v1beta" - + "1.SyncRecognizeRequest\0322.google.cloud.sp" - + "eech.v1beta1.SyncRecognizeResponse\"(\202\323\344\223" - + "\002\"\"\035/v1beta1/speech:syncrecognize:\001*\022\216\001\n" - + "\016AsyncRecognize\0222.google.cloud.speech.v1" - + "beta1.AsyncRecognizeRequest\032\035.google.lon" - + "grunning.Operation\")\202\323\344\223\002#\"\036/v1beta1/spe" - + "ech:asyncrecognize:\001*\022\211\001\n\022StreamingRecog" - + "nize\0226.google.cloud.speech.v1beta1.Strea" - + "mingRecognizeRequest\0327.google.cloud.spee" - + "ch.v1beta1.StreamingRecognizeResponse(\0010" - + "\001Bs\n\037com.google.cloud.speech.v1beta1B\013Sp" - + "eechProtoP\001ZAgoogle.golang.org/genproto/" - + "googleapis/cloud/speech/v1beta1;speechb\006" - + "proto3" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - com.google.longrunning.OperationsProto.getDescriptor(), - com.google.protobuf.DurationProto.getDescriptor(), - com.google.protobuf.TimestampProto.getDescriptor(), - com.google.rpc.StatusProto.getDescriptor(), - }, - assigner); - internal_static_google_cloud_speech_v1beta1_SyncRecognizeRequest_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_cloud_speech_v1beta1_SyncRecognizeRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1beta1_SyncRecognizeRequest_descriptor, - new java.lang.String[] { - "Config", "Audio", - }); - internal_static_google_cloud_speech_v1beta1_AsyncRecognizeRequest_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_cloud_speech_v1beta1_AsyncRecognizeRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1beta1_AsyncRecognizeRequest_descriptor, - new java.lang.String[] { - "Config", "Audio", - }); - internal_static_google_cloud_speech_v1beta1_StreamingRecognizeRequest_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_google_cloud_speech_v1beta1_StreamingRecognizeRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1beta1_StreamingRecognizeRequest_descriptor, - new java.lang.String[] { - "StreamingConfig", "AudioContent", "StreamingRequest", - }); - internal_static_google_cloud_speech_v1beta1_StreamingRecognitionConfig_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_google_cloud_speech_v1beta1_StreamingRecognitionConfig_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1beta1_StreamingRecognitionConfig_descriptor, - new java.lang.String[] { - "Config", "SingleUtterance", "InterimResults", - }); - internal_static_google_cloud_speech_v1beta1_RecognitionConfig_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_google_cloud_speech_v1beta1_RecognitionConfig_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1beta1_RecognitionConfig_descriptor, - new java.lang.String[] { - "Encoding", - "SampleRate", - "LanguageCode", - "MaxAlternatives", - "ProfanityFilter", - "SpeechContext", - }); - internal_static_google_cloud_speech_v1beta1_SpeechContext_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_google_cloud_speech_v1beta1_SpeechContext_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1beta1_SpeechContext_descriptor, - new java.lang.String[] { - "Phrases", - }); - internal_static_google_cloud_speech_v1beta1_RecognitionAudio_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_google_cloud_speech_v1beta1_RecognitionAudio_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1beta1_RecognitionAudio_descriptor, - new java.lang.String[] { - "Content", "Uri", "AudioSource", - }); - internal_static_google_cloud_speech_v1beta1_SyncRecognizeResponse_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_google_cloud_speech_v1beta1_SyncRecognizeResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1beta1_SyncRecognizeResponse_descriptor, - new java.lang.String[] { - "Results", - }); - internal_static_google_cloud_speech_v1beta1_AsyncRecognizeResponse_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_google_cloud_speech_v1beta1_AsyncRecognizeResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1beta1_AsyncRecognizeResponse_descriptor, - new java.lang.String[] { - "Results", - }); - internal_static_google_cloud_speech_v1beta1_AsyncRecognizeMetadata_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_google_cloud_speech_v1beta1_AsyncRecognizeMetadata_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1beta1_AsyncRecognizeMetadata_descriptor, - new java.lang.String[] { - "ProgressPercent", "StartTime", "LastUpdateTime", - }); - internal_static_google_cloud_speech_v1beta1_StreamingRecognizeResponse_descriptor = - getDescriptor().getMessageTypes().get(10); - internal_static_google_cloud_speech_v1beta1_StreamingRecognizeResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1beta1_StreamingRecognizeResponse_descriptor, - new java.lang.String[] { - "Error", "Results", "ResultIndex", "EndpointerType", - }); - internal_static_google_cloud_speech_v1beta1_StreamingRecognitionResult_descriptor = - getDescriptor().getMessageTypes().get(11); - internal_static_google_cloud_speech_v1beta1_StreamingRecognitionResult_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1beta1_StreamingRecognitionResult_descriptor, - new java.lang.String[] { - "Alternatives", "IsFinal", "Stability", - }); - internal_static_google_cloud_speech_v1beta1_SpeechRecognitionResult_descriptor = - getDescriptor().getMessageTypes().get(12); - internal_static_google_cloud_speech_v1beta1_SpeechRecognitionResult_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1beta1_SpeechRecognitionResult_descriptor, - new java.lang.String[] { - "Alternatives", - }); - internal_static_google_cloud_speech_v1beta1_SpeechRecognitionAlternative_descriptor = - getDescriptor().getMessageTypes().get(13); - internal_static_google_cloud_speech_v1beta1_SpeechRecognitionAlternative_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1beta1_SpeechRecognitionAlternative_descriptor, - new java.lang.String[] { - "Transcript", "Confidence", - }); - com.google.protobuf.ExtensionRegistry registry = - com.google.protobuf.ExtensionRegistry.newInstance(); - registry.add(com.google.api.AnnotationsProto.http); - com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( - descriptor, registry); - com.google.api.AnnotationsProto.getDescriptor(); - com.google.longrunning.OperationsProto.getDescriptor(); - com.google.protobuf.DurationProto.getDescriptor(); - com.google.protobuf.TimestampProto.getDescriptor(); - com.google.rpc.StatusProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechRecognitionAlternative.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechRecognitionAlternative.java deleted file mode 100644 index 099a59907..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechRecognitionAlternative.java +++ /dev/null @@ -1,700 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -/** - * - * - *
- * Alternative hypotheses (a.k.a. n-best list).
- * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.SpeechRecognitionAlternative} - */ -public final class SpeechRecognitionAlternative extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1beta1.SpeechRecognitionAlternative) - SpeechRecognitionAlternativeOrBuilder { - private static final long serialVersionUID = 0L; - // Use SpeechRecognitionAlternative.newBuilder() to construct. - private SpeechRecognitionAlternative(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SpeechRecognitionAlternative() { - transcript_ = ""; - confidence_ = 0F; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private SpeechRecognitionAlternative( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - transcript_ = s; - break; - } - case 21: - { - confidence_ = input.readFloat(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SpeechRecognitionAlternative_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SpeechRecognitionAlternative_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.class, - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.Builder.class); - } - - public static final int TRANSCRIPT_FIELD_NUMBER = 1; - private volatile java.lang.Object transcript_; - /** - * - * - *
-   * *Output-only* Transcript text representing the words that the user spoke.
-   * 
- * - * string transcript = 1; - */ - public java.lang.String getTranscript() { - java.lang.Object ref = transcript_; - 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(); - transcript_ = s; - return s; - } - } - /** - * - * - *
-   * *Output-only* Transcript text representing the words that the user spoke.
-   * 
- * - * string transcript = 1; - */ - public com.google.protobuf.ByteString getTranscriptBytes() { - java.lang.Object ref = transcript_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - transcript_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONFIDENCE_FIELD_NUMBER = 2; - private float confidence_; - /** - * - * - *
-   * *Output-only* The confidence estimate between 0.0 and 1.0. A higher number
-   * indicates an estimated greater likelihood that the recognized words are
-   * correct. This field is typically provided only for the top hypothesis, and
-   * only for `is_final=true` results. Clients should not rely on the
-   * `confidence` field as it is not guaranteed to be accurate, or even set, in
-   * any of the results.
-   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-   * 
- * - * float confidence = 2; - */ - public float getConfidence() { - return confidence_; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getTranscriptBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, transcript_); - } - if (confidence_ != 0F) { - output.writeFloat(2, confidence_); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getTranscriptBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, transcript_); - } - if (confidence_ != 0F) { - size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, confidence_); - } - size += unknownFields.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.v1beta1.SpeechRecognitionAlternative)) { - return super.equals(obj); - } - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative other = - (com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative) obj; - - boolean result = true; - result = result && getTranscript().equals(other.getTranscript()); - result = - result - && (java.lang.Float.floatToIntBits(getConfidence()) - == java.lang.Float.floatToIntBits(other.getConfidence())); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + TRANSCRIPT_FIELD_NUMBER; - hash = (53 * hash) + getTranscript().hashCode(); - hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidence()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative 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.v1beta1.SpeechRecognitionAlternative parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative 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.v1beta1.SpeechRecognitionAlternative parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative 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.v1beta1.SpeechRecognitionAlternative parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative 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.v1beta1.SpeechRecognitionAlternative parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - 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; - } - /** - * - * - *
-   * Alternative hypotheses (a.k.a. n-best list).
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.SpeechRecognitionAlternative} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1beta1.SpeechRecognitionAlternative) - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternativeOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SpeechRecognitionAlternative_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SpeechRecognitionAlternative_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.class, - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.Builder.class); - } - - // Construct using com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - public Builder clear() { - super.clear(); - transcript_ = ""; - - confidence_ = 0F; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SpeechRecognitionAlternative_descriptor; - } - - public com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative - getDefaultInstanceForType() { - return com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.getDefaultInstance(); - } - - public com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative build() { - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative buildPartial() { - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative result = - new com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative(this); - result.transcript_ = transcript_; - result.confidence_ = confidence_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative) { - return mergeFrom((com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative other) { - if (other - == com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.getDefaultInstance()) - return this; - if (!other.getTranscript().isEmpty()) { - transcript_ = other.transcript_; - onChanged(); - } - if (other.getConfidence() != 0F) { - setConfidence(other.getConfidence()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object transcript_ = ""; - /** - * - * - *
-     * *Output-only* Transcript text representing the words that the user spoke.
-     * 
- * - * string transcript = 1; - */ - public java.lang.String getTranscript() { - java.lang.Object ref = transcript_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - transcript_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * *Output-only* Transcript text representing the words that the user spoke.
-     * 
- * - * string transcript = 1; - */ - public com.google.protobuf.ByteString getTranscriptBytes() { - java.lang.Object ref = transcript_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - transcript_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * *Output-only* Transcript text representing the words that the user spoke.
-     * 
- * - * string transcript = 1; - */ - public Builder setTranscript(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - transcript_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * *Output-only* Transcript text representing the words that the user spoke.
-     * 
- * - * string transcript = 1; - */ - public Builder clearTranscript() { - - transcript_ = getDefaultInstance().getTranscript(); - onChanged(); - return this; - } - /** - * - * - *
-     * *Output-only* Transcript text representing the words that the user spoke.
-     * 
- * - * string transcript = 1; - */ - public Builder setTranscriptBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - transcript_ = value; - onChanged(); - return this; - } - - private float confidence_; - /** - * - * - *
-     * *Output-only* The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is typically provided only for the top hypothesis, and
-     * only for `is_final=true` results. Clients should not rely on the
-     * `confidence` field as it is not guaranteed to be accurate, or even set, in
-     * any of the results.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 2; - */ - public float getConfidence() { - return confidence_; - } - /** - * - * - *
-     * *Output-only* The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is typically provided only for the top hypothesis, and
-     * only for `is_final=true` results. Clients should not rely on the
-     * `confidence` field as it is not guaranteed to be accurate, or even set, in
-     * any of the results.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 2; - */ - public Builder setConfidence(float value) { - - confidence_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * *Output-only* The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is typically provided only for the top hypothesis, and
-     * only for `is_final=true` results. Clients should not rely on the
-     * `confidence` field as it is not guaranteed to be accurate, or even set, in
-     * any of the results.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 2; - */ - public Builder clearConfidence() { - - confidence_ = 0F; - onChanged(); - return this; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1beta1.SpeechRecognitionAlternative) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1beta1.SpeechRecognitionAlternative) - private static final com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative(); - } - - public static com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public SpeechRecognitionAlternative parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeechRecognitionAlternative(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechRecognitionAlternativeOrBuilder.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechRecognitionAlternativeOrBuilder.java deleted file mode 100644 index 69303ffcb..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechRecognitionAlternativeOrBuilder.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -public interface SpeechRecognitionAlternativeOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1beta1.SpeechRecognitionAlternative) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * *Output-only* Transcript text representing the words that the user spoke.
-   * 
- * - * string transcript = 1; - */ - java.lang.String getTranscript(); - /** - * - * - *
-   * *Output-only* Transcript text representing the words that the user spoke.
-   * 
- * - * string transcript = 1; - */ - com.google.protobuf.ByteString getTranscriptBytes(); - - /** - * - * - *
-   * *Output-only* The confidence estimate between 0.0 and 1.0. A higher number
-   * indicates an estimated greater likelihood that the recognized words are
-   * correct. This field is typically provided only for the top hypothesis, and
-   * only for `is_final=true` results. Clients should not rely on the
-   * `confidence` field as it is not guaranteed to be accurate, or even set, in
-   * any of the results.
-   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-   * 
- * - * float confidence = 2; - */ - float getConfidence(); -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechRecognitionResult.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechRecognitionResult.java deleted file mode 100644 index ebc1e51d8..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechRecognitionResult.java +++ /dev/null @@ -1,989 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -/** - * - * - *
- * A speech recognition result corresponding to a portion of the audio.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.SpeechRecognitionResult} - */ -public final class SpeechRecognitionResult extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1beta1.SpeechRecognitionResult) - SpeechRecognitionResultOrBuilder { - private static final long serialVersionUID = 0L; - // Use SpeechRecognitionResult.newBuilder() to construct. - private SpeechRecognitionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SpeechRecognitionResult() { - alternatives_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private SpeechRecognitionResult( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - alternatives_ = - new java.util.ArrayList< - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative>(); - mutable_bitField0_ |= 0x00000001; - } - alternatives_.add( - input.readMessage( - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.parser(), - extensionRegistry)); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - alternatives_ = java.util.Collections.unmodifiableList(alternatives_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SpeechRecognitionResult_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SpeechRecognitionResult_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.SpeechRecognitionResult.class, - com.google.cloud.speech.v1beta1.SpeechRecognitionResult.Builder.class); - } - - public static final int ALTERNATIVES_FIELD_NUMBER = 1; - private java.util.List - alternatives_; - /** - * - * - *
-   * *Output-only* May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public java.util.List - getAlternativesList() { - return alternatives_; - } - /** - * - * - *
-   * *Output-only* May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public java.util.List< - ? extends com.google.cloud.speech.v1beta1.SpeechRecognitionAlternativeOrBuilder> - getAlternativesOrBuilderList() { - return alternatives_; - } - /** - * - * - *
-   * *Output-only* May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public int getAlternativesCount() { - return alternatives_.size(); - } - /** - * - * - *
-   * *Output-only* May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative getAlternatives(int index) { - return alternatives_.get(index); - } - /** - * - * - *
-   * *Output-only* May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionAlternativeOrBuilder - getAlternativesOrBuilder(int index) { - return alternatives_.get(index); - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < alternatives_.size(); i++) { - output.writeMessage(1, alternatives_.get(i)); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < alternatives_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, alternatives_.get(i)); - } - size += unknownFields.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.v1beta1.SpeechRecognitionResult)) { - return super.equals(obj); - } - com.google.cloud.speech.v1beta1.SpeechRecognitionResult other = - (com.google.cloud.speech.v1beta1.SpeechRecognitionResult) obj; - - boolean result = true; - result = result && getAlternativesList().equals(other.getAlternativesList()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getAlternativesCount() > 0) { - hash = (37 * hash) + ALTERNATIVES_FIELD_NUMBER; - hash = (53 * hash) + getAlternativesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1beta1.SpeechRecognitionResult parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.SpeechRecognitionResult 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.v1beta1.SpeechRecognitionResult parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.SpeechRecognitionResult 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.v1beta1.SpeechRecognitionResult parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.SpeechRecognitionResult parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.speech.v1beta1.SpeechRecognitionResult parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.SpeechRecognitionResult 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.v1beta1.SpeechRecognitionResult parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.SpeechRecognitionResult 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.v1beta1.SpeechRecognitionResult parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.SpeechRecognitionResult parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.speech.v1beta1.SpeechRecognitionResult prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - 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; - } - /** - * - * - *
-   * A speech recognition result corresponding to a portion of the audio.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.SpeechRecognitionResult} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1beta1.SpeechRecognitionResult) - com.google.cloud.speech.v1beta1.SpeechRecognitionResultOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SpeechRecognitionResult_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SpeechRecognitionResult_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.SpeechRecognitionResult.class, - com.google.cloud.speech.v1beta1.SpeechRecognitionResult.Builder.class); - } - - // Construct using com.google.cloud.speech.v1beta1.SpeechRecognitionResult.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getAlternativesFieldBuilder(); - } - } - - public Builder clear() { - super.clear(); - if (alternativesBuilder_ == null) { - alternatives_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - alternativesBuilder_.clear(); - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SpeechRecognitionResult_descriptor; - } - - public com.google.cloud.speech.v1beta1.SpeechRecognitionResult getDefaultInstanceForType() { - return com.google.cloud.speech.v1beta1.SpeechRecognitionResult.getDefaultInstance(); - } - - public com.google.cloud.speech.v1beta1.SpeechRecognitionResult build() { - com.google.cloud.speech.v1beta1.SpeechRecognitionResult result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.cloud.speech.v1beta1.SpeechRecognitionResult buildPartial() { - com.google.cloud.speech.v1beta1.SpeechRecognitionResult result = - new com.google.cloud.speech.v1beta1.SpeechRecognitionResult(this); - int from_bitField0_ = bitField0_; - if (alternativesBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - alternatives_ = java.util.Collections.unmodifiableList(alternatives_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.alternatives_ = alternatives_; - } else { - result.alternatives_ = alternativesBuilder_.build(); - } - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1beta1.SpeechRecognitionResult) { - return mergeFrom((com.google.cloud.speech.v1beta1.SpeechRecognitionResult) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1beta1.SpeechRecognitionResult other) { - if (other == com.google.cloud.speech.v1beta1.SpeechRecognitionResult.getDefaultInstance()) - return this; - if (alternativesBuilder_ == null) { - if (!other.alternatives_.isEmpty()) { - if (alternatives_.isEmpty()) { - alternatives_ = other.alternatives_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAlternativesIsMutable(); - alternatives_.addAll(other.alternatives_); - } - onChanged(); - } - } else { - if (!other.alternatives_.isEmpty()) { - if (alternativesBuilder_.isEmpty()) { - alternativesBuilder_.dispose(); - alternativesBuilder_ = null; - alternatives_ = other.alternatives_; - bitField0_ = (bitField0_ & ~0x00000001); - alternativesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getAlternativesFieldBuilder() - : null; - } else { - alternativesBuilder_.addAllMessages(other.alternatives_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1beta1.SpeechRecognitionResult parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1beta1.SpeechRecognitionResult) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List - alternatives_ = java.util.Collections.emptyList(); - - private void ensureAlternativesIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - alternatives_ = - new java.util.ArrayList( - alternatives_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative, - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.Builder, - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternativeOrBuilder> - alternativesBuilder_; - - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public java.util.List - getAlternativesList() { - if (alternativesBuilder_ == null) { - return java.util.Collections.unmodifiableList(alternatives_); - } else { - return alternativesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public int getAlternativesCount() { - if (alternativesBuilder_ == null) { - return alternatives_.size(); - } else { - return alternativesBuilder_.getCount(); - } - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative getAlternatives(int index) { - if (alternativesBuilder_ == null) { - return alternatives_.get(index); - } else { - return alternativesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder setAlternatives( - int index, com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.set(index, value); - onChanged(); - } else { - alternativesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder setAlternatives( - int index, - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.set(index, builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder addAlternatives( - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.add(value); - onChanged(); - } else { - alternativesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder addAlternatives( - int index, com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.add(index, value); - onChanged(); - } else { - alternativesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder addAlternatives( - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.add(builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder addAlternatives( - int index, - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.add(index, builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder addAllAlternatives( - java.lang.Iterable - values) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, alternatives_); - onChanged(); - } else { - alternativesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder clearAlternatives() { - if (alternativesBuilder_ == null) { - alternatives_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - alternativesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder removeAlternatives(int index) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.remove(index); - onChanged(); - } else { - alternativesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.Builder - getAlternativesBuilder(int index) { - return getAlternativesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionAlternativeOrBuilder - getAlternativesOrBuilder(int index) { - if (alternativesBuilder_ == null) { - return alternatives_.get(index); - } else { - return alternativesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public java.util.List< - ? extends com.google.cloud.speech.v1beta1.SpeechRecognitionAlternativeOrBuilder> - getAlternativesOrBuilderList() { - if (alternativesBuilder_ != null) { - return alternativesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(alternatives_); - } - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.Builder - addAlternativesBuilder() { - return getAlternativesFieldBuilder() - .addBuilder( - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.getDefaultInstance()); - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.Builder - addAlternativesBuilder(int index) { - return getAlternativesFieldBuilder() - .addBuilder( - index, - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.getDefaultInstance()); - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public java.util.List - getAlternativesBuilderList() { - return getAlternativesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative, - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.Builder, - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternativeOrBuilder> - getAlternativesFieldBuilder() { - if (alternativesBuilder_ == null) { - alternativesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative, - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.Builder, - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternativeOrBuilder>( - alternatives_, - ((bitField0_ & 0x00000001) == 0x00000001), - getParentForChildren(), - isClean()); - alternatives_ = null; - } - return alternativesBuilder_; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1beta1.SpeechRecognitionResult) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1beta1.SpeechRecognitionResult) - private static final com.google.cloud.speech.v1beta1.SpeechRecognitionResult DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1beta1.SpeechRecognitionResult(); - } - - public static com.google.cloud.speech.v1beta1.SpeechRecognitionResult getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public SpeechRecognitionResult parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeechRecognitionResult(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.cloud.speech.v1beta1.SpeechRecognitionResult getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechRecognitionResultOrBuilder.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechRecognitionResultOrBuilder.java deleted file mode 100644 index 4373456e1..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SpeechRecognitionResultOrBuilder.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -public interface SpeechRecognitionResultOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1beta1.SpeechRecognitionResult) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * *Output-only* May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - java.util.List - getAlternativesList(); - /** - * - * - *
-   * *Output-only* May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative getAlternatives(int index); - /** - * - * - *
-   * *Output-only* May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - int getAlternativesCount(); - /** - * - * - *
-   * *Output-only* May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - java.util.List - getAlternativesOrBuilderList(); - /** - * - * - *
-   * *Output-only* May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( - int index); -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognitionConfig.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognitionConfig.java deleted file mode 100644 index 50b8b87ce..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognitionConfig.java +++ /dev/null @@ -1,915 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -/** - * - * - *
- * Provides information to the recognizer that specifies how to process the
- * request.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.StreamingRecognitionConfig} - */ -public final class StreamingRecognitionConfig extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1beta1.StreamingRecognitionConfig) - StreamingRecognitionConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use StreamingRecognitionConfig.newBuilder() to construct. - private StreamingRecognitionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private StreamingRecognitionConfig() { - singleUtterance_ = false; - interimResults_ = false; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private StreamingRecognitionConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - com.google.cloud.speech.v1beta1.RecognitionConfig.Builder subBuilder = null; - if (config_ != null) { - subBuilder = config_.toBuilder(); - } - config_ = - input.readMessage( - com.google.cloud.speech.v1beta1.RecognitionConfig.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(config_); - config_ = subBuilder.buildPartial(); - } - - break; - } - case 16: - { - singleUtterance_ = input.readBool(); - break; - } - case 24: - { - interimResults_ = input.readBool(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_StreamingRecognitionConfig_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_StreamingRecognitionConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.class, - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.Builder.class); - } - - public static final int CONFIG_FIELD_NUMBER = 1; - private com.google.cloud.speech.v1beta1.RecognitionConfig config_; - /** - * - * - *
-   * *Required* Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public boolean hasConfig() { - return config_ != null; - } - /** - * - * - *
-   * *Required* Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public com.google.cloud.speech.v1beta1.RecognitionConfig getConfig() { - return config_ == null - ? com.google.cloud.speech.v1beta1.RecognitionConfig.getDefaultInstance() - : config_; - } - /** - * - * - *
-   * *Required* Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public com.google.cloud.speech.v1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { - return getConfig(); - } - - public static final int SINGLE_UTTERANCE_FIELD_NUMBER = 2; - private boolean singleUtterance_; - /** - * - * - *
-   * *Optional* If `false` or omitted, the recognizer will perform continuous
-   * recognition (continuing to wait for and process audio even if the user
-   * pauses speaking) until the client closes the input stream (gRPC API) or
-   * until the maximum time limit has been reached. May return multiple
-   * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-   * If `true`, the recognizer will detect a single spoken utterance. When it
-   * detects that the user has paused or stopped speaking, it will return an
-   * `END_OF_UTTERANCE` event and cease recognition. It will return no more than
-   * one `StreamingRecognitionResult` with the `is_final` flag set to `true`.
-   * 
- * - * bool single_utterance = 2; - */ - public boolean getSingleUtterance() { - return singleUtterance_; - } - - public static final int INTERIM_RESULTS_FIELD_NUMBER = 3; - private boolean interimResults_; - /** - * - * - *
-   * *Optional* If `true`, interim results (tentative hypotheses) may be
-   * returned as they become available (these interim results are indicated with
-   * the `is_final=false` flag).
-   * If `false` or omitted, only `is_final=true` result(s) are returned.
-   * 
- * - * bool interim_results = 3; - */ - public boolean getInterimResults() { - return interimResults_; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (config_ != null) { - output.writeMessage(1, getConfig()); - } - if (singleUtterance_ != false) { - output.writeBool(2, singleUtterance_); - } - if (interimResults_ != false) { - output.writeBool(3, interimResults_); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (config_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getConfig()); - } - if (singleUtterance_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, singleUtterance_); - } - if (interimResults_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, interimResults_); - } - size += unknownFields.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.v1beta1.StreamingRecognitionConfig)) { - return super.equals(obj); - } - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig other = - (com.google.cloud.speech.v1beta1.StreamingRecognitionConfig) obj; - - boolean result = true; - result = result && (hasConfig() == other.hasConfig()); - if (hasConfig()) { - result = result && getConfig().equals(other.getConfig()); - } - result = result && (getSingleUtterance() == other.getSingleUtterance()); - result = result && (getInterimResults() == other.getInterimResults()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConfig()) { - hash = (37 * hash) + CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getConfig().hashCode(); - } - hash = (37 * hash) + SINGLE_UTTERANCE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSingleUtterance()); - hash = (37 * hash) + INTERIM_RESULTS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getInterimResults()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognitionConfig parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognitionConfig 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.v1beta1.StreamingRecognitionConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognitionConfig 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.v1beta1.StreamingRecognitionConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognitionConfig parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognitionConfig parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognitionConfig 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.v1beta1.StreamingRecognitionConfig parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognitionConfig 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.v1beta1.StreamingRecognitionConfig parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognitionConfig parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - 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; - } - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.StreamingRecognitionConfig} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1beta1.StreamingRecognitionConfig) - com.google.cloud.speech.v1beta1.StreamingRecognitionConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_StreamingRecognitionConfig_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_StreamingRecognitionConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.class, - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.Builder.class); - } - - // Construct using com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - public Builder clear() { - super.clear(); - if (configBuilder_ == null) { - config_ = null; - } else { - config_ = null; - configBuilder_ = null; - } - singleUtterance_ = false; - - interimResults_ = false; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_StreamingRecognitionConfig_descriptor; - } - - public com.google.cloud.speech.v1beta1.StreamingRecognitionConfig getDefaultInstanceForType() { - return com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } - - public com.google.cloud.speech.v1beta1.StreamingRecognitionConfig build() { - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.cloud.speech.v1beta1.StreamingRecognitionConfig buildPartial() { - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig result = - new com.google.cloud.speech.v1beta1.StreamingRecognitionConfig(this); - if (configBuilder_ == null) { - result.config_ = config_; - } else { - result.config_ = configBuilder_.build(); - } - result.singleUtterance_ = singleUtterance_; - result.interimResults_ = interimResults_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1beta1.StreamingRecognitionConfig) { - return mergeFrom((com.google.cloud.speech.v1beta1.StreamingRecognitionConfig) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1beta1.StreamingRecognitionConfig other) { - if (other == com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.getDefaultInstance()) - return this; - if (other.hasConfig()) { - mergeConfig(other.getConfig()); - } - if (other.getSingleUtterance() != false) { - setSingleUtterance(other.getSingleUtterance()); - } - if (other.getInterimResults() != false) { - setInterimResults(other.getInterimResults()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1beta1.StreamingRecognitionConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.speech.v1beta1.RecognitionConfig config_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.RecognitionConfig, - com.google.cloud.speech.v1beta1.RecognitionConfig.Builder, - com.google.cloud.speech.v1beta1.RecognitionConfigOrBuilder> - configBuilder_; - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public boolean hasConfig() { - return configBuilder_ != null || config_ != null; - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public com.google.cloud.speech.v1beta1.RecognitionConfig getConfig() { - if (configBuilder_ == null) { - return config_ == null - ? com.google.cloud.speech.v1beta1.RecognitionConfig.getDefaultInstance() - : config_; - } else { - return configBuilder_.getMessage(); - } - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public Builder setConfig(com.google.cloud.speech.v1beta1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - config_ = value; - onChanged(); - } else { - configBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public Builder setConfig( - com.google.cloud.speech.v1beta1.RecognitionConfig.Builder builderForValue) { - if (configBuilder_ == null) { - config_ = builderForValue.build(); - onChanged(); - } else { - configBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public Builder mergeConfig(com.google.cloud.speech.v1beta1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (config_ != null) { - config_ = - com.google.cloud.speech.v1beta1.RecognitionConfig.newBuilder(config_) - .mergeFrom(value) - .buildPartial(); - } else { - config_ = value; - } - onChanged(); - } else { - configBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public Builder clearConfig() { - if (configBuilder_ == null) { - config_ = null; - onChanged(); - } else { - config_ = null; - configBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public com.google.cloud.speech.v1beta1.RecognitionConfig.Builder getConfigBuilder() { - - onChanged(); - return getConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public com.google.cloud.speech.v1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { - if (configBuilder_ != null) { - return configBuilder_.getMessageOrBuilder(); - } else { - return config_ == null - ? com.google.cloud.speech.v1beta1.RecognitionConfig.getDefaultInstance() - : config_; - } - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.RecognitionConfig, - com.google.cloud.speech.v1beta1.RecognitionConfig.Builder, - com.google.cloud.speech.v1beta1.RecognitionConfigOrBuilder> - getConfigFieldBuilder() { - if (configBuilder_ == null) { - configBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.RecognitionConfig, - com.google.cloud.speech.v1beta1.RecognitionConfig.Builder, - com.google.cloud.speech.v1beta1.RecognitionConfigOrBuilder>( - getConfig(), getParentForChildren(), isClean()); - config_ = null; - } - return configBuilder_; - } - - private boolean singleUtterance_; - /** - * - * - *
-     * *Optional* If `false` or omitted, the recognizer will perform continuous
-     * recognition (continuing to wait for and process audio even if the user
-     * pauses speaking) until the client closes the input stream (gRPC API) or
-     * until the maximum time limit has been reached. May return multiple
-     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-     * If `true`, the recognizer will detect a single spoken utterance. When it
-     * detects that the user has paused or stopped speaking, it will return an
-     * `END_OF_UTTERANCE` event and cease recognition. It will return no more than
-     * one `StreamingRecognitionResult` with the `is_final` flag set to `true`.
-     * 
- * - * bool single_utterance = 2; - */ - public boolean getSingleUtterance() { - return singleUtterance_; - } - /** - * - * - *
-     * *Optional* If `false` or omitted, the recognizer will perform continuous
-     * recognition (continuing to wait for and process audio even if the user
-     * pauses speaking) until the client closes the input stream (gRPC API) or
-     * until the maximum time limit has been reached. May return multiple
-     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-     * If `true`, the recognizer will detect a single spoken utterance. When it
-     * detects that the user has paused or stopped speaking, it will return an
-     * `END_OF_UTTERANCE` event and cease recognition. It will return no more than
-     * one `StreamingRecognitionResult` with the `is_final` flag set to `true`.
-     * 
- * - * bool single_utterance = 2; - */ - public Builder setSingleUtterance(boolean value) { - - singleUtterance_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * *Optional* If `false` or omitted, the recognizer will perform continuous
-     * recognition (continuing to wait for and process audio even if the user
-     * pauses speaking) until the client closes the input stream (gRPC API) or
-     * until the maximum time limit has been reached. May return multiple
-     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-     * If `true`, the recognizer will detect a single spoken utterance. When it
-     * detects that the user has paused or stopped speaking, it will return an
-     * `END_OF_UTTERANCE` event and cease recognition. It will return no more than
-     * one `StreamingRecognitionResult` with the `is_final` flag set to `true`.
-     * 
- * - * bool single_utterance = 2; - */ - public Builder clearSingleUtterance() { - - singleUtterance_ = false; - onChanged(); - return this; - } - - private boolean interimResults_; - /** - * - * - *
-     * *Optional* If `true`, interim results (tentative hypotheses) may be
-     * returned as they become available (these interim results are indicated with
-     * the `is_final=false` flag).
-     * If `false` or omitted, only `is_final=true` result(s) are returned.
-     * 
- * - * bool interim_results = 3; - */ - public boolean getInterimResults() { - return interimResults_; - } - /** - * - * - *
-     * *Optional* If `true`, interim results (tentative hypotheses) may be
-     * returned as they become available (these interim results are indicated with
-     * the `is_final=false` flag).
-     * If `false` or omitted, only `is_final=true` result(s) are returned.
-     * 
- * - * bool interim_results = 3; - */ - public Builder setInterimResults(boolean value) { - - interimResults_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * *Optional* If `true`, interim results (tentative hypotheses) may be
-     * returned as they become available (these interim results are indicated with
-     * the `is_final=false` flag).
-     * If `false` or omitted, only `is_final=true` result(s) are returned.
-     * 
- * - * bool interim_results = 3; - */ - public Builder clearInterimResults() { - - interimResults_ = false; - onChanged(); - return this; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1beta1.StreamingRecognitionConfig) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1beta1.StreamingRecognitionConfig) - private static final com.google.cloud.speech.v1beta1.StreamingRecognitionConfig DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1beta1.StreamingRecognitionConfig(); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognitionConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public StreamingRecognitionConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingRecognitionConfig(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.cloud.speech.v1beta1.StreamingRecognitionConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognitionConfigOrBuilder.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognitionConfigOrBuilder.java deleted file mode 100644 index a86a3e255..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognitionConfigOrBuilder.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -public interface StreamingRecognitionConfigOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1beta1.StreamingRecognitionConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * *Required* Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - boolean hasConfig(); - /** - * - * - *
-   * *Required* Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - com.google.cloud.speech.v1beta1.RecognitionConfig getConfig(); - /** - * - * - *
-   * *Required* Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - com.google.cloud.speech.v1beta1.RecognitionConfigOrBuilder getConfigOrBuilder(); - - /** - * - * - *
-   * *Optional* If `false` or omitted, the recognizer will perform continuous
-   * recognition (continuing to wait for and process audio even if the user
-   * pauses speaking) until the client closes the input stream (gRPC API) or
-   * until the maximum time limit has been reached. May return multiple
-   * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-   * If `true`, the recognizer will detect a single spoken utterance. When it
-   * detects that the user has paused or stopped speaking, it will return an
-   * `END_OF_UTTERANCE` event and cease recognition. It will return no more than
-   * one `StreamingRecognitionResult` with the `is_final` flag set to `true`.
-   * 
- * - * bool single_utterance = 2; - */ - boolean getSingleUtterance(); - - /** - * - * - *
-   * *Optional* If `true`, interim results (tentative hypotheses) may be
-   * returned as they become available (these interim results are indicated with
-   * the `is_final=false` flag).
-   * If `false` or omitted, only `is_final=true` result(s) are returned.
-   * 
- * - * bool interim_results = 3; - */ - boolean getInterimResults(); -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognitionResult.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognitionResult.java deleted file mode 100644 index 62b004988..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognitionResult.java +++ /dev/null @@ -1,1189 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -/** - * - * - *
- * A streaming speech recognition result corresponding to a portion of the audio
- * that is currently being processed.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.StreamingRecognitionResult} - */ -public final class StreamingRecognitionResult extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1beta1.StreamingRecognitionResult) - StreamingRecognitionResultOrBuilder { - private static final long serialVersionUID = 0L; - // Use StreamingRecognitionResult.newBuilder() to construct. - private StreamingRecognitionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private StreamingRecognitionResult() { - alternatives_ = java.util.Collections.emptyList(); - isFinal_ = false; - stability_ = 0F; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private StreamingRecognitionResult( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - alternatives_ = - new java.util.ArrayList< - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative>(); - mutable_bitField0_ |= 0x00000001; - } - alternatives_.add( - input.readMessage( - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.parser(), - extensionRegistry)); - break; - } - case 16: - { - isFinal_ = input.readBool(); - break; - } - case 29: - { - stability_ = input.readFloat(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - alternatives_ = java.util.Collections.unmodifiableList(alternatives_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_StreamingRecognitionResult_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_StreamingRecognitionResult_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.StreamingRecognitionResult.class, - com.google.cloud.speech.v1beta1.StreamingRecognitionResult.Builder.class); - } - - private int bitField0_; - public static final int ALTERNATIVES_FIELD_NUMBER = 1; - private java.util.List - alternatives_; - /** - * - * - *
-   * *Output-only* May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public java.util.List - getAlternativesList() { - return alternatives_; - } - /** - * - * - *
-   * *Output-only* May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public java.util.List< - ? extends com.google.cloud.speech.v1beta1.SpeechRecognitionAlternativeOrBuilder> - getAlternativesOrBuilderList() { - return alternatives_; - } - /** - * - * - *
-   * *Output-only* May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public int getAlternativesCount() { - return alternatives_.size(); - } - /** - * - * - *
-   * *Output-only* May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative getAlternatives(int index) { - return alternatives_.get(index); - } - /** - * - * - *
-   * *Output-only* May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionAlternativeOrBuilder - getAlternativesOrBuilder(int index) { - return alternatives_.get(index); - } - - public static final int IS_FINAL_FIELD_NUMBER = 2; - private boolean isFinal_; - /** - * - * - *
-   * *Output-only* If `false`, this `StreamingRecognitionResult` represents an
-   * interim result that may change. If `true`, this is the final time the
-   * speech service will return this particular `StreamingRecognitionResult`,
-   * the recognizer will not return any further hypotheses for this portion of
-   * the transcript and corresponding audio.
-   * 
- * - * bool is_final = 2; - */ - public boolean getIsFinal() { - return isFinal_; - } - - public static final int STABILITY_FIELD_NUMBER = 3; - private float stability_; - /** - * - * - *
-   * *Output-only* An estimate of the likelihood that the recognizer will not
-   * change its guess about this interim result. Values range from 0.0
-   * (completely unstable) to 1.0 (completely stable).
-   * This field is only provided for interim results (`is_final=false`).
-   * The default of 0.0 is a sentinel value indicating `stability` was not set.
-   * 
- * - * float stability = 3; - */ - public float getStability() { - return stability_; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < alternatives_.size(); i++) { - output.writeMessage(1, alternatives_.get(i)); - } - if (isFinal_ != false) { - output.writeBool(2, isFinal_); - } - if (stability_ != 0F) { - output.writeFloat(3, stability_); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < alternatives_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, alternatives_.get(i)); - } - if (isFinal_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, isFinal_); - } - if (stability_ != 0F) { - size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, stability_); - } - size += unknownFields.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.v1beta1.StreamingRecognitionResult)) { - return super.equals(obj); - } - com.google.cloud.speech.v1beta1.StreamingRecognitionResult other = - (com.google.cloud.speech.v1beta1.StreamingRecognitionResult) obj; - - boolean result = true; - result = result && getAlternativesList().equals(other.getAlternativesList()); - result = result && (getIsFinal() == other.getIsFinal()); - result = - result - && (java.lang.Float.floatToIntBits(getStability()) - == java.lang.Float.floatToIntBits(other.getStability())); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getAlternativesCount() > 0) { - hash = (37 * hash) + ALTERNATIVES_FIELD_NUMBER; - hash = (53 * hash) + getAlternativesList().hashCode(); - } - hash = (37 * hash) + IS_FINAL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsFinal()); - hash = (37 * hash) + STABILITY_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits(getStability()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognitionResult parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognitionResult 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.v1beta1.StreamingRecognitionResult parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognitionResult 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.v1beta1.StreamingRecognitionResult parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognitionResult parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognitionResult parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognitionResult 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.v1beta1.StreamingRecognitionResult parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognitionResult 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.v1beta1.StreamingRecognitionResult parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognitionResult parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.speech.v1beta1.StreamingRecognitionResult prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - 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; - } - /** - * - * - *
-   * A streaming speech recognition result corresponding to a portion of the audio
-   * that is currently being processed.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.StreamingRecognitionResult} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1beta1.StreamingRecognitionResult) - com.google.cloud.speech.v1beta1.StreamingRecognitionResultOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_StreamingRecognitionResult_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_StreamingRecognitionResult_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.StreamingRecognitionResult.class, - com.google.cloud.speech.v1beta1.StreamingRecognitionResult.Builder.class); - } - - // Construct using com.google.cloud.speech.v1beta1.StreamingRecognitionResult.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getAlternativesFieldBuilder(); - } - } - - public Builder clear() { - super.clear(); - if (alternativesBuilder_ == null) { - alternatives_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - alternativesBuilder_.clear(); - } - isFinal_ = false; - - stability_ = 0F; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_StreamingRecognitionResult_descriptor; - } - - public com.google.cloud.speech.v1beta1.StreamingRecognitionResult getDefaultInstanceForType() { - return com.google.cloud.speech.v1beta1.StreamingRecognitionResult.getDefaultInstance(); - } - - public com.google.cloud.speech.v1beta1.StreamingRecognitionResult build() { - com.google.cloud.speech.v1beta1.StreamingRecognitionResult result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.cloud.speech.v1beta1.StreamingRecognitionResult buildPartial() { - com.google.cloud.speech.v1beta1.StreamingRecognitionResult result = - new com.google.cloud.speech.v1beta1.StreamingRecognitionResult(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (alternativesBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - alternatives_ = java.util.Collections.unmodifiableList(alternatives_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.alternatives_ = alternatives_; - } else { - result.alternatives_ = alternativesBuilder_.build(); - } - result.isFinal_ = isFinal_; - result.stability_ = stability_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1beta1.StreamingRecognitionResult) { - return mergeFrom((com.google.cloud.speech.v1beta1.StreamingRecognitionResult) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1beta1.StreamingRecognitionResult other) { - if (other == com.google.cloud.speech.v1beta1.StreamingRecognitionResult.getDefaultInstance()) - return this; - if (alternativesBuilder_ == null) { - if (!other.alternatives_.isEmpty()) { - if (alternatives_.isEmpty()) { - alternatives_ = other.alternatives_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAlternativesIsMutable(); - alternatives_.addAll(other.alternatives_); - } - onChanged(); - } - } else { - if (!other.alternatives_.isEmpty()) { - if (alternativesBuilder_.isEmpty()) { - alternativesBuilder_.dispose(); - alternativesBuilder_ = null; - alternatives_ = other.alternatives_; - bitField0_ = (bitField0_ & ~0x00000001); - alternativesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getAlternativesFieldBuilder() - : null; - } else { - alternativesBuilder_.addAllMessages(other.alternatives_); - } - } - } - if (other.getIsFinal() != false) { - setIsFinal(other.getIsFinal()); - } - if (other.getStability() != 0F) { - setStability(other.getStability()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1beta1.StreamingRecognitionResult parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1beta1.StreamingRecognitionResult) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List - alternatives_ = java.util.Collections.emptyList(); - - private void ensureAlternativesIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - alternatives_ = - new java.util.ArrayList( - alternatives_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative, - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.Builder, - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternativeOrBuilder> - alternativesBuilder_; - - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public java.util.List - getAlternativesList() { - if (alternativesBuilder_ == null) { - return java.util.Collections.unmodifiableList(alternatives_); - } else { - return alternativesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public int getAlternativesCount() { - if (alternativesBuilder_ == null) { - return alternatives_.size(); - } else { - return alternativesBuilder_.getCount(); - } - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative getAlternatives(int index) { - if (alternativesBuilder_ == null) { - return alternatives_.get(index); - } else { - return alternativesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder setAlternatives( - int index, com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.set(index, value); - onChanged(); - } else { - alternativesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder setAlternatives( - int index, - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.set(index, builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder addAlternatives( - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.add(value); - onChanged(); - } else { - alternativesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder addAlternatives( - int index, com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.add(index, value); - onChanged(); - } else { - alternativesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder addAlternatives( - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.add(builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder addAlternatives( - int index, - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.add(index, builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder addAllAlternatives( - java.lang.Iterable - values) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, alternatives_); - onChanged(); - } else { - alternativesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder clearAlternatives() { - if (alternativesBuilder_ == null) { - alternatives_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - alternativesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder removeAlternatives(int index) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.remove(index); - onChanged(); - } else { - alternativesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.Builder - getAlternativesBuilder(int index) { - return getAlternativesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionAlternativeOrBuilder - getAlternativesOrBuilder(int index) { - if (alternativesBuilder_ == null) { - return alternatives_.get(index); - } else { - return alternativesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public java.util.List< - ? extends com.google.cloud.speech.v1beta1.SpeechRecognitionAlternativeOrBuilder> - getAlternativesOrBuilderList() { - if (alternativesBuilder_ != null) { - return alternativesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(alternatives_); - } - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.Builder - addAlternativesBuilder() { - return getAlternativesFieldBuilder() - .addBuilder( - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.getDefaultInstance()); - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.Builder - addAlternativesBuilder(int index) { - return getAlternativesFieldBuilder() - .addBuilder( - index, - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.getDefaultInstance()); - } - /** - * - * - *
-     * *Output-only* May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public java.util.List - getAlternativesBuilderList() { - return getAlternativesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative, - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.Builder, - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternativeOrBuilder> - getAlternativesFieldBuilder() { - if (alternativesBuilder_ == null) { - alternativesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative, - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative.Builder, - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternativeOrBuilder>( - alternatives_, - ((bitField0_ & 0x00000001) == 0x00000001), - getParentForChildren(), - isClean()); - alternatives_ = null; - } - return alternativesBuilder_; - } - - private boolean isFinal_; - /** - * - * - *
-     * *Output-only* If `false`, this `StreamingRecognitionResult` represents an
-     * interim result that may change. If `true`, this is the final time the
-     * speech service will return this particular `StreamingRecognitionResult`,
-     * the recognizer will not return any further hypotheses for this portion of
-     * the transcript and corresponding audio.
-     * 
- * - * bool is_final = 2; - */ - public boolean getIsFinal() { - return isFinal_; - } - /** - * - * - *
-     * *Output-only* If `false`, this `StreamingRecognitionResult` represents an
-     * interim result that may change. If `true`, this is the final time the
-     * speech service will return this particular `StreamingRecognitionResult`,
-     * the recognizer will not return any further hypotheses for this portion of
-     * the transcript and corresponding audio.
-     * 
- * - * bool is_final = 2; - */ - public Builder setIsFinal(boolean value) { - - isFinal_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * *Output-only* If `false`, this `StreamingRecognitionResult` represents an
-     * interim result that may change. If `true`, this is the final time the
-     * speech service will return this particular `StreamingRecognitionResult`,
-     * the recognizer will not return any further hypotheses for this portion of
-     * the transcript and corresponding audio.
-     * 
- * - * bool is_final = 2; - */ - public Builder clearIsFinal() { - - isFinal_ = false; - onChanged(); - return this; - } - - private float stability_; - /** - * - * - *
-     * *Output-only* An estimate of the likelihood that the recognizer will not
-     * change its guess about this interim result. Values range from 0.0
-     * (completely unstable) to 1.0 (completely stable).
-     * This field is only provided for interim results (`is_final=false`).
-     * The default of 0.0 is a sentinel value indicating `stability` was not set.
-     * 
- * - * float stability = 3; - */ - public float getStability() { - return stability_; - } - /** - * - * - *
-     * *Output-only* An estimate of the likelihood that the recognizer will not
-     * change its guess about this interim result. Values range from 0.0
-     * (completely unstable) to 1.0 (completely stable).
-     * This field is only provided for interim results (`is_final=false`).
-     * The default of 0.0 is a sentinel value indicating `stability` was not set.
-     * 
- * - * float stability = 3; - */ - public Builder setStability(float value) { - - stability_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * *Output-only* An estimate of the likelihood that the recognizer will not
-     * change its guess about this interim result. Values range from 0.0
-     * (completely unstable) to 1.0 (completely stable).
-     * This field is only provided for interim results (`is_final=false`).
-     * The default of 0.0 is a sentinel value indicating `stability` was not set.
-     * 
- * - * float stability = 3; - */ - public Builder clearStability() { - - stability_ = 0F; - onChanged(); - return this; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1beta1.StreamingRecognitionResult) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1beta1.StreamingRecognitionResult) - private static final com.google.cloud.speech.v1beta1.StreamingRecognitionResult DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1beta1.StreamingRecognitionResult(); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognitionResult getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public StreamingRecognitionResult parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingRecognitionResult(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.cloud.speech.v1beta1.StreamingRecognitionResult getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognitionResultOrBuilder.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognitionResultOrBuilder.java deleted file mode 100644 index 80f2a1f65..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognitionResultOrBuilder.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -public interface StreamingRecognitionResultOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1beta1.StreamingRecognitionResult) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * *Output-only* May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - java.util.List - getAlternativesList(); - /** - * - * - *
-   * *Output-only* May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternative getAlternatives(int index); - /** - * - * - *
-   * *Output-only* May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - int getAlternativesCount(); - /** - * - * - *
-   * *Output-only* May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - java.util.List - getAlternativesOrBuilderList(); - /** - * - * - *
-   * *Output-only* May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - com.google.cloud.speech.v1beta1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( - int index); - - /** - * - * - *
-   * *Output-only* If `false`, this `StreamingRecognitionResult` represents an
-   * interim result that may change. If `true`, this is the final time the
-   * speech service will return this particular `StreamingRecognitionResult`,
-   * the recognizer will not return any further hypotheses for this portion of
-   * the transcript and corresponding audio.
-   * 
- * - * bool is_final = 2; - */ - boolean getIsFinal(); - - /** - * - * - *
-   * *Output-only* An estimate of the likelihood that the recognizer will not
-   * change its guess about this interim result. Values range from 0.0
-   * (completely unstable) to 1.0 (completely stable).
-   * This field is only provided for interim results (`is_final=false`).
-   * The default of 0.0 is a sentinel value indicating `stability` was not set.
-   * 
- * - * float stability = 3; - */ - float getStability(); -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognizeRequest.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognizeRequest.java deleted file mode 100644 index 33c6533f6..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognizeRequest.java +++ /dev/null @@ -1,961 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -/** - * - * - *
- * The top-level message sent by the client for the `StreamingRecognize` method.
- * Multiple `StreamingRecognizeRequest` messages are sent. The first message
- * must contain a `streaming_config` message and must not contain `audio` data.
- * All subsequent messages must contain `audio` data and must not contain a
- * `streaming_config` message.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.StreamingRecognizeRequest} - */ -public final class StreamingRecognizeRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1beta1.StreamingRecognizeRequest) - StreamingRecognizeRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use StreamingRecognizeRequest.newBuilder() to construct. - private StreamingRecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private StreamingRecognizeRequest() {} - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private StreamingRecognizeRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.Builder subBuilder = null; - if (streamingRequestCase_ == 1) { - subBuilder = - ((com.google.cloud.speech.v1beta1.StreamingRecognitionConfig) streamingRequest_) - .toBuilder(); - } - streamingRequest_ = - input.readMessage( - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.cloud.speech.v1beta1.StreamingRecognitionConfig) streamingRequest_); - streamingRequest_ = subBuilder.buildPartial(); - } - streamingRequestCase_ = 1; - break; - } - case 18: - { - streamingRequestCase_ = 2; - streamingRequest_ = input.readBytes(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_StreamingRecognizeRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_StreamingRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.StreamingRecognizeRequest.class, - com.google.cloud.speech.v1beta1.StreamingRecognizeRequest.Builder.class); - } - - private int streamingRequestCase_ = 0; - private java.lang.Object streamingRequest_; - - public enum StreamingRequestCase implements com.google.protobuf.Internal.EnumLite { - STREAMING_CONFIG(1), - AUDIO_CONTENT(2), - STREAMINGREQUEST_NOT_SET(0); - private final int value; - - private StreamingRequestCase(int value) { - this.value = value; - } - /** @deprecated Use {@link #forNumber(int)} instead. */ - @java.lang.Deprecated - public static StreamingRequestCase valueOf(int value) { - return forNumber(value); - } - - public static StreamingRequestCase forNumber(int value) { - switch (value) { - case 1: - return STREAMING_CONFIG; - case 2: - return AUDIO_CONTENT; - case 0: - return STREAMINGREQUEST_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public StreamingRequestCase getStreamingRequestCase() { - return StreamingRequestCase.forNumber(streamingRequestCase_); - } - - public static final int STREAMING_CONFIG_FIELD_NUMBER = 1; - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public boolean hasStreamingConfig() { - return streamingRequestCase_ == 1; - } - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public com.google.cloud.speech.v1beta1.StreamingRecognitionConfig getStreamingConfig() { - if (streamingRequestCase_ == 1) { - return (com.google.cloud.speech.v1beta1.StreamingRecognitionConfig) streamingRequest_; - } - return com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public com.google.cloud.speech.v1beta1.StreamingRecognitionConfigOrBuilder - getStreamingConfigOrBuilder() { - if (streamingRequestCase_ == 1) { - return (com.google.cloud.speech.v1beta1.StreamingRecognitionConfig) streamingRequest_; - } - return com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } - - public static final int AUDIO_CONTENT_FIELD_NUMBER = 2; - /** - * - * - *
-   * The audio data to be recognized. Sequential chunks of audio data are sent
-   * in sequential `StreamingRecognizeRequest` messages. The first
-   * `StreamingRecognizeRequest` message must not contain `audio_content` data
-   * and all subsequent `StreamingRecognizeRequest` messages must contain
-   * `audio_content` data. The audio bytes must be encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, protobuffers use a
-   * pure binary representation (not base64). See
-   * [audio limits](https://cloud.google.com/speech/limits#content).
-   * 
- * - * bytes audio_content = 2; - */ - public com.google.protobuf.ByteString getAudioContent() { - if (streamingRequestCase_ == 2) { - return (com.google.protobuf.ByteString) streamingRequest_; - } - return com.google.protobuf.ByteString.EMPTY; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (streamingRequestCase_ == 1) { - output.writeMessage( - 1, (com.google.cloud.speech.v1beta1.StreamingRecognitionConfig) streamingRequest_); - } - if (streamingRequestCase_ == 2) { - output.writeBytes(2, (com.google.protobuf.ByteString) streamingRequest_); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (streamingRequestCase_ == 1) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 1, (com.google.cloud.speech.v1beta1.StreamingRecognitionConfig) streamingRequest_); - } - if (streamingRequestCase_ == 2) { - size += - com.google.protobuf.CodedOutputStream.computeBytesSize( - 2, (com.google.protobuf.ByteString) streamingRequest_); - } - size += unknownFields.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.v1beta1.StreamingRecognizeRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1beta1.StreamingRecognizeRequest other = - (com.google.cloud.speech.v1beta1.StreamingRecognizeRequest) obj; - - boolean result = true; - result = result && getStreamingRequestCase().equals(other.getStreamingRequestCase()); - if (!result) return false; - switch (streamingRequestCase_) { - case 1: - result = result && getStreamingConfig().equals(other.getStreamingConfig()); - break; - case 2: - result = result && getAudioContent().equals(other.getAudioContent()); - break; - case 0: - default: - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (streamingRequestCase_) { - case 1: - hash = (37 * hash) + STREAMING_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getStreamingConfig().hashCode(); - break; - case 2: - hash = (37 * hash) + AUDIO_CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getAudioContent().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognizeRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognizeRequest 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.v1beta1.StreamingRecognizeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognizeRequest 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.v1beta1.StreamingRecognizeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognizeRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognizeRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognizeRequest 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.v1beta1.StreamingRecognizeRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognizeRequest 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.v1beta1.StreamingRecognizeRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognizeRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.speech.v1beta1.StreamingRecognizeRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - 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; - } - /** - * - * - *
-   * The top-level message sent by the client for the `StreamingRecognize` method.
-   * Multiple `StreamingRecognizeRequest` messages are sent. The first message
-   * must contain a `streaming_config` message and must not contain `audio` data.
-   * All subsequent messages must contain `audio` data and must not contain a
-   * `streaming_config` message.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.StreamingRecognizeRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1beta1.StreamingRecognizeRequest) - com.google.cloud.speech.v1beta1.StreamingRecognizeRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_StreamingRecognizeRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_StreamingRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.StreamingRecognizeRequest.class, - com.google.cloud.speech.v1beta1.StreamingRecognizeRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1beta1.StreamingRecognizeRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - public Builder clear() { - super.clear(); - streamingRequestCase_ = 0; - streamingRequest_ = null; - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_StreamingRecognizeRequest_descriptor; - } - - public com.google.cloud.speech.v1beta1.StreamingRecognizeRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1beta1.StreamingRecognizeRequest.getDefaultInstance(); - } - - public com.google.cloud.speech.v1beta1.StreamingRecognizeRequest build() { - com.google.cloud.speech.v1beta1.StreamingRecognizeRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.cloud.speech.v1beta1.StreamingRecognizeRequest buildPartial() { - com.google.cloud.speech.v1beta1.StreamingRecognizeRequest result = - new com.google.cloud.speech.v1beta1.StreamingRecognizeRequest(this); - if (streamingRequestCase_ == 1) { - if (streamingConfigBuilder_ == null) { - result.streamingRequest_ = streamingRequest_; - } else { - result.streamingRequest_ = streamingConfigBuilder_.build(); - } - } - if (streamingRequestCase_ == 2) { - result.streamingRequest_ = streamingRequest_; - } - result.streamingRequestCase_ = streamingRequestCase_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1beta1.StreamingRecognizeRequest) { - return mergeFrom((com.google.cloud.speech.v1beta1.StreamingRecognizeRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1beta1.StreamingRecognizeRequest other) { - if (other == com.google.cloud.speech.v1beta1.StreamingRecognizeRequest.getDefaultInstance()) - return this; - switch (other.getStreamingRequestCase()) { - case STREAMING_CONFIG: - { - mergeStreamingConfig(other.getStreamingConfig()); - break; - } - case AUDIO_CONTENT: - { - setAudioContent(other.getAudioContent()); - break; - } - case STREAMINGREQUEST_NOT_SET: - { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1beta1.StreamingRecognizeRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1beta1.StreamingRecognizeRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int streamingRequestCase_ = 0; - private java.lang.Object streamingRequest_; - - public StreamingRequestCase getStreamingRequestCase() { - return StreamingRequestCase.forNumber(streamingRequestCase_); - } - - public Builder clearStreamingRequest() { - streamingRequestCase_ = 0; - streamingRequest_ = null; - onChanged(); - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig, - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.Builder, - com.google.cloud.speech.v1beta1.StreamingRecognitionConfigOrBuilder> - streamingConfigBuilder_; - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public boolean hasStreamingConfig() { - return streamingRequestCase_ == 1; - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public com.google.cloud.speech.v1beta1.StreamingRecognitionConfig getStreamingConfig() { - if (streamingConfigBuilder_ == null) { - if (streamingRequestCase_ == 1) { - return (com.google.cloud.speech.v1beta1.StreamingRecognitionConfig) streamingRequest_; - } - return com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } else { - if (streamingRequestCase_ == 1) { - return streamingConfigBuilder_.getMessage(); - } - return com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public Builder setStreamingConfig( - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig value) { - if (streamingConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - streamingRequest_ = value; - onChanged(); - } else { - streamingConfigBuilder_.setMessage(value); - } - streamingRequestCase_ = 1; - return this; - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public Builder setStreamingConfig( - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.Builder builderForValue) { - if (streamingConfigBuilder_ == null) { - streamingRequest_ = builderForValue.build(); - onChanged(); - } else { - streamingConfigBuilder_.setMessage(builderForValue.build()); - } - streamingRequestCase_ = 1; - return this; - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public Builder mergeStreamingConfig( - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig value) { - if (streamingConfigBuilder_ == null) { - if (streamingRequestCase_ == 1 - && streamingRequest_ - != com.google.cloud.speech.v1beta1.StreamingRecognitionConfig - .getDefaultInstance()) { - streamingRequest_ = - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.newBuilder( - (com.google.cloud.speech.v1beta1.StreamingRecognitionConfig) - streamingRequest_) - .mergeFrom(value) - .buildPartial(); - } else { - streamingRequest_ = value; - } - onChanged(); - } else { - if (streamingRequestCase_ == 1) { - streamingConfigBuilder_.mergeFrom(value); - } - streamingConfigBuilder_.setMessage(value); - } - streamingRequestCase_ = 1; - return this; - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public Builder clearStreamingConfig() { - if (streamingConfigBuilder_ == null) { - if (streamingRequestCase_ == 1) { - streamingRequestCase_ = 0; - streamingRequest_ = null; - onChanged(); - } - } else { - if (streamingRequestCase_ == 1) { - streamingRequestCase_ = 0; - streamingRequest_ = null; - } - streamingConfigBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.Builder - getStreamingConfigBuilder() { - return getStreamingConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public com.google.cloud.speech.v1beta1.StreamingRecognitionConfigOrBuilder - getStreamingConfigOrBuilder() { - if ((streamingRequestCase_ == 1) && (streamingConfigBuilder_ != null)) { - return streamingConfigBuilder_.getMessageOrBuilder(); - } else { - if (streamingRequestCase_ == 1) { - return (com.google.cloud.speech.v1beta1.StreamingRecognitionConfig) streamingRequest_; - } - return com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig, - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.Builder, - com.google.cloud.speech.v1beta1.StreamingRecognitionConfigOrBuilder> - getStreamingConfigFieldBuilder() { - if (streamingConfigBuilder_ == null) { - if (!(streamingRequestCase_ == 1)) { - streamingRequest_ = - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } - streamingConfigBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig, - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig.Builder, - com.google.cloud.speech.v1beta1.StreamingRecognitionConfigOrBuilder>( - (com.google.cloud.speech.v1beta1.StreamingRecognitionConfig) streamingRequest_, - getParentForChildren(), - isClean()); - streamingRequest_ = null; - } - streamingRequestCase_ = 1; - onChanged(); - ; - return streamingConfigBuilder_; - } - - /** - * - * - *
-     * The audio data to be recognized. Sequential chunks of audio data are sent
-     * in sequential `StreamingRecognizeRequest` messages. The first
-     * `StreamingRecognizeRequest` message must not contain `audio_content` data
-     * and all subsequent `StreamingRecognizeRequest` messages must contain
-     * `audio_content` data. The audio bytes must be encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, protobuffers use a
-     * pure binary representation (not base64). See
-     * [audio limits](https://cloud.google.com/speech/limits#content).
-     * 
- * - * bytes audio_content = 2; - */ - public com.google.protobuf.ByteString getAudioContent() { - if (streamingRequestCase_ == 2) { - return (com.google.protobuf.ByteString) streamingRequest_; - } - return com.google.protobuf.ByteString.EMPTY; - } - /** - * - * - *
-     * The audio data to be recognized. Sequential chunks of audio data are sent
-     * in sequential `StreamingRecognizeRequest` messages. The first
-     * `StreamingRecognizeRequest` message must not contain `audio_content` data
-     * and all subsequent `StreamingRecognizeRequest` messages must contain
-     * `audio_content` data. The audio bytes must be encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, protobuffers use a
-     * pure binary representation (not base64). See
-     * [audio limits](https://cloud.google.com/speech/limits#content).
-     * 
- * - * bytes audio_content = 2; - */ - public Builder setAudioContent(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - streamingRequestCase_ = 2; - streamingRequest_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The audio data to be recognized. Sequential chunks of audio data are sent
-     * in sequential `StreamingRecognizeRequest` messages. The first
-     * `StreamingRecognizeRequest` message must not contain `audio_content` data
-     * and all subsequent `StreamingRecognizeRequest` messages must contain
-     * `audio_content` data. The audio bytes must be encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, protobuffers use a
-     * pure binary representation (not base64). See
-     * [audio limits](https://cloud.google.com/speech/limits#content).
-     * 
- * - * bytes audio_content = 2; - */ - public Builder clearAudioContent() { - if (streamingRequestCase_ == 2) { - streamingRequestCase_ = 0; - streamingRequest_ = null; - onChanged(); - } - return this; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1beta1.StreamingRecognizeRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1beta1.StreamingRecognizeRequest) - private static final com.google.cloud.speech.v1beta1.StreamingRecognizeRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1beta1.StreamingRecognizeRequest(); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognizeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public StreamingRecognizeRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingRecognizeRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.cloud.speech.v1beta1.StreamingRecognizeRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognizeRequestOrBuilder.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognizeRequestOrBuilder.java deleted file mode 100644 index 3879a185a..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognizeRequestOrBuilder.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -public interface StreamingRecognizeRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1beta1.StreamingRecognizeRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - boolean hasStreamingConfig(); - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - com.google.cloud.speech.v1beta1.StreamingRecognitionConfig getStreamingConfig(); - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - com.google.cloud.speech.v1beta1.StreamingRecognitionConfigOrBuilder getStreamingConfigOrBuilder(); - - /** - * - * - *
-   * The audio data to be recognized. Sequential chunks of audio data are sent
-   * in sequential `StreamingRecognizeRequest` messages. The first
-   * `StreamingRecognizeRequest` message must not contain `audio_content` data
-   * and all subsequent `StreamingRecognizeRequest` messages must contain
-   * `audio_content` data. The audio bytes must be encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, protobuffers use a
-   * pure binary representation (not base64). See
-   * [audio limits](https://cloud.google.com/speech/limits#content).
-   * 
- * - * bytes audio_content = 2; - */ - com.google.protobuf.ByteString getAudioContent(); - - public com.google.cloud.speech.v1beta1.StreamingRecognizeRequest.StreamingRequestCase - getStreamingRequestCase(); -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognizeResponse.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognizeResponse.java deleted file mode 100644 index b44539afa..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognizeResponse.java +++ /dev/null @@ -1,1821 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -/** - * - * - *
- * `StreamingRecognizeResponse` is the only message returned to the client by
- * `StreamingRecognize`. A series of one or more `StreamingRecognizeResponse`
- * messages are streamed back to the client.
- * Here's an example of a series of ten `StreamingRecognizeResponse`s that might
- * be returned while processing audio:
- * 1. endpointer_type: START_OF_SPEECH
- * 2. results { alternatives { transcript: "tube" } stability: 0.01 }
- *    result_index: 0
- * 3. results { alternatives { transcript: "to be a" } stability: 0.01 }
- *    result_index: 0
- * 4. results { alternatives { transcript: "to be" } stability: 0.9 }
- *    results { alternatives { transcript: " or not to be" } stability: 0.01 }
- *    result_index: 0
- * 5. results { alternatives { transcript: "to be or not to be"
- *                             confidence: 0.92 }
- *              alternatives { transcript: "to bee or not to bee" }
- *              is_final: true }
- *    result_index: 0
- * 6. results { alternatives { transcript: " that's" } stability: 0.01 }
- *    result_index: 1
- * 7. results { alternatives { transcript: " that is" } stability: 0.9 }
- *    results { alternatives { transcript: " the question" } stability: 0.01 }
- *    result_index: 1
- * 8. endpointer_type: END_OF_SPEECH
- * 9. results { alternatives { transcript: " that is the question"
- *                             confidence: 0.98 }
- *              alternatives { transcript: " that was the question" }
- *              is_final: true }
- *    result_index: 1
- * 10. endpointer_type: END_OF_AUDIO
- * Notes:
- * - Only two of the above responses #5 and #9 contain final results, they are
- *   indicated by `is_final: true`. Concatenating these together generates the
- *   full transcript: "to be or not to be that is the question".
- * - The others contain interim `results`. #4 and #7 contain two interim
- *   `results`, the first portion has a high stability and is less likely to
- *   change, the second portion has a low stability and is very likely to
- *   change. A UI designer might choose to show only high stability `results`.
- * - The specific `stability` and `confidence` values shown above are only for
- *   illustrative purposes. Actual values may vary.
- * - The `result_index` indicates the portion of audio that has had final
- *   results returned, and is no longer being processed. For example, the
- *   `results` in #6 and later correspond to the portion of audio after
- *   "to be or not to be".
- * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.StreamingRecognizeResponse} - */ -public final class StreamingRecognizeResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1beta1.StreamingRecognizeResponse) - StreamingRecognizeResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use StreamingRecognizeResponse.newBuilder() to construct. - private StreamingRecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private StreamingRecognizeResponse() { - results_ = java.util.Collections.emptyList(); - resultIndex_ = 0; - endpointerType_ = 0; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private StreamingRecognizeResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - com.google.rpc.Status.Builder subBuilder = null; - if (error_ != null) { - subBuilder = error_.toBuilder(); - } - error_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(error_); - error_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - results_ = - new java.util.ArrayList< - com.google.cloud.speech.v1beta1.StreamingRecognitionResult>(); - mutable_bitField0_ |= 0x00000002; - } - results_.add( - input.readMessage( - com.google.cloud.speech.v1beta1.StreamingRecognitionResult.parser(), - extensionRegistry)); - break; - } - case 24: - { - resultIndex_ = input.readInt32(); - break; - } - case 32: - { - int rawValue = input.readEnum(); - - endpointerType_ = rawValue; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - results_ = java.util.Collections.unmodifiableList(results_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_StreamingRecognizeResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_StreamingRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse.class, - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse.Builder.class); - } - - /** - * - * - *
-   * Indicates the type of endpointer event.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType} - */ - public enum EndpointerType implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * No endpointer event specified.
-     * 
- * - * ENDPOINTER_EVENT_UNSPECIFIED = 0; - */ - ENDPOINTER_EVENT_UNSPECIFIED(0), - /** - * - * - *
-     * Speech has been detected in the audio stream, and the service is
-     * beginning to process it.
-     * 
- * - * START_OF_SPEECH = 1; - */ - START_OF_SPEECH(1), - /** - * - * - *
-     * Speech has ceased to be detected in the audio stream. (For example, the
-     * user may have paused after speaking.) If `single_utterance` is `false`,
-     * the service will continue to process audio, and if subsequent speech is
-     * detected, will send another START_OF_SPEECH event.
-     * 
- * - * END_OF_SPEECH = 2; - */ - END_OF_SPEECH(2), - /** - * - * - *
-     * This event is sent after the client has half-closed the input stream gRPC
-     * connection and the server has received all of the audio. (The server may
-     * still be processing the audio and may subsequently return additional
-     * results.)
-     * 
- * - * END_OF_AUDIO = 3; - */ - END_OF_AUDIO(3), - /** - * - * - *
-     * This event is only sent when `single_utterance` is `true`. It indicates
-     * that the server has detected the end of the user's speech utterance and
-     * expects no additional speech. Therefore, the server will not process
-     * additional audio (although it may subsequently return additional
-     * results). The client should stop sending additional audio data,
-     * half-close the gRPC connection, and wait for any additional results
-     * until the server closes the gRPC connection.
-     * 
- * - * END_OF_UTTERANCE = 4; - */ - END_OF_UTTERANCE(4), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * No endpointer event specified.
-     * 
- * - * ENDPOINTER_EVENT_UNSPECIFIED = 0; - */ - public static final int ENDPOINTER_EVENT_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * Speech has been detected in the audio stream, and the service is
-     * beginning to process it.
-     * 
- * - * START_OF_SPEECH = 1; - */ - public static final int START_OF_SPEECH_VALUE = 1; - /** - * - * - *
-     * Speech has ceased to be detected in the audio stream. (For example, the
-     * user may have paused after speaking.) If `single_utterance` is `false`,
-     * the service will continue to process audio, and if subsequent speech is
-     * detected, will send another START_OF_SPEECH event.
-     * 
- * - * END_OF_SPEECH = 2; - */ - public static final int END_OF_SPEECH_VALUE = 2; - /** - * - * - *
-     * This event is sent after the client has half-closed the input stream gRPC
-     * connection and the server has received all of the audio. (The server may
-     * still be processing the audio and may subsequently return additional
-     * results.)
-     * 
- * - * END_OF_AUDIO = 3; - */ - public static final int END_OF_AUDIO_VALUE = 3; - /** - * - * - *
-     * This event is only sent when `single_utterance` is `true`. It indicates
-     * that the server has detected the end of the user's speech utterance and
-     * expects no additional speech. Therefore, the server will not process
-     * additional audio (although it may subsequently return additional
-     * results). The client should stop sending additional audio data,
-     * half-close the gRPC connection, and wait for any additional results
-     * until the server closes the gRPC connection.
-     * 
- * - * END_OF_UTTERANCE = 4; - */ - public static final int END_OF_UTTERANCE_VALUE = 4; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** @deprecated Use {@link #forNumber(int)} instead. */ - @java.lang.Deprecated - public static EndpointerType valueOf(int value) { - return forNumber(value); - } - - public static EndpointerType forNumber(int value) { - switch (value) { - case 0: - return ENDPOINTER_EVENT_UNSPECIFIED; - case 1: - return START_OF_SPEECH; - case 2: - return END_OF_SPEECH; - case 3: - return END_OF_AUDIO; - case 4: - return END_OF_UTTERANCE; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public EndpointerType findValueByNumber(int number) { - return EndpointerType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.StreamingRecognizeResponse.getDescriptor() - .getEnumTypes() - .get(0); - } - - private static final EndpointerType[] VALUES = values(); - - public static EndpointerType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private EndpointerType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType) - } - - private int bitField0_; - public static final int ERROR_FIELD_NUMBER = 1; - private com.google.rpc.Status error_; - /** - * - * - *
-   * *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - */ - public boolean hasError() { - return error_ != null; - } - /** - * - * - *
-   * *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - */ - public com.google.rpc.Status getError() { - return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; - } - /** - * - * - *
-   * *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - */ - public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { - return getError(); - } - - public static final int RESULTS_FIELD_NUMBER = 2; - private java.util.List results_; - /** - * - * - *
-   * *Output-only* This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public java.util.List - getResultsList() { - return results_; - } - /** - * - * - *
-   * *Output-only* This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public java.util.List< - ? extends com.google.cloud.speech.v1beta1.StreamingRecognitionResultOrBuilder> - getResultsOrBuilderList() { - return results_; - } - /** - * - * - *
-   * *Output-only* This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public int getResultsCount() { - return results_.size(); - } - /** - * - * - *
-   * *Output-only* This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.StreamingRecognitionResult getResults(int index) { - return results_.get(index); - } - /** - * - * - *
-   * *Output-only* This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.StreamingRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - return results_.get(index); - } - - public static final int RESULT_INDEX_FIELD_NUMBER = 3; - private int resultIndex_; - /** - * - * - *
-   * *Output-only* Indicates the lowest index in the `results` array that has
-   * changed. The repeated `StreamingRecognitionResult` results overwrite past
-   * results at this index and higher.
-   * 
- * - * int32 result_index = 3; - */ - public int getResultIndex() { - return resultIndex_; - } - - public static final int ENDPOINTER_TYPE_FIELD_NUMBER = 4; - private int endpointerType_; - /** - * - * - *
-   * *Output-only* Indicates the type of endpointer event.
-   * 
- * - * - * .google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType endpointer_type = 4; - * - */ - public int getEndpointerTypeValue() { - return endpointerType_; - } - /** - * - * - *
-   * *Output-only* Indicates the type of endpointer event.
-   * 
- * - * - * .google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType endpointer_type = 4; - * - */ - public com.google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType - getEndpointerType() { - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType result = - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType.valueOf( - endpointerType_); - return result == null - ? com.google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType.UNRECOGNIZED - : result; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (error_ != null) { - output.writeMessage(1, getError()); - } - for (int i = 0; i < results_.size(); i++) { - output.writeMessage(2, results_.get(i)); - } - if (resultIndex_ != 0) { - output.writeInt32(3, resultIndex_); - } - if (endpointerType_ - != com.google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType - .ENDPOINTER_EVENT_UNSPECIFIED - .getNumber()) { - output.writeEnum(4, endpointerType_); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (error_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getError()); - } - for (int i = 0; i < results_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, results_.get(i)); - } - if (resultIndex_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, resultIndex_); - } - if (endpointerType_ - != com.google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType - .ENDPOINTER_EVENT_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, endpointerType_); - } - size += unknownFields.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.v1beta1.StreamingRecognizeResponse)) { - return super.equals(obj); - } - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse other = - (com.google.cloud.speech.v1beta1.StreamingRecognizeResponse) obj; - - boolean result = true; - result = result && (hasError() == other.hasError()); - if (hasError()) { - result = result && getError().equals(other.getError()); - } - result = result && getResultsList().equals(other.getResultsList()); - result = result && (getResultIndex() == other.getResultIndex()); - result = result && endpointerType_ == other.endpointerType_; - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasError()) { - hash = (37 * hash) + ERROR_FIELD_NUMBER; - hash = (53 * hash) + getError().hashCode(); - } - if (getResultsCount() > 0) { - hash = (37 * hash) + RESULTS_FIELD_NUMBER; - hash = (53 * hash) + getResultsList().hashCode(); - } - hash = (37 * hash) + RESULT_INDEX_FIELD_NUMBER; - hash = (53 * hash) + getResultIndex(); - hash = (37 * hash) + ENDPOINTER_TYPE_FIELD_NUMBER; - hash = (53 * hash) + endpointerType_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognizeResponse parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognizeResponse 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.v1beta1.StreamingRecognizeResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognizeResponse 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.v1beta1.StreamingRecognizeResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognizeResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognizeResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognizeResponse 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.v1beta1.StreamingRecognizeResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognizeResponse 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.v1beta1.StreamingRecognizeResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognizeResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - 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; - } - /** - * - * - *
-   * `StreamingRecognizeResponse` is the only message returned to the client by
-   * `StreamingRecognize`. A series of one or more `StreamingRecognizeResponse`
-   * messages are streamed back to the client.
-   * Here's an example of a series of ten `StreamingRecognizeResponse`s that might
-   * be returned while processing audio:
-   * 1. endpointer_type: START_OF_SPEECH
-   * 2. results { alternatives { transcript: "tube" } stability: 0.01 }
-   *    result_index: 0
-   * 3. results { alternatives { transcript: "to be a" } stability: 0.01 }
-   *    result_index: 0
-   * 4. results { alternatives { transcript: "to be" } stability: 0.9 }
-   *    results { alternatives { transcript: " or not to be" } stability: 0.01 }
-   *    result_index: 0
-   * 5. results { alternatives { transcript: "to be or not to be"
-   *                             confidence: 0.92 }
-   *              alternatives { transcript: "to bee or not to bee" }
-   *              is_final: true }
-   *    result_index: 0
-   * 6. results { alternatives { transcript: " that's" } stability: 0.01 }
-   *    result_index: 1
-   * 7. results { alternatives { transcript: " that is" } stability: 0.9 }
-   *    results { alternatives { transcript: " the question" } stability: 0.01 }
-   *    result_index: 1
-   * 8. endpointer_type: END_OF_SPEECH
-   * 9. results { alternatives { transcript: " that is the question"
-   *                             confidence: 0.98 }
-   *              alternatives { transcript: " that was the question" }
-   *              is_final: true }
-   *    result_index: 1
-   * 10. endpointer_type: END_OF_AUDIO
-   * Notes:
-   * - Only two of the above responses #5 and #9 contain final results, they are
-   *   indicated by `is_final: true`. Concatenating these together generates the
-   *   full transcript: "to be or not to be that is the question".
-   * - The others contain interim `results`. #4 and #7 contain two interim
-   *   `results`, the first portion has a high stability and is less likely to
-   *   change, the second portion has a low stability and is very likely to
-   *   change. A UI designer might choose to show only high stability `results`.
-   * - The specific `stability` and `confidence` values shown above are only for
-   *   illustrative purposes. Actual values may vary.
-   * - The `result_index` indicates the portion of audio that has had final
-   *   results returned, and is no longer being processed. For example, the
-   *   `results` in #6 and later correspond to the portion of audio after
-   *   "to be or not to be".
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.StreamingRecognizeResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1beta1.StreamingRecognizeResponse) - com.google.cloud.speech.v1beta1.StreamingRecognizeResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_StreamingRecognizeResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_StreamingRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse.class, - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse.Builder.class); - } - - // Construct using com.google.cloud.speech.v1beta1.StreamingRecognizeResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getResultsFieldBuilder(); - } - } - - public Builder clear() { - super.clear(); - if (errorBuilder_ == null) { - error_ = null; - } else { - error_ = null; - errorBuilder_ = null; - } - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - resultsBuilder_.clear(); - } - resultIndex_ = 0; - - endpointerType_ = 0; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_StreamingRecognizeResponse_descriptor; - } - - public com.google.cloud.speech.v1beta1.StreamingRecognizeResponse getDefaultInstanceForType() { - return com.google.cloud.speech.v1beta1.StreamingRecognizeResponse.getDefaultInstance(); - } - - public com.google.cloud.speech.v1beta1.StreamingRecognizeResponse build() { - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.cloud.speech.v1beta1.StreamingRecognizeResponse buildPartial() { - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse result = - new com.google.cloud.speech.v1beta1.StreamingRecognizeResponse(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (errorBuilder_ == null) { - result.error_ = error_; - } else { - result.error_ = errorBuilder_.build(); - } - if (resultsBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002)) { - results_ = java.util.Collections.unmodifiableList(results_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.results_ = results_; - } else { - result.results_ = resultsBuilder_.build(); - } - result.resultIndex_ = resultIndex_; - result.endpointerType_ = endpointerType_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1beta1.StreamingRecognizeResponse) { - return mergeFrom((com.google.cloud.speech.v1beta1.StreamingRecognizeResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1beta1.StreamingRecognizeResponse other) { - if (other == com.google.cloud.speech.v1beta1.StreamingRecognizeResponse.getDefaultInstance()) - return this; - if (other.hasError()) { - mergeError(other.getError()); - } - if (resultsBuilder_ == null) { - if (!other.results_.isEmpty()) { - if (results_.isEmpty()) { - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureResultsIsMutable(); - results_.addAll(other.results_); - } - onChanged(); - } - } else { - if (!other.results_.isEmpty()) { - if (resultsBuilder_.isEmpty()) { - resultsBuilder_.dispose(); - resultsBuilder_ = null; - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000002); - resultsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getResultsFieldBuilder() - : null; - } else { - resultsBuilder_.addAllMessages(other.results_); - } - } - } - if (other.getResultIndex() != 0) { - setResultIndex(other.getResultIndex()); - } - if (other.endpointerType_ != 0) { - setEndpointerTypeValue(other.getEndpointerTypeValue()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1beta1.StreamingRecognizeResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private com.google.rpc.Status error_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> - errorBuilder_; - /** - * - * - *
-     * *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public boolean hasError() { - return errorBuilder_ != null || error_ != null; - } - /** - * - * - *
-     * *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public com.google.rpc.Status getError() { - if (errorBuilder_ == null) { - return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; - } else { - return errorBuilder_.getMessage(); - } - } - /** - * - * - *
-     * *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public Builder setError(com.google.rpc.Status value) { - if (errorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - error_ = value; - onChanged(); - } else { - errorBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public Builder setError(com.google.rpc.Status.Builder builderForValue) { - if (errorBuilder_ == null) { - error_ = builderForValue.build(); - onChanged(); - } else { - errorBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public Builder mergeError(com.google.rpc.Status value) { - if (errorBuilder_ == null) { - if (error_ != null) { - error_ = com.google.rpc.Status.newBuilder(error_).mergeFrom(value).buildPartial(); - } else { - error_ = value; - } - onChanged(); - } else { - errorBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public Builder clearError() { - if (errorBuilder_ == null) { - error_ = null; - onChanged(); - } else { - error_ = null; - errorBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public com.google.rpc.Status.Builder getErrorBuilder() { - - onChanged(); - return getErrorFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { - if (errorBuilder_ != null) { - return errorBuilder_.getMessageOrBuilder(); - } else { - return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; - } - } - /** - * - * - *
-     * *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> - getErrorFieldBuilder() { - if (errorBuilder_ == null) { - errorBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, - com.google.rpc.Status.Builder, - com.google.rpc.StatusOrBuilder>(getError(), getParentForChildren(), isClean()); - error_ = null; - } - return errorBuilder_; - } - - private java.util.List results_ = - java.util.Collections.emptyList(); - - private void ensureResultsIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - results_ = - new java.util.ArrayList( - results_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1beta1.StreamingRecognitionResult, - com.google.cloud.speech.v1beta1.StreamingRecognitionResult.Builder, - com.google.cloud.speech.v1beta1.StreamingRecognitionResultOrBuilder> - resultsBuilder_; - - /** - * - * - *
-     * *Output-only* This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public java.util.List - getResultsList() { - if (resultsBuilder_ == null) { - return java.util.Collections.unmodifiableList(results_); - } else { - return resultsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * *Output-only* This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public int getResultsCount() { - if (resultsBuilder_ == null) { - return results_.size(); - } else { - return resultsBuilder_.getCount(); - } - } - /** - * - * - *
-     * *Output-only* This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.StreamingRecognitionResult getResults(int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * *Output-only* This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1beta1.StreamingRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.set(index, value); - onChanged(); - } else { - resultsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * *Output-only* This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public Builder setResults( - int index, - com.google.cloud.speech.v1beta1.StreamingRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.set(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * *Output-only* This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public Builder addResults(com.google.cloud.speech.v1beta1.StreamingRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(value); - onChanged(); - } else { - resultsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * *Output-only* This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1beta1.StreamingRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(index, value); - onChanged(); - } else { - resultsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * *Output-only* This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public Builder addResults( - com.google.cloud.speech.v1beta1.StreamingRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * *Output-only* This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public Builder addResults( - int index, - com.google.cloud.speech.v1beta1.StreamingRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * *Output-only* This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public Builder addAllResults( - java.lang.Iterable - values) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); - onChanged(); - } else { - resultsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * *Output-only* This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public Builder clearResults() { - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - resultsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * *Output-only* This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public Builder removeResults(int index) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.remove(index); - onChanged(); - } else { - resultsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * *Output-only* This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.StreamingRecognitionResult.Builder getResultsBuilder( - int index) { - return getResultsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * *Output-only* This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.StreamingRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * *Output-only* This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public java.util.List< - ? extends com.google.cloud.speech.v1beta1.StreamingRecognitionResultOrBuilder> - getResultsOrBuilderList() { - if (resultsBuilder_ != null) { - return resultsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(results_); - } - } - /** - * - * - *
-     * *Output-only* This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.StreamingRecognitionResult.Builder addResultsBuilder() { - return getResultsFieldBuilder() - .addBuilder( - com.google.cloud.speech.v1beta1.StreamingRecognitionResult.getDefaultInstance()); - } - /** - * - * - *
-     * *Output-only* This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.StreamingRecognitionResult.Builder addResultsBuilder( - int index) { - return getResultsFieldBuilder() - .addBuilder( - index, - com.google.cloud.speech.v1beta1.StreamingRecognitionResult.getDefaultInstance()); - } - /** - * - * - *
-     * *Output-only* This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - public java.util.List - getResultsBuilderList() { - return getResultsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1beta1.StreamingRecognitionResult, - com.google.cloud.speech.v1beta1.StreamingRecognitionResult.Builder, - com.google.cloud.speech.v1beta1.StreamingRecognitionResultOrBuilder> - getResultsFieldBuilder() { - if (resultsBuilder_ == null) { - resultsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1beta1.StreamingRecognitionResult, - com.google.cloud.speech.v1beta1.StreamingRecognitionResult.Builder, - com.google.cloud.speech.v1beta1.StreamingRecognitionResultOrBuilder>( - results_, - ((bitField0_ & 0x00000002) == 0x00000002), - getParentForChildren(), - isClean()); - results_ = null; - } - return resultsBuilder_; - } - - private int resultIndex_; - /** - * - * - *
-     * *Output-only* Indicates the lowest index in the `results` array that has
-     * changed. The repeated `StreamingRecognitionResult` results overwrite past
-     * results at this index and higher.
-     * 
- * - * int32 result_index = 3; - */ - public int getResultIndex() { - return resultIndex_; - } - /** - * - * - *
-     * *Output-only* Indicates the lowest index in the `results` array that has
-     * changed. The repeated `StreamingRecognitionResult` results overwrite past
-     * results at this index and higher.
-     * 
- * - * int32 result_index = 3; - */ - public Builder setResultIndex(int value) { - - resultIndex_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * *Output-only* Indicates the lowest index in the `results` array that has
-     * changed. The repeated `StreamingRecognitionResult` results overwrite past
-     * results at this index and higher.
-     * 
- * - * int32 result_index = 3; - */ - public Builder clearResultIndex() { - - resultIndex_ = 0; - onChanged(); - return this; - } - - private int endpointerType_ = 0; - /** - * - * - *
-     * *Output-only* Indicates the type of endpointer event.
-     * 
- * - * - * .google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType endpointer_type = 4; - * - */ - public int getEndpointerTypeValue() { - return endpointerType_; - } - /** - * - * - *
-     * *Output-only* Indicates the type of endpointer event.
-     * 
- * - * - * .google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType endpointer_type = 4; - * - */ - public Builder setEndpointerTypeValue(int value) { - endpointerType_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * *Output-only* Indicates the type of endpointer event.
-     * 
- * - * - * .google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType endpointer_type = 4; - * - */ - public com.google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType - getEndpointerType() { - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType result = - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType.valueOf( - endpointerType_); - return result == null - ? com.google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType.UNRECOGNIZED - : result; - } - /** - * - * - *
-     * *Output-only* Indicates the type of endpointer event.
-     * 
- * - * - * .google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType endpointer_type = 4; - * - */ - public Builder setEndpointerType( - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType value) { - if (value == null) { - throw new NullPointerException(); - } - - endpointerType_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * *Output-only* Indicates the type of endpointer event.
-     * 
- * - * - * .google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType endpointer_type = 4; - * - */ - public Builder clearEndpointerType() { - - endpointerType_ = 0; - onChanged(); - return this; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1beta1.StreamingRecognizeResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1beta1.StreamingRecognizeResponse) - private static final com.google.cloud.speech.v1beta1.StreamingRecognizeResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1beta1.StreamingRecognizeResponse(); - } - - public static com.google.cloud.speech.v1beta1.StreamingRecognizeResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public StreamingRecognizeResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingRecognizeResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.cloud.speech.v1beta1.StreamingRecognizeResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognizeResponseOrBuilder.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognizeResponseOrBuilder.java deleted file mode 100644 index e63e31309..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/StreamingRecognizeResponseOrBuilder.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -public interface StreamingRecognizeResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1beta1.StreamingRecognizeResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - */ - boolean hasError(); - /** - * - * - *
-   * *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - */ - com.google.rpc.Status getError(); - /** - * - * - *
-   * *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - */ - com.google.rpc.StatusOrBuilder getErrorOrBuilder(); - - /** - * - * - *
-   * *Output-only* This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - java.util.List getResultsList(); - /** - * - * - *
-   * *Output-only* This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - com.google.cloud.speech.v1beta1.StreamingRecognitionResult getResults(int index); - /** - * - * - *
-   * *Output-only* This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - int getResultsCount(); - /** - * - * - *
-   * *Output-only* This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - java.util.List - getResultsOrBuilderList(); - /** - * - * - *
-   * *Output-only* This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.StreamingRecognitionResult results = 2; - */ - com.google.cloud.speech.v1beta1.StreamingRecognitionResultOrBuilder getResultsOrBuilder( - int index); - - /** - * - * - *
-   * *Output-only* Indicates the lowest index in the `results` array that has
-   * changed. The repeated `StreamingRecognitionResult` results overwrite past
-   * results at this index and higher.
-   * 
- * - * int32 result_index = 3; - */ - int getResultIndex(); - - /** - * - * - *
-   * *Output-only* Indicates the type of endpointer event.
-   * 
- * - * - * .google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType endpointer_type = 4; - * - */ - int getEndpointerTypeValue(); - /** - * - * - *
-   * *Output-only* Indicates the type of endpointer event.
-   * 
- * - * - * .google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType endpointer_type = 4; - * - */ - com.google.cloud.speech.v1beta1.StreamingRecognizeResponse.EndpointerType getEndpointerType(); -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SyncRecognizeRequest.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SyncRecognizeRequest.java deleted file mode 100644 index e8c9f8865..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SyncRecognizeRequest.java +++ /dev/null @@ -1,974 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -/** - * - * - *
- * The top-level message sent by the client for the `SyncRecognize` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.SyncRecognizeRequest} - */ -public final class SyncRecognizeRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1beta1.SyncRecognizeRequest) - SyncRecognizeRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use SyncRecognizeRequest.newBuilder() to construct. - private SyncRecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SyncRecognizeRequest() {} - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private SyncRecognizeRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: - { - com.google.cloud.speech.v1beta1.RecognitionConfig.Builder subBuilder = null; - if (config_ != null) { - subBuilder = config_.toBuilder(); - } - config_ = - input.readMessage( - com.google.cloud.speech.v1beta1.RecognitionConfig.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(config_); - config_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.cloud.speech.v1beta1.RecognitionAudio.Builder subBuilder = null; - if (audio_ != null) { - subBuilder = audio_.toBuilder(); - } - audio_ = - input.readMessage( - com.google.cloud.speech.v1beta1.RecognitionAudio.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(audio_); - audio_ = subBuilder.buildPartial(); - } - - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SyncRecognizeRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SyncRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.SyncRecognizeRequest.class, - com.google.cloud.speech.v1beta1.SyncRecognizeRequest.Builder.class); - } - - public static final int CONFIG_FIELD_NUMBER = 1; - private com.google.cloud.speech.v1beta1.RecognitionConfig config_; - /** - * - * - *
-   * *Required* Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public boolean hasConfig() { - return config_ != null; - } - /** - * - * - *
-   * *Required* Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public com.google.cloud.speech.v1beta1.RecognitionConfig getConfig() { - return config_ == null - ? com.google.cloud.speech.v1beta1.RecognitionConfig.getDefaultInstance() - : config_; - } - /** - * - * - *
-   * *Required* Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public com.google.cloud.speech.v1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { - return getConfig(); - } - - public static final int AUDIO_FIELD_NUMBER = 2; - private com.google.cloud.speech.v1beta1.RecognitionAudio audio_; - /** - * - * - *
-   * *Required* The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public boolean hasAudio() { - return audio_ != null; - } - /** - * - * - *
-   * *Required* The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public com.google.cloud.speech.v1beta1.RecognitionAudio getAudio() { - return audio_ == null - ? com.google.cloud.speech.v1beta1.RecognitionAudio.getDefaultInstance() - : audio_; - } - /** - * - * - *
-   * *Required* The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public com.google.cloud.speech.v1beta1.RecognitionAudioOrBuilder getAudioOrBuilder() { - return getAudio(); - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (config_ != null) { - output.writeMessage(1, getConfig()); - } - if (audio_ != null) { - output.writeMessage(2, getAudio()); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (config_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getConfig()); - } - if (audio_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAudio()); - } - size += unknownFields.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.v1beta1.SyncRecognizeRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1beta1.SyncRecognizeRequest other = - (com.google.cloud.speech.v1beta1.SyncRecognizeRequest) obj; - - boolean result = true; - result = result && (hasConfig() == other.hasConfig()); - if (hasConfig()) { - result = result && getConfig().equals(other.getConfig()); - } - result = result && (hasAudio() == other.hasAudio()); - if (hasAudio()) { - result = result && getAudio().equals(other.getAudio()); - } - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConfig()) { - hash = (37 * hash) + CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getConfig().hashCode(); - } - if (hasAudio()) { - hash = (37 * hash) + AUDIO_FIELD_NUMBER; - hash = (53 * hash) + getAudio().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1beta1.SyncRecognizeRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.SyncRecognizeRequest 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.v1beta1.SyncRecognizeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.SyncRecognizeRequest 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.v1beta1.SyncRecognizeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.SyncRecognizeRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.speech.v1beta1.SyncRecognizeRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.SyncRecognizeRequest 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.v1beta1.SyncRecognizeRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.SyncRecognizeRequest 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.v1beta1.SyncRecognizeRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.SyncRecognizeRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.cloud.speech.v1beta1.SyncRecognizeRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - 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; - } - /** - * - * - *
-   * The top-level message sent by the client for the `SyncRecognize` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.SyncRecognizeRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1beta1.SyncRecognizeRequest) - com.google.cloud.speech.v1beta1.SyncRecognizeRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SyncRecognizeRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SyncRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.SyncRecognizeRequest.class, - com.google.cloud.speech.v1beta1.SyncRecognizeRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1beta1.SyncRecognizeRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - public Builder clear() { - super.clear(); - if (configBuilder_ == null) { - config_ = null; - } else { - config_ = null; - configBuilder_ = null; - } - if (audioBuilder_ == null) { - audio_ = null; - } else { - audio_ = null; - audioBuilder_ = null; - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SyncRecognizeRequest_descriptor; - } - - public com.google.cloud.speech.v1beta1.SyncRecognizeRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1beta1.SyncRecognizeRequest.getDefaultInstance(); - } - - public com.google.cloud.speech.v1beta1.SyncRecognizeRequest build() { - com.google.cloud.speech.v1beta1.SyncRecognizeRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.cloud.speech.v1beta1.SyncRecognizeRequest buildPartial() { - com.google.cloud.speech.v1beta1.SyncRecognizeRequest result = - new com.google.cloud.speech.v1beta1.SyncRecognizeRequest(this); - if (configBuilder_ == null) { - result.config_ = config_; - } else { - result.config_ = configBuilder_.build(); - } - if (audioBuilder_ == null) { - result.audio_ = audio_; - } else { - result.audio_ = audioBuilder_.build(); - } - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1beta1.SyncRecognizeRequest) { - return mergeFrom((com.google.cloud.speech.v1beta1.SyncRecognizeRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1beta1.SyncRecognizeRequest other) { - if (other == com.google.cloud.speech.v1beta1.SyncRecognizeRequest.getDefaultInstance()) - return this; - if (other.hasConfig()) { - mergeConfig(other.getConfig()); - } - if (other.hasAudio()) { - mergeAudio(other.getAudio()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1beta1.SyncRecognizeRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1beta1.SyncRecognizeRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.speech.v1beta1.RecognitionConfig config_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.RecognitionConfig, - com.google.cloud.speech.v1beta1.RecognitionConfig.Builder, - com.google.cloud.speech.v1beta1.RecognitionConfigOrBuilder> - configBuilder_; - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public boolean hasConfig() { - return configBuilder_ != null || config_ != null; - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public com.google.cloud.speech.v1beta1.RecognitionConfig getConfig() { - if (configBuilder_ == null) { - return config_ == null - ? com.google.cloud.speech.v1beta1.RecognitionConfig.getDefaultInstance() - : config_; - } else { - return configBuilder_.getMessage(); - } - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public Builder setConfig(com.google.cloud.speech.v1beta1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - config_ = value; - onChanged(); - } else { - configBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public Builder setConfig( - com.google.cloud.speech.v1beta1.RecognitionConfig.Builder builderForValue) { - if (configBuilder_ == null) { - config_ = builderForValue.build(); - onChanged(); - } else { - configBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public Builder mergeConfig(com.google.cloud.speech.v1beta1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (config_ != null) { - config_ = - com.google.cloud.speech.v1beta1.RecognitionConfig.newBuilder(config_) - .mergeFrom(value) - .buildPartial(); - } else { - config_ = value; - } - onChanged(); - } else { - configBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public Builder clearConfig() { - if (configBuilder_ == null) { - config_ = null; - onChanged(); - } else { - config_ = null; - configBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public com.google.cloud.speech.v1beta1.RecognitionConfig.Builder getConfigBuilder() { - - onChanged(); - return getConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - public com.google.cloud.speech.v1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { - if (configBuilder_ != null) { - return configBuilder_.getMessageOrBuilder(); - } else { - return config_ == null - ? com.google.cloud.speech.v1beta1.RecognitionConfig.getDefaultInstance() - : config_; - } - } - /** - * - * - *
-     * *Required* Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.RecognitionConfig, - com.google.cloud.speech.v1beta1.RecognitionConfig.Builder, - com.google.cloud.speech.v1beta1.RecognitionConfigOrBuilder> - getConfigFieldBuilder() { - if (configBuilder_ == null) { - configBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.RecognitionConfig, - com.google.cloud.speech.v1beta1.RecognitionConfig.Builder, - com.google.cloud.speech.v1beta1.RecognitionConfigOrBuilder>( - getConfig(), getParentForChildren(), isClean()); - config_ = null; - } - return configBuilder_; - } - - private com.google.cloud.speech.v1beta1.RecognitionAudio audio_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.RecognitionAudio, - com.google.cloud.speech.v1beta1.RecognitionAudio.Builder, - com.google.cloud.speech.v1beta1.RecognitionAudioOrBuilder> - audioBuilder_; - /** - * - * - *
-     * *Required* The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public boolean hasAudio() { - return audioBuilder_ != null || audio_ != null; - } - /** - * - * - *
-     * *Required* The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public com.google.cloud.speech.v1beta1.RecognitionAudio getAudio() { - if (audioBuilder_ == null) { - return audio_ == null - ? com.google.cloud.speech.v1beta1.RecognitionAudio.getDefaultInstance() - : audio_; - } else { - return audioBuilder_.getMessage(); - } - } - /** - * - * - *
-     * *Required* The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public Builder setAudio(com.google.cloud.speech.v1beta1.RecognitionAudio value) { - if (audioBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - audio_ = value; - onChanged(); - } else { - audioBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * *Required* The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public Builder setAudio( - com.google.cloud.speech.v1beta1.RecognitionAudio.Builder builderForValue) { - if (audioBuilder_ == null) { - audio_ = builderForValue.build(); - onChanged(); - } else { - audioBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * *Required* The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public Builder mergeAudio(com.google.cloud.speech.v1beta1.RecognitionAudio value) { - if (audioBuilder_ == null) { - if (audio_ != null) { - audio_ = - com.google.cloud.speech.v1beta1.RecognitionAudio.newBuilder(audio_) - .mergeFrom(value) - .buildPartial(); - } else { - audio_ = value; - } - onChanged(); - } else { - audioBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * *Required* The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public Builder clearAudio() { - if (audioBuilder_ == null) { - audio_ = null; - onChanged(); - } else { - audio_ = null; - audioBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * *Required* The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public com.google.cloud.speech.v1beta1.RecognitionAudio.Builder getAudioBuilder() { - - onChanged(); - return getAudioFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * *Required* The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - public com.google.cloud.speech.v1beta1.RecognitionAudioOrBuilder getAudioOrBuilder() { - if (audioBuilder_ != null) { - return audioBuilder_.getMessageOrBuilder(); - } else { - return audio_ == null - ? com.google.cloud.speech.v1beta1.RecognitionAudio.getDefaultInstance() - : audio_; - } - } - /** - * - * - *
-     * *Required* The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.RecognitionAudio, - com.google.cloud.speech.v1beta1.RecognitionAudio.Builder, - com.google.cloud.speech.v1beta1.RecognitionAudioOrBuilder> - getAudioFieldBuilder() { - if (audioBuilder_ == null) { - audioBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1beta1.RecognitionAudio, - com.google.cloud.speech.v1beta1.RecognitionAudio.Builder, - com.google.cloud.speech.v1beta1.RecognitionAudioOrBuilder>( - getAudio(), getParentForChildren(), isClean()); - audio_ = null; - } - return audioBuilder_; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1beta1.SyncRecognizeRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1beta1.SyncRecognizeRequest) - private static final com.google.cloud.speech.v1beta1.SyncRecognizeRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1beta1.SyncRecognizeRequest(); - } - - public static com.google.cloud.speech.v1beta1.SyncRecognizeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public SyncRecognizeRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SyncRecognizeRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.cloud.speech.v1beta1.SyncRecognizeRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SyncRecognizeRequestOrBuilder.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SyncRecognizeRequestOrBuilder.java deleted file mode 100644 index cc47fd2b0..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SyncRecognizeRequestOrBuilder.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -public interface SyncRecognizeRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1beta1.SyncRecognizeRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * *Required* Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - boolean hasConfig(); - /** - * - * - *
-   * *Required* Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - com.google.cloud.speech.v1beta1.RecognitionConfig getConfig(); - /** - * - * - *
-   * *Required* Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionConfig config = 1; - */ - com.google.cloud.speech.v1beta1.RecognitionConfigOrBuilder getConfigOrBuilder(); - - /** - * - * - *
-   * *Required* The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - boolean hasAudio(); - /** - * - * - *
-   * *Required* The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - com.google.cloud.speech.v1beta1.RecognitionAudio getAudio(); - /** - * - * - *
-   * *Required* The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1beta1.RecognitionAudio audio = 2; - */ - com.google.cloud.speech.v1beta1.RecognitionAudioOrBuilder getAudioOrBuilder(); -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SyncRecognizeResponse.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SyncRecognizeResponse.java deleted file mode 100644 index 6a386a0ae..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SyncRecognizeResponse.java +++ /dev/null @@ -1,963 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -/** - * - * - *
- * The only message returned to the client by `SyncRecognize`. method. It
- * contains the result as zero or more sequential `SpeechRecognitionResult`
- * messages.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.SyncRecognizeResponse} - */ -public final class SyncRecognizeResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1beta1.SyncRecognizeResponse) - SyncRecognizeResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use SyncRecognizeResponse.newBuilder() to construct. - private SyncRecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SyncRecognizeResponse() { - results_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private SyncRecognizeResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - results_ = - new java.util.ArrayList< - com.google.cloud.speech.v1beta1.SpeechRecognitionResult>(); - mutable_bitField0_ |= 0x00000001; - } - results_.add( - input.readMessage( - com.google.cloud.speech.v1beta1.SpeechRecognitionResult.parser(), - extensionRegistry)); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - results_ = java.util.Collections.unmodifiableList(results_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SyncRecognizeResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SyncRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.SyncRecognizeResponse.class, - com.google.cloud.speech.v1beta1.SyncRecognizeResponse.Builder.class); - } - - public static final int RESULTS_FIELD_NUMBER = 2; - private java.util.List results_; - /** - * - * - *
-   * *Output-only* Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List getResultsList() { - return results_; - } - /** - * - * - *
-   * *Output-only* Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsOrBuilderList() { - return results_; - } - /** - * - * - *
-   * *Output-only* Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public int getResultsCount() { - return results_.size(); - } - /** - * - * - *
-   * *Output-only* Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionResult getResults(int index) { - return results_.get(index); - } - /** - * - * - *
-   * *Output-only* Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - return results_.get(index); - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < results_.size(); i++) { - output.writeMessage(2, results_.get(i)); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < results_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, results_.get(i)); - } - size += unknownFields.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.v1beta1.SyncRecognizeResponse)) { - return super.equals(obj); - } - com.google.cloud.speech.v1beta1.SyncRecognizeResponse other = - (com.google.cloud.speech.v1beta1.SyncRecognizeResponse) obj; - - boolean result = true; - result = result && getResultsList().equals(other.getResultsList()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getResultsCount() > 0) { - hash = (37 * hash) + RESULTS_FIELD_NUMBER; - hash = (53 * hash) + getResultsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1beta1.SyncRecognizeResponse parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.SyncRecognizeResponse 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.v1beta1.SyncRecognizeResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.SyncRecognizeResponse 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.v1beta1.SyncRecognizeResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1beta1.SyncRecognizeResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.speech.v1beta1.SyncRecognizeResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.SyncRecognizeResponse 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.v1beta1.SyncRecognizeResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.SyncRecognizeResponse 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.v1beta1.SyncRecognizeResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1beta1.SyncRecognizeResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.speech.v1beta1.SyncRecognizeResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - 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; - } - /** - * - * - *
-   * The only message returned to the client by `SyncRecognize`. method. It
-   * contains the result as zero or more sequential `SpeechRecognitionResult`
-   * messages.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1beta1.SyncRecognizeResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1beta1.SyncRecognizeResponse) - com.google.cloud.speech.v1beta1.SyncRecognizeResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SyncRecognizeResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SyncRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1beta1.SyncRecognizeResponse.class, - com.google.cloud.speech.v1beta1.SyncRecognizeResponse.Builder.class); - } - - // Construct using com.google.cloud.speech.v1beta1.SyncRecognizeResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getResultsFieldBuilder(); - } - } - - public Builder clear() { - super.clear(); - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - resultsBuilder_.clear(); - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.speech.v1beta1.SpeechProto - .internal_static_google_cloud_speech_v1beta1_SyncRecognizeResponse_descriptor; - } - - public com.google.cloud.speech.v1beta1.SyncRecognizeResponse getDefaultInstanceForType() { - return com.google.cloud.speech.v1beta1.SyncRecognizeResponse.getDefaultInstance(); - } - - public com.google.cloud.speech.v1beta1.SyncRecognizeResponse build() { - com.google.cloud.speech.v1beta1.SyncRecognizeResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.cloud.speech.v1beta1.SyncRecognizeResponse buildPartial() { - com.google.cloud.speech.v1beta1.SyncRecognizeResponse result = - new com.google.cloud.speech.v1beta1.SyncRecognizeResponse(this); - int from_bitField0_ = bitField0_; - if (resultsBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - results_ = java.util.Collections.unmodifiableList(results_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.results_ = results_; - } else { - result.results_ = resultsBuilder_.build(); - } - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1beta1.SyncRecognizeResponse) { - return mergeFrom((com.google.cloud.speech.v1beta1.SyncRecognizeResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1beta1.SyncRecognizeResponse other) { - if (other == com.google.cloud.speech.v1beta1.SyncRecognizeResponse.getDefaultInstance()) - return this; - if (resultsBuilder_ == null) { - if (!other.results_.isEmpty()) { - if (results_.isEmpty()) { - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResultsIsMutable(); - results_.addAll(other.results_); - } - onChanged(); - } - } else { - if (!other.results_.isEmpty()) { - if (resultsBuilder_.isEmpty()) { - resultsBuilder_.dispose(); - resultsBuilder_ = null; - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - resultsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getResultsFieldBuilder() - : null; - } else { - resultsBuilder_.addAllMessages(other.results_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1beta1.SyncRecognizeResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1beta1.SyncRecognizeResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List results_ = - java.util.Collections.emptyList(); - - private void ensureResultsIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - results_ = - new java.util.ArrayList( - results_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1beta1.SpeechRecognitionResult, - com.google.cloud.speech.v1beta1.SpeechRecognitionResult.Builder, - com.google.cloud.speech.v1beta1.SpeechRecognitionResultOrBuilder> - resultsBuilder_; - - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsList() { - if (resultsBuilder_ == null) { - return java.util.Collections.unmodifiableList(results_); - } else { - return resultsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public int getResultsCount() { - if (resultsBuilder_ == null) { - return results_.size(); - } else { - return resultsBuilder_.getCount(); - } - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionResult getResults(int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1beta1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.set(index, value); - onChanged(); - } else { - resultsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public Builder setResults( - int index, - com.google.cloud.speech.v1beta1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.set(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults(com.google.cloud.speech.v1beta1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(value); - onChanged(); - } else { - resultsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1beta1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(index, value); - onChanged(); - } else { - resultsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - com.google.cloud.speech.v1beta1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - int index, - com.google.cloud.speech.v1beta1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addAllResults( - java.lang.Iterable - values) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); - onChanged(); - } else { - resultsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public Builder clearResults() { - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - resultsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public Builder removeResults(int index) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.remove(index); - onChanged(); - } else { - resultsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionResult.Builder getResultsBuilder( - int index) { - return getResultsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List< - ? extends com.google.cloud.speech.v1beta1.SpeechRecognitionResultOrBuilder> - getResultsOrBuilderList() { - if (resultsBuilder_ != null) { - return resultsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(results_); - } - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionResult.Builder addResultsBuilder() { - return getResultsFieldBuilder() - .addBuilder(com.google.cloud.speech.v1beta1.SpeechRecognitionResult.getDefaultInstance()); - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1beta1.SpeechRecognitionResult.Builder addResultsBuilder( - int index) { - return getResultsFieldBuilder() - .addBuilder( - index, com.google.cloud.speech.v1beta1.SpeechRecognitionResult.getDefaultInstance()); - } - /** - * - * - *
-     * *Output-only* Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsBuilderList() { - return getResultsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1beta1.SpeechRecognitionResult, - com.google.cloud.speech.v1beta1.SpeechRecognitionResult.Builder, - com.google.cloud.speech.v1beta1.SpeechRecognitionResultOrBuilder> - getResultsFieldBuilder() { - if (resultsBuilder_ == null) { - resultsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1beta1.SpeechRecognitionResult, - com.google.cloud.speech.v1beta1.SpeechRecognitionResult.Builder, - com.google.cloud.speech.v1beta1.SpeechRecognitionResultOrBuilder>( - results_, - ((bitField0_ & 0x00000001) == 0x00000001), - getParentForChildren(), - isClean()); - results_ = null; - } - return resultsBuilder_; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1beta1.SyncRecognizeResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1beta1.SyncRecognizeResponse) - private static final com.google.cloud.speech.v1beta1.SyncRecognizeResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1beta1.SyncRecognizeResponse(); - } - - public static com.google.cloud.speech.v1beta1.SyncRecognizeResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public SyncRecognizeResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SyncRecognizeResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.cloud.speech.v1beta1.SyncRecognizeResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SyncRecognizeResponseOrBuilder.java b/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SyncRecognizeResponseOrBuilder.java deleted file mode 100644 index 4405c3db8..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/java/com/google/cloud/speech/v1beta1/SyncRecognizeResponseOrBuilder.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2019 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/v1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1beta1; - -public interface SyncRecognizeResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1beta1.SyncRecognizeResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * *Output-only* Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - java.util.List getResultsList(); - /** - * - * - *
-   * *Output-only* Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - com.google.cloud.speech.v1beta1.SpeechRecognitionResult getResults(int index); - /** - * - * - *
-   * *Output-only* Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - int getResultsCount(); - /** - * - * - *
-   * *Output-only* Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - java.util.List - getResultsOrBuilderList(); - /** - * - * - *
-   * *Output-only* Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1beta1.SpeechRecognitionResult results = 2; - */ - com.google.cloud.speech.v1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder(int index); -} diff --git a/proto-google-cloud-speech-v1beta1/src/main/proto/google/cloud/speech/v1beta1/cloud_speech.proto b/proto-google-cloud-speech-v1beta1/src/main/proto/google/cloud/speech/v1beta1/cloud_speech.proto deleted file mode 100644 index 82b82d3c0..000000000 --- a/proto-google-cloud-speech-v1beta1/src/main/proto/google/cloud/speech/v1beta1/cloud_speech.proto +++ /dev/null @@ -1,421 +0,0 @@ -// Copyright 2017 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.speech.v1beta1; - -import "google/api/annotations.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/speech/v1beta1;speech"; -option java_multiple_files = true; -option java_outer_classname = "SpeechProto"; -option java_package = "com.google.cloud.speech.v1beta1"; - - -// Service that implements Google Cloud Speech API. -service Speech { - // Performs synchronous speech recognition: receive results after all audio - // has been sent and processed. - rpc SyncRecognize(SyncRecognizeRequest) returns (SyncRecognizeResponse) { - option (google.api.http) = { post: "/v1beta1/speech:syncrecognize" body: "*" }; - } - - // Performs asynchronous speech recognition: receive results via the - // [google.longrunning.Operations] - // (/speech/reference/rest/v1beta1/operations#Operation) - // interface. Returns either an - // `Operation.error` or an `Operation.response` which contains - // an `AsyncRecognizeResponse` message. - rpc AsyncRecognize(AsyncRecognizeRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { post: "/v1beta1/speech:asyncrecognize" body: "*" }; - } - - // Performs bidirectional streaming speech recognition: receive results while - // sending audio. This method is only available via the gRPC API (not REST). - rpc StreamingRecognize(stream StreamingRecognizeRequest) returns (stream StreamingRecognizeResponse); -} - -// The top-level message sent by the client for the `SyncRecognize` method. -message SyncRecognizeRequest { - // *Required* Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1; - - // *Required* The audio data to be recognized. - RecognitionAudio audio = 2; -} - -// The top-level message sent by the client for the `AsyncRecognize` method. -message AsyncRecognizeRequest { - // *Required* Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1; - - // *Required* The audio data to be recognized. - RecognitionAudio audio = 2; -} - -// The top-level message sent by the client for the `StreamingRecognize` method. -// Multiple `StreamingRecognizeRequest` messages are sent. The first message -// must contain a `streaming_config` message and must not contain `audio` data. -// All subsequent messages must contain `audio` data and must not contain a -// `streaming_config` message. -message StreamingRecognizeRequest { - // The streaming request, which is either a streaming config or audio content. - oneof streaming_request { - // Provides information to the recognizer that specifies how to process the - // request. The first `StreamingRecognizeRequest` message must contain a - // `streaming_config` message. - StreamingRecognitionConfig streaming_config = 1; - - // The audio data to be recognized. Sequential chunks of audio data are sent - // in sequential `StreamingRecognizeRequest` messages. The first - // `StreamingRecognizeRequest` message must not contain `audio_content` data - // and all subsequent `StreamingRecognizeRequest` messages must contain - // `audio_content` data. The audio bytes must be encoded as specified in - // `RecognitionConfig`. Note: as with all bytes fields, protobuffers use a - // pure binary representation (not base64). See - // [audio limits](https://cloud.google.com/speech/limits#content). - bytes audio_content = 2; - } -} - -// Provides information to the recognizer that specifies how to process the -// request. -message StreamingRecognitionConfig { - // *Required* Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1; - - // *Optional* If `false` or omitted, the recognizer will perform continuous - // recognition (continuing to wait for and process audio even if the user - // pauses speaking) until the client closes the input stream (gRPC API) or - // until the maximum time limit has been reached. May return multiple - // `StreamingRecognitionResult`s with the `is_final` flag set to `true`. - // - // If `true`, the recognizer will detect a single spoken utterance. When it - // detects that the user has paused or stopped speaking, it will return an - // `END_OF_UTTERANCE` event and cease recognition. It will return no more than - // one `StreamingRecognitionResult` with the `is_final` flag set to `true`. - bool single_utterance = 2; - - // *Optional* If `true`, interim results (tentative hypotheses) may be - // returned as they become available (these interim results are indicated with - // the `is_final=false` flag). - // If `false` or omitted, only `is_final=true` result(s) are returned. - bool interim_results = 3; -} - -// Provides information to the recognizer that specifies how to process the -// request. -message RecognitionConfig { - // Audio encoding of the data sent in the audio message. All encodings support - // only 1 channel (mono) audio. Only `FLAC` includes a header that describes - // the bytes of audio that follow the header. The other encodings are raw - // audio bytes with no header. - // - // For best results, the audio source should be captured and transmitted using - // a lossless encoding (`FLAC` or `LINEAR16`). Recognition accuracy may be - // reduced if lossy codecs (such as AMR, AMR_WB and MULAW) are used to capture - // or transmit the audio, particularly if background noise is present. - enum AudioEncoding { - // Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - ENCODING_UNSPECIFIED = 0; - - // Uncompressed 16-bit signed little-endian samples (Linear PCM). - // This is the only encoding that may be used by `AsyncRecognize`. - LINEAR16 = 1; - - // This is the recommended encoding for `SyncRecognize` and - // `StreamingRecognize` because it uses lossless compression; therefore - // recognition accuracy is not compromised by a lossy codec. - // - // The stream FLAC (Free Lossless Audio Codec) encoding is specified at: - // http://flac.sourceforge.net/documentation.html. - // 16-bit and 24-bit samples are supported. - // Not all fields in STREAMINFO are supported. - FLAC = 2; - - // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. - MULAW = 3; - - // Adaptive Multi-Rate Narrowband codec. `sample_rate` must be 8000 Hz. - AMR = 4; - - // Adaptive Multi-Rate Wideband codec. `sample_rate` must be 16000 Hz. - AMR_WB = 5; - } - - // *Required* Encoding of audio data sent in all `RecognitionAudio` messages. - AudioEncoding encoding = 1; - - // *Required* Sample rate in Hertz of the audio data sent in all - // `RecognitionAudio` messages. Valid values are: 8000-48000. - // 16000 is optimal. For best results, set the sampling rate of the audio - // source to 16000 Hz. If that's not possible, use the native sample rate of - // the audio source (instead of re-sampling). - int32 sample_rate = 2; - - // *Optional* The language of the supplied audio as a BCP-47 language tag. - // Example: "en-GB" https://www.rfc-editor.org/rfc/bcp/bcp47.txt - // If omitted, defaults to "en-US". See - // [Language Support](https://cloud.google.com/speech/docs/languages) - // for a list of the currently supported language codes. - string language_code = 3; - - // *Optional* Maximum number of recognition hypotheses to be returned. - // Specifically, the maximum number of `SpeechRecognitionAlternative` messages - // within each `SpeechRecognitionResult`. - // The server may return fewer than `max_alternatives`. - // Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of - // one. If omitted, will return a maximum of one. - int32 max_alternatives = 4; - - // *Optional* If set to `true`, the server will attempt to filter out - // profanities, replacing all but the initial character in each filtered word - // with asterisks, e.g. "f***". If set to `false` or omitted, profanities - // won't be filtered out. - bool profanity_filter = 5; - - // *Optional* A means to provide context to assist the speech recognition. - SpeechContext speech_context = 6; -} - -// Provides "hints" to the speech recognizer to favor specific words and phrases -// in the results. -message SpeechContext { - // *Optional* A list of strings containing words and phrases "hints" so that - // the speech recognition is more likely to recognize them. This can be used - // to improve the accuracy for specific words and phrases, for example, if - // specific commands are typically spoken by the user. This can also be used - // to add additional words to the vocabulary of the recognizer. See - // [usage limits](https://cloud.google.com/speech/limits#content). - repeated string phrases = 1; -} - -// Contains audio data in the encoding specified in the `RecognitionConfig`. -// Either `content` or `uri` must be supplied. Supplying both or neither -// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See -// [audio limits](https://cloud.google.com/speech/limits#content). -message RecognitionAudio { - // The audio source, which is either inline content or a GCS uri. - oneof audio_source { - // The audio data bytes encoded as specified in - // `RecognitionConfig`. Note: as with all bytes fields, protobuffers use a - // pure binary representation, whereas JSON representations use base64. - bytes content = 1; - - // URI that points to a file that contains audio data bytes as specified in - // `RecognitionConfig`. Currently, only Google Cloud Storage URIs are - // supported, which must be specified in the following format: - // `gs://bucket_name/object_name` (other URI formats return - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see - // [Request URIs](https://cloud.google.com/storage/docs/reference-uris). - string uri = 2; - } -} - -// The only message returned to the client by `SyncRecognize`. method. It -// contains the result as zero or more sequential `SpeechRecognitionResult` -// messages. -message SyncRecognizeResponse { - // *Output-only* Sequential list of transcription results corresponding to - // sequential portions of audio. - repeated SpeechRecognitionResult results = 2; -} - -// The only message returned to the client by `AsyncRecognize`. It contains the -// result as zero or more sequential `SpeechRecognitionResult` messages. It is -// included in the `result.response` field of the `Operation` returned by the -// `GetOperation` call of the `google::longrunning::Operations` service. -message AsyncRecognizeResponse { - // *Output-only* Sequential list of transcription results corresponding to - // sequential portions of audio. - repeated SpeechRecognitionResult results = 2; -} - -// Describes the progress of a long-running `AsyncRecognize` call. It is -// included in the `metadata` field of the `Operation` returned by the -// `GetOperation` call of the `google::longrunning::Operations` service. -message AsyncRecognizeMetadata { - // Approximate percentage of audio processed thus far. Guaranteed to be 100 - // when the audio is fully processed and the results are available. - int32 progress_percent = 1; - - // Time when the request was received. - google.protobuf.Timestamp start_time = 2; - - // Time of the most recent processing update. - google.protobuf.Timestamp last_update_time = 3; -} - -// `StreamingRecognizeResponse` is the only message returned to the client by -// `StreamingRecognize`. A series of one or more `StreamingRecognizeResponse` -// messages are streamed back to the client. -// -// Here's an example of a series of ten `StreamingRecognizeResponse`s that might -// be returned while processing audio: -// -// 1. endpointer_type: START_OF_SPEECH -// -// 2. results { alternatives { transcript: "tube" } stability: 0.01 } -// result_index: 0 -// -// 3. results { alternatives { transcript: "to be a" } stability: 0.01 } -// result_index: 0 -// -// 4. results { alternatives { transcript: "to be" } stability: 0.9 } -// results { alternatives { transcript: " or not to be" } stability: 0.01 } -// result_index: 0 -// -// 5. results { alternatives { transcript: "to be or not to be" -// confidence: 0.92 } -// alternatives { transcript: "to bee or not to bee" } -// is_final: true } -// result_index: 0 -// -// 6. results { alternatives { transcript: " that's" } stability: 0.01 } -// result_index: 1 -// -// 7. results { alternatives { transcript: " that is" } stability: 0.9 } -// results { alternatives { transcript: " the question" } stability: 0.01 } -// result_index: 1 -// -// 8. endpointer_type: END_OF_SPEECH -// -// 9. results { alternatives { transcript: " that is the question" -// confidence: 0.98 } -// alternatives { transcript: " that was the question" } -// is_final: true } -// result_index: 1 -// -// 10. endpointer_type: END_OF_AUDIO -// -// Notes: -// -// - Only two of the above responses #5 and #9 contain final results, they are -// indicated by `is_final: true`. Concatenating these together generates the -// full transcript: "to be or not to be that is the question". -// -// - The others contain interim `results`. #4 and #7 contain two interim -// `results`, the first portion has a high stability and is less likely to -// change, the second portion has a low stability and is very likely to -// change. A UI designer might choose to show only high stability `results`. -// -// - The specific `stability` and `confidence` values shown above are only for -// illustrative purposes. Actual values may vary. -// -// - The `result_index` indicates the portion of audio that has had final -// results returned, and is no longer being processed. For example, the -// `results` in #6 and later correspond to the portion of audio after -// "to be or not to be". -message StreamingRecognizeResponse { - // Indicates the type of endpointer event. - enum EndpointerType { - // No endpointer event specified. - ENDPOINTER_EVENT_UNSPECIFIED = 0; - - // Speech has been detected in the audio stream, and the service is - // beginning to process it. - START_OF_SPEECH = 1; - - // Speech has ceased to be detected in the audio stream. (For example, the - // user may have paused after speaking.) If `single_utterance` is `false`, - // the service will continue to process audio, and if subsequent speech is - // detected, will send another START_OF_SPEECH event. - END_OF_SPEECH = 2; - - // This event is sent after the client has half-closed the input stream gRPC - // connection and the server has received all of the audio. (The server may - // still be processing the audio and may subsequently return additional - // results.) - END_OF_AUDIO = 3; - - // This event is only sent when `single_utterance` is `true`. It indicates - // that the server has detected the end of the user's speech utterance and - // expects no additional speech. Therefore, the server will not process - // additional audio (although it may subsequently return additional - // results). The client should stop sending additional audio data, - // half-close the gRPC connection, and wait for any additional results - // until the server closes the gRPC connection. - END_OF_UTTERANCE = 4; - } - - // *Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that - // specifies the error for the operation. - google.rpc.Status error = 1; - - // *Output-only* This repeated list contains zero or more results that - // correspond to consecutive portions of the audio currently being processed. - // It contains zero or one `is_final=true` result (the newly settled portion), - // followed by zero or more `is_final=false` results. - repeated StreamingRecognitionResult results = 2; - - // *Output-only* Indicates the lowest index in the `results` array that has - // changed. The repeated `StreamingRecognitionResult` results overwrite past - // results at this index and higher. - int32 result_index = 3; - - // *Output-only* Indicates the type of endpointer event. - EndpointerType endpointer_type = 4; -} - -// A streaming speech recognition result corresponding to a portion of the audio -// that is currently being processed. -message StreamingRecognitionResult { - // *Output-only* May contain one or more recognition hypotheses (up to the - // maximum specified in `max_alternatives`). - repeated SpeechRecognitionAlternative alternatives = 1; - - // *Output-only* If `false`, this `StreamingRecognitionResult` represents an - // interim result that may change. If `true`, this is the final time the - // speech service will return this particular `StreamingRecognitionResult`, - // the recognizer will not return any further hypotheses for this portion of - // the transcript and corresponding audio. - bool is_final = 2; - - // *Output-only* An estimate of the likelihood that the recognizer will not - // change its guess about this interim result. Values range from 0.0 - // (completely unstable) to 1.0 (completely stable). - // This field is only provided for interim results (`is_final=false`). - // The default of 0.0 is a sentinel value indicating `stability` was not set. - float stability = 3; -} - -// A speech recognition result corresponding to a portion of the audio. -message SpeechRecognitionResult { - // *Output-only* May contain one or more recognition hypotheses (up to the - // maximum specified in `max_alternatives`). - repeated SpeechRecognitionAlternative alternatives = 1; -} - -// Alternative hypotheses (a.k.a. n-best list). -message SpeechRecognitionAlternative { - // *Output-only* Transcript text representing the words that the user spoke. - string transcript = 1; - - // *Output-only* The confidence estimate between 0.0 and 1.0. A higher number - // indicates an estimated greater likelihood that the recognized words are - // correct. This field is typically provided only for the top hypothesis, and - // only for `is_final=true` results. Clients should not rely on the - // `confidence` field as it is not guaranteed to be accurate, or even set, in - // any of the results. - // The default of 0.0 is a sentinel value indicating `confidence` was not set. - float confidence = 2; -} diff --git a/proto-google-cloud-speech-v1p1beta1/clirr-ignored-differences.xml b/proto-google-cloud-speech-v1p1beta1/clirr-ignored-differences.xml deleted file mode 100644 index 32245c4f8..000000000 --- a/proto-google-cloud-speech-v1p1beta1/clirr-ignored-differences.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - 7012 - com/google/cloud/speech/v1p1beta1/*OrBuilder - * get*(*) - - - 7012 - com/google/cloud/speech/v1p1beta1/*OrBuilder - boolean contains*(*) - - - 7012 - com/google/cloud/speech/v1p1beta1/*OrBuilder - boolean has*(*) - - diff --git a/proto-google-cloud-speech-v1p1beta1/pom.xml b/proto-google-cloud-speech-v1p1beta1/pom.xml deleted file mode 100644 index b07dee586..000000000 --- a/proto-google-cloud-speech-v1p1beta1/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - 4.0.0 - com.google.api.grpc - proto-google-cloud-speech-v1p1beta1 - 0.77.2-SNAPSHOT - proto-google-cloud-speech-v1p1beta1 - PROTO library for proto-google-cloud-speech-v1p1beta1 - - com.google.cloud - google-cloud-speech-parent - 1.24.2-SNAPSHOT - - - - com.google.protobuf - protobuf-java - compile - - - com.google.api.grpc - proto-google-common-protos - compile - - - com.google.guava - guava - - - com.google.api - api-common - - - - - - - org.codehaus.mojo - flatten-maven-plugin - - - - \ No newline at end of file diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClass.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClass.java deleted file mode 100644 index 4583de87f..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClass.java +++ /dev/null @@ -1,1986 +0,0 @@ -/* - * 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/resource.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - * - * - *
- * A set of words or phrases that represents a common concept likely to appear
- * in your audio, for example a list of passenger ship names. CustomClass items
- * can be substituted into placeholders that you set in PhraseSet phrases.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.CustomClass} - */ -public final class CustomClass extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.CustomClass) - CustomClassOrBuilder { - private static final long serialVersionUID = 0L; - // Use CustomClass.newBuilder() to construct. - private CustomClass(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CustomClass() { - name_ = ""; - customClassId_ = ""; - items_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CustomClass(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CustomClass( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - customClassId_ = s; - break; - } - case 26: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - items_ = - new java.util.ArrayList< - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem>(); - mutable_bitField0_ |= 0x00000001; - } - items_.add( - input.readMessage( - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.parser(), - extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - items_ = java.util.Collections.unmodifiableList(items_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_CustomClass_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.CustomClass.class, - com.google.cloud.speech.v1p1beta1.CustomClass.Builder.class); - } - - public interface ClassItemOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.CustomClass.ClassItem) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * The class item's value.
-     * 
- * - * string value = 1; - * - * @return The value. - */ - java.lang.String getValue(); - /** - * - * - *
-     * The class item's value.
-     * 
- * - * string value = 1; - * - * @return The bytes for value. - */ - com.google.protobuf.ByteString getValueBytes(); - } - /** - * - * - *
-   * An item of the class.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.CustomClass.ClassItem} - */ - public static final class ClassItem extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.CustomClass.ClassItem) - ClassItemOrBuilder { - private static final long serialVersionUID = 0L; - // Use ClassItem.newBuilder() to construct. - private ClassItem(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ClassItem() { - value_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ClassItem(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ClassItem( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - value_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.class, - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder.class); - } - - public static final int VALUE_FIELD_NUMBER = 1; - private volatile java.lang.Object value_; - /** - * - * - *
-     * The class item's value.
-     * 
- * - * string value = 1; - * - * @return The value. - */ - @java.lang.Override - public java.lang.String getValue() { - java.lang.Object ref = value_; - 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(); - value_ = s; - return s; - } - } - /** - * - * - *
-     * The class item's value.
-     * 
- * - * string value = 1; - * - * @return The bytes for value. - */ - @java.lang.Override - public com.google.protobuf.ByteString getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - value_ = 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 (!getValueBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getValueBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, value_); - } - size += unknownFields.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.CustomClass.ClassItem)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem other = - (com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem) obj; - - if (!getValue().equals(other.getValue())) return false; - if (!unknownFields.equals(other.unknownFields)) 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) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValue().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem 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.CustomClass.ClassItem parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem 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.CustomClass.ClassItem parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem 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.CustomClass.ClassItem parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem 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.CustomClass.ClassItem parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem 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.CustomClass.ClassItem 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.CustomClass.ClassItem 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.CustomClass.ClassItem 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; - } - /** - * - * - *
-     * An item of the class.
-     * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.CustomClass.ClassItem} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.CustomClass.ClassItem) - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.class, - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - value_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem build() { - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem buildPartial() { - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem result = - new com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem(this); - result.value_ = value_; - 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.CustomClass.ClassItem) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem other) { - if (other == com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.getDefaultInstance()) - return this; - if (!other.getValue().isEmpty()) { - value_ = other.value_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object value_ = ""; - /** - * - * - *
-       * The class item's value.
-       * 
- * - * string value = 1; - * - * @return The value. - */ - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * The class item's value.
-       * 
- * - * string value = 1; - * - * @return The bytes for value. - */ - public com.google.protobuf.ByteString getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * The class item's value.
-       * 
- * - * string value = 1; - * - * @param value The value to set. - * @return This builder for chaining. - */ - public Builder setValue(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - value_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * The class item's value.
-       * 
- * - * string value = 1; - * - * @return This builder for chaining. - */ - public Builder clearValue() { - - value_ = getDefaultInstance().getValue(); - onChanged(); - return this; - } - /** - * - * - *
-       * The class item's value.
-       * 
- * - * string value = 1; - * - * @param value The bytes for value to set. - * @return This builder for chaining. - */ - public Builder setValueBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - value_ = 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.CustomClass.ClassItem) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.CustomClass.ClassItem) - private static final com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem(); - } - - public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ClassItem parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ClassItem(input, extensionRegistry); - } - }; - - 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.CustomClass.ClassItem getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-   * The resource name of the custom class.
-   * 
- * - * string name = 1; - * - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - 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(); - name_ = s; - return s; - } - } - /** - * - * - *
-   * The resource name of the custom class.
-   * 
- * - * string name = 1; - * - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CUSTOM_CLASS_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object customClassId_; - /** - * - * - *
-   * If this custom class is a resource, the custom_class_id is the resource id
-   * of the CustomClass.
-   * 
- * - * string custom_class_id = 2; - * - * @return The customClassId. - */ - @java.lang.Override - public java.lang.String getCustomClassId() { - java.lang.Object ref = customClassId_; - 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(); - customClassId_ = s; - return s; - } - } - /** - * - * - *
-   * If this custom class is a resource, the custom_class_id is the resource id
-   * of the CustomClass.
-   * 
- * - * string custom_class_id = 2; - * - * @return The bytes for customClassId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getCustomClassIdBytes() { - java.lang.Object ref = customClassId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - customClassId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ITEMS_FIELD_NUMBER = 3; - private java.util.List items_; - /** - * - * - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - @java.lang.Override - public java.util.List getItemsList() { - return items_; - } - /** - * - * - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - @java.lang.Override - public java.util.List - getItemsOrBuilderList() { - return items_; - } - /** - * - * - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - @java.lang.Override - public int getItemsCount() { - return items_.size(); - } - /** - * - * - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem getItems(int index) { - return items_.get(index); - } - /** - * - * - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder getItemsOrBuilder( - int index) { - return items_.get(index); - } - - 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 (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!getCustomClassIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, customClassId_); - } - for (int i = 0; i < items_.size(); i++) { - output.writeMessage(3, items_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!getCustomClassIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, customClassId_); - } - for (int i = 0; i < items_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, items_.get(i)); - } - size += unknownFields.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.CustomClass)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.CustomClass other = - (com.google.cloud.speech.v1p1beta1.CustomClass) obj; - - if (!getName().equals(other.getName())) return false; - if (!getCustomClassId().equals(other.getCustomClassId())) return false; - if (!getItemsList().equals(other.getItemsList())) return false; - if (!unknownFields.equals(other.unknownFields)) 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) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + CUSTOM_CLASS_ID_FIELD_NUMBER; - hash = (53 * hash) + getCustomClassId().hashCode(); - if (getItemsCount() > 0) { - hash = (37 * hash) + ITEMS_FIELD_NUMBER; - hash = (53 * hash) + getItemsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.CustomClass 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.CustomClass parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.CustomClass 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.CustomClass parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.CustomClass 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.CustomClass parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.CustomClass 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.CustomClass parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.CustomClass 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.CustomClass 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.CustomClass 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.CustomClass 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; - } - /** - * - * - *
-   * A set of words or phrases that represents a common concept likely to appear
-   * in your audio, for example a list of passenger ship names. CustomClass items
-   * can be substituted into placeholders that you set in PhraseSet phrases.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.CustomClass} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.CustomClass) - com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_CustomClass_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.CustomClass.class, - com.google.cloud.speech.v1p1beta1.CustomClass.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.CustomClass.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getItemsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - customClassId_ = ""; - - if (itemsBuilder_ == null) { - items_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - itemsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass build() { - com.google.cloud.speech.v1p1beta1.CustomClass result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass buildPartial() { - com.google.cloud.speech.v1p1beta1.CustomClass result = - new com.google.cloud.speech.v1p1beta1.CustomClass(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.customClassId_ = customClassId_; - if (itemsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - items_ = java.util.Collections.unmodifiableList(items_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.items_ = items_; - } else { - result.items_ = itemsBuilder_.build(); - } - 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.CustomClass) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.CustomClass) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.CustomClass other) { - if (other == com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getCustomClassId().isEmpty()) { - customClassId_ = other.customClassId_; - onChanged(); - } - if (itemsBuilder_ == null) { - if (!other.items_.isEmpty()) { - if (items_.isEmpty()) { - items_ = other.items_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureItemsIsMutable(); - items_.addAll(other.items_); - } - onChanged(); - } - } else { - if (!other.items_.isEmpty()) { - if (itemsBuilder_.isEmpty()) { - itemsBuilder_.dispose(); - itemsBuilder_ = null; - items_ = other.items_; - bitField0_ = (bitField0_ & ~0x00000001); - itemsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getItemsFieldBuilder() - : null; - } else { - itemsBuilder_.addAllMessages(other.items_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.CustomClass parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.CustomClass) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * The resource name of the custom class.
-     * 
- * - * string name = 1; - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The resource name of the custom class.
-     * 
- * - * string name = 1; - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The resource name of the custom class.
-     * 
- * - * string name = 1; - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The resource name of the custom class.
-     * 
- * - * string name = 1; - * - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-     * The resource name of the custom class.
-     * 
- * - * string name = 1; - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object customClassId_ = ""; - /** - * - * - *
-     * If this custom class is a resource, the custom_class_id is the resource id
-     * of the CustomClass.
-     * 
- * - * string custom_class_id = 2; - * - * @return The customClassId. - */ - public java.lang.String getCustomClassId() { - java.lang.Object ref = customClassId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - customClassId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * If this custom class is a resource, the custom_class_id is the resource id
-     * of the CustomClass.
-     * 
- * - * string custom_class_id = 2; - * - * @return The bytes for customClassId. - */ - public com.google.protobuf.ByteString getCustomClassIdBytes() { - java.lang.Object ref = customClassId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - customClassId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * If this custom class is a resource, the custom_class_id is the resource id
-     * of the CustomClass.
-     * 
- * - * string custom_class_id = 2; - * - * @param value The customClassId to set. - * @return This builder for chaining. - */ - public Builder setCustomClassId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - customClassId_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If this custom class is a resource, the custom_class_id is the resource id
-     * of the CustomClass.
-     * 
- * - * string custom_class_id = 2; - * - * @return This builder for chaining. - */ - public Builder clearCustomClassId() { - - customClassId_ = getDefaultInstance().getCustomClassId(); - onChanged(); - return this; - } - /** - * - * - *
-     * If this custom class is a resource, the custom_class_id is the resource id
-     * of the CustomClass.
-     * 
- * - * string custom_class_id = 2; - * - * @param value The bytes for customClassId to set. - * @return This builder for chaining. - */ - public Builder setCustomClassIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - customClassId_ = value; - onChanged(); - return this; - } - - private java.util.List items_ = - java.util.Collections.emptyList(); - - private void ensureItemsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - items_ = - new java.util.ArrayList( - items_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem, - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder, - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder> - itemsBuilder_; - - /** - * - * - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public java.util.List getItemsList() { - if (itemsBuilder_ == null) { - return java.util.Collections.unmodifiableList(items_); - } else { - return itemsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public int getItemsCount() { - if (itemsBuilder_ == null) { - return items_.size(); - } else { - return itemsBuilder_.getCount(); - } - } - /** - * - * - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem getItems(int index) { - if (itemsBuilder_ == null) { - return items_.get(index); - } else { - return itemsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public Builder setItems( - int index, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.set(index, value); - onChanged(); - } else { - itemsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public Builder setItems( - int index, - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.set(index, builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public Builder addItems(com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.add(value); - onChanged(); - } else { - itemsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public Builder addItems( - int index, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.add(index, value); - onChanged(); - } else { - itemsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public Builder addItems( - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.add(builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public Builder addItems( - int index, - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.add(index, builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public Builder addAllItems( - java.lang.Iterable - values) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, items_); - onChanged(); - } else { - itemsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public Builder clearItems() { - if (itemsBuilder_ == null) { - items_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - itemsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public Builder removeItems(int index) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.remove(index); - onChanged(); - } else { - itemsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder getItemsBuilder( - int index) { - return getItemsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder getItemsOrBuilder( - int index) { - if (itemsBuilder_ == null) { - return items_.get(index); - } else { - return itemsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public java.util.List< - ? extends com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder> - getItemsOrBuilderList() { - if (itemsBuilder_ != null) { - return itemsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(items_); - } - } - /** - * - * - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder addItemsBuilder() { - return getItemsFieldBuilder() - .addBuilder(com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.getDefaultInstance()); - } - /** - * - * - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder addItemsBuilder( - int index) { - return getItemsFieldBuilder() - .addBuilder( - index, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.getDefaultInstance()); - } - /** - * - * - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public java.util.List - getItemsBuilderList() { - return getItemsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem, - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder, - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder> - getItemsFieldBuilder() { - if (itemsBuilder_ == null) { - itemsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem, - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder, - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder>( - items_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - items_ = null; - } - return itemsBuilder_; - } - - @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.CustomClass) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.CustomClass) - private static final com.google.cloud.speech.v1p1beta1.CustomClass DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.CustomClass(); - } - - public static com.google.cloud.speech.v1p1beta1.CustomClass getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CustomClass parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CustomClass(input, extensionRegistry); - } - }; - - 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.CustomClass getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassName.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassName.java deleted file mode 100644 index 3fc961136..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassName.java +++ /dev/null @@ -1,215 +0,0 @@ -/* - * 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. - */ - -package com.google.cloud.speech.v1p1beta1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") -public class CustomClassName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/locations/{location}/customClasses/{custom_class}"); - - private volatile Map fieldValuesMap; - - private final String project; - private final String location; - private final String customClass; - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public String getCustomClass() { - return customClass; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private CustomClassName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - customClass = Preconditions.checkNotNull(builder.getCustomClass()); - } - - public static CustomClassName of(String project, String location, String customClass) { - return newBuilder() - .setProject(project) - .setLocation(location) - .setCustomClass(customClass) - .build(); - } - - public static String format(String project, String location, String customClass) { - return newBuilder() - .setProject(project) - .setLocation(location) - .setCustomClass(customClass) - .build() - .toString(); - } - - public static CustomClassName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PATH_TEMPLATE.validatedMatch( - formattedString, "CustomClassName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("custom_class")); - } - - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); - for (String formattedString : formattedStrings) { - list.add(parse(formattedString)); - } - return list; - } - - public static List toStringList(List values) { - List list = new ArrayList(values.size()); - for (CustomClassName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("customClass", customClass); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "project", project, "location", location, "custom_class", customClass); - } - - /** Builder for CustomClassName. */ - public static class Builder { - - private String project; - private String location; - private String customClass; - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public String getCustomClass() { - return customClass; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setLocation(String location) { - this.location = location; - return this; - } - - public Builder setCustomClass(String customClass) { - this.customClass = customClass; - return this; - } - - private Builder() {} - - private Builder(CustomClassName customClassName) { - project = customClassName.project; - location = customClassName.location; - customClass = customClassName.customClass; - } - - public CustomClassName build() { - return new CustomClassName(this); - } - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof CustomClassName) { - CustomClassName that = (CustomClassName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.customClass.equals(that.customClass)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= customClass.hashCode(); - return h; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassOrBuilder.java deleted file mode 100644 index b6f23c994..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassOrBuilder.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * 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/resource.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface CustomClassOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.CustomClass) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The resource name of the custom class.
-   * 
- * - * string name = 1; - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * The resource name of the custom class.
-   * 
- * - * string name = 1; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-   * If this custom class is a resource, the custom_class_id is the resource id
-   * of the CustomClass.
-   * 
- * - * string custom_class_id = 2; - * - * @return The customClassId. - */ - java.lang.String getCustomClassId(); - /** - * - * - *
-   * If this custom class is a resource, the custom_class_id is the resource id
-   * of the CustomClass.
-   * 
- * - * string custom_class_id = 2; - * - * @return The bytes for customClassId. - */ - com.google.protobuf.ByteString getCustomClassIdBytes(); - - /** - * - * - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - java.util.List getItemsList(); - /** - * - * - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem getItems(int index); - /** - * - * - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - int getItemsCount(); - /** - * - * - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - java.util.List - getItemsOrBuilderList(); - /** - * - * - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder getItemsOrBuilder(int index); -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java deleted file mode 100644 index a54d7fac9..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java +++ /dev/null @@ -1,1292 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * Describes the progress of a long-running `LongRunningRecognize` call. It is
- * included in the `metadata` field of the `Operation` returned by the
- * `GetOperation` call of the `google::longrunning::Operations` service.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} - */ -public final class LongRunningRecognizeMetadata extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) - LongRunningRecognizeMetadataOrBuilder { - private static final long serialVersionUID = 0L; - // Use LongRunningRecognizeMetadata.newBuilder() to construct. - private LongRunningRecognizeMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private LongRunningRecognizeMetadata() { - uri_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new LongRunningRecognizeMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private LongRunningRecognizeMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - progressPercent_ = input.readInt32(); - break; - } - case 18: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (startTime_ != null) { - subBuilder = startTime_.toBuilder(); - } - startTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(startTime_); - startTime_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (lastUpdateTime_ != null) { - subBuilder = lastUpdateTime_.toBuilder(); - } - lastUpdateTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(lastUpdateTime_); - lastUpdateTime_ = subBuilder.buildPartial(); - } - - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - uri_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.class, - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.Builder.class); - } - - public static final int PROGRESS_PERCENT_FIELD_NUMBER = 1; - private int progressPercent_; - /** - * - * - *
-   * Approximate percentage of audio processed thus far. Guaranteed to be 100
-   * when the audio is fully processed and the results are available.
-   * 
- * - * int32 progress_percent = 1; - * - * @return The progressPercent. - */ - @java.lang.Override - public int getProgressPercent() { - return progressPercent_; - } - - public static final int START_TIME_FIELD_NUMBER = 2; - private com.google.protobuf.Timestamp startTime_; - /** - * - * - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - * - * @return Whether the startTime field is set. - */ - @java.lang.Override - public boolean hasStartTime() { - return startTime_ != null; - } - /** - * - * - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - * - * @return The startTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getStartTime() { - return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; - } - /** - * - * - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { - return getStartTime(); - } - - public static final int LAST_UPDATE_TIME_FIELD_NUMBER = 3; - private com.google.protobuf.Timestamp lastUpdateTime_; - /** - * - * - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * - * @return Whether the lastUpdateTime field is set. - */ - @java.lang.Override - public boolean hasLastUpdateTime() { - return lastUpdateTime_ != null; - } - /** - * - * - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * - * @return The lastUpdateTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getLastUpdateTime() { - return lastUpdateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : lastUpdateTime_; - } - /** - * - * - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder() { - return getLastUpdateTime(); - } - - public static final int URI_FIELD_NUMBER = 4; - private volatile java.lang.Object uri_; - /** - * - * - *
-   * The URI of the audio file being transcribed. Empty if the audio was sent
-   * as byte content.
-   * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The uri. - */ - @java.lang.Override - public java.lang.String getUri() { - java.lang.Object ref = uri_; - 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(); - uri_ = s; - return s; - } - } - /** - * - * - *
-   * The URI of the audio file being transcribed. Empty if the audio was sent
-   * as byte content.
-   * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for uri. - */ - @java.lang.Override - public com.google.protobuf.ByteString getUriBytes() { - java.lang.Object ref = uri_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - uri_ = 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 (progressPercent_ != 0) { - output.writeInt32(1, progressPercent_); - } - if (startTime_ != null) { - output.writeMessage(2, getStartTime()); - } - if (lastUpdateTime_ != null) { - output.writeMessage(3, getLastUpdateTime()); - } - if (!getUriBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, uri_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (progressPercent_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, progressPercent_); - } - if (startTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); - } - if (lastUpdateTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getLastUpdateTime()); - } - if (!getUriBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, uri_); - } - size += unknownFields.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.LongRunningRecognizeMetadata)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata other = - (com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) obj; - - if (getProgressPercent() != other.getProgressPercent()) return false; - if (hasStartTime() != other.hasStartTime()) return false; - if (hasStartTime()) { - if (!getStartTime().equals(other.getStartTime())) return false; - } - if (hasLastUpdateTime() != other.hasLastUpdateTime()) return false; - if (hasLastUpdateTime()) { - if (!getLastUpdateTime().equals(other.getLastUpdateTime())) return false; - } - if (!getUri().equals(other.getUri())) return false; - if (!unknownFields.equals(other.unknownFields)) 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) + PROGRESS_PERCENT_FIELD_NUMBER; - hash = (53 * hash) + getProgressPercent(); - if (hasStartTime()) { - hash = (37 * hash) + START_TIME_FIELD_NUMBER; - hash = (53 * hash) + getStartTime().hashCode(); - } - if (hasLastUpdateTime()) { - hash = (37 * hash) + LAST_UPDATE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getLastUpdateTime().hashCode(); - } - hash = (37 * hash) + URI_FIELD_NUMBER; - hash = (53 * hash) + getUri().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata 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.LongRunningRecognizeMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata 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.LongRunningRecognizeMetadata parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata 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.LongRunningRecognizeMetadata parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata 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.LongRunningRecognizeMetadata parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata 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.LongRunningRecognizeMetadata 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.LongRunningRecognizeMetadata 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.LongRunningRecognizeMetadata 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; - } - /** - * - * - *
-   * Describes the progress of a long-running `LongRunningRecognize` call. It is
-   * included in the `metadata` field of the `Operation` returned by the
-   * `GetOperation` call of the `google::longrunning::Operations` service.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.class, - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - progressPercent_ = 0; - - if (startTimeBuilder_ == null) { - startTime_ = null; - } else { - startTime_ = null; - startTimeBuilder_ = null; - } - if (lastUpdateTimeBuilder_ == null) { - lastUpdateTime_ = null; - } else { - lastUpdateTime_ = null; - lastUpdateTimeBuilder_ = null; - } - uri_ = ""; - - 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_LongRunningRecognizeMetadata_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata - getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata build() { - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata buildPartial() { - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata result = - new com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata(this); - result.progressPercent_ = progressPercent_; - if (startTimeBuilder_ == null) { - result.startTime_ = startTime_; - } else { - result.startTime_ = startTimeBuilder_.build(); - } - if (lastUpdateTimeBuilder_ == null) { - result.lastUpdateTime_ = lastUpdateTime_; - } else { - result.lastUpdateTime_ = lastUpdateTimeBuilder_.build(); - } - result.uri_ = uri_; - 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.LongRunningRecognizeMetadata) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata other) { - if (other - == com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.getDefaultInstance()) - return this; - if (other.getProgressPercent() != 0) { - setProgressPercent(other.getProgressPercent()); - } - if (other.hasStartTime()) { - mergeStartTime(other.getStartTime()); - } - if (other.hasLastUpdateTime()) { - mergeLastUpdateTime(other.getLastUpdateTime()); - } - if (!other.getUri().isEmpty()) { - uri_ = other.uri_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int progressPercent_; - /** - * - * - *
-     * Approximate percentage of audio processed thus far. Guaranteed to be 100
-     * when the audio is fully processed and the results are available.
-     * 
- * - * int32 progress_percent = 1; - * - * @return The progressPercent. - */ - @java.lang.Override - public int getProgressPercent() { - return progressPercent_; - } - /** - * - * - *
-     * Approximate percentage of audio processed thus far. Guaranteed to be 100
-     * when the audio is fully processed and the results are available.
-     * 
- * - * int32 progress_percent = 1; - * - * @param value The progressPercent to set. - * @return This builder for chaining. - */ - public Builder setProgressPercent(int value) { - - progressPercent_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Approximate percentage of audio processed thus far. Guaranteed to be 100
-     * when the audio is fully processed and the results are available.
-     * 
- * - * int32 progress_percent = 1; - * - * @return This builder for chaining. - */ - public Builder clearProgressPercent() { - - progressPercent_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp startTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - startTimeBuilder_; - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - * - * @return Whether the startTime field is set. - */ - public boolean hasStartTime() { - return startTimeBuilder_ != null || startTime_ != null; - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - * - * @return The startTime. - */ - public com.google.protobuf.Timestamp getStartTime() { - if (startTimeBuilder_ == null) { - return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; - } else { - return startTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public Builder setStartTime(com.google.protobuf.Timestamp value) { - if (startTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - startTime_ = value; - onChanged(); - } else { - startTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (startTimeBuilder_ == null) { - startTime_ = builderForValue.build(); - onChanged(); - } else { - startTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public Builder mergeStartTime(com.google.protobuf.Timestamp value) { - if (startTimeBuilder_ == null) { - if (startTime_ != null) { - startTime_ = - com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); - } else { - startTime_ = value; - } - onChanged(); - } else { - startTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public Builder clearStartTime() { - if (startTimeBuilder_ == null) { - startTime_ = null; - onChanged(); - } else { - startTime_ = null; - startTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { - - onChanged(); - return getStartTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { - if (startTimeBuilder_ != null) { - return startTimeBuilder_.getMessageOrBuilder(); - } else { - return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; - } - } - /** - * - * - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getStartTimeFieldBuilder() { - if (startTimeBuilder_ == null) { - startTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getStartTime(), getParentForChildren(), isClean()); - startTime_ = null; - } - return startTimeBuilder_; - } - - private com.google.protobuf.Timestamp lastUpdateTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - lastUpdateTimeBuilder_; - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * - * @return Whether the lastUpdateTime field is set. - */ - public boolean hasLastUpdateTime() { - return lastUpdateTimeBuilder_ != null || lastUpdateTime_ != null; - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * - * @return The lastUpdateTime. - */ - public com.google.protobuf.Timestamp getLastUpdateTime() { - if (lastUpdateTimeBuilder_ == null) { - return lastUpdateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : lastUpdateTime_; - } else { - return lastUpdateTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public Builder setLastUpdateTime(com.google.protobuf.Timestamp value) { - if (lastUpdateTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - lastUpdateTime_ = value; - onChanged(); - } else { - lastUpdateTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public Builder setLastUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (lastUpdateTimeBuilder_ == null) { - lastUpdateTime_ = builderForValue.build(); - onChanged(); - } else { - lastUpdateTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public Builder mergeLastUpdateTime(com.google.protobuf.Timestamp value) { - if (lastUpdateTimeBuilder_ == null) { - if (lastUpdateTime_ != null) { - lastUpdateTime_ = - com.google.protobuf.Timestamp.newBuilder(lastUpdateTime_) - .mergeFrom(value) - .buildPartial(); - } else { - lastUpdateTime_ = value; - } - onChanged(); - } else { - lastUpdateTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public Builder clearLastUpdateTime() { - if (lastUpdateTimeBuilder_ == null) { - lastUpdateTime_ = null; - onChanged(); - } else { - lastUpdateTime_ = null; - lastUpdateTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public com.google.protobuf.Timestamp.Builder getLastUpdateTimeBuilder() { - - onChanged(); - return getLastUpdateTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder() { - if (lastUpdateTimeBuilder_ != null) { - return lastUpdateTimeBuilder_.getMessageOrBuilder(); - } else { - return lastUpdateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : lastUpdateTime_; - } - } - /** - * - * - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getLastUpdateTimeFieldBuilder() { - if (lastUpdateTimeBuilder_ == null) { - lastUpdateTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getLastUpdateTime(), getParentForChildren(), isClean()); - lastUpdateTime_ = null; - } - return lastUpdateTimeBuilder_; - } - - private java.lang.Object uri_ = ""; - /** - * - * - *
-     * The URI of the audio file being transcribed. Empty if the audio was sent
-     * as byte content.
-     * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The uri. - */ - public java.lang.String getUri() { - java.lang.Object ref = uri_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uri_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The URI of the audio file being transcribed. Empty if the audio was sent
-     * as byte content.
-     * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for uri. - */ - public com.google.protobuf.ByteString getUriBytes() { - java.lang.Object ref = uri_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - uri_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The URI of the audio file being transcribed. Empty if the audio was sent
-     * as byte content.
-     * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The uri to set. - * @return This builder for chaining. - */ - public Builder setUri(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - uri_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The URI of the audio file being transcribed. Empty if the audio was sent
-     * as byte content.
-     * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return This builder for chaining. - */ - public Builder clearUri() { - - uri_ = getDefaultInstance().getUri(); - onChanged(); - return this; - } - /** - * - * - *
-     * The URI of the audio file being transcribed. Empty if the audio was sent
-     * as byte content.
-     * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The bytes for uri to set. - * @return This builder for chaining. - */ - public Builder setUriBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - uri_ = 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.LongRunningRecognizeMetadata) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) - private static final com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata(); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public LongRunningRecognizeMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new LongRunningRecognizeMetadata(input, extensionRegistry); - } - }; - - 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.LongRunningRecognizeMetadata - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java deleted file mode 100644 index 072c108ae..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * 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 LongRunningRecognizeMetadataOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Approximate percentage of audio processed thus far. Guaranteed to be 100
-   * when the audio is fully processed and the results are available.
-   * 
- * - * int32 progress_percent = 1; - * - * @return The progressPercent. - */ - int getProgressPercent(); - - /** - * - * - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - * - * @return Whether the startTime field is set. - */ - boolean hasStartTime(); - /** - * - * - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - * - * @return The startTime. - */ - com.google.protobuf.Timestamp getStartTime(); - /** - * - * - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); - - /** - * - * - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * - * @return Whether the lastUpdateTime field is set. - */ - boolean hasLastUpdateTime(); - /** - * - * - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * - * @return The lastUpdateTime. - */ - com.google.protobuf.Timestamp getLastUpdateTime(); - /** - * - * - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder(); - - /** - * - * - *
-   * The URI of the audio file being transcribed. Empty if the audio was sent
-   * as byte content.
-   * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The uri. - */ - java.lang.String getUri(); - /** - * - * - *
-   * The URI of the audio file being transcribed. Empty if the audio was sent
-   * as byte content.
-   * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for uri. - */ - com.google.protobuf.ByteString getUriBytes(); -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequest.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequest.java deleted file mode 100644 index a19960d8b..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequest.java +++ /dev/null @@ -1,1081 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * The top-level message sent by the client for the `LongRunningRecognize`
- * method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} - */ -public final class LongRunningRecognizeRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) - LongRunningRecognizeRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use LongRunningRecognizeRequest.newBuilder() to construct. - private LongRunningRecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private LongRunningRecognizeRequest() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new LongRunningRecognizeRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private LongRunningRecognizeRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder subBuilder = null; - if (config_ != null) { - subBuilder = config_.toBuilder(); - } - config_ = - input.readMessage( - com.google.cloud.speech.v1p1beta1.RecognitionConfig.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(config_); - config_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder subBuilder = null; - if (audio_ != null) { - subBuilder = audio_.toBuilder(); - } - audio_ = - input.readMessage( - com.google.cloud.speech.v1p1beta1.RecognitionAudio.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(audio_); - audio_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.class, - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.Builder.class); - } - - public static final int CONFIG_FIELD_NUMBER = 1; - private com.google.cloud.speech.v1p1beta1.RecognitionConfig config_; - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the config field is set. - */ - @java.lang.Override - public boolean hasConfig() { - return config_ != null; - } - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The config. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig() { - return config_ == null - ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() - : config_; - } - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { - return getConfig(); - } - - public static final int AUDIO_FIELD_NUMBER = 2; - private com.google.cloud.speech.v1p1beta1.RecognitionAudio audio_; - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the audio field is set. - */ - @java.lang.Override - public boolean hasAudio() { - return audio_ != null; - } - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The audio. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionAudio getAudio() { - return audio_ == null - ? com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance() - : audio_; - } - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder getAudioOrBuilder() { - return getAudio(); - } - - 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 (config_ != null) { - output.writeMessage(1, getConfig()); - } - if (audio_ != null) { - output.writeMessage(2, getAudio()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (config_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getConfig()); - } - if (audio_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAudio()); - } - size += unknownFields.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.LongRunningRecognizeRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest other = - (com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) obj; - - if (hasConfig() != other.hasConfig()) return false; - if (hasConfig()) { - if (!getConfig().equals(other.getConfig())) return false; - } - if (hasAudio() != other.hasAudio()) return false; - if (hasAudio()) { - if (!getAudio().equals(other.getAudio())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConfig()) { - hash = (37 * hash) + CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getConfig().hashCode(); - } - if (hasAudio()) { - hash = (37 * hash) + AUDIO_FIELD_NUMBER; - hash = (53 * hash) + getAudio().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest 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.LongRunningRecognizeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest 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.LongRunningRecognizeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest 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.LongRunningRecognizeRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest 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.LongRunningRecognizeRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest 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.LongRunningRecognizeRequest 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.LongRunningRecognizeRequest 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.LongRunningRecognizeRequest 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; - } - /** - * - * - *
-   * The top-level message sent by the client for the `LongRunningRecognize`
-   * method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.class, - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (configBuilder_ == null) { - config_ = null; - } else { - config_ = null; - configBuilder_ = null; - } - if (audioBuilder_ == null) { - audio_ = null; - } else { - audio_ = null; - audioBuilder_ = null; - } - 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_LongRunningRecognizeRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest - getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest build() { - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest buildPartial() { - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest result = - new com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest(this); - if (configBuilder_ == null) { - result.config_ = config_; - } else { - result.config_ = configBuilder_.build(); - } - if (audioBuilder_ == null) { - result.audio_ = audio_; - } else { - result.audio_ = audioBuilder_.build(); - } - 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.LongRunningRecognizeRequest) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest other) { - if (other - == com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.getDefaultInstance()) - return this; - if (other.hasConfig()) { - mergeConfig(other.getConfig()); - } - if (other.hasAudio()) { - mergeAudio(other.getAudio()); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.speech.v1p1beta1.RecognitionConfig config_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionConfig, - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, - com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder> - configBuilder_; - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the config field is set. - */ - public boolean hasConfig() { - return configBuilder_ != null || config_ != null; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The config. - */ - public com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig() { - if (configBuilder_ == null) { - return config_ == null - ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() - : config_; - } else { - return configBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setConfig(com.google.cloud.speech.v1p1beta1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - config_ = value; - onChanged(); - } else { - configBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setConfig( - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder builderForValue) { - if (configBuilder_ == null) { - config_ = builderForValue.build(); - onChanged(); - } else { - configBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeConfig(com.google.cloud.speech.v1p1beta1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (config_ != null) { - config_ = - com.google.cloud.speech.v1p1beta1.RecognitionConfig.newBuilder(config_) - .mergeFrom(value) - .buildPartial(); - } else { - config_ = value; - } - onChanged(); - } else { - configBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearConfig() { - if (configBuilder_ == null) { - config_ = null; - onChanged(); - } else { - config_ = null; - configBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder getConfigBuilder() { - - onChanged(); - return getConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { - if (configBuilder_ != null) { - return configBuilder_.getMessageOrBuilder(); - } else { - return config_ == null - ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() - : config_; - } - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionConfig, - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, - com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder> - getConfigFieldBuilder() { - if (configBuilder_ == null) { - configBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionConfig, - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, - com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder>( - getConfig(), getParentForChildren(), isClean()); - config_ = null; - } - return configBuilder_; - } - - private com.google.cloud.speech.v1p1beta1.RecognitionAudio audio_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionAudio, - com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder, - com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder> - audioBuilder_; - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the audio field is set. - */ - public boolean hasAudio() { - return audioBuilder_ != null || audio_ != null; - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The audio. - */ - public com.google.cloud.speech.v1p1beta1.RecognitionAudio getAudio() { - if (audioBuilder_ == null) { - return audio_ == null - ? com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance() - : audio_; - } else { - return audioBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setAudio(com.google.cloud.speech.v1p1beta1.RecognitionAudio value) { - if (audioBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - audio_ = value; - onChanged(); - } else { - audioBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setAudio( - com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder builderForValue) { - if (audioBuilder_ == null) { - audio_ = builderForValue.build(); - onChanged(); - } else { - audioBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeAudio(com.google.cloud.speech.v1p1beta1.RecognitionAudio value) { - if (audioBuilder_ == null) { - if (audio_ != null) { - audio_ = - com.google.cloud.speech.v1p1beta1.RecognitionAudio.newBuilder(audio_) - .mergeFrom(value) - .buildPartial(); - } else { - audio_ = value; - } - onChanged(); - } else { - audioBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearAudio() { - if (audioBuilder_ == null) { - audio_ = null; - onChanged(); - } else { - audio_ = null; - audioBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder getAudioBuilder() { - - onChanged(); - return getAudioFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder getAudioOrBuilder() { - if (audioBuilder_ != null) { - return audioBuilder_.getMessageOrBuilder(); - } else { - return audio_ == null - ? com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance() - : audio_; - } - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionAudio, - com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder, - com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder> - getAudioFieldBuilder() { - if (audioBuilder_ == null) { - audioBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionAudio, - com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder, - com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder>( - getAudio(), getParentForChildren(), isClean()); - audio_ = null; - } - return audioBuilder_; - } - - @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.LongRunningRecognizeRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) - private static final com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest(); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public LongRunningRecognizeRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new LongRunningRecognizeRequest(input, extensionRegistry); - } - }; - - 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.LongRunningRecognizeRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequestOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequestOrBuilder.java deleted file mode 100644 index eac75ceed..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequestOrBuilder.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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 LongRunningRecognizeRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the config field is set. - */ - boolean hasConfig(); - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The config. - */ - com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig(); - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder(); - - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the audio field is set. - */ - boolean hasAudio(); - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The audio. - */ - com.google.cloud.speech.v1p1beta1.RecognitionAudio getAudio(); - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder getAudioOrBuilder(); -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponse.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponse.java deleted file mode 100644 index 7536e6be4..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponse.java +++ /dev/null @@ -1,1009 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * The only message returned to the client by the `LongRunningRecognize` method.
- * It contains the result as zero or more sequential `SpeechRecognitionResult`
- * messages. It is included in the `result.response` field of the `Operation`
- * returned by the `GetOperation` call of the `google::longrunning::Operations`
- * service.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} - */ -public final class LongRunningRecognizeResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) - LongRunningRecognizeResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use LongRunningRecognizeResponse.newBuilder() to construct. - private LongRunningRecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private LongRunningRecognizeResponse() { - results_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new LongRunningRecognizeResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private LongRunningRecognizeResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = - new java.util.ArrayList< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult>(); - mutable_bitField0_ |= 0x00000001; - } - results_.add( - input.readMessage( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.parser(), - extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.class, - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.Builder.class); - } - - public static final int RESULTS_FIELD_NUMBER = 2; - private java.util.List results_; - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List - getResultsList() { - return results_; - } - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List< - ? extends com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder> - getResultsOrBuilderList() { - return results_; - } - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public int getResultsCount() { - return results_.size(); - } - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getResults(int index) { - return results_.get(index); - } - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - return results_.get(index); - } - - 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 { - for (int i = 0; i < results_.size(); i++) { - output.writeMessage(2, results_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < results_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, results_.get(i)); - } - size += unknownFields.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.LongRunningRecognizeResponse)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse other = - (com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) obj; - - if (!getResultsList().equals(other.getResultsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getResultsCount() > 0) { - hash = (37 * hash) + RESULTS_FIELD_NUMBER; - hash = (53 * hash) + getResultsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse 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.LongRunningRecognizeResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse 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.LongRunningRecognizeResponse parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse 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.LongRunningRecognizeResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse 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.LongRunningRecognizeResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse 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.LongRunningRecognizeResponse 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.LongRunningRecognizeResponse 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.LongRunningRecognizeResponse 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; - } - /** - * - * - *
-   * The only message returned to the client by the `LongRunningRecognize` method.
-   * It contains the result as zero or more sequential `SpeechRecognitionResult`
-   * messages. It is included in the `result.response` field of the `Operation`
-   * returned by the `GetOperation` call of the `google::longrunning::Operations`
-   * service.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.class, - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getResultsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - resultsBuilder_.clear(); - } - 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_LongRunningRecognizeResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse - getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse build() { - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse buildPartial() { - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse result = - new com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse(this); - int from_bitField0_ = bitField0_; - if (resultsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.results_ = results_; - } else { - result.results_ = resultsBuilder_.build(); - } - 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.LongRunningRecognizeResponse) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse other) { - if (other - == com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.getDefaultInstance()) - return this; - if (resultsBuilder_ == null) { - if (!other.results_.isEmpty()) { - if (results_.isEmpty()) { - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResultsIsMutable(); - results_.addAll(other.results_); - } - onChanged(); - } - } else { - if (!other.results_.isEmpty()) { - if (resultsBuilder_.isEmpty()) { - resultsBuilder_.dispose(); - resultsBuilder_ = null; - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - resultsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getResultsFieldBuilder() - : null; - } else { - resultsBuilder_.addAllMessages(other.results_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List results_ = - java.util.Collections.emptyList(); - - private void ensureResultsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - results_ = - new java.util.ArrayList( - results_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder> - resultsBuilder_; - - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsList() { - if (resultsBuilder_ == null) { - return java.util.Collections.unmodifiableList(results_); - } else { - return resultsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public int getResultsCount() { - if (resultsBuilder_ == null) { - return results_.size(); - } else { - return resultsBuilder_.getCount(); - } - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getResults(int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.set(index, value); - onChanged(); - } else { - resultsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder setResults( - int index, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.set(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults(com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(value); - onChanged(); - } else { - resultsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(index, value); - onChanged(); - } else { - resultsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - int index, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addAllResults( - java.lang.Iterable - values) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); - onChanged(); - } else { - resultsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder clearResults() { - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - resultsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder removeResults(int index) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.remove(index); - onChanged(); - } else { - resultsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder getResultsBuilder( - int index) { - return getResultsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List< - ? extends com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder> - getResultsOrBuilderList() { - if (resultsBuilder_ != null) { - return resultsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(results_); - } - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder addResultsBuilder() { - return getResultsFieldBuilder() - .addBuilder( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.getDefaultInstance()); - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder addResultsBuilder( - int index) { - return getResultsFieldBuilder() - .addBuilder( - index, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.getDefaultInstance()); - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsBuilderList() { - return getResultsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder> - getResultsFieldBuilder() { - if (resultsBuilder_ == null) { - resultsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder>( - results_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - results_ = null; - } - return resultsBuilder_; - } - - @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.LongRunningRecognizeResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) - private static final com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse(); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public LongRunningRecognizeResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new LongRunningRecognizeResponse(input, extensionRegistry); - } - }; - - 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.LongRunningRecognizeResponse - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponseOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponseOrBuilder.java deleted file mode 100644 index 20a34f17a..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponseOrBuilder.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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 LongRunningRecognizeResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - java.util.List getResultsList(); - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getResults(int index); - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - int getResultsCount(); - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - java.util.List - getResultsOrBuilderList(); - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder(int index); -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSet.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSet.java deleted file mode 100644 index 4552b2c44..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSet.java +++ /dev/null @@ -1,2093 +0,0 @@ -/* - * 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/resource.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - * - * - *
- * Provides "hints" to the speech recognizer to favor specific words and phrases
- * in the results.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.PhraseSet} - */ -public final class PhraseSet extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.PhraseSet) - PhraseSetOrBuilder { - private static final long serialVersionUID = 0L; - // Use PhraseSet.newBuilder() to construct. - private PhraseSet(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private PhraseSet() { - name_ = ""; - phrases_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PhraseSet(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private PhraseSet( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - phrases_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - phrases_.add( - input.readMessage( - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.parser(), - extensionRegistry)); - break; - } - case 37: - { - boost_ = input.readFloat(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - phrases_ = java.util.Collections.unmodifiableList(phrases_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_PhraseSet_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.PhraseSet.class, - com.google.cloud.speech.v1p1beta1.PhraseSet.Builder.class); - } - - public interface PhraseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.PhraseSet.Phrase) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * The phrase itself.
-     * 
- * - * string value = 1; - * - * @return The value. - */ - java.lang.String getValue(); - /** - * - * - *
-     * The phrase itself.
-     * 
- * - * string value = 1; - * - * @return The bytes for value. - */ - com.google.protobuf.ByteString getValueBytes(); - - /** - * - * - *
-     * Hint Boost. Overrides the boost set at the phrase set level.
-     * Positive value will increase the probability that a specific phrase will
-     * be recognized over other similar sounding phrases. The higher the boost,
-     * the higher the chance of false positive recognition as well. Negative
-     * boost values would correspond to anti-biasing. Anti-biasing is not
-     * enabled, so negative boost will simply be ignored. Though `boost` can
-     * accept a wide range of positive values, most use cases are best served
-     * with values between 0 and 20. We recommend using a binary search approach
-     * to finding the optimal value for your use case. Speech recognition
-     * will skip PhraseSets with a boost value of 0.
-     * 
- * - * float boost = 2; - * - * @return The boost. - */ - float getBoost(); - } - /** - * - * - *
-   * A phrases containing words and phrase "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also include pre-built or custom classes containing groups
-   * of words that represent common concepts that occur in natural language. For
-   * example, rather than providing a phrase hint for every month of the
-   * year (e.g. "i was born in january", "i was born in febuary", ...), use the
-   * pre-built `$MONTH` class improves the likelihood of correctly transcribing
-   * audio that includes months (e.g. "i was born in $month").
-   * To refer to pre-built classes, use the class' symbol prepended with `$`
-   * e.g. `$MONTH`. To refer to custom classes that were defined inline in the
-   * request, set the class's `custom_class_id` to a string unique to all class
-   * resources and inline classes. Then use the class' id wrapped in $`{...}`
-   * e.g. "${my-months}". To refer to custom classes resources, use the class'
-   * id wrapped in `${}` (e.g. `${my-months}`).
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.PhraseSet.Phrase} - */ - public static final class Phrase extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.PhraseSet.Phrase) - PhraseOrBuilder { - private static final long serialVersionUID = 0L; - // Use Phrase.newBuilder() to construct. - private Phrase(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Phrase() { - value_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Phrase(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Phrase( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - value_ = s; - break; - } - case 21: - { - boost_ = input.readFloat(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.class, - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder.class); - } - - public static final int VALUE_FIELD_NUMBER = 1; - private volatile java.lang.Object value_; - /** - * - * - *
-     * The phrase itself.
-     * 
- * - * string value = 1; - * - * @return The value. - */ - @java.lang.Override - public java.lang.String getValue() { - java.lang.Object ref = value_; - 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(); - value_ = s; - return s; - } - } - /** - * - * - *
-     * The phrase itself.
-     * 
- * - * string value = 1; - * - * @return The bytes for value. - */ - @java.lang.Override - public com.google.protobuf.ByteString getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int BOOST_FIELD_NUMBER = 2; - private float boost_; - /** - * - * - *
-     * Hint Boost. Overrides the boost set at the phrase set level.
-     * Positive value will increase the probability that a specific phrase will
-     * be recognized over other similar sounding phrases. The higher the boost,
-     * the higher the chance of false positive recognition as well. Negative
-     * boost values would correspond to anti-biasing. Anti-biasing is not
-     * enabled, so negative boost will simply be ignored. Though `boost` can
-     * accept a wide range of positive values, most use cases are best served
-     * with values between 0 and 20. We recommend using a binary search approach
-     * to finding the optimal value for your use case. Speech recognition
-     * will skip PhraseSets with a boost value of 0.
-     * 
- * - * float boost = 2; - * - * @return The boost. - */ - @java.lang.Override - public float getBoost() { - return boost_; - } - - 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 (!getValueBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_); - } - if (boost_ != 0F) { - output.writeFloat(2, boost_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getValueBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, value_); - } - if (boost_ != 0F) { - size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, boost_); - } - size += unknownFields.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.PhraseSet.Phrase)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase other = - (com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase) obj; - - if (!getValue().equals(other.getValue())) return false; - if (java.lang.Float.floatToIntBits(getBoost()) - != java.lang.Float.floatToIntBits(other.getBoost())) return false; - if (!unknownFields.equals(other.unknownFields)) 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) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValue().hashCode(); - hash = (37 * hash) + BOOST_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits(getBoost()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase 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.PhraseSet.Phrase parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase 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.PhraseSet.Phrase parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase 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.PhraseSet.Phrase parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase 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.PhraseSet.Phrase parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase 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.PhraseSet.Phrase 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.PhraseSet.Phrase 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.PhraseSet.Phrase 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; - } - /** - * - * - *
-     * A phrases containing words and phrase "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also include pre-built or custom classes containing groups
-     * of words that represent common concepts that occur in natural language. For
-     * example, rather than providing a phrase hint for every month of the
-     * year (e.g. "i was born in january", "i was born in febuary", ...), use the
-     * pre-built `$MONTH` class improves the likelihood of correctly transcribing
-     * audio that includes months (e.g. "i was born in $month").
-     * To refer to pre-built classes, use the class' symbol prepended with `$`
-     * e.g. `$MONTH`. To refer to custom classes that were defined inline in the
-     * request, set the class's `custom_class_id` to a string unique to all class
-     * resources and inline classes. Then use the class' id wrapped in $`{...}`
-     * e.g. "${my-months}". To refer to custom classes resources, use the class'
-     * id wrapped in `${}` (e.g. `${my-months}`).
-     * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.PhraseSet.Phrase} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.PhraseSet.Phrase) - com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.class, - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - value_ = ""; - - boost_ = 0F; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase build() { - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase buildPartial() { - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase result = - new com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase(this); - result.value_ = value_; - result.boost_ = boost_; - 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.PhraseSet.Phrase) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase other) { - if (other == com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.getDefaultInstance()) - return this; - if (!other.getValue().isEmpty()) { - value_ = other.value_; - onChanged(); - } - if (other.getBoost() != 0F) { - setBoost(other.getBoost()); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object value_ = ""; - /** - * - * - *
-       * The phrase itself.
-       * 
- * - * string value = 1; - * - * @return The value. - */ - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * The phrase itself.
-       * 
- * - * string value = 1; - * - * @return The bytes for value. - */ - public com.google.protobuf.ByteString getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * The phrase itself.
-       * 
- * - * string value = 1; - * - * @param value The value to set. - * @return This builder for chaining. - */ - public Builder setValue(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - value_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * The phrase itself.
-       * 
- * - * string value = 1; - * - * @return This builder for chaining. - */ - public Builder clearValue() { - - value_ = getDefaultInstance().getValue(); - onChanged(); - return this; - } - /** - * - * - *
-       * The phrase itself.
-       * 
- * - * string value = 1; - * - * @param value The bytes for value to set. - * @return This builder for chaining. - */ - public Builder setValueBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - value_ = value; - onChanged(); - return this; - } - - private float boost_; - /** - * - * - *
-       * Hint Boost. Overrides the boost set at the phrase set level.
-       * Positive value will increase the probability that a specific phrase will
-       * be recognized over other similar sounding phrases. The higher the boost,
-       * the higher the chance of false positive recognition as well. Negative
-       * boost values would correspond to anti-biasing. Anti-biasing is not
-       * enabled, so negative boost will simply be ignored. Though `boost` can
-       * accept a wide range of positive values, most use cases are best served
-       * with values between 0 and 20. We recommend using a binary search approach
-       * to finding the optimal value for your use case. Speech recognition
-       * will skip PhraseSets with a boost value of 0.
-       * 
- * - * float boost = 2; - * - * @return The boost. - */ - @java.lang.Override - public float getBoost() { - return boost_; - } - /** - * - * - *
-       * Hint Boost. Overrides the boost set at the phrase set level.
-       * Positive value will increase the probability that a specific phrase will
-       * be recognized over other similar sounding phrases. The higher the boost,
-       * the higher the chance of false positive recognition as well. Negative
-       * boost values would correspond to anti-biasing. Anti-biasing is not
-       * enabled, so negative boost will simply be ignored. Though `boost` can
-       * accept a wide range of positive values, most use cases are best served
-       * with values between 0 and 20. We recommend using a binary search approach
-       * to finding the optimal value for your use case. Speech recognition
-       * will skip PhraseSets with a boost value of 0.
-       * 
- * - * float boost = 2; - * - * @param value The boost to set. - * @return This builder for chaining. - */ - public Builder setBoost(float value) { - - boost_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Hint Boost. Overrides the boost set at the phrase set level.
-       * Positive value will increase the probability that a specific phrase will
-       * be recognized over other similar sounding phrases. The higher the boost,
-       * the higher the chance of false positive recognition as well. Negative
-       * boost values would correspond to anti-biasing. Anti-biasing is not
-       * enabled, so negative boost will simply be ignored. Though `boost` can
-       * accept a wide range of positive values, most use cases are best served
-       * with values between 0 and 20. We recommend using a binary search approach
-       * to finding the optimal value for your use case. Speech recognition
-       * will skip PhraseSets with a boost value of 0.
-       * 
- * - * float boost = 2; - * - * @return This builder for chaining. - */ - public Builder clearBoost() { - - boost_ = 0F; - 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.PhraseSet.Phrase) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.PhraseSet.Phrase) - private static final com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase(); - } - - public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Phrase parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Phrase(input, extensionRegistry); - } - }; - - 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.PhraseSet.Phrase getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-   * The resource name of the phrase set.
-   * 
- * - * string name = 1; - * - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - 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(); - name_ = s; - return s; - } - } - /** - * - * - *
-   * The resource name of the phrase set.
-   * 
- * - * string name = 1; - * - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PHRASES_FIELD_NUMBER = 2; - private java.util.List phrases_; - /** - * - * - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - @java.lang.Override - public java.util.List getPhrasesList() { - return phrases_; - } - /** - * - * - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - @java.lang.Override - public java.util.List - getPhrasesOrBuilderList() { - return phrases_; - } - /** - * - * - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - @java.lang.Override - public int getPhrasesCount() { - return phrases_.size(); - } - /** - * - * - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getPhrases(int index) { - return phrases_.get(index); - } - /** - * - * - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder getPhrasesOrBuilder( - int index) { - return phrases_.get(index); - } - - public static final int BOOST_FIELD_NUMBER = 4; - private float boost_; - /** - * - * - *
-   * Hint Boost. Positive value will increase the probability that a specific
-   * phrase will be recognized over other similar sounding phrases. The higher
-   * the boost, the higher the chance of false positive recognition as well.
-   * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-   * enabled, so negative boost will simply be ignored. Though `boost` can
-   * accept a wide range of positive values, most use cases are best served with
-   * values between 0 (exclusive) and 20. We recommend using a binary search
-   * approach to finding the optimal value for your use case. Speech recognition
-   * will skip PhraseSets with a boost value of 0.
-   * 
- * - * float boost = 4; - * - * @return The boost. - */ - @java.lang.Override - public float getBoost() { - return boost_; - } - - 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 (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - for (int i = 0; i < phrases_.size(); i++) { - output.writeMessage(2, phrases_.get(i)); - } - if (boost_ != 0F) { - output.writeFloat(4, boost_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - for (int i = 0; i < phrases_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, phrases_.get(i)); - } - if (boost_ != 0F) { - size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, boost_); - } - size += unknownFields.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.PhraseSet)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.PhraseSet other = - (com.google.cloud.speech.v1p1beta1.PhraseSet) obj; - - if (!getName().equals(other.getName())) return false; - if (!getPhrasesList().equals(other.getPhrasesList())) return false; - if (java.lang.Float.floatToIntBits(getBoost()) - != java.lang.Float.floatToIntBits(other.getBoost())) return false; - if (!unknownFields.equals(other.unknownFields)) 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) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - if (getPhrasesCount() > 0) { - hash = (37 * hash) + PHRASES_FIELD_NUMBER; - hash = (53 * hash) + getPhrasesList().hashCode(); - } - hash = (37 * hash) + BOOST_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits(getBoost()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.PhraseSet 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.PhraseSet parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.PhraseSet 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.PhraseSet parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.PhraseSet 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.PhraseSet parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.PhraseSet 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.PhraseSet parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.PhraseSet 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.PhraseSet 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.PhraseSet 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.PhraseSet 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; - } - /** - * - * - *
-   * Provides "hints" to the speech recognizer to favor specific words and phrases
-   * in the results.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.PhraseSet} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.PhraseSet) - com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_PhraseSet_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.PhraseSet.class, - com.google.cloud.speech.v1p1beta1.PhraseSet.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.PhraseSet.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getPhrasesFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - if (phrasesBuilder_ == null) { - phrases_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - phrasesBuilder_.clear(); - } - boost_ = 0F; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet build() { - com.google.cloud.speech.v1p1beta1.PhraseSet result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet buildPartial() { - com.google.cloud.speech.v1p1beta1.PhraseSet result = - new com.google.cloud.speech.v1p1beta1.PhraseSet(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - if (phrasesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - phrases_ = java.util.Collections.unmodifiableList(phrases_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.phrases_ = phrases_; - } else { - result.phrases_ = phrasesBuilder_.build(); - } - result.boost_ = boost_; - 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.PhraseSet) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.PhraseSet) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.PhraseSet other) { - if (other == com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (phrasesBuilder_ == null) { - if (!other.phrases_.isEmpty()) { - if (phrases_.isEmpty()) { - phrases_ = other.phrases_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePhrasesIsMutable(); - phrases_.addAll(other.phrases_); - } - onChanged(); - } - } else { - if (!other.phrases_.isEmpty()) { - if (phrasesBuilder_.isEmpty()) { - phrasesBuilder_.dispose(); - phrasesBuilder_ = null; - phrases_ = other.phrases_; - bitField0_ = (bitField0_ & ~0x00000001); - phrasesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getPhrasesFieldBuilder() - : null; - } else { - phrasesBuilder_.addAllMessages(other.phrases_); - } - } - } - if (other.getBoost() != 0F) { - setBoost(other.getBoost()); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.PhraseSet parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.PhraseSet) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * The resource name of the phrase set.
-     * 
- * - * string name = 1; - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The resource name of the phrase set.
-     * 
- * - * string name = 1; - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The resource name of the phrase set.
-     * 
- * - * string name = 1; - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The resource name of the phrase set.
-     * 
- * - * string name = 1; - * - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-     * The resource name of the phrase set.
-     * 
- * - * string name = 1; - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.util.List phrases_ = - java.util.Collections.emptyList(); - - private void ensurePhrasesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - phrases_ = - new java.util.ArrayList(phrases_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase, - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder, - com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder> - phrasesBuilder_; - - /** - * - * - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public java.util.List getPhrasesList() { - if (phrasesBuilder_ == null) { - return java.util.Collections.unmodifiableList(phrases_); - } else { - return phrasesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public int getPhrasesCount() { - if (phrasesBuilder_ == null) { - return phrases_.size(); - } else { - return phrasesBuilder_.getCount(); - } - } - /** - * - * - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getPhrases(int index) { - if (phrasesBuilder_ == null) { - return phrases_.get(index); - } else { - return phrasesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public Builder setPhrases(int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase value) { - if (phrasesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhrasesIsMutable(); - phrases_.set(index, value); - onChanged(); - } else { - phrasesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public Builder setPhrases( - int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder builderForValue) { - if (phrasesBuilder_ == null) { - ensurePhrasesIsMutable(); - phrases_.set(index, builderForValue.build()); - onChanged(); - } else { - phrasesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public Builder addPhrases(com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase value) { - if (phrasesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhrasesIsMutable(); - phrases_.add(value); - onChanged(); - } else { - phrasesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public Builder addPhrases(int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase value) { - if (phrasesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhrasesIsMutable(); - phrases_.add(index, value); - onChanged(); - } else { - phrasesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public Builder addPhrases( - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder builderForValue) { - if (phrasesBuilder_ == null) { - ensurePhrasesIsMutable(); - phrases_.add(builderForValue.build()); - onChanged(); - } else { - phrasesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public Builder addPhrases( - int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder builderForValue) { - if (phrasesBuilder_ == null) { - ensurePhrasesIsMutable(); - phrases_.add(index, builderForValue.build()); - onChanged(); - } else { - phrasesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public Builder addAllPhrases( - java.lang.Iterable values) { - if (phrasesBuilder_ == null) { - ensurePhrasesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, phrases_); - onChanged(); - } else { - phrasesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public Builder clearPhrases() { - if (phrasesBuilder_ == null) { - phrases_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - phrasesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public Builder removePhrases(int index) { - if (phrasesBuilder_ == null) { - ensurePhrasesIsMutable(); - phrases_.remove(index); - onChanged(); - } else { - phrasesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder getPhrasesBuilder(int index) { - return getPhrasesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder getPhrasesOrBuilder( - int index) { - if (phrasesBuilder_ == null) { - return phrases_.get(index); - } else { - return phrasesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public java.util.List - getPhrasesOrBuilderList() { - if (phrasesBuilder_ != null) { - return phrasesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(phrases_); - } - } - /** - * - * - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder addPhrasesBuilder() { - return getPhrasesFieldBuilder() - .addBuilder(com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.getDefaultInstance()); - } - /** - * - * - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder addPhrasesBuilder(int index) { - return getPhrasesFieldBuilder() - .addBuilder( - index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.getDefaultInstance()); - } - /** - * - * - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public java.util.List - getPhrasesBuilderList() { - return getPhrasesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase, - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder, - com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder> - getPhrasesFieldBuilder() { - if (phrasesBuilder_ == null) { - phrasesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase, - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder, - com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder>( - phrases_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - phrases_ = null; - } - return phrasesBuilder_; - } - - private float boost_; - /** - * - * - *
-     * Hint Boost. Positive value will increase the probability that a specific
-     * phrase will be recognized over other similar sounding phrases. The higher
-     * the boost, the higher the chance of false positive recognition as well.
-     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-     * enabled, so negative boost will simply be ignored. Though `boost` can
-     * accept a wide range of positive values, most use cases are best served with
-     * values between 0 (exclusive) and 20. We recommend using a binary search
-     * approach to finding the optimal value for your use case. Speech recognition
-     * will skip PhraseSets with a boost value of 0.
-     * 
- * - * float boost = 4; - * - * @return The boost. - */ - @java.lang.Override - public float getBoost() { - return boost_; - } - /** - * - * - *
-     * Hint Boost. Positive value will increase the probability that a specific
-     * phrase will be recognized over other similar sounding phrases. The higher
-     * the boost, the higher the chance of false positive recognition as well.
-     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-     * enabled, so negative boost will simply be ignored. Though `boost` can
-     * accept a wide range of positive values, most use cases are best served with
-     * values between 0 (exclusive) and 20. We recommend using a binary search
-     * approach to finding the optimal value for your use case. Speech recognition
-     * will skip PhraseSets with a boost value of 0.
-     * 
- * - * float boost = 4; - * - * @param value The boost to set. - * @return This builder for chaining. - */ - public Builder setBoost(float value) { - - boost_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Hint Boost. Positive value will increase the probability that a specific
-     * phrase will be recognized over other similar sounding phrases. The higher
-     * the boost, the higher the chance of false positive recognition as well.
-     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-     * enabled, so negative boost will simply be ignored. Though `boost` can
-     * accept a wide range of positive values, most use cases are best served with
-     * values between 0 (exclusive) and 20. We recommend using a binary search
-     * approach to finding the optimal value for your use case. Speech recognition
-     * will skip PhraseSets with a boost value of 0.
-     * 
- * - * float boost = 4; - * - * @return This builder for chaining. - */ - public Builder clearBoost() { - - boost_ = 0F; - 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.PhraseSet) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.PhraseSet) - private static final com.google.cloud.speech.v1p1beta1.PhraseSet DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.PhraseSet(); - } - - public static com.google.cloud.speech.v1p1beta1.PhraseSet getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PhraseSet parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PhraseSet(input, extensionRegistry); - } - }; - - 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.PhraseSet getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetName.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetName.java deleted file mode 100644 index 7d7f40576..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetName.java +++ /dev/null @@ -1,211 +0,0 @@ -/* - * 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. - */ - -package com.google.cloud.speech.v1p1beta1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") -public class PhraseSetName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/locations/{location}/phraseSets/{phrase_set}"); - - private volatile Map fieldValuesMap; - - private final String project; - private final String location; - private final String phraseSet; - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public String getPhraseSet() { - return phraseSet; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private PhraseSetName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - phraseSet = Preconditions.checkNotNull(builder.getPhraseSet()); - } - - public static PhraseSetName of(String project, String location, String phraseSet) { - return newBuilder().setProject(project).setLocation(location).setPhraseSet(phraseSet).build(); - } - - public static String format(String project, String location, String phraseSet) { - return newBuilder() - .setProject(project) - .setLocation(location) - .setPhraseSet(phraseSet) - .build() - .toString(); - } - - public static PhraseSetName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PATH_TEMPLATE.validatedMatch( - formattedString, "PhraseSetName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("phrase_set")); - } - - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); - for (String formattedString : formattedStrings) { - list.add(parse(formattedString)); - } - return list; - } - - public static List toStringList(List values) { - List list = new ArrayList(values.size()); - for (PhraseSetName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("phraseSet", phraseSet); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate( - "project", project, "location", location, "phrase_set", phraseSet); - } - - /** Builder for PhraseSetName. */ - public static class Builder { - - private String project; - private String location; - private String phraseSet; - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public String getPhraseSet() { - return phraseSet; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setLocation(String location) { - this.location = location; - return this; - } - - public Builder setPhraseSet(String phraseSet) { - this.phraseSet = phraseSet; - return this; - } - - private Builder() {} - - private Builder(PhraseSetName phraseSetName) { - project = phraseSetName.project; - location = phraseSetName.location; - phraseSet = phraseSetName.phraseSet; - } - - public PhraseSetName build() { - return new PhraseSetName(this); - } - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof PhraseSetName) { - PhraseSetName that = (PhraseSetName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.phraseSet.equals(that.phraseSet)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= phraseSet.hashCode(); - return h; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetOrBuilder.java deleted file mode 100644 index 55f1127b4..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetOrBuilder.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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/resource.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface PhraseSetOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.PhraseSet) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The resource name of the phrase set.
-   * 
- * - * string name = 1; - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * The resource name of the phrase set.
-   * 
- * - * string name = 1; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - java.util.List getPhrasesList(); - /** - * - * - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getPhrases(int index); - /** - * - * - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - int getPhrasesCount(); - /** - * - * - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - java.util.List - getPhrasesOrBuilderList(); - /** - * - * - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder getPhrasesOrBuilder(int index); - - /** - * - * - *
-   * Hint Boost. Positive value will increase the probability that a specific
-   * phrase will be recognized over other similar sounding phrases. The higher
-   * the boost, the higher the chance of false positive recognition as well.
-   * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-   * enabled, so negative boost will simply be ignored. Though `boost` can
-   * accept a wide range of positive values, most use cases are best served with
-   * values between 0 (exclusive) and 20. We recommend using a binary search
-   * approach to finding the optimal value for your use case. Speech recognition
-   * will skip PhraseSets with a boost value of 0.
-   * 
- * - * float boost = 4; - * - * @return The boost. - */ - float getBoost(); -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudio.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudio.java deleted file mode 100644 index 174dc1636..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudio.java +++ /dev/null @@ -1,910 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * Contains audio data in the encoding specified in the `RecognitionConfig`.
- * Either `content` or `uri` must be supplied. Supplying both or neither
- * returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
- * See [content limits](https://cloud.google.com/speech-to-text/quotas#content).
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognitionAudio} - */ -public final class RecognitionAudio extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.RecognitionAudio) - RecognitionAudioOrBuilder { - private static final long serialVersionUID = 0L; - // Use RecognitionAudio.newBuilder() to construct. - private RecognitionAudio(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private RecognitionAudio() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RecognitionAudio(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private RecognitionAudio( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - audioSourceCase_ = 1; - audioSource_ = input.readBytes(); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - audioSourceCase_ = 2; - audioSource_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.RecognitionAudio.class, - com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder.class); - } - - private int audioSourceCase_ = 0; - private java.lang.Object audioSource_; - - public enum AudioSourceCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - CONTENT(1), - URI(2), - AUDIOSOURCE_NOT_SET(0); - private final int value; - - private AudioSourceCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static AudioSourceCase valueOf(int value) { - return forNumber(value); - } - - public static AudioSourceCase forNumber(int value) { - switch (value) { - case 1: - return CONTENT; - case 2: - return URI; - case 0: - return AUDIOSOURCE_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public AudioSourceCase getAudioSourceCase() { - return AudioSourceCase.forNumber(audioSourceCase_); - } - - public static final int CONTENT_FIELD_NUMBER = 1; - /** - * - * - *
-   * The audio data bytes encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation, whereas JSON representations use base64.
-   * 
- * - * bytes content = 1; - * - * @return The content. - */ - @java.lang.Override - public com.google.protobuf.ByteString getContent() { - if (audioSourceCase_ == 1) { - return (com.google.protobuf.ByteString) audioSource_; - } - return com.google.protobuf.ByteString.EMPTY; - } - - public static final int URI_FIELD_NUMBER = 2; - /** - * - * - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-   * Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]).
-   * For more information, see [Request
-   * URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - * - * @return The uri. - */ - public java.lang.String getUri() { - java.lang.Object ref = ""; - if (audioSourceCase_ == 2) { - ref = audioSource_; - } - 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(); - if (audioSourceCase_ == 2) { - audioSource_ = s; - } - return s; - } - } - /** - * - * - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-   * Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]).
-   * For more information, see [Request
-   * URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - * - * @return The bytes for uri. - */ - public com.google.protobuf.ByteString getUriBytes() { - java.lang.Object ref = ""; - if (audioSourceCase_ == 2) { - ref = audioSource_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - if (audioSourceCase_ == 2) { - audioSource_ = 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 (audioSourceCase_ == 1) { - output.writeBytes(1, (com.google.protobuf.ByteString) audioSource_); - } - if (audioSourceCase_ == 2) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, audioSource_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (audioSourceCase_ == 1) { - size += - com.google.protobuf.CodedOutputStream.computeBytesSize( - 1, (com.google.protobuf.ByteString) audioSource_); - } - if (audioSourceCase_ == 2) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, audioSource_); - } - size += unknownFields.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.RecognitionAudio)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.RecognitionAudio other = - (com.google.cloud.speech.v1p1beta1.RecognitionAudio) obj; - - if (!getAudioSourceCase().equals(other.getAudioSourceCase())) return false; - switch (audioSourceCase_) { - case 1: - if (!getContent().equals(other.getContent())) return false; - break; - case 2: - if (!getUri().equals(other.getUri())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (audioSourceCase_) { - case 1: - hash = (37 * hash) + CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getContent().hashCode(); - break; - case 2: - hash = (37 * hash) + URI_FIELD_NUMBER; - hash = (53 * hash) + getUri().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionAudio 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.RecognitionAudio parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionAudio 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.RecognitionAudio parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionAudio 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.RecognitionAudio parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionAudio 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.RecognitionAudio parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionAudio 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.RecognitionAudio 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.RecognitionAudio 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.RecognitionAudio 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; - } - /** - * - * - *
-   * Contains audio data in the encoding specified in the `RecognitionConfig`.
-   * Either `content` or `uri` must be supplied. Supplying both or neither
-   * returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
-   * See [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognitionAudio} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.RecognitionAudio) - com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.RecognitionAudio.class, - com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.RecognitionAudio.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - audioSourceCase_ = 0; - audioSource_ = null; - 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_RecognitionAudio_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionAudio getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionAudio build() { - com.google.cloud.speech.v1p1beta1.RecognitionAudio result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionAudio buildPartial() { - com.google.cloud.speech.v1p1beta1.RecognitionAudio result = - new com.google.cloud.speech.v1p1beta1.RecognitionAudio(this); - if (audioSourceCase_ == 1) { - result.audioSource_ = audioSource_; - } - if (audioSourceCase_ == 2) { - result.audioSource_ = audioSource_; - } - result.audioSourceCase_ = audioSourceCase_; - 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.RecognitionAudio) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.RecognitionAudio) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.RecognitionAudio other) { - if (other == com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance()) - return this; - switch (other.getAudioSourceCase()) { - case CONTENT: - { - setContent(other.getContent()); - break; - } - case URI: - { - audioSourceCase_ = 2; - audioSource_ = other.audioSource_; - onChanged(); - break; - } - case AUDIOSOURCE_NOT_SET: - { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.RecognitionAudio parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1p1beta1.RecognitionAudio) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int audioSourceCase_ = 0; - private java.lang.Object audioSource_; - - public AudioSourceCase getAudioSourceCase() { - return AudioSourceCase.forNumber(audioSourceCase_); - } - - public Builder clearAudioSource() { - audioSourceCase_ = 0; - audioSource_ = null; - onChanged(); - return this; - } - - /** - * - * - *
-     * The audio data bytes encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation, whereas JSON representations use base64.
-     * 
- * - * bytes content = 1; - * - * @return The content. - */ - public com.google.protobuf.ByteString getContent() { - if (audioSourceCase_ == 1) { - return (com.google.protobuf.ByteString) audioSource_; - } - return com.google.protobuf.ByteString.EMPTY; - } - /** - * - * - *
-     * The audio data bytes encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation, whereas JSON representations use base64.
-     * 
- * - * bytes content = 1; - * - * @param value The content to set. - * @return This builder for chaining. - */ - public Builder setContent(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - audioSourceCase_ = 1; - audioSource_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The audio data bytes encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation, whereas JSON representations use base64.
-     * 
- * - * bytes content = 1; - * - * @return This builder for chaining. - */ - public Builder clearContent() { - if (audioSourceCase_ == 1) { - audioSourceCase_ = 0; - audioSource_ = null; - onChanged(); - } - return this; - } - - /** - * - * - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]).
-     * For more information, see [Request
-     * URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * - * @return The uri. - */ - @java.lang.Override - public java.lang.String getUri() { - java.lang.Object ref = ""; - if (audioSourceCase_ == 2) { - ref = audioSource_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (audioSourceCase_ == 2) { - audioSource_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]).
-     * For more information, see [Request
-     * URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * - * @return The bytes for uri. - */ - @java.lang.Override - public com.google.protobuf.ByteString getUriBytes() { - java.lang.Object ref = ""; - if (audioSourceCase_ == 2) { - ref = audioSource_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - if (audioSourceCase_ == 2) { - audioSource_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]).
-     * For more information, see [Request
-     * URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * - * @param value The uri to set. - * @return This builder for chaining. - */ - public Builder setUri(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - audioSourceCase_ = 2; - audioSource_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]).
-     * For more information, see [Request
-     * URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * - * @return This builder for chaining. - */ - public Builder clearUri() { - if (audioSourceCase_ == 2) { - audioSourceCase_ = 0; - audioSource_ = null; - onChanged(); - } - return this; - } - /** - * - * - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]).
-     * For more information, see [Request
-     * URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * - * @param value The bytes for uri to set. - * @return This builder for chaining. - */ - public Builder setUriBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - audioSourceCase_ = 2; - audioSource_ = 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.RecognitionAudio) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.RecognitionAudio) - private static final com.google.cloud.speech.v1p1beta1.RecognitionAudio DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.RecognitionAudio(); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionAudio getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecognitionAudio parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognitionAudio(input, extensionRegistry); - } - }; - - 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.RecognitionAudio getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudioOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudioOrBuilder.java deleted file mode 100644 index 417e5bbe2..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudioOrBuilder.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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 RecognitionAudioOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.RecognitionAudio) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The audio data bytes encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation, whereas JSON representations use base64.
-   * 
- * - * bytes content = 1; - * - * @return The content. - */ - com.google.protobuf.ByteString getContent(); - - /** - * - * - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-   * Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]).
-   * For more information, see [Request
-   * URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - * - * @return The uri. - */ - java.lang.String getUri(); - /** - * - * - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-   * Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]).
-   * For more information, see [Request
-   * URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - * - * @return The bytes for uri. - */ - com.google.protobuf.ByteString getUriBytes(); - - public com.google.cloud.speech.v1p1beta1.RecognitionAudio.AudioSourceCase getAudioSourceCase(); -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfig.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfig.java deleted file mode 100644 index ff4ebf3a1..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfig.java +++ /dev/null @@ -1,4787 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * Provides information to the recognizer that specifies how to process the
- * request.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognitionConfig} - */ -public final class RecognitionConfig extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.RecognitionConfig) - RecognitionConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use RecognitionConfig.newBuilder() to construct. - private RecognitionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private RecognitionConfig() { - encoding_ = 0; - languageCode_ = ""; - alternativeLanguageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - speechContexts_ = java.util.Collections.emptyList(); - model_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RecognitionConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private RecognitionConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - int rawValue = input.readEnum(); - - encoding_ = rawValue; - break; - } - case 16: - { - sampleRateHertz_ = input.readInt32(); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - languageCode_ = s; - break; - } - case 32: - { - maxAlternatives_ = input.readInt32(); - break; - } - case 40: - { - profanityFilter_ = input.readBool(); - break; - } - case 50: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - speechContexts_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - speechContexts_.add( - input.readMessage( - com.google.cloud.speech.v1p1beta1.SpeechContext.parser(), extensionRegistry)); - break; - } - case 56: - { - audioChannelCount_ = input.readInt32(); - break; - } - case 64: - { - enableWordTimeOffsets_ = input.readBool(); - break; - } - case 74: - { - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder subBuilder = null; - if (metadata_ != null) { - subBuilder = metadata_.toBuilder(); - } - metadata_ = - input.readMessage( - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metadata_); - metadata_ = subBuilder.buildPartial(); - } - - break; - } - case 88: - { - enableAutomaticPunctuation_ = input.readBool(); - break; - } - case 96: - { - enableSeparateRecognitionPerChannel_ = input.readBool(); - break; - } - case 106: - { - java.lang.String s = input.readStringRequireUtf8(); - - model_ = s; - break; - } - case 112: - { - useEnhanced_ = input.readBool(); - break; - } - case 120: - { - enableWordConfidence_ = input.readBool(); - break; - } - case 128: - { - enableSpeakerDiarization_ = input.readBool(); - break; - } - case 136: - { - diarizationSpeakerCount_ = input.readInt32(); - break; - } - case 146: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - alternativeLanguageCodes_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - alternativeLanguageCodes_.add(s); - break; - } - case 154: - { - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder subBuilder = null; - if (diarizationConfig_ != null) { - subBuilder = diarizationConfig_.toBuilder(); - } - diarizationConfig_ = - input.readMessage( - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(diarizationConfig_); - diarizationConfig_ = subBuilder.buildPartial(); - } - - break; - } - case 162: - { - com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder subBuilder = null; - if (adaptation_ != null) { - subBuilder = adaptation_.toBuilder(); - } - adaptation_ = - input.readMessage( - com.google.cloud.speech.v1p1beta1.SpeechAdaptation.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(adaptation_); - adaptation_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { - speechContexts_ = java.util.Collections.unmodifiableList(speechContexts_); - } - if (((mutable_bitField0_ & 0x00000001) != 0)) { - alternativeLanguageCodes_ = alternativeLanguageCodes_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.RecognitionConfig.class, - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder.class); - } - - /** - * - * - *
-   * The encoding of the audio data sent in the request.
-   * All encodings support only 1 channel (mono) audio, unless the
-   * `audio_channel_count` and `enable_separate_recognition_per_channel` fields
-   * are set.
-   * For best results, the audio source should be captured and transmitted using
-   * a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech
-   * recognition can be reduced if lossy codecs are used to capture or transmit
-   * audio, particularly if background noise is present. Lossy codecs include
-   * `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, and `MP3`.
-   * The `FLAC` and `WAV` audio file formats include a header that describes the
-   * included audio content. You can request recognition for `WAV` files that
-   * contain either `LINEAR16` or `MULAW` encoded audio.
-   * If you send `FLAC` or `WAV` audio file format in
-   * your request, you do not need to specify an `AudioEncoding`; the audio
-   * encoding format is determined from the file header. If you specify
-   * an `AudioEncoding` when you send  send `FLAC` or `WAV` audio, the
-   * encoding configuration must match the encoding described in the audio
-   * header; otherwise the request returns an
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error
-   * code.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding} - */ - public enum AudioEncoding implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * Not specified.
-     * 
- * - * ENCODING_UNSPECIFIED = 0; - */ - ENCODING_UNSPECIFIED(0), - /** - * - * - *
-     * Uncompressed 16-bit signed little-endian samples (Linear PCM).
-     * 
- * - * LINEAR16 = 1; - */ - LINEAR16(1), - /** - * - * - *
-     * `FLAC` (Free Lossless Audio
-     * Codec) is the recommended encoding because it is
-     * lossless--therefore recognition is not compromised--and
-     * requires only about half the bandwidth of `LINEAR16`. `FLAC` stream
-     * encoding supports 16-bit and 24-bit samples, however, not all fields in
-     * `STREAMINFO` are supported.
-     * 
- * - * FLAC = 2; - */ - FLAC(2), - /** - * - * - *
-     * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
-     * 
- * - * MULAW = 3; - */ - MULAW(3), - /** - * - * - *
-     * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
-     * 
- * - * AMR = 4; - */ - AMR(4), - /** - * - * - *
-     * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
-     * 
- * - * AMR_WB = 5; - */ - AMR_WB(5), - /** - * - * - *
-     * Opus encoded audio frames in Ogg container
-     * ([OggOpus](https://wiki.xiph.org/OggOpus)).
-     * `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000.
-     * 
- * - * OGG_OPUS = 6; - */ - OGG_OPUS(6), - /** - * - * - *
-     * Although the use of lossy encodings is not recommended, if a very low
-     * bitrate encoding is required, `OGG_OPUS` is highly preferred over
-     * Speex encoding. The [Speex](https://speex.org/)  encoding supported by
-     * Cloud Speech API has a header byte in each block, as in MIME type
-     * `audio/x-speex-with-header-byte`.
-     * It is a variant of the RTP Speex encoding defined in
-     * [RFC 5574](https://tools.ietf.org/html/rfc5574).
-     * The stream is a sequence of blocks, one block per RTP packet. Each block
-     * starts with a byte containing the length of the block, in bytes, followed
-     * by one or more frames of Speex data, padded to an integral number of
-     * bytes (octets) as specified in RFC 5574. In other words, each RTP header
-     * is replaced with a single byte containing the block length. Only Speex
-     * wideband is supported. `sample_rate_hertz` must be 16000.
-     * 
- * - * SPEEX_WITH_HEADER_BYTE = 7; - */ - SPEEX_WITH_HEADER_BYTE(7), - /** - * - * - *
-     * MP3 audio. Support all standard MP3 bitrates (which range from 32-320
-     * kbps). When using this encoding, `sample_rate_hertz` has to match the
-     * sample rate of the file being used.
-     * 
- * - * MP3 = 8; - */ - MP3(8), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * Not specified.
-     * 
- * - * ENCODING_UNSPECIFIED = 0; - */ - public static final int ENCODING_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * Uncompressed 16-bit signed little-endian samples (Linear PCM).
-     * 
- * - * LINEAR16 = 1; - */ - public static final int LINEAR16_VALUE = 1; - /** - * - * - *
-     * `FLAC` (Free Lossless Audio
-     * Codec) is the recommended encoding because it is
-     * lossless--therefore recognition is not compromised--and
-     * requires only about half the bandwidth of `LINEAR16`. `FLAC` stream
-     * encoding supports 16-bit and 24-bit samples, however, not all fields in
-     * `STREAMINFO` are supported.
-     * 
- * - * FLAC = 2; - */ - public static final int FLAC_VALUE = 2; - /** - * - * - *
-     * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
-     * 
- * - * MULAW = 3; - */ - public static final int MULAW_VALUE = 3; - /** - * - * - *
-     * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
-     * 
- * - * AMR = 4; - */ - public static final int AMR_VALUE = 4; - /** - * - * - *
-     * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
-     * 
- * - * AMR_WB = 5; - */ - public static final int AMR_WB_VALUE = 5; - /** - * - * - *
-     * Opus encoded audio frames in Ogg container
-     * ([OggOpus](https://wiki.xiph.org/OggOpus)).
-     * `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000.
-     * 
- * - * OGG_OPUS = 6; - */ - public static final int OGG_OPUS_VALUE = 6; - /** - * - * - *
-     * Although the use of lossy encodings is not recommended, if a very low
-     * bitrate encoding is required, `OGG_OPUS` is highly preferred over
-     * Speex encoding. The [Speex](https://speex.org/)  encoding supported by
-     * Cloud Speech API has a header byte in each block, as in MIME type
-     * `audio/x-speex-with-header-byte`.
-     * It is a variant of the RTP Speex encoding defined in
-     * [RFC 5574](https://tools.ietf.org/html/rfc5574).
-     * The stream is a sequence of blocks, one block per RTP packet. Each block
-     * starts with a byte containing the length of the block, in bytes, followed
-     * by one or more frames of Speex data, padded to an integral number of
-     * bytes (octets) as specified in RFC 5574. In other words, each RTP header
-     * is replaced with a single byte containing the block length. Only Speex
-     * wideband is supported. `sample_rate_hertz` must be 16000.
-     * 
- * - * SPEEX_WITH_HEADER_BYTE = 7; - */ - public static final int SPEEX_WITH_HEADER_BYTE_VALUE = 7; - /** - * - * - *
-     * MP3 audio. Support all standard MP3 bitrates (which range from 32-320
-     * kbps). When using this encoding, `sample_rate_hertz` has to match the
-     * sample rate of the file being used.
-     * 
- * - * MP3 = 8; - */ - public static final int MP3_VALUE = 8; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static AudioEncoding valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static AudioEncoding forNumber(int value) { - switch (value) { - case 0: - return ENCODING_UNSPECIFIED; - case 1: - return LINEAR16; - case 2: - return FLAC; - case 3: - return MULAW; - case 4: - return AMR; - case 5: - return AMR_WB; - case 6: - return OGG_OPUS; - case 7: - return SPEEX_WITH_HEADER_BYTE; - case 8: - return MP3; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public AudioEncoding findValueByNumber(int number) { - return AudioEncoding.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDescriptor() - .getEnumTypes() - .get(0); - } - - private static final AudioEncoding[] VALUES = values(); - - public static AudioEncoding valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private AudioEncoding(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding) - } - - public static final int ENCODING_FIELD_NUMBER = 1; - private int encoding_; - /** - * - * - *
-   * Encoding of audio data sent in all `RecognitionAudio` messages.
-   * This field is optional for `FLAC` and `WAV` audio files and required
-   * for all other audio formats. For details, see
-   * [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; - * - * @return The enum numeric value on the wire for encoding. - */ - @java.lang.Override - public int getEncodingValue() { - return encoding_; - } - /** - * - * - *
-   * Encoding of audio data sent in all `RecognitionAudio` messages.
-   * This field is optional for `FLAC` and `WAV` audio files and required
-   * for all other audio formats. For details, see
-   * [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; - * - * @return The encoding. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding getEncoding() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding result = - com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding.valueOf(encoding_); - return result == null - ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding.UNRECOGNIZED - : result; - } - - public static final int SAMPLE_RATE_HERTZ_FIELD_NUMBER = 2; - private int sampleRateHertz_; - /** - * - * - *
-   * Sample rate in Hertz of the audio data sent in all
-   * `RecognitionAudio` messages. Valid values are: 8000-48000.
-   * 16000 is optimal. For best results, set the sampling rate of the audio
-   * source to 16000 Hz. If that's not possible, use the native sample rate of
-   * the audio source (instead of re-sampling).
-   * This field is optional for FLAC and WAV audio files, but is
-   * required for all other audio formats. For details, see
-   * [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-   * 
- * - * int32 sample_rate_hertz = 2; - * - * @return The sampleRateHertz. - */ - @java.lang.Override - public int getSampleRateHertz() { - return sampleRateHertz_; - } - - public static final int AUDIO_CHANNEL_COUNT_FIELD_NUMBER = 7; - private int audioChannelCount_; - /** - * - * - *
-   * 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 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.
-   * To perform independent recognition on each channel set
-   * `enable_separate_recognition_per_channel` to 'true'.
-   * 
- * - * int32 audio_channel_count = 7; - * - * @return The audioChannelCount. - */ - @java.lang.Override - public int getAudioChannelCount() { - return audioChannelCount_; - } - - public static final int ENABLE_SEPARATE_RECOGNITION_PER_CHANNEL_FIELD_NUMBER = 12; - private boolean enableSeparateRecognitionPerChannel_; - /** - * - * - *
-   * This needs to be set to `true` explicitly and `audio_channel_count` > 1
-   * to get each channel recognized separately. The recognition result will
-   * contain a `channel_tag` field to state which channel that result belongs
-   * to. If this is not true, we will only recognize the first channel. The
-   * request is billed cumulatively for all channels recognized:
-   * `audio_channel_count` multiplied by the length of the audio.
-   * 
- * - * bool enable_separate_recognition_per_channel = 12; - * - * @return The enableSeparateRecognitionPerChannel. - */ - @java.lang.Override - public boolean getEnableSeparateRecognitionPerChannel() { - return enableSeparateRecognitionPerChannel_; - } - - public static final int LANGUAGE_CODE_FIELD_NUMBER = 3; - private volatile java.lang.Object languageCode_; - /** - * - * - *
-   * Required. The language of the supplied audio as a
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-   * Example: "en-US".
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes.
-   * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The languageCode. - */ - @java.lang.Override - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - 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(); - languageCode_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The language of the supplied audio as a
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-   * Example: "en-US".
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes.
-   * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for languageCode. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ALTERNATIVE_LANGUAGE_CODES_FIELD_NUMBER = 18; - private com.google.protobuf.LazyStringList alternativeLanguageCodes_; - /** - * - * - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * - * @return A list containing the alternativeLanguageCodes. - */ - public com.google.protobuf.ProtocolStringList getAlternativeLanguageCodesList() { - return alternativeLanguageCodes_; - } - /** - * - * - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * - * @return The count of alternativeLanguageCodes. - */ - public int getAlternativeLanguageCodesCount() { - return alternativeLanguageCodes_.size(); - } - /** - * - * - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * - * @param index The index of the element to return. - * @return The alternativeLanguageCodes at the given index. - */ - public java.lang.String getAlternativeLanguageCodes(int index) { - return alternativeLanguageCodes_.get(index); - } - /** - * - * - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * - * @param index The index of the value to return. - * @return The bytes of the alternativeLanguageCodes at the given index. - */ - public com.google.protobuf.ByteString getAlternativeLanguageCodesBytes(int index) { - return alternativeLanguageCodes_.getByteString(index); - } - - public static final int MAX_ALTERNATIVES_FIELD_NUMBER = 4; - private int maxAlternatives_; - /** - * - * - *
-   * Maximum number of recognition hypotheses to be returned.
-   * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-   * within each `SpeechRecognitionResult`.
-   * The server may return fewer than `max_alternatives`.
-   * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-   * one. If omitted, will return a maximum of one.
-   * 
- * - * int32 max_alternatives = 4; - * - * @return The maxAlternatives. - */ - @java.lang.Override - public int getMaxAlternatives() { - return maxAlternatives_; - } - - public static final int PROFANITY_FILTER_FIELD_NUMBER = 5; - private boolean profanityFilter_; - /** - * - * - *
-   * If set to `true`, the server will attempt to filter out
-   * profanities, replacing all but the initial character in each filtered word
-   * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-   * won't be filtered out.
-   * 
- * - * bool profanity_filter = 5; - * - * @return The profanityFilter. - */ - @java.lang.Override - public boolean getProfanityFilter() { - return profanityFilter_; - } - - public static final int ADAPTATION_FIELD_NUMBER = 20; - private com.google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation_; - /** - * - * - *
-   * Speech adaptation configuration improves the accuracy of speech
-   * recognition. When speech adaptation is set it supersedes the
-   * `speech_contexts` field. For more information, see the [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength)
-   * documentation.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - * - * @return Whether the adaptation field is set. - */ - @java.lang.Override - public boolean hasAdaptation() { - return adaptation_ != null; - } - /** - * - * - *
-   * Speech adaptation configuration improves the accuracy of speech
-   * recognition. When speech adaptation is set it supersedes the
-   * `speech_contexts` field. For more information, see the [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength)
-   * documentation.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - * - * @return The adaptation. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechAdaptation getAdaptation() { - return adaptation_ == null - ? com.google.cloud.speech.v1p1beta1.SpeechAdaptation.getDefaultInstance() - : adaptation_; - } - /** - * - * - *
-   * Speech adaptation configuration improves the accuracy of speech
-   * recognition. When speech adaptation is set it supersedes the
-   * `speech_contexts` field. For more information, see the [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength)
-   * documentation.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder getAdaptationOrBuilder() { - return getAdaptation(); - } - - public static final int SPEECH_CONTEXTS_FIELD_NUMBER = 6; - private java.util.List speechContexts_; - /** - * - * - *
-   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - @java.lang.Override - public java.util.List getSpeechContextsList() { - return speechContexts_; - } - /** - * - * - *
-   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - @java.lang.Override - public java.util.List - getSpeechContextsOrBuilderList() { - return speechContexts_; - } - /** - * - * - *
-   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - @java.lang.Override - public int getSpeechContextsCount() { - return speechContexts_.size(); - } - /** - * - * - *
-   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechContext getSpeechContexts(int index) { - return speechContexts_.get(index); - } - /** - * - * - *
-   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder getSpeechContextsOrBuilder( - int index) { - return speechContexts_.get(index); - } - - public static final int ENABLE_WORD_TIME_OFFSETS_FIELD_NUMBER = 8; - private boolean enableWordTimeOffsets_; - /** - * - * - *
-   * If `true`, the top result includes a list of words and
-   * the start and end time offsets (timestamps) for those words. If
-   * `false`, no word-level time offset information is returned. The default is
-   * `false`.
-   * 
- * - * bool enable_word_time_offsets = 8; - * - * @return The enableWordTimeOffsets. - */ - @java.lang.Override - public boolean getEnableWordTimeOffsets() { - return enableWordTimeOffsets_; - } - - public static final int ENABLE_WORD_CONFIDENCE_FIELD_NUMBER = 15; - private boolean enableWordConfidence_; - /** - * - * - *
-   * If `true`, the top result includes a list of words and the
-   * confidence for those words. If `false`, no word-level confidence
-   * information is returned. The default is `false`.
-   * 
- * - * bool enable_word_confidence = 15; - * - * @return The enableWordConfidence. - */ - @java.lang.Override - public boolean getEnableWordConfidence() { - return enableWordConfidence_; - } - - public static final int ENABLE_AUTOMATIC_PUNCTUATION_FIELD_NUMBER = 11; - private boolean enableAutomaticPunctuation_; - /** - * - * - *
-   * If 'true', adds punctuation to recognition result hypotheses.
-   * This feature is only available in select languages. Setting this for
-   * requests in other languages has no effect at all.
-   * The default 'false' value does not add punctuation to result hypotheses.
-   * 
- * - * bool enable_automatic_punctuation = 11; - * - * @return The enableAutomaticPunctuation. - */ - @java.lang.Override - public boolean getEnableAutomaticPunctuation() { - return enableAutomaticPunctuation_; - } - - public static final int ENABLE_SPEAKER_DIARIZATION_FIELD_NUMBER = 16; - private boolean enableSpeakerDiarization_; - /** - * - * - *
-   * If 'true', enables speaker detection for each recognized word in
-   * the top alternative of the recognition result using a speaker_tag provided
-   * in the WordInfo.
-   * Note: Use diarization_config instead.
-   * 
- * - * bool enable_speaker_diarization = 16 [deprecated = true]; - * - * @return The enableSpeakerDiarization. - */ - @java.lang.Override - @java.lang.Deprecated - public boolean getEnableSpeakerDiarization() { - return enableSpeakerDiarization_; - } - - public static final int DIARIZATION_SPEAKER_COUNT_FIELD_NUMBER = 17; - private int diarizationSpeakerCount_; - /** - * - * - *
-   * If set, specifies the estimated number of speakers in the conversation.
-   * Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
-   * Note: Use diarization_config instead.
-   * 
- * - * int32 diarization_speaker_count = 17 [deprecated = true]; - * - * @return The diarizationSpeakerCount. - */ - @java.lang.Override - @java.lang.Deprecated - public int getDiarizationSpeakerCount() { - return diarizationSpeakerCount_; - } - - public static final int DIARIZATION_CONFIG_FIELD_NUMBER = 19; - private com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarizationConfig_; - /** - * - * - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - * - * @return Whether the diarizationConfig field is set. - */ - @java.lang.Override - public boolean hasDiarizationConfig() { - return diarizationConfig_ != null; - } - /** - * - * - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - * - * @return The diarizationConfig. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig getDiarizationConfig() { - return diarizationConfig_ == null - ? com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.getDefaultInstance() - : diarizationConfig_; - } - /** - * - * - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder - getDiarizationConfigOrBuilder() { - return getDiarizationConfig(); - } - - public static final int METADATA_FIELD_NUMBER = 9; - private com.google.cloud.speech.v1p1beta1.RecognitionMetadata metadata_; - /** - * - * - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - * - * @return Whether the metadata field is set. - */ - @java.lang.Override - public boolean hasMetadata() { - return metadata_ != null; - } - /** - * - * - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - * - * @return The metadata. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata getMetadata() { - return metadata_ == null - ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDefaultInstance() - : metadata_; - } - /** - * - * - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder getMetadataOrBuilder() { - return getMetadata(); - } - - public static final int MODEL_FIELD_NUMBER = 13; - private volatile java.lang.Object model_; - /** - * - * - *
-   * Which model to select for the given request. Select the model
-   * best suited to your domain to get best results. If a model is not
-   * explicitly specified, then we auto-select a model based on the parameters
-   * in the RecognitionConfig.
-   * <table>
-   *   <tr>
-   *     <td><b>Model</b></td>
-   *     <td><b>Description</b></td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>command_and_search</code></td>
-   *     <td>Best for short queries such as voice commands or voice search.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>phone_call</code></td>
-   *     <td>Best for audio that originated from a phone call (typically
-   *     recorded at an 8khz sampling rate).</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>video</code></td>
-   *     <td>Best for audio that originated from from video or includes multiple
-   *         speakers. Ideally the audio is recorded at a 16khz or greater
-   *         sampling rate. This is a premium model that costs more than the
-   *         standard rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>default</code></td>
-   *     <td>Best for audio that is not one of the specific audio models.
-   *         For example, long-form audio. Ideally the audio is high-fidelity,
-   *         recorded at a 16khz or greater sampling rate.</td>
-   *   </tr>
-   * </table>
-   * 
- * - * string model = 13; - * - * @return The model. - */ - @java.lang.Override - public java.lang.String getModel() { - java.lang.Object ref = model_; - 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(); - model_ = s; - return s; - } - } - /** - * - * - *
-   * Which model to select for the given request. Select the model
-   * best suited to your domain to get best results. If a model is not
-   * explicitly specified, then we auto-select a model based on the parameters
-   * in the RecognitionConfig.
-   * <table>
-   *   <tr>
-   *     <td><b>Model</b></td>
-   *     <td><b>Description</b></td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>command_and_search</code></td>
-   *     <td>Best for short queries such as voice commands or voice search.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>phone_call</code></td>
-   *     <td>Best for audio that originated from a phone call (typically
-   *     recorded at an 8khz sampling rate).</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>video</code></td>
-   *     <td>Best for audio that originated from from video or includes multiple
-   *         speakers. Ideally the audio is recorded at a 16khz or greater
-   *         sampling rate. This is a premium model that costs more than the
-   *         standard rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>default</code></td>
-   *     <td>Best for audio that is not one of the specific audio models.
-   *         For example, long-form audio. Ideally the audio is high-fidelity,
-   *         recorded at a 16khz or greater sampling rate.</td>
-   *   </tr>
-   * </table>
-   * 
- * - * string model = 13; - * - * @return The bytes for model. - */ - @java.lang.Override - public com.google.protobuf.ByteString getModelBytes() { - java.lang.Object ref = model_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - model_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int USE_ENHANCED_FIELD_NUMBER = 14; - private boolean useEnhanced_; - /** - * - * - *
-   * Set to true to use an enhanced model for speech recognition.
-   * If `use_enhanced` is set to true and the `model` field is not set, then
-   * an appropriate enhanced model is chosen if an enhanced model exists for
-   * the audio.
-   * If `use_enhanced` is true and an enhanced version of the specified model
-   * does not exist, then the speech is recognized using the standard version
-   * of the specified model.
-   * 
- * - * bool use_enhanced = 14; - * - * @return The useEnhanced. - */ - @java.lang.Override - public boolean getUseEnhanced() { - return useEnhanced_; - } - - 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 (encoding_ - != com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding.ENCODING_UNSPECIFIED - .getNumber()) { - output.writeEnum(1, encoding_); - } - if (sampleRateHertz_ != 0) { - output.writeInt32(2, sampleRateHertz_); - } - if (!getLanguageCodeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languageCode_); - } - if (maxAlternatives_ != 0) { - output.writeInt32(4, maxAlternatives_); - } - if (profanityFilter_ != false) { - output.writeBool(5, profanityFilter_); - } - for (int i = 0; i < speechContexts_.size(); i++) { - output.writeMessage(6, speechContexts_.get(i)); - } - if (audioChannelCount_ != 0) { - output.writeInt32(7, audioChannelCount_); - } - if (enableWordTimeOffsets_ != false) { - output.writeBool(8, enableWordTimeOffsets_); - } - if (metadata_ != null) { - output.writeMessage(9, getMetadata()); - } - if (enableAutomaticPunctuation_ != false) { - output.writeBool(11, enableAutomaticPunctuation_); - } - if (enableSeparateRecognitionPerChannel_ != false) { - output.writeBool(12, enableSeparateRecognitionPerChannel_); - } - if (!getModelBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 13, model_); - } - if (useEnhanced_ != false) { - output.writeBool(14, useEnhanced_); - } - if (enableWordConfidence_ != false) { - output.writeBool(15, enableWordConfidence_); - } - if (enableSpeakerDiarization_ != false) { - output.writeBool(16, enableSpeakerDiarization_); - } - if (diarizationSpeakerCount_ != 0) { - output.writeInt32(17, diarizationSpeakerCount_); - } - for (int i = 0; i < alternativeLanguageCodes_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString( - output, 18, alternativeLanguageCodes_.getRaw(i)); - } - if (diarizationConfig_ != null) { - output.writeMessage(19, getDiarizationConfig()); - } - if (adaptation_ != null) { - output.writeMessage(20, getAdaptation()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (encoding_ - != com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding.ENCODING_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, encoding_); - } - if (sampleRateHertz_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, sampleRateHertz_); - } - if (!getLanguageCodeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, languageCode_); - } - if (maxAlternatives_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, maxAlternatives_); - } - if (profanityFilter_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, profanityFilter_); - } - for (int i = 0; i < speechContexts_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, speechContexts_.get(i)); - } - if (audioChannelCount_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, audioChannelCount_); - } - if (enableWordTimeOffsets_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(8, enableWordTimeOffsets_); - } - if (metadata_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getMetadata()); - } - if (enableAutomaticPunctuation_ != false) { - size += - com.google.protobuf.CodedOutputStream.computeBoolSize(11, enableAutomaticPunctuation_); - } - if (enableSeparateRecognitionPerChannel_ != false) { - size += - com.google.protobuf.CodedOutputStream.computeBoolSize( - 12, enableSeparateRecognitionPerChannel_); - } - if (!getModelBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, model_); - } - if (useEnhanced_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(14, useEnhanced_); - } - if (enableWordConfidence_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(15, enableWordConfidence_); - } - if (enableSpeakerDiarization_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(16, enableSpeakerDiarization_); - } - if (diarizationSpeakerCount_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(17, diarizationSpeakerCount_); - } - { - int dataSize = 0; - for (int i = 0; i < alternativeLanguageCodes_.size(); i++) { - dataSize += computeStringSizeNoTag(alternativeLanguageCodes_.getRaw(i)); - } - size += dataSize; - size += 2 * getAlternativeLanguageCodesList().size(); - } - if (diarizationConfig_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, getDiarizationConfig()); - } - if (adaptation_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, getAdaptation()); - } - size += unknownFields.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.RecognitionConfig)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.RecognitionConfig other = - (com.google.cloud.speech.v1p1beta1.RecognitionConfig) obj; - - if (encoding_ != other.encoding_) return false; - if (getSampleRateHertz() != other.getSampleRateHertz()) return false; - if (getAudioChannelCount() != other.getAudioChannelCount()) return false; - if (getEnableSeparateRecognitionPerChannel() != other.getEnableSeparateRecognitionPerChannel()) - return false; - if (!getLanguageCode().equals(other.getLanguageCode())) return false; - if (!getAlternativeLanguageCodesList().equals(other.getAlternativeLanguageCodesList())) - return false; - if (getMaxAlternatives() != other.getMaxAlternatives()) return false; - if (getProfanityFilter() != other.getProfanityFilter()) return false; - if (hasAdaptation() != other.hasAdaptation()) return false; - if (hasAdaptation()) { - if (!getAdaptation().equals(other.getAdaptation())) return false; - } - if (!getSpeechContextsList().equals(other.getSpeechContextsList())) return false; - if (getEnableWordTimeOffsets() != other.getEnableWordTimeOffsets()) return false; - if (getEnableWordConfidence() != other.getEnableWordConfidence()) return false; - if (getEnableAutomaticPunctuation() != other.getEnableAutomaticPunctuation()) return false; - if (getEnableSpeakerDiarization() != other.getEnableSpeakerDiarization()) return false; - if (getDiarizationSpeakerCount() != other.getDiarizationSpeakerCount()) return false; - if (hasDiarizationConfig() != other.hasDiarizationConfig()) return false; - if (hasDiarizationConfig()) { - if (!getDiarizationConfig().equals(other.getDiarizationConfig())) return false; - } - if (hasMetadata() != other.hasMetadata()) return false; - if (hasMetadata()) { - if (!getMetadata().equals(other.getMetadata())) return false; - } - if (!getModel().equals(other.getModel())) return false; - if (getUseEnhanced() != other.getUseEnhanced()) return false; - if (!unknownFields.equals(other.unknownFields)) 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) + ENCODING_FIELD_NUMBER; - hash = (53 * hash) + encoding_; - hash = (37 * hash) + SAMPLE_RATE_HERTZ_FIELD_NUMBER; - hash = (53 * hash) + getSampleRateHertz(); - hash = (37 * hash) + AUDIO_CHANNEL_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getAudioChannelCount(); - hash = (37 * hash) + ENABLE_SEPARATE_RECOGNITION_PER_CHANNEL_FIELD_NUMBER; - hash = - (53 * hash) - + com.google.protobuf.Internal.hashBoolean(getEnableSeparateRecognitionPerChannel()); - hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; - hash = (53 * hash) + getLanguageCode().hashCode(); - if (getAlternativeLanguageCodesCount() > 0) { - hash = (37 * hash) + ALTERNATIVE_LANGUAGE_CODES_FIELD_NUMBER; - hash = (53 * hash) + getAlternativeLanguageCodesList().hashCode(); - } - hash = (37 * hash) + MAX_ALTERNATIVES_FIELD_NUMBER; - hash = (53 * hash) + getMaxAlternatives(); - hash = (37 * hash) + PROFANITY_FILTER_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getProfanityFilter()); - if (hasAdaptation()) { - hash = (37 * hash) + ADAPTATION_FIELD_NUMBER; - hash = (53 * hash) + getAdaptation().hashCode(); - } - if (getSpeechContextsCount() > 0) { - hash = (37 * hash) + SPEECH_CONTEXTS_FIELD_NUMBER; - hash = (53 * hash) + getSpeechContextsList().hashCode(); - } - hash = (37 * hash) + ENABLE_WORD_TIME_OFFSETS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableWordTimeOffsets()); - hash = (37 * hash) + ENABLE_WORD_CONFIDENCE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableWordConfidence()); - hash = (37 * hash) + ENABLE_AUTOMATIC_PUNCTUATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableAutomaticPunctuation()); - hash = (37 * hash) + ENABLE_SPEAKER_DIARIZATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableSpeakerDiarization()); - hash = (37 * hash) + DIARIZATION_SPEAKER_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getDiarizationSpeakerCount(); - if (hasDiarizationConfig()) { - hash = (37 * hash) + DIARIZATION_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getDiarizationConfig().hashCode(); - } - if (hasMetadata()) { - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - } - hash = (37 * hash) + MODEL_FIELD_NUMBER; - hash = (53 * hash) + getModel().hashCode(); - hash = (37 * hash) + USE_ENHANCED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUseEnhanced()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionConfig 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.RecognitionConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionConfig 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.RecognitionConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionConfig 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.RecognitionConfig parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionConfig 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.RecognitionConfig parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionConfig 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.RecognitionConfig 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.RecognitionConfig 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.RecognitionConfig 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; - } - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognitionConfig} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.RecognitionConfig) - com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.RecognitionConfig.class, - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.RecognitionConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getSpeechContextsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - encoding_ = 0; - - sampleRateHertz_ = 0; - - audioChannelCount_ = 0; - - enableSeparateRecognitionPerChannel_ = false; - - languageCode_ = ""; - - alternativeLanguageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - maxAlternatives_ = 0; - - profanityFilter_ = false; - - if (adaptationBuilder_ == null) { - adaptation_ = null; - } else { - adaptation_ = null; - adaptationBuilder_ = null; - } - if (speechContextsBuilder_ == null) { - speechContexts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - speechContextsBuilder_.clear(); - } - enableWordTimeOffsets_ = false; - - enableWordConfidence_ = false; - - enableAutomaticPunctuation_ = false; - - enableSpeakerDiarization_ = false; - - diarizationSpeakerCount_ = 0; - - if (diarizationConfigBuilder_ == null) { - diarizationConfig_ = null; - } else { - diarizationConfig_ = null; - diarizationConfigBuilder_ = null; - } - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadata_ = null; - metadataBuilder_ = null; - } - model_ = ""; - - useEnhanced_ = false; - - 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_RecognitionConfig_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfig getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfig build() { - com.google.cloud.speech.v1p1beta1.RecognitionConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfig buildPartial() { - com.google.cloud.speech.v1p1beta1.RecognitionConfig result = - new com.google.cloud.speech.v1p1beta1.RecognitionConfig(this); - int from_bitField0_ = bitField0_; - result.encoding_ = encoding_; - result.sampleRateHertz_ = sampleRateHertz_; - result.audioChannelCount_ = audioChannelCount_; - result.enableSeparateRecognitionPerChannel_ = enableSeparateRecognitionPerChannel_; - result.languageCode_ = languageCode_; - if (((bitField0_ & 0x00000001) != 0)) { - alternativeLanguageCodes_ = alternativeLanguageCodes_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.alternativeLanguageCodes_ = alternativeLanguageCodes_; - result.maxAlternatives_ = maxAlternatives_; - result.profanityFilter_ = profanityFilter_; - if (adaptationBuilder_ == null) { - result.adaptation_ = adaptation_; - } else { - result.adaptation_ = adaptationBuilder_.build(); - } - if (speechContextsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - speechContexts_ = java.util.Collections.unmodifiableList(speechContexts_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.speechContexts_ = speechContexts_; - } else { - result.speechContexts_ = speechContextsBuilder_.build(); - } - result.enableWordTimeOffsets_ = enableWordTimeOffsets_; - result.enableWordConfidence_ = enableWordConfidence_; - result.enableAutomaticPunctuation_ = enableAutomaticPunctuation_; - result.enableSpeakerDiarization_ = enableSpeakerDiarization_; - result.diarizationSpeakerCount_ = diarizationSpeakerCount_; - if (diarizationConfigBuilder_ == null) { - result.diarizationConfig_ = diarizationConfig_; - } else { - result.diarizationConfig_ = diarizationConfigBuilder_.build(); - } - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); - } - result.model_ = model_; - result.useEnhanced_ = useEnhanced_; - 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.RecognitionConfig) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.RecognitionConfig) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.RecognitionConfig other) { - if (other == com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance()) - return this; - if (other.encoding_ != 0) { - setEncodingValue(other.getEncodingValue()); - } - if (other.getSampleRateHertz() != 0) { - setSampleRateHertz(other.getSampleRateHertz()); - } - if (other.getAudioChannelCount() != 0) { - setAudioChannelCount(other.getAudioChannelCount()); - } - if (other.getEnableSeparateRecognitionPerChannel() != false) { - setEnableSeparateRecognitionPerChannel(other.getEnableSeparateRecognitionPerChannel()); - } - if (!other.getLanguageCode().isEmpty()) { - languageCode_ = other.languageCode_; - onChanged(); - } - if (!other.alternativeLanguageCodes_.isEmpty()) { - if (alternativeLanguageCodes_.isEmpty()) { - alternativeLanguageCodes_ = other.alternativeLanguageCodes_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAlternativeLanguageCodesIsMutable(); - alternativeLanguageCodes_.addAll(other.alternativeLanguageCodes_); - } - onChanged(); - } - if (other.getMaxAlternatives() != 0) { - setMaxAlternatives(other.getMaxAlternatives()); - } - if (other.getProfanityFilter() != false) { - setProfanityFilter(other.getProfanityFilter()); - } - if (other.hasAdaptation()) { - mergeAdaptation(other.getAdaptation()); - } - if (speechContextsBuilder_ == null) { - if (!other.speechContexts_.isEmpty()) { - if (speechContexts_.isEmpty()) { - speechContexts_ = other.speechContexts_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureSpeechContextsIsMutable(); - speechContexts_.addAll(other.speechContexts_); - } - onChanged(); - } - } else { - if (!other.speechContexts_.isEmpty()) { - if (speechContextsBuilder_.isEmpty()) { - speechContextsBuilder_.dispose(); - speechContextsBuilder_ = null; - speechContexts_ = other.speechContexts_; - bitField0_ = (bitField0_ & ~0x00000002); - speechContextsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getSpeechContextsFieldBuilder() - : null; - } else { - speechContextsBuilder_.addAllMessages(other.speechContexts_); - } - } - } - if (other.getEnableWordTimeOffsets() != false) { - setEnableWordTimeOffsets(other.getEnableWordTimeOffsets()); - } - if (other.getEnableWordConfidence() != false) { - setEnableWordConfidence(other.getEnableWordConfidence()); - } - if (other.getEnableAutomaticPunctuation() != false) { - setEnableAutomaticPunctuation(other.getEnableAutomaticPunctuation()); - } - if (other.getEnableSpeakerDiarization() != false) { - setEnableSpeakerDiarization(other.getEnableSpeakerDiarization()); - } - if (other.getDiarizationSpeakerCount() != 0) { - setDiarizationSpeakerCount(other.getDiarizationSpeakerCount()); - } - if (other.hasDiarizationConfig()) { - mergeDiarizationConfig(other.getDiarizationConfig()); - } - if (other.hasMetadata()) { - mergeMetadata(other.getMetadata()); - } - if (!other.getModel().isEmpty()) { - model_ = other.model_; - onChanged(); - } - if (other.getUseEnhanced() != false) { - setUseEnhanced(other.getUseEnhanced()); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.RecognitionConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1p1beta1.RecognitionConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private int encoding_ = 0; - /** - * - * - *
-     * Encoding of audio data sent in all `RecognitionAudio` messages.
-     * This field is optional for `FLAC` and `WAV` audio files and required
-     * for all other audio formats. For details, see
-     * [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; - * - * @return The enum numeric value on the wire for encoding. - */ - @java.lang.Override - public int getEncodingValue() { - return encoding_; - } - /** - * - * - *
-     * Encoding of audio data sent in all `RecognitionAudio` messages.
-     * This field is optional for `FLAC` and `WAV` audio files and required
-     * for all other audio formats. For details, see
-     * [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; - * - * @param value The enum numeric value on the wire for encoding to set. - * @return This builder for chaining. - */ - public Builder setEncodingValue(int value) { - - encoding_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Encoding of audio data sent in all `RecognitionAudio` messages.
-     * This field is optional for `FLAC` and `WAV` audio files and required
-     * for all other audio formats. For details, see
-     * [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; - * - * @return The encoding. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding getEncoding() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding result = - com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding.valueOf(encoding_); - return result == null - ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding.UNRECOGNIZED - : result; - } - /** - * - * - *
-     * Encoding of audio data sent in all `RecognitionAudio` messages.
-     * This field is optional for `FLAC` and `WAV` audio files and required
-     * for all other audio formats. For details, see
-     * [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; - * - * @param value The encoding to set. - * @return This builder for chaining. - */ - public Builder setEncoding( - com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding value) { - if (value == null) { - throw new NullPointerException(); - } - - encoding_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * Encoding of audio data sent in all `RecognitionAudio` messages.
-     * This field is optional for `FLAC` and `WAV` audio files and required
-     * for all other audio formats. For details, see
-     * [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; - * - * @return This builder for chaining. - */ - public Builder clearEncoding() { - - encoding_ = 0; - onChanged(); - return this; - } - - private int sampleRateHertz_; - /** - * - * - *
-     * Sample rate in Hertz of the audio data sent in all
-     * `RecognitionAudio` messages. Valid values are: 8000-48000.
-     * 16000 is optimal. For best results, set the sampling rate of the audio
-     * source to 16000 Hz. If that's not possible, use the native sample rate of
-     * the audio source (instead of re-sampling).
-     * This field is optional for FLAC and WAV audio files, but is
-     * required for all other audio formats. For details, see
-     * [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-     * 
- * - * int32 sample_rate_hertz = 2; - * - * @return The sampleRateHertz. - */ - @java.lang.Override - public int getSampleRateHertz() { - return sampleRateHertz_; - } - /** - * - * - *
-     * Sample rate in Hertz of the audio data sent in all
-     * `RecognitionAudio` messages. Valid values are: 8000-48000.
-     * 16000 is optimal. For best results, set the sampling rate of the audio
-     * source to 16000 Hz. If that's not possible, use the native sample rate of
-     * the audio source (instead of re-sampling).
-     * This field is optional for FLAC and WAV audio files, but is
-     * required for all other audio formats. For details, see
-     * [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-     * 
- * - * int32 sample_rate_hertz = 2; - * - * @param value The sampleRateHertz to set. - * @return This builder for chaining. - */ - public Builder setSampleRateHertz(int value) { - - sampleRateHertz_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Sample rate in Hertz of the audio data sent in all
-     * `RecognitionAudio` messages. Valid values are: 8000-48000.
-     * 16000 is optimal. For best results, set the sampling rate of the audio
-     * source to 16000 Hz. If that's not possible, use the native sample rate of
-     * the audio source (instead of re-sampling).
-     * This field is optional for FLAC and WAV audio files, but is
-     * required for all other audio formats. For details, see
-     * [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-     * 
- * - * int32 sample_rate_hertz = 2; - * - * @return This builder for chaining. - */ - public Builder clearSampleRateHertz() { - - sampleRateHertz_ = 0; - onChanged(); - return this; - } - - private int audioChannelCount_; - /** - * - * - *
-     * 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 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.
-     * To perform independent recognition on each channel set
-     * `enable_separate_recognition_per_channel` to 'true'.
-     * 
- * - * int32 audio_channel_count = 7; - * - * @return The audioChannelCount. - */ - @java.lang.Override - public int getAudioChannelCount() { - return audioChannelCount_; - } - /** - * - * - *
-     * 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 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.
-     * To perform independent recognition on each channel set
-     * `enable_separate_recognition_per_channel` to 'true'.
-     * 
- * - * int32 audio_channel_count = 7; - * - * @param value The audioChannelCount to set. - * @return This builder for chaining. - */ - public Builder setAudioChannelCount(int value) { - - audioChannelCount_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * 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 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.
-     * To perform independent recognition on each channel set
-     * `enable_separate_recognition_per_channel` to 'true'.
-     * 
- * - * int32 audio_channel_count = 7; - * - * @return This builder for chaining. - */ - public Builder clearAudioChannelCount() { - - audioChannelCount_ = 0; - onChanged(); - return this; - } - - private boolean enableSeparateRecognitionPerChannel_; - /** - * - * - *
-     * This needs to be set to `true` explicitly and `audio_channel_count` > 1
-     * to get each channel recognized separately. The recognition result will
-     * contain a `channel_tag` field to state which channel that result belongs
-     * to. If this is not true, we will only recognize the first channel. The
-     * request is billed cumulatively for all channels recognized:
-     * `audio_channel_count` multiplied by the length of the audio.
-     * 
- * - * bool enable_separate_recognition_per_channel = 12; - * - * @return The enableSeparateRecognitionPerChannel. - */ - @java.lang.Override - public boolean getEnableSeparateRecognitionPerChannel() { - return enableSeparateRecognitionPerChannel_; - } - /** - * - * - *
-     * This needs to be set to `true` explicitly and `audio_channel_count` > 1
-     * to get each channel recognized separately. The recognition result will
-     * contain a `channel_tag` field to state which channel that result belongs
-     * to. If this is not true, we will only recognize the first channel. The
-     * request is billed cumulatively for all channels recognized:
-     * `audio_channel_count` multiplied by the length of the audio.
-     * 
- * - * bool enable_separate_recognition_per_channel = 12; - * - * @param value The enableSeparateRecognitionPerChannel to set. - * @return This builder for chaining. - */ - public Builder setEnableSeparateRecognitionPerChannel(boolean value) { - - enableSeparateRecognitionPerChannel_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * This needs to be set to `true` explicitly and `audio_channel_count` > 1
-     * to get each channel recognized separately. The recognition result will
-     * contain a `channel_tag` field to state which channel that result belongs
-     * to. If this is not true, we will only recognize the first channel. The
-     * request is billed cumulatively for all channels recognized:
-     * `audio_channel_count` multiplied by the length of the audio.
-     * 
- * - * bool enable_separate_recognition_per_channel = 12; - * - * @return This builder for chaining. - */ - public Builder clearEnableSeparateRecognitionPerChannel() { - - enableSeparateRecognitionPerChannel_ = false; - onChanged(); - return this; - } - - private java.lang.Object languageCode_ = ""; - /** - * - * - *
-     * Required. The language of the supplied audio as a
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-     * Example: "en-US".
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes.
-     * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The languageCode. - */ - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - languageCode_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The language of the supplied audio as a
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-     * Example: "en-US".
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes.
-     * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for languageCode. - */ - public com.google.protobuf.ByteString getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The language of the supplied audio as a
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-     * Example: "en-US".
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes.
-     * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCode(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - languageCode_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The language of the supplied audio as a
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-     * Example: "en-US".
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes.
-     * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearLanguageCode() { - - languageCode_ = getDefaultInstance().getLanguageCode(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The language of the supplied audio as a
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-     * Example: "en-US".
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes.
-     * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - languageCode_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList alternativeLanguageCodes_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureAlternativeLanguageCodesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - alternativeLanguageCodes_ = - new com.google.protobuf.LazyStringArrayList(alternativeLanguageCodes_); - bitField0_ |= 0x00000001; - } - } - /** - * - * - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * - * @return A list containing the alternativeLanguageCodes. - */ - public com.google.protobuf.ProtocolStringList getAlternativeLanguageCodesList() { - return alternativeLanguageCodes_.getUnmodifiableView(); - } - /** - * - * - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * - * @return The count of alternativeLanguageCodes. - */ - public int getAlternativeLanguageCodesCount() { - return alternativeLanguageCodes_.size(); - } - /** - * - * - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * - * @param index The index of the element to return. - * @return The alternativeLanguageCodes at the given index. - */ - public java.lang.String getAlternativeLanguageCodes(int index) { - return alternativeLanguageCodes_.get(index); - } - /** - * - * - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * - * @param index The index of the value to return. - * @return The bytes of the alternativeLanguageCodes at the given index. - */ - public com.google.protobuf.ByteString getAlternativeLanguageCodesBytes(int index) { - return alternativeLanguageCodes_.getByteString(index); - } - /** - * - * - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * - * @param index The index to set the value at. - * @param value The alternativeLanguageCodes to set. - * @return This builder for chaining. - */ - public Builder setAlternativeLanguageCodes(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativeLanguageCodesIsMutable(); - alternativeLanguageCodes_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * - * @param value The alternativeLanguageCodes to add. - * @return This builder for chaining. - */ - public Builder addAlternativeLanguageCodes(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativeLanguageCodesIsMutable(); - alternativeLanguageCodes_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * - * @param values The alternativeLanguageCodes to add. - * @return This builder for chaining. - */ - public Builder addAllAlternativeLanguageCodes(java.lang.Iterable values) { - ensureAlternativeLanguageCodesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, alternativeLanguageCodes_); - onChanged(); - return this; - } - /** - * - * - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * - * @return This builder for chaining. - */ - public Builder clearAlternativeLanguageCodes() { - alternativeLanguageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * - * @param value The bytes of the alternativeLanguageCodes to add. - * @return This builder for chaining. - */ - public Builder addAlternativeLanguageCodesBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureAlternativeLanguageCodesIsMutable(); - alternativeLanguageCodes_.add(value); - onChanged(); - return this; - } - - private int maxAlternatives_; - /** - * - * - *
-     * Maximum number of recognition hypotheses to be returned.
-     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-     * within each `SpeechRecognitionResult`.
-     * The server may return fewer than `max_alternatives`.
-     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-     * one. If omitted, will return a maximum of one.
-     * 
- * - * int32 max_alternatives = 4; - * - * @return The maxAlternatives. - */ - @java.lang.Override - public int getMaxAlternatives() { - return maxAlternatives_; - } - /** - * - * - *
-     * Maximum number of recognition hypotheses to be returned.
-     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-     * within each `SpeechRecognitionResult`.
-     * The server may return fewer than `max_alternatives`.
-     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-     * one. If omitted, will return a maximum of one.
-     * 
- * - * int32 max_alternatives = 4; - * - * @param value The maxAlternatives to set. - * @return This builder for chaining. - */ - public Builder setMaxAlternatives(int value) { - - maxAlternatives_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Maximum number of recognition hypotheses to be returned.
-     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-     * within each `SpeechRecognitionResult`.
-     * The server may return fewer than `max_alternatives`.
-     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-     * one. If omitted, will return a maximum of one.
-     * 
- * - * int32 max_alternatives = 4; - * - * @return This builder for chaining. - */ - public Builder clearMaxAlternatives() { - - maxAlternatives_ = 0; - onChanged(); - return this; - } - - private boolean profanityFilter_; - /** - * - * - *
-     * If set to `true`, the server will attempt to filter out
-     * profanities, replacing all but the initial character in each filtered word
-     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-     * won't be filtered out.
-     * 
- * - * bool profanity_filter = 5; - * - * @return The profanityFilter. - */ - @java.lang.Override - public boolean getProfanityFilter() { - return profanityFilter_; - } - /** - * - * - *
-     * If set to `true`, the server will attempt to filter out
-     * profanities, replacing all but the initial character in each filtered word
-     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-     * won't be filtered out.
-     * 
- * - * bool profanity_filter = 5; - * - * @param value The profanityFilter to set. - * @return This builder for chaining. - */ - public Builder setProfanityFilter(boolean value) { - - profanityFilter_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If set to `true`, the server will attempt to filter out
-     * profanities, replacing all but the initial character in each filtered word
-     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-     * won't be filtered out.
-     * 
- * - * bool profanity_filter = 5; - * - * @return This builder for chaining. - */ - public Builder clearProfanityFilter() { - - profanityFilter_ = false; - onChanged(); - return this; - } - - private com.google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechAdaptation, - com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder, - com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder> - adaptationBuilder_; - /** - * - * - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. When speech adaptation is set it supersedes the
-     * `speech_contexts` field. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength)
-     * documentation.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - * - * @return Whether the adaptation field is set. - */ - public boolean hasAdaptation() { - return adaptationBuilder_ != null || adaptation_ != null; - } - /** - * - * - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. When speech adaptation is set it supersedes the
-     * `speech_contexts` field. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength)
-     * documentation.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - * - * @return The adaptation. - */ - public com.google.cloud.speech.v1p1beta1.SpeechAdaptation getAdaptation() { - if (adaptationBuilder_ == null) { - return adaptation_ == null - ? com.google.cloud.speech.v1p1beta1.SpeechAdaptation.getDefaultInstance() - : adaptation_; - } else { - return adaptationBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. When speech adaptation is set it supersedes the
-     * `speech_contexts` field. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength)
-     * documentation.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - */ - public Builder setAdaptation(com.google.cloud.speech.v1p1beta1.SpeechAdaptation value) { - if (adaptationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - adaptation_ = value; - onChanged(); - } else { - adaptationBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. When speech adaptation is set it supersedes the
-     * `speech_contexts` field. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength)
-     * documentation.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - */ - public Builder setAdaptation( - com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder builderForValue) { - if (adaptationBuilder_ == null) { - adaptation_ = builderForValue.build(); - onChanged(); - } else { - adaptationBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. When speech adaptation is set it supersedes the
-     * `speech_contexts` field. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength)
-     * documentation.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - */ - public Builder mergeAdaptation(com.google.cloud.speech.v1p1beta1.SpeechAdaptation value) { - if (adaptationBuilder_ == null) { - if (adaptation_ != null) { - adaptation_ = - com.google.cloud.speech.v1p1beta1.SpeechAdaptation.newBuilder(adaptation_) - .mergeFrom(value) - .buildPartial(); - } else { - adaptation_ = value; - } - onChanged(); - } else { - adaptationBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. When speech adaptation is set it supersedes the
-     * `speech_contexts` field. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength)
-     * documentation.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - */ - public Builder clearAdaptation() { - if (adaptationBuilder_ == null) { - adaptation_ = null; - onChanged(); - } else { - adaptation_ = null; - adaptationBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. When speech adaptation is set it supersedes the
-     * `speech_contexts` field. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength)
-     * documentation.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - */ - public com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder getAdaptationBuilder() { - - onChanged(); - return getAdaptationFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. When speech adaptation is set it supersedes the
-     * `speech_contexts` field. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength)
-     * documentation.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - */ - public com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder getAdaptationOrBuilder() { - if (adaptationBuilder_ != null) { - return adaptationBuilder_.getMessageOrBuilder(); - } else { - return adaptation_ == null - ? com.google.cloud.speech.v1p1beta1.SpeechAdaptation.getDefaultInstance() - : adaptation_; - } - } - /** - * - * - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. When speech adaptation is set it supersedes the
-     * `speech_contexts` field. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength)
-     * documentation.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechAdaptation, - com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder, - com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder> - getAdaptationFieldBuilder() { - if (adaptationBuilder_ == null) { - adaptationBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechAdaptation, - com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder, - com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder>( - getAdaptation(), getParentForChildren(), isClean()); - adaptation_ = null; - } - return adaptationBuilder_; - } - - private java.util.List speechContexts_ = - java.util.Collections.emptyList(); - - private void ensureSpeechContextsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - speechContexts_ = - new java.util.ArrayList( - speechContexts_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechContext, - com.google.cloud.speech.v1p1beta1.SpeechContext.Builder, - com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder> - speechContextsBuilder_; - - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public java.util.List getSpeechContextsList() { - if (speechContextsBuilder_ == null) { - return java.util.Collections.unmodifiableList(speechContexts_); - } else { - return speechContextsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public int getSpeechContextsCount() { - if (speechContextsBuilder_ == null) { - return speechContexts_.size(); - } else { - return speechContextsBuilder_.getCount(); - } - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public com.google.cloud.speech.v1p1beta1.SpeechContext getSpeechContexts(int index) { - if (speechContextsBuilder_ == null) { - return speechContexts_.get(index); - } else { - return speechContextsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public Builder setSpeechContexts( - int index, com.google.cloud.speech.v1p1beta1.SpeechContext value) { - if (speechContextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSpeechContextsIsMutable(); - speechContexts_.set(index, value); - onChanged(); - } else { - speechContextsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public Builder setSpeechContexts( - int index, com.google.cloud.speech.v1p1beta1.SpeechContext.Builder builderForValue) { - if (speechContextsBuilder_ == null) { - ensureSpeechContextsIsMutable(); - speechContexts_.set(index, builderForValue.build()); - onChanged(); - } else { - speechContextsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public Builder addSpeechContexts(com.google.cloud.speech.v1p1beta1.SpeechContext value) { - if (speechContextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSpeechContextsIsMutable(); - speechContexts_.add(value); - onChanged(); - } else { - speechContextsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public Builder addSpeechContexts( - int index, com.google.cloud.speech.v1p1beta1.SpeechContext value) { - if (speechContextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSpeechContextsIsMutable(); - speechContexts_.add(index, value); - onChanged(); - } else { - speechContextsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public Builder addSpeechContexts( - com.google.cloud.speech.v1p1beta1.SpeechContext.Builder builderForValue) { - if (speechContextsBuilder_ == null) { - ensureSpeechContextsIsMutable(); - speechContexts_.add(builderForValue.build()); - onChanged(); - } else { - speechContextsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public Builder addSpeechContexts( - int index, com.google.cloud.speech.v1p1beta1.SpeechContext.Builder builderForValue) { - if (speechContextsBuilder_ == null) { - ensureSpeechContextsIsMutable(); - speechContexts_.add(index, builderForValue.build()); - onChanged(); - } else { - speechContextsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public Builder addAllSpeechContexts( - java.lang.Iterable values) { - if (speechContextsBuilder_ == null) { - ensureSpeechContextsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, speechContexts_); - onChanged(); - } else { - speechContextsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public Builder clearSpeechContexts() { - if (speechContextsBuilder_ == null) { - speechContexts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - speechContextsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public Builder removeSpeechContexts(int index) { - if (speechContextsBuilder_ == null) { - ensureSpeechContextsIsMutable(); - speechContexts_.remove(index); - onChanged(); - } else { - speechContextsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public com.google.cloud.speech.v1p1beta1.SpeechContext.Builder getSpeechContextsBuilder( - int index) { - return getSpeechContextsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder getSpeechContextsOrBuilder( - int index) { - if (speechContextsBuilder_ == null) { - return speechContexts_.get(index); - } else { - return speechContextsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public java.util.List - getSpeechContextsOrBuilderList() { - if (speechContextsBuilder_ != null) { - return speechContextsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(speechContexts_); - } - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public com.google.cloud.speech.v1p1beta1.SpeechContext.Builder addSpeechContextsBuilder() { - return getSpeechContextsFieldBuilder() - .addBuilder(com.google.cloud.speech.v1p1beta1.SpeechContext.getDefaultInstance()); - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public com.google.cloud.speech.v1p1beta1.SpeechContext.Builder addSpeechContextsBuilder( - int index) { - return getSpeechContextsFieldBuilder() - .addBuilder(index, com.google.cloud.speech.v1p1beta1.SpeechContext.getDefaultInstance()); - } - /** - * - * - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public java.util.List - getSpeechContextsBuilderList() { - return getSpeechContextsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechContext, - com.google.cloud.speech.v1p1beta1.SpeechContext.Builder, - com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder> - getSpeechContextsFieldBuilder() { - if (speechContextsBuilder_ == null) { - speechContextsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechContext, - com.google.cloud.speech.v1p1beta1.SpeechContext.Builder, - com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder>( - speechContexts_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - speechContexts_ = null; - } - return speechContextsBuilder_; - } - - private boolean enableWordTimeOffsets_; - /** - * - * - *
-     * If `true`, the top result includes a list of words and
-     * the start and end time offsets (timestamps) for those words. If
-     * `false`, no word-level time offset information is returned. The default is
-     * `false`.
-     * 
- * - * bool enable_word_time_offsets = 8; - * - * @return The enableWordTimeOffsets. - */ - @java.lang.Override - public boolean getEnableWordTimeOffsets() { - return enableWordTimeOffsets_; - } - /** - * - * - *
-     * If `true`, the top result includes a list of words and
-     * the start and end time offsets (timestamps) for those words. If
-     * `false`, no word-level time offset information is returned. The default is
-     * `false`.
-     * 
- * - * bool enable_word_time_offsets = 8; - * - * @param value The enableWordTimeOffsets to set. - * @return This builder for chaining. - */ - public Builder setEnableWordTimeOffsets(boolean value) { - - enableWordTimeOffsets_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If `true`, the top result includes a list of words and
-     * the start and end time offsets (timestamps) for those words. If
-     * `false`, no word-level time offset information is returned. The default is
-     * `false`.
-     * 
- * - * bool enable_word_time_offsets = 8; - * - * @return This builder for chaining. - */ - public Builder clearEnableWordTimeOffsets() { - - enableWordTimeOffsets_ = false; - onChanged(); - return this; - } - - private boolean enableWordConfidence_; - /** - * - * - *
-     * If `true`, the top result includes a list of words and the
-     * confidence for those words. If `false`, no word-level confidence
-     * information is returned. The default is `false`.
-     * 
- * - * bool enable_word_confidence = 15; - * - * @return The enableWordConfidence. - */ - @java.lang.Override - public boolean getEnableWordConfidence() { - return enableWordConfidence_; - } - /** - * - * - *
-     * If `true`, the top result includes a list of words and the
-     * confidence for those words. If `false`, no word-level confidence
-     * information is returned. The default is `false`.
-     * 
- * - * bool enable_word_confidence = 15; - * - * @param value The enableWordConfidence to set. - * @return This builder for chaining. - */ - public Builder setEnableWordConfidence(boolean value) { - - enableWordConfidence_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If `true`, the top result includes a list of words and the
-     * confidence for those words. If `false`, no word-level confidence
-     * information is returned. The default is `false`.
-     * 
- * - * bool enable_word_confidence = 15; - * - * @return This builder for chaining. - */ - public Builder clearEnableWordConfidence() { - - enableWordConfidence_ = false; - onChanged(); - return this; - } - - private boolean enableAutomaticPunctuation_; - /** - * - * - *
-     * If 'true', adds punctuation to recognition result hypotheses.
-     * This feature is only available in select languages. Setting this for
-     * requests in other languages has no effect at all.
-     * The default 'false' value does not add punctuation to result hypotheses.
-     * 
- * - * bool enable_automatic_punctuation = 11; - * - * @return The enableAutomaticPunctuation. - */ - @java.lang.Override - public boolean getEnableAutomaticPunctuation() { - return enableAutomaticPunctuation_; - } - /** - * - * - *
-     * If 'true', adds punctuation to recognition result hypotheses.
-     * This feature is only available in select languages. Setting this for
-     * requests in other languages has no effect at all.
-     * The default 'false' value does not add punctuation to result hypotheses.
-     * 
- * - * bool enable_automatic_punctuation = 11; - * - * @param value The enableAutomaticPunctuation to set. - * @return This builder for chaining. - */ - public Builder setEnableAutomaticPunctuation(boolean value) { - - enableAutomaticPunctuation_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If 'true', adds punctuation to recognition result hypotheses.
-     * This feature is only available in select languages. Setting this for
-     * requests in other languages has no effect at all.
-     * The default 'false' value does not add punctuation to result hypotheses.
-     * 
- * - * bool enable_automatic_punctuation = 11; - * - * @return This builder for chaining. - */ - public Builder clearEnableAutomaticPunctuation() { - - enableAutomaticPunctuation_ = false; - onChanged(); - return this; - } - - private boolean enableSpeakerDiarization_; - /** - * - * - *
-     * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
-     * Note: Use diarization_config instead.
-     * 
- * - * bool enable_speaker_diarization = 16 [deprecated = true]; - * - * @return The enableSpeakerDiarization. - */ - @java.lang.Override - @java.lang.Deprecated - public boolean getEnableSpeakerDiarization() { - return enableSpeakerDiarization_; - } - /** - * - * - *
-     * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
-     * Note: Use diarization_config instead.
-     * 
- * - * bool enable_speaker_diarization = 16 [deprecated = true]; - * - * @param value The enableSpeakerDiarization to set. - * @return This builder for chaining. - */ - @java.lang.Deprecated - public Builder setEnableSpeakerDiarization(boolean value) { - - enableSpeakerDiarization_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
-     * Note: Use diarization_config instead.
-     * 
- * - * bool enable_speaker_diarization = 16 [deprecated = true]; - * - * @return This builder for chaining. - */ - @java.lang.Deprecated - public Builder clearEnableSpeakerDiarization() { - - enableSpeakerDiarization_ = false; - onChanged(); - return this; - } - - private int diarizationSpeakerCount_; - /** - * - * - *
-     * If set, specifies the estimated number of speakers in the conversation.
-     * Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
-     * Note: Use diarization_config instead.
-     * 
- * - * int32 diarization_speaker_count = 17 [deprecated = true]; - * - * @return The diarizationSpeakerCount. - */ - @java.lang.Override - @java.lang.Deprecated - public int getDiarizationSpeakerCount() { - return diarizationSpeakerCount_; - } - /** - * - * - *
-     * If set, specifies the estimated number of speakers in the conversation.
-     * Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
-     * Note: Use diarization_config instead.
-     * 
- * - * int32 diarization_speaker_count = 17 [deprecated = true]; - * - * @param value The diarizationSpeakerCount to set. - * @return This builder for chaining. - */ - @java.lang.Deprecated - public Builder setDiarizationSpeakerCount(int value) { - - diarizationSpeakerCount_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If set, specifies the estimated number of speakers in the conversation.
-     * Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
-     * Note: Use diarization_config instead.
-     * 
- * - * int32 diarization_speaker_count = 17 [deprecated = true]; - * - * @return This builder for chaining. - */ - @java.lang.Deprecated - public Builder clearDiarizationSpeakerCount() { - - diarizationSpeakerCount_ = 0; - onChanged(); - return this; - } - - private com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarizationConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig, - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder, - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder> - diarizationConfigBuilder_; - /** - * - * - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - * - * @return Whether the diarizationConfig field is set. - */ - public boolean hasDiarizationConfig() { - return diarizationConfigBuilder_ != null || diarizationConfig_ != null; - } - /** - * - * - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - * - * @return The diarizationConfig. - */ - public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig getDiarizationConfig() { - if (diarizationConfigBuilder_ == null) { - return diarizationConfig_ == null - ? com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.getDefaultInstance() - : diarizationConfig_; - } else { - return diarizationConfigBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - */ - public Builder setDiarizationConfig( - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig value) { - if (diarizationConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - diarizationConfig_ = value; - onChanged(); - } else { - diarizationConfigBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - */ - public Builder setDiarizationConfig( - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder builderForValue) { - if (diarizationConfigBuilder_ == null) { - diarizationConfig_ = builderForValue.build(); - onChanged(); - } else { - diarizationConfigBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - */ - public Builder mergeDiarizationConfig( - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig value) { - if (diarizationConfigBuilder_ == null) { - if (diarizationConfig_ != null) { - diarizationConfig_ = - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.newBuilder( - diarizationConfig_) - .mergeFrom(value) - .buildPartial(); - } else { - diarizationConfig_ = value; - } - onChanged(); - } else { - diarizationConfigBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - */ - public Builder clearDiarizationConfig() { - if (diarizationConfigBuilder_ == null) { - diarizationConfig_ = null; - onChanged(); - } else { - diarizationConfig_ = null; - diarizationConfigBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - */ - public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder - getDiarizationConfigBuilder() { - - onChanged(); - return getDiarizationConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - */ - public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder - getDiarizationConfigOrBuilder() { - if (diarizationConfigBuilder_ != null) { - return diarizationConfigBuilder_.getMessageOrBuilder(); - } else { - return diarizationConfig_ == null - ? com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.getDefaultInstance() - : diarizationConfig_; - } - } - /** - * - * - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig, - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder, - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder> - getDiarizationConfigFieldBuilder() { - if (diarizationConfigBuilder_ == null) { - diarizationConfigBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig, - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder, - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder>( - getDiarizationConfig(), getParentForChildren(), isClean()); - diarizationConfig_ = null; - } - return diarizationConfigBuilder_; - } - - private com.google.cloud.speech.v1p1beta1.RecognitionMetadata metadata_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionMetadata, - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder, - com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder> - metadataBuilder_; - /** - * - * - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - * - * @return Whether the metadata field is set. - */ - public boolean hasMetadata() { - return metadataBuilder_ != null || metadata_ != null; - } - /** - * - * - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - * - * @return The metadata. - */ - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata getMetadata() { - if (metadataBuilder_ == null) { - return metadata_ == null - ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDefaultInstance() - : metadata_; - } else { - return metadataBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - */ - public Builder setMetadata(com.google.cloud.speech.v1p1beta1.RecognitionMetadata value) { - if (metadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metadata_ = value; - onChanged(); - } else { - metadataBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - */ - public Builder setMetadata( - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder builderForValue) { - if (metadataBuilder_ == null) { - metadata_ = builderForValue.build(); - onChanged(); - } else { - metadataBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - */ - public Builder mergeMetadata(com.google.cloud.speech.v1p1beta1.RecognitionMetadata value) { - if (metadataBuilder_ == null) { - if (metadata_ != null) { - metadata_ = - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.newBuilder(metadata_) - .mergeFrom(value) - .buildPartial(); - } else { - metadata_ = value; - } - onChanged(); - } else { - metadataBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - */ - public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadata_ = null; - metadataBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - */ - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder getMetadataBuilder() { - - onChanged(); - return getMetadataFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - */ - public com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder getMetadataOrBuilder() { - if (metadataBuilder_ != null) { - return metadataBuilder_.getMessageOrBuilder(); - } else { - return metadata_ == null - ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDefaultInstance() - : metadata_; - } - } - /** - * - * - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionMetadata, - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder, - com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder> - getMetadataFieldBuilder() { - if (metadataBuilder_ == null) { - metadataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionMetadata, - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder, - com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder>( - getMetadata(), getParentForChildren(), isClean()); - metadata_ = null; - } - return metadataBuilder_; - } - - private java.lang.Object model_ = ""; - /** - * - * - *
-     * Which model to select for the given request. Select the model
-     * best suited to your domain to get best results. If a model is not
-     * explicitly specified, then we auto-select a model based on the parameters
-     * in the RecognitionConfig.
-     * <table>
-     *   <tr>
-     *     <td><b>Model</b></td>
-     *     <td><b>Description</b></td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>command_and_search</code></td>
-     *     <td>Best for short queries such as voice commands or voice search.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>phone_call</code></td>
-     *     <td>Best for audio that originated from a phone call (typically
-     *     recorded at an 8khz sampling rate).</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>video</code></td>
-     *     <td>Best for audio that originated from from video or includes multiple
-     *         speakers. Ideally the audio is recorded at a 16khz or greater
-     *         sampling rate. This is a premium model that costs more than the
-     *         standard rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>default</code></td>
-     *     <td>Best for audio that is not one of the specific audio models.
-     *         For example, long-form audio. Ideally the audio is high-fidelity,
-     *         recorded at a 16khz or greater sampling rate.</td>
-     *   </tr>
-     * </table>
-     * 
- * - * string model = 13; - * - * @return The model. - */ - public java.lang.String getModel() { - java.lang.Object ref = model_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - model_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Which model to select for the given request. Select the model
-     * best suited to your domain to get best results. If a model is not
-     * explicitly specified, then we auto-select a model based on the parameters
-     * in the RecognitionConfig.
-     * <table>
-     *   <tr>
-     *     <td><b>Model</b></td>
-     *     <td><b>Description</b></td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>command_and_search</code></td>
-     *     <td>Best for short queries such as voice commands or voice search.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>phone_call</code></td>
-     *     <td>Best for audio that originated from a phone call (typically
-     *     recorded at an 8khz sampling rate).</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>video</code></td>
-     *     <td>Best for audio that originated from from video or includes multiple
-     *         speakers. Ideally the audio is recorded at a 16khz or greater
-     *         sampling rate. This is a premium model that costs more than the
-     *         standard rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>default</code></td>
-     *     <td>Best for audio that is not one of the specific audio models.
-     *         For example, long-form audio. Ideally the audio is high-fidelity,
-     *         recorded at a 16khz or greater sampling rate.</td>
-     *   </tr>
-     * </table>
-     * 
- * - * string model = 13; - * - * @return The bytes for model. - */ - public com.google.protobuf.ByteString getModelBytes() { - java.lang.Object ref = model_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - model_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Which model to select for the given request. Select the model
-     * best suited to your domain to get best results. If a model is not
-     * explicitly specified, then we auto-select a model based on the parameters
-     * in the RecognitionConfig.
-     * <table>
-     *   <tr>
-     *     <td><b>Model</b></td>
-     *     <td><b>Description</b></td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>command_and_search</code></td>
-     *     <td>Best for short queries such as voice commands or voice search.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>phone_call</code></td>
-     *     <td>Best for audio that originated from a phone call (typically
-     *     recorded at an 8khz sampling rate).</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>video</code></td>
-     *     <td>Best for audio that originated from from video or includes multiple
-     *         speakers. Ideally the audio is recorded at a 16khz or greater
-     *         sampling rate. This is a premium model that costs more than the
-     *         standard rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>default</code></td>
-     *     <td>Best for audio that is not one of the specific audio models.
-     *         For example, long-form audio. Ideally the audio is high-fidelity,
-     *         recorded at a 16khz or greater sampling rate.</td>
-     *   </tr>
-     * </table>
-     * 
- * - * string model = 13; - * - * @param value The model to set. - * @return This builder for chaining. - */ - public Builder setModel(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - model_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Which model to select for the given request. Select the model
-     * best suited to your domain to get best results. If a model is not
-     * explicitly specified, then we auto-select a model based on the parameters
-     * in the RecognitionConfig.
-     * <table>
-     *   <tr>
-     *     <td><b>Model</b></td>
-     *     <td><b>Description</b></td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>command_and_search</code></td>
-     *     <td>Best for short queries such as voice commands or voice search.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>phone_call</code></td>
-     *     <td>Best for audio that originated from a phone call (typically
-     *     recorded at an 8khz sampling rate).</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>video</code></td>
-     *     <td>Best for audio that originated from from video or includes multiple
-     *         speakers. Ideally the audio is recorded at a 16khz or greater
-     *         sampling rate. This is a premium model that costs more than the
-     *         standard rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>default</code></td>
-     *     <td>Best for audio that is not one of the specific audio models.
-     *         For example, long-form audio. Ideally the audio is high-fidelity,
-     *         recorded at a 16khz or greater sampling rate.</td>
-     *   </tr>
-     * </table>
-     * 
- * - * string model = 13; - * - * @return This builder for chaining. - */ - public Builder clearModel() { - - model_ = getDefaultInstance().getModel(); - onChanged(); - return this; - } - /** - * - * - *
-     * Which model to select for the given request. Select the model
-     * best suited to your domain to get best results. If a model is not
-     * explicitly specified, then we auto-select a model based on the parameters
-     * in the RecognitionConfig.
-     * <table>
-     *   <tr>
-     *     <td><b>Model</b></td>
-     *     <td><b>Description</b></td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>command_and_search</code></td>
-     *     <td>Best for short queries such as voice commands or voice search.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>phone_call</code></td>
-     *     <td>Best for audio that originated from a phone call (typically
-     *     recorded at an 8khz sampling rate).</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>video</code></td>
-     *     <td>Best for audio that originated from from video or includes multiple
-     *         speakers. Ideally the audio is recorded at a 16khz or greater
-     *         sampling rate. This is a premium model that costs more than the
-     *         standard rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>default</code></td>
-     *     <td>Best for audio that is not one of the specific audio models.
-     *         For example, long-form audio. Ideally the audio is high-fidelity,
-     *         recorded at a 16khz or greater sampling rate.</td>
-     *   </tr>
-     * </table>
-     * 
- * - * string model = 13; - * - * @param value The bytes for model to set. - * @return This builder for chaining. - */ - public Builder setModelBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - model_ = value; - onChanged(); - return this; - } - - private boolean useEnhanced_; - /** - * - * - *
-     * Set to true to use an enhanced model for speech recognition.
-     * If `use_enhanced` is set to true and the `model` field is not set, then
-     * an appropriate enhanced model is chosen if an enhanced model exists for
-     * the audio.
-     * If `use_enhanced` is true and an enhanced version of the specified model
-     * does not exist, then the speech is recognized using the standard version
-     * of the specified model.
-     * 
- * - * bool use_enhanced = 14; - * - * @return The useEnhanced. - */ - @java.lang.Override - public boolean getUseEnhanced() { - return useEnhanced_; - } - /** - * - * - *
-     * Set to true to use an enhanced model for speech recognition.
-     * If `use_enhanced` is set to true and the `model` field is not set, then
-     * an appropriate enhanced model is chosen if an enhanced model exists for
-     * the audio.
-     * If `use_enhanced` is true and an enhanced version of the specified model
-     * does not exist, then the speech is recognized using the standard version
-     * of the specified model.
-     * 
- * - * bool use_enhanced = 14; - * - * @param value The useEnhanced to set. - * @return This builder for chaining. - */ - public Builder setUseEnhanced(boolean value) { - - useEnhanced_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Set to true to use an enhanced model for speech recognition.
-     * If `use_enhanced` is set to true and the `model` field is not set, then
-     * an appropriate enhanced model is chosen if an enhanced model exists for
-     * the audio.
-     * If `use_enhanced` is true and an enhanced version of the specified model
-     * does not exist, then the speech is recognized using the standard version
-     * of the specified model.
-     * 
- * - * bool use_enhanced = 14; - * - * @return This builder for chaining. - */ - public Builder clearUseEnhanced() { - - useEnhanced_ = false; - 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.RecognitionConfig) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.RecognitionConfig) - private static final com.google.cloud.speech.v1p1beta1.RecognitionConfig DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.RecognitionConfig(); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecognitionConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognitionConfig(input, extensionRegistry); - } - }; - - 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.RecognitionConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfigOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfigOrBuilder.java deleted file mode 100644 index 199837a00..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfigOrBuilder.java +++ /dev/null @@ -1,676 +0,0 @@ -/* - * 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 RecognitionConfigOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.RecognitionConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Encoding of audio data sent in all `RecognitionAudio` messages.
-   * This field is optional for `FLAC` and `WAV` audio files and required
-   * for all other audio formats. For details, see
-   * [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; - * - * @return The enum numeric value on the wire for encoding. - */ - int getEncodingValue(); - /** - * - * - *
-   * Encoding of audio data sent in all `RecognitionAudio` messages.
-   * This field is optional for `FLAC` and `WAV` audio files and required
-   * for all other audio formats. For details, see
-   * [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; - * - * @return The encoding. - */ - com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding getEncoding(); - - /** - * - * - *
-   * Sample rate in Hertz of the audio data sent in all
-   * `RecognitionAudio` messages. Valid values are: 8000-48000.
-   * 16000 is optimal. For best results, set the sampling rate of the audio
-   * source to 16000 Hz. If that's not possible, use the native sample rate of
-   * the audio source (instead of re-sampling).
-   * This field is optional for FLAC and WAV audio files, but is
-   * required for all other audio formats. For details, see
-   * [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-   * 
- * - * int32 sample_rate_hertz = 2; - * - * @return The sampleRateHertz. - */ - 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 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.
-   * To perform independent recognition on each channel set
-   * `enable_separate_recognition_per_channel` to 'true'.
-   * 
- * - * int32 audio_channel_count = 7; - * - * @return The audioChannelCount. - */ - int getAudioChannelCount(); - - /** - * - * - *
-   * This needs to be set to `true` explicitly and `audio_channel_count` > 1
-   * to get each channel recognized separately. The recognition result will
-   * contain a `channel_tag` field to state which channel that result belongs
-   * to. If this is not true, we will only recognize the first channel. The
-   * request is billed cumulatively for all channels recognized:
-   * `audio_channel_count` multiplied by the length of the audio.
-   * 
- * - * bool enable_separate_recognition_per_channel = 12; - * - * @return The enableSeparateRecognitionPerChannel. - */ - boolean getEnableSeparateRecognitionPerChannel(); - - /** - * - * - *
-   * Required. The language of the supplied audio as a
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-   * Example: "en-US".
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes.
-   * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The languageCode. - */ - java.lang.String getLanguageCode(); - /** - * - * - *
-   * Required. The language of the supplied audio as a
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-   * Example: "en-US".
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes.
-   * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for languageCode. - */ - com.google.protobuf.ByteString getLanguageCodeBytes(); - - /** - * - * - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * - * @return A list containing the alternativeLanguageCodes. - */ - java.util.List getAlternativeLanguageCodesList(); - /** - * - * - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * - * @return The count of alternativeLanguageCodes. - */ - int getAlternativeLanguageCodesCount(); - /** - * - * - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * - * @param index The index of the element to return. - * @return The alternativeLanguageCodes at the given index. - */ - java.lang.String getAlternativeLanguageCodes(int index); - /** - * - * - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * - * @param index The index of the value to return. - * @return The bytes of the alternativeLanguageCodes at the given index. - */ - com.google.protobuf.ByteString getAlternativeLanguageCodesBytes(int index); - - /** - * - * - *
-   * Maximum number of recognition hypotheses to be returned.
-   * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-   * within each `SpeechRecognitionResult`.
-   * The server may return fewer than `max_alternatives`.
-   * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-   * one. If omitted, will return a maximum of one.
-   * 
- * - * int32 max_alternatives = 4; - * - * @return The maxAlternatives. - */ - int getMaxAlternatives(); - - /** - * - * - *
-   * If set to `true`, the server will attempt to filter out
-   * profanities, replacing all but the initial character in each filtered word
-   * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-   * won't be filtered out.
-   * 
- * - * bool profanity_filter = 5; - * - * @return The profanityFilter. - */ - boolean getProfanityFilter(); - - /** - * - * - *
-   * Speech adaptation configuration improves the accuracy of speech
-   * recognition. When speech adaptation is set it supersedes the
-   * `speech_contexts` field. For more information, see the [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength)
-   * documentation.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - * - * @return Whether the adaptation field is set. - */ - boolean hasAdaptation(); - /** - * - * - *
-   * Speech adaptation configuration improves the accuracy of speech
-   * recognition. When speech adaptation is set it supersedes the
-   * `speech_contexts` field. For more information, see the [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength)
-   * documentation.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - * - * @return The adaptation. - */ - com.google.cloud.speech.v1p1beta1.SpeechAdaptation getAdaptation(); - /** - * - * - *
-   * Speech adaptation configuration improves the accuracy of speech
-   * recognition. When speech adaptation is set it supersedes the
-   * `speech_contexts` field. For more information, see the [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength)
-   * documentation.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - */ - com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder getAdaptationOrBuilder(); - - /** - * - * - *
-   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - java.util.List getSpeechContextsList(); - /** - * - * - *
-   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - com.google.cloud.speech.v1p1beta1.SpeechContext getSpeechContexts(int index); - /** - * - * - *
-   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - int getSpeechContextsCount(); - /** - * - * - *
-   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - java.util.List - getSpeechContextsOrBuilderList(); - /** - * - * - *
-   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder getSpeechContextsOrBuilder(int index); - - /** - * - * - *
-   * If `true`, the top result includes a list of words and
-   * the start and end time offsets (timestamps) for those words. If
-   * `false`, no word-level time offset information is returned. The default is
-   * `false`.
-   * 
- * - * bool enable_word_time_offsets = 8; - * - * @return The enableWordTimeOffsets. - */ - boolean getEnableWordTimeOffsets(); - - /** - * - * - *
-   * If `true`, the top result includes a list of words and the
-   * confidence for those words. If `false`, no word-level confidence
-   * information is returned. The default is `false`.
-   * 
- * - * bool enable_word_confidence = 15; - * - * @return The enableWordConfidence. - */ - boolean getEnableWordConfidence(); - - /** - * - * - *
-   * If 'true', adds punctuation to recognition result hypotheses.
-   * This feature is only available in select languages. Setting this for
-   * requests in other languages has no effect at all.
-   * The default 'false' value does not add punctuation to result hypotheses.
-   * 
- * - * bool enable_automatic_punctuation = 11; - * - * @return The enableAutomaticPunctuation. - */ - boolean getEnableAutomaticPunctuation(); - - /** - * - * - *
-   * If 'true', enables speaker detection for each recognized word in
-   * the top alternative of the recognition result using a speaker_tag provided
-   * in the WordInfo.
-   * Note: Use diarization_config instead.
-   * 
- * - * bool enable_speaker_diarization = 16 [deprecated = true]; - * - * @return The enableSpeakerDiarization. - */ - @java.lang.Deprecated - boolean getEnableSpeakerDiarization(); - - /** - * - * - *
-   * If set, specifies the estimated number of speakers in the conversation.
-   * Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
-   * Note: Use diarization_config instead.
-   * 
- * - * int32 diarization_speaker_count = 17 [deprecated = true]; - * - * @return The diarizationSpeakerCount. - */ - @java.lang.Deprecated - int getDiarizationSpeakerCount(); - - /** - * - * - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - * - * @return Whether the diarizationConfig field is set. - */ - boolean hasDiarizationConfig(); - /** - * - * - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - * - * @return The diarizationConfig. - */ - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig getDiarizationConfig(); - /** - * - * - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - */ - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder - getDiarizationConfigOrBuilder(); - - /** - * - * - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - * - * @return Whether the metadata field is set. - */ - boolean hasMetadata(); - /** - * - * - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - * - * @return The metadata. - */ - com.google.cloud.speech.v1p1beta1.RecognitionMetadata getMetadata(); - /** - * - * - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - */ - com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder getMetadataOrBuilder(); - - /** - * - * - *
-   * Which model to select for the given request. Select the model
-   * best suited to your domain to get best results. If a model is not
-   * explicitly specified, then we auto-select a model based on the parameters
-   * in the RecognitionConfig.
-   * <table>
-   *   <tr>
-   *     <td><b>Model</b></td>
-   *     <td><b>Description</b></td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>command_and_search</code></td>
-   *     <td>Best for short queries such as voice commands or voice search.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>phone_call</code></td>
-   *     <td>Best for audio that originated from a phone call (typically
-   *     recorded at an 8khz sampling rate).</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>video</code></td>
-   *     <td>Best for audio that originated from from video or includes multiple
-   *         speakers. Ideally the audio is recorded at a 16khz or greater
-   *         sampling rate. This is a premium model that costs more than the
-   *         standard rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>default</code></td>
-   *     <td>Best for audio that is not one of the specific audio models.
-   *         For example, long-form audio. Ideally the audio is high-fidelity,
-   *         recorded at a 16khz or greater sampling rate.</td>
-   *   </tr>
-   * </table>
-   * 
- * - * string model = 13; - * - * @return The model. - */ - java.lang.String getModel(); - /** - * - * - *
-   * Which model to select for the given request. Select the model
-   * best suited to your domain to get best results. If a model is not
-   * explicitly specified, then we auto-select a model based on the parameters
-   * in the RecognitionConfig.
-   * <table>
-   *   <tr>
-   *     <td><b>Model</b></td>
-   *     <td><b>Description</b></td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>command_and_search</code></td>
-   *     <td>Best for short queries such as voice commands or voice search.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>phone_call</code></td>
-   *     <td>Best for audio that originated from a phone call (typically
-   *     recorded at an 8khz sampling rate).</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>video</code></td>
-   *     <td>Best for audio that originated from from video or includes multiple
-   *         speakers. Ideally the audio is recorded at a 16khz or greater
-   *         sampling rate. This is a premium model that costs more than the
-   *         standard rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>default</code></td>
-   *     <td>Best for audio that is not one of the specific audio models.
-   *         For example, long-form audio. Ideally the audio is high-fidelity,
-   *         recorded at a 16khz or greater sampling rate.</td>
-   *   </tr>
-   * </table>
-   * 
- * - * string model = 13; - * - * @return The bytes for model. - */ - com.google.protobuf.ByteString getModelBytes(); - - /** - * - * - *
-   * Set to true to use an enhanced model for speech recognition.
-   * If `use_enhanced` is set to true and the `model` field is not set, then
-   * an appropriate enhanced model is chosen if an enhanced model exists for
-   * the audio.
-   * If `use_enhanced` is true and an enhanced version of the specified model
-   * does not exist, then the speech is recognized using the standard version
-   * of the specified model.
-   * 
- * - * bool use_enhanced = 14; - * - * @return The useEnhanced. - */ - boolean getUseEnhanced(); -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadata.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadata.java deleted file mode 100644 index 068385ebf..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadata.java +++ /dev/null @@ -1,2859 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * Description of audio data to be recognized.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognitionMetadata} - */ -public final class RecognitionMetadata extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.RecognitionMetadata) - RecognitionMetadataOrBuilder { - private static final long serialVersionUID = 0L; - // Use RecognitionMetadata.newBuilder() to construct. - private RecognitionMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private RecognitionMetadata() { - interactionType_ = 0; - microphoneDistance_ = 0; - originalMediaType_ = 0; - recordingDeviceType_ = 0; - recordingDeviceName_ = ""; - originalMimeType_ = ""; - audioTopic_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RecognitionMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private RecognitionMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - int rawValue = input.readEnum(); - - interactionType_ = rawValue; - break; - } - case 24: - { - industryNaicsCodeOfAudio_ = input.readUInt32(); - break; - } - case 32: - { - int rawValue = input.readEnum(); - - microphoneDistance_ = rawValue; - break; - } - case 40: - { - int rawValue = input.readEnum(); - - originalMediaType_ = rawValue; - break; - } - case 48: - { - int rawValue = input.readEnum(); - - recordingDeviceType_ = rawValue; - break; - } - case 58: - { - java.lang.String s = input.readStringRequireUtf8(); - - recordingDeviceName_ = s; - break; - } - case 66: - { - java.lang.String s = input.readStringRequireUtf8(); - - originalMimeType_ = s; - break; - } - case 72: - { - obfuscatedId_ = input.readInt64(); - break; - } - case 82: - { - java.lang.String s = input.readStringRequireUtf8(); - - audioTopic_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.class, - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder.class); - } - - /** - * - * - *
-   * Use case categories that the audio recognition request can be described
-   * by.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType} - */ - public enum InteractionType implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * Use case is either unknown or is something other than one of the other
-     * values below.
-     * 
- * - * INTERACTION_TYPE_UNSPECIFIED = 0; - */ - INTERACTION_TYPE_UNSPECIFIED(0), - /** - * - * - *
-     * Multiple people in a conversation or discussion. For example in a
-     * meeting with two or more people actively participating. Typically
-     * all the primary people speaking would be in the same room (if not,
-     * see PHONE_CALL)
-     * 
- * - * DISCUSSION = 1; - */ - DISCUSSION(1), - /** - * - * - *
-     * One or more persons lecturing or presenting to others, mostly
-     * uninterrupted.
-     * 
- * - * PRESENTATION = 2; - */ - PRESENTATION(2), - /** - * - * - *
-     * A phone-call or video-conference in which two or more people, who are
-     * not in the same room, are actively participating.
-     * 
- * - * PHONE_CALL = 3; - */ - PHONE_CALL(3), - /** - * - * - *
-     * A recorded message intended for another person to listen to.
-     * 
- * - * VOICEMAIL = 4; - */ - VOICEMAIL(4), - /** - * - * - *
-     * Professionally produced audio (eg. TV Show, Podcast).
-     * 
- * - * PROFESSIONALLY_PRODUCED = 5; - */ - PROFESSIONALLY_PRODUCED(5), - /** - * - * - *
-     * Transcribe spoken questions and queries into text.
-     * 
- * - * VOICE_SEARCH = 6; - */ - VOICE_SEARCH(6), - /** - * - * - *
-     * Transcribe voice commands, such as for controlling a device.
-     * 
- * - * VOICE_COMMAND = 7; - */ - VOICE_COMMAND(7), - /** - * - * - *
-     * Transcribe speech to text to create a written document, such as a
-     * text-message, email or report.
-     * 
- * - * DICTATION = 8; - */ - DICTATION(8), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * Use case is either unknown or is something other than one of the other
-     * values below.
-     * 
- * - * INTERACTION_TYPE_UNSPECIFIED = 0; - */ - public static final int INTERACTION_TYPE_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * Multiple people in a conversation or discussion. For example in a
-     * meeting with two or more people actively participating. Typically
-     * all the primary people speaking would be in the same room (if not,
-     * see PHONE_CALL)
-     * 
- * - * DISCUSSION = 1; - */ - public static final int DISCUSSION_VALUE = 1; - /** - * - * - *
-     * One or more persons lecturing or presenting to others, mostly
-     * uninterrupted.
-     * 
- * - * PRESENTATION = 2; - */ - public static final int PRESENTATION_VALUE = 2; - /** - * - * - *
-     * A phone-call or video-conference in which two or more people, who are
-     * not in the same room, are actively participating.
-     * 
- * - * PHONE_CALL = 3; - */ - public static final int PHONE_CALL_VALUE = 3; - /** - * - * - *
-     * A recorded message intended for another person to listen to.
-     * 
- * - * VOICEMAIL = 4; - */ - public static final int VOICEMAIL_VALUE = 4; - /** - * - * - *
-     * Professionally produced audio (eg. TV Show, Podcast).
-     * 
- * - * PROFESSIONALLY_PRODUCED = 5; - */ - public static final int PROFESSIONALLY_PRODUCED_VALUE = 5; - /** - * - * - *
-     * Transcribe spoken questions and queries into text.
-     * 
- * - * VOICE_SEARCH = 6; - */ - public static final int VOICE_SEARCH_VALUE = 6; - /** - * - * - *
-     * Transcribe voice commands, such as for controlling a device.
-     * 
- * - * VOICE_COMMAND = 7; - */ - public static final int VOICE_COMMAND_VALUE = 7; - /** - * - * - *
-     * Transcribe speech to text to create a written document, such as a
-     * text-message, email or report.
-     * 
- * - * DICTATION = 8; - */ - public static final int DICTATION_VALUE = 8; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static InteractionType valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static InteractionType forNumber(int value) { - switch (value) { - case 0: - return INTERACTION_TYPE_UNSPECIFIED; - case 1: - return DISCUSSION; - case 2: - return PRESENTATION; - case 3: - return PHONE_CALL; - case 4: - return VOICEMAIL; - case 5: - return PROFESSIONALLY_PRODUCED; - case 6: - return VOICE_SEARCH; - case 7: - return VOICE_COMMAND; - case 8: - return DICTATION; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public InteractionType findValueByNumber(int number) { - return InteractionType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDescriptor() - .getEnumTypes() - .get(0); - } - - private static final InteractionType[] VALUES = values(); - - public static InteractionType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private InteractionType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType) - } - - /** - * - * - *
-   * Enumerates the types of capture settings describing an audio file.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance} - */ - public enum MicrophoneDistance implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * Audio type is not known.
-     * 
- * - * MICROPHONE_DISTANCE_UNSPECIFIED = 0; - */ - MICROPHONE_DISTANCE_UNSPECIFIED(0), - /** - * - * - *
-     * The audio was captured from a closely placed microphone. Eg. phone,
-     * dictaphone, or handheld microphone. Generally if there speaker is within
-     * 1 meter of the microphone.
-     * 
- * - * NEARFIELD = 1; - */ - NEARFIELD(1), - /** - * - * - *
-     * The speaker if within 3 meters of the microphone.
-     * 
- * - * MIDFIELD = 2; - */ - MIDFIELD(2), - /** - * - * - *
-     * The speaker is more than 3 meters away from the microphone.
-     * 
- * - * FARFIELD = 3; - */ - FARFIELD(3), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * Audio type is not known.
-     * 
- * - * MICROPHONE_DISTANCE_UNSPECIFIED = 0; - */ - public static final int MICROPHONE_DISTANCE_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * The audio was captured from a closely placed microphone. Eg. phone,
-     * dictaphone, or handheld microphone. Generally if there speaker is within
-     * 1 meter of the microphone.
-     * 
- * - * NEARFIELD = 1; - */ - public static final int NEARFIELD_VALUE = 1; - /** - * - * - *
-     * The speaker if within 3 meters of the microphone.
-     * 
- * - * MIDFIELD = 2; - */ - public static final int MIDFIELD_VALUE = 2; - /** - * - * - *
-     * The speaker is more than 3 meters away from the microphone.
-     * 
- * - * FARFIELD = 3; - */ - public static final int FARFIELD_VALUE = 3; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static MicrophoneDistance valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static MicrophoneDistance forNumber(int value) { - switch (value) { - case 0: - return MICROPHONE_DISTANCE_UNSPECIFIED; - case 1: - return NEARFIELD; - case 2: - return MIDFIELD; - case 3: - return FARFIELD; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public MicrophoneDistance findValueByNumber(int number) { - return MicrophoneDistance.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDescriptor() - .getEnumTypes() - .get(1); - } - - private static final MicrophoneDistance[] VALUES = values(); - - public static MicrophoneDistance valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private MicrophoneDistance(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance) - } - - /** - * - * - *
-   * The original media the speech was recorded on.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType} - */ - public enum OriginalMediaType implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * Unknown original media type.
-     * 
- * - * ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; - */ - ORIGINAL_MEDIA_TYPE_UNSPECIFIED(0), - /** - * - * - *
-     * The speech data is an audio recording.
-     * 
- * - * AUDIO = 1; - */ - AUDIO(1), - /** - * - * - *
-     * The speech data originally recorded on a video.
-     * 
- * - * VIDEO = 2; - */ - VIDEO(2), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * Unknown original media type.
-     * 
- * - * ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; - */ - public static final int ORIGINAL_MEDIA_TYPE_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * The speech data is an audio recording.
-     * 
- * - * AUDIO = 1; - */ - public static final int AUDIO_VALUE = 1; - /** - * - * - *
-     * The speech data originally recorded on a video.
-     * 
- * - * VIDEO = 2; - */ - public static final int VIDEO_VALUE = 2; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OriginalMediaType valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static OriginalMediaType forNumber(int value) { - switch (value) { - case 0: - return ORIGINAL_MEDIA_TYPE_UNSPECIFIED; - case 1: - return AUDIO; - case 2: - return VIDEO; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public OriginalMediaType findValueByNumber(int number) { - return OriginalMediaType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDescriptor() - .getEnumTypes() - .get(2); - } - - private static final OriginalMediaType[] VALUES = values(); - - public static OriginalMediaType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private OriginalMediaType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType) - } - - /** - * - * - *
-   * The type of device the speech was recorded with.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType} - */ - public enum RecordingDeviceType implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * The recording device is unknown.
-     * 
- * - * RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; - */ - RECORDING_DEVICE_TYPE_UNSPECIFIED(0), - /** - * - * - *
-     * Speech was recorded on a smartphone.
-     * 
- * - * SMARTPHONE = 1; - */ - SMARTPHONE(1), - /** - * - * - *
-     * Speech was recorded using a personal computer or tablet.
-     * 
- * - * PC = 2; - */ - PC(2), - /** - * - * - *
-     * Speech was recorded over a phone line.
-     * 
- * - * PHONE_LINE = 3; - */ - PHONE_LINE(3), - /** - * - * - *
-     * Speech was recorded in a vehicle.
-     * 
- * - * VEHICLE = 4; - */ - VEHICLE(4), - /** - * - * - *
-     * Speech was recorded outdoors.
-     * 
- * - * OTHER_OUTDOOR_DEVICE = 5; - */ - OTHER_OUTDOOR_DEVICE(5), - /** - * - * - *
-     * Speech was recorded indoors.
-     * 
- * - * OTHER_INDOOR_DEVICE = 6; - */ - OTHER_INDOOR_DEVICE(6), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * The recording device is unknown.
-     * 
- * - * RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; - */ - public static final int RECORDING_DEVICE_TYPE_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * Speech was recorded on a smartphone.
-     * 
- * - * SMARTPHONE = 1; - */ - public static final int SMARTPHONE_VALUE = 1; - /** - * - * - *
-     * Speech was recorded using a personal computer or tablet.
-     * 
- * - * PC = 2; - */ - public static final int PC_VALUE = 2; - /** - * - * - *
-     * Speech was recorded over a phone line.
-     * 
- * - * PHONE_LINE = 3; - */ - public static final int PHONE_LINE_VALUE = 3; - /** - * - * - *
-     * Speech was recorded in a vehicle.
-     * 
- * - * VEHICLE = 4; - */ - public static final int VEHICLE_VALUE = 4; - /** - * - * - *
-     * Speech was recorded outdoors.
-     * 
- * - * OTHER_OUTDOOR_DEVICE = 5; - */ - public static final int OTHER_OUTDOOR_DEVICE_VALUE = 5; - /** - * - * - *
-     * Speech was recorded indoors.
-     * 
- * - * OTHER_INDOOR_DEVICE = 6; - */ - public static final int OTHER_INDOOR_DEVICE_VALUE = 6; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static RecordingDeviceType valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static RecordingDeviceType forNumber(int value) { - switch (value) { - case 0: - return RECORDING_DEVICE_TYPE_UNSPECIFIED; - case 1: - return SMARTPHONE; - case 2: - return PC; - case 3: - return PHONE_LINE; - case 4: - return VEHICLE; - case 5: - return OTHER_OUTDOOR_DEVICE; - case 6: - return OTHER_INDOOR_DEVICE; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public RecordingDeviceType findValueByNumber(int number) { - return RecordingDeviceType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDescriptor() - .getEnumTypes() - .get(3); - } - - private static final RecordingDeviceType[] VALUES = values(); - - public static RecordingDeviceType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private RecordingDeviceType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType) - } - - public static final int INTERACTION_TYPE_FIELD_NUMBER = 1; - private int interactionType_; - /** - * - * - *
-   * The use case most closely describing the audio content to be recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; - * - * - * @return The enum numeric value on the wire for interactionType. - */ - @java.lang.Override - public int getInteractionTypeValue() { - return interactionType_; - } - /** - * - * - *
-   * The use case most closely describing the audio content to be recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; - * - * - * @return The interactionType. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType - getInteractionType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType result = - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType.valueOf( - interactionType_); - return result == null - ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType.UNRECOGNIZED - : result; - } - - public static final int INDUSTRY_NAICS_CODE_OF_AUDIO_FIELD_NUMBER = 3; - private int industryNaicsCodeOfAudio_; - /** - * - * - *
-   * The industry vertical to which this speech recognition request most
-   * closely applies. This is most indicative of the topics contained
-   * in the audio.  Use the 6-digit NAICS code to identify the industry
-   * vertical - see https://www.naics.com/search/.
-   * 
- * - * uint32 industry_naics_code_of_audio = 3; - * - * @return The industryNaicsCodeOfAudio. - */ - @java.lang.Override - public int getIndustryNaicsCodeOfAudio() { - return industryNaicsCodeOfAudio_; - } - - public static final int MICROPHONE_DISTANCE_FIELD_NUMBER = 4; - private int microphoneDistance_; - /** - * - * - *
-   * The audio type that most closely describes the audio being recognized.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * - * - * @return The enum numeric value on the wire for microphoneDistance. - */ - @java.lang.Override - public int getMicrophoneDistanceValue() { - return microphoneDistance_; - } - /** - * - * - *
-   * The audio type that most closely describes the audio being recognized.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * - * - * @return The microphoneDistance. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance - getMicrophoneDistance() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance result = - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance.valueOf( - microphoneDistance_); - return result == null - ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance.UNRECOGNIZED - : result; - } - - public static final int ORIGINAL_MEDIA_TYPE_FIELD_NUMBER = 5; - private int originalMediaType_; - /** - * - * - *
-   * The original media the speech was recorded on.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * - * - * @return The enum numeric value on the wire for originalMediaType. - */ - @java.lang.Override - public int getOriginalMediaTypeValue() { - return originalMediaType_; - } - /** - * - * - *
-   * The original media the speech was recorded on.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * - * - * @return The originalMediaType. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType - getOriginalMediaType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType result = - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType.valueOf( - originalMediaType_); - return result == null - ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType.UNRECOGNIZED - : result; - } - - public static final int RECORDING_DEVICE_TYPE_FIELD_NUMBER = 6; - private int recordingDeviceType_; - /** - * - * - *
-   * The type of device the speech was recorded with.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * - * - * @return The enum numeric value on the wire for recordingDeviceType. - */ - @java.lang.Override - public int getRecordingDeviceTypeValue() { - return recordingDeviceType_; - } - /** - * - * - *
-   * The type of device the speech was recorded with.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * - * - * @return The recordingDeviceType. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType - getRecordingDeviceType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType result = - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType.valueOf( - recordingDeviceType_); - return result == null - ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType.UNRECOGNIZED - : result; - } - - public static final int RECORDING_DEVICE_NAME_FIELD_NUMBER = 7; - private volatile java.lang.Object recordingDeviceName_; - /** - * - * - *
-   * The device used to make the recording.  Examples 'Nexus 5X' or
-   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-   * 'Cardioid Microphone'.
-   * 
- * - * string recording_device_name = 7; - * - * @return The recordingDeviceName. - */ - @java.lang.Override - public java.lang.String getRecordingDeviceName() { - java.lang.Object ref = recordingDeviceName_; - 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(); - recordingDeviceName_ = s; - return s; - } - } - /** - * - * - *
-   * The device used to make the recording.  Examples 'Nexus 5X' or
-   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-   * 'Cardioid Microphone'.
-   * 
- * - * string recording_device_name = 7; - * - * @return The bytes for recordingDeviceName. - */ - @java.lang.Override - public com.google.protobuf.ByteString getRecordingDeviceNameBytes() { - java.lang.Object ref = recordingDeviceName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - recordingDeviceName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ORIGINAL_MIME_TYPE_FIELD_NUMBER = 8; - private volatile java.lang.Object originalMimeType_; - /** - * - * - *
-   * Mime type of the original audio file.  For example `audio/m4a`,
-   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-   * A list of possible audio mime types is maintained at
-   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-   * 
- * - * string original_mime_type = 8; - * - * @return The originalMimeType. - */ - @java.lang.Override - public java.lang.String getOriginalMimeType() { - java.lang.Object ref = originalMimeType_; - 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(); - originalMimeType_ = s; - return s; - } - } - /** - * - * - *
-   * Mime type of the original audio file.  For example `audio/m4a`,
-   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-   * A list of possible audio mime types is maintained at
-   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-   * 
- * - * string original_mime_type = 8; - * - * @return The bytes for originalMimeType. - */ - @java.lang.Override - public com.google.protobuf.ByteString getOriginalMimeTypeBytes() { - java.lang.Object ref = originalMimeType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - originalMimeType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int OBFUSCATED_ID_FIELD_NUMBER = 9; - private long obfuscatedId_; - /** - * - * - *
-   * Obfuscated (privacy-protected) ID of the user, to identify number of
-   * unique users using the service.
-   * 
- * - * int64 obfuscated_id = 9 [deprecated = true]; - * - * @return The obfuscatedId. - */ - @java.lang.Override - @java.lang.Deprecated - public long getObfuscatedId() { - return obfuscatedId_; - } - - public static final int AUDIO_TOPIC_FIELD_NUMBER = 10; - private volatile java.lang.Object audioTopic_; - /** - * - * - *
-   * Description of the content. Eg. "Recordings of federal supreme court
-   * hearings from 2012".
-   * 
- * - * string audio_topic = 10; - * - * @return The audioTopic. - */ - @java.lang.Override - public java.lang.String getAudioTopic() { - java.lang.Object ref = audioTopic_; - 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(); - audioTopic_ = s; - return s; - } - } - /** - * - * - *
-   * Description of the content. Eg. "Recordings of federal supreme court
-   * hearings from 2012".
-   * 
- * - * string audio_topic = 10; - * - * @return The bytes for audioTopic. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAudioTopicBytes() { - java.lang.Object ref = audioTopic_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - audioTopic_ = 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 (interactionType_ - != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType - .INTERACTION_TYPE_UNSPECIFIED - .getNumber()) { - output.writeEnum(1, interactionType_); - } - if (industryNaicsCodeOfAudio_ != 0) { - output.writeUInt32(3, industryNaicsCodeOfAudio_); - } - if (microphoneDistance_ - != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance - .MICROPHONE_DISTANCE_UNSPECIFIED - .getNumber()) { - output.writeEnum(4, microphoneDistance_); - } - if (originalMediaType_ - != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType - .ORIGINAL_MEDIA_TYPE_UNSPECIFIED - .getNumber()) { - output.writeEnum(5, originalMediaType_); - } - if (recordingDeviceType_ - != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType - .RECORDING_DEVICE_TYPE_UNSPECIFIED - .getNumber()) { - output.writeEnum(6, recordingDeviceType_); - } - if (!getRecordingDeviceNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, recordingDeviceName_); - } - if (!getOriginalMimeTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, originalMimeType_); - } - if (obfuscatedId_ != 0L) { - output.writeInt64(9, obfuscatedId_); - } - if (!getAudioTopicBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 10, audioTopic_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (interactionType_ - != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType - .INTERACTION_TYPE_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, interactionType_); - } - if (industryNaicsCodeOfAudio_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeUInt32Size(3, industryNaicsCodeOfAudio_); - } - if (microphoneDistance_ - != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance - .MICROPHONE_DISTANCE_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, microphoneDistance_); - } - if (originalMediaType_ - != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType - .ORIGINAL_MEDIA_TYPE_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, originalMediaType_); - } - if (recordingDeviceType_ - != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType - .RECORDING_DEVICE_TYPE_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, recordingDeviceType_); - } - if (!getRecordingDeviceNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, recordingDeviceName_); - } - if (!getOriginalMimeTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, originalMimeType_); - } - if (obfuscatedId_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(9, obfuscatedId_); - } - if (!getAudioTopicBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, audioTopic_); - } - size += unknownFields.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.RecognitionMetadata)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.RecognitionMetadata other = - (com.google.cloud.speech.v1p1beta1.RecognitionMetadata) obj; - - if (interactionType_ != other.interactionType_) return false; - if (getIndustryNaicsCodeOfAudio() != other.getIndustryNaicsCodeOfAudio()) return false; - if (microphoneDistance_ != other.microphoneDistance_) return false; - if (originalMediaType_ != other.originalMediaType_) return false; - if (recordingDeviceType_ != other.recordingDeviceType_) return false; - if (!getRecordingDeviceName().equals(other.getRecordingDeviceName())) return false; - if (!getOriginalMimeType().equals(other.getOriginalMimeType())) return false; - if (getObfuscatedId() != other.getObfuscatedId()) return false; - if (!getAudioTopic().equals(other.getAudioTopic())) return false; - if (!unknownFields.equals(other.unknownFields)) 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) + INTERACTION_TYPE_FIELD_NUMBER; - hash = (53 * hash) + interactionType_; - hash = (37 * hash) + INDUSTRY_NAICS_CODE_OF_AUDIO_FIELD_NUMBER; - hash = (53 * hash) + getIndustryNaicsCodeOfAudio(); - hash = (37 * hash) + MICROPHONE_DISTANCE_FIELD_NUMBER; - hash = (53 * hash) + microphoneDistance_; - hash = (37 * hash) + ORIGINAL_MEDIA_TYPE_FIELD_NUMBER; - hash = (53 * hash) + originalMediaType_; - hash = (37 * hash) + RECORDING_DEVICE_TYPE_FIELD_NUMBER; - hash = (53 * hash) + recordingDeviceType_; - hash = (37 * hash) + RECORDING_DEVICE_NAME_FIELD_NUMBER; - hash = (53 * hash) + getRecordingDeviceName().hashCode(); - hash = (37 * hash) + ORIGINAL_MIME_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getOriginalMimeType().hashCode(); - hash = (37 * hash) + OBFUSCATED_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getObfuscatedId()); - hash = (37 * hash) + AUDIO_TOPIC_FIELD_NUMBER; - hash = (53 * hash) + getAudioTopic().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata 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.RecognitionMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata 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.RecognitionMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata 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.RecognitionMetadata parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata 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.RecognitionMetadata parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata 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.RecognitionMetadata 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.RecognitionMetadata 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.RecognitionMetadata 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; - } - /** - * - * - *
-   * Description of audio data to be recognized.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognitionMetadata} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.RecognitionMetadata) - com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.class, - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.RecognitionMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - interactionType_ = 0; - - industryNaicsCodeOfAudio_ = 0; - - microphoneDistance_ = 0; - - originalMediaType_ = 0; - - recordingDeviceType_ = 0; - - recordingDeviceName_ = ""; - - originalMimeType_ = ""; - - obfuscatedId_ = 0L; - - audioTopic_ = ""; - - 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_RecognitionMetadata_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata build() { - com.google.cloud.speech.v1p1beta1.RecognitionMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata buildPartial() { - com.google.cloud.speech.v1p1beta1.RecognitionMetadata result = - new com.google.cloud.speech.v1p1beta1.RecognitionMetadata(this); - result.interactionType_ = interactionType_; - result.industryNaicsCodeOfAudio_ = industryNaicsCodeOfAudio_; - result.microphoneDistance_ = microphoneDistance_; - result.originalMediaType_ = originalMediaType_; - result.recordingDeviceType_ = recordingDeviceType_; - result.recordingDeviceName_ = recordingDeviceName_; - result.originalMimeType_ = originalMimeType_; - result.obfuscatedId_ = obfuscatedId_; - result.audioTopic_ = audioTopic_; - 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.RecognitionMetadata) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.RecognitionMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.RecognitionMetadata other) { - if (other == com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDefaultInstance()) - return this; - if (other.interactionType_ != 0) { - setInteractionTypeValue(other.getInteractionTypeValue()); - } - if (other.getIndustryNaicsCodeOfAudio() != 0) { - setIndustryNaicsCodeOfAudio(other.getIndustryNaicsCodeOfAudio()); - } - if (other.microphoneDistance_ != 0) { - setMicrophoneDistanceValue(other.getMicrophoneDistanceValue()); - } - if (other.originalMediaType_ != 0) { - setOriginalMediaTypeValue(other.getOriginalMediaTypeValue()); - } - if (other.recordingDeviceType_ != 0) { - setRecordingDeviceTypeValue(other.getRecordingDeviceTypeValue()); - } - if (!other.getRecordingDeviceName().isEmpty()) { - recordingDeviceName_ = other.recordingDeviceName_; - onChanged(); - } - if (!other.getOriginalMimeType().isEmpty()) { - originalMimeType_ = other.originalMimeType_; - onChanged(); - } - if (other.getObfuscatedId() != 0L) { - setObfuscatedId(other.getObfuscatedId()); - } - if (!other.getAudioTopic().isEmpty()) { - audioTopic_ = other.audioTopic_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.RecognitionMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1p1beta1.RecognitionMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int interactionType_ = 0; - /** - * - * - *
-     * The use case most closely describing the audio content to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; - * - * - * @return The enum numeric value on the wire for interactionType. - */ - @java.lang.Override - public int getInteractionTypeValue() { - return interactionType_; - } - /** - * - * - *
-     * The use case most closely describing the audio content to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; - * - * - * @param value The enum numeric value on the wire for interactionType to set. - * @return This builder for chaining. - */ - public Builder setInteractionTypeValue(int value) { - - interactionType_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The use case most closely describing the audio content to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; - * - * - * @return The interactionType. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType - getInteractionType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType result = - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType.valueOf( - interactionType_); - return result == null - ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType.UNRECOGNIZED - : result; - } - /** - * - * - *
-     * The use case most closely describing the audio content to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; - * - * - * @param value The interactionType to set. - * @return This builder for chaining. - */ - public Builder setInteractionType( - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType value) { - if (value == null) { - throw new NullPointerException(); - } - - interactionType_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * The use case most closely describing the audio content to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; - * - * - * @return This builder for chaining. - */ - public Builder clearInteractionType() { - - interactionType_ = 0; - onChanged(); - return this; - } - - private int industryNaicsCodeOfAudio_; - /** - * - * - *
-     * The industry vertical to which this speech recognition request most
-     * closely applies. This is most indicative of the topics contained
-     * in the audio.  Use the 6-digit NAICS code to identify the industry
-     * vertical - see https://www.naics.com/search/.
-     * 
- * - * uint32 industry_naics_code_of_audio = 3; - * - * @return The industryNaicsCodeOfAudio. - */ - @java.lang.Override - public int getIndustryNaicsCodeOfAudio() { - return industryNaicsCodeOfAudio_; - } - /** - * - * - *
-     * The industry vertical to which this speech recognition request most
-     * closely applies. This is most indicative of the topics contained
-     * in the audio.  Use the 6-digit NAICS code to identify the industry
-     * vertical - see https://www.naics.com/search/.
-     * 
- * - * uint32 industry_naics_code_of_audio = 3; - * - * @param value The industryNaicsCodeOfAudio to set. - * @return This builder for chaining. - */ - public Builder setIndustryNaicsCodeOfAudio(int value) { - - industryNaicsCodeOfAudio_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The industry vertical to which this speech recognition request most
-     * closely applies. This is most indicative of the topics contained
-     * in the audio.  Use the 6-digit NAICS code to identify the industry
-     * vertical - see https://www.naics.com/search/.
-     * 
- * - * uint32 industry_naics_code_of_audio = 3; - * - * @return This builder for chaining. - */ - public Builder clearIndustryNaicsCodeOfAudio() { - - industryNaicsCodeOfAudio_ = 0; - onChanged(); - return this; - } - - private int microphoneDistance_ = 0; - /** - * - * - *
-     * The audio type that most closely describes the audio being recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * - * - * @return The enum numeric value on the wire for microphoneDistance. - */ - @java.lang.Override - public int getMicrophoneDistanceValue() { - return microphoneDistance_; - } - /** - * - * - *
-     * The audio type that most closely describes the audio being recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * - * - * @param value The enum numeric value on the wire for microphoneDistance to set. - * @return This builder for chaining. - */ - public Builder setMicrophoneDistanceValue(int value) { - - microphoneDistance_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The audio type that most closely describes the audio being recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * - * - * @return The microphoneDistance. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance - getMicrophoneDistance() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance result = - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance.valueOf( - microphoneDistance_); - return result == null - ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance.UNRECOGNIZED - : result; - } - /** - * - * - *
-     * The audio type that most closely describes the audio being recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * - * - * @param value The microphoneDistance to set. - * @return This builder for chaining. - */ - public Builder setMicrophoneDistance( - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance value) { - if (value == null) { - throw new NullPointerException(); - } - - microphoneDistance_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * The audio type that most closely describes the audio being recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * - * - * @return This builder for chaining. - */ - public Builder clearMicrophoneDistance() { - - microphoneDistance_ = 0; - onChanged(); - return this; - } - - private int originalMediaType_ = 0; - /** - * - * - *
-     * The original media the speech was recorded on.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * - * - * @return The enum numeric value on the wire for originalMediaType. - */ - @java.lang.Override - public int getOriginalMediaTypeValue() { - return originalMediaType_; - } - /** - * - * - *
-     * The original media the speech was recorded on.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * - * - * @param value The enum numeric value on the wire for originalMediaType to set. - * @return This builder for chaining. - */ - public Builder setOriginalMediaTypeValue(int value) { - - originalMediaType_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The original media the speech was recorded on.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * - * - * @return The originalMediaType. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType - getOriginalMediaType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType result = - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType.valueOf( - originalMediaType_); - return result == null - ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType.UNRECOGNIZED - : result; - } - /** - * - * - *
-     * The original media the speech was recorded on.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * - * - * @param value The originalMediaType to set. - * @return This builder for chaining. - */ - public Builder setOriginalMediaType( - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType value) { - if (value == null) { - throw new NullPointerException(); - } - - originalMediaType_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * The original media the speech was recorded on.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * - * - * @return This builder for chaining. - */ - public Builder clearOriginalMediaType() { - - originalMediaType_ = 0; - onChanged(); - return this; - } - - private int recordingDeviceType_ = 0; - /** - * - * - *
-     * The type of device the speech was recorded with.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * - * - * @return The enum numeric value on the wire for recordingDeviceType. - */ - @java.lang.Override - public int getRecordingDeviceTypeValue() { - return recordingDeviceType_; - } - /** - * - * - *
-     * The type of device the speech was recorded with.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * - * - * @param value The enum numeric value on the wire for recordingDeviceType to set. - * @return This builder for chaining. - */ - public Builder setRecordingDeviceTypeValue(int value) { - - recordingDeviceType_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The type of device the speech was recorded with.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * - * - * @return The recordingDeviceType. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType - getRecordingDeviceType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType result = - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType.valueOf( - recordingDeviceType_); - return result == null - ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType.UNRECOGNIZED - : result; - } - /** - * - * - *
-     * The type of device the speech was recorded with.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * - * - * @param value The recordingDeviceType to set. - * @return This builder for chaining. - */ - public Builder setRecordingDeviceType( - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType value) { - if (value == null) { - throw new NullPointerException(); - } - - recordingDeviceType_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * The type of device the speech was recorded with.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * - * - * @return This builder for chaining. - */ - public Builder clearRecordingDeviceType() { - - recordingDeviceType_ = 0; - onChanged(); - return this; - } - - private java.lang.Object recordingDeviceName_ = ""; - /** - * - * - *
-     * The device used to make the recording.  Examples 'Nexus 5X' or
-     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-     * 'Cardioid Microphone'.
-     * 
- * - * string recording_device_name = 7; - * - * @return The recordingDeviceName. - */ - public java.lang.String getRecordingDeviceName() { - java.lang.Object ref = recordingDeviceName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - recordingDeviceName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The device used to make the recording.  Examples 'Nexus 5X' or
-     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-     * 'Cardioid Microphone'.
-     * 
- * - * string recording_device_name = 7; - * - * @return The bytes for recordingDeviceName. - */ - public com.google.protobuf.ByteString getRecordingDeviceNameBytes() { - java.lang.Object ref = recordingDeviceName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - recordingDeviceName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The device used to make the recording.  Examples 'Nexus 5X' or
-     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-     * 'Cardioid Microphone'.
-     * 
- * - * string recording_device_name = 7; - * - * @param value The recordingDeviceName to set. - * @return This builder for chaining. - */ - public Builder setRecordingDeviceName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - recordingDeviceName_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The device used to make the recording.  Examples 'Nexus 5X' or
-     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-     * 'Cardioid Microphone'.
-     * 
- * - * string recording_device_name = 7; - * - * @return This builder for chaining. - */ - public Builder clearRecordingDeviceName() { - - recordingDeviceName_ = getDefaultInstance().getRecordingDeviceName(); - onChanged(); - return this; - } - /** - * - * - *
-     * The device used to make the recording.  Examples 'Nexus 5X' or
-     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-     * 'Cardioid Microphone'.
-     * 
- * - * string recording_device_name = 7; - * - * @param value The bytes for recordingDeviceName to set. - * @return This builder for chaining. - */ - public Builder setRecordingDeviceNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - recordingDeviceName_ = value; - onChanged(); - return this; - } - - private java.lang.Object originalMimeType_ = ""; - /** - * - * - *
-     * Mime type of the original audio file.  For example `audio/m4a`,
-     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-     * A list of possible audio mime types is maintained at
-     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-     * 
- * - * string original_mime_type = 8; - * - * @return The originalMimeType. - */ - public java.lang.String getOriginalMimeType() { - java.lang.Object ref = originalMimeType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - originalMimeType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Mime type of the original audio file.  For example `audio/m4a`,
-     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-     * A list of possible audio mime types is maintained at
-     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-     * 
- * - * string original_mime_type = 8; - * - * @return The bytes for originalMimeType. - */ - public com.google.protobuf.ByteString getOriginalMimeTypeBytes() { - java.lang.Object ref = originalMimeType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - originalMimeType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Mime type of the original audio file.  For example `audio/m4a`,
-     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-     * A list of possible audio mime types is maintained at
-     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-     * 
- * - * string original_mime_type = 8; - * - * @param value The originalMimeType to set. - * @return This builder for chaining. - */ - public Builder setOriginalMimeType(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - originalMimeType_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Mime type of the original audio file.  For example `audio/m4a`,
-     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-     * A list of possible audio mime types is maintained at
-     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-     * 
- * - * string original_mime_type = 8; - * - * @return This builder for chaining. - */ - public Builder clearOriginalMimeType() { - - originalMimeType_ = getDefaultInstance().getOriginalMimeType(); - onChanged(); - return this; - } - /** - * - * - *
-     * Mime type of the original audio file.  For example `audio/m4a`,
-     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-     * A list of possible audio mime types is maintained at
-     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-     * 
- * - * string original_mime_type = 8; - * - * @param value The bytes for originalMimeType to set. - * @return This builder for chaining. - */ - public Builder setOriginalMimeTypeBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - originalMimeType_ = value; - onChanged(); - return this; - } - - private long obfuscatedId_; - /** - * - * - *
-     * Obfuscated (privacy-protected) ID of the user, to identify number of
-     * unique users using the service.
-     * 
- * - * int64 obfuscated_id = 9 [deprecated = true]; - * - * @return The obfuscatedId. - */ - @java.lang.Override - @java.lang.Deprecated - public long getObfuscatedId() { - return obfuscatedId_; - } - /** - * - * - *
-     * Obfuscated (privacy-protected) ID of the user, to identify number of
-     * unique users using the service.
-     * 
- * - * int64 obfuscated_id = 9 [deprecated = true]; - * - * @param value The obfuscatedId to set. - * @return This builder for chaining. - */ - @java.lang.Deprecated - public Builder setObfuscatedId(long value) { - - obfuscatedId_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Obfuscated (privacy-protected) ID of the user, to identify number of
-     * unique users using the service.
-     * 
- * - * int64 obfuscated_id = 9 [deprecated = true]; - * - * @return This builder for chaining. - */ - @java.lang.Deprecated - public Builder clearObfuscatedId() { - - obfuscatedId_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object audioTopic_ = ""; - /** - * - * - *
-     * Description of the content. Eg. "Recordings of federal supreme court
-     * hearings from 2012".
-     * 
- * - * string audio_topic = 10; - * - * @return The audioTopic. - */ - public java.lang.String getAudioTopic() { - java.lang.Object ref = audioTopic_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - audioTopic_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Description of the content. Eg. "Recordings of federal supreme court
-     * hearings from 2012".
-     * 
- * - * string audio_topic = 10; - * - * @return The bytes for audioTopic. - */ - public com.google.protobuf.ByteString getAudioTopicBytes() { - java.lang.Object ref = audioTopic_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - audioTopic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Description of the content. Eg. "Recordings of federal supreme court
-     * hearings from 2012".
-     * 
- * - * string audio_topic = 10; - * - * @param value The audioTopic to set. - * @return This builder for chaining. - */ - public Builder setAudioTopic(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - audioTopic_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Description of the content. Eg. "Recordings of federal supreme court
-     * hearings from 2012".
-     * 
- * - * string audio_topic = 10; - * - * @return This builder for chaining. - */ - public Builder clearAudioTopic() { - - audioTopic_ = getDefaultInstance().getAudioTopic(); - onChanged(); - return this; - } - /** - * - * - *
-     * Description of the content. Eg. "Recordings of federal supreme court
-     * hearings from 2012".
-     * 
- * - * string audio_topic = 10; - * - * @param value The bytes for audioTopic to set. - * @return This builder for chaining. - */ - public Builder setAudioTopicBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - audioTopic_ = 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.RecognitionMetadata) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.RecognitionMetadata) - private static final com.google.cloud.speech.v1p1beta1.RecognitionMetadata DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.RecognitionMetadata(); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecognitionMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognitionMetadata(input, extensionRegistry); - } - }; - - 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.RecognitionMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadataOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadataOrBuilder.java deleted file mode 100644 index 463ce17b9..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadataOrBuilder.java +++ /dev/null @@ -1,258 +0,0 @@ -/* - * 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 RecognitionMetadataOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.RecognitionMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The use case most closely describing the audio content to be recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; - * - * - * @return The enum numeric value on the wire for interactionType. - */ - int getInteractionTypeValue(); - /** - * - * - *
-   * The use case most closely describing the audio content to be recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; - * - * - * @return The interactionType. - */ - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType getInteractionType(); - - /** - * - * - *
-   * The industry vertical to which this speech recognition request most
-   * closely applies. This is most indicative of the topics contained
-   * in the audio.  Use the 6-digit NAICS code to identify the industry
-   * vertical - see https://www.naics.com/search/.
-   * 
- * - * uint32 industry_naics_code_of_audio = 3; - * - * @return The industryNaicsCodeOfAudio. - */ - int getIndustryNaicsCodeOfAudio(); - - /** - * - * - *
-   * The audio type that most closely describes the audio being recognized.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * - * - * @return The enum numeric value on the wire for microphoneDistance. - */ - int getMicrophoneDistanceValue(); - /** - * - * - *
-   * The audio type that most closely describes the audio being recognized.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * - * - * @return The microphoneDistance. - */ - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance getMicrophoneDistance(); - - /** - * - * - *
-   * The original media the speech was recorded on.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * - * - * @return The enum numeric value on the wire for originalMediaType. - */ - int getOriginalMediaTypeValue(); - /** - * - * - *
-   * The original media the speech was recorded on.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * - * - * @return The originalMediaType. - */ - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType getOriginalMediaType(); - - /** - * - * - *
-   * The type of device the speech was recorded with.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * - * - * @return The enum numeric value on the wire for recordingDeviceType. - */ - int getRecordingDeviceTypeValue(); - /** - * - * - *
-   * The type of device the speech was recorded with.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * - * - * @return The recordingDeviceType. - */ - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType - getRecordingDeviceType(); - - /** - * - * - *
-   * The device used to make the recording.  Examples 'Nexus 5X' or
-   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-   * 'Cardioid Microphone'.
-   * 
- * - * string recording_device_name = 7; - * - * @return The recordingDeviceName. - */ - java.lang.String getRecordingDeviceName(); - /** - * - * - *
-   * The device used to make the recording.  Examples 'Nexus 5X' or
-   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-   * 'Cardioid Microphone'.
-   * 
- * - * string recording_device_name = 7; - * - * @return The bytes for recordingDeviceName. - */ - com.google.protobuf.ByteString getRecordingDeviceNameBytes(); - - /** - * - * - *
-   * Mime type of the original audio file.  For example `audio/m4a`,
-   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-   * A list of possible audio mime types is maintained at
-   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-   * 
- * - * string original_mime_type = 8; - * - * @return The originalMimeType. - */ - java.lang.String getOriginalMimeType(); - /** - * - * - *
-   * Mime type of the original audio file.  For example `audio/m4a`,
-   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-   * A list of possible audio mime types is maintained at
-   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-   * 
- * - * string original_mime_type = 8; - * - * @return The bytes for originalMimeType. - */ - com.google.protobuf.ByteString getOriginalMimeTypeBytes(); - - /** - * - * - *
-   * Obfuscated (privacy-protected) ID of the user, to identify number of
-   * unique users using the service.
-   * 
- * - * int64 obfuscated_id = 9 [deprecated = true]; - * - * @return The obfuscatedId. - */ - @java.lang.Deprecated - long getObfuscatedId(); - - /** - * - * - *
-   * Description of the content. Eg. "Recordings of federal supreme court
-   * hearings from 2012".
-   * 
- * - * string audio_topic = 10; - * - * @return The audioTopic. - */ - java.lang.String getAudioTopic(); - /** - * - * - *
-   * Description of the content. Eg. "Recordings of federal supreme court
-   * hearings from 2012".
-   * 
- * - * string audio_topic = 10; - * - * @return The bytes for audioTopic. - */ - com.google.protobuf.ByteString getAudioTopicBytes(); -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequest.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequest.java deleted file mode 100644 index 24dc5f5a2..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequest.java +++ /dev/null @@ -1,1074 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * The top-level message sent by the client for the `Recognize` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognizeRequest} - */ -public final class RecognizeRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.RecognizeRequest) - RecognizeRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use RecognizeRequest.newBuilder() to construct. - private RecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private RecognizeRequest() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RecognizeRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private RecognizeRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder subBuilder = null; - if (config_ != null) { - subBuilder = config_.toBuilder(); - } - config_ = - input.readMessage( - com.google.cloud.speech.v1p1beta1.RecognitionConfig.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(config_); - config_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder subBuilder = null; - if (audio_ != null) { - subBuilder = audio_.toBuilder(); - } - audio_ = - input.readMessage( - com.google.cloud.speech.v1p1beta1.RecognitionAudio.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(audio_); - audio_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.RecognizeRequest.class, - com.google.cloud.speech.v1p1beta1.RecognizeRequest.Builder.class); - } - - public static final int CONFIG_FIELD_NUMBER = 1; - private com.google.cloud.speech.v1p1beta1.RecognitionConfig config_; - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the config field is set. - */ - @java.lang.Override - public boolean hasConfig() { - return config_ != null; - } - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The config. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig() { - return config_ == null - ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() - : config_; - } - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { - return getConfig(); - } - - public static final int AUDIO_FIELD_NUMBER = 2; - private com.google.cloud.speech.v1p1beta1.RecognitionAudio audio_; - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the audio field is set. - */ - @java.lang.Override - public boolean hasAudio() { - return audio_ != null; - } - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The audio. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionAudio getAudio() { - return audio_ == null - ? com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance() - : audio_; - } - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder getAudioOrBuilder() { - return getAudio(); - } - - 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 (config_ != null) { - output.writeMessage(1, getConfig()); - } - if (audio_ != null) { - output.writeMessage(2, getAudio()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (config_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getConfig()); - } - if (audio_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAudio()); - } - size += unknownFields.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.RecognizeRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.RecognizeRequest other = - (com.google.cloud.speech.v1p1beta1.RecognizeRequest) obj; - - if (hasConfig() != other.hasConfig()) return false; - if (hasConfig()) { - if (!getConfig().equals(other.getConfig())) return false; - } - if (hasAudio() != other.hasAudio()) return false; - if (hasAudio()) { - if (!getAudio().equals(other.getAudio())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConfig()) { - hash = (37 * hash) + CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getConfig().hashCode(); - } - if (hasAudio()) { - hash = (37 * hash) + AUDIO_FIELD_NUMBER; - hash = (53 * hash) + getAudio().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.RecognizeRequest 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.RecognizeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.RecognizeRequest 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.RecognizeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.RecognizeRequest 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.RecognizeRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.RecognizeRequest 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.RecognizeRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.RecognizeRequest 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.RecognizeRequest 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.RecognizeRequest 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.RecognizeRequest 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; - } - /** - * - * - *
-   * The top-level message sent by the client for the `Recognize` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognizeRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.RecognizeRequest) - com.google.cloud.speech.v1p1beta1.RecognizeRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.RecognizeRequest.class, - com.google.cloud.speech.v1p1beta1.RecognizeRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.RecognizeRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (configBuilder_ == null) { - config_ = null; - } else { - config_ = null; - configBuilder_ = null; - } - if (audioBuilder_ == null) { - audio_ = null; - } else { - audio_ = null; - audioBuilder_ = null; - } - 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_RecognizeRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognizeRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.RecognizeRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognizeRequest build() { - com.google.cloud.speech.v1p1beta1.RecognizeRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognizeRequest buildPartial() { - com.google.cloud.speech.v1p1beta1.RecognizeRequest result = - new com.google.cloud.speech.v1p1beta1.RecognizeRequest(this); - if (configBuilder_ == null) { - result.config_ = config_; - } else { - result.config_ = configBuilder_.build(); - } - if (audioBuilder_ == null) { - result.audio_ = audio_; - } else { - result.audio_ = audioBuilder_.build(); - } - 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.RecognizeRequest) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.RecognizeRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.RecognizeRequest other) { - if (other == com.google.cloud.speech.v1p1beta1.RecognizeRequest.getDefaultInstance()) - return this; - if (other.hasConfig()) { - mergeConfig(other.getConfig()); - } - if (other.hasAudio()) { - mergeAudio(other.getAudio()); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.RecognizeRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1p1beta1.RecognizeRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.speech.v1p1beta1.RecognitionConfig config_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionConfig, - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, - com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder> - configBuilder_; - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the config field is set. - */ - public boolean hasConfig() { - return configBuilder_ != null || config_ != null; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The config. - */ - public com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig() { - if (configBuilder_ == null) { - return config_ == null - ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() - : config_; - } else { - return configBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setConfig(com.google.cloud.speech.v1p1beta1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - config_ = value; - onChanged(); - } else { - configBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setConfig( - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder builderForValue) { - if (configBuilder_ == null) { - config_ = builderForValue.build(); - onChanged(); - } else { - configBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeConfig(com.google.cloud.speech.v1p1beta1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (config_ != null) { - config_ = - com.google.cloud.speech.v1p1beta1.RecognitionConfig.newBuilder(config_) - .mergeFrom(value) - .buildPartial(); - } else { - config_ = value; - } - onChanged(); - } else { - configBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearConfig() { - if (configBuilder_ == null) { - config_ = null; - onChanged(); - } else { - config_ = null; - configBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder getConfigBuilder() { - - onChanged(); - return getConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { - if (configBuilder_ != null) { - return configBuilder_.getMessageOrBuilder(); - } else { - return config_ == null - ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() - : config_; - } - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionConfig, - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, - com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder> - getConfigFieldBuilder() { - if (configBuilder_ == null) { - configBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionConfig, - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, - com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder>( - getConfig(), getParentForChildren(), isClean()); - config_ = null; - } - return configBuilder_; - } - - private com.google.cloud.speech.v1p1beta1.RecognitionAudio audio_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionAudio, - com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder, - com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder> - audioBuilder_; - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the audio field is set. - */ - public boolean hasAudio() { - return audioBuilder_ != null || audio_ != null; - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The audio. - */ - public com.google.cloud.speech.v1p1beta1.RecognitionAudio getAudio() { - if (audioBuilder_ == null) { - return audio_ == null - ? com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance() - : audio_; - } else { - return audioBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setAudio(com.google.cloud.speech.v1p1beta1.RecognitionAudio value) { - if (audioBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - audio_ = value; - onChanged(); - } else { - audioBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setAudio( - com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder builderForValue) { - if (audioBuilder_ == null) { - audio_ = builderForValue.build(); - onChanged(); - } else { - audioBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeAudio(com.google.cloud.speech.v1p1beta1.RecognitionAudio value) { - if (audioBuilder_ == null) { - if (audio_ != null) { - audio_ = - com.google.cloud.speech.v1p1beta1.RecognitionAudio.newBuilder(audio_) - .mergeFrom(value) - .buildPartial(); - } else { - audio_ = value; - } - onChanged(); - } else { - audioBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearAudio() { - if (audioBuilder_ == null) { - audio_ = null; - onChanged(); - } else { - audio_ = null; - audioBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder getAudioBuilder() { - - onChanged(); - return getAudioFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder getAudioOrBuilder() { - if (audioBuilder_ != null) { - return audioBuilder_.getMessageOrBuilder(); - } else { - return audio_ == null - ? com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance() - : audio_; - } - } - /** - * - * - *
-     * Required. The audio data to be recognized.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionAudio, - com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder, - com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder> - getAudioFieldBuilder() { - if (audioBuilder_ == null) { - audioBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionAudio, - com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder, - com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder>( - getAudio(), getParentForChildren(), isClean()); - audio_ = null; - } - return audioBuilder_; - } - - @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.RecognizeRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.RecognizeRequest) - private static final com.google.cloud.speech.v1p1beta1.RecognizeRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.RecognizeRequest(); - } - - public static com.google.cloud.speech.v1p1beta1.RecognizeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecognizeRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognizeRequest(input, extensionRegistry); - } - }; - - 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.RecognizeRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequestOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequestOrBuilder.java deleted file mode 100644 index 2f3e881fd..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequestOrBuilder.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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 RecognizeRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.RecognizeRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the config field is set. - */ - boolean hasConfig(); - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The config. - */ - com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig(); - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder(); - - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the audio field is set. - */ - boolean hasAudio(); - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The audio. - */ - com.google.cloud.speech.v1p1beta1.RecognitionAudio getAudio(); - /** - * - * - *
-   * Required. The audio data to be recognized.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder getAudioOrBuilder(); -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponse.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponse.java deleted file mode 100644 index 6b217c7ba..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponse.java +++ /dev/null @@ -1,998 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * The only message returned to the client by the `Recognize` method. It
- * contains the result as zero or more sequential `SpeechRecognitionResult`
- * messages.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognizeResponse} - */ -public final class RecognizeResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.RecognizeResponse) - RecognizeResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use RecognizeResponse.newBuilder() to construct. - private RecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private RecognizeResponse() { - results_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RecognizeResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private RecognizeResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = - new java.util.ArrayList< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult>(); - mutable_bitField0_ |= 0x00000001; - } - results_.add( - input.readMessage( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.parser(), - extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.RecognizeResponse.class, - com.google.cloud.speech.v1p1beta1.RecognizeResponse.Builder.class); - } - - public static final int RESULTS_FIELD_NUMBER = 2; - private java.util.List results_; - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List - getResultsList() { - return results_; - } - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List< - ? extends com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder> - getResultsOrBuilderList() { - return results_; - } - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public int getResultsCount() { - return results_.size(); - } - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getResults(int index) { - return results_.get(index); - } - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - return results_.get(index); - } - - 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 { - for (int i = 0; i < results_.size(); i++) { - output.writeMessage(2, results_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < results_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, results_.get(i)); - } - size += unknownFields.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.RecognizeResponse)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.RecognizeResponse other = - (com.google.cloud.speech.v1p1beta1.RecognizeResponse) obj; - - if (!getResultsList().equals(other.getResultsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getResultsCount() > 0) { - hash = (37 * hash) + RESULTS_FIELD_NUMBER; - hash = (53 * hash) + getResultsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.RecognizeResponse 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.RecognizeResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.RecognizeResponse 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.RecognizeResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.RecognizeResponse 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.RecognizeResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.RecognizeResponse 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.RecognizeResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.RecognizeResponse 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.RecognizeResponse 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.RecognizeResponse 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.RecognizeResponse 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; - } - /** - * - * - *
-   * The only message returned to the client by the `Recognize` method. It
-   * contains the result as zero or more sequential `SpeechRecognitionResult`
-   * messages.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognizeResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.RecognizeResponse) - com.google.cloud.speech.v1p1beta1.RecognizeResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.RecognizeResponse.class, - com.google.cloud.speech.v1p1beta1.RecognizeResponse.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.RecognizeResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getResultsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - resultsBuilder_.clear(); - } - 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_RecognizeResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognizeResponse getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.RecognizeResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognizeResponse build() { - com.google.cloud.speech.v1p1beta1.RecognizeResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognizeResponse buildPartial() { - com.google.cloud.speech.v1p1beta1.RecognizeResponse result = - new com.google.cloud.speech.v1p1beta1.RecognizeResponse(this); - int from_bitField0_ = bitField0_; - if (resultsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.results_ = results_; - } else { - result.results_ = resultsBuilder_.build(); - } - 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.RecognizeResponse) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.RecognizeResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.RecognizeResponse other) { - if (other == com.google.cloud.speech.v1p1beta1.RecognizeResponse.getDefaultInstance()) - return this; - if (resultsBuilder_ == null) { - if (!other.results_.isEmpty()) { - if (results_.isEmpty()) { - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResultsIsMutable(); - results_.addAll(other.results_); - } - onChanged(); - } - } else { - if (!other.results_.isEmpty()) { - if (resultsBuilder_.isEmpty()) { - resultsBuilder_.dispose(); - resultsBuilder_ = null; - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - resultsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getResultsFieldBuilder() - : null; - } else { - resultsBuilder_.addAllMessages(other.results_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.RecognizeResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1p1beta1.RecognizeResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List results_ = - java.util.Collections.emptyList(); - - private void ensureResultsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - results_ = - new java.util.ArrayList( - results_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder> - resultsBuilder_; - - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsList() { - if (resultsBuilder_ == null) { - return java.util.Collections.unmodifiableList(results_); - } else { - return resultsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public int getResultsCount() { - if (resultsBuilder_ == null) { - return results_.size(); - } else { - return resultsBuilder_.getCount(); - } - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getResults(int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.set(index, value); - onChanged(); - } else { - resultsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder setResults( - int index, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.set(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults(com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(value); - onChanged(); - } else { - resultsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(index, value); - onChanged(); - } else { - resultsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - int index, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addAllResults( - java.lang.Iterable - values) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); - onChanged(); - } else { - resultsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder clearResults() { - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - resultsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder removeResults(int index) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.remove(index); - onChanged(); - } else { - resultsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder getResultsBuilder( - int index) { - return getResultsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List< - ? extends com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder> - getResultsOrBuilderList() { - if (resultsBuilder_ != null) { - return resultsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(results_); - } - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder addResultsBuilder() { - return getResultsFieldBuilder() - .addBuilder( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.getDefaultInstance()); - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder addResultsBuilder( - int index) { - return getResultsFieldBuilder() - .addBuilder( - index, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.getDefaultInstance()); - } - /** - * - * - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsBuilderList() { - return getResultsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder> - getResultsFieldBuilder() { - if (resultsBuilder_ == null) { - resultsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder>( - results_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - results_ = null; - } - return resultsBuilder_; - } - - @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.RecognizeResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.RecognizeResponse) - private static final com.google.cloud.speech.v1p1beta1.RecognizeResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.RecognizeResponse(); - } - - public static com.google.cloud.speech.v1p1beta1.RecognizeResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecognizeResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognizeResponse(input, extensionRegistry); - } - }; - - 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.RecognizeResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponseOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponseOrBuilder.java deleted file mode 100644 index 421822456..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponseOrBuilder.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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 RecognizeResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.RecognizeResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - java.util.List getResultsList(); - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getResults(int index); - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - int getResultsCount(); - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - java.util.List - getResultsOrBuilderList(); - /** - * - * - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder(int index); -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfig.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfig.java deleted file mode 100644 index ce7343779..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfig.java +++ /dev/null @@ -1,849 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * Config to enable speaker diarization.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} - */ -public final class SpeakerDiarizationConfig extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) - SpeakerDiarizationConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use SpeakerDiarizationConfig.newBuilder() to construct. - private SpeakerDiarizationConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SpeakerDiarizationConfig() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SpeakerDiarizationConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private SpeakerDiarizationConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - enableSpeakerDiarization_ = input.readBool(); - break; - } - case 16: - { - minSpeakerCount_ = input.readInt32(); - break; - } - case 24: - { - maxSpeakerCount_ = input.readInt32(); - break; - } - case 40: - { - speakerTag_ = input.readInt32(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.class, - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder.class); - } - - public static final int ENABLE_SPEAKER_DIARIZATION_FIELD_NUMBER = 1; - private boolean enableSpeakerDiarization_; - /** - * - * - *
-   * If 'true', enables speaker detection for each recognized word in
-   * the top alternative of the recognition result using a speaker_tag provided
-   * in the WordInfo.
-   * 
- * - * bool enable_speaker_diarization = 1; - * - * @return The enableSpeakerDiarization. - */ - @java.lang.Override - public boolean getEnableSpeakerDiarization() { - return enableSpeakerDiarization_; - } - - public static final int MIN_SPEAKER_COUNT_FIELD_NUMBER = 2; - private int minSpeakerCount_; - /** - * - * - *
-   * Minimum number of speakers in the conversation. This range gives you more
-   * flexibility by allowing the system to automatically determine the correct
-   * number of speakers. If not set, the default value is 2.
-   * 
- * - * int32 min_speaker_count = 2; - * - * @return The minSpeakerCount. - */ - @java.lang.Override - public int getMinSpeakerCount() { - return minSpeakerCount_; - } - - public static final int MAX_SPEAKER_COUNT_FIELD_NUMBER = 3; - private int maxSpeakerCount_; - /** - * - * - *
-   * Maximum number of speakers in the conversation. This range gives you more
-   * flexibility by allowing the system to automatically determine the correct
-   * number of speakers. If not set, the default value is 6.
-   * 
- * - * int32 max_speaker_count = 3; - * - * @return The maxSpeakerCount. - */ - @java.lang.Override - public int getMaxSpeakerCount() { - return maxSpeakerCount_; - } - - public static final int SPEAKER_TAG_FIELD_NUMBER = 5; - private int speakerTag_; - /** - * - * - *
-   * Output only. Unused.
-   * 
- * - * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The speakerTag. - */ - @java.lang.Override - @java.lang.Deprecated - public int getSpeakerTag() { - return speakerTag_; - } - - 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 (enableSpeakerDiarization_ != false) { - output.writeBool(1, enableSpeakerDiarization_); - } - if (minSpeakerCount_ != 0) { - output.writeInt32(2, minSpeakerCount_); - } - if (maxSpeakerCount_ != 0) { - output.writeInt32(3, maxSpeakerCount_); - } - if (speakerTag_ != 0) { - output.writeInt32(5, speakerTag_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (enableSpeakerDiarization_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enableSpeakerDiarization_); - } - if (minSpeakerCount_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, minSpeakerCount_); - } - if (maxSpeakerCount_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, maxSpeakerCount_); - } - if (speakerTag_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, speakerTag_); - } - size += unknownFields.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.SpeakerDiarizationConfig)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig other = - (com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) obj; - - if (getEnableSpeakerDiarization() != other.getEnableSpeakerDiarization()) return false; - if (getMinSpeakerCount() != other.getMinSpeakerCount()) return false; - if (getMaxSpeakerCount() != other.getMaxSpeakerCount()) return false; - if (getSpeakerTag() != other.getSpeakerTag()) return false; - if (!unknownFields.equals(other.unknownFields)) 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) + ENABLE_SPEAKER_DIARIZATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableSpeakerDiarization()); - hash = (37 * hash) + MIN_SPEAKER_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getMinSpeakerCount(); - hash = (37 * hash) + MAX_SPEAKER_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getMaxSpeakerCount(); - hash = (37 * hash) + SPEAKER_TAG_FIELD_NUMBER; - hash = (53 * hash) + getSpeakerTag(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig 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.SpeakerDiarizationConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig 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.SpeakerDiarizationConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig 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.SpeakerDiarizationConfig parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig 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.SpeakerDiarizationConfig parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig 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.SpeakerDiarizationConfig 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.SpeakerDiarizationConfig 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.SpeakerDiarizationConfig 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; - } - /** - * - * - *
-   * Config to enable speaker diarization.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.class, - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - enableSpeakerDiarization_ = false; - - minSpeakerCount_ = 0; - - maxSpeakerCount_ = 0; - - speakerTag_ = 0; - - 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_SpeakerDiarizationConfig_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig build() { - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig buildPartial() { - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig result = - new com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig(this); - result.enableSpeakerDiarization_ = enableSpeakerDiarization_; - result.minSpeakerCount_ = minSpeakerCount_; - result.maxSpeakerCount_ = maxSpeakerCount_; - result.speakerTag_ = speakerTag_; - 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.SpeakerDiarizationConfig) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig other) { - if (other == com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.getDefaultInstance()) - return this; - if (other.getEnableSpeakerDiarization() != false) { - setEnableSpeakerDiarization(other.getEnableSpeakerDiarization()); - } - if (other.getMinSpeakerCount() != 0) { - setMinSpeakerCount(other.getMinSpeakerCount()); - } - if (other.getMaxSpeakerCount() != 0) { - setMaxSpeakerCount(other.getMaxSpeakerCount()); - } - if (other.getSpeakerTag() != 0) { - setSpeakerTag(other.getSpeakerTag()); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean enableSpeakerDiarization_; - /** - * - * - *
-     * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
-     * 
- * - * bool enable_speaker_diarization = 1; - * - * @return The enableSpeakerDiarization. - */ - @java.lang.Override - public boolean getEnableSpeakerDiarization() { - return enableSpeakerDiarization_; - } - /** - * - * - *
-     * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
-     * 
- * - * bool enable_speaker_diarization = 1; - * - * @param value The enableSpeakerDiarization to set. - * @return This builder for chaining. - */ - public Builder setEnableSpeakerDiarization(boolean value) { - - enableSpeakerDiarization_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
-     * 
- * - * bool enable_speaker_diarization = 1; - * - * @return This builder for chaining. - */ - public Builder clearEnableSpeakerDiarization() { - - enableSpeakerDiarization_ = false; - onChanged(); - return this; - } - - private int minSpeakerCount_; - /** - * - * - *
-     * Minimum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 2.
-     * 
- * - * int32 min_speaker_count = 2; - * - * @return The minSpeakerCount. - */ - @java.lang.Override - public int getMinSpeakerCount() { - return minSpeakerCount_; - } - /** - * - * - *
-     * Minimum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 2.
-     * 
- * - * int32 min_speaker_count = 2; - * - * @param value The minSpeakerCount to set. - * @return This builder for chaining. - */ - public Builder setMinSpeakerCount(int value) { - - minSpeakerCount_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Minimum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 2.
-     * 
- * - * int32 min_speaker_count = 2; - * - * @return This builder for chaining. - */ - public Builder clearMinSpeakerCount() { - - minSpeakerCount_ = 0; - onChanged(); - return this; - } - - private int maxSpeakerCount_; - /** - * - * - *
-     * Maximum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 6.
-     * 
- * - * int32 max_speaker_count = 3; - * - * @return The maxSpeakerCount. - */ - @java.lang.Override - public int getMaxSpeakerCount() { - return maxSpeakerCount_; - } - /** - * - * - *
-     * Maximum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 6.
-     * 
- * - * int32 max_speaker_count = 3; - * - * @param value The maxSpeakerCount to set. - * @return This builder for chaining. - */ - public Builder setMaxSpeakerCount(int value) { - - maxSpeakerCount_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Maximum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 6.
-     * 
- * - * int32 max_speaker_count = 3; - * - * @return This builder for chaining. - */ - public Builder clearMaxSpeakerCount() { - - maxSpeakerCount_ = 0; - onChanged(); - return this; - } - - private int speakerTag_; - /** - * - * - *
-     * Output only. Unused.
-     * 
- * - * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The speakerTag. - */ - @java.lang.Override - @java.lang.Deprecated - public int getSpeakerTag() { - return speakerTag_; - } - /** - * - * - *
-     * Output only. Unused.
-     * 
- * - * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @param value The speakerTag to set. - * @return This builder for chaining. - */ - @java.lang.Deprecated - public Builder setSpeakerTag(int value) { - - speakerTag_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Unused.
-     * 
- * - * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return This builder for chaining. - */ - @java.lang.Deprecated - public Builder clearSpeakerTag() { - - speakerTag_ = 0; - 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.SpeakerDiarizationConfig) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) - private static final com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig(); - } - - public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SpeakerDiarizationConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeakerDiarizationConfig(input, extensionRegistry); - } - }; - - 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.SpeakerDiarizationConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfigOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfigOrBuilder.java deleted file mode 100644 index 3a1bf9e62..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfigOrBuilder.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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 SpeakerDiarizationConfigOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * If 'true', enables speaker detection for each recognized word in
-   * the top alternative of the recognition result using a speaker_tag provided
-   * in the WordInfo.
-   * 
- * - * bool enable_speaker_diarization = 1; - * - * @return The enableSpeakerDiarization. - */ - boolean getEnableSpeakerDiarization(); - - /** - * - * - *
-   * Minimum number of speakers in the conversation. This range gives you more
-   * flexibility by allowing the system to automatically determine the correct
-   * number of speakers. If not set, the default value is 2.
-   * 
- * - * int32 min_speaker_count = 2; - * - * @return The minSpeakerCount. - */ - int getMinSpeakerCount(); - - /** - * - * - *
-   * Maximum number of speakers in the conversation. This range gives you more
-   * flexibility by allowing the system to automatically determine the correct
-   * number of speakers. If not set, the default value is 6.
-   * 
- * - * int32 max_speaker_count = 3; - * - * @return The maxSpeakerCount. - */ - int getMaxSpeakerCount(); - - /** - * - * - *
-   * Output only. Unused.
-   * 
- * - * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The speakerTag. - */ - @java.lang.Deprecated - int getSpeakerTag(); -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptation.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptation.java deleted file mode 100644 index fd05b15f0..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptation.java +++ /dev/null @@ -1,1566 +0,0 @@ -/* - * 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/resource.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - * - * - *
- * Speech adaptation configuration.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechAdaptation} - */ -public final class SpeechAdaptation extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.SpeechAdaptation) - SpeechAdaptationOrBuilder { - private static final long serialVersionUID = 0L; - // Use SpeechAdaptation.newBuilder() to construct. - private SpeechAdaptation(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SpeechAdaptation() { - phraseSets_ = java.util.Collections.emptyList(); - customClasses_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SpeechAdaptation(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private SpeechAdaptation( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - phraseSets_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - phraseSets_.add( - input.readMessage( - com.google.cloud.speech.v1p1beta1.PhraseSet.parser(), extensionRegistry)); - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - customClasses_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - customClasses_.add( - input.readMessage( - com.google.cloud.speech.v1p1beta1.CustomClass.parser(), extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - customClasses_ = java.util.Collections.unmodifiableList(customClasses_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.SpeechAdaptation.class, - com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder.class); - } - - public static final int PHRASE_SETS_FIELD_NUMBER = 1; - private java.util.List phraseSets_; - /** - * - * - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public java.util.List getPhraseSetsList() { - return phraseSets_; - } - /** - * - * - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public java.util.List - getPhraseSetsOrBuilderList() { - return phraseSets_; - } - /** - * - * - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public int getPhraseSetsCount() { - return phraseSets_.size(); - } - /** - * - * - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSets(int index) { - return phraseSets_.get(index); - } - /** - * - * - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuilder(int index) { - return phraseSets_.get(index); - } - - public static final int CUSTOM_CLASSES_FIELD_NUMBER = 2; - private java.util.List customClasses_; - /** - * - * - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - @java.lang.Override - public java.util.List getCustomClassesList() { - return customClasses_; - } - /** - * - * - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - @java.lang.Override - public java.util.List - getCustomClassesOrBuilderList() { - return customClasses_; - } - /** - * - * - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - @java.lang.Override - public int getCustomClassesCount() { - return customClasses_.size(); - } - /** - * - * - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index) { - return customClasses_.get(index); - } - /** - * - * - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder( - int index) { - return customClasses_.get(index); - } - - 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 { - for (int i = 0; i < phraseSets_.size(); i++) { - output.writeMessage(1, phraseSets_.get(i)); - } - for (int i = 0; i < customClasses_.size(); i++) { - output.writeMessage(2, customClasses_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < phraseSets_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, phraseSets_.get(i)); - } - for (int i = 0; i < customClasses_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, customClasses_.get(i)); - } - size += unknownFields.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.SpeechAdaptation)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.SpeechAdaptation other = - (com.google.cloud.speech.v1p1beta1.SpeechAdaptation) obj; - - if (!getPhraseSetsList().equals(other.getPhraseSetsList())) return false; - if (!getCustomClassesList().equals(other.getCustomClassesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getPhraseSetsCount() > 0) { - hash = (37 * hash) + PHRASE_SETS_FIELD_NUMBER; - hash = (53 * hash) + getPhraseSetsList().hashCode(); - } - if (getCustomClassesCount() > 0) { - hash = (37 * hash) + CUSTOM_CLASSES_FIELD_NUMBER; - hash = (53 * hash) + getCustomClassesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation 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.SpeechAdaptation parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation 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.SpeechAdaptation parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation 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.SpeechAdaptation parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation 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.SpeechAdaptation parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation 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.SpeechAdaptation 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.SpeechAdaptation 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.SpeechAdaptation 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; - } - /** - * - * - *
-   * Speech adaptation configuration.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechAdaptation} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.SpeechAdaptation) - com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.SpeechAdaptation.class, - com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.SpeechAdaptation.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getPhraseSetsFieldBuilder(); - getCustomClassesFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (phraseSetsBuilder_ == null) { - phraseSets_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - phraseSetsBuilder_.clear(); - } - if (customClassesBuilder_ == null) { - customClasses_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - customClassesBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto - .internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechAdaptation getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptation.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechAdaptation build() { - com.google.cloud.speech.v1p1beta1.SpeechAdaptation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechAdaptation buildPartial() { - com.google.cloud.speech.v1p1beta1.SpeechAdaptation result = - new com.google.cloud.speech.v1p1beta1.SpeechAdaptation(this); - int from_bitField0_ = bitField0_; - if (phraseSetsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.phraseSets_ = phraseSets_; - } else { - result.phraseSets_ = phraseSetsBuilder_.build(); - } - if (customClassesBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - customClasses_ = java.util.Collections.unmodifiableList(customClasses_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.customClasses_ = customClasses_; - } else { - result.customClasses_ = customClassesBuilder_.build(); - } - 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.SpeechAdaptation) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.SpeechAdaptation) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.SpeechAdaptation other) { - if (other == com.google.cloud.speech.v1p1beta1.SpeechAdaptation.getDefaultInstance()) - return this; - if (phraseSetsBuilder_ == null) { - if (!other.phraseSets_.isEmpty()) { - if (phraseSets_.isEmpty()) { - phraseSets_ = other.phraseSets_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePhraseSetsIsMutable(); - phraseSets_.addAll(other.phraseSets_); - } - onChanged(); - } - } else { - if (!other.phraseSets_.isEmpty()) { - if (phraseSetsBuilder_.isEmpty()) { - phraseSetsBuilder_.dispose(); - phraseSetsBuilder_ = null; - phraseSets_ = other.phraseSets_; - bitField0_ = (bitField0_ & ~0x00000001); - phraseSetsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getPhraseSetsFieldBuilder() - : null; - } else { - phraseSetsBuilder_.addAllMessages(other.phraseSets_); - } - } - } - if (customClassesBuilder_ == null) { - if (!other.customClasses_.isEmpty()) { - if (customClasses_.isEmpty()) { - customClasses_ = other.customClasses_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureCustomClassesIsMutable(); - customClasses_.addAll(other.customClasses_); - } - onChanged(); - } - } else { - if (!other.customClasses_.isEmpty()) { - if (customClassesBuilder_.isEmpty()) { - customClassesBuilder_.dispose(); - customClassesBuilder_ = null; - customClasses_ = other.customClasses_; - bitField0_ = (bitField0_ & ~0x00000002); - customClassesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getCustomClassesFieldBuilder() - : null; - } else { - customClassesBuilder_.addAllMessages(other.customClasses_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.SpeechAdaptation parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1p1beta1.SpeechAdaptation) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List phraseSets_ = - java.util.Collections.emptyList(); - - private void ensurePhraseSetsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - phraseSets_ = - new java.util.ArrayList(phraseSets_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet, - com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, - com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> - phraseSetsBuilder_; - - /** - * - * - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public java.util.List getPhraseSetsList() { - if (phraseSetsBuilder_ == null) { - return java.util.Collections.unmodifiableList(phraseSets_); - } else { - return phraseSetsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public int getPhraseSetsCount() { - if (phraseSetsBuilder_ == null) { - return phraseSets_.size(); - } else { - return phraseSetsBuilder_.getCount(); - } - } - /** - * - * - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSets(int index) { - if (phraseSetsBuilder_ == null) { - return phraseSets_.get(index); - } else { - return phraseSetsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder setPhraseSets(int index, com.google.cloud.speech.v1p1beta1.PhraseSet value) { - if (phraseSetsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhraseSetsIsMutable(); - phraseSets_.set(index, value); - onChanged(); - } else { - phraseSetsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder setPhraseSets( - int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - phraseSets_.set(index, builderForValue.build()); - onChanged(); - } else { - phraseSetsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder addPhraseSets(com.google.cloud.speech.v1p1beta1.PhraseSet value) { - if (phraseSetsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhraseSetsIsMutable(); - phraseSets_.add(value); - onChanged(); - } else { - phraseSetsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder addPhraseSets(int index, com.google.cloud.speech.v1p1beta1.PhraseSet value) { - if (phraseSetsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhraseSetsIsMutable(); - phraseSets_.add(index, value); - onChanged(); - } else { - phraseSetsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder addPhraseSets( - com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - phraseSets_.add(builderForValue.build()); - onChanged(); - } else { - phraseSetsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder addPhraseSets( - int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - phraseSets_.add(index, builderForValue.build()); - onChanged(); - } else { - phraseSetsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder addAllPhraseSets( - java.lang.Iterable values) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, phraseSets_); - onChanged(); - } else { - phraseSetsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder clearPhraseSets() { - if (phraseSetsBuilder_ == null) { - phraseSets_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - phraseSetsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder removePhraseSets(int index) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - phraseSets_.remove(index); - onChanged(); - } else { - phraseSetsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder getPhraseSetsBuilder(int index) { - return getPhraseSetsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuilder(int index) { - if (phraseSetsBuilder_ == null) { - return phraseSets_.get(index); - } else { - return phraseSetsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public java.util.List - getPhraseSetsOrBuilderList() { - if (phraseSetsBuilder_ != null) { - return phraseSetsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(phraseSets_); - } - } - /** - * - * - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder addPhraseSetsBuilder() { - return getPhraseSetsFieldBuilder() - .addBuilder(com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance()); - } - /** - * - * - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder addPhraseSetsBuilder(int index) { - return getPhraseSetsFieldBuilder() - .addBuilder(index, com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance()); - } - /** - * - * - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public java.util.List - getPhraseSetsBuilderList() { - return getPhraseSetsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet, - com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, - com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> - getPhraseSetsFieldBuilder() { - if (phraseSetsBuilder_ == null) { - phraseSetsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet, - com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, - com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder>( - phraseSets_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - phraseSets_ = null; - } - return phraseSetsBuilder_; - } - - private java.util.List customClasses_ = - java.util.Collections.emptyList(); - - private void ensureCustomClassesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - customClasses_ = - new java.util.ArrayList(customClasses_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass, - com.google.cloud.speech.v1p1beta1.CustomClass.Builder, - com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> - customClassesBuilder_; - - /** - * - * - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - public java.util.List getCustomClassesList() { - if (customClassesBuilder_ == null) { - return java.util.Collections.unmodifiableList(customClasses_); - } else { - return customClassesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - public int getCustomClassesCount() { - if (customClassesBuilder_ == null) { - return customClasses_.size(); - } else { - return customClassesBuilder_.getCount(); - } - } - /** - * - * - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index) { - if (customClassesBuilder_ == null) { - return customClasses_.get(index); - } else { - return customClassesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - public Builder setCustomClasses( - int index, com.google.cloud.speech.v1p1beta1.CustomClass value) { - if (customClassesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCustomClassesIsMutable(); - customClasses_.set(index, value); - onChanged(); - } else { - customClassesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - public Builder setCustomClasses( - int index, com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - customClasses_.set(index, builderForValue.build()); - onChanged(); - } else { - customClassesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - public Builder addCustomClasses(com.google.cloud.speech.v1p1beta1.CustomClass value) { - if (customClassesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCustomClassesIsMutable(); - customClasses_.add(value); - onChanged(); - } else { - customClassesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - public Builder addCustomClasses( - int index, com.google.cloud.speech.v1p1beta1.CustomClass value) { - if (customClassesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCustomClassesIsMutable(); - customClasses_.add(index, value); - onChanged(); - } else { - customClassesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - public Builder addCustomClasses( - com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - customClasses_.add(builderForValue.build()); - onChanged(); - } else { - customClassesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - public Builder addCustomClasses( - int index, com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - customClasses_.add(index, builderForValue.build()); - onChanged(); - } else { - customClassesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - public Builder addAllCustomClasses( - java.lang.Iterable values) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, customClasses_); - onChanged(); - } else { - customClassesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - public Builder clearCustomClasses() { - if (customClassesBuilder_ == null) { - customClasses_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - customClassesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - public Builder removeCustomClasses(int index) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - customClasses_.remove(index); - onChanged(); - } else { - customClassesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.Builder getCustomClassesBuilder( - int index) { - return getCustomClassesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder( - int index) { - if (customClassesBuilder_ == null) { - return customClasses_.get(index); - } else { - return customClassesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - public java.util.List - getCustomClassesOrBuilderList() { - if (customClassesBuilder_ != null) { - return customClassesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(customClasses_); - } - } - /** - * - * - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.Builder addCustomClassesBuilder() { - return getCustomClassesFieldBuilder() - .addBuilder(com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance()); - } - /** - * - * - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.Builder addCustomClassesBuilder( - int index) { - return getCustomClassesFieldBuilder() - .addBuilder(index, com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance()); - } - /** - * - * - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - public java.util.List - getCustomClassesBuilderList() { - return getCustomClassesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass, - com.google.cloud.speech.v1p1beta1.CustomClass.Builder, - com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> - getCustomClassesFieldBuilder() { - if (customClassesBuilder_ == null) { - customClassesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass, - com.google.cloud.speech.v1p1beta1.CustomClass.Builder, - com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder>( - customClasses_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - customClasses_ = null; - } - return customClassesBuilder_; - } - - @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.SpeechAdaptation) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.SpeechAdaptation) - private static final com.google.cloud.speech.v1p1beta1.SpeechAdaptation DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.SpeechAdaptation(); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SpeechAdaptation parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeechAdaptation(input, extensionRegistry); - } - }; - - 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.SpeechAdaptation getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationOrBuilder.java deleted file mode 100644 index 1549bd430..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationOrBuilder.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * 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/resource.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface SpeechAdaptationOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.SpeechAdaptation) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - java.util.List getPhraseSetsList(); - /** - * - * - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSets(int index); - /** - * - * - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - int getPhraseSetsCount(); - /** - * - * - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - java.util.List - getPhraseSetsOrBuilderList(); - /** - * - * - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuilder(int index); - - /** - * - * - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - java.util.List getCustomClassesList(); - /** - * - * - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index); - /** - * - * - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - int getCustomClassesCount(); - /** - * - * - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - java.util.List - getCustomClassesOrBuilderList(); - /** - * - * - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; - */ - com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder(int index); -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContext.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContext.java deleted file mode 100644 index c420a3366..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContext.java +++ /dev/null @@ -1,987 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * Provides "hints" to the speech recognizer to favor specific words and phrases
- * in the results.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechContext} - */ -public final class SpeechContext extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.SpeechContext) - SpeechContextOrBuilder { - private static final long serialVersionUID = 0L; - // Use SpeechContext.newBuilder() to construct. - private SpeechContext(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SpeechContext() { - phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SpeechContext(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private SpeechContext( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - phrases_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - phrases_.add(s); - break; - } - case 37: - { - boost_ = input.readFloat(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - phrases_ = phrases_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_SpeechContext_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_SpeechContext_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.SpeechContext.class, - com.google.cloud.speech.v1p1beta1.SpeechContext.Builder.class); - } - - public static final int PHRASES_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList phrases_; - /** - * - * - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * - * @return A list containing the phrases. - */ - public com.google.protobuf.ProtocolStringList getPhrasesList() { - return phrases_; - } - /** - * - * - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * - * @return The count of phrases. - */ - public int getPhrasesCount() { - return phrases_.size(); - } - /** - * - * - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * - * @param index The index of the element to return. - * @return The phrases at the given index. - */ - public java.lang.String getPhrases(int index) { - return phrases_.get(index); - } - /** - * - * - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * - * @param index The index of the value to return. - * @return The bytes of the phrases at the given index. - */ - public com.google.protobuf.ByteString getPhrasesBytes(int index) { - return phrases_.getByteString(index); - } - - public static final int BOOST_FIELD_NUMBER = 4; - private float boost_; - /** - * - * - *
-   * Hint Boost. Positive value will increase the probability that a specific
-   * phrase will be recognized over other similar sounding phrases. The higher
-   * the boost, the higher the chance of false positive recognition as well.
-   * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-   * enabled, so negative boost will simply be ignored. Though `boost` can
-   * accept a wide range of positive values, most use cases are best served with
-   * values between 0 and 20. We recommend using a binary search approach to
-   * finding the optimal value for your use case.
-   * 
- * - * float boost = 4; - * - * @return The boost. - */ - @java.lang.Override - public float getBoost() { - return boost_; - } - - 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 { - for (int i = 0; i < phrases_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, phrases_.getRaw(i)); - } - if (boost_ != 0F) { - output.writeFloat(4, boost_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < phrases_.size(); i++) { - dataSize += computeStringSizeNoTag(phrases_.getRaw(i)); - } - size += dataSize; - size += 1 * getPhrasesList().size(); - } - if (boost_ != 0F) { - size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, boost_); - } - size += unknownFields.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.SpeechContext)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.SpeechContext other = - (com.google.cloud.speech.v1p1beta1.SpeechContext) obj; - - if (!getPhrasesList().equals(other.getPhrasesList())) return false; - if (java.lang.Float.floatToIntBits(getBoost()) - != java.lang.Float.floatToIntBits(other.getBoost())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getPhrasesCount() > 0) { - hash = (37 * hash) + PHRASES_FIELD_NUMBER; - hash = (53 * hash) + getPhrasesList().hashCode(); - } - hash = (37 * hash) + BOOST_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits(getBoost()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechContext 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.SpeechContext parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechContext 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.SpeechContext parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechContext 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.SpeechContext parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechContext 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.SpeechContext parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechContext 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.SpeechContext 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.SpeechContext 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.SpeechContext 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; - } - /** - * - * - *
-   * Provides "hints" to the speech recognizer to favor specific words and phrases
-   * in the results.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechContext} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.SpeechContext) - com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_SpeechContext_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_SpeechContext_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.SpeechContext.class, - com.google.cloud.speech.v1p1beta1.SpeechContext.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.SpeechContext.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - boost_ = 0F; - - 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_SpeechContext_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechContext getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.SpeechContext.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechContext build() { - com.google.cloud.speech.v1p1beta1.SpeechContext result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechContext buildPartial() { - com.google.cloud.speech.v1p1beta1.SpeechContext result = - new com.google.cloud.speech.v1p1beta1.SpeechContext(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - phrases_ = phrases_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.phrases_ = phrases_; - result.boost_ = boost_; - 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.SpeechContext) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.SpeechContext) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.SpeechContext other) { - if (other == com.google.cloud.speech.v1p1beta1.SpeechContext.getDefaultInstance()) - return this; - if (!other.phrases_.isEmpty()) { - if (phrases_.isEmpty()) { - phrases_ = other.phrases_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePhrasesIsMutable(); - phrases_.addAll(other.phrases_); - } - onChanged(); - } - if (other.getBoost() != 0F) { - setBoost(other.getBoost()); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.SpeechContext parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.SpeechContext) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private com.google.protobuf.LazyStringList phrases_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensurePhrasesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - phrases_ = new com.google.protobuf.LazyStringArrayList(phrases_); - bitField0_ |= 0x00000001; - } - } - /** - * - * - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * - * @return A list containing the phrases. - */ - public com.google.protobuf.ProtocolStringList getPhrasesList() { - return phrases_.getUnmodifiableView(); - } - /** - * - * - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * - * @return The count of phrases. - */ - public int getPhrasesCount() { - return phrases_.size(); - } - /** - * - * - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * - * @param index The index of the element to return. - * @return The phrases at the given index. - */ - public java.lang.String getPhrases(int index) { - return phrases_.get(index); - } - /** - * - * - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * - * @param index The index of the value to return. - * @return The bytes of the phrases at the given index. - */ - public com.google.protobuf.ByteString getPhrasesBytes(int index) { - return phrases_.getByteString(index); - } - /** - * - * - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * - * @param index The index to set the value at. - * @param value The phrases to set. - * @return This builder for chaining. - */ - public Builder setPhrases(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhrasesIsMutable(); - phrases_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * - * @param value The phrases to add. - * @return This builder for chaining. - */ - public Builder addPhrases(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhrasesIsMutable(); - phrases_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * - * @param values The phrases to add. - * @return This builder for chaining. - */ - public Builder addAllPhrases(java.lang.Iterable values) { - ensurePhrasesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, phrases_); - onChanged(); - return this; - } - /** - * - * - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * - * @return This builder for chaining. - */ - public Builder clearPhrases() { - phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * - * @param value The bytes of the phrases to add. - * @return This builder for chaining. - */ - public Builder addPhrasesBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensurePhrasesIsMutable(); - phrases_.add(value); - onChanged(); - return this; - } - - private float boost_; - /** - * - * - *
-     * Hint Boost. Positive value will increase the probability that a specific
-     * phrase will be recognized over other similar sounding phrases. The higher
-     * the boost, the higher the chance of false positive recognition as well.
-     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-     * enabled, so negative boost will simply be ignored. Though `boost` can
-     * accept a wide range of positive values, most use cases are best served with
-     * values between 0 and 20. We recommend using a binary search approach to
-     * finding the optimal value for your use case.
-     * 
- * - * float boost = 4; - * - * @return The boost. - */ - @java.lang.Override - public float getBoost() { - return boost_; - } - /** - * - * - *
-     * Hint Boost. Positive value will increase the probability that a specific
-     * phrase will be recognized over other similar sounding phrases. The higher
-     * the boost, the higher the chance of false positive recognition as well.
-     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-     * enabled, so negative boost will simply be ignored. Though `boost` can
-     * accept a wide range of positive values, most use cases are best served with
-     * values between 0 and 20. We recommend using a binary search approach to
-     * finding the optimal value for your use case.
-     * 
- * - * float boost = 4; - * - * @param value The boost to set. - * @return This builder for chaining. - */ - public Builder setBoost(float value) { - - boost_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Hint Boost. Positive value will increase the probability that a specific
-     * phrase will be recognized over other similar sounding phrases. The higher
-     * the boost, the higher the chance of false positive recognition as well.
-     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-     * enabled, so negative boost will simply be ignored. Though `boost` can
-     * accept a wide range of positive values, most use cases are best served with
-     * values between 0 and 20. We recommend using a binary search approach to
-     * finding the optimal value for your use case.
-     * 
- * - * float boost = 4; - * - * @return This builder for chaining. - */ - public Builder clearBoost() { - - boost_ = 0F; - 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.SpeechContext) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.SpeechContext) - private static final com.google.cloud.speech.v1p1beta1.SpeechContext DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.SpeechContext(); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechContext getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SpeechContext parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeechContext(input, extensionRegistry); - } - }; - - 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.SpeechContext getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContextOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContextOrBuilder.java deleted file mode 100644 index 9c1e1ba58..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContextOrBuilder.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * 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 SpeechContextOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.SpeechContext) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * - * @return A list containing the phrases. - */ - java.util.List getPhrasesList(); - /** - * - * - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * - * @return The count of phrases. - */ - int getPhrasesCount(); - /** - * - * - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * - * @param index The index of the element to return. - * @return The phrases at the given index. - */ - java.lang.String getPhrases(int index); - /** - * - * - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * - * @param index The index of the value to return. - * @return The bytes of the phrases at the given index. - */ - com.google.protobuf.ByteString getPhrasesBytes(int index); - - /** - * - * - *
-   * Hint Boost. Positive value will increase the probability that a specific
-   * phrase will be recognized over other similar sounding phrases. The higher
-   * the boost, the higher the chance of false positive recognition as well.
-   * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-   * enabled, so negative boost will simply be ignored. Though `boost` can
-   * accept a wide range of positive values, most use cases are best served with
-   * values between 0 and 20. We recommend using a binary search approach to
-   * finding the optimal value for your use case.
-   * 
- * - * float boost = 4; - * - * @return The boost. - */ - float getBoost(); -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java deleted file mode 100644 index bcc62d545..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java +++ /dev/null @@ -1,449 +0,0 @@ -/* - * 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 final class SpeechProto { - private SpeechProto() {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_SpeechContext_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_SpeechContext_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_WordInfo_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_WordInfo_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - - static { - java.lang.String[] descriptorData = { - "\n0google/cloud/speech/v1p1beta1/cloud_sp" - + "eech.proto\022\035google.cloud.speech.v1p1beta" - + "1\032\034google/api/annotations.proto\032\027google/" - + "api/client.proto\032\037google/api/field_behav" - + "ior.proto\032\031google/api/resource.proto\032,go" - + "ogle/cloud/speech/v1p1beta1/resource.pro" - + "to\032#google/longrunning/operations.proto\032" - + "\031google/protobuf/any.proto\032\036google/proto" - + "buf/duration.proto\032\037google/protobuf/time" - + "stamp.proto\032\027google/rpc/status.proto\"\236\001\n" - + "\020RecognizeRequest\022E\n\006config\030\001 \001(\01320.goog" - + "le.cloud.speech.v1p1beta1.RecognitionCon" - + "figB\003\340A\002\022C\n\005audio\030\002 \001(\0132/.google.cloud.s" - + "peech.v1p1beta1.RecognitionAudioB\003\340A\002\"\251\001" - + "\n\033LongRunningRecognizeRequest\022E\n\006config\030" - + "\001 \001(\01320.google.cloud.speech.v1p1beta1.Re" - + "cognitionConfigB\003\340A\002\022C\n\005audio\030\002 \001(\0132/.go" - + "ogle.cloud.speech.v1p1beta1.RecognitionA" - + "udioB\003\340A\002\"\240\001\n\031StreamingRecognizeRequest\022" - + "U\n\020streaming_config\030\001 \001(\01329.google.cloud" - + ".speech.v1p1beta1.StreamingRecognitionCo" - + "nfigH\000\022\027\n\raudio_content\030\002 \001(\014H\000B\023\n\021strea" - + "ming_request\"\226\001\n\032StreamingRecognitionCon" - + "fig\022E\n\006config\030\001 \001(\01320.google.cloud.speec" - + "h.v1p1beta1.RecognitionConfigB\003\340A\002\022\030\n\020si" - + "ngle_utterance\030\002 \001(\010\022\027\n\017interim_results\030" - + "\003 \001(\010\"\334\007\n\021RecognitionConfig\022P\n\010encoding\030" - + "\001 \001(\0162>.google.cloud.speech.v1p1beta1.Re" - + "cognitionConfig.AudioEncoding\022\031\n\021sample_" - + "rate_hertz\030\002 \001(\005\022\033\n\023audio_channel_count\030" - + "\007 \001(\005\022/\n\'enable_separate_recognition_per" - + "_channel\030\014 \001(\010\022\032\n\rlanguage_code\030\003 \001(\tB\003\340" - + "A\002\022\"\n\032alternative_language_codes\030\022 \003(\t\022\030" - + "\n\020max_alternatives\030\004 \001(\005\022\030\n\020profanity_fi" - + "lter\030\005 \001(\010\022C\n\nadaptation\030\024 \001(\0132/.google." - + "cloud.speech.v1p1beta1.SpeechAdaptation\022" - + "E\n\017speech_contexts\030\006 \003(\0132,.google.cloud." - + "speech.v1p1beta1.SpeechContext\022 \n\030enable" - + "_word_time_offsets\030\010 \001(\010\022\036\n\026enable_word_" - + "confidence\030\017 \001(\010\022$\n\034enable_automatic_pun" - + "ctuation\030\013 \001(\010\022&\n\032enable_speaker_diariza" - + "tion\030\020 \001(\010B\002\030\001\022%\n\031diarization_speaker_co" - + "unt\030\021 \001(\005B\002\030\001\022S\n\022diarization_config\030\023 \001(" - + "\01327.google.cloud.speech.v1p1beta1.Speake" - + "rDiarizationConfig\022D\n\010metadata\030\t \001(\01322.g" - + "oogle.cloud.speech.v1p1beta1.Recognition" - + "Metadata\022\r\n\005model\030\r \001(\t\022\024\n\014use_enhanced\030" - + "\016 \001(\010\"\224\001\n\rAudioEncoding\022\030\n\024ENCODING_UNSP" - + "ECIFIED\020\000\022\014\n\010LINEAR16\020\001\022\010\n\004FLAC\020\002\022\t\n\005MUL" - + "AW\020\003\022\007\n\003AMR\020\004\022\n\n\006AMR_WB\020\005\022\014\n\010OGG_OPUS\020\006\022" - + "\032\n\026SPEEX_WITH_HEADER_BYTE\020\007\022\007\n\003MP3\020\010\"\220\001\n" - + "\030SpeakerDiarizationConfig\022\"\n\032enable_spea" - + "ker_diarization\030\001 \001(\010\022\031\n\021min_speaker_cou" - + "nt\030\002 \001(\005\022\031\n\021max_speaker_count\030\003 \001(\005\022\032\n\013s" - + "peaker_tag\030\005 \001(\005B\005\030\001\340A\003\"\327\010\n\023RecognitionM" - + "etadata\022\\\n\020interaction_type\030\001 \001(\0162B.goog" - + "le.cloud.speech.v1p1beta1.RecognitionMet" - + "adata.InteractionType\022$\n\034industry_naics_" - + "code_of_audio\030\003 \001(\r\022b\n\023microphone_distan" - + "ce\030\004 \001(\0162E.google.cloud.speech.v1p1beta1" - + ".RecognitionMetadata.MicrophoneDistance\022" - + "a\n\023original_media_type\030\005 \001(\0162D.google.cl" - + "oud.speech.v1p1beta1.RecognitionMetadata" - + ".OriginalMediaType\022e\n\025recording_device_t" - + "ype\030\006 \001(\0162F.google.cloud.speech.v1p1beta" - + "1.RecognitionMetadata.RecordingDeviceTyp" - + "e\022\035\n\025recording_device_name\030\007 \001(\t\022\032\n\022orig" - + "inal_mime_type\030\010 \001(\t\022\031\n\robfuscated_id\030\t " - + "\001(\003B\002\030\001\022\023\n\013audio_topic\030\n \001(\t\"\305\001\n\017Interac" - + "tionType\022 \n\034INTERACTION_TYPE_UNSPECIFIED" - + "\020\000\022\016\n\nDISCUSSION\020\001\022\020\n\014PRESENTATION\020\002\022\016\n\n" - + "PHONE_CALL\020\003\022\r\n\tVOICEMAIL\020\004\022\033\n\027PROFESSIO" - + "NALLY_PRODUCED\020\005\022\020\n\014VOICE_SEARCH\020\006\022\021\n\rVO" - + "ICE_COMMAND\020\007\022\r\n\tDICTATION\020\010\"d\n\022Micropho" - + "neDistance\022#\n\037MICROPHONE_DISTANCE_UNSPEC" - + "IFIED\020\000\022\r\n\tNEARFIELD\020\001\022\014\n\010MIDFIELD\020\002\022\014\n\010" - + "FARFIELD\020\003\"N\n\021OriginalMediaType\022#\n\037ORIGI" - + "NAL_MEDIA_TYPE_UNSPECIFIED\020\000\022\t\n\005AUDIO\020\001\022" - + "\t\n\005VIDEO\020\002\"\244\001\n\023RecordingDeviceType\022%\n!RE" - + "CORDING_DEVICE_TYPE_UNSPECIFIED\020\000\022\016\n\nSMA" - + "RTPHONE\020\001\022\006\n\002PC\020\002\022\016\n\nPHONE_LINE\020\003\022\013\n\007VEH" - + "ICLE\020\004\022\030\n\024OTHER_OUTDOOR_DEVICE\020\005\022\027\n\023OTHE" - + "R_INDOOR_DEVICE\020\006\"/\n\rSpeechContext\022\017\n\007ph" - + "rases\030\001 \003(\t\022\r\n\005boost\030\004 \001(\002\"D\n\020Recognitio" - + "nAudio\022\021\n\007content\030\001 \001(\014H\000\022\r\n\003uri\030\002 \001(\tH\000" - + "B\016\n\014audio_source\"\\\n\021RecognizeResponse\022G\n" - + "\007results\030\002 \003(\01326.google.cloud.speech.v1p" - + "1beta1.SpeechRecognitionResult\"g\n\034LongRu" - + "nningRecognizeResponse\022G\n\007results\030\002 \003(\0132" - + "6.google.cloud.speech.v1p1beta1.SpeechRe" - + "cognitionResult\"\260\001\n\034LongRunningRecognize" - + "Metadata\022\030\n\020progress_percent\030\001 \001(\005\022.\n\nst" - + "art_time\030\002 \001(\0132\032.google.protobuf.Timesta" - + "mp\0224\n\020last_update_time\030\003 \001(\0132\032.google.pr" - + "otobuf.Timestamp\022\020\n\003uri\030\004 \001(\tB\003\340A\003\"\277\002\n\032S" - + "treamingRecognizeResponse\022!\n\005error\030\001 \001(\013" - + "2\022.google.rpc.Status\022J\n\007results\030\002 \003(\01329." - + "google.cloud.speech.v1p1beta1.StreamingR" - + "ecognitionResult\022d\n\021speech_event_type\030\004 " - + "\001(\0162I.google.cloud.speech.v1p1beta1.Stre" - + "amingRecognizeResponse.SpeechEventType\"L" - + "\n\017SpeechEventType\022\034\n\030SPEECH_EVENT_UNSPEC" - + "IFIED\020\000\022\033\n\027END_OF_SINGLE_UTTERANCE\020\001\"\371\001\n" - + "\032StreamingRecognitionResult\022Q\n\014alternati" - + "ves\030\001 \003(\0132;.google.cloud.speech.v1p1beta" - + "1.SpeechRecognitionAlternative\022\020\n\010is_fin" - + "al\030\002 \001(\010\022\021\n\tstability\030\003 \001(\002\0222\n\017result_en" - + "d_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\"\235\001\n\027SpeechRecognitionResult\022Q\n\014" - + "alternatives\030\001 \003(\0132;.google.cloud.speech" - + ".v1p1beta1.SpeechRecognitionAlternative\022" - + "\023\n\013channel_tag\030\002 \001(\005\022\032\n\rlanguage_code\030\005 " - + "\001(\tB\003\340A\003\"~\n\034SpeechRecognitionAlternative" - + "\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.speech.v1" - + "p1beta1.WordInfo\"\242\001\n\010WordInfo\022-\n\nstart_t" - + "ime\030\001 \001(\0132\031.google.protobuf.Duration\022+\n\010" - + "end_time\030\002 \001(\0132\031.google.protobuf.Duratio" - + "n\022\014\n\004word\030\003 \001(\t\022\022\n\nconfidence\030\004 \001(\002\022\030\n\013s" - + "peaker_tag\030\005 \001(\005B\003\340A\0032\202\005\n\006Speech\022\245\001\n\tRec" - + "ognize\022/.google.cloud.speech.v1p1beta1.R" - + "ecognizeRequest\0320.google.cloud.speech.v1" - + "p1beta1.RecognizeResponse\"5\202\323\344\223\002 \"\033/v1p1" - + "beta1/speech:recognize:\001*\332A\014config,audio" - + "\022\362\001\n\024LongRunningRecognize\022:.google.cloud" - + ".speech.v1p1beta1.LongRunningRecognizeRe" - + "quest\032\035.google.longrunning.Operation\"\177\202\323" - + "\344\223\002+\"&/v1p1beta1/speech:longrunningrecog" - + "nize:\001*\332A\014config,audio\312A<\n\034LongRunningRe" - + "cognizeResponse\022\034LongRunningRecognizeMet" - + "adata\022\217\001\n\022StreamingRecognize\0228.google.cl" - + "oud.speech.v1p1beta1.StreamingRecognizeR" - + "equest\0329.google.cloud.speech.v1p1beta1.S" - + "treamingRecognizeResponse\"\000(\0010\001\032I\312A\025spee" - + "ch.googleapis.com\322A.https://www.googleap" - + "is.com/auth/cloud-platformB\200\001\n!com.googl" - + "e.cloud.speech.v1p1beta1B\013SpeechProtoP\001Z" - + "Cgoogle.golang.org/genproto/googleapis/c" - + "loud/speech/v1p1beta1;speech\370\001\001\242\002\003GCSb\006p" - + "roto3" - }; - descriptor = - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - com.google.api.ClientProto.getDescriptor(), - com.google.api.FieldBehaviorProto.getDescriptor(), - com.google.api.ResourceProto.getDescriptor(), - com.google.cloud.speech.v1p1beta1.SpeechResourceProto.getDescriptor(), - com.google.longrunning.OperationsProto.getDescriptor(), - com.google.protobuf.AnyProto.getDescriptor(), - com.google.protobuf.DurationProto.getDescriptor(), - com.google.protobuf.TimestampProto.getDescriptor(), - com.google.rpc.StatusProto.getDescriptor(), - }); - internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_descriptor, - new java.lang.String[] { - "Config", "Audio", - }); - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_descriptor, - new java.lang.String[] { - "Config", "Audio", - }); - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_descriptor, - new java.lang.String[] { - "StreamingConfig", "AudioContent", "StreamingRequest", - }); - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_descriptor, - new java.lang.String[] { - "Config", "SingleUtterance", "InterimResults", - }); - internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_descriptor, - new java.lang.String[] { - "Encoding", - "SampleRateHertz", - "AudioChannelCount", - "EnableSeparateRecognitionPerChannel", - "LanguageCode", - "AlternativeLanguageCodes", - "MaxAlternatives", - "ProfanityFilter", - "Adaptation", - "SpeechContexts", - "EnableWordTimeOffsets", - "EnableWordConfidence", - "EnableAutomaticPunctuation", - "EnableSpeakerDiarization", - "DiarizationSpeakerCount", - "DiarizationConfig", - "Metadata", - "Model", - "UseEnhanced", - }); - internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_descriptor, - new java.lang.String[] { - "EnableSpeakerDiarization", "MinSpeakerCount", "MaxSpeakerCount", "SpeakerTag", - }); - internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_descriptor, - new java.lang.String[] { - "InteractionType", - "IndustryNaicsCodeOfAudio", - "MicrophoneDistance", - "OriginalMediaType", - "RecordingDeviceType", - "RecordingDeviceName", - "OriginalMimeType", - "ObfuscatedId", - "AudioTopic", - }); - internal_static_google_cloud_speech_v1p1beta1_SpeechContext_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_google_cloud_speech_v1p1beta1_SpeechContext_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_SpeechContext_descriptor, - new java.lang.String[] { - "Phrases", "Boost", - }); - internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_descriptor, - new java.lang.String[] { - "Content", "Uri", "AudioSource", - }); - internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_descriptor, - new java.lang.String[] { - "Results", - }); - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_descriptor = - getDescriptor().getMessageTypes().get(10); - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_descriptor, - new java.lang.String[] { - "Results", - }); - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_descriptor = - getDescriptor().getMessageTypes().get(11); - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_descriptor, - new java.lang.String[] { - "ProgressPercent", "StartTime", "LastUpdateTime", "Uri", - }); - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_descriptor = - getDescriptor().getMessageTypes().get(12); - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_descriptor, - new java.lang.String[] { - "Error", "Results", "SpeechEventType", - }); - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_descriptor = - getDescriptor().getMessageTypes().get(13); - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_descriptor, - new java.lang.String[] { - "Alternatives", "IsFinal", "Stability", "ResultEndTime", "ChannelTag", "LanguageCode", - }); - internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_descriptor = - getDescriptor().getMessageTypes().get(14); - internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_descriptor, - new java.lang.String[] { - "Alternatives", "ChannelTag", "LanguageCode", - }); - internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_descriptor = - getDescriptor().getMessageTypes().get(15); - internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_descriptor, - new java.lang.String[] { - "Transcript", "Confidence", "Words", - }); - internal_static_google_cloud_speech_v1p1beta1_WordInfo_descriptor = - getDescriptor().getMessageTypes().get(16); - internal_static_google_cloud_speech_v1p1beta1_WordInfo_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_WordInfo_descriptor, - new java.lang.String[] { - "StartTime", "EndTime", "Word", "Confidence", "SpeakerTag", - }); - com.google.protobuf.ExtensionRegistry registry = - com.google.protobuf.ExtensionRegistry.newInstance(); - registry.add(com.google.api.ClientProto.defaultHost); - registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); - registry.add(com.google.api.AnnotationsProto.http); - registry.add(com.google.api.ClientProto.methodSignature); - registry.add(com.google.api.ClientProto.oauthScopes); - registry.add(com.google.longrunning.OperationsProto.operationInfo); - com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( - descriptor, registry); - com.google.api.AnnotationsProto.getDescriptor(); - com.google.api.ClientProto.getDescriptor(); - com.google.api.FieldBehaviorProto.getDescriptor(); - com.google.api.ResourceProto.getDescriptor(); - com.google.cloud.speech.v1p1beta1.SpeechResourceProto.getDescriptor(); - com.google.longrunning.OperationsProto.getDescriptor(); - com.google.protobuf.AnyProto.getDescriptor(); - com.google.protobuf.DurationProto.getDescriptor(); - com.google.protobuf.TimestampProto.getDescriptor(); - com.google.rpc.StatusProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternative.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternative.java deleted file mode 100644 index 4de88bfb9..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternative.java +++ /dev/null @@ -1,1296 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * Alternative hypotheses (a.k.a. n-best list).
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} - */ -public final class SpeechRecognitionAlternative extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) - SpeechRecognitionAlternativeOrBuilder { - private static final long serialVersionUID = 0L; - // Use SpeechRecognitionAlternative.newBuilder() to construct. - private SpeechRecognitionAlternative(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SpeechRecognitionAlternative() { - transcript_ = ""; - words_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SpeechRecognitionAlternative(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private SpeechRecognitionAlternative( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - transcript_ = s; - break; - } - case 21: - { - confidence_ = input.readFloat(); - break; - } - case 26: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - words_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - words_.add( - input.readMessage( - com.google.cloud.speech.v1p1beta1.WordInfo.parser(), extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - words_ = java.util.Collections.unmodifiableList(words_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.class, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder.class); - } - - public static final int TRANSCRIPT_FIELD_NUMBER = 1; - private volatile java.lang.Object transcript_; - /** - * - * - *
-   * Transcript text representing the words that the user spoke.
-   * 
- * - * string transcript = 1; - * - * @return The transcript. - */ - @java.lang.Override - public java.lang.String getTranscript() { - java.lang.Object ref = transcript_; - 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(); - transcript_ = s; - return s; - } - } - /** - * - * - *
-   * Transcript text representing the words that the user spoke.
-   * 
- * - * string transcript = 1; - * - * @return The bytes for transcript. - */ - @java.lang.Override - public com.google.protobuf.ByteString getTranscriptBytes() { - java.lang.Object ref = transcript_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - transcript_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONFIDENCE_FIELD_NUMBER = 2; - private float confidence_; - /** - * - * - *
-   * The confidence estimate between 0.0 and 1.0. A higher number
-   * indicates an estimated greater likelihood that the recognized words are
-   * correct. This field is set only for the top alternative of a non-streaming
-   * result or, of a streaming result where `is_final=true`.
-   * This field is not guaranteed to be accurate and users should not rely on it
-   * to be always provided.
-   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-   * 
- * - * float confidence = 2; - * - * @return The confidence. - */ - @java.lang.Override - public float getConfidence() { - return confidence_; - } - - public static final int WORDS_FIELD_NUMBER = 3; - private java.util.List words_; - /** - * - * - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - @java.lang.Override - public java.util.List getWordsList() { - return words_; - } - /** - * - * - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - @java.lang.Override - public java.util.List - getWordsOrBuilderList() { - return words_; - } - /** - * - * - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - @java.lang.Override - public int getWordsCount() { - return words_.size(); - } - /** - * - * - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.WordInfo getWords(int index) { - return words_.get(index); - } - /** - * - * - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder getWordsOrBuilder(int index) { - return words_.get(index); - } - - 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 (!getTranscriptBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, transcript_); - } - if (confidence_ != 0F) { - output.writeFloat(2, confidence_); - } - for (int i = 0; i < words_.size(); i++) { - output.writeMessage(3, words_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getTranscriptBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, transcript_); - } - if (confidence_ != 0F) { - size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, confidence_); - } - for (int i = 0; i < words_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, words_.get(i)); - } - size += unknownFields.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.SpeechRecognitionAlternative)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative other = - (com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) obj; - - if (!getTranscript().equals(other.getTranscript())) return false; - if (java.lang.Float.floatToIntBits(getConfidence()) - != java.lang.Float.floatToIntBits(other.getConfidence())) return false; - if (!getWordsList().equals(other.getWordsList())) return false; - if (!unknownFields.equals(other.unknownFields)) 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) + TRANSCRIPT_FIELD_NUMBER; - hash = (53 * hash) + getTranscript().hashCode(); - hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidence()); - if (getWordsCount() > 0) { - hash = (37 * hash) + WORDS_FIELD_NUMBER; - hash = (53 * hash) + getWordsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative 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.SpeechRecognitionAlternative parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative 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.SpeechRecognitionAlternative parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative 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.SpeechRecognitionAlternative parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative 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.SpeechRecognitionAlternative parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative 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.SpeechRecognitionAlternative 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.SpeechRecognitionAlternative 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.SpeechRecognitionAlternative 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; - } - /** - * - * - *
-   * Alternative hypotheses (a.k.a. n-best list).
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.class, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getWordsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - transcript_ = ""; - - confidence_ = 0F; - - if (wordsBuilder_ == null) { - words_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - wordsBuilder_.clear(); - } - 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_SpeechRecognitionAlternative_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative - getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative build() { - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative buildPartial() { - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative result = - new com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative(this); - int from_bitField0_ = bitField0_; - result.transcript_ = transcript_; - result.confidence_ = confidence_; - if (wordsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - words_ = java.util.Collections.unmodifiableList(words_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.words_ = words_; - } else { - result.words_ = wordsBuilder_.build(); - } - 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.SpeechRecognitionAlternative) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative other) { - if (other - == com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.getDefaultInstance()) - return this; - if (!other.getTranscript().isEmpty()) { - transcript_ = other.transcript_; - onChanged(); - } - if (other.getConfidence() != 0F) { - setConfidence(other.getConfidence()); - } - if (wordsBuilder_ == null) { - if (!other.words_.isEmpty()) { - if (words_.isEmpty()) { - words_ = other.words_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureWordsIsMutable(); - words_.addAll(other.words_); - } - onChanged(); - } - } else { - if (!other.words_.isEmpty()) { - if (wordsBuilder_.isEmpty()) { - wordsBuilder_.dispose(); - wordsBuilder_ = null; - words_ = other.words_; - bitField0_ = (bitField0_ & ~0x00000001); - wordsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getWordsFieldBuilder() - : null; - } else { - wordsBuilder_.addAllMessages(other.words_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object transcript_ = ""; - /** - * - * - *
-     * Transcript text representing the words that the user spoke.
-     * 
- * - * string transcript = 1; - * - * @return The transcript. - */ - public java.lang.String getTranscript() { - java.lang.Object ref = transcript_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - transcript_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Transcript text representing the words that the user spoke.
-     * 
- * - * string transcript = 1; - * - * @return The bytes for transcript. - */ - public com.google.protobuf.ByteString getTranscriptBytes() { - java.lang.Object ref = transcript_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - transcript_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Transcript text representing the words that the user spoke.
-     * 
- * - * string transcript = 1; - * - * @param value The transcript to set. - * @return This builder for chaining. - */ - public Builder setTranscript(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - transcript_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Transcript text representing the words that the user spoke.
-     * 
- * - * string transcript = 1; - * - * @return This builder for chaining. - */ - public Builder clearTranscript() { - - transcript_ = getDefaultInstance().getTranscript(); - onChanged(); - return this; - } - /** - * - * - *
-     * Transcript text representing the words that the user spoke.
-     * 
- * - * string transcript = 1; - * - * @param value The bytes for transcript to set. - * @return This builder for chaining. - */ - public Builder setTranscriptBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - transcript_ = value; - onChanged(); - return this; - } - - private float confidence_; - /** - * - * - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 2; - * - * @return The confidence. - */ - @java.lang.Override - public float getConfidence() { - return confidence_; - } - /** - * - * - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 2; - * - * @param value The confidence to set. - * @return This builder for chaining. - */ - public Builder setConfidence(float value) { - - confidence_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 2; - * - * @return This builder for chaining. - */ - public Builder clearConfidence() { - - confidence_ = 0F; - onChanged(); - return this; - } - - private java.util.List words_ = - java.util.Collections.emptyList(); - - private void ensureWordsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - words_ = new java.util.ArrayList(words_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.WordInfo, - com.google.cloud.speech.v1p1beta1.WordInfo.Builder, - com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder> - wordsBuilder_; - - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public java.util.List getWordsList() { - if (wordsBuilder_ == null) { - return java.util.Collections.unmodifiableList(words_); - } else { - return wordsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public int getWordsCount() { - if (wordsBuilder_ == null) { - return words_.size(); - } else { - return wordsBuilder_.getCount(); - } - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public com.google.cloud.speech.v1p1beta1.WordInfo getWords(int index) { - if (wordsBuilder_ == null) { - return words_.get(index); - } else { - return wordsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public Builder setWords(int index, com.google.cloud.speech.v1p1beta1.WordInfo value) { - if (wordsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureWordsIsMutable(); - words_.set(index, value); - onChanged(); - } else { - wordsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public Builder setWords( - int index, com.google.cloud.speech.v1p1beta1.WordInfo.Builder builderForValue) { - if (wordsBuilder_ == null) { - ensureWordsIsMutable(); - words_.set(index, builderForValue.build()); - onChanged(); - } else { - wordsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public Builder addWords(com.google.cloud.speech.v1p1beta1.WordInfo value) { - if (wordsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureWordsIsMutable(); - words_.add(value); - onChanged(); - } else { - wordsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public Builder addWords(int index, com.google.cloud.speech.v1p1beta1.WordInfo value) { - if (wordsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureWordsIsMutable(); - words_.add(index, value); - onChanged(); - } else { - wordsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public Builder addWords(com.google.cloud.speech.v1p1beta1.WordInfo.Builder builderForValue) { - if (wordsBuilder_ == null) { - ensureWordsIsMutable(); - words_.add(builderForValue.build()); - onChanged(); - } else { - wordsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public Builder addWords( - int index, com.google.cloud.speech.v1p1beta1.WordInfo.Builder builderForValue) { - if (wordsBuilder_ == null) { - ensureWordsIsMutable(); - words_.add(index, builderForValue.build()); - onChanged(); - } else { - wordsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public Builder addAllWords( - java.lang.Iterable values) { - if (wordsBuilder_ == null) { - ensureWordsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, words_); - onChanged(); - } else { - wordsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public Builder clearWords() { - if (wordsBuilder_ == null) { - words_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - wordsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public Builder removeWords(int index) { - if (wordsBuilder_ == null) { - ensureWordsIsMutable(); - words_.remove(index); - onChanged(); - } else { - wordsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public com.google.cloud.speech.v1p1beta1.WordInfo.Builder getWordsBuilder(int index) { - return getWordsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder getWordsOrBuilder(int index) { - if (wordsBuilder_ == null) { - return words_.get(index); - } else { - return wordsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public java.util.List - getWordsOrBuilderList() { - if (wordsBuilder_ != null) { - return wordsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(words_); - } - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public com.google.cloud.speech.v1p1beta1.WordInfo.Builder addWordsBuilder() { - return getWordsFieldBuilder() - .addBuilder(com.google.cloud.speech.v1p1beta1.WordInfo.getDefaultInstance()); - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public com.google.cloud.speech.v1p1beta1.WordInfo.Builder addWordsBuilder(int index) { - return getWordsFieldBuilder() - .addBuilder(index, com.google.cloud.speech.v1p1beta1.WordInfo.getDefaultInstance()); - } - /** - * - * - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public java.util.List - getWordsBuilderList() { - return getWordsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.WordInfo, - com.google.cloud.speech.v1p1beta1.WordInfo.Builder, - com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder> - getWordsFieldBuilder() { - if (wordsBuilder_ == null) { - wordsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.WordInfo, - com.google.cloud.speech.v1p1beta1.WordInfo.Builder, - com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder>( - words_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - words_ = null; - } - return wordsBuilder_; - } - - @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.SpeechRecognitionAlternative) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) - private static final com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative(); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SpeechRecognitionAlternative parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeechRecognitionAlternative(input, extensionRegistry); - } - }; - - 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.SpeechRecognitionAlternative - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternativeOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternativeOrBuilder.java deleted file mode 100644 index c2ff84253..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternativeOrBuilder.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * 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 SpeechRecognitionAlternativeOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Transcript text representing the words that the user spoke.
-   * 
- * - * string transcript = 1; - * - * @return The transcript. - */ - java.lang.String getTranscript(); - /** - * - * - *
-   * Transcript text representing the words that the user spoke.
-   * 
- * - * string transcript = 1; - * - * @return The bytes for transcript. - */ - com.google.protobuf.ByteString getTranscriptBytes(); - - /** - * - * - *
-   * The confidence estimate between 0.0 and 1.0. A higher number
-   * indicates an estimated greater likelihood that the recognized words are
-   * correct. This field is set only for the top alternative of a non-streaming
-   * result or, of a streaming result where `is_final=true`.
-   * This field is not guaranteed to be accurate and users should not rely on it
-   * to be always provided.
-   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-   * 
- * - * float confidence = 2; - * - * @return The confidence. - */ - float getConfidence(); - - /** - * - * - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - java.util.List getWordsList(); - /** - * - * - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - com.google.cloud.speech.v1p1beta1.WordInfo getWords(int index); - /** - * - * - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - int getWordsCount(); - /** - * - * - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - java.util.List - getWordsOrBuilderList(); - /** - * - * - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder getWordsOrBuilder(int index); -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResult.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResult.java deleted file mode 100644 index ff7c05220..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResult.java +++ /dev/null @@ -1,1359 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * A speech recognition result corresponding to a portion of the audio.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechRecognitionResult} - */ -public final class SpeechRecognitionResult extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.SpeechRecognitionResult) - SpeechRecognitionResultOrBuilder { - private static final long serialVersionUID = 0L; - // Use SpeechRecognitionResult.newBuilder() to construct. - private SpeechRecognitionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SpeechRecognitionResult() { - alternatives_ = java.util.Collections.emptyList(); - languageCode_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SpeechRecognitionResult(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private SpeechRecognitionResult( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - alternatives_ = - new java.util.ArrayList< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative>(); - mutable_bitField0_ |= 0x00000001; - } - alternatives_.add( - input.readMessage( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.parser(), - extensionRegistry)); - break; - } - case 16: - { - channelTag_ = input.readInt32(); - break; - } - case 42: - { - java.lang.String s = input.readStringRequireUtf8(); - - languageCode_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - alternatives_ = java.util.Collections.unmodifiableList(alternatives_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.class, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder.class); - } - - public static final int ALTERNATIVES_FIELD_NUMBER = 1; - private java.util.List - alternatives_; - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - @java.lang.Override - public java.util.List - getAlternativesList() { - return alternatives_; - } - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - @java.lang.Override - public java.util.List< - ? extends com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder> - getAlternativesOrBuilderList() { - return alternatives_; - } - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - @java.lang.Override - public int getAlternativesCount() { - return alternatives_.size(); - } - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getAlternatives(int index) { - return alternatives_.get(index); - } - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder - getAlternativesOrBuilder(int index) { - return alternatives_.get(index); - } - - public static final int CHANNEL_TAG_FIELD_NUMBER = 2; - private int channelTag_; - /** - * - * - *
-   * For multi-channel audio, this is the channel number corresponding to the
-   * recognized result for the audio from that channel.
-   * For audio_channel_count = N, its output values can range from '1' to 'N'.
-   * 
- * - * int32 channel_tag = 2; - * - * @return The channelTag. - */ - @java.lang.Override - public int getChannelTag() { - return channelTag_; - } - - public static final int LANGUAGE_CODE_FIELD_NUMBER = 5; - private volatile java.lang.Object languageCode_; - /** - * - * - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
-   * language tag of the language in this result. This language code was
-   * detected to have the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The languageCode. - */ - @java.lang.Override - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - 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(); - languageCode_ = s; - return s; - } - } - /** - * - * - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
-   * language tag of the language in this result. This language code was
-   * detected to have the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for languageCode. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - languageCode_ = 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 { - for (int i = 0; i < alternatives_.size(); i++) { - output.writeMessage(1, alternatives_.get(i)); - } - if (channelTag_ != 0) { - output.writeInt32(2, channelTag_); - } - if (!getLanguageCodeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, languageCode_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < alternatives_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, alternatives_.get(i)); - } - if (channelTag_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, channelTag_); - } - if (!getLanguageCodeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, languageCode_); - } - size += unknownFields.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.SpeechRecognitionResult)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult other = - (com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult) obj; - - if (!getAlternativesList().equals(other.getAlternativesList())) return false; - if (getChannelTag() != other.getChannelTag()) return false; - if (!getLanguageCode().equals(other.getLanguageCode())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getAlternativesCount() > 0) { - hash = (37 * hash) + ALTERNATIVES_FIELD_NUMBER; - hash = (53 * hash) + getAlternativesList().hashCode(); - } - hash = (37 * hash) + CHANNEL_TAG_FIELD_NUMBER; - hash = (53 * hash) + getChannelTag(); - hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; - hash = (53 * hash) + getLanguageCode().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult 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.SpeechRecognitionResult parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult 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.SpeechRecognitionResult parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult 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.SpeechRecognitionResult parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult 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.SpeechRecognitionResult parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult 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.SpeechRecognitionResult 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.SpeechRecognitionResult 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.SpeechRecognitionResult 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; - } - /** - * - * - *
-   * A speech recognition result corresponding to a portion of the audio.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechRecognitionResult} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.SpeechRecognitionResult) - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.class, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getAlternativesFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (alternativesBuilder_ == null) { - alternatives_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - alternativesBuilder_.clear(); - } - channelTag_ = 0; - - languageCode_ = ""; - - 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_SpeechRecognitionResult_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult build() { - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult buildPartial() { - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult result = - new com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult(this); - int from_bitField0_ = bitField0_; - if (alternativesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - alternatives_ = java.util.Collections.unmodifiableList(alternatives_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.alternatives_ = alternatives_; - } else { - result.alternatives_ = alternativesBuilder_.build(); - } - result.channelTag_ = channelTag_; - result.languageCode_ = languageCode_; - 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.SpeechRecognitionResult) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult other) { - if (other == com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.getDefaultInstance()) - return this; - if (alternativesBuilder_ == null) { - if (!other.alternatives_.isEmpty()) { - if (alternatives_.isEmpty()) { - alternatives_ = other.alternatives_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAlternativesIsMutable(); - alternatives_.addAll(other.alternatives_); - } - onChanged(); - } - } else { - if (!other.alternatives_.isEmpty()) { - if (alternativesBuilder_.isEmpty()) { - alternativesBuilder_.dispose(); - alternativesBuilder_ = null; - alternatives_ = other.alternatives_; - bitField0_ = (bitField0_ & ~0x00000001); - alternativesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getAlternativesFieldBuilder() - : null; - } else { - alternativesBuilder_.addAllMessages(other.alternatives_); - } - } - } - if (other.getChannelTag() != 0) { - setChannelTag(other.getChannelTag()); - } - if (!other.getLanguageCode().isEmpty()) { - languageCode_ = other.languageCode_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List - alternatives_ = java.util.Collections.emptyList(); - - private void ensureAlternativesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - alternatives_ = - new java.util.ArrayList( - alternatives_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder> - alternativesBuilder_; - - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public java.util.List - getAlternativesList() { - if (alternativesBuilder_ == null) { - return java.util.Collections.unmodifiableList(alternatives_); - } else { - return alternativesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public int getAlternativesCount() { - if (alternativesBuilder_ == null) { - return alternatives_.size(); - } else { - return alternativesBuilder_.getCount(); - } - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getAlternatives( - int index) { - if (alternativesBuilder_ == null) { - return alternatives_.get(index); - } else { - return alternativesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder setAlternatives( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.set(index, value); - onChanged(); - } else { - alternativesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder setAlternatives( - int index, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.set(index, builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder addAlternatives( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.add(value); - onChanged(); - } else { - alternativesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder addAlternatives( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.add(index, value); - onChanged(); - } else { - alternativesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder addAlternatives( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.add(builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder addAlternatives( - int index, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.add(index, builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder addAllAlternatives( - java.lang.Iterable - values) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, alternatives_); - onChanged(); - } else { - alternativesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder clearAlternatives() { - if (alternativesBuilder_ == null) { - alternatives_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - alternativesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder removeAlternatives(int index) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.remove(index); - onChanged(); - } else { - alternativesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder - getAlternativesBuilder(int index) { - return getAlternativesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder - getAlternativesOrBuilder(int index) { - if (alternativesBuilder_ == null) { - return alternatives_.get(index); - } else { - return alternativesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public java.util.List< - ? extends com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder> - getAlternativesOrBuilderList() { - if (alternativesBuilder_ != null) { - return alternativesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(alternatives_); - } - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder - addAlternativesBuilder() { - return getAlternativesFieldBuilder() - .addBuilder( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.getDefaultInstance()); - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder - addAlternativesBuilder(int index) { - return getAlternativesFieldBuilder() - .addBuilder( - index, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.getDefaultInstance()); - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public java.util.List - getAlternativesBuilderList() { - return getAlternativesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder> - getAlternativesFieldBuilder() { - if (alternativesBuilder_ == null) { - alternativesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder>( - alternatives_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - alternatives_ = null; - } - return alternativesBuilder_; - } - - private int channelTag_; - /** - * - * - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 2; - * - * @return The channelTag. - */ - @java.lang.Override - public int getChannelTag() { - return channelTag_; - } - /** - * - * - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 2; - * - * @param value The channelTag to set. - * @return This builder for chaining. - */ - public Builder setChannelTag(int value) { - - channelTag_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 2; - * - * @return This builder for chaining. - */ - public Builder clearChannelTag() { - - channelTag_ = 0; - onChanged(); - return this; - } - - private java.lang.Object languageCode_ = ""; - /** - * - * - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
-     * language tag of the language in this result. This language code was
-     * detected to have the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The languageCode. - */ - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - languageCode_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
-     * language tag of the language in this result. This language code was
-     * detected to have the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for languageCode. - */ - public com.google.protobuf.ByteString getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
-     * language tag of the language in this result. This language code was
-     * detected to have the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCode(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - languageCode_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
-     * language tag of the language in this result. This language code was
-     * detected to have the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return This builder for chaining. - */ - public Builder clearLanguageCode() { - - languageCode_ = getDefaultInstance().getLanguageCode(); - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
-     * language tag of the language in this result. This language code was
-     * detected to have the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The bytes for languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - languageCode_ = 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.SpeechRecognitionResult) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.SpeechRecognitionResult) - private static final com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult(); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SpeechRecognitionResult parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeechRecognitionResult(input, extensionRegistry); - } - }; - - 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.SpeechRecognitionResult getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResultOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResultOrBuilder.java deleted file mode 100644 index b27b1cbad..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResultOrBuilder.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * 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 SpeechRecognitionResultOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.SpeechRecognitionResult) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - java.util.List - getAlternativesList(); - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getAlternatives(int index); - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - int getAlternativesCount(); - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - java.util.List - getAlternativesOrBuilderList(); - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( - int index); - - /** - * - * - *
-   * For multi-channel audio, this is the channel number corresponding to the
-   * recognized result for the audio from that channel.
-   * For audio_channel_count = N, its output values can range from '1' to 'N'.
-   * 
- * - * int32 channel_tag = 2; - * - * @return The channelTag. - */ - int getChannelTag(); - - /** - * - * - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
-   * language tag of the language in this result. This language code was
-   * detected to have the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The languageCode. - */ - java.lang.String getLanguageCode(); - /** - * - * - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
-   * language tag of the language in this result. This language code was
-   * detected to have the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for languageCode. - */ - com.google.protobuf.ByteString getLanguageCodeBytes(); -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechResourceProto.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechResourceProto.java deleted file mode 100644 index c10c54239..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechResourceProto.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * 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/resource.proto - -package com.google.cloud.speech.v1p1beta1; - -public final class SpeechResourceProto { - private SpeechResourceProto() {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_CustomClass_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - - static { - java.lang.String[] descriptorData = { - "\n,google/cloud/speech/v1p1beta1/resource" - + ".proto\022\035google.cloud.speech.v1p1beta1\032\034g" - + "oogle/api/annotations.proto\032\031google/api/" - + "resource.proto\"\203\002\n\013CustomClass\022\014\n\004name\030\001" - + " \001(\t\022\027\n\017custom_class_id\030\002 \001(\t\022C\n\005items\030\003" - + " \003(\01324.google.cloud.speech.v1p1beta1.Cus" - + "tomClass.ClassItem\032\032\n\tClassItem\022\r\n\005value" - + "\030\001 \001(\t:l\352Ai\n!speech.googleapis.com/Custo" - + "mClass\022Dprojects/{project}/locations/{lo" - + "cation}/customClasses/{custom_class}\"\371\001\n" - + "\tPhraseSet\022\014\n\004name\030\001 \001(\t\022@\n\007phrases\030\002 \003(" - + "\0132/.google.cloud.speech.v1p1beta1.Phrase" - + "Set.Phrase\022\r\n\005boost\030\004 \001(\002\032&\n\006Phrase\022\r\n\005v" - + "alue\030\001 \001(\t\022\r\n\005boost\030\002 \001(\002:e\352Ab\n\037speech.g" - + "oogleapis.com/PhraseSet\022?projects/{proje" - + "ct}/locations/{location}/phraseSets/{phr" - + "ase_set}\"\225\001\n\020SpeechAdaptation\022=\n\013phrase_" - + "sets\030\001 \003(\0132(.google.cloud.speech.v1p1bet" - + "a1.PhraseSet\022B\n\016custom_classes\030\002 \003(\0132*.g" - + "oogle.cloud.speech.v1p1beta1.CustomClass" - + "B\210\001\n!com.google.cloud.speech.v1p1beta1B\023" - + "SpeechResourceProtoP\001ZCgoogle.golang.org" - + "/genproto/googleapis/cloud/speech/v1p1be" - + "ta1;speech\370\001\001\242\002\003GCSb\006proto3" - }; - descriptor = - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - com.google.api.ResourceProto.getDescriptor(), - }); - internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_cloud_speech_v1p1beta1_CustomClass_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor, - new java.lang.String[] { - "Name", "CustomClassId", "Items", - }); - internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_descriptor = - internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor - .getNestedTypes() - .get(0); - internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_descriptor, - new java.lang.String[] { - "Value", - }); - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor, - new java.lang.String[] { - "Name", "Phrases", "Boost", - }); - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor = - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor.getNestedTypes().get(0); - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor, - new java.lang.String[] { - "Value", "Boost", - }); - internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_descriptor, - new java.lang.String[] { - "PhraseSets", "CustomClasses", - }); - com.google.protobuf.ExtensionRegistry registry = - com.google.protobuf.ExtensionRegistry.newInstance(); - registry.add(com.google.api.ResourceProto.resource); - com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( - descriptor, registry); - com.google.api.AnnotationsProto.getDescriptor(); - com.google.api.ResourceProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfig.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfig.java deleted file mode 100644 index 844ab39bd..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfig.java +++ /dev/null @@ -1,1005 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * Provides information to the recognizer that specifies how to process the
- * request.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} - */ -public final class StreamingRecognitionConfig extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) - StreamingRecognitionConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use StreamingRecognitionConfig.newBuilder() to construct. - private StreamingRecognitionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private StreamingRecognitionConfig() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new StreamingRecognitionConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private StreamingRecognitionConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder subBuilder = null; - if (config_ != null) { - subBuilder = config_.toBuilder(); - } - config_ = - input.readMessage( - com.google.cloud.speech.v1p1beta1.RecognitionConfig.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(config_); - config_ = subBuilder.buildPartial(); - } - - break; - } - case 16: - { - singleUtterance_ = input.readBool(); - break; - } - case 24: - { - interimResults_ = input.readBool(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.class, - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder.class); - } - - public static final int CONFIG_FIELD_NUMBER = 1; - private com.google.cloud.speech.v1p1beta1.RecognitionConfig config_; - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the config field is set. - */ - @java.lang.Override - public boolean hasConfig() { - return config_ != null; - } - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The config. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig() { - return config_ == null - ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() - : config_; - } - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { - return getConfig(); - } - - public static final int SINGLE_UTTERANCE_FIELD_NUMBER = 2; - private boolean singleUtterance_; - /** - * - * - *
-   * If `false` or omitted, the recognizer will perform continuous
-   * recognition (continuing to wait for and process audio even if the user
-   * pauses speaking) until the client closes the input stream (gRPC API) or
-   * until the maximum time limit has been reached. May return multiple
-   * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-   * If `true`, the recognizer will detect a single spoken utterance. When it
-   * detects that the user has paused or stopped speaking, it will return an
-   * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
-   * more than one `StreamingRecognitionResult` with the `is_final` flag set to
-   * `true`.
-   * 
- * - * bool single_utterance = 2; - * - * @return The singleUtterance. - */ - @java.lang.Override - public boolean getSingleUtterance() { - return singleUtterance_; - } - - public static final int INTERIM_RESULTS_FIELD_NUMBER = 3; - private boolean interimResults_; - /** - * - * - *
-   * If `true`, interim results (tentative hypotheses) may be
-   * returned as they become available (these interim results are indicated with
-   * the `is_final=false` flag).
-   * If `false` or omitted, only `is_final=true` result(s) are returned.
-   * 
- * - * bool interim_results = 3; - * - * @return The interimResults. - */ - @java.lang.Override - public boolean getInterimResults() { - return interimResults_; - } - - 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 (config_ != null) { - output.writeMessage(1, getConfig()); - } - if (singleUtterance_ != false) { - output.writeBool(2, singleUtterance_); - } - if (interimResults_ != false) { - output.writeBool(3, interimResults_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (config_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getConfig()); - } - if (singleUtterance_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, singleUtterance_); - } - if (interimResults_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, interimResults_); - } - size += unknownFields.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.StreamingRecognitionConfig)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig other = - (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) obj; - - if (hasConfig() != other.hasConfig()) return false; - if (hasConfig()) { - if (!getConfig().equals(other.getConfig())) return false; - } - if (getSingleUtterance() != other.getSingleUtterance()) return false; - if (getInterimResults() != other.getInterimResults()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConfig()) { - hash = (37 * hash) + CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getConfig().hashCode(); - } - hash = (37 * hash) + SINGLE_UTTERANCE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSingleUtterance()); - hash = (37 * hash) + INTERIM_RESULTS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getInterimResults()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig 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.StreamingRecognitionConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig 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.StreamingRecognitionConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig 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.StreamingRecognitionConfig parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig 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.StreamingRecognitionConfig parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig 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.StreamingRecognitionConfig 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.StreamingRecognitionConfig 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.StreamingRecognitionConfig 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; - } - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.class, - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (configBuilder_ == null) { - config_ = null; - } else { - config_ = null; - configBuilder_ = null; - } - singleUtterance_ = false; - - interimResults_ = false; - - 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_StreamingRecognitionConfig_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig - getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig build() { - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig buildPartial() { - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig result = - new com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig(this); - if (configBuilder_ == null) { - result.config_ = config_; - } else { - result.config_ = configBuilder_.build(); - } - result.singleUtterance_ = singleUtterance_; - result.interimResults_ = interimResults_; - 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.StreamingRecognitionConfig) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig other) { - if (other - == com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance()) - return this; - if (other.hasConfig()) { - mergeConfig(other.getConfig()); - } - if (other.getSingleUtterance() != false) { - setSingleUtterance(other.getSingleUtterance()); - } - if (other.getInterimResults() != false) { - setInterimResults(other.getInterimResults()); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.speech.v1p1beta1.RecognitionConfig config_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionConfig, - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, - com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder> - configBuilder_; - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the config field is set. - */ - public boolean hasConfig() { - return configBuilder_ != null || config_ != null; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The config. - */ - public com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig() { - if (configBuilder_ == null) { - return config_ == null - ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() - : config_; - } else { - return configBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setConfig(com.google.cloud.speech.v1p1beta1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - config_ = value; - onChanged(); - } else { - configBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setConfig( - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder builderForValue) { - if (configBuilder_ == null) { - config_ = builderForValue.build(); - onChanged(); - } else { - configBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeConfig(com.google.cloud.speech.v1p1beta1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (config_ != null) { - config_ = - com.google.cloud.speech.v1p1beta1.RecognitionConfig.newBuilder(config_) - .mergeFrom(value) - .buildPartial(); - } else { - config_ = value; - } - onChanged(); - } else { - configBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearConfig() { - if (configBuilder_ == null) { - config_ = null; - onChanged(); - } else { - config_ = null; - configBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder getConfigBuilder() { - - onChanged(); - return getConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { - if (configBuilder_ != null) { - return configBuilder_.getMessageOrBuilder(); - } else { - return config_ == null - ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() - : config_; - } - } - /** - * - * - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionConfig, - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, - com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder> - getConfigFieldBuilder() { - if (configBuilder_ == null) { - configBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionConfig, - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, - com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder>( - getConfig(), getParentForChildren(), isClean()); - config_ = null; - } - return configBuilder_; - } - - private boolean singleUtterance_; - /** - * - * - *
-     * If `false` or omitted, the recognizer will perform continuous
-     * recognition (continuing to wait for and process audio even if the user
-     * pauses speaking) until the client closes the input stream (gRPC API) or
-     * until the maximum time limit has been reached. May return multiple
-     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-     * If `true`, the recognizer will detect a single spoken utterance. When it
-     * detects that the user has paused or stopped speaking, it will return an
-     * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
-     * more than one `StreamingRecognitionResult` with the `is_final` flag set to
-     * `true`.
-     * 
- * - * bool single_utterance = 2; - * - * @return The singleUtterance. - */ - @java.lang.Override - public boolean getSingleUtterance() { - return singleUtterance_; - } - /** - * - * - *
-     * If `false` or omitted, the recognizer will perform continuous
-     * recognition (continuing to wait for and process audio even if the user
-     * pauses speaking) until the client closes the input stream (gRPC API) or
-     * until the maximum time limit has been reached. May return multiple
-     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-     * If `true`, the recognizer will detect a single spoken utterance. When it
-     * detects that the user has paused or stopped speaking, it will return an
-     * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
-     * more than one `StreamingRecognitionResult` with the `is_final` flag set to
-     * `true`.
-     * 
- * - * bool single_utterance = 2; - * - * @param value The singleUtterance to set. - * @return This builder for chaining. - */ - public Builder setSingleUtterance(boolean value) { - - singleUtterance_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If `false` or omitted, the recognizer will perform continuous
-     * recognition (continuing to wait for and process audio even if the user
-     * pauses speaking) until the client closes the input stream (gRPC API) or
-     * until the maximum time limit has been reached. May return multiple
-     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-     * If `true`, the recognizer will detect a single spoken utterance. When it
-     * detects that the user has paused or stopped speaking, it will return an
-     * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
-     * more than one `StreamingRecognitionResult` with the `is_final` flag set to
-     * `true`.
-     * 
- * - * bool single_utterance = 2; - * - * @return This builder for chaining. - */ - public Builder clearSingleUtterance() { - - singleUtterance_ = false; - onChanged(); - return this; - } - - private boolean interimResults_; - /** - * - * - *
-     * If `true`, interim results (tentative hypotheses) may be
-     * returned as they become available (these interim results are indicated with
-     * the `is_final=false` flag).
-     * If `false` or omitted, only `is_final=true` result(s) are returned.
-     * 
- * - * bool interim_results = 3; - * - * @return The interimResults. - */ - @java.lang.Override - public boolean getInterimResults() { - return interimResults_; - } - /** - * - * - *
-     * If `true`, interim results (tentative hypotheses) may be
-     * returned as they become available (these interim results are indicated with
-     * the `is_final=false` flag).
-     * If `false` or omitted, only `is_final=true` result(s) are returned.
-     * 
- * - * bool interim_results = 3; - * - * @param value The interimResults to set. - * @return This builder for chaining. - */ - public Builder setInterimResults(boolean value) { - - interimResults_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If `true`, interim results (tentative hypotheses) may be
-     * returned as they become available (these interim results are indicated with
-     * the `is_final=false` flag).
-     * If `false` or omitted, only `is_final=true` result(s) are returned.
-     * 
- * - * bool interim_results = 3; - * - * @return This builder for chaining. - */ - public Builder clearInterimResults() { - - interimResults_ = false; - 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.StreamingRecognitionConfig) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) - private static final com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig(); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StreamingRecognitionConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingRecognitionConfig(input, extensionRegistry); - } - }; - - 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.StreamingRecognitionConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfigOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfigOrBuilder.java deleted file mode 100644 index 157a5dccc..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfigOrBuilder.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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 StreamingRecognitionConfigOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the config field is set. - */ - boolean hasConfig(); - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The config. - */ - com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig(); - /** - * - * - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder(); - - /** - * - * - *
-   * If `false` or omitted, the recognizer will perform continuous
-   * recognition (continuing to wait for and process audio even if the user
-   * pauses speaking) until the client closes the input stream (gRPC API) or
-   * until the maximum time limit has been reached. May return multiple
-   * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-   * If `true`, the recognizer will detect a single spoken utterance. When it
-   * detects that the user has paused or stopped speaking, it will return an
-   * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
-   * more than one `StreamingRecognitionResult` with the `is_final` flag set to
-   * `true`.
-   * 
- * - * bool single_utterance = 2; - * - * @return The singleUtterance. - */ - boolean getSingleUtterance(); - - /** - * - * - *
-   * If `true`, interim results (tentative hypotheses) may be
-   * returned as they become available (these interim results are indicated with
-   * the `is_final=false` flag).
-   * If `false` or omitted, only `is_final=true` result(s) are returned.
-   * 
- * - * bool interim_results = 3; - * - * @return The interimResults. - */ - boolean getInterimResults(); -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResult.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResult.java deleted file mode 100644 index eea12db42..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResult.java +++ /dev/null @@ -1,1865 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * A streaming speech recognition result corresponding to a portion of the audio
- * that is currently being processed.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognitionResult} - */ -public final class StreamingRecognitionResult extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.StreamingRecognitionResult) - StreamingRecognitionResultOrBuilder { - private static final long serialVersionUID = 0L; - // Use StreamingRecognitionResult.newBuilder() to construct. - private StreamingRecognitionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private StreamingRecognitionResult() { - alternatives_ = java.util.Collections.emptyList(); - languageCode_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new StreamingRecognitionResult(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private StreamingRecognitionResult( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - alternatives_ = - new java.util.ArrayList< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative>(); - mutable_bitField0_ |= 0x00000001; - } - alternatives_.add( - input.readMessage( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.parser(), - extensionRegistry)); - break; - } - case 16: - { - isFinal_ = input.readBool(); - break; - } - case 29: - { - stability_ = input.readFloat(); - break; - } - case 34: - { - com.google.protobuf.Duration.Builder subBuilder = null; - if (resultEndTime_ != null) { - subBuilder = resultEndTime_.toBuilder(); - } - resultEndTime_ = - input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(resultEndTime_); - resultEndTime_ = subBuilder.buildPartial(); - } - - break; - } - case 40: - { - channelTag_ = input.readInt32(); - break; - } - case 50: - { - java.lang.String s = input.readStringRequireUtf8(); - - languageCode_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - alternatives_ = java.util.Collections.unmodifiableList(alternatives_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.class, - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder.class); - } - - public static final int ALTERNATIVES_FIELD_NUMBER = 1; - private java.util.List - alternatives_; - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - @java.lang.Override - public java.util.List - getAlternativesList() { - return alternatives_; - } - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - @java.lang.Override - public java.util.List< - ? extends com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder> - getAlternativesOrBuilderList() { - return alternatives_; - } - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - @java.lang.Override - public int getAlternativesCount() { - return alternatives_.size(); - } - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getAlternatives(int index) { - return alternatives_.get(index); - } - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder - getAlternativesOrBuilder(int index) { - return alternatives_.get(index); - } - - public static final int IS_FINAL_FIELD_NUMBER = 2; - private boolean isFinal_; - /** - * - * - *
-   * If `false`, this `StreamingRecognitionResult` represents an
-   * interim result that may change. If `true`, this is the final time the
-   * speech service will return this particular `StreamingRecognitionResult`,
-   * the recognizer will not return any further hypotheses for this portion of
-   * the transcript and corresponding audio.
-   * 
- * - * bool is_final = 2; - * - * @return The isFinal. - */ - @java.lang.Override - public boolean getIsFinal() { - return isFinal_; - } - - public static final int STABILITY_FIELD_NUMBER = 3; - private float stability_; - /** - * - * - *
-   * An estimate of the likelihood that the recognizer will not
-   * change its guess about this interim result. Values range from 0.0
-   * (completely unstable) to 1.0 (completely stable).
-   * This field is only provided for interim results (`is_final=false`).
-   * The default of 0.0 is a sentinel value indicating `stability` was not set.
-   * 
- * - * float stability = 3; - * - * @return The stability. - */ - @java.lang.Override - public float getStability() { - return stability_; - } - - public static final int RESULT_END_TIME_FIELD_NUMBER = 4; - private com.google.protobuf.Duration resultEndTime_; - /** - * - * - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * - * @return Whether the resultEndTime field is set. - */ - @java.lang.Override - public boolean hasResultEndTime() { - return resultEndTime_ != null; - } - /** - * - * - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * - * @return The resultEndTime. - */ - @java.lang.Override - public com.google.protobuf.Duration getResultEndTime() { - return resultEndTime_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : resultEndTime_; - } - /** - * - * - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder() { - return getResultEndTime(); - } - - public static final int CHANNEL_TAG_FIELD_NUMBER = 5; - private int channelTag_; - /** - * - * - *
-   * For multi-channel audio, this is the channel number corresponding to the
-   * recognized result for the audio from that channel.
-   * For audio_channel_count = N, its output values can range from '1' to 'N'.
-   * 
- * - * int32 channel_tag = 5; - * - * @return The channelTag. - */ - @java.lang.Override - public int getChannelTag() { - return channelTag_; - } - - public static final int LANGUAGE_CODE_FIELD_NUMBER = 6; - private volatile java.lang.Object languageCode_; - /** - * - * - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
-   * language tag of the language in this result. This language code was
-   * detected to have the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The languageCode. - */ - @java.lang.Override - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - 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(); - languageCode_ = s; - return s; - } - } - /** - * - * - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
-   * language tag of the language in this result. This language code was
-   * detected to have the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for languageCode. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - languageCode_ = 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 { - for (int i = 0; i < alternatives_.size(); i++) { - output.writeMessage(1, alternatives_.get(i)); - } - if (isFinal_ != false) { - output.writeBool(2, isFinal_); - } - if (stability_ != 0F) { - output.writeFloat(3, stability_); - } - if (resultEndTime_ != null) { - output.writeMessage(4, getResultEndTime()); - } - if (channelTag_ != 0) { - output.writeInt32(5, channelTag_); - } - if (!getLanguageCodeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, languageCode_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < alternatives_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, alternatives_.get(i)); - } - if (isFinal_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, isFinal_); - } - if (stability_ != 0F) { - size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, stability_); - } - if (resultEndTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getResultEndTime()); - } - if (channelTag_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, channelTag_); - } - if (!getLanguageCodeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, languageCode_); - } - size += unknownFields.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.StreamingRecognitionResult)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult other = - (com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult) obj; - - if (!getAlternativesList().equals(other.getAlternativesList())) return false; - if (getIsFinal() != other.getIsFinal()) return false; - if (java.lang.Float.floatToIntBits(getStability()) - != java.lang.Float.floatToIntBits(other.getStability())) return false; - if (hasResultEndTime() != other.hasResultEndTime()) return false; - if (hasResultEndTime()) { - if (!getResultEndTime().equals(other.getResultEndTime())) return false; - } - if (getChannelTag() != other.getChannelTag()) return false; - if (!getLanguageCode().equals(other.getLanguageCode())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getAlternativesCount() > 0) { - hash = (37 * hash) + ALTERNATIVES_FIELD_NUMBER; - hash = (53 * hash) + getAlternativesList().hashCode(); - } - hash = (37 * hash) + IS_FINAL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsFinal()); - hash = (37 * hash) + STABILITY_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits(getStability()); - if (hasResultEndTime()) { - hash = (37 * hash) + RESULT_END_TIME_FIELD_NUMBER; - hash = (53 * hash) + getResultEndTime().hashCode(); - } - hash = (37 * hash) + CHANNEL_TAG_FIELD_NUMBER; - hash = (53 * hash) + getChannelTag(); - hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; - hash = (53 * hash) + getLanguageCode().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult 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.StreamingRecognitionResult parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult 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.StreamingRecognitionResult parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult 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.StreamingRecognitionResult parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult 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.StreamingRecognitionResult parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult 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.StreamingRecognitionResult 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.StreamingRecognitionResult 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.StreamingRecognitionResult 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; - } - /** - * - * - *
-   * A streaming speech recognition result corresponding to a portion of the audio
-   * that is currently being processed.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognitionResult} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.StreamingRecognitionResult) - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.class, - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getAlternativesFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (alternativesBuilder_ == null) { - alternatives_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - alternativesBuilder_.clear(); - } - isFinal_ = false; - - stability_ = 0F; - - if (resultEndTimeBuilder_ == null) { - resultEndTime_ = null; - } else { - resultEndTime_ = null; - resultEndTimeBuilder_ = null; - } - channelTag_ = 0; - - languageCode_ = ""; - - 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_StreamingRecognitionResult_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult - getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult build() { - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult buildPartial() { - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult result = - new com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult(this); - int from_bitField0_ = bitField0_; - if (alternativesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - alternatives_ = java.util.Collections.unmodifiableList(alternatives_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.alternatives_ = alternatives_; - } else { - result.alternatives_ = alternativesBuilder_.build(); - } - result.isFinal_ = isFinal_; - result.stability_ = stability_; - if (resultEndTimeBuilder_ == null) { - result.resultEndTime_ = resultEndTime_; - } else { - result.resultEndTime_ = resultEndTimeBuilder_.build(); - } - result.channelTag_ = channelTag_; - result.languageCode_ = languageCode_; - 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.StreamingRecognitionResult) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult other) { - if (other - == com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.getDefaultInstance()) - return this; - if (alternativesBuilder_ == null) { - if (!other.alternatives_.isEmpty()) { - if (alternatives_.isEmpty()) { - alternatives_ = other.alternatives_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAlternativesIsMutable(); - alternatives_.addAll(other.alternatives_); - } - onChanged(); - } - } else { - if (!other.alternatives_.isEmpty()) { - if (alternativesBuilder_.isEmpty()) { - alternativesBuilder_.dispose(); - alternativesBuilder_ = null; - alternatives_ = other.alternatives_; - bitField0_ = (bitField0_ & ~0x00000001); - alternativesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getAlternativesFieldBuilder() - : null; - } else { - alternativesBuilder_.addAllMessages(other.alternatives_); - } - } - } - if (other.getIsFinal() != false) { - setIsFinal(other.getIsFinal()); - } - if (other.getStability() != 0F) { - setStability(other.getStability()); - } - if (other.hasResultEndTime()) { - mergeResultEndTime(other.getResultEndTime()); - } - if (other.getChannelTag() != 0) { - setChannelTag(other.getChannelTag()); - } - if (!other.getLanguageCode().isEmpty()) { - languageCode_ = other.languageCode_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List - alternatives_ = java.util.Collections.emptyList(); - - private void ensureAlternativesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - alternatives_ = - new java.util.ArrayList( - alternatives_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder> - alternativesBuilder_; - - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public java.util.List - getAlternativesList() { - if (alternativesBuilder_ == null) { - return java.util.Collections.unmodifiableList(alternatives_); - } else { - return alternativesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public int getAlternativesCount() { - if (alternativesBuilder_ == null) { - return alternatives_.size(); - } else { - return alternativesBuilder_.getCount(); - } - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getAlternatives( - int index) { - if (alternativesBuilder_ == null) { - return alternatives_.get(index); - } else { - return alternativesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder setAlternatives( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.set(index, value); - onChanged(); - } else { - alternativesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder setAlternatives( - int index, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.set(index, builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder addAlternatives( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.add(value); - onChanged(); - } else { - alternativesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder addAlternatives( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.add(index, value); - onChanged(); - } else { - alternativesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder addAlternatives( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.add(builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder addAlternatives( - int index, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.add(index, builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder addAllAlternatives( - java.lang.Iterable - values) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, alternatives_); - onChanged(); - } else { - alternativesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder clearAlternatives() { - if (alternativesBuilder_ == null) { - alternatives_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - alternativesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public Builder removeAlternatives(int index) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.remove(index); - onChanged(); - } else { - alternativesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder - getAlternativesBuilder(int index) { - return getAlternativesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder - getAlternativesOrBuilder(int index) { - if (alternativesBuilder_ == null) { - return alternatives_.get(index); - } else { - return alternativesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public java.util.List< - ? extends com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder> - getAlternativesOrBuilderList() { - if (alternativesBuilder_ != null) { - return alternativesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(alternatives_); - } - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder - addAlternativesBuilder() { - return getAlternativesFieldBuilder() - .addBuilder( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.getDefaultInstance()); - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder - addAlternativesBuilder(int index) { - return getAlternativesFieldBuilder() - .addBuilder( - index, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.getDefaultInstance()); - } - /** - * - * - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - public java.util.List - getAlternativesBuilderList() { - return getAlternativesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder> - getAlternativesFieldBuilder() { - if (alternativesBuilder_ == null) { - alternativesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder, - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder>( - alternatives_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - alternatives_ = null; - } - return alternativesBuilder_; - } - - private boolean isFinal_; - /** - * - * - *
-     * If `false`, this `StreamingRecognitionResult` represents an
-     * interim result that may change. If `true`, this is the final time the
-     * speech service will return this particular `StreamingRecognitionResult`,
-     * the recognizer will not return any further hypotheses for this portion of
-     * the transcript and corresponding audio.
-     * 
- * - * bool is_final = 2; - * - * @return The isFinal. - */ - @java.lang.Override - public boolean getIsFinal() { - return isFinal_; - } - /** - * - * - *
-     * If `false`, this `StreamingRecognitionResult` represents an
-     * interim result that may change. If `true`, this is the final time the
-     * speech service will return this particular `StreamingRecognitionResult`,
-     * the recognizer will not return any further hypotheses for this portion of
-     * the transcript and corresponding audio.
-     * 
- * - * bool is_final = 2; - * - * @param value The isFinal to set. - * @return This builder for chaining. - */ - public Builder setIsFinal(boolean value) { - - isFinal_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * If `false`, this `StreamingRecognitionResult` represents an
-     * interim result that may change. If `true`, this is the final time the
-     * speech service will return this particular `StreamingRecognitionResult`,
-     * the recognizer will not return any further hypotheses for this portion of
-     * the transcript and corresponding audio.
-     * 
- * - * bool is_final = 2; - * - * @return This builder for chaining. - */ - public Builder clearIsFinal() { - - isFinal_ = false; - onChanged(); - return this; - } - - private float stability_; - /** - * - * - *
-     * An estimate of the likelihood that the recognizer will not
-     * change its guess about this interim result. Values range from 0.0
-     * (completely unstable) to 1.0 (completely stable).
-     * This field is only provided for interim results (`is_final=false`).
-     * The default of 0.0 is a sentinel value indicating `stability` was not set.
-     * 
- * - * float stability = 3; - * - * @return The stability. - */ - @java.lang.Override - public float getStability() { - return stability_; - } - /** - * - * - *
-     * An estimate of the likelihood that the recognizer will not
-     * change its guess about this interim result. Values range from 0.0
-     * (completely unstable) to 1.0 (completely stable).
-     * This field is only provided for interim results (`is_final=false`).
-     * The default of 0.0 is a sentinel value indicating `stability` was not set.
-     * 
- * - * float stability = 3; - * - * @param value The stability to set. - * @return This builder for chaining. - */ - public Builder setStability(float value) { - - stability_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * An estimate of the likelihood that the recognizer will not
-     * change its guess about this interim result. Values range from 0.0
-     * (completely unstable) to 1.0 (completely stable).
-     * This field is only provided for interim results (`is_final=false`).
-     * The default of 0.0 is a sentinel value indicating `stability` was not set.
-     * 
- * - * float stability = 3; - * - * @return This builder for chaining. - */ - public Builder clearStability() { - - stability_ = 0F; - onChanged(); - return this; - } - - private com.google.protobuf.Duration resultEndTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - resultEndTimeBuilder_; - /** - * - * - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - * - * @return Whether the resultEndTime field is set. - */ - public boolean hasResultEndTime() { - return resultEndTimeBuilder_ != null || resultEndTime_ != null; - } - /** - * - * - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - * - * @return The resultEndTime. - */ - public com.google.protobuf.Duration getResultEndTime() { - if (resultEndTimeBuilder_ == null) { - return resultEndTime_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : resultEndTime_; - } else { - return resultEndTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder setResultEndTime(com.google.protobuf.Duration value) { - if (resultEndTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - resultEndTime_ = value; - onChanged(); - } else { - resultEndTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder setResultEndTime(com.google.protobuf.Duration.Builder builderForValue) { - if (resultEndTimeBuilder_ == null) { - resultEndTime_ = builderForValue.build(); - onChanged(); - } else { - resultEndTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder mergeResultEndTime(com.google.protobuf.Duration value) { - if (resultEndTimeBuilder_ == null) { - if (resultEndTime_ != null) { - resultEndTime_ = - com.google.protobuf.Duration.newBuilder(resultEndTime_) - .mergeFrom(value) - .buildPartial(); - } else { - resultEndTime_ = value; - } - onChanged(); - } else { - resultEndTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder clearResultEndTime() { - if (resultEndTimeBuilder_ == null) { - resultEndTime_ = null; - onChanged(); - } else { - resultEndTime_ = null; - resultEndTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public com.google.protobuf.Duration.Builder getResultEndTimeBuilder() { - - onChanged(); - return getResultEndTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder() { - if (resultEndTimeBuilder_ != null) { - return resultEndTimeBuilder_.getMessageOrBuilder(); - } else { - return resultEndTime_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : resultEndTime_; - } - } - /** - * - * - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - getResultEndTimeFieldBuilder() { - if (resultEndTimeBuilder_ == null) { - resultEndTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder>( - getResultEndTime(), getParentForChildren(), isClean()); - resultEndTime_ = null; - } - return resultEndTimeBuilder_; - } - - private int channelTag_; - /** - * - * - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 5; - * - * @return The channelTag. - */ - @java.lang.Override - public int getChannelTag() { - return channelTag_; - } - /** - * - * - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 5; - * - * @param value The channelTag to set. - * @return This builder for chaining. - */ - public Builder setChannelTag(int value) { - - channelTag_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 5; - * - * @return This builder for chaining. - */ - public Builder clearChannelTag() { - - channelTag_ = 0; - onChanged(); - return this; - } - - private java.lang.Object languageCode_ = ""; - /** - * - * - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
-     * language tag of the language in this result. This language code was
-     * detected to have the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The languageCode. - */ - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - languageCode_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
-     * language tag of the language in this result. This language code was
-     * detected to have the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for languageCode. - */ - public com.google.protobuf.ByteString getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
-     * language tag of the language in this result. This language code was
-     * detected to have the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCode(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - languageCode_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
-     * language tag of the language in this result. This language code was
-     * detected to have the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return This builder for chaining. - */ - public Builder clearLanguageCode() { - - languageCode_ = getDefaultInstance().getLanguageCode(); - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
-     * language tag of the language in this result. This language code was
-     * detected to have the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The bytes for languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - languageCode_ = 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.StreamingRecognitionResult) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.StreamingRecognitionResult) - private static final com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult(); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StreamingRecognitionResult parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingRecognitionResult(input, extensionRegistry); - } - }; - - 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.StreamingRecognitionResult getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResultOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResultOrBuilder.java deleted file mode 100644 index bde0e8939..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResultOrBuilder.java +++ /dev/null @@ -1,215 +0,0 @@ -/* - * 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 StreamingRecognitionResultOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.StreamingRecognitionResult) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - java.util.List - getAlternativesList(); - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getAlternatives(int index); - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - int getAlternativesCount(); - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - java.util.List - getAlternativesOrBuilderList(); - /** - * - * - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - * - */ - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( - int index); - - /** - * - * - *
-   * If `false`, this `StreamingRecognitionResult` represents an
-   * interim result that may change. If `true`, this is the final time the
-   * speech service will return this particular `StreamingRecognitionResult`,
-   * the recognizer will not return any further hypotheses for this portion of
-   * the transcript and corresponding audio.
-   * 
- * - * bool is_final = 2; - * - * @return The isFinal. - */ - boolean getIsFinal(); - - /** - * - * - *
-   * An estimate of the likelihood that the recognizer will not
-   * change its guess about this interim result. Values range from 0.0
-   * (completely unstable) to 1.0 (completely stable).
-   * This field is only provided for interim results (`is_final=false`).
-   * The default of 0.0 is a sentinel value indicating `stability` was not set.
-   * 
- * - * float stability = 3; - * - * @return The stability. - */ - float getStability(); - - /** - * - * - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * - * @return Whether the resultEndTime field is set. - */ - boolean hasResultEndTime(); - /** - * - * - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * - * @return The resultEndTime. - */ - com.google.protobuf.Duration getResultEndTime(); - /** - * - * - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder(); - - /** - * - * - *
-   * For multi-channel audio, this is the channel number corresponding to the
-   * recognized result for the audio from that channel.
-   * For audio_channel_count = N, its output values can range from '1' to 'N'.
-   * 
- * - * int32 channel_tag = 5; - * - * @return The channelTag. - */ - int getChannelTag(); - - /** - * - * - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
-   * language tag of the language in this result. This language code was
-   * detected to have the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The languageCode. - */ - java.lang.String getLanguageCode(); - /** - * - * - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
-   * language tag of the language in this result. This language code was
-   * detected to have the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for languageCode. - */ - com.google.protobuf.ByteString getLanguageCodeBytes(); -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequest.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequest.java deleted file mode 100644 index dda6bbb18..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequest.java +++ /dev/null @@ -1,1023 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * The top-level message sent by the client for the `StreamingRecognize` method.
- * Multiple `StreamingRecognizeRequest` messages are sent. The first message
- * must contain a `streaming_config` message and must not contain
- * `audio_content`. All subsequent messages must contain `audio_content` and
- * must not contain a `streaming_config` message.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} - */ -public final class StreamingRecognizeRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) - StreamingRecognizeRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use StreamingRecognizeRequest.newBuilder() to construct. - private StreamingRecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private StreamingRecognizeRequest() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new StreamingRecognizeRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private StreamingRecognizeRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder subBuilder = - null; - if (streamingRequestCase_ == 1) { - subBuilder = - ((com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) - streamingRequest_) - .toBuilder(); - } - streamingRequest_ = - input.readMessage( - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) - streamingRequest_); - streamingRequest_ = subBuilder.buildPartial(); - } - streamingRequestCase_ = 1; - break; - } - case 18: - { - streamingRequestCase_ = 2; - streamingRequest_ = input.readBytes(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.class, - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.Builder.class); - } - - private int streamingRequestCase_ = 0; - private java.lang.Object streamingRequest_; - - public enum StreamingRequestCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - STREAMING_CONFIG(1), - AUDIO_CONTENT(2), - STREAMINGREQUEST_NOT_SET(0); - private final int value; - - private StreamingRequestCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static StreamingRequestCase valueOf(int value) { - return forNumber(value); - } - - public static StreamingRequestCase forNumber(int value) { - switch (value) { - case 1: - return STREAMING_CONFIG; - case 2: - return AUDIO_CONTENT; - case 0: - return STREAMINGREQUEST_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public StreamingRequestCase getStreamingRequestCase() { - return StreamingRequestCase.forNumber(streamingRequestCase_); - } - - public static final int STREAMING_CONFIG_FIELD_NUMBER = 1; - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - * - * @return Whether the streamingConfig field is set. - */ - @java.lang.Override - public boolean hasStreamingConfig() { - return streamingRequestCase_ == 1; - } - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - * - * @return The streamingConfig. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig getStreamingConfig() { - if (streamingRequestCase_ == 1) { - return (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_; - } - return com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder - getStreamingConfigOrBuilder() { - if (streamingRequestCase_ == 1) { - return (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_; - } - return com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } - - public static final int AUDIO_CONTENT_FIELD_NUMBER = 2; - /** - * - * - *
-   * The audio data to be recognized. Sequential chunks of audio data are sent
-   * in sequential `StreamingRecognizeRequest` messages. The first
-   * `StreamingRecognizeRequest` message must not contain `audio_content` data
-   * and all subsequent `StreamingRecognizeRequest` messages must contain
-   * `audio_content` data. The audio bytes must be encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation (not base64). See
-   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * 
- * - * bytes audio_content = 2; - * - * @return The audioContent. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAudioContent() { - if (streamingRequestCase_ == 2) { - return (com.google.protobuf.ByteString) streamingRequest_; - } - return com.google.protobuf.ByteString.EMPTY; - } - - 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 (streamingRequestCase_ == 1) { - output.writeMessage( - 1, (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_); - } - if (streamingRequestCase_ == 2) { - output.writeBytes(2, (com.google.protobuf.ByteString) streamingRequest_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (streamingRequestCase_ == 1) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 1, (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_); - } - if (streamingRequestCase_ == 2) { - size += - com.google.protobuf.CodedOutputStream.computeBytesSize( - 2, (com.google.protobuf.ByteString) streamingRequest_); - } - size += unknownFields.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.StreamingRecognizeRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest other = - (com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) obj; - - if (!getStreamingRequestCase().equals(other.getStreamingRequestCase())) return false; - switch (streamingRequestCase_) { - case 1: - if (!getStreamingConfig().equals(other.getStreamingConfig())) return false; - break; - case 2: - if (!getAudioContent().equals(other.getAudioContent())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (streamingRequestCase_) { - case 1: - hash = (37 * hash) + STREAMING_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getStreamingConfig().hashCode(); - break; - case 2: - hash = (37 * hash) + AUDIO_CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getAudioContent().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest 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.StreamingRecognizeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest 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.StreamingRecognizeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest 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.StreamingRecognizeRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest 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.StreamingRecognizeRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest 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.StreamingRecognizeRequest 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.StreamingRecognizeRequest 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.StreamingRecognizeRequest 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; - } - /** - * - * - *
-   * The top-level message sent by the client for the `StreamingRecognize` method.
-   * Multiple `StreamingRecognizeRequest` messages are sent. The first message
-   * must contain a `streaming_config` message and must not contain
-   * `audio_content`. All subsequent messages must contain `audio_content` and
-   * must not contain a `streaming_config` message.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.class, - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - streamingRequestCase_ = 0; - streamingRequest_ = null; - 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_StreamingRecognizeRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest build() { - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest buildPartial() { - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest result = - new com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest(this); - if (streamingRequestCase_ == 1) { - if (streamingConfigBuilder_ == null) { - result.streamingRequest_ = streamingRequest_; - } else { - result.streamingRequest_ = streamingConfigBuilder_.build(); - } - } - if (streamingRequestCase_ == 2) { - result.streamingRequest_ = streamingRequest_; - } - result.streamingRequestCase_ = streamingRequestCase_; - 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.StreamingRecognizeRequest) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest other) { - if (other == com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.getDefaultInstance()) - return this; - switch (other.getStreamingRequestCase()) { - case STREAMING_CONFIG: - { - mergeStreamingConfig(other.getStreamingConfig()); - break; - } - case AUDIO_CONTENT: - { - setAudioContent(other.getAudioContent()); - break; - } - case STREAMINGREQUEST_NOT_SET: - { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int streamingRequestCase_ = 0; - private java.lang.Object streamingRequest_; - - public StreamingRequestCase getStreamingRequestCase() { - return StreamingRequestCase.forNumber(streamingRequestCase_); - } - - public Builder clearStreamingRequest() { - streamingRequestCase_ = 0; - streamingRequest_ = null; - onChanged(); - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig, - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder, - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder> - streamingConfigBuilder_; - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - * - * @return Whether the streamingConfig field is set. - */ - @java.lang.Override - public boolean hasStreamingConfig() { - return streamingRequestCase_ == 1; - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - * - * @return The streamingConfig. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig getStreamingConfig() { - if (streamingConfigBuilder_ == null) { - if (streamingRequestCase_ == 1) { - return (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_; - } - return com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } else { - if (streamingRequestCase_ == 1) { - return streamingConfigBuilder_.getMessage(); - } - return com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public Builder setStreamingConfig( - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig value) { - if (streamingConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - streamingRequest_ = value; - onChanged(); - } else { - streamingConfigBuilder_.setMessage(value); - } - streamingRequestCase_ = 1; - return this; - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public Builder setStreamingConfig( - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder builderForValue) { - if (streamingConfigBuilder_ == null) { - streamingRequest_ = builderForValue.build(); - onChanged(); - } else { - streamingConfigBuilder_.setMessage(builderForValue.build()); - } - streamingRequestCase_ = 1; - return this; - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public Builder mergeStreamingConfig( - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig value) { - if (streamingConfigBuilder_ == null) { - if (streamingRequestCase_ == 1 - && streamingRequest_ - != com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig - .getDefaultInstance()) { - streamingRequest_ = - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.newBuilder( - (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) - streamingRequest_) - .mergeFrom(value) - .buildPartial(); - } else { - streamingRequest_ = value; - } - onChanged(); - } else { - if (streamingRequestCase_ == 1) { - streamingConfigBuilder_.mergeFrom(value); - } - streamingConfigBuilder_.setMessage(value); - } - streamingRequestCase_ = 1; - return this; - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public Builder clearStreamingConfig() { - if (streamingConfigBuilder_ == null) { - if (streamingRequestCase_ == 1) { - streamingRequestCase_ = 0; - streamingRequest_ = null; - onChanged(); - } - } else { - if (streamingRequestCase_ == 1) { - streamingRequestCase_ = 0; - streamingRequest_ = null; - } - streamingConfigBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder - getStreamingConfigBuilder() { - return getStreamingConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder - getStreamingConfigOrBuilder() { - if ((streamingRequestCase_ == 1) && (streamingConfigBuilder_ != null)) { - return streamingConfigBuilder_.getMessageOrBuilder(); - } else { - if (streamingRequestCase_ == 1) { - return (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_; - } - return com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } - } - /** - * - * - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig, - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder, - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder> - getStreamingConfigFieldBuilder() { - if (streamingConfigBuilder_ == null) { - if (!(streamingRequestCase_ == 1)) { - streamingRequest_ = - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } - streamingConfigBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig, - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder, - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder>( - (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_, - getParentForChildren(), - isClean()); - streamingRequest_ = null; - } - streamingRequestCase_ = 1; - onChanged(); - ; - return streamingConfigBuilder_; - } - - /** - * - * - *
-     * The audio data to be recognized. Sequential chunks of audio data are sent
-     * in sequential `StreamingRecognizeRequest` messages. The first
-     * `StreamingRecognizeRequest` message must not contain `audio_content` data
-     * and all subsequent `StreamingRecognizeRequest` messages must contain
-     * `audio_content` data. The audio bytes must be encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation (not base64). See
-     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * 
- * - * bytes audio_content = 2; - * - * @return The audioContent. - */ - public com.google.protobuf.ByteString getAudioContent() { - if (streamingRequestCase_ == 2) { - return (com.google.protobuf.ByteString) streamingRequest_; - } - return com.google.protobuf.ByteString.EMPTY; - } - /** - * - * - *
-     * The audio data to be recognized. Sequential chunks of audio data are sent
-     * in sequential `StreamingRecognizeRequest` messages. The first
-     * `StreamingRecognizeRequest` message must not contain `audio_content` data
-     * and all subsequent `StreamingRecognizeRequest` messages must contain
-     * `audio_content` data. The audio bytes must be encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation (not base64). See
-     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * 
- * - * bytes audio_content = 2; - * - * @param value The audioContent to set. - * @return This builder for chaining. - */ - public Builder setAudioContent(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - streamingRequestCase_ = 2; - streamingRequest_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The audio data to be recognized. Sequential chunks of audio data are sent
-     * in sequential `StreamingRecognizeRequest` messages. The first
-     * `StreamingRecognizeRequest` message must not contain `audio_content` data
-     * and all subsequent `StreamingRecognizeRequest` messages must contain
-     * `audio_content` data. The audio bytes must be encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation (not base64). See
-     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * 
- * - * bytes audio_content = 2; - * - * @return This builder for chaining. - */ - public Builder clearAudioContent() { - if (streamingRequestCase_ == 2) { - streamingRequestCase_ = 0; - streamingRequest_ = null; - 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.StreamingRecognizeRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) - private static final com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest(); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StreamingRecognizeRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingRecognizeRequest(input, extensionRegistry); - } - }; - - 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.StreamingRecognizeRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequestOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequestOrBuilder.java deleted file mode 100644 index 280ddf8ec..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequestOrBuilder.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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 StreamingRecognizeRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - * - * @return Whether the streamingConfig field is set. - */ - boolean hasStreamingConfig(); - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - * - * @return The streamingConfig. - */ - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig getStreamingConfig(); - /** - * - * - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder - getStreamingConfigOrBuilder(); - - /** - * - * - *
-   * The audio data to be recognized. Sequential chunks of audio data are sent
-   * in sequential `StreamingRecognizeRequest` messages. The first
-   * `StreamingRecognizeRequest` message must not contain `audio_content` data
-   * and all subsequent `StreamingRecognizeRequest` messages must contain
-   * `audio_content` data. The audio bytes must be encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation (not base64). See
-   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * 
- * - * bytes audio_content = 2; - * - * @return The audioContent. - */ - com.google.protobuf.ByteString getAudioContent(); - - public com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.StreamingRequestCase - getStreamingRequestCase(); -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponse.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponse.java deleted file mode 100644 index 247307470..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponse.java +++ /dev/null @@ -1,1719 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * `StreamingRecognizeResponse` is the only message returned to the client by
- * `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse`
- * messages are streamed back to the client. If there is no recognizable
- * audio, and `single_utterance` is set to false, then no messages are streamed
- * back to the client.
- * Here's an example of a series of ten `StreamingRecognizeResponse`s that might
- * be returned while processing audio:
- * 1. results { alternatives { transcript: "tube" } stability: 0.01 }
- * 2. results { alternatives { transcript: "to be a" } stability: 0.01 }
- * 3. results { alternatives { transcript: "to be" } stability: 0.9 }
- *    results { alternatives { transcript: " or not to be" } stability: 0.01 }
- * 4. results { alternatives { transcript: "to be or not to be"
- *                             confidence: 0.92 }
- *              alternatives { transcript: "to bee or not to bee" }
- *              is_final: true }
- * 5. results { alternatives { transcript: " that's" } stability: 0.01 }
- * 6. results { alternatives { transcript: " that is" } stability: 0.9 }
- *    results { alternatives { transcript: " the question" } stability: 0.01 }
- * 7. results { alternatives { transcript: " that is the question"
- *                             confidence: 0.98 }
- *              alternatives { transcript: " that was the question" }
- *              is_final: true }
- * Notes:
- * - Only two of the above responses #4 and #7 contain final results; they are
- *   indicated by `is_final: true`. Concatenating these together generates the
- *   full transcript: "to be or not to be that is the question".
- * - The others contain interim `results`. #3 and #6 contain two interim
- *   `results`: the first portion has a high stability and is less likely to
- *   change; the second portion has a low stability and is very likely to
- *   change. A UI designer might choose to show only high stability `results`.
- * - The specific `stability` and `confidence` values shown above are only for
- *   illustrative purposes. Actual values may vary.
- * - In each response, only one of these fields will be set:
- *     `error`,
- *     `speech_event_type`, or
- *     one or more (repeated) `results`.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} - */ -public final class StreamingRecognizeResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) - StreamingRecognizeResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use StreamingRecognizeResponse.newBuilder() to construct. - private StreamingRecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private StreamingRecognizeResponse() { - results_ = java.util.Collections.emptyList(); - speechEventType_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new StreamingRecognizeResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private StreamingRecognizeResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.rpc.Status.Builder subBuilder = null; - if (error_ != null) { - subBuilder = error_.toBuilder(); - } - error_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(error_); - error_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = - new java.util.ArrayList< - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult>(); - mutable_bitField0_ |= 0x00000001; - } - results_.add( - input.readMessage( - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.parser(), - extensionRegistry)); - break; - } - case 32: - { - int rawValue = input.readEnum(); - - speechEventType_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.class, - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.Builder.class); - } - - /** - * - * - *
-   * Indicates the type of speech event.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType} - */ - public enum SpeechEventType implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * No speech event specified.
-     * 
- * - * SPEECH_EVENT_UNSPECIFIED = 0; - */ - SPEECH_EVENT_UNSPECIFIED(0), - /** - * - * - *
-     * This event indicates that the server has detected the end of the user's
-     * speech utterance and expects no additional speech. Therefore, the server
-     * will not process additional audio (although it may subsequently return
-     * additional results). The client should stop sending additional audio
-     * data, half-close the gRPC connection, and wait for any additional results
-     * until the server closes the gRPC connection. This event is only sent if
-     * `single_utterance` was set to `true`, and is not used otherwise.
-     * 
- * - * END_OF_SINGLE_UTTERANCE = 1; - */ - END_OF_SINGLE_UTTERANCE(1), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * No speech event specified.
-     * 
- * - * SPEECH_EVENT_UNSPECIFIED = 0; - */ - public static final int SPEECH_EVENT_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * This event indicates that the server has detected the end of the user's
-     * speech utterance and expects no additional speech. Therefore, the server
-     * will not process additional audio (although it may subsequently return
-     * additional results). The client should stop sending additional audio
-     * data, half-close the gRPC connection, and wait for any additional results
-     * until the server closes the gRPC connection. This event is only sent if
-     * `single_utterance` was set to `true`, and is not used otherwise.
-     * 
- * - * END_OF_SINGLE_UTTERANCE = 1; - */ - public static final int END_OF_SINGLE_UTTERANCE_VALUE = 1; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static SpeechEventType valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static SpeechEventType forNumber(int value) { - switch (value) { - case 0: - return SPEECH_EVENT_UNSPECIFIED; - case 1: - return END_OF_SINGLE_UTTERANCE; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public SpeechEventType findValueByNumber(int number) { - return SpeechEventType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.getDescriptor() - .getEnumTypes() - .get(0); - } - - private static final SpeechEventType[] VALUES = values(); - - public static SpeechEventType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private SpeechEventType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType) - } - - public static final int ERROR_FIELD_NUMBER = 1; - private com.google.rpc.Status error_; - /** - * - * - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - * - * @return Whether the error field is set. - */ - @java.lang.Override - public boolean hasError() { - return error_ != null; - } - /** - * - * - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - * - * @return The error. - */ - @java.lang.Override - public com.google.rpc.Status getError() { - return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; - } - /** - * - * - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - */ - @java.lang.Override - public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { - return getError(); - } - - public static final int RESULTS_FIELD_NUMBER = 2; - private java.util.List results_; - /** - * - * - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List - getResultsList() { - return results_; - } - /** - * - * - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List< - ? extends com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder> - getResultsOrBuilderList() { - return results_; - } - /** - * - * - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - @java.lang.Override - public int getResultsCount() { - return results_.size(); - } - /** - * - * - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult getResults(int index) { - return results_.get(index); - } - /** - * - * - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - return results_.get(index); - } - - public static final int SPEECH_EVENT_TYPE_FIELD_NUMBER = 4; - private int speechEventType_; - /** - * - * - *
-   * Indicates the type of speech event.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * - * - * @return The enum numeric value on the wire for speechEventType. - */ - @java.lang.Override - public int getSpeechEventTypeValue() { - return speechEventType_; - } - /** - * - * - *
-   * Indicates the type of speech event.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * - * - * @return The speechEventType. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType - getSpeechEventType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType result = - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType.valueOf( - speechEventType_); - return result == null - ? com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType.UNRECOGNIZED - : result; - } - - 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 (error_ != null) { - output.writeMessage(1, getError()); - } - for (int i = 0; i < results_.size(); i++) { - output.writeMessage(2, results_.get(i)); - } - if (speechEventType_ - != com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType - .SPEECH_EVENT_UNSPECIFIED - .getNumber()) { - output.writeEnum(4, speechEventType_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (error_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getError()); - } - for (int i = 0; i < results_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, results_.get(i)); - } - if (speechEventType_ - != com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType - .SPEECH_EVENT_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, speechEventType_); - } - size += unknownFields.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.StreamingRecognizeResponse)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse other = - (com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) obj; - - if (hasError() != other.hasError()) return false; - if (hasError()) { - if (!getError().equals(other.getError())) return false; - } - if (!getResultsList().equals(other.getResultsList())) return false; - if (speechEventType_ != other.speechEventType_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasError()) { - hash = (37 * hash) + ERROR_FIELD_NUMBER; - hash = (53 * hash) + getError().hashCode(); - } - if (getResultsCount() > 0) { - hash = (37 * hash) + RESULTS_FIELD_NUMBER; - hash = (53 * hash) + getResultsList().hashCode(); - } - hash = (37 * hash) + SPEECH_EVENT_TYPE_FIELD_NUMBER; - hash = (53 * hash) + speechEventType_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse 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.StreamingRecognizeResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse 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.StreamingRecognizeResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse 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.StreamingRecognizeResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse 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.StreamingRecognizeResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse 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.StreamingRecognizeResponse 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.StreamingRecognizeResponse 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.StreamingRecognizeResponse 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; - } - /** - * - * - *
-   * `StreamingRecognizeResponse` is the only message returned to the client by
-   * `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse`
-   * messages are streamed back to the client. If there is no recognizable
-   * audio, and `single_utterance` is set to false, then no messages are streamed
-   * back to the client.
-   * Here's an example of a series of ten `StreamingRecognizeResponse`s that might
-   * be returned while processing audio:
-   * 1. results { alternatives { transcript: "tube" } stability: 0.01 }
-   * 2. results { alternatives { transcript: "to be a" } stability: 0.01 }
-   * 3. results { alternatives { transcript: "to be" } stability: 0.9 }
-   *    results { alternatives { transcript: " or not to be" } stability: 0.01 }
-   * 4. results { alternatives { transcript: "to be or not to be"
-   *                             confidence: 0.92 }
-   *              alternatives { transcript: "to bee or not to bee" }
-   *              is_final: true }
-   * 5. results { alternatives { transcript: " that's" } stability: 0.01 }
-   * 6. results { alternatives { transcript: " that is" } stability: 0.9 }
-   *    results { alternatives { transcript: " the question" } stability: 0.01 }
-   * 7. results { alternatives { transcript: " that is the question"
-   *                             confidence: 0.98 }
-   *              alternatives { transcript: " that was the question" }
-   *              is_final: true }
-   * Notes:
-   * - Only two of the above responses #4 and #7 contain final results; they are
-   *   indicated by `is_final: true`. Concatenating these together generates the
-   *   full transcript: "to be or not to be that is the question".
-   * - The others contain interim `results`. #3 and #6 contain two interim
-   *   `results`: the first portion has a high stability and is less likely to
-   *   change; the second portion has a low stability and is very likely to
-   *   change. A UI designer might choose to show only high stability `results`.
-   * - The specific `stability` and `confidence` values shown above are only for
-   *   illustrative purposes. Actual values may vary.
-   * - In each response, only one of these fields will be set:
-   *     `error`,
-   *     `speech_event_type`, or
-   *     one or more (repeated) `results`.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.class, - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getResultsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (errorBuilder_ == null) { - error_ = null; - } else { - error_ = null; - errorBuilder_ = null; - } - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - resultsBuilder_.clear(); - } - speechEventType_ = 0; - - 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_StreamingRecognizeResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse - getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse build() { - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse buildPartial() { - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse result = - new com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse(this); - int from_bitField0_ = bitField0_; - if (errorBuilder_ == null) { - result.error_ = error_; - } else { - result.error_ = errorBuilder_.build(); - } - if (resultsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.results_ = results_; - } else { - result.results_ = resultsBuilder_.build(); - } - result.speechEventType_ = speechEventType_; - 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.StreamingRecognizeResponse) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse other) { - if (other - == com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.getDefaultInstance()) - return this; - if (other.hasError()) { - mergeError(other.getError()); - } - if (resultsBuilder_ == null) { - if (!other.results_.isEmpty()) { - if (results_.isEmpty()) { - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResultsIsMutable(); - results_.addAll(other.results_); - } - onChanged(); - } - } else { - if (!other.results_.isEmpty()) { - if (resultsBuilder_.isEmpty()) { - resultsBuilder_.dispose(); - resultsBuilder_ = null; - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - resultsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getResultsFieldBuilder() - : null; - } else { - resultsBuilder_.addAllMessages(other.results_); - } - } - } - if (other.speechEventType_ != 0) { - setSpeechEventTypeValue(other.getSpeechEventTypeValue()); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private com.google.rpc.Status error_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> - errorBuilder_; - /** - * - * - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - * - * @return Whether the error field is set. - */ - public boolean hasError() { - return errorBuilder_ != null || error_ != null; - } - /** - * - * - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - * - * @return The error. - */ - public com.google.rpc.Status getError() { - if (errorBuilder_ == null) { - return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; - } else { - return errorBuilder_.getMessage(); - } - } - /** - * - * - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public Builder setError(com.google.rpc.Status value) { - if (errorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - error_ = value; - onChanged(); - } else { - errorBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public Builder setError(com.google.rpc.Status.Builder builderForValue) { - if (errorBuilder_ == null) { - error_ = builderForValue.build(); - onChanged(); - } else { - errorBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public Builder mergeError(com.google.rpc.Status value) { - if (errorBuilder_ == null) { - if (error_ != null) { - error_ = com.google.rpc.Status.newBuilder(error_).mergeFrom(value).buildPartial(); - } else { - error_ = value; - } - onChanged(); - } else { - errorBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public Builder clearError() { - if (errorBuilder_ == null) { - error_ = null; - onChanged(); - } else { - error_ = null; - errorBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public com.google.rpc.Status.Builder getErrorBuilder() { - - onChanged(); - return getErrorFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { - if (errorBuilder_ != null) { - return errorBuilder_.getMessageOrBuilder(); - } else { - return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; - } - } - /** - * - * - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> - getErrorFieldBuilder() { - if (errorBuilder_ == null) { - errorBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, - com.google.rpc.Status.Builder, - com.google.rpc.StatusOrBuilder>(getError(), getParentForChildren(), isClean()); - error_ = null; - } - return errorBuilder_; - } - - private java.util.List results_ = - java.util.Collections.emptyList(); - - private void ensureResultsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - results_ = - new java.util.ArrayList( - results_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult, - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder, - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder> - resultsBuilder_; - - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public java.util.List - getResultsList() { - if (resultsBuilder_ == null) { - return java.util.Collections.unmodifiableList(results_); - } else { - return resultsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public int getResultsCount() { - if (resultsBuilder_ == null) { - return results_.size(); - } else { - return resultsBuilder_.getCount(); - } - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult getResults(int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.set(index, value); - onChanged(); - } else { - resultsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public Builder setResults( - int index, - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.set(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public Builder addResults(com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(value); - onChanged(); - } else { - resultsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(index, value); - onChanged(); - } else { - resultsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public Builder addResults( - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public Builder addResults( - int index, - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public Builder addAllResults( - java.lang.Iterable - values) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); - onChanged(); - } else { - resultsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public Builder clearResults() { - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - resultsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public Builder removeResults(int index) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.remove(index); - onChanged(); - } else { - resultsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder getResultsBuilder( - int index) { - return getResultsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder - getResultsOrBuilder(int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public java.util.List< - ? extends com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder> - getResultsOrBuilderList() { - if (resultsBuilder_ != null) { - return resultsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(results_); - } - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder - addResultsBuilder() { - return getResultsFieldBuilder() - .addBuilder( - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.getDefaultInstance()); - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder addResultsBuilder( - int index) { - return getResultsFieldBuilder() - .addBuilder( - index, - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.getDefaultInstance()); - } - /** - * - * - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public java.util.List - getResultsBuilderList() { - return getResultsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult, - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder, - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder> - getResultsFieldBuilder() { - if (resultsBuilder_ == null) { - resultsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult, - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder, - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder>( - results_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - results_ = null; - } - return resultsBuilder_; - } - - private int speechEventType_ = 0; - /** - * - * - *
-     * Indicates the type of speech event.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * - * - * @return The enum numeric value on the wire for speechEventType. - */ - @java.lang.Override - public int getSpeechEventTypeValue() { - return speechEventType_; - } - /** - * - * - *
-     * Indicates the type of speech event.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * - * - * @param value The enum numeric value on the wire for speechEventType to set. - * @return This builder for chaining. - */ - public Builder setSpeechEventTypeValue(int value) { - - speechEventType_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Indicates the type of speech event.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * - * - * @return The speechEventType. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType - getSpeechEventType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType result = - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType.valueOf( - speechEventType_); - return result == null - ? com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType - .UNRECOGNIZED - : result; - } - /** - * - * - *
-     * Indicates the type of speech event.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * - * - * @param value The speechEventType to set. - * @return This builder for chaining. - */ - public Builder setSpeechEventType( - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType value) { - if (value == null) { - throw new NullPointerException(); - } - - speechEventType_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * Indicates the type of speech event.
-     * 
- * - * - * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * - * - * @return This builder for chaining. - */ - public Builder clearSpeechEventType() { - - speechEventType_ = 0; - 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.StreamingRecognizeResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) - private static final com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse(); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StreamingRecognizeResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingRecognizeResponse(input, extensionRegistry); - } - }; - - 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.StreamingRecognizeResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponseOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponseOrBuilder.java deleted file mode 100644 index 10147ad4e..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponseOrBuilder.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * 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 StreamingRecognizeResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - * - * @return Whether the error field is set. - */ - boolean hasError(); - /** - * - * - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - * - * @return The error. - */ - com.google.rpc.Status getError(); - /** - * - * - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - */ - com.google.rpc.StatusOrBuilder getErrorOrBuilder(); - - /** - * - * - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - java.util.List getResultsList(); - /** - * - * - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult getResults(int index); - /** - * - * - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - int getResultsCount(); - /** - * - * - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - java.util.List - getResultsOrBuilderList(); - /** - * - * - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder getResultsOrBuilder( - int index); - - /** - * - * - *
-   * Indicates the type of speech event.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * - * - * @return The enum numeric value on the wire for speechEventType. - */ - int getSpeechEventTypeValue(); - /** - * - * - *
-   * Indicates the type of speech event.
-   * 
- * - * - * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * - * - * @return The speechEventType. - */ - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType getSpeechEventType(); -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfo.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfo.java deleted file mode 100644 index d89ddacde..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfo.java +++ /dev/null @@ -1,1511 +0,0 @@ -/* - * 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; - -/** - * - * - *
- * Word-specific information for recognized words.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.WordInfo} - */ -public final class WordInfo extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.WordInfo) - WordInfoOrBuilder { - private static final long serialVersionUID = 0L; - // Use WordInfo.newBuilder() to construct. - private WordInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private WordInfo() { - word_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new WordInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private WordInfo( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.protobuf.Duration.Builder subBuilder = null; - if (startTime_ != null) { - subBuilder = startTime_.toBuilder(); - } - startTime_ = - input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(startTime_); - startTime_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.protobuf.Duration.Builder subBuilder = null; - if (endTime_ != null) { - subBuilder = endTime_.toBuilder(); - } - endTime_ = - input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(endTime_); - endTime_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - word_ = s; - break; - } - case 37: - { - confidence_ = input.readFloat(); - break; - } - case 40: - { - speakerTag_ = input.readInt32(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_WordInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_WordInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.WordInfo.class, - com.google.cloud.speech.v1p1beta1.WordInfo.Builder.class); - } - - public static final int START_TIME_FIELD_NUMBER = 1; - private com.google.protobuf.Duration startTime_; - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - * - * @return Whether the startTime field is set. - */ - @java.lang.Override - public boolean hasStartTime() { - return startTime_ != null; - } - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - * - * @return The startTime. - */ - @java.lang.Override - public com.google.protobuf.Duration getStartTime() { - return startTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startTime_; - } - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder() { - return getStartTime(); - } - - public static final int END_TIME_FIELD_NUMBER = 2; - private com.google.protobuf.Duration endTime_; - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - * - * @return Whether the endTime field is set. - */ - @java.lang.Override - public boolean hasEndTime() { - return endTime_ != null; - } - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - * - * @return The endTime. - */ - @java.lang.Override - public com.google.protobuf.Duration getEndTime() { - return endTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endTime_; - } - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder() { - return getEndTime(); - } - - public static final int WORD_FIELD_NUMBER = 3; - private volatile java.lang.Object word_; - /** - * - * - *
-   * The word corresponding to this set of information.
-   * 
- * - * string word = 3; - * - * @return The word. - */ - @java.lang.Override - public java.lang.String getWord() { - java.lang.Object ref = word_; - 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(); - word_ = s; - return s; - } - } - /** - * - * - *
-   * The word corresponding to this set of information.
-   * 
- * - * string word = 3; - * - * @return The bytes for word. - */ - @java.lang.Override - public com.google.protobuf.ByteString getWordBytes() { - java.lang.Object ref = word_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - word_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONFIDENCE_FIELD_NUMBER = 4; - private float confidence_; - /** - * - * - *
-   * The confidence estimate between 0.0 and 1.0. A higher number
-   * indicates an estimated greater likelihood that the recognized words are
-   * correct. This field is set only for the top alternative of a non-streaming
-   * result or, of a streaming result where `is_final=true`.
-   * This field is not guaranteed to be accurate and users should not rely on it
-   * to be always provided.
-   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-   * 
- * - * float confidence = 4; - * - * @return The confidence. - */ - @java.lang.Override - public float getConfidence() { - return confidence_; - } - - public static final int SPEAKER_TAG_FIELD_NUMBER = 5; - private int speakerTag_; - /** - * - * - *
-   * Output only. A distinct integer value is assigned for every speaker within
-   * the audio. This field specifies which one of those speakers was detected to
-   * have spoken this word. Value ranges from '1' to diarization_speaker_count.
-   * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
-   * top alternative.
-   * 
- * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The speakerTag. - */ - @java.lang.Override - public int getSpeakerTag() { - return speakerTag_; - } - - 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 (startTime_ != null) { - output.writeMessage(1, getStartTime()); - } - if (endTime_ != null) { - output.writeMessage(2, getEndTime()); - } - if (!getWordBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, word_); - } - if (confidence_ != 0F) { - output.writeFloat(4, confidence_); - } - if (speakerTag_ != 0) { - output.writeInt32(5, speakerTag_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (startTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStartTime()); - } - if (endTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); - } - if (!getWordBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, word_); - } - if (confidence_ != 0F) { - size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, confidence_); - } - if (speakerTag_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, speakerTag_); - } - size += unknownFields.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.WordInfo)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.WordInfo other = - (com.google.cloud.speech.v1p1beta1.WordInfo) obj; - - if (hasStartTime() != other.hasStartTime()) return false; - if (hasStartTime()) { - if (!getStartTime().equals(other.getStartTime())) return false; - } - if (hasEndTime() != other.hasEndTime()) return false; - if (hasEndTime()) { - if (!getEndTime().equals(other.getEndTime())) return false; - } - if (!getWord().equals(other.getWord())) return false; - if (java.lang.Float.floatToIntBits(getConfidence()) - != java.lang.Float.floatToIntBits(other.getConfidence())) return false; - if (getSpeakerTag() != other.getSpeakerTag()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasStartTime()) { - hash = (37 * hash) + START_TIME_FIELD_NUMBER; - hash = (53 * hash) + getStartTime().hashCode(); - } - if (hasEndTime()) { - hash = (37 * hash) + END_TIME_FIELD_NUMBER; - hash = (53 * hash) + getEndTime().hashCode(); - } - hash = (37 * hash) + WORD_FIELD_NUMBER; - hash = (53 * hash) + getWord().hashCode(); - hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidence()); - hash = (37 * hash) + SPEAKER_TAG_FIELD_NUMBER; - hash = (53 * hash) + getSpeakerTag(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.WordInfo 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.WordInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.WordInfo 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.WordInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.speech.v1p1beta1.WordInfo 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.WordInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.WordInfo 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.WordInfo parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.speech.v1p1beta1.WordInfo 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.WordInfo 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.WordInfo 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.WordInfo 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; - } - /** - * - * - *
-   * Word-specific information for recognized words.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.WordInfo} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.WordInfo) - com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_WordInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto - .internal_static_google_cloud_speech_v1p1beta1_WordInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.WordInfo.class, - com.google.cloud.speech.v1p1beta1.WordInfo.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.WordInfo.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (startTimeBuilder_ == null) { - startTime_ = null; - } else { - startTime_ = null; - startTimeBuilder_ = null; - } - if (endTimeBuilder_ == null) { - endTime_ = null; - } else { - endTime_ = null; - endTimeBuilder_ = null; - } - word_ = ""; - - confidence_ = 0F; - - speakerTag_ = 0; - - 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_WordInfo_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.WordInfo getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.WordInfo.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.WordInfo build() { - com.google.cloud.speech.v1p1beta1.WordInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.WordInfo buildPartial() { - com.google.cloud.speech.v1p1beta1.WordInfo result = - new com.google.cloud.speech.v1p1beta1.WordInfo(this); - if (startTimeBuilder_ == null) { - result.startTime_ = startTime_; - } else { - result.startTime_ = startTimeBuilder_.build(); - } - if (endTimeBuilder_ == null) { - result.endTime_ = endTime_; - } else { - result.endTime_ = endTimeBuilder_.build(); - } - result.word_ = word_; - result.confidence_ = confidence_; - result.speakerTag_ = speakerTag_; - 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.WordInfo) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.WordInfo) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.WordInfo other) { - if (other == com.google.cloud.speech.v1p1beta1.WordInfo.getDefaultInstance()) return this; - if (other.hasStartTime()) { - mergeStartTime(other.getStartTime()); - } - if (other.hasEndTime()) { - mergeEndTime(other.getEndTime()); - } - if (!other.getWord().isEmpty()) { - word_ = other.word_; - onChanged(); - } - if (other.getConfidence() != 0F) { - setConfidence(other.getConfidence()); - } - if (other.getSpeakerTag() != 0) { - setSpeakerTag(other.getSpeakerTag()); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.cloud.speech.v1p1beta1.WordInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.WordInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.protobuf.Duration startTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - startTimeBuilder_; - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - * - * @return Whether the startTime field is set. - */ - public boolean hasStartTime() { - return startTimeBuilder_ != null || startTime_ != null; - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - * - * @return The startTime. - */ - public com.google.protobuf.Duration getStartTime() { - if (startTimeBuilder_ == null) { - return startTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startTime_; - } else { - return startTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public Builder setStartTime(com.google.protobuf.Duration value) { - if (startTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - startTime_ = value; - onChanged(); - } else { - startTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public Builder setStartTime(com.google.protobuf.Duration.Builder builderForValue) { - if (startTimeBuilder_ == null) { - startTime_ = builderForValue.build(); - onChanged(); - } else { - startTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public Builder mergeStartTime(com.google.protobuf.Duration value) { - if (startTimeBuilder_ == null) { - if (startTime_ != null) { - startTime_ = - com.google.protobuf.Duration.newBuilder(startTime_).mergeFrom(value).buildPartial(); - } else { - startTime_ = value; - } - onChanged(); - } else { - startTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public Builder clearStartTime() { - if (startTimeBuilder_ == null) { - startTime_ = null; - onChanged(); - } else { - startTime_ = null; - startTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public com.google.protobuf.Duration.Builder getStartTimeBuilder() { - - onChanged(); - return getStartTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder() { - if (startTimeBuilder_ != null) { - return startTimeBuilder_.getMessageOrBuilder(); - } else { - return startTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startTime_; - } - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - getStartTimeFieldBuilder() { - if (startTimeBuilder_ == null) { - startTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder>( - getStartTime(), getParentForChildren(), isClean()); - startTime_ = null; - } - return startTimeBuilder_; - } - - private com.google.protobuf.Duration endTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - endTimeBuilder_; - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - * - * @return Whether the endTime field is set. - */ - public boolean hasEndTime() { - return endTimeBuilder_ != null || endTime_ != null; - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - * - * @return The endTime. - */ - public com.google.protobuf.Duration getEndTime() { - if (endTimeBuilder_ == null) { - return endTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endTime_; - } else { - return endTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public Builder setEndTime(com.google.protobuf.Duration value) { - if (endTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - endTime_ = value; - onChanged(); - } else { - endTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public Builder setEndTime(com.google.protobuf.Duration.Builder builderForValue) { - if (endTimeBuilder_ == null) { - endTime_ = builderForValue.build(); - onChanged(); - } else { - endTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public Builder mergeEndTime(com.google.protobuf.Duration value) { - if (endTimeBuilder_ == null) { - if (endTime_ != null) { - endTime_ = - com.google.protobuf.Duration.newBuilder(endTime_).mergeFrom(value).buildPartial(); - } else { - endTime_ = value; - } - onChanged(); - } else { - endTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public Builder clearEndTime() { - if (endTimeBuilder_ == null) { - endTime_ = null; - onChanged(); - } else { - endTime_ = null; - endTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public com.google.protobuf.Duration.Builder getEndTimeBuilder() { - - onChanged(); - return getEndTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder() { - if (endTimeBuilder_ != null) { - return endTimeBuilder_.getMessageOrBuilder(); - } else { - return endTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endTime_; - } - } - /** - * - * - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - getEndTimeFieldBuilder() { - if (endTimeBuilder_ == null) { - endTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder>( - getEndTime(), getParentForChildren(), isClean()); - endTime_ = null; - } - return endTimeBuilder_; - } - - private java.lang.Object word_ = ""; - /** - * - * - *
-     * The word corresponding to this set of information.
-     * 
- * - * string word = 3; - * - * @return The word. - */ - public java.lang.String getWord() { - java.lang.Object ref = word_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - word_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The word corresponding to this set of information.
-     * 
- * - * string word = 3; - * - * @return The bytes for word. - */ - public com.google.protobuf.ByteString getWordBytes() { - java.lang.Object ref = word_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - word_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The word corresponding to this set of information.
-     * 
- * - * string word = 3; - * - * @param value The word to set. - * @return This builder for chaining. - */ - public Builder setWord(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - word_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The word corresponding to this set of information.
-     * 
- * - * string word = 3; - * - * @return This builder for chaining. - */ - public Builder clearWord() { - - word_ = getDefaultInstance().getWord(); - onChanged(); - return this; - } - /** - * - * - *
-     * The word corresponding to this set of information.
-     * 
- * - * string word = 3; - * - * @param value The bytes for word to set. - * @return This builder for chaining. - */ - public Builder setWordBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - word_ = value; - onChanged(); - return this; - } - - private float confidence_; - /** - * - * - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 4; - * - * @return The confidence. - */ - @java.lang.Override - public float getConfidence() { - return confidence_; - } - /** - * - * - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 4; - * - * @param value The confidence to set. - * @return This builder for chaining. - */ - public Builder setConfidence(float value) { - - confidence_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 4; - * - * @return This builder for chaining. - */ - public Builder clearConfidence() { - - confidence_ = 0F; - onChanged(); - return this; - } - - private int speakerTag_; - /** - * - * - *
-     * Output only. A distinct integer value is assigned for every speaker within
-     * the audio. This field specifies which one of those speakers was detected to
-     * have spoken this word. Value ranges from '1' to diarization_speaker_count.
-     * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
-     * top alternative.
-     * 
- * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The speakerTag. - */ - @java.lang.Override - public int getSpeakerTag() { - return speakerTag_; - } - /** - * - * - *
-     * Output only. A distinct integer value is assigned for every speaker within
-     * the audio. This field specifies which one of those speakers was detected to
-     * have spoken this word. Value ranges from '1' to diarization_speaker_count.
-     * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
-     * top alternative.
-     * 
- * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The speakerTag to set. - * @return This builder for chaining. - */ - public Builder setSpeakerTag(int value) { - - speakerTag_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. A distinct integer value is assigned for every speaker within
-     * the audio. This field specifies which one of those speakers was detected to
-     * have spoken this word. Value ranges from '1' to diarization_speaker_count.
-     * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
-     * top alternative.
-     * 
- * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return This builder for chaining. - */ - public Builder clearSpeakerTag() { - - speakerTag_ = 0; - 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.WordInfo) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.WordInfo) - private static final com.google.cloud.speech.v1p1beta1.WordInfo DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.WordInfo(); - } - - public static com.google.cloud.speech.v1p1beta1.WordInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public WordInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new WordInfo(input, extensionRegistry); - } - }; - - 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.WordInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfoOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfoOrBuilder.java deleted file mode 100644 index 0bdb11ab4..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfoOrBuilder.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * 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 WordInfoOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.WordInfo) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - * - * @return Whether the startTime field is set. - */ - boolean hasStartTime(); - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - * - * @return The startTime. - */ - com.google.protobuf.Duration getStartTime(); - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - */ - com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder(); - - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - * - * @return Whether the endTime field is set. - */ - boolean hasEndTime(); - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - * - * @return The endTime. - */ - com.google.protobuf.Duration getEndTime(); - /** - * - * - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - */ - com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder(); - - /** - * - * - *
-   * The word corresponding to this set of information.
-   * 
- * - * string word = 3; - * - * @return The word. - */ - java.lang.String getWord(); - /** - * - * - *
-   * The word corresponding to this set of information.
-   * 
- * - * string word = 3; - * - * @return The bytes for word. - */ - com.google.protobuf.ByteString getWordBytes(); - - /** - * - * - *
-   * The confidence estimate between 0.0 and 1.0. A higher number
-   * indicates an estimated greater likelihood that the recognized words are
-   * correct. This field is set only for the top alternative of a non-streaming
-   * result or, of a streaming result where `is_final=true`.
-   * This field is not guaranteed to be accurate and users should not rely on it
-   * to be always provided.
-   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-   * 
- * - * float confidence = 4; - * - * @return The confidence. - */ - float getConfidence(); - - /** - * - * - *
-   * Output only. A distinct integer value is assigned for every speaker within
-   * the audio. This field specifies which one of those speakers was detected to
-   * have spoken this word. Value ranges from '1' to diarization_speaker_count.
-   * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
-   * top alternative.
-   * 
- * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The speakerTag. - */ - int getSpeakerTag(); -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto b/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto deleted file mode 100644 index 7bb12866b..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto +++ /dev/null @@ -1,835 +0,0 @@ -// 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 -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.speech.v1p1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/speech/v1p1beta1/resource.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/speech/v1p1beta1;speech"; -option java_multiple_files = true; -option java_outer_classname = "SpeechProto"; -option java_package = "com.google.cloud.speech.v1p1beta1"; -option objc_class_prefix = "GCS"; - -// Service that implements Google Cloud Speech API. -service Speech { - option (google.api.default_host) = "speech.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Performs synchronous speech recognition: receive results after all audio - // has been sent and processed. - rpc Recognize(RecognizeRequest) returns (RecognizeResponse) { - option (google.api.http) = { - post: "/v1p1beta1/speech:recognize" - body: "*" - }; - option (google.api.method_signature) = "config,audio"; - } - - // Performs asynchronous speech recognition: receive results via the - // google.longrunning.Operations interface. Returns either an - // `Operation.error` or an `Operation.response` which contains - // a `LongRunningRecognizeResponse` message. - // For more information on asynchronous speech recognition, see the - // [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - rpc LongRunningRecognize(LongRunningRecognizeRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1p1beta1/speech:longrunningrecognize" - body: "*" - }; - option (google.api.method_signature) = "config,audio"; - option (google.longrunning.operation_info) = { - response_type: "LongRunningRecognizeResponse" - metadata_type: "LongRunningRecognizeMetadata" - }; - } - - // Performs bidirectional streaming speech recognition: receive results while - // sending audio. This method is only available via the gRPC API (not REST). - rpc StreamingRecognize(stream StreamingRecognizeRequest) - returns (stream StreamingRecognizeResponse) {} -} - -// The top-level message sent by the client for the `Recognize` method. -message RecognizeRequest { - // Required. Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The audio data to be recognized. - RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The top-level message sent by the client for the `LongRunningRecognize` -// method. -message LongRunningRecognizeRequest { - // Required. Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The audio data to be recognized. - RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The top-level message sent by the client for the `StreamingRecognize` method. -// Multiple `StreamingRecognizeRequest` messages are sent. The first message -// must contain a `streaming_config` message and must not contain -// `audio_content`. All subsequent messages must contain `audio_content` and -// must not contain a `streaming_config` message. -message StreamingRecognizeRequest { - // The streaming request, which is either a streaming config or audio content. - oneof streaming_request { - // Provides information to the recognizer that specifies how to process the - // request. The first `StreamingRecognizeRequest` message must contain a - // `streaming_config` message. - StreamingRecognitionConfig streaming_config = 1; - - // The audio data to be recognized. Sequential chunks of audio data are sent - // in sequential `StreamingRecognizeRequest` messages. The first - // `StreamingRecognizeRequest` message must not contain `audio_content` data - // and all subsequent `StreamingRecognizeRequest` messages must contain - // `audio_content` data. The audio bytes must be encoded as specified in - // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a - // pure binary representation (not base64). See - // [content limits](https://cloud.google.com/speech-to-text/quotas#content). - bytes audio_content = 2; - } -} - -// Provides information to the recognizer that specifies how to process the -// request. -message StreamingRecognitionConfig { - // Required. Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; - - // If `false` or omitted, the recognizer will perform continuous - // recognition (continuing to wait for and process audio even if the user - // pauses speaking) until the client closes the input stream (gRPC API) or - // until the maximum time limit has been reached. May return multiple - // `StreamingRecognitionResult`s with the `is_final` flag set to `true`. - // - // If `true`, the recognizer will detect a single spoken utterance. When it - // detects that the user has paused or stopped speaking, it will return an - // `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no - // more than one `StreamingRecognitionResult` with the `is_final` flag set to - // `true`. - bool single_utterance = 2; - - // If `true`, interim results (tentative hypotheses) may be - // returned as they become available (these interim results are indicated with - // the `is_final=false` flag). - // If `false` or omitted, only `is_final=true` result(s) are returned. - bool interim_results = 3; -} - -// Provides information to the recognizer that specifies how to process the -// request. -message RecognitionConfig { - // The encoding of the audio data sent in the request. - // - // All encodings support only 1 channel (mono) audio, unless the - // `audio_channel_count` and `enable_separate_recognition_per_channel` fields - // are set. - // - // For best results, the audio source should be captured and transmitted using - // a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech - // recognition can be reduced if lossy codecs are used to capture or transmit - // audio, particularly if background noise is present. Lossy codecs include - // `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, and `MP3`. - // - // The `FLAC` and `WAV` audio file formats include a header that describes the - // included audio content. You can request recognition for `WAV` files that - // contain either `LINEAR16` or `MULAW` encoded audio. - // If you send `FLAC` or `WAV` audio file format in - // your request, you do not need to specify an `AudioEncoding`; the audio - // encoding format is determined from the file header. If you specify - // an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the - // encoding configuration must match the encoding described in the audio - // header; otherwise the request returns an - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error - // code. - enum AudioEncoding { - // Not specified. - ENCODING_UNSPECIFIED = 0; - - // Uncompressed 16-bit signed little-endian samples (Linear PCM). - LINEAR16 = 1; - - // `FLAC` (Free Lossless Audio - // Codec) is the recommended encoding because it is - // lossless--therefore recognition is not compromised--and - // requires only about half the bandwidth of `LINEAR16`. `FLAC` stream - // encoding supports 16-bit and 24-bit samples, however, not all fields in - // `STREAMINFO` are supported. - FLAC = 2; - - // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. - MULAW = 3; - - // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. - AMR = 4; - - // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. - AMR_WB = 5; - - // Opus encoded audio frames in Ogg container - // ([OggOpus](https://wiki.xiph.org/OggOpus)). - // `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000. - OGG_OPUS = 6; - - // Although the use of lossy encodings is not recommended, if a very low - // bitrate encoding is required, `OGG_OPUS` is highly preferred over - // Speex encoding. The [Speex](https://speex.org/) encoding supported by - // Cloud Speech API has a header byte in each block, as in MIME type - // `audio/x-speex-with-header-byte`. - // It is a variant of the RTP Speex encoding defined in - // [RFC 5574](https://tools.ietf.org/html/rfc5574). - // The stream is a sequence of blocks, one block per RTP packet. Each block - // starts with a byte containing the length of the block, in bytes, followed - // by one or more frames of Speex data, padded to an integral number of - // bytes (octets) as specified in RFC 5574. In other words, each RTP header - // is replaced with a single byte containing the block length. Only Speex - // wideband is supported. `sample_rate_hertz` must be 16000. - SPEEX_WITH_HEADER_BYTE = 7; - - // MP3 audio. Support all standard MP3 bitrates (which range from 32-320 - // kbps). When using this encoding, `sample_rate_hertz` has to match the - // sample rate of the file being used. - MP3 = 8; - } - - // Encoding of audio data sent in all `RecognitionAudio` messages. - // This field is optional for `FLAC` and `WAV` audio files and required - // for all other audio formats. For details, see - // [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding]. - AudioEncoding encoding = 1; - - // Sample rate in Hertz of the audio data sent in all - // `RecognitionAudio` messages. Valid values are: 8000-48000. - // 16000 is optimal. For best results, set the sampling rate of the audio - // source to 16000 Hz. If that's not possible, use the native sample rate of - // the audio source (instead of re-sampling). - // This field is optional for FLAC and WAV audio files, but is - // required for all other audio formats. For details, see - // [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding]. - int32 sample_rate_hertz = 2; - - // 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 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. - // To perform independent recognition on each channel set - // `enable_separate_recognition_per_channel` to 'true'. - int32 audio_channel_count = 7; - - // This needs to be set to `true` explicitly and `audio_channel_count` > 1 - // to get each channel recognized separately. The recognition result will - // contain a `channel_tag` field to state which channel that result belongs - // to. If this is not true, we will only recognize the first channel. The - // request is billed cumulatively for all channels recognized: - // `audio_channel_count` multiplied by the length of the audio. - bool enable_separate_recognition_per_channel = 12; - - // Required. The language of the supplied audio as a - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - // Example: "en-US". - // See [Language - // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list - // of the currently supported language codes. - string language_code = 3 [(google.api.field_behavior) = REQUIRED]; - - // A list of up to 3 additional - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags, - // listing possible alternative languages of the supplied audio. - // See [Language - // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list - // of the currently supported language codes. If alternative languages are - // listed, recognition result will contain recognition in the most likely - // language detected including the main language_code. The recognition result - // will include the language tag of the language detected in the audio. Note: - // This feature is only supported for Voice Command and Voice Search use cases - // and performance may vary for other use cases (e.g., phone call - // transcription). - repeated string alternative_language_codes = 18; - - // Maximum number of recognition hypotheses to be returned. - // Specifically, the maximum number of `SpeechRecognitionAlternative` messages - // within each `SpeechRecognitionResult`. - // The server may return fewer than `max_alternatives`. - // Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of - // one. If omitted, will return a maximum of one. - int32 max_alternatives = 4; - - // If set to `true`, the server will attempt to filter out - // profanities, replacing all but the initial character in each filtered word - // with asterisks, e.g. "f***". If set to `false` or omitted, profanities - // won't be filtered out. - bool profanity_filter = 5; - - // Speech adaptation configuration improves the accuracy of speech - // recognition. When speech adaptation is set it supersedes the - // `speech_contexts` field. For more information, see the [speech - // adaptation](https://cloud.google.com/speech-to-text/docs/context-strength) - // documentation. - SpeechAdaptation adaptation = 20; - - // Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext]. - // A means to provide context to assist the speech recognition. For more - // information, see - // [speech - // adaptation](https://cloud.google.com/speech-to-text/docs/context-strength). - repeated SpeechContext speech_contexts = 6; - - // If `true`, the top result includes a list of words and - // the start and end time offsets (timestamps) for those words. If - // `false`, no word-level time offset information is returned. The default is - // `false`. - bool enable_word_time_offsets = 8; - - // If `true`, the top result includes a list of words and the - // confidence for those words. If `false`, no word-level confidence - // information is returned. The default is `false`. - bool enable_word_confidence = 15; - - // If 'true', adds punctuation to recognition result hypotheses. - // This feature is only available in select languages. Setting this for - // requests in other languages has no effect at all. - // The default 'false' value does not add punctuation to result hypotheses. - bool enable_automatic_punctuation = 11; - - // If 'true', enables speaker detection for each recognized word in - // the top alternative of the recognition result using a speaker_tag provided - // in the WordInfo. - // Note: Use diarization_config instead. - bool enable_speaker_diarization = 16 [deprecated = true]; - - // If set, specifies the estimated number of speakers in the conversation. - // Defaults to '2'. Ignored unless enable_speaker_diarization is set to true. - // Note: Use diarization_config instead. - int32 diarization_speaker_count = 17 [deprecated = true]; - - // Config to enable speaker diarization and set additional - // parameters to make diarization better suited for your application. - // Note: When this is enabled, we send all the words from the beginning of the - // audio for the top alternative in every consecutive STREAMING responses. - // This is done in order to improve our speaker tags as our models learn to - // identify the speakers in the conversation over time. - // For non-streaming requests, the diarization results will be provided only - // in the top alternative of the FINAL SpeechRecognitionResult. - SpeakerDiarizationConfig diarization_config = 19; - - // Metadata regarding this request. - RecognitionMetadata metadata = 9; - - // Which model to select for the given request. Select the model - // best suited to your domain to get best results. If a model is not - // explicitly specified, then we auto-select a model based on the parameters - // in the RecognitionConfig. - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - //
ModelDescription
command_and_searchBest for short queries such as voice commands or voice search.
phone_callBest for audio that originated from a phone call (typically - // recorded at an 8khz sampling rate).
videoBest for audio that originated from from video or includes multiple - // speakers. Ideally the audio is recorded at a 16khz or greater - // sampling rate. This is a premium model that costs more than the - // standard rate.
defaultBest for audio that is not one of the specific audio models. - // For example, long-form audio. Ideally the audio is high-fidelity, - // recorded at a 16khz or greater sampling rate.
- string model = 13; - - // Set to true to use an enhanced model for speech recognition. - // If `use_enhanced` is set to true and the `model` field is not set, then - // an appropriate enhanced model is chosen if an enhanced model exists for - // the audio. - // - // If `use_enhanced` is true and an enhanced version of the specified model - // does not exist, then the speech is recognized using the standard version - // of the specified model. - bool use_enhanced = 14; -} - -// Config to enable speaker diarization. -message SpeakerDiarizationConfig { - // If 'true', enables speaker detection for each recognized word in - // the top alternative of the recognition result using a speaker_tag provided - // in the WordInfo. - bool enable_speaker_diarization = 1; - - // Minimum number of speakers in the conversation. This range gives you more - // flexibility by allowing the system to automatically determine the correct - // number of speakers. If not set, the default value is 2. - int32 min_speaker_count = 2; - - // Maximum number of speakers in the conversation. This range gives you more - // flexibility by allowing the system to automatically determine the correct - // number of speakers. If not set, the default value is 6. - int32 max_speaker_count = 3; - - // Output only. Unused. - int32 speaker_tag = 5 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Description of audio data to be recognized. -message RecognitionMetadata { - // Use case categories that the audio recognition request can be described - // by. - enum InteractionType { - // Use case is either unknown or is something other than one of the other - // values below. - INTERACTION_TYPE_UNSPECIFIED = 0; - - // Multiple people in a conversation or discussion. For example in a - // meeting with two or more people actively participating. Typically - // all the primary people speaking would be in the same room (if not, - // see PHONE_CALL) - DISCUSSION = 1; - - // One or more persons lecturing or presenting to others, mostly - // uninterrupted. - PRESENTATION = 2; - - // A phone-call or video-conference in which two or more people, who are - // not in the same room, are actively participating. - PHONE_CALL = 3; - - // A recorded message intended for another person to listen to. - VOICEMAIL = 4; - - // Professionally produced audio (eg. TV Show, Podcast). - PROFESSIONALLY_PRODUCED = 5; - - // Transcribe spoken questions and queries into text. - VOICE_SEARCH = 6; - - // Transcribe voice commands, such as for controlling a device. - VOICE_COMMAND = 7; - - // Transcribe speech to text to create a written document, such as a - // text-message, email or report. - DICTATION = 8; - } - - // Enumerates the types of capture settings describing an audio file. - enum MicrophoneDistance { - // Audio type is not known. - MICROPHONE_DISTANCE_UNSPECIFIED = 0; - - // The audio was captured from a closely placed microphone. Eg. phone, - // dictaphone, or handheld microphone. Generally if there speaker is within - // 1 meter of the microphone. - NEARFIELD = 1; - - // The speaker if within 3 meters of the microphone. - MIDFIELD = 2; - - // The speaker is more than 3 meters away from the microphone. - FARFIELD = 3; - } - - // The original media the speech was recorded on. - enum OriginalMediaType { - // Unknown original media type. - ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; - - // The speech data is an audio recording. - AUDIO = 1; - - // The speech data originally recorded on a video. - VIDEO = 2; - } - - // The type of device the speech was recorded with. - enum RecordingDeviceType { - // The recording device is unknown. - RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; - - // Speech was recorded on a smartphone. - SMARTPHONE = 1; - - // Speech was recorded using a personal computer or tablet. - PC = 2; - - // Speech was recorded over a phone line. - PHONE_LINE = 3; - - // Speech was recorded in a vehicle. - VEHICLE = 4; - - // Speech was recorded outdoors. - OTHER_OUTDOOR_DEVICE = 5; - - // Speech was recorded indoors. - OTHER_INDOOR_DEVICE = 6; - } - - // The use case most closely describing the audio content to be recognized. - InteractionType interaction_type = 1; - - // The industry vertical to which this speech recognition request most - // closely applies. This is most indicative of the topics contained - // in the audio. Use the 6-digit NAICS code to identify the industry - // vertical - see https://www.naics.com/search/. - uint32 industry_naics_code_of_audio = 3; - - // The audio type that most closely describes the audio being recognized. - MicrophoneDistance microphone_distance = 4; - - // The original media the speech was recorded on. - OriginalMediaType original_media_type = 5; - - // The type of device the speech was recorded with. - RecordingDeviceType recording_device_type = 6; - - // The device used to make the recording. Examples 'Nexus 5X' or - // 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or - // 'Cardioid Microphone'. - string recording_device_name = 7; - - // Mime type of the original audio file. For example `audio/m4a`, - // `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`. - // A list of possible audio mime types is maintained at - // http://www.iana.org/assignments/media-types/media-types.xhtml#audio - string original_mime_type = 8; - - // Obfuscated (privacy-protected) ID of the user, to identify number of - // unique users using the service. - int64 obfuscated_id = 9 [deprecated = true]; - - // Description of the content. Eg. "Recordings of federal supreme court - // hearings from 2012". - string audio_topic = 10; -} - -// Provides "hints" to the speech recognizer to favor specific words and phrases -// in the results. -message SpeechContext { - // A list of strings containing words and phrases "hints" so that - // the speech recognition is more likely to recognize them. This can be used - // to improve the accuracy for specific words and phrases, for example, if - // specific commands are typically spoken by the user. This can also be used - // to add additional words to the vocabulary of the recognizer. See - // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). - // - // List items can also be set to classes for groups of words that represent - // common concepts that occur in natural language. For example, rather than - // providing phrase hints for every month of the year, using the $MONTH class - // improves the likelihood of correctly transcribing audio that includes - // months. - repeated string phrases = 1; - - // Hint Boost. Positive value will increase the probability that a specific - // phrase will be recognized over other similar sounding phrases. The higher - // the boost, the higher the chance of false positive recognition as well. - // Negative boost values would correspond to anti-biasing. Anti-biasing is not - // enabled, so negative boost will simply be ignored. Though `boost` can - // accept a wide range of positive values, most use cases are best served with - // values between 0 and 20. We recommend using a binary search approach to - // finding the optimal value for your use case. - float boost = 4; -} - -// Contains audio data in the encoding specified in the `RecognitionConfig`. -// Either `content` or `uri` must be supplied. Supplying both or neither -// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. -// See [content limits](https://cloud.google.com/speech-to-text/quotas#content). -message RecognitionAudio { - // The audio source, which is either inline content or a Google Cloud - // Storage uri. - oneof audio_source { - // The audio data bytes encoded as specified in - // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a - // pure binary representation, whereas JSON representations use base64. - bytes content = 1; - - // URI that points to a file that contains audio data bytes as specified in - // `RecognitionConfig`. The file must not be compressed (for example, gzip). - // Currently, only Google Cloud Storage URIs are - // supported, which must be specified in the following format: - // `gs://bucket_name/object_name` (other URI formats return - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). - // For more information, see [Request - // URIs](https://cloud.google.com/storage/docs/reference-uris). - string uri = 2; - } -} - -// The only message returned to the client by the `Recognize` method. It -// contains the result as zero or more sequential `SpeechRecognitionResult` -// messages. -message RecognizeResponse { - // Sequential list of transcription results corresponding to - // sequential portions of audio. - repeated SpeechRecognitionResult results = 2; -} - -// The only message returned to the client by the `LongRunningRecognize` method. -// It contains the result as zero or more sequential `SpeechRecognitionResult` -// messages. It is included in the `result.response` field of the `Operation` -// returned by the `GetOperation` call of the `google::longrunning::Operations` -// service. -message LongRunningRecognizeResponse { - // Sequential list of transcription results corresponding to - // sequential portions of audio. - repeated SpeechRecognitionResult results = 2; -} - -// Describes the progress of a long-running `LongRunningRecognize` call. It is -// included in the `metadata` field of the `Operation` returned by the -// `GetOperation` call of the `google::longrunning::Operations` service. -message LongRunningRecognizeMetadata { - // Approximate percentage of audio processed thus far. Guaranteed to be 100 - // when the audio is fully processed and the results are available. - int32 progress_percent = 1; - - // Time when the request was received. - google.protobuf.Timestamp start_time = 2; - - // Time of the most recent processing update. - google.protobuf.Timestamp last_update_time = 3; - - // The URI of the audio file being transcribed. Empty if the audio was sent - // as byte content. - string uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// `StreamingRecognizeResponse` is the only message returned to the client by -// `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` -// messages are streamed back to the client. If there is no recognizable -// audio, and `single_utterance` is set to false, then no messages are streamed -// back to the client. -// -// Here's an example of a series of ten `StreamingRecognizeResponse`s that might -// be returned while processing audio: -// -// 1. results { alternatives { transcript: "tube" } stability: 0.01 } -// -// 2. results { alternatives { transcript: "to be a" } stability: 0.01 } -// -// 3. results { alternatives { transcript: "to be" } stability: 0.9 } -// results { alternatives { transcript: " or not to be" } stability: 0.01 } -// -// 4. results { alternatives { transcript: "to be or not to be" -// confidence: 0.92 } -// alternatives { transcript: "to bee or not to bee" } -// is_final: true } -// -// 5. results { alternatives { transcript: " that's" } stability: 0.01 } -// -// 6. results { alternatives { transcript: " that is" } stability: 0.9 } -// results { alternatives { transcript: " the question" } stability: 0.01 } -// -// 7. results { alternatives { transcript: " that is the question" -// confidence: 0.98 } -// alternatives { transcript: " that was the question" } -// is_final: true } -// -// Notes: -// -// - Only two of the above responses #4 and #7 contain final results; they are -// indicated by `is_final: true`. Concatenating these together generates the -// full transcript: "to be or not to be that is the question". -// -// - The others contain interim `results`. #3 and #6 contain two interim -// `results`: the first portion has a high stability and is less likely to -// change; the second portion has a low stability and is very likely to -// change. A UI designer might choose to show only high stability `results`. -// -// - The specific `stability` and `confidence` values shown above are only for -// illustrative purposes. Actual values may vary. -// -// - In each response, only one of these fields will be set: -// `error`, -// `speech_event_type`, or -// one or more (repeated) `results`. -message StreamingRecognizeResponse { - // Indicates the type of speech event. - enum SpeechEventType { - // No speech event specified. - SPEECH_EVENT_UNSPECIFIED = 0; - - // This event indicates that the server has detected the end of the user's - // speech utterance and expects no additional speech. Therefore, the server - // will not process additional audio (although it may subsequently return - // additional results). The client should stop sending additional audio - // data, half-close the gRPC connection, and wait for any additional results - // until the server closes the gRPC connection. This event is only sent if - // `single_utterance` was set to `true`, and is not used otherwise. - END_OF_SINGLE_UTTERANCE = 1; - } - - // If set, returns a [google.rpc.Status][google.rpc.Status] message that - // specifies the error for the operation. - google.rpc.Status error = 1; - - // This repeated list contains zero or more results that - // correspond to consecutive portions of the audio currently being processed. - // It contains zero or one `is_final=true` result (the newly settled portion), - // followed by zero or more `is_final=false` results (the interim results). - repeated StreamingRecognitionResult results = 2; - - // Indicates the type of speech event. - SpeechEventType speech_event_type = 4; -} - -// A streaming speech recognition result corresponding to a portion of the audio -// that is currently being processed. -message StreamingRecognitionResult { - // May contain one or more recognition hypotheses (up to the - // maximum specified in `max_alternatives`). - // These alternatives are ordered in terms of accuracy, with the top (first) - // alternative being the most probable, as ranked by the recognizer. - repeated SpeechRecognitionAlternative alternatives = 1; - - // If `false`, this `StreamingRecognitionResult` represents an - // interim result that may change. If `true`, this is the final time the - // speech service will return this particular `StreamingRecognitionResult`, - // the recognizer will not return any further hypotheses for this portion of - // the transcript and corresponding audio. - bool is_final = 2; - - // An estimate of the likelihood that the recognizer will not - // change its guess about this interim result. Values range from 0.0 - // (completely unstable) to 1.0 (completely stable). - // This field is only provided for interim results (`is_final=false`). - // The default of 0.0 is a sentinel value indicating `stability` was not set. - float stability = 3; - - // Time offset of the end of this result relative to the - // beginning of the audio. - google.protobuf.Duration result_end_time = 4; - - // For multi-channel audio, this is the channel number corresponding to the - // recognized result for the audio from that channel. - // For audio_channel_count = N, its output values can range from '1' to 'N'. - int32 channel_tag = 5; - - // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - // language tag of the language in this result. This language code was - // detected to have the most likelihood of being spoken in the audio. - string language_code = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A speech recognition result corresponding to a portion of the audio. -message SpeechRecognitionResult { - // May contain one or more recognition hypotheses (up to the - // maximum specified in `max_alternatives`). - // These alternatives are ordered in terms of accuracy, with the top (first) - // alternative being the most probable, as ranked by the recognizer. - repeated SpeechRecognitionAlternative alternatives = 1; - - // For multi-channel audio, this is the channel number corresponding to the - // recognized result for the audio from that channel. - // For audio_channel_count = N, its output values can range from '1' to 'N'. - int32 channel_tag = 2; - - // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - // language tag of the language in this result. This language code was - // detected to have the most likelihood of being spoken in the audio. - string language_code = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Alternative hypotheses (a.k.a. n-best list). -message SpeechRecognitionAlternative { - // Transcript text representing the words that the user spoke. - string transcript = 1; - - // The confidence estimate between 0.0 and 1.0. A higher number - // indicates an estimated greater likelihood that the recognized words are - // correct. This field is set only for the top alternative of a non-streaming - // result or, of a streaming result where `is_final=true`. - // This field is not guaranteed to be accurate and users should not rely on it - // to be always provided. - // The default of 0.0 is a sentinel value indicating `confidence` was not set. - float confidence = 2; - - // A list of word-specific information for each recognized word. - // Note: When `enable_speaker_diarization` is true, you will see all the words - // from the beginning of the audio. - repeated WordInfo words = 3; -} - -// Word-specific information for recognized words. -message WordInfo { - // Time offset relative to the beginning of the audio, - // and corresponding to the start of the spoken word. - // This field is only set if `enable_word_time_offsets=true` and only - // in the top hypothesis. - // This is an experimental feature and the accuracy of the time offset can - // vary. - google.protobuf.Duration start_time = 1; - - // Time offset relative to the beginning of the audio, - // and corresponding to the end of the spoken word. - // This field is only set if `enable_word_time_offsets=true` and only - // in the top hypothesis. - // This is an experimental feature and the accuracy of the time offset can - // vary. - google.protobuf.Duration end_time = 2; - - // The word corresponding to this set of information. - string word = 3; - - // The confidence estimate between 0.0 and 1.0. A higher number - // indicates an estimated greater likelihood that the recognized words are - // correct. This field is set only for the top alternative of a non-streaming - // result or, of a streaming result where `is_final=true`. - // This field is not guaranteed to be accurate and users should not rely on it - // to be always provided. - // The default of 0.0 is a sentinel value indicating `confidence` was not set. - float confidence = 4; - - // Output only. A distinct integer value is assigned for every speaker within - // the audio. This field specifies which one of those speakers was detected to - // have spoken this word. Value ranges from '1' to diarization_speaker_count. - // speaker_tag is set if enable_speaker_diarization = 'true' and only in the - // top alternative. - int32 speaker_tag = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/resource.proto b/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/resource.proto deleted file mode 100644 index 5bb379ff1..000000000 --- a/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/resource.proto +++ /dev/null @@ -1,129 +0,0 @@ -// 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 -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.speech.v1p1beta1; - -import "google/api/annotations.proto"; -import "google/api/resource.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/speech/v1p1beta1;speech"; -option java_multiple_files = true; -option java_outer_classname = "SpeechResourceProto"; -option java_package = "com.google.cloud.speech.v1p1beta1"; -option objc_class_prefix = "GCS"; - -// A set of words or phrases that represents a common concept likely to appear -// in your audio, for example a list of passenger ship names. CustomClass items -// can be substituted into placeholders that you set in PhraseSet phrases. -message CustomClass { - option (google.api.resource) = { - type: "speech.googleapis.com/CustomClass" - pattern: "projects/{project}/locations/{location}/customClasses/{custom_class}" - }; - - // An item of the class. - message ClassItem { - // The class item's value. - string value = 1; - } - - // The resource name of the custom class. - string name = 1; - - // If this custom class is a resource, the custom_class_id is the resource id - // of the CustomClass. - string custom_class_id = 2; - - // A collection of class items. - repeated ClassItem items = 3; -} - -// Provides "hints" to the speech recognizer to favor specific words and phrases -// in the results. -message PhraseSet { - option (google.api.resource) = { - type: "speech.googleapis.com/PhraseSet" - pattern: "projects/{project}/locations/{location}/phraseSets/{phrase_set}" - }; - - // A phrases containing words and phrase "hints" so that - // the speech recognition is more likely to recognize them. This can be used - // to improve the accuracy for specific words and phrases, for example, if - // specific commands are typically spoken by the user. This can also be used - // to add additional words to the vocabulary of the recognizer. See - // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). - // - // List items can also include pre-built or custom classes containing groups - // of words that represent common concepts that occur in natural language. For - // example, rather than providing a phrase hint for every month of the - // year (e.g. "i was born in january", "i was born in febuary", ...), use the - // pre-built `$MONTH` class improves the likelihood of correctly transcribing - // audio that includes months (e.g. "i was born in $month"). - // To refer to pre-built classes, use the class' symbol prepended with `$` - // e.g. `$MONTH`. To refer to custom classes that were defined inline in the - // request, set the class's `custom_class_id` to a string unique to all class - // resources and inline classes. Then use the class' id wrapped in $`{...}` - // e.g. "${my-months}". To refer to custom classes resources, use the class' - // id wrapped in `${}` (e.g. `${my-months}`). - message Phrase { - // The phrase itself. - string value = 1; - - // Hint Boost. Overrides the boost set at the phrase set level. - // Positive value will increase the probability that a specific phrase will - // be recognized over other similar sounding phrases. The higher the boost, - // the higher the chance of false positive recognition as well. Negative - // boost values would correspond to anti-biasing. Anti-biasing is not - // enabled, so negative boost will simply be ignored. Though `boost` can - // accept a wide range of positive values, most use cases are best served - // with values between 0 and 20. We recommend using a binary search approach - // to finding the optimal value for your use case. Speech recognition - // will skip PhraseSets with a boost value of 0. - float boost = 2; - } - - // The resource name of the phrase set. - string name = 1; - - // A list of word and phrases. - repeated Phrase phrases = 2; - - // Hint Boost. Positive value will increase the probability that a specific - // phrase will be recognized over other similar sounding phrases. The higher - // the boost, the higher the chance of false positive recognition as well. - // Negative boost values would correspond to anti-biasing. Anti-biasing is not - // enabled, so negative boost will simply be ignored. Though `boost` can - // accept a wide range of positive values, most use cases are best served with - // values between 0 (exclusive) and 20. We recommend using a binary search - // approach to finding the optimal value for your use case. Speech recognition - // will skip PhraseSets with a boost value of 0. - float boost = 4; -} - -// Speech adaptation configuration. -message SpeechAdaptation { - // A collection of phrase sets. To specify the hints inline, leave the - // phrase set's `name` blank and fill in the rest of its fields. Any - // phrase set can use any custom class. - repeated PhraseSet phrase_sets = 1; - - // A collection of custom classes. To specify the classes inline, leave the - // class' `name` blank and fill in the rest of its fields, giving it a unique - // `custom_class_id`. Refer to the inline defined class in phrase hints by its - // `custom_class_id`. - repeated CustomClass custom_classes = 2; -} diff --git a/renovate.json b/renovate.json deleted file mode 100644 index c2dd1d4b0..000000000 --- a/renovate.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "extends": [ - ":separateMajorReleases", - ":combinePatchMinorReleases", - ":ignoreUnstable", - ":prImmediately", - ":updateNotScheduled", - ":automergeDisabled", - ":ignoreModulesAndTests", - ":maintainLockFilesDisabled", - ":autodetectPinVersions" - ], - "packageRules": [ - { - "packagePatterns": [ - "^com.google.guava:" - ], - "versionScheme": "docker" - }, - { - "packagePatterns": [ - "^com.google.api:gax", - "^com.google.auth:", - "^com.google.cloud:google-cloud-core", - "^io.grpc:", - "^com.google.guava:" - ], - "groupName": "core dependencies" - }, - { - "packagePatterns": [ - "^com.google.http-client:", - "^com.google.oauth-client:", - "^com.google.api-client:" - ], - "groupName": "core transport dependencies" - }, - { - "packagePatterns": [ - "*" - ], - "semanticCommitType": "deps", - "semanticCommitScope": null - }, - { - "packagePatterns": [ - "^org.apache.maven", - "^org.jacoco:", - "^org.codehaus.mojo:", - "^org.sonatype.plugins:", - "^com.coveo:", - "^com.google.cloud:google-cloud-shared-config" - ], - "semanticCommitType": "build", - "semanticCommitScope": "deps" - }, - { - "packagePatterns": [ - "^com.google.cloud:google-cloud-speech", - "^com.google.cloud:libraries-bom", - "^com.google.cloud.samples:shared-configuration" - ], - "semanticCommitType": "chore", - "semanticCommitScope": "deps" - }, - { - "packagePatterns": [ - "^com.google.cloud:google-cloud-" - ], - "ignoreUnstable": false - }, - { - "packagePatterns": [ - "^com.fasterxml.jackson.core" - ], - "groupName": "jackson dependencies" - } - ], - "semanticCommits": true, - "masterIssue": true -} \ No newline at end of file diff --git a/samples/generated/resources/brooklyn_bridge.flac b/samples/generated/resources/brooklyn_bridge.flac deleted file mode 100644 index 0e101a55d..000000000 Binary files a/samples/generated/resources/brooklyn_bridge.flac and /dev/null differ diff --git a/samples/generated/resources/brooklyn_bridge.mp3 b/samples/generated/resources/brooklyn_bridge.mp3 deleted file mode 100644 index 97f9955c6..000000000 Binary files a/samples/generated/resources/brooklyn_bridge.mp3 and /dev/null differ diff --git a/samples/generated/resources/brooklyn_bridge.raw b/samples/generated/resources/brooklyn_bridge.raw deleted file mode 100644 index 5ebf79d3c..000000000 Binary files a/samples/generated/resources/brooklyn_bridge.raw and /dev/null differ diff --git a/samples/generated/resources/brooklyn_bridge.wav b/samples/generated/resources/brooklyn_bridge.wav deleted file mode 100644 index 044086e91..000000000 Binary files a/samples/generated/resources/brooklyn_bridge.wav and /dev/null differ diff --git a/samples/generated/resources/commercial_mono.wav b/samples/generated/resources/commercial_mono.wav deleted file mode 100644 index e6b9ed434..000000000 Binary files a/samples/generated/resources/commercial_mono.wav and /dev/null differ diff --git a/samples/generated/resources/hello.raw b/samples/generated/resources/hello.raw deleted file mode 100644 index b5b464500..000000000 Binary files a/samples/generated/resources/hello.raw and /dev/null differ diff --git a/samples/generated/resources/hello.wav b/samples/generated/resources/hello.wav deleted file mode 100644 index 69b506936..000000000 Binary files a/samples/generated/resources/hello.wav and /dev/null differ diff --git a/samples/generated/resources/multi.flac b/samples/generated/resources/multi.flac deleted file mode 100644 index c550e0f42..000000000 Binary files a/samples/generated/resources/multi.flac and /dev/null differ diff --git a/samples/generated/resources/multi.wav b/samples/generated/resources/multi.wav deleted file mode 100644 index 7f71d74b9..000000000 Binary files a/samples/generated/resources/multi.wav and /dev/null differ diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeAsync.java b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeAsync.java deleted file mode 100644 index ffe52f018..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeAsync.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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. - */ -// DO NOT EDIT! This is a generated sample ("LongRunningRequestAsync", "speech_transcribe_async") -// sample-metadata: -// title: Transcribe Audio File using Long Running Operation (Local File) (LRO) -// description: Transcribe a long audio file using asynchronous speech recognition -// usage: gradle run -PmainClass=com.google.cloud.examples.speech.v1.SpeechTranscribeAsync [--args='[--local_file_path "resources/brooklyn_bridge.raw"]'] - -package com.google.cloud.examples.speech.v1; - -import com.google.api.gax.longrunning.OperationFuture; -import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1.SpeechRecognitionResult; -import com.google.protobuf.ByteString; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; - -public class SpeechTranscribeAsync { - // [START speech_transcribe_async] - /* - * Please include the following imports to run this sample. - * - * import com.google.api.gax.longrunning.OperationFuture; - * import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; - * import com.google.cloud.speech.v1.LongRunningRecognizeRequest; - * import com.google.cloud.speech.v1.LongRunningRecognizeResponse; - * import com.google.cloud.speech.v1.RecognitionAudio; - * import com.google.cloud.speech.v1.RecognitionConfig; - * import com.google.cloud.speech.v1.SpeechClient; - * import com.google.cloud.speech.v1.SpeechRecognitionAlternative; - * import com.google.cloud.speech.v1.SpeechRecognitionResult; - * import com.google.protobuf.ByteString; - * import java.nio.file.Files; - * import java.nio.file.Path; - * import java.nio.file.Paths; - */ - - public static void sampleLongRunningRecognize() { - // TODO(developer): Replace these variables before running the sample. - String localFilePath = "resources/brooklyn_bridge.raw"; - sampleLongRunningRecognize(localFilePath); - } - - /** - * Transcribe a long audio file using asynchronous speech recognition - * - * @param localFilePath Path to local audio file, e.g. /path/audio.wav - */ - public static void sampleLongRunningRecognize(String localFilePath) { - try (SpeechClient speechClient = SpeechClient.create()) { - - // The language of the supplied audio - String languageCode = "en-US"; - - // Sample rate in Hertz of the audio data sent - int sampleRateHertz = 16000; - - // Encoding of audio data sent. This sample sets this explicitly. - // This field is optional for FLAC and WAV audio formats. - RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.LINEAR16; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setLanguageCode(languageCode) - .setSampleRateHertz(sampleRateHertz) - .setEncoding(encoding) - .build(); - Path path = Paths.get(localFilePath); - byte[] data = Files.readAllBytes(path); - ByteString content = ByteString.copyFrom(data); - RecognitionAudio audio = RecognitionAudio.newBuilder().setContent(content).build(); - LongRunningRecognizeRequest request = - LongRunningRecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - OperationFuture future = - speechClient.longRunningRecognizeAsync(request); - - System.out.println("Waiting for operation to complete..."); - LongRunningRecognizeResponse response = future.get(); - for (SpeechRecognitionResult result : response.getResultsList()) { - // First alternative is the most probable result - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript: %s\n", alternative.getTranscript()); - } - } catch (Exception exception) { - System.err.println("Failed to create the client due to: " + exception); - } - } - // [END speech_transcribe_async] - - public static void main(String[] args) throws Exception { - Options options = new Options(); - options.addOption( - Option.builder("").required(false).hasArg(true).longOpt("local_file_path").build()); - - CommandLine cl = (new DefaultParser()).parse(options, args); - String localFilePath = cl.getOptionValue("local_file_path", "resources/brooklyn_bridge.raw"); - - sampleLongRunningRecognize(localFilePath); - } -} diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeAsyncGcs.java b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeAsyncGcs.java deleted file mode 100644 index 519c76266..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeAsyncGcs.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -// DO NOT EDIT! This is a generated sample ("LongRunningRequestAsync", "speech_transcribe_async_gcs") -// sample-metadata: -// title: Transcript Audio File using Long Running Operation (Cloud Storage) (LRO) -// description: Transcribe long audio file from Cloud Storage using asynchronous speech recognition -// usage: gradle run -PmainClass=com.google.cloud.examples.speech.v1.SpeechTranscribeAsyncGcs [--args='[--storage_uri "gs://cloud-samples-data/speech/brooklyn_bridge.raw"]'] - -package com.google.cloud.examples.speech.v1; - -import com.google.api.gax.longrunning.OperationFuture; -import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1.SpeechRecognitionResult; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; - -public class SpeechTranscribeAsyncGcs { - // [START speech_transcribe_async_gcs] - /* - * Please include the following imports to run this sample. - * - * import com.google.api.gax.longrunning.OperationFuture; - * import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; - * import com.google.cloud.speech.v1.LongRunningRecognizeRequest; - * import com.google.cloud.speech.v1.LongRunningRecognizeResponse; - * import com.google.cloud.speech.v1.RecognitionAudio; - * import com.google.cloud.speech.v1.RecognitionConfig; - * import com.google.cloud.speech.v1.SpeechClient; - * import com.google.cloud.speech.v1.SpeechRecognitionAlternative; - * import com.google.cloud.speech.v1.SpeechRecognitionResult; - */ - - public static void sampleLongRunningRecognize() { - // TODO(developer): Replace these variables before running the sample. - String storageUri = "gs://cloud-samples-data/speech/brooklyn_bridge.raw"; - sampleLongRunningRecognize(storageUri); - } - - /** - * Transcribe long audio file from Cloud Storage using asynchronous speech recognition - * - * @param storageUri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE] - */ - public static void sampleLongRunningRecognize(String storageUri) { - try (SpeechClient speechClient = SpeechClient.create()) { - - // Sample rate in Hertz of the audio data sent - int sampleRateHertz = 16000; - - // The language of the supplied audio - String languageCode = "en-US"; - - // Encoding of audio data sent. This sample sets this explicitly. - // This field is optional for FLAC and WAV audio formats. - RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.LINEAR16; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setSampleRateHertz(sampleRateHertz) - .setLanguageCode(languageCode) - .setEncoding(encoding) - .build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(storageUri).build(); - LongRunningRecognizeRequest request = - LongRunningRecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - OperationFuture future = - speechClient.longRunningRecognizeAsync(request); - - System.out.println("Waiting for operation to complete..."); - LongRunningRecognizeResponse response = future.get(); - for (SpeechRecognitionResult result : response.getResultsList()) { - // First alternative is the most probable result - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript: %s\n", alternative.getTranscript()); - } - } catch (Exception exception) { - System.err.println("Failed to create the client due to: " + exception); - } - } - // [END speech_transcribe_async_gcs] - - public static void main(String[] args) throws Exception { - Options options = new Options(); - options.addOption( - Option.builder("").required(false).hasArg(true).longOpt("storage_uri").build()); - - CommandLine cl = (new DefaultParser()).parse(options, args); - String storageUri = - cl.getOptionValue("storage_uri", "gs://cloud-samples-data/speech/brooklyn_bridge.raw"); - - sampleLongRunningRecognize(storageUri); - } -} diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeAsyncWordTimeOffsetsGcs.java b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeAsyncWordTimeOffsetsGcs.java deleted file mode 100644 index 02196b375..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeAsyncWordTimeOffsetsGcs.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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. - */ -// DO NOT EDIT! This is a generated sample ("LongRunningRequestAsync", "speech_transcribe_async_word_time_offsets_gcs") -// sample-metadata: -// title: Getting word timestamps (Cloud Storage) (LRO) -// description: Print start and end time of each word spoken in audio file from Cloud Storage -// usage: gradle run -PmainClass=com.google.cloud.examples.speech.v1.SpeechTranscribeAsyncWordTimeOffsetsGcs [--args='[--storage_uri "gs://cloud-samples-data/speech/brooklyn_bridge.flac"]'] - -package com.google.cloud.examples.speech.v1; - -import com.google.api.gax.longrunning.OperationFuture; -import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1.SpeechRecognitionResult; -import com.google.cloud.speech.v1.WordInfo; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; - -public class SpeechTranscribeAsyncWordTimeOffsetsGcs { - // [START speech_transcribe_async_word_time_offsets_gcs] - /* - * Please include the following imports to run this sample. - * - * import com.google.api.gax.longrunning.OperationFuture; - * import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; - * import com.google.cloud.speech.v1.LongRunningRecognizeRequest; - * import com.google.cloud.speech.v1.LongRunningRecognizeResponse; - * import com.google.cloud.speech.v1.RecognitionAudio; - * import com.google.cloud.speech.v1.RecognitionConfig; - * import com.google.cloud.speech.v1.SpeechClient; - * import com.google.cloud.speech.v1.SpeechRecognitionAlternative; - * import com.google.cloud.speech.v1.SpeechRecognitionResult; - * import com.google.cloud.speech.v1.WordInfo; - */ - - public static void sampleLongRunningRecognize() { - // TODO(developer): Replace these variables before running the sample. - String storageUri = "gs://cloud-samples-data/speech/brooklyn_bridge.flac"; - sampleLongRunningRecognize(storageUri); - } - - /** - * Print start and end time of each word spoken in audio file from Cloud Storage - * - * @param storageUri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE] - */ - public static void sampleLongRunningRecognize(String storageUri) { - try (SpeechClient speechClient = SpeechClient.create()) { - - // When enabled, the first result returned by the API will include a list - // of words and the start and end time offsets (timestamps) for those words. - boolean enableWordTimeOffsets = true; - - // The language of the supplied audio - String languageCode = "en-US"; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEnableWordTimeOffsets(enableWordTimeOffsets) - .setLanguageCode(languageCode) - .build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(storageUri).build(); - LongRunningRecognizeRequest request = - LongRunningRecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - OperationFuture future = - speechClient.longRunningRecognizeAsync(request); - - System.out.println("Waiting for operation to complete..."); - LongRunningRecognizeResponse response = future.get(); - // The first result includes start and end time word offsets - SpeechRecognitionResult result = response.getResultsList().get(0); - // First alternative is the most probable result - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript: %s\n", alternative.getTranscript()); - // Print the start and end time of each word - for (WordInfo word : alternative.getWordsList()) { - System.out.printf("Word: %s\n", word.getWord()); - System.out.printf( - "Start time: %s seconds %s nanos\n", - word.getStartTime().getSeconds(), word.getStartTime().getNanos()); - System.out.printf( - "End time: %s seconds %s nanos\n", - word.getEndTime().getSeconds(), word.getEndTime().getNanos()); - } - } catch (Exception exception) { - System.err.println("Failed to create the client due to: " + exception); - } - } - // [END speech_transcribe_async_word_time_offsets_gcs] - - public static void main(String[] args) throws Exception { - Options options = new Options(); - options.addOption( - Option.builder("").required(false).hasArg(true).longOpt("storage_uri").build()); - - CommandLine cl = (new DefaultParser()).parse(options, args); - String storageUri = - cl.getOptionValue("storage_uri", "gs://cloud-samples-data/speech/brooklyn_bridge.flac"); - - sampleLongRunningRecognize(storageUri); - } -} diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeEnhancedModel.java b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeEnhancedModel.java deleted file mode 100644 index 2bc23ff37..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeEnhancedModel.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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. - */ -// DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_enhanced_model") -// sample-metadata: -// title: Using Enhanced Models (Local File) -// description: Transcribe a short audio file using an enhanced model -// usage: gradle run -PmainClass=com.google.cloud.examples.speech.v1.SpeechTranscribeEnhancedModel [--args='[--local_file_path "resources/hello.wav"]'] - -package com.google.cloud.examples.speech.v1; - -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.RecognizeRequest; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1.SpeechRecognitionResult; -import com.google.protobuf.ByteString; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; - -public class SpeechTranscribeEnhancedModel { - // [START speech_transcribe_enhanced_model] - /* - * Please include the following imports to run this sample. - * - * import com.google.cloud.speech.v1.RecognitionAudio; - * import com.google.cloud.speech.v1.RecognitionConfig; - * import com.google.cloud.speech.v1.RecognizeRequest; - * import com.google.cloud.speech.v1.RecognizeResponse; - * import com.google.cloud.speech.v1.SpeechClient; - * import com.google.cloud.speech.v1.SpeechRecognitionAlternative; - * import com.google.cloud.speech.v1.SpeechRecognitionResult; - * import com.google.protobuf.ByteString; - * import java.nio.file.Files; - * import java.nio.file.Path; - * import java.nio.file.Paths; - */ - - public static void sampleRecognize() { - // TODO(developer): Replace these variables before running the sample. - String localFilePath = "resources/hello.wav"; - sampleRecognize(localFilePath); - } - - /** - * Transcribe a short audio file using an enhanced model - * - * @param localFilePath Path to local audio file, e.g. /path/audio.wav - */ - public static void sampleRecognize(String localFilePath) { - try (SpeechClient speechClient = SpeechClient.create()) { - - // The enhanced model to use, e.g. phone_call - String model = "phone_call"; - - // Use an enhanced model for speech recognition (when set to true). - // Project must be eligible for requesting enhanced models. - // Enhanced speech models require that you opt-in to data logging. - boolean useEnhanced = true; - - // The language of the supplied audio - String languageCode = "en-US"; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setModel(model) - .setUseEnhanced(useEnhanced) - .setLanguageCode(languageCode) - .build(); - Path path = Paths.get(localFilePath); - byte[] data = Files.readAllBytes(path); - ByteString content = ByteString.copyFrom(data); - RecognitionAudio audio = RecognitionAudio.newBuilder().setContent(content).build(); - RecognizeRequest request = - RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - RecognizeResponse response = speechClient.recognize(request); - for (SpeechRecognitionResult result : response.getResultsList()) { - // First alternative is the most probable result - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript: %s\n", alternative.getTranscript()); - } - } catch (Exception exception) { - System.err.println("Failed to create the client due to: " + exception); - } - } - // [END speech_transcribe_enhanced_model] - - public static void main(String[] args) throws Exception { - Options options = new Options(); - options.addOption( - Option.builder("").required(false).hasArg(true).longOpt("local_file_path").build()); - - CommandLine cl = (new DefaultParser()).parse(options, args); - String localFilePath = cl.getOptionValue("local_file_path", "resources/hello.wav"); - - sampleRecognize(localFilePath); - } -} diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeModelSelection.java b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeModelSelection.java deleted file mode 100644 index 435f296d6..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeModelSelection.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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. - */ -// DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_model_selection") -// sample-metadata: -// title: Selecting a Transcription Model (Local File) -// description: Transcribe a short audio file using a specified transcription model -// usage: gradle run -PmainClass=com.google.cloud.examples.speech.v1.SpeechTranscribeModelSelection [--args='[--local_file_path "resources/hello.wav"] [--model "phone_call"]'] - -package com.google.cloud.examples.speech.v1; - -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.RecognizeRequest; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1.SpeechRecognitionResult; -import com.google.protobuf.ByteString; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; - -public class SpeechTranscribeModelSelection { - // [START speech_transcribe_model_selection] - /* - * Please include the following imports to run this sample. - * - * import com.google.cloud.speech.v1.RecognitionAudio; - * import com.google.cloud.speech.v1.RecognitionConfig; - * import com.google.cloud.speech.v1.RecognizeRequest; - * import com.google.cloud.speech.v1.RecognizeResponse; - * import com.google.cloud.speech.v1.SpeechClient; - * import com.google.cloud.speech.v1.SpeechRecognitionAlternative; - * import com.google.cloud.speech.v1.SpeechRecognitionResult; - * import com.google.protobuf.ByteString; - * import java.nio.file.Files; - * import java.nio.file.Path; - * import java.nio.file.Paths; - */ - - public static void sampleRecognize() { - // TODO(developer): Replace these variables before running the sample. - String localFilePath = "resources/hello.wav"; - String model = "phone_call"; - sampleRecognize(localFilePath, model); - } - - /** - * Transcribe a short audio file using a specified transcription model - * - * @param localFilePath Path to local audio file, e.g. /path/audio.wav - * @param model The transcription model to use, e.g. video, phone_call, default For a list of - * available transcription models, see: - * https://cloud.google.com/speech-to-text/docs/transcription-model#transcription_models - */ - public static void sampleRecognize(String localFilePath, String model) { - try (SpeechClient speechClient = SpeechClient.create()) { - - // The language of the supplied audio - String languageCode = "en-US"; - RecognitionConfig config = - RecognitionConfig.newBuilder().setModel(model).setLanguageCode(languageCode).build(); - Path path = Paths.get(localFilePath); - byte[] data = Files.readAllBytes(path); - ByteString content = ByteString.copyFrom(data); - RecognitionAudio audio = RecognitionAudio.newBuilder().setContent(content).build(); - RecognizeRequest request = - RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - RecognizeResponse response = speechClient.recognize(request); - for (SpeechRecognitionResult result : response.getResultsList()) { - // First alternative is the most probable result - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript: %s\n", alternative.getTranscript()); - } - } catch (Exception exception) { - System.err.println("Failed to create the client due to: " + exception); - } - } - // [END speech_transcribe_model_selection] - - public static void main(String[] args) throws Exception { - Options options = new Options(); - options.addOption( - Option.builder("").required(false).hasArg(true).longOpt("local_file_path").build()); - options.addOption(Option.builder("").required(false).hasArg(true).longOpt("model").build()); - - CommandLine cl = (new DefaultParser()).parse(options, args); - String localFilePath = cl.getOptionValue("local_file_path", "resources/hello.wav"); - String model = cl.getOptionValue("model", "phone_call"); - - sampleRecognize(localFilePath, model); - } -} diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeModelSelectionGcs.java b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeModelSelectionGcs.java deleted file mode 100644 index 93e81906b..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeModelSelectionGcs.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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. - */ -// DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_model_selection_gcs") -// sample-metadata: -// title: Selecting a Transcription Model (Cloud Storage) -// description: Transcribe a short audio file from Cloud Storage using a specified transcription model -// usage: gradle run -PmainClass=com.google.cloud.examples.speech.v1.SpeechTranscribeModelSelectionGcs [--args='[--storage_uri "gs://cloud-samples-data/speech/hello.wav"] [--model "phone_call"]'] - -package com.google.cloud.examples.speech.v1; - -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.RecognizeRequest; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1.SpeechRecognitionResult; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; - -public class SpeechTranscribeModelSelectionGcs { - // [START speech_transcribe_model_selection_gcs] - /* - * Please include the following imports to run this sample. - * - * import com.google.cloud.speech.v1.RecognitionAudio; - * import com.google.cloud.speech.v1.RecognitionConfig; - * import com.google.cloud.speech.v1.RecognizeRequest; - * import com.google.cloud.speech.v1.RecognizeResponse; - * import com.google.cloud.speech.v1.SpeechClient; - * import com.google.cloud.speech.v1.SpeechRecognitionAlternative; - * import com.google.cloud.speech.v1.SpeechRecognitionResult; - */ - - public static void sampleRecognize() { - // TODO(developer): Replace these variables before running the sample. - String storageUri = "gs://cloud-samples-data/speech/hello.wav"; - String model = "phone_call"; - sampleRecognize(storageUri, model); - } - - /** - * Transcribe a short audio file from Cloud Storage using a specified transcription model - * - * @param storageUri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE] - * @param model The transcription model to use, e.g. video, phone_call, default For a list of - * available transcription models, see: - * https://cloud.google.com/speech-to-text/docs/transcription-model#transcription_models - */ - public static void sampleRecognize(String storageUri, String model) { - try (SpeechClient speechClient = SpeechClient.create()) { - - // The language of the supplied audio - String languageCode = "en-US"; - RecognitionConfig config = - RecognitionConfig.newBuilder().setModel(model).setLanguageCode(languageCode).build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(storageUri).build(); - RecognizeRequest request = - RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - RecognizeResponse response = speechClient.recognize(request); - for (SpeechRecognitionResult result : response.getResultsList()) { - // First alternative is the most probable result - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript: %s\n", alternative.getTranscript()); - } - } catch (Exception exception) { - System.err.println("Failed to create the client due to: " + exception); - } - } - // [END speech_transcribe_model_selection_gcs] - - public static void main(String[] args) throws Exception { - Options options = new Options(); - options.addOption( - Option.builder("").required(false).hasArg(true).longOpt("storage_uri").build()); - options.addOption(Option.builder("").required(false).hasArg(true).longOpt("model").build()); - - CommandLine cl = (new DefaultParser()).parse(options, args); - String storageUri = - cl.getOptionValue("storage_uri", "gs://cloud-samples-data/speech/hello.wav"); - String model = cl.getOptionValue("model", "phone_call"); - - sampleRecognize(storageUri, model); - } -} diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeMultichannel.java b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeMultichannel.java deleted file mode 100644 index 5eb75c017..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeMultichannel.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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. - */ -// DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_multichannel") -// sample-metadata: -// title: Multi-Channel Audio Transcription (Local File) -// description: Transcribe a short audio file with multiple channels -// usage: gradle run -PmainClass=com.google.cloud.examples.speech.v1.SpeechTranscribeMultichannel [--args='[--local_file_path "resources/multi.wav"]'] - -package com.google.cloud.examples.speech.v1; - -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.RecognizeRequest; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1.SpeechRecognitionResult; -import com.google.protobuf.ByteString; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; - -public class SpeechTranscribeMultichannel { - // [START speech_transcribe_multichannel] - /* - * Please include the following imports to run this sample. - * - * import com.google.cloud.speech.v1.RecognitionAudio; - * import com.google.cloud.speech.v1.RecognitionConfig; - * import com.google.cloud.speech.v1.RecognizeRequest; - * import com.google.cloud.speech.v1.RecognizeResponse; - * import com.google.cloud.speech.v1.SpeechClient; - * import com.google.cloud.speech.v1.SpeechRecognitionAlternative; - * import com.google.cloud.speech.v1.SpeechRecognitionResult; - * import com.google.protobuf.ByteString; - * import java.nio.file.Files; - * import java.nio.file.Path; - * import java.nio.file.Paths; - */ - - public static void sampleRecognize() { - // TODO(developer): Replace these variables before running the sample. - String localFilePath = "resources/multi.wav"; - sampleRecognize(localFilePath); - } - - /** - * Transcribe a short audio file with multiple channels - * - * @param localFilePath Path to local audio file, e.g. /path/audio.wav - */ - public static void sampleRecognize(String localFilePath) { - try (SpeechClient speechClient = SpeechClient.create()) { - - // The number of channels in the input audio file (optional) - int audioChannelCount = 2; - - // When set to true, each audio channel will be recognized separately. - // The recognition result will contain a channel_tag field to state which - // channel that result belongs to - boolean enableSeparateRecognitionPerChannel = true; - - // The language of the supplied audio - String languageCode = "en-US"; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setAudioChannelCount(audioChannelCount) - .setEnableSeparateRecognitionPerChannel(enableSeparateRecognitionPerChannel) - .setLanguageCode(languageCode) - .build(); - Path path = Paths.get(localFilePath); - byte[] data = Files.readAllBytes(path); - ByteString content = ByteString.copyFrom(data); - RecognitionAudio audio = RecognitionAudio.newBuilder().setContent(content).build(); - RecognizeRequest request = - RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - RecognizeResponse response = speechClient.recognize(request); - for (SpeechRecognitionResult result : response.getResultsList()) { - // channelTag to recognize which audio channel this result is for - System.out.printf("Channel tag: %s\n", result.getChannelTag()); - // First alternative is the most probable result - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript: %s\n", alternative.getTranscript()); - } - } catch (Exception exception) { - System.err.println("Failed to create the client due to: " + exception); - } - } - // [END speech_transcribe_multichannel] - - public static void main(String[] args) throws Exception { - Options options = new Options(); - options.addOption( - Option.builder("").required(false).hasArg(true).longOpt("local_file_path").build()); - - CommandLine cl = (new DefaultParser()).parse(options, args); - String localFilePath = cl.getOptionValue("local_file_path", "resources/multi.wav"); - - sampleRecognize(localFilePath); - } -} diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeMultichannelGcs.java b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeMultichannelGcs.java deleted file mode 100644 index f45c78739..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeMultichannelGcs.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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. - */ -// DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_multichannel_gcs") -// sample-metadata: -// title: Multi-Channel Audio Transcription (Cloud Storage) -// description: Transcribe a short audio file from Cloud Storage with multiple channels -// usage: gradle run -PmainClass=com.google.cloud.examples.speech.v1.SpeechTranscribeMultichannelGcs [--args='[--storage_uri "gs://cloud-samples-data/speech/multi.wav"]'] - -package com.google.cloud.examples.speech.v1; - -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.RecognizeRequest; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1.SpeechRecognitionResult; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; - -public class SpeechTranscribeMultichannelGcs { - // [START speech_transcribe_multichannel_gcs] - /* - * Please include the following imports to run this sample. - * - * import com.google.cloud.speech.v1.RecognitionAudio; - * import com.google.cloud.speech.v1.RecognitionConfig; - * import com.google.cloud.speech.v1.RecognizeRequest; - * import com.google.cloud.speech.v1.RecognizeResponse; - * import com.google.cloud.speech.v1.SpeechClient; - * import com.google.cloud.speech.v1.SpeechRecognitionAlternative; - * import com.google.cloud.speech.v1.SpeechRecognitionResult; - */ - - public static void sampleRecognize() { - // TODO(developer): Replace these variables before running the sample. - String storageUri = "gs://cloud-samples-data/speech/multi.wav"; - sampleRecognize(storageUri); - } - - /** - * Transcribe a short audio file from Cloud Storage with multiple channels - * - * @param storageUri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE] - */ - public static void sampleRecognize(String storageUri) { - try (SpeechClient speechClient = SpeechClient.create()) { - - // The number of channels in the input audio file (optional) - int audioChannelCount = 2; - - // When set to true, each audio channel will be recognized separately. - // The recognition result will contain a channel_tag field to state which - // channel that result belongs to - boolean enableSeparateRecognitionPerChannel = true; - - // The language of the supplied audio - String languageCode = "en-US"; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setAudioChannelCount(audioChannelCount) - .setEnableSeparateRecognitionPerChannel(enableSeparateRecognitionPerChannel) - .setLanguageCode(languageCode) - .build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(storageUri).build(); - RecognizeRequest request = - RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - RecognizeResponse response = speechClient.recognize(request); - for (SpeechRecognitionResult result : response.getResultsList()) { - // channelTag to recognize which audio channel this result is for - System.out.printf("Channel tag: %s\n", result.getChannelTag()); - // First alternative is the most probable result - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript: %s\n", alternative.getTranscript()); - } - } catch (Exception exception) { - System.err.println("Failed to create the client due to: " + exception); - } - } - // [END speech_transcribe_multichannel_gcs] - - public static void main(String[] args) throws Exception { - Options options = new Options(); - options.addOption( - Option.builder("").required(false).hasArg(true).longOpt("storage_uri").build()); - - CommandLine cl = (new DefaultParser()).parse(options, args); - String storageUri = - cl.getOptionValue("storage_uri", "gs://cloud-samples-data/speech/multi.wav"); - - sampleRecognize(storageUri); - } -} diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeSync.java b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeSync.java deleted file mode 100644 index a58d9cb42..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeSync.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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. - */ -// DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_sync") -// sample-metadata: -// title: Transcribe Audio File (Local File) -// description: Transcribe a short audio file using synchronous speech recognition -// usage: gradle run -PmainClass=com.google.cloud.examples.speech.v1.SpeechTranscribeSync [--args='[--local_file_path "resources/brooklyn_bridge.raw"]'] - -package com.google.cloud.examples.speech.v1; - -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.RecognizeRequest; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1.SpeechRecognitionResult; -import com.google.protobuf.ByteString; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; - -public class SpeechTranscribeSync { - // [START speech_transcribe_sync] - /* - * Please include the following imports to run this sample. - * - * import com.google.cloud.speech.v1.RecognitionAudio; - * import com.google.cloud.speech.v1.RecognitionConfig; - * import com.google.cloud.speech.v1.RecognizeRequest; - * import com.google.cloud.speech.v1.RecognizeResponse; - * import com.google.cloud.speech.v1.SpeechClient; - * import com.google.cloud.speech.v1.SpeechRecognitionAlternative; - * import com.google.cloud.speech.v1.SpeechRecognitionResult; - * import com.google.protobuf.ByteString; - * import java.nio.file.Files; - * import java.nio.file.Path; - * import java.nio.file.Paths; - */ - - public static void sampleRecognize() { - // TODO(developer): Replace these variables before running the sample. - String localFilePath = "resources/brooklyn_bridge.raw"; - sampleRecognize(localFilePath); - } - - /** - * Transcribe a short audio file using synchronous speech recognition - * - * @param localFilePath Path to local audio file, e.g. /path/audio.wav - */ - public static void sampleRecognize(String localFilePath) { - try (SpeechClient speechClient = SpeechClient.create()) { - - // The language of the supplied audio - String languageCode = "en-US"; - - // Sample rate in Hertz of the audio data sent - int sampleRateHertz = 16000; - - // Encoding of audio data sent. This sample sets this explicitly. - // This field is optional for FLAC and WAV audio formats. - RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.LINEAR16; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setLanguageCode(languageCode) - .setSampleRateHertz(sampleRateHertz) - .setEncoding(encoding) - .build(); - Path path = Paths.get(localFilePath); - byte[] data = Files.readAllBytes(path); - ByteString content = ByteString.copyFrom(data); - RecognitionAudio audio = RecognitionAudio.newBuilder().setContent(content).build(); - RecognizeRequest request = - RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - RecognizeResponse response = speechClient.recognize(request); - for (SpeechRecognitionResult result : response.getResultsList()) { - // First alternative is the most probable result - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript: %s\n", alternative.getTranscript()); - } - } catch (Exception exception) { - System.err.println("Failed to create the client due to: " + exception); - } - } - // [END speech_transcribe_sync] - - public static void main(String[] args) throws Exception { - Options options = new Options(); - options.addOption( - Option.builder("").required(false).hasArg(true).longOpt("local_file_path").build()); - - CommandLine cl = (new DefaultParser()).parse(options, args); - String localFilePath = cl.getOptionValue("local_file_path", "resources/brooklyn_bridge.raw"); - - sampleRecognize(localFilePath); - } -} diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeSyncGcs.java b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeSyncGcs.java deleted file mode 100644 index d4b821f28..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/SpeechTranscribeSyncGcs.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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. - */ -// DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_sync_gcs") -// sample-metadata: -// title: Transcript Audio File (Cloud Storage) -// description: Transcribe short audio file from Cloud Storage using synchronous speech recognition -// usage: gradle run -PmainClass=com.google.cloud.examples.speech.v1.SpeechTranscribeSyncGcs [--args='[--storage_uri "gs://cloud-samples-data/speech/brooklyn_bridge.raw"]'] - -package com.google.cloud.examples.speech.v1; - -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.RecognizeRequest; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1.SpeechRecognitionResult; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; - -public class SpeechTranscribeSyncGcs { - // [START speech_transcribe_sync_gcs] - /* - * Please include the following imports to run this sample. - * - * import com.google.cloud.speech.v1.RecognitionAudio; - * import com.google.cloud.speech.v1.RecognitionConfig; - * import com.google.cloud.speech.v1.RecognizeRequest; - * import com.google.cloud.speech.v1.RecognizeResponse; - * import com.google.cloud.speech.v1.SpeechClient; - * import com.google.cloud.speech.v1.SpeechRecognitionAlternative; - * import com.google.cloud.speech.v1.SpeechRecognitionResult; - */ - - public static void sampleRecognize() { - // TODO(developer): Replace these variables before running the sample. - String storageUri = "gs://cloud-samples-data/speech/brooklyn_bridge.raw"; - sampleRecognize(storageUri); - } - - /** - * Transcribe short audio file from Cloud Storage using synchronous speech recognition - * - * @param storageUri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE] - */ - public static void sampleRecognize(String storageUri) { - try (SpeechClient speechClient = SpeechClient.create()) { - - // Sample rate in Hertz of the audio data sent - int sampleRateHertz = 16000; - - // The language of the supplied audio - String languageCode = "en-US"; - - // Encoding of audio data sent. This sample sets this explicitly. - // This field is optional for FLAC and WAV audio formats. - RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.LINEAR16; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setSampleRateHertz(sampleRateHertz) - .setLanguageCode(languageCode) - .setEncoding(encoding) - .build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(storageUri).build(); - RecognizeRequest request = - RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - RecognizeResponse response = speechClient.recognize(request); - for (SpeechRecognitionResult result : response.getResultsList()) { - // First alternative is the most probable result - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript: %s\n", alternative.getTranscript()); - } - } catch (Exception exception) { - System.err.println("Failed to create the client due to: " + exception); - } - } - // [END speech_transcribe_sync_gcs] - - public static void main(String[] args) throws Exception { - Options options = new Options(); - options.addOption( - Option.builder("").required(false).hasArg(true).longOpt("storage_uri").build()); - - CommandLine cl = (new DefaultParser()).parse(options, args); - String storageUri = - cl.getOptionValue("storage_uri", "gs://cloud-samples-data/speech/brooklyn_bridge.raw"); - - sampleRecognize(storageUri); - } -} diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/speech.v1.java.yaml b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/speech.v1.java.yaml deleted file mode 100644 index a82089734..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/speech.v1.java.yaml +++ /dev/null @@ -1,60 +0,0 @@ ---- -type: manifest/samples -schema_version: 3 -java: &java - environment: "java" - bin: "mvn exec:java" - base_path: "samples/src/main/java/com/google/cloud/examples/speech/v1" - package: "com.google.cloud.examples.speech.v1" - invocation: "{bin} -Dexec.mainClass={class} -Dexec.args='@args'" -samples: -- <<: *java - sample: "speech_transcribe_model_selection_gcs" - path: "{base_path}/SpeechTranscribeModelSelectionGcs.java" - class: "{package}.SpeechTranscribeModelSelectionGcs" - region_tag: "speech_transcribe_model_selection_gcs" -- <<: *java - sample: "speech_transcribe_model_selection" - path: "{base_path}/SpeechTranscribeModelSelection.java" - class: "{package}.SpeechTranscribeModelSelection" - region_tag: "speech_transcribe_model_selection" -- <<: *java - sample: "speech_transcribe_multichannel_gcs" - path: "{base_path}/SpeechTranscribeMultichannelGcs.java" - class: "{package}.SpeechTranscribeMultichannelGcs" - region_tag: "speech_transcribe_multichannel_gcs" -- <<: *java - sample: "speech_transcribe_sync_gcs" - path: "{base_path}/SpeechTranscribeSyncGcs.java" - class: "{package}.SpeechTranscribeSyncGcs" - region_tag: "speech_transcribe_sync_gcs" -- <<: *java - sample: "speech_transcribe_enhanced_model" - path: "{base_path}/SpeechTranscribeEnhancedModel.java" - class: "{package}.SpeechTranscribeEnhancedModel" - region_tag: "speech_transcribe_enhanced_model" -- <<: *java - sample: "speech_transcribe_multichannel" - path: "{base_path}/SpeechTranscribeMultichannel.java" - class: "{package}.SpeechTranscribeMultichannel" - region_tag: "speech_transcribe_multichannel" -- <<: *java - sample: "speech_transcribe_sync" - path: "{base_path}/SpeechTranscribeSync.java" - class: "{package}.SpeechTranscribeSync" - region_tag: "speech_transcribe_sync" -- <<: *java - sample: "speech_transcribe_async" - path: "{base_path}/SpeechTranscribeAsync.java" - class: "{package}.SpeechTranscribeAsync" - region_tag: "speech_transcribe_async" -- <<: *java - sample: "speech_transcribe_async_gcs" - path: "{base_path}/SpeechTranscribeAsyncGcs.java" - class: "{package}.SpeechTranscribeAsyncGcs" - region_tag: "speech_transcribe_async_gcs" -- <<: *java - sample: "speech_transcribe_async_word_time_offsets_gcs" - path: "{base_path}/SpeechTranscribeAsyncWordTimeOffsetsGcs.java" - class: "{package}.SpeechTranscribeAsyncWordTimeOffsetsGcs" - region_tag: "speech_transcribe_async_word_time_offsets_gcs" diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_async.test.yaml b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_async.test.yaml deleted file mode 100644 index f26cfbabc..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_async.test.yaml +++ /dev/null @@ -1,28 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Transcribe Audio File using Long Running Operation (Local File) (LRO) - cases: - - # This sample should default to using brooklyn_bridge.raw - # with explicitly configured sample_rate_hertz and encoding - - name: speech_transcribe_async (no arguments) - spec: - - call: - sample: speech_transcribe_async - - assert_contains: - - literal: "how old is the Brooklyn Bridge" - - # Confirm that another file can be transcribed (use another .raw PCM file) - - name: speech_transcribe_async (--local_file_path) - spec: - - call: - sample: speech_transcribe_async - params: - local_file_path: - literal: "resources/hello.raw" - - assert_contains: - - literal: "hello" - - assert_not_contains: - - literal: "how old is the Brooklyn Bridge" diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_async_gcs.test.yaml b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_async_gcs.test.yaml deleted file mode 100644 index d3d83133e..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_async_gcs.test.yaml +++ /dev/null @@ -1,28 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Transcript Audio File using Long Running Operation (Cloud Storage) (LRO) - cases: - - # This sample should default to using gs://cloud-samples-data/brooklyn_bridge.raw - # with explicitly configured sample_rate_hertz and encoding - - name: speech_transcribe_async_gcs (no arguments) - spec: - - call: - sample: speech_transcribe_async_gcs - - assert_contains: - - literal: "how old is the Brooklyn Bridge" - - # Confirm that another file can be transcribed (use another .raw PCM file) - - name: speech_transcribe_async_gcs (--storage_uri) - spec: - - call: - sample: speech_transcribe_async_gcs - params: - storage_uri: - literal: "gs://cloud-samples-data/speech/hello.raw" - - assert_contains: - - literal: "hello" - - assert_not_contains: - - literal: "how old is the Brooklyn Bridge" diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_async_word_time_offsets_gcs.test.yaml b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_async_word_time_offsets_gcs.test.yaml deleted file mode 100644 index 11784726d..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_async_word_time_offsets_gcs.test.yaml +++ /dev/null @@ -1,37 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Getting word timestamps (Cloud Storage) (LRO) - cases: - - # This sample should default to using gs://cloud-samples-data/speech/brooklyn_bridge.flac - - name: speech_transcribe_async_word_time_offsets_gcs (no arguments) - spec: - - call: - sample: speech_transcribe_async_word_time_offsets_gcs - - assert_contains: - - literal: "how old is the Brooklyn Bridge" - - literal: "Word: how" - - literal: "Word: old" - - literal: "Word: is" - - literal: "Start time: 0 seconds" - - literal: "End time: 1 seconds" - - # Confirm that another file can be transcribed (use another file) - - name: speech_transcribe_async_word_time_offsets_gcs (--storage_uri) - spec: - - call: - sample: speech_transcribe_async_word_time_offsets_gcs - params: - storage_uri: - literal: "gs://cloud-samples-data/speech/multi.flac" - - assert_contains: - - literal: "how are you doing" - - literal: "Word: how" - - literal: "Word: are" - - literal: "Word: you" - - literal: "Start time: 0 seconds" - - literal: "End time: 1 seconds" - - assert_not_contains: - - literal: "how old is the Brooklyn Bridge" diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_enhanced_model.test.yaml b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_enhanced_model.test.yaml deleted file mode 100644 index 6eab33b52..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_enhanced_model.test.yaml +++ /dev/null @@ -1,29 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Using Enhanced Models (Local File) - cases: - - # This sample should default to using hello.wav - # and the phone_call model (only currently available enhanced model) - # - # Note: if the project used to run these tests isn't eligible for - # enhanced models, you will receive an error. - - name: speech_transcribe_enhanced_model (no arguments) - spec: - - call: - sample: speech_transcribe_enhanced_model - - assert_contains: - - literal: "hello" - - # Confirm that another file can be transcribed (use another .wav file) - - name: speech_transcribe_enhanced_model (--local_file_path) - spec: - - call: - sample: speech_transcribe_enhanced_model - params: - local_file_path: - literal: "resources/commercial_mono.wav" - - assert_contains: - - literal: "Chrome" diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_model_selection.test.yaml b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_model_selection.test.yaml deleted file mode 100644 index b5ec2d902..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_model_selection.test.yaml +++ /dev/null @@ -1,52 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Selecting a Transcription Model (Local File) - cases: - - # This sample should default to using hello.wav - # and the phone_call model - - name: speech_transcribe_model_selection (no arguments) - spec: - - call: - sample: speech_transcribe_model_selection - - assert_contains: - - literal: "Hello" - - # Confirm that another file can be transcribed (use another .wav file) - - name: speech_transcribe_model_selection (--local_file_path) - spec: - - call: - sample: speech_transcribe_model_selection - params: - local_file_path: - literal: "resources/commercial_mono.wav" - - assert_contains: - - literal: "Chrome" - - # Confirm that --model can be specified and the sample does not blow up - # - # Note: we are not using example audio files which result in deterministically - # different results when using different models. so we simply test - # that regular transcription continues to work. - - name: speech_transcribe_model_selection (--model) - spec: - - call: - sample: speech_transcribe_model_selection - params: - model: - literal: video - - assert_contains: - - literal: "hello" - - # Confirm that --model is being passed through by providing an invalid model - - name: speech_transcribe_model_selection (invalid --model) - spec: - - call_may_fail: - sample: speech_transcribe_model_selection - params: - model: - literal: I_DONT_EXIST - - assert_contains: - - literal: "Incorrect model specified" diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_model_selection_gcs.test.yaml b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_model_selection_gcs.test.yaml deleted file mode 100644 index 60c45c975..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_model_selection_gcs.test.yaml +++ /dev/null @@ -1,52 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Selecting a Transcription Model (Cloud Storage) - cases: - - # This sample should default to using gs://cloud-samples-data/speech/hello.wav - # and the phone_call model - - name: speech_transcribe_model_selection_gcs (no arguments) - spec: - - call: - sample: speech_transcribe_model_selection_gcs - - assert_contains: - - literal: "Hello" - - # Confirm that another file can be transcribed (use another .wav file) - - name: speech_transcribe_model_selection_gcs (--local_file_path) - spec: - - call: - sample: speech_transcribe_model_selection_gcs - params: - storage_uri: - literal: "gs://cloud-samples-data/speech/commercial_mono.wav" - - assert_contains: - - literal: "Chrome" - - # Confirm that --model can be specified and the sample does not blow up - # - # Note: we are not using example audio files which result in deterministically - # different results when using different models. so we simply test - # that regular transcription continues to work. - - name: speech_transcribe_model_selection_gcs (--model) - spec: - - call: - sample: speech_transcribe_model_selection_gcs - params: - model: - literal: video - - assert_contains: - - literal: "hello" - - # Confirm that --model is being passed through by providing an invalid model - - name: speech_transcribe_model_selection_gcs (invalid --model) - spec: - - call_may_fail: - sample: speech_transcribe_model_selection_gcs - params: - model: - literal: I_DONT_EXIST - - assert_contains: - - literal: "Incorrect model specified" diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_multichannel.test.yaml b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_multichannel.test.yaml deleted file mode 100644 index 9d5379dc9..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_multichannel.test.yaml +++ /dev/null @@ -1,31 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Multi-Channel Audio Transcription (Local File) - cases: - - # This sample should default to using multi.wav (2 channels) - - name: speech_transcribe_multichannel (no arguments) - spec: - - call: - sample: speech_transcribe_multichannel - - assert_contains: - - literal: "Channel tag: 1" - - literal: "Channel tag: 2" - - literal: "how are you doing" - - # Confirm that another file can be transcribed (use another 2 channel .wav file) - - name: speech_transcribe_multichannel (--local_file_path) - spec: - - call: - sample: speech_transcribe_multichannel - params: - local_file_path: - literal: "resources/brooklyn_bridge.wav" - - assert_contains: - # Only one channel of data is present in brooklyn_bridge.wav - - literal: "Channel tag:" - - literal: "how old is the Brooklyn Bridge" - - assert_not_contains: - - literal: "how are you doing" diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_multichannel_gcs.test.yaml b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_multichannel_gcs.test.yaml deleted file mode 100644 index 64c9340ce..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_multichannel_gcs.test.yaml +++ /dev/null @@ -1,32 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Multi-Channel Audio Transcription (Cloud Storage) - cases: - - # This sample should default to using gs://cloud-samples-data/speech/multi.wav - # with 2 audio channels of data - - name: speech_transcribe_multichannel_gcs (no arguments) - spec: - - call: - sample: speech_transcribe_multichannel_gcs - - assert_contains: - - literal: "Channel tag: 1" - - literal: "Channel tag: 2" - - literal: "how are you doing" - - # Confirm that another file can be transcribed (use another 2 channel .wav file) - - name: speech_transcribe_multichannel_gcs (--storage_uri) - spec: - - call: - sample: speech_transcribe_multichannel_gcs - params: - storage_uri: - literal: "gs://cloud-samples-data/speech/brooklyn_bridge.wav" - - assert_contains: - # Only one channel of data is present in brooklyn_bridge.wav - - literal: "Channel tag:" - - literal: "how old is the Brooklyn Bridge" - - assert_not_contains: - - literal: "how are you doing" diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_sync.test.yaml b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_sync.test.yaml deleted file mode 100644 index 47cc8c1a4..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_sync.test.yaml +++ /dev/null @@ -1,28 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Transcribe Audio File (Local File) - cases: - - # This sample should default to using brooklyn_bridge.raw - # with explicitly configured sample_rate_hertz and encoding - - name: speech_transcribe_sync (no arguments) - spec: - - call: - sample: speech_transcribe_sync - - assert_contains: - - literal: "how old is the Brooklyn Bridge" - - # Confirm that another file can be transcribed (use another .raw PCM file) - - name: speech_transcribe_sync (--local_file_path) - spec: - - call: - sample: speech_transcribe_sync - params: - local_file_path: - literal: "resources/hello.raw" - - assert_contains: - - literal: "hello" - - assert_not_contains: - - literal: "how old is the Brooklyn Bridge" diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_sync_gcs.test.yaml b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_sync_gcs.test.yaml deleted file mode 100644 index 3defdf289..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1/test/speech_transcribe_sync_gcs.test.yaml +++ /dev/null @@ -1,28 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Transcript Audio File (Cloud Storage) - cases: - - # This sample should default to using gs://cloud-samples-data/speech/brooklyn_bridge.raw - # with explicitly configured sample_rate_hertz and encoding - - name: speech_transcribe_sync_gcs (no arguments) - spec: - - call: - sample: speech_transcribe_sync_gcs - - assert_contains: - - literal: "how old is the Brooklyn Bridge" - - # Confirm that another file can be transcribed (use another .raw PCM file) - - name: speech_transcribe_sync_gcs (--storage_uri) - spec: - - call: - sample: speech_transcribe_sync_gcs - params: - storage_uri: - literal: "gs://cloud-samples-data/speech/hello.raw" - - assert_contains: - - literal: "hello" - - assert_not_contains: - - literal: "how old is the Brooklyn Bridge" diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechAdaptationBeta.java b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechAdaptationBeta.java deleted file mode 100644 index 9ebda210e..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechAdaptationBeta.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * 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. - */ -// DO NOT EDIT! This is a generated sample ("Request", "speech_adaptation_beta") -// sample-metadata: -// title: Speech Adaptation (Cloud Storage) -// description: Transcribe a short audio file with speech adaptation. -// usage: gradle run -PmainClass=com.google.cloud.examples.speech.v1p1beta1.SpeechAdaptationBeta [--args='[--storage_uri "gs://cloud-samples-data/speech/brooklyn_bridge.mp3"] [--phrase "Brooklyn Bridge"]'] - -package com.google.cloud.examples.speech.v1p1beta1; - -import com.google.cloud.speech.v1p1beta1.RecognitionAudio; -import com.google.cloud.speech.v1p1beta1.RecognitionConfig; -import com.google.cloud.speech.v1p1beta1.RecognizeRequest; -import com.google.cloud.speech.v1p1beta1.RecognizeResponse; -import com.google.cloud.speech.v1p1beta1.SpeechClient; -import com.google.cloud.speech.v1p1beta1.SpeechContext; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult; -import java.util.Arrays; -import java.util.List; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; - -public class SpeechAdaptationBeta { - // [START speech_adaptation_beta] - /* - * Please include the following imports to run this sample. - * - * import com.google.cloud.speech.v1p1beta1.RecognitionAudio; - * import com.google.cloud.speech.v1p1beta1.RecognitionConfig; - * import com.google.cloud.speech.v1p1beta1.RecognizeRequest; - * import com.google.cloud.speech.v1p1beta1.RecognizeResponse; - * import com.google.cloud.speech.v1p1beta1.SpeechClient; - * import com.google.cloud.speech.v1p1beta1.SpeechContext; - * import com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; - * import com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult; - * import java.util.Arrays; - * import java.util.List; - */ - - public static void sampleRecognize() { - // TODO(developer): Replace these variables before running the sample. - String storageUri = "gs://cloud-samples-data/speech/brooklyn_bridge.mp3"; - String phrase = "Brooklyn Bridge"; - sampleRecognize(storageUri, phrase); - } - - /** - * Transcribe a short audio file with speech adaptation. - * - * @param storageUri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE] - * @param phrase Phrase "hints" help recognize the specified phrases from your audio. - */ - public static void sampleRecognize(String storageUri, String phrase) { - try (SpeechClient speechClient = SpeechClient.create()) { - List phrases = Arrays.asList(phrase); - - // Hint Boost. This value increases the probability that a specific - // phrase will be recognized over other similar sounding phrases. - // The higher the boost, the higher the chance of false positive - // recognition as well. Can accept wide range of positive values. - // Most use cases are best served with values between 0 and 20. - // Using a binary search happroach may help you find the optimal value. - float boost = 20.0F; - SpeechContext speechContextsElement = - SpeechContext.newBuilder().addAllPhrases(phrases).setBoost(boost).build(); - List speechContexts = Arrays.asList(speechContextsElement); - - // Sample rate in Hertz of the audio data sent - int sampleRateHertz = 44100; - - // The language of the supplied audio - String languageCode = "en-US"; - - // Encoding of audio data sent. This sample sets this explicitly. - // This field is optional for FLAC and WAV audio formats. - RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.MP3; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .addAllSpeechContexts(speechContexts) - .setSampleRateHertz(sampleRateHertz) - .setLanguageCode(languageCode) - .setEncoding(encoding) - .build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(storageUri).build(); - RecognizeRequest request = - RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - RecognizeResponse response = speechClient.recognize(request); - for (SpeechRecognitionResult result : response.getResultsList()) { - // First alternative is the most probable result - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript: %s\n", alternative.getTranscript()); - } - } catch (Exception exception) { - System.err.println("Failed to create the client due to: " + exception); - } - } - // [END speech_adaptation_beta] - - public static void main(String[] args) throws Exception { - Options options = new Options(); - options.addOption( - Option.builder("").required(false).hasArg(true).longOpt("storage_uri").build()); - options.addOption(Option.builder("").required(false).hasArg(true).longOpt("phrase").build()); - - CommandLine cl = (new DefaultParser()).parse(options, args); - String storageUri = - cl.getOptionValue("storage_uri", "gs://cloud-samples-data/speech/brooklyn_bridge.mp3"); - String phrase = cl.getOptionValue("phrase", "Brooklyn Bridge"); - - sampleRecognize(storageUri, phrase); - } -} diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechContextsClassesBeta.java b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechContextsClassesBeta.java deleted file mode 100644 index f42742c24..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechContextsClassesBeta.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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. - */ -// DO NOT EDIT! This is a generated sample ("Request", "speech_contexts_classes_beta") -// sample-metadata: -// title: Using Context Classes (Cloud Storage) -// description: Transcribe a short audio file with static context classes. -// usage: gradle run -PmainClass=com.google.cloud.examples.speech.v1p1beta1.SpeechContextsClassesBeta [--args='[--storage_uri "gs://cloud-samples-data/speech/time.mp3"] [--phrase "$TIME"]'] - -package com.google.cloud.examples.speech.v1p1beta1; - -import com.google.cloud.speech.v1p1beta1.RecognitionAudio; -import com.google.cloud.speech.v1p1beta1.RecognitionConfig; -import com.google.cloud.speech.v1p1beta1.RecognizeRequest; -import com.google.cloud.speech.v1p1beta1.RecognizeResponse; -import com.google.cloud.speech.v1p1beta1.SpeechClient; -import com.google.cloud.speech.v1p1beta1.SpeechContext; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult; -import java.util.Arrays; -import java.util.List; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; - -public class SpeechContextsClassesBeta { - // [START speech_contexts_classes_beta] - /* - * Please include the following imports to run this sample. - * - * import com.google.cloud.speech.v1p1beta1.RecognitionAudio; - * import com.google.cloud.speech.v1p1beta1.RecognitionConfig; - * import com.google.cloud.speech.v1p1beta1.RecognizeRequest; - * import com.google.cloud.speech.v1p1beta1.RecognizeResponse; - * import com.google.cloud.speech.v1p1beta1.SpeechClient; - * import com.google.cloud.speech.v1p1beta1.SpeechContext; - * import com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; - * import com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult; - * import java.util.Arrays; - * import java.util.List; - */ - - public static void sampleRecognize() { - // TODO(developer): Replace these variables before running the sample. - String storageUri = "gs://cloud-samples-data/speech/time.mp3"; - String phrase = "$TIME"; - sampleRecognize(storageUri, phrase); - } - - /** - * Transcribe a short audio file with static context classes. - * - * @param storageUri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE] - * @param phrase Phrase "hints" help recognize the specified phrases from your audio. In this - * sample we are using a static class phrase ($TIME). Classes represent groups of words that - * represent common concepts that occur in natural language. - */ - public static void sampleRecognize(String storageUri, String phrase) { - try (SpeechClient speechClient = SpeechClient.create()) { - List phrases = Arrays.asList(phrase); - SpeechContext speechContextsElement = - SpeechContext.newBuilder().addAllPhrases(phrases).build(); - List speechContexts = Arrays.asList(speechContextsElement); - - // The language of the supplied audio - String languageCode = "en-US"; - - // Sample rate in Hertz of the audio data sent - int sampleRateHertz = 24000; - - // Encoding of audio data sent. This sample sets this explicitly. - // This field is optional for FLAC and WAV audio formats. - RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.MP3; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .addAllSpeechContexts(speechContexts) - .setLanguageCode(languageCode) - .setSampleRateHertz(sampleRateHertz) - .setEncoding(encoding) - .build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(storageUri).build(); - RecognizeRequest request = - RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - RecognizeResponse response = speechClient.recognize(request); - for (SpeechRecognitionResult result : response.getResultsList()) { - // First alternative is the most probable result - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript: %s\n", alternative.getTranscript()); - } - } catch (Exception exception) { - System.err.println("Failed to create the client due to: " + exception); - } - } - // [END speech_contexts_classes_beta] - - public static void main(String[] args) throws Exception { - Options options = new Options(); - options.addOption( - Option.builder("").required(false).hasArg(true).longOpt("storage_uri").build()); - options.addOption(Option.builder("").required(false).hasArg(true).longOpt("phrase").build()); - - CommandLine cl = (new DefaultParser()).parse(options, args); - String storageUri = cl.getOptionValue("storage_uri", "gs://cloud-samples-data/speech/time.mp3"); - String phrase = cl.getOptionValue("phrase", "$TIME"); - - sampleRecognize(storageUri, phrase); - } -} diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechQuickstartBeta.java b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechQuickstartBeta.java deleted file mode 100644 index ebeebb619..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechQuickstartBeta.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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. - */ -// DO NOT EDIT! This is a generated sample ("Request", "speech_quickstart_beta") -// sample-metadata: -// title: Quickstart Beta -// description: Performs synchronous speech recognition on an audio file -// usage: gradle run -PmainClass=com.google.cloud.examples.speech.v1p1beta1.SpeechQuickstartBeta [--args='[--storage_uri "gs://cloud-samples-data/speech/brooklyn_bridge.mp3"]'] - -package com.google.cloud.examples.speech.v1p1beta1; - -import com.google.cloud.speech.v1p1beta1.RecognitionAudio; -import com.google.cloud.speech.v1p1beta1.RecognitionConfig; -import com.google.cloud.speech.v1p1beta1.RecognizeRequest; -import com.google.cloud.speech.v1p1beta1.RecognizeResponse; -import com.google.cloud.speech.v1p1beta1.SpeechClient; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; - -public class SpeechQuickstartBeta { - // [START speech_quickstart_beta] - /* - * Please include the following imports to run this sample. - * - * import com.google.cloud.speech.v1p1beta1.RecognitionAudio; - * import com.google.cloud.speech.v1p1beta1.RecognitionConfig; - * import com.google.cloud.speech.v1p1beta1.RecognizeRequest; - * import com.google.cloud.speech.v1p1beta1.RecognizeResponse; - * import com.google.cloud.speech.v1p1beta1.SpeechClient; - * import com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; - * import com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult; - */ - - public static void sampleRecognize() { - // TODO(developer): Replace these variables before running the sample. - String storageUri = "gs://cloud-samples-data/speech/brooklyn_bridge.mp3"; - sampleRecognize(storageUri); - } - - /** - * Performs synchronous speech recognition on an audio file - * - * @param storageUri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE] - */ - public static void sampleRecognize(String storageUri) { - try (SpeechClient speechClient = SpeechClient.create()) { - - // The language of the supplied audio - String languageCode = "en-US"; - - // Sample rate in Hertz of the audio data sent - int sampleRateHertz = 44100; - - // Encoding of audio data sent. This sample sets this explicitly. - // This field is optional for FLAC and WAV audio formats. - RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.MP3; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setLanguageCode(languageCode) - .setSampleRateHertz(sampleRateHertz) - .setEncoding(encoding) - .build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(storageUri).build(); - RecognizeRequest request = - RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - RecognizeResponse response = speechClient.recognize(request); - for (SpeechRecognitionResult result : response.getResultsList()) { - // First alternative is the most probable result - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript: %s\n", alternative.getTranscript()); - } - } catch (Exception exception) { - System.err.println("Failed to create the client due to: " + exception); - } - } - // [END speech_quickstart_beta] - - public static void main(String[] args) throws Exception { - Options options = new Options(); - options.addOption( - Option.builder("").required(false).hasArg(true).longOpt("storage_uri").build()); - - CommandLine cl = (new DefaultParser()).parse(options, args); - String storageUri = - cl.getOptionValue("storage_uri", "gs://cloud-samples-data/speech/brooklyn_bridge.mp3"); - - sampleRecognize(storageUri); - } -} diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeAutoPunctuationBeta.java b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeAutoPunctuationBeta.java deleted file mode 100644 index f09386703..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeAutoPunctuationBeta.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * 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. - */ -// DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_auto_punctuation_beta") -// sample-metadata: -// title: Getting punctuation in results (Local File) (Beta) -// description: Transcribe a short audio file with punctuation -// usage: gradle run -PmainClass=com.google.cloud.examples.speech.v1p1beta1.SpeechTranscribeAutoPunctuationBeta [--args='[--local_file_path "resources/commercial_mono.wav"]'] - -package com.google.cloud.examples.speech.v1p1beta1; - -import com.google.cloud.speech.v1p1beta1.RecognitionAudio; -import com.google.cloud.speech.v1p1beta1.RecognitionConfig; -import com.google.cloud.speech.v1p1beta1.RecognizeRequest; -import com.google.cloud.speech.v1p1beta1.RecognizeResponse; -import com.google.cloud.speech.v1p1beta1.SpeechClient; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult; -import com.google.protobuf.ByteString; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; - -public class SpeechTranscribeAutoPunctuationBeta { - // [START speech_transcribe_auto_punctuation_beta] - /* - * Please include the following imports to run this sample. - * - * import com.google.cloud.speech.v1p1beta1.RecognitionAudio; - * import com.google.cloud.speech.v1p1beta1.RecognitionConfig; - * import com.google.cloud.speech.v1p1beta1.RecognizeRequest; - * import com.google.cloud.speech.v1p1beta1.RecognizeResponse; - * import com.google.cloud.speech.v1p1beta1.SpeechClient; - * import com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; - * import com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult; - * import com.google.protobuf.ByteString; - * import java.nio.file.Files; - * import java.nio.file.Path; - * import java.nio.file.Paths; - */ - - public static void sampleRecognize() { - // TODO(developer): Replace these variables before running the sample. - String localFilePath = "resources/commercial_mono.wav"; - sampleRecognize(localFilePath); - } - - /** - * Transcribe a short audio file with punctuation - * - * @param localFilePath Path to local audio file, e.g. /path/audio.wav - */ - public static void sampleRecognize(String localFilePath) { - try (SpeechClient speechClient = SpeechClient.create()) { - - // When enabled, trascription results may include punctuation - // (available for select languages). - boolean enableAutomaticPunctuation = true; - - // The language of the supplied audio. Even though additional languages are - // provided by alternative_language_codes, a primary language is still required. - String languageCode = "en-US"; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEnableAutomaticPunctuation(enableAutomaticPunctuation) - .setLanguageCode(languageCode) - .build(); - Path path = Paths.get(localFilePath); - byte[] data = Files.readAllBytes(path); - ByteString content = ByteString.copyFrom(data); - RecognitionAudio audio = RecognitionAudio.newBuilder().setContent(content).build(); - RecognizeRequest request = - RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - RecognizeResponse response = speechClient.recognize(request); - for (SpeechRecognitionResult result : response.getResultsList()) { - // First alternative is the most probable result - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript: %s\n", alternative.getTranscript()); - } - } catch (Exception exception) { - System.err.println("Failed to create the client due to: " + exception); - } - } - // [END speech_transcribe_auto_punctuation_beta] - - public static void main(String[] args) throws Exception { - Options options = new Options(); - options.addOption( - Option.builder("").required(false).hasArg(true).longOpt("local_file_path").build()); - - CommandLine cl = (new DefaultParser()).parse(options, args); - String localFilePath = cl.getOptionValue("local_file_path", "resources/commercial_mono.wav"); - - sampleRecognize(localFilePath); - } -} diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeDiarizationBeta.java b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeDiarizationBeta.java deleted file mode 100644 index 5608ca263..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeDiarizationBeta.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * 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. - */ -// DO NOT EDIT! This is a generated sample ("LongRunningRequestAsync", "speech_transcribe_diarization_beta") -// sample-metadata: -// title: Separating different speakers (Local File) (LRO) (Beta) -// description: Print confidence level for individual words in a transcription of a short audio file -// Separating different speakers in an audio file recording -// usage: gradle run -PmainClass=com.google.cloud.examples.speech.v1p1beta1.SpeechTranscribeDiarizationBeta [--args='[--local_file_path "resources/commercial_mono.wav"]'] - -package com.google.cloud.examples.speech.v1p1beta1; - -import com.google.api.gax.longrunning.OperationFuture; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1p1beta1.RecognitionAudio; -import com.google.cloud.speech.v1p1beta1.RecognitionConfig; -import com.google.cloud.speech.v1p1beta1.SpeechClient; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult; -import com.google.cloud.speech.v1p1beta1.WordInfo; -import com.google.protobuf.ByteString; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; - -public class SpeechTranscribeDiarizationBeta { - // [START speech_transcribe_diarization_beta] - /* - * Please include the following imports to run this sample. - * - * import com.google.api.gax.longrunning.OperationFuture; - * import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; - * import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; - * import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; - * import com.google.cloud.speech.v1p1beta1.RecognitionAudio; - * import com.google.cloud.speech.v1p1beta1.RecognitionConfig; - * import com.google.cloud.speech.v1p1beta1.SpeechClient; - * import com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; - * import com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult; - * import com.google.cloud.speech.v1p1beta1.WordInfo; - * import com.google.protobuf.ByteString; - * import java.nio.file.Files; - * import java.nio.file.Path; - * import java.nio.file.Paths; - */ - - public static void sampleLongRunningRecognize() { - // TODO(developer): Replace these variables before running the sample. - String localFilePath = "resources/commercial_mono.wav"; - sampleLongRunningRecognize(localFilePath); - } - - /** - * Print confidence level for individual words in a transcription of a short audio file Separating - * different speakers in an audio file recording - * - * @param localFilePath Path to local audio file, e.g. /path/audio.wav - */ - public static void sampleLongRunningRecognize(String localFilePath) { - try (SpeechClient speechClient = SpeechClient.create()) { - - // If enabled, each word in the first alternative of each result will be - // tagged with a speaker tag to identify the speaker. - boolean enableSpeakerDiarization = true; - - // Optional. Specifies the estimated number of speakers in the conversation. - int diarizationSpeakerCount = 2; - - // The language of the supplied audio - String languageCode = "en-US"; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEnableSpeakerDiarization(enableSpeakerDiarization) - .setDiarizationSpeakerCount(diarizationSpeakerCount) - .setLanguageCode(languageCode) - .build(); - Path path = Paths.get(localFilePath); - byte[] data = Files.readAllBytes(path); - ByteString content = ByteString.copyFrom(data); - RecognitionAudio audio = RecognitionAudio.newBuilder().setContent(content).build(); - LongRunningRecognizeRequest request = - LongRunningRecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - OperationFuture future = - speechClient.longRunningRecognizeAsync(request); - - System.out.println("Waiting for operation to complete..."); - LongRunningRecognizeResponse response = future.get(); - for (SpeechRecognitionResult result : response.getResultsList()) { - // First alternative has words tagged with speakers - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript: %s\n", alternative.getTranscript()); - // Print the speakerTag of each word - for (WordInfo word : alternative.getWordsList()) { - System.out.printf("Word: %s\n", word.getWord()); - System.out.printf("Speaker tag: %s\n", word.getSpeakerTag()); - } - } - } catch (Exception exception) { - System.err.println("Failed to create the client due to: " + exception); - } - } - // [END speech_transcribe_diarization_beta] - - public static void main(String[] args) throws Exception { - Options options = new Options(); - options.addOption( - Option.builder("").required(false).hasArg(true).longOpt("local_file_path").build()); - - CommandLine cl = (new DefaultParser()).parse(options, args); - String localFilePath = cl.getOptionValue("local_file_path", "resources/commercial_mono.wav"); - - sampleLongRunningRecognize(localFilePath); - } -} diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeMultilanguageBeta.java b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeMultilanguageBeta.java deleted file mode 100644 index 31f4f0052..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeMultilanguageBeta.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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. - */ -// DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_multilanguage_beta") -// sample-metadata: -// title: Detecting language spoken automatically (Local File) (Beta) -// description: Transcribe a short audio file with language detected from a list of possible languages -// usage: gradle run -PmainClass=com.google.cloud.examples.speech.v1p1beta1.SpeechTranscribeMultilanguageBeta [--args='[--local_file_path "resources/brooklyn_bridge.flac"]'] - -package com.google.cloud.examples.speech.v1p1beta1; - -import com.google.cloud.speech.v1p1beta1.RecognitionAudio; -import com.google.cloud.speech.v1p1beta1.RecognitionConfig; -import com.google.cloud.speech.v1p1beta1.RecognizeRequest; -import com.google.cloud.speech.v1p1beta1.RecognizeResponse; -import com.google.cloud.speech.v1p1beta1.SpeechClient; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult; -import com.google.protobuf.ByteString; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Arrays; -import java.util.List; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; - -public class SpeechTranscribeMultilanguageBeta { - // [START speech_transcribe_multilanguage_beta] - /* - * Please include the following imports to run this sample. - * - * import com.google.cloud.speech.v1p1beta1.RecognitionAudio; - * import com.google.cloud.speech.v1p1beta1.RecognitionConfig; - * import com.google.cloud.speech.v1p1beta1.RecognizeRequest; - * import com.google.cloud.speech.v1p1beta1.RecognizeResponse; - * import com.google.cloud.speech.v1p1beta1.SpeechClient; - * import com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; - * import com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult; - * import com.google.protobuf.ByteString; - * import java.nio.file.Files; - * import java.nio.file.Path; - * import java.nio.file.Paths; - * import java.util.Arrays; - * import java.util.List; - */ - - public static void sampleRecognize() { - // TODO(developer): Replace these variables before running the sample. - String localFilePath = "resources/brooklyn_bridge.flac"; - sampleRecognize(localFilePath); - } - - /** - * Transcribe a short audio file with language detected from a list of possible languages - * - * @param localFilePath Path to local audio file, e.g. /path/audio.wav - */ - public static void sampleRecognize(String localFilePath) { - try (SpeechClient speechClient = SpeechClient.create()) { - - // The language of the supplied audio. Even though additional languages are - // provided by alternative_language_codes, a primary language is still required. - String languageCode = "fr"; - - // Specify up to 3 additional languages as possible alternative languages - // of the supplied audio. - String alternativeLanguageCodesElement = "es"; - String alternativeLanguageCodesElement2 = "en"; - List alternativeLanguageCodes = - Arrays.asList(alternativeLanguageCodesElement, alternativeLanguageCodesElement2); - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setLanguageCode(languageCode) - .addAllAlternativeLanguageCodes(alternativeLanguageCodes) - .build(); - Path path = Paths.get(localFilePath); - byte[] data = Files.readAllBytes(path); - ByteString content = ByteString.copyFrom(data); - RecognitionAudio audio = RecognitionAudio.newBuilder().setContent(content).build(); - RecognizeRequest request = - RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - RecognizeResponse response = speechClient.recognize(request); - for (SpeechRecognitionResult result : response.getResultsList()) { - // The languageCode which was detected as the most likely being spoken in the audio - System.out.printf("Detected language: %s\n", result.getLanguageCode()); - // First alternative is the most probable result - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript: %s\n", alternative.getTranscript()); - } - } catch (Exception exception) { - System.err.println("Failed to create the client due to: " + exception); - } - } - // [END speech_transcribe_multilanguage_beta] - - public static void main(String[] args) throws Exception { - Options options = new Options(); - options.addOption( - Option.builder("").required(false).hasArg(true).longOpt("local_file_path").build()); - - CommandLine cl = (new DefaultParser()).parse(options, args); - String localFilePath = cl.getOptionValue("local_file_path", "resources/brooklyn_bridge.flac"); - - sampleRecognize(localFilePath); - } -} diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeRecognitionMetadataBeta.java b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeRecognitionMetadataBeta.java deleted file mode 100644 index 096023951..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeRecognitionMetadataBeta.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * 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. - */ -// DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_recognition_metadata_beta") -// sample-metadata: -// title: Adding recognition metadata (Local File) (Beta) -// description: Adds additional details short audio file included in this recognition request -// usage: gradle run -PmainClass=com.google.cloud.examples.speech.v1p1beta1.SpeechTranscribeRecognitionMetadataBeta [--args='[--local_file_path "resources/commercial_mono.wav"]'] - -package com.google.cloud.examples.speech.v1p1beta1; - -import com.google.cloud.speech.v1p1beta1.RecognitionAudio; -import com.google.cloud.speech.v1p1beta1.RecognitionConfig; -import com.google.cloud.speech.v1p1beta1.RecognitionMetadata; -import com.google.cloud.speech.v1p1beta1.RecognizeRequest; -import com.google.cloud.speech.v1p1beta1.RecognizeResponse; -import com.google.cloud.speech.v1p1beta1.SpeechClient; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult; -import com.google.protobuf.ByteString; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; - -public class SpeechTranscribeRecognitionMetadataBeta { - // [START speech_transcribe_recognition_metadata_beta] - /* - * Please include the following imports to run this sample. - * - * import com.google.cloud.speech.v1p1beta1.RecognitionAudio; - * import com.google.cloud.speech.v1p1beta1.RecognitionConfig; - * import com.google.cloud.speech.v1p1beta1.RecognitionMetadata; - * import com.google.cloud.speech.v1p1beta1.RecognizeRequest; - * import com.google.cloud.speech.v1p1beta1.RecognizeResponse; - * import com.google.cloud.speech.v1p1beta1.SpeechClient; - * import com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; - * import com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult; - * import com.google.protobuf.ByteString; - * import java.nio.file.Files; - * import java.nio.file.Path; - * import java.nio.file.Paths; - */ - - public static void sampleRecognize() { - // TODO(developer): Replace these variables before running the sample. - String localFilePath = "resources/commercial_mono.wav"; - sampleRecognize(localFilePath); - } - - /** - * Adds additional details short audio file included in this recognition request - * - * @param localFilePath Path to local audio file, e.g. /path/audio.wav - */ - public static void sampleRecognize(String localFilePath) { - try (SpeechClient speechClient = SpeechClient.create()) { - - // The use case of the audio, e.g. PHONE_CALL, DISCUSSION, PRESENTATION, et al. - RecognitionMetadata.InteractionType interactionType = - RecognitionMetadata.InteractionType.VOICE_SEARCH; - - // The kind of device used to capture the audio - RecognitionMetadata.RecordingDeviceType recordingDeviceType = - RecognitionMetadata.RecordingDeviceType.SMARTPHONE; - - // The device used to make the recording. - // Arbitrary string, e.g. 'Pixel XL', 'VoIP', 'Cardioid Microphone', or other value. - String recordingDeviceName = "Pixel 3"; - RecognitionMetadata metadata = - RecognitionMetadata.newBuilder() - .setInteractionType(interactionType) - .setRecordingDeviceType(recordingDeviceType) - .setRecordingDeviceName(recordingDeviceName) - .build(); - - // The language of the supplied audio. Even though additional languages are - // provided by alternative_language_codes, a primary language is still required. - String languageCode = "en-US"; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setMetadata(metadata) - .setLanguageCode(languageCode) - .build(); - Path path = Paths.get(localFilePath); - byte[] data = Files.readAllBytes(path); - ByteString content = ByteString.copyFrom(data); - RecognitionAudio audio = RecognitionAudio.newBuilder().setContent(content).build(); - RecognizeRequest request = - RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - RecognizeResponse response = speechClient.recognize(request); - for (SpeechRecognitionResult result : response.getResultsList()) { - // First alternative is the most probable result - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript: %s\n", alternative.getTranscript()); - } - } catch (Exception exception) { - System.err.println("Failed to create the client due to: " + exception); - } - } - // [END speech_transcribe_recognition_metadata_beta] - - public static void main(String[] args) throws Exception { - Options options = new Options(); - options.addOption( - Option.builder("").required(false).hasArg(true).longOpt("local_file_path").build()); - - CommandLine cl = (new DefaultParser()).parse(options, args); - String localFilePath = cl.getOptionValue("local_file_path", "resources/commercial_mono.wav"); - - sampleRecognize(localFilePath); - } -} diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeWordLevelConfidenceBeta.java b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeWordLevelConfidenceBeta.java deleted file mode 100644 index 6f174df79..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/SpeechTranscribeWordLevelConfidenceBeta.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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. - */ -// DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_word_level_confidence_beta") -// sample-metadata: -// title: Enabling word-level confidence (Local File) (Beta) -// description: Print confidence level for individual words in a transcription of a short audio file. -// usage: gradle run -PmainClass=com.google.cloud.examples.speech.v1p1beta1.SpeechTranscribeWordLevelConfidenceBeta [--args='[--local_file_path "resources/brooklyn_bridge.flac"]'] - -package com.google.cloud.examples.speech.v1p1beta1; - -import com.google.cloud.speech.v1p1beta1.RecognitionAudio; -import com.google.cloud.speech.v1p1beta1.RecognitionConfig; -import com.google.cloud.speech.v1p1beta1.RecognizeRequest; -import com.google.cloud.speech.v1p1beta1.RecognizeResponse; -import com.google.cloud.speech.v1p1beta1.SpeechClient; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult; -import com.google.cloud.speech.v1p1beta1.WordInfo; -import com.google.protobuf.ByteString; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; - -public class SpeechTranscribeWordLevelConfidenceBeta { - // [START speech_transcribe_word_level_confidence_beta] - /* - * Please include the following imports to run this sample. - * - * import com.google.cloud.speech.v1p1beta1.RecognitionAudio; - * import com.google.cloud.speech.v1p1beta1.RecognitionConfig; - * import com.google.cloud.speech.v1p1beta1.RecognizeRequest; - * import com.google.cloud.speech.v1p1beta1.RecognizeResponse; - * import com.google.cloud.speech.v1p1beta1.SpeechClient; - * import com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; - * import com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult; - * import com.google.cloud.speech.v1p1beta1.WordInfo; - * import com.google.protobuf.ByteString; - * import java.nio.file.Files; - * import java.nio.file.Path; - * import java.nio.file.Paths; - */ - - public static void sampleRecognize() { - // TODO(developer): Replace these variables before running the sample. - String localFilePath = "resources/brooklyn_bridge.flac"; - sampleRecognize(localFilePath); - } - - /** - * Print confidence level for individual words in a transcription of a short audio file. - * - * @param localFilePath Path to local audio file, e.g. /path/audio.wav - */ - public static void sampleRecognize(String localFilePath) { - try (SpeechClient speechClient = SpeechClient.create()) { - - // When enabled, the first result returned by the API will include a list - // of words and the confidence level for each of those words. - boolean enableWordConfidence = true; - - // The language of the supplied audio - String languageCode = "en-US"; - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEnableWordConfidence(enableWordConfidence) - .setLanguageCode(languageCode) - .build(); - Path path = Paths.get(localFilePath); - byte[] data = Files.readAllBytes(path); - ByteString content = ByteString.copyFrom(data); - RecognitionAudio audio = RecognitionAudio.newBuilder().setContent(content).build(); - RecognizeRequest request = - RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - RecognizeResponse response = speechClient.recognize(request); - // The first result includes confidence levels per word - SpeechRecognitionResult result = response.getResultsList().get(0); - // First alternative is the most probable result - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript: %s\n", alternative.getTranscript()); - // Print the confidence level of each word - for (WordInfo word : alternative.getWordsList()) { - System.out.printf("Word: %s\n", word.getWord()); - System.out.printf("Confidence: %s\n", word.getConfidence()); - } - } catch (Exception exception) { - System.err.println("Failed to create the client due to: " + exception); - } - } - // [END speech_transcribe_word_level_confidence_beta] - - public static void main(String[] args) throws Exception { - Options options = new Options(); - options.addOption( - Option.builder("").required(false).hasArg(true).longOpt("local_file_path").build()); - - CommandLine cl = (new DefaultParser()).parse(options, args); - String localFilePath = cl.getOptionValue("local_file_path", "resources/brooklyn_bridge.flac"); - - sampleRecognize(localFilePath); - } -} diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/speech.v1p1beta1.java.yaml b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/speech.v1p1beta1.java.yaml deleted file mode 100644 index d03cc3ac6..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/speech.v1p1beta1.java.yaml +++ /dev/null @@ -1,50 +0,0 @@ ---- -type: manifest/samples -schema_version: 3 -java: &java - environment: "java" - bin: "mvn exec:java" - base_path: "samples/src/main/java/com/google/cloud/examples/speech/v1p1beta1" - package: "com.google.cloud.examples.speech.v1p1beta1" - invocation: "{bin} -Dexec.mainClass={class} -Dexec.args='@args'" -samples: -- <<: *java - sample: "speech_contexts_classes_beta" - path: "{base_path}/SpeechContextsClassesBeta.java" - class: "{package}.SpeechContextsClassesBeta" - region_tag: "speech_contexts_classes_beta" -- <<: *java - sample: "speech_transcribe_auto_punctuation_beta" - path: "{base_path}/SpeechTranscribeAutoPunctuationBeta.java" - class: "{package}.SpeechTranscribeAutoPunctuationBeta" - region_tag: "speech_transcribe_auto_punctuation_beta" -- <<: *java - sample: "speech_quickstart_beta" - path: "{base_path}/SpeechQuickstartBeta.java" - class: "{package}.SpeechQuickstartBeta" - region_tag: "speech_quickstart_beta" -- <<: *java - sample: "speech_transcribe_word_level_confidence_beta" - path: "{base_path}/SpeechTranscribeWordLevelConfidenceBeta.java" - class: "{package}.SpeechTranscribeWordLevelConfidenceBeta" - region_tag: "speech_transcribe_word_level_confidence_beta" -- <<: *java - sample: "speech_adaptation_beta" - path: "{base_path}/SpeechAdaptationBeta.java" - class: "{package}.SpeechAdaptationBeta" - region_tag: "speech_adaptation_beta" -- <<: *java - sample: "speech_transcribe_multilanguage_beta" - path: "{base_path}/SpeechTranscribeMultilanguageBeta.java" - class: "{package}.SpeechTranscribeMultilanguageBeta" - region_tag: "speech_transcribe_multilanguage_beta" -- <<: *java - sample: "speech_transcribe_recognition_metadata_beta" - path: "{base_path}/SpeechTranscribeRecognitionMetadataBeta.java" - class: "{package}.SpeechTranscribeRecognitionMetadataBeta" - region_tag: "speech_transcribe_recognition_metadata_beta" -- <<: *java - sample: "speech_transcribe_diarization_beta" - path: "{base_path}/SpeechTranscribeDiarizationBeta.java" - class: "{package}.SpeechTranscribeDiarizationBeta" - region_tag: "speech_transcribe_diarization_beta" diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_adaptation_beta.test.yaml b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_adaptation_beta.test.yaml deleted file mode 100644 index 4efe8e83f..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_adaptation_beta.test.yaml +++ /dev/null @@ -1,11 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Speech-to-Text Sample Tests For Speech Adaptation - cases: - - name: speech_adaptation_beta - spec: - - call: {sample: speech_adaptation_beta} - - assert_contains: - - literal: "how old is the Brooklyn Bridge" diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_contexts_classes_beta.test.yaml b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_contexts_classes_beta.test.yaml deleted file mode 100644 index b6dccfc71..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_contexts_classes_beta.test.yaml +++ /dev/null @@ -1,11 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Speech-to-Text Sample Tests For Speech Contexts Static Classes - cases: - - name: speech_contexts_classes_beta - spec: - - call: {sample: speech_contexts_classes_beta} - - assert_contains: - - literal: "the time is 5:45 p.m." diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_quickstart_beta.test.yaml b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_quickstart_beta.test.yaml deleted file mode 100644 index bd5bf6700..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_quickstart_beta.test.yaml +++ /dev/null @@ -1,11 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Speech-to-Text Sample Tests For Quickstart - cases: - - name: speech_quickstart_beta - spec: - - call: {sample: speech_quickstart_beta} - - assert_contains: - - literal: "how old is the Brooklyn Bridge" diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_transcribe_auto_punctuation_beta.test.yaml b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_transcribe_auto_punctuation_beta.test.yaml deleted file mode 100644 index 1ab5f79a0..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_transcribe_auto_punctuation_beta.test.yaml +++ /dev/null @@ -1,28 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Getting punctuation in results (Local File) (Beta) - cases: - - # This sample should default to using commercial_mono.wav - - name: speech_transcribe_auto_punctuation_beta (no arguments) - spec: - - call: - sample: speech_transcribe_auto_punctuation_beta - - assert_contains: - # Simply assert that actual punctuation is present from commercial_mono.wav - - literal: "?" - - literal: "," - - literal: "" - - # Confirm that another file can be transcribed (use another file) - - name: speech_transcribe_auto_punctuation_beta (--local_file_path) - spec: - - call: - sample: speech_transcribe_auto_punctuation_beta - params: - local_file_path: - literal: "resources/brooklyn_bridge.flac" - - assert_contains: - - literal: "How old is the Brooklyn Bridge?" diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_transcribe_diarization_beta.test.yaml b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_transcribe_diarization_beta.test.yaml deleted file mode 100644 index 409e4b54b..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_transcribe_diarization_beta.test.yaml +++ /dev/null @@ -1,40 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Separating different speakers (Local File) (LRO) (Beta) - cases: - - # This sample should default to using commercial_mono.wav - - name: speech_transcribe_diarization_beta (no arguments) - spec: - - call: - sample: speech_transcribe_diarization_beta - - assert_contains: - - literal: "Word: Chrome" - # The identifier given to each speaker is non-deterministic. - # For two speakers, it can be 0 and 1, 0 and 2, or other variations. - # - # The example audio file has two speakers, but this test is - # not verifying that greater than one speaker is detected. - - literal: "Speaker tag:" - - # Confirm that another file can be transcribed (use another .flac file) - - name: speech_transcribe_diarization_beta (--local_file_path) - spec: - - call: - sample: speech_transcribe_diarization_beta - params: - local_file_path: - literal: "resources/multi.flac" - - assert_contains: - - literal: "how are you doing" - - literal: "Word: doing" - # The identifier given to each speaker is non-deterministic. - # For two speakers, it can be 0 and 1, 0 and 2, or other variations. - # - # The example audio file has two speakers, but this test is - # not verifying that greater than one speaker is detected. - - literal: "Speaker tag:" - - assert_not_contains: - - literal: "Chrome" diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_transcribe_multilanguage_beta.test.yaml b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_transcribe_multilanguage_beta.test.yaml deleted file mode 100644 index d9f2d7109..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_transcribe_multilanguage_beta.test.yaml +++ /dev/null @@ -1,33 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Detecting language spoken automatically (Local File) (Beta) - cases: - - # This sample should default to using brooklyn_bridge.flac - - name: speech_transcribe_multilanguage_beta (no arguments) - spec: - - call: - sample: speech_transcribe_multilanguage_beta - - assert_contains: - - literal: "how old is the Brooklyn Bridge" - # Note: the primary language_code given was not English, but - # English was provided in the list of alternative_language_codes - - literal: "Detected language: en-us" - - # Confirm that another file can be transcribed (use another .flac file) - - name: speech_transcribe_multilanguage_beta (--local_file_path) - spec: - - call: - sample: speech_transcribe_multilanguage_beta - params: - local_file_path: - literal: "resources/multi.flac" - - assert_contains: - - literal: "how are you doing" - # Note: the primary language_code given was not English, but - # English was provided in the list of alternative_language_codes - - literal: "Detected language: en-us" - - assert_not_contains: - - literal: "how old is the Brooklyn Bridge" diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_transcribe_recognition_metadata_beta.test.yaml b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_transcribe_recognition_metadata_beta.test.yaml deleted file mode 100644 index 57cf24a1d..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_transcribe_recognition_metadata_beta.test.yaml +++ /dev/null @@ -1,27 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Adding recognition metadata (Local File) (Beta) - cases: - - # This sample should default to using commercial_mono.wav - - name: speech_transcribe_recognition_metadata_beta (no arguments) - spec: - - call: - sample: speech_transcribe_recognition_metadata_beta - - assert_contains: - - literal: "Chrome" - - # Confirm that another file can be transcribed (use another file) - - name: speech_transcribe_recognition_metadata_beta (--local_file_path) - spec: - - call: - sample: speech_transcribe_recognition_metadata_beta - params: - local_file_path: - literal: "resources/brooklyn_bridge.flac" - - assert_contains: - - literal: "how old is the Brooklyn Bridge" - - assert_not_contains: - - literal: "Chrome" diff --git a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_transcribe_word_level_confidence_beta.test.yaml b/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_transcribe_word_level_confidence_beta.test.yaml deleted file mode 100644 index 0d7d60570..000000000 --- a/samples/generated/src/main/java/com/google/cloud/examples/speech/v1p1beta1/test/speech_transcribe_word_level_confidence_beta.test.yaml +++ /dev/null @@ -1,35 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Enabling word-level confidence (Local File) (Beta) - cases: - - # This sample should default to using brooklyn_bridge.flac - - name: speech_transcribe_word_level_confidence_beta (no arguments) - spec: - - call: - sample: speech_transcribe_word_level_confidence_beta - - assert_contains: - - literal: "how old is the Brooklyn Bridge" - - literal: "Word: how" - - literal: "Word: old" - - literal: "Word: is" - - literal: "Confidence: 0." - - # Confirm that another file can be transcribed (use another .flac file) - - name: speech_transcribe_word_level_confidence_beta (--local_file_path) - spec: - - call: - sample: speech_transcribe_word_level_confidence_beta - params: - local_file_path: - literal: "resources/multi.flac" - - assert_contains: - - literal: "how are you doing" - - literal: "Word: how" - - literal: "Word: are" - - literal: "Word: you" - - literal: "Confidence: 0." - - assert_not_contains: - - literal: "how old is the Brooklyn Bridge" diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml deleted file mode 100644 index 1902085c4..000000000 --- a/samples/install-without-bom/pom.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - 4.0.0 - com.google.cloud - google-cloud-speech-install-without-bom - jar - Google Cloud Speech Install Without Bom - https://github.com/googleapis/java-speech - - - - com.google.cloud.samples - shared-configuration - 1.0.18 - - - - 1.8 - 1.8 - UTF-8 - - - - - - - com.google.cloud - google-cloud-speech - 1.24.0 - - - - commons-cli - commons-cli - 1.4 - - - junit - junit - 4.13 - test - - - com.google.truth - truth - 1.0.1 - test - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.2.0 - - - add-snippets-source - - add-source - - - - ../snippets/src/main/java - - - - - add-snippets-tests - - add-test-source - - - - ../snippets/src/test/java - - - - - - - - diff --git a/samples/install-without-bom/resources/Google_Gnome.wav b/samples/install-without-bom/resources/Google_Gnome.wav deleted file mode 100644 index 2f497b7fb..000000000 Binary files a/samples/install-without-bom/resources/Google_Gnome.wav and /dev/null differ diff --git a/samples/install-without-bom/resources/audio.raw b/samples/install-without-bom/resources/audio.raw deleted file mode 100644 index 5ebf79d3c..000000000 Binary files a/samples/install-without-bom/resources/audio.raw and /dev/null differ diff --git a/samples/install-without-bom/resources/commercial_mono.wav b/samples/install-without-bom/resources/commercial_mono.wav deleted file mode 100644 index e6b9ed434..000000000 Binary files a/samples/install-without-bom/resources/commercial_mono.wav and /dev/null differ diff --git a/samples/install-without-bom/resources/commercial_stereo.wav b/samples/install-without-bom/resources/commercial_stereo.wav deleted file mode 100644 index 467f36877..000000000 Binary files a/samples/install-without-bom/resources/commercial_stereo.wav and /dev/null differ diff --git a/samples/pom.xml b/samples/pom.xml deleted file mode 100644 index f208273f7..000000000 --- a/samples/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - 4.0.0 - com.google.cloud - google-cloud-google-cloud-speech-samples - 0.0.1-SNAPSHOT - pom - Google Cloud Speech Samples Parent - https://github.com/googleapis/java-speech - - Java idiomatic client for Google Cloud Platform services. - - - - - com.google.cloud.samples - shared-configuration - 1.0.18 - - - - 1.8 - 1.8 - UTF-8 - - - - install-without-bom - snapshot - snippets - - - - - - org.apache.maven.plugins - maven-deploy-plugin - 2.8.2 - - true - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.8 - - true - - - - - diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml deleted file mode 100644 index 4e439e15f..000000000 --- a/samples/snapshot/pom.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - 4.0.0 - com.google.cloud - google-cloud-speech-snapshot - jar - Google Cloud Speech Snapshot Samples - https://github.com/googleapis/java-speech - - - - com.google.cloud.samples - shared-configuration - 1.0.18 - - - - 1.8 - 1.8 - UTF-8 - - - - - - - com.google.cloud - google-cloud-speech - 1.24.2-SNAPSHOT - - - - commons-cli - commons-cli - 1.4 - - - junit - junit - 4.13 - test - - - com.google.truth - truth - 1.0.1 - test - - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.2.0 - - - add-snippets-source - - add-source - - - - ../snippets/src/main/java - - - - - add-snippets-tests - - add-test-source - - - - ../snippets/src/test/java - - - - - - - - \ No newline at end of file diff --git a/samples/snapshot/resources/Google_Gnome.wav b/samples/snapshot/resources/Google_Gnome.wav deleted file mode 100644 index 2f497b7fb..000000000 Binary files a/samples/snapshot/resources/Google_Gnome.wav and /dev/null differ diff --git a/samples/snapshot/resources/audio.raw b/samples/snapshot/resources/audio.raw deleted file mode 100644 index 5ebf79d3c..000000000 Binary files a/samples/snapshot/resources/audio.raw and /dev/null differ diff --git a/samples/snapshot/resources/commercial_mono.wav b/samples/snapshot/resources/commercial_mono.wav deleted file mode 100644 index e6b9ed434..000000000 Binary files a/samples/snapshot/resources/commercial_mono.wav and /dev/null differ diff --git a/samples/snapshot/resources/commercial_stereo.wav b/samples/snapshot/resources/commercial_stereo.wav deleted file mode 100644 index 467f36877..000000000 Binary files a/samples/snapshot/resources/commercial_stereo.wav and /dev/null differ diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml deleted file mode 100644 index 94f27b32b..000000000 --- a/samples/snippets/pom.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - 4.0.0 - com.google.cloud - google-cloud-speech-snippets - jar - Google Cloud Speech Snippets - https://github.com/googleapis/java-speech - - - - com.google.cloud.samples - shared-configuration - 1.0.18 - - - - 1.8 - 1.8 - UTF-8 - - - - - - - - com.google.cloud - libraries-bom - 10.1.0 - pom - import - - - - - - - com.google.cloud - google-cloud-speech - - - - commons-cli - commons-cli - 1.4 - - - junit - junit - 4.13 - test - - - com.google.truth - truth - 1.0.1 - test - - - - - diff --git a/samples/snippets/resources/Google_Gnome.wav b/samples/snippets/resources/Google_Gnome.wav deleted file mode 100644 index 2f497b7fb..000000000 Binary files a/samples/snippets/resources/Google_Gnome.wav and /dev/null differ diff --git a/samples/snippets/resources/audio.raw b/samples/snippets/resources/audio.raw deleted file mode 100644 index 5ebf79d3c..000000000 Binary files a/samples/snippets/resources/audio.raw and /dev/null differ diff --git a/samples/snippets/resources/commercial_mono.wav b/samples/snippets/resources/commercial_mono.wav deleted file mode 100644 index e6b9ed434..000000000 Binary files a/samples/snippets/resources/commercial_mono.wav and /dev/null differ diff --git a/samples/snippets/resources/commercial_stereo.wav b/samples/snippets/resources/commercial_stereo.wav deleted file mode 100644 index 467f36877..000000000 Binary files a/samples/snippets/resources/commercial_stereo.wav and /dev/null differ diff --git a/samples/snippets/src/main/java/com/example/speech/InfiniteStreamRecognize.java b/samples/snippets/src/main/java/com/example/speech/InfiniteStreamRecognize.java deleted file mode 100644 index fa045ae07..000000000 --- a/samples/snippets/src/main/java/com/example/speech/InfiniteStreamRecognize.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Copyright 2018 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.speech; - -// [START speech_transcribe_infinite_streaming] - -import com.google.api.gax.rpc.ClientStream; -import com.google.api.gax.rpc.ResponseObserver; -import com.google.api.gax.rpc.StreamController; -import com.google.cloud.speech.v1p1beta1.RecognitionConfig; -import com.google.cloud.speech.v1p1beta1.SpeechClient; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig; -import com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult; -import com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest; -import com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse; -import com.google.protobuf.ByteString; -import com.google.protobuf.Duration; -import java.text.DecimalFormat; -import java.util.ArrayList; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.TimeUnit; -import javax.sound.sampled.AudioFormat; -import javax.sound.sampled.AudioSystem; -import javax.sound.sampled.DataLine; -import javax.sound.sampled.DataLine.Info; -import javax.sound.sampled.TargetDataLine; - -public class InfiniteStreamRecognize { - - private static final int STREAMING_LIMIT = 290000; // ~5 minutes - - public static final String RED = "\033[0;31m"; - public static final String GREEN = "\033[0;32m"; - public static final String YELLOW = "\033[0;33m"; - - // Creating shared object - private static volatile BlockingQueue sharedQueue = new LinkedBlockingQueue(); - private static TargetDataLine targetDataLine; - private static int BYTES_PER_BUFFER = 6400; // buffer size in bytes - - private static int restartCounter = 0; - private static ArrayList audioInput = new ArrayList(); - private static ArrayList lastAudioInput = new ArrayList(); - private static int resultEndTimeInMS = 0; - private static int isFinalEndTime = 0; - private static int finalRequestEndTime = 0; - private static boolean newStream = true; - private static double bridgingOffset = 0; - private static boolean lastTranscriptWasFinal = false; - private static StreamController referenceToStreamController; - private static ByteString tempByteString; - - public static void main(String... args) { - InfiniteStreamRecognizeOptions options = InfiniteStreamRecognizeOptions.fromFlags(args); - if (options == null) { - // Could not parse. - System.out.println("Failed to parse options."); - System.exit(1); - } - - try { - infiniteStreamingRecognize(options.langCode); - } catch (Exception e) { - System.out.println("Exception caught: " + e); - } - } - - public static String convertMillisToDate(double milliSeconds) { - long millis = (long) milliSeconds; - DecimalFormat format = new DecimalFormat(); - format.setMinimumIntegerDigits(2); - return String.format( - "%s:%s /", - format.format(TimeUnit.MILLISECONDS.toMinutes(millis)), - format.format( - TimeUnit.MILLISECONDS.toSeconds(millis) - - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millis)))); - } - - /** Performs infinite streaming speech recognition */ - public static void infiniteStreamingRecognize(String languageCode) throws Exception { - - // Microphone Input buffering - class MicBuffer implements Runnable { - - @Override - public void run() { - System.out.println(YELLOW); - System.out.println("Start speaking...Press Ctrl-C to stop"); - targetDataLine.start(); - byte[] data = new byte[BYTES_PER_BUFFER]; - while (targetDataLine.isOpen()) { - try { - int numBytesRead = targetDataLine.read(data, 0, data.length); - if ((numBytesRead <= 0) && (targetDataLine.isOpen())) { - continue; - } - sharedQueue.put(data.clone()); - } catch (InterruptedException e) { - System.out.println("Microphone input buffering interrupted : " + e.getMessage()); - } - } - } - } - - // Creating microphone input buffer thread - MicBuffer micrunnable = new MicBuffer(); - Thread micThread = new Thread(micrunnable); - ResponseObserver responseObserver = null; - try (SpeechClient client = SpeechClient.create()) { - ClientStream clientStream; - responseObserver = - new ResponseObserver() { - - ArrayList responses = new ArrayList<>(); - - public void onStart(StreamController controller) { - referenceToStreamController = controller; - } - - public void onResponse(StreamingRecognizeResponse response) { - responses.add(response); - StreamingRecognitionResult result = response.getResultsList().get(0); - Duration resultEndTime = result.getResultEndTime(); - resultEndTimeInMS = - (int) - ((resultEndTime.getSeconds() * 1000) + (resultEndTime.getNanos() / 1000000)); - double correctedTime = - resultEndTimeInMS - bridgingOffset + (STREAMING_LIMIT * restartCounter); - - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - if (result.getIsFinal()) { - System.out.print(GREEN); - System.out.print("\033[2K\r"); - System.out.printf( - "%s: %s [confidence: %.2f]\n", - convertMillisToDate(correctedTime), - alternative.getTranscript(), - alternative.getConfidence()); - isFinalEndTime = resultEndTimeInMS; - lastTranscriptWasFinal = true; - } else { - System.out.print(RED); - System.out.print("\033[2K\r"); - System.out.printf( - "%s: %s", convertMillisToDate(correctedTime), alternative.getTranscript()); - lastTranscriptWasFinal = false; - } - } - - public void onComplete() {} - - public void onError(Throwable t) {} - }; - clientStream = client.streamingRecognizeCallable().splitCall(responseObserver); - - RecognitionConfig recognitionConfig = - RecognitionConfig.newBuilder() - .setEncoding(RecognitionConfig.AudioEncoding.LINEAR16) - .setLanguageCode(languageCode) - .setSampleRateHertz(16000) - .build(); - - StreamingRecognitionConfig streamingRecognitionConfig = - StreamingRecognitionConfig.newBuilder() - .setConfig(recognitionConfig) - .setInterimResults(true) - .build(); - - StreamingRecognizeRequest request = - StreamingRecognizeRequest.newBuilder() - .setStreamingConfig(streamingRecognitionConfig) - .build(); // The first request in a streaming call has to be a config - - clientStream.send(request); - - try { - // SampleRate:16000Hz, SampleSizeInBits: 16, Number of channels: 1, Signed: true, - // bigEndian: false - AudioFormat audioFormat = new AudioFormat(16000, 16, 1, true, false); - DataLine.Info targetInfo = - new Info( - TargetDataLine.class, - audioFormat); // Set the system information to read from the microphone audio - // stream - - if (!AudioSystem.isLineSupported(targetInfo)) { - System.out.println("Microphone not supported"); - System.exit(0); - } - // Target data line captures the audio stream the microphone produces. - targetDataLine = (TargetDataLine) AudioSystem.getLine(targetInfo); - targetDataLine.open(audioFormat); - micThread.start(); - - long startTime = System.currentTimeMillis(); - - while (true) { - - long estimatedTime = System.currentTimeMillis() - startTime; - - if (estimatedTime >= STREAMING_LIMIT) { - - clientStream.closeSend(); - referenceToStreamController.cancel(); // remove Observer - - if (resultEndTimeInMS > 0) { - finalRequestEndTime = isFinalEndTime; - } - resultEndTimeInMS = 0; - - lastAudioInput = null; - lastAudioInput = audioInput; - audioInput = new ArrayList(); - - restartCounter++; - - if (!lastTranscriptWasFinal) { - System.out.print('\n'); - } - - newStream = true; - - clientStream = client.streamingRecognizeCallable().splitCall(responseObserver); - - request = - StreamingRecognizeRequest.newBuilder() - .setStreamingConfig(streamingRecognitionConfig) - .build(); - - System.out.println(YELLOW); - System.out.printf("%d: RESTARTING REQUEST\n", restartCounter * STREAMING_LIMIT); - - startTime = System.currentTimeMillis(); - - } else { - - if ((newStream) && (lastAudioInput.size() > 0)) { - // if this is the first audio from a new request - // calculate amount of unfinalized audio from last request - // resend the audio to the speech client before incoming audio - double chunkTime = STREAMING_LIMIT / lastAudioInput.size(); - // ms length of each chunk in previous request audio arrayList - if (chunkTime != 0) { - if (bridgingOffset < 0) { - // bridging Offset accounts for time of resent audio - // calculated from last request - bridgingOffset = 0; - } - if (bridgingOffset > finalRequestEndTime) { - bridgingOffset = finalRequestEndTime; - } - int chunksFromMS = - (int) Math.floor((finalRequestEndTime - bridgingOffset) / chunkTime); - // chunks from MS is number of chunks to resend - bridgingOffset = - (int) Math.floor((lastAudioInput.size() - chunksFromMS) * chunkTime); - // set bridging offset for next request - for (int i = chunksFromMS; i < lastAudioInput.size(); i++) { - request = - StreamingRecognizeRequest.newBuilder() - .setAudioContent(lastAudioInput.get(i)) - .build(); - clientStream.send(request); - } - } - newStream = false; - } - - tempByteString = ByteString.copyFrom(sharedQueue.take()); - - request = - StreamingRecognizeRequest.newBuilder().setAudioContent(tempByteString).build(); - - audioInput.add(tempByteString); - } - - clientStream.send(request); - } - } catch (Exception e) { - System.out.println(e); - } - } - } -} -// [END speech_transcribe_infinite_streaming] diff --git a/samples/snippets/src/main/java/com/example/speech/InfiniteStreamRecognizeOptions.java b/samples/snippets/src/main/java/com/example/speech/InfiniteStreamRecognizeOptions.java deleted file mode 100644 index 909ff2be0..000000000 --- a/samples/snippets/src/main/java/com/example/speech/InfiniteStreamRecognizeOptions.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2019 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.speech; - -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.CommandLineParser; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; -import org.apache.commons.cli.ParseException; - -public class InfiniteStreamRecognizeOptions { - String langCode = "en-US"; // by default english US - - /** Construct an InfiniteStreamRecognizeOptions class from command line flags. */ - public static InfiniteStreamRecognizeOptions fromFlags(String[] args) { - Options options = new Options(); - options.addOption( - Option.builder() - .type(String.class) - .longOpt("lang_code") - .hasArg() - .desc("Language code") - .build()); - - CommandLineParser parser = new DefaultParser(); - CommandLine commandLine; - try { - commandLine = parser.parse(options, args); - InfiniteStreamRecognizeOptions res = new InfiniteStreamRecognizeOptions(); - - if (commandLine.hasOption("lang_code")) { - res.langCode = commandLine.getOptionValue("lang_code"); - } - return res; - } catch (ParseException e) { - System.err.println(e.getMessage()); - return null; - } - } -} diff --git a/samples/snippets/src/main/java/com/example/speech/QuickstartSample.java b/samples/snippets/src/main/java/com/example/speech/QuickstartSample.java deleted file mode 100644 index 8c4c17af8..000000000 --- a/samples/snippets/src/main/java/com/example/speech/QuickstartSample.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2018 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.speech; - -// [START speech_quickstart] -// Imports the Google Cloud client library -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1.SpeechRecognitionResult; -import com.google.protobuf.ByteString; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.List; - -public class QuickstartSample { - - /** Demonstrates using the Speech API to transcribe an audio file. */ - public static void main(String... args) throws Exception { - // Instantiates a client - try (SpeechClient speechClient = SpeechClient.create()) { - - // The path to the audio file to transcribe - String fileName = "./resources/audio.raw"; - - // Reads the audio file into memory - Path path = Paths.get(fileName); - byte[] data = Files.readAllBytes(path); - ByteString audioBytes = ByteString.copyFrom(data); - - // Builds the sync recognize request - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.LINEAR16) - .setSampleRateHertz(16000) - .setLanguageCode("en-US") - .build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().setContent(audioBytes).build(); - - // Performs speech recognition on the audio file - RecognizeResponse response = speechClient.recognize(config, audio); - List results = response.getResultsList(); - - for (SpeechRecognitionResult result : results) { - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcription: %s%n", alternative.getTranscript()); - } - } - } -} -// [END speech_quickstart] diff --git a/samples/snippets/src/main/java/com/example/speech/Recognize.java b/samples/snippets/src/main/java/com/example/speech/Recognize.java deleted file mode 100644 index 629974ad4..000000000 --- a/samples/snippets/src/main/java/com/example/speech/Recognize.java +++ /dev/null @@ -1,921 +0,0 @@ -/* - * Copyright 2018 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.speech; - -import com.google.api.gax.longrunning.OperationFuture; -import com.google.api.gax.rpc.ApiStreamObserver; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientStream; -import com.google.api.gax.rpc.ResponseObserver; -import com.google.api.gax.rpc.StreamController; -import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1.SpeechRecognitionResult; -import com.google.cloud.speech.v1.StreamingRecognitionConfig; -import com.google.cloud.speech.v1.StreamingRecognitionResult; -import com.google.cloud.speech.v1.StreamingRecognizeRequest; -import com.google.cloud.speech.v1.StreamingRecognizeResponse; -import com.google.cloud.speech.v1.WordInfo; -import com.google.common.util.concurrent.SettableFuture; -import com.google.protobuf.ByteString; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.List; -import javax.sound.sampled.AudioFormat; -import javax.sound.sampled.AudioInputStream; -import javax.sound.sampled.AudioSystem; -import javax.sound.sampled.DataLine; -import javax.sound.sampled.DataLine.Info; -import javax.sound.sampled.TargetDataLine; - -public class Recognize { - - /** Run speech recognition tasks. */ - public static void main(String... args) throws Exception { - if (args.length < 1) { - System.out.println("Usage:"); - System.out.printf( - "\tjava %s \"\" \"\"\n" - + "Commands:\n" - + "\tsyncrecognize | asyncrecognize | streamrecognize | micstreamrecognize \n" - + "\t| wordoffsets | auto-punctuation | stream-punctuation \n" - + "\t| enhanced-model | model-selection | multi-channel\n" - + "Path:\n\tA file path (ex: ./resources/audio.raw) or a URI " - + "for a Cloud Storage resource (gs://...)\n", - Recognize.class.getCanonicalName()); - return; - } - String command = args[0]; - String path = args.length > 1 ? args[1] : ""; - - // Use command and GCS path pattern to invoke transcription. - if (command.equals("syncrecognize")) { - if (path.startsWith("gs://")) { - syncRecognizeGcs(path); - } else { - syncRecognizeFile(path); - } - } else if (command.equals("wordoffsets")) { - if (path.startsWith("gs://")) { - asyncRecognizeWords(path); - } else { - syncRecognizeWords(path); - } - } else if (command.equals("asyncrecognize")) { - if (path.startsWith("gs://")) { - asyncRecognizeGcs(path); - } else { - asyncRecognizeFile(path); - } - } else if (command.equals("streamrecognize")) { - streamingRecognizeFile(path); - } else if (command.equals("micstreamrecognize")) { - streamingMicRecognize(); - } else if (command.equals("auto-punctuation")) { - if (path.startsWith("gs://")) { - transcribeGcsWithAutomaticPunctuation(path); - } else { - transcribeFileWithAutomaticPunctuation(path); - } - } else if (command.equals("stream-punctuation")) { - streamingTranscribeWithAutomaticPunctuation(path); - } else if (command.equals("enhanced-model")) { - transcribeFileWithEnhancedModel(path); - } else if (command.equals("model-selection")) { - if (path.startsWith("gs://")) { - transcribeModelSelectionGcs(path); - } else { - transcribeModelSelection(path); - } - } else if (command.equals("multi-channel")) { - if (path.startsWith("gs://")) { - transcribeMultiChannelGcs(path); - } else { - transcribeMultiChannel(path); - } - } - } - - // [START speech_transcribe_sync] - /** - * Performs speech recognition on raw PCM audio and prints the transcription. - * - * @param fileName the path to a PCM audio file to transcribe. - */ - public static void syncRecognizeFile(String fileName) throws Exception { - try (SpeechClient speech = SpeechClient.create()) { - Path path = Paths.get(fileName); - byte[] data = Files.readAllBytes(path); - ByteString audioBytes = ByteString.copyFrom(data); - - // Configure request with local raw PCM audio - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.LINEAR16) - .setLanguageCode("en-US") - .setSampleRateHertz(16000) - .build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().setContent(audioBytes).build(); - - // Use blocking call to get audio transcript - RecognizeResponse response = speech.recognize(config, audio); - List results = response.getResultsList(); - - for (SpeechRecognitionResult result : results) { - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcription: %s%n", alternative.getTranscript()); - } - } - } - // [END speech_transcribe_sync] - - /** - * Performs sync recognize and prints word time offsets. - * - * @param fileName the path to a PCM audio file to transcribe get offsets on. - */ - public static void syncRecognizeWords(String fileName) throws Exception { - try (SpeechClient speech = SpeechClient.create()) { - Path path = Paths.get(fileName); - byte[] data = Files.readAllBytes(path); - ByteString audioBytes = ByteString.copyFrom(data); - - // Configure request with local raw PCM audio - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.LINEAR16) - .setLanguageCode("en-US") - .setSampleRateHertz(16000) - .setEnableWordTimeOffsets(true) - .build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().setContent(audioBytes).build(); - - // Use blocking call to get audio transcript - RecognizeResponse response = speech.recognize(config, audio); - List results = response.getResultsList(); - - for (SpeechRecognitionResult result : results) { - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcription: %s%n", alternative.getTranscript()); - for (WordInfo wordInfo : alternative.getWordsList()) { - System.out.println(wordInfo.getWord()); - System.out.printf( - "\t%s.%s sec - %s.%s sec\n", - wordInfo.getStartTime().getSeconds(), - wordInfo.getStartTime().getNanos() / 100000000, - wordInfo.getEndTime().getSeconds(), - wordInfo.getEndTime().getNanos() / 100000000); - } - } - } - } - - // [START speech_transcribe_sync_gcs] - /** - * Performs speech recognition on remote FLAC file and prints the transcription. - * - * @param gcsUri the path to the remote FLAC audio file to transcribe. - */ - public static void syncRecognizeGcs(String gcsUri) throws Exception { - // Instantiates a client with GOOGLE_APPLICATION_CREDENTIALS - try (SpeechClient speech = SpeechClient.create()) { - // Builds the request for remote FLAC file - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.FLAC) - .setLanguageCode("en-US") - .setSampleRateHertz(16000) - .build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(gcsUri).build(); - - // Use blocking call for getting audio transcript - RecognizeResponse response = speech.recognize(config, audio); - List results = response.getResultsList(); - - for (SpeechRecognitionResult result : results) { - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcription: %s%n", alternative.getTranscript()); - } - } - } - // [END speech_transcribe_sync_gcs] - - // [START speech_transcribe_async] - /** - * Performs non-blocking speech recognition on raw PCM audio and prints the transcription. Note - * that transcription is limited to 60 seconds audio. - * - * @param fileName the path to a PCM audio file to transcribe. - */ - public static void asyncRecognizeFile(String fileName) throws Exception { - // Instantiates a client with GOOGLE_APPLICATION_CREDENTIALS - try (SpeechClient speech = SpeechClient.create()) { - - Path path = Paths.get(fileName); - byte[] data = Files.readAllBytes(path); - ByteString audioBytes = ByteString.copyFrom(data); - - // Configure request with local raw PCM audio - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.LINEAR16) - .setLanguageCode("en-US") - .setSampleRateHertz(16000) - .build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().setContent(audioBytes).build(); - - // Use non-blocking call for getting file transcription - OperationFuture response = - speech.longRunningRecognizeAsync(config, audio); - - while (!response.isDone()) { - System.out.println("Waiting for response..."); - Thread.sleep(10000); - } - - List results = response.get().getResultsList(); - - for (SpeechRecognitionResult result : results) { - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcription: %s%n", alternative.getTranscript()); - } - } - } - // [END speech_transcribe_async] - - // [START speech_transcribe_async_word_time_offsets_gcs] - /** - * Performs non-blocking speech recognition on remote FLAC file and prints the transcription as - * well as word time offsets. - * - * @param gcsUri the path to the remote LINEAR16 audio file to transcribe. - */ - public static void asyncRecognizeWords(String gcsUri) throws Exception { - // Instantiates a client with GOOGLE_APPLICATION_CREDENTIALS - try (SpeechClient speech = SpeechClient.create()) { - - // Configure remote file request for FLAC - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.FLAC) - .setLanguageCode("en-US") - .setSampleRateHertz(16000) - .setEnableWordTimeOffsets(true) - .build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(gcsUri).build(); - - // Use non-blocking call for getting file transcription - OperationFuture response = - speech.longRunningRecognizeAsync(config, audio); - while (!response.isDone()) { - System.out.println("Waiting for response..."); - Thread.sleep(10000); - } - - List results = response.get().getResultsList(); - - for (SpeechRecognitionResult result : results) { - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcription: %s\n", alternative.getTranscript()); - for (WordInfo wordInfo : alternative.getWordsList()) { - System.out.println(wordInfo.getWord()); - System.out.printf( - "\t%s.%s sec - %s.%s sec\n", - wordInfo.getStartTime().getSeconds(), - wordInfo.getStartTime().getNanos() / 100000000, - wordInfo.getEndTime().getSeconds(), - wordInfo.getEndTime().getNanos() / 100000000); - } - } - } - } - // [END speech_transcribe_async_word_time_offsets_gcs] - - // [START speech_transcribe_async_gcs] - /** - * Performs non-blocking speech recognition on remote FLAC file and prints the transcription. - * - * @param gcsUri the path to the remote LINEAR16 audio file to transcribe. - */ - public static void asyncRecognizeGcs(String gcsUri) throws Exception { - // Instantiates a client with GOOGLE_APPLICATION_CREDENTIALS - try (SpeechClient speech = SpeechClient.create()) { - - // Configure remote file request for FLAC - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.FLAC) - .setLanguageCode("en-US") - .setSampleRateHertz(16000) - .build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(gcsUri).build(); - - // Use non-blocking call for getting file transcription - OperationFuture response = - speech.longRunningRecognizeAsync(config, audio); - while (!response.isDone()) { - System.out.println("Waiting for response..."); - Thread.sleep(10000); - } - - List results = response.get().getResultsList(); - - for (SpeechRecognitionResult result : results) { - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcription: %s\n", alternative.getTranscript()); - } - } - } - // [END speech_transcribe_async_gcs] - - // [START speech_transcribe_streaming] - /** - * Performs streaming speech recognition on raw PCM audio data. - * - * @param fileName the path to a PCM audio file to transcribe. - */ - public static void streamingRecognizeFile(String fileName) throws Exception, IOException { - Path path = Paths.get(fileName); - byte[] data = Files.readAllBytes(path); - - // Instantiates a client with GOOGLE_APPLICATION_CREDENTIALS - try (SpeechClient speech = SpeechClient.create()) { - - // Configure request with local raw PCM audio - RecognitionConfig recConfig = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.LINEAR16) - .setLanguageCode("en-US") - .setSampleRateHertz(16000) - .setModel("default") - .build(); - StreamingRecognitionConfig config = - StreamingRecognitionConfig.newBuilder().setConfig(recConfig).build(); - - class ResponseApiStreamingObserver implements ApiStreamObserver { - private final SettableFuture> future = SettableFuture.create(); - private final List messages = new java.util.ArrayList(); - - @Override - public void onNext(T message) { - messages.add(message); - } - - @Override - public void onError(Throwable t) { - future.setException(t); - } - - @Override - public void onCompleted() { - future.set(messages); - } - - // Returns the SettableFuture object to get received messages / exceptions. - public SettableFuture> future() { - return future; - } - } - - ResponseApiStreamingObserver responseObserver = - new ResponseApiStreamingObserver<>(); - - BidiStreamingCallable callable = - speech.streamingRecognizeCallable(); - - ApiStreamObserver requestObserver = - callable.bidiStreamingCall(responseObserver); - - // The first request must **only** contain the audio configuration: - requestObserver.onNext( - StreamingRecognizeRequest.newBuilder().setStreamingConfig(config).build()); - - // Subsequent requests must **only** contain the audio data. - requestObserver.onNext( - StreamingRecognizeRequest.newBuilder() - .setAudioContent(ByteString.copyFrom(data)) - .build()); - - // Mark transmission as completed after sending the data. - requestObserver.onCompleted(); - - List responses = responseObserver.future().get(); - - for (StreamingRecognizeResponse response : responses) { - // For streaming recognize, the results list has one is_final result (if available) followed - // by a number of in-progress results (if iterim_results is true) for subsequent utterances. - // Just print the first result here. - StreamingRecognitionResult result = response.getResultsList().get(0); - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript : %s\n", alternative.getTranscript()); - } - } - } - // [END speech_transcribe_streaming] - - // [START speech_sync_recognize_punctuation] - /** - * Performs transcription with automatic punctuation on raw PCM audio data. - * - * @param fileName the path to a PCM audio file to transcribe. - */ - public static void transcribeFileWithAutomaticPunctuation(String fileName) throws Exception { - Path path = Paths.get(fileName); - byte[] content = Files.readAllBytes(path); - - try (SpeechClient speechClient = SpeechClient.create()) { - // Configure request with local raw PCM audio - RecognitionConfig recConfig = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.LINEAR16) - .setLanguageCode("en-US") - .setSampleRateHertz(16000) - .setEnableAutomaticPunctuation(true) - .build(); - - // Get the contents of the local audio file - RecognitionAudio recognitionAudio = - RecognitionAudio.newBuilder().setContent(ByteString.copyFrom(content)).build(); - - // Perform the transcription request - RecognizeResponse recognizeResponse = speechClient.recognize(recConfig, recognitionAudio); - - // Just print the first result here. - SpeechRecognitionResult result = recognizeResponse.getResultsList().get(0); - - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - - // Print out the result - System.out.printf("Transcript : %s\n", alternative.getTranscript()); - } - } - // [END speech_sync_recognize_punctuation] - - // [START speech_transcribe_auto_punctuation] - /** - * Performs transcription on remote FLAC file and prints the transcription. - * - * @param gcsUri the path to the remote FLAC audio file to transcribe. - */ - public static void transcribeGcsWithAutomaticPunctuation(String gcsUri) throws Exception { - try (SpeechClient speechClient = SpeechClient.create()) { - // Configure request with raw PCM audio - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.FLAC) - .setLanguageCode("en-US") - .setSampleRateHertz(16000) - .setEnableAutomaticPunctuation(true) - .build(); - - // Set the remote path for the audio file - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(gcsUri).build(); - - // Use non-blocking call for getting file transcription - OperationFuture response = - speechClient.longRunningRecognizeAsync(config, audio); - - while (!response.isDone()) { - System.out.println("Waiting for response..."); - Thread.sleep(10000); - } - - // Just print the first result here. - SpeechRecognitionResult result = response.get().getResultsList().get(0); - - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - - // Print out the result - System.out.printf("Transcript : %s\n", alternative.getTranscript()); - } - } - // [END speech_transcribe_auto_punctuation] - - // [START speech_stream_recognize_punctuation] - /** - * Performs streaming speech recognition on raw PCM audio data. - * - * @param fileName the path to a PCM audio file to transcribe. - */ - public static void streamingTranscribeWithAutomaticPunctuation(String fileName) throws Exception { - Path path = Paths.get(fileName); - byte[] data = Files.readAllBytes(path); - - // Instantiates a client with GOOGLE_APPLICATION_CREDENTIALS - try (SpeechClient speech = SpeechClient.create()) { - - // Configure request with local raw PCM audio - RecognitionConfig recConfig = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.LINEAR16) - .setLanguageCode("en-US") - .setSampleRateHertz(16000) - .setEnableAutomaticPunctuation(true) - .build(); - - // Build the streaming config with the audio config - StreamingRecognitionConfig config = - StreamingRecognitionConfig.newBuilder().setConfig(recConfig).build(); - - class ResponseApiStreamingObserver implements ApiStreamObserver { - private final SettableFuture> future = SettableFuture.create(); - private final List messages = new java.util.ArrayList(); - - @Override - public void onNext(T message) { - messages.add(message); - } - - @Override - public void onError(Throwable t) { - future.setException(t); - } - - @Override - public void onCompleted() { - future.set(messages); - } - - // Returns the SettableFuture object to get received messages / exceptions. - public SettableFuture> future() { - return future; - } - } - - ResponseApiStreamingObserver responseObserver = - new ResponseApiStreamingObserver<>(); - - BidiStreamingCallable callable = - speech.streamingRecognizeCallable(); - - ApiStreamObserver requestObserver = - callable.bidiStreamingCall(responseObserver); - - // The first request must **only** contain the audio configuration: - requestObserver.onNext( - StreamingRecognizeRequest.newBuilder().setStreamingConfig(config).build()); - - // Subsequent requests must **only** contain the audio data. - requestObserver.onNext( - StreamingRecognizeRequest.newBuilder() - .setAudioContent(ByteString.copyFrom(data)) - .build()); - - // Mark transmission as completed after sending the data. - requestObserver.onCompleted(); - - List responses = responseObserver.future().get(); - - for (StreamingRecognizeResponse response : responses) { - // For streaming recognize, the results list has one is_final result (if available) followed - // by a number of in-progress results (if iterim_results is true) for subsequent utterances. - // Just print the first result here. - StreamingRecognitionResult result = response.getResultsList().get(0); - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript : %s\n", alternative.getTranscript()); - } - } - } - // [END speech_stream_recognize_punctuation] - - // [START speech_transcribe_streaming_mic] - /** Performs microphone streaming speech recognition with a duration of 1 minute. */ - public static void streamingMicRecognize() throws Exception { - - ResponseObserver responseObserver = null; - try (SpeechClient client = SpeechClient.create()) { - - responseObserver = - new ResponseObserver() { - ArrayList responses = new ArrayList<>(); - - public void onStart(StreamController controller) {} - - public void onResponse(StreamingRecognizeResponse response) { - responses.add(response); - } - - public void onComplete() { - for (StreamingRecognizeResponse response : responses) { - StreamingRecognitionResult result = response.getResultsList().get(0); - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript : %s\n", alternative.getTranscript()); - } - } - - public void onError(Throwable t) { - System.out.println(t); - } - }; - - ClientStream clientStream = - client.streamingRecognizeCallable().splitCall(responseObserver); - - RecognitionConfig recognitionConfig = - RecognitionConfig.newBuilder() - .setEncoding(RecognitionConfig.AudioEncoding.LINEAR16) - .setLanguageCode("en-US") - .setSampleRateHertz(16000) - .build(); - StreamingRecognitionConfig streamingRecognitionConfig = - StreamingRecognitionConfig.newBuilder().setConfig(recognitionConfig).build(); - - StreamingRecognizeRequest request = - StreamingRecognizeRequest.newBuilder() - .setStreamingConfig(streamingRecognitionConfig) - .build(); // The first request in a streaming call has to be a config - - clientStream.send(request); - // SampleRate:16000Hz, SampleSizeInBits: 16, Number of channels: 1, Signed: true, - // bigEndian: false - AudioFormat audioFormat = new AudioFormat(16000, 16, 1, true, false); - DataLine.Info targetInfo = - new Info( - TargetDataLine.class, - audioFormat); // Set the system information to read from the microphone audio stream - - if (!AudioSystem.isLineSupported(targetInfo)) { - System.out.println("Microphone not supported"); - System.exit(0); - } - // Target data line captures the audio stream the microphone produces. - TargetDataLine targetDataLine = (TargetDataLine) AudioSystem.getLine(targetInfo); - targetDataLine.open(audioFormat); - targetDataLine.start(); - System.out.println("Start speaking"); - long startTime = System.currentTimeMillis(); - // Audio Input Stream - AudioInputStream audio = new AudioInputStream(targetDataLine); - while (true) { - long estimatedTime = System.currentTimeMillis() - startTime; - byte[] data = new byte[6400]; - audio.read(data); - if (estimatedTime > 60000) { // 60 seconds - System.out.println("Stop speaking."); - targetDataLine.stop(); - targetDataLine.close(); - break; - } - request = - StreamingRecognizeRequest.newBuilder() - .setAudioContent(ByteString.copyFrom(data)) - .build(); - clientStream.send(request); - } - } catch (Exception e) { - System.out.println(e); - } - responseObserver.onComplete(); - } - // [END speech_transcribe_streaming_mic] - - // [START speech_transcribe_enhanced_model] - /** - * Transcribe the given audio file using an enhanced model. - * - * @param fileName the path to an audio file. - */ - public static void transcribeFileWithEnhancedModel(String fileName) throws Exception { - Path path = Paths.get(fileName); - byte[] content = Files.readAllBytes(path); - - try (SpeechClient speechClient = SpeechClient.create()) { - // Get the contents of the local audio file - RecognitionAudio recognitionAudio = - RecognitionAudio.newBuilder().setContent(ByteString.copyFrom(content)).build(); - - // Configure request to enable enhanced models - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.LINEAR16) - .setLanguageCode("en-US") - .setSampleRateHertz(8000) - .setUseEnhanced(true) - // A model must be specified to use enhanced model. - .setModel("phone_call") - .build(); - - // Perform the transcription request - RecognizeResponse recognizeResponse = speechClient.recognize(config, recognitionAudio); - - // Print out the results - for (SpeechRecognitionResult result : recognizeResponse.getResultsList()) { - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternatives(0); - System.out.format("Transcript: %s\n\n", alternative.getTranscript()); - } - } - } - // [END speech_transcribe_enhanced_model] - - // [START speech_transcribe_model_selection] - /** - * Performs transcription of the given audio file synchronously with the selected model. - * - * @param fileName the path to a audio file to transcribe - */ - public static void transcribeModelSelection(String fileName) throws Exception { - Path path = Paths.get(fileName); - byte[] content = Files.readAllBytes(path); - - try (SpeechClient speech = SpeechClient.create()) { - // Configure request with video media type - RecognitionConfig recConfig = - RecognitionConfig.newBuilder() - // encoding may either be omitted or must match the value in the file header - .setEncoding(AudioEncoding.LINEAR16) - .setLanguageCode("en-US") - // sample rate hertz may be either be omitted or must match the value in the file - // header - .setSampleRateHertz(16000) - .setModel("video") - .build(); - - RecognitionAudio recognitionAudio = - RecognitionAudio.newBuilder().setContent(ByteString.copyFrom(content)).build(); - - RecognizeResponse recognizeResponse = speech.recognize(recConfig, recognitionAudio); - // Just print the first result here. - SpeechRecognitionResult result = recognizeResponse.getResultsList().get(0); - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript : %s\n", alternative.getTranscript()); - } - } - // [END speech_transcribe_model_selection] - - // [START speech_transcribe_model_selection_gcs] - /** - * Performs transcription of the remote audio file asynchronously with the selected model. - * - * @param gcsUri the path to the remote audio file to transcribe. - */ - public static void transcribeModelSelectionGcs(String gcsUri) throws Exception { - try (SpeechClient speech = SpeechClient.create()) { - - // Configure request with video media type - RecognitionConfig config = - RecognitionConfig.newBuilder() - // encoding may either be omitted or must match the value in the file header - .setEncoding(AudioEncoding.LINEAR16) - .setLanguageCode("en-US") - // sample rate hertz may be either be omitted or must match the value in the file - // header - .setSampleRateHertz(16000) - .setModel("video") - .build(); - - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(gcsUri).build(); - - // Use non-blocking call for getting file transcription - OperationFuture response = - speech.longRunningRecognizeAsync(config, audio); - - while (!response.isDone()) { - System.out.println("Waiting for response..."); - Thread.sleep(10000); - } - - List results = response.get().getResultsList(); - - // Just print the first result here. - SpeechRecognitionResult result = results.get(0); - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript : %s\n", alternative.getTranscript()); - } - } - // [END speech_transcribe_model_selection_gcs] - - // [START speech_transcribe_multichannel] - /** - * Transcribe a local audio file with multi-channel recognition - * - * @param fileName the path to local audio file - */ - public static void transcribeMultiChannel(String fileName) throws Exception { - Path path = Paths.get(fileName); - byte[] content = Files.readAllBytes(path); - - try (SpeechClient speechClient = SpeechClient.create()) { - // Get the contents of the local audio file - RecognitionAudio recognitionAudio = - RecognitionAudio.newBuilder().setContent(ByteString.copyFrom(content)).build(); - - // Configure request to enable multiple channels - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.LINEAR16) - .setLanguageCode("en-US") - .setSampleRateHertz(44100) - .setAudioChannelCount(2) - .setEnableSeparateRecognitionPerChannel(true) - .build(); - - // Perform the transcription request - RecognizeResponse recognizeResponse = speechClient.recognize(config, recognitionAudio); - - // Print out the results - for (SpeechRecognitionResult result : recognizeResponse.getResultsList()) { - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternatives(0); - System.out.format("Transcript : %s\n", alternative.getTranscript()); - System.out.printf("Channel Tag : %s\n", result.getChannelTag()); - } - } - } - // [END speech_transcribe_multichannel] - - // [START speech_transcribe_multichannel_gcs] - /** - * Transcribe a remote audio file with multi-channel recognition - * - * @param gcsUri the path to the audio file - */ - public static void transcribeMultiChannelGcs(String gcsUri) throws Exception { - - try (SpeechClient speechClient = SpeechClient.create()) { - - // Configure request to enable multiple channels - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.LINEAR16) - .setLanguageCode("en-US") - .setSampleRateHertz(44100) - .setAudioChannelCount(2) - .setEnableSeparateRecognitionPerChannel(true) - .build(); - - // Set the remote path for the audio file - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(gcsUri).build(); - - // Use non-blocking call for getting file transcription - OperationFuture response = - speechClient.longRunningRecognizeAsync(config, audio); - - while (!response.isDone()) { - System.out.println("Waiting for response..."); - Thread.sleep(10000); - } - // Just print the first result here. - for (SpeechRecognitionResult result : response.get().getResultsList()) { - - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - - // Print out the result - System.out.printf("Transcript : %s\n", alternative.getTranscript()); - System.out.printf("Channel Tag : %s\n", result.getChannelTag()); - } - } - } - // [END speech_transcribe_multichannel_gcs] -} diff --git a/samples/snippets/src/main/java/com/example/speech/RecognizeBeta.java b/samples/snippets/src/main/java/com/example/speech/RecognizeBeta.java deleted file mode 100644 index 99544b79e..000000000 --- a/samples/snippets/src/main/java/com/example/speech/RecognizeBeta.java +++ /dev/null @@ -1,532 +0,0 @@ -/* - * Copyright 2018 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.speech; - -import com.google.api.gax.longrunning.OperationFuture; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1p1beta1.RecognitionAudio; -import com.google.cloud.speech.v1p1beta1.RecognitionConfig; -import com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding; -import com.google.cloud.speech.v1p1beta1.RecognitionMetadata; -import com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType; -import com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance; -import com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType; -import com.google.cloud.speech.v1p1beta1.RecognizeResponse; -import com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig; -import com.google.cloud.speech.v1p1beta1.SpeechClient; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult; -import com.google.cloud.speech.v1p1beta1.WordInfo; -import com.google.protobuf.ByteString; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; - -public class RecognizeBeta { - - /** Run speech recognition tasks. */ - public static void main(String... args) throws Exception { - if (args.length < 1) { - System.out.println("Usage:"); - System.out.printf( - "\tjava %s \"\" \"\"\n" - + "Commands:\n" - + "\t metadata | diarization | multi-channel |\n" - + "\t multi-language | word-level-conf\n" - + "Path:\n\tA file path (ex: ./resources/audio.raw) or a URI " - + "for a Cloud Storage resource (gs://...)\n", - RecognizeBeta.class.getCanonicalName()); - return; - } - String command = args[0]; - String path = args.length > 1 ? args[1] : ""; - - // Use command and GCS path pattern to invoke transcription. - if (command.equals("metadata")) { - transcribeFileWithMetadata(path); - } else if (command.equals("diarization")) { - if (path.startsWith("gs://")) { - transcribeDiarizationGcs(path); - } else { - transcribeDiarization(path); - } - } else if (command.equals("multi-channel")) { - if (path.startsWith("gs://")) { - transcribeMultiChannelGcs(path); - } else { - transcribeMultiChannel(path); - } - } else if (command.equals("multi-language")) { - if (path.startsWith("gs://")) { - transcribeMultiLanguageGcs(path); - } else { - transcribeMultiLanguage(path); - } - } else if (command.equals("word-level-conf")) { - if (path.startsWith("gs://")) { - transcribeWordLevelConfidenceGcs(path); - } else { - transcribeWordLevelConfidence(path); - } - } - } - - // [START speech_transcribe_recognition_metadata_beta] - /** - * Transcribe the given audio file and include recognition metadata in the request. - * - * @param fileName the path to an audio file. - */ - public static void transcribeFileWithMetadata(String fileName) throws Exception { - Path path = Paths.get(fileName); - byte[] content = Files.readAllBytes(path); - - try (SpeechClient speechClient = SpeechClient.create()) { - // Get the contents of the local audio file - RecognitionAudio recognitionAudio = - RecognitionAudio.newBuilder().setContent(ByteString.copyFrom(content)).build(); - - // Construct a recognition metadata object. - // Most metadata fields are specified as enums that can be found - // in speech.enums.RecognitionMetadata - RecognitionMetadata metadata = - RecognitionMetadata.newBuilder() - .setInteractionType(InteractionType.DISCUSSION) - .setMicrophoneDistance(MicrophoneDistance.NEARFIELD) - .setRecordingDeviceType(RecordingDeviceType.SMARTPHONE) - .setRecordingDeviceName("Pixel 2 XL") // Some metadata fields are free form strings - // And some are integers, for instance the 6 digit NAICS code - // https://www.naics.com/search/ - .setIndustryNaicsCodeOfAudio(519190) - .build(); - - // Configure request to enable enhanced models - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.LINEAR16) - .setLanguageCode("en-US") - .setSampleRateHertz(8000) - .setMetadata(metadata) // Add the metadata to the config - .build(); - - // Perform the transcription request - RecognizeResponse recognizeResponse = speechClient.recognize(config, recognitionAudio); - - // Print out the results - for (SpeechRecognitionResult result : recognizeResponse.getResultsList()) { - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternatives(0); - System.out.format("Transcript: %s\n\n", alternative.getTranscript()); - } - } - } - // [END speech_transcribe_recognition_metadata_beta] - - // [START speech_transcribe_diarization_beta] - /** - * Transcribe the given audio file using speaker diarization. - * - * @param fileName the path to an audio file. - */ - public static void transcribeDiarization(String fileName) throws Exception { - Path path = Paths.get(fileName); - byte[] content = Files.readAllBytes(path); - - try (SpeechClient speechClient = SpeechClient.create()) { - // Get the contents of the local audio file - RecognitionAudio recognitionAudio = - RecognitionAudio.newBuilder().setContent(ByteString.copyFrom(content)).build(); - - SpeakerDiarizationConfig speakerDiarizationConfig = - SpeakerDiarizationConfig.newBuilder() - .setEnableSpeakerDiarization(true) - .setMinSpeakerCount(2) - .setMaxSpeakerCount(2) - .build(); - - // Configure request to enable Speaker diarization - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.LINEAR16) - .setLanguageCode("en-US") - .setSampleRateHertz(8000) - .setDiarizationConfig(speakerDiarizationConfig) - .build(); - - // Perform the transcription request - RecognizeResponse recognizeResponse = speechClient.recognize(config, recognitionAudio); - - // Speaker Tags are only included in the last result object, which has only one alternative. - SpeechRecognitionAlternative alternative = - recognizeResponse.getResults(recognizeResponse.getResultsCount() - 1).getAlternatives(0); - - // The alternative is made up of WordInfo objects that contain the speaker_tag. - WordInfo wordInfo = alternative.getWords(0); - int currentSpeakerTag = wordInfo.getSpeakerTag(); - - // For each word, get all the words associated with one speaker, once the speaker changes, - // add a new line with the new speaker and their spoken words. - StringBuilder speakerWords = - new StringBuilder( - String.format("Speaker %d: %s", wordInfo.getSpeakerTag(), wordInfo.getWord())); - - for (int i = 1; i < alternative.getWordsCount(); i++) { - wordInfo = alternative.getWords(i); - if (currentSpeakerTag == wordInfo.getSpeakerTag()) { - speakerWords.append(" "); - speakerWords.append(wordInfo.getWord()); - } else { - speakerWords.append( - String.format("\nSpeaker %d: %s", wordInfo.getSpeakerTag(), wordInfo.getWord())); - currentSpeakerTag = wordInfo.getSpeakerTag(); - } - } - - System.out.println(speakerWords.toString()); - } - } - // [END speech_transcribe_diarization_beta] - - // [START speech_transcribe_diarization_gcs_beta] - /** - * Transcribe a remote audio file using speaker diarization. - * - * @param gcsUri the path to an audio file. - */ - public static void transcribeDiarizationGcs(String gcsUri) throws Exception { - try (SpeechClient speechClient = SpeechClient.create()) { - SpeakerDiarizationConfig speakerDiarizationConfig = - SpeakerDiarizationConfig.newBuilder() - .setEnableSpeakerDiarization(true) - .setMinSpeakerCount(2) - .setMaxSpeakerCount(2) - .build(); - - // Configure request to enable Speaker diarization - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.LINEAR16) - .setLanguageCode("en-US") - .setSampleRateHertz(8000) - .setDiarizationConfig(speakerDiarizationConfig) - .build(); - - // Set the remote path for the audio file - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(gcsUri).build(); - - // Use non-blocking call for getting file transcription - OperationFuture response = - speechClient.longRunningRecognizeAsync(config, audio); - - while (!response.isDone()) { - System.out.println("Waiting for response..."); - Thread.sleep(10000); - } - - // Speaker Tags are only included in the last result object, which has only one alternative. - LongRunningRecognizeResponse longRunningRecognizeResponse = response.get(); - SpeechRecognitionAlternative alternative = - longRunningRecognizeResponse - .getResults(longRunningRecognizeResponse.getResultsCount() - 1) - .getAlternatives(0); - - // The alternative is made up of WordInfo objects that contain the speaker_tag. - WordInfo wordInfo = alternative.getWords(0); - int currentSpeakerTag = wordInfo.getSpeakerTag(); - - // For each word, get all the words associated with one speaker, once the speaker changes, - // add a new line with the new speaker and their spoken words. - StringBuilder speakerWords = - new StringBuilder( - String.format("Speaker %d: %s", wordInfo.getSpeakerTag(), wordInfo.getWord())); - - for (int i = 1; i < alternative.getWordsCount(); i++) { - wordInfo = alternative.getWords(i); - if (currentSpeakerTag == wordInfo.getSpeakerTag()) { - speakerWords.append(" "); - speakerWords.append(wordInfo.getWord()); - } else { - speakerWords.append( - String.format("\nSpeaker %d: %s", wordInfo.getSpeakerTag(), wordInfo.getWord())); - currentSpeakerTag = wordInfo.getSpeakerTag(); - } - } - - System.out.println(speakerWords.toString()); - } - } - // [END speech_transcribe_diarization_gcs_beta] - - // [START speech_transcribe_multichannel_beta] - /** - * Transcribe a local audio file with multi-channel recognition - * - * @param fileName the path to local audio file - */ - public static void transcribeMultiChannel(String fileName) throws Exception { - Path path = Paths.get(fileName); - byte[] content = Files.readAllBytes(path); - - try (SpeechClient speechClient = SpeechClient.create()) { - // Get the contents of the local audio file - RecognitionAudio recognitionAudio = - RecognitionAudio.newBuilder().setContent(ByteString.copyFrom(content)).build(); - - // Configure request to enable multiple channels - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.LINEAR16) - .setLanguageCode("en-US") - .setSampleRateHertz(44100) - .setAudioChannelCount(2) - .setEnableSeparateRecognitionPerChannel(true) - .build(); - - // Perform the transcription request - RecognizeResponse recognizeResponse = speechClient.recognize(config, recognitionAudio); - - // Print out the results - for (SpeechRecognitionResult result : recognizeResponse.getResultsList()) { - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternatives(0); - System.out.format("Transcript : %s\n", alternative.getTranscript()); - System.out.printf("Channel Tag : %s\n\n", result.getChannelTag()); - } - } - } - // [END speech_transcribe_multichannel_beta] - - // [START speech_transcribe_multichannel_gcs_beta] - /** - * Transcribe a remote audio file with multi-channel recognition - * - * @param gcsUri the path to the audio file - */ - public static void transcribeMultiChannelGcs(String gcsUri) throws Exception { - - try (SpeechClient speechClient = SpeechClient.create()) { - - // Configure request to enable multiple channels - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.LINEAR16) - .setLanguageCode("en-US") - .setSampleRateHertz(44100) - .setAudioChannelCount(2) - .setEnableSeparateRecognitionPerChannel(true) - .build(); - - // Set the remote path for the audio file - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(gcsUri).build(); - - // Use non-blocking call for getting file transcription - OperationFuture response = - speechClient.longRunningRecognizeAsync(config, audio); - - while (!response.isDone()) { - System.out.println("Waiting for response..."); - Thread.sleep(10000); - } - // Just print the first result here. - for (SpeechRecognitionResult result : response.get().getResultsList()) { - - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - - // Print out the result - System.out.printf("Transcript : %s\n", alternative.getTranscript()); - System.out.printf("Channel Tag : %s\n\n", result.getChannelTag()); - } - } - } - // [END speech_transcribe_multichannel_gcs_beta] - - // [START speech_transcribe_multilanguage_beta] - /** - * Transcribe a local audio file with multi-language recognition - * - * @param fileName the path to the audio file - */ - public static void transcribeMultiLanguage(String fileName) throws Exception { - Path path = Paths.get(fileName); - // Get the contents of the local audio file - byte[] content = Files.readAllBytes(path); - - try (SpeechClient speechClient = SpeechClient.create()) { - - RecognitionAudio recognitionAudio = - RecognitionAudio.newBuilder().setContent(ByteString.copyFrom(content)).build(); - ArrayList languageList = new ArrayList<>(); - languageList.add("es-ES"); - languageList.add("en-US"); - - // Configure request to enable multiple languages - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.LINEAR16) - .setSampleRateHertz(16000) - .setLanguageCode("ja-JP") - .addAllAlternativeLanguageCodes(languageList) - .build(); - // Perform the transcription request - RecognizeResponse recognizeResponse = speechClient.recognize(config, recognitionAudio); - - // Print out the results - for (SpeechRecognitionResult result : recognizeResponse.getResultsList()) { - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternatives(0); - System.out.format("Transcript : %s\n\n", alternative.getTranscript()); - } - } - } - // [END speech_transcribe_multilanguage_beta] - - // [START speech_transcribe_multilanguage_gcs_beta] - /** - * Transcribe a remote audio file with multi-language recognition - * - * @param gcsUri the path to the remote audio file - */ - public static void transcribeMultiLanguageGcs(String gcsUri) throws Exception { - try (SpeechClient speechClient = SpeechClient.create()) { - - ArrayList languageList = new ArrayList<>(); - languageList.add("es-ES"); - languageList.add("en-US"); - - // Configure request to enable multiple languages - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.LINEAR16) - .setSampleRateHertz(16000) - .setLanguageCode("ja-JP") - .addAllAlternativeLanguageCodes(languageList) - .build(); - - // Set the remote path for the audio file - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(gcsUri).build(); - - // Use non-blocking call for getting file transcription - OperationFuture response = - speechClient.longRunningRecognizeAsync(config, audio); - - while (!response.isDone()) { - System.out.println("Waiting for response..."); - Thread.sleep(10000); - } - - for (SpeechRecognitionResult result : response.get().getResultsList()) { - - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - - // Print out the result - System.out.printf("Transcript : %s\n\n", alternative.getTranscript()); - } - } - } - // [END speech_transcribe_multilanguage_gcs_beta] - - // [START speech_transcribe_word_level_confidence_beta] - /** - * Transcribe a local audio file with word level confidence - * - * @param fileName the path to the local audio file - */ - public static void transcribeWordLevelConfidence(String fileName) throws Exception { - Path path = Paths.get(fileName); - byte[] content = Files.readAllBytes(path); - - try (SpeechClient speechClient = SpeechClient.create()) { - RecognitionAudio recognitionAudio = - RecognitionAudio.newBuilder().setContent(ByteString.copyFrom(content)).build(); - // Configure request to enable word level confidence - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.LINEAR16) - .setSampleRateHertz(16000) - .setLanguageCode("en-US") - .setEnableWordConfidence(true) - .build(); - // Perform the transcription request - RecognizeResponse recognizeResponse = speechClient.recognize(config, recognitionAudio); - - // Print out the results - for (SpeechRecognitionResult result : recognizeResponse.getResultsList()) { - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternatives(0); - System.out.format("Transcript : %s\n", alternative.getTranscript()); - System.out.format( - "First Word and Confidence : %s %s \n", - alternative.getWords(0).getWord(), alternative.getWords(0).getConfidence()); - } - } - } - // [END speech_transcribe_word_level_confidence_beta] - - // [START speech_transcribe_word_level_confidence_gcs_beta] - /** - * Transcribe a remote audio file with word level confidence - * - * @param gcsUri path to the remote audio file - */ - public static void transcribeWordLevelConfidenceGcs(String gcsUri) throws Exception { - try (SpeechClient speechClient = SpeechClient.create()) { - - // Configure request to enable word level confidence - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(AudioEncoding.FLAC) - .setSampleRateHertz(44100) - .setLanguageCode("en-US") - .setEnableWordConfidence(true) - .build(); - - // Set the remote path for the audio file - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(gcsUri).build(); - - // Use non-blocking call for getting file transcription - OperationFuture response = - speechClient.longRunningRecognizeAsync(config, audio); - - while (!response.isDone()) { - System.out.println("Waiting for response..."); - Thread.sleep(10000); - } - // Just print the first result here. - SpeechRecognitionResult result = response.get().getResultsList().get(0); - - // There can be several alternative transcripts for a given chunk of speech. Just use the - // first (most likely) one here. - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - // Print out the result - System.out.printf("Transcript : %s\n", alternative.getTranscript()); - System.out.format( - "First Word and Confidence : %s %s \n", - alternative.getWords(0).getWord(), alternative.getWords(0).getConfidence()); - } - } - // [END speech_transcribe_word_level_confidence_gcs_beta] -} diff --git a/samples/snippets/src/main/java/com/example/speech/SpeechAdaptation.java b/samples/snippets/src/main/java/com/example/speech/SpeechAdaptation.java deleted file mode 100644 index 4c51672d1..000000000 --- a/samples/snippets/src/main/java/com/example/speech/SpeechAdaptation.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.speech; - -// [START speech_adaptation_beta] -import com.google.cloud.speech.v1p1beta1.RecognitionAudio; -import com.google.cloud.speech.v1p1beta1.RecognitionConfig; -import com.google.cloud.speech.v1p1beta1.RecognizeRequest; -import com.google.cloud.speech.v1p1beta1.RecognizeResponse; -import com.google.cloud.speech.v1p1beta1.SpeechClient; -import com.google.cloud.speech.v1p1beta1.SpeechContext; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult; -import java.io.IOException; - -public class SpeechAdaptation { - - public void speechAdaptation() throws IOException { - String uriPath = "gs://cloud-samples-data/speech/brooklyn_bridge.mp3"; - speechAdaptation(uriPath); - } - - public static void speechAdaptation(String uriPath) throws IOException { - // Initialize client that will be used to send requests. This client only needs to be created - // once, and can be reused for multiple requests. After completing all of your requests, call - // the "close" method on the client to safely clean up any remaining background resources. - try (SpeechClient speechClient = SpeechClient.create()) { - - // Provides "hints" to the speech recognizer to favor specific words and phrases in the - // results. - // https://cloud.google.com/speech-to-text/docs/reference/rpc/google.cloud.speech.v1p1beta1#google.cloud.speech.v1p1beta1.SpeechContext - SpeechContext speechContext = - SpeechContext.newBuilder().addPhrases("Brooklyn Bridge").setBoost(20.0F).build(); - // Configure recognition config to match your audio file. - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(RecognitionConfig.AudioEncoding.MP3) - .setSampleRateHertz(44100) - .setLanguageCode("en-US") - .addSpeechContexts(speechContext) - .build(); - // Set the path to your audio file - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(uriPath).build(); - - // Make the request - RecognizeRequest request = - RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - - // Display the results - RecognizeResponse response = speechClient.recognize(request); - for (SpeechRecognitionResult result : response.getResultsList()) { - // First alternative is the most probable result - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript: %s\n", alternative.getTranscript()); - } - } - } -} -// [END speech_adaptation_beta] diff --git a/samples/snippets/src/main/java/com/example/speech/TranscribeContextClasses.java b/samples/snippets/src/main/java/com/example/speech/TranscribeContextClasses.java deleted file mode 100644 index b75013ea3..000000000 --- a/samples/snippets/src/main/java/com/example/speech/TranscribeContextClasses.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.speech; - -// [START speech_context_classes] -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.RecognizeRequest; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.SpeechContext; -import com.google.cloud.speech.v1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1.SpeechRecognitionResult; -import java.io.IOException; - -class TranscribeContextClasses { - - void transcribeContextClasses() throws IOException { - // TODO(developer): Replace these variables before running the sample. - String storageUri = "gs://YOUR_BUCKET_ID/path/to/your/file.wav"; - transcribeContextClasses(storageUri); - } - - // Provides "hints" to the speech recognizer to favor specific classes of words in the results. - static void transcribeContextClasses(String storageUri) throws IOException { - // Initialize client that will be used to send requests. This client only needs to be created - // once, and can be reused for multiple requests. After completing all of your requests, call - // the "close" method on the client to safely clean up any remaining background resources. - try (SpeechClient speechClient = SpeechClient.create()) { - // SpeechContext: to configure your speech_context see: - // https://cloud.google.com/speech-to-text/docs/reference/rpc/google.cloud.speech.v1#speechcontext - // Full list of supported phrases (class tokens) here: - // https://cloud.google.com/speech-to-text/docs/class-tokens - SpeechContext speechContext = SpeechContext.newBuilder().addPhrases("$TIME").build(); - - // RecognitionConfig: to configure your encoding and sample_rate_hertz, see: - // https://cloud.google.com/speech-to-text/docs/reference/rpc/google.cloud.speech.v1#recognitionconfig - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(RecognitionConfig.AudioEncoding.LINEAR16) - .setSampleRateHertz(8000) - .setLanguageCode("en-US") - .addSpeechContexts(speechContext) - .build(); - - // Set the path to your audio file - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(storageUri).build(); - - // Build the request - RecognizeRequest request = - RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - - // Perform the request - RecognizeResponse response = speechClient.recognize(request); - - for (SpeechRecognitionResult result : response.getResultsList()) { - // First alternative is the most probable result - SpeechRecognitionAlternative alternative = result.getAlternativesList().get(0); - System.out.printf("Transcript: %s\n", alternative.getTranscript()); - } - } - } -} -// [END speech_context_classes] diff --git a/samples/snippets/src/main/java/com/example/speech/TranscribeDiarization.java b/samples/snippets/src/main/java/com/example/speech/TranscribeDiarization.java deleted file mode 100644 index 6778f4c59..000000000 --- a/samples/snippets/src/main/java/com/example/speech/TranscribeDiarization.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2019 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.speech; - -// [START speech_transcribe_diarization] - -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.SpeakerDiarizationConfig; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1.WordInfo; -import com.google.protobuf.ByteString; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -class TranscribeDiarization { - - static void transcribeDiarization() throws IOException { - // TODO(developer): Replace these variables before running the sample. - String fileName = "resources/commercial_mono.wav"; - transcribeDiarization(fileName); - } - - // Transcribe the given audio file using speaker diarization. - static void transcribeDiarization(String fileName) throws IOException { - Path path = Paths.get(fileName); - byte[] content = Files.readAllBytes(path); - - // Initialize client that will be used to send requests. This client only needs to be created - // once, and can be reused for multiple requests. After completing all of your requests, call - // the "close" method on the client to safely clean up any remaining background resources. - try (SpeechClient client = SpeechClient.create()) { - // Get the contents of the local audio file - RecognitionAudio recognitionAudio = - RecognitionAudio.newBuilder().setContent(ByteString.copyFrom(content)).build(); - SpeakerDiarizationConfig speakerDiarizationConfig = - SpeakerDiarizationConfig.newBuilder() - .setEnableSpeakerDiarization(true) - .setMinSpeakerCount(2) - .setMaxSpeakerCount(2) - .build(); - // Configure request to enable Speaker diarization - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(RecognitionConfig.AudioEncoding.LINEAR16) - .setLanguageCode("en-US") - .setSampleRateHertz(8000) - .setDiarizationConfig(speakerDiarizationConfig) - .build(); - - // Perform the transcription request - RecognizeResponse recognizeResponse = client.recognize(config, recognitionAudio); - - // Speaker Tags are only included in the last result object, which has only one alternative. - SpeechRecognitionAlternative alternative = - recognizeResponse.getResults(recognizeResponse.getResultsCount() - 1).getAlternatives(0); - // The alternative is made up of WordInfo objects that contain the speaker_tag. - WordInfo wordInfo = alternative.getWords(0); - int currentSpeakerTag = wordInfo.getSpeakerTag(); - // For each word, get all the words associated with one speaker, once the speaker changes, - // add a new line with the new speaker and their spoken words. - StringBuilder speakerWords = - new StringBuilder( - String.format("Speaker %d: %s", wordInfo.getSpeakerTag(), wordInfo.getWord())); - for (int i = 1; i < alternative.getWordsCount(); i++) { - wordInfo = alternative.getWords(i); - if (currentSpeakerTag == wordInfo.getSpeakerTag()) { - speakerWords.append(" "); - speakerWords.append(wordInfo.getWord()); - } else { - speakerWords.append( - String.format("\nSpeaker %d: %s", wordInfo.getSpeakerTag(), wordInfo.getWord())); - currentSpeakerTag = wordInfo.getSpeakerTag(); - } - } - System.out.println(speakerWords.toString()); - } - } -} -// [END speech_transcribe_diarization] diff --git a/samples/snippets/src/main/java/com/example/speech/TranscribeDiarizationGcs.java b/samples/snippets/src/main/java/com/example/speech/TranscribeDiarizationGcs.java deleted file mode 100644 index de7245b9a..000000000 --- a/samples/snippets/src/main/java/com/example/speech/TranscribeDiarizationGcs.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2019 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.speech; - -// [START speech_transcribe_diarization_gcs] - -import com.google.api.gax.longrunning.OperationFuture; -import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.SpeakerDiarizationConfig; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.SpeechRecognitionAlternative; -import com.google.cloud.speech.v1.WordInfo; -import java.io.IOException; -import java.util.concurrent.ExecutionException; - -public class TranscribeDiarizationGcs { - - static void transcribeDiarizationGcs() - throws IOException, ExecutionException, InterruptedException { - // TODO(developer): Replace these variables before running the sample. - String gcsUri = "gs://cloud-samples-data/speech/commercial_mono.wav"; - transcribeDiarizationGcs(gcsUri); - } - - // Transcribe the give gcs file using speaker diarization - public static void transcribeDiarizationGcs(String gcsUri) - throws IOException, ExecutionException, InterruptedException { - // Initialize client that will be used to send requests. This client only needs to be created - // once, and can be reused for multiple requests. After completing all of your requests, call - // the "close" method on the client to safely clean up any remaining background resources. - try (SpeechClient speechClient = SpeechClient.create()) { - SpeakerDiarizationConfig speakerDiarizationConfig = - SpeakerDiarizationConfig.newBuilder() - .setEnableSpeakerDiarization(true) - .setMinSpeakerCount(2) - .setMaxSpeakerCount(2) - .build(); - // Configure request to enable Speaker diarization - RecognitionConfig config = - RecognitionConfig.newBuilder() - .setEncoding(RecognitionConfig.AudioEncoding.LINEAR16) - .setLanguageCode("en-US") - .setSampleRateHertz(8000) - .setDiarizationConfig(speakerDiarizationConfig) - .build(); - // Set the remote path for the audio file - RecognitionAudio audio = RecognitionAudio.newBuilder().setUri(gcsUri).build(); - - // Use non-blocking call for getting file transcription - OperationFuture future = - speechClient.longRunningRecognizeAsync(config, audio); - System.out.println("Waiting for response..."); - - // Speaker Tags are only included in the last result object, which has only one alternative. - LongRunningRecognizeResponse response = future.get(); - SpeechRecognitionAlternative alternative = - response.getResults(response.getResultsCount() - 1).getAlternatives(0); - // The alternative is made up of WordInfo objects that contain the speaker_tag. - WordInfo wordInfo = alternative.getWords(0); - int currentSpeakerTag = wordInfo.getSpeakerTag(); - // For each word, get all the words associated with one speaker, once the speaker changes, - // add a new line with the new speaker and their spoken words. - StringBuilder speakerWords = - new StringBuilder( - String.format("Speaker %d: %s", wordInfo.getSpeakerTag(), wordInfo.getWord())); - for (int i = 1; i < alternative.getWordsCount(); i++) { - wordInfo = alternative.getWords(i); - if (currentSpeakerTag == wordInfo.getSpeakerTag()) { - speakerWords.append(" "); - speakerWords.append(wordInfo.getWord()); - } else { - speakerWords.append( - String.format("\nSpeaker %d: %s", wordInfo.getSpeakerTag(), wordInfo.getWord())); - currentSpeakerTag = wordInfo.getSpeakerTag(); - } - } - System.out.println(speakerWords.toString()); - } - } -} -// [END speech_transcribe_diarization_gcs] diff --git a/samples/snippets/src/test/java/com/example/speech/QuickstartSampleIT.java b/samples/snippets/src/test/java/com/example/speech/QuickstartSampleIT.java deleted file mode 100644 index ed7399301..000000000 --- a/samples/snippets/src/test/java/com/example/speech/QuickstartSampleIT.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2018 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.speech; - -import static com.google.common.truth.Truth.assertThat; - -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -/** Tests for quickstart sample. */ -@RunWith(JUnit4.class) -@SuppressWarnings("checkstyle:abbreviationaswordinname") -public class QuickstartSampleIT { - private ByteArrayOutputStream bout; - private PrintStream out; - - @Before - public void setUp() { - bout = new ByteArrayOutputStream(); - out = new PrintStream(bout); - System.setOut(out); - } - - @After - public void tearDown() { - System.setOut(null); - } - - @Test - public void testQuickstart() throws Exception { - // Act - QuickstartSample.main(); - - // Assert - String got = bout.toString(); - assertThat(got).contains("how old is the Brooklyn Bridge"); - } -} diff --git a/samples/snippets/src/test/java/com/example/speech/RecognizeBetaIT.java b/samples/snippets/src/test/java/com/example/speech/RecognizeBetaIT.java deleted file mode 100644 index 17fe91f1f..000000000 --- a/samples/snippets/src/test/java/com/example/speech/RecognizeBetaIT.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright 2018 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.speech; - -import static com.google.common.truth.Truth.assertThat; - -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -/** Tests for speech recognize sample. */ -@RunWith(JUnit4.class) -@SuppressWarnings("checkstyle:abbreviationaswordinname") -public class RecognizeBetaIT { - private static final String BUCKET = "cloud-samples-data"; - - private ByteArrayOutputStream bout; - private PrintStream out; - - // The path to the audio file to transcribe - private String audioFileName = "./resources/audio.raw"; - private String multiChannelAudioFileName = "./resources/commercial_stereo.wav"; - private String gcsMultiChannelAudioPath = "gs://" + BUCKET + "/speech/commercial_stereo.wav"; - private String gcsAudioPath = "gs://" + BUCKET + "/speech/brooklyn_bridge.flac"; - private String gcsDiarizationAudioPath = "gs://" + BUCKET + "/speech/commercial_mono.wav"; - - // The path to the video file to transcribe - private String videoFileName = "./resources/Google_Gnome.wav"; - private String gcsVideoPath = "gs://" + BUCKET + "/speech/Google_Gnome.wav"; - - private String recognitionAudioFile = "./resources/commercial_mono.wav"; - - @Before - public void setUp() { - bout = new ByteArrayOutputStream(); - out = new PrintStream(bout); - System.setOut(out); - } - - @After - public void tearDown() { - System.setOut(null); - } - - @Test - public void testMetadata() throws Exception { - RecognizeBeta.transcribeFileWithMetadata(recognitionAudioFile); - String got = bout.toString(); - assertThat(got).contains("Chrome"); - } - - @Test - public void testTranscribeDiarization() throws Exception { - RecognizeBeta.transcribeDiarization(recognitionAudioFile); - String got = bout.toString(); - // Diarization (a beta product) can be flaky, therefore this test is only looking for output - assertThat(got).contains("Speaker"); - } - - @Test - public void testTranscribeDiarizationGcs() throws Exception { - RecognizeBeta.transcribeDiarizationGcs(gcsDiarizationAudioPath); - String got = bout.toString(); - // Diarization (a beta product) can be flaky, therefore this test is only looking for output - assertThat(got).contains("Speaker"); - } - - @Test - public void testTranscribeMultiChannel() throws Exception { - RecognizeBeta.transcribeMultiChannel(multiChannelAudioFileName); - String got = bout.toString(); - assertThat(got).contains("Channel Tag : 1"); - } - - @Test - public void testTranscribeMultiChannelGcs() throws Exception { - RecognizeBeta.transcribeMultiChannelGcs(gcsMultiChannelAudioPath); - String got = bout.toString(); - assertThat(got).contains("Channel Tag : 1"); - } - - @Test - public void testTranscribeMultiLanguage() throws Exception { - RecognizeBeta.transcribeMultiLanguage(videoFileName); - String got = bout.toString(); - assertThat(got).contains("Transcript : OK Google"); - } - - @Test - public void testTranscribeMultiLanguageGcs() throws Exception { - RecognizeBeta.transcribeMultiLanguageGcs(gcsVideoPath); - String got = bout.toString(); - assertThat(got).contains("Transcript : OK Google"); - } - - @Test - public void testTranscribeWordLevelConfidence() throws Exception { - RecognizeBeta.transcribeWordLevelConfidence(audioFileName); - String got = bout.toString(); - assertThat(got).contains("Transcript : how old is the Brooklyn Bridge"); - assertThat(got).contains("First Word and Confidence : how"); - } - - @Test - public void testTranscribeWordLevelConfidenceGcs() throws Exception { - RecognizeBeta.transcribeWordLevelConfidenceGcs(gcsAudioPath); - String got = bout.toString(); - assertThat(got).contains("Transcript : how old is the Brooklyn Bridge"); - assertThat(got).contains("First Word and Confidence : how"); - } -} diff --git a/samples/snippets/src/test/java/com/example/speech/RecognizeIT.java b/samples/snippets/src/test/java/com/example/speech/RecognizeIT.java deleted file mode 100644 index 2de1b0a1b..000000000 --- a/samples/snippets/src/test/java/com/example/speech/RecognizeIT.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright 2018 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.speech; - -import static com.google.common.truth.Truth.assertThat; - -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -/** Tests for speech recognize sample. */ -@RunWith(JUnit4.class) -@SuppressWarnings("checkstyle:abbreviationaswordinname") -public class RecognizeIT { - private static final String BUCKET = "cloud-samples-tests"; - - private ByteArrayOutputStream bout; - private PrintStream out; - - // The path to the audio file to transcribe - private String audioFileName = "./resources/audio.raw"; - private String multiChannelAudioFileName = "./resources/commercial_stereo.wav"; - private String gcsAudioPath = "gs://" + BUCKET + "/speech/brooklyn.flac"; - private String gcsMultiChannelAudioPath = "gs://" + BUCKET + "/speech/commercial_stereo.wav"; - - private String recognitionAudioFile = "./resources/commercial_mono.wav"; - - // The path to the video file to transcribe - private String videoFileName = "./resources/Google_Gnome.wav"; - private String gcsVideoPath = "gs://" + BUCKET + "/speech/Google_Gnome.wav"; - - @Before - public void setUp() { - bout = new ByteArrayOutputStream(); - out = new PrintStream(bout); - System.setOut(out); - } - - @After - public void tearDown() { - System.setOut(null); - } - - @Test - public void testRecognizeFile() throws Exception { - Recognize.syncRecognizeFile(audioFileName); - String got = bout.toString(); - assertThat(got).contains("how old is the Brooklyn Bridge"); - } - - @Test - public void testRecognizeWordoffset() throws Exception { - Recognize.syncRecognizeWords(audioFileName); - String got = bout.toString(); - assertThat(got).contains("how old is the Brooklyn Bridge"); - assertThat(got).contains("\t0.0 sec -"); - } - - @Test - public void testRecognizeGcs() throws Exception { - Recognize.syncRecognizeGcs(gcsAudioPath); - String got = bout.toString(); - assertThat(got).contains("how old is the Brooklyn Bridge"); - } - - @Test - public void testAsyncRecognizeFile() throws Exception { - Recognize.asyncRecognizeFile(audioFileName); - String got = bout.toString(); - assertThat(got).contains("how old is the Brooklyn Bridge"); - } - - @Test - public void testAsyncRecognizeGcs() throws Exception { - Recognize.asyncRecognizeGcs(gcsAudioPath); - String got = bout.toString(); - assertThat(got).contains("how old is the Brooklyn Bridge"); - } - - @Test - public void testAsyncWordoffset() throws Exception { - Recognize.asyncRecognizeWords(gcsAudioPath); - String got = bout.toString(); - assertThat(got).contains("how old is the Brooklyn Bridge"); - assertThat(got).contains("\t0.0 sec -"); - } - - @Test - public void testStreamRecognize() throws Exception { - Recognize.streamingRecognizeFile(audioFileName); - String got = bout.toString(); - assertThat(got).contains("how old is the Brooklyn Bridge"); - } - - @Test - public void testAutoPunctuation() throws Exception { - Recognize.transcribeFileWithAutomaticPunctuation(audioFileName); - String got = bout.toString(); - assertThat(got).contains("Transcript"); - } - - @Test - public void testGcsAutoPunctuation() throws Exception { - Recognize.transcribeGcsWithAutomaticPunctuation(gcsAudioPath); - String got = bout.toString(); - assertThat(got).contains("Transcript"); - } - - @Test - public void testStreamAutoPunctuation() throws Exception { - Recognize.streamingTranscribeWithAutomaticPunctuation(audioFileName); - String got = bout.toString(); - assertThat(got).contains("Transcript"); - } - - @Test - public void testEnhancedModel() throws Exception { - Recognize.transcribeFileWithEnhancedModel(recognitionAudioFile); - String got = bout.toString(); - assertThat(got).contains("Chrome"); - } - - @Test - public void testModelSelection() throws Exception { - Recognize.transcribeModelSelection(videoFileName); - String got = bout.toString(); - assertThat(got).contains("OK Google"); - assertThat(got).contains("the weather outside is sunny"); - } - - @Test - public void testGcsModelSelection() throws Exception { - Recognize.transcribeModelSelectionGcs(gcsVideoPath); - String got = bout.toString(); - assertThat(got).contains("OK Google"); - assertThat(got).contains("the weather outside is sunny"); - } - - @Test - public void testTranscribeMultiChannel() throws Exception { - Recognize.transcribeMultiChannel(multiChannelAudioFileName); - String got = bout.toString(); - assertThat(got).contains("Channel Tag : 1"); - } - - @Test - public void testTranscribeMultiChannelGcs() throws Exception { - Recognize.transcribeMultiChannelGcs(gcsMultiChannelAudioPath); - String got = bout.toString(); - assertThat(got).contains("Channel Tag : 1"); - } -} diff --git a/samples/snippets/src/test/java/com/example/speech/SpeechAdaptationTest.java b/samples/snippets/src/test/java/com/example/speech/SpeechAdaptationTest.java deleted file mode 100644 index a31b3637d..000000000 --- a/samples/snippets/src/test/java/com/example/speech/SpeechAdaptationTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.speech; - -import static com.google.common.truth.Truth.assertThat; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.PrintStream; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -@RunWith(JUnit4.class) -@SuppressWarnings("checkstyle:abbreviationaswordinname") -public class SpeechAdaptationTest { - private static final String AUDIO_FILE = "gs://cloud-samples-data/speech/brooklyn_bridge.mp3"; - private ByteArrayOutputStream bout; - private PrintStream out; - - @Before - public void setUp() { - bout = new ByteArrayOutputStream(); - out = new PrintStream(bout); - System.setOut(out); - } - - @After - public void tearDown() { - System.setOut(null); - } - - @Test - public void testTranscribeContextClasses() throws IOException { - SpeechAdaptation.speechAdaptation(AUDIO_FILE); - String got = bout.toString(); - assertThat(got).contains("Transcript:"); - } -} diff --git a/samples/snippets/src/test/java/com/example/speech/TranscribeContextClassesTests.java b/samples/snippets/src/test/java/com/example/speech/TranscribeContextClassesTests.java deleted file mode 100644 index 1afd71d35..000000000 --- a/samples/snippets/src/test/java/com/example/speech/TranscribeContextClassesTests.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.speech; - -import static com.google.common.truth.Truth.assertThat; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.PrintStream; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -@RunWith(JUnit4.class) -@SuppressWarnings("checkstyle:abbreviationaswordinname") -public class TranscribeContextClassesTests { - private static final String AUDIO_FILE = "gs://cloud-samples-data/speech/commercial_mono.wav"; - private ByteArrayOutputStream bout; - private PrintStream out; - - @Before - public void setUp() { - bout = new ByteArrayOutputStream(); - out = new PrintStream(bout); - System.setOut(out); - } - - @After - public void tearDown() { - System.setOut(null); - } - - @Test - public void testTranscribeContextClasses() throws IOException { - TranscribeContextClasses.transcribeContextClasses(AUDIO_FILE); - String got = bout.toString(); - assertThat(got).contains("Transcript:"); - } -} diff --git a/samples/snippets/src/test/java/com/example/speech/TranscribeDiarizationIT.java b/samples/snippets/src/test/java/com/example/speech/TranscribeDiarizationIT.java deleted file mode 100644 index ce69cdd22..000000000 --- a/samples/snippets/src/test/java/com/example/speech/TranscribeDiarizationIT.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2018 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.speech; - -import static com.google.common.truth.Truth.assertThat; -import static junit.framework.TestCase.assertNotNull; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.PrintStream; -import java.util.concurrent.ExecutionException; -import org.junit.After; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -// Tests for speech Transcribe Diarization samples. -@RunWith(JUnit4.class) -@SuppressWarnings("checkstyle:abbreviationaswordinname") -public class TranscribeDiarizationIT { - private ByteArrayOutputStream bout; - private PrintStream out; - - // The path to the audio file to transcribe - private String recognitionAudioFile = "./resources/commercial_mono.wav"; - - private static void requireEnvVar(String varName) { - assertNotNull( - System.getenv(varName), - "Environment variable '%s' is required to perform these tests.".format(varName)); - } - - @BeforeClass - public static void checkRequirements() { - requireEnvVar("GOOGLE_APPLICATION_CREDENTIALS"); - } - - @Before - public void setUp() { - bout = new ByteArrayOutputStream(); - out = new PrintStream(bout); - System.setOut(out); - } - - @After - public void tearDown() { - System.setOut(null); - } - - @Test - public void testDiarization() throws IOException { - TranscribeDiarization.transcribeDiarization(recognitionAudioFile); - String got = bout.toString(); - assertThat(got).contains("Speaker"); - } - - @Test - public void testDiarizationGcs() throws IOException, ExecutionException, InterruptedException { - TranscribeDiarizationGcs.transcribeDiarizationGcs( - "gs://cloud-samples-data/speech/commercial_mono.wav"); - String got = bout.toString(); - assertThat(got).contains("Speaker"); - } -} diff --git a/synth.metadata b/synth.metadata deleted file mode 100644 index bfde26e11..000000000 --- a/synth.metadata +++ /dev/null @@ -1,227 +0,0 @@ -{ - "sources": [ - { - "git": { - "name": ".", - "remote": "https://github.com/googleapis/java-speech.git", - "sha": "80728c733ab1145feaeb0ce4372af6f3e6a638ab" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c62551667895c73daec0fb232c348f845caddf0f", - "internalRef": "316899534" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c62551667895c73daec0fb232c348f845caddf0f", - "internalRef": "316899534" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "019c7168faa0e56619f792693a8acdb30d6de19b" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "speech", - "apiVersion": "v1", - "language": "java", - "generator": "bazel" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "speech", - "apiVersion": "v1p1beta1", - "language": "java", - "generator": "bazel" - } - } - ], - "generatedFiles": [ - ".github/CODEOWNERS", - ".github/ISSUE_TEMPLATE/bug_report.md", - ".github/ISSUE_TEMPLATE/feature_request.md", - ".github/ISSUE_TEMPLATE/support_request.md", - ".github/PULL_REQUEST_TEMPLATE.md", - ".github/release-please.yml", - ".github/trusted-contribution.yml", - ".github/workflows/ci.yaml", - ".github/workflows/samples.yaml", - ".kokoro/build.bat", - ".kokoro/build.sh", - ".kokoro/coerce_logs.sh", - ".kokoro/common.cfg", - ".kokoro/common.sh", - ".kokoro/continuous/common.cfg", - ".kokoro/continuous/java8.cfg", - ".kokoro/dependencies.sh", - ".kokoro/linkage-monitor.sh", - ".kokoro/nightly/common.cfg", - ".kokoro/nightly/integration.cfg", - ".kokoro/nightly/java11.cfg", - ".kokoro/nightly/java7.cfg", - ".kokoro/nightly/java8-osx.cfg", - ".kokoro/nightly/java8-win.cfg", - ".kokoro/nightly/java8.cfg", - ".kokoro/nightly/samples.cfg", - ".kokoro/populate-secrets.sh", - ".kokoro/presubmit/clirr.cfg", - ".kokoro/presubmit/common.cfg", - ".kokoro/presubmit/dependencies.cfg", - ".kokoro/presubmit/integration.cfg", - ".kokoro/presubmit/java11.cfg", - ".kokoro/presubmit/java7.cfg", - ".kokoro/presubmit/java8-osx.cfg", - ".kokoro/presubmit/java8-win.cfg", - ".kokoro/presubmit/java8.cfg", - ".kokoro/presubmit/linkage-monitor.cfg", - ".kokoro/presubmit/lint.cfg", - ".kokoro/presubmit/samples.cfg", - ".kokoro/release/bump_snapshot.cfg", - ".kokoro/release/common.cfg", - ".kokoro/release/common.sh", - ".kokoro/release/drop.cfg", - ".kokoro/release/drop.sh", - ".kokoro/release/promote.cfg", - ".kokoro/release/promote.sh", - ".kokoro/release/publish_javadoc.cfg", - ".kokoro/release/publish_javadoc.sh", - ".kokoro/release/snapshot.cfg", - ".kokoro/release/snapshot.sh", - ".kokoro/release/stage.cfg", - ".kokoro/release/stage.sh", - ".kokoro/trampoline.sh", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "README.md", - "codecov.yaml", - "google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechClient.java", - "google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechSettings.java", - "google-cloud-speech/src/main/java/com/google/cloud/speech/v1/package-info.java", - "google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechCallableFactory.java", - "google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechStub.java", - "google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStub.java", - "google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStubSettings.java", - "google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechClient.java", - "google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechSettings.java", - "google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/package-info.java", - "google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechCallableFactory.java", - "google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechStub.java", - "google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStub.java", - "google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStubSettings.java", - "google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeech.java", - "google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeechImpl.java", - "google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientTest.java", - "google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechSmokeTest.java", - "google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeech.java", - "google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeechImpl.java", - "google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java", - "google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechSmokeTest.java", - "grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechGrpc.java", - "grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechGrpc.java", - "java.header", - "license-checks.xml", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadata.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadataOrBuilder.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequest.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequestOrBuilder.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponse.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponseOrBuilder.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudio.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudioOrBuilder.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfig.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfigOrBuilder.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadata.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadataOrBuilder.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequest.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequestOrBuilder.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponse.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponseOrBuilder.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfig.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfigOrBuilder.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechContext.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechContextOrBuilder.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechProto.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionAlternative.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionAlternativeOrBuilder.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResult.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResultOrBuilder.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionConfig.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionConfigOrBuilder.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResult.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResultOrBuilder.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequest.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequestOrBuilder.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponse.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponseOrBuilder.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfo.java", - "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfoOrBuilder.java", - "proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClass.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassName.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassOrBuilder.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequest.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequestOrBuilder.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponse.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponseOrBuilder.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSet.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetName.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetOrBuilder.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudio.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudioOrBuilder.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfig.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfigOrBuilder.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadata.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadataOrBuilder.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequest.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequestOrBuilder.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponse.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponseOrBuilder.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfig.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfigOrBuilder.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptation.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationOrBuilder.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContext.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContextOrBuilder.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternative.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternativeOrBuilder.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResult.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResultOrBuilder.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechResourceProto.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfig.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfigOrBuilder.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResult.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResultOrBuilder.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequest.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequestOrBuilder.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponse.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponseOrBuilder.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfo.java", - "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfoOrBuilder.java", - "proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto", - "proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/resource.proto", - "renovate.json", - "samples/install-without-bom/pom.xml", - "samples/pom.xml", - "samples/snapshot/pom.xml", - "samples/snippets/pom.xml" - ] -} \ No newline at end of file diff --git a/synth.py b/synth.py deleted file mode 100644 index 4333f8e51..000000000 --- a/synth.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 2018 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -import synthtool.languages.java as java - -AUTOSYNTH_MULTIPLE_COMMITS = True - -service = 'speech' -versions = ['v1', 'v1p1beta1'] - -for version in versions: - library = java.bazel_library( - service=service, - version=version, - bazel_target=f'//google/cloud/{service}/{version}:google-cloud-{service}-{version}-java', - ) - -# skip smoke test on VPCSC -s.replace( - 'google-cloud-speech/src/test/**/SpeechSmokeTest.java', - 'import org.junit.Test;', - "import org.junit.Assume;\nimport org.junit.Test;" -) -vpcsc_skip_code = """ - // Skip smoke tests if running in VPCSC because our V1 integration tests - // cover VPC-SC. - Assume.assumeTrue(System.getenv("GOOGLE_CLOUD_TESTS_IN_VPCSC") == null);""" -s.replace( - 'google-cloud-speech/src/test/**/SpeechSmokeTest.java', - r'(\s+public void run.*)', - f'\g<1>{vpcsc_skip_code}' -) - -java.common_templates() diff --git a/versions.txt b/versions.txt deleted file mode 100644 index 0b5805bc6..000000000 --- a/versions.txt +++ /dev/null @@ -1,10 +0,0 @@ -# Format: -# module:released-version:current-version - -google-cloud-speech:1.24.1:1.24.2-SNAPSHOT -grpc-google-cloud-speech-v1:1.24.1:1.24.2-SNAPSHOT -grpc-google-cloud-speech-v1beta1:0.77.1:0.77.2-SNAPSHOT -grpc-google-cloud-speech-v1p1beta1:0.77.1:0.77.2-SNAPSHOT -proto-google-cloud-speech-v1:1.24.1:1.24.2-SNAPSHOT -proto-google-cloud-speech-v1beta1:0.77.1:0.77.2-SNAPSHOT -proto-google-cloud-speech-v1p1beta1:0.77.1:0.77.2-SNAPSHOT \ No newline at end of file