diff --git a/.github/release-please.yml b/.github/release-please.yml index 82744682..dce2c845 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1 +1,2 @@ releaseType: java-yoshi +bumpMinorPreMajor: true \ No newline at end of file diff --git a/.github/trusted-contribution.yml b/.github/trusted-contribution.yml new file mode 100644 index 00000000..f247d5c7 --- /dev/null +++ b/.github/trusted-contribution.yml @@ -0,0 +1,2 @@ +trustedContributors: +- renovate-bot \ No newline at end of file diff --git a/.kokoro/build.sh b/.kokoro/build.sh index fa132f41..e62d0321 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -27,6 +27,7 @@ echo ${JOB_TYPE} mvn install -B -V \ -DskipTests=true \ -Dclirr.skip=true \ + -Denforcer.skip=true \ -Dmaven.javadoc.skip=true \ -Dgcloud.download.skip=true \ -T 1C @@ -36,25 +37,72 @@ if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTI export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_ROOT}/src/${GOOGLE_APPLICATION_CREDENTIALS}) fi +RETURN_CODE=0 +set +e + case ${JOB_TYPE} in test) - mvn test -B -Dclirr.skip=true - bash ${KOKORO_GFILE_DIR}/codecov.sh - bash .kokoro/coerce_logs.sh + mvn test -B -Dclirr.skip=true -Denforcer.skip=true + RETURN_CODE=$? ;; lint) - mvn com.coveo:fmt-maven-plugin:check + mvn \ + -Penable-samples \ + com.coveo:fmt-maven-plugin:check + RETURN_CODE=$? ;; javadoc) mvn javadoc:javadoc javadoc:test-javadoc + RETURN_CODE=$? ;; integration) - mvn -B ${INTEGRATION_TEST_ARGS} -DtrimStackTrace=false -Dclirr.skip=true -fae verify - bash .kokoro/coerce_logs.sh + 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 clirr:check + mvn -B -Denforcer.skip=true clirr:check + RETURN_CODE=$? ;; *) ;; -esac \ No newline at end of file +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-document-ai +fi + +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} diff --git a/.kokoro/continuous/java8.cfg b/.kokoro/continuous/java8.cfg index 3b017fc8..495cc7ba 100644 --- a/.kokoro/continuous/java8.cfg +++ b/.kokoro/continuous/java8.cfg @@ -5,3 +5,8 @@ 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/samples.cfg b/.kokoro/continuous/samples.cfg new file mode 100644 index 00000000..fa7b493d --- /dev/null +++ b/.kokoro/continuous/samples.cfg @@ -0,0 +1,31 @@ +# 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" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index 9470b9c1..f326e3cd 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -23,5 +23,9 @@ echo $JOB_TYPE export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" -mvn install -DskipTests=true -B -V +# this should run maven enforcer +mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true + mvn -B dependency:analyze -DfailOnWarning=true diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh index 7c94f33e..34e98e92 100755 --- a/.kokoro/linkage-monitor.sh +++ b/.kokoro/linkage-monitor.sh @@ -23,7 +23,12 @@ cd github/java-document-ai/ java -version echo ${JOB_TYPE} -mvn install -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V +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 diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg index 3b017fc8..8bf59c02 100644 --- a/.kokoro/nightly/integration.cfg +++ b/.kokoro/nightly/integration.cfg @@ -5,3 +5,17 @@ env_vars: { key: "TRAMPOLINE_IMAGE" value: "gcr.io/cloud-devrel-kokoro-resources/java8" } + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/nightly/java8.cfg b/.kokoro/nightly/java8.cfg index 3b017fc8..495cc7ba 100644 --- a/.kokoro/nightly/java8.cfg +++ b/.kokoro/nightly/java8.cfg @@ -5,3 +5,8 @@ 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 new file mode 100644 index 00000000..b4b051cd --- /dev/null +++ b/.kokoro/nightly/samples.cfg @@ -0,0 +1,36 @@ +# 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" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/presubmit/java8.cfg b/.kokoro/presubmit/java8.cfg index 3b017fc8..495cc7ba 100644 --- a/.kokoro/presubmit/java8.cfg +++ b/.kokoro/presubmit/java8.cfg @@ -5,3 +5,8 @@ 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/samples.cfg b/.kokoro/presubmit/samples.cfg new file mode 100644 index 00000000..fa7b493d --- /dev/null +++ b/.kokoro/presubmit/samples.cfg @@ -0,0 +1,31 @@ +# 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" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg index fda0dbbe..54e9e333 100644 --- a/.kokoro/release/drop.cfg +++ b/.kokoro/release/drop.cfg @@ -4,6 +4,3 @@ env_vars: { key: "TRAMPOLINE_BUILD_FILE" value: "github/java-document-ai/.kokoro/release/drop.sh" } - -# Download staging properties file. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/java/releases/java-document-ai" \ No newline at end of file diff --git a/.kokoro/release/promote.cfg b/.kokoro/release/promote.cfg index c0da0fec..19079acd 100644 --- a/.kokoro/release/promote.cfg +++ b/.kokoro/release/promote.cfg @@ -4,7 +4,3 @@ env_vars: { key: "TRAMPOLINE_BUILD_FILE" value: "github/java-document-ai/.kokoro/release/promote.sh" } - -# Download staging properties file. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/java/releases/java-document-ai" - diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh index a2aaf7c2..1aa0f820 100755 --- a/.kokoro/release/publish_javadoc.sh +++ b/.kokoro/release/publish_javadoc.sh @@ -33,7 +33,7 @@ python3 -m pip install gcp-docuploader # compile all packages mvn clean install -B -DskipTests=true -NAME=documentai +NAME=google-cloud-document-ai VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) # build the docs diff --git a/.repo-metadata.json b/.repo-metadata.json index 0dd1f0ae..9297f92f 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -1,13 +1,16 @@ { "name": "documentai", - "name_pretty": "Google Cloud OS Login", + "name_pretty": "Document AI", "product_documentation": "https://cloud.google.com/compute/docs/documentai/", - "client_documentation": "https://googleapis.dev/java/google-cloud-clients/latest/index.html?com/google/cloud/documentai/v1/package-summary.html", + "client_documentation": "https://googleapis.dev/java/google-cloud-document-ai/latest/index.html", + "api_description": "allows developers to unlock insights from your documents with machine learning.", "issue_tracker": "https://issuetracker.google.com/savedsearches/559755", "release_level": "alpha", "language": "java", "repo": "googleapis/java-document-ai", "repo_short": "java-document-ai", - "distribution_name": "com.google.cloud:google-cloud-documentai", - "api_id": "documentai.googleapis.com" + "distribution_name": "com.google.cloud:google-cloud-document-ai", + "api_id": "documentai.googleapis.com", + "transport": "grpc", + "requires_billing": true } \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ebbb59e5..085021dd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,4 +25,106 @@ information on using pull requests. ## Community Guidelines This project follows -[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). \ No newline at end of file +[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). + +## Building the project + +To build, package, and run all unit tests run the command + +``` +mvn clean verify +``` + +### Running Integration tests + +To include integration tests when building the project, you need access to +a GCP Project with a valid service account. + +For instructions on how to generate a service account and corresponding +credentials JSON see: [Creating a Service Account][1]. + +Then run the following to build, package, run all unit tests and run all +integration tests. + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +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`. + +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 + selectively exclude samples from a build run. +2. Many code samples depend on external GCP services and need + credentials to access the service. +3. Code samples are not released as Maven artifacts and must be excluded from + release builds. + +### Building + +```bash +mvn -Penable-samples 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 +``` + +### 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 + +### 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 diff --git a/README.md b/README.md index 1a43ef17..bf7783f5 100644 --- a/README.md +++ b/README.md @@ -1,113 +1,163 @@ -Google Cloud Java Client for Cloud Document AI -============================================== +# Google Document AI Client for Java -Java idiomatic client for Document AI. +Java idiomatic client for [Document AI][product-docs]. -[![Kokoro CI](http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/master.svg)](http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/master.html) -[![Maven](https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-documentai.svg)](https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-documentai.svg) -[![Codacy Badge](https://api.codacy.com/project/badge/grade/9da006ad7c3a4fe1abd142e77c003917)](https://www.codacy.com/app/mziccard/google-cloud-java) +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] > Note: This client is a work-in-progress, and may occasionally > make backwards-incompatible changes. -Quickstart ----------- -If you are using Maven with Bom, Add this to your pom.xml file. +## Quickstart + +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file ```xml - + + + com.google.cloud + libraries-bom + 4.2.0 + pom + import + + + + com.google.cloud - libraries-bom - 2.8.0 - pom - import - - - - - - com.google.cloud - google-cloud-documentai - + google-cloud-document-ai + + ``` -[//]: # ({x-version-update-start:google-cloud-documentai:released}) -If you are using Maven without Bom, Add this to your dependencies. + +[//]: # ({x-version-update-start:google-cloud-document-ai:released}) + +If you are using Maven without BOM, add this to your dependencies: + ```xml com.google.cloud - google-cloud-documentai - 0.1.0 + google-cloud-document-ai + 0.0.0 ``` + If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-documentai:0.1.0' +compile 'com.google.cloud:google-cloud-document-ai:0.0.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-documentai" % "0.1.0" +libraryDependencies += "com.google.cloud" % "google-cloud-document-ai" % "0.0.0" ``` [//]: # ({x-version-update-end}) -Authentication --------------- +## Authentication -See the [Authentication](https://github.com/googleapis/google-cloud-java#authentication) section in the base directory's README. +See the [Authentication][authentication] section in the base directory's README. -About Google Cloud Cloud Document AI ------------------------------------- +## Getting Started +### Prerequisites -See the Cloud Document AI client library docs to learn how to use this Document AI API Client Library. +You will need a [Google Cloud Platform Console][developer-console] project with the Document AI [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Document AI. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud SDK][cloud-sdk] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. -Getting Started ---------------- -#### Prerequisites -You will need a [Google Developers Console](https://console.developers.google.com/) project with the Cloud Document AI API enabled. [Follow these instructions](https://cloud.google.com/resource-manager/docs/creating-managing-projects) to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud SDK](https://cloud.google.com/sdk/) and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. +### Installation and setup -#### Installation and setup -You'll need to obtain the `google-cloud-documentai` library. See the [Quickstart](#quickstart) section to add `google-cloud-documentai` as a dependency in your code. +You'll need to obtain the `google-cloud-document-ai` library. See the [Quickstart](#quickstart) section +to add `google-cloud-document-ai` as a dependency in your code. -Troubleshooting ---------------- +## About Document AI -To get help, follow the instructions in the [shared Troubleshooting document](https://github.com/googleapis/google-cloud-common/blob/master/troubleshooting/readme.md#troubleshooting). -Transport ---------- -Cloud Document AI uses gRPC for the transport layer. +[Document AI][product-docs] allows developers to unlock insights from your documents with machine learning. -Java Versions -------------- +See the [Document AI client library docs][javadocs] to learn how to +use this Document AI Client Library. -Java 7 or above is required for using this client. -Versioning ----------- -This library follows [Semantic Versioning](http://semver.org/). -It is currently in major version zero (``0.y.z``), which means that anything may change at any time and the public API should not be considered stable. -Contributing ------------- -Contributions to this library are always welcome and highly encouraged. +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Document AI uses gRPC for the transport layer. + +## Java Versions + +Java 7 or above is required for using this client. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + -See `google-cloud`'s [CONTRIBUTING] documentation and the [shared documentation](https://github.com/googleapis/google-cloud-common/blob/master/contributing/readme.md#how-to-contribute-to-gcloud) for more information on how to get started. +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. -Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information. -License -------- +## Contributing -Apache 2.0 - See [LICENSE] for more information. +Contributions to this library are always welcome and highly encouraged. -[CONTRIBUTING]:https://github.com/googleapis/java-documentai/blob/master/CONTRIBUTING.md -[code-of-conduct]:https://github.com/googleapis/java-documentai/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct -[LICENSE]: https://github.com/googleapis/java-documentai/blob/master/LICENSE -[cloud-platform]: https://cloud.google.com/ -[client-lib-docs]: https://googleapis.dev/java/google-cloud-clients/latest/index.html?com/google/cloud/documentai/v2/package-summary.html \ No newline at end of file +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +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. + +## CI Status + +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] + +[product-docs]: https://cloud.google.com/compute/docs/documentai/ +[javadocs]: https://googleapis.dev/java/google-cloud-document-ai/latest/index.html +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-document-ai/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-document-ai/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-document-ai/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-document-ai/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-document-ai/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-document-ai/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-document-ai/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-document-ai/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-document-ai/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-document-ai/java11.html +[stability-image]: https://img.shields.io/badge/stability-alpha-orange +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-document-ai.svg +[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-document-ai&core=gav +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[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-document-ai/blob/master/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-document-ai/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-document-ai/blob/master/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=documentai.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 diff --git a/google-cloud-documentai-bom/pom.xml b/google-cloud-document-ai-bom/pom.xml similarity index 71% rename from google-cloud-documentai-bom/pom.xml rename to google-cloud-document-ai-bom/pom.xml index bf378df5..8fccdff7 100644 --- a/google-cloud-documentai-bom/pom.xml +++ b/google-cloud-document-ai-bom/pom.xml @@ -2,8 +2,8 @@ 4.0.0 com.google.cloud - google-cloud-documentai-bom - 0.1.0-SNAPSHOT + google-cloud-document-ai-bom + 0.1.0-SNAPSHOT pom com.google.cloud @@ -13,9 +13,7 @@ Google Cloud Document AI BOM https://github.com/googleapis/java-documentai - - BOM for Google Cloud Document AI - + BOM for Google Cloud Document AI Google LLC @@ -62,18 +60,28 @@ com.google.api.grpc - proto-google-cloud-documentai-v1beta1 - 0.1.0-SNAPSHOT + proto-google-cloud-document-ai-v1beta1 + 0.1.0-SNAPSHOT com.google.api.grpc - grpc-google-cloud-documentai-v1beta1 - 0.1.0-SNAPSHOT + proto-google-cloud-document-ai-v1beta2 + 0.1.0-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-document-ai-v1beta1 + 0.1.0-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-document-ai-v1beta2 + 0.1.0-SNAPSHOT com.google.cloud - google-cloud-documentai - 0.1.0-SNAPSHOT + google-cloud-document-ai + 0.1.0-SNAPSHOT diff --git a/google-cloud-documentai/pom.xml b/google-cloud-document-ai/pom.xml similarity index 80% rename from google-cloud-documentai/pom.xml rename to google-cloud-document-ai/pom.xml index fb0c87ed..497aeb25 100644 --- a/google-cloud-documentai/pom.xml +++ b/google-cloud-document-ai/pom.xml @@ -2,19 +2,19 @@ 4.0.0 com.google.cloud - google-cloud-documentai - 0.1.0-SNAPSHOT + google-cloud-document-ai + 0.1.0-SNAPSHOT jar Google Cloud Document AI https://github.com/googleapis/java-documentai Java idiomatic client for Google Cloud Document AI com.google.cloud - google-cloud-documentai-parent - 0.1.0-SNAPSHOT + google-cloud-document-ai-parent + 0.1.0-SNAPSHOT - google-cloud-documentai + google-cloud-document-ai @@ -44,7 +44,11 @@ com.google.api.grpc - proto-google-cloud-documentai-v1beta1 + proto-google-cloud-document-ai-v1beta1 + + + com.google.api.grpc + proto-google-cloud-document-ai-v1beta2 com.google.guava @@ -71,7 +75,12 @@ com.google.api.grpc - grpc-google-cloud-documentai-v1beta1 + grpc-google-cloud-document-ai-v1beta1 + test + + + com.google.api.grpc + grpc-google-cloud-document-ai-v1beta2 test diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClient.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClient.java new file mode 100644 index 00000000..8f63c68f --- /dev/null +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClient.java @@ -0,0 +1,300 @@ +/* + * 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.documentai.v1beta1; + +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.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.documentai.v1beta1.stub.DocumentUnderstandingServiceStub; +import com.google.cloud.documentai.v1beta1.stub.DocumentUnderstandingServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Service to parse structured information from unstructured or semi-structured + * documents using state-of-the-art Google AI such as natural language, computer vision, and + * translation. + * + *

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 (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
+ *   List<ProcessDocumentRequest> requests = new ArrayList<>();
+ *   BatchProcessDocumentsResponse response = documentUnderstandingServiceClient.batchProcessDocumentsAsync(requests).get();
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the documentUnderstandingServiceClient 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 + * DocumentUnderstandingServiceSettings to create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * DocumentUnderstandingServiceSettings documentUnderstandingServiceSettings =
+ *     DocumentUnderstandingServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
+ *     DocumentUnderstandingServiceClient.create(documentUnderstandingServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * DocumentUnderstandingServiceSettings documentUnderstandingServiceSettings =
+ *     DocumentUnderstandingServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
+ *     DocumentUnderstandingServiceClient.create(documentUnderstandingServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class DocumentUnderstandingServiceClient implements BackgroundResource { + private final DocumentUnderstandingServiceSettings settings; + private final DocumentUnderstandingServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of DocumentUnderstandingServiceClient with default settings. */ + public static final DocumentUnderstandingServiceClient create() throws IOException { + return create(DocumentUnderstandingServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of DocumentUnderstandingServiceClient, 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 DocumentUnderstandingServiceClient create( + DocumentUnderstandingServiceSettings settings) throws IOException { + return new DocumentUnderstandingServiceClient(settings); + } + + /** + * Constructs an instance of DocumentUnderstandingServiceClient, using the given stub for making + * calls. This is for advanced usage - prefer to use DocumentUnderstandingServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final DocumentUnderstandingServiceClient create( + DocumentUnderstandingServiceStub stub) { + return new DocumentUnderstandingServiceClient(stub); + } + + /** + * Constructs an instance of DocumentUnderstandingServiceClient, 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 DocumentUnderstandingServiceClient(DocumentUnderstandingServiceSettings settings) + throws IOException { + this.settings = settings; + this.stub = + ((DocumentUnderstandingServiceStubSettings) 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 DocumentUnderstandingServiceClient(DocumentUnderstandingServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final DocumentUnderstandingServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public DocumentUnderstandingServiceStub 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 + /** + * LRO endpoint to batch process many documents. + * + *

Sample code: + * + *


+   * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
+   *   List<ProcessDocumentRequest> requests = new ArrayList<>();
+   *   BatchProcessDocumentsResponse response = documentUnderstandingServiceClient.batchProcessDocumentsAsync(requests).get();
+   * }
+   * 
+ * + * @param requests Required. Individual requests for each document. + * @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 + batchProcessDocumentsAsync(List requests) { + BatchProcessDocumentsRequest request = + BatchProcessDocumentsRequest.newBuilder().addAllRequests(requests).build(); + return batchProcessDocumentsAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * LRO endpoint to batch process many documents. + * + *

Sample code: + * + *


+   * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
+   *   List<ProcessDocumentRequest> requests = new ArrayList<>();
+   *   BatchProcessDocumentsRequest request = BatchProcessDocumentsRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   BatchProcessDocumentsResponse response = documentUnderstandingServiceClient.batchProcessDocumentsAsync(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 + batchProcessDocumentsAsync(BatchProcessDocumentsRequest request) { + return batchProcessDocumentsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * LRO endpoint to batch process many documents. + * + *

Sample code: + * + *


+   * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
+   *   List<ProcessDocumentRequest> requests = new ArrayList<>();
+   *   BatchProcessDocumentsRequest request = BatchProcessDocumentsRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   OperationFuture<BatchProcessDocumentsResponse, OperationMetadata> future = documentUnderstandingServiceClient.batchProcessDocumentsOperationCallable().futureCall(request);
+   *   // Do something
+   *   BatchProcessDocumentsResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationCallable() { + return stub.batchProcessDocumentsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * LRO endpoint to batch process many documents. + * + *

Sample code: + * + *


+   * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
+   *   List<ProcessDocumentRequest> requests = new ArrayList<>();
+   *   BatchProcessDocumentsRequest request = BatchProcessDocumentsRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   ApiFuture<Operation> future = documentUnderstandingServiceClient.batchProcessDocumentsCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + batchProcessDocumentsCallable() { + return stub.batchProcessDocumentsCallable(); + } + + @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-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceSettings.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceSettings.java new file mode 100644 index 00000000..87ceed34 --- /dev/null +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceSettings.java @@ -0,0 +1,205 @@ +/* + * 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.documentai.v1beta1; + +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.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.documentai.v1beta1.stub.DocumentUnderstandingServiceStubSettings; +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 DocumentUnderstandingServiceClient}. + * + *

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

    + *
  • The default service address (documentai.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 batchProcessDocumentsAsync to 30 seconds: + * + *

+ * 
+ * DocumentUnderstandingServiceSettings.Builder documentUnderstandingServiceSettingsBuilder =
+ *     DocumentUnderstandingServiceSettings.newBuilder();
+ * documentUnderstandingServiceSettingsBuilder
+ *     .batchProcessDocumentsSettings()
+ *     .setRetrySettings(
+ *         documentUnderstandingServiceSettingsBuilder.batchProcessDocumentsSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * DocumentUnderstandingServiceSettings documentUnderstandingServiceSettings = documentUnderstandingServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class DocumentUnderstandingServiceSettings + extends ClientSettings { + /** Returns the object with the settings used for calls to batchProcessDocuments. */ + public UnaryCallSettings + batchProcessDocumentsSettings() { + return ((DocumentUnderstandingServiceStubSettings) getStubSettings()) + .batchProcessDocumentsSettings(); + } + + /** Returns the object with the settings used for calls to batchProcessDocuments. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationSettings() { + return ((DocumentUnderstandingServiceStubSettings) getStubSettings()) + .batchProcessDocumentsOperationSettings(); + } + + public static final DocumentUnderstandingServiceSettings create( + DocumentUnderstandingServiceStubSettings stub) throws IOException { + return new DocumentUnderstandingServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return DocumentUnderstandingServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return DocumentUnderstandingServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DocumentUnderstandingServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return DocumentUnderstandingServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return DocumentUnderstandingServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return DocumentUnderstandingServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DocumentUnderstandingServiceStubSettings.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 DocumentUnderstandingServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for DocumentUnderstandingServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(DocumentUnderstandingServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(DocumentUnderstandingServiceStubSettings.newBuilder()); + } + + protected Builder(DocumentUnderstandingServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(DocumentUnderstandingServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public DocumentUnderstandingServiceStubSettings.Builder getStubSettingsBuilder() { + return ((DocumentUnderstandingServiceStubSettings.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 batchProcessDocuments. */ + public UnaryCallSettings.Builder + batchProcessDocumentsSettings() { + return getStubSettingsBuilder().batchProcessDocumentsSettings(); + } + + /** Returns the builder for the settings used for calls to batchProcessDocuments. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationSettings() { + return getStubSettingsBuilder().batchProcessDocumentsOperationSettings(); + } + + @Override + public DocumentUnderstandingServiceSettings build() throws IOException { + return new DocumentUnderstandingServiceSettings(this); + } + } +} diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/package-info.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/package-info.java new file mode 100644 index 00000000..f7fc4875 --- /dev/null +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/package-info.java @@ -0,0 +1,43 @@ +/* + * 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 Document AI API. + * + *

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

================================== DocumentUnderstandingServiceClient + * ================================== + * + *

Service Description: Service to parse structured information from unstructured or + * semi-structured documents using state-of-the-art Google AI such as natural language, computer + * vision, and translation. + * + *

Sample for DocumentUnderstandingServiceClient: + * + *

+ * 
+ * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
+ *   List<ProcessDocumentRequest> requests = new ArrayList<>();
+ *   BatchProcessDocumentsResponse response = documentUnderstandingServiceClient.batchProcessDocumentsAsync(requests);
+ * }
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +package com.google.cloud.documentai.v1beta1; + +import javax.annotation.Generated; diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStub.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStub.java new file mode 100644 index 00000000..e121fb0d --- /dev/null +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStub.java @@ -0,0 +1,58 @@ +/* + * 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.documentai.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest; +import com.google.cloud.documentai.v1beta1.BatchProcessDocumentsResponse; +import com.google.cloud.documentai.v1beta1.OperationMetadata; +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 Document AI 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 DocumentUnderstandingServiceStub 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()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: batchProcessDocumentsOperationCallable()"); + } + + public UnaryCallable batchProcessDocumentsCallable() { + throw new UnsupportedOperationException("Not implemented: batchProcessDocumentsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStubSettings.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStubSettings.java new file mode 100644 index 00000000..1441128e --- /dev/null +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStubSettings.java @@ -0,0 +1,336 @@ +/* + * 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.documentai.v1beta1.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.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest; +import com.google.cloud.documentai.v1beta1.BatchProcessDocumentsResponse; +import com.google.cloud.documentai.v1beta1.OperationMetadata; +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 DocumentUnderstandingServiceStub}. + * + *

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

    + *
  • The default service address (documentai.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 batchProcessDocumentsAsync to 30 seconds: + * + *

+ * 
+ * DocumentUnderstandingServiceStubSettings.Builder documentUnderstandingServiceSettingsBuilder =
+ *     DocumentUnderstandingServiceStubSettings.newBuilder();
+ * documentUnderstandingServiceSettingsBuilder
+ *     .batchProcessDocumentsSettings()
+ *     .setRetrySettings(
+ *         documentUnderstandingServiceSettingsBuilder.batchProcessDocumentsSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * DocumentUnderstandingServiceStubSettings documentUnderstandingServiceSettings = documentUnderstandingServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class DocumentUnderstandingServiceStubSettings + 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 + batchProcessDocumentsSettings; + private final OperationCallSettings< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationSettings; + + /** Returns the object with the settings used for calls to batchProcessDocuments. */ + public UnaryCallSettings + batchProcessDocumentsSettings() { + return batchProcessDocumentsSettings; + } + + /** Returns the object with the settings used for calls to batchProcessDocuments. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationSettings() { + return batchProcessDocumentsOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public DocumentUnderstandingServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcDocumentUnderstandingServiceStub.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 "documentai.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(DocumentUnderstandingServiceStubSettings.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 DocumentUnderstandingServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + batchProcessDocumentsSettings = settingsBuilder.batchProcessDocumentsSettings().build(); + batchProcessDocumentsOperationSettings = + settingsBuilder.batchProcessDocumentsOperationSettings().build(); + } + + /** Builder for DocumentUnderstandingServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + batchProcessDocumentsSettings; + private final OperationCallSettings.Builder< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", 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(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + batchProcessDocumentsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + batchProcessDocumentsOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(batchProcessDocumentsSettings); + + 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 + .batchProcessDocumentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .batchProcessDocumentsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + BatchProcessDocumentsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(20000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(86400000L)) + .build())); + + return builder; + } + + protected Builder(DocumentUnderstandingServiceStubSettings settings) { + super(settings); + + batchProcessDocumentsSettings = settings.batchProcessDocumentsSettings.toBuilder(); + batchProcessDocumentsOperationSettings = + settings.batchProcessDocumentsOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(batchProcessDocumentsSettings); + } + + // 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 batchProcessDocuments. */ + public UnaryCallSettings.Builder + batchProcessDocumentsSettings() { + return batchProcessDocumentsSettings; + } + + /** Returns the builder for the settings used for calls to batchProcessDocuments. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationSettings() { + return batchProcessDocumentsOperationSettings; + } + + @Override + public DocumentUnderstandingServiceStubSettings build() throws IOException { + return new DocumentUnderstandingServiceStubSettings(this); + } + } +} diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceCallableFactory.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceCallableFactory.java new file mode 100644 index 00000000..f66ebe91 --- /dev/null +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.documentai.v1beta1.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 Document AI 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 GrpcDocumentUnderstandingServiceCallableFactory 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-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceStub.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceStub.java new file mode 100644 index 00000000..63bc20b3 --- /dev/null +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceStub.java @@ -0,0 +1,190 @@ +/* + * 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.documentai.v1beta1.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.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest; +import com.google.cloud.documentai.v1beta1.BatchProcessDocumentsResponse; +import com.google.cloud.documentai.v1beta1.OperationMetadata; +import com.google.common.collect.ImmutableMap; +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.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Cloud Document AI 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 GrpcDocumentUnderstandingServiceStub extends DocumentUnderstandingServiceStub { + + private static final MethodDescriptor + batchProcessDocumentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta1.DocumentUnderstandingService/BatchProcessDocuments") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchProcessDocumentsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable + batchProcessDocumentsCallable; + private final OperationCallable< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcDocumentUnderstandingServiceStub create( + DocumentUnderstandingServiceStubSettings settings) throws IOException { + return new GrpcDocumentUnderstandingServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcDocumentUnderstandingServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcDocumentUnderstandingServiceStub( + DocumentUnderstandingServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcDocumentUnderstandingServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcDocumentUnderstandingServiceStub( + DocumentUnderstandingServiceStubSettings.newBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of GrpcDocumentUnderstandingServiceStub, 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 GrpcDocumentUnderstandingServiceStub( + DocumentUnderstandingServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcDocumentUnderstandingServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcDocumentUnderstandingServiceStub, 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 GrpcDocumentUnderstandingServiceStub( + DocumentUnderstandingServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + batchProcessDocumentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchProcessDocumentsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(BatchProcessDocumentsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + + this.batchProcessDocumentsCallable = + callableFactory.createUnaryCallable( + batchProcessDocumentsTransportSettings, + settings.batchProcessDocumentsSettings(), + clientContext); + this.batchProcessDocumentsOperationCallable = + callableFactory.createOperationCallable( + batchProcessDocumentsTransportSettings, + settings.batchProcessDocumentsOperationSettings(), + clientContext, + this.operationsStub); + + 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; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationCallable() { + return batchProcessDocumentsOperationCallable; + } + + public UnaryCallable batchProcessDocumentsCallable() { + return batchProcessDocumentsCallable; + } + + @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-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClient.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClient.java new file mode 100644 index 00000000..a3111385 --- /dev/null +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClient.java @@ -0,0 +1,343 @@ +/* + * 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.documentai.v1beta2; + +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.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.documentai.v1beta2.stub.DocumentUnderstandingServiceStub; +import com.google.cloud.documentai.v1beta2.stub.DocumentUnderstandingServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Service to parse structured information from unstructured or semi-structured + * documents using state-of-the-art Google AI such as natural language, computer vision, and + * translation. + * + *

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 (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
+ *   ProcessDocumentRequest request = ProcessDocumentRequest.newBuilder().build();
+ *   Document response = documentUnderstandingServiceClient.processDocument(request);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the documentUnderstandingServiceClient 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 + * DocumentUnderstandingServiceSettings to create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * DocumentUnderstandingServiceSettings documentUnderstandingServiceSettings =
+ *     DocumentUnderstandingServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
+ *     DocumentUnderstandingServiceClient.create(documentUnderstandingServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * DocumentUnderstandingServiceSettings documentUnderstandingServiceSettings =
+ *     DocumentUnderstandingServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
+ *     DocumentUnderstandingServiceClient.create(documentUnderstandingServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class DocumentUnderstandingServiceClient implements BackgroundResource { + private final DocumentUnderstandingServiceSettings settings; + private final DocumentUnderstandingServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of DocumentUnderstandingServiceClient with default settings. */ + public static final DocumentUnderstandingServiceClient create() throws IOException { + return create(DocumentUnderstandingServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of DocumentUnderstandingServiceClient, 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 DocumentUnderstandingServiceClient create( + DocumentUnderstandingServiceSettings settings) throws IOException { + return new DocumentUnderstandingServiceClient(settings); + } + + /** + * Constructs an instance of DocumentUnderstandingServiceClient, using the given stub for making + * calls. This is for advanced usage - prefer to use DocumentUnderstandingServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final DocumentUnderstandingServiceClient create( + DocumentUnderstandingServiceStub stub) { + return new DocumentUnderstandingServiceClient(stub); + } + + /** + * Constructs an instance of DocumentUnderstandingServiceClient, 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 DocumentUnderstandingServiceClient(DocumentUnderstandingServiceSettings settings) + throws IOException { + this.settings = settings; + this.stub = + ((DocumentUnderstandingServiceStubSettings) 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 DocumentUnderstandingServiceClient(DocumentUnderstandingServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final DocumentUnderstandingServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public DocumentUnderstandingServiceStub 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 + /** + * LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in + * the [Document] format. + * + *

Sample code: + * + *


+   * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
+   *   List<ProcessDocumentRequest> requests = new ArrayList<>();
+   *   BatchProcessDocumentsResponse response = documentUnderstandingServiceClient.batchProcessDocumentsAsync(requests).get();
+   * }
+   * 
+ * + * @param requests Required. Individual requests for each document. + * @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 + batchProcessDocumentsAsync(List requests) { + BatchProcessDocumentsRequest request = + BatchProcessDocumentsRequest.newBuilder().addAllRequests(requests).build(); + return batchProcessDocumentsAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in + * the [Document] format. + * + *

Sample code: + * + *


+   * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
+   *   List<ProcessDocumentRequest> requests = new ArrayList<>();
+   *   BatchProcessDocumentsRequest request = BatchProcessDocumentsRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   BatchProcessDocumentsResponse response = documentUnderstandingServiceClient.batchProcessDocumentsAsync(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 + batchProcessDocumentsAsync(BatchProcessDocumentsRequest request) { + return batchProcessDocumentsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in + * the [Document] format. + * + *

Sample code: + * + *


+   * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
+   *   List<ProcessDocumentRequest> requests = new ArrayList<>();
+   *   BatchProcessDocumentsRequest request = BatchProcessDocumentsRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   OperationFuture<BatchProcessDocumentsResponse, OperationMetadata> future = documentUnderstandingServiceClient.batchProcessDocumentsOperationCallable().futureCall(request);
+   *   // Do something
+   *   BatchProcessDocumentsResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationCallable() { + return stub.batchProcessDocumentsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in + * the [Document] format. + * + *

Sample code: + * + *


+   * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
+   *   List<ProcessDocumentRequest> requests = new ArrayList<>();
+   *   BatchProcessDocumentsRequest request = BatchProcessDocumentsRequest.newBuilder()
+   *     .addAllRequests(requests)
+   *     .build();
+   *   ApiFuture<Operation> future = documentUnderstandingServiceClient.batchProcessDocumentsCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + batchProcessDocumentsCallable() { + return stub.batchProcessDocumentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Processes a single document. + * + *

Sample code: + * + *


+   * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
+   *   ProcessDocumentRequest request = ProcessDocumentRequest.newBuilder().build();
+   *   Document response = documentUnderstandingServiceClient.processDocument(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 Document processDocument(ProcessDocumentRequest request) { + return processDocumentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Processes a single document. + * + *

Sample code: + * + *


+   * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
+   *   ProcessDocumentRequest request = ProcessDocumentRequest.newBuilder().build();
+   *   ApiFuture<Document> future = documentUnderstandingServiceClient.processDocumentCallable().futureCall(request);
+   *   // Do something
+   *   Document response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable processDocumentCallable() { + return stub.processDocumentCallable(); + } + + @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-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceSettings.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceSettings.java new file mode 100644 index 00000000..db7606aa --- /dev/null +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceSettings.java @@ -0,0 +1,215 @@ +/* + * 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.documentai.v1beta2; + +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.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.documentai.v1beta2.stub.DocumentUnderstandingServiceStubSettings; +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 DocumentUnderstandingServiceClient}. + * + *

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

    + *
  • The default service address (documentai.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 processDocument to 30 seconds: + * + *

+ * 
+ * DocumentUnderstandingServiceSettings.Builder documentUnderstandingServiceSettingsBuilder =
+ *     DocumentUnderstandingServiceSettings.newBuilder();
+ * documentUnderstandingServiceSettingsBuilder
+ *     .processDocumentSettings()
+ *     .setRetrySettings(
+ *         documentUnderstandingServiceSettingsBuilder.processDocumentSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * DocumentUnderstandingServiceSettings documentUnderstandingServiceSettings = documentUnderstandingServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class DocumentUnderstandingServiceSettings + extends ClientSettings { + /** Returns the object with the settings used for calls to batchProcessDocuments. */ + public UnaryCallSettings + batchProcessDocumentsSettings() { + return ((DocumentUnderstandingServiceStubSettings) getStubSettings()) + .batchProcessDocumentsSettings(); + } + + /** Returns the object with the settings used for calls to batchProcessDocuments. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationSettings() { + return ((DocumentUnderstandingServiceStubSettings) getStubSettings()) + .batchProcessDocumentsOperationSettings(); + } + + /** Returns the object with the settings used for calls to processDocument. */ + public UnaryCallSettings processDocumentSettings() { + return ((DocumentUnderstandingServiceStubSettings) getStubSettings()).processDocumentSettings(); + } + + public static final DocumentUnderstandingServiceSettings create( + DocumentUnderstandingServiceStubSettings stub) throws IOException { + return new DocumentUnderstandingServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return DocumentUnderstandingServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return DocumentUnderstandingServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DocumentUnderstandingServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return DocumentUnderstandingServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return DocumentUnderstandingServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return DocumentUnderstandingServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DocumentUnderstandingServiceStubSettings.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 DocumentUnderstandingServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for DocumentUnderstandingServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(DocumentUnderstandingServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(DocumentUnderstandingServiceStubSettings.newBuilder()); + } + + protected Builder(DocumentUnderstandingServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(DocumentUnderstandingServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public DocumentUnderstandingServiceStubSettings.Builder getStubSettingsBuilder() { + return ((DocumentUnderstandingServiceStubSettings.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 batchProcessDocuments. */ + public UnaryCallSettings.Builder + batchProcessDocumentsSettings() { + return getStubSettingsBuilder().batchProcessDocumentsSettings(); + } + + /** Returns the builder for the settings used for calls to batchProcessDocuments. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationSettings() { + return getStubSettingsBuilder().batchProcessDocumentsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to processDocument. */ + public UnaryCallSettings.Builder processDocumentSettings() { + return getStubSettingsBuilder().processDocumentSettings(); + } + + @Override + public DocumentUnderstandingServiceSettings build() throws IOException { + return new DocumentUnderstandingServiceSettings(this); + } + } +} diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/package-info.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/package-info.java new file mode 100644 index 00000000..62a42566 --- /dev/null +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/package-info.java @@ -0,0 +1,43 @@ +/* + * 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 Document AI API. + * + *

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

================================== DocumentUnderstandingServiceClient + * ================================== + * + *

Service Description: Service to parse structured information from unstructured or + * semi-structured documents using state-of-the-art Google AI such as natural language, computer + * vision, and translation. + * + *

Sample for DocumentUnderstandingServiceClient: + * + *

+ * 
+ * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
+ *   ProcessDocumentRequest request = ProcessDocumentRequest.newBuilder().build();
+ *   Document response = documentUnderstandingServiceClient.processDocument(request);
+ * }
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +package com.google.cloud.documentai.v1beta2; + +import javax.annotation.Generated; diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/DocumentUnderstandingServiceStub.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/DocumentUnderstandingServiceStub.java new file mode 100644 index 00000000..5d3928b5 --- /dev/null +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/DocumentUnderstandingServiceStub.java @@ -0,0 +1,64 @@ +/* + * 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.documentai.v1beta2.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest; +import com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse; +import com.google.cloud.documentai.v1beta2.Document; +import com.google.cloud.documentai.v1beta2.OperationMetadata; +import com.google.cloud.documentai.v1beta2.ProcessDocumentRequest; +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 Document AI 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 DocumentUnderstandingServiceStub 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()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: batchProcessDocumentsOperationCallable()"); + } + + public UnaryCallable batchProcessDocumentsCallable() { + throw new UnsupportedOperationException("Not implemented: batchProcessDocumentsCallable()"); + } + + public UnaryCallable processDocumentCallable() { + throw new UnsupportedOperationException("Not implemented: processDocumentCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/DocumentUnderstandingServiceStubSettings.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/DocumentUnderstandingServiceStubSettings.java new file mode 100644 index 00000000..d74b5e80 --- /dev/null +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/DocumentUnderstandingServiceStubSettings.java @@ -0,0 +1,362 @@ +/* + * 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.documentai.v1beta2.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.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest; +import com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse; +import com.google.cloud.documentai.v1beta2.Document; +import com.google.cloud.documentai.v1beta2.OperationMetadata; +import com.google.cloud.documentai.v1beta2.ProcessDocumentRequest; +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 DocumentUnderstandingServiceStub}. + * + *

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

    + *
  • The default service address (documentai.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 processDocument to 30 seconds: + * + *

+ * 
+ * DocumentUnderstandingServiceStubSettings.Builder documentUnderstandingServiceSettingsBuilder =
+ *     DocumentUnderstandingServiceStubSettings.newBuilder();
+ * documentUnderstandingServiceSettingsBuilder
+ *     .processDocumentSettings()
+ *     .setRetrySettings(
+ *         documentUnderstandingServiceSettingsBuilder.processDocumentSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * DocumentUnderstandingServiceStubSettings documentUnderstandingServiceSettings = documentUnderstandingServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class DocumentUnderstandingServiceStubSettings + 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 + batchProcessDocumentsSettings; + private final OperationCallSettings< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationSettings; + private final UnaryCallSettings processDocumentSettings; + + /** Returns the object with the settings used for calls to batchProcessDocuments. */ + public UnaryCallSettings + batchProcessDocumentsSettings() { + return batchProcessDocumentsSettings; + } + + /** Returns the object with the settings used for calls to batchProcessDocuments. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationSettings() { + return batchProcessDocumentsOperationSettings; + } + + /** Returns the object with the settings used for calls to processDocument. */ + public UnaryCallSettings processDocumentSettings() { + return processDocumentSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public DocumentUnderstandingServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcDocumentUnderstandingServiceStub.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 "documentai.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(DocumentUnderstandingServiceStubSettings.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 DocumentUnderstandingServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + batchProcessDocumentsSettings = settingsBuilder.batchProcessDocumentsSettings().build(); + batchProcessDocumentsOperationSettings = + settingsBuilder.batchProcessDocumentsOperationSettings().build(); + processDocumentSettings = settingsBuilder.processDocumentSettings().build(); + } + + /** Builder for DocumentUnderstandingServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + batchProcessDocumentsSettings; + private final OperationCallSettings.Builder< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationSettings; + private final UnaryCallSettings.Builder + processDocumentSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", 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(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + batchProcessDocumentsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + batchProcessDocumentsOperationSettings = OperationCallSettings.newBuilder(); + + processDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + batchProcessDocumentsSettings, processDocumentSettings); + + 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 + .batchProcessDocumentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .processDocumentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .batchProcessDocumentsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + BatchProcessDocumentsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(20000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(86400000L)) + .build())); + + return builder; + } + + protected Builder(DocumentUnderstandingServiceStubSettings settings) { + super(settings); + + batchProcessDocumentsSettings = settings.batchProcessDocumentsSettings.toBuilder(); + batchProcessDocumentsOperationSettings = + settings.batchProcessDocumentsOperationSettings.toBuilder(); + processDocumentSettings = settings.processDocumentSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + batchProcessDocumentsSettings, processDocumentSettings); + } + + // 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 batchProcessDocuments. */ + public UnaryCallSettings.Builder + batchProcessDocumentsSettings() { + return batchProcessDocumentsSettings; + } + + /** Returns the builder for the settings used for calls to batchProcessDocuments. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationSettings() { + return batchProcessDocumentsOperationSettings; + } + + /** Returns the builder for the settings used for calls to processDocument. */ + public UnaryCallSettings.Builder processDocumentSettings() { + return processDocumentSettings; + } + + @Override + public DocumentUnderstandingServiceStubSettings build() throws IOException { + return new DocumentUnderstandingServiceStubSettings(this); + } + } +} diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/GrpcDocumentUnderstandingServiceCallableFactory.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/GrpcDocumentUnderstandingServiceCallableFactory.java new file mode 100644 index 00000000..6ea0b58a --- /dev/null +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/GrpcDocumentUnderstandingServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.documentai.v1beta2.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 Document AI 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 GrpcDocumentUnderstandingServiceCallableFactory 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-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/GrpcDocumentUnderstandingServiceStub.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/GrpcDocumentUnderstandingServiceStub.java new file mode 100644 index 00000000..39430b8c --- /dev/null +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/GrpcDocumentUnderstandingServiceStub.java @@ -0,0 +1,223 @@ +/* + * 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.documentai.v1beta2.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.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest; +import com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse; +import com.google.cloud.documentai.v1beta2.Document; +import com.google.cloud.documentai.v1beta2.OperationMetadata; +import com.google.cloud.documentai.v1beta2.ProcessDocumentRequest; +import com.google.common.collect.ImmutableMap; +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.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Cloud Document AI 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 GrpcDocumentUnderstandingServiceStub extends DocumentUnderstandingServiceStub { + + private static final MethodDescriptor + batchProcessDocumentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta2.DocumentUnderstandingService/BatchProcessDocuments") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchProcessDocumentsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + processDocumentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.documentai.v1beta2.DocumentUnderstandingService/ProcessDocument") + .setRequestMarshaller( + ProtoUtils.marshaller(ProcessDocumentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Document.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable + batchProcessDocumentsCallable; + private final OperationCallable< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationCallable; + private final UnaryCallable processDocumentCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcDocumentUnderstandingServiceStub create( + DocumentUnderstandingServiceStubSettings settings) throws IOException { + return new GrpcDocumentUnderstandingServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcDocumentUnderstandingServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcDocumentUnderstandingServiceStub( + DocumentUnderstandingServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcDocumentUnderstandingServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcDocumentUnderstandingServiceStub( + DocumentUnderstandingServiceStubSettings.newBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of GrpcDocumentUnderstandingServiceStub, 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 GrpcDocumentUnderstandingServiceStub( + DocumentUnderstandingServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcDocumentUnderstandingServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcDocumentUnderstandingServiceStub, 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 GrpcDocumentUnderstandingServiceStub( + DocumentUnderstandingServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + batchProcessDocumentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchProcessDocumentsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(BatchProcessDocumentsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings processDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(processDocumentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ProcessDocumentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + + this.batchProcessDocumentsCallable = + callableFactory.createUnaryCallable( + batchProcessDocumentsTransportSettings, + settings.batchProcessDocumentsSettings(), + clientContext); + this.batchProcessDocumentsOperationCallable = + callableFactory.createOperationCallable( + batchProcessDocumentsTransportSettings, + settings.batchProcessDocumentsOperationSettings(), + clientContext, + this.operationsStub); + this.processDocumentCallable = + callableFactory.createUnaryCallable( + processDocumentTransportSettings, settings.processDocumentSettings(), 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; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable< + BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata> + batchProcessDocumentsOperationCallable() { + return batchProcessDocumentsOperationCallable; + } + + public UnaryCallable batchProcessDocumentsCallable() { + return batchProcessDocumentsCallable; + } + + public UnaryCallable processDocumentCallable() { + return processDocumentCallable; + } + + @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-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClientTest.java b/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClientTest.java new file mode 100644 index 00000000..0ff114e1 --- /dev/null +++ b/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClientTest.java @@ -0,0 +1,131 @@ +/* + * 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.documentai.v1beta1; + +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.rpc.ApiClientHeaderProvider; +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.ArrayList; +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 DocumentUnderstandingServiceClientTest { + private static MockDocumentUnderstandingService mockDocumentUnderstandingService; + private static MockServiceHelper serviceHelper; + private DocumentUnderstandingServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockDocumentUnderstandingService = new MockDocumentUnderstandingService(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockDocumentUnderstandingService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + DocumentUnderstandingServiceSettings settings = + DocumentUnderstandingServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = DocumentUnderstandingServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void batchProcessDocumentsTest() throws Exception { + BatchProcessDocumentsResponse expectedResponse = + BatchProcessDocumentsResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchProcessDocumentsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentUnderstandingService.addResponse(resultOperation); + + List requests = new ArrayList<>(); + + BatchProcessDocumentsResponse actualResponse = + client.batchProcessDocumentsAsync(requests).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentUnderstandingService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BatchProcessDocumentsRequest actualRequest = + (BatchProcessDocumentsRequest) actualRequests.get(0); + + Assert.assertEquals(requests, actualRequest.getRequestsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void batchProcessDocumentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockDocumentUnderstandingService.addException(exception); + + try { + List requests = new ArrayList<>(); + + client.batchProcessDocumentsAsync(requests).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()); + } + } +} diff --git a/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingService.java b/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingService.java new file mode 100644 index 00000000..e9856c7d --- /dev/null +++ b/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingService.java @@ -0,0 +1,57 @@ +/* + * 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.documentai.v1beta1; + +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 MockDocumentUnderstandingService implements MockGrpcService { + private final MockDocumentUnderstandingServiceImpl serviceImpl; + + public MockDocumentUnderstandingService() { + serviceImpl = new MockDocumentUnderstandingServiceImpl(); + } + + @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-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingServiceImpl.java b/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingServiceImpl.java new file mode 100644 index 00000000..a41b118b --- /dev/null +++ b/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingServiceImpl.java @@ -0,0 +1,74 @@ +/* + * 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.documentai.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.documentai.v1beta1.DocumentUnderstandingServiceGrpc.DocumentUnderstandingServiceImplBase; +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 MockDocumentUnderstandingServiceImpl extends DocumentUnderstandingServiceImplBase { + private List requests; + private Queue responses; + + public MockDocumentUnderstandingServiceImpl() { + 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 batchProcessDocuments( + BatchProcessDocumentsRequest 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")); + } + } +} diff --git a/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClientTest.java b/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClientTest.java new file mode 100644 index 00000000..0f3f15f3 --- /dev/null +++ b/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClientTest.java @@ -0,0 +1,172 @@ +/* + * 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.documentai.v1beta2; + +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.rpc.ApiClientHeaderProvider; +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.ArrayList; +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 DocumentUnderstandingServiceClientTest { + private static MockDocumentUnderstandingService mockDocumentUnderstandingService; + private static MockServiceHelper serviceHelper; + private DocumentUnderstandingServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockDocumentUnderstandingService = new MockDocumentUnderstandingService(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockDocumentUnderstandingService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + DocumentUnderstandingServiceSettings settings = + DocumentUnderstandingServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = DocumentUnderstandingServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void batchProcessDocumentsTest() throws Exception { + BatchProcessDocumentsResponse expectedResponse = + BatchProcessDocumentsResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchProcessDocumentsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentUnderstandingService.addResponse(resultOperation); + + List requests = new ArrayList<>(); + + BatchProcessDocumentsResponse actualResponse = + client.batchProcessDocumentsAsync(requests).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentUnderstandingService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BatchProcessDocumentsRequest actualRequest = + (BatchProcessDocumentsRequest) actualRequests.get(0); + + Assert.assertEquals(requests, actualRequest.getRequestsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void batchProcessDocumentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockDocumentUnderstandingService.addException(exception); + + try { + List requests = new ArrayList<>(); + + client.batchProcessDocumentsAsync(requests).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 processDocumentTest() { + String uri = "uri116076"; + String mimeType = "mimeType-196041627"; + String text = "text3556653"; + Document expectedResponse = + Document.newBuilder().setUri(uri).setMimeType(mimeType).setText(text).build(); + mockDocumentUnderstandingService.addResponse(expectedResponse); + + ProcessDocumentRequest request = ProcessDocumentRequest.newBuilder().build(); + + Document actualResponse = client.processDocument(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentUnderstandingService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ProcessDocumentRequest actualRequest = (ProcessDocumentRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void processDocumentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockDocumentUnderstandingService.addException(exception); + + try { + ProcessDocumentRequest request = ProcessDocumentRequest.newBuilder().build(); + + client.processDocument(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockDocumentUnderstandingService.java b/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockDocumentUnderstandingService.java new file mode 100644 index 00000000..bc62c5ed --- /dev/null +++ b/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockDocumentUnderstandingService.java @@ -0,0 +1,57 @@ +/* + * 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.documentai.v1beta2; + +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 MockDocumentUnderstandingService implements MockGrpcService { + private final MockDocumentUnderstandingServiceImpl serviceImpl; + + public MockDocumentUnderstandingService() { + serviceImpl = new MockDocumentUnderstandingServiceImpl(); + } + + @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-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockDocumentUnderstandingServiceImpl.java b/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockDocumentUnderstandingServiceImpl.java new file mode 100644 index 00000000..bce68ef0 --- /dev/null +++ b/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/MockDocumentUnderstandingServiceImpl.java @@ -0,0 +1,89 @@ +/* + * 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.documentai.v1beta2; + +import com.google.api.core.BetaApi; +import com.google.cloud.documentai.v1beta2.DocumentUnderstandingServiceGrpc.DocumentUnderstandingServiceImplBase; +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 MockDocumentUnderstandingServiceImpl extends DocumentUnderstandingServiceImplBase { + private List requests; + private Queue responses; + + public MockDocumentUnderstandingServiceImpl() { + 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 batchProcessDocuments( + BatchProcessDocumentsRequest 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 void processDocument( + ProcessDocumentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Document) { + requests.add(request); + responseObserver.onNext((Document) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClient.java b/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClient.java index c1509ecc..8f63c68f 100644 --- a/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClient.java +++ b/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -189,7 +189,6 @@ public final OperationsClient getOperationsClient() { "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture batchProcessDocumentsAsync(List requests) { - BatchProcessDocumentsRequest request = BatchProcessDocumentsRequest.newBuilder().addAllRequests(requests).build(); return batchProcessDocumentsAsync(request); diff --git a/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceSettings.java b/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceSettings.java index 80a04afb..87ceed34 100644 --- a/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceSettings.java +++ b/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -53,8 +53,12 @@ * * DocumentUnderstandingServiceSettings.Builder documentUnderstandingServiceSettingsBuilder = * DocumentUnderstandingServiceSettings.newBuilder(); - * documentUnderstandingServiceSettingsBuilder.batchProcessDocumentsSettings().getRetrySettings().toBuilder() - * .setTotalTimeout(Duration.ofSeconds(30)); + * documentUnderstandingServiceSettingsBuilder + * .batchProcessDocumentsSettings() + * .setRetrySettings( + * documentUnderstandingServiceSettingsBuilder.batchProcessDocumentsSettings().getRetrySettings().toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); * DocumentUnderstandingServiceSettings documentUnderstandingServiceSettings = documentUnderstandingServiceSettingsBuilder.build(); * * diff --git a/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/package-info.java b/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/package-info.java index 71a15f5c..f7fc4875 100644 --- a/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/package-info.java +++ b/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. diff --git a/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStub.java b/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStub.java index 046c4b7e..e121fb0d 100644 --- a/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStub.java +++ b/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. diff --git a/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStubSettings.java b/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStubSettings.java index 27ecc227..1441128e 100644 --- a/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStubSettings.java +++ b/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -68,8 +68,12 @@ * * DocumentUnderstandingServiceStubSettings.Builder documentUnderstandingServiceSettingsBuilder = * DocumentUnderstandingServiceStubSettings.newBuilder(); - * documentUnderstandingServiceSettingsBuilder.batchProcessDocumentsSettings().getRetrySettings().toBuilder() - * .setTotalTimeout(Duration.ofSeconds(30)); + * documentUnderstandingServiceSettingsBuilder + * .batchProcessDocumentsSettings() + * .setRetrySettings( + * documentUnderstandingServiceSettingsBuilder.batchProcessDocumentsSettings().getRetrySettings().toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); * DocumentUnderstandingServiceStubSettings documentUnderstandingServiceSettings = documentUnderstandingServiceSettingsBuilder.build(); * * diff --git a/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceCallableFactory.java b/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceCallableFactory.java index 888cc471..f66ebe91 100644 --- a/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceCallableFactory.java +++ b/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. diff --git a/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceStub.java b/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceStub.java index 22e5790f..63bc20b3 100644 --- a/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceStub.java +++ b/google-cloud-documentai/src/main/java/com/google/cloud/documentai/v1beta1/stub/GrpcDocumentUnderstandingServiceStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. diff --git a/google-cloud-documentai/src/test/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClientTest.java b/google-cloud-documentai/src/test/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClientTest.java index 95586d51..0ff114e1 100644 --- a/google-cloud-documentai/src/test/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClientTest.java +++ b/google-cloud-documentai/src/test/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -32,6 +32,7 @@ import java.util.ArrayList; 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; @@ -52,7 +53,8 @@ public static void startStaticServer() { mockDocumentUnderstandingService = new MockDocumentUnderstandingService(); serviceHelper = new MockServiceHelper( - "in-process-1", Arrays.asList(mockDocumentUnderstandingService)); + UUID.randomUUID().toString(), + Arrays.asList(mockDocumentUnderstandingService)); serviceHelper.start(); } diff --git a/google-cloud-documentai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingService.java b/google-cloud-documentai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingService.java index 62713173..e9856c7d 100644 --- a/google-cloud-documentai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingService.java +++ b/google-cloud-documentai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingService.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. diff --git a/google-cloud-documentai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingServiceImpl.java b/google-cloud-documentai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingServiceImpl.java index 5127ca1b..a41b118b 100644 --- a/google-cloud-documentai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingServiceImpl.java +++ b/google-cloud-documentai/src/test/java/com/google/cloud/documentai/v1beta1/MockDocumentUnderstandingServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. diff --git a/grpc-google-cloud-documentai-v1beta1/pom.xml b/grpc-google-cloud-document-ai-v1beta1/pom.xml similarity index 80% rename from grpc-google-cloud-documentai-v1beta1/pom.xml rename to grpc-google-cloud-document-ai-v1beta1/pom.xml index 2322c330..89574272 100644 --- a/grpc-google-cloud-documentai-v1beta1/pom.xml +++ b/grpc-google-cloud-document-ai-v1beta1/pom.xml @@ -2,14 +2,14 @@ 4.0.0 com.google.api.grpc - grpc-google-cloud-documentai-v1beta1 - 0.1.0-SNAPSHOT - grpc-google-cloud-documentai-v1beta1 - GRPC library for grpc-google-cloud-documentai-v1beta1 + grpc-google-cloud-document-ai-v1beta1 + 0.1.0-SNAPSHOT + grpc-google-cloud-document-ai-v1beta1 + GRPC library for grpc-google-cloud-document-ai-v1beta1 com.google.cloud - google-cloud-documentai-parent - 0.1.0-SNAPSHOT + google-cloud-document-ai-parent + 0.1.0-SNAPSHOT @@ -34,7 +34,7 @@ com.google.api.grpc - proto-google-cloud-documentai-v1beta1 + proto-google-cloud-document-ai-v1beta1 com.google.guava diff --git a/grpc-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceGrpc.java b/grpc-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceGrpc.java similarity index 89% rename from grpc-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceGrpc.java rename to grpc-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceGrpc.java index 0ba4f1e4..4e2477f9 100644 --- a/grpc-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceGrpc.java +++ b/grpc-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceGrpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -32,7 +32,7 @@ * */ @javax.annotation.Generated( - value = "by gRPC proto compiler (version 1.10.0)", + value = "by gRPC proto compiler", comments = "Source: google/cloud/documentai/v1beta1/document_understanding.proto") public final class DocumentUnderstandingServiceGrpc { @@ -42,30 +42,20 @@ private DocumentUnderstandingServiceGrpc() {} "google.cloud.documentai.v1beta1.DocumentUnderstandingService"; // Static method descriptors that strictly reflect the proto. - @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") - @java.lang.Deprecated // Use {@link #getBatchProcessDocumentsMethod()} instead. - public static final io.grpc.MethodDescriptor< - com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest, - com.google.longrunning.Operation> - METHOD_BATCH_PROCESS_DOCUMENTS = getBatchProcessDocumentsMethodHelper(); - private static volatile io.grpc.MethodDescriptor< com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest, com.google.longrunning.Operation> getBatchProcessDocumentsMethod; - @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "BatchProcessDocuments", + requestType = com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor< com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest, com.google.longrunning.Operation> getBatchProcessDocumentsMethod() { - return getBatchProcessDocumentsMethodHelper(); - } - - private static io.grpc.MethodDescriptor< - com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest, - com.google.longrunning.Operation> - getBatchProcessDocumentsMethodHelper() { io.grpc.MethodDescriptor< com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest, com.google.longrunning.Operation> @@ -85,9 +75,7 @@ private DocumentUnderstandingServiceGrpc() {} newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName( - generateFullMethodName( - "google.cloud.documentai.v1beta1.DocumentUnderstandingService", - "BatchProcessDocuments")) + generateFullMethodName(SERVICE_NAME, "BatchProcessDocuments")) .setSampledToLocalTracing(true) .setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( @@ -145,14 +133,14 @@ public abstract static class DocumentUnderstandingServiceImplBase public void batchProcessDocuments( com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getBatchProcessDocumentsMethodHelper(), responseObserver); + asyncUnimplementedUnaryCall(getBatchProcessDocumentsMethod(), responseObserver); } @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( - getBatchProcessDocumentsMethodHelper(), + getBatchProcessDocumentsMethod(), asyncUnaryCall( new MethodHandlers< com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest, @@ -198,7 +186,7 @@ public void batchProcessDocuments( com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( - getChannel().newCall(getBatchProcessDocumentsMethodHelper(), getCallOptions()), + getChannel().newCall(getBatchProcessDocumentsMethod(), getCallOptions()), request, responseObserver); } @@ -240,7 +228,7 @@ protected DocumentUnderstandingServiceBlockingStub build( public com.google.longrunning.Operation batchProcessDocuments( com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest request) { return blockingUnaryCall( - getChannel(), getBatchProcessDocumentsMethodHelper(), getCallOptions(), request); + getChannel(), getBatchProcessDocumentsMethod(), getCallOptions(), request); } } @@ -281,7 +269,7 @@ protected DocumentUnderstandingServiceFutureStub build( batchProcessDocuments( com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest request) { return futureUnaryCall( - getChannel().newCall(getBatchProcessDocumentsMethodHelper(), getCallOptions()), request); + getChannel().newCall(getBatchProcessDocumentsMethod(), getCallOptions()), request); } } @@ -373,7 +361,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) .setSchemaDescriptor(new DocumentUnderstandingServiceFileDescriptorSupplier()) - .addMethod(getBatchProcessDocumentsMethodHelper()) + .addMethod(getBatchProcessDocumentsMethod()) .build(); } } diff --git a/grpc-google-cloud-document-ai-v1beta2/pom.xml b/grpc-google-cloud-document-ai-v1beta2/pom.xml new file mode 100644 index 00000000..d83806c2 --- /dev/null +++ b/grpc-google-cloud-document-ai-v1beta2/pom.xml @@ -0,0 +1,59 @@ + + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-document-ai-v1beta2 + 0.1.0-SNAPSHOT + grpc-google-cloud-document-ai-v1beta2 + GRPC library for grpc-google-cloud-document-ai-v1beta2 + + com.google.cloud + google-cloud-document-ai-parent + 0.1.0-SNAPSHOT + + + + 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.grpc + proto-google-cloud-document-ai-v1beta2 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + \ No newline at end of file diff --git a/grpc-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceGrpc.java b/grpc-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceGrpc.java new file mode 100644 index 00000000..6a2668bd --- /dev/null +++ b/grpc-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceGrpc.java @@ -0,0 +1,496 @@ +/* + * 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.documentai.v1beta2; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +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.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * Service to parse structured information from unstructured or semi-structured
+ * documents using state-of-the-art Google AI such as natural language,
+ * computer vision, and translation.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/documentai/v1beta2/document_understanding.proto") +public final class DocumentUnderstandingServiceGrpc { + + private DocumentUnderstandingServiceGrpc() {} + + public static final String SERVICE_NAME = + "google.cloud.documentai.v1beta2.DocumentUnderstandingService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest, + com.google.longrunning.Operation> + getBatchProcessDocumentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "BatchProcessDocuments", + requestType = com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest, + com.google.longrunning.Operation> + getBatchProcessDocumentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest, + com.google.longrunning.Operation> + getBatchProcessDocumentsMethod; + if ((getBatchProcessDocumentsMethod = + DocumentUnderstandingServiceGrpc.getBatchProcessDocumentsMethod) + == null) { + synchronized (DocumentUnderstandingServiceGrpc.class) { + if ((getBatchProcessDocumentsMethod = + DocumentUnderstandingServiceGrpc.getBatchProcessDocumentsMethod) + == null) { + DocumentUnderstandingServiceGrpc.getBatchProcessDocumentsMethod = + getBatchProcessDocumentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "BatchProcessDocuments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentUnderstandingServiceMethodDescriptorSupplier( + "BatchProcessDocuments")) + .build(); + } + } + } + return getBatchProcessDocumentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest, + com.google.cloud.documentai.v1beta2.Document> + getProcessDocumentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ProcessDocument", + requestType = com.google.cloud.documentai.v1beta2.ProcessDocumentRequest.class, + responseType = com.google.cloud.documentai.v1beta2.Document.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest, + com.google.cloud.documentai.v1beta2.Document> + getProcessDocumentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest, + com.google.cloud.documentai.v1beta2.Document> + getProcessDocumentMethod; + if ((getProcessDocumentMethod = DocumentUnderstandingServiceGrpc.getProcessDocumentMethod) + == null) { + synchronized (DocumentUnderstandingServiceGrpc.class) { + if ((getProcessDocumentMethod = DocumentUnderstandingServiceGrpc.getProcessDocumentMethod) + == null) { + DocumentUnderstandingServiceGrpc.getProcessDocumentMethod = + getProcessDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ProcessDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.documentai.v1beta2.Document.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentUnderstandingServiceMethodDescriptorSupplier( + "ProcessDocument")) + .build(); + } + } + } + return getProcessDocumentMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static DocumentUnderstandingServiceStub newStub(io.grpc.Channel channel) { + return new DocumentUnderstandingServiceStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static DocumentUnderstandingServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new DocumentUnderstandingServiceBlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static DocumentUnderstandingServiceFutureStub newFutureStub(io.grpc.Channel channel) { + return new DocumentUnderstandingServiceFutureStub(channel); + } + + /** + * + * + *
+   * Service to parse structured information from unstructured or semi-structured
+   * documents using state-of-the-art Google AI such as natural language,
+   * computer vision, and translation.
+   * 
+ */ + public abstract static class DocumentUnderstandingServiceImplBase + implements io.grpc.BindableService { + + /** + * + * + *
+     * LRO endpoint to batch process many documents. The output is written
+     * to Cloud Storage as JSON in the [Document] format.
+     * 
+ */ + public void batchProcessDocuments( + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getBatchProcessDocumentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Processes a single document.
+     * 
+ */ + public void processDocument( + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getProcessDocumentMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getBatchProcessDocumentsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest, + com.google.longrunning.Operation>(this, METHODID_BATCH_PROCESS_DOCUMENTS))) + .addMethod( + getProcessDocumentMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest, + com.google.cloud.documentai.v1beta2.Document>( + this, METHODID_PROCESS_DOCUMENT))) + .build(); + } + } + + /** + * + * + *
+   * Service to parse structured information from unstructured or semi-structured
+   * documents using state-of-the-art Google AI such as natural language,
+   * computer vision, and translation.
+   * 
+ */ + public static final class DocumentUnderstandingServiceStub + extends io.grpc.stub.AbstractStub { + private DocumentUnderstandingServiceStub(io.grpc.Channel channel) { + super(channel); + } + + private DocumentUnderstandingServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentUnderstandingServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents. The output is written
+     * to Cloud Storage as JSON in the [Document] format.
+     * 
+ */ + public void batchProcessDocuments( + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getBatchProcessDocumentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Processes a single document.
+     * 
+ */ + public void processDocument( + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getProcessDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service to parse structured information from unstructured or semi-structured
+   * documents using state-of-the-art Google AI such as natural language,
+   * computer vision, and translation.
+   * 
+ */ + public static final class DocumentUnderstandingServiceBlockingStub + extends io.grpc.stub.AbstractStub { + private DocumentUnderstandingServiceBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private DocumentUnderstandingServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentUnderstandingServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents. The output is written
+     * to Cloud Storage as JSON in the [Document] format.
+     * 
+ */ + public com.google.longrunning.Operation batchProcessDocuments( + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest request) { + return blockingUnaryCall( + getChannel(), getBatchProcessDocumentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Processes a single document.
+     * 
+ */ + public com.google.cloud.documentai.v1beta2.Document processDocument( + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest request) { + return blockingUnaryCall(getChannel(), getProcessDocumentMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service to parse structured information from unstructured or semi-structured
+   * documents using state-of-the-art Google AI such as natural language,
+   * computer vision, and translation.
+   * 
+ */ + public static final class DocumentUnderstandingServiceFutureStub + extends io.grpc.stub.AbstractStub { + private DocumentUnderstandingServiceFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private DocumentUnderstandingServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentUnderstandingServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * LRO endpoint to batch process many documents. The output is written
+     * to Cloud Storage as JSON in the [Document] format.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + batchProcessDocuments( + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest request) { + return futureUnaryCall( + getChannel().newCall(getBatchProcessDocumentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Processes a single document.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.documentai.v1beta2.Document> + processDocument(com.google.cloud.documentai.v1beta2.ProcessDocumentRequest request) { + return futureUnaryCall( + getChannel().newCall(getProcessDocumentMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_BATCH_PROCESS_DOCUMENTS = 0; + private static final int METHODID_PROCESS_DOCUMENT = 1; + + 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 DocumentUnderstandingServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(DocumentUnderstandingServiceImplBase 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_BATCH_PROCESS_DOCUMENTS: + serviceImpl.batchProcessDocuments( + (com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_PROCESS_DOCUMENT: + serviceImpl.processDocument( + (com.google.cloud.documentai.v1beta2.ProcessDocumentRequest) 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) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class DocumentUnderstandingServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + DocumentUnderstandingServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.documentai.v1beta2.DocumentAiProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("DocumentUnderstandingService"); + } + } + + private static final class DocumentUnderstandingServiceFileDescriptorSupplier + extends DocumentUnderstandingServiceBaseDescriptorSupplier { + DocumentUnderstandingServiceFileDescriptorSupplier() {} + } + + private static final class DocumentUnderstandingServiceMethodDescriptorSupplier + extends DocumentUnderstandingServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + DocumentUnderstandingServiceMethodDescriptorSupplier(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 (DocumentUnderstandingServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new DocumentUnderstandingServiceFileDescriptorSupplier()) + .addMethod(getBatchProcessDocumentsMethod()) + .addMethod(getProcessDocumentMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java.header b/java.header new file mode 100644 index 00000000..3a9b503a --- /dev/null +++ b/java.header @@ -0,0 +1,15 @@ +^/\*$ +^ \* 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/pom.xml b/pom.xml index 05fd3e7c..01633ed4 100644 --- a/pom.xml +++ b/pom.xml @@ -2,9 +2,9 @@ 4.0.0 com.google.cloud - google-cloud-documentai-parent + google-cloud-document-ai-parent pom - 0.1.0-SNAPSHOT + 0.1.0-SNAPSHOT Google Cloud Document AI Parent https://github.com/googleapis/java-documentai @@ -62,16 +62,16 @@ UTF-8 UTF-8 github - google-cloud-documentai-parent - 1.91.1 + google-cloud-document-ai-parent + 1.93.2 1.8.1 1.17.0 - 1.50.0 - 1.24.1 - 3.10.0 + 1.54.0 + 1.27.2 + 3.11.4 4.12 - 28.1-android - 1.4.0 + 28.2-android + 1.4.1 1.3.2 1.18 @@ -80,13 +80,23 @@ com.google.api.grpc - grpc-google-cloud-documentai-v1beta1 - 0.1.0-SNAPSHOT + grpc-google-cloud-document-ai-v1beta1 + 0.1.0-SNAPSHOT com.google.api.grpc - proto-google-cloud-documentai-v1beta1 - 0.1.0-SNAPSHOT + grpc-google-cloud-document-ai-v1beta2 + 0.1.0-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-document-ai-v1beta1 + 0.1.0-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-document-ai-v1beta2 + 0.1.0-SNAPSHOT @@ -174,10 +184,12 @@ - proto-google-cloud-documentai-v1beta1 - grpc-google-cloud-documentai-v1beta1 - google-cloud-documentai - google-cloud-documentai-bom + proto-google-cloud-document-ai-v1beta1 + proto-google-cloud-document-ai-v1beta2 + grpc-google-cloud-document-ai-v1beta1 + grpc-google-cloud-document-ai-v1beta2 + google-cloud-document-ai + google-cloud-document-ai-bom diff --git a/proto-google-cloud-documentai-v1beta1/pom.xml b/proto-google-cloud-document-ai-v1beta1/pom.xml similarity index 69% rename from proto-google-cloud-documentai-v1beta1/pom.xml rename to proto-google-cloud-document-ai-v1beta1/pom.xml index 8859b88c..ff4c2ec2 100644 --- a/proto-google-cloud-documentai-v1beta1/pom.xml +++ b/proto-google-cloud-document-ai-v1beta1/pom.xml @@ -2,14 +2,14 @@ 4.0.0 com.google.api.grpc - proto-google-cloud-documentai-v1beta1 - 0.1.0-SNAPSHOT - proto-google-cloud-documentai-v1beta1 - PROTO library for proto-google-cloud-documentai-v1beta1 + proto-google-cloud-document-ai-v1beta1 + 0.1.0-SNAPSHOT + proto-google-cloud-document-ai-v1beta1 + PROTO library for proto-google-cloud-document-ai-v1beta1 com.google.cloud - google-cloud-documentai-parent - 0.1.0-SNAPSHOT + google-cloud-document-ai-parent + 0.1.0-SNAPSHOT diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsRequest.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsRequest.java similarity index 98% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsRequest.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsRequest.java index baa7dccf..f5fe4bdf 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsRequest.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -42,6 +42,12 @@ private BatchProcessDocumentsRequest() { parent_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchProcessDocumentsRequest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -124,7 +130,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest.Builder.class); } - private int bitField0_; public static final int REQUESTS_FIELD_NUMBER = 1; private java.util.List requests_; /** @@ -214,6 +219,8 @@ public com.google.cloud.documentai.v1beta1.ProcessDocumentRequestOrBuilder getRe * * * string parent = 2; + * + * @return The parent. */ public java.lang.String getParent() { java.lang.Object ref = parent_; @@ -236,6 +243,8 @@ public java.lang.String getParent() { * * * string parent = 2; + * + * @return The bytes for parent. */ public com.google.protobuf.ByteString getParentBytes() { java.lang.Object ref = parent_; @@ -504,7 +513,6 @@ public com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest buildPar com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest result = new com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; if (requestsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { requests_ = java.util.Collections.unmodifiableList(requests_); @@ -515,7 +523,6 @@ public com.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest buildPar result.requests_ = requestsBuilder_.build(); } result.parent_ = parent_; - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -1044,6 +1051,8 @@ public com.google.cloud.documentai.v1beta1.ProcessDocumentRequest.Builder addReq * * * string parent = 2; + * + * @return The parent. */ public java.lang.String getParent() { java.lang.Object ref = parent_; @@ -1066,6 +1075,8 @@ public java.lang.String getParent() { * * * string parent = 2; + * + * @return The bytes for parent. */ public com.google.protobuf.ByteString getParentBytes() { java.lang.Object ref = parent_; @@ -1088,6 +1099,9 @@ public com.google.protobuf.ByteString getParentBytes() { * * * string parent = 2; + * + * @param value The parent to set. + * @return This builder for chaining. */ public Builder setParent(java.lang.String value) { if (value == null) { @@ -1108,6 +1122,8 @@ public Builder setParent(java.lang.String value) { * * * string parent = 2; + * + * @return This builder for chaining. */ public Builder clearParent() { @@ -1125,6 +1141,9 @@ public Builder clearParent() { * * * string parent = 2; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. */ public Builder setParentBytes(com.google.protobuf.ByteString value) { if (value == null) { diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsRequestOrBuilder.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsRequestOrBuilder.java similarity index 97% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsRequestOrBuilder.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsRequestOrBuilder.java index 8aa02eca..f4b7b6dc 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsRequestOrBuilder.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -96,6 +96,8 @@ com.google.cloud.documentai.v1beta1.ProcessDocumentRequestOrBuilder getRequestsO * * * string parent = 2; + * + * @return The parent. */ java.lang.String getParent(); /** @@ -108,6 +110,8 @@ com.google.cloud.documentai.v1beta1.ProcessDocumentRequestOrBuilder getRequestsO * * * string parent = 2; + * + * @return The bytes for parent. */ com.google.protobuf.ByteString getParentBytes(); } diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsResponse.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsResponse.java similarity index 99% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsResponse.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsResponse.java index 49db8e10..2fbf0e02 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsResponse.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -42,6 +42,12 @@ private BatchProcessDocumentsResponse() { responses_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchProcessDocumentsResponse(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsResponseOrBuilder.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsResponseOrBuilder.java similarity index 98% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsResponseOrBuilder.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsResponseOrBuilder.java index 9466ea08..3d84dcaa 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsResponseOrBuilder.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BatchProcessDocumentsResponseOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BoundingPoly.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BoundingPoly.java similarity index 99% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BoundingPoly.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BoundingPoly.java index 6d3e0e68..d4e4f9c7 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BoundingPoly.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BoundingPoly.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -42,6 +42,12 @@ private BoundingPoly() { normalizedVertices_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BoundingPoly(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BoundingPolyOrBuilder.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BoundingPolyOrBuilder.java similarity index 99% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BoundingPolyOrBuilder.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BoundingPolyOrBuilder.java index d723c63f..e3fca55f 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BoundingPolyOrBuilder.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/BoundingPolyOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/Document.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/Document.java similarity index 97% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/Document.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/Document.java index 4ee88f08..465488ad 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/Document.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/Document.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -50,6 +50,12 @@ private Document() { entityRelations_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Document(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -103,10 +109,10 @@ private Document( } case 42: { - if (!((mutable_bitField0_ & 0x00000010) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { textStyles_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000010; + mutable_bitField0_ |= 0x00000001; } textStyles_.add( input.readMessage( @@ -116,10 +122,10 @@ private Document( } case 50: { - if (!((mutable_bitField0_ & 0x00000020) != 0)) { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { pages_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; + mutable_bitField0_ |= 0x00000002; } pages_.add( input.readMessage( @@ -129,10 +135,10 @@ private Document( } case 58: { - if (!((mutable_bitField0_ & 0x00000040) != 0)) { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { entities_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000040; + mutable_bitField0_ |= 0x00000004; } entities_.add( input.readMessage( @@ -142,11 +148,11 @@ private Document( } case 66: { - if (!((mutable_bitField0_ & 0x00000080) != 0)) { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { entityRelations_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.EntityRelation>(); - mutable_bitField0_ |= 0x00000080; + mutable_bitField0_ |= 0x00000008; } entityRelations_.add( input.readMessage( @@ -199,16 +205,16 @@ private Document( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000010) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { textStyles_ = java.util.Collections.unmodifiableList(textStyles_); } - if (((mutable_bitField0_ & 0x00000020) != 0)) { + if (((mutable_bitField0_ & 0x00000002) != 0)) { pages_ = java.util.Collections.unmodifiableList(pages_); } - if (((mutable_bitField0_ & 0x00000040) != 0)) { + if (((mutable_bitField0_ & 0x00000004) != 0)) { entities_ = java.util.Collections.unmodifiableList(entities_); } - if (((mutable_bitField0_ & 0x00000080) != 0)) { + if (((mutable_bitField0_ & 0x00000008) != 0)) { entityRelations_ = java.util.Collections.unmodifiableList(entityRelations_); } this.unknownFields = unknownFields.build(); @@ -244,6 +250,8 @@ public interface ShardInfoOrBuilder * * * int64 shard_index = 1; + * + * @return The shardIndex. */ long getShardIndex(); @@ -255,6 +263,8 @@ public interface ShardInfoOrBuilder * * * int64 shard_count = 2; + * + * @return The shardCount. */ long getShardCount(); @@ -268,6 +278,8 @@ public interface ShardInfoOrBuilder * * * int64 text_offset = 3; + * + * @return The textOffset. */ long getTextOffset(); } @@ -294,6 +306,12 @@ private ShardInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { private ShardInfo() {} + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ShardInfo(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -307,7 +325,6 @@ private ShardInfo( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -377,6 +394,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * int64 shard_index = 1; + * + * @return The shardIndex. */ public long getShardIndex() { return shardIndex_; @@ -392,6 +411,8 @@ public long getShardIndex() { * * * int64 shard_count = 2; + * + * @return The shardCount. */ public long getShardCount() { return shardCount_; @@ -409,6 +430,8 @@ public long getShardCount() { * * * int64 text_offset = 3; + * + * @return The textOffset. */ public long getTextOffset() { return textOffset_; @@ -777,6 +800,8 @@ public Builder mergeFrom( * * * int64 shard_index = 1; + * + * @return The shardIndex. */ public long getShardIndex() { return shardIndex_; @@ -789,6 +814,9 @@ public long getShardIndex() { * * * int64 shard_index = 1; + * + * @param value The shardIndex to set. + * @return This builder for chaining. */ public Builder setShardIndex(long value) { @@ -804,6 +832,8 @@ public Builder setShardIndex(long value) { * * * int64 shard_index = 1; + * + * @return This builder for chaining. */ public Builder clearShardIndex() { @@ -821,6 +851,8 @@ public Builder clearShardIndex() { * * * int64 shard_count = 2; + * + * @return The shardCount. */ public long getShardCount() { return shardCount_; @@ -833,6 +865,9 @@ public long getShardCount() { * * * int64 shard_count = 2; + * + * @param value The shardCount to set. + * @return This builder for chaining. */ public Builder setShardCount(long value) { @@ -848,6 +883,8 @@ public Builder setShardCount(long value) { * * * int64 shard_count = 2; + * + * @return This builder for chaining. */ public Builder clearShardCount() { @@ -867,6 +904,8 @@ public Builder clearShardCount() { * * * int64 text_offset = 3; + * + * @return The textOffset. */ public long getTextOffset() { return textOffset_; @@ -881,6 +920,9 @@ public long getTextOffset() { * * * int64 text_offset = 3; + * + * @param value The textOffset to set. + * @return This builder for chaining. */ public Builder setTextOffset(long value) { @@ -898,6 +940,8 @@ public Builder setTextOffset(long value) { * * * int64 text_offset = 3; + * + * @return This builder for chaining. */ public Builder clearTextOffset() { @@ -972,6 +1016,8 @@ public interface StyleOrBuilder * * * .google.cloud.documentai.v1beta1.Document.TextAnchor text_anchor = 1; + * + * @return Whether the textAnchor field is set. */ boolean hasTextAnchor(); /** @@ -983,6 +1029,8 @@ public interface StyleOrBuilder * * * .google.cloud.documentai.v1beta1.Document.TextAnchor text_anchor = 1; + * + * @return The textAnchor. */ com.google.cloud.documentai.v1beta1.Document.TextAnchor getTextAnchor(); /** @@ -1005,6 +1053,8 @@ public interface StyleOrBuilder * * * .google.type.Color color = 2; + * + * @return Whether the color field is set. */ boolean hasColor(); /** @@ -1015,6 +1065,8 @@ public interface StyleOrBuilder * * * .google.type.Color color = 2; + * + * @return The color. */ com.google.type.Color getColor(); /** @@ -1036,6 +1088,8 @@ public interface StyleOrBuilder * * * .google.type.Color background_color = 3; + * + * @return Whether the backgroundColor field is set. */ boolean hasBackgroundColor(); /** @@ -1046,6 +1100,8 @@ public interface StyleOrBuilder * * * .google.type.Color background_color = 3; + * + * @return The backgroundColor. */ com.google.type.Color getBackgroundColor(); /** @@ -1068,6 +1124,8 @@ public interface StyleOrBuilder * * * string font_weight = 4; + * + * @return The fontWeight. */ java.lang.String getFontWeight(); /** @@ -1079,6 +1137,8 @@ public interface StyleOrBuilder * * * string font_weight = 4; + * + * @return The bytes for fontWeight. */ com.google.protobuf.ByteString getFontWeightBytes(); @@ -1091,6 +1151,8 @@ public interface StyleOrBuilder * * * string text_style = 5; + * + * @return The textStyle. */ java.lang.String getTextStyle(); /** @@ -1102,6 +1164,8 @@ public interface StyleOrBuilder * * * string text_style = 5; + * + * @return The bytes for textStyle. */ com.google.protobuf.ByteString getTextStyleBytes(); @@ -1115,6 +1179,8 @@ public interface StyleOrBuilder * * * string text_decoration = 6; + * + * @return The textDecoration. */ java.lang.String getTextDecoration(); /** @@ -1127,6 +1193,8 @@ public interface StyleOrBuilder * * * string text_decoration = 6; + * + * @return The bytes for textDecoration. */ com.google.protobuf.ByteString getTextDecorationBytes(); @@ -1138,6 +1206,8 @@ public interface StyleOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Style.FontSize font_size = 7; + * + * @return Whether the fontSize field is set. */ boolean hasFontSize(); /** @@ -1148,6 +1218,8 @@ public interface StyleOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Style.FontSize font_size = 7; + * + * @return The fontSize. */ com.google.cloud.documentai.v1beta1.Document.Style.FontSize getFontSize(); /** @@ -1187,6 +1259,12 @@ private Style() { textDecoration_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Style(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -1200,7 +1278,6 @@ private Style( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -1343,6 +1420,8 @@ public interface FontSizeOrBuilder * * * float size = 1; + * + * @return The size. */ float getSize(); @@ -1354,6 +1433,8 @@ public interface FontSizeOrBuilder * * * string unit = 2; + * + * @return The unit. */ java.lang.String getUnit(); /** @@ -1364,6 +1445,8 @@ public interface FontSizeOrBuilder * * * string unit = 2; + * + * @return The bytes for unit. */ com.google.protobuf.ByteString getUnitBytes(); } @@ -1390,6 +1473,12 @@ private FontSize() { unit_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FontSize(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -1403,7 +1492,6 @@ private FontSize( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -1471,6 +1559,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * float size = 1; + * + * @return The size. */ public float getSize() { return size_; @@ -1486,6 +1576,8 @@ public float getSize() { * * * string unit = 2; + * + * @return The unit. */ public java.lang.String getUnit() { java.lang.Object ref = unit_; @@ -1506,6 +1598,8 @@ public java.lang.String getUnit() { * * * string unit = 2; + * + * @return The bytes for unit. */ public com.google.protobuf.ByteString getUnitBytes() { java.lang.Object ref = unit_; @@ -1871,6 +1965,8 @@ public Builder mergeFrom( * * * float size = 1; + * + * @return The size. */ public float getSize() { return size_; @@ -1883,6 +1979,9 @@ public float getSize() { * * * float size = 1; + * + * @param value The size to set. + * @return This builder for chaining. */ public Builder setSize(float value) { @@ -1898,6 +1997,8 @@ public Builder setSize(float value) { * * * float size = 1; + * + * @return This builder for chaining. */ public Builder clearSize() { @@ -1915,6 +2016,8 @@ public Builder clearSize() { * * * string unit = 2; + * + * @return The unit. */ public java.lang.String getUnit() { java.lang.Object ref = unit_; @@ -1935,6 +2038,8 @@ public java.lang.String getUnit() { * * * string unit = 2; + * + * @return The bytes for unit. */ public com.google.protobuf.ByteString getUnitBytes() { java.lang.Object ref = unit_; @@ -1955,6 +2060,9 @@ public com.google.protobuf.ByteString getUnitBytes() { * * * string unit = 2; + * + * @param value The unit to set. + * @return This builder for chaining. */ public Builder setUnit(java.lang.String value) { if (value == null) { @@ -1973,6 +2081,8 @@ public Builder setUnit(java.lang.String value) { * * * string unit = 2; + * + * @return This builder for chaining. */ public Builder clearUnit() { @@ -1988,6 +2098,9 @@ public Builder clearUnit() { * * * string unit = 2; + * + * @param value The bytes for unit to set. + * @return This builder for chaining. */ public Builder setUnitBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -2066,6 +2179,8 @@ public com.google.protobuf.Parser getParserForType() { * * * .google.cloud.documentai.v1beta1.Document.TextAnchor text_anchor = 1; + * + * @return Whether the textAnchor field is set. */ public boolean hasTextAnchor() { return textAnchor_ != null; @@ -2079,6 +2194,8 @@ public boolean hasTextAnchor() { * * * .google.cloud.documentai.v1beta1.Document.TextAnchor text_anchor = 1; + * + * @return The textAnchor. */ public com.google.cloud.documentai.v1beta1.Document.TextAnchor getTextAnchor() { return textAnchor_ == null @@ -2110,6 +2227,8 @@ public com.google.cloud.documentai.v1beta1.Document.TextAnchor getTextAnchor() { * * * .google.type.Color color = 2; + * + * @return Whether the color field is set. */ public boolean hasColor() { return color_ != null; @@ -2122,6 +2241,8 @@ public boolean hasColor() { * * * .google.type.Color color = 2; + * + * @return The color. */ public com.google.type.Color getColor() { return color_ == null ? com.google.type.Color.getDefaultInstance() : color_; @@ -2149,6 +2270,8 @@ public com.google.type.ColorOrBuilder getColorOrBuilder() { * * * .google.type.Color background_color = 3; + * + * @return Whether the backgroundColor field is set. */ public boolean hasBackgroundColor() { return backgroundColor_ != null; @@ -2161,6 +2284,8 @@ public boolean hasBackgroundColor() { * * * .google.type.Color background_color = 3; + * + * @return The backgroundColor. */ public com.google.type.Color getBackgroundColor() { return backgroundColor_ == null @@ -2191,6 +2316,8 @@ public com.google.type.ColorOrBuilder getBackgroundColorOrBuilder() { * * * string font_weight = 4; + * + * @return The fontWeight. */ public java.lang.String getFontWeight() { java.lang.Object ref = fontWeight_; @@ -2212,6 +2339,8 @@ public java.lang.String getFontWeight() { * * * string font_weight = 4; + * + * @return The bytes for fontWeight. */ public com.google.protobuf.ByteString getFontWeightBytes() { java.lang.Object ref = fontWeight_; @@ -2236,6 +2365,8 @@ public com.google.protobuf.ByteString getFontWeightBytes() { * * * string text_style = 5; + * + * @return The textStyle. */ public java.lang.String getTextStyle() { java.lang.Object ref = textStyle_; @@ -2257,6 +2388,8 @@ public java.lang.String getTextStyle() { * * * string text_style = 5; + * + * @return The bytes for textStyle. */ public com.google.protobuf.ByteString getTextStyleBytes() { java.lang.Object ref = textStyle_; @@ -2282,6 +2415,8 @@ public com.google.protobuf.ByteString getTextStyleBytes() { * * * string text_decoration = 6; + * + * @return The textDecoration. */ public java.lang.String getTextDecoration() { java.lang.Object ref = textDecoration_; @@ -2304,6 +2439,8 @@ public java.lang.String getTextDecoration() { * * * string text_decoration = 6; + * + * @return The bytes for textDecoration. */ public com.google.protobuf.ByteString getTextDecorationBytes() { java.lang.Object ref = textDecoration_; @@ -2327,6 +2464,8 @@ public com.google.protobuf.ByteString getTextDecorationBytes() { * * * .google.cloud.documentai.v1beta1.Document.Style.FontSize font_size = 7; + * + * @return Whether the fontSize field is set. */ public boolean hasFontSize() { return fontSize_ != null; @@ -2339,6 +2478,8 @@ public boolean hasFontSize() { * * * .google.cloud.documentai.v1beta1.Document.Style.FontSize font_size = 7; + * + * @return The fontSize. */ public com.google.cloud.documentai.v1beta1.Document.Style.FontSize getFontSize() { return fontSize_ == null @@ -2841,6 +2982,8 @@ public Builder mergeFrom( * * * .google.cloud.documentai.v1beta1.Document.TextAnchor text_anchor = 1; + * + * @return Whether the textAnchor field is set. */ public boolean hasTextAnchor() { return textAnchorBuilder_ != null || textAnchor_ != null; @@ -2854,6 +2997,8 @@ public boolean hasTextAnchor() { * * * .google.cloud.documentai.v1beta1.Document.TextAnchor text_anchor = 1; + * + * @return The textAnchor. */ public com.google.cloud.documentai.v1beta1.Document.TextAnchor getTextAnchor() { if (textAnchorBuilder_ == null) { @@ -3032,6 +3177,8 @@ public Builder clearTextAnchor() { * * * .google.type.Color color = 2; + * + * @return Whether the color field is set. */ public boolean hasColor() { return colorBuilder_ != null || color_ != null; @@ -3044,6 +3191,8 @@ public boolean hasColor() { * * * .google.type.Color color = 2; + * + * @return The color. */ public com.google.type.Color getColor() { if (colorBuilder_ == null) { @@ -3201,6 +3350,8 @@ public com.google.type.ColorOrBuilder getColorOrBuilder() { * * * .google.type.Color background_color = 3; + * + * @return Whether the backgroundColor field is set. */ public boolean hasBackgroundColor() { return backgroundColorBuilder_ != null || backgroundColor_ != null; @@ -3213,6 +3364,8 @@ public boolean hasBackgroundColor() { * * * .google.type.Color background_color = 3; + * + * @return The backgroundColor. */ public com.google.type.Color getBackgroundColor() { if (backgroundColorBuilder_ == null) { @@ -3374,6 +3527,8 @@ public com.google.type.ColorOrBuilder getBackgroundColorOrBuilder() { * * * string font_weight = 4; + * + * @return The fontWeight. */ public java.lang.String getFontWeight() { java.lang.Object ref = fontWeight_; @@ -3395,6 +3550,8 @@ public java.lang.String getFontWeight() { * * * string font_weight = 4; + * + * @return The bytes for fontWeight. */ public com.google.protobuf.ByteString getFontWeightBytes() { java.lang.Object ref = fontWeight_; @@ -3416,6 +3573,9 @@ public com.google.protobuf.ByteString getFontWeightBytes() { * * * string font_weight = 4; + * + * @param value The fontWeight to set. + * @return This builder for chaining. */ public Builder setFontWeight(java.lang.String value) { if (value == null) { @@ -3435,6 +3595,8 @@ public Builder setFontWeight(java.lang.String value) { * * * string font_weight = 4; + * + * @return This builder for chaining. */ public Builder clearFontWeight() { @@ -3451,6 +3613,9 @@ public Builder clearFontWeight() { * * * string font_weight = 4; + * + * @param value The bytes for fontWeight to set. + * @return This builder for chaining. */ public Builder setFontWeightBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -3473,6 +3638,8 @@ public Builder setFontWeightBytes(com.google.protobuf.ByteString value) { * * * string text_style = 5; + * + * @return The textStyle. */ public java.lang.String getTextStyle() { java.lang.Object ref = textStyle_; @@ -3494,6 +3661,8 @@ public java.lang.String getTextStyle() { * * * string text_style = 5; + * + * @return The bytes for textStyle. */ public com.google.protobuf.ByteString getTextStyleBytes() { java.lang.Object ref = textStyle_; @@ -3515,6 +3684,9 @@ public com.google.protobuf.ByteString getTextStyleBytes() { * * * string text_style = 5; + * + * @param value The textStyle to set. + * @return This builder for chaining. */ public Builder setTextStyle(java.lang.String value) { if (value == null) { @@ -3534,6 +3706,8 @@ public Builder setTextStyle(java.lang.String value) { * * * string text_style = 5; + * + * @return This builder for chaining. */ public Builder clearTextStyle() { @@ -3550,6 +3724,9 @@ public Builder clearTextStyle() { * * * string text_style = 5; + * + * @param value The bytes for textStyle to set. + * @return This builder for chaining. */ public Builder setTextStyleBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -3573,6 +3750,8 @@ public Builder setTextStyleBytes(com.google.protobuf.ByteString value) { * * * string text_decoration = 6; + * + * @return The textDecoration. */ public java.lang.String getTextDecoration() { java.lang.Object ref = textDecoration_; @@ -3595,6 +3774,8 @@ public java.lang.String getTextDecoration() { * * * string text_decoration = 6; + * + * @return The bytes for textDecoration. */ public com.google.protobuf.ByteString getTextDecorationBytes() { java.lang.Object ref = textDecoration_; @@ -3617,6 +3798,9 @@ public com.google.protobuf.ByteString getTextDecorationBytes() { * * * string text_decoration = 6; + * + * @param value The textDecoration to set. + * @return This builder for chaining. */ public Builder setTextDecoration(java.lang.String value) { if (value == null) { @@ -3637,6 +3821,8 @@ public Builder setTextDecoration(java.lang.String value) { * * * string text_decoration = 6; + * + * @return This builder for chaining. */ public Builder clearTextDecoration() { @@ -3654,6 +3840,9 @@ public Builder clearTextDecoration() { * * * string text_decoration = 6; + * + * @param value The bytes for textDecoration to set. + * @return This builder for chaining. */ public Builder setTextDecorationBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -3680,6 +3869,8 @@ public Builder setTextDecorationBytes(com.google.protobuf.ByteString value) { * * * .google.cloud.documentai.v1beta1.Document.Style.FontSize font_size = 7; + * + * @return Whether the fontSize field is set. */ public boolean hasFontSize() { return fontSizeBuilder_ != null || fontSize_ != null; @@ -3692,6 +3883,8 @@ public boolean hasFontSize() { * * * .google.cloud.documentai.v1beta1.Document.Style.FontSize font_size = 7; + * + * @return The fontSize. */ public com.google.cloud.documentai.v1beta1.Document.Style.FontSize getFontSize() { if (fontSizeBuilder_ == null) { @@ -3921,6 +4114,8 @@ public interface PageOrBuilder * * * int32 page_number = 1; + * + * @return The pageNumber. */ int getPageNumber(); @@ -3932,6 +4127,8 @@ public interface PageOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Dimension dimension = 2; + * + * @return Whether the dimension field is set. */ boolean hasDimension(); /** @@ -3942,6 +4139,8 @@ public interface PageOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Dimension dimension = 2; + * + * @return The dimension. */ com.google.cloud.documentai.v1beta1.Document.Page.Dimension getDimension(); /** @@ -3964,6 +4163,8 @@ public interface PageOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 3; + * + * @return Whether the layout field is set. */ boolean hasLayout(); /** @@ -3975,6 +4176,8 @@ public interface PageOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 3; + * + * @return The layout. */ com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout(); /** @@ -4499,6 +4702,12 @@ private Page() { formFields_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Page(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -4565,11 +4774,11 @@ private Page( } case 34: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage>(); - mutable_bitField0_ |= 0x00000008; + mutable_bitField0_ |= 0x00000001; } detectedLanguages_.add( input.readMessage( @@ -4579,11 +4788,11 @@ private Page( } case 42: { - if (!((mutable_bitField0_ & 0x00000010) != 0)) { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { blocks_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.Block>(); - mutable_bitField0_ |= 0x00000010; + mutable_bitField0_ |= 0x00000002; } blocks_.add( input.readMessage( @@ -4593,11 +4802,11 @@ private Page( } case 50: { - if (!((mutable_bitField0_ & 0x00000020) != 0)) { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { paragraphs_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.Paragraph>(); - mutable_bitField0_ |= 0x00000020; + mutable_bitField0_ |= 0x00000004; } paragraphs_.add( input.readMessage( @@ -4607,11 +4816,11 @@ private Page( } case 58: { - if (!((mutable_bitField0_ & 0x00000040) != 0)) { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { lines_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.Line>(); - mutable_bitField0_ |= 0x00000040; + mutable_bitField0_ |= 0x00000008; } lines_.add( input.readMessage( @@ -4621,11 +4830,11 @@ private Page( } case 66: { - if (!((mutable_bitField0_ & 0x00000080) != 0)) { + if (!((mutable_bitField0_ & 0x00000010) != 0)) { tokens_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.Token>(); - mutable_bitField0_ |= 0x00000080; + mutable_bitField0_ |= 0x00000010; } tokens_.add( input.readMessage( @@ -4635,11 +4844,11 @@ private Page( } case 74: { - if (!((mutable_bitField0_ & 0x00000100) != 0)) { + if (!((mutable_bitField0_ & 0x00000020) != 0)) { visualElements_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.VisualElement>(); - mutable_bitField0_ |= 0x00000100; + mutable_bitField0_ |= 0x00000020; } visualElements_.add( input.readMessage( @@ -4649,11 +4858,11 @@ private Page( } case 82: { - if (!((mutable_bitField0_ & 0x00000200) != 0)) { + if (!((mutable_bitField0_ & 0x00000040) != 0)) { tables_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.Table>(); - mutable_bitField0_ |= 0x00000200; + mutable_bitField0_ |= 0x00000040; } tables_.add( input.readMessage( @@ -4663,11 +4872,11 @@ private Page( } case 90: { - if (!((mutable_bitField0_ & 0x00000400) != 0)) { + if (!((mutable_bitField0_ & 0x00000080) != 0)) { formFields_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.FormField>(); - mutable_bitField0_ |= 0x00000400; + mutable_bitField0_ |= 0x00000080; } formFields_.add( input.readMessage( @@ -4689,28 +4898,28 @@ private Page( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000008) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = java.util.Collections.unmodifiableList(detectedLanguages_); } - if (((mutable_bitField0_ & 0x00000010) != 0)) { + if (((mutable_bitField0_ & 0x00000002) != 0)) { blocks_ = java.util.Collections.unmodifiableList(blocks_); } - if (((mutable_bitField0_ & 0x00000020) != 0)) { + if (((mutable_bitField0_ & 0x00000004) != 0)) { paragraphs_ = java.util.Collections.unmodifiableList(paragraphs_); } - if (((mutable_bitField0_ & 0x00000040) != 0)) { + if (((mutable_bitField0_ & 0x00000008) != 0)) { lines_ = java.util.Collections.unmodifiableList(lines_); } - if (((mutable_bitField0_ & 0x00000080) != 0)) { + if (((mutable_bitField0_ & 0x00000010) != 0)) { tokens_ = java.util.Collections.unmodifiableList(tokens_); } - if (((mutable_bitField0_ & 0x00000100) != 0)) { + if (((mutable_bitField0_ & 0x00000020) != 0)) { visualElements_ = java.util.Collections.unmodifiableList(visualElements_); } - if (((mutable_bitField0_ & 0x00000200) != 0)) { + if (((mutable_bitField0_ & 0x00000040) != 0)) { tables_ = java.util.Collections.unmodifiableList(tables_); } - if (((mutable_bitField0_ & 0x00000400) != 0)) { + if (((mutable_bitField0_ & 0x00000080) != 0)) { formFields_ = java.util.Collections.unmodifiableList(formFields_); } this.unknownFields = unknownFields.build(); @@ -4746,6 +4955,8 @@ public interface DimensionOrBuilder * * * float width = 1; + * + * @return The width. */ float getWidth(); @@ -4757,6 +4968,8 @@ public interface DimensionOrBuilder * * * float height = 2; + * + * @return The height. */ float getHeight(); @@ -4768,6 +4981,8 @@ public interface DimensionOrBuilder * * * string unit = 3; + * + * @return The unit. */ java.lang.String getUnit(); /** @@ -4778,6 +4993,8 @@ public interface DimensionOrBuilder * * * string unit = 3; + * + * @return The bytes for unit. */ com.google.protobuf.ByteString getUnitBytes(); } @@ -4804,6 +5021,12 @@ private Dimension() { unit_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Dimension(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -4817,7 +5040,6 @@ private Dimension( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -4890,6 +5112,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * float width = 1; + * + * @return The width. */ public float getWidth() { return width_; @@ -4905,6 +5129,8 @@ public float getWidth() { * * * float height = 2; + * + * @return The height. */ public float getHeight() { return height_; @@ -4920,6 +5146,8 @@ public float getHeight() { * * * string unit = 3; + * + * @return The unit. */ public java.lang.String getUnit() { java.lang.Object ref = unit_; @@ -4940,6 +5168,8 @@ public java.lang.String getUnit() { * * * string unit = 3; + * + * @return The bytes for unit. */ public com.google.protobuf.ByteString getUnitBytes() { java.lang.Object ref = unit_; @@ -5321,6 +5551,8 @@ public Builder mergeFrom( * * * float width = 1; + * + * @return The width. */ public float getWidth() { return width_; @@ -5333,6 +5565,9 @@ public float getWidth() { * * * float width = 1; + * + * @param value The width to set. + * @return This builder for chaining. */ public Builder setWidth(float value) { @@ -5348,6 +5583,8 @@ public Builder setWidth(float value) { * * * float width = 1; + * + * @return This builder for chaining. */ public Builder clearWidth() { @@ -5365,6 +5602,8 @@ public Builder clearWidth() { * * * float height = 2; + * + * @return The height. */ public float getHeight() { return height_; @@ -5377,6 +5616,9 @@ public float getHeight() { * * * float height = 2; + * + * @param value The height to set. + * @return This builder for chaining. */ public Builder setHeight(float value) { @@ -5392,6 +5634,8 @@ public Builder setHeight(float value) { * * * float height = 2; + * + * @return This builder for chaining. */ public Builder clearHeight() { @@ -5409,6 +5653,8 @@ public Builder clearHeight() { * * * string unit = 3; + * + * @return The unit. */ public java.lang.String getUnit() { java.lang.Object ref = unit_; @@ -5429,6 +5675,8 @@ public java.lang.String getUnit() { * * * string unit = 3; + * + * @return The bytes for unit. */ public com.google.protobuf.ByteString getUnitBytes() { java.lang.Object ref = unit_; @@ -5449,6 +5697,9 @@ public com.google.protobuf.ByteString getUnitBytes() { * * * string unit = 3; + * + * @param value The unit to set. + * @return This builder for chaining. */ public Builder setUnit(java.lang.String value) { if (value == null) { @@ -5467,6 +5718,8 @@ public Builder setUnit(java.lang.String value) { * * * string unit = 3; + * + * @return This builder for chaining. */ public Builder clearUnit() { @@ -5482,6 +5735,9 @@ public Builder clearUnit() { * * * string unit = 3; + * + * @param value The bytes for unit to set. + * @return This builder for chaining. */ public Builder setUnitBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -5563,6 +5819,8 @@ public interface LayoutOrBuilder * * * .google.cloud.documentai.v1beta1.Document.TextAnchor text_anchor = 1; + * + * @return Whether the textAnchor field is set. */ boolean hasTextAnchor(); /** @@ -5574,6 +5832,8 @@ public interface LayoutOrBuilder * * * .google.cloud.documentai.v1beta1.Document.TextAnchor text_anchor = 1; + * + * @return The textAnchor. */ com.google.cloud.documentai.v1beta1.Document.TextAnchor getTextAnchor(); /** @@ -5600,6 +5860,8 @@ public interface LayoutOrBuilder * * * float confidence = 2; + * + * @return The confidence. */ float getConfidence(); @@ -5612,6 +5874,8 @@ public interface LayoutOrBuilder * * * .google.cloud.documentai.v1beta1.BoundingPoly bounding_poly = 3; + * + * @return Whether the boundingPoly field is set. */ boolean hasBoundingPoly(); /** @@ -5623,6 +5887,8 @@ public interface LayoutOrBuilder * * * .google.cloud.documentai.v1beta1.BoundingPoly bounding_poly = 3; + * + * @return The boundingPoly. */ com.google.cloud.documentai.v1beta1.BoundingPoly getBoundingPoly(); /** @@ -5647,6 +5913,8 @@ public interface LayoutOrBuilder * * .google.cloud.documentai.v1beta1.Document.Page.Layout.Orientation orientation = 4; * + * + * @return The enum numeric value on the wire for orientation. */ int getOrientationValue(); /** @@ -5659,6 +5927,8 @@ public interface LayoutOrBuilder * * .google.cloud.documentai.v1beta1.Document.Page.Layout.Orientation orientation = 4; * + * + * @return The orientation. */ com.google.cloud.documentai.v1beta1.Document.Page.Layout.Orientation getOrientation(); } @@ -5685,6 +5955,12 @@ private Layout() { orientation_ = 0; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Layout(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -5698,7 +5974,6 @@ private Layout( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -5918,12 +6193,20 @@ public final int getNumber() { return value; } - /** @deprecated Use {@link #forNumber(int)} instead. */ + /** + * @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 Orientation 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 Orientation forNumber(int value) { switch (value) { case 0: @@ -6001,6 +6284,8 @@ private Orientation(int value) { * * * .google.cloud.documentai.v1beta1.Document.TextAnchor text_anchor = 1; + * + * @return Whether the textAnchor field is set. */ public boolean hasTextAnchor() { return textAnchor_ != null; @@ -6014,6 +6299,8 @@ public boolean hasTextAnchor() { * * * .google.cloud.documentai.v1beta1.Document.TextAnchor text_anchor = 1; + * + * @return The textAnchor. */ public com.google.cloud.documentai.v1beta1.Document.TextAnchor getTextAnchor() { return textAnchor_ == null @@ -6049,6 +6336,8 @@ public com.google.cloud.documentai.v1beta1.Document.TextAnchor getTextAnchor() { * * * float confidence = 2; + * + * @return The confidence. */ public float getConfidence() { return confidence_; @@ -6065,6 +6354,8 @@ public float getConfidence() { * * * .google.cloud.documentai.v1beta1.BoundingPoly bounding_poly = 3; + * + * @return Whether the boundingPoly field is set. */ public boolean hasBoundingPoly() { return boundingPoly_ != null; @@ -6078,6 +6369,8 @@ public boolean hasBoundingPoly() { * * * .google.cloud.documentai.v1beta1.BoundingPoly bounding_poly = 3; + * + * @return The boundingPoly. */ public com.google.cloud.documentai.v1beta1.BoundingPoly getBoundingPoly() { return boundingPoly_ == null @@ -6110,6 +6403,8 @@ public com.google.cloud.documentai.v1beta1.BoundingPolyOrBuilder getBoundingPoly * * .google.cloud.documentai.v1beta1.Document.Page.Layout.Orientation orientation = 4; * + * + * @return The enum numeric value on the wire for orientation. */ public int getOrientationValue() { return orientation_; @@ -6124,6 +6419,8 @@ public int getOrientationValue() { * * .google.cloud.documentai.v1beta1.Document.Page.Layout.Orientation orientation = 4; * + * + * @return The orientation. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout.Orientation getOrientation() { @SuppressWarnings("deprecation") @@ -6552,6 +6849,8 @@ public Builder mergeFrom( * * * .google.cloud.documentai.v1beta1.Document.TextAnchor text_anchor = 1; + * + * @return Whether the textAnchor field is set. */ public boolean hasTextAnchor() { return textAnchorBuilder_ != null || textAnchor_ != null; @@ -6565,6 +6864,8 @@ public boolean hasTextAnchor() { * * * .google.cloud.documentai.v1beta1.Document.TextAnchor text_anchor = 1; + * + * @return The textAnchor. */ public com.google.cloud.documentai.v1beta1.Document.TextAnchor getTextAnchor() { if (textAnchorBuilder_ == null) { @@ -6745,6 +7046,8 @@ public Builder clearTextAnchor() { * * * float confidence = 2; + * + * @return The confidence. */ public float getConfidence() { return confidence_; @@ -6761,6 +7064,9 @@ public float getConfidence() { * * * float confidence = 2; + * + * @param value The confidence to set. + * @return This builder for chaining. */ public Builder setConfidence(float value) { @@ -6780,6 +7086,8 @@ public Builder setConfidence(float value) { * * * float confidence = 2; + * + * @return This builder for chaining. */ public Builder clearConfidence() { @@ -6803,6 +7111,8 @@ public Builder clearConfidence() { * * * .google.cloud.documentai.v1beta1.BoundingPoly bounding_poly = 3; + * + * @return Whether the boundingPoly field is set. */ public boolean hasBoundingPoly() { return boundingPolyBuilder_ != null || boundingPoly_ != null; @@ -6816,6 +7126,8 @@ public boolean hasBoundingPoly() { * * * .google.cloud.documentai.v1beta1.BoundingPoly bounding_poly = 3; + * + * @return The boundingPoly. */ public com.google.cloud.documentai.v1beta1.BoundingPoly getBoundingPoly() { if (boundingPolyBuilder_ == null) { @@ -6991,6 +7303,8 @@ public com.google.cloud.documentai.v1beta1.BoundingPoly.Builder getBoundingPolyB * * .google.cloud.documentai.v1beta1.Document.Page.Layout.Orientation orientation = 4; * + * + * @return The enum numeric value on the wire for orientation. */ public int getOrientationValue() { return orientation_; @@ -7005,6 +7319,9 @@ public int getOrientationValue() { * * .google.cloud.documentai.v1beta1.Document.Page.Layout.Orientation orientation = 4; * + * + * @param value The enum numeric value on the wire for orientation to set. + * @return This builder for chaining. */ public Builder setOrientationValue(int value) { orientation_ = value; @@ -7021,6 +7338,8 @@ public Builder setOrientationValue(int value) { * * .google.cloud.documentai.v1beta1.Document.Page.Layout.Orientation orientation = 4; * + * + * @return The orientation. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout.Orientation getOrientation() { @@ -7042,6 +7361,9 @@ public Builder setOrientationValue(int value) { * * .google.cloud.documentai.v1beta1.Document.Page.Layout.Orientation orientation = 4; * + * + * @param value The orientation to set. + * @return This builder for chaining. */ public Builder setOrientation( com.google.cloud.documentai.v1beta1.Document.Page.Layout.Orientation value) { @@ -7063,6 +7385,8 @@ public Builder setOrientation( * * .google.cloud.documentai.v1beta1.Document.Page.Layout.Orientation orientation = 4; * + * + * @return This builder for chaining. */ public Builder clearOrientation() { @@ -7138,6 +7462,8 @@ public interface BlockOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ boolean hasLayout(); /** @@ -7149,6 +7475,8 @@ public interface BlockOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout(); /** @@ -7253,6 +7581,12 @@ private Block() { detectedLanguages_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Block(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -7297,11 +7631,11 @@ private Block( } case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage>(); - mutable_bitField0_ |= 0x00000002; + mutable_bitField0_ |= 0x00000001; } detectedLanguages_.add( input.readMessage( @@ -7325,7 +7659,7 @@ private Block( throw new com.google.protobuf.InvalidProtocolBufferException(e) .setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = java.util.Collections.unmodifiableList(detectedLanguages_); } this.unknownFields = unknownFields.build(); @@ -7348,7 +7682,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.documentai.v1beta1.Document.Page.Block.Builder.class); } - private int bitField0_; public static final int LAYOUT_FIELD_NUMBER = 1; private com.google.cloud.documentai.v1beta1.Document.Page.Layout layout_; /** @@ -7360,6 +7693,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ public boolean hasLayout() { return layout_ != null; @@ -7373,6 +7708,8 @@ public boolean hasLayout() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout() { return layout_ == null @@ -7709,7 +8046,7 @@ public Builder clear() { } if (detectedLanguagesBuilder_ == null) { detectedLanguages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { detectedLanguagesBuilder_.clear(); } @@ -7741,22 +8078,20 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Block buildPartial() { com.google.cloud.documentai.v1beta1.Document.Page.Block result = new com.google.cloud.documentai.v1beta1.Document.Page.Block(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; if (layoutBuilder_ == null) { result.layout_ = layout_; } else { result.layout_ = layoutBuilder_.build(); } if (detectedLanguagesBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = java.util.Collections.unmodifiableList(detectedLanguages_); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } result.detectedLanguages_ = detectedLanguages_; } else { result.detectedLanguages_ = detectedLanguagesBuilder_.build(); } - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -7816,7 +8151,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page.Block if (!other.detectedLanguages_.isEmpty()) { if (detectedLanguages_.isEmpty()) { detectedLanguages_ = other.detectedLanguages_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureDetectedLanguagesIsMutable(); detectedLanguages_.addAll(other.detectedLanguages_); @@ -7829,7 +8164,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page.Block detectedLanguagesBuilder_.dispose(); detectedLanguagesBuilder_ = null; detectedLanguages_ = other.detectedLanguages_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); detectedLanguagesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDetectedLanguagesFieldBuilder() @@ -7886,6 +8221,8 @@ public Builder mergeFrom( * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ public boolean hasLayout() { return layoutBuilder_ != null || layout_ != null; @@ -7899,6 +8236,8 @@ public boolean hasLayout() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout() { if (layoutBuilder_ == null) { @@ -8067,12 +8406,12 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Layout.Builder getLayou detectedLanguages_ = java.util.Collections.emptyList(); private void ensureDetectedLanguagesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage>( detectedLanguages_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000001; } } @@ -8322,7 +8661,7 @@ public Builder addAllDetectedLanguages( public Builder clearDetectedLanguages() { if (detectedLanguagesBuilder_ == null) { detectedLanguages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { detectedLanguagesBuilder_.clear(); @@ -8471,7 +8810,7 @@ public Builder removeDetectedLanguages(int index) { com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage.Builder, com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguageOrBuilder>( detectedLanguages_, - ((bitField0_ & 0x00000002) != 0), + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); detectedLanguages_ = null; @@ -8545,6 +8884,8 @@ public interface ParagraphOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ boolean hasLayout(); /** @@ -8556,6 +8897,8 @@ public interface ParagraphOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout(); /** @@ -8659,6 +9002,12 @@ private Paragraph() { detectedLanguages_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Paragraph(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -8703,11 +9052,11 @@ private Paragraph( } case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage>(); - mutable_bitField0_ |= 0x00000002; + mutable_bitField0_ |= 0x00000001; } detectedLanguages_.add( input.readMessage( @@ -8731,7 +9080,7 @@ private Paragraph( throw new com.google.protobuf.InvalidProtocolBufferException(e) .setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = java.util.Collections.unmodifiableList(detectedLanguages_); } this.unknownFields = unknownFields.build(); @@ -8754,7 +9103,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.documentai.v1beta1.Document.Page.Paragraph.Builder.class); } - private int bitField0_; public static final int LAYOUT_FIELD_NUMBER = 1; private com.google.cloud.documentai.v1beta1.Document.Page.Layout layout_; /** @@ -8766,6 +9114,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ public boolean hasLayout() { return layout_ != null; @@ -8779,6 +9129,8 @@ public boolean hasLayout() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout() { return layout_ == null @@ -9114,7 +9466,7 @@ public Builder clear() { } if (detectedLanguagesBuilder_ == null) { detectedLanguages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { detectedLanguagesBuilder_.clear(); } @@ -9147,22 +9499,20 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Paragraph buildPartial( com.google.cloud.documentai.v1beta1.Document.Page.Paragraph result = new com.google.cloud.documentai.v1beta1.Document.Page.Paragraph(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; if (layoutBuilder_ == null) { result.layout_ = layout_; } else { result.layout_ = layoutBuilder_.build(); } if (detectedLanguagesBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = java.util.Collections.unmodifiableList(detectedLanguages_); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } result.detectedLanguages_ = detectedLanguages_; } else { result.detectedLanguages_ = detectedLanguagesBuilder_.build(); } - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -9224,7 +9574,7 @@ public Builder mergeFrom( if (!other.detectedLanguages_.isEmpty()) { if (detectedLanguages_.isEmpty()) { detectedLanguages_ = other.detectedLanguages_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureDetectedLanguagesIsMutable(); detectedLanguages_.addAll(other.detectedLanguages_); @@ -9237,7 +9587,7 @@ public Builder mergeFrom( detectedLanguagesBuilder_.dispose(); detectedLanguagesBuilder_ = null; detectedLanguages_ = other.detectedLanguages_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); detectedLanguagesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDetectedLanguagesFieldBuilder() @@ -9295,6 +9645,8 @@ public Builder mergeFrom( * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ public boolean hasLayout() { return layoutBuilder_ != null || layout_ != null; @@ -9308,6 +9660,8 @@ public boolean hasLayout() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout() { if (layoutBuilder_ == null) { @@ -9476,12 +9830,12 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Layout.Builder getLayou detectedLanguages_ = java.util.Collections.emptyList(); private void ensureDetectedLanguagesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage>( detectedLanguages_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000001; } } @@ -9731,7 +10085,7 @@ public Builder addAllDetectedLanguages( public Builder clearDetectedLanguages() { if (detectedLanguagesBuilder_ == null) { detectedLanguages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { detectedLanguagesBuilder_.clear(); @@ -9880,7 +10234,7 @@ public Builder removeDetectedLanguages(int index) { com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage.Builder, com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguageOrBuilder>( detectedLanguages_, - ((bitField0_ & 0x00000002) != 0), + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); detectedLanguages_ = null; @@ -9957,6 +10311,8 @@ public interface LineOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ boolean hasLayout(); /** @@ -9968,6 +10324,8 @@ public interface LineOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout(); /** @@ -10072,6 +10430,12 @@ private Line() { detectedLanguages_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Line(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -10116,11 +10480,11 @@ private Line( } case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage>(); - mutable_bitField0_ |= 0x00000002; + mutable_bitField0_ |= 0x00000001; } detectedLanguages_.add( input.readMessage( @@ -10144,7 +10508,7 @@ private Line( throw new com.google.protobuf.InvalidProtocolBufferException(e) .setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = java.util.Collections.unmodifiableList(detectedLanguages_); } this.unknownFields = unknownFields.build(); @@ -10167,7 +10531,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.documentai.v1beta1.Document.Page.Line.Builder.class); } - private int bitField0_; public static final int LAYOUT_FIELD_NUMBER = 1; private com.google.cloud.documentai.v1beta1.Document.Page.Layout layout_; /** @@ -10179,6 +10542,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ public boolean hasLayout() { return layout_ != null; @@ -10192,6 +10557,8 @@ public boolean hasLayout() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout() { return layout_ == null @@ -10528,7 +10895,7 @@ public Builder clear() { } if (detectedLanguagesBuilder_ == null) { detectedLanguages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { detectedLanguagesBuilder_.clear(); } @@ -10560,22 +10927,20 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Line buildPartial() { com.google.cloud.documentai.v1beta1.Document.Page.Line result = new com.google.cloud.documentai.v1beta1.Document.Page.Line(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; if (layoutBuilder_ == null) { result.layout_ = layout_; } else { result.layout_ = layoutBuilder_.build(); } if (detectedLanguagesBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = java.util.Collections.unmodifiableList(detectedLanguages_); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } result.detectedLanguages_ = detectedLanguages_; } else { result.detectedLanguages_ = detectedLanguagesBuilder_.build(); } - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -10635,7 +11000,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page.Line if (!other.detectedLanguages_.isEmpty()) { if (detectedLanguages_.isEmpty()) { detectedLanguages_ = other.detectedLanguages_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureDetectedLanguagesIsMutable(); detectedLanguages_.addAll(other.detectedLanguages_); @@ -10648,7 +11013,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page.Line detectedLanguagesBuilder_.dispose(); detectedLanguagesBuilder_ = null; detectedLanguages_ = other.detectedLanguages_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); detectedLanguagesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDetectedLanguagesFieldBuilder() @@ -10705,6 +11070,8 @@ public Builder mergeFrom( * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ public boolean hasLayout() { return layoutBuilder_ != null || layout_ != null; @@ -10718,6 +11085,8 @@ public boolean hasLayout() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout() { if (layoutBuilder_ == null) { @@ -10886,12 +11255,12 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Layout.Builder getLayou detectedLanguages_ = java.util.Collections.emptyList(); private void ensureDetectedLanguagesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage>( detectedLanguages_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000001; } } @@ -11141,7 +11510,7 @@ public Builder addAllDetectedLanguages( public Builder clearDetectedLanguages() { if (detectedLanguagesBuilder_ == null) { detectedLanguages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { detectedLanguagesBuilder_.clear(); @@ -11290,7 +11659,7 @@ public Builder removeDetectedLanguages(int index) { com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage.Builder, com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguageOrBuilder>( detectedLanguages_, - ((bitField0_ & 0x00000002) != 0), + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); detectedLanguages_ = null; @@ -11364,6 +11733,8 @@ public interface TokenOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ boolean hasLayout(); /** @@ -11375,6 +11746,8 @@ public interface TokenOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout(); /** @@ -11400,6 +11773,8 @@ public interface TokenOrBuilder * * .google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak detected_break = 2; * + * + * @return Whether the detectedBreak field is set. */ boolean hasDetectedBreak(); /** @@ -11413,6 +11788,8 @@ public interface TokenOrBuilder * * .google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak detected_break = 2; * + * + * @return The detectedBreak. */ com.google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak getDetectedBreak(); /** @@ -11519,6 +11896,12 @@ private Token() { detectedLanguages_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Token(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -11582,11 +11965,11 @@ private Token( } case 26: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage>(); - mutable_bitField0_ |= 0x00000004; + mutable_bitField0_ |= 0x00000001; } detectedLanguages_.add( input.readMessage( @@ -11610,7 +11993,7 @@ private Token( throw new com.google.protobuf.InvalidProtocolBufferException(e) .setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000004) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = java.util.Collections.unmodifiableList(detectedLanguages_); } this.unknownFields = unknownFields.build(); @@ -11647,6 +12030,8 @@ public interface DetectedBreakOrBuilder * * .google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak.Type type = 1; * + * + * @return The enum numeric value on the wire for type. */ int getTypeValue(); /** @@ -11658,6 +12043,8 @@ public interface DetectedBreakOrBuilder * * .google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak.Type type = 1; * + * + * @return The type. */ com.google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak.Type getType(); } @@ -11685,6 +12072,12 @@ private DetectedBreak() { type_ = 0; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DetectedBreak(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -11698,7 +12091,6 @@ private DetectedBreak( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -11855,12 +12247,20 @@ public final int getNumber() { return value; } - /** @deprecated Use {@link #forNumber(int)} instead. */ + /** + * @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 Type 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 Type forNumber(int value) { switch (value) { case 0: @@ -11935,6 +12335,8 @@ private Type(int value) { * * .google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak.Type type = 1; * + * + * @return The enum numeric value on the wire for type. */ public int getTypeValue() { return type_; @@ -11948,6 +12350,8 @@ public int getTypeValue() { * * .google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak.Type type = 1; * + * + * @return The type. */ public com.google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak.Type getType() { @@ -12324,6 +12728,8 @@ public Builder mergeFrom( * * .google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak.Type type = 1; * + * + * @return The enum numeric value on the wire for type. */ public int getTypeValue() { return type_; @@ -12337,6 +12743,9 @@ public int getTypeValue() { * * .google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak.Type type = 1; * + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. */ public Builder setTypeValue(int value) { type_ = value; @@ -12352,6 +12761,8 @@ public Builder setTypeValue(int value) { * * .google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak.Type type = 1; * + * + * @return The type. */ public com.google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak.Type getType() { @@ -12373,6 +12784,9 @@ public Builder setTypeValue(int value) { * * .google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak.Type type = 1; * + * + * @param value The type to set. + * @return This builder for chaining. */ public Builder setType( com.google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak.Type value) { @@ -12393,6 +12807,8 @@ public Builder setType( * * .google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak.Type type = 1; * + * + * @return This builder for chaining. */ public Builder clearType() { @@ -12457,7 +12873,6 @@ public com.google.protobuf.Parser getParserForType() { } } - private int bitField0_; public static final int LAYOUT_FIELD_NUMBER = 1; private com.google.cloud.documentai.v1beta1.Document.Page.Layout layout_; /** @@ -12469,6 +12884,8 @@ public com.google.protobuf.Parser getParserForType() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ public boolean hasLayout() { return layout_ != null; @@ -12482,6 +12899,8 @@ public boolean hasLayout() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout() { return layout_ == null @@ -12516,6 +12935,8 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout() { * * .google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak detected_break = 2; * + * + * @return Whether the detectedBreak field is set. */ public boolean hasDetectedBreak() { return detectedBreak_ != null; @@ -12531,6 +12952,8 @@ public boolean hasDetectedBreak() { * * .google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak detected_break = 2; * + * + * @return The detectedBreak. */ public com.google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak getDetectedBreak() { @@ -12890,7 +13313,7 @@ public Builder clear() { } if (detectedLanguagesBuilder_ == null) { detectedLanguages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); } else { detectedLanguagesBuilder_.clear(); } @@ -12922,7 +13345,6 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Token buildPartial() { com.google.cloud.documentai.v1beta1.Document.Page.Token result = new com.google.cloud.documentai.v1beta1.Document.Page.Token(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; if (layoutBuilder_ == null) { result.layout_ = layout_; } else { @@ -12934,15 +13356,14 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Token buildPartial() { result.detectedBreak_ = detectedBreakBuilder_.build(); } if (detectedLanguagesBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = java.util.Collections.unmodifiableList(detectedLanguages_); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); } result.detectedLanguages_ = detectedLanguages_; } else { result.detectedLanguages_ = detectedLanguagesBuilder_.build(); } - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -13005,7 +13426,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page.Token if (!other.detectedLanguages_.isEmpty()) { if (detectedLanguages_.isEmpty()) { detectedLanguages_ = other.detectedLanguages_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureDetectedLanguagesIsMutable(); detectedLanguages_.addAll(other.detectedLanguages_); @@ -13018,7 +13439,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page.Token detectedLanguagesBuilder_.dispose(); detectedLanguagesBuilder_ = null; detectedLanguages_ = other.detectedLanguages_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); detectedLanguagesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDetectedLanguagesFieldBuilder() @@ -13075,6 +13496,8 @@ public Builder mergeFrom( * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ public boolean hasLayout() { return layoutBuilder_ != null || layout_ != null; @@ -13088,6 +13511,8 @@ public boolean hasLayout() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout() { if (layoutBuilder_ == null) { @@ -13270,6 +13695,8 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Layout.Builder getLayou * * .google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak detected_break = 2; * + * + * @return Whether the detectedBreak field is set. */ public boolean hasDetectedBreak() { return detectedBreakBuilder_ != null || detectedBreak_ != null; @@ -13285,6 +13712,8 @@ public boolean hasDetectedBreak() { * * .google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak detected_break = 2; * + * + * @return The detectedBreak. */ public com.google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak getDetectedBreak() { @@ -13475,12 +13904,12 @@ public Builder clearDetectedBreak() { detectedLanguages_ = java.util.Collections.emptyList(); private void ensureDetectedLanguagesIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage>( detectedLanguages_); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000001; } } @@ -13730,7 +14159,7 @@ public Builder addAllDetectedLanguages( public Builder clearDetectedLanguages() { if (detectedLanguagesBuilder_ == null) { detectedLanguages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { detectedLanguagesBuilder_.clear(); @@ -13879,7 +14308,7 @@ public Builder removeDetectedLanguages(int index) { com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage.Builder, com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguageOrBuilder>( detectedLanguages_, - ((bitField0_ & 0x00000004) != 0), + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); detectedLanguages_ = null; @@ -13953,6 +14382,8 @@ public interface VisualElementOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ boolean hasLayout(); /** @@ -13964,6 +14395,8 @@ public interface VisualElementOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout(); /** @@ -13987,6 +14420,8 @@ public interface VisualElementOrBuilder * * * string type = 2; + * + * @return The type. */ java.lang.String getType(); /** @@ -13998,6 +14433,8 @@ public interface VisualElementOrBuilder * * * string type = 2; + * + * @return The bytes for type. */ com.google.protobuf.ByteString getTypeBytes(); @@ -14092,6 +14529,12 @@ private VisualElement() { detectedLanguages_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new VisualElement(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -14143,11 +14586,11 @@ private VisualElement( } case 26: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage>(); - mutable_bitField0_ |= 0x00000004; + mutable_bitField0_ |= 0x00000001; } detectedLanguages_.add( input.readMessage( @@ -14171,7 +14614,7 @@ private VisualElement( throw new com.google.protobuf.InvalidProtocolBufferException(e) .setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000004) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = java.util.Collections.unmodifiableList(detectedLanguages_); } this.unknownFields = unknownFields.build(); @@ -14194,7 +14637,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.documentai.v1beta1.Document.Page.VisualElement.Builder.class); } - private int bitField0_; public static final int LAYOUT_FIELD_NUMBER = 1; private com.google.cloud.documentai.v1beta1.Document.Page.Layout layout_; /** @@ -14206,6 +14648,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ public boolean hasLayout() { return layout_ != null; @@ -14219,6 +14663,8 @@ public boolean hasLayout() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout() { return layout_ == null @@ -14251,6 +14697,8 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout() { * * * string type = 2; + * + * @return The type. */ public java.lang.String getType() { java.lang.Object ref = type_; @@ -14272,6 +14720,8 @@ public java.lang.String getType() { * * * string type = 2; + * + * @return The bytes for type. */ public com.google.protobuf.ByteString getTypeBytes() { java.lang.Object ref = type_; @@ -14614,7 +15064,7 @@ public Builder clear() { if (detectedLanguagesBuilder_ == null) { detectedLanguages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); } else { detectedLanguagesBuilder_.clear(); } @@ -14648,7 +15098,6 @@ public com.google.cloud.documentai.v1beta1.Document.Page.VisualElement buildPart com.google.cloud.documentai.v1beta1.Document.Page.VisualElement result = new com.google.cloud.documentai.v1beta1.Document.Page.VisualElement(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; if (layoutBuilder_ == null) { result.layout_ = layout_; } else { @@ -14656,15 +15105,14 @@ public com.google.cloud.documentai.v1beta1.Document.Page.VisualElement buildPart } result.type_ = type_; if (detectedLanguagesBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = java.util.Collections.unmodifiableList(detectedLanguages_); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); } result.detectedLanguages_ = detectedLanguages_; } else { result.detectedLanguages_ = detectedLanguagesBuilder_.build(); } - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -14731,7 +15179,7 @@ public Builder mergeFrom( if (!other.detectedLanguages_.isEmpty()) { if (detectedLanguages_.isEmpty()) { detectedLanguages_ = other.detectedLanguages_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureDetectedLanguagesIsMutable(); detectedLanguages_.addAll(other.detectedLanguages_); @@ -14744,7 +15192,7 @@ public Builder mergeFrom( detectedLanguagesBuilder_.dispose(); detectedLanguagesBuilder_ = null; detectedLanguages_ = other.detectedLanguages_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); detectedLanguagesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDetectedLanguagesFieldBuilder() @@ -14802,6 +15250,8 @@ public Builder mergeFrom( * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ public boolean hasLayout() { return layoutBuilder_ != null || layout_ != null; @@ -14815,6 +15265,8 @@ public boolean hasLayout() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout() { if (layoutBuilder_ == null) { @@ -14989,6 +15441,8 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Layout.Builder getLayou * * * string type = 2; + * + * @return The type. */ public java.lang.String getType() { java.lang.Object ref = type_; @@ -15010,6 +15464,8 @@ public java.lang.String getType() { * * * string type = 2; + * + * @return The bytes for type. */ public com.google.protobuf.ByteString getTypeBytes() { java.lang.Object ref = type_; @@ -15031,6 +15487,9 @@ public com.google.protobuf.ByteString getTypeBytes() { * * * string type = 2; + * + * @param value The type to set. + * @return This builder for chaining. */ public Builder setType(java.lang.String value) { if (value == null) { @@ -15050,6 +15509,8 @@ public Builder setType(java.lang.String value) { * * * string type = 2; + * + * @return This builder for chaining. */ public Builder clearType() { @@ -15066,6 +15527,9 @@ public Builder clearType() { * * * string type = 2; + * + * @param value The bytes for type to set. + * @return This builder for chaining. */ public Builder setTypeBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -15082,12 +15546,12 @@ public Builder setTypeBytes(com.google.protobuf.ByteString value) { detectedLanguages_ = java.util.Collections.emptyList(); private void ensureDetectedLanguagesIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage>( detectedLanguages_); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000001; } } @@ -15337,7 +15801,7 @@ public Builder addAllDetectedLanguages( public Builder clearDetectedLanguages() { if (detectedLanguagesBuilder_ == null) { detectedLanguages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { detectedLanguagesBuilder_.clear(); @@ -15486,7 +15950,7 @@ public Builder removeDetectedLanguages(int index) { com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage.Builder, com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguageOrBuilder>( detectedLanguages_, - ((bitField0_ & 0x00000004) != 0), + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); detectedLanguages_ = null; @@ -15563,6 +16027,8 @@ public interface TableOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ boolean hasLayout(); /** @@ -15574,6 +16040,8 @@ public interface TableOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout(); /** @@ -15804,6 +16272,12 @@ private Table() { detectedLanguages_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Table(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -15848,11 +16322,11 @@ private Table( } case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { headerRows_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.Table.TableRow>(); - mutable_bitField0_ |= 0x00000002; + mutable_bitField0_ |= 0x00000001; } headerRows_.add( input.readMessage( @@ -15862,11 +16336,11 @@ private Table( } case 26: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { bodyRows_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.Table.TableRow>(); - mutable_bitField0_ |= 0x00000004; + mutable_bitField0_ |= 0x00000002; } bodyRows_.add( input.readMessage( @@ -15876,11 +16350,11 @@ private Table( } case 34: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { detectedLanguages_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage>(); - mutable_bitField0_ |= 0x00000008; + mutable_bitField0_ |= 0x00000004; } detectedLanguages_.add( input.readMessage( @@ -15904,13 +16378,13 @@ private Table( throw new com.google.protobuf.InvalidProtocolBufferException(e) .setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { headerRows_ = java.util.Collections.unmodifiableList(headerRows_); } - if (((mutable_bitField0_ & 0x00000004) != 0)) { + if (((mutable_bitField0_ & 0x00000002) != 0)) { bodyRows_ = java.util.Collections.unmodifiableList(bodyRows_); } - if (((mutable_bitField0_ & 0x00000008) != 0)) { + if (((mutable_bitField0_ & 0x00000004) != 0)) { detectedLanguages_ = java.util.Collections.unmodifiableList(detectedLanguages_); } this.unknownFields = unknownFields.build(); @@ -16022,6 +16496,12 @@ private TableRow() { cells_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TableRow(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -17032,6 +17512,8 @@ public interface TableCellOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ boolean hasLayout(); /** @@ -17043,6 +17525,8 @@ public interface TableCellOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout(); /** @@ -17065,6 +17549,8 @@ public interface TableCellOrBuilder * * * int32 row_span = 2; + * + * @return The rowSpan. */ int getRowSpan(); @@ -17076,6 +17562,8 @@ public interface TableCellOrBuilder * * * int32 col_span = 3; + * + * @return The colSpan. */ int getColSpan(); @@ -17169,6 +17657,12 @@ private TableCell() { detectedLanguages_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TableCell(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -17223,11 +17717,11 @@ private TableCell( } case 34: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage>(); - mutable_bitField0_ |= 0x00000008; + mutable_bitField0_ |= 0x00000001; } detectedLanguages_.add( input.readMessage( @@ -17251,7 +17745,7 @@ private TableCell( throw new com.google.protobuf.InvalidProtocolBufferException(e) .setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000008) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = java.util.Collections.unmodifiableList(detectedLanguages_); } this.unknownFields = unknownFields.build(); @@ -17274,7 +17768,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.documentai.v1beta1.Document.Page.Table.TableCell.Builder.class); } - private int bitField0_; public static final int LAYOUT_FIELD_NUMBER = 1; private com.google.cloud.documentai.v1beta1.Document.Page.Layout layout_; /** @@ -17286,6 +17779,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ public boolean hasLayout() { return layout_ != null; @@ -17299,6 +17794,8 @@ public boolean hasLayout() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout() { return layout_ == null @@ -17330,6 +17827,8 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout() { * * * int32 row_span = 2; + * + * @return The rowSpan. */ public int getRowSpan() { return rowSpan_; @@ -17345,6 +17844,8 @@ public int getRowSpan() { * * * int32 col_span = 3; + * + * @return The colSpan. */ public int getColSpan() { return colSpan_; @@ -17693,7 +18194,7 @@ public Builder clear() { if (detectedLanguagesBuilder_ == null) { detectedLanguages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000001); } else { detectedLanguagesBuilder_.clear(); } @@ -17728,7 +18229,6 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Table.TableCell buildPa com.google.cloud.documentai.v1beta1.Document.Page.Table.TableCell result = new com.google.cloud.documentai.v1beta1.Document.Page.Table.TableCell(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; if (layoutBuilder_ == null) { result.layout_ = layout_; } else { @@ -17737,15 +18237,14 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Table.TableCell buildPa result.rowSpan_ = rowSpan_; result.colSpan_ = colSpan_; if (detectedLanguagesBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = java.util.Collections.unmodifiableList(detectedLanguages_); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000001); } result.detectedLanguages_ = detectedLanguages_; } else { result.detectedLanguages_ = detectedLanguagesBuilder_.build(); } - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -17815,7 +18314,7 @@ public Builder mergeFrom( if (!other.detectedLanguages_.isEmpty()) { if (detectedLanguages_.isEmpty()) { detectedLanguages_ = other.detectedLanguages_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureDetectedLanguagesIsMutable(); detectedLanguages_.addAll(other.detectedLanguages_); @@ -17828,7 +18327,7 @@ public Builder mergeFrom( detectedLanguagesBuilder_.dispose(); detectedLanguagesBuilder_ = null; detectedLanguages_ = other.detectedLanguages_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000001); detectedLanguagesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDetectedLanguagesFieldBuilder() @@ -17886,6 +18385,8 @@ public Builder mergeFrom( * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ public boolean hasLayout() { return layoutBuilder_ != null || layout_ != null; @@ -17899,6 +18400,8 @@ public boolean hasLayout() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout() { if (layoutBuilder_ == null) { @@ -18074,6 +18577,8 @@ public Builder clearLayout() { * * * int32 row_span = 2; + * + * @return The rowSpan. */ public int getRowSpan() { return rowSpan_; @@ -18086,6 +18591,9 @@ public int getRowSpan() { * * * int32 row_span = 2; + * + * @param value The rowSpan to set. + * @return This builder for chaining. */ public Builder setRowSpan(int value) { @@ -18101,6 +18609,8 @@ public Builder setRowSpan(int value) { * * * int32 row_span = 2; + * + * @return This builder for chaining. */ public Builder clearRowSpan() { @@ -18118,6 +18628,8 @@ public Builder clearRowSpan() { * * * int32 col_span = 3; + * + * @return The colSpan. */ public int getColSpan() { return colSpan_; @@ -18130,6 +18642,9 @@ public int getColSpan() { * * * int32 col_span = 3; + * + * @param value The colSpan to set. + * @return This builder for chaining. */ public Builder setColSpan(int value) { @@ -18145,6 +18660,8 @@ public Builder setColSpan(int value) { * * * int32 col_span = 3; + * + * @return This builder for chaining. */ public Builder clearColSpan() { @@ -18157,12 +18674,12 @@ public Builder clearColSpan() { detectedLanguages_ = java.util.Collections.emptyList(); private void ensureDetectedLanguagesIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage>( detectedLanguages_); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000001; } } @@ -18412,7 +18929,7 @@ public Builder addAllDetectedLanguages( public Builder clearDetectedLanguages() { if (detectedLanguagesBuilder_ == null) { detectedLanguages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { detectedLanguagesBuilder_.clear(); @@ -18561,7 +19078,7 @@ public Builder removeDetectedLanguages(int index) { com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage.Builder, com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguageOrBuilder>( detectedLanguages_, - ((bitField0_ & 0x00000008) != 0), + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); detectedLanguages_ = null; @@ -18625,7 +19142,6 @@ public com.google.protobuf.Parser getParserForType() { } } - private int bitField0_; public static final int LAYOUT_FIELD_NUMBER = 1; private com.google.cloud.documentai.v1beta1.Document.Page.Layout layout_; /** @@ -18637,6 +19153,8 @@ public com.google.protobuf.Parser getParserForType() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ public boolean hasLayout() { return layout_ != null; @@ -18650,6 +19168,8 @@ public boolean hasLayout() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout() { return layout_ == null @@ -19162,19 +19682,19 @@ public Builder clear() { } if (headerRowsBuilder_ == null) { headerRows_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { headerRowsBuilder_.clear(); } if (bodyRowsBuilder_ == null) { bodyRows_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000002); } else { bodyRowsBuilder_.clear(); } if (detectedLanguagesBuilder_ == null) { detectedLanguages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000004); } else { detectedLanguagesBuilder_.clear(); } @@ -19206,40 +19726,38 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Table buildPartial() { com.google.cloud.documentai.v1beta1.Document.Page.Table result = new com.google.cloud.documentai.v1beta1.Document.Page.Table(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; if (layoutBuilder_ == null) { result.layout_ = layout_; } else { result.layout_ = layoutBuilder_.build(); } if (headerRowsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { headerRows_ = java.util.Collections.unmodifiableList(headerRows_); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } result.headerRows_ = headerRows_; } else { result.headerRows_ = headerRowsBuilder_.build(); } if (bodyRowsBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { + if (((bitField0_ & 0x00000002) != 0)) { bodyRows_ = java.util.Collections.unmodifiableList(bodyRows_); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000002); } result.bodyRows_ = bodyRows_; } else { result.bodyRows_ = bodyRowsBuilder_.build(); } if (detectedLanguagesBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { + if (((bitField0_ & 0x00000004) != 0)) { detectedLanguages_ = java.util.Collections.unmodifiableList(detectedLanguages_); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000004); } result.detectedLanguages_ = detectedLanguages_; } else { result.detectedLanguages_ = detectedLanguagesBuilder_.build(); } - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -19299,7 +19817,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page.Table if (!other.headerRows_.isEmpty()) { if (headerRows_.isEmpty()) { headerRows_ = other.headerRows_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureHeaderRowsIsMutable(); headerRows_.addAll(other.headerRows_); @@ -19312,7 +19830,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page.Table headerRowsBuilder_.dispose(); headerRowsBuilder_ = null; headerRows_ = other.headerRows_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); headerRowsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getHeaderRowsFieldBuilder() @@ -19326,7 +19844,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page.Table if (!other.bodyRows_.isEmpty()) { if (bodyRows_.isEmpty()) { bodyRows_ = other.bodyRows_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureBodyRowsIsMutable(); bodyRows_.addAll(other.bodyRows_); @@ -19339,7 +19857,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page.Table bodyRowsBuilder_.dispose(); bodyRowsBuilder_ = null; bodyRows_ = other.bodyRows_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000002); bodyRowsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getBodyRowsFieldBuilder() @@ -19353,7 +19871,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page.Table if (!other.detectedLanguages_.isEmpty()) { if (detectedLanguages_.isEmpty()) { detectedLanguages_ = other.detectedLanguages_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000004); } else { ensureDetectedLanguagesIsMutable(); detectedLanguages_.addAll(other.detectedLanguages_); @@ -19366,7 +19884,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page.Table detectedLanguagesBuilder_.dispose(); detectedLanguagesBuilder_ = null; detectedLanguages_ = other.detectedLanguages_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000004); detectedLanguagesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDetectedLanguagesFieldBuilder() @@ -19423,6 +19941,8 @@ public Builder mergeFrom( * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return Whether the layout field is set. */ public boolean hasLayout() { return layoutBuilder_ != null || layout_ != null; @@ -19436,6 +19956,8 @@ public boolean hasLayout() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 1; + * + * @return The layout. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout() { if (layoutBuilder_ == null) { @@ -19604,11 +20126,11 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Layout.Builder getLayou headerRows_ = java.util.Collections.emptyList(); private void ensureHeaderRowsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { headerRows_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.Table.TableRow>(headerRows_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000001; } } @@ -19858,7 +20380,7 @@ public Builder addAllHeaderRows( public Builder clearHeaderRows() { if (headerRowsBuilder_ == null) { headerRows_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { headerRowsBuilder_.clear(); @@ -20006,7 +20528,7 @@ public Builder removeHeaderRows(int index) { com.google.cloud.documentai.v1beta1.Document.Page.Table.TableRow.Builder, com.google.cloud.documentai.v1beta1.Document.Page.Table.TableRowOrBuilder>( headerRows_, - ((bitField0_ & 0x00000002) != 0), + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); headerRows_ = null; @@ -20018,11 +20540,11 @@ public Builder removeHeaderRows(int index) { bodyRows_ = java.util.Collections.emptyList(); private void ensureBodyRowsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { + if (!((bitField0_ & 0x00000002) != 0)) { bodyRows_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.Table.TableRow>(bodyRows_); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000002; } } @@ -20272,7 +20794,7 @@ public Builder addAllBodyRows( public Builder clearBodyRows() { if (bodyRowsBuilder_ == null) { bodyRows_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { bodyRowsBuilder_.clear(); @@ -20419,7 +20941,7 @@ public Builder removeBodyRows(int index) { com.google.cloud.documentai.v1beta1.Document.Page.Table.TableRow, com.google.cloud.documentai.v1beta1.Document.Page.Table.TableRow.Builder, com.google.cloud.documentai.v1beta1.Document.Page.Table.TableRowOrBuilder>( - bodyRows_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + bodyRows_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); bodyRows_ = null; } return bodyRowsBuilder_; @@ -20429,12 +20951,12 @@ public Builder removeBodyRows(int index) { detectedLanguages_ = java.util.Collections.emptyList(); private void ensureDetectedLanguagesIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { + if (!((bitField0_ & 0x00000004) != 0)) { detectedLanguages_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage>( detectedLanguages_); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000004; } } @@ -20684,7 +21206,7 @@ public Builder addAllDetectedLanguages( public Builder clearDetectedLanguages() { if (detectedLanguagesBuilder_ == null) { detectedLanguages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); } else { detectedLanguagesBuilder_.clear(); @@ -20833,7 +21355,7 @@ public Builder removeDetectedLanguages(int index) { com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage.Builder, com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguageOrBuilder>( detectedLanguages_, - ((bitField0_ & 0x00000008) != 0), + ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); detectedLanguages_ = null; @@ -20908,6 +21430,8 @@ public interface FormFieldOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Layout field_name = 1; + * + * @return Whether the fieldName field is set. */ boolean hasFieldName(); /** @@ -20920,6 +21444,8 @@ public interface FormFieldOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Layout field_name = 1; + * + * @return The fieldName. */ com.google.cloud.documentai.v1beta1.Document.Page.Layout getFieldName(); /** @@ -20945,6 +21471,8 @@ public interface FormFieldOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Layout field_value = 2; + * + * @return Whether the fieldValue field is set. */ boolean hasFieldValue(); /** @@ -20957,6 +21485,8 @@ public interface FormFieldOrBuilder * * * .google.cloud.documentai.v1beta1.Document.Page.Layout field_value = 2; + * + * @return The fieldValue. */ com.google.cloud.documentai.v1beta1.Document.Page.Layout getFieldValue(); /** @@ -21128,6 +21658,12 @@ private FormField() { valueDetectedLanguages_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FormField(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -21190,11 +21726,11 @@ private FormField( } case 26: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { nameDetectedLanguages_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage>(); - mutable_bitField0_ |= 0x00000004; + mutable_bitField0_ |= 0x00000001; } nameDetectedLanguages_.add( input.readMessage( @@ -21205,11 +21741,11 @@ private FormField( } case 34: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { valueDetectedLanguages_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage>(); - mutable_bitField0_ |= 0x00000008; + mutable_bitField0_ |= 0x00000002; } valueDetectedLanguages_.add( input.readMessage( @@ -21233,10 +21769,10 @@ private FormField( throw new com.google.protobuf.InvalidProtocolBufferException(e) .setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000004) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { nameDetectedLanguages_ = java.util.Collections.unmodifiableList(nameDetectedLanguages_); } - if (((mutable_bitField0_ & 0x00000008) != 0)) { + if (((mutable_bitField0_ & 0x00000002) != 0)) { valueDetectedLanguages_ = java.util.Collections.unmodifiableList(valueDetectedLanguages_); } @@ -21260,7 +21796,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.documentai.v1beta1.Document.Page.FormField.Builder.class); } - private int bitField0_; public static final int FIELD_NAME_FIELD_NUMBER = 1; private com.google.cloud.documentai.v1beta1.Document.Page.Layout fieldName_; /** @@ -21273,6 +21808,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout field_name = 1; + * + * @return Whether the fieldName field is set. */ public boolean hasFieldName() { return fieldName_ != null; @@ -21287,6 +21824,8 @@ public boolean hasFieldName() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout field_name = 1; + * + * @return The fieldName. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getFieldName() { return fieldName_ == null @@ -21321,6 +21860,8 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getFieldName() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout field_value = 2; + * + * @return Whether the fieldValue field is set. */ public boolean hasFieldValue() { return fieldValue_ != null; @@ -21335,6 +21876,8 @@ public boolean hasFieldValue() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout field_value = 2; + * + * @return The fieldValue. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getFieldValue() { return fieldValue_ == null @@ -21786,13 +22329,13 @@ public Builder clear() { } if (nameDetectedLanguagesBuilder_ == null) { nameDetectedLanguages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); } else { nameDetectedLanguagesBuilder_.clear(); } if (valueDetectedLanguagesBuilder_ == null) { valueDetectedLanguages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000002); } else { valueDetectedLanguagesBuilder_.clear(); } @@ -21825,7 +22368,6 @@ public com.google.cloud.documentai.v1beta1.Document.Page.FormField buildPartial( com.google.cloud.documentai.v1beta1.Document.Page.FormField result = new com.google.cloud.documentai.v1beta1.Document.Page.FormField(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; if (fieldNameBuilder_ == null) { result.fieldName_ = fieldName_; } else { @@ -21837,26 +22379,25 @@ public com.google.cloud.documentai.v1beta1.Document.Page.FormField buildPartial( result.fieldValue_ = fieldValueBuilder_.build(); } if (nameDetectedLanguagesBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { nameDetectedLanguages_ = java.util.Collections.unmodifiableList(nameDetectedLanguages_); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); } result.nameDetectedLanguages_ = nameDetectedLanguages_; } else { result.nameDetectedLanguages_ = nameDetectedLanguagesBuilder_.build(); } if (valueDetectedLanguagesBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { + if (((bitField0_ & 0x00000002) != 0)) { valueDetectedLanguages_ = java.util.Collections.unmodifiableList(valueDetectedLanguages_); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000002); } result.valueDetectedLanguages_ = valueDetectedLanguages_; } else { result.valueDetectedLanguages_ = valueDetectedLanguagesBuilder_.build(); } - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -21921,7 +22462,7 @@ public Builder mergeFrom( if (!other.nameDetectedLanguages_.isEmpty()) { if (nameDetectedLanguages_.isEmpty()) { nameDetectedLanguages_ = other.nameDetectedLanguages_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureNameDetectedLanguagesIsMutable(); nameDetectedLanguages_.addAll(other.nameDetectedLanguages_); @@ -21934,7 +22475,7 @@ public Builder mergeFrom( nameDetectedLanguagesBuilder_.dispose(); nameDetectedLanguagesBuilder_ = null; nameDetectedLanguages_ = other.nameDetectedLanguages_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); nameDetectedLanguagesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getNameDetectedLanguagesFieldBuilder() @@ -21948,7 +22489,7 @@ public Builder mergeFrom( if (!other.valueDetectedLanguages_.isEmpty()) { if (valueDetectedLanguages_.isEmpty()) { valueDetectedLanguages_ = other.valueDetectedLanguages_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureValueDetectedLanguagesIsMutable(); valueDetectedLanguages_.addAll(other.valueDetectedLanguages_); @@ -21961,7 +22502,7 @@ public Builder mergeFrom( valueDetectedLanguagesBuilder_.dispose(); valueDetectedLanguagesBuilder_ = null; valueDetectedLanguages_ = other.valueDetectedLanguages_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000002); valueDetectedLanguagesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getValueDetectedLanguagesFieldBuilder() @@ -22020,6 +22561,8 @@ public Builder mergeFrom( * * * .google.cloud.documentai.v1beta1.Document.Page.Layout field_name = 1; + * + * @return Whether the fieldName field is set. */ public boolean hasFieldName() { return fieldNameBuilder_ != null || fieldName_ != null; @@ -22034,6 +22577,8 @@ public boolean hasFieldName() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout field_name = 1; + * + * @return The fieldName. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getFieldName() { if (fieldNameBuilder_ == null) { @@ -22224,6 +22769,8 @@ public Builder clearFieldName() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout field_value = 2; + * + * @return Whether the fieldValue field is set. */ public boolean hasFieldValue() { return fieldValueBuilder_ != null || fieldValue_ != null; @@ -22238,6 +22785,8 @@ public boolean hasFieldValue() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout field_value = 2; + * + * @return The fieldValue. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getFieldValue() { if (fieldValueBuilder_ == null) { @@ -22416,12 +22965,12 @@ public Builder clearFieldValue() { nameDetectedLanguages_ = java.util.Collections.emptyList(); private void ensureNameDetectedLanguagesIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { nameDetectedLanguages_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage>( nameDetectedLanguages_); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000001; } } @@ -22671,7 +23220,7 @@ public Builder addAllNameDetectedLanguages( public Builder clearNameDetectedLanguages() { if (nameDetectedLanguagesBuilder_ == null) { nameDetectedLanguages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { nameDetectedLanguagesBuilder_.clear(); @@ -22820,7 +23369,7 @@ public Builder removeNameDetectedLanguages(int index) { com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage.Builder, com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguageOrBuilder>( nameDetectedLanguages_, - ((bitField0_ & 0x00000004) != 0), + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); nameDetectedLanguages_ = null; @@ -22832,12 +23381,12 @@ public Builder removeNameDetectedLanguages(int index) { valueDetectedLanguages_ = java.util.Collections.emptyList(); private void ensureValueDetectedLanguagesIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { + if (!((bitField0_ & 0x00000002) != 0)) { valueDetectedLanguages_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage>( valueDetectedLanguages_); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000002; } } @@ -23087,7 +23636,7 @@ public Builder addAllValueDetectedLanguages( public Builder clearValueDetectedLanguages() { if (valueDetectedLanguagesBuilder_ == null) { valueDetectedLanguages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { valueDetectedLanguagesBuilder_.clear(); @@ -23236,7 +23785,7 @@ public Builder removeValueDetectedLanguages(int index) { com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage.Builder, com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguageOrBuilder>( valueDetectedLanguages_, - ((bitField0_ & 0x00000008) != 0), + ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); valueDetectedLanguages_ = null; @@ -23314,6 +23863,8 @@ public interface DetectedLanguageOrBuilder * * * string language_code = 1; + * + * @return The languageCode. */ java.lang.String getLanguageCode(); /** @@ -23326,6 +23877,8 @@ public interface DetectedLanguageOrBuilder * * * string language_code = 1; + * + * @return The bytes for languageCode. */ com.google.protobuf.ByteString getLanguageCodeBytes(); @@ -23337,6 +23890,8 @@ public interface DetectedLanguageOrBuilder * * * float confidence = 2; + * + * @return The confidence. */ float getConfidence(); } @@ -23363,6 +23918,12 @@ private DetectedLanguage() { languageCode_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DetectedLanguage(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -23376,7 +23937,6 @@ private DetectedLanguage( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -23446,6 +24006,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * string language_code = 1; + * + * @return The languageCode. */ public java.lang.String getLanguageCode() { java.lang.Object ref = languageCode_; @@ -23468,6 +24030,8 @@ public java.lang.String getLanguageCode() { * * * string language_code = 1; + * + * @return The bytes for languageCode. */ public com.google.protobuf.ByteString getLanguageCodeBytes() { java.lang.Object ref = languageCode_; @@ -23491,6 +24055,8 @@ public com.google.protobuf.ByteString getLanguageCodeBytes() { * * * float confidence = 2; + * + * @return The confidence. */ public float getConfidence() { return confidence_; @@ -23856,6 +24422,8 @@ public Builder mergeFrom( * * * string language_code = 1; + * + * @return The languageCode. */ public java.lang.String getLanguageCode() { java.lang.Object ref = languageCode_; @@ -23878,6 +24446,8 @@ public java.lang.String getLanguageCode() { * * * string language_code = 1; + * + * @return The bytes for languageCode. */ public com.google.protobuf.ByteString getLanguageCodeBytes() { java.lang.Object ref = languageCode_; @@ -23900,6 +24470,9 @@ public com.google.protobuf.ByteString getLanguageCodeBytes() { * * * string language_code = 1; + * + * @param value The languageCode to set. + * @return This builder for chaining. */ public Builder setLanguageCode(java.lang.String value) { if (value == null) { @@ -23920,6 +24493,8 @@ public Builder setLanguageCode(java.lang.String value) { * * * string language_code = 1; + * + * @return This builder for chaining. */ public Builder clearLanguageCode() { @@ -23937,6 +24512,9 @@ public Builder clearLanguageCode() { * * * string language_code = 1; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. */ public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -23958,6 +24536,8 @@ public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { * * * float confidence = 2; + * + * @return The confidence. */ public float getConfidence() { return confidence_; @@ -23970,6 +24550,9 @@ public float getConfidence() { * * * float confidence = 2; + * + * @param value The confidence to set. + * @return This builder for chaining. */ public Builder setConfidence(float value) { @@ -23985,6 +24568,8 @@ public Builder setConfidence(float value) { * * * float confidence = 2; + * + * @return This builder for chaining. */ public Builder clearConfidence() { @@ -24048,7 +24633,6 @@ public com.google.protobuf.Parser getParserForType() { } } - private int bitField0_; public static final int PAGE_NUMBER_FIELD_NUMBER = 1; private int pageNumber_; /** @@ -24063,6 +24647,8 @@ public com.google.protobuf.Parser getParserForType() { * * * int32 page_number = 1; + * + * @return The pageNumber. */ public int getPageNumber() { return pageNumber_; @@ -24078,6 +24664,8 @@ public int getPageNumber() { * * * .google.cloud.documentai.v1beta1.Document.Page.Dimension dimension = 2; + * + * @return Whether the dimension field is set. */ public boolean hasDimension() { return dimension_ != null; @@ -24090,6 +24678,8 @@ public boolean hasDimension() { * * * .google.cloud.documentai.v1beta1.Document.Page.Dimension dimension = 2; + * + * @return The dimension. */ public com.google.cloud.documentai.v1beta1.Document.Page.Dimension getDimension() { return dimension_ == null @@ -24121,6 +24711,8 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Dimension getDimension( * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 3; + * + * @return Whether the layout field is set. */ public boolean hasLayout() { return layout_ != null; @@ -24134,6 +24726,8 @@ public boolean hasLayout() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 3; + * + * @return The layout. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout() { return layout_ == null @@ -25092,49 +25686,49 @@ public Builder clear() { } if (detectedLanguagesBuilder_ == null) { detectedLanguages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000001); } else { detectedLanguagesBuilder_.clear(); } if (blocksBuilder_ == null) { blocks_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000002); } else { blocksBuilder_.clear(); } if (paragraphsBuilder_ == null) { paragraphs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000004); } else { paragraphsBuilder_.clear(); } if (linesBuilder_ == null) { lines_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000008); } else { linesBuilder_.clear(); } if (tokensBuilder_ == null) { tokens_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000010); } else { tokensBuilder_.clear(); } if (visualElementsBuilder_ == null) { visualElements_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000100); + bitField0_ = (bitField0_ & ~0x00000020); } else { visualElementsBuilder_.clear(); } if (tablesBuilder_ == null) { tables_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000200); + bitField0_ = (bitField0_ & ~0x00000040); } else { tablesBuilder_.clear(); } if (formFieldsBuilder_ == null) { formFields_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000400); + bitField0_ = (bitField0_ & ~0x00000080); } else { formFieldsBuilder_.clear(); } @@ -25166,7 +25760,6 @@ public com.google.cloud.documentai.v1beta1.Document.Page buildPartial() { com.google.cloud.documentai.v1beta1.Document.Page result = new com.google.cloud.documentai.v1beta1.Document.Page(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; result.pageNumber_ = pageNumber_; if (dimensionBuilder_ == null) { result.dimension_ = dimension_; @@ -25179,78 +25772,77 @@ public com.google.cloud.documentai.v1beta1.Document.Page buildPartial() { result.layout_ = layoutBuilder_.build(); } if (detectedLanguagesBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = java.util.Collections.unmodifiableList(detectedLanguages_); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000001); } result.detectedLanguages_ = detectedLanguages_; } else { result.detectedLanguages_ = detectedLanguagesBuilder_.build(); } if (blocksBuilder_ == null) { - if (((bitField0_ & 0x00000010) != 0)) { + if (((bitField0_ & 0x00000002) != 0)) { blocks_ = java.util.Collections.unmodifiableList(blocks_); - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000002); } result.blocks_ = blocks_; } else { result.blocks_ = blocksBuilder_.build(); } if (paragraphsBuilder_ == null) { - if (((bitField0_ & 0x00000020) != 0)) { + if (((bitField0_ & 0x00000004) != 0)) { paragraphs_ = java.util.Collections.unmodifiableList(paragraphs_); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000004); } result.paragraphs_ = paragraphs_; } else { result.paragraphs_ = paragraphsBuilder_.build(); } if (linesBuilder_ == null) { - if (((bitField0_ & 0x00000040) != 0)) { + if (((bitField0_ & 0x00000008) != 0)) { lines_ = java.util.Collections.unmodifiableList(lines_); - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000008); } result.lines_ = lines_; } else { result.lines_ = linesBuilder_.build(); } if (tokensBuilder_ == null) { - if (((bitField0_ & 0x00000080) != 0)) { + if (((bitField0_ & 0x00000010) != 0)) { tokens_ = java.util.Collections.unmodifiableList(tokens_); - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000010); } result.tokens_ = tokens_; } else { result.tokens_ = tokensBuilder_.build(); } if (visualElementsBuilder_ == null) { - if (((bitField0_ & 0x00000100) != 0)) { + if (((bitField0_ & 0x00000020) != 0)) { visualElements_ = java.util.Collections.unmodifiableList(visualElements_); - bitField0_ = (bitField0_ & ~0x00000100); + bitField0_ = (bitField0_ & ~0x00000020); } result.visualElements_ = visualElements_; } else { result.visualElements_ = visualElementsBuilder_.build(); } if (tablesBuilder_ == null) { - if (((bitField0_ & 0x00000200) != 0)) { + if (((bitField0_ & 0x00000040) != 0)) { tables_ = java.util.Collections.unmodifiableList(tables_); - bitField0_ = (bitField0_ & ~0x00000200); + bitField0_ = (bitField0_ & ~0x00000040); } result.tables_ = tables_; } else { result.tables_ = tablesBuilder_.build(); } if (formFieldsBuilder_ == null) { - if (((bitField0_ & 0x00000400) != 0)) { + if (((bitField0_ & 0x00000080) != 0)) { formFields_ = java.util.Collections.unmodifiableList(formFields_); - bitField0_ = (bitField0_ & ~0x00000400); + bitField0_ = (bitField0_ & ~0x00000080); } result.formFields_ = formFields_; } else { result.formFields_ = formFieldsBuilder_.build(); } - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -25316,7 +25908,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page other if (!other.detectedLanguages_.isEmpty()) { if (detectedLanguages_.isEmpty()) { detectedLanguages_ = other.detectedLanguages_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureDetectedLanguagesIsMutable(); detectedLanguages_.addAll(other.detectedLanguages_); @@ -25329,7 +25921,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page other detectedLanguagesBuilder_.dispose(); detectedLanguagesBuilder_ = null; detectedLanguages_ = other.detectedLanguages_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000001); detectedLanguagesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDetectedLanguagesFieldBuilder() @@ -25343,7 +25935,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page other if (!other.blocks_.isEmpty()) { if (blocks_.isEmpty()) { blocks_ = other.blocks_; - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureBlocksIsMutable(); blocks_.addAll(other.blocks_); @@ -25356,7 +25948,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page other blocksBuilder_.dispose(); blocksBuilder_ = null; blocks_ = other.blocks_; - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000002); blocksBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getBlocksFieldBuilder() @@ -25370,7 +25962,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page other if (!other.paragraphs_.isEmpty()) { if (paragraphs_.isEmpty()) { paragraphs_ = other.paragraphs_; - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000004); } else { ensureParagraphsIsMutable(); paragraphs_.addAll(other.paragraphs_); @@ -25383,7 +25975,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page other paragraphsBuilder_.dispose(); paragraphsBuilder_ = null; paragraphs_ = other.paragraphs_; - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000004); paragraphsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getParagraphsFieldBuilder() @@ -25397,7 +25989,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page other if (!other.lines_.isEmpty()) { if (lines_.isEmpty()) { lines_ = other.lines_; - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000008); } else { ensureLinesIsMutable(); lines_.addAll(other.lines_); @@ -25410,7 +26002,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page other linesBuilder_.dispose(); linesBuilder_ = null; lines_ = other.lines_; - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000008); linesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getLinesFieldBuilder() @@ -25424,7 +26016,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page other if (!other.tokens_.isEmpty()) { if (tokens_.isEmpty()) { tokens_ = other.tokens_; - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000010); } else { ensureTokensIsMutable(); tokens_.addAll(other.tokens_); @@ -25437,7 +26029,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page other tokensBuilder_.dispose(); tokensBuilder_ = null; tokens_ = other.tokens_; - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000010); tokensBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getTokensFieldBuilder() @@ -25451,7 +26043,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page other if (!other.visualElements_.isEmpty()) { if (visualElements_.isEmpty()) { visualElements_ = other.visualElements_; - bitField0_ = (bitField0_ & ~0x00000100); + bitField0_ = (bitField0_ & ~0x00000020); } else { ensureVisualElementsIsMutable(); visualElements_.addAll(other.visualElements_); @@ -25464,7 +26056,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page other visualElementsBuilder_.dispose(); visualElementsBuilder_ = null; visualElements_ = other.visualElements_; - bitField0_ = (bitField0_ & ~0x00000100); + bitField0_ = (bitField0_ & ~0x00000020); visualElementsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getVisualElementsFieldBuilder() @@ -25478,7 +26070,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page other if (!other.tables_.isEmpty()) { if (tables_.isEmpty()) { tables_ = other.tables_; - bitField0_ = (bitField0_ & ~0x00000200); + bitField0_ = (bitField0_ & ~0x00000040); } else { ensureTablesIsMutable(); tables_.addAll(other.tables_); @@ -25491,7 +26083,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page other tablesBuilder_.dispose(); tablesBuilder_ = null; tables_ = other.tables_; - bitField0_ = (bitField0_ & ~0x00000200); + bitField0_ = (bitField0_ & ~0x00000040); tablesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getTablesFieldBuilder() @@ -25505,7 +26097,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page other if (!other.formFields_.isEmpty()) { if (formFields_.isEmpty()) { formFields_ = other.formFields_; - bitField0_ = (bitField0_ & ~0x00000400); + bitField0_ = (bitField0_ & ~0x00000080); } else { ensureFormFieldsIsMutable(); formFields_.addAll(other.formFields_); @@ -25518,7 +26110,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document.Page other formFieldsBuilder_.dispose(); formFieldsBuilder_ = null; formFields_ = other.formFields_; - bitField0_ = (bitField0_ & ~0x00000400); + bitField0_ = (bitField0_ & ~0x00000080); formFieldsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getFormFieldsFieldBuilder() @@ -25573,6 +26165,8 @@ public Builder mergeFrom( * * * int32 page_number = 1; + * + * @return The pageNumber. */ public int getPageNumber() { return pageNumber_; @@ -25589,6 +26183,9 @@ public int getPageNumber() { * * * int32 page_number = 1; + * + * @param value The pageNumber to set. + * @return This builder for chaining. */ public Builder setPageNumber(int value) { @@ -25608,6 +26205,8 @@ public Builder setPageNumber(int value) { * * * int32 page_number = 1; + * + * @return This builder for chaining. */ public Builder clearPageNumber() { @@ -25630,6 +26229,8 @@ public Builder clearPageNumber() { * * * .google.cloud.documentai.v1beta1.Document.Page.Dimension dimension = 2; + * + * @return Whether the dimension field is set. */ public boolean hasDimension() { return dimensionBuilder_ != null || dimension_ != null; @@ -25642,6 +26243,8 @@ public boolean hasDimension() { * * * .google.cloud.documentai.v1beta1.Document.Page.Dimension dimension = 2; + * + * @return The dimension. */ public com.google.cloud.documentai.v1beta1.Document.Page.Dimension getDimension() { if (dimensionBuilder_ == null) { @@ -25817,6 +26420,8 @@ public Builder clearDimension() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 3; + * + * @return Whether the layout field is set. */ public boolean hasLayout() { return layoutBuilder_ != null || layout_ != null; @@ -25830,6 +26435,8 @@ public boolean hasLayout() { * * * .google.cloud.documentai.v1beta1.Document.Page.Layout layout = 3; + * + * @return The layout. */ public com.google.cloud.documentai.v1beta1.Document.Page.Layout getLayout() { if (layoutBuilder_ == null) { @@ -25998,12 +26605,12 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Layout.Builder getLayou detectedLanguages_ = java.util.Collections.emptyList(); private void ensureDetectedLanguagesIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { detectedLanguages_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage>( detectedLanguages_); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000001; } } @@ -26253,7 +26860,7 @@ public Builder addAllDetectedLanguages( public Builder clearDetectedLanguages() { if (detectedLanguagesBuilder_ == null) { detectedLanguages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { detectedLanguagesBuilder_.clear(); @@ -26401,7 +27008,7 @@ public Builder removeDetectedLanguages(int index) { com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage.Builder, com.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguageOrBuilder>( detectedLanguages_, - ((bitField0_ & 0x00000008) != 0), + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); detectedLanguages_ = null; @@ -26413,11 +27020,11 @@ public Builder removeDetectedLanguages(int index) { java.util.Collections.emptyList(); private void ensureBlocksIsMutable() { - if (!((bitField0_ & 0x00000010) != 0)) { + if (!((bitField0_ & 0x00000002) != 0)) { blocks_ = new java.util.ArrayList( blocks_); - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000002; } } @@ -26661,7 +27268,7 @@ public Builder addAllBlocks( public Builder clearBlocks() { if (blocksBuilder_ == null) { blocks_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { blocksBuilder_.clear(); @@ -26804,7 +27411,7 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Block.Builder addBlocks com.google.cloud.documentai.v1beta1.Document.Page.Block, com.google.cloud.documentai.v1beta1.Document.Page.Block.Builder, com.google.cloud.documentai.v1beta1.Document.Page.BlockOrBuilder>( - blocks_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); + blocks_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); blocks_ = null; } return blocksBuilder_; @@ -26814,11 +27421,11 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Block.Builder addBlocks paragraphs_ = java.util.Collections.emptyList(); private void ensureParagraphsIsMutable() { - if (!((bitField0_ & 0x00000020) != 0)) { + if (!((bitField0_ & 0x00000004) != 0)) { paragraphs_ = new java.util.ArrayList( paragraphs_); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000004; } } @@ -27063,7 +27670,7 @@ public Builder addAllParagraphs( public Builder clearParagraphs() { if (paragraphsBuilder_ == null) { paragraphs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); } else { paragraphsBuilder_.clear(); @@ -27207,7 +27814,7 @@ public Builder removeParagraphs(int index) { com.google.cloud.documentai.v1beta1.Document.Page.Paragraph, com.google.cloud.documentai.v1beta1.Document.Page.Paragraph.Builder, com.google.cloud.documentai.v1beta1.Document.Page.ParagraphOrBuilder>( - paragraphs_, ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); + paragraphs_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); paragraphs_ = null; } return paragraphsBuilder_; @@ -27217,11 +27824,11 @@ public Builder removeParagraphs(int index) { java.util.Collections.emptyList(); private void ensureLinesIsMutable() { - if (!((bitField0_ & 0x00000040) != 0)) { + if (!((bitField0_ & 0x00000008) != 0)) { lines_ = new java.util.ArrayList( lines_); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000008; } } @@ -27453,7 +28060,7 @@ public Builder addAllLines( public Builder clearLines() { if (linesBuilder_ == null) { lines_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); } else { linesBuilder_.clear(); @@ -27588,7 +28195,7 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Line.Builder addLinesBu com.google.cloud.documentai.v1beta1.Document.Page.Line, com.google.cloud.documentai.v1beta1.Document.Page.Line.Builder, com.google.cloud.documentai.v1beta1.Document.Page.LineOrBuilder>( - lines_, ((bitField0_ & 0x00000040) != 0), getParentForChildren(), isClean()); + lines_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); lines_ = null; } return linesBuilder_; @@ -27598,11 +28205,11 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Line.Builder addLinesBu java.util.Collections.emptyList(); private void ensureTokensIsMutable() { - if (!((bitField0_ & 0x00000080) != 0)) { + if (!((bitField0_ & 0x00000010) != 0)) { tokens_ = new java.util.ArrayList( tokens_); - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000010; } } @@ -27824,7 +28431,7 @@ public Builder addAllTokens( public Builder clearTokens() { if (tokensBuilder_ == null) { tokens_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); } else { tokensBuilder_.clear(); @@ -27953,7 +28560,7 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Token.Builder addTokens com.google.cloud.documentai.v1beta1.Document.Page.Token, com.google.cloud.documentai.v1beta1.Document.Page.Token.Builder, com.google.cloud.documentai.v1beta1.Document.Page.TokenOrBuilder>( - tokens_, ((bitField0_ & 0x00000080) != 0), getParentForChildren(), isClean()); + tokens_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); tokens_ = null; } return tokensBuilder_; @@ -27963,11 +28570,11 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Token.Builder addTokens visualElements_ = java.util.Collections.emptyList(); private void ensureVisualElementsIsMutable() { - if (!((bitField0_ & 0x00000100) != 0)) { + if (!((bitField0_ & 0x00000020) != 0)) { visualElements_ = new java.util.ArrayList< com.google.cloud.documentai.v1beta1.Document.Page.VisualElement>(visualElements_); - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000020; } } @@ -28225,7 +28832,7 @@ public Builder addAllVisualElements( public Builder clearVisualElements() { if (visualElementsBuilder_ == null) { visualElements_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000100); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); } else { visualElementsBuilder_.clear(); @@ -28379,7 +28986,7 @@ public Builder removeVisualElements(int index) { com.google.cloud.documentai.v1beta1.Document.Page.VisualElement.Builder, com.google.cloud.documentai.v1beta1.Document.Page.VisualElementOrBuilder>( visualElements_, - ((bitField0_ & 0x00000100) != 0), + ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); visualElements_ = null; @@ -28391,11 +28998,11 @@ public Builder removeVisualElements(int index) { java.util.Collections.emptyList(); private void ensureTablesIsMutable() { - if (!((bitField0_ & 0x00000200) != 0)) { + if (!((bitField0_ & 0x00000040) != 0)) { tables_ = new java.util.ArrayList( tables_); - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000040; } } @@ -28617,7 +29224,7 @@ public Builder addAllTables( public Builder clearTables() { if (tablesBuilder_ == null) { tables_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000200); + bitField0_ = (bitField0_ & ~0x00000040); onChanged(); } else { tablesBuilder_.clear(); @@ -28746,7 +29353,7 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Table.Builder addTables com.google.cloud.documentai.v1beta1.Document.Page.Table, com.google.cloud.documentai.v1beta1.Document.Page.Table.Builder, com.google.cloud.documentai.v1beta1.Document.Page.TableOrBuilder>( - tables_, ((bitField0_ & 0x00000200) != 0), getParentForChildren(), isClean()); + tables_, ((bitField0_ & 0x00000040) != 0), getParentForChildren(), isClean()); tables_ = null; } return tablesBuilder_; @@ -28756,11 +29363,11 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Table.Builder addTables formFields_ = java.util.Collections.emptyList(); private void ensureFormFieldsIsMutable() { - if (!((bitField0_ & 0x00000400) != 0)) { + if (!((bitField0_ & 0x00000080) != 0)) { formFields_ = new java.util.ArrayList( formFields_); - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000080; } } @@ -28994,7 +29601,7 @@ public Builder addAllFormFields( public Builder clearFormFields() { if (formFieldsBuilder_ == null) { formFields_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000400); + bitField0_ = (bitField0_ & ~0x00000080); onChanged(); } else { formFieldsBuilder_.clear(); @@ -29131,7 +29738,7 @@ public Builder removeFormFields(int index) { com.google.cloud.documentai.v1beta1.Document.Page.FormField, com.google.cloud.documentai.v1beta1.Document.Page.FormField.Builder, com.google.cloud.documentai.v1beta1.Document.Page.FormFieldOrBuilder>( - formFields_, ((bitField0_ & 0x00000400) != 0), getParentForChildren(), isClean()); + formFields_, ((bitField0_ & 0x00000080) != 0), getParentForChildren(), isClean()); formFields_ = null; } return formFieldsBuilder_; @@ -29204,6 +29811,8 @@ public interface EntityOrBuilder * * * .google.cloud.documentai.v1beta1.Document.TextAnchor text_anchor = 1; + * + * @return Whether the textAnchor field is set. */ boolean hasTextAnchor(); /** @@ -29216,6 +29825,8 @@ public interface EntityOrBuilder * * * .google.cloud.documentai.v1beta1.Document.TextAnchor text_anchor = 1; + * + * @return The textAnchor. */ com.google.cloud.documentai.v1beta1.Document.TextAnchor getTextAnchor(); /** @@ -29239,6 +29850,8 @@ public interface EntityOrBuilder * * * string type = 2; + * + * @return The type. */ java.lang.String getType(); /** @@ -29249,6 +29862,8 @@ public interface EntityOrBuilder * * * string type = 2; + * + * @return The bytes for type. */ com.google.protobuf.ByteString getTypeBytes(); @@ -29260,6 +29875,8 @@ public interface EntityOrBuilder * * * string mention_text = 3; + * + * @return The mentionText. */ java.lang.String getMentionText(); /** @@ -29270,6 +29887,8 @@ public interface EntityOrBuilder * * * string mention_text = 3; + * + * @return The bytes for mentionText. */ com.google.protobuf.ByteString getMentionTextBytes(); @@ -29282,6 +29901,8 @@ public interface EntityOrBuilder * * * string mention_id = 4; + * + * @return The mentionId. */ java.lang.String getMentionId(); /** @@ -29293,6 +29914,8 @@ public interface EntityOrBuilder * * * string mention_id = 4; + * + * @return The bytes for mentionId. */ com.google.protobuf.ByteString getMentionIdBytes(); } @@ -29322,6 +29945,12 @@ private Entity() { mentionId_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Entity(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -29335,7 +29964,6 @@ private Entity( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -29430,6 +30058,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * .google.cloud.documentai.v1beta1.Document.TextAnchor text_anchor = 1; + * + * @return Whether the textAnchor field is set. */ public boolean hasTextAnchor() { return textAnchor_ != null; @@ -29444,6 +30074,8 @@ public boolean hasTextAnchor() { * * * .google.cloud.documentai.v1beta1.Document.TextAnchor text_anchor = 1; + * + * @return The textAnchor. */ public com.google.cloud.documentai.v1beta1.Document.TextAnchor getTextAnchor() { return textAnchor_ == null @@ -29476,6 +30108,8 @@ public com.google.cloud.documentai.v1beta1.Document.TextAnchor getTextAnchor() { * * * string type = 2; + * + * @return The type. */ public java.lang.String getType() { java.lang.Object ref = type_; @@ -29496,6 +30130,8 @@ public java.lang.String getType() { * * * string type = 2; + * + * @return The bytes for type. */ public com.google.protobuf.ByteString getTypeBytes() { java.lang.Object ref = type_; @@ -29519,6 +30155,8 @@ public com.google.protobuf.ByteString getTypeBytes() { * * * string mention_text = 3; + * + * @return The mentionText. */ public java.lang.String getMentionText() { java.lang.Object ref = mentionText_; @@ -29539,6 +30177,8 @@ public java.lang.String getMentionText() { * * * string mention_text = 3; + * + * @return The bytes for mentionText. */ public com.google.protobuf.ByteString getMentionTextBytes() { java.lang.Object ref = mentionText_; @@ -29563,6 +30203,8 @@ public com.google.protobuf.ByteString getMentionTextBytes() { * * * string mention_id = 4; + * + * @return The mentionId. */ public java.lang.String getMentionId() { java.lang.Object ref = mentionId_; @@ -29584,6 +30226,8 @@ public java.lang.String getMentionId() { * * * string mention_id = 4; + * + * @return The bytes for mentionId. */ public com.google.protobuf.ByteString getMentionIdBytes() { java.lang.Object ref = mentionId_; @@ -29997,6 +30641,8 @@ public Builder mergeFrom( * * * .google.cloud.documentai.v1beta1.Document.TextAnchor text_anchor = 1; + * + * @return Whether the textAnchor field is set. */ public boolean hasTextAnchor() { return textAnchorBuilder_ != null || textAnchor_ != null; @@ -30011,6 +30657,8 @@ public boolean hasTextAnchor() { * * * .google.cloud.documentai.v1beta1.Document.TextAnchor text_anchor = 1; + * + * @return The textAnchor. */ public com.google.cloud.documentai.v1beta1.Document.TextAnchor getTextAnchor() { if (textAnchorBuilder_ == null) { @@ -30193,6 +30841,8 @@ public Builder clearTextAnchor() { * * * string type = 2; + * + * @return The type. */ public java.lang.String getType() { java.lang.Object ref = type_; @@ -30213,6 +30863,8 @@ public java.lang.String getType() { * * * string type = 2; + * + * @return The bytes for type. */ public com.google.protobuf.ByteString getTypeBytes() { java.lang.Object ref = type_; @@ -30233,6 +30885,9 @@ public com.google.protobuf.ByteString getTypeBytes() { * * * string type = 2; + * + * @param value The type to set. + * @return This builder for chaining. */ public Builder setType(java.lang.String value) { if (value == null) { @@ -30251,6 +30906,8 @@ public Builder setType(java.lang.String value) { * * * string type = 2; + * + * @return This builder for chaining. */ public Builder clearType() { @@ -30266,6 +30923,9 @@ public Builder clearType() { * * * string type = 2; + * + * @param value The bytes for type to set. + * @return This builder for chaining. */ public Builder setTypeBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -30287,6 +30947,8 @@ public Builder setTypeBytes(com.google.protobuf.ByteString value) { * * * string mention_text = 3; + * + * @return The mentionText. */ public java.lang.String getMentionText() { java.lang.Object ref = mentionText_; @@ -30307,6 +30969,8 @@ public java.lang.String getMentionText() { * * * string mention_text = 3; + * + * @return The bytes for mentionText. */ public com.google.protobuf.ByteString getMentionTextBytes() { java.lang.Object ref = mentionText_; @@ -30327,6 +30991,9 @@ public com.google.protobuf.ByteString getMentionTextBytes() { * * * string mention_text = 3; + * + * @param value The mentionText to set. + * @return This builder for chaining. */ public Builder setMentionText(java.lang.String value) { if (value == null) { @@ -30345,6 +31012,8 @@ public Builder setMentionText(java.lang.String value) { * * * string mention_text = 3; + * + * @return This builder for chaining. */ public Builder clearMentionText() { @@ -30360,6 +31029,9 @@ public Builder clearMentionText() { * * * string mention_text = 3; + * + * @param value The bytes for mentionText to set. + * @return This builder for chaining. */ public Builder setMentionTextBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -30382,6 +31054,8 @@ public Builder setMentionTextBytes(com.google.protobuf.ByteString value) { * * * string mention_id = 4; + * + * @return The mentionId. */ public java.lang.String getMentionId() { java.lang.Object ref = mentionId_; @@ -30403,6 +31077,8 @@ public java.lang.String getMentionId() { * * * string mention_id = 4; + * + * @return The bytes for mentionId. */ public com.google.protobuf.ByteString getMentionIdBytes() { java.lang.Object ref = mentionId_; @@ -30424,6 +31100,9 @@ public com.google.protobuf.ByteString getMentionIdBytes() { * * * string mention_id = 4; + * + * @param value The mentionId to set. + * @return This builder for chaining. */ public Builder setMentionId(java.lang.String value) { if (value == null) { @@ -30443,6 +31122,8 @@ public Builder setMentionId(java.lang.String value) { * * * string mention_id = 4; + * + * @return This builder for chaining. */ public Builder clearMentionId() { @@ -30459,6 +31140,9 @@ public Builder clearMentionId() { * * * string mention_id = 4; + * + * @param value The bytes for mentionId to set. + * @return This builder for chaining. */ public Builder setMentionIdBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -30536,6 +31220,8 @@ public interface EntityRelationOrBuilder * * * string subject_id = 1; + * + * @return The subjectId. */ java.lang.String getSubjectId(); /** @@ -30546,6 +31232,8 @@ public interface EntityRelationOrBuilder * * * string subject_id = 1; + * + * @return The bytes for subjectId. */ com.google.protobuf.ByteString getSubjectIdBytes(); @@ -30557,6 +31245,8 @@ public interface EntityRelationOrBuilder * * * string object_id = 2; + * + * @return The objectId. */ java.lang.String getObjectId(); /** @@ -30567,6 +31257,8 @@ public interface EntityRelationOrBuilder * * * string object_id = 2; + * + * @return The bytes for objectId. */ com.google.protobuf.ByteString getObjectIdBytes(); @@ -30578,6 +31270,8 @@ public interface EntityRelationOrBuilder * * * string relation = 3; + * + * @return The relation. */ java.lang.String getRelation(); /** @@ -30588,6 +31282,8 @@ public interface EntityRelationOrBuilder * * * string relation = 3; + * + * @return The bytes for relation. */ com.google.protobuf.ByteString getRelationBytes(); } @@ -30617,6 +31313,12 @@ private EntityRelation() { relation_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EntityRelation(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -30630,7 +31332,6 @@ private EntityRelation( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -30706,6 +31407,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * string subject_id = 1; + * + * @return The subjectId. */ public java.lang.String getSubjectId() { java.lang.Object ref = subjectId_; @@ -30726,6 +31429,8 @@ public java.lang.String getSubjectId() { * * * string subject_id = 1; + * + * @return The bytes for subjectId. */ public com.google.protobuf.ByteString getSubjectIdBytes() { java.lang.Object ref = subjectId_; @@ -30749,6 +31454,8 @@ public com.google.protobuf.ByteString getSubjectIdBytes() { * * * string object_id = 2; + * + * @return The objectId. */ public java.lang.String getObjectId() { java.lang.Object ref = objectId_; @@ -30769,6 +31476,8 @@ public java.lang.String getObjectId() { * * * string object_id = 2; + * + * @return The bytes for objectId. */ public com.google.protobuf.ByteString getObjectIdBytes() { java.lang.Object ref = objectId_; @@ -30792,6 +31501,8 @@ public com.google.protobuf.ByteString getObjectIdBytes() { * * * string relation = 3; + * + * @return The relation. */ public java.lang.String getRelation() { java.lang.Object ref = relation_; @@ -30812,6 +31523,8 @@ public java.lang.String getRelation() { * * * string relation = 3; + * + * @return The bytes for relation. */ public com.google.protobuf.ByteString getRelationBytes() { java.lang.Object ref = relation_; @@ -31193,6 +31906,8 @@ public Builder mergeFrom( * * * string subject_id = 1; + * + * @return The subjectId. */ public java.lang.String getSubjectId() { java.lang.Object ref = subjectId_; @@ -31213,6 +31928,8 @@ public java.lang.String getSubjectId() { * * * string subject_id = 1; + * + * @return The bytes for subjectId. */ public com.google.protobuf.ByteString getSubjectIdBytes() { java.lang.Object ref = subjectId_; @@ -31233,6 +31950,9 @@ public com.google.protobuf.ByteString getSubjectIdBytes() { * * * string subject_id = 1; + * + * @param value The subjectId to set. + * @return This builder for chaining. */ public Builder setSubjectId(java.lang.String value) { if (value == null) { @@ -31251,6 +31971,8 @@ public Builder setSubjectId(java.lang.String value) { * * * string subject_id = 1; + * + * @return This builder for chaining. */ public Builder clearSubjectId() { @@ -31266,6 +31988,9 @@ public Builder clearSubjectId() { * * * string subject_id = 1; + * + * @param value The bytes for subjectId to set. + * @return This builder for chaining. */ public Builder setSubjectIdBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -31287,6 +32012,8 @@ public Builder setSubjectIdBytes(com.google.protobuf.ByteString value) { * * * string object_id = 2; + * + * @return The objectId. */ public java.lang.String getObjectId() { java.lang.Object ref = objectId_; @@ -31307,6 +32034,8 @@ public java.lang.String getObjectId() { * * * string object_id = 2; + * + * @return The bytes for objectId. */ public com.google.protobuf.ByteString getObjectIdBytes() { java.lang.Object ref = objectId_; @@ -31327,6 +32056,9 @@ public com.google.protobuf.ByteString getObjectIdBytes() { * * * string object_id = 2; + * + * @param value The objectId to set. + * @return This builder for chaining. */ public Builder setObjectId(java.lang.String value) { if (value == null) { @@ -31345,6 +32077,8 @@ public Builder setObjectId(java.lang.String value) { * * * string object_id = 2; + * + * @return This builder for chaining. */ public Builder clearObjectId() { @@ -31360,6 +32094,9 @@ public Builder clearObjectId() { * * * string object_id = 2; + * + * @param value The bytes for objectId to set. + * @return This builder for chaining. */ public Builder setObjectIdBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -31381,6 +32118,8 @@ public Builder setObjectIdBytes(com.google.protobuf.ByteString value) { * * * string relation = 3; + * + * @return The relation. */ public java.lang.String getRelation() { java.lang.Object ref = relation_; @@ -31401,6 +32140,8 @@ public java.lang.String getRelation() { * * * string relation = 3; + * + * @return The bytes for relation. */ public com.google.protobuf.ByteString getRelationBytes() { java.lang.Object ref = relation_; @@ -31421,6 +32162,9 @@ public com.google.protobuf.ByteString getRelationBytes() { * * * string relation = 3; + * + * @param value The relation to set. + * @return This builder for chaining. */ public Builder setRelation(java.lang.String value) { if (value == null) { @@ -31439,6 +32183,8 @@ public Builder setRelation(java.lang.String value) { * * * string relation = 3; + * + * @return This builder for chaining. */ public Builder clearRelation() { @@ -31454,6 +32200,9 @@ public Builder clearRelation() { * * * string relation = 3; + * + * @param value The bytes for relation to set. + * @return This builder for chaining. */ public Builder setRelationBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -31618,6 +32367,12 @@ private TextAnchor() { textSegments_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TextAnchor(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -31709,6 +32464,8 @@ public interface TextSegmentOrBuilder * * * int64 start_index = 1; + * + * @return The startIndex. */ long getStartIndex(); @@ -31722,6 +32479,8 @@ public interface TextSegmentOrBuilder * * * int64 end_index = 2; + * + * @return The endIndex. */ long getEndIndex(); } @@ -31750,6 +32509,12 @@ private TextSegment(com.google.protobuf.GeneratedMessageV3.Builder builder) { private TextSegment() {} + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TextSegment(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -31763,7 +32528,6 @@ private TextSegment( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -31831,6 +32595,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * int64 start_index = 1; + * + * @return The startIndex. */ public long getStartIndex() { return startIndex_; @@ -31848,6 +32614,8 @@ public long getStartIndex() { * * * int64 end_index = 2; + * + * @return The endIndex. */ public long getEndIndex() { return endIndex_; @@ -32217,6 +32985,8 @@ public Builder mergeFrom( * * * int64 start_index = 1; + * + * @return The startIndex. */ public long getStartIndex() { return startIndex_; @@ -32231,6 +33001,9 @@ public long getStartIndex() { * * * int64 start_index = 1; + * + * @param value The startIndex to set. + * @return This builder for chaining. */ public Builder setStartIndex(long value) { @@ -32248,6 +33021,8 @@ public Builder setStartIndex(long value) { * * * int64 start_index = 1; + * + * @return This builder for chaining. */ public Builder clearStartIndex() { @@ -32267,6 +33042,8 @@ public Builder clearStartIndex() { * * * int64 end_index = 2; + * + * @return The endIndex. */ public long getEndIndex() { return endIndex_; @@ -32281,6 +33058,9 @@ public long getEndIndex() { * * * int64 end_index = 2; + * + * @param value The endIndex to set. + * @return This builder for chaining. */ public Builder setEndIndex(long value) { @@ -32298,6 +33078,8 @@ public Builder setEndIndex(long value) { * * * int64 end_index = 2; + * + * @return This builder for chaining. */ public Builder clearEndIndex() { @@ -33298,11 +34080,13 @@ public com.google.cloud.documentai.v1beta1.Document.TextAnchor getDefaultInstanc } } - private int bitField0_; private int sourceCase_ = 0; private java.lang.Object source_; - public enum SourceCase implements com.google.protobuf.Internal.EnumLite { + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { URI(1), CONTENT(2), SOURCE_NOT_SET(0); @@ -33311,7 +34095,11 @@ public enum SourceCase implements com.google.protobuf.Internal.EnumLite { private SourceCase(int value) { this.value = value; } - /** @deprecated Use {@link #forNumber(int)} instead. */ + /** + * @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 SourceCase valueOf(int value) { return forNumber(value); @@ -33352,6 +34140,8 @@ public SourceCase getSourceCase() { * * * string uri = 1; + * + * @return The uri. */ public java.lang.String getUri() { java.lang.Object ref = ""; @@ -33381,6 +34171,8 @@ public java.lang.String getUri() { * * * string uri = 1; + * + * @return The bytes for uri. */ public com.google.protobuf.ByteString getUriBytes() { java.lang.Object ref = ""; @@ -33410,6 +34202,8 @@ public com.google.protobuf.ByteString getUriBytes() { * * * bytes content = 2; + * + * @return The content. */ public com.google.protobuf.ByteString getContent() { if (sourceCase_ == 2) { @@ -33430,6 +34224,8 @@ public com.google.protobuf.ByteString getContent() { * * * string mime_type = 3; + * + * @return The mimeType. */ public java.lang.String getMimeType() { java.lang.Object ref = mimeType_; @@ -33452,6 +34248,8 @@ public java.lang.String getMimeType() { * * * string mime_type = 3; + * + * @return The bytes for mimeType. */ public com.google.protobuf.ByteString getMimeTypeBytes() { java.lang.Object ref = mimeType_; @@ -33475,6 +34273,8 @@ public com.google.protobuf.ByteString getMimeTypeBytes() { * * * string text = 4; + * + * @return The text. */ public java.lang.String getText() { java.lang.Object ref = text_; @@ -33495,6 +34295,8 @@ public java.lang.String getText() { * * * string text = 4; + * + * @return The bytes for text. */ public com.google.protobuf.ByteString getTextBytes() { java.lang.Object ref = text_; @@ -33811,6 +34613,8 @@ public com.google.cloud.documentai.v1beta1.Document.EntityRelation getEntityRela * * * .google.cloud.documentai.v1beta1.Document.ShardInfo shard_info = 9; + * + * @return Whether the shardInfo field is set. */ public boolean hasShardInfo() { return shardInfo_ != null; @@ -33824,6 +34628,8 @@ public boolean hasShardInfo() { * * * .google.cloud.documentai.v1beta1.Document.ShardInfo shard_info = 9; + * + * @return The shardInfo. */ public com.google.cloud.documentai.v1beta1.Document.ShardInfo getShardInfo() { return shardInfo_ == null @@ -33854,6 +34660,8 @@ public com.google.cloud.documentai.v1beta1.Document.ShardInfoOrBuilder getShardI * * * .google.rpc.Status error = 10; + * + * @return Whether the error field is set. */ public boolean hasError() { return error_ != null; @@ -33866,6 +34674,8 @@ public boolean hasError() { * * * .google.rpc.Status error = 10; + * + * @return The error. */ public com.google.rpc.Status getError() { return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; @@ -34220,25 +35030,25 @@ public Builder clear() { if (textStylesBuilder_ == null) { textStyles_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000001); } else { textStylesBuilder_.clear(); } if (pagesBuilder_ == null) { pages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000002); } else { pagesBuilder_.clear(); } if (entitiesBuilder_ == null) { entities_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000004); } else { entitiesBuilder_.clear(); } if (entityRelationsBuilder_ == null) { entityRelations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000008); } else { entityRelationsBuilder_.clear(); } @@ -34284,7 +35094,6 @@ public com.google.cloud.documentai.v1beta1.Document buildPartial() { com.google.cloud.documentai.v1beta1.Document result = new com.google.cloud.documentai.v1beta1.Document(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; if (sourceCase_ == 1) { result.source_ = source_; } @@ -34294,36 +35103,36 @@ public com.google.cloud.documentai.v1beta1.Document buildPartial() { result.mimeType_ = mimeType_; result.text_ = text_; if (textStylesBuilder_ == null) { - if (((bitField0_ & 0x00000010) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { textStyles_ = java.util.Collections.unmodifiableList(textStyles_); - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000001); } result.textStyles_ = textStyles_; } else { result.textStyles_ = textStylesBuilder_.build(); } if (pagesBuilder_ == null) { - if (((bitField0_ & 0x00000020) != 0)) { + if (((bitField0_ & 0x00000002) != 0)) { pages_ = java.util.Collections.unmodifiableList(pages_); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000002); } result.pages_ = pages_; } else { result.pages_ = pagesBuilder_.build(); } if (entitiesBuilder_ == null) { - if (((bitField0_ & 0x00000040) != 0)) { + if (((bitField0_ & 0x00000004) != 0)) { entities_ = java.util.Collections.unmodifiableList(entities_); - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000004); } result.entities_ = entities_; } else { result.entities_ = entitiesBuilder_.build(); } if (entityRelationsBuilder_ == null) { - if (((bitField0_ & 0x00000080) != 0)) { + if (((bitField0_ & 0x00000008) != 0)) { entityRelations_ = java.util.Collections.unmodifiableList(entityRelations_); - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000008); } result.entityRelations_ = entityRelations_; } else { @@ -34339,7 +35148,6 @@ public com.google.cloud.documentai.v1beta1.Document buildPartial() { } else { result.error_ = errorBuilder_.build(); } - result.bitField0_ = to_bitField0_; result.sourceCase_ = sourceCase_; onBuilt(); return result; @@ -34402,7 +35210,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document other) { if (!other.textStyles_.isEmpty()) { if (textStyles_.isEmpty()) { textStyles_ = other.textStyles_; - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureTextStylesIsMutable(); textStyles_.addAll(other.textStyles_); @@ -34415,7 +35223,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document other) { textStylesBuilder_.dispose(); textStylesBuilder_ = null; textStyles_ = other.textStyles_; - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000001); textStylesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getTextStylesFieldBuilder() @@ -34429,7 +35237,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document other) { if (!other.pages_.isEmpty()) { if (pages_.isEmpty()) { pages_ = other.pages_; - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensurePagesIsMutable(); pages_.addAll(other.pages_); @@ -34442,7 +35250,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document other) { pagesBuilder_.dispose(); pagesBuilder_ = null; pages_ = other.pages_; - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000002); pagesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getPagesFieldBuilder() @@ -34456,7 +35264,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document other) { if (!other.entities_.isEmpty()) { if (entities_.isEmpty()) { entities_ = other.entities_; - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000004); } else { ensureEntitiesIsMutable(); entities_.addAll(other.entities_); @@ -34469,7 +35277,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document other) { entitiesBuilder_.dispose(); entitiesBuilder_ = null; entities_ = other.entities_; - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000004); entitiesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getEntitiesFieldBuilder() @@ -34483,7 +35291,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document other) { if (!other.entityRelations_.isEmpty()) { if (entityRelations_.isEmpty()) { entityRelations_ = other.entityRelations_; - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000008); } else { ensureEntityRelationsIsMutable(); entityRelations_.addAll(other.entityRelations_); @@ -34496,7 +35304,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.Document other) { entityRelationsBuilder_.dispose(); entityRelationsBuilder_ = null; entityRelations_ = other.entityRelations_; - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000008); entityRelationsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getEntityRelationsFieldBuilder() @@ -34587,6 +35395,8 @@ public Builder clearSource() { * * * string uri = 1; + * + * @return The uri. */ public java.lang.String getUri() { java.lang.Object ref = ""; @@ -34616,6 +35426,8 @@ public java.lang.String getUri() { * * * string uri = 1; + * + * @return The bytes for uri. */ public com.google.protobuf.ByteString getUriBytes() { java.lang.Object ref = ""; @@ -34645,6 +35457,9 @@ public com.google.protobuf.ByteString getUriBytes() { * * * string uri = 1; + * + * @param value The uri to set. + * @return This builder for chaining. */ public Builder setUri(java.lang.String value) { if (value == null) { @@ -34667,6 +35482,8 @@ public Builder setUri(java.lang.String value) { * * * string uri = 1; + * + * @return This builder for chaining. */ public Builder clearUri() { if (sourceCase_ == 1) { @@ -34688,6 +35505,9 @@ public Builder clearUri() { * * * string uri = 1; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. */ public Builder setUriBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -34710,6 +35530,8 @@ public Builder setUriBytes(com.google.protobuf.ByteString value) { * * * bytes content = 2; + * + * @return The content. */ public com.google.protobuf.ByteString getContent() { if (sourceCase_ == 2) { @@ -34727,6 +35549,9 @@ public com.google.protobuf.ByteString getContent() { * * * bytes content = 2; + * + * @param value The content to set. + * @return This builder for chaining. */ public Builder setContent(com.google.protobuf.ByteString value) { if (value == null) { @@ -34747,6 +35572,8 @@ public Builder setContent(com.google.protobuf.ByteString value) { * * * bytes content = 2; + * + * @return This builder for chaining. */ public Builder clearContent() { if (sourceCase_ == 2) { @@ -34768,6 +35595,8 @@ public Builder clearContent() { * * * string mime_type = 3; + * + * @return The mimeType. */ public java.lang.String getMimeType() { java.lang.Object ref = mimeType_; @@ -34790,6 +35619,8 @@ public java.lang.String getMimeType() { * * * string mime_type = 3; + * + * @return The bytes for mimeType. */ public com.google.protobuf.ByteString getMimeTypeBytes() { java.lang.Object ref = mimeType_; @@ -34812,6 +35643,9 @@ public com.google.protobuf.ByteString getMimeTypeBytes() { * * * string mime_type = 3; + * + * @param value The mimeType to set. + * @return This builder for chaining. */ public Builder setMimeType(java.lang.String value) { if (value == null) { @@ -34832,6 +35666,8 @@ public Builder setMimeType(java.lang.String value) { * * * string mime_type = 3; + * + * @return This builder for chaining. */ public Builder clearMimeType() { @@ -34849,6 +35685,9 @@ public Builder clearMimeType() { * * * string mime_type = 3; + * + * @param value The bytes for mimeType to set. + * @return This builder for chaining. */ public Builder setMimeTypeBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -34870,6 +35709,8 @@ public Builder setMimeTypeBytes(com.google.protobuf.ByteString value) { * * * string text = 4; + * + * @return The text. */ public java.lang.String getText() { java.lang.Object ref = text_; @@ -34890,6 +35731,8 @@ public java.lang.String getText() { * * * string text = 4; + * + * @return The bytes for text. */ public com.google.protobuf.ByteString getTextBytes() { java.lang.Object ref = text_; @@ -34910,6 +35753,9 @@ public com.google.protobuf.ByteString getTextBytes() { * * * string text = 4; + * + * @param value The text to set. + * @return This builder for chaining. */ public Builder setText(java.lang.String value) { if (value == null) { @@ -34928,6 +35774,8 @@ public Builder setText(java.lang.String value) { * * * string text = 4; + * + * @return This builder for chaining. */ public Builder clearText() { @@ -34943,6 +35791,9 @@ public Builder clearText() { * * * string text = 4; + * + * @param value The bytes for text to set. + * @return This builder for chaining. */ public Builder setTextBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -34959,11 +35810,11 @@ public Builder setTextBytes(com.google.protobuf.ByteString value) { java.util.Collections.emptyList(); private void ensureTextStylesIsMutable() { - if (!((bitField0_ & 0x00000010) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { textStyles_ = new java.util.ArrayList( textStyles_); - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000001; } } @@ -35192,7 +36043,7 @@ public Builder addAllTextStyles( public Builder clearTextStyles() { if (textStylesBuilder_ == null) { textStyles_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { textStylesBuilder_.clear(); @@ -35325,7 +36176,7 @@ public com.google.cloud.documentai.v1beta1.Document.Style.Builder addTextStylesB com.google.cloud.documentai.v1beta1.Document.Style, com.google.cloud.documentai.v1beta1.Document.Style.Builder, com.google.cloud.documentai.v1beta1.Document.StyleOrBuilder>( - textStyles_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); + textStyles_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); textStyles_ = null; } return textStylesBuilder_; @@ -35335,9 +36186,9 @@ public com.google.cloud.documentai.v1beta1.Document.Style.Builder addTextStylesB java.util.Collections.emptyList(); private void ensurePagesIsMutable() { - if (!((bitField0_ & 0x00000020) != 0)) { + if (!((bitField0_ & 0x00000002) != 0)) { pages_ = new java.util.ArrayList(pages_); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000002; } } @@ -35564,7 +36415,7 @@ public Builder addAllPages( public Builder clearPages() { if (pagesBuilder_ == null) { pages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { pagesBuilder_.clear(); @@ -35694,7 +36545,7 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Builder addPagesBuilder com.google.cloud.documentai.v1beta1.Document.Page, com.google.cloud.documentai.v1beta1.Document.Page.Builder, com.google.cloud.documentai.v1beta1.Document.PageOrBuilder>( - pages_, ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); + pages_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); pages_ = null; } return pagesBuilder_; @@ -35704,10 +36555,10 @@ public com.google.cloud.documentai.v1beta1.Document.Page.Builder addPagesBuilder java.util.Collections.emptyList(); private void ensureEntitiesIsMutable() { - if (!((bitField0_ & 0x00000040) != 0)) { + if (!((bitField0_ & 0x00000004) != 0)) { entities_ = new java.util.ArrayList(entities_); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000004; } } @@ -35947,7 +36798,7 @@ public Builder addAllEntities( public Builder clearEntities() { if (entitiesBuilder_ == null) { entities_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); } else { entitiesBuilder_.clear(); @@ -36087,7 +36938,7 @@ public com.google.cloud.documentai.v1beta1.Document.Entity.Builder addEntitiesBu com.google.cloud.documentai.v1beta1.Document.Entity, com.google.cloud.documentai.v1beta1.Document.Entity.Builder, com.google.cloud.documentai.v1beta1.Document.EntityOrBuilder>( - entities_, ((bitField0_ & 0x00000040) != 0), getParentForChildren(), isClean()); + entities_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); entities_ = null; } return entitiesBuilder_; @@ -36097,11 +36948,11 @@ public com.google.cloud.documentai.v1beta1.Document.Entity.Builder addEntitiesBu entityRelations_ = java.util.Collections.emptyList(); private void ensureEntityRelationsIsMutable() { - if (!((bitField0_ & 0x00000080) != 0)) { + if (!((bitField0_ & 0x00000008) != 0)) { entityRelations_ = new java.util.ArrayList( entityRelations_); - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000008; } } @@ -36347,7 +37198,7 @@ public Builder addAllEntityRelations( public Builder clearEntityRelations() { if (entityRelationsBuilder_ == null) { entityRelations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); } else { entityRelationsBuilder_.clear(); @@ -36492,7 +37343,7 @@ public Builder removeEntityRelations(int index) { com.google.cloud.documentai.v1beta1.Document.EntityRelation.Builder, com.google.cloud.documentai.v1beta1.Document.EntityRelationOrBuilder>( entityRelations_, - ((bitField0_ & 0x00000080) != 0), + ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); entityRelations_ = null; @@ -36515,6 +37366,8 @@ public Builder removeEntityRelations(int index) { * * * .google.cloud.documentai.v1beta1.Document.ShardInfo shard_info = 9; + * + * @return Whether the shardInfo field is set. */ public boolean hasShardInfo() { return shardInfoBuilder_ != null || shardInfo_ != null; @@ -36528,6 +37381,8 @@ public boolean hasShardInfo() { * * * .google.cloud.documentai.v1beta1.Document.ShardInfo shard_info = 9; + * + * @return The shardInfo. */ public com.google.cloud.documentai.v1beta1.Document.ShardInfo getShardInfo() { if (shardInfoBuilder_ == null) { @@ -36703,6 +37558,8 @@ public com.google.cloud.documentai.v1beta1.Document.ShardInfoOrBuilder getShardI * * * .google.rpc.Status error = 10; + * + * @return Whether the error field is set. */ public boolean hasError() { return errorBuilder_ != null || error_ != null; @@ -36715,6 +37572,8 @@ public boolean hasError() { * * * .google.rpc.Status error = 10; + * + * @return The error. */ public com.google.rpc.Status getError() { if (errorBuilder_ == null) { diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentAiProto.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentAiProto.java similarity index 95% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentAiProto.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentAiProto.java index e6fde400..cd8450d1 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentAiProto.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentAiProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -174,25 +174,17 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "loud/documentai/v1beta1;documentaib\006prot" + "o3" }; - 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.api.ClientProto.getDescriptor(), - com.google.api.FieldBehaviorProto.getDescriptor(), - com.google.cloud.documentai.v1beta1.GeometryProto.getDescriptor(), - com.google.longrunning.OperationsProto.getDescriptor(), - com.google.protobuf.TimestampProto.getDescriptor(), - }, - assigner); + 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.cloud.documentai.v1beta1.GeometryProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); internal_static_google_cloud_documentai_v1beta1_BatchProcessDocumentsRequest_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_google_cloud_documentai_v1beta1_BatchProcessDocumentsRequest_fieldAccessorTable = diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentOrBuilder.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentOrBuilder.java similarity index 96% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentOrBuilder.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentOrBuilder.java index 919c67f6..1bbf6913 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentOrBuilder.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -35,6 +35,8 @@ public interface DocumentOrBuilder * * * string uri = 1; + * + * @return The uri. */ java.lang.String getUri(); /** @@ -49,6 +51,8 @@ public interface DocumentOrBuilder * * * string uri = 1; + * + * @return The bytes for uri. */ com.google.protobuf.ByteString getUriBytes(); @@ -62,6 +66,8 @@ public interface DocumentOrBuilder * * * bytes content = 2; + * + * @return The content. */ com.google.protobuf.ByteString getContent(); @@ -75,6 +81,8 @@ public interface DocumentOrBuilder * * * string mime_type = 3; + * + * @return The mimeType. */ java.lang.String getMimeType(); /** @@ -87,6 +95,8 @@ public interface DocumentOrBuilder * * * string mime_type = 3; + * + * @return The bytes for mimeType. */ com.google.protobuf.ByteString getMimeTypeBytes(); @@ -98,6 +108,8 @@ public interface DocumentOrBuilder * * * string text = 4; + * + * @return The text. */ java.lang.String getText(); /** @@ -108,6 +120,8 @@ public interface DocumentOrBuilder * * * string text = 4; + * + * @return The bytes for text. */ com.google.protobuf.ByteString getTextBytes(); @@ -360,6 +374,8 @@ com.google.cloud.documentai.v1beta1.Document.EntityRelationOrBuilder getEntityRe * * * .google.cloud.documentai.v1beta1.Document.ShardInfo shard_info = 9; + * + * @return Whether the shardInfo field is set. */ boolean hasShardInfo(); /** @@ -371,6 +387,8 @@ com.google.cloud.documentai.v1beta1.Document.EntityRelationOrBuilder getEntityRe * * * .google.cloud.documentai.v1beta1.Document.ShardInfo shard_info = 9; + * + * @return The shardInfo. */ com.google.cloud.documentai.v1beta1.Document.ShardInfo getShardInfo(); /** @@ -393,6 +411,8 @@ com.google.cloud.documentai.v1beta1.Document.EntityRelationOrBuilder getEntityRe * * * .google.rpc.Status error = 10; + * + * @return Whether the error field is set. */ boolean hasError(); /** @@ -403,6 +423,8 @@ com.google.cloud.documentai.v1beta1.Document.EntityRelationOrBuilder getEntityRe * * * .google.rpc.Status error = 10; + * + * @return The error. */ com.google.rpc.Status getError(); /** diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentProto.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentProto.java similarity index 97% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentProto.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentProto.java index 9cb75303..03b8b3c2 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentProto.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -253,23 +253,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "loud/documentai/v1beta1;documentaib\006prot" + "o3" }; - 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.cloud.documentai.v1beta1.GeometryProto.getDescriptor(), - com.google.rpc.StatusProto.getDescriptor(), - com.google.type.ColorProto.getDescriptor(), - }, - assigner); + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.documentai.v1beta1.GeometryProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + com.google.type.ColorProto.getDescriptor(), + }); internal_static_google_cloud_documentai_v1beta1_Document_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_google_cloud_documentai_v1beta1_Document_fieldAccessorTable = diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/EntityExtractionParams.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/EntityExtractionParams.java similarity index 96% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/EntityExtractionParams.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/EntityExtractionParams.java index bf0c2acd..4239a794 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/EntityExtractionParams.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/EntityExtractionParams.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -41,6 +41,12 @@ private EntityExtractionParams() { modelVersion_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EntityExtractionParams(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -54,7 +60,6 @@ private EntityExtractionParams( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -121,6 +126,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * bool enabled = 1; + * + * @return The enabled. */ public boolean getEnabled() { return enabled_; @@ -137,6 +144,8 @@ public boolean getEnabled() { * * * string model_version = 2; + * + * @return The modelVersion. */ public java.lang.String getModelVersion() { java.lang.Object ref = modelVersion_; @@ -158,6 +167,8 @@ public java.lang.String getModelVersion() { * * * string model_version = 2; + * + * @return The bytes for modelVersion. */ public com.google.protobuf.ByteString getModelVersionBytes() { java.lang.Object ref = modelVersion_; @@ -514,6 +525,8 @@ public Builder mergeFrom( * * * bool enabled = 1; + * + * @return The enabled. */ public boolean getEnabled() { return enabled_; @@ -526,6 +539,9 @@ public boolean getEnabled() { * * * bool enabled = 1; + * + * @param value The enabled to set. + * @return This builder for chaining. */ public Builder setEnabled(boolean value) { @@ -541,6 +557,8 @@ public Builder setEnabled(boolean value) { * * * bool enabled = 1; + * + * @return This builder for chaining. */ public Builder clearEnabled() { @@ -559,6 +577,8 @@ public Builder clearEnabled() { * * * string model_version = 2; + * + * @return The modelVersion. */ public java.lang.String getModelVersion() { java.lang.Object ref = modelVersion_; @@ -580,6 +600,8 @@ public java.lang.String getModelVersion() { * * * string model_version = 2; + * + * @return The bytes for modelVersion. */ public com.google.protobuf.ByteString getModelVersionBytes() { java.lang.Object ref = modelVersion_; @@ -601,6 +623,9 @@ public com.google.protobuf.ByteString getModelVersionBytes() { * * * string model_version = 2; + * + * @param value The modelVersion to set. + * @return This builder for chaining. */ public Builder setModelVersion(java.lang.String value) { if (value == null) { @@ -620,6 +645,8 @@ public Builder setModelVersion(java.lang.String value) { * * * string model_version = 2; + * + * @return This builder for chaining. */ public Builder clearModelVersion() { @@ -636,6 +663,9 @@ public Builder clearModelVersion() { * * * string model_version = 2; + * + * @param value The bytes for modelVersion to set. + * @return This builder for chaining. */ public Builder setModelVersionBytes(com.google.protobuf.ByteString value) { if (value == null) { diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/EntityExtractionParamsOrBuilder.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/EntityExtractionParamsOrBuilder.java similarity index 92% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/EntityExtractionParamsOrBuilder.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/EntityExtractionParamsOrBuilder.java index f5bd1a1a..ef4f2c33 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/EntityExtractionParamsOrBuilder.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/EntityExtractionParamsOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -31,6 +31,8 @@ public interface EntityExtractionParamsOrBuilder * * * bool enabled = 1; + * + * @return The enabled. */ boolean getEnabled(); @@ -43,6 +45,8 @@ public interface EntityExtractionParamsOrBuilder * * * string model_version = 2; + * + * @return The modelVersion. */ java.lang.String getModelVersion(); /** @@ -54,6 +58,8 @@ public interface EntityExtractionParamsOrBuilder * * * string model_version = 2; + * + * @return The bytes for modelVersion. */ com.google.protobuf.ByteString getModelVersionBytes(); } diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/FormExtractionParams.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/FormExtractionParams.java similarity index 97% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/FormExtractionParams.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/FormExtractionParams.java index 157002f4..d00a1c66 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/FormExtractionParams.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/FormExtractionParams.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -42,6 +42,12 @@ private FormExtractionParams() { modelVersion_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FormExtractionParams(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -73,10 +79,10 @@ private FormExtractionParams( } case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { keyValuePairHints_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; + mutable_bitField0_ |= 0x00000001; } keyValuePairHints_.add( input.readMessage( @@ -105,7 +111,7 @@ private FormExtractionParams( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { keyValuePairHints_ = java.util.Collections.unmodifiableList(keyValuePairHints_); } this.unknownFields = unknownFields.build(); @@ -128,7 +134,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.documentai.v1beta1.FormExtractionParams.Builder.class); } - private int bitField0_; public static final int ENABLED_FIELD_NUMBER = 1; private boolean enabled_; /** @@ -139,6 +144,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * bool enabled = 1; + * + * @return The enabled. */ public boolean getEnabled() { return enabled_; @@ -271,6 +278,8 @@ public com.google.cloud.documentai.v1beta1.KeyValuePairHint getKeyValuePairHints * * * string model_version = 3; + * + * @return The modelVersion. */ public java.lang.String getModelVersion() { java.lang.Object ref = modelVersion_; @@ -292,6 +301,8 @@ public java.lang.String getModelVersion() { * * * string model_version = 3; + * + * @return The bytes for modelVersion. */ public com.google.protobuf.ByteString getModelVersionBytes() { java.lang.Object ref = modelVersion_; @@ -537,7 +548,7 @@ public Builder clear() { if (keyValuePairHintsBuilder_ == null) { keyValuePairHints_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { keyValuePairHintsBuilder_.clear(); } @@ -571,19 +582,17 @@ public com.google.cloud.documentai.v1beta1.FormExtractionParams buildPartial() { com.google.cloud.documentai.v1beta1.FormExtractionParams result = new com.google.cloud.documentai.v1beta1.FormExtractionParams(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; result.enabled_ = enabled_; if (keyValuePairHintsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { keyValuePairHints_ = java.util.Collections.unmodifiableList(keyValuePairHints_); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } result.keyValuePairHints_ = keyValuePairHints_; } else { result.keyValuePairHints_ = keyValuePairHintsBuilder_.build(); } result.modelVersion_ = modelVersion_; - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -641,7 +650,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.FormExtractionParam if (!other.keyValuePairHints_.isEmpty()) { if (keyValuePairHints_.isEmpty()) { keyValuePairHints_ = other.keyValuePairHints_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureKeyValuePairHintsIsMutable(); keyValuePairHints_.addAll(other.keyValuePairHints_); @@ -654,7 +663,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.FormExtractionParam keyValuePairHintsBuilder_.dispose(); keyValuePairHintsBuilder_ = null; keyValuePairHints_ = other.keyValuePairHints_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); keyValuePairHintsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getKeyValuePairHintsFieldBuilder() @@ -709,6 +718,8 @@ public Builder mergeFrom( * * * bool enabled = 1; + * + * @return The enabled. */ public boolean getEnabled() { return enabled_; @@ -721,6 +732,9 @@ public boolean getEnabled() { * * * bool enabled = 1; + * + * @param value The enabled to set. + * @return This builder for chaining. */ public Builder setEnabled(boolean value) { @@ -736,6 +750,8 @@ public Builder setEnabled(boolean value) { * * * bool enabled = 1; + * + * @return This builder for chaining. */ public Builder clearEnabled() { @@ -748,11 +764,11 @@ public Builder clearEnabled() { keyValuePairHints_ = java.util.Collections.emptyList(); private void ensureKeyValuePairHintsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { keyValuePairHints_ = new java.util.ArrayList( keyValuePairHints_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000001; } } @@ -1082,7 +1098,7 @@ public Builder addAllKeyValuePairHints( public Builder clearKeyValuePairHints() { if (keyValuePairHintsBuilder_ == null) { keyValuePairHints_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { keyValuePairHintsBuilder_.clear(); @@ -1280,7 +1296,7 @@ public com.google.cloud.documentai.v1beta1.KeyValuePairHint.Builder addKeyValueP com.google.cloud.documentai.v1beta1.KeyValuePairHint.Builder, com.google.cloud.documentai.v1beta1.KeyValuePairHintOrBuilder>( keyValuePairHints_, - ((bitField0_ & 0x00000002) != 0), + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); keyValuePairHints_ = null; @@ -1298,6 +1314,8 @@ public com.google.cloud.documentai.v1beta1.KeyValuePairHint.Builder addKeyValueP * * * string model_version = 3; + * + * @return The modelVersion. */ public java.lang.String getModelVersion() { java.lang.Object ref = modelVersion_; @@ -1319,6 +1337,8 @@ public java.lang.String getModelVersion() { * * * string model_version = 3; + * + * @return The bytes for modelVersion. */ public com.google.protobuf.ByteString getModelVersionBytes() { java.lang.Object ref = modelVersion_; @@ -1340,6 +1360,9 @@ public com.google.protobuf.ByteString getModelVersionBytes() { * * * string model_version = 3; + * + * @param value The modelVersion to set. + * @return This builder for chaining. */ public Builder setModelVersion(java.lang.String value) { if (value == null) { @@ -1359,6 +1382,8 @@ public Builder setModelVersion(java.lang.String value) { * * * string model_version = 3; + * + * @return This builder for chaining. */ public Builder clearModelVersion() { @@ -1375,6 +1400,9 @@ public Builder clearModelVersion() { * * * string model_version = 3; + * + * @param value The bytes for modelVersion to set. + * @return This builder for chaining. */ public Builder setModelVersionBytes(com.google.protobuf.ByteString value) { if (value == null) { diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/FormExtractionParamsOrBuilder.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/FormExtractionParamsOrBuilder.java similarity index 97% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/FormExtractionParamsOrBuilder.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/FormExtractionParamsOrBuilder.java index 36ff4e7f..3b02c0a0 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/FormExtractionParamsOrBuilder.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/FormExtractionParamsOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -31,6 +31,8 @@ public interface FormExtractionParamsOrBuilder * * * bool enabled = 1; + * + * @return The enabled. */ boolean getEnabled(); @@ -146,6 +148,8 @@ com.google.cloud.documentai.v1beta1.KeyValuePairHintOrBuilder getKeyValuePairHin * * * string model_version = 3; + * + * @return The modelVersion. */ java.lang.String getModelVersion(); /** @@ -157,6 +161,8 @@ com.google.cloud.documentai.v1beta1.KeyValuePairHintOrBuilder getKeyValuePairHin * * * string model_version = 3; + * + * @return The bytes for modelVersion. */ com.google.protobuf.ByteString getModelVersionBytes(); } diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsDestination.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsDestination.java similarity index 93% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsDestination.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsDestination.java index ad5babec..827561a1 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsDestination.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsDestination.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -41,6 +41,12 @@ private GcsDestination() { uri_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GcsDestination(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -54,7 +60,6 @@ private GcsDestination( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -108,7 +113,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public static final int URI_FIELD_NUMBER = 1; private volatile java.lang.Object uri_; - /** string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ + /** + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ public java.lang.String getUri() { java.lang.Object ref = uri_; if (ref instanceof java.lang.String) { @@ -120,7 +129,11 @@ public java.lang.String getUri() { return s; } } - /** string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ + /** + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ public com.google.protobuf.ByteString getUriBytes() { java.lang.Object ref = uri_; if (ref instanceof java.lang.String) { @@ -452,7 +465,11 @@ public Builder mergeFrom( } private java.lang.Object uri_ = ""; - /** string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ + /** + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ public java.lang.String getUri() { java.lang.Object ref = uri_; if (!(ref instanceof java.lang.String)) { @@ -464,7 +481,11 @@ public java.lang.String getUri() { return (java.lang.String) ref; } } - /** string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ + /** + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ public com.google.protobuf.ByteString getUriBytes() { java.lang.Object ref = uri_; if (ref instanceof String) { @@ -476,7 +497,12 @@ public com.google.protobuf.ByteString getUriBytes() { return (com.google.protobuf.ByteString) ref; } } - /** string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ + /** + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The uri to set. + * @return This builder for chaining. + */ public Builder setUri(java.lang.String value) { if (value == null) { throw new NullPointerException(); @@ -486,14 +512,23 @@ public Builder setUri(java.lang.String value) { onChanged(); return this; } - /** string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ + /** + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ public Builder clearUri() { uri_ = getDefaultInstance().getUri(); onChanged(); return this; } - /** string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ + /** + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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(); diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsDestinationOrBuilder.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsDestinationOrBuilder.java similarity index 79% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsDestinationOrBuilder.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsDestinationOrBuilder.java index 524b786c..1f58b3ae 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsDestinationOrBuilder.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsDestinationOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -23,8 +23,16 @@ public interface GcsDestinationOrBuilder // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta1.GcsDestination) com.google.protobuf.MessageOrBuilder { - /** string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ + /** + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ java.lang.String getUri(); - /** string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ + /** + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ com.google.protobuf.ByteString getUriBytes(); } diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsSource.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsSource.java similarity index 93% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsSource.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsSource.java index d8fcc4d2..94ddc557 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsSource.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -41,6 +41,12 @@ private GcsSource() { uri_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GcsSource(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -54,7 +60,6 @@ private GcsSource( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -108,7 +113,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public static final int URI_FIELD_NUMBER = 1; private volatile java.lang.Object uri_; - /** string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ + /** + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ public java.lang.String getUri() { java.lang.Object ref = uri_; if (ref instanceof java.lang.String) { @@ -120,7 +129,11 @@ public java.lang.String getUri() { return s; } } - /** string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ + /** + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ public com.google.protobuf.ByteString getUriBytes() { java.lang.Object ref = uri_; if (ref instanceof java.lang.String) { @@ -450,7 +463,11 @@ public Builder mergeFrom( } private java.lang.Object uri_ = ""; - /** string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ + /** + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ public java.lang.String getUri() { java.lang.Object ref = uri_; if (!(ref instanceof java.lang.String)) { @@ -462,7 +479,11 @@ public java.lang.String getUri() { return (java.lang.String) ref; } } - /** string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ + /** + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ public com.google.protobuf.ByteString getUriBytes() { java.lang.Object ref = uri_; if (ref instanceof String) { @@ -474,7 +495,12 @@ public com.google.protobuf.ByteString getUriBytes() { return (com.google.protobuf.ByteString) ref; } } - /** string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ + /** + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The uri to set. + * @return This builder for chaining. + */ public Builder setUri(java.lang.String value) { if (value == null) { throw new NullPointerException(); @@ -484,14 +510,23 @@ public Builder setUri(java.lang.String value) { onChanged(); return this; } - /** string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ + /** + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ public Builder clearUri() { uri_ = getDefaultInstance().getUri(); onChanged(); return this; } - /** string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ + /** + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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(); diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsSourceOrBuilder.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsSourceOrBuilder.java similarity index 78% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsSourceOrBuilder.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsSourceOrBuilder.java index 6c9eb3d3..a488b810 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsSourceOrBuilder.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GcsSourceOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -23,8 +23,16 @@ public interface GcsSourceOrBuilder // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta1.GcsSource) com.google.protobuf.MessageOrBuilder { - /** string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ + /** + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ java.lang.String getUri(); - /** string uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ + /** + * string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ com.google.protobuf.ByteString getUriBytes(); } diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GeometryProto.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GeometryProto.java similarity index 86% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GeometryProto.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GeometryProto.java index c64a91ee..244ec174 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GeometryProto.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/GeometryProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -62,20 +62,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "oud/documentai/v1beta1;documentaib\006proto" + "3" }; - 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(), - }, - assigner); + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + }); internal_static_google_cloud_documentai_v1beta1_Vertex_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_google_cloud_documentai_v1beta1_Vertex_fieldAccessorTable = diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/InputConfig.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/InputConfig.java similarity index 96% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/InputConfig.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/InputConfig.java index 4844443c..86c3220d 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/InputConfig.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/InputConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -41,6 +41,12 @@ private InputConfig() { mimeType_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InputConfig(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -54,7 +60,6 @@ private InputConfig( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -125,7 +130,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { private int sourceCase_ = 0; private java.lang.Object source_; - public enum SourceCase implements com.google.protobuf.Internal.EnumLite { + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { GCS_SOURCE(1), SOURCE_NOT_SET(0); private final int value; @@ -133,7 +141,11 @@ public enum SourceCase implements com.google.protobuf.Internal.EnumLite { private SourceCase(int value) { this.value = value; } - /** @deprecated Use {@link #forNumber(int)} instead. */ + /** + * @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 SourceCase valueOf(int value) { return forNumber(value); @@ -169,6 +181,8 @@ public SourceCase getSourceCase() { * * * .google.cloud.documentai.v1beta1.GcsSource gcs_source = 1; + * + * @return Whether the gcsSource field is set. */ public boolean hasGcsSource() { return sourceCase_ == 1; @@ -182,6 +196,8 @@ public boolean hasGcsSource() { * * * .google.cloud.documentai.v1beta1.GcsSource gcs_source = 1; + * + * @return The gcsSource. */ public com.google.cloud.documentai.v1beta1.GcsSource getGcsSource() { if (sourceCase_ == 1) { @@ -217,6 +233,8 @@ public com.google.cloud.documentai.v1beta1.GcsSourceOrBuilder getGcsSourceOrBuil * * * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mimeType. */ public java.lang.String getMimeType() { java.lang.Object ref = mimeType_; @@ -238,6 +256,8 @@ public java.lang.String getMimeType() { * * * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for mimeType. */ public com.google.protobuf.ByteString getMimeTypeBytes() { java.lang.Object ref = mimeType_; @@ -641,6 +661,8 @@ public Builder clearSource() { * * * .google.cloud.documentai.v1beta1.GcsSource gcs_source = 1; + * + * @return Whether the gcsSource field is set. */ public boolean hasGcsSource() { return sourceCase_ == 1; @@ -654,6 +676,8 @@ public boolean hasGcsSource() { * * * .google.cloud.documentai.v1beta1.GcsSource gcs_source = 1; + * + * @return The gcsSource. */ public com.google.cloud.documentai.v1beta1.GcsSource getGcsSource() { if (gcsSourceBuilder_ == null) { @@ -848,6 +872,8 @@ public com.google.cloud.documentai.v1beta1.GcsSourceOrBuilder getGcsSourceOrBuil * * * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mimeType. */ public java.lang.String getMimeType() { java.lang.Object ref = mimeType_; @@ -869,6 +895,8 @@ public java.lang.String getMimeType() { * * * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for mimeType. */ public com.google.protobuf.ByteString getMimeTypeBytes() { java.lang.Object ref = mimeType_; @@ -890,6 +918,9 @@ public com.google.protobuf.ByteString getMimeTypeBytes() { * * * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The mimeType to set. + * @return This builder for chaining. */ public Builder setMimeType(java.lang.String value) { if (value == null) { @@ -909,6 +940,8 @@ public Builder setMimeType(java.lang.String value) { * * * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. */ public Builder clearMimeType() { @@ -925,6 +958,9 @@ public Builder clearMimeType() { * * * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for mimeType to set. + * @return This builder for chaining. */ public Builder setMimeTypeBytes(com.google.protobuf.ByteString value) { if (value == null) { diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/InputConfigOrBuilder.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/InputConfigOrBuilder.java similarity index 92% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/InputConfigOrBuilder.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/InputConfigOrBuilder.java index aaa15469..d67e0a74 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/InputConfigOrBuilder.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/InputConfigOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -32,6 +32,8 @@ public interface InputConfigOrBuilder * * * .google.cloud.documentai.v1beta1.GcsSource gcs_source = 1; + * + * @return Whether the gcsSource field is set. */ boolean hasGcsSource(); /** @@ -43,6 +45,8 @@ public interface InputConfigOrBuilder * * * .google.cloud.documentai.v1beta1.GcsSource gcs_source = 1; + * + * @return The gcsSource. */ com.google.cloud.documentai.v1beta1.GcsSource getGcsSource(); /** @@ -66,6 +70,8 @@ public interface InputConfigOrBuilder * * * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mimeType. */ java.lang.String getMimeType(); /** @@ -77,6 +83,8 @@ public interface InputConfigOrBuilder * * * string mime_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for mimeType. */ com.google.protobuf.ByteString getMimeTypeBytes(); diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/KeyValuePairHint.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/KeyValuePairHint.java similarity index 92% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/KeyValuePairHint.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/KeyValuePairHint.java index dfe47734..28e44acd 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/KeyValuePairHint.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/KeyValuePairHint.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -42,6 +42,12 @@ private KeyValuePairHint() { valueTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new KeyValuePairHint(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -76,9 +82,9 @@ private KeyValuePairHint( case 18: { java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { valueTypes_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; + mutable_bitField0_ |= 0x00000001; } valueTypes_.add(s); break; @@ -97,7 +103,7 @@ private KeyValuePairHint( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { valueTypes_ = valueTypes_.getUnmodifiableView(); } this.unknownFields = unknownFields.build(); @@ -120,7 +126,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.documentai.v1beta1.KeyValuePairHint.Builder.class); } - private int bitField0_; public static final int KEY_FIELD_NUMBER = 1; private volatile java.lang.Object key_; /** @@ -131,6 +136,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * string key = 1; + * + * @return The key. */ public java.lang.String getKey() { java.lang.Object ref = key_; @@ -151,6 +158,8 @@ public java.lang.String getKey() { * * * string key = 1; + * + * @return The bytes for key. */ public com.google.protobuf.ByteString getKeyBytes() { java.lang.Object ref = key_; @@ -177,6 +186,8 @@ public com.google.protobuf.ByteString getKeyBytes() { * * * repeated string value_types = 2; + * + * @return A list containing the valueTypes. */ public com.google.protobuf.ProtocolStringList getValueTypesList() { return valueTypes_; @@ -192,6 +203,8 @@ public com.google.protobuf.ProtocolStringList getValueTypesList() { * * * repeated string value_types = 2; + * + * @return The count of valueTypes. */ public int getValueTypesCount() { return valueTypes_.size(); @@ -207,6 +220,9 @@ public int getValueTypesCount() { * * * repeated string value_types = 2; + * + * @param index The index of the element to return. + * @return The valueTypes at the given index. */ public java.lang.String getValueTypes(int index) { return valueTypes_.get(index); @@ -222,6 +238,9 @@ public java.lang.String getValueTypes(int index) { * * * repeated string value_types = 2; + * + * @param index The index of the value to return. + * @return The bytes of the valueTypes at the given index. */ public com.google.protobuf.ByteString getValueTypesBytes(int index) { return valueTypes_.getByteString(index); @@ -450,7 +469,7 @@ public Builder clear() { key_ = ""; valueTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); return this; } @@ -479,14 +498,12 @@ public com.google.cloud.documentai.v1beta1.KeyValuePairHint buildPartial() { com.google.cloud.documentai.v1beta1.KeyValuePairHint result = new com.google.cloud.documentai.v1beta1.KeyValuePairHint(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; result.key_ = key_; - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { valueTypes_ = valueTypes_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } result.valueTypes_ = valueTypes_; - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -544,7 +561,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.KeyValuePairHint ot if (!other.valueTypes_.isEmpty()) { if (valueTypes_.isEmpty()) { valueTypes_ = other.valueTypes_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureValueTypesIsMutable(); valueTypes_.addAll(other.valueTypes_); @@ -592,6 +609,8 @@ public Builder mergeFrom( * * * string key = 1; + * + * @return The key. */ public java.lang.String getKey() { java.lang.Object ref = key_; @@ -612,6 +631,8 @@ public java.lang.String getKey() { * * * string key = 1; + * + * @return The bytes for key. */ public com.google.protobuf.ByteString getKeyBytes() { java.lang.Object ref = key_; @@ -632,6 +653,9 @@ public com.google.protobuf.ByteString getKeyBytes() { * * * string key = 1; + * + * @param value The key to set. + * @return This builder for chaining. */ public Builder setKey(java.lang.String value) { if (value == null) { @@ -650,6 +674,8 @@ public Builder setKey(java.lang.String value) { * * * string key = 1; + * + * @return This builder for chaining. */ public Builder clearKey() { @@ -665,6 +691,9 @@ public Builder clearKey() { * * * string key = 1; + * + * @param value The bytes for key to set. + * @return This builder for chaining. */ public Builder setKeyBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -681,9 +710,9 @@ public Builder setKeyBytes(com.google.protobuf.ByteString value) { com.google.protobuf.LazyStringArrayList.EMPTY; private void ensureValueTypesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { valueTypes_ = new com.google.protobuf.LazyStringArrayList(valueTypes_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000001; } } /** @@ -697,6 +726,8 @@ private void ensureValueTypesIsMutable() { * * * repeated string value_types = 2; + * + * @return A list containing the valueTypes. */ public com.google.protobuf.ProtocolStringList getValueTypesList() { return valueTypes_.getUnmodifiableView(); @@ -712,6 +743,8 @@ public com.google.protobuf.ProtocolStringList getValueTypesList() { * * * repeated string value_types = 2; + * + * @return The count of valueTypes. */ public int getValueTypesCount() { return valueTypes_.size(); @@ -727,6 +760,9 @@ public int getValueTypesCount() { * * * repeated string value_types = 2; + * + * @param index The index of the element to return. + * @return The valueTypes at the given index. */ public java.lang.String getValueTypes(int index) { return valueTypes_.get(index); @@ -742,6 +778,9 @@ public java.lang.String getValueTypes(int index) { * * * repeated string value_types = 2; + * + * @param index The index of the value to return. + * @return The bytes of the valueTypes at the given index. */ public com.google.protobuf.ByteString getValueTypesBytes(int index) { return valueTypes_.getByteString(index); @@ -757,6 +796,10 @@ public com.google.protobuf.ByteString getValueTypesBytes(int index) { * * * repeated string value_types = 2; + * + * @param index The index to set the value at. + * @param value The valueTypes to set. + * @return This builder for chaining. */ public Builder setValueTypes(int index, java.lang.String value) { if (value == null) { @@ -778,6 +821,9 @@ public Builder setValueTypes(int index, java.lang.String value) { * * * repeated string value_types = 2; + * + * @param value The valueTypes to add. + * @return This builder for chaining. */ public Builder addValueTypes(java.lang.String value) { if (value == null) { @@ -799,6 +845,9 @@ public Builder addValueTypes(java.lang.String value) { * * * repeated string value_types = 2; + * + * @param values The valueTypes to add. + * @return This builder for chaining. */ public Builder addAllValueTypes(java.lang.Iterable values) { ensureValueTypesIsMutable(); @@ -817,10 +866,12 @@ public Builder addAllValueTypes(java.lang.Iterable values) { * * * repeated string value_types = 2; + * + * @return This builder for chaining. */ public Builder clearValueTypes() { valueTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -835,6 +886,9 @@ public Builder clearValueTypes() { * * * repeated string value_types = 2; + * + * @param value The bytes of the valueTypes to add. + * @return This builder for chaining. */ public Builder addValueTypesBytes(com.google.protobuf.ByteString value) { if (value == null) { diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/KeyValuePairHintOrBuilder.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/KeyValuePairHintOrBuilder.java similarity index 86% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/KeyValuePairHintOrBuilder.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/KeyValuePairHintOrBuilder.java index c943e00d..bdc17e7d 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/KeyValuePairHintOrBuilder.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/KeyValuePairHintOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -31,6 +31,8 @@ public interface KeyValuePairHintOrBuilder * * * string key = 1; + * + * @return The key. */ java.lang.String getKey(); /** @@ -41,6 +43,8 @@ public interface KeyValuePairHintOrBuilder * * * string key = 1; + * + * @return The bytes for key. */ com.google.protobuf.ByteString getKeyBytes(); @@ -55,6 +59,8 @@ public interface KeyValuePairHintOrBuilder * * * repeated string value_types = 2; + * + * @return A list containing the valueTypes. */ java.util.List getValueTypesList(); /** @@ -68,6 +74,8 @@ public interface KeyValuePairHintOrBuilder * * * repeated string value_types = 2; + * + * @return The count of valueTypes. */ int getValueTypesCount(); /** @@ -81,6 +89,9 @@ public interface KeyValuePairHintOrBuilder * * * repeated string value_types = 2; + * + * @param index The index of the element to return. + * @return The valueTypes at the given index. */ java.lang.String getValueTypes(int index); /** @@ -94,6 +105,9 @@ public interface KeyValuePairHintOrBuilder * * * repeated string value_types = 2; + * + * @param index The index of the value to return. + * @return The bytes of the valueTypes at the given index. */ com.google.protobuf.ByteString getValueTypesBytes(int index); } diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/NormalizedVertex.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/NormalizedVertex.java similarity index 97% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/NormalizedVertex.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/NormalizedVertex.java index 2d18d33e..4bf9e541 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/NormalizedVertex.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/NormalizedVertex.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -41,6 +41,12 @@ private NormalizedVertex(com.google.protobuf.GeneratedMessageV3.Builder build private NormalizedVertex() {} + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NormalizedVertex(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -54,7 +60,6 @@ private NormalizedVertex( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -119,6 +124,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * float x = 1; + * + * @return The x. */ public float getX() { return x_; @@ -134,6 +141,8 @@ public float getX() { * * * float y = 2; + * + * @return The y. */ public float getY() { return y_; @@ -484,6 +493,8 @@ public Builder mergeFrom( * * * float x = 1; + * + * @return The x. */ public float getX() { return x_; @@ -496,6 +507,9 @@ public float getX() { * * * float x = 1; + * + * @param value The x to set. + * @return This builder for chaining. */ public Builder setX(float value) { @@ -511,6 +525,8 @@ public Builder setX(float value) { * * * float x = 1; + * + * @return This builder for chaining. */ public Builder clearX() { @@ -528,6 +544,8 @@ public Builder clearX() { * * * float y = 2; + * + * @return The y. */ public float getY() { return y_; @@ -540,6 +558,9 @@ public float getY() { * * * float y = 2; + * + * @param value The y to set. + * @return This builder for chaining. */ public Builder setY(float value) { @@ -555,6 +576,8 @@ public Builder setY(float value) { * * * float y = 2; + * + * @return This builder for chaining. */ public Builder clearY() { diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/NormalizedVertexOrBuilder.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/NormalizedVertexOrBuilder.java similarity index 93% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/NormalizedVertexOrBuilder.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/NormalizedVertexOrBuilder.java index 44a94852..36b0030b 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/NormalizedVertexOrBuilder.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/NormalizedVertexOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -31,6 +31,8 @@ public interface NormalizedVertexOrBuilder * * * float x = 1; + * + * @return The x. */ float getX(); @@ -42,6 +44,8 @@ public interface NormalizedVertexOrBuilder * * * float y = 2; + * + * @return The y. */ float getY(); } diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OcrParams.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OcrParams.java similarity index 95% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OcrParams.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OcrParams.java index 1fb2a012..4f7d6f45 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OcrParams.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OcrParams.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -41,6 +41,12 @@ private OcrParams() { languageHints_ = com.google.protobuf.LazyStringArrayList.EMPTY; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OcrParams(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -129,6 +135,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * repeated string language_hints = 1; + * + * @return A list containing the languageHints. */ public com.google.protobuf.ProtocolStringList getLanguageHintsList() { return languageHints_; @@ -148,6 +156,8 @@ public com.google.protobuf.ProtocolStringList getLanguageHintsList() { * * * repeated string language_hints = 1; + * + * @return The count of languageHints. */ public int getLanguageHintsCount() { return languageHints_.size(); @@ -167,6 +177,9 @@ public int getLanguageHintsCount() { * * * repeated string language_hints = 1; + * + * @param index The index of the element to return. + * @return The languageHints at the given index. */ public java.lang.String getLanguageHints(int index) { return languageHints_.get(index); @@ -186,6 +199,9 @@ public java.lang.String getLanguageHints(int index) { * * * repeated string language_hints = 1; + * + * @param index The index of the value to return. + * @return The bytes of the languageHints at the given index. */ public com.google.protobuf.ByteString getLanguageHintsBytes(int index) { return languageHints_.getByteString(index); @@ -551,6 +567,8 @@ private void ensureLanguageHintsIsMutable() { * * * repeated string language_hints = 1; + * + * @return A list containing the languageHints. */ public com.google.protobuf.ProtocolStringList getLanguageHintsList() { return languageHints_.getUnmodifiableView(); @@ -570,6 +588,8 @@ public com.google.protobuf.ProtocolStringList getLanguageHintsList() { * * * repeated string language_hints = 1; + * + * @return The count of languageHints. */ public int getLanguageHintsCount() { return languageHints_.size(); @@ -589,6 +609,9 @@ public int getLanguageHintsCount() { * * * repeated string language_hints = 1; + * + * @param index The index of the element to return. + * @return The languageHints at the given index. */ public java.lang.String getLanguageHints(int index) { return languageHints_.get(index); @@ -608,6 +631,9 @@ public java.lang.String getLanguageHints(int index) { * * * repeated string language_hints = 1; + * + * @param index The index of the value to return. + * @return The bytes of the languageHints at the given index. */ public com.google.protobuf.ByteString getLanguageHintsBytes(int index) { return languageHints_.getByteString(index); @@ -627,6 +653,10 @@ public com.google.protobuf.ByteString getLanguageHintsBytes(int index) { * * * repeated string language_hints = 1; + * + * @param index The index to set the value at. + * @param value The languageHints to set. + * @return This builder for chaining. */ public Builder setLanguageHints(int index, java.lang.String value) { if (value == null) { @@ -652,6 +682,9 @@ public Builder setLanguageHints(int index, java.lang.String value) { * * * repeated string language_hints = 1; + * + * @param value The languageHints to add. + * @return This builder for chaining. */ public Builder addLanguageHints(java.lang.String value) { if (value == null) { @@ -677,6 +710,9 @@ public Builder addLanguageHints(java.lang.String value) { * * * repeated string language_hints = 1; + * + * @param values The languageHints to add. + * @return This builder for chaining. */ public Builder addAllLanguageHints(java.lang.Iterable values) { ensureLanguageHintsIsMutable(); @@ -699,6 +735,8 @@ public Builder addAllLanguageHints(java.lang.Iterable values) * * * repeated string language_hints = 1; + * + * @return This builder for chaining. */ public Builder clearLanguageHints() { languageHints_ = com.google.protobuf.LazyStringArrayList.EMPTY; @@ -721,6 +759,9 @@ public Builder clearLanguageHints() { * * * repeated string language_hints = 1; + * + * @param value The bytes of the languageHints to add. + * @return This builder for chaining. */ public Builder addLanguageHintsBytes(com.google.protobuf.ByteString value) { if (value == null) { diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OcrParamsOrBuilder.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OcrParamsOrBuilder.java similarity index 91% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OcrParamsOrBuilder.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OcrParamsOrBuilder.java index 9211ea5f..41597f50 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OcrParamsOrBuilder.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OcrParamsOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -38,6 +38,8 @@ public interface OcrParamsOrBuilder * * * repeated string language_hints = 1; + * + * @return A list containing the languageHints. */ java.util.List getLanguageHintsList(); /** @@ -55,6 +57,8 @@ public interface OcrParamsOrBuilder * * * repeated string language_hints = 1; + * + * @return The count of languageHints. */ int getLanguageHintsCount(); /** @@ -72,6 +76,9 @@ public interface OcrParamsOrBuilder * * * repeated string language_hints = 1; + * + * @param index The index of the element to return. + * @return The languageHints at the given index. */ java.lang.String getLanguageHints(int index); /** @@ -89,6 +96,9 @@ public interface OcrParamsOrBuilder * * * repeated string language_hints = 1; + * + * @param index The index of the value to return. + * @return The bytes of the languageHints at the given index. */ com.google.protobuf.ByteString getLanguageHintsBytes(int index); } diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OperationMetadata.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OperationMetadata.java similarity index 95% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OperationMetadata.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OperationMetadata.java index b0325354..fd92f965 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OperationMetadata.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OperationMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -42,6 +42,12 @@ private OperationMetadata() { stateMessage_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -55,7 +61,6 @@ private OperationMetadata( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -298,12 +303,20 @@ public final int getNumber() { return value; } - /** @deprecated Use {@link #forNumber(int)} instead. */ + /** + * @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 State 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 State forNumber(int value) { switch (value) { case 0: @@ -381,6 +394,8 @@ private State(int value) { * * * .google.cloud.documentai.v1beta1.OperationMetadata.State state = 1; + * + * @return The enum numeric value on the wire for state. */ public int getStateValue() { return state_; @@ -393,6 +408,8 @@ public int getStateValue() { * * * .google.cloud.documentai.v1beta1.OperationMetadata.State state = 1; + * + * @return The state. */ public com.google.cloud.documentai.v1beta1.OperationMetadata.State getState() { @SuppressWarnings("deprecation") @@ -413,6 +430,8 @@ public com.google.cloud.documentai.v1beta1.OperationMetadata.State getState() { * * * string state_message = 2; + * + * @return The stateMessage. */ public java.lang.String getStateMessage() { java.lang.Object ref = stateMessage_; @@ -433,6 +452,8 @@ public java.lang.String getStateMessage() { * * * string state_message = 2; + * + * @return The bytes for stateMessage. */ public com.google.protobuf.ByteString getStateMessageBytes() { java.lang.Object ref = stateMessage_; @@ -456,6 +477,8 @@ public com.google.protobuf.ByteString getStateMessageBytes() { * * * .google.protobuf.Timestamp create_time = 3; + * + * @return Whether the createTime field is set. */ public boolean hasCreateTime() { return createTime_ != null; @@ -468,6 +491,8 @@ public boolean hasCreateTime() { * * * .google.protobuf.Timestamp create_time = 3; + * + * @return The createTime. */ public com.google.protobuf.Timestamp getCreateTime() { return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; @@ -495,6 +520,8 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * * * .google.protobuf.Timestamp update_time = 4; + * + * @return Whether the updateTime field is set. */ public boolean hasUpdateTime() { return updateTime_ != null; @@ -507,6 +534,8 @@ public boolean hasUpdateTime() { * * * .google.protobuf.Timestamp update_time = 4; + * + * @return The updateTime. */ public com.google.protobuf.Timestamp getUpdateTime() { return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; @@ -927,6 +956,8 @@ public Builder mergeFrom( * * * .google.cloud.documentai.v1beta1.OperationMetadata.State state = 1; + * + * @return The enum numeric value on the wire for state. */ public int getStateValue() { return state_; @@ -939,6 +970,9 @@ public int getStateValue() { * * * .google.cloud.documentai.v1beta1.OperationMetadata.State state = 1; + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. */ public Builder setStateValue(int value) { state_ = value; @@ -953,6 +987,8 @@ public Builder setStateValue(int value) { * * * .google.cloud.documentai.v1beta1.OperationMetadata.State state = 1; + * + * @return The state. */ public com.google.cloud.documentai.v1beta1.OperationMetadata.State getState() { @SuppressWarnings("deprecation") @@ -970,6 +1006,9 @@ public com.google.cloud.documentai.v1beta1.OperationMetadata.State getState() { * * * .google.cloud.documentai.v1beta1.OperationMetadata.State state = 1; + * + * @param value The state to set. + * @return This builder for chaining. */ public Builder setState(com.google.cloud.documentai.v1beta1.OperationMetadata.State value) { if (value == null) { @@ -988,6 +1027,8 @@ public Builder setState(com.google.cloud.documentai.v1beta1.OperationMetadata.St * * * .google.cloud.documentai.v1beta1.OperationMetadata.State state = 1; + * + * @return This builder for chaining. */ public Builder clearState() { @@ -1005,6 +1046,8 @@ public Builder clearState() { * * * string state_message = 2; + * + * @return The stateMessage. */ public java.lang.String getStateMessage() { java.lang.Object ref = stateMessage_; @@ -1025,6 +1068,8 @@ public java.lang.String getStateMessage() { * * * string state_message = 2; + * + * @return The bytes for stateMessage. */ public com.google.protobuf.ByteString getStateMessageBytes() { java.lang.Object ref = stateMessage_; @@ -1045,6 +1090,9 @@ public com.google.protobuf.ByteString getStateMessageBytes() { * * * string state_message = 2; + * + * @param value The stateMessage to set. + * @return This builder for chaining. */ public Builder setStateMessage(java.lang.String value) { if (value == null) { @@ -1063,6 +1111,8 @@ public Builder setStateMessage(java.lang.String value) { * * * string state_message = 2; + * + * @return This builder for chaining. */ public Builder clearStateMessage() { @@ -1078,6 +1128,9 @@ public Builder clearStateMessage() { * * * string state_message = 2; + * + * @param value The bytes for stateMessage to set. + * @return This builder for chaining. */ public Builder setStateMessageBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -1104,6 +1157,8 @@ public Builder setStateMessageBytes(com.google.protobuf.ByteString value) { * * * .google.protobuf.Timestamp create_time = 3; + * + * @return Whether the createTime field is set. */ public boolean hasCreateTime() { return createTimeBuilder_ != null || createTime_ != null; @@ -1116,6 +1171,8 @@ public boolean hasCreateTime() { * * * .google.protobuf.Timestamp create_time = 3; + * + * @return The createTime. */ public com.google.protobuf.Timestamp getCreateTime() { if (createTimeBuilder_ == null) { @@ -1283,6 +1340,8 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * * * .google.protobuf.Timestamp update_time = 4; + * + * @return Whether the updateTime field is set. */ public boolean hasUpdateTime() { return updateTimeBuilder_ != null || updateTime_ != null; @@ -1295,6 +1354,8 @@ public boolean hasUpdateTime() { * * * .google.protobuf.Timestamp update_time = 4; + * + * @return The updateTime. */ public com.google.protobuf.Timestamp getUpdateTime() { if (updateTimeBuilder_ == null) { diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OperationMetadataOrBuilder.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OperationMetadataOrBuilder.java similarity index 88% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OperationMetadataOrBuilder.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OperationMetadataOrBuilder.java index 0dc064a5..03519627 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OperationMetadataOrBuilder.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OperationMetadataOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -31,6 +31,8 @@ public interface OperationMetadataOrBuilder * * * .google.cloud.documentai.v1beta1.OperationMetadata.State state = 1; + * + * @return The enum numeric value on the wire for state. */ int getStateValue(); /** @@ -41,6 +43,8 @@ public interface OperationMetadataOrBuilder * * * .google.cloud.documentai.v1beta1.OperationMetadata.State state = 1; + * + * @return The state. */ com.google.cloud.documentai.v1beta1.OperationMetadata.State getState(); @@ -52,6 +56,8 @@ public interface OperationMetadataOrBuilder * * * string state_message = 2; + * + * @return The stateMessage. */ java.lang.String getStateMessage(); /** @@ -62,6 +68,8 @@ public interface OperationMetadataOrBuilder * * * string state_message = 2; + * + * @return The bytes for stateMessage. */ com.google.protobuf.ByteString getStateMessageBytes(); @@ -73,6 +81,8 @@ public interface OperationMetadataOrBuilder * * * .google.protobuf.Timestamp create_time = 3; + * + * @return Whether the createTime field is set. */ boolean hasCreateTime(); /** @@ -83,6 +93,8 @@ public interface OperationMetadataOrBuilder * * * .google.protobuf.Timestamp create_time = 3; + * + * @return The createTime. */ com.google.protobuf.Timestamp getCreateTime(); /** @@ -104,6 +116,8 @@ public interface OperationMetadataOrBuilder * * * .google.protobuf.Timestamp update_time = 4; + * + * @return Whether the updateTime field is set. */ boolean hasUpdateTime(); /** @@ -114,6 +128,8 @@ public interface OperationMetadataOrBuilder * * * .google.protobuf.Timestamp update_time = 4; + * + * @return The updateTime. */ com.google.protobuf.Timestamp getUpdateTime(); /** diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OutputConfig.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OutputConfig.java similarity index 97% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OutputConfig.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OutputConfig.java index 9110dc2a..b920bef8 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OutputConfig.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OutputConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -39,6 +39,12 @@ private OutputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) private OutputConfig() {} + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OutputConfig(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -52,7 +58,6 @@ private OutputConfig( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -124,7 +129,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { private int destinationCase_ = 0; private java.lang.Object destination_; - public enum DestinationCase implements com.google.protobuf.Internal.EnumLite { + public enum DestinationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { GCS_DESTINATION(1), DESTINATION_NOT_SET(0); private final int value; @@ -132,7 +140,11 @@ public enum DestinationCase implements com.google.protobuf.Internal.EnumLite { private DestinationCase(int value) { this.value = value; } - /** @deprecated Use {@link #forNumber(int)} instead. */ + /** + * @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 DestinationCase valueOf(int value) { return forNumber(value); @@ -167,6 +179,8 @@ public DestinationCase getDestinationCase() { * * * .google.cloud.documentai.v1beta1.GcsDestination gcs_destination = 1; + * + * @return Whether the gcsDestination field is set. */ public boolean hasGcsDestination() { return destinationCase_ == 1; @@ -179,6 +193,8 @@ public boolean hasGcsDestination() { * * * .google.cloud.documentai.v1beta1.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. */ public com.google.cloud.documentai.v1beta1.GcsDestination getGcsDestination() { if (destinationCase_ == 1) { @@ -224,6 +240,8 @@ public com.google.cloud.documentai.v1beta1.GcsDestinationOrBuilder getGcsDestina * * * int32 pages_per_shard = 2; + * + * @return The pagesPerShard. */ public int getPagesPerShard() { return pagesPerShard_; @@ -617,6 +635,8 @@ public Builder clearDestination() { * * * .google.cloud.documentai.v1beta1.GcsDestination gcs_destination = 1; + * + * @return Whether the gcsDestination field is set. */ public boolean hasGcsDestination() { return destinationCase_ == 1; @@ -629,6 +649,8 @@ public boolean hasGcsDestination() { * * * .google.cloud.documentai.v1beta1.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. */ public com.google.cloud.documentai.v1beta1.GcsDestination getGcsDestination() { if (gcsDestinationBuilder_ == null) { @@ -829,6 +851,8 @@ public com.google.cloud.documentai.v1beta1.GcsDestination.Builder getGcsDestinat * * * int32 pages_per_shard = 2; + * + * @return The pagesPerShard. */ public int getPagesPerShard() { return pagesPerShard_; @@ -853,6 +877,9 @@ public int getPagesPerShard() { * * * int32 pages_per_shard = 2; + * + * @param value The pagesPerShard to set. + * @return This builder for chaining. */ public Builder setPagesPerShard(int value) { @@ -880,6 +907,8 @@ public Builder setPagesPerShard(int value) { * * * int32 pages_per_shard = 2; + * + * @return This builder for chaining. */ public Builder clearPagesPerShard() { diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OutputConfigOrBuilder.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OutputConfigOrBuilder.java similarity index 94% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OutputConfigOrBuilder.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OutputConfigOrBuilder.java index a61ddd02..c858c0ca 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OutputConfigOrBuilder.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/OutputConfigOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -31,6 +31,8 @@ public interface OutputConfigOrBuilder * * * .google.cloud.documentai.v1beta1.GcsDestination gcs_destination = 1; + * + * @return Whether the gcsDestination field is set. */ boolean hasGcsDestination(); /** @@ -41,6 +43,8 @@ public interface OutputConfigOrBuilder * * * .google.cloud.documentai.v1beta1.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. */ com.google.cloud.documentai.v1beta1.GcsDestination getGcsDestination(); /** @@ -74,6 +78,8 @@ public interface OutputConfigOrBuilder * * * int32 pages_per_shard = 2; + * + * @return The pagesPerShard. */ int getPagesPerShard(); diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentRequest.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentRequest.java similarity index 97% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentRequest.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentRequest.java index 7b58e77d..3807e53a 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentRequest.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -41,6 +41,12 @@ private ProcessDocumentRequest() { documentType_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProcessDocumentRequest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -54,7 +60,6 @@ private ProcessDocumentRequest( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -217,6 +222,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * .google.cloud.documentai.v1beta1.InputConfig input_config = 1 [(.google.api.field_behavior) = REQUIRED]; * + * + * @return Whether the inputConfig field is set. */ public boolean hasInputConfig() { return inputConfig_ != null; @@ -231,6 +238,8 @@ public boolean hasInputConfig() { * * .google.cloud.documentai.v1beta1.InputConfig input_config = 1 [(.google.api.field_behavior) = REQUIRED]; * + * + * @return The inputConfig. */ public com.google.cloud.documentai.v1beta1.InputConfig getInputConfig() { return inputConfig_ == null @@ -264,6 +273,8 @@ public com.google.cloud.documentai.v1beta1.InputConfigOrBuilder getInputConfigOr * * .google.cloud.documentai.v1beta1.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; * + * + * @return Whether the outputConfig field is set. */ public boolean hasOutputConfig() { return outputConfig_ != null; @@ -278,6 +289,8 @@ public boolean hasOutputConfig() { * * .google.cloud.documentai.v1beta1.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; * + * + * @return The outputConfig. */ public com.google.cloud.documentai.v1beta1.OutputConfig getOutputConfig() { return outputConfig_ == null @@ -311,6 +324,8 @@ public com.google.cloud.documentai.v1beta1.OutputConfigOrBuilder getOutputConfig * * * string document_type = 3; + * + * @return The documentType. */ public java.lang.String getDocumentType() { java.lang.Object ref = documentType_; @@ -333,6 +348,8 @@ public java.lang.String getDocumentType() { * * * string document_type = 3; + * + * @return The bytes for documentType. */ public com.google.protobuf.ByteString getDocumentTypeBytes() { java.lang.Object ref = documentType_; @@ -358,6 +375,8 @@ public com.google.protobuf.ByteString getDocumentTypeBytes() { * * .google.cloud.documentai.v1beta1.TableExtractionParams table_extraction_params = 4; * + * + * @return Whether the tableExtractionParams field is set. */ public boolean hasTableExtractionParams() { return tableExtractionParams_ != null; @@ -372,6 +391,8 @@ public boolean hasTableExtractionParams() { * * .google.cloud.documentai.v1beta1.TableExtractionParams table_extraction_params = 4; * + * + * @return The tableExtractionParams. */ public com.google.cloud.documentai.v1beta1.TableExtractionParams getTableExtractionParams() { return tableExtractionParams_ == null @@ -405,6 +426,8 @@ public com.google.cloud.documentai.v1beta1.TableExtractionParams getTableExtract * * * .google.cloud.documentai.v1beta1.FormExtractionParams form_extraction_params = 5; + * + * @return Whether the formExtractionParams field is set. */ public boolean hasFormExtractionParams() { return formExtractionParams_ != null; @@ -418,6 +441,8 @@ public boolean hasFormExtractionParams() { * * * .google.cloud.documentai.v1beta1.FormExtractionParams form_extraction_params = 5; + * + * @return The formExtractionParams. */ public com.google.cloud.documentai.v1beta1.FormExtractionParams getFormExtractionParams() { return formExtractionParams_ == null @@ -451,6 +476,8 @@ public com.google.cloud.documentai.v1beta1.FormExtractionParams getFormExtractio * * .google.cloud.documentai.v1beta1.EntityExtractionParams entity_extraction_params = 6; * + * + * @return Whether the entityExtractionParams field is set. */ public boolean hasEntityExtractionParams() { return entityExtractionParams_ != null; @@ -465,6 +492,8 @@ public boolean hasEntityExtractionParams() { * * .google.cloud.documentai.v1beta1.EntityExtractionParams entity_extraction_params = 6; * + * + * @return The entityExtractionParams. */ public com.google.cloud.documentai.v1beta1.EntityExtractionParams getEntityExtractionParams() { return entityExtractionParams_ == null @@ -498,6 +527,8 @@ public com.google.cloud.documentai.v1beta1.EntityExtractionParams getEntityExtra * * * .google.cloud.documentai.v1beta1.OcrParams ocr_params = 7; + * + * @return Whether the ocrParams field is set. */ public boolean hasOcrParams() { return ocrParams_ != null; @@ -511,6 +542,8 @@ public boolean hasOcrParams() { * * * .google.cloud.documentai.v1beta1.OcrParams ocr_params = 7; + * + * @return The ocrParams. */ public com.google.cloud.documentai.v1beta1.OcrParams getOcrParams() { return ocrParams_ == null @@ -1037,6 +1070,8 @@ public Builder mergeFrom( * * .google.cloud.documentai.v1beta1.InputConfig input_config = 1 [(.google.api.field_behavior) = REQUIRED]; * + * + * @return Whether the inputConfig field is set. */ public boolean hasInputConfig() { return inputConfigBuilder_ != null || inputConfig_ != null; @@ -1051,6 +1086,8 @@ public boolean hasInputConfig() { * * .google.cloud.documentai.v1beta1.InputConfig input_config = 1 [(.google.api.field_behavior) = REQUIRED]; * + * + * @return The inputConfig. */ public com.google.cloud.documentai.v1beta1.InputConfig getInputConfig() { if (inputConfigBuilder_ == null) { @@ -1237,6 +1274,8 @@ public com.google.cloud.documentai.v1beta1.InputConfigOrBuilder getInputConfigOr * * .google.cloud.documentai.v1beta1.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; * + * + * @return Whether the outputConfig field is set. */ public boolean hasOutputConfig() { return outputConfigBuilder_ != null || outputConfig_ != null; @@ -1251,6 +1290,8 @@ public boolean hasOutputConfig() { * * .google.cloud.documentai.v1beta1.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; * + * + * @return The outputConfig. */ public com.google.cloud.documentai.v1beta1.OutputConfig getOutputConfig() { if (outputConfigBuilder_ == null) { @@ -1432,6 +1473,8 @@ public com.google.cloud.documentai.v1beta1.OutputConfigOrBuilder getOutputConfig * * * string document_type = 3; + * + * @return The documentType. */ public java.lang.String getDocumentType() { java.lang.Object ref = documentType_; @@ -1454,6 +1497,8 @@ public java.lang.String getDocumentType() { * * * string document_type = 3; + * + * @return The bytes for documentType. */ public com.google.protobuf.ByteString getDocumentTypeBytes() { java.lang.Object ref = documentType_; @@ -1476,6 +1521,9 @@ public com.google.protobuf.ByteString getDocumentTypeBytes() { * * * string document_type = 3; + * + * @param value The documentType to set. + * @return This builder for chaining. */ public Builder setDocumentType(java.lang.String value) { if (value == null) { @@ -1496,6 +1544,8 @@ public Builder setDocumentType(java.lang.String value) { * * * string document_type = 3; + * + * @return This builder for chaining. */ public Builder clearDocumentType() { @@ -1513,6 +1563,9 @@ public Builder clearDocumentType() { * * * string document_type = 3; + * + * @param value The bytes for documentType to set. + * @return This builder for chaining. */ public Builder setDocumentTypeBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -1541,6 +1594,8 @@ public Builder setDocumentTypeBytes(com.google.protobuf.ByteString value) { * * .google.cloud.documentai.v1beta1.TableExtractionParams table_extraction_params = 4; * + * + * @return Whether the tableExtractionParams field is set. */ public boolean hasTableExtractionParams() { return tableExtractionParamsBuilder_ != null || tableExtractionParams_ != null; @@ -1555,6 +1610,8 @@ public boolean hasTableExtractionParams() { * * .google.cloud.documentai.v1beta1.TableExtractionParams table_extraction_params = 4; * + * + * @return The tableExtractionParams. */ public com.google.cloud.documentai.v1beta1.TableExtractionParams getTableExtractionParams() { if (tableExtractionParamsBuilder_ == null) { @@ -1746,6 +1803,8 @@ public Builder clearTableExtractionParams() { * * .google.cloud.documentai.v1beta1.FormExtractionParams form_extraction_params = 5; * + * + * @return Whether the formExtractionParams field is set. */ public boolean hasFormExtractionParams() { return formExtractionParamsBuilder_ != null || formExtractionParams_ != null; @@ -1760,6 +1819,8 @@ public boolean hasFormExtractionParams() { * * .google.cloud.documentai.v1beta1.FormExtractionParams form_extraction_params = 5; * + * + * @return The formExtractionParams. */ public com.google.cloud.documentai.v1beta1.FormExtractionParams getFormExtractionParams() { if (formExtractionParamsBuilder_ == null) { @@ -1951,6 +2012,8 @@ public Builder clearFormExtractionParams() { * * .google.cloud.documentai.v1beta1.EntityExtractionParams entity_extraction_params = 6; * + * + * @return Whether the entityExtractionParams field is set. */ public boolean hasEntityExtractionParams() { return entityExtractionParamsBuilder_ != null || entityExtractionParams_ != null; @@ -1965,6 +2028,8 @@ public boolean hasEntityExtractionParams() { * * .google.cloud.documentai.v1beta1.EntityExtractionParams entity_extraction_params = 6; * + * + * @return The entityExtractionParams. */ public com.google.cloud.documentai.v1beta1.EntityExtractionParams getEntityExtractionParams() { if (entityExtractionParamsBuilder_ == null) { @@ -2155,6 +2220,8 @@ public Builder clearEntityExtractionParams() { * * * .google.cloud.documentai.v1beta1.OcrParams ocr_params = 7; + * + * @return Whether the ocrParams field is set. */ public boolean hasOcrParams() { return ocrParamsBuilder_ != null || ocrParams_ != null; @@ -2168,6 +2235,8 @@ public boolean hasOcrParams() { * * * .google.cloud.documentai.v1beta1.OcrParams ocr_params = 7; + * + * @return The ocrParams. */ public com.google.cloud.documentai.v1beta1.OcrParams getOcrParams() { if (ocrParamsBuilder_ == null) { diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentRequestOrBuilder.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentRequestOrBuilder.java similarity index 91% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentRequestOrBuilder.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentRequestOrBuilder.java index e4a765e6..9944a007 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentRequestOrBuilder.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -33,6 +33,8 @@ public interface ProcessDocumentRequestOrBuilder * * .google.cloud.documentai.v1beta1.InputConfig input_config = 1 [(.google.api.field_behavior) = REQUIRED]; * + * + * @return Whether the inputConfig field is set. */ boolean hasInputConfig(); /** @@ -45,6 +47,8 @@ public interface ProcessDocumentRequestOrBuilder * * .google.cloud.documentai.v1beta1.InputConfig input_config = 1 [(.google.api.field_behavior) = REQUIRED]; * + * + * @return The inputConfig. */ com.google.cloud.documentai.v1beta1.InputConfig getInputConfig(); /** @@ -70,6 +74,8 @@ public interface ProcessDocumentRequestOrBuilder * * .google.cloud.documentai.v1beta1.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; * + * + * @return Whether the outputConfig field is set. */ boolean hasOutputConfig(); /** @@ -82,6 +88,8 @@ public interface ProcessDocumentRequestOrBuilder * * .google.cloud.documentai.v1beta1.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; * + * + * @return The outputConfig. */ com.google.cloud.documentai.v1beta1.OutputConfig getOutputConfig(); /** @@ -107,6 +115,8 @@ public interface ProcessDocumentRequestOrBuilder * * * string document_type = 3; + * + * @return The documentType. */ java.lang.String getDocumentType(); /** @@ -119,6 +129,8 @@ public interface ProcessDocumentRequestOrBuilder * * * string document_type = 3; + * + * @return The bytes for documentType. */ com.google.protobuf.ByteString getDocumentTypeBytes(); @@ -132,6 +144,8 @@ public interface ProcessDocumentRequestOrBuilder * * .google.cloud.documentai.v1beta1.TableExtractionParams table_extraction_params = 4; * + * + * @return Whether the tableExtractionParams field is set. */ boolean hasTableExtractionParams(); /** @@ -144,6 +158,8 @@ public interface ProcessDocumentRequestOrBuilder * * .google.cloud.documentai.v1beta1.TableExtractionParams table_extraction_params = 4; * + * + * @return The tableExtractionParams. */ com.google.cloud.documentai.v1beta1.TableExtractionParams getTableExtractionParams(); /** @@ -169,6 +185,8 @@ public interface ProcessDocumentRequestOrBuilder * * * .google.cloud.documentai.v1beta1.FormExtractionParams form_extraction_params = 5; + * + * @return Whether the formExtractionParams field is set. */ boolean hasFormExtractionParams(); /** @@ -180,6 +198,8 @@ public interface ProcessDocumentRequestOrBuilder * * * .google.cloud.documentai.v1beta1.FormExtractionParams form_extraction_params = 5; + * + * @return The formExtractionParams. */ com.google.cloud.documentai.v1beta1.FormExtractionParams getFormExtractionParams(); /** @@ -205,6 +225,8 @@ public interface ProcessDocumentRequestOrBuilder * * .google.cloud.documentai.v1beta1.EntityExtractionParams entity_extraction_params = 6; * + * + * @return Whether the entityExtractionParams field is set. */ boolean hasEntityExtractionParams(); /** @@ -217,6 +239,8 @@ public interface ProcessDocumentRequestOrBuilder * * .google.cloud.documentai.v1beta1.EntityExtractionParams entity_extraction_params = 6; * + * + * @return The entityExtractionParams. */ com.google.cloud.documentai.v1beta1.EntityExtractionParams getEntityExtractionParams(); /** @@ -242,6 +266,8 @@ public interface ProcessDocumentRequestOrBuilder * * * .google.cloud.documentai.v1beta1.OcrParams ocr_params = 7; + * + * @return Whether the ocrParams field is set. */ boolean hasOcrParams(); /** @@ -253,6 +279,8 @@ public interface ProcessDocumentRequestOrBuilder * * * .google.cloud.documentai.v1beta1.OcrParams ocr_params = 7; + * + * @return The ocrParams. */ com.google.cloud.documentai.v1beta1.OcrParams getOcrParams(); /** diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentResponse.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentResponse.java similarity index 98% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentResponse.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentResponse.java index d7a03d70..ffd4a850 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentResponse.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -39,6 +39,12 @@ private ProcessDocumentResponse(com.google.protobuf.GeneratedMessageV3.Builder * * .google.cloud.documentai.v1beta1.InputConfig input_config = 1; + * + * @return Whether the inputConfig field is set. */ public boolean hasInputConfig() { return inputConfig_ != null; @@ -153,6 +160,8 @@ public boolean hasInputConfig() { * * * .google.cloud.documentai.v1beta1.InputConfig input_config = 1; + * + * @return The inputConfig. */ public com.google.cloud.documentai.v1beta1.InputConfig getInputConfig() { return inputConfig_ == null @@ -184,6 +193,8 @@ public com.google.cloud.documentai.v1beta1.InputConfigOrBuilder getInputConfigOr * * * .google.cloud.documentai.v1beta1.OutputConfig output_config = 2; + * + * @return Whether the outputConfig field is set. */ public boolean hasOutputConfig() { return outputConfig_ != null; @@ -197,6 +208,8 @@ public boolean hasOutputConfig() { * * * .google.cloud.documentai.v1beta1.OutputConfig output_config = 2; + * + * @return The outputConfig. */ public com.google.cloud.documentai.v1beta1.OutputConfig getOutputConfig() { return outputConfig_ == null @@ -591,6 +604,8 @@ public Builder mergeFrom( * * * .google.cloud.documentai.v1beta1.InputConfig input_config = 1; + * + * @return Whether the inputConfig field is set. */ public boolean hasInputConfig() { return inputConfigBuilder_ != null || inputConfig_ != null; @@ -604,6 +619,8 @@ public boolean hasInputConfig() { * * * .google.cloud.documentai.v1beta1.InputConfig input_config = 1; + * + * @return The inputConfig. */ public com.google.cloud.documentai.v1beta1.InputConfig getInputConfig() { if (inputConfigBuilder_ == null) { @@ -782,6 +799,8 @@ public com.google.cloud.documentai.v1beta1.InputConfigOrBuilder getInputConfigOr * * * .google.cloud.documentai.v1beta1.OutputConfig output_config = 2; + * + * @return Whether the outputConfig field is set. */ public boolean hasOutputConfig() { return outputConfigBuilder_ != null || outputConfig_ != null; @@ -795,6 +814,8 @@ public boolean hasOutputConfig() { * * * .google.cloud.documentai.v1beta1.OutputConfig output_config = 2; + * + * @return The outputConfig. */ public com.google.cloud.documentai.v1beta1.OutputConfig getOutputConfig() { if (outputConfigBuilder_ == null) { diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentResponseOrBuilder.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentResponseOrBuilder.java similarity index 93% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentResponseOrBuilder.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentResponseOrBuilder.java index 26e49c53..2350202c 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentResponseOrBuilder.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/ProcessDocumentResponseOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -32,6 +32,8 @@ public interface ProcessDocumentResponseOrBuilder * * * .google.cloud.documentai.v1beta1.InputConfig input_config = 1; + * + * @return Whether the inputConfig field is set. */ boolean hasInputConfig(); /** @@ -43,6 +45,8 @@ public interface ProcessDocumentResponseOrBuilder * * * .google.cloud.documentai.v1beta1.InputConfig input_config = 1; + * + * @return The inputConfig. */ com.google.cloud.documentai.v1beta1.InputConfig getInputConfig(); /** @@ -66,6 +70,8 @@ public interface ProcessDocumentResponseOrBuilder * * * .google.cloud.documentai.v1beta1.OutputConfig output_config = 2; + * + * @return Whether the outputConfig field is set. */ boolean hasOutputConfig(); /** @@ -77,6 +83,8 @@ public interface ProcessDocumentResponseOrBuilder * * * .google.cloud.documentai.v1beta1.OutputConfig output_config = 2; + * + * @return The outputConfig. */ com.google.cloud.documentai.v1beta1.OutputConfig getOutputConfig(); /** diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableBoundHint.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableBoundHint.java similarity index 97% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableBoundHint.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableBoundHint.java index 85ab7588..df140052 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableBoundHint.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableBoundHint.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -39,6 +39,12 @@ private TableBoundHint(com.google.protobuf.GeneratedMessageV3.Builder builder private TableBoundHint() {} + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TableBoundHint(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -52,7 +58,6 @@ private TableBoundHint( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -130,6 +135,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * int32 page_number = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageNumber. */ public int getPageNumber() { return pageNumber_; @@ -146,6 +153,8 @@ public int getPageNumber() { * * * .google.cloud.documentai.v1beta1.BoundingPoly bounding_box = 2; + * + * @return Whether the boundingBox field is set. */ public boolean hasBoundingBox() { return boundingBox_ != null; @@ -159,6 +168,8 @@ public boolean hasBoundingBox() { * * * .google.cloud.documentai.v1beta1.BoundingPoly bounding_box = 2; + * + * @return The boundingBox. */ public com.google.cloud.documentai.v1beta1.BoundingPoly getBoundingBox() { return boundingBox_ == null @@ -535,6 +546,8 @@ public Builder mergeFrom( * * * int32 page_number = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageNumber. */ public int getPageNumber() { return pageNumber_; @@ -549,6 +562,9 @@ public int getPageNumber() { * * * int32 page_number = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageNumber to set. + * @return This builder for chaining. */ public Builder setPageNumber(int value) { @@ -566,6 +582,8 @@ public Builder setPageNumber(int value) { * * * int32 page_number = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. */ public Builder clearPageNumber() { @@ -589,6 +607,8 @@ public Builder clearPageNumber() { * * * .google.cloud.documentai.v1beta1.BoundingPoly bounding_box = 2; + * + * @return Whether the boundingBox field is set. */ public boolean hasBoundingBox() { return boundingBoxBuilder_ != null || boundingBox_ != null; @@ -602,6 +622,8 @@ public boolean hasBoundingBox() { * * * .google.cloud.documentai.v1beta1.BoundingPoly bounding_box = 2; + * + * @return The boundingBox. */ public com.google.cloud.documentai.v1beta1.BoundingPoly getBoundingBox() { if (boundingBoxBuilder_ == null) { diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableBoundHintOrBuilder.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableBoundHintOrBuilder.java similarity index 93% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableBoundHintOrBuilder.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableBoundHintOrBuilder.java index a9cc86ce..ff466178 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableBoundHintOrBuilder.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableBoundHintOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -33,6 +33,8 @@ public interface TableBoundHintOrBuilder * * * int32 page_number = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageNumber. */ int getPageNumber(); @@ -45,6 +47,8 @@ public interface TableBoundHintOrBuilder * * * .google.cloud.documentai.v1beta1.BoundingPoly bounding_box = 2; + * + * @return Whether the boundingBox field is set. */ boolean hasBoundingBox(); /** @@ -56,6 +60,8 @@ public interface TableBoundHintOrBuilder * * * .google.cloud.documentai.v1beta1.BoundingPoly bounding_box = 2; + * + * @return The boundingBox. */ com.google.cloud.documentai.v1beta1.BoundingPoly getBoundingBox(); /** diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableExtractionParams.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableExtractionParams.java similarity index 94% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableExtractionParams.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableExtractionParams.java index 6b2ee96f..8ed57193 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableExtractionParams.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableExtractionParams.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -43,6 +43,12 @@ private TableExtractionParams() { modelVersion_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TableExtractionParams(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -74,10 +80,10 @@ private TableExtractionParams( } case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { tableBoundHints_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; + mutable_bitField0_ |= 0x00000001; } tableBoundHints_.add( input.readMessage( @@ -88,9 +94,9 @@ private TableExtractionParams( case 26: { java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000004) != 0)) { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { headerHints_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000004; + mutable_bitField0_ |= 0x00000002; } headerHints_.add(s); break; @@ -116,10 +122,10 @@ private TableExtractionParams( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { tableBoundHints_ = java.util.Collections.unmodifiableList(tableBoundHints_); } - if (((mutable_bitField0_ & 0x00000004) != 0)) { + if (((mutable_bitField0_ & 0x00000002) != 0)) { headerHints_ = headerHints_.getUnmodifiableView(); } this.unknownFields = unknownFields.build(); @@ -142,7 +148,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.documentai.v1beta1.TableExtractionParams.Builder.class); } - private int bitField0_; public static final int ENABLED_FIELD_NUMBER = 1; private boolean enabled_; /** @@ -153,6 +158,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * bool enabled = 1; + * + * @return The enabled. */ public boolean getEnabled() { return enabled_; @@ -250,6 +257,8 @@ public com.google.cloud.documentai.v1beta1.TableBoundHintOrBuilder getTableBound * * * repeated string header_hints = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the headerHints. */ public com.google.protobuf.ProtocolStringList getHeaderHintsList() { return headerHints_; @@ -263,6 +272,8 @@ public com.google.protobuf.ProtocolStringList getHeaderHintsList() { * * * repeated string header_hints = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of headerHints. */ public int getHeaderHintsCount() { return headerHints_.size(); @@ -276,6 +287,9 @@ public int getHeaderHintsCount() { * * * repeated string header_hints = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The headerHints at the given index. */ public java.lang.String getHeaderHints(int index) { return headerHints_.get(index); @@ -289,6 +303,9 @@ public java.lang.String getHeaderHints(int index) { * * * repeated string header_hints = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the headerHints at the given index. */ public com.google.protobuf.ByteString getHeaderHintsBytes(int index) { return headerHints_.getByteString(index); @@ -305,6 +322,8 @@ public com.google.protobuf.ByteString getHeaderHintsBytes(int index) { * * * string model_version = 4; + * + * @return The modelVersion. */ public java.lang.String getModelVersion() { java.lang.Object ref = modelVersion_; @@ -326,6 +345,8 @@ public java.lang.String getModelVersion() { * * * string model_version = 4; + * + * @return The bytes for modelVersion. */ public com.google.protobuf.ByteString getModelVersionBytes() { java.lang.Object ref = modelVersion_; @@ -586,12 +607,12 @@ public Builder clear() { if (tableBoundHintsBuilder_ == null) { tableBoundHints_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { tableBoundHintsBuilder_.clear(); } headerHints_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000002); modelVersion_ = ""; return this; @@ -622,24 +643,22 @@ public com.google.cloud.documentai.v1beta1.TableExtractionParams buildPartial() com.google.cloud.documentai.v1beta1.TableExtractionParams result = new com.google.cloud.documentai.v1beta1.TableExtractionParams(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; result.enabled_ = enabled_; if (tableBoundHintsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { tableBoundHints_ = java.util.Collections.unmodifiableList(tableBoundHints_); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } result.tableBoundHints_ = tableBoundHints_; } else { result.tableBoundHints_ = tableBoundHintsBuilder_.build(); } - if (((bitField0_ & 0x00000004) != 0)) { + if (((bitField0_ & 0x00000002) != 0)) { headerHints_ = headerHints_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000002); } result.headerHints_ = headerHints_; result.modelVersion_ = modelVersion_; - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -697,7 +716,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.TableExtractionPara if (!other.tableBoundHints_.isEmpty()) { if (tableBoundHints_.isEmpty()) { tableBoundHints_ = other.tableBoundHints_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureTableBoundHintsIsMutable(); tableBoundHints_.addAll(other.tableBoundHints_); @@ -710,7 +729,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.TableExtractionPara tableBoundHintsBuilder_.dispose(); tableBoundHintsBuilder_ = null; tableBoundHints_ = other.tableBoundHints_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); tableBoundHintsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getTableBoundHintsFieldBuilder() @@ -723,7 +742,7 @@ public Builder mergeFrom(com.google.cloud.documentai.v1beta1.TableExtractionPara if (!other.headerHints_.isEmpty()) { if (headerHints_.isEmpty()) { headerHints_ = other.headerHints_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureHeaderHintsIsMutable(); headerHints_.addAll(other.headerHints_); @@ -775,6 +794,8 @@ public Builder mergeFrom( * * * bool enabled = 1; + * + * @return The enabled. */ public boolean getEnabled() { return enabled_; @@ -787,6 +808,9 @@ public boolean getEnabled() { * * * bool enabled = 1; + * + * @param value The enabled to set. + * @return This builder for chaining. */ public Builder setEnabled(boolean value) { @@ -802,6 +826,8 @@ public Builder setEnabled(boolean value) { * * * bool enabled = 1; + * + * @return This builder for chaining. */ public Builder clearEnabled() { @@ -814,11 +840,11 @@ public Builder clearEnabled() { java.util.Collections.emptyList(); private void ensureTableBoundHintsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { tableBoundHints_ = new java.util.ArrayList( tableBoundHints_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000001; } } @@ -1070,7 +1096,7 @@ public Builder addAllTableBoundHints( public Builder clearTableBoundHints() { if (tableBoundHintsBuilder_ == null) { tableBoundHints_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { tableBoundHintsBuilder_.clear(); @@ -1218,7 +1244,7 @@ public com.google.cloud.documentai.v1beta1.TableBoundHint.Builder addTableBoundH com.google.cloud.documentai.v1beta1.TableBoundHint.Builder, com.google.cloud.documentai.v1beta1.TableBoundHintOrBuilder>( tableBoundHints_, - ((bitField0_ & 0x00000002) != 0), + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); tableBoundHints_ = null; @@ -1230,9 +1256,9 @@ public com.google.cloud.documentai.v1beta1.TableBoundHint.Builder addTableBoundH com.google.protobuf.LazyStringArrayList.EMPTY; private void ensureHeaderHintsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { + if (!((bitField0_ & 0x00000002) != 0)) { headerHints_ = new com.google.protobuf.LazyStringArrayList(headerHints_); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000002; } } /** @@ -1244,6 +1270,8 @@ private void ensureHeaderHintsIsMutable() { * * * repeated string header_hints = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the headerHints. */ public com.google.protobuf.ProtocolStringList getHeaderHintsList() { return headerHints_.getUnmodifiableView(); @@ -1257,6 +1285,8 @@ public com.google.protobuf.ProtocolStringList getHeaderHintsList() { * * * repeated string header_hints = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of headerHints. */ public int getHeaderHintsCount() { return headerHints_.size(); @@ -1270,6 +1300,9 @@ public int getHeaderHintsCount() { * * * repeated string header_hints = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The headerHints at the given index. */ public java.lang.String getHeaderHints(int index) { return headerHints_.get(index); @@ -1283,6 +1316,9 @@ public java.lang.String getHeaderHints(int index) { * * * repeated string header_hints = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the headerHints at the given index. */ public com.google.protobuf.ByteString getHeaderHintsBytes(int index) { return headerHints_.getByteString(index); @@ -1296,6 +1332,10 @@ public com.google.protobuf.ByteString getHeaderHintsBytes(int index) { * * * repeated string header_hints = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The headerHints to set. + * @return This builder for chaining. */ public Builder setHeaderHints(int index, java.lang.String value) { if (value == null) { @@ -1315,6 +1355,9 @@ public Builder setHeaderHints(int index, java.lang.String value) { * * * repeated string header_hints = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The headerHints to add. + * @return This builder for chaining. */ public Builder addHeaderHints(java.lang.String value) { if (value == null) { @@ -1334,6 +1377,9 @@ public Builder addHeaderHints(java.lang.String value) { * * * repeated string header_hints = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The headerHints to add. + * @return This builder for chaining. */ public Builder addAllHeaderHints(java.lang.Iterable values) { ensureHeaderHintsIsMutable(); @@ -1350,10 +1396,12 @@ public Builder addAllHeaderHints(java.lang.Iterable values) { * * * repeated string header_hints = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. */ public Builder clearHeaderHints() { headerHints_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } @@ -1366,6 +1414,9 @@ public Builder clearHeaderHints() { * * * repeated string header_hints = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the headerHints to add. + * @return This builder for chaining. */ public Builder addHeaderHintsBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -1388,6 +1439,8 @@ public Builder addHeaderHintsBytes(com.google.protobuf.ByteString value) { * * * string model_version = 4; + * + * @return The modelVersion. */ public java.lang.String getModelVersion() { java.lang.Object ref = modelVersion_; @@ -1409,6 +1462,8 @@ public java.lang.String getModelVersion() { * * * string model_version = 4; + * + * @return The bytes for modelVersion. */ public com.google.protobuf.ByteString getModelVersionBytes() { java.lang.Object ref = modelVersion_; @@ -1430,6 +1485,9 @@ public com.google.protobuf.ByteString getModelVersionBytes() { * * * string model_version = 4; + * + * @param value The modelVersion to set. + * @return This builder for chaining. */ public Builder setModelVersion(java.lang.String value) { if (value == null) { @@ -1449,6 +1507,8 @@ public Builder setModelVersion(java.lang.String value) { * * * string model_version = 4; + * + * @return This builder for chaining. */ public Builder clearModelVersion() { @@ -1465,6 +1525,9 @@ public Builder clearModelVersion() { * * * string model_version = 4; + * + * @param value The bytes for modelVersion to set. + * @return This builder for chaining. */ public Builder setModelVersionBytes(com.google.protobuf.ByteString value) { if (value == null) { diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableExtractionParamsOrBuilder.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableExtractionParamsOrBuilder.java similarity index 91% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableExtractionParamsOrBuilder.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableExtractionParamsOrBuilder.java index c14b8559..4269b1dd 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableExtractionParamsOrBuilder.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/TableExtractionParamsOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -31,6 +31,8 @@ public interface TableExtractionParamsOrBuilder * * * bool enabled = 1; + * + * @return The enabled. */ boolean getEnabled(); @@ -111,6 +113,8 @@ com.google.cloud.documentai.v1beta1.TableBoundHintOrBuilder getTableBoundHintsOr * * * repeated string header_hints = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the headerHints. */ java.util.List getHeaderHintsList(); /** @@ -122,6 +126,8 @@ com.google.cloud.documentai.v1beta1.TableBoundHintOrBuilder getTableBoundHintsOr * * * repeated string header_hints = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of headerHints. */ int getHeaderHintsCount(); /** @@ -133,6 +139,9 @@ com.google.cloud.documentai.v1beta1.TableBoundHintOrBuilder getTableBoundHintsOr * * * repeated string header_hints = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The headerHints at the given index. */ java.lang.String getHeaderHints(int index); /** @@ -144,6 +153,9 @@ com.google.cloud.documentai.v1beta1.TableBoundHintOrBuilder getTableBoundHintsOr * * * repeated string header_hints = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the headerHints at the given index. */ com.google.protobuf.ByteString getHeaderHintsBytes(int index); @@ -156,6 +168,8 @@ com.google.cloud.documentai.v1beta1.TableBoundHintOrBuilder getTableBoundHintsOr * * * string model_version = 4; + * + * @return The modelVersion. */ java.lang.String getModelVersion(); /** @@ -167,6 +181,8 @@ com.google.cloud.documentai.v1beta1.TableBoundHintOrBuilder getTableBoundHintsOr * * * string model_version = 4; + * + * @return The bytes for modelVersion. */ com.google.protobuf.ByteString getModelVersionBytes(); } diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/Vertex.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/Vertex.java similarity index 96% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/Vertex.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/Vertex.java index f263db76..dde131ef 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/Vertex.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/Vertex.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -40,6 +40,12 @@ private Vertex(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Vertex() {} + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Vertex(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -53,7 +59,6 @@ private Vertex( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -118,6 +123,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * * int32 x = 1; + * + * @return The x. */ public int getX() { return x_; @@ -133,6 +140,8 @@ public int getX() { * * * int32 y = 2; + * + * @return The y. */ public int getY() { return y_; @@ -478,6 +487,8 @@ public Builder mergeFrom( * * * int32 x = 1; + * + * @return The x. */ public int getX() { return x_; @@ -490,6 +501,9 @@ public int getX() { * * * int32 x = 1; + * + * @param value The x to set. + * @return This builder for chaining. */ public Builder setX(int value) { @@ -505,6 +519,8 @@ public Builder setX(int value) { * * * int32 x = 1; + * + * @return This builder for chaining. */ public Builder clearX() { @@ -522,6 +538,8 @@ public Builder clearX() { * * * int32 y = 2; + * + * @return The y. */ public int getY() { return y_; @@ -534,6 +552,9 @@ public int getY() { * * * int32 y = 2; + * + * @param value The y to set. + * @return This builder for chaining. */ public Builder setY(int value) { @@ -549,6 +570,8 @@ public Builder setY(int value) { * * * int32 y = 2; + * + * @return This builder for chaining. */ public Builder clearY() { diff --git a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/VertexOrBuilder.java b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/VertexOrBuilder.java similarity index 93% rename from proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/VertexOrBuilder.java rename to proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/VertexOrBuilder.java index 332b7c2c..49c899ee 100644 --- a/proto-google-cloud-documentai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/VertexOrBuilder.java +++ b/proto-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/VertexOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -31,6 +31,8 @@ public interface VertexOrBuilder * * * int32 x = 1; + * + * @return The x. */ int getX(); @@ -42,6 +44,8 @@ public interface VertexOrBuilder * * * int32 y = 2; + * + * @return The y. */ int getY(); } diff --git a/proto-google-cloud-documentai-v1beta1/src/main/proto/google/cloud/documentai/v1beta1/document.proto b/proto-google-cloud-document-ai-v1beta1/src/main/proto/google/cloud/documentai/v1beta1/document.proto similarity index 100% rename from proto-google-cloud-documentai-v1beta1/src/main/proto/google/cloud/documentai/v1beta1/document.proto rename to proto-google-cloud-document-ai-v1beta1/src/main/proto/google/cloud/documentai/v1beta1/document.proto diff --git a/proto-google-cloud-documentai-v1beta1/src/main/proto/google/cloud/documentai/v1beta1/document_understanding.proto b/proto-google-cloud-document-ai-v1beta1/src/main/proto/google/cloud/documentai/v1beta1/document_understanding.proto similarity index 100% rename from proto-google-cloud-documentai-v1beta1/src/main/proto/google/cloud/documentai/v1beta1/document_understanding.proto rename to proto-google-cloud-document-ai-v1beta1/src/main/proto/google/cloud/documentai/v1beta1/document_understanding.proto diff --git a/proto-google-cloud-documentai-v1beta1/src/main/proto/google/cloud/documentai/v1beta1/geometry.proto b/proto-google-cloud-document-ai-v1beta1/src/main/proto/google/cloud/documentai/v1beta1/geometry.proto similarity index 100% rename from proto-google-cloud-documentai-v1beta1/src/main/proto/google/cloud/documentai/v1beta1/geometry.proto rename to proto-google-cloud-document-ai-v1beta1/src/main/proto/google/cloud/documentai/v1beta1/geometry.proto diff --git a/proto-google-cloud-document-ai-v1beta2/pom.xml b/proto-google-cloud-document-ai-v1beta2/pom.xml new file mode 100644 index 00000000..b0d68407 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta2/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + com.google.api.grpc + proto-google-cloud-document-ai-v1beta2 + 0.1.0-SNAPSHOT + proto-google-cloud-document-ai-v1beta2 + PROTO library for proto-google-cloud-document-ai-v1beta2 + + com.google.cloud + google-cloud-document-ai-parent + 0.1.0-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + \ No newline at end of file diff --git a/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/AutoMlParams.java b/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/AutoMlParams.java new file mode 100644 index 00000000..e3f7e630 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/AutoMlParams.java @@ -0,0 +1,640 @@ +/* + * 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/documentai/v1beta2/document_understanding.proto + +package com.google.cloud.documentai.v1beta2; + +/** + * + * + *
+ * Parameters to control AutoML model prediction behavior.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta2.AutoMlParams} + */ +public final class AutoMlParams extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta2.AutoMlParams) + AutoMlParamsOrBuilder { + private static final long serialVersionUID = 0L; + // Use AutoMlParams.newBuilder() to construct. + private AutoMlParams(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AutoMlParams() { + model_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AutoMlParams(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AutoMlParams( + 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(); + + model_ = 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.documentai.v1beta2.DocumentAiProto + .internal_static_google_cloud_documentai_v1beta2_AutoMlParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta2.DocumentAiProto + .internal_static_google_cloud_documentai_v1beta2_AutoMlParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta2.AutoMlParams.class, + com.google.cloud.documentai.v1beta2.AutoMlParams.Builder.class); + } + + public static final int MODEL_FIELD_NUMBER = 1; + private volatile java.lang.Object model_; + /** + * + * + *
+   * Resource name of the AutoML model.
+   * Format: `projects/{project-id}/locations/{location-id}/models/{model-id}`.
+   * 
+ * + * string model = 1; + * + * @return The model. + */ + 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; + } + } + /** + * + * + *
+   * Resource name of the AutoML model.
+   * Format: `projects/{project-id}/locations/{location-id}/models/{model-id}`.
+   * 
+ * + * string model = 1; + * + * @return The bytes for model. + */ + 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; + } + } + + 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 (!getModelBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, model_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getModelBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, model_); + } + 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.documentai.v1beta2.AutoMlParams)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta2.AutoMlParams other = + (com.google.cloud.documentai.v1beta2.AutoMlParams) obj; + + if (!getModel().equals(other.getModel())) 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) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta2.AutoMlParams parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta2.AutoMlParams 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.documentai.v1beta2.AutoMlParams parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta2.AutoMlParams 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.documentai.v1beta2.AutoMlParams parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta2.AutoMlParams parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta2.AutoMlParams parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta2.AutoMlParams 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.documentai.v1beta2.AutoMlParams parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta2.AutoMlParams 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.documentai.v1beta2.AutoMlParams parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta2.AutoMlParams 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.documentai.v1beta2.AutoMlParams 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; + } + /** + * + * + *
+   * Parameters to control AutoML model prediction behavior.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta2.AutoMlParams} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta2.AutoMlParams) + com.google.cloud.documentai.v1beta2.AutoMlParamsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta2.DocumentAiProto + .internal_static_google_cloud_documentai_v1beta2_AutoMlParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta2.DocumentAiProto + .internal_static_google_cloud_documentai_v1beta2_AutoMlParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta2.AutoMlParams.class, + com.google.cloud.documentai.v1beta2.AutoMlParams.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta2.AutoMlParams.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(); + model_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta2.DocumentAiProto + .internal_static_google_cloud_documentai_v1beta2_AutoMlParams_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta2.AutoMlParams getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta2.AutoMlParams.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta2.AutoMlParams build() { + com.google.cloud.documentai.v1beta2.AutoMlParams result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta2.AutoMlParams buildPartial() { + com.google.cloud.documentai.v1beta2.AutoMlParams result = + new com.google.cloud.documentai.v1beta2.AutoMlParams(this); + result.model_ = model_; + 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.documentai.v1beta2.AutoMlParams) { + return mergeFrom((com.google.cloud.documentai.v1beta2.AutoMlParams) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta2.AutoMlParams other) { + if (other == com.google.cloud.documentai.v1beta2.AutoMlParams.getDefaultInstance()) + return this; + if (!other.getModel().isEmpty()) { + model_ = other.model_; + 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.documentai.v1beta2.AutoMlParams parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.documentai.v1beta2.AutoMlParams) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object model_ = ""; + /** + * + * + *
+     * Resource name of the AutoML model.
+     * Format: `projects/{project-id}/locations/{location-id}/models/{model-id}`.
+     * 
+ * + * string model = 1; + * + * @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; + } + } + /** + * + * + *
+     * Resource name of the AutoML model.
+     * Format: `projects/{project-id}/locations/{location-id}/models/{model-id}`.
+     * 
+ * + * string model = 1; + * + * @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; + } + } + /** + * + * + *
+     * Resource name of the AutoML model.
+     * Format: `projects/{project-id}/locations/{location-id}/models/{model-id}`.
+     * 
+ * + * string model = 1; + * + * @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; + } + /** + * + * + *
+     * Resource name of the AutoML model.
+     * Format: `projects/{project-id}/locations/{location-id}/models/{model-id}`.
+     * 
+ * + * string model = 1; + * + * @return This builder for chaining. + */ + public Builder clearModel() { + + model_ = getDefaultInstance().getModel(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the AutoML model.
+     * Format: `projects/{project-id}/locations/{location-id}/models/{model-id}`.
+     * 
+ * + * string model = 1; + * + * @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; + } + + @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.documentai.v1beta2.AutoMlParams) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta2.AutoMlParams) + private static final com.google.cloud.documentai.v1beta2.AutoMlParams DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta2.AutoMlParams(); + } + + public static com.google.cloud.documentai.v1beta2.AutoMlParams getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AutoMlParams parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AutoMlParams(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.documentai.v1beta2.AutoMlParams getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/AutoMlParamsOrBuilder.java b/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/AutoMlParamsOrBuilder.java new file mode 100644 index 00000000..29fbc11b --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/AutoMlParamsOrBuilder.java @@ -0,0 +1,52 @@ +/* + * 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/documentai/v1beta2/document_understanding.proto + +package com.google.cloud.documentai.v1beta2; + +public interface AutoMlParamsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta2.AutoMlParams) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of the AutoML model.
+   * Format: `projects/{project-id}/locations/{location-id}/models/{model-id}`.
+   * 
+ * + * string model = 1; + * + * @return The model. + */ + java.lang.String getModel(); + /** + * + * + *
+   * Resource name of the AutoML model.
+   * Format: `projects/{project-id}/locations/{location-id}/models/{model-id}`.
+   * 
+ * + * string model = 1; + * + * @return The bytes for model. + */ + com.google.protobuf.ByteString getModelBytes(); +} diff --git a/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/BatchProcessDocumentsRequest.java b/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/BatchProcessDocumentsRequest.java new file mode 100644 index 00000000..907c3e26 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/BatchProcessDocumentsRequest.java @@ -0,0 +1,1213 @@ +/* + * 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/documentai/v1beta2/document_understanding.proto + +package com.google.cloud.documentai.v1beta2; + +/** + * + * + *
+ * Request to batch process documents as an asynchronous operation. The output
+ * is written to Cloud Storage as JSON in the [Document] format.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest} + */ +public final class BatchProcessDocumentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest) + BatchProcessDocumentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchProcessDocumentsRequest.newBuilder() to construct. + private BatchProcessDocumentsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchProcessDocumentsRequest() { + requests_ = java.util.Collections.emptyList(); + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchProcessDocumentsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BatchProcessDocumentsRequest( + 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)) { + requests_ = + new java.util.ArrayList< + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest>(); + mutable_bitField0_ |= 0x00000001; + } + requests_.add( + input.readMessage( + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = 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)) { + requests_ = java.util.Collections.unmodifiableList(requests_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta2.DocumentAiProto + .internal_static_google_cloud_documentai_v1beta2_BatchProcessDocumentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta2.DocumentAiProto + .internal_static_google_cloud_documentai_v1beta2_BatchProcessDocumentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest.class, + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest.Builder.class); + } + + public static final int REQUESTS_FIELD_NUMBER = 1; + private java.util.List requests_; + /** + * + * + *
+   * Required. Individual requests for each document.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getRequestsList() { + return requests_; + } + /** + * + * + *
+   * Required. Individual requests for each document.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List< + ? extends com.google.cloud.documentai.v1beta2.ProcessDocumentRequestOrBuilder> + getRequestsOrBuilderList() { + return requests_; + } + /** + * + * + *
+   * Required. Individual requests for each document.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getRequestsCount() { + return requests_.size(); + } + /** + * + * + *
+   * Required. Individual requests for each document.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.documentai.v1beta2.ProcessDocumentRequest getRequests(int index) { + return requests_.get(index); + } + /** + * + * + *
+   * Required. Individual requests for each document.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.documentai.v1beta2.ProcessDocumentRequestOrBuilder getRequestsOrBuilder( + int index) { + return requests_.get(index); + } + + public static final int PARENT_FIELD_NUMBER = 2; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Target project and location to make a call.
+   * Format: `projects/{project-id}/locations/{location-id}`.
+   * If no location is specified, a region will be chosen automatically.
+   * 
+ * + * string parent = 2; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Target project and location to make a call.
+   * Format: `projects/{project-id}/locations/{location-id}`.
+   * If no location is specified, a region will be chosen automatically.
+   * 
+ * + * string parent = 2; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = 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 < requests_.size(); i++) { + output.writeMessage(1, requests_.get(i)); + } + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, parent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < requests_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, requests_.get(i)); + } + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, parent_); + } + 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.documentai.v1beta2.BatchProcessDocumentsRequest)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest other = + (com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest) obj; + + if (!getRequestsList().equals(other.getRequestsList())) return false; + if (!getParent().equals(other.getParent())) 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 (getRequestsCount() > 0) { + hash = (37 * hash) + REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getRequestsList().hashCode(); + } + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest 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.documentai.v1beta2.BatchProcessDocumentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest 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.documentai.v1beta2.BatchProcessDocumentsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest 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.documentai.v1beta2.BatchProcessDocumentsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest 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.documentai.v1beta2.BatchProcessDocumentsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest 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.documentai.v1beta2.BatchProcessDocumentsRequest 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; + } + /** + * + * + *
+   * Request to batch process documents as an asynchronous operation. The output
+   * is written to Cloud Storage as JSON in the [Document] format.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest) + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta2.DocumentAiProto + .internal_static_google_cloud_documentai_v1beta2_BatchProcessDocumentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta2.DocumentAiProto + .internal_static_google_cloud_documentai_v1beta2_BatchProcessDocumentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest.class, + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRequestsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + requestsBuilder_.clear(); + } + parent_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta2.DocumentAiProto + .internal_static_google_cloud_documentai_v1beta2_BatchProcessDocumentsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest build() { + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest buildPartial() { + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest result = + new com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest(this); + int from_bitField0_ = bitField0_; + if (requestsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + requests_ = java.util.Collections.unmodifiableList(requests_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.requests_ = requests_; + } else { + result.requests_ = requestsBuilder_.build(); + } + result.parent_ = parent_; + 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.documentai.v1beta2.BatchProcessDocumentsRequest) { + return mergeFrom((com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest other) { + if (other + == com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest.getDefaultInstance()) + return this; + if (requestsBuilder_ == null) { + if (!other.requests_.isEmpty()) { + if (requests_.isEmpty()) { + requests_ = other.requests_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRequestsIsMutable(); + requests_.addAll(other.requests_); + } + onChanged(); + } + } else { + if (!other.requests_.isEmpty()) { + if (requestsBuilder_.isEmpty()) { + requestsBuilder_.dispose(); + requestsBuilder_ = null; + requests_ = other.requests_; + bitField0_ = (bitField0_ & ~0x00000001); + requestsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRequestsFieldBuilder() + : null; + } else { + requestsBuilder_.addAllMessages(other.requests_); + } + } + } + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + 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.documentai.v1beta2.BatchProcessDocumentsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List requests_ = + java.util.Collections.emptyList(); + + private void ensureRequestsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + requests_ = + new java.util.ArrayList( + requests_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest, + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest.Builder, + com.google.cloud.documentai.v1beta2.ProcessDocumentRequestOrBuilder> + requestsBuilder_; + + /** + * + * + *
+     * Required. Individual requests for each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getRequestsList() { + if (requestsBuilder_ == null) { + return java.util.Collections.unmodifiableList(requests_); + } else { + return requestsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. Individual requests for each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getRequestsCount() { + if (requestsBuilder_ == null) { + return requests_.size(); + } else { + return requestsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. Individual requests for each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.documentai.v1beta2.ProcessDocumentRequest getRequests(int index) { + if (requestsBuilder_ == null) { + return requests_.get(index); + } else { + return requestsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. Individual requests for each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRequests( + int index, com.google.cloud.documentai.v1beta2.ProcessDocumentRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.set(index, value); + onChanged(); + } else { + requestsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Individual requests for each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRequests( + int index, + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.set(index, builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Individual requests for each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addRequests(com.google.cloud.documentai.v1beta2.ProcessDocumentRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.add(value); + onChanged(); + } else { + requestsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. Individual requests for each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addRequests( + int index, com.google.cloud.documentai.v1beta2.ProcessDocumentRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.add(index, value); + onChanged(); + } else { + requestsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Individual requests for each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addRequests( + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Individual requests for each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addRequests( + int index, + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(index, builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Individual requests for each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllRequests( + java.lang.Iterable + values) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, requests_); + onChanged(); + } else { + requestsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. Individual requests for each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearRequests() { + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + requestsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Individual requests for each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeRequests(int index) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.remove(index); + onChanged(); + } else { + requestsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. Individual requests for each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.documentai.v1beta2.ProcessDocumentRequest.Builder getRequestsBuilder( + int index) { + return getRequestsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. Individual requests for each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.documentai.v1beta2.ProcessDocumentRequestOrBuilder getRequestsOrBuilder( + int index) { + if (requestsBuilder_ == null) { + return requests_.get(index); + } else { + return requestsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. Individual requests for each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List< + ? extends com.google.cloud.documentai.v1beta2.ProcessDocumentRequestOrBuilder> + getRequestsOrBuilderList() { + if (requestsBuilder_ != null) { + return requestsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(requests_); + } + } + /** + * + * + *
+     * Required. Individual requests for each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.documentai.v1beta2.ProcessDocumentRequest.Builder addRequestsBuilder() { + return getRequestsFieldBuilder() + .addBuilder( + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Individual requests for each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.documentai.v1beta2.ProcessDocumentRequest.Builder addRequestsBuilder( + int index) { + return getRequestsFieldBuilder() + .addBuilder( + index, + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Individual requests for each document.
+     * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getRequestsBuilderList() { + return getRequestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest, + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest.Builder, + com.google.cloud.documentai.v1beta2.ProcessDocumentRequestOrBuilder> + getRequestsFieldBuilder() { + if (requestsBuilder_ == null) { + requestsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest, + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest.Builder, + com.google.cloud.documentai.v1beta2.ProcessDocumentRequestOrBuilder>( + requests_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + requests_ = null; + } + return requestsBuilder_; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Target project and location to make a call.
+     * Format: `projects/{project-id}/locations/{location-id}`.
+     * If no location is specified, a region will be chosen automatically.
+     * 
+ * + * string parent = 2; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Target project and location to make a call.
+     * Format: `projects/{project-id}/locations/{location-id}`.
+     * If no location is specified, a region will be chosen automatically.
+     * 
+ * + * string parent = 2; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Target project and location to make a call.
+     * Format: `projects/{project-id}/locations/{location-id}`.
+     * If no location is specified, a region will be chosen automatically.
+     * 
+ * + * string parent = 2; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Target project and location to make a call.
+     * Format: `projects/{project-id}/locations/{location-id}`.
+     * If no location is specified, a region will be chosen automatically.
+     * 
+ * + * string parent = 2; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Target project and location to make a call.
+     * Format: `projects/{project-id}/locations/{location-id}`.
+     * If no location is specified, a region will be chosen automatically.
+     * 
+ * + * string parent = 2; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = 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.documentai.v1beta2.BatchProcessDocumentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest) + private static final com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest(); + } + + public static com.google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchProcessDocumentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchProcessDocumentsRequest(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.documentai.v1beta2.BatchProcessDocumentsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/BatchProcessDocumentsRequestOrBuilder.java b/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/BatchProcessDocumentsRequestOrBuilder.java new file mode 100644 index 00000000..c564a1dc --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/BatchProcessDocumentsRequestOrBuilder.java @@ -0,0 +1,117 @@ +/* + * 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/documentai/v1beta2/document_understanding.proto + +package com.google.cloud.documentai.v1beta2; + +public interface BatchProcessDocumentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta2.BatchProcessDocumentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Individual requests for each document.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getRequestsList(); + /** + * + * + *
+   * Required. Individual requests for each document.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.documentai.v1beta2.ProcessDocumentRequest getRequests(int index); + /** + * + * + *
+   * Required. Individual requests for each document.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getRequestsCount(); + /** + * + * + *
+   * Required. Individual requests for each document.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getRequestsOrBuilderList(); + /** + * + * + *
+   * Required. Individual requests for each document.
+   * 
+ * + * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentRequest requests = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.documentai.v1beta2.ProcessDocumentRequestOrBuilder getRequestsOrBuilder( + int index); + + /** + * + * + *
+   * Target project and location to make a call.
+   * Format: `projects/{project-id}/locations/{location-id}`.
+   * If no location is specified, a region will be chosen automatically.
+   * 
+ * + * string parent = 2; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Target project and location to make a call.
+   * Format: `projects/{project-id}/locations/{location-id}`.
+   * If no location is specified, a region will be chosen automatically.
+   * 
+ * + * string parent = 2; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); +} diff --git a/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/BatchProcessDocumentsResponse.java b/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/BatchProcessDocumentsResponse.java new file mode 100644 index 00000000..15d50f33 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/BatchProcessDocumentsResponse.java @@ -0,0 +1,979 @@ +/* + * 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/documentai/v1beta2/document_understanding.proto + +package com.google.cloud.documentai.v1beta2; + +/** + * + * + *
+ * Response to an batch document processing request. This is returned in
+ * the LRO Operation after the operation is complete.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse} + */ +public final class BatchProcessDocumentsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse) + BatchProcessDocumentsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchProcessDocumentsResponse.newBuilder() to construct. + private BatchProcessDocumentsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchProcessDocumentsResponse() { + responses_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchProcessDocumentsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BatchProcessDocumentsResponse( + 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)) { + responses_ = + new java.util.ArrayList< + com.google.cloud.documentai.v1beta2.ProcessDocumentResponse>(); + mutable_bitField0_ |= 0x00000001; + } + responses_.add( + input.readMessage( + com.google.cloud.documentai.v1beta2.ProcessDocumentResponse.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)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta2.DocumentAiProto + .internal_static_google_cloud_documentai_v1beta2_BatchProcessDocumentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta2.DocumentAiProto + .internal_static_google_cloud_documentai_v1beta2_BatchProcessDocumentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse.class, + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse.Builder.class); + } + + public static final int RESPONSES_FIELD_NUMBER = 1; + private java.util.List responses_; + /** + * + * + *
+   * Responses for each individual document.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public java.util.List + getResponsesList() { + return responses_; + } + /** + * + * + *
+   * Responses for each individual document.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public java.util.List< + ? extends com.google.cloud.documentai.v1beta2.ProcessDocumentResponseOrBuilder> + getResponsesOrBuilderList() { + return responses_; + } + /** + * + * + *
+   * Responses for each individual document.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public int getResponsesCount() { + return responses_.size(); + } + /** + * + * + *
+   * Responses for each individual document.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public com.google.cloud.documentai.v1beta2.ProcessDocumentResponse getResponses(int index) { + return responses_.get(index); + } + /** + * + * + *
+   * Responses for each individual document.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public com.google.cloud.documentai.v1beta2.ProcessDocumentResponseOrBuilder getResponsesOrBuilder( + int index) { + return responses_.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 < responses_.size(); i++) { + output.writeMessage(1, responses_.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 < responses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, responses_.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.documentai.v1beta2.BatchProcessDocumentsResponse)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse other = + (com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse) obj; + + if (!getResponsesList().equals(other.getResponsesList())) 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 (getResponsesCount() > 0) { + hash = (37 * hash) + RESPONSES_FIELD_NUMBER; + hash = (53 * hash) + getResponsesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse 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.documentai.v1beta2.BatchProcessDocumentsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse 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.documentai.v1beta2.BatchProcessDocumentsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse 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.documentai.v1beta2.BatchProcessDocumentsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse + 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.documentai.v1beta2.BatchProcessDocumentsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse 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.documentai.v1beta2.BatchProcessDocumentsResponse 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; + } + /** + * + * + *
+   * Response to an batch document processing request. This is returned in
+   * the LRO Operation after the operation is complete.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse) + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta2.DocumentAiProto + .internal_static_google_cloud_documentai_v1beta2_BatchProcessDocumentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta2.DocumentAiProto + .internal_static_google_cloud_documentai_v1beta2_BatchProcessDocumentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse.class, + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getResponsesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + responsesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta2.DocumentAiProto + .internal_static_google_cloud_documentai_v1beta2_BatchProcessDocumentsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse + getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse build() { + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse buildPartial() { + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse result = + new com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse(this); + int from_bitField0_ = bitField0_; + if (responsesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.responses_ = responses_; + } else { + result.responses_ = responsesBuilder_.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.documentai.v1beta2.BatchProcessDocumentsResponse) { + return mergeFrom((com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse other) { + if (other + == com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse.getDefaultInstance()) + return this; + if (responsesBuilder_ == null) { + if (!other.responses_.isEmpty()) { + if (responses_.isEmpty()) { + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResponsesIsMutable(); + responses_.addAll(other.responses_); + } + onChanged(); + } + } else { + if (!other.responses_.isEmpty()) { + if (responsesBuilder_.isEmpty()) { + responsesBuilder_.dispose(); + responsesBuilder_ = null; + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + responsesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResponsesFieldBuilder() + : null; + } else { + responsesBuilder_.addAllMessages(other.responses_); + } + } + } + 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.documentai.v1beta2.BatchProcessDocumentsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List responses_ = + java.util.Collections.emptyList(); + + private void ensureResponsesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + responses_ = + new java.util.ArrayList( + responses_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta2.ProcessDocumentResponse, + com.google.cloud.documentai.v1beta2.ProcessDocumentResponse.Builder, + com.google.cloud.documentai.v1beta2.ProcessDocumentResponseOrBuilder> + responsesBuilder_; + + /** + * + * + *
+     * Responses for each individual document.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public java.util.List + getResponsesList() { + if (responsesBuilder_ == null) { + return java.util.Collections.unmodifiableList(responses_); + } else { + return responsesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Responses for each individual document.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public int getResponsesCount() { + if (responsesBuilder_ == null) { + return responses_.size(); + } else { + return responsesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Responses for each individual document.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public com.google.cloud.documentai.v1beta2.ProcessDocumentResponse getResponses(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Responses for each individual document.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public Builder setResponses( + int index, com.google.cloud.documentai.v1beta2.ProcessDocumentResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.set(index, value); + onChanged(); + } else { + responsesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Responses for each individual document.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public Builder setResponses( + int index, + com.google.cloud.documentai.v1beta2.ProcessDocumentResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.set(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Responses for each individual document.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public Builder addResponses(com.google.cloud.documentai.v1beta2.ProcessDocumentResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(value); + onChanged(); + } else { + responsesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Responses for each individual document.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public Builder addResponses( + int index, com.google.cloud.documentai.v1beta2.ProcessDocumentResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(index, value); + onChanged(); + } else { + responsesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Responses for each individual document.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public Builder addResponses( + com.google.cloud.documentai.v1beta2.ProcessDocumentResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Responses for each individual document.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public Builder addResponses( + int index, + com.google.cloud.documentai.v1beta2.ProcessDocumentResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Responses for each individual document.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public Builder addAllResponses( + java.lang.Iterable + values) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, responses_); + onChanged(); + } else { + responsesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Responses for each individual document.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public Builder clearResponses() { + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + responsesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Responses for each individual document.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public Builder removeResponses(int index) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.remove(index); + onChanged(); + } else { + responsesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Responses for each individual document.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public com.google.cloud.documentai.v1beta2.ProcessDocumentResponse.Builder getResponsesBuilder( + int index) { + return getResponsesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Responses for each individual document.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public com.google.cloud.documentai.v1beta2.ProcessDocumentResponseOrBuilder + getResponsesOrBuilder(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Responses for each individual document.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public java.util.List< + ? extends com.google.cloud.documentai.v1beta2.ProcessDocumentResponseOrBuilder> + getResponsesOrBuilderList() { + if (responsesBuilder_ != null) { + return responsesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(responses_); + } + } + /** + * + * + *
+     * Responses for each individual document.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public com.google.cloud.documentai.v1beta2.ProcessDocumentResponse.Builder + addResponsesBuilder() { + return getResponsesFieldBuilder() + .addBuilder( + com.google.cloud.documentai.v1beta2.ProcessDocumentResponse.getDefaultInstance()); + } + /** + * + * + *
+     * Responses for each individual document.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public com.google.cloud.documentai.v1beta2.ProcessDocumentResponse.Builder addResponsesBuilder( + int index) { + return getResponsesFieldBuilder() + .addBuilder( + index, + com.google.cloud.documentai.v1beta2.ProcessDocumentResponse.getDefaultInstance()); + } + /** + * + * + *
+     * Responses for each individual document.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + public java.util.List + getResponsesBuilderList() { + return getResponsesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta2.ProcessDocumentResponse, + com.google.cloud.documentai.v1beta2.ProcessDocumentResponse.Builder, + com.google.cloud.documentai.v1beta2.ProcessDocumentResponseOrBuilder> + getResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta2.ProcessDocumentResponse, + com.google.cloud.documentai.v1beta2.ProcessDocumentResponse.Builder, + com.google.cloud.documentai.v1beta2.ProcessDocumentResponseOrBuilder>( + responses_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + responses_ = null; + } + return responsesBuilder_; + } + + @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.documentai.v1beta2.BatchProcessDocumentsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse) + private static final com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse(); + } + + public static com.google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchProcessDocumentsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchProcessDocumentsResponse(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.documentai.v1beta2.BatchProcessDocumentsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/BatchProcessDocumentsResponseOrBuilder.java b/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/BatchProcessDocumentsResponseOrBuilder.java new file mode 100644 index 00000000..0625a7b6 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/BatchProcessDocumentsResponseOrBuilder.java @@ -0,0 +1,78 @@ +/* + * 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/documentai/v1beta2/document_understanding.proto + +package com.google.cloud.documentai.v1beta2; + +public interface BatchProcessDocumentsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta2.BatchProcessDocumentsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Responses for each individual document.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + java.util.List getResponsesList(); + /** + * + * + *
+   * Responses for each individual document.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + com.google.cloud.documentai.v1beta2.ProcessDocumentResponse getResponses(int index); + /** + * + * + *
+   * Responses for each individual document.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + int getResponsesCount(); + /** + * + * + *
+   * Responses for each individual document.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + java.util.List + getResponsesOrBuilderList(); + /** + * + * + *
+   * Responses for each individual document.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.ProcessDocumentResponse responses = 1; + */ + com.google.cloud.documentai.v1beta2.ProcessDocumentResponseOrBuilder getResponsesOrBuilder( + int index); +} diff --git a/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/BoundingPoly.java b/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/BoundingPoly.java new file mode 100644 index 00000000..217c1b71 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/BoundingPoly.java @@ -0,0 +1,1468 @@ +/* + * 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/documentai/v1beta2/geometry.proto + +package com.google.cloud.documentai.v1beta2; + +/** + * + * + *
+ * A bounding polygon for the detected image annotation.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta2.BoundingPoly} + */ +public final class BoundingPoly extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta2.BoundingPoly) + BoundingPolyOrBuilder { + private static final long serialVersionUID = 0L; + // Use BoundingPoly.newBuilder() to construct. + private BoundingPoly(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BoundingPoly() { + vertices_ = java.util.Collections.emptyList(); + normalizedVertices_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BoundingPoly(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BoundingPoly( + 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)) { + vertices_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + vertices_.add( + input.readMessage( + com.google.cloud.documentai.v1beta2.Vertex.parser(), extensionRegistry)); + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + normalizedVertices_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + normalizedVertices_.add( + input.readMessage( + com.google.cloud.documentai.v1beta2.NormalizedVertex.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)) { + vertices_ = java.util.Collections.unmodifiableList(vertices_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + normalizedVertices_ = java.util.Collections.unmodifiableList(normalizedVertices_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta2.GeometryProto + .internal_static_google_cloud_documentai_v1beta2_BoundingPoly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta2.GeometryProto + .internal_static_google_cloud_documentai_v1beta2_BoundingPoly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta2.BoundingPoly.class, + com.google.cloud.documentai.v1beta2.BoundingPoly.Builder.class); + } + + public static final int VERTICES_FIELD_NUMBER = 1; + private java.util.List vertices_; + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public java.util.List getVerticesList() { + return vertices_; + } + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public java.util.List + getVerticesOrBuilderList() { + return vertices_; + } + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public int getVerticesCount() { + return vertices_.size(); + } + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public com.google.cloud.documentai.v1beta2.Vertex getVertices(int index) { + return vertices_.get(index); + } + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public com.google.cloud.documentai.v1beta2.VertexOrBuilder getVerticesOrBuilder(int index) { + return vertices_.get(index); + } + + public static final int NORMALIZED_VERTICES_FIELD_NUMBER = 2; + private java.util.List normalizedVertices_; + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public java.util.List + getNormalizedVerticesList() { + return normalizedVertices_; + } + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public java.util.List + getNormalizedVerticesOrBuilderList() { + return normalizedVertices_; + } + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public int getNormalizedVerticesCount() { + return normalizedVertices_.size(); + } + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public com.google.cloud.documentai.v1beta2.NormalizedVertex getNormalizedVertices(int index) { + return normalizedVertices_.get(index); + } + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public com.google.cloud.documentai.v1beta2.NormalizedVertexOrBuilder + getNormalizedVerticesOrBuilder(int index) { + return normalizedVertices_.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 < vertices_.size(); i++) { + output.writeMessage(1, vertices_.get(i)); + } + for (int i = 0; i < normalizedVertices_.size(); i++) { + output.writeMessage(2, normalizedVertices_.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 < vertices_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, vertices_.get(i)); + } + for (int i = 0; i < normalizedVertices_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, normalizedVertices_.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.documentai.v1beta2.BoundingPoly)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta2.BoundingPoly other = + (com.google.cloud.documentai.v1beta2.BoundingPoly) obj; + + if (!getVerticesList().equals(other.getVerticesList())) return false; + if (!getNormalizedVerticesList().equals(other.getNormalizedVerticesList())) 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 (getVerticesCount() > 0) { + hash = (37 * hash) + VERTICES_FIELD_NUMBER; + hash = (53 * hash) + getVerticesList().hashCode(); + } + if (getNormalizedVerticesCount() > 0) { + hash = (37 * hash) + NORMALIZED_VERTICES_FIELD_NUMBER; + hash = (53 * hash) + getNormalizedVerticesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta2.BoundingPoly parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta2.BoundingPoly 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.documentai.v1beta2.BoundingPoly parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta2.BoundingPoly 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.documentai.v1beta2.BoundingPoly parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta2.BoundingPoly parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta2.BoundingPoly parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta2.BoundingPoly 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.documentai.v1beta2.BoundingPoly parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta2.BoundingPoly 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.documentai.v1beta2.BoundingPoly parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta2.BoundingPoly 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.documentai.v1beta2.BoundingPoly 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 bounding polygon for the detected image annotation.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta2.BoundingPoly} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta2.BoundingPoly) + com.google.cloud.documentai.v1beta2.BoundingPolyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta2.GeometryProto + .internal_static_google_cloud_documentai_v1beta2_BoundingPoly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta2.GeometryProto + .internal_static_google_cloud_documentai_v1beta2_BoundingPoly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta2.BoundingPoly.class, + com.google.cloud.documentai.v1beta2.BoundingPoly.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta2.BoundingPoly.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getVerticesFieldBuilder(); + getNormalizedVerticesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (verticesBuilder_ == null) { + vertices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + verticesBuilder_.clear(); + } + if (normalizedVerticesBuilder_ == null) { + normalizedVertices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + normalizedVerticesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta2.GeometryProto + .internal_static_google_cloud_documentai_v1beta2_BoundingPoly_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta2.BoundingPoly getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta2.BoundingPoly.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta2.BoundingPoly build() { + com.google.cloud.documentai.v1beta2.BoundingPoly result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta2.BoundingPoly buildPartial() { + com.google.cloud.documentai.v1beta2.BoundingPoly result = + new com.google.cloud.documentai.v1beta2.BoundingPoly(this); + int from_bitField0_ = bitField0_; + if (verticesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + vertices_ = java.util.Collections.unmodifiableList(vertices_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.vertices_ = vertices_; + } else { + result.vertices_ = verticesBuilder_.build(); + } + if (normalizedVerticesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + normalizedVertices_ = java.util.Collections.unmodifiableList(normalizedVertices_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.normalizedVertices_ = normalizedVertices_; + } else { + result.normalizedVertices_ = normalizedVerticesBuilder_.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.documentai.v1beta2.BoundingPoly) { + return mergeFrom((com.google.cloud.documentai.v1beta2.BoundingPoly) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta2.BoundingPoly other) { + if (other == com.google.cloud.documentai.v1beta2.BoundingPoly.getDefaultInstance()) + return this; + if (verticesBuilder_ == null) { + if (!other.vertices_.isEmpty()) { + if (vertices_.isEmpty()) { + vertices_ = other.vertices_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureVerticesIsMutable(); + vertices_.addAll(other.vertices_); + } + onChanged(); + } + } else { + if (!other.vertices_.isEmpty()) { + if (verticesBuilder_.isEmpty()) { + verticesBuilder_.dispose(); + verticesBuilder_ = null; + vertices_ = other.vertices_; + bitField0_ = (bitField0_ & ~0x00000001); + verticesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getVerticesFieldBuilder() + : null; + } else { + verticesBuilder_.addAllMessages(other.vertices_); + } + } + } + if (normalizedVerticesBuilder_ == null) { + if (!other.normalizedVertices_.isEmpty()) { + if (normalizedVertices_.isEmpty()) { + normalizedVertices_ = other.normalizedVertices_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.addAll(other.normalizedVertices_); + } + onChanged(); + } + } else { + if (!other.normalizedVertices_.isEmpty()) { + if (normalizedVerticesBuilder_.isEmpty()) { + normalizedVerticesBuilder_.dispose(); + normalizedVerticesBuilder_ = null; + normalizedVertices_ = other.normalizedVertices_; + bitField0_ = (bitField0_ & ~0x00000002); + normalizedVerticesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNormalizedVerticesFieldBuilder() + : null; + } else { + normalizedVerticesBuilder_.addAllMessages(other.normalizedVertices_); + } + } + } + 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.documentai.v1beta2.BoundingPoly parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.documentai.v1beta2.BoundingPoly) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List vertices_ = + java.util.Collections.emptyList(); + + private void ensureVerticesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + vertices_ = new java.util.ArrayList(vertices_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta2.Vertex, + com.google.cloud.documentai.v1beta2.Vertex.Builder, + com.google.cloud.documentai.v1beta2.VertexOrBuilder> + verticesBuilder_; + + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public java.util.List getVerticesList() { + if (verticesBuilder_ == null) { + return java.util.Collections.unmodifiableList(vertices_); + } else { + return verticesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public int getVerticesCount() { + if (verticesBuilder_ == null) { + return vertices_.size(); + } else { + return verticesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public com.google.cloud.documentai.v1beta2.Vertex getVertices(int index) { + if (verticesBuilder_ == null) { + return vertices_.get(index); + } else { + return verticesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public Builder setVertices(int index, com.google.cloud.documentai.v1beta2.Vertex value) { + if (verticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVerticesIsMutable(); + vertices_.set(index, value); + onChanged(); + } else { + verticesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public Builder setVertices( + int index, com.google.cloud.documentai.v1beta2.Vertex.Builder builderForValue) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.set(index, builderForValue.build()); + onChanged(); + } else { + verticesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public Builder addVertices(com.google.cloud.documentai.v1beta2.Vertex value) { + if (verticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVerticesIsMutable(); + vertices_.add(value); + onChanged(); + } else { + verticesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public Builder addVertices(int index, com.google.cloud.documentai.v1beta2.Vertex value) { + if (verticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVerticesIsMutable(); + vertices_.add(index, value); + onChanged(); + } else { + verticesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public Builder addVertices(com.google.cloud.documentai.v1beta2.Vertex.Builder builderForValue) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.add(builderForValue.build()); + onChanged(); + } else { + verticesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public Builder addVertices( + int index, com.google.cloud.documentai.v1beta2.Vertex.Builder builderForValue) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.add(index, builderForValue.build()); + onChanged(); + } else { + verticesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public Builder addAllVertices( + java.lang.Iterable values) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, vertices_); + onChanged(); + } else { + verticesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public Builder clearVertices() { + if (verticesBuilder_ == null) { + vertices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + verticesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public Builder removeVertices(int index) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.remove(index); + onChanged(); + } else { + verticesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public com.google.cloud.documentai.v1beta2.Vertex.Builder getVerticesBuilder(int index) { + return getVerticesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public com.google.cloud.documentai.v1beta2.VertexOrBuilder getVerticesOrBuilder(int index) { + if (verticesBuilder_ == null) { + return vertices_.get(index); + } else { + return verticesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public java.util.List + getVerticesOrBuilderList() { + if (verticesBuilder_ != null) { + return verticesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(vertices_); + } + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public com.google.cloud.documentai.v1beta2.Vertex.Builder addVerticesBuilder() { + return getVerticesFieldBuilder() + .addBuilder(com.google.cloud.documentai.v1beta2.Vertex.getDefaultInstance()); + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public com.google.cloud.documentai.v1beta2.Vertex.Builder addVerticesBuilder(int index) { + return getVerticesFieldBuilder() + .addBuilder(index, com.google.cloud.documentai.v1beta2.Vertex.getDefaultInstance()); + } + /** + * + * + *
+     * The bounding polygon vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + public java.util.List + getVerticesBuilderList() { + return getVerticesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta2.Vertex, + com.google.cloud.documentai.v1beta2.Vertex.Builder, + com.google.cloud.documentai.v1beta2.VertexOrBuilder> + getVerticesFieldBuilder() { + if (verticesBuilder_ == null) { + verticesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta2.Vertex, + com.google.cloud.documentai.v1beta2.Vertex.Builder, + com.google.cloud.documentai.v1beta2.VertexOrBuilder>( + vertices_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + vertices_ = null; + } + return verticesBuilder_; + } + + private java.util.List + normalizedVertices_ = java.util.Collections.emptyList(); + + private void ensureNormalizedVerticesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + normalizedVertices_ = + new java.util.ArrayList( + normalizedVertices_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta2.NormalizedVertex, + com.google.cloud.documentai.v1beta2.NormalizedVertex.Builder, + com.google.cloud.documentai.v1beta2.NormalizedVertexOrBuilder> + normalizedVerticesBuilder_; + + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public java.util.List + getNormalizedVerticesList() { + if (normalizedVerticesBuilder_ == null) { + return java.util.Collections.unmodifiableList(normalizedVertices_); + } else { + return normalizedVerticesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public int getNormalizedVerticesCount() { + if (normalizedVerticesBuilder_ == null) { + return normalizedVertices_.size(); + } else { + return normalizedVerticesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public com.google.cloud.documentai.v1beta2.NormalizedVertex getNormalizedVertices(int index) { + if (normalizedVerticesBuilder_ == null) { + return normalizedVertices_.get(index); + } else { + return normalizedVerticesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public Builder setNormalizedVertices( + int index, com.google.cloud.documentai.v1beta2.NormalizedVertex value) { + if (normalizedVerticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.set(index, value); + onChanged(); + } else { + normalizedVerticesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public Builder setNormalizedVertices( + int index, com.google.cloud.documentai.v1beta2.NormalizedVertex.Builder builderForValue) { + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.set(index, builderForValue.build()); + onChanged(); + } else { + normalizedVerticesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public Builder addNormalizedVertices( + com.google.cloud.documentai.v1beta2.NormalizedVertex value) { + if (normalizedVerticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.add(value); + onChanged(); + } else { + normalizedVerticesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public Builder addNormalizedVertices( + int index, com.google.cloud.documentai.v1beta2.NormalizedVertex value) { + if (normalizedVerticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.add(index, value); + onChanged(); + } else { + normalizedVerticesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public Builder addNormalizedVertices( + com.google.cloud.documentai.v1beta2.NormalizedVertex.Builder builderForValue) { + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.add(builderForValue.build()); + onChanged(); + } else { + normalizedVerticesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public Builder addNormalizedVertices( + int index, com.google.cloud.documentai.v1beta2.NormalizedVertex.Builder builderForValue) { + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.add(index, builderForValue.build()); + onChanged(); + } else { + normalizedVerticesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public Builder addAllNormalizedVertices( + java.lang.Iterable values) { + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, normalizedVertices_); + onChanged(); + } else { + normalizedVerticesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public Builder clearNormalizedVertices() { + if (normalizedVerticesBuilder_ == null) { + normalizedVertices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + normalizedVerticesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public Builder removeNormalizedVertices(int index) { + if (normalizedVerticesBuilder_ == null) { + ensureNormalizedVerticesIsMutable(); + normalizedVertices_.remove(index); + onChanged(); + } else { + normalizedVerticesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public com.google.cloud.documentai.v1beta2.NormalizedVertex.Builder + getNormalizedVerticesBuilder(int index) { + return getNormalizedVerticesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public com.google.cloud.documentai.v1beta2.NormalizedVertexOrBuilder + getNormalizedVerticesOrBuilder(int index) { + if (normalizedVerticesBuilder_ == null) { + return normalizedVertices_.get(index); + } else { + return normalizedVerticesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public java.util.List + getNormalizedVerticesOrBuilderList() { + if (normalizedVerticesBuilder_ != null) { + return normalizedVerticesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(normalizedVertices_); + } + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public com.google.cloud.documentai.v1beta2.NormalizedVertex.Builder + addNormalizedVerticesBuilder() { + return getNormalizedVerticesFieldBuilder() + .addBuilder(com.google.cloud.documentai.v1beta2.NormalizedVertex.getDefaultInstance()); + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public com.google.cloud.documentai.v1beta2.NormalizedVertex.Builder + addNormalizedVerticesBuilder(int index) { + return getNormalizedVerticesFieldBuilder() + .addBuilder( + index, com.google.cloud.documentai.v1beta2.NormalizedVertex.getDefaultInstance()); + } + /** + * + * + *
+     * The bounding polygon normalized vertices.
+     * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + public java.util.List + getNormalizedVerticesBuilderList() { + return getNormalizedVerticesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta2.NormalizedVertex, + com.google.cloud.documentai.v1beta2.NormalizedVertex.Builder, + com.google.cloud.documentai.v1beta2.NormalizedVertexOrBuilder> + getNormalizedVerticesFieldBuilder() { + if (normalizedVerticesBuilder_ == null) { + normalizedVerticesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.documentai.v1beta2.NormalizedVertex, + com.google.cloud.documentai.v1beta2.NormalizedVertex.Builder, + com.google.cloud.documentai.v1beta2.NormalizedVertexOrBuilder>( + normalizedVertices_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + normalizedVertices_ = null; + } + return normalizedVerticesBuilder_; + } + + @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.documentai.v1beta2.BoundingPoly) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta2.BoundingPoly) + private static final com.google.cloud.documentai.v1beta2.BoundingPoly DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta2.BoundingPoly(); + } + + public static com.google.cloud.documentai.v1beta2.BoundingPoly getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BoundingPoly parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BoundingPoly(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.documentai.v1beta2.BoundingPoly getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/BoundingPolyOrBuilder.java b/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/BoundingPolyOrBuilder.java new file mode 100644 index 00000000..c7093297 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/BoundingPolyOrBuilder.java @@ -0,0 +1,135 @@ +/* + * 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/documentai/v1beta2/geometry.proto + +package com.google.cloud.documentai.v1beta2; + +public interface BoundingPolyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta2.BoundingPoly) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + java.util.List getVerticesList(); + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + com.google.cloud.documentai.v1beta2.Vertex getVertices(int index); + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + int getVerticesCount(); + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + java.util.List + getVerticesOrBuilderList(); + /** + * + * + *
+   * The bounding polygon vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.Vertex vertices = 1; + */ + com.google.cloud.documentai.v1beta2.VertexOrBuilder getVerticesOrBuilder(int index); + + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + java.util.List getNormalizedVerticesList(); + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + com.google.cloud.documentai.v1beta2.NormalizedVertex getNormalizedVertices(int index); + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + int getNormalizedVerticesCount(); + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + java.util.List + getNormalizedVerticesOrBuilderList(); + /** + * + * + *
+   * The bounding polygon normalized vertices.
+   * 
+ * + * repeated .google.cloud.documentai.v1beta2.NormalizedVertex normalized_vertices = 2; + * + */ + com.google.cloud.documentai.v1beta2.NormalizedVertexOrBuilder getNormalizedVerticesOrBuilder( + int index); +} diff --git a/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/Document.java b/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/Document.java new file mode 100644 index 00000000..792f6293 --- /dev/null +++ b/proto-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/Document.java @@ -0,0 +1,43126 @@ +/* + * 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/documentai/v1beta2/document.proto + +package com.google.cloud.documentai.v1beta2; + +/** + * + * + *
+ * Document represents the canonical document resource in Document Understanding
+ * AI.
+ * It is an interchange format that provides insights into documents and allows
+ * for collaboration between users and Document Understanding AI to iterate and
+ * optimize for quality.
+ * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta2.Document} + */ +public final class Document extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta2.Document) + DocumentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Document.newBuilder() to construct. + private Document(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Document() { + mimeType_ = ""; + text_ = ""; + textStyles_ = java.util.Collections.emptyList(); + pages_ = java.util.Collections.emptyList(); + entities_ = java.util.Collections.emptyList(); + entityRelations_ = java.util.Collections.emptyList(); + labels_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Document(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Document( + 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(); + sourceCase_ = 1; + source_ = s; + break; + } + case 18: + { + sourceCase_ = 2; + source_ = input.readBytes(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + mimeType_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + text_ = s; + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + textStyles_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + textStyles_.add( + input.readMessage( + com.google.cloud.documentai.v1beta2.Document.Style.parser(), + extensionRegistry)); + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + pages_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + pages_.add( + input.readMessage( + com.google.cloud.documentai.v1beta2.Document.Page.parser(), + extensionRegistry)); + break; + } + case 58: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + entities_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + entities_.add( + input.readMessage( + com.google.cloud.documentai.v1beta2.Document.Entity.parser(), + extensionRegistry)); + break; + } + case 66: + { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + entityRelations_ = + new java.util.ArrayList< + com.google.cloud.documentai.v1beta2.Document.EntityRelation>(); + mutable_bitField0_ |= 0x00000008; + } + entityRelations_.add( + input.readMessage( + com.google.cloud.documentai.v1beta2.Document.EntityRelation.parser(), + extensionRegistry)); + break; + } + case 74: + { + com.google.cloud.documentai.v1beta2.Document.ShardInfo.Builder subBuilder = null; + if (shardInfo_ != null) { + subBuilder = shardInfo_.toBuilder(); + } + shardInfo_ = + input.readMessage( + com.google.cloud.documentai.v1beta2.Document.ShardInfo.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(shardInfo_); + shardInfo_ = subBuilder.buildPartial(); + } + + break; + } + case 82: + { + 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 90: + { + if (!((mutable_bitField0_ & 0x00000010) != 0)) { + labels_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + labels_.add( + input.readMessage( + com.google.cloud.documentai.v1beta2.Document.Label.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)) { + textStyles_ = java.util.Collections.unmodifiableList(textStyles_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + pages_ = java.util.Collections.unmodifiableList(pages_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + entities_ = java.util.Collections.unmodifiableList(entities_); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + entityRelations_ = java.util.Collections.unmodifiableList(entityRelations_); + } + if (((mutable_bitField0_ & 0x00000010) != 0)) { + labels_ = java.util.Collections.unmodifiableList(labels_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta2.DocumentProto + .internal_static_google_cloud_documentai_v1beta2_Document_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta2.DocumentProto + .internal_static_google_cloud_documentai_v1beta2_Document_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta2.Document.class, + com.google.cloud.documentai.v1beta2.Document.Builder.class); + } + + public interface ShardInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta2.Document.ShardInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The 0-based index of this shard.
+     * 
+ * + * int64 shard_index = 1; + * + * @return The shardIndex. + */ + long getShardIndex(); + + /** + * + * + *
+     * Total number of shards.
+     * 
+ * + * int64 shard_count = 2; + * + * @return The shardCount. + */ + long getShardCount(); + + /** + * + * + *
+     * The index of the first character in [Document.text][google.cloud.documentai.v1beta2.Document.text] in the overall
+     * document global text.
+     * 
+ * + * int64 text_offset = 3; + * + * @return The textOffset. + */ + long getTextOffset(); + } + /** + * + * + *
+   * For a large document, sharding may be performed to produce several
+   * document shards. Each document shard contains this field to detail which
+   * shard it is.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta2.Document.ShardInfo} + */ + public static final class ShardInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta2.Document.ShardInfo) + ShardInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ShardInfo.newBuilder() to construct. + private ShardInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ShardInfo() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ShardInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ShardInfo( + 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: + { + shardIndex_ = input.readInt64(); + break; + } + case 16: + { + shardCount_ = input.readInt64(); + break; + } + case 24: + { + textOffset_ = input.readInt64(); + 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.documentai.v1beta2.DocumentProto + .internal_static_google_cloud_documentai_v1beta2_Document_ShardInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta2.DocumentProto + .internal_static_google_cloud_documentai_v1beta2_Document_ShardInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta2.Document.ShardInfo.class, + com.google.cloud.documentai.v1beta2.Document.ShardInfo.Builder.class); + } + + public static final int SHARD_INDEX_FIELD_NUMBER = 1; + private long shardIndex_; + /** + * + * + *
+     * The 0-based index of this shard.
+     * 
+ * + * int64 shard_index = 1; + * + * @return The shardIndex. + */ + public long getShardIndex() { + return shardIndex_; + } + + public static final int SHARD_COUNT_FIELD_NUMBER = 2; + private long shardCount_; + /** + * + * + *
+     * Total number of shards.
+     * 
+ * + * int64 shard_count = 2; + * + * @return The shardCount. + */ + public long getShardCount() { + return shardCount_; + } + + public static final int TEXT_OFFSET_FIELD_NUMBER = 3; + private long textOffset_; + /** + * + * + *
+     * The index of the first character in [Document.text][google.cloud.documentai.v1beta2.Document.text] in the overall
+     * document global text.
+     * 
+ * + * int64 text_offset = 3; + * + * @return The textOffset. + */ + public long getTextOffset() { + return textOffset_; + } + + 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 (shardIndex_ != 0L) { + output.writeInt64(1, shardIndex_); + } + if (shardCount_ != 0L) { + output.writeInt64(2, shardCount_); + } + if (textOffset_ != 0L) { + output.writeInt64(3, textOffset_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (shardIndex_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, shardIndex_); + } + if (shardCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, shardCount_); + } + if (textOffset_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, textOffset_); + } + 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.documentai.v1beta2.Document.ShardInfo)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta2.Document.ShardInfo other = + (com.google.cloud.documentai.v1beta2.Document.ShardInfo) obj; + + if (getShardIndex() != other.getShardIndex()) return false; + if (getShardCount() != other.getShardCount()) return false; + if (getTextOffset() != other.getTextOffset()) 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) + SHARD_INDEX_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getShardIndex()); + hash = (37 * hash) + SHARD_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getShardCount()); + hash = (37 * hash) + TEXT_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTextOffset()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta2.Document.ShardInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta2.Document.ShardInfo 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.documentai.v1beta2.Document.ShardInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta2.Document.ShardInfo 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.documentai.v1beta2.Document.ShardInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta2.Document.ShardInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta2.Document.ShardInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta2.Document.ShardInfo 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.documentai.v1beta2.Document.ShardInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta2.Document.ShardInfo 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.documentai.v1beta2.Document.ShardInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta2.Document.ShardInfo 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.documentai.v1beta2.Document.ShardInfo 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; + } + /** + * + * + *
+     * For a large document, sharding may be performed to produce several
+     * document shards. Each document shard contains this field to detail which
+     * shard it is.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta2.Document.ShardInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta2.Document.ShardInfo) + com.google.cloud.documentai.v1beta2.Document.ShardInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta2.DocumentProto + .internal_static_google_cloud_documentai_v1beta2_Document_ShardInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta2.DocumentProto + .internal_static_google_cloud_documentai_v1beta2_Document_ShardInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta2.Document.ShardInfo.class, + com.google.cloud.documentai.v1beta2.Document.ShardInfo.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta2.Document.ShardInfo.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(); + shardIndex_ = 0L; + + shardCount_ = 0L; + + textOffset_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta2.DocumentProto + .internal_static_google_cloud_documentai_v1beta2_Document_ShardInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta2.Document.ShardInfo getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta2.Document.ShardInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta2.Document.ShardInfo build() { + com.google.cloud.documentai.v1beta2.Document.ShardInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta2.Document.ShardInfo buildPartial() { + com.google.cloud.documentai.v1beta2.Document.ShardInfo result = + new com.google.cloud.documentai.v1beta2.Document.ShardInfo(this); + result.shardIndex_ = shardIndex_; + result.shardCount_ = shardCount_; + result.textOffset_ = textOffset_; + 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.documentai.v1beta2.Document.ShardInfo) { + return mergeFrom((com.google.cloud.documentai.v1beta2.Document.ShardInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta2.Document.ShardInfo other) { + if (other == com.google.cloud.documentai.v1beta2.Document.ShardInfo.getDefaultInstance()) + return this; + if (other.getShardIndex() != 0L) { + setShardIndex(other.getShardIndex()); + } + if (other.getShardCount() != 0L) { + setShardCount(other.getShardCount()); + } + if (other.getTextOffset() != 0L) { + setTextOffset(other.getTextOffset()); + } + 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.documentai.v1beta2.Document.ShardInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta2.Document.ShardInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long shardIndex_; + /** + * + * + *
+       * The 0-based index of this shard.
+       * 
+ * + * int64 shard_index = 1; + * + * @return The shardIndex. + */ + public long getShardIndex() { + return shardIndex_; + } + /** + * + * + *
+       * The 0-based index of this shard.
+       * 
+ * + * int64 shard_index = 1; + * + * @param value The shardIndex to set. + * @return This builder for chaining. + */ + public Builder setShardIndex(long value) { + + shardIndex_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The 0-based index of this shard.
+       * 
+ * + * int64 shard_index = 1; + * + * @return This builder for chaining. + */ + public Builder clearShardIndex() { + + shardIndex_ = 0L; + onChanged(); + return this; + } + + private long shardCount_; + /** + * + * + *
+       * Total number of shards.
+       * 
+ * + * int64 shard_count = 2; + * + * @return The shardCount. + */ + public long getShardCount() { + return shardCount_; + } + /** + * + * + *
+       * Total number of shards.
+       * 
+ * + * int64 shard_count = 2; + * + * @param value The shardCount to set. + * @return This builder for chaining. + */ + public Builder setShardCount(long value) { + + shardCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Total number of shards.
+       * 
+ * + * int64 shard_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearShardCount() { + + shardCount_ = 0L; + onChanged(); + return this; + } + + private long textOffset_; + /** + * + * + *
+       * The index of the first character in [Document.text][google.cloud.documentai.v1beta2.Document.text] in the overall
+       * document global text.
+       * 
+ * + * int64 text_offset = 3; + * + * @return The textOffset. + */ + public long getTextOffset() { + return textOffset_; + } + /** + * + * + *
+       * The index of the first character in [Document.text][google.cloud.documentai.v1beta2.Document.text] in the overall
+       * document global text.
+       * 
+ * + * int64 text_offset = 3; + * + * @param value The textOffset to set. + * @return This builder for chaining. + */ + public Builder setTextOffset(long value) { + + textOffset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The index of the first character in [Document.text][google.cloud.documentai.v1beta2.Document.text] in the overall
+       * document global text.
+       * 
+ * + * int64 text_offset = 3; + * + * @return This builder for chaining. + */ + public Builder clearTextOffset() { + + textOffset_ = 0L; + 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.documentai.v1beta2.Document.ShardInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta2.Document.ShardInfo) + private static final com.google.cloud.documentai.v1beta2.Document.ShardInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta2.Document.ShardInfo(); + } + + public static com.google.cloud.documentai.v1beta2.Document.ShardInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ShardInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ShardInfo(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.documentai.v1beta2.Document.ShardInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface LabelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta2.Document.Label) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Label is generated AutoML model. This field stores the full resource
+     * name of the AutoML model.
+     * Format:
+     * `projects/{project-id}/locations/{location-id}/models/{model-id}`
+     * 
+ * + * string automl_model = 2; + * + * @return The automlModel. + */ + java.lang.String getAutomlModel(); + /** + * + * + *
+     * Label is generated AutoML model. This field stores the full resource
+     * name of the AutoML model.
+     * Format:
+     * `projects/{project-id}/locations/{location-id}/models/{model-id}`
+     * 
+ * + * string automl_model = 2; + * + * @return The bytes for automlModel. + */ + com.google.protobuf.ByteString getAutomlModelBytes(); + + /** + * + * + *
+     * Name of the label.
+     * When the label is generated from AutoML Text Classification model, this
+     * field represents the name of the category.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+     * Name of the label.
+     * When the label is generated from AutoML Text Classification model, this
+     * field represents the name of the category.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * Confidence score between 0 and 1 for label assignment.
+     * 
+ * + * float confidence = 3; + * + * @return The confidence. + */ + float getConfidence(); + + public com.google.cloud.documentai.v1beta2.Document.Label.SourceCase getSourceCase(); + } + /** + * + * + *
+   * Label attaches schema information and/or other metadata to segments within
+   * a [Document][google.cloud.documentai.v1beta2.Document]. Multiple [Label][google.cloud.documentai.v1beta2.Document.Label]s on a single field can denote either
+   * different labels, different instances of the same label created at
+   * different times, or some combination of both.
+   * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta2.Document.Label} + */ + public static final class Label extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta2.Document.Label) + LabelOrBuilder { + private static final long serialVersionUID = 0L; + // Use Label.newBuilder() to construct. + private Label(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Label() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Label(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Label( + 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(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + sourceCase_ = 2; + source_ = s; + break; + } + case 29: + { + confidence_ = 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.documentai.v1beta2.DocumentProto + .internal_static_google_cloud_documentai_v1beta2_Document_Label_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta2.DocumentProto + .internal_static_google_cloud_documentai_v1beta2_Document_Label_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta2.Document.Label.class, + com.google.cloud.documentai.v1beta2.Document.Label.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + AUTOML_MODEL(2), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(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 SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 2: + return AUTOML_MODEL; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int AUTOML_MODEL_FIELD_NUMBER = 2; + /** + * + * + *
+     * Label is generated AutoML model. This field stores the full resource
+     * name of the AutoML model.
+     * Format:
+     * `projects/{project-id}/locations/{location-id}/models/{model-id}`
+     * 
+ * + * string automl_model = 2; + * + * @return The automlModel. + */ + public java.lang.String getAutomlModel() { + java.lang.Object ref = ""; + if (sourceCase_ == 2) { + ref = source_; + } + 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 (sourceCase_ == 2) { + source_ = s; + } + return s; + } + } + /** + * + * + *
+     * Label is generated AutoML model. This field stores the full resource
+     * name of the AutoML model.
+     * Format:
+     * `projects/{project-id}/locations/{location-id}/models/{model-id}`
+     * 
+ * + * string automl_model = 2; + * + * @return The bytes for automlModel. + */ + public com.google.protobuf.ByteString getAutomlModelBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 2) { + ref = source_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 2) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+     * Name of the label.
+     * When the label is generated from AutoML Text Classification model, this
+     * field represents the name of the category.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + 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; + } + } + /** + * + * + *
+     * Name of the label.
+     * When the label is generated from AutoML Text Classification model, this
+     * field represents the name of the category.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + 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 CONFIDENCE_FIELD_NUMBER = 3; + private float confidence_; + /** + * + * + *
+     * Confidence score between 0 and 1 for label assignment.
+     * 
+ * + * float confidence = 3; + * + * @return The confidence. + */ + public float getConfidence() { + return confidence_; + } + + 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 (sourceCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, source_); + } + if (confidence_ != 0F) { + output.writeFloat(3, confidence_); + } + 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 (sourceCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, source_); + } + if (confidence_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, 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.documentai.v1beta2.Document.Label)) { + return super.equals(obj); + } + com.google.cloud.documentai.v1beta2.Document.Label other = + (com.google.cloud.documentai.v1beta2.Document.Label) obj; + + if (!getName().equals(other.getName())) return false; + if (java.lang.Float.floatToIntBits(getConfidence()) + != java.lang.Float.floatToIntBits(other.getConfidence())) return false; + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 2: + if (!getAutomlModel().equals(other.getAutomlModel())) 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(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidence()); + switch (sourceCase_) { + case 2: + hash = (37 * hash) + AUTOML_MODEL_FIELD_NUMBER; + hash = (53 * hash) + getAutomlModel().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.documentai.v1beta2.Document.Label parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta2.Document.Label 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.documentai.v1beta2.Document.Label parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta2.Document.Label 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.documentai.v1beta2.Document.Label parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.documentai.v1beta2.Document.Label parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.documentai.v1beta2.Document.Label parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta2.Document.Label 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.documentai.v1beta2.Document.Label parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta2.Document.Label 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.documentai.v1beta2.Document.Label parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.documentai.v1beta2.Document.Label 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.documentai.v1beta2.Document.Label 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; + } + /** + * + * + *
+     * Label attaches schema information and/or other metadata to segments within
+     * a [Document][google.cloud.documentai.v1beta2.Document]. Multiple [Label][google.cloud.documentai.v1beta2.Document.Label]s on a single field can denote either
+     * different labels, different instances of the same label created at
+     * different times, or some combination of both.
+     * 
+ * + * Protobuf type {@code google.cloud.documentai.v1beta2.Document.Label} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta2.Document.Label) + com.google.cloud.documentai.v1beta2.Document.LabelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.documentai.v1beta2.DocumentProto + .internal_static_google_cloud_documentai_v1beta2_Document_Label_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.documentai.v1beta2.DocumentProto + .internal_static_google_cloud_documentai_v1beta2_Document_Label_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.documentai.v1beta2.Document.Label.class, + com.google.cloud.documentai.v1beta2.Document.Label.Builder.class); + } + + // Construct using com.google.cloud.documentai.v1beta2.Document.Label.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(); + name_ = ""; + + confidence_ = 0F; + + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.documentai.v1beta2.DocumentProto + .internal_static_google_cloud_documentai_v1beta2_Document_Label_descriptor; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta2.Document.Label getDefaultInstanceForType() { + return com.google.cloud.documentai.v1beta2.Document.Label.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta2.Document.Label build() { + com.google.cloud.documentai.v1beta2.Document.Label result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.documentai.v1beta2.Document.Label buildPartial() { + com.google.cloud.documentai.v1beta2.Document.Label result = + new com.google.cloud.documentai.v1beta2.Document.Label(this); + if (sourceCase_ == 2) { + result.source_ = source_; + } + result.name_ = name_; + result.confidence_ = confidence_; + result.sourceCase_ = sourceCase_; + 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.documentai.v1beta2.Document.Label) { + return mergeFrom((com.google.cloud.documentai.v1beta2.Document.Label) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.documentai.v1beta2.Document.Label other) { + if (other == com.google.cloud.documentai.v1beta2.Document.Label.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getConfidence() != 0F) { + setConfidence(other.getConfidence()); + } + switch (other.getSourceCase()) { + case AUTOML_MODEL: + { + sourceCase_ = 2; + source_ = other.source_; + onChanged(); + break; + } + case SOURCE_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.documentai.v1beta2.Document.Label parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.documentai.v1beta2.Document.Label) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+       * Label is generated AutoML model. This field stores the full resource
+       * name of the AutoML model.
+       * Format:
+       * `projects/{project-id}/locations/{location-id}/models/{model-id}`
+       * 
+ * + * string automl_model = 2; + * + * @return The automlModel. + */ + public java.lang.String getAutomlModel() { + java.lang.Object ref = ""; + if (sourceCase_ == 2) { + ref = source_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (sourceCase_ == 2) { + source_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Label is generated AutoML model. This field stores the full resource
+       * name of the AutoML model.
+       * Format:
+       * `projects/{project-id}/locations/{location-id}/models/{model-id}`
+       * 
+ * + * string automl_model = 2; + * + * @return The bytes for automlModel. + */ + public com.google.protobuf.ByteString getAutomlModelBytes() { + java.lang.Object ref = ""; + if (sourceCase_ == 2) { + ref = source_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCase_ == 2) { + source_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Label is generated AutoML model. This field stores the full resource
+       * name of the AutoML model.
+       * Format:
+       * `projects/{project-id}/locations/{location-id}/models/{model-id}`
+       * 
+ * + * string automl_model = 2; + * + * @param value The automlModel to set. + * @return This builder for chaining. + */ + public Builder setAutomlModel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceCase_ = 2; + source_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Label is generated AutoML model. This field stores the full resource
+       * name of the AutoML model.
+       * Format:
+       * `projects/{project-id}/locations/{location-id}/models/{model-id}`
+       * 
+ * + * string automl_model = 2; + * + * @return This builder for chaining. + */ + public Builder clearAutomlModel() { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Label is generated AutoML model. This field stores the full resource
+       * name of the AutoML model.
+       * Format:
+       * `projects/{project-id}/locations/{location-id}/models/{model-id}`
+       * 
+ * + * string automl_model = 2; + * + * @param value The bytes for automlModel to set. + * @return This builder for chaining. + */ + public Builder setAutomlModelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceCase_ = 2; + source_ = value; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * Name of the label.
+       * When the label is generated from AutoML Text Classification model, this
+       * field represents the name of the category.
+       * 
+ * + * 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; + } + } + /** + * + * + *
+       * Name of the label.
+       * When the label is generated from AutoML Text Classification model, this
+       * field represents the name of the category.
+       * 
+ * + * 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; + } + } + /** + * + * + *
+       * Name of the label.
+       * When the label is generated from AutoML Text Classification model, this
+       * field represents the name of the category.
+       * 
+ * + * 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; + } + /** + * + * + *
+       * Name of the label.
+       * When the label is generated from AutoML Text Classification model, this
+       * field represents the name of the category.
+       * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+       * Name of the label.
+       * When the label is generated from AutoML Text Classification model, this
+       * field represents the name of the category.
+       * 
+ * + * 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 float confidence_; + /** + * + * + *
+       * Confidence score between 0 and 1 for label assignment.
+       * 
+ * + * float confidence = 3; + * + * @return The confidence. + */ + public float getConfidence() { + return confidence_; + } + /** + * + * + *
+       * Confidence score between 0 and 1 for label assignment.
+       * 
+ * + * float confidence = 3; + * + * @param value The confidence to set. + * @return This builder for chaining. + */ + public Builder setConfidence(float value) { + + confidence_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Confidence score between 0 and 1 for label assignment.
+       * 
+ * + * float confidence = 3; + * + * @return This builder for chaining. + */ + public Builder clearConfidence() { + + confidence_ = 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.documentai.v1beta2.Document.Label) + } + + // @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta2.Document.Label) + private static final com.google.cloud.documentai.v1beta2.Document.Label DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta2.Document.Label(); + } + + public static com.google.cloud.documentai.v1beta2.Document.Label getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser